cabloy 5.1.222 → 5.1.224

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 (43) hide show
  1. package/.cabloy-version +1 -1
  2. package/.github/workflows/vona-test-sqlite3.yml +1 -1
  3. package/.github/workflows/vona-tsc.yml +4 -3
  4. package/CHANGELOG.md +23 -0
  5. package/lint-staged.config.mjs +2 -0
  6. package/oxfmt.config.ts +2 -0
  7. package/oxlint.config.ts +2 -0
  8. package/package.json +11 -2
  9. package/repo-docs/reference/repo-scripts.md +31 -0
  10. package/scripts/release.ts +3 -0
  11. package/scripts/runIsolatedTest.test.ts +1 -1
  12. package/scripts/typecheck.test.ts +199 -0
  13. package/scripts/typecheck.ts +20 -0
  14. package/vona/package.original.json +3 -0
  15. package/vona/packages-cli/cli/package.json +1 -1
  16. package/vona/packages-cli/cli-set-api/package.json +2 -2
  17. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.bin.dev.ts +0 -7
  18. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.bin.test.ts +22 -7
  19. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.bin.tsc.ts +34 -5
  20. package/vona/packages-cli/cli-set-api/src/lib/bean/toolsBin/testCleanupProcess.test.ts +1 -1
  21. package/vona/packages-cli/cli-set-api/src/lib/bean/toolsBin/testCleanupProcess.ts +1 -1
  22. package/vona/packages-cli/cli-set-api/src/lib/command/bin.tsc.ts +11 -1
  23. package/vona/packages-cli/cli-set-api/src/lib/typescriptRunner.ts +61 -0
  24. package/vona/packages-cli/cli-set-api/templates/app/register.js +1 -1
  25. package/vona/packages-cli/cli-set-api/templates/config/_tsconfig_project.json +0 -3
  26. package/vona/packages-cli/cli-set-api/templates/config/_tsconfig_source.json +0 -3
  27. package/vona/packages-cli/cli-set-api/test/binTestPatterns.test.ts +57 -0
  28. package/vona/packages-vona/vona/package.json +1 -1
  29. package/vona/pnpm-lock.yaml +455 -117
  30. package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/package.json +1 -1
  31. package/vona/src/suite-vendor/a-cabloy/package.json +2 -2
  32. package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +3 -3
  33. package/vona/src/suite-vendor/a-vona/modules/a-orm/package.json +1 -1
  34. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/common/utils.ts +2 -1
  35. package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +1 -1
  36. package/vona/src/suite-vendor/a-vona/modules/a-redis/package.json +1 -1
  37. package/vona/src/suite-vendor/a-vona/modules/a-redis/test/redisCleanup.test.ts +1 -1
  38. package/vona/src/suite-vendor/a-vona/modules/a-startup/package.json +1 -1
  39. package/vona/src/suite-vendor/a-vona/modules/a-startup/test/devSeed.test.ts +1 -1
  40. package/vona/src/suite-vendor/a-vona/package.json +1 -1
  41. package/vona/tsconfig.json +1 -4
  42. package/zova/package.original.json +2 -0
  43. package/zova/pnpm-lock.yaml +47 -11
@@ -0,0 +1,61 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { readFileSync } from 'node:fs';
3
+ import { createRequire } from 'node:module';
4
+ import path from 'node:path';
5
+
6
+ export type TypeScriptCompiler = 'native' | 'typescript';
7
+
8
+ export function resolveTypeScriptCompiler(
9
+ compiler: TypeScriptCompiler,
10
+ projectPath: string,
11
+ ): string {
12
+ const packageName = compiler === 'native' ? '@typescript/native' : 'typescript';
13
+ const require = createRequire(path.resolve(projectPath, 'package.json'));
14
+ let manifestPath: string;
15
+ try {
16
+ manifestPath = require.resolve(`${packageName}/package.json`);
17
+ } catch (cause) {
18
+ throw new Error(
19
+ `Cannot resolve ${packageName}. Install the ${compiler === 'native' ? 'native TypeScript alias (npm:typescript@7.0.2)' : 'TypeScript package'} in the project or its repository root.`,
20
+ { cause },
21
+ );
22
+ }
23
+ const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
24
+ if (typeof manifest.bin?.tsc !== 'string') {
25
+ throw new TypeError(`${packageName} does not declare a tsc executable.`);
26
+ }
27
+ return path.resolve(path.dirname(manifestPath), manifest.bin.tsc);
28
+ }
29
+
30
+ export async function runTypeScript(
31
+ compiler: TypeScriptCompiler,
32
+ args: string[],
33
+ { projectPath, cwd = projectPath }: { projectPath: string; cwd?: string },
34
+ ): Promise<void> {
35
+ const executable = resolveTypeScriptCompiler(compiler, projectPath);
36
+ await new Promise<void>((resolve, reject) => {
37
+ const child = spawn(process.execPath, [executable, ...args], {
38
+ cwd,
39
+ stdio: 'inherit',
40
+ shell: false,
41
+ });
42
+ child.once('error', reject);
43
+ child.once('close', (code, signal) => {
44
+ if (code === 0) {
45
+ resolve();
46
+ } else {
47
+ reject(
48
+ Object.assign(
49
+ new Error(
50
+ `TypeScript (${compiler}) failed: ${signal ? `signal ${signal}` : `exit code ${code}`}`,
51
+ ),
52
+ {
53
+ exitCode: code ?? 1,
54
+ signal,
55
+ },
56
+ ),
57
+ );
58
+ }
59
+ });
60
+ });
61
+ }
@@ -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"
@@ -0,0 +1,57 @@
1
+ import assert from 'node:assert/strict';
2
+ import { mkdtempSync, mkdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
3
+ import { tmpdir } from 'node:os';
4
+ import { join } from 'node:path';
5
+ import { it } from 'node:test';
6
+
7
+ import { runTestChild } from '../src/lib/bean/cli.bin.test.ts';
8
+
9
+ it('preserves literal test patterns and arguments through a real Node child', async () => {
10
+ const projectPath = mkdtempSync(join(tmpdir(), 'vona test argv '));
11
+ try {
12
+ const probe = join(projectPath, 'argv probe.mjs');
13
+ const output = join(projectPath, 'argv.json');
14
+ const fixtures = join(projectPath, 'test', 'support');
15
+ mkdirSync(fixtures, { recursive: true });
16
+ for (const name of ['first.ts', 'second.ts']) writeFileSync(join(fixtures, name), '');
17
+ writeFileSync(
18
+ probe,
19
+ `import { writeFileSync } from 'node:fs';
20
+ writeFileSync(process.argv[2], JSON.stringify({ argv: process.argv.slice(3), cwd: process.cwd() }));
21
+ `,
22
+ );
23
+ const args = [
24
+ 'test/**/*.ts',
25
+ 'test/*.ts,test/support/*.ts',
26
+ '',
27
+ 'a value with spaces',
28
+ 'literal & ; $HOME $(echo unexpected) %PATH% [brackets]',
29
+ ];
30
+ await runTestChild([probe, output, ...args], projectPath);
31
+ const observed = JSON.parse(readFileSync(output, 'utf8'));
32
+ assert.deepEqual(observed.argv, args);
33
+ assert.equal(realpathSync(observed.cwd), realpathSync(projectPath));
34
+ } finally {
35
+ rmSync(projectPath, { recursive: true, force: true });
36
+ }
37
+ });
38
+
39
+ it('rejects child failure and spawn failure without leaking signal listeners', async () => {
40
+ const projectPath = mkdtempSync(join(tmpdir(), 'vona test exit '));
41
+ try {
42
+ const listeners = [process.listenerCount('SIGINT'), process.listenerCount('SIGTERM')];
43
+ await assert.rejects(
44
+ runTestChild(['--eval', 'process.exit(7)'], projectPath),
45
+ /Test child exited: 7/,
46
+ );
47
+ await assert.rejects(runTestChild(['--eval', ''], join(projectPath, 'missing')), {
48
+ code: 'ENOENT',
49
+ });
50
+ assert.deepEqual(
51
+ [process.listenerCount('SIGINT'), process.listenerCount('SIGTERM')],
52
+ listeners,
53
+ );
54
+ } finally {
55
+ rmSync(projectPath, { recursive: true, force: true });
56
+ }
57
+ });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vona",
3
- "version": "5.1.113",
3
+ "version": "5.1.114",
4
4
  "gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
5
5
  "description": "Vona is an intuitive, elegant and powerful Node.js framework for rapidly developing enterprise applications of any size",
6
6
  "keywords": [