vona-cli-set-api 1.0.402 → 1.0.405

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.
Files changed (91) hide show
  1. package/cli/templates/create/project/basic/boilerplate/env/.env +1 -1
  2. package/cli/templates/create/project/basic/boilerplate/env/.env.prod +1 -1
  3. package/cli/templates/create/project/basic/boilerplate/package.original.json +1 -1
  4. package/cli/templates/create/project/basic/boilerplate/src/backend/config/config/config.ts +1 -0
  5. package/cli/templates/tools/crud/snippets/2-meta.index.ts +10 -5
  6. package/cli/templates/tools/crud/snippets/2-meta.version.ts +11 -9
  7. package/cli/templates/tools/crud/snippets/3-en-us.ts +1 -1
  8. package/cli/templates/tools/crud/snippets/4-zh-cn.ts +1 -1
  9. package/cli/templates/tools/crud/utils.ts +15 -15
  10. package/dist/index.js +3313 -3
  11. package/dist/lib/bean/cli.bin.buildGeneral.d.ts +12 -0
  12. package/dist/lib/beans.d.ts +2 -0
  13. package/dist/lib/command/bin.buildGeneral.d.ts +19 -0
  14. package/dist/lib/commands.d.ts +18 -0
  15. package/package.json +9 -9
  16. package/dist/lib/bean/cli.bin.build.js +0 -185
  17. package/dist/lib/bean/cli.bin.buildModule.js +0 -106
  18. package/dist/lib/bean/cli.bin.dbReset.js +0 -48
  19. package/dist/lib/bean/cli.bin.dev.js +0 -66
  20. package/dist/lib/bean/cli.bin.play.js +0 -92
  21. package/dist/lib/bean/cli.bin.test.js +0 -93
  22. package/dist/lib/bean/cli.bin.tsc.js +0 -48
  23. package/dist/lib/bean/cli.create.bean.js +0 -81
  24. package/dist/lib/bean/cli.create.module.js +0 -73
  25. package/dist/lib/bean/cli.create.project.js +0 -119
  26. package/dist/lib/bean/cli.create.suite.js +0 -35
  27. package/dist/lib/bean/cli.create.test.js +0 -39
  28. package/dist/lib/bean/cli.default.list.js +0 -93
  29. package/dist/lib/bean/cli.init.appMonkey.js +0 -24
  30. package/dist/lib/bean/cli.init.asset.js +0 -28
  31. package/dist/lib/bean/cli.init.config.js +0 -38
  32. package/dist/lib/bean/cli.init.constant.js +0 -38
  33. package/dist/lib/bean/cli.init.error.js +0 -49
  34. package/dist/lib/bean/cli.init.lib.js +0 -38
  35. package/dist/lib/bean/cli.init.locale.js +0 -38
  36. package/dist/lib/bean/cli.init.main.js +0 -38
  37. package/dist/lib/bean/cli.init.monkey.js +0 -64
  38. package/dist/lib/bean/cli.init.static.js +0 -38
  39. package/dist/lib/bean/cli.init.types.js +0 -38
  40. package/dist/lib/bean/cli.tools.crud.js +0 -46
  41. package/dist/lib/bean/cli.tools.deps.js +0 -42
  42. package/dist/lib/bean/cli.tools.metadata.js +0 -234
  43. package/dist/lib/bean/toolsBin/configUtils.js +0 -56
  44. package/dist/lib/bean/toolsBin/dbReset.js +0 -8
  45. package/dist/lib/bean/toolsBin/generateEntryFiles.js +0 -90
  46. package/dist/lib/bean/toolsBin/generateVonaMeta.js +0 -17
  47. package/dist/lib/bean/toolsBin/generateZod.js +0 -48
  48. package/dist/lib/bean/toolsBin/play.js +0 -59
  49. package/dist/lib/bean/toolsBin/test.js +0 -137
  50. package/dist/lib/bean/toolsBin/types.js +0 -1
  51. package/dist/lib/bean/toolsMetadata/generateBeanGenerals.js +0 -33
  52. package/dist/lib/bean/toolsMetadata/generateConfig.js +0 -62
  53. package/dist/lib/bean/toolsMetadata/generateMetadataCustom.js +0 -23
  54. package/dist/lib/bean/toolsMetadata/generateMonkey.js +0 -24
  55. package/dist/lib/bean/toolsMetadata/generateOnions.js +0 -112
  56. package/dist/lib/bean/toolsMetadata/generateScope.js +0 -83
  57. package/dist/lib/bean/toolsMetadata/generateScopeResources.js +0 -33
  58. package/dist/lib/bean/toolsMetadata/generateScopeResourcesMeta.js +0 -13
  59. package/dist/lib/bean/toolsMetadata/utils.js +0 -84
  60. package/dist/lib/beans.js +0 -56
  61. package/dist/lib/command/bin.build.js +0 -18
  62. package/dist/lib/command/bin.buildModule.js +0 -18
  63. package/dist/lib/command/bin.dbReset.js +0 -14
  64. package/dist/lib/command/bin.dev.js +0 -18
  65. package/dist/lib/command/bin.play.js +0 -27
  66. package/dist/lib/command/bin.test.js +0 -18
  67. package/dist/lib/command/bin.tsc.js +0 -14
  68. package/dist/lib/command/create.bean.js +0 -46
  69. package/dist/lib/command/create.module.js +0 -36
  70. package/dist/lib/command/create.project.js +0 -43
  71. package/dist/lib/command/create.suite.js +0 -23
  72. package/dist/lib/command/create.test.js +0 -33
  73. package/dist/lib/command/default.list.js +0 -18
  74. package/dist/lib/command/init.appMonkey.js +0 -10
  75. package/dist/lib/command/init.asset.js +0 -33
  76. package/dist/lib/command/init.config.js +0 -10
  77. package/dist/lib/command/init.constant.js +0 -10
  78. package/dist/lib/command/init.error.js +0 -10
  79. package/dist/lib/command/init.lib.js +0 -10
  80. package/dist/lib/command/init.locale.js +0 -10
  81. package/dist/lib/command/init.main.js +0 -10
  82. package/dist/lib/command/init.monkey.js +0 -10
  83. package/dist/lib/command/init.static.js +0 -10
  84. package/dist/lib/command/init.types.js +0 -10
  85. package/dist/lib/command/tools.crud.js +0 -33
  86. package/dist/lib/command/tools.deps.js +0 -9
  87. package/dist/lib/command/tools.metadata.js +0 -14
  88. package/dist/lib/commands.js +0 -67
  89. package/dist/lib/this.js +0 -1
  90. package/dist/lib/utils.js +0 -80
  91. package/dist/typings.js +0 -1
@@ -1,33 +0,0 @@
1
- export default {
2
- bean: 'create.test',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Create Test',
6
- usage: 'vona :create:test name [--module=]',
7
- },
8
- options: {
9
- module: {
10
- description: 'module name',
11
- type: 'string',
12
- },
13
- },
14
- groups: {
15
- default: {
16
- questions: {
17
- name: {
18
- type: 'input',
19
- message: 'name',
20
- initial: {
21
- expression: 'context.argv._[0]',
22
- },
23
- required: true,
24
- },
25
- module: {
26
- type: 'input',
27
- message: 'module name',
28
- required: true,
29
- },
30
- },
31
- },
32
- },
33
- };
@@ -1,18 +0,0 @@
1
- export default {
2
- bean: 'default.list',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Command List',
6
- },
7
- options: {
8
- module: {
9
- description: 'module',
10
- type: 'string',
11
- },
12
- group: {
13
- description: 'group',
14
- type: 'string',
15
- },
16
- },
17
- groups: null,
18
- };
@@ -1,10 +0,0 @@
1
- export default {
2
- bean: 'init.appMonkey',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Init: App Monkey',
6
- usage: 'vona :init:appMonkey',
7
- },
8
- // options: null,
9
- // groups: null,
10
- };
@@ -1,33 +0,0 @@
1
- export default {
2
- bean: 'init.asset',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Init: Asset Resources',
6
- usage: 'vona :init:asset scene [--module=]',
7
- },
8
- options: {
9
- module: {
10
- description: 'module name',
11
- type: 'string',
12
- },
13
- },
14
- groups: {
15
- default: {
16
- questions: {
17
- scene: {
18
- type: 'input',
19
- message: 'scene',
20
- initial: {
21
- expression: 'context.argv._[0]',
22
- },
23
- required: true,
24
- },
25
- module: {
26
- type: 'input',
27
- message: 'module name',
28
- required: true,
29
- },
30
- },
31
- },
32
- },
33
- };
@@ -1,10 +0,0 @@
1
- export default {
2
- bean: 'init.config',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Init: Config',
6
- usage: 'vona :init:config module',
7
- },
8
- // options: null,
9
- // groups: null,
10
- };
@@ -1,10 +0,0 @@
1
- export default {
2
- bean: 'init.constant',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Init: Constant',
6
- usage: 'vona :init:constant module',
7
- },
8
- // options: null,
9
- // groups: null,
10
- };
@@ -1,10 +0,0 @@
1
- export default {
2
- bean: 'init.error',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Init: Error',
6
- usage: 'vona :init:error module',
7
- },
8
- // options: null,
9
- // groups: null,
10
- };
@@ -1,10 +0,0 @@
1
- export default {
2
- bean: 'init.lib',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Init: Lib',
6
- usage: 'vona :init:lib module',
7
- },
8
- // options: null,
9
- // groups: null,
10
- };
@@ -1,10 +0,0 @@
1
- export default {
2
- bean: 'init.locale',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Init: Locale',
6
- usage: 'vona :init:locale module',
7
- },
8
- // options: null,
9
- // groups: null,
10
- };
@@ -1,10 +0,0 @@
1
- export default {
2
- bean: 'init.main',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Init: Main',
6
- usage: 'vona :init:main module',
7
- },
8
- // options: null,
9
- // groups: null,
10
- };
@@ -1,10 +0,0 @@
1
- export default {
2
- bean: 'init.monkey',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Init: Monkey',
6
- usage: 'vona :init:monkey module',
7
- },
8
- // options: null,
9
- // groups: null,
10
- };
@@ -1,10 +0,0 @@
1
- export default {
2
- bean: 'init.static',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Init: Static Resources',
6
- usage: 'vona :init:static module',
7
- },
8
- // options: null,
9
- // groups: null,
10
- };
@@ -1,10 +0,0 @@
1
- export default {
2
- bean: 'init.types',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Init: Types',
6
- usage: 'vona :init:types module',
7
- },
8
- // options: null,
9
- // groups: null,
10
- };
@@ -1,33 +0,0 @@
1
- export default {
2
- bean: 'tools.crud',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Tools: Crud',
6
- usage: 'vona :tools:crud resourceName [--module=]',
7
- },
8
- options: {
9
- module: {
10
- description: 'module name',
11
- type: 'string',
12
- },
13
- },
14
- groups: {
15
- default: {
16
- questions: {
17
- resourceName: {
18
- type: 'input',
19
- message: 'resourceName',
20
- initial: {
21
- expression: 'context.argv._[0]',
22
- },
23
- required: true,
24
- },
25
- module: {
26
- type: 'input',
27
- message: 'module name',
28
- required: true,
29
- },
30
- },
31
- },
32
- },
33
- };
@@ -1,9 +0,0 @@
1
- export default {
2
- bean: 'tools.deps',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Tools: Deps',
6
- usage: 'vona :tools:deps',
7
- },
8
- options: {},
9
- };
@@ -1,14 +0,0 @@
1
- export default {
2
- bean: 'tools.metadata',
3
- info: {
4
- version: '5.0.0',
5
- title: 'Cli: Tools: Metadata',
6
- usage: 'vona :tools:metadata module1 [module2] [--force]',
7
- },
8
- options: {
9
- force: {
10
- description: 'force',
11
- type: 'boolean',
12
- },
13
- },
14
- };
@@ -1,67 +0,0 @@
1
- import binBuild from "./command/bin.build.js";
2
- import binBuildModule from "./command/bin.buildModule.js";
3
- import binDbReset from "./command/bin.dbReset.js";
4
- import binDev from "./command/bin.dev.js";
5
- import binPlay from "./command/bin.play.js";
6
- import binTest from "./command/bin.test.js";
7
- import binTsc from "./command/bin.tsc.js";
8
- import createBean from "./command/create.bean.js";
9
- import createModule from "./command/create.module.js";
10
- import createProject from "./command/create.project.js";
11
- import createSuite from "./command/create.suite.js";
12
- import createTest from "./command/create.test.js";
13
- import defaultList from "./command/default.list.js";
14
- import initAppMonkey from "./command/init.appMonkey.js";
15
- import initAsset from "./command/init.asset.js";
16
- import initConfig from "./command/init.config.js";
17
- import initConstant from "./command/init.constant.js";
18
- import initError from "./command/init.error.js";
19
- import initLib from "./command/init.lib.js";
20
- import initLocale from "./command/init.locale.js";
21
- import initMain from "./command/init.main.js";
22
- import initMonkey from "./command/init.monkey.js";
23
- import initStatic from "./command/init.static.js";
24
- import initTypes from "./command/init.types.js";
25
- import toolsCrud from "./command/tools.crud.js";
26
- import toolsDeps from "./command/tools.deps.js";
27
- import toolsMetadata from "./command/tools.metadata.js";
28
- export const commands = {
29
- default: {
30
- list: defaultList,
31
- },
32
- bin: {
33
- build: binBuild,
34
- buildModule: binBuildModule,
35
- dbReset: binDbReset,
36
- dev: binDev,
37
- play: binPlay,
38
- test: binTest,
39
- tsc: binTsc,
40
- },
41
- create: {
42
- suite: createSuite,
43
- module: createModule,
44
- project: createProject,
45
- bean: createBean,
46
- test: createTest,
47
- },
48
- init: {
49
- config: initConfig,
50
- locale: initLocale,
51
- constant: initConstant,
52
- error: initError,
53
- monkey: initMonkey,
54
- main: initMain,
55
- static: initStatic,
56
- asset: initAsset,
57
- lib: initLib,
58
- types: initTypes,
59
- appMonkey: initAppMonkey,
60
- },
61
- refactor: {},
62
- tools: {
63
- deps: toolsDeps,
64
- metadata: toolsMetadata,
65
- crud: toolsCrud,
66
- },
67
- };
package/dist/lib/this.js DELETED
@@ -1 +0,0 @@
1
- export const __ThisSetName__ = 'api';
package/dist/lib/utils.js DELETED
@@ -1,80 +0,0 @@
1
- import { createRequire } from 'node:module';
2
- import path from 'node:path';
3
- import { fileURLToPath } from 'node:url';
4
- import { pathToFileURL } from 'node:url';
5
- import fse from 'fs-extra';
6
- import compileTemplate from 'lodash/template.js';
7
- export function getEnvMeta(configMeta) {
8
- return { flavor: configMeta.flavor, mode: configMeta.mode, mine: 'mine' };
9
- }
10
- export function getNodeEnv(mode) {
11
- return mode === 'test' ? 'test' : mode === 'dev' ? 'development' : 'production';
12
- }
13
- export function resolveTemplatePath(file) {
14
- const url = (new URL(path.join('../../templates', file), import.meta.url));
15
- return fileURLToPath(url);
16
- }
17
- export function generateConfigDefine(env, translates) {
18
- const acc = {};
19
- for (const key in env) {
20
- if (!translates || translates.includes(key)) {
21
- acc[`process.env.${key}`] = JSON.stringify(env[key]);
22
- }
23
- else {
24
- acc[`process.env.${key}`] = `'process.env.${key}->app.meta.env.${key}'`;
25
- }
26
- }
27
- return acc;
28
- }
29
- export function getAbsolutePathOfModule(id, postfix = 'index.js') {
30
- const require = createRequire(import.meta.url);
31
- let modulePath = require.resolve(id);
32
- if (postfix) {
33
- const pos = modulePath.lastIndexOf(postfix);
34
- if (pos > -1) {
35
- modulePath = modulePath.substring(0, modulePath.length - postfix.length - 1);
36
- }
37
- }
38
- return modulePath;
39
- }
40
- export function requireModule(id) {
41
- const require = createRequire(import.meta.url);
42
- return require(id);
43
- }
44
- export async function copyTemplateFile(fileSrc, fileDest, variables) {
45
- if (!variables) {
46
- await fse.copyFile(fileSrc, fileDest);
47
- return;
48
- }
49
- // src
50
- const contentSrc = (await fse.readFile(fileSrc, 'utf-8')).toString();
51
- const template = compileTemplate(contentSrc);
52
- // dest
53
- const contentDest = template(variables);
54
- await fse.writeFile(fileDest, contentDest, 'utf-8');
55
- }
56
- export async function loadJSONFile(fileName) {
57
- const pkgContent = (await fse.readFile(fileName)).toString();
58
- return JSON.parse(pkgContent);
59
- }
60
- export async function saveJSONFile(fileName, json) {
61
- await fse.writeFile(fileName, `${JSON.stringify(json, null, 2)}\n`);
62
- }
63
- export function pathToHref(fileName) {
64
- return pathToFileURL(fileName).href;
65
- }
66
- export function getOutDir() {
67
- return process.env.BUILD_OUTDIR || `dist/${process.env.META_FLAVOR}`;
68
- }
69
- export function getOutReleasesDir() {
70
- return `dist-releases/${process.env.META_FLAVOR}-${process.env.APP_VERSION}`;
71
- }
72
- export function copyTemplateIfNeed(fileSrc, fileDest) {
73
- if (!fse.existsSync(fileDest)) {
74
- fse.copyFileSync(fileSrc, fileDest);
75
- }
76
- }
77
- export function getImportEsm() {
78
- // return '--loader=ts-node/esm';
79
- return '--import=./.vona/register.js';
80
- }
package/dist/typings.js DELETED
@@ -1 +0,0 @@
1
- import '@cabloy/cli';