refactor(script): 更换包管理器到pnpm

This commit is contained in:
Super12138 2025-10-02 10:19:13 +08:00
parent 62619a7c2a
commit 4eeab85689
5 changed files with 50 additions and 56 deletions

View file

@ -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

View file

@ -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"
}
}
}

View file

@ -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"
}
}

39
script/pnpm-lock.yaml Normal file
View file

@ -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: {}

View file

@ -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);
}
});
});