vona-cli-set-api 1.0.339 → 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",
@@ -46,7 +46,7 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "vona": "^5.0.197"
49
+ "vona": "^5.0.198"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@cabloy/lint": "^5.0.16",
@@ -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
  }
@@ -9,5 +9,4 @@ declare module '@cabloy/cli' {
9
9
  }
10
10
  export declare class CliInitAsset extends BeanCliBase {
11
11
  execute(): Promise<void>;
12
- _setPackageInfo(modulePath: string, scene: string): Promise<void>;
13
12
  }
@@ -19,28 +19,10 @@ export class CliInitAsset extends BeanCliBase {
19
19
  // scene
20
20
  const scene = argv.scene;
21
21
  // directory
22
- const assetDir = path.join(targetDir, scene);
22
+ const assetDir = path.join(targetDir, 'assets', scene);
23
23
  if (fse.existsSync(assetDir)) {
24
- throw new Error(`asset exists: ${moduleName}/${scene}`);
24
+ throw new Error(`asset exists: ${moduleName}/assets/${scene}`);
25
25
  }
26
26
  await this.helper.ensureDir(assetDir);
27
- // package.json
28
- await this._setPackageInfo(targetDir, scene);
29
- }
30
- async _setPackageInfo(modulePath, scene) {
31
- const pkgFile = path.join(modulePath, 'package.json');
32
- const pkg = await this.helper.loadJSONFile(pkgFile);
33
- if (!pkg.files)
34
- pkg.files = [];
35
- let changed;
36
- // files
37
- if (!pkg.files.includes(scene)) {
38
- pkg.files.push(scene);
39
- changed = true;
40
- }
41
- // save
42
- if (changed) {
43
- await this.helper.saveJSONFile(pkgFile, pkg);
44
- }
45
27
  }
46
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
  }
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.339",
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.92",
64
+ "vona-core": "^5.0.93",
65
65
  "why-is-node-running": "^3.2.2",
66
66
  "yargs-parser": "^21.1.1"
67
67
  },