vona-cli-set-api 1.0.335 → 1.0.341

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.
@@ -22,7 +22,7 @@
22
22
  "description": "<%=argv.description%>",
23
23
  "keywords": ["Vona Module"],
24
24
  "author": "<%=argv.author%>",
25
- "files": ["dist", "static"],
25
+ "files": ["dist", "assets"],
26
26
  "scripts": {
27
27
  "clean": "rimraf dist tsconfig.build.tsbuildinfo",
28
28
  "tsc:publish": "npm run clean && vona :bin:buildModule && tsc -p tsconfig.build.json",
@@ -9,7 +9,6 @@ APP_VERSION = 5.0.0
9
9
  SERVER_KEYS = <%=argv.SERVER_KEYS%>
10
10
  SERVER_GLOBALPREFIX = /api
11
11
  SERVER_PUBLICDIR =
12
- SERVER_LOGGERDIR =
13
12
  SERVER_SUBDOMAINOFFSET = 1
14
13
  SERVER_WORKERS =
15
14
  SERVER_LISTEN_HOSTNAME = 0.0.0.0
@@ -23,6 +22,7 @@ PROJECT_DISABLED_SUITES =
23
22
 
24
23
  # logger
25
24
 
25
+ LOGGER_DIR =
26
26
  LOGGER_CLIENT_DEFAULT =
27
27
  LOGGER_DUMMY =
28
28
  LOGGER_ROTATE_ENABLE = true
@@ -46,7 +46,7 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "vona": "^5.0.195"
49
+ "vona": "^5.0.198"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@cabloy/lint": "^5.0.16",
@@ -28,14 +28,12 @@ export default function (appInfo: VonaAppInfo, env: VonaConfigEnv) {
28
28
 
29
29
  // server
30
30
  const publicDir = env.SERVER_PUBLICDIR || getPublicPathPhysicalRoot(appInfo);
31
- const loggerDir = env.SERVER_LOGGERDIR || getLoggerPathPhysicalRoot(appInfo);
32
31
  const subdomainOffset = Number.parseInt(env.SERVER_SUBDOMAINOFFSET || '1');
33
32
  const workers = Number.parseInt(env.SERVER_WORKERS!);
34
33
  config.server = {
35
34
  keys: (env.SERVER_KEYS || '').split(','),
36
35
  globalPrefix: env.SERVER_GLOBALPREFIX || '/api',
37
36
  publicDir,
38
- loggerDir,
39
37
  subdomainOffset,
40
38
  workers,
41
39
  listen: {
@@ -57,7 +55,9 @@ export default function (appInfo: VonaAppInfo, env: VonaConfigEnv) {
57
55
  };
58
56
 
59
57
  // logger
58
+ const loggerDir = env.LOGGER_DIR || getLoggerPathPhysicalRoot(appInfo);
60
59
  config.logger = {
60
+ baseDir: loggerDir,
61
61
  rotate: {
62
62
  enable: env.LOGGER_ROTATE_ENABLE === 'true',
63
63
  options(filename: string) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-home-base",
3
3
  "type": "module",
4
- "version": "5.0.10",
4
+ "version": "5.0.11",
5
5
  "title": "home-base",
6
6
  "vonaModule": {
7
7
  "dependencies": {
@@ -25,8 +25,8 @@
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "files": [
28
- "dist",
29
- "static"
28
+ "assets",
29
+ "dist"
30
30
  ],
31
31
  "scripts": {
32
32
  "clean": "rimraf dist tsconfig.build.tsbuildinfo",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-home-index",
3
3
  "type": "module",
4
- "version": "5.0.8",
4
+ "version": "5.0.9",
5
5
  "title": "home-index",
6
6
  "vonaModule": {
7
7
  "dependencies": {
@@ -25,8 +25,8 @@
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "files": [
28
- "dist",
29
- "static"
28
+ "assets",
29
+ "dist"
30
30
  ],
31
31
  "scripts": {
32
32
  "clean": "rimraf dist tsconfig.build.tsbuildinfo",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-home-user",
3
3
  "type": "module",
4
- "version": "5.0.16",
4
+ "version": "5.0.17",
5
5
  "title": "home-user",
6
6
  "vonaModule": {
7
7
  "fileVersion": 1,
@@ -26,8 +26,8 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "files": [
29
- "dist",
30
- "static"
29
+ "assets",
30
+ "dist"
31
31
  ],
32
32
  "scripts": {
33
33
  "clean": "rimraf dist tsconfig.build.tsbuildinfo",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-suite-a-home",
3
3
  "type": "module",
4
- "version": "5.0.18",
4
+ "version": "5.0.19",
5
5
  "title": "a-home",
6
6
  "description": "",
7
7
  "author": "zhennann",
@@ -8,6 +8,7 @@ import resolveImport from '@rollup/plugin-node-resolve';
8
8
  import replaceImport from '@rollup/plugin-replace';
9
9
  import terserImport from '@rollup/plugin-terser';
10
10
  import fse from 'fs-extra';
11
+ import { globby } from 'globby';
11
12
  import { rimraf } from 'rimraf';
12
13
  import { rollup } from 'rollup';
13
14
  import { generateConfigDefine, getAbsolutePathOfModule, getOutDir, getOutReleasesDir } from "../utils.js";
@@ -71,16 +72,12 @@ export class CliBinBuild extends BeanCliBase {
71
72
  const assetsPath = path.join(outDir, 'assets');
72
73
  for (const relativeName in modulesMeta.modules) {
73
74
  const module = modulesMeta.modules[relativeName];
74
- if (!module.package.files)
75
- continue;
76
- for (const scene of module.package.files) {
77
- if (['src', 'dist', 'cli', 'test'].includes(scene))
78
- continue;
79
- const scenePath = path.join(module.root, scene);
80
- if (fse.existsSync(scenePath)) {
81
- const destPath = path.join(assetsPath, scene, relativeName);
82
- await fse.copy(scenePath, destPath);
83
- }
75
+ const scenes = await globby('assets/*', { cwd: module.root, onlyDirectories: true });
76
+ for (const scene2 of scenes) {
77
+ const scene = scene2.substring('assets/'.length);
78
+ const scenePath = path.join(module.root, scene2);
79
+ const destPath = path.join(assetsPath, scene, relativeName);
80
+ await fse.copy(scenePath, destPath);
84
81
  }
85
82
  }
86
83
  }
@@ -0,0 +1,12 @@
1
+ import type { IModuleInfo } from '@cabloy/module-info';
2
+ import { BeanCliBase } from '@cabloy/cli';
3
+ declare module '@cabloy/cli' {
4
+ interface ICommandArgv {
5
+ module: string;
6
+ moduleInfo: IModuleInfo;
7
+ scene: string;
8
+ }
9
+ }
10
+ export declare class CliInitAsset extends BeanCliBase {
11
+ execute(): Promise<void>;
12
+ }
@@ -0,0 +1,28 @@
1
+ import path from 'node:path';
2
+ import { BeanCliBase } from '@cabloy/cli';
3
+ import fse from 'fs-extra';
4
+ export class CliInitAsset extends BeanCliBase {
5
+ async execute() {
6
+ const { argv } = this.context;
7
+ // super
8
+ await super.execute();
9
+ // module name/info
10
+ const moduleName = argv.module;
11
+ argv.moduleInfo = this.helper.parseModuleInfo(moduleName);
12
+ // check if exists
13
+ const _module = this.helper.findModule(moduleName);
14
+ if (!_module) {
15
+ throw new Error(`module does not exist: ${moduleName}`);
16
+ }
17
+ // target dir
18
+ const targetDir = await this.helper.ensureDir(_module.root);
19
+ // scene
20
+ const scene = argv.scene;
21
+ // directory
22
+ const assetDir = path.join(targetDir, 'assets', scene);
23
+ if (fse.existsSync(assetDir)) {
24
+ throw new Error(`asset exists: ${moduleName}/assets/${scene}`);
25
+ }
26
+ await this.helper.ensureDir(assetDir);
27
+ }
28
+ }
@@ -19,7 +19,7 @@ export class CliInitStatic extends BeanCliBase {
19
19
  }
20
20
  // target dir
21
21
  const targetDir = await this.helper.ensureDir(_module.root);
22
- const staticDir = path.join(targetDir, 'static');
22
+ const staticDir = path.join(targetDir, 'assets/static');
23
23
  if (fse.existsSync(staticDir)) {
24
24
  throw new Error(`static exists: ${moduleName}`);
25
25
  }
@@ -12,6 +12,7 @@ import { CliCreateSuite } from './bean/cli.create.suite.ts';
12
12
  import { CliCreateTest } from './bean/cli.create.test.ts';
13
13
  import { CliDefaultList } from './bean/cli.default.list.ts';
14
14
  import { CliInitAppMonkey } from './bean/cli.init.appMonkey.ts';
15
+ import { CliInitAsset } from './bean/cli.init.asset.ts';
15
16
  import { CliInitConfig } from './bean/cli.init.config.ts';
16
17
  import { CliInitConstant } from './bean/cli.init.constant.ts';
17
18
  import { CliInitError } from './bean/cli.init.error.ts';
@@ -45,6 +46,7 @@ export declare const beans: {
45
46
  'init.monkey': typeof CliInitMonkey;
46
47
  'init.main': typeof CliInitMain;
47
48
  'init.static': typeof CliInitStatic;
49
+ 'init.asset': typeof CliInitAsset;
48
50
  'init.lib': typeof CliInitLib;
49
51
  'init.types': typeof CliInitTypes;
50
52
  'init.appMonkey': typeof CliInitAppMonkey;
package/dist/lib/beans.js CHANGED
@@ -12,6 +12,7 @@ import { CliCreateSuite } from "./bean/cli.create.suite.js";
12
12
  import { CliCreateTest } from "./bean/cli.create.test.js";
13
13
  import { CliDefaultList } from "./bean/cli.default.list.js";
14
14
  import { CliInitAppMonkey } from "./bean/cli.init.appMonkey.js";
15
+ import { CliInitAsset } from "./bean/cli.init.asset.js";
15
16
  import { CliInitConfig } from "./bean/cli.init.config.js";
16
17
  import { CliInitConstant } from "./bean/cli.init.constant.js";
17
18
  import { CliInitError } from "./bean/cli.init.error.js";
@@ -45,6 +46,7 @@ export const beans = {
45
46
  'init.monkey': CliInitMonkey,
46
47
  'init.main': CliInitMain,
47
48
  'init.static': CliInitStatic,
49
+ 'init.asset': CliInitAsset,
48
50
  'init.lib': CliInitLib,
49
51
  'init.types': CliInitTypes,
50
52
  'init.appMonkey': CliInitAppMonkey,
@@ -0,0 +1,34 @@
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
+ scene: {
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;
@@ -0,0 +1,33 @@
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
+ };
@@ -399,6 +399,39 @@ export declare const commands: {
399
399
  usage: string;
400
400
  };
401
401
  };
402
+ asset: {
403
+ bean: string;
404
+ info: {
405
+ version: string;
406
+ title: string;
407
+ usage: string;
408
+ };
409
+ options: {
410
+ module: {
411
+ description: string;
412
+ type: string;
413
+ };
414
+ };
415
+ groups: {
416
+ default: {
417
+ questions: {
418
+ scene: {
419
+ type: string;
420
+ message: string;
421
+ initial: {
422
+ expression: string;
423
+ };
424
+ required: boolean;
425
+ };
426
+ module: {
427
+ type: string;
428
+ message: string;
429
+ required: boolean;
430
+ };
431
+ };
432
+ };
433
+ };
434
+ };
402
435
  lib: {
403
436
  bean: string;
404
437
  info: {
@@ -12,6 +12,7 @@ import createSuite from "./command/create.suite.js";
12
12
  import createTest from "./command/create.test.js";
13
13
  import defaultList from "./command/default.list.js";
14
14
  import initAppMonkey from "./command/init.appMonkey.js";
15
+ import initAsset from "./command/init.asset.js";
15
16
  import initConfig from "./command/init.config.js";
16
17
  import initConstant from "./command/init.constant.js";
17
18
  import initError from "./command/init.error.js";
@@ -52,6 +53,7 @@ export const commands = {
52
53
  monkey: initMonkey,
53
54
  main: initMain,
54
55
  static: initStatic,
56
+ asset: initAsset,
55
57
  lib: initLib,
56
58
  types: initTypes,
57
59
  appMonkey: initAppMonkey,
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.335",
4
+ "version": "1.0.341",
5
5
  "description": "vona cli-set-api",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -61,7 +61,7 @@
61
61
  "ts-node-maintained": "^10.9.6",
62
62
  "urllib": "^4.6.11",
63
63
  "uuid": "^11.1.0",
64
- "vona-core": "^5.0.90",
64
+ "vona-core": "^5.0.93",
65
65
  "why-is-node-running": "^3.2.2",
66
66
  "yargs-parser": "^21.1.1"
67
67
  },