Upgrade Packages

This commit is contained in:
johnathan 2025-07-04 17:43:00 +08:00
parent a883f49d53
commit 5efc112f4b
12 changed files with 3528 additions and 3503 deletions

View File

@ -17,10 +17,7 @@
"build:background": "vite build --config vite.config.background.mts", "build:background": "vite build --config vite.config.background.mts",
"build:web": "vite build", "build:web": "vite build",
"build:js": "vite build --config vite.config.content.mts", "build:js": "vite build --config vite.config.content.mts",
"pack": "cross-env NODE_ENV=production run-p pack:*", "pack:7z": "rimraf --glob ./build/*.7z && 7z a ./build/extension.7z extension/* && 7z a ./build/extension-firefox.7z extension-firefox/*",
"pack:zip": "rimraf extension.zip && jszip-cli add extension/* -o ./extension.zip",
"pack:crx": "crx pack extension -o ./extension.crx",
"pack:xpi": "cross-env WEB_EXT_ARTIFACTS_DIR=./ web-ext build --source-dir ./extension-firefox --filename extension.xpi --overwrite-dest",
"start:chromium": "web-ext run --source-dir ./extension --target=chromium --chromium-binary 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'", "start:chromium": "web-ext run --source-dir ./extension --target=chromium --chromium-binary 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'",
"start:firefox": "web-ext run --source-dir ./extension-firefox --target=firefox-desktop", "start:firefox": "web-ext run --source-dir ./extension-firefox --target=firefox-desktop",
"clear": "rimraf --glob extension/dist extension/manifest.json extension.* ", "clear": "rimraf --glob extension/dist extension/manifest.json extension.* ",
@ -30,19 +27,18 @@
"prepare": "husky" "prepare": "husky"
}, },
"devDependencies": { "devDependencies": {
"@ffflorian/jszip-cli": "^3.8.2",
"@iconify/json": "^2.2.293", "@iconify/json": "^2.2.293",
"@types/fs-extra": "^11.0.4", "@types/fs-extra": "^11.0.4",
"@types/node": "^22.10.5", "@types/node": "^22.14.0",
"@types/webextension-polyfill": "^0.12.3", "@types/webextension-polyfill": "^0.12.3",
"@vitejs/plugin-vue": "^5.2.1", "@types/gulp-terser": "^1.2.6",
"@vitejs/plugin-vue-jsx": "^4.2.0", "@vitejs/plugin-vue": "^6.0.0",
"@vitejs/plugin-vue-jsx": "^5.0.1",
"@vue/test-utils": "^2.4.6", "@vue/test-utils": "^2.4.6",
"@vueuse/core": "^12.3.0", "@vueuse/core": "^12.3.0",
"alova": "^3.3.4", "alova": "^3.3.4",
"chokidar": "^4.0.3", "chokidar": "^4.0.3",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"crx": "^5.0.1",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"emittery": "^1.1.0", "emittery": "^1.1.0",
"esno": "^4.8.0", "esno": "^4.8.0",
@ -62,7 +58,7 @@
"unplugin-auto-import": "^19.1.2", "unplugin-auto-import": "^19.1.2",
"unplugin-icons": "^22.1.0", "unplugin-icons": "^22.1.0",
"unplugin-vue-components": "^28.4.1", "unplugin-vue-components": "^28.4.1",
"vite": "^6.2.4", "vite": "^7.0.2",
"vitest": "^3.1.1", "vitest": "^3.1.1",
"vue": "^3.5.13", "vue": "^3.5.13",
"vue-demi": "^0.14.10", "vue-demi": "^0.14.10",

961
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
import fs from 'fs-extra'; import fs from 'fs-extra';
import { isDev, isFirefox, log, outputDir, port, r } from './utils'; import { isDev, isFirefox, log, outputDir, port, r } from './utils.js';
import { type Manifest } from 'webextension-polyfill'; import { type Manifest } from 'webextension-polyfill';
import type PkgType from '../package.json'; import type PkgType from '../package.json';
@ -54,7 +54,9 @@ async function getManifest() {
// add content security policy // add content security policy
if (isFirefox) { if (isFirefox) {
manifest.content_security_policy = `script-src 'self' http://localhost:${port}; object-src 'self';`; manifest.content_security_policy = isDev
? `script-src 'self' http://localhost:${port}; object-src 'self';`
: `script-src 'self'; object-src 'self';`;
} else { } else {
manifest.content_security_policy = { manifest.content_security_policy = {
extension_pages: isDev extension_pages: isDev

View File

@ -2,7 +2,7 @@
import { execSync } from 'node:child_process'; import { execSync } from 'node:child_process';
import fs from 'fs-extra'; import fs from 'fs-extra';
import chokidar from 'chokidar'; import chokidar from 'chokidar';
import { isDev, log, outputDir, port, r } from './utils'; import { isDev, log, outputDir, port, r } from './utils.js';
/** /**
* Stub index.html to use Vite in development * Stub index.html to use Vite in development

View File

@ -22,12 +22,12 @@ watch(currentUrl, (newVal) => {
const url = new URL(newVal); const url = new URL(newVal);
switch (url.hostname) { switch (url.hostname) {
case 'www.amazon.com': case 'www.amazon.com':
router.push('/amazon');
site.value = 'amazon'; site.value = 'amazon';
router.push({ path: '/amazon' });
break; break;
case 'www.homedepot.com': case 'www.homedepot.com':
router.push('/homedepot');
site.value = 'homedepot'; site.value = 'homedepot';
router.push({ path: '/homedepot' });
break; break;
default: default:
break; break;

View File

@ -1,13 +1,14 @@
{ {
"compilerOptions": { "compilerOptions": {
"incremental": false, "incremental": false,
"useDefineForClassFields": false, // Could **not** be true because of vue-router
"target": "es2016", "target": "es2016",
"jsx": "preserve", "jsx": "preserve",
"jsxImportSource": "vue", "jsxImportSource": "vue",
"lib": ["DOM", "ESNext"], "lib": ["DOM", "ESNext"],
"baseUrl": ".", "baseUrl": ".",
"module": "ESNext", "module": "esnext",
"moduleResolution": "node", "moduleResolution": "node10",
"paths": { "paths": {
"~/*": ["src/*"] "~/*": ["src/*"]
}, },
@ -19,5 +20,6 @@
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"skipLibCheck": true "skipLibCheck": true
}, },
"exclude": ["dist", "node_modules"] "references": [{ "path": "tsconfig.node.json" }],
"include": ["*.d.ts", "src/**/*"]
} }

11
tsconfig.node.json Normal file
View File

@ -0,0 +1,11 @@
{
"compilerOptions": {
"composite": true,
"module": "node16",
"moduleResolution": "node16",
"types": ["vite/client"],
"resolveJsonModule": true,
"baseUrl": "."
},
"include": ["vite.config.*", "scripts/*"]
}

View File

@ -1,6 +1,6 @@
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
import { sharedConfig } from './vite.config.mjs'; import { sharedConfig } from './vite.config.mjs';
import { isDev, outputDir, r } from './scripts/utils'; import { isDev, outputDir, r } from './scripts/utils.js';
import packageJson from './package.json'; import packageJson from './package.json';
// bundling the content script using Vite // bundling the content script using Vite

View File

@ -1,6 +1,6 @@
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
import { sharedConfig } from './vite.config.mjs'; import { sharedConfig } from './vite.config.mjs';
import { isDev, outputDir, r } from './scripts/utils'; import { isDev, outputDir, r } from './scripts/utils.js';
import packageJson from './package.json'; import packageJson from './package.json';
// bundling the content script using Vite // bundling the content script using Vite

View File

@ -10,8 +10,7 @@ import IconsResolver from 'unplugin-icons/resolver';
import Components from 'unplugin-vue-components/vite'; import Components from 'unplugin-vue-components/vite';
import AutoImport from 'unplugin-auto-import/vite'; import AutoImport from 'unplugin-auto-import/vite';
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'; import { NaiveUiResolver } from 'unplugin-vue-components/resolvers';
import { isDev, outputDir, port, r } from './scripts/utils.js';
import { isDev, outputDir, port, r } from './scripts/utils';
import packageJson from './package.json'; import packageJson from './package.json';
export const sharedConfig: UserConfig = { export const sharedConfig: UserConfig = {

View File

@ -22,7 +22,7 @@
}, },
"author": "Neek Sandhu <neek.sandhu@outlook.com>", "author": "Neek Sandhu <neek.sandhu@outlook.com>",
"scripts": { "scripts": {
"build": "tsup src/index.ts src/background.ts src/content-script.ts src/devtools.ts src/options.ts src/popup.ts src/window.ts src/sidepanel.ts --format esm,cjs --dts", "build": "tsup src/index.ts src/background.ts src/content-script.ts src/devtools.ts src/options.ts src/popup.ts src/window.ts src/sidepanel.ts --format esm --dts",
"watch": "npm run build -- --watch", "watch": "npm run build -- --watch",
"release": "bumpp --commit --push --tag && npm run build && npm publish" "release": "bumpp --commit --push --tag && npm run build && npm publish"
}, },
@ -99,21 +99,21 @@
}, },
"homepage": "https://github.com/zikaari/webext-bridge#readme", "homepage": "https://github.com/zikaari/webext-bridge#readme",
"dependencies": { "dependencies": {
"@types/webextension-polyfill": "^0.8.3", "@types/webextension-polyfill": "^0.12.3",
"nanoevents": "^6.0.2", "nanoevents": "^9.1.0",
"serialize-error": "^9.0.0", "serialize-error": "^12.0.0",
"tiny-uid": "^1.1.1", "tiny-uid": "^1.1.2",
"webextension-polyfill": "^0.9.0" "webextension-polyfill": "^0.12.0"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^0.16.1", "@antfu/eslint-config": "^4.16.2",
"@types/node": "^17.0.16", "@types/node": "^22.14.0",
"@typescript-eslint/eslint-plugin": "^5.11.0", "@typescript-eslint/eslint-plugin": "^8.35.1",
"@typescript-eslint/parser": "^5.11.0", "@typescript-eslint/parser": "^8.35.1",
"bumpp": "^7.1.1", "bumpp": "^10.2.0",
"eslint": "^8.8.0", "eslint": "^9.30.1",
"tsup": "^5.11.13", "tsup": "^8.5.0",
"type-fest": "^2.11.1", "type-fest": "^4.41.0",
"typescript": "^4.5.5" "typescript": "^5.8.3"
} }
} }

File diff suppressed because it is too large Load Diff