@anxin233/gitviz 1.0.1 → 1.0.3
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/dist/cli.cjs +11949 -0
- package/dist/cli.js +155 -162
- package/package.json +2 -2
- package/scripts/build-esbuild.js +14 -8
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anxin233/gitviz",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "🎨 Beautiful, interactive Git repository visualizations - Transform your Git history into stunning visual stories",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"gitviz": "./dist/cli.
|
|
7
|
+
"gitviz": "./dist/cli.cjs"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"dev": "node --loader ts-node/esm src/cli/index.ts",
|
package/scripts/build-esbuild.js
CHANGED
|
@@ -13,13 +13,9 @@ build({
|
|
|
13
13
|
bundle: true,
|
|
14
14
|
platform: 'node',
|
|
15
15
|
target: 'node18',
|
|
16
|
-
format: '
|
|
17
|
-
outfile: join(rootDir, 'dist', 'cli.
|
|
18
|
-
banner: {
|
|
19
|
-
js: '#!/usr/bin/env node'
|
|
20
|
-
},
|
|
16
|
+
format: 'cjs',
|
|
17
|
+
outfile: join(rootDir, 'dist', 'cli.cjs'),
|
|
21
18
|
external: [
|
|
22
|
-
// 不打包这些 node 内置模块
|
|
23
19
|
'fs',
|
|
24
20
|
'path',
|
|
25
21
|
'url',
|
|
@@ -30,12 +26,22 @@ build({
|
|
|
30
26
|
'os',
|
|
31
27
|
'crypto'
|
|
32
28
|
],
|
|
33
|
-
minify: false,
|
|
29
|
+
minify: false,
|
|
34
30
|
sourcemap: false,
|
|
35
31
|
logLevel: 'info'
|
|
36
32
|
}).then(() => {
|
|
33
|
+
// 读取生成的文件
|
|
34
|
+
const outputPath = join(rootDir, 'dist', 'cli.cjs');
|
|
35
|
+
let content = readFileSync(outputPath, 'utf-8');
|
|
36
|
+
|
|
37
|
+
// 检查是否已有 shebang,如果没有才添加
|
|
38
|
+
if (!content.startsWith('#!/usr/bin/env node')) {
|
|
39
|
+
content = '#!/usr/bin/env node\n' + content;
|
|
40
|
+
writeFileSync(outputPath, content, 'utf-8');
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
console.log('✅ Build successful!');
|
|
38
|
-
console.log('📁 Output: dist/cli.
|
|
44
|
+
console.log('📁 Output: dist/cli.cjs');
|
|
39
45
|
}).catch((error) => {
|
|
40
46
|
console.error('❌ Build failed:', error);
|
|
41
47
|
process.exit(1);
|