From fd61af5095daf5f3f84ba5b32b08db0784b55335 Mon Sep 17 00:00:00 2001 From: Virgil Clyne Date: Sat, 26 Oct 2024 22:09:35 +0800 Subject: [PATCH] chore: @nsnanocat/util --- .github/workflows/build.yml | 2 ++ .github/workflows/dev.yml | 2 ++ .gitmodules | 3 -- .npmrc | 2 ++ CHANGELOG.md | 4 +-- arguments-builder.config.ts | 4 +++ package-lock.json | 60 ++++++++++++++++++++++------------ package.json | 3 +- src/Microsoft.Translate.dev.js | 2 +- src/Microsoft.Translate.js | 2 +- src/function/setENV.mjs | 3 +- src/utils | 1 - 12 files changed, 56 insertions(+), 32 deletions(-) create mode 100644 .npmrc delete mode 160000 src/utils diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5c94b8..c022cec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,8 @@ jobs: cache: 'npm' - name: Install dependencies run: npm install + env: + NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_TOKEN }} - name: Update local package.json version from release tag if: github.ref_type == 'tag' uses: BellCubeDev/update-package-version-by-release-tag@v2 diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index a75d396..aab5099 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -24,6 +24,8 @@ jobs: cache: 'npm' - name: Install dependencies run: npm install + env: + NODE_AUTH_TOKEN: ${{ secrets.PACKAGE_TOKEN }} - name: Build run: npm run build:dev - name: Upload artifact diff --git a/.gitmodules b/.gitmodules index 868a2ec..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "src/utils"] - path = src/utils - url = https://github.com/NanoCat-Me/utils.git diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..3ba43c1 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +@nsnanocat:registry=https://npm.pkg.github.com +//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN} diff --git a/CHANGELOG.md b/CHANGELOG.md index 51c8c89..7bdfcb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,2 @@ -### 🛠️ Bug Fixes - * 修复 `Surge` 模块内置`参数面板` +### 🔄 Other Changes + * util 由 `submodule` 更改为 `package` diff --git a/arguments-builder.config.ts b/arguments-builder.config.ts index ddc978b..0d64788 100644 --- a/arguments-builder.config.ts +++ b/arguments-builder.config.ts @@ -17,6 +17,10 @@ export default defineConfig({ path: "./dist/Microsoft.Translate.yaml", template: "./template/egern.handlebars", }, + { + path: "./dist/Microsoft.Translate.srmodule", + template: "./template/shadowrocket.handlebars", + }, ], dts: { isExported: true, diff --git a/package-lock.json b/package-lock.json index 5475dc9..c1930dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,18 @@ { "name": "@dualsubs/addon", - "version": "1.0.1", + "version": "1.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dualsubs/addon", - "version": "1.0.1", + "version": "1.0.3", "license": "Apache-2.0", "devDependencies": { "@biomejs/biome": "^1.9.4", "@iringo/arguments-builder": "^1.7.8", "@iringo/sgmoudle-tools": "^1.2.2", + "@nsnanocat/util": "^1.3.2", "@rspack/cli": "^1.0.13", "@rspack/core": "^1.0.13", "node-polyfill-webpack-plugin": "^4.0.0" @@ -469,6 +470,16 @@ "node": ">= 8" } }, + "node_modules/@nsnanocat/util": { + "version": "1.3.2", + "resolved": "https://npm.pkg.github.com/download/@nsnanocat/util/1.3.2/57b2c8a122e1ae3c749ade9cd2b6f9810f621a2c", + "integrity": "sha512-QV1nm0FJNH5BP8jja3rzrmbq7hB3mt4OOkzEsDnHrXCeOu2lTqxTeVZdL09jAfA8YvxTfHa5lb15n8YaqxqLtw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "pako": "^2.1.0" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -797,9 +808,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.0.tgz", - "integrity": "sha512-AbXMTZGt40T+KON9/Fdxx0B2WK5hsgxcfXJLr5bFpZ7b4JCex2WyQPTEKdXqfHiY5nKKBScZ7yCoO6Pvgxfvnw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.1.tgz", + "integrity": "sha512-CRICJIl0N5cXDONAdlTv5ShATZ4HEwk6kDDIW2/w9qOWKg+NU/5F8wYRWCrONad0/UKkloNSmmyN/wX4rtpbVA==", "dev": true, "license": "MIT", "dependencies": { @@ -854,13 +865,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.7.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.9.tgz", - "integrity": "sha512-jrTfRC7FM6nChvU7X2KqcrgquofrWLFDeYC1hKfwNWomVvrn7JIksqf344WN2X/y8xrgqBd2dJATZV4GbatBfg==", + "version": "22.8.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.8.1.tgz", + "integrity": "sha512-k6Gi8Yyo8EtrNtkHXutUu2corfDf9su95VYVP10aGYMMROM6SAItZi0w1XszA6RtWTHSVp5OeFof37w0IEqCQg==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~6.19.2" + "undici-types": "~6.19.8" } }, "node_modules/@types/node-forge": { @@ -1644,6 +1655,13 @@ "pako": "~1.0.5" } }, + "node_modules/browserify-zlib/node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true, + "license": "(MIT AND Zlib)" + }, "node_modules/browserslist": { "version": "4.24.2", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.2.tgz", @@ -1772,9 +1790,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001669", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz", - "integrity": "sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w==", + "version": "1.0.30001671", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001671.tgz", + "integrity": "sha512-jocyVaSSfXg2faluE6hrWkMgDOiULBMca4QLtDT39hw1YxaIPHWc1CcTCKkPmHgGH6tKji6ZNbMSmUAvENf2/A==", "dev": true, "funding": [ { @@ -2418,17 +2436,17 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.43", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.43.tgz", - "integrity": "sha512-NxnmFBHDl5Sachd2P46O7UJiMaMHMLSofoIWVJq3mj8NJgG0umiSeljAVP9lGzjI0UDLJJ5jjoGjcrB8RSbjLQ==", + "version": "1.5.47", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.47.tgz", + "integrity": "sha512-zS5Yer0MOYw4rtK2iq43cJagHZ8sXN0jDHDKzB+86gSBSAI4v07S97mcq+Gs2vclAxSh1j7vOAHxSVgduiiuVQ==", "dev": true, "license": "ISC", "peer": true }, "node_modules/elliptic": { - "version": "6.5.7", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", - "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.0.tgz", + "integrity": "sha512-dpwoQcLc/2WLQvJvLRHKZ+f9FgOdjnq11rurqwekGQygGPsYSK29OMMD2WalatiqQ+XGFDglTNixpPfI+lpaAA==", "dev": true, "license": "MIT", "dependencies": { @@ -4260,9 +4278,9 @@ "license": "BlueOak-1.0.0" }, "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", + "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==", "dev": true, "license": "(MIT AND Zlib)" }, diff --git a/package.json b/package.json index 6d18c33..f804c2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dualsubs/addon", - "version": "1.0.2", + "version": "1.0.3", "organizationName": "🍿️ DualSubs", "displayName": "🍿️ DualSubs: ➕ AddOn", "description": "DualSubs 额外插件", @@ -40,6 +40,7 @@ "@biomejs/biome": "^1.9.4", "@iringo/arguments-builder": "^1.7.8", "@iringo/sgmoudle-tools": "^1.2.2", + "@nsnanocat/util": "^1.3.2", "@rspack/cli": "^1.0.13", "@rspack/core": "^1.0.13", "node-polyfill-webpack-plugin": "^4.0.0" diff --git a/src/Microsoft.Translate.dev.js b/src/Microsoft.Translate.dev.js index 9a1ab8c..2326d00 100644 --- a/src/Microsoft.Translate.dev.js +++ b/src/Microsoft.Translate.dev.js @@ -1,4 +1,4 @@ -import { $platform, URL, _, Storage, fetch, notification, log, logError, wait, done, getScript, runScript } from "./utils/utils.mjs"; +import { $platform, Lodash as _, URL, Storage, fetch, notification, log, logError, wait, done, getScript, runScript } from "@nsnanocat/util"; import database from "./function/database.mjs"; import setENV from "./function/setENV.mjs"; const $request = { diff --git a/src/Microsoft.Translate.js b/src/Microsoft.Translate.js index 9a1ab8c..2326d00 100644 --- a/src/Microsoft.Translate.js +++ b/src/Microsoft.Translate.js @@ -1,4 +1,4 @@ -import { $platform, URL, _, Storage, fetch, notification, log, logError, wait, done, getScript, runScript } from "./utils/utils.mjs"; +import { $platform, Lodash as _, URL, Storage, fetch, notification, log, logError, wait, done, getScript, runScript } from "@nsnanocat/util"; import database from "./function/database.mjs"; import setENV from "./function/setENV.mjs"; const $request = { diff --git a/src/function/setENV.mjs b/src/function/setENV.mjs index 37ac198..13ad1a2 100644 --- a/src/function/setENV.mjs +++ b/src/function/setENV.mjs @@ -1,5 +1,4 @@ -import getStorage from '../utils/getStorage.mjs' -import { _, log } from "../utils/utils.mjs"; +import { Lodash as _, getStorage, log } from "@nsnanocat/util"; /** * Set Environment Variables diff --git a/src/utils b/src/utils deleted file mode 160000 index 40e91e8..0000000 --- a/src/utils +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 40e91e80011968370ba7ef400ff768dabf5cf583