vona-cli-set-api 1.0.196 → 1.0.200

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.
@@ -45,7 +45,7 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "vona": "^5.0.116"
48
+ "vona": "^5.0.118"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@cabloy/lint": "^5.0.16",
@@ -9,6 +9,7 @@ declare module '@cabloy/cli' {
9
9
  beanName: string;
10
10
  beanNameCapitalize: string;
11
11
  moduleResourceName: string;
12
+ boilerplate: string;
12
13
  }
13
14
  }
14
15
  export declare class CliCreateBean extends BeanCliBase {
@@ -39,7 +39,7 @@ export class CliCreateBean extends BeanCliBase {
39
39
  await this.helper.ensureDir(beanDir);
40
40
  // snippets/boilerplate
41
41
  const snippets = this._getBoilerplatesOrSnippets('snippets');
42
- const boilerplates = this._getBoilerplatesOrSnippets('boilerplate');
42
+ const boilerplates = this._getBoilerplatesOrSnippets('boilerplate', argv.boilerplate);
43
43
  const snippetsName = snippets[`${sceneName}:${argv.beanName}`] || snippets[sceneName];
44
44
  const boilerplateName = boilerplates[`${sceneName}:${argv.beanName}`] || boilerplates[sceneName];
45
45
  // render
@@ -52,22 +52,24 @@ export class CliCreateBean extends BeanCliBase {
52
52
  // tools.metadata
53
53
  await this.helper.invokeCli([':tools:metadata', moduleName], { cwd: argv.projectPath });
54
54
  }
55
- _getBoilerplatesOrSnippets(type) {
55
+ _getBoilerplatesOrSnippets(type, customPath) {
56
56
  const result = {};
57
57
  // scenes
58
58
  const onionScenesMeta = getOnionScenesMeta(this.modulesMeta.modules);
59
59
  for (const sceneName in onionScenesMeta) {
60
60
  const onionSceneMeta = onionScenesMeta[sceneName];
61
- if (onionSceneMeta[type]) {
62
- result[sceneName] = path.join(onionSceneMeta.module.root, onionSceneMeta[type]);
61
+ const scenePath = customPath || onionSceneMeta[type];
62
+ if (scenePath) {
63
+ result[sceneName] = path.join(onionSceneMeta.module.root, scenePath);
63
64
  }
64
65
  }
65
66
  // metas
66
67
  const onionMetasMeta = getOnionMetasMeta(this.modulesMeta.modules);
67
68
  for (const sceneName in onionMetasMeta) {
68
69
  const onionMetaMeta = onionMetasMeta[sceneName];
69
- if (onionMetaMeta[type]) {
70
- result[`meta:${sceneName}`] = path.join(onionMetaMeta.module.root, onionMetaMeta[type]);
70
+ const scenePath = customPath || onionMetaMeta[type];
71
+ if (scenePath) {
72
+ result[`meta:${sceneName}`] = path.join(onionMetaMeta.module.root, scenePath);
71
73
  }
72
74
  }
73
75
  return result;
@@ -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: {
@@ -3,13 +3,17 @@ export default {
3
3
  info: {
4
4
  version: '5.0.0',
5
5
  title: 'Cli: Create Bean',
6
- usage: 'vona :create:bean sceneName beanName [--module=]',
6
+ usage: 'vona :create:bean sceneName beanName [--module=] [--boilerplate=]',
7
7
  },
8
8
  options: {
9
9
  module: {
10
10
  description: 'module name',
11
11
  type: 'string',
12
12
  },
13
+ boilerplate: {
14
+ description: 'boilerplate',
15
+ type: 'string',
16
+ },
13
17
  },
14
18
  groups: {
15
19
  default: {
@@ -275,6 +275,10 @@ export declare const commands: {
275
275
  description: string;
276
276
  type: string;
277
277
  };
278
+ boilerplate: {
279
+ description: string;
280
+ type: string;
281
+ };
278
282
  };
279
283
  groups: {
280
284
  default: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-cli-set-api",
3
3
  "type": "module",
4
- "version": "1.0.196",
4
+ "version": "1.0.200",
5
5
  "description": "vona cli-set-api",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -31,10 +31,10 @@
31
31
  "@babel/plugin-proposal-decorators": "^7.25.9",
32
32
  "@babel/plugin-transform-class-properties": "^7.25.9",
33
33
  "@babel/plugin-transform-typescript": "^7.26.8",
34
- "@cabloy/cli": "^3.0.44",
34
+ "@cabloy/cli": "^3.0.45",
35
35
  "@cabloy/dotenv": "^1.1.10",
36
36
  "@cabloy/extend": "^3.1.10",
37
- "@cabloy/module-glob": "^5.2.24",
37
+ "@cabloy/module-glob": "^5.2.25",
38
38
  "@cabloy/module-info": "^1.3.26",
39
39
  "@cabloy/word-utils": "^2.0.1",
40
40
  "@lcov-viewer/cli": "^1.3.0",
@@ -61,7 +61,7 @@
61
61
  "ts-node": "^10.9.2",
62
62
  "urllib": "^4.6.11",
63
63
  "uuid": "^11.1.0",
64
- "vona-core": "^5.0.53",
64
+ "vona-core": "^5.0.55",
65
65
  "why-is-node-running": "^3.2.2",
66
66
  "yargs-parser": "^21.1.1"
67
67
  },