From e487d49aef4c680b2160f50c01eac21573e1906b Mon Sep 17 00:00:00 2001 From: Anush Date: Sat, 3 Jun 2023 06:41:40 +0530 Subject: [PATCH 1/3] fix: undefined version config --- src/pages/help.tsx | 2 +- src/vite-env.d.ts | 3 +-- vite.config.ts | 5 +---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/pages/help.tsx b/src/pages/help.tsx index ef20c60e..8dd72d80 100644 --- a/src/pages/help.tsx +++ b/src/pages/help.tsx @@ -7,7 +7,7 @@ import { } from "react-icons/hi2"; import { goBack } from "react-chrome-extension-router"; import { VscIssues } from "react-icons/vsc"; -const { version } = config; +import { version } from "../../package.json"; const Help = () => (
diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index f12ad48d..151aa685 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -1,2 +1 @@ -/// -declare var config: Record; \ No newline at end of file +/// \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index 346c10a8..9b1adf7a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,8 +5,5 @@ import manifest from "./manifest.json" assert { type: "json" }; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [react(), crx({ manifest })], - define: { - 'config.version': JSON.stringify(process.env.npm_package_version), -} + plugins: [react(), crx({ manifest })] }); From 246ce4d9ca059302cbc975ebd2519b8318f8a85d Mon Sep 17 00:00:00 2001 From: Anush Date: Sat, 3 Jun 2023 07:21:57 +0530 Subject: [PATCH 2/3] chore: lint fix --- src/content-scripts/github.ts | 2 +- src/pages/help.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content-scripts/github.ts b/src/content-scripts/github.ts index c154de7c..10f84148 100644 --- a/src/content-scripts/github.ts +++ b/src/content-scripts/github.ts @@ -60,7 +60,7 @@ void processGithubPage(); chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => { switch (msg.type) { case "get_highlight": { - const title = (document.querySelector(".js-issue-title.markdown-title") as HTMLHeadingElement)?.innerText; + const title = (document.querySelector(".js-issue-title.markdown-title")!).innerText; sendResponse(title); break; diff --git a/src/pages/help.tsx b/src/pages/help.tsx index 8dd72d80..bf51907f 100644 --- a/src/pages/help.tsx +++ b/src/pages/help.tsx @@ -7,7 +7,7 @@ import { } from "react-icons/hi2"; import { goBack } from "react-chrome-extension-router"; import { VscIssues } from "react-icons/vsc"; -import { version } from "../../package.json"; +import { version } from "../../package.json"; const Help = () => (
From 7b20f6cd1d974e93d36a5a433f8620417fc3dfae Mon Sep 17 00:00:00 2001 From: Anush Date: Sat, 3 Jun 2023 07:27:21 +0530 Subject: [PATCH 3/3] chore: revert auto-lint fix change --- src/content-scripts/github.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content-scripts/github.ts b/src/content-scripts/github.ts index 10f84148..1519efe4 100644 --- a/src/content-scripts/github.ts +++ b/src/content-scripts/github.ts @@ -60,7 +60,7 @@ void processGithubPage(); chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => { switch (msg.type) { case "get_highlight": { - const title = (document.querySelector(".js-issue-title.markdown-title")!).innerText; + const title = (document.querySelector(".js-issue-title.markdown-title") as HTMLHeadingElement).innerText; sendResponse(title); break;