cli-z-develop 0.9.2 → 0.10.1
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/README.md +2 -2
- package/dist/index.js +2159 -1
- package/package.json +6 -10
- package/vite.config.ts +48 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cli-z-develop",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.10.1",
|
|
4
|
+
"description": "技术团队开发流程管理工具",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"z": "bin/z.js",
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"prepare": "[ -n '$z' ] && z init prepare || echo 'Warning: z not exist at global'",
|
|
12
|
-
"dev": "
|
|
13
|
-
"
|
|
12
|
+
"dev": "vite build --watch",
|
|
13
|
+
"dev:debug": "DEBUG=true vite build --watch",
|
|
14
|
+
"build": "vite build",
|
|
14
15
|
"eslint": "eslint '**/*.{ts,js}' --fix",
|
|
15
16
|
"prettier": "prettier -wu .",
|
|
16
17
|
"upload": "npm run build && npm publish --access public --registry https://registry.npmjs.org/",
|
|
@@ -22,10 +23,6 @@
|
|
|
22
23
|
"author": "z",
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"@lonely9/eslint-config-team": "^1.3.5",
|
|
25
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
26
|
-
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
27
|
-
"@rollup/plugin-replace": "v6.0.3",
|
|
28
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
29
26
|
"@tsconfig/node22": "^22.0.5",
|
|
30
27
|
"@types/fs-extra": "^11.0.4",
|
|
31
28
|
"@types/inquirer": "^9.0.9",
|
|
@@ -38,9 +35,8 @@
|
|
|
38
35
|
"eslint": "^9.39.2",
|
|
39
36
|
"jiti": "^2.6.1",
|
|
40
37
|
"prettier": "^3.7.4",
|
|
41
|
-
"rollup": "^4.55.1",
|
|
42
|
-
"rollup-plugin-typescript2": "^0.36.0",
|
|
43
38
|
"typescript": "^5.9.3",
|
|
39
|
+
"vite": "^7.3.1",
|
|
44
40
|
"vue-tsc": "^3.2.2"
|
|
45
41
|
},
|
|
46
42
|
"dependencies": {
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { builtinModules } from "node:module";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
import { defineConfig } from "vite";
|
|
6
|
+
|
|
7
|
+
import pkg from "./package.json";
|
|
8
|
+
|
|
9
|
+
const isDebug = process.env.DEBUG === "true";
|
|
10
|
+
const rootDir = path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const nodeBuiltins = new Set(builtinModules.flatMap((m) => [m, `node:${m}`]));
|
|
12
|
+
const externalDeps = new Set(Object.keys(pkg.dependencies ?? {}));
|
|
13
|
+
|
|
14
|
+
export default defineConfig({
|
|
15
|
+
resolve: {
|
|
16
|
+
alias: {
|
|
17
|
+
src: path.resolve(rootDir, "src"),
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
define: {
|
|
21
|
+
"process.env.DEBUG": JSON.stringify(process.env.DEBUG),
|
|
22
|
+
},
|
|
23
|
+
build: {
|
|
24
|
+
target: "node22",
|
|
25
|
+
lib: {
|
|
26
|
+
entry: path.resolve(rootDir, "src/main.ts"),
|
|
27
|
+
formats: ["es"],
|
|
28
|
+
fileName: () => "index.js",
|
|
29
|
+
},
|
|
30
|
+
outDir: "dist",
|
|
31
|
+
emptyOutDir: true,
|
|
32
|
+
sourcemap: false,
|
|
33
|
+
minify: isDebug ? false : "esbuild",
|
|
34
|
+
rollupOptions: {
|
|
35
|
+
external: (id) => {
|
|
36
|
+
if (nodeBuiltins.has(id) || id.startsWith("node:")) return true;
|
|
37
|
+
if (externalDeps.has(id)) return true;
|
|
38
|
+
for (const dep of externalDeps) {
|
|
39
|
+
if (id.startsWith(`${dep}/`)) return true;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
},
|
|
43
|
+
output: {
|
|
44
|
+
inlineDynamicImports: true,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
});
|