vona-cli-set-api 1.0.244 → 1.0.246

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.144"
48
+ "vona": "^5.0.145"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@cabloy/lint": "^5.0.16",
@@ -5,3 +5,24 @@ packages:
5
5
  - 'src/suite/*/modules/*'
6
6
  - 'src/suite-vendor/*'
7
7
  - 'src/suite-vendor/*/modules/*'
8
+
9
+ hoist: true
10
+ hoistWorkspacePackages: true
11
+ linkWorkspacePackages: 'deep'
12
+ preferWorkspacePackages: true
13
+ autoInstallPeers: true
14
+ publicHoistPattern:
15
+ - '*babel*'
16
+ - '*@babel*'
17
+ - '*eslint*'
18
+ - '*types*'
19
+ - 'lerna'
20
+ - 'vona'
21
+ - '*vona*'
22
+ - 'cabloy'
23
+ - '@cabloy'
24
+ - '*cabloy*'
25
+ - '*@cabloy*'
26
+ - '*why-is-node-running*'
27
+ - '*ts-node*'
28
+ - 'zod'
@@ -2,6 +2,7 @@ import path from 'node:path';
2
2
  import { BeanCliBase } from '@cabloy/cli';
3
3
  import fse from 'fs-extra';
4
4
  import { rimraf } from 'rimraf';
5
+ import { getImportEsm } from "../utils.js";
5
6
  import { generateVonaMeta } from "./toolsBin/generateVonaMeta.js";
6
7
  export class CliBinDbReset extends BeanCliBase {
7
8
  async execute() {
@@ -34,7 +35,7 @@ export class CliBinDbReset extends BeanCliBase {
34
35
  }
35
36
  // run
36
37
  let args = [];
37
- args = args.concat(['--experimental-transform-types', '--loader=ts-node/esm', testFile, projectPath]);
38
+ args = args.concat(['--experimental-transform-types', getImportEsm(), testFile, projectPath]);
38
39
  await this.helper.spawnExe({
39
40
  cmd: 'node',
40
41
  args,
@@ -1,6 +1,7 @@
1
1
  import path from 'node:path';
2
2
  import { BeanCliBase } from '@cabloy/cli';
3
3
  import fse from 'fs-extra';
4
+ import { getImportEsm } from "../utils.js";
4
5
  import { generateVonaMeta } from "./toolsBin/generateVonaMeta.js";
5
6
  export class CliBinDemo extends BeanCliBase {
6
7
  async execute() {
@@ -34,7 +35,7 @@ export class CliBinDemo extends BeanCliBase {
34
35
  }
35
36
  // run
36
37
  let args = [];
37
- args = args.concat(['--experimental-transform-types', '--loader=ts-node/esm', testFile, projectPath]);
38
+ args = args.concat(['--experimental-transform-types', getImportEsm(), testFile, projectPath]);
38
39
  const pos = process.argv.indexOf(':bin:demo');
39
40
  if (pos > -1) {
40
41
  args = args.concat(process.argv.slice(pos + 1));
@@ -2,6 +2,7 @@ import path from 'node:path';
2
2
  import { BeanCliBase } from '@cabloy/cli';
3
3
  import nodemon from 'nodemon';
4
4
  import { rimraf } from 'rimraf';
5
+ import { getImportEsm } from "../utils.js";
5
6
  import { generateVonaMeta } from "./toolsBin/generateVonaMeta.js";
6
7
  export class CliBinDev extends BeanCliBase {
7
8
  async execute() {
@@ -32,7 +33,8 @@ export class CliBinDev extends BeanCliBase {
32
33
  script: '.vona/bootstrap.ts',
33
34
  cwd: projectPath,
34
35
  exec: 'node',
35
- execArgs: ['--experimental-transform-types', '--loader=ts-node/esm'],
36
+ execArgs: ['--experimental-transform-types', getImportEsm()],
37
+ // execArgs: ['--experimental-transform-types', getImportEsm(), '--trace-deprecation'],
36
38
  // signal: 'SIGHUP',
37
39
  });
38
40
  nodemon.on('quit', () => {
@@ -3,7 +3,7 @@ import { BeanCliBase } from '@cabloy/cli';
3
3
  import { catchError } from '@cabloy/utils';
4
4
  import fse from 'fs-extra';
5
5
  import { rimraf } from 'rimraf';
6
- import { getAbsolutePathOfModule } from "../utils.js";
6
+ import { getAbsolutePathOfModule, getImportEsm } from "../utils.js";
7
7
  import { generateVonaMeta } from "./toolsBin/generateVonaMeta.js";
8
8
  export class CliBinTest extends BeanCliBase {
9
9
  async execute() {
@@ -48,7 +48,7 @@ export class CliBinTest extends BeanCliBase {
48
48
  if (process.env.TEST_WHYISNODERUNNING === 'true') {
49
49
  args.push('--import=why-is-node-running/include');
50
50
  }
51
- args = args.concat(['--experimental-transform-types', '--loader=ts-node/esm', testFile, projectPath, (!!argv.coverage).toString(), patterns.join(',')]);
51
+ args = args.concat(['--experimental-transform-types', getImportEsm(), testFile, projectPath, (!!argv.coverage).toString(), patterns.join(',')]);
52
52
  // ignore error special in windows
53
53
  await catchError(() => {
54
54
  return this.helper.spawnExe({
@@ -13,6 +13,8 @@ export async function generateEntryFiles(configMeta, configOptions, modulesMeta,
13
13
  await __generateEnvJson();
14
14
  // app
15
15
  await __generateApp();
16
+ // others
17
+ await __generateOthers();
16
18
  // zod
17
19
  await generateZod(configOptions);
18
20
  //////////////////////////////
@@ -58,6 +60,16 @@ export async function generateEntryFiles(configMeta, configOptions, modulesMeta,
58
60
  await copyTemplateFile(fileSrc, fileDest, vars);
59
61
  }
60
62
  }
63
+ async function __generateOthers() {
64
+ const templates = [['app/register.js', 'register.js']];
65
+ for (const [templateSrc, templateDest] of templates) {
66
+ const fileSrc = resolveTemplatePath(templateSrc);
67
+ const fileDest = path.join(configOptions.appDir, configOptions.runtimeDir, templateDest);
68
+ await fse.ensureDir(path.join(configOptions.appDir, configOptions.runtimeDir));
69
+ const vars = {};
70
+ await copyTemplateFile(fileSrc, fileDest, vars);
71
+ }
72
+ }
61
73
  async function __generateModulesMeta() {
62
74
  // modules
63
75
  const { modules, modulesArray } = modulesMeta;
@@ -16,3 +16,4 @@ export declare function pathToHref(fileName: string): string;
16
16
  export declare function getOutDir(): string;
17
17
  export declare function getOutReleasesDir(): string;
18
18
  export declare function copyTemplateIfNeed(fileSrc: string, fileDest: string): void;
19
+ export declare function getImportEsm(): string;
package/dist/lib/utils.js CHANGED
@@ -74,3 +74,7 @@ export function copyTemplateIfNeed(fileSrc, fileDest) {
74
74
  fse.copyFileSync(fileSrc, fileDest);
75
75
  }
76
76
  }
77
+ export function getImportEsm() {
78
+ // return '--loader=ts-node/esm';
79
+ return '--import=\'./.vona/register.js\'';
80
+ }
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.244",
4
+ "version": "1.0.246",
5
5
  "description": "vona cli-set-api",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -31,7 +31,7 @@
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.47",
34
+ "@cabloy/cli": "^3.0.48",
35
35
  "@cabloy/dotenv": "^1.1.10",
36
36
  "@cabloy/extend": "^3.1.10",
37
37
  "@cabloy/module-glob": "^5.2.26",
@@ -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.65",
64
+ "vona-core": "^5.0.66",
65
65
  "why-is-node-running": "^3.2.2",
66
66
  "yargs-parser": "^21.1.1"
67
67
  },
@@ -0,0 +1,4 @@
1
+ import { register } from 'node:module';
2
+ import { pathToFileURL } from 'node:url';
3
+
4
+ register('ts-node/esm', pathToFileURL('./'));
@@ -1,19 +0,0 @@
1
- hoist = true
2
- hoist-workspace-packages = true
3
- public-hoist-pattern[]=*babel*
4
- public-hoist-pattern[]=*@babel*
5
- public-hoist-pattern[]=*eslint*
6
- public-hoist-pattern[]=*types*
7
- public-hoist-pattern[]=lerna
8
- public-hoist-pattern[]=vona
9
- public-hoist-pattern[]=*vona*
10
- public-hoist-pattern[]=cabloy
11
- public-hoist-pattern[]=@cabloy
12
- public-hoist-pattern[]=*cabloy*
13
- public-hoist-pattern[]=*@cabloy*
14
- public-hoist-pattern[]=*why-is-node-running*
15
- public-hoist-pattern[]=*ts-node*
16
- public-hoist-pattern[]=zod
17
- link-workspace-packages = 'deep'
18
- prefer-workspace-packages = true
19
- auto-install-peers = true