diff --git a/.github/workflows/script_build.yml b/.github/workflows/script_build.yml index 7b80c5b..59a927f 100644 --- a/.github/workflows/script_build.yml +++ b/.github/workflows/script_build.yml @@ -21,13 +21,14 @@ jobs: - name: Setup Node uses: actions/setup-node@v5.0.0 with: - node-version: 22 + node-version: 24 + cache: pnpm - name: Install dependencies - run: cd script && npm install + run: cd script && pnpm install - name: Build - run: cd script && npm run build + run: cd script && pnpm run build - name: Upload artifact uses: actions/upload-artifact@v4.6.2 diff --git a/script/package-lock.json b/script/package-lock.json deleted file mode 100644 index 93f8965..0000000 --- a/script/package-lock.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "todo_script", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "todo_script", - "version": "1.0.0", - "license": "GPL-3.0-only", - "devDependencies": { - "@types/node": "^22.13.4", - "typescript": "^5.7.3" - } - }, - "node_modules/@types/node": { - "version": "22.18.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.18.8.tgz", - "integrity": "sha512-pAZSHMiagDR7cARo/cch1f3rXy0AEXwsVsVH09FcyeJVAzCnGgmYis7P3JidtTUjyadhTeSo8TgRPswstghDaw==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.21.0" - } - }, - "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undici-types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", - "dev": true, - "license": "MIT" - } - } -} diff --git a/script/package.json b/script/package.json index dec3ba2..23ea8e3 100644 --- a/script/package.json +++ b/script/package.json @@ -10,7 +10,7 @@ "replace": "tsc updateVersionCode.ts && node updateVersionCode.js" }, "devDependencies": { - "@types/node": "^22.13.4", - "typescript": "^5.7.3" + "@types/node": "^24.6.2", + "typescript": "^5.9.3" } } diff --git a/script/pnpm-lock.yaml b/script/pnpm-lock.yaml new file mode 100644 index 0000000..fad061e --- /dev/null +++ b/script/pnpm-lock.yaml @@ -0,0 +1,39 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@types/node': + specifier: ^24.6.2 + version: 24.6.2 + typescript: + specifier: ^5.9.3 + version: 5.9.3 + +packages: + + '@types/node@24.6.2': + resolution: {integrity: sha512-d2L25Y4j+W3ZlNAeMKcy7yDsK425ibcAOO2t7aPTz6gNMH0z2GThtwENCDc0d/Pw9wgyRqE5Px1wkV7naz8ang==} + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + + undici-types@7.13.0: + resolution: {integrity: sha512-Ov2Rr9Sx+fRgagJ5AX0qvItZG/JKKoBRAVITs1zk7IqZGTJUwgUr7qoYBpWwakpWilTZFM98rG/AFRocu10iIQ==} + +snapshots: + + '@types/node@24.6.2': + dependencies: + undici-types: 7.13.0 + + typescript@5.9.3: {} + + undici-types@7.13.0: {} diff --git a/script/updateVersionCode.ts b/script/updateVersionCode.ts index 0beb0ef..3d86f54 100644 --- a/script/updateVersionCode.ts +++ b/script/updateVersionCode.ts @@ -7,7 +7,7 @@ exec("git rev-list --count HEAD", (err, versionCode, stderr) => { return; } - const filePath = "./app/build.gradle.kts" + const filePath = "./app/build.gradle.kts"; try { const data = readFileSync(filePath, "utf-8"); const regex = /(?<=versionCode\s*=\s*)\d+/; @@ -15,7 +15,9 @@ exec("git rev-list --count HEAD", (err, versionCode, stderr) => { const newString = data.replace(regex, versionCode.trim()); try { writeFileSync(filePath, newString); - console.log(`版本号更新完成,已由 ${oldVerionCode} 更新至 ${versionCode}`); + console.log( + `版本号更新完成,已由 ${oldVerionCode} 更新至 ${versionCode}` + ); process.exit(0); } catch (e) { console.log(e); @@ -23,4 +25,4 @@ exec("git rev-list --count HEAD", (err, versionCode, stderr) => { } catch (e) { console.log(e); } -}); \ No newline at end of file +});