vona-cli-set-api 1.1.166 → 1.1.168

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.
package/dist/index.js CHANGED
@@ -944,13 +944,6 @@ class CliBinDev extends BeanCliBase {
944
944
  console.log('App restarted due to: ', files);
945
945
  });
946
946
  });
947
- // await this.helper.spawnExe({
948
- // cmd: 'node',
949
- // args: ['--experimental-transform-types', '--loader=ts-node/esm', '.vona/bootstrap.ts'],
950
- // options: {
951
- // cwd: projectPath,
952
- // },
953
- // });
954
947
  }
955
948
  }
956
949
 
@@ -1049,6 +1042,27 @@ class CliBinPlay extends BeanCliBase {
1049
1042
  }
1050
1043
  }
1051
1044
 
1045
+ async function runTestChild(args, projectPath) {
1046
+ const child = spawn(process.execPath, args, {
1047
+ cwd: projectPath,
1048
+ stdio: 'inherit'
1049
+ });
1050
+ const onInterrupt = () => child.kill('SIGINT');
1051
+ const onTerminate = () => child.kill('SIGTERM');
1052
+ process.on('SIGINT', onInterrupt);
1053
+ process.on('SIGTERM', onTerminate);
1054
+ try {
1055
+ await new Promise((resolve, reject) => {
1056
+ child.once('error', reject);
1057
+ child.once('close', (code, signal) => {
1058
+ if (code === 0) resolve();else reject(new Error(`Test child exited: ${signal ?? code}`));
1059
+ });
1060
+ });
1061
+ } finally {
1062
+ process.off('SIGINT', onInterrupt);
1063
+ process.off('SIGTERM', onTerminate);
1064
+ }
1065
+ }
1052
1066
  class CliBinTest extends BeanCliBase {
1053
1067
  async execute() {
1054
1068
  const {
@@ -1114,13 +1128,7 @@ class CliBinTest extends BeanCliBase {
1114
1128
  }
1115
1129
  args = args.concat([getImportEsm(resolveVonaLocalPaths(projectPath, 'test').generatedDir), testFile, projectPath, (!!argv.coverage).toString(), patterns.join(',')]);
1116
1130
  // args = args.concat(['--experimental-transform-types', getImportEsm(), testFile, projectPath, (!!argv.coverage).toString(), patterns.join(',')]);
1117
- await this.helper.spawnExe({
1118
- cmd: 'node',
1119
- args,
1120
- options: {
1121
- cwd: projectPath
1122
- }
1123
- });
1131
+ await runTestChild(args, projectPath);
1124
1132
  }
1125
1133
  async _outputCoverageReportViewer(projectPath) {
1126
1134
  // lcovCliFile
@@ -1165,62 +1173,6 @@ class CliBinTest extends BeanCliBase {
1165
1173
  }
1166
1174
  }
1167
1175
 
1168
- class CliBinTsc extends BeanCliBase {
1169
- async execute() {
1170
- const {
1171
- argv
1172
- } = this.context;
1173
- // super
1174
- await super.execute();
1175
- const projectPath = argv.projectPath;
1176
- const force = argv.force;
1177
- await this._tsc(projectPath, force);
1178
- }
1179
- async _tsc(projectPath, force) {
1180
- const suiteNames = Object.keys(this.modulesMeta.suites).filter(suiteName => !this.modulesMeta.suites[suiteName].info.node_modules);
1181
- const modulesArray = this.modulesMeta.modulesArray.filter(item => !item.suite && !item.info.node_modules);
1182
- // count
1183
- const count = 1 + suiteNames.length + modulesArray.length;
1184
- // begin
1185
- let counter = 0;
1186
- const timeBegin = Date.now();
1187
- // eslint-disable-next-line
1188
- console.log('===> build begin');
1189
- // args
1190
- const tscArgs = ['-b'];
1191
- if (force) {
1192
- tscArgs.push('--force');
1193
- }
1194
- // tsc: project
1195
- // eslint-disable-next-line
1196
- console.log(`===> ${++counter}/${count} project`);
1197
- await this.helper.processHelper.tsc(tscArgs, {
1198
- cwd: projectPath
1199
- });
1200
- // suites
1201
- for (const key of suiteNames) {
1202
- const suite = this.modulesMeta.suites[key];
1203
- // eslint-disable-next-line
1204
- console.log(`===> ${++counter}/${count} suite: ${suite.info.originalName}`);
1205
- await this.helper.processHelper.tsc(tscArgs, {
1206
- cwd: suite.root
1207
- });
1208
- }
1209
- // modules
1210
- for (const module of modulesArray) {
1211
- // eslint-disable-next-line
1212
- console.log(`===> ${++counter}/${count} module: ${module.info.originalName}`);
1213
- await this.helper.processHelper.tsc(tscArgs, {
1214
- cwd: module.root
1215
- });
1216
- }
1217
- // end
1218
- const timeEnd = Date.now();
1219
- // eslint-disable-next-line
1220
- console.log(`===> tsc end: ${(timeEnd - timeBegin) / 1000}s`);
1221
- }
1222
- }
1223
-
1224
1176
  const __ThisSetName__ = 'api';
1225
1177
 
1226
1178
  let __snippetsPathPrefix;
@@ -3492,7 +3444,6 @@ const beans = {
3492
3444
  'bin.play': CliBinPlay,
3493
3445
  'bin.dev': CliBinDev,
3494
3446
  'bin.test': CliBinTest,
3495
- 'bin.tsc': CliBinTsc,
3496
3447
  'create.suite': CliCreateSuite,
3497
3448
  'create.bean': CliCreateBean,
3498
3449
  'create.module': CliCreateModule,
@@ -3659,21 +3610,6 @@ var binTest = {
3659
3610
  }
3660
3611
  };
3661
3612
 
3662
- var binTsc = {
3663
- bean: 'bin.tsc',
3664
- info: {
3665
- version: '5.0.0',
3666
- title: 'Cli: Bin: Tsc',
3667
- usage: 'npm run vona :bin:tsc -- [--force]'
3668
- },
3669
- options: {
3670
- force: {
3671
- description: 'force',
3672
- type: 'boolean'
3673
- }
3674
- }
3675
- };
3676
-
3677
3613
  var createBean = {
3678
3614
  bean: 'create.bean',
3679
3615
  info: {
@@ -4195,8 +4131,7 @@ const commands = {
4195
4131
  dbReset: binDbReset,
4196
4132
  dev: binDev,
4197
4133
  play: binPlay,
4198
- test: binTest,
4199
- tsc: binTsc
4134
+ test: binTest
4200
4135
  },
4201
4136
  create: {
4202
4137
  suite: createSuite,
@@ -7,6 +7,7 @@ declare module '@cabloy/cli' {
7
7
  flavor?: VonaMetaFlavor;
8
8
  }
9
9
  }
10
+ export declare function runTestChild(args: string[], projectPath: string): Promise<void>;
10
11
  export declare class CliBinTest extends BeanCliBase {
11
12
  execute(): Promise<void>;
12
13
  _test(projectPath: string): Promise<void>;
@@ -5,7 +5,6 @@ import { CliBinDbReset } from './bean/cli.bin.dbReset.ts';
5
5
  import { CliBinDev } from './bean/cli.bin.dev.ts';
6
6
  import { CliBinPlay } from './bean/cli.bin.play.ts';
7
7
  import { CliBinTest } from './bean/cli.bin.test.ts';
8
- import { CliBinTsc } from './bean/cli.bin.tsc.ts';
9
8
  import { CliCreateBean } from './bean/cli.create.bean.ts';
10
9
  import { CliCreateModule } from './bean/cli.create.module.ts';
11
10
  import { CliCreateSuite } from './bean/cli.create.suite.ts';
@@ -37,7 +36,6 @@ export declare const beans: {
37
36
  'bin.play': typeof CliBinPlay;
38
37
  'bin.dev': typeof CliBinDev;
39
38
  'bin.test': typeof CliBinTest;
40
- 'bin.tsc': typeof CliBinTsc;
41
39
  'create.suite': typeof CliCreateSuite;
42
40
  'create.bean': typeof CliCreateBean;
43
41
  'create.module': typeof CliCreateModule;
@@ -156,20 +156,6 @@ export declare const commands: {
156
156
  };
157
157
  };
158
158
  };
159
- tsc: {
160
- bean: string;
161
- info: {
162
- version: string;
163
- title: string;
164
- usage: string;
165
- };
166
- options: {
167
- force: {
168
- description: string;
169
- type: string;
170
- };
171
- };
172
- };
173
159
  };
174
160
  create: {
175
161
  suite: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-cli-set-api",
3
- "version": "1.1.166",
4
- "gitHead": "c703cb481fdf9d50a4f3eb3971e7b7c20a79619d",
3
+ "version": "1.1.168",
4
+ "gitHead": "ac1ffe7f3effb85c5d4896bb26c2c4e8751aa089",
5
5
  "description": "vona cli-set-api",
6
6
  "keywords": [
7
7
  "framework",
@@ -45,10 +45,10 @@
45
45
  "@babel/plugin-proposal-decorators": "^7.29.0",
46
46
  "@babel/plugin-transform-class-properties": "^7.28.6",
47
47
  "@babel/plugin-transform-typescript": "^7.28.6",
48
- "@cabloy/cli": "^3.1.30",
48
+ "@cabloy/cli": "^3.1.31",
49
49
  "@cabloy/dotenv": "^1.2.9",
50
50
  "@cabloy/extend": "^3.2.8",
51
- "@cabloy/module-glob": "^5.3.18",
51
+ "@cabloy/module-glob": "^5.3.19",
52
52
  "@cabloy/module-info": "^2.0.3",
53
53
  "@cabloy/utils": "^2.1.27",
54
54
  "@cabloy/word-utils": "^2.1.8",
@@ -61,6 +61,7 @@
61
61
  "@rollup/plugin-replace": "^6.0.3",
62
62
  "@rollup/plugin-terser": "^1.0.0",
63
63
  "@rollup/plugin-typescript": "^12.3.0",
64
+ "@swc-node/register": "^1.12.1",
64
65
  "babel-plugin-transform-typescript-metadata": "^0.3.2",
65
66
  "babel-plugin-vona-bean-module": "^1.1.9",
66
67
  "chalk": "^3.0.0",
@@ -74,7 +75,6 @@
74
75
  "randomatic": "^3.1.1",
75
76
  "rimraf": "^6.1.3",
76
77
  "rollup": "^4.60.1",
77
- "ts-node-maintained": "^10.9.6",
78
78
  "urllib": "^4.9.0",
79
79
  "uuid": "^11.1.0",
80
80
  "vona-core": "^5.1.50",
@@ -1,4 +1,4 @@
1
1
  import { register } from 'node:module';
2
2
  import { pathToFileURL } from 'node:url';
3
3
 
4
- register('ts-node-maintained/esm', pathToFileURL('./'));
4
+ register('@swc-node/register/esm', pathToFileURL('./'));
@@ -12,8 +12,5 @@
12
12
  "src/backend/typing"
13
13
  ],
14
14
  "exclude": [],
15
- "ts-node": {
16
- "swc": true
17
- },
18
15
  "references": []
19
16
  }
@@ -12,9 +12,6 @@
12
12
  "src/backend/typing"
13
13
  ],
14
14
  "exclude": [],
15
- "ts-node": {
16
- "swc": true
17
- },
18
15
  "references": [
19
16
  {
20
17
  "path": "packages-utils/compose"
@@ -1,10 +0,0 @@
1
- import { BeanCliBase } from '@cabloy/cli';
2
- declare module '@cabloy/cli' {
3
- interface ICommandArgv {
4
- force: boolean;
5
- }
6
- }
7
- export declare class CliBinTsc extends BeanCliBase {
8
- execute(): Promise<void>;
9
- _tsc(projectPath: string, force: boolean): Promise<void>;
10
- }
@@ -1,15 +0,0 @@
1
- declare const _default: {
2
- bean: string;
3
- info: {
4
- version: string;
5
- title: string;
6
- usage: string;
7
- };
8
- options: {
9
- force: {
10
- description: string;
11
- type: string;
12
- };
13
- };
14
- };
15
- export default _default;