cabloy 5.1.225 → 5.1.227

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 (89) hide show
  1. package/.cabloy-version +1 -1
  2. package/.github/workflows/vona-tsc.yml +2 -2
  3. package/CHANGELOG.md +22 -0
  4. package/oxlint.config.ts +5 -1
  5. package/package.json +5 -11
  6. package/repo-agent-governance/managed-assets.json +9 -9
  7. package/repo-agent-governance/policies/repository.md +2 -0
  8. package/repo-agent-governance/skills/cabloy-spec-execution/references/execution-protocol.md +6 -2
  9. package/repo-agent-governance/skills/cabloy-spec-generation/SKILL.md +1 -1
  10. package/repo-docs/ai/ai-spec-driven-development.md +6 -2
  11. package/repo-docs/reference/repo-scripts.md +18 -19
  12. package/scripts/oxlintPlugins.ts +25 -0
  13. package/scripts/typecheck.test.ts +107 -94
  14. package/scripts/typecheck.ts +1 -1
  15. package/vona/oxlint.config.ts +5 -1
  16. package/vona/package.original.json +5 -6
  17. package/vona/packages-cli/cabloy-cli/package.json +1 -1
  18. package/vona/packages-cli/cli/package.json +1 -1
  19. package/vona/packages-cli/cli-set-api/package.json +1 -1
  20. package/vona/packages-cli/cli-set-api/src/lib/beans.ts +0 -2
  21. package/vona/packages-cli/cli-set-api/src/lib/commands.ts +0 -2
  22. package/vona/packages-utils/lint/package.json +3 -3
  23. package/vona/packages-utils/module-glob/package.json +2 -1
  24. package/vona/packages-utils/module-glob/src/index.ts +2 -26
  25. package/vona/packages-utils/module-glob/src/suites.ts +31 -0
  26. package/vona/packages-utils/module-glob/test/suites.test.ts +108 -0
  27. package/vona/packages-vona/vona/package.json +1 -1
  28. package/vona/pnpm-lock.yaml +254 -182
  29. package/vona/pnpm-workspace.yaml +0 -1
  30. package/vona/src/suite/a-commerce/modules/commerce-catalog/test/product.test.ts +2 -0
  31. package/vona/src/suite/a-commerce/modules/commerce-catalog/test/sku.test.ts +1 -0
  32. package/vona/src/suite/a-commerce/modules/commerce-catalog/test/skuUniqueness.test.ts +9 -10
  33. package/vona/src/suite/a-commerce/modules/commerce-member/test/addressOwnership.test.ts +43 -16
  34. package/vona/src/suite/a-commerce/modules/commerce-member/test/addressPresentation.test.ts +7 -1
  35. package/vona/src/suite/a-commerce/modules/commerce-payment/test/paymentIndexes.test.ts +2 -1
  36. package/vona/src/suite/a-commerce/modules/commerce-promotion/test/couponReservation.test.ts +18 -9
  37. package/vona/src/suite/a-commerce/modules/commerce-trade/test/cartOwnership.test.ts +28 -11
  38. package/vona/src/suite/a-commerce/modules/commerce-trade/test/checkoutReservation.test.ts +33 -21
  39. package/vona/src/suite/a-commerce/modules/commerce-trade/test/checkoutTransaction.test.ts +6 -5
  40. package/vona/src/suite/a-commerce/modules/commerce-trade/test/orderSnapshot.test.ts +33 -25
  41. package/vona/src/suite/a-commerce/modules/commerce-trade/test/paymentOutcome.test.ts +31 -20
  42. package/vona/src/suite/a-commerce/modules/commerce-trade/test/refundLifecycle.test.ts +30 -30
  43. package/vona/src/suite/a-commerce/modules/commerce-trade/test/reservationExpiry.test.ts +24 -26
  44. package/vona/src/suite/a-commerce/modules/commerce-trade/test/shipment.test.ts +7 -2
  45. package/vona/src/suite/a-commerce/modules/commerce-trade/test/shipmentRefundRace.test.ts +15 -5
  46. package/vona/src/suite/a-commerce/modules/commerce-trade/test/stockBalance.test.ts +7 -5
  47. package/vona/src/suite/a-home/modules/home-user/test/account.test.ts +2 -2
  48. package/vona/src/suite/a-home/modules/home-user/test/accountActivation.test.ts +2 -1
  49. package/vona/src/suite/a-home/modules/home-user/test/accountOpenapi.test.ts +53 -42
  50. package/vona/src/suite/a-home/modules/home-user/test/accountPasswordReset.test.ts +1 -0
  51. package/vona/src/suite/a-home/modules/home-user/test/accountPasswordSet.test.ts +2 -1
  52. package/vona/src/suite/a-training/modules/training-record/test/record.test.ts +12 -7
  53. package/vona/src/suite/a-training/modules/training-student/test/student.test.ts +23 -11
  54. package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/package.json +1 -1
  55. package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/test/rbacCatalogGuard.test.ts +5 -1
  56. package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/package.json +1 -1
  57. package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/test/ssrMenuVisibility.test.ts +3 -3
  58. package/vona/src/suite-vendor/a-cabloy/package.json +2 -2
  59. package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
  60. package/vona/src/suite-vendor/a-vona/modules/a-metrics/package.json +1 -1
  61. package/vona/src/suite-vendor/a-vona/modules/a-metrics/test/middlewareSystem.health.test.ts +33 -12
  62. package/vona/src/suite-vendor/a-vona/modules/a-openapi/package.json +1 -1
  63. package/vona/src/suite-vendor/a-vona/modules/a-openapi/src/types/permissions.ts +3 -1
  64. package/vona/src/suite-vendor/a-vona/modules/a-orm/package.json +1 -1
  65. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/bean.model/bean.model_crud_inner.ts +6 -2
  66. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/bean.model/bean.model_crud_table.ts +4 -4
  67. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/dto/dtoMutate.ts +38 -9
  68. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relationsGroup.ts +12 -10
  69. package/vona/src/suite-vendor/a-vona/modules/a-orm/test/dtoMutate.types.test.ts +129 -0
  70. package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +1 -1
  71. package/vona/src/suite-vendor/a-vona/modules/a-security/package.json +1 -1
  72. package/vona/src/suite-vendor/a-vona/modules/a-security/test/origin.test.ts +1 -0
  73. package/vona/src/suite-vendor/a-vona/modules/a-web/cli/controller/metadata/generate.ts +72 -28
  74. package/vona/src/suite-vendor/a-vona/modules/a-web/package.json +1 -1
  75. package/vona/src/suite-vendor/a-vona/modules/a-web/test/controllerMetadataParser.test.ts +156 -0
  76. package/vona/src/suite-vendor/a-vona/package.json +1 -1
  77. package/vona/tsconfig.json +19 -35
  78. package/zova/oxlint.config.ts +5 -1
  79. package/zova/package.original.json +6 -6
  80. package/zova/packages-cli/cli/package.json +3 -3
  81. package/zova/packages-cli/cli-set-front/package.json +4 -4
  82. package/zova/packages-utils/zova-vite/package.json +2 -2
  83. package/zova/packages-zova/zova/package.json +2 -2
  84. package/zova/pnpm-lock.yaml +195 -65
  85. package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
  86. package/zova/src/suite-vendor/a-zova/package.json +2 -2
  87. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.bin.tsc.ts +0 -89
  88. package/vona/packages-cli/cli-set-api/src/lib/command/bin.tsc.ts +0 -24
  89. /package/{vona/packages-cli/cli-set-api/src/lib → scripts}/typescriptRunner.ts +0 -0
@@ -1,7 +1,9 @@
1
1
  import { oxcLintConfig } from '@cabloy/lint';
2
2
  import { defineConfig } from 'oxlint';
3
3
 
4
- export default defineConfig(
4
+ import { resolveOxlintPlugins } from '../scripts/oxlintPlugins.ts';
5
+
6
+ const config = defineConfig(
5
7
  oxcLintConfig({
6
8
  ignorePatterns: [
7
9
  '**/node_modules',
@@ -55,3 +57,5 @@ export default defineConfig(
55
57
  ],
56
58
  }),
57
59
  );
60
+
61
+ export default resolveOxlintPlugins(config);
@@ -26,10 +26,9 @@
26
26
  "dev:one": "npm run prerun && npm run vona :bin:dev -- --workers=1 --flavor=normal",
27
27
  "test": "node ../scripts/runIsolatedTest.ts unit",
28
28
  "cov": "node ../scripts/runIsolatedTest.ts unit --coverage",
29
- "tsc": "npm run prerun && npm run vona :bin:tsc",
30
- "tsc:native": "npm run prerun && npm run vona :bin:tsc -- --compiler=native",
31
- "tsc:native:force": "npm run prerun && npm run vona :bin:tsc -- --compiler=native --force",
32
- "tsc:legacy": "npm run prerun && npm run vona :bin:tsc -- --force",
29
+ "tsc": "npm run tsc:native",
30
+ "tsc:native": "npm run prerun && node ../scripts/typecheck.ts native vona --noEmit --incremental false --project tsconfig.json",
31
+ "tsc:legacy": "npm run prerun && node ../scripts/typecheck.ts typescript vona --noEmit --incremental false --project tsconfig.json",
33
32
  "build": "npm run prerun && npm run vona :bin:build -- --flavor=normal",
34
33
  "build:docker": "npm run prerun && npm run vona :bin:build -- --flavor=docker",
35
34
  "start": "pnpm -C ./dist/normal install && node ./dist/normal/bootstrap.js",
@@ -51,7 +50,7 @@
51
50
  "textlint-rule-ja-no-mixed-period": "^3.0.2",
52
51
  "textlint-rule-ja-space-between-half-and-full-width": "^2.4.2",
53
52
  "textlint-rule-period-in-list-item": "^1.0.1",
54
- "oxfmt": "^0.62.0",
55
- "oxlint": "^1.77.0"
53
+ "oxfmt": "^0.74.0",
54
+ "oxlint": "^1.89.0"
56
55
  }
57
56
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabloy/cli",
3
- "version": "3.1.30",
3
+ "version": "3.1.31",
4
4
  "gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
5
5
  "description": "@cabloy/cli",
6
6
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vona-cli",
3
- "version": "1.1.169",
3
+ "version": "1.1.170",
4
4
  "gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
5
5
  "description": "vona cli",
6
6
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vona-cli-set-api",
3
- "version": "1.1.167",
3
+ "version": "1.1.168",
4
4
  "gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
5
5
  "description": "vona cli-set-api",
6
6
  "keywords": [
@@ -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';
@@ -38,7 +37,6 @@ export const beans = {
38
37
  'bin.play': CliBinPlay,
39
38
  'bin.dev': CliBinDev,
40
39
  'bin.test': CliBinTest,
41
- 'bin.tsc': CliBinTsc,
42
40
  'create.suite': CliCreateSuite,
43
41
  'create.bean': CliCreateBean,
44
42
  'create.module': CliCreateModule,
@@ -5,7 +5,6 @@ import binDbReset from './command/bin.dbReset.ts';
5
5
  import binDev from './command/bin.dev.ts';
6
6
  import binPlay from './command/bin.play.ts';
7
7
  import binTest from './command/bin.test.ts';
8
- import binTsc from './command/bin.tsc.ts';
9
8
  import createBean from './command/create.bean.ts';
10
9
  import createModule from './command/create.module.ts';
11
10
  import createSuite from './command/create.suite.ts';
@@ -41,7 +40,6 @@ export const commands = {
41
40
  dev: binDev,
42
41
  play: binPlay,
43
42
  test: binTest,
44
- tsc: binTsc,
45
43
  },
46
44
  create: {
47
45
  suite: createSuite,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabloy/lint",
3
- "version": "5.1.35",
3
+ "version": "5.1.36",
4
4
  "gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
5
5
  "description": "Node Style Guide for Cabloy.",
6
6
  "files": [
@@ -52,8 +52,8 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "clean-package": "^2.2.0",
55
- "oxfmt": "^0.62.0",
56
- "oxlint": "^1.77.0",
55
+ "oxfmt": "^0.74.0",
56
+ "oxlint": "^1.89.0",
57
57
  "rimraf": "^6.1.3"
58
58
  },
59
59
  "peerDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabloy/module-glob",
3
- "version": "5.3.18",
3
+ "version": "5.3.19",
4
4
  "gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
5
5
  "description": "cabloy module-glob",
6
6
  "keywords": [
@@ -27,6 +27,7 @@
27
27
  "access": "public"
28
28
  },
29
29
  "scripts": {
30
+ "test": "node --test test/*.test.ts",
30
31
  "clean": "rimraf dist tsconfig.tsbuildinfo",
31
32
  "tsc:publish": "npm run clean && node ../../packages-cli/cli/src/bin/vona.ts :bin:buildGeneral && tsc",
32
33
  "prepublishOnly": "npm run tsc:publish",
@@ -13,6 +13,7 @@ import semver from 'semver';
13
13
  import type { IModuleGlobContext, IModuleGlobOptions } from './interface.ts';
14
14
 
15
15
  import { getPathsMeta } from './meta.ts';
16
+ import { bindSuitesModules } from './suites.ts';
16
17
 
17
18
  export * from './interface.ts';
18
19
 
@@ -61,7 +62,7 @@ export async function glob(options: IModuleGlobOptions) {
61
62
  await __loadPackage(context, suites);
62
63
  await __loadPackage(context, modules);
63
64
  // bind suites modules
64
- __bindSuitesModules(suites, modules);
65
+ bindSuitesModules(suites, modules);
65
66
 
66
67
  // check suites
67
68
  __checkSuites(context, suites);
@@ -401,31 +402,6 @@ function __parseSuites(context: IModuleGlobContext, projectPath) {
401
402
  return suites;
402
403
  }
403
404
 
404
- const __suite_pattern1 = /src\/suite\/([^/]+)\/modules/;
405
- const __suite_pattern2 = /src\/suite-vendor\/([^/]+)\/modules/;
406
- function __bindSuitesModules(suites, modules) {
407
- for (const moduleName in modules) {
408
- const module = modules[moduleName];
409
- // check
410
- let res = module.root.match(__suite_pattern1);
411
- if (!res) {
412
- res = module.root.match(__suite_pattern2);
413
- }
414
- if (!res) continue;
415
- // suiteName
416
- const suiteName = res[1];
417
- const suite = suites[suiteName];
418
- if (!suite) {
419
- // means disabled
420
- delete modules[moduleName];
421
- } else {
422
- // bind
423
- module.suite = suiteName;
424
- suite.modules.push(moduleName);
425
- }
426
- }
427
- }
428
-
429
405
  function __checkSuites(context: IModuleGlobContext, suites: Record<string, ISuite>) {
430
406
  for (const key in suites) {
431
407
  const suite = suites[key];
@@ -0,0 +1,31 @@
1
+ import type { IModule, ISuite } from '@cabloy/module-info';
2
+
3
+ const __suite_pattern1 = /src\/suite\/([^/]+)\/modules/;
4
+ const __suite_pattern2 = /src\/suite-vendor\/([^/]+)\/modules/;
5
+
6
+ export function bindSuitesModules(
7
+ suites: Record<string, ISuite>,
8
+ modules: Record<string, IModule>,
9
+ ) {
10
+ for (const moduleName in modules) {
11
+ const module = modules[moduleName];
12
+ // check
13
+ const root = module.root.replace(/\\/g, '/');
14
+ let res = root.match(__suite_pattern1);
15
+ if (!res) {
16
+ res = root.match(__suite_pattern2);
17
+ }
18
+ if (!res) continue;
19
+ // suiteName
20
+ const suiteName = res[1];
21
+ const suite = suites[suiteName];
22
+ if (!suite) {
23
+ // means disabled
24
+ delete modules[moduleName];
25
+ } else {
26
+ // bind
27
+ module.suite = suiteName;
28
+ suite.modules.push(moduleName);
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,108 @@
1
+ import type { IModule, ISuite } from '@cabloy/module-info';
2
+
3
+ import { parseInfoPro } from '@cabloy/module-info';
4
+ import assert from 'node:assert/strict';
5
+ import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises';
6
+ import { tmpdir } from 'node:os';
7
+ import path from 'node:path';
8
+ import { test } from 'node:test';
9
+
10
+ import { glob } from '../src/index.ts';
11
+ import { bindSuitesModules } from '../src/suites.ts';
12
+
13
+ function createModule(name: string, root: string): IModule {
14
+ const info = parseInfoPro(name, 'vona', 'module');
15
+ assert.ok(info);
16
+ return { name, info, root, pkg: '', package: { name, version: '1.0.0' } };
17
+ }
18
+
19
+ function createSuite(name: string, root: string): ISuite {
20
+ const info = parseInfoPro(name, 'vona', 'suite');
21
+ assert.ok(info);
22
+ return { name, info, root, pkg: '', package: { name, version: '1.0.0' }, modules: [] };
23
+ }
24
+
25
+ for (const [platform, paths, projectPath] of [
26
+ ['POSIX', path.posix, '/project with spaces/vona'],
27
+ ['Windows', path.win32, 'C:\\project with spaces\\vona'],
28
+ ] as const) {
29
+ for (const directory of ['suite', 'suite-vendor']) {
30
+ test(`binds ${platform} ${directory} members without duplicate standalone checks`, () => {
31
+ const root = paths.join(projectPath, 'src', directory, 'a-example');
32
+ const suite = createSuite('a-example', root);
33
+ const first = createModule('a-first', paths.join(root, 'modules', 'a-first'));
34
+ const second = createModule('a-second', paths.join(root, 'modules', 'a-second'));
35
+ const standalone = createModule(
36
+ 'a-standalone',
37
+ paths.join(projectPath, 'src', 'module', 'a-standalone'),
38
+ );
39
+ const orphan = createModule(
40
+ 'a-orphan',
41
+ paths.join(projectPath, 'src', directory, 'a-missing', 'modules', 'a-orphan'),
42
+ );
43
+ const suites = { 'a-example': suite };
44
+ const modules = {
45
+ 'a-first': first,
46
+ 'a-second': second,
47
+ 'a-standalone': standalone,
48
+ 'a-orphan': orphan,
49
+ };
50
+
51
+ bindSuitesModules(suites, modules);
52
+
53
+ assert.equal(first.suite, 'a-example');
54
+ assert.equal(second.suite, 'a-example');
55
+ assert.deepEqual(suite.modules, ['a-first', 'a-second']);
56
+ assert.equal(first.root, paths.join(root, 'modules', 'a-first'));
57
+ assert.equal(standalone.suite, undefined);
58
+ assert.equal('a-orphan' in modules, false);
59
+ const independent = Object.values(modules).filter(
60
+ item => !item.suite && !item.info.node_modules,
61
+ );
62
+ assert.deepEqual(
63
+ independent.map(item => item.name),
64
+ ['a-standalone'],
65
+ );
66
+ assert.equal(1 + Object.keys(suites).length + independent.length, 3);
67
+ });
68
+ }
69
+ }
70
+
71
+ test('glob binds suite members and excludes members of disabled suites', async () => {
72
+ const projectPath = await mkdtemp(path.join(tmpdir(), 'cabloy-module-glob-'));
73
+ try {
74
+ for (const directory of [
75
+ 'src/suite/a-local',
76
+ 'src/suite/a-local/modules/a-first',
77
+ 'src/suite-vendor/a-vendor',
78
+ 'src/suite-vendor/a-vendor/modules/a-second',
79
+ 'src/module/a-standalone',
80
+ ]) {
81
+ const root = path.join(projectPath, directory);
82
+ await mkdir(root, { recursive: true });
83
+ await writeFile(
84
+ path.join(root, 'package.json'),
85
+ JSON.stringify({ name: directory.split('/').at(-1), version: '1.0.0' }),
86
+ );
87
+ }
88
+ const options = { projectPath, projectMode: 'vona', log: false } as const;
89
+ const meta = await glob(options);
90
+ assert.equal(meta.modules['a-first'].suite, 'a-local');
91
+ assert.equal(meta.modules['a-second'].suite, 'a-vendor');
92
+ assert.deepEqual(meta.suites['a-local'].modules, ['a-first']);
93
+ assert.deepEqual(meta.suites['a-vendor'].modules, ['a-second']);
94
+ assert.deepEqual(
95
+ meta.modulesArray.filter(item => !item.suite).map(item => item.name),
96
+ ['a-standalone'],
97
+ );
98
+
99
+ const disabled = await glob({ ...options, disabledSuites: ['a-local', 'a-vendor'] });
100
+ assert.deepEqual(Object.keys(disabled.suites), []);
101
+ assert.deepEqual(
102
+ disabled.modulesArray.map(item => item.name),
103
+ ['a-standalone'],
104
+ );
105
+ } finally {
106
+ await rm(projectPath, { recursive: true, force: true });
107
+ }
108
+ });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vona",
3
- "version": "5.1.114",
3
+ "version": "5.1.116",
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": [