zova-cli-set-front 1.2.73 → 1.2.77

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 CHANGED
@@ -1 +1,51 @@
1
1
  # zova-cli-set-front
2
+
3
+ This package contains the authoritative Zova command catalog for frontend-oriented CLI workflows.
4
+
5
+ ## Source of truth
6
+
7
+ The top-level command-family registry lives in:
8
+
9
+ - `src/lib/commands.ts`
10
+
11
+ Inspect this file first when you need to answer:
12
+
13
+ - which Zova command families exist
14
+ - which command names are registered
15
+ - which command module implements each entry
16
+
17
+ Current families include:
18
+
19
+ - `default`
20
+ - `bin`
21
+ - `create`
22
+ - `init`
23
+ - `refactor`
24
+ - `tools`
25
+ - `openapi`
26
+
27
+ ## Command metadata surface
28
+
29
+ Each command module under `src/lib/command/` provides the main CLI-facing metadata for that command, typically including:
30
+
31
+ - `bean`
32
+ - `info.title`
33
+ - `info.usage`
34
+ - `options`
35
+
36
+ Representative example:
37
+
38
+ - `src/lib/command/tools.metadata.ts`
39
+
40
+ ## Recommended navigation path
41
+
42
+ 1. run `npm run zova`
43
+ 2. inspect `../cli/src/bin/zova.ts` for entry dispatch only
44
+ 3. inspect `src/lib/commands.ts` for the authoritative family map
45
+ 4. inspect the specific command module for usage and options
46
+
47
+ ## Public reference
48
+
49
+ For the compact top-level overview shared across Vona and Zova, see:
50
+
51
+ - `../../../cabloy-docs/reference/cli-reference.md`
@@ -17,7 +17,7 @@
17
17
  "files": ["mock", "dist", "src", "icons", "assets"],
18
18
  "scripts": {
19
19
  "clean": "rimraf dist tsconfig.build.tsbuildinfo",
20
- "tsc:publish": "npm run clean && zova :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
20
+ "tsc:publish": "npm run clean && node <%=argv.suite?'../../../../../':'../../../'%>packages-cli/cli/src/bin/zova.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
21
21
  "prepublishOnly": "npm run tsc:publish",
22
22
  "prepack": "clean-package",
23
23
  "postpack": "clean-package restore && npm run clean"
@@ -1,3 +1,3 @@
1
- <svg width="15" height="19" viewBox="0 0 15 19" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ <svg width="32" height="32" viewBox="0 0 15 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M13.7344 0C13.9844 0 14.1771 0.046875 14.3125 0.140625C14.4479 0.223958 14.5469 0.380208 14.6094 0.609375C14.6823 0.838542 14.7188 1.17188 14.7188 1.60938C14.7188 2.24479 14.599 2.72396 14.3594 3.04688L5.39062 15.1875H11.125V11.7188C11.125 11.3646 11.276 11.1146 11.5781 10.9688C11.8802 10.8125 12.3646 10.7344 13.0312 10.7344C13.6771 10.7344 14.1198 10.8073 14.3594 10.9531C14.599 11.099 14.7188 11.3542 14.7188 11.7188V17.5312C14.7188 17.8854 14.6406 18.1458 14.4844 18.3125C14.3281 18.4688 14.0677 18.5469 13.7031 18.5469H0.984375C0.734375 18.5469 0.541667 18.5052 0.40625 18.4219C0.270833 18.3385 0.166667 18.1823 0.09375 17.9531C0.03125 17.724 0 17.3906 0 16.9531C0 16.2656 0.104167 15.7812 0.3125 15.5L9.28125 3.35938H4.0625V6.51562C4.0625 6.86979 3.91146 7.125 3.60938 7.28125C3.30729 7.42708 2.82292 7.5 2.15625 7.5C1.51042 7.5 1.06771 7.42708 0.828125 7.28125C0.588542 7.13542 0.46875 6.88021 0.46875 6.51562V1.01562C0.46875 0.651042 0.546875 0.390625 0.703125 0.234375C0.869792 0.078125 1.13021 0 1.48438 0H13.7344Z" fill="#FF9300"/>
3
3
  </svg>
package/dist/index.js CHANGED
@@ -395,27 +395,48 @@ async function _extractDepsVersion(projectPath, deps) {
395
395
  const parsedLockfile = yaml.parse(lockfileContent);
396
396
  const depsVersion = {};
397
397
  for (const dep of deps) {
398
- let version = getPackageVersionFromLock(parsedLockfile, dep);
399
- if (!version) {
400
- version = await getPackageVersionFromNodeModules(projectPath, dep);
398
+ let dependencyRange = getPackageDependencyRangeFromLock(parsedLockfile, dep);
399
+ if (!dependencyRange) {
400
+ const version = await getPackageVersionFromNodeModules(projectPath, dep);
401
+ dependencyRange = version ? `^${version}` : null;
401
402
  }
402
- if (!version) {
403
+ if (!dependencyRange) {
403
404
  console.warn('dep version not found: ', dep);
404
405
  continue;
405
406
  }
406
- depsVersion[dep] = `^${version}`;
407
+ depsVersion[dep] = dependencyRange;
407
408
  }
408
409
  return depsVersion;
409
410
  }
410
- function getPackageVersionFromLock(parsedLockfile, packageName) {
411
- const packages = parsedLockfile.packages || {};
412
- for (const key in packages) {
413
- if (key.startsWith(`${packageName}@`)) {
414
- return key.substring(`${packageName}@`.length);
415
- }
411
+ function getPackageDependencyRangeFromLock(parsedLockfile, packageName) {
412
+ const importer = parsedLockfile.importers?.['.'];
413
+ const sections = ['dependencies', 'devDependencies', 'optionalDependencies'];
414
+ for (const section of sections) {
415
+ const dependencyRange = getImporterDependencyRange(importer?.[section]?.[packageName]);
416
+ if (dependencyRange) return dependencyRange;
416
417
  }
417
418
  return null;
418
419
  }
420
+ function getImporterDependencyRange(importerDependency) {
421
+ if (!importerDependency) return null;
422
+ const specifier = importerDependency.specifier;
423
+ if (specifier?.startsWith('npm:')) return specifier;
424
+ const version = normalizeLockfileVersion(importerDependency.version);
425
+ if (!version) return null;
426
+ return `^${version}`;
427
+ }
428
+ function normalizeLockfileVersion(version) {
429
+ if (!version) return null;
430
+ if (version.startsWith('link:') || version.startsWith('file:')) return null;
431
+ const versionWithoutPeers = version.split('(')[0];
432
+ if (!versionWithoutPeers) return null;
433
+ if (/^\d/.test(versionWithoutPeers)) return versionWithoutPeers;
434
+ const aliasSeparator = versionWithoutPeers.lastIndexOf('@');
435
+ if (aliasSeparator === -1) return null;
436
+ const aliasedVersion = versionWithoutPeers.slice(aliasSeparator + 1);
437
+ if (!aliasedVersion || !/^\d/.test(aliasedVersion)) return null;
438
+ return aliasedVersion;
439
+ }
419
440
  async function getPackageVersionFromNodeModules(projectPath, packageName) {
420
441
  const pkgFile = path.join(projectPath, 'node_modules', packageName, 'package.json');
421
442
  if (!fse.existsSync(pkgFile)) return null;
@@ -706,6 +727,12 @@ class CliCreateModule extends BeanCliBase {
706
727
  if (!argv.vscode && !argv.ci) {
707
728
  await this.helper.pnpmInstall();
708
729
  }
730
+ // tools.metadata
731
+ if (!argv.nometadata) {
732
+ await this.helper.invokeCli([':tools:metadata', moduleName], {
733
+ cwd: argv.projectPath
734
+ });
735
+ }
709
736
  }
710
737
  }
711
738
 
@@ -2147,50 +2174,6 @@ class CliRefactorAnotherStyle extends BeanCliBase {
2147
2174
  }
2148
2175
  }
2149
2176
 
2150
- class CliRefactorComponentEmits extends BeanCliBase {
2151
- async execute() {
2152
- const {
2153
- argv
2154
- } = this.context;
2155
- // super
2156
- await super.execute();
2157
- // module name/info
2158
- const moduleName = argv.module;
2159
- argv.moduleInfo = this.helper.parseModuleInfo(moduleName);
2160
- // check if exists
2161
- const _module = this.helper.findModule(moduleName);
2162
- if (!_module) {
2163
- throw new Error(`module does not exist: ${moduleName}`);
2164
- }
2165
- // target dir
2166
- const targetDir = await this.helper.ensureDir(_module.root);
2167
- // componentName
2168
- const componentName = argv.componentName;
2169
- // nameMeta
2170
- argv.nameMeta = this.helper.parseNameMeta(componentName, ['component']);
2171
- argv.controllerClassName = `Controller${argv.nameMeta.shortCapitalize}`;
2172
- argv.controllerFileName = getControllerFileName(_module, 'component', argv.nameMeta.short);
2173
- // directory
2174
- const componentDir = path.join(targetDir, 'src/component', argv.nameMeta.short);
2175
- if (!fs.existsSync(componentDir)) {
2176
- throw new Error(`component not exists: ${componentDir}`);
2177
- }
2178
- // render boilerplate
2179
- await this.template.renderBoilerplateAndSnippets({
2180
- targetDir: componentDir,
2181
- setName: __ThisSetName__,
2182
- snippetsPath: 'refactor/componentEmits/snippets',
2183
- boilerplatePath: null
2184
- });
2185
- // tools.metadata
2186
- if (!argv.nometadata) {
2187
- await this.helper.invokeCli([':tools:metadata', moduleName], {
2188
- cwd: argv.projectPath
2189
- });
2190
- }
2191
- }
2192
- }
2193
-
2194
2177
  class CliRefactorComponentGeneric extends BeanCliBase {
2195
2178
  async execute() {
2196
2179
  const {
@@ -2331,50 +2314,6 @@ class CliRefactorComponentProps extends BeanCliBase {
2331
2314
  }
2332
2315
  }
2333
2316
 
2334
- class CliRefactorComponentSlots extends BeanCliBase {
2335
- async execute() {
2336
- const {
2337
- argv
2338
- } = this.context;
2339
- // super
2340
- await super.execute();
2341
- // module name/info
2342
- const moduleName = argv.module;
2343
- argv.moduleInfo = this.helper.parseModuleInfo(moduleName);
2344
- // check if exists
2345
- const _module = this.helper.findModule(moduleName);
2346
- if (!_module) {
2347
- throw new Error(`module does not exist: ${moduleName}`);
2348
- }
2349
- // target dir
2350
- const targetDir = await this.helper.ensureDir(_module.root);
2351
- // componentName
2352
- const componentName = argv.componentName;
2353
- // nameMeta
2354
- argv.nameMeta = this.helper.parseNameMeta(componentName, ['component']);
2355
- argv.controllerClassName = `Controller${argv.nameMeta.shortCapitalize}`;
2356
- argv.controllerFileName = getControllerFileName(_module, 'component', argv.nameMeta.short);
2357
- // directory
2358
- const componentDir = path.join(targetDir, 'src/component', argv.nameMeta.short);
2359
- if (!fs.existsSync(componentDir)) {
2360
- throw new Error(`component not exists: ${componentDir}`);
2361
- }
2362
- // render boilerplate
2363
- await this.template.renderBoilerplateAndSnippets({
2364
- targetDir: componentDir,
2365
- setName: __ThisSetName__,
2366
- snippetsPath: 'refactor/componentSlots/snippets',
2367
- boilerplatePath: null
2368
- });
2369
- // tools.metadata
2370
- if (!argv.nometadata) {
2371
- await this.helper.invokeCli([':tools:metadata', moduleName], {
2372
- cwd: argv.projectPath
2373
- });
2374
- }
2375
- }
2376
- }
2377
-
2378
2317
  class CliRefactorFirstRender extends BeanCliBase {
2379
2318
  async execute() {
2380
2319
  const {
@@ -3629,8 +3568,6 @@ const beans = {
3629
3568
  'refactor.anotherRender': CliRefactorAnotherRender,
3630
3569
  'refactor.anotherStyle': CliRefactorAnotherStyle,
3631
3570
  'refactor.componentProps': CliRefactorComponentProps,
3632
- 'refactor.componentEmits': CliRefactorComponentEmits,
3633
- 'refactor.componentSlots': CliRefactorComponentSlots,
3634
3571
  'refactor.componentModel': CliRefactorComponentModel,
3635
3572
  'refactor.renameComponent': CliRefactorRenameComponent,
3636
3573
  'tools.metadata': CliToolsMetadata,
@@ -3643,7 +3580,7 @@ var binBuildModule = {
3643
3580
  bean: 'bin.buildModule',
3644
3581
  info: {
3645
3582
  version: '5.0.0',
3646
- title: 'Cli: Tools: Bin',
3583
+ title: 'Cli: Bin: Build Module',
3647
3584
  usage: 'npm run zova :bin:buildModule -- [--minify] [--sourcemap] [--dts]'
3648
3585
  },
3649
3586
  options: {
@@ -3666,7 +3603,7 @@ var binBuildRest = {
3666
3603
  bean: 'bin.buildRest',
3667
3604
  info: {
3668
3605
  version: '5.0.0',
3669
- title: 'Cli: Tools: Bin',
3606
+ title: 'Cli: Bin: Build Rest',
3670
3607
  usage: 'npm run zova :bin:buildRest -- [--flavor=]'
3671
3608
  },
3672
3609
  options: {
@@ -3682,12 +3619,16 @@ var createBean = {
3682
3619
  info: {
3683
3620
  version: '5.0.0',
3684
3621
  title: 'Cli: Create Bean',
3685
- usage: 'npm run zova :create:bean sceneName beanName -- [--module=]'
3622
+ usage: 'npm run zova :create:bean sceneName beanName -- [--module=] [--boilerplate=]'
3686
3623
  },
3687
3624
  options: {
3688
3625
  module: {
3689
3626
  description: 'module name',
3690
3627
  type: 'string'
3628
+ },
3629
+ boilerplate: {
3630
+ description: 'boilerplate',
3631
+ type: 'string'
3691
3632
  }
3692
3633
  },
3693
3634
  groups: {
@@ -25,11 +25,9 @@ import { CliOpenapiConfig } from './bean/cli.openapi.config.ts';
25
25
  import { CliOpenapiGenerate } from './bean/cli.openapi.generate.ts';
26
26
  import { CliRefactorAnotherRender } from './bean/cli.refactor.anotherRender.ts';
27
27
  import { CliRefactorAnotherStyle } from './bean/cli.refactor.anotherStyle.ts';
28
- import { CliRefactorComponentEmits } from './bean/cli.refactor.componentEmits.ts';
29
28
  import { CliRefactorComponentGeneric } from './bean/cli.refactor.componentGeneric.ts';
30
29
  import { CliRefactorComponentModel } from './bean/cli.refactor.componentModel.ts';
31
30
  import { CliRefactorComponentProps } from './bean/cli.refactor.componentProps.ts';
32
- import { CliRefactorComponentSlots } from './bean/cli.refactor.componentSlots.ts';
33
31
  import { CliRefactorFirstRender } from './bean/cli.refactor.firstRender.ts';
34
32
  import { CliRefactorFirstStyle } from './bean/cli.refactor.firstStyle.ts';
35
33
  import { CliRefactorPageParams } from './bean/cli.refactor.pageParams.ts';
@@ -69,8 +67,6 @@ export declare const beans: {
69
67
  'refactor.anotherRender': typeof CliRefactorAnotherRender;
70
68
  'refactor.anotherStyle': typeof CliRefactorAnotherStyle;
71
69
  'refactor.componentProps': typeof CliRefactorComponentProps;
72
- 'refactor.componentEmits': typeof CliRefactorComponentEmits;
73
- 'refactor.componentSlots': typeof CliRefactorComponentSlots;
74
70
  'refactor.componentModel': typeof CliRefactorComponentModel;
75
71
  'refactor.renameComponent': typeof CliRefactorRenameComponent;
76
72
  'tools.metadata': typeof CliToolsMetadata;
@@ -10,6 +10,10 @@ declare const _default: {
10
10
  description: string;
11
11
  type: string;
12
12
  };
13
+ boilerplate: {
14
+ description: string;
15
+ type: string;
16
+ };
13
17
  };
14
18
  groups: {
15
19
  default: {
@@ -232,6 +232,10 @@ export declare const commands: {
232
232
  description: string;
233
233
  type: string;
234
234
  };
235
+ boilerplate: {
236
+ description: string;
237
+ type: string;
238
+ };
235
239
  };
236
240
  groups: {
237
241
  default: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zova-cli-set-front",
3
- "version": "1.2.73",
4
- "gitHead": "b2879af32ebdecaf6687854b0f7c1d94918919ef",
3
+ "version": "1.2.77",
4
+ "gitHead": "ca10457f38716ad28bf5918dd67c85dd1f7dc9d0",
5
5
  "description": "zova cli-set-front",
6
6
  "keywords": [
7
7
  "framework",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "scripts": {
29
29
  "clean": "rimraf dist dist-cli tsconfig.build.tsbuildinfo tsconfig.cli.tsbuildinfo",
30
- "tsc:publish": "npm run clean && vona :bin:buildGeneral && tsc -p tsconfig.build.json && tsc -p tsconfig.cli.json",
30
+ "tsc:publish": "npm run clean && node ../../../vona/packages-cli/cli/src/bin/vona.ts :bin:buildGeneral && tsc -p tsconfig.build.json && tsc -p tsconfig.cli.json",
31
31
  "prepublishOnly": "npm run tsc:publish",
32
32
  "prepack": "clean-package",
33
33
  "postpack": "clean-package restore && npm run clean"
@@ -36,11 +36,11 @@
36
36
  "@babel/plugin-proposal-decorators": "^7.29.0",
37
37
  "@babel/plugin-transform-class-properties": "^7.28.6",
38
38
  "@babel/plugin-transform-typescript": "^7.28.6",
39
- "@cabloy/cli": "^3.1.14",
40
- "@cabloy/extend": "^3.1.0",
39
+ "@cabloy/cli": "^3.1.18",
40
+ "@cabloy/extend": "^3.2.8",
41
41
  "@cabloy/module-info": "^2.0.0",
42
42
  "@cabloy/openapi-typescript": "^7.9.2",
43
- "@cabloy/utils": "^2.1.19",
43
+ "@cabloy/utils": "^2.1.22",
44
44
  "@cabloy/vite-plugin-babel": "^1.3.3",
45
45
  "@cabloy/vue-babel-plugin-jsx": "^2.0.1",
46
46
  "@cabloy/word-utils": "^2.1.14",
@@ -64,7 +64,7 @@
64
64
  "urllib": "^4.6.11",
65
65
  "vite": "^8.0.14",
66
66
  "yaml": "^2.8.3",
67
- "zova-openapi": "^1.1.14",
68
- "zova-vite": "^1.1.35"
67
+ "zova-openapi": "^1.1.17",
68
+ "zova-vite": "^1.1.39"
69
69
  }
70
70
  }
@@ -1,9 +0,0 @@
1
- declare const _default: {
2
- bean: string;
3
- info: {
4
- version: string;
5
- title: string;
6
- usage: string;
7
- };
8
- };
9
- export default _default;
@@ -1,34 +0,0 @@
1
- declare const _default: {
2
- bean: string;
3
- info: {
4
- version: string;
5
- title: string;
6
- usage: string;
7
- };
8
- options: {
9
- module: {
10
- description: string;
11
- type: string;
12
- };
13
- };
14
- groups: {
15
- default: {
16
- questions: {
17
- componentName: {
18
- type: string;
19
- message: string;
20
- initial: {
21
- expression: string;
22
- };
23
- required: boolean;
24
- };
25
- module: {
26
- type: string;
27
- message: string;
28
- required: boolean;
29
- };
30
- };
31
- };
32
- };
33
- };
34
- export default _default;
@@ -1,34 +0,0 @@
1
- declare const _default: {
2
- bean: string;
3
- info: {
4
- version: string;
5
- title: string;
6
- usage: string;
7
- };
8
- options: {
9
- module: {
10
- description: string;
11
- type: string;
12
- };
13
- };
14
- groups: {
15
- default: {
16
- questions: {
17
- componentName: {
18
- type: string;
19
- message: string;
20
- initial: {
21
- expression: string;
22
- };
23
- required: boolean;
24
- };
25
- module: {
26
- type: string;
27
- message: string;
28
- required: boolean;
29
- };
30
- };
31
- };
32
- };
33
- };
34
- export default _default;