@share-crm/sharedev-cli 0.0.4-rc.3 → 0.0.4-rc.32

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": "@share-crm/sharedev-cli",
3
- "version": "0.0.4-rc.3",
3
+ "version": "0.0.4-rc.32",
4
4
  "private": false,
5
5
  "description": "sharedev command line tool",
6
6
  "type": "module",
@@ -18,11 +18,16 @@
18
18
  ],
19
19
  "scripts": {
20
20
  "build": "tsc --noEmit && webpack --config build/webpack/webpack.prod.cjs",
21
- "build:bin": "bun build --compile --target=bun-linux-x64 src/cli.ts --outfile dist/sharedev-linux-x64 && bun build --compile --target=bun-linux-arm64 src/cli.ts --outfile dist/sharedev-linux-arm64 && bun build --compile --target=bun-darwin-x64 src/cli.ts --outfile dist/sharedev-darwin-x64 && bun build --compile --target=bun-darwin-arm64 src/cli.ts --outfile dist/sharedev-darwin-arm64 && bun build --compile --target=bun-windows-x64 src/cli.ts --outfile dist/sharedev-windows-x64.exe",
21
+ "build:debug": "tsc --noEmit && webpack --config build/webpack/webpack.debug.cjs",
22
+ "build:bin": "bun build --compile --target=bun-darwin-x64 src/cli.ts --outfile scripts/sharedev-darwin-x64 && bun build --compile --target=bun-darwin-arm64 src/cli.ts --outfile scripts/sharedev-darwin-arm64 && bun build --compile --target=bun-windows-x64 src/cli.ts --outfile scripts/sharedev-windows-x64.exe",
23
+ "build:all": "npm run build && npm run build:bin",
22
24
  "dev": "tsc --noEmit --watch & webpack --config build/webpack/webpack.dev.cjs --watch",
23
25
  "dev2": "node src/cli.ts",
24
26
  "typecheck": "tsc --noEmit",
25
- "prettier": "prettier --write ./src/**/*.ts"
27
+ "prettier": "prettier --write ./src/**/*.ts",
28
+ "test": "vitest run",
29
+ "test:watch": "vitest",
30
+ "test:coverage": "vitest run --coverage"
26
31
  },
27
32
  "dependencies": {
28
33
  "@clack/prompts": "^1.1.0",
@@ -30,17 +35,22 @@
30
35
  "axios": "~1.13.0",
31
36
  "chalk": "^5.6.2",
32
37
  "commander": "^14.0.1",
33
- "fast-xml-parser": "^5.2.5",
34
38
  "extract-zip": "^2.0.1",
39
+ "fast-xml-parser": "^5.2.5",
35
40
  "fs-extra": "^11.3.2",
36
- "ora": "^9.3.0"
41
+ "lodash-es": "^4.18.1",
42
+ "ora": "^9.3.0",
43
+ "terser-webpack-plugin": "^5.6.1"
37
44
  },
38
45
  "devDependencies": {
39
46
  "@types/extract-zip": "^2.0.3",
40
47
  "@types/fs-extra": "^11.0.4",
48
+ "@types/lodash-es": "^4.17.12",
41
49
  "@types/node": "^24.3.0",
50
+ "@vitest/coverage-v8": "^4.1.8",
42
51
  "ts-loader": "^9.5.4",
43
52
  "typescript": "^5.9.2",
53
+ "vitest": "^3.2.6",
44
54
  "webpack": "^5.101.3",
45
55
  "webpack-cli": "^6.0.1",
46
56
  "webpack-merge": "^6.0.1"
package/readme.md CHANGED
@@ -290,6 +290,51 @@ sharedev
290
290
 
291
291
  ---
292
292
 
293
+ ## 本地调试方式
294
+
295
+ ### 步骤一:安装依赖并构建
296
+
297
+ ```bash
298
+ cd packages/share-dev-cli
299
+ npm install
300
+ npm run build
301
+ ```
302
+
303
+ ### 步骤二:全局链接
304
+
305
+ ```bash
306
+ # 在 packages/share-dev-cli 目录下执行
307
+ npm link
308
+ ```
309
+
310
+ 执行后,`sharedev` 命令会被注册为全局可执行命令,指向当前构建产物 `dist/sharedev.js`。
311
+
312
+ > **注意**:如果 `npm link` 报 `ENOTEMPTY` 错误,说明全局 node_modules 中已存在该包的旧目录,npm 无法原子替换。手动删除后重试即可:
313
+ >
314
+ > ```bash
315
+ > rm -rf /Users/wujing/.nvm/versions/node/v23.6.0/lib/node_modules/@share-crm/sharedev-cli
316
+ > npm link
317
+ > ```
318
+ >
319
+ > 若使用其他 Node 版本,将路径中的 `v23.6.0` 替换为实际版本号(可通过 `node -v` 查看)。
320
+
321
+ > 调试结束后可执行 `npm unlink -g sharedev` 解除链接。
322
+
323
+ ### 步骤三:在测试目录中执行命令
324
+
325
+ 进入任意含有 `.sharedev/settings.json` 的测试目录,运行命令:
326
+
327
+ ```bash
328
+ sharedev --help
329
+ sharedev apl list
330
+ sharedev apl pull <apiName>
331
+ sharedev pwc pull <apiName> --type component
332
+ ```
333
+
334
+ 每次修改源码后,重新执行 `npm run build`(或保持 `npm run dev` 在后台运行),无需重复 `npm link`。
335
+
336
+ ---
337
+
293
338
  ## 实施计划
294
339
 
295
340
  ### 第一期(最小可用)
@@ -1,49 +0,0 @@
1
- {
2
- "name": "@share-crm/sharedev-cli",
3
- "version": "0.0.4-rc.3",
4
- "private": false,
5
- "description": "sharedev command line tool",
6
- "type": "module",
7
- "main": "dist/sharedev.js",
8
- "bin": {
9
- "sharedev": "./bin/cli.mjs"
10
- },
11
- "author": {
12
- "name": "sharecrm-npm"
13
- },
14
- "files": [
15
- "dist",
16
- "bin",
17
- "README.md"
18
- ],
19
- "scripts": {
20
- "build": "tsc --noEmit && webpack --config build/webpack/webpack.prod.cjs",
21
- "build:bin": "bun build --compile --target=bun-linux-x64 src/cli.ts --outfile dist/sharedev-linux-x64 && bun build --compile --target=bun-linux-arm64 src/cli.ts --outfile dist/sharedev-linux-arm64 && bun build --compile --target=bun-darwin-x64 src/cli.ts --outfile dist/sharedev-darwin-x64 && bun build --compile --target=bun-darwin-arm64 src/cli.ts --outfile dist/sharedev-darwin-arm64 && bun build --compile --target=bun-windows-x64 src/cli.ts --outfile dist/sharedev-windows-x64.exe",
22
- "dev": "tsc --noEmit --watch & webpack --config build/webpack/webpack.dev.cjs --watch",
23
- "dev2": "node src/cli.ts",
24
- "typecheck": "tsc --noEmit",
25
- "prettier": "prettier --write ./src/**/*.ts"
26
- },
27
- "dependencies": {
28
- "@clack/prompts": "^1.1.0",
29
- "@mariozechner/pi-coding-agent": "^0.62.0",
30
- "axios": "~1.13.0",
31
- "chalk": "^5.6.2",
32
- "commander": "^14.0.1",
33
- "fast-xml-parser": "^5.2.5",
34
- "extract-zip": "^2.0.1",
35
- "fs-extra": "^11.3.2",
36
- "ora": "^9.3.0"
37
- },
38
- "devDependencies": {
39
- "@types/extract-zip": "^2.0.3",
40
- "@types/fs-extra": "^11.0.4",
41
- "@types/node": "^24.3.0",
42
- "ts-loader": "^9.5.4",
43
- "typescript": "^5.9.2",
44
- "webpack": "^5.101.3",
45
- "webpack-cli": "^6.0.1",
46
- "webpack-merge": "^6.0.1"
47
- },
48
- "packageManager": "pnpm@10.17.0"
49
- }
@@ -1,15 +0,0 @@
1
- /*!
2
- * mime-db
3
- * Copyright(c) 2014 Jonathan Ong
4
- * Copyright(c) 2015-2022 Douglas Christopher Wilson
5
- * MIT Licensed
6
- */
7
-
8
- /*!
9
- * mime-types
10
- * Copyright(c) 2014 Jonathan Ong
11
- * Copyright(c) 2015 Douglas Christopher Wilson
12
- * MIT Licensed
13
- */
14
-
15
- /*! Axios v1.13.6 Copyright (c) 2026 Matt Zabriskie and contributors */