zova-cli-set-front 1.2.76 → 1.2.78

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.
@@ -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>
@@ -1,5 +1,10 @@
1
1
  import type { ZovaOpenapiConfigModule } from 'zova-openapi';
2
2
 
3
3
  export default function (): ZovaOpenapiConfigModule {
4
- return {};
4
+ return {
5
+ operations: {
6
+ // Specify operations.match or operations.ignore explicitly for this module.
7
+ match: [],
8
+ },
9
+ };
5
10
  }
package/dist/index.js CHANGED
@@ -727,6 +727,12 @@ class CliCreateModule extends BeanCliBase {
727
727
  if (!argv.vscode && !argv.ci) {
728
728
  await this.helper.pnpmInstall();
729
729
  }
730
+ // tools.metadata
731
+ if (!argv.nometadata) {
732
+ await this.helper.invokeCli([':tools:metadata', moduleName], {
733
+ cwd: argv.projectPath
734
+ });
735
+ }
730
736
  }
731
737
  }
732
738
 
@@ -1626,6 +1632,7 @@ class CliOpenapiGenerate extends BeanCliBase {
1626
1632
  apiMeta: false,
1627
1633
  apiSchema: true
1628
1634
  }, config.default, moduleConfigCli, config.modules[moduleInfo.relativeName]);
1635
+ _validateOperations(moduleConfig, moduleInfo.relativeName, configFile);
1629
1636
  const cache = await this._outputFiles(openapiTypescript, moduleConfig, moduleInfo, module, __caches);
1630
1637
  // generate
1631
1638
  await this._generateApis(openapiTypescript, cache.ast, moduleConfig, moduleInfo, module);
@@ -1995,10 +2002,24 @@ function _isNodeNever(node) {
1995
2002
  function _q(question) {
1996
2003
  return question ? '?' : '';
1997
2004
  }
2005
+ function _hasOperationRule(rule) {
2006
+ if (!rule) return false;
2007
+ return !Array.isArray(rule) || rule.length > 0;
2008
+ }
2009
+ function _validateOperations(moduleConfig, moduleName, configFile) {
2010
+ if (_hasOperationRule(moduleConfig.operations?.match) || _hasOperationRule(moduleConfig.operations?.ignore)) {
2011
+ return;
2012
+ }
2013
+ throw new Error(`Please specify operations.match or operations.ignore in ${configFile} to avoid generating a large number of API SDKs unrelated to module "${moduleName}".`);
2014
+ }
1998
2015
  function _checkOperationIdEnabled(moduleConfig, selector) {
1999
2016
  if (!selector) return false;
2000
- if (!moduleConfig.operations?.match && !moduleConfig.operations?.ignore) return true;
2001
- return moduleConfig.operations?.match && matchSelector(moduleConfig.operations?.match, selector) || moduleConfig.operations?.ignore && !matchSelector(moduleConfig.operations?.ignore, selector);
2017
+ const match = moduleConfig.operations?.match;
2018
+ const ignore = moduleConfig.operations?.ignore;
2019
+ const hasMatch = _hasOperationRule(match);
2020
+ const hasIgnore = _hasOperationRule(ignore);
2021
+ if (!hasMatch && !hasIgnore) return false;
2022
+ return hasMatch && matchSelector(match, selector) || hasIgnore && !matchSelector(ignore, selector);
2002
2023
  }
2003
2024
 
2004
2025
  /**
@@ -3613,12 +3634,16 @@ var createBean = {
3613
3634
  info: {
3614
3635
  version: '5.0.0',
3615
3636
  title: 'Cli: Create Bean',
3616
- usage: 'npm run zova :create:bean sceneName beanName -- [--module=]'
3637
+ usage: 'npm run zova :create:bean sceneName beanName -- [--module=] [--boilerplate=]'
3617
3638
  },
3618
3639
  options: {
3619
3640
  module: {
3620
3641
  description: 'module name',
3621
3642
  type: 'string'
3643
+ },
3644
+ boilerplate: {
3645
+ description: 'boilerplate',
3646
+ type: 'string'
3622
3647
  }
3623
3648
  },
3624
3649
  groups: {
@@ -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.76",
4
- "gitHead": "3380f8c5d3989242b60dc2a34cbb330f74335cbe",
3
+ "version": "1.2.78",
4
+ "gitHead": "69a9c7e1a934ea08b8c8b1dbb3066e47dbaf270f",
5
5
  "description": "zova cli-set-front",
6
6
  "keywords": [
7
7
  "framework",
@@ -36,7 +36,7 @@
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.17",
39
+ "@cabloy/cli": "^3.1.18",
40
40
  "@cabloy/extend": "^3.2.8",
41
41
  "@cabloy/module-info": "^2.0.0",
42
42
  "@cabloy/openapi-typescript": "^7.9.2",
@@ -65,6 +65,6 @@
65
65
  "vite": "^8.0.14",
66
66
  "yaml": "^2.8.3",
67
67
  "zova-openapi": "^1.1.17",
68
- "zova-vite": "^1.1.38"
68
+ "zova-vite": "^1.1.39"
69
69
  }
70
70
  }