Skip to content

Commit b7a1977

Browse files
committed
fix: 🐛 #267
1 parent 0583fe9 commit b7a1977

File tree

13 files changed

+279
-552
lines changed

13 files changed

+279
-552
lines changed

define.config.mjs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,24 @@ const gitCommit = spawnSync("git", ["rev-parse", "--short", "HEAD"])
1010
.stdout.toString()
1111
.trim()
1212

13-
const jsn = (value) => JSON.stringify(value)
14-
1513
// Don't forget to add your added variables to vite-env.d.ts also!
1614

1715
// These variables are available in your Vue components and will be replaced by their values at build time.
1816
// These will be compiled into your app. Don't store secrets here!
1917

20-
export const defineViteConfig = {
21-
__VERSION__: jsn(packageJson.version),
22-
__NAME__: jsn(packageJson.name),
23-
__DISPLAY_NAME__: jsn(packageJson.displayName),
24-
__CHANGELOG__: jsn(changelog),
25-
__GIT_COMMIT__: jsn(gitCommit),
26-
__GITHUB_URL__: jsn(packageJson.repository.url),
27-
// Set the HTML title for all pages from package.json so you can use %HTML_TITLE% in your HTML files.
28-
HTML_TITLE: jsn(packageJson.displayName),
18+
const raw = {
19+
VERSION: packageJson.version,
20+
NAME: packageJson.name,
21+
DISPLAY_NAME: packageJson.displayName,
22+
CHANGELOG: changelog,
23+
GIT_COMMIT: gitCommit,
24+
GITHUB_URL: packageJson.repository.url,
25+
// Set the HTML title for all pages from package.json so you can use %HTMLTITLE% in your HTML files.
26+
HTML_TITLE: packageJson.displayName,
2927
}
28+
29+
const define = Object.fromEntries(
30+
Object.entries(raw).map(([k, v]) => [`__${ k }__`, JSON.stringify(v)])
31+
)
32+
33+
export { raw, define }

eslint.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { includeIgnoreFile } from "@eslint/compat"
66
import path from "node:path"
77
import { fileURLToPath } from "node:url"
88
import AutoImportGlobals from "./src/types/.eslintrc-auto-import.json" with { type: "json" }
9-
import { defineViteConfig as viteDefineVariable } from "./define.config.mjs"
9+
import define from "./define.config.mjs"
1010

1111
const __filename = fileURLToPath(import.meta.url)
1212
const __dirname = path.dirname(__filename)
1313
const gitignorePath = path.resolve(__dirname, ".gitignore")
14-
const viteDefineGlobals = Object.keys(viteDefineVariable).reduce((acc, key) => {
14+
const viteDefineGlobals = Object.keys(define).reduce((acc, key) => {
1515
acc[key] = "readonly"
1616
return acc
1717
}, {})

package.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"dependencies": {
33
"@nuxt/ui": "^3.1.0",
4-
"marked": "^15.0.10",
4+
"marked": "^15.0.11",
55
"pinia": "^3.0.2",
66
"vue": "^3.5.13",
77
"vue-i18n": "^11.1.3",
8-
"vue-router": "^4.5.0",
8+
"vue-router": "^4.5.1",
99
"webextension-polyfill": "^0.12.0"
1010
},
1111
"description": "A Vue 3 + Vite project for building Chrome extensions",
@@ -19,33 +19,32 @@
1919
"@intlify/unplugin-vue-i18n": "^6.0.8",
2020
"@tailwindcss/typography": "^0.5.16",
2121
"@types/eslint": "^9.6.1",
22-
"@types/node": "^22.14.1",
22+
"@types/node": "^22.15.3",
2323
"@types/webextension-polyfill": "^0.12.3",
2424
"@vitejs/plugin-vue": "^5.2.3",
2525
"@vue/compiler-sfc": "^3.5.13",
2626
"@vueuse/core": "^13.1.0",
2727
"chalk": "^5.4.1",
28-
"chrome-types": "^0.1.347",
28+
"chrome-types": "^0.1.349",
2929
"commander": "^13.1.0",
3030
"concurrently": "^9.1.2",
3131
"cross-env": "^7.0.3",
3232
"dotenv": "^16.5.0",
3333
"eslint": "^9.25.1",
34-
"eslint-plugin-vue": "^10.0.0",
34+
"eslint-plugin-vue": "^10.1.0",
3535
"get-installed-browsers": "^0.1.7",
3636
"globals": "^16.0.0",
3737
"prettier": "^3.5.3",
3838
"sass": "^1.87.0",
3939
"terser": "^5.39.0",
40-
"tsx": "^4.19.3",
40+
"tsx": "^4.19.4",
4141
"typescript": "^5.8.3",
42-
"typescript-eslint": "^8.31.0",
42+
"typescript-eslint": "^8.31.1",
4343
"unplugin-imagemin": "^0.6.7",
4444
"unplugin-turbo-console": "^2.1.3",
4545
"unplugin-vue-router": "^0.12.0",
46-
"vite": "^6.3.3",
47-
"vite-plugin-html": "^3.2.2",
48-
"vite-plugin-vue-devtools": "^7.7.5",
46+
"vite": "^6.3.4",
47+
"vite-plugin-vue-devtools": "^7.7.6",
4948
"vite-plugin-zip-pack": "^1.2.4",
5049
"vue-tsc": "^2.2.10",
5150
"vuefire": "^3.2.1",

0 commit comments

Comments
 (0)