xi-create 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xi-create",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "一个用于创建项目的命令行工具",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./bin/xi-create.js",
|
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
|
-
"start": "node ./bin/xi-create.js"
|
|
12
|
+
"start": "node ./bin/xi-create.js",
|
|
13
|
+
"release:patch": "pnpm version patch && git push --follow-tags",
|
|
14
|
+
"release:minor": "pnpm version minor && git push --follow-tags",
|
|
15
|
+
"release:major": "pnpm version major && git push --follow-tags",
|
|
16
|
+
"verify:version-tag": "node ./scripts/verify-version-tag.mjs"
|
|
13
17
|
},
|
|
14
18
|
"keywords": [
|
|
15
19
|
"cli",
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* 校验 package.json 的 version 与 git tag 是否一致。
|
|
4
|
+
*
|
|
5
|
+
* 用法:
|
|
6
|
+
* node scripts/verify-version-tag.mjs # HEAD 在某一 tag 上时,校验该 tag 是否为 v${version}
|
|
7
|
+
* npm run verify:version-tag -- v1.2.3 # 显式传入即将推送的 tag 名
|
|
8
|
+
*/
|
|
9
|
+
import { readFileSync } from 'node:fs';
|
|
10
|
+
import { dirname, join } from 'node:path';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
import { execSync } from 'node:child_process';
|
|
13
|
+
|
|
14
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
15
|
+
const pkg = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'));
|
|
16
|
+
const expected = `v${pkg.version}`;
|
|
17
|
+
|
|
18
|
+
const args = process.argv.slice(2).filter((a) => a !== '--');
|
|
19
|
+
const arg = args[0];
|
|
20
|
+
if (arg) {
|
|
21
|
+
if (arg !== expected) {
|
|
22
|
+
console.error(
|
|
23
|
+
`错误: tag "${arg}" 与 package.json 的 version "${pkg.version}" 不一致,应为 ${expected}`,
|
|
24
|
+
);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
console.log(`OK: ${arg} 与 package.json 一致`);
|
|
28
|
+
process.exit(0);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let tag;
|
|
32
|
+
try {
|
|
33
|
+
tag = execSync('git describe --tags --exact-match HEAD', {
|
|
34
|
+
cwd: root,
|
|
35
|
+
encoding: 'utf8',
|
|
36
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
37
|
+
}).trim();
|
|
38
|
+
} catch {
|
|
39
|
+
console.log(
|
|
40
|
+
'当前提交不在精确 tag 上。推送 tag 前可执行: npm run verify:version-tag -- vx.y.z',
|
|
41
|
+
);
|
|
42
|
+
process.exit(0);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (tag !== expected) {
|
|
46
|
+
console.error(
|
|
47
|
+
`错误: 当前 tag "${tag}" 与 package.json 的 version "${pkg.version}"(期望 ${expected})不一致`,
|
|
48
|
+
);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
console.log(`OK: ${tag} 与 package.json 一致`);
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@tailwindcss/vite": "^4.2.2",
|
|
15
|
-
"@xiping/react-components": "^1.0.
|
|
15
|
+
"@xiping/react-components": "^1.0.78",
|
|
16
16
|
"@zumer/snapdom": "^2.7.0",
|
|
17
17
|
"ahooks": "^3.9.7",
|
|
18
18
|
"axios": "^1.14.0",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"react-dom": "^19.2.4",
|
|
29
29
|
"react-dropzone": "^15.0.0",
|
|
30
30
|
"react-hot-toast": "^2.6.0",
|
|
31
|
-
"react-router-dom": "^7.
|
|
31
|
+
"react-router-dom": "^7.14.0",
|
|
32
32
|
"zustand": "^5.0.12"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@eslint/js": "^9.39.4",
|
|
36
36
|
"@types/file-saver": "^2.0.7",
|
|
37
37
|
"@types/lodash-es": "^4.17.12",
|
|
38
|
-
"@types/node": "^24.12.
|
|
38
|
+
"@types/node": "^24.12.2",
|
|
39
39
|
"@types/react": "^19.2.14",
|
|
40
40
|
"@types/react-dom": "^19.2.3",
|
|
41
41
|
"@vitejs/plugin-react": "^6.0.1",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"tailwindcss-safe-area": "^1.3.0",
|
|
57
57
|
"typescript": "~5.9.3",
|
|
58
58
|
"typescript-eslint": "^8.58.0",
|
|
59
|
-
"vite": "^8.0.
|
|
59
|
+
"vite": "^8.0.5",
|
|
60
60
|
"vite-plugin-image-optimizer": "^2.0.3",
|
|
61
61
|
"vite-plugin-pwa": "^1.2.0",
|
|
62
62
|
"vite-plugin-zip-pack": "^1.2.4"
|