cabloy 5.1.221 → 5.1.222

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 (52) hide show
  1. package/.cabloy-version +1 -1
  2. package/CHANGELOG.md +11 -0
  3. package/package.json +1 -1
  4. package/repo-agent-governance/managed-assets.json +15 -15
  5. package/repo-agent-governance/policies/repository.md +1 -0
  6. package/repo-agent-governance/skills/cabloy-backend-scaffold/SKILL.md +5 -1
  7. package/repo-agent-governance/skills/cabloy-backend-scaffold/references/follow-up-checklist.md +7 -5
  8. package/repo-agent-governance/skills/cabloy-frontend-scaffold/SKILL.md +5 -1
  9. package/repo-agent-governance/skills/cabloy-frontend-scaffold/references/follow-up-checklist.md +6 -4
  10. package/repo-docs/backend/unit-testing.md +5 -1
  11. package/repo-docs/frontend/scripts.md +8 -0
  12. package/vona/packages-cli/cabloy-cli/package.json +1 -1
  13. package/vona/packages-cli/cli/package.json +1 -1
  14. package/vona/packages-cli/cli-set-api/package.json +1 -1
  15. package/vona/packages-utils/process-helper/package.json +1 -1
  16. package/vona/packages-utils/process-helper/src/index.test.ts +62 -0
  17. package/vona/packages-utils/process-helper/src/index.ts +9 -4
  18. package/vona/packages-vona/vona/package.json +1 -1
  19. package/vona/packages-vona/vona-core/package.json +1 -1
  20. package/vona/packages-vona/vona-core/src/lib/core/completedReadiness.test.ts +558 -0
  21. package/vona/packages-vona/vona-core/src/lib/core/completedReadiness.ts +389 -0
  22. package/vona/packages-vona/vona-core/src/lib/core/context.ts +3 -0
  23. package/vona/packages-vona/vona-core/src/lib/core/index.ts +11 -0
  24. package/vona/packages-vona/vona-core/src/lib/core/meta.ts +5 -0
  25. package/vona/packages-vona/vona-core/src/lib/framework/start.test.ts +10 -0
  26. package/vona/packages-vona/vona-core/src/lib/framework/start.ts +8 -0
  27. package/vona/packages-vona/vona-mock/package.json +1 -1
  28. package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
  29. package/vona/src/suite-vendor/a-vona/modules/a-executor/package.json +1 -1
  30. package/vona/src/suite-vendor/a-vona/modules/a-executor/src/bean/bean.executor.ts +124 -4
  31. package/vona/src/suite-vendor/a-vona/modules/a-executor/src/types/executor.ts +7 -0
  32. package/vona/src/suite-vendor/a-vona/modules/a-executor/test/readyExisting.test.ts +423 -0
  33. package/vona/src/suite-vendor/a-vona/modules/a-executor/test/readyExistingCommit.test.ts +174 -0
  34. package/vona/src/suite-vendor/a-vona/modules/a-instance/package.json +1 -1
  35. package/vona/src/suite-vendor/a-vona/modules/a-instance/src/bean/bean.instance.ts +3 -1
  36. package/vona/src/suite-vendor/a-vona/modules/a-instance/src/lib/existingReadyAdmission.ts +125 -0
  37. package/vona/src/suite-vendor/a-vona/modules/a-instance/src/service/instance.ts +72 -25
  38. package/vona/src/suite-vendor/a-vona/modules/a-instance/test/existingReadyAdmission.test.ts +949 -0
  39. package/vona/src/suite-vendor/a-vona/modules/a-logger/package.json +1 -1
  40. package/vona/src/suite-vendor/a-vona/modules/a-logger/test/middlewareSystem.httpLog.test.ts +61 -59
  41. package/vona/src/suite-vendor/a-vona/modules/a-mail/package.json +1 -1
  42. package/vona/src/suite-vendor/a-vona/modules/a-mail/src/service/mail.ts +5 -0
  43. package/vona/src/suite-vendor/a-vona/modules/a-startup/package.json +1 -1
  44. package/vona/src/suite-vendor/a-vona/modules/a-startup/test/devSeed.test.ts +61 -2
  45. package/vona/src/suite-vendor/a-vona/package.json +1 -1
  46. package/zova/package.original.json +0 -1
  47. package/zova/packages-cli/cli/package.json +4 -4
  48. package/zova/packages-cli/cli-set-front/package.json +2 -2
  49. package/zova/packages-zova/zova/package.json +2 -2
  50. package/zova/pnpm-lock.yaml +7 -78
  51. package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
  52. package/zova/src/suite-vendor/a-zova/package.json +2 -2
package/.cabloy-version CHANGED
@@ -1 +1 @@
1
- 5.1.221
1
+ 5.1.222
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.1.222
4
+
5
+ ### Features
6
+
7
+ - Apply feature updates, including MCP-related changes.
8
+
9
+ ### Improvements
10
+
11
+ - Add end-to-end tests and email-sending tests.
12
+ - Update the pnpm lockfile.
13
+
3
14
  ## 5.1.221
4
15
 
5
16
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cabloy",
3
- "version": "5.1.221",
3
+ "version": "5.1.222",
4
4
  "gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
5
5
  "description": "A Node.js fullstack framework",
6
6
  "keywords": [
@@ -18,14 +18,14 @@
18
18
  {
19
19
  "adapter": "codex",
20
20
  "category": "skill",
21
- "sha256": "73e068093dfc88d57dc484582e0c20b1dd5d48bdbe12e860ac6343a64883cf5e",
21
+ "sha256": "11a02f57b7fbccc004e2a8d9cacb0e2af9e6f9a881e53852b9d74cb6309f4fc3",
22
22
  "source": "skills/cabloy-backend-scaffold/references/follow-up-checklist.md",
23
23
  "target": ".agents/skills/cabloy-backend-scaffold/references/follow-up-checklist.md"
24
24
  },
25
25
  {
26
26
  "adapter": "codex",
27
27
  "category": "skill",
28
- "sha256": "e874fe06a1d9a0c5d50fcb3184e7c616e3f4e0b7d8ebada2f165119110955ede",
28
+ "sha256": "45ac18019b253a8313b5a229528f6373f1a6814d90f27a70783f787b23936aa0",
29
29
  "source": "skills/cabloy-backend-scaffold/SKILL.md",
30
30
  "target": ".agents/skills/cabloy-backend-scaffold/SKILL.md"
31
31
  },
@@ -81,7 +81,7 @@
81
81
  {
82
82
  "adapter": "codex",
83
83
  "category": "skill",
84
- "sha256": "409edb90ce79c81752dffd3b4ded365e9551259d5fc194859200471d43608f09",
84
+ "sha256": "2bdeea2869862d1e52300da6b946b4b4cd2489b9271144e94e85d8377175c6af",
85
85
  "source": "skills/cabloy-frontend-scaffold/references/follow-up-checklist.md",
86
86
  "target": ".agents/skills/cabloy-frontend-scaffold/references/follow-up-checklist.md"
87
87
  },
@@ -95,7 +95,7 @@
95
95
  {
96
96
  "adapter": "codex",
97
97
  "category": "skill",
98
- "sha256": "edd0014d787e03f9f37df9e67e42bf14bef9f8ca629e3aa3633d7130364020e7",
98
+ "sha256": "af5f73b8c1d52bf0bdd0464c9b29c1f9eccdddece2142da73657d164ab927f95",
99
99
  "source": "skills/cabloy-frontend-scaffold/SKILL.md",
100
100
  "target": ".agents/skills/cabloy-frontend-scaffold/SKILL.md"
101
101
  },
@@ -354,14 +354,14 @@
354
354
  {
355
355
  "adapter": "claude",
356
356
  "category": "skill",
357
- "sha256": "73e068093dfc88d57dc484582e0c20b1dd5d48bdbe12e860ac6343a64883cf5e",
357
+ "sha256": "11a02f57b7fbccc004e2a8d9cacb0e2af9e6f9a881e53852b9d74cb6309f4fc3",
358
358
  "source": "skills/cabloy-backend-scaffold/references/follow-up-checklist.md",
359
359
  "target": ".claude/skills/cabloy-backend-scaffold/references/follow-up-checklist.md"
360
360
  },
361
361
  {
362
362
  "adapter": "claude",
363
363
  "category": "skill",
364
- "sha256": "e874fe06a1d9a0c5d50fcb3184e7c616e3f4e0b7d8ebada2f165119110955ede",
364
+ "sha256": "45ac18019b253a8313b5a229528f6373f1a6814d90f27a70783f787b23936aa0",
365
365
  "source": "skills/cabloy-backend-scaffold/SKILL.md",
366
366
  "target": ".claude/skills/cabloy-backend-scaffold/SKILL.md"
367
367
  },
@@ -417,7 +417,7 @@
417
417
  {
418
418
  "adapter": "claude",
419
419
  "category": "skill",
420
- "sha256": "409edb90ce79c81752dffd3b4ded365e9551259d5fc194859200471d43608f09",
420
+ "sha256": "2bdeea2869862d1e52300da6b946b4b4cd2489b9271144e94e85d8377175c6af",
421
421
  "source": "skills/cabloy-frontend-scaffold/references/follow-up-checklist.md",
422
422
  "target": ".claude/skills/cabloy-frontend-scaffold/references/follow-up-checklist.md"
423
423
  },
@@ -431,7 +431,7 @@
431
431
  {
432
432
  "adapter": "claude",
433
433
  "category": "skill",
434
- "sha256": "edd0014d787e03f9f37df9e67e42bf14bef9f8ca629e3aa3633d7130364020e7",
434
+ "sha256": "af5f73b8c1d52bf0bdd0464c9b29c1f9eccdddece2142da73657d164ab927f95",
435
435
  "source": "skills/cabloy-frontend-scaffold/SKILL.md",
436
436
  "target": ".claude/skills/cabloy-frontend-scaffold/SKILL.md"
437
437
  },
@@ -683,7 +683,7 @@
683
683
  {
684
684
  "adapter": "cursor",
685
685
  "category": "policy",
686
- "sha256": "050769a0c11ce7706b6dc0d526aad3ecd9d5a2ca1edd4d3eab699aac5eec9996",
686
+ "sha256": "b8453cbb90a6b75014615dea5ffb8f8e6b31be1e5c3392c1dc4bc0f4456adb57",
687
687
  "source": "policies/repository.md",
688
688
  "target": ".cursor/rules/cabloy-governance.mdc"
689
689
  },
@@ -704,14 +704,14 @@
704
704
  {
705
705
  "adapter": "cursor",
706
706
  "category": "skill",
707
- "sha256": "73e068093dfc88d57dc484582e0c20b1dd5d48bdbe12e860ac6343a64883cf5e",
707
+ "sha256": "11a02f57b7fbccc004e2a8d9cacb0e2af9e6f9a881e53852b9d74cb6309f4fc3",
708
708
  "source": "skills/cabloy-backend-scaffold/references/follow-up-checklist.md",
709
709
  "target": ".cursor/skills/cabloy-backend-scaffold/references/follow-up-checklist.md"
710
710
  },
711
711
  {
712
712
  "adapter": "cursor",
713
713
  "category": "skill",
714
- "sha256": "e874fe06a1d9a0c5d50fcb3184e7c616e3f4e0b7d8ebada2f165119110955ede",
714
+ "sha256": "45ac18019b253a8313b5a229528f6373f1a6814d90f27a70783f787b23936aa0",
715
715
  "source": "skills/cabloy-backend-scaffold/SKILL.md",
716
716
  "target": ".cursor/skills/cabloy-backend-scaffold/SKILL.md"
717
717
  },
@@ -767,7 +767,7 @@
767
767
  {
768
768
  "adapter": "cursor",
769
769
  "category": "skill",
770
- "sha256": "409edb90ce79c81752dffd3b4ded365e9551259d5fc194859200471d43608f09",
770
+ "sha256": "2bdeea2869862d1e52300da6b946b4b4cd2489b9271144e94e85d8377175c6af",
771
771
  "source": "skills/cabloy-frontend-scaffold/references/follow-up-checklist.md",
772
772
  "target": ".cursor/skills/cabloy-frontend-scaffold/references/follow-up-checklist.md"
773
773
  },
@@ -781,7 +781,7 @@
781
781
  {
782
782
  "adapter": "cursor",
783
783
  "category": "skill",
784
- "sha256": "edd0014d787e03f9f37df9e67e42bf14bef9f8ca629e3aa3633d7130364020e7",
784
+ "sha256": "af5f73b8c1d52bf0bdd0464c9b29c1f9eccdddece2142da73657d164ab927f95",
785
785
  "source": "skills/cabloy-frontend-scaffold/SKILL.md",
786
786
  "target": ".cursor/skills/cabloy-frontend-scaffold/SKILL.md"
787
787
  },
@@ -1005,14 +1005,14 @@
1005
1005
  {
1006
1006
  "adapter": "codex",
1007
1007
  "category": "policy",
1008
- "sha256": "4056d436da610d0438fe8aa4c873cd23442613de800799b358b1c1a2483d7402",
1008
+ "sha256": "18d072d31b706f8eadda5d757ee3db7d69c4a7ea5e4c14dc33ab3ac307ae89e0",
1009
1009
  "source": "policies/repository.md",
1010
1010
  "target": "AGENTS.md"
1011
1011
  },
1012
1012
  {
1013
1013
  "adapter": "claude",
1014
1014
  "category": "policy",
1015
- "sha256": "4056d436da610d0438fe8aa4c873cd23442613de800799b358b1c1a2483d7402",
1015
+ "sha256": "18d072d31b706f8eadda5d757ee3db7d69c4a7ea5e4c14dc33ab3ac307ae89e0",
1016
1016
  "source": "policies/repository.md",
1017
1017
  "target": "CLAUDE.md"
1018
1018
  }
@@ -106,4 +106,5 @@ Before inventing a custom implementation path:
106
106
  - For docs changes: run the docs build and verify links/navigation where practical.
107
107
  - For code-generation or workflow guidance changes: verify that the referenced scripts and command families still exist.
108
108
  - For code changes: prefer the narrowest meaningful verification first, then use shared root scripts when broader confidence is needed.
109
+ - Keep frontend and backend verification proportional to the change: cover critical behavior using existing infrastructure, not exhaustive upfront test matrices or bespoke source-evaluation/mock harnesses. Prefer a few critical-flow E2E scenarios for frontend work and the smallest meaningful service/model/API/integration tests for backend work; add focused regressions for actual defects. Preserve applicable security, SSR, data-consistency, migration, and acceptance requirements.
109
110
  - Any change to `meta.version.ts` requires running `npm run test` so the test database is reinitialized and schema/data consistency issues surface early.
@@ -237,7 +237,11 @@ Especially relevant pages include:
237
237
 
238
238
  Always end with a verification path that matches the scope of the backend change.
239
239
 
240
- Typical shared checks include:
240
+ Prefer focused tests of critical business behavior using the existing Vona testing infrastructure. Choose the smallest meaningful service/model, controller/API, or integration boundary for the changed contract; browser E2E is not the default backend test layer. Avoid exhaustive upfront mock/fake matrices and bespoke harnesses. Add focused regression coverage when actual defects are fixed; targeted unit and framework tests remain useful when they directly prove new or changed behavior.
241
+
242
+ Keep relevant static checks scope-dependent and preserve applicable authentication/authorization, tenant-isolation, transaction, concurrency, idempotency, migration, and acceptance requirements. These are selected by the affected behavior, not a mandatory matrix for every change. Retain `mockCtx(...)` ownership, test-resource isolation, precise fixture cleanup, and the required `npm run test` after `meta.version.ts` changes. Missing runtime access is a reported gap, not permission to reset resources or invent substitute test machinery. See [Unit Testing](../../../repo-docs/backend/unit-testing.md).
243
+
244
+ Shared checks, when applicable, include:
241
245
 
242
246
  - `npm run test`
243
247
  - `npm run tsc`
@@ -79,11 +79,13 @@ When the active edition and installed modules provide `@Passport.rbac(...)` and
79
79
 
80
80
  ## Verification follow-up
81
81
 
82
- - unit tests
83
- - `db:reset` or migration verification
84
- - `npm run test`
85
- - `npm run tsc`
86
- - `npm run build`
82
+ - focused critical-business-path tests using existing Vona service/model, controller/API, or integration infrastructure; browser E2E is not the default backend layer
83
+ - focused regressions for actual defects; avoid exhaustive upfront mock/fake matrices and bespoke harnesses
84
+ - applicable authentication/authorization, tenant-isolation, transaction, concurrency, idempotency, migration, and acceptance checks
85
+ - relevant format, lint, and type checks using the smallest supported scope
86
+ - `npm run test`, including the required run after `meta.version.ts` changes
87
+ - migration verification when affected; `db:reset` remains destructive and requires explicit approval
88
+ - `npm run build` only when the affected artifact or acceptance boundary requires it
87
89
 
88
90
  ## Escalation rule
89
91
 
@@ -278,7 +278,11 @@ Especially relevant pages include:
278
278
 
279
279
  Always end with a verification path that matches the scope of the frontend change.
280
280
 
281
- Typical shared checks include:
281
+ For ordinary frontend changes, prefer a few critical user flows through the existing E2E infrastructure, selected by affected behavior with spec names, tags, or `--grep`. Reuse existing scenarios or extend them narrowly; do not require exhaustive isolated-test matrices, extensive fake dependencies, or custom source-evaluation loaders before delivery. When an actual problem is fixed, add focused regression coverage. Targeted unit or framework tests remain useful when they efficiently prove the behavior being changed; this is not a ban on existing tests or managed test-resource isolation.
282
+
283
+ Keep relevant format, lint, and type checks lightweight and scope-dependent. Prepare only the affected flavor's required artifacts for runtime verification. Preserve applicable route, SSR/hydration, authentication, authorization, contract, and acceptance checks; frontend E2E does not replace server-side enforcement. If runtime verification is unavailable or not authorized, report the gap rather than building a substitute harness. See [Frontend Scripts](../../../repo-docs/frontend/scripts.md) for edition-aware preparation and filtered E2E commands.
284
+
285
+ Shared checks, when applicable, include:
282
286
 
283
287
  - `npm run tsc`
284
288
  - `npm run build:zova`
@@ -42,10 +42,12 @@ After generating or extending a frontend thread, check which follow-up layers ap
42
42
 
43
43
  ## Verification follow-up
44
44
 
45
- - `npm run tsc`
46
- - `npm run build:zova`
47
- - flavor-specific checks
48
- - route or SSR verification
45
+ - relevant format, lint, and type checks using the smallest supported scope
46
+ - a few affected critical user flows through existing E2E scenarios, selected by spec, tag, or `--grep`
47
+ - focused regressions for actual defects; no exhaustive upfront fake matrices or custom source-evaluation harnesses
48
+ - affected-flavor artifact preparation when runtime verification needs updated output
49
+ - applicable route, SSR/hydration, authentication, authorization, and contract checks; do not replace server-side enforcement with UI coverage
50
+ - report unavailable or unauthorized runtime proof explicitly; do not create substitute test machinery
49
51
 
50
52
  ## Escalation rule
51
53
 
@@ -4,7 +4,11 @@ This guide explains the most important Vona testing workflows in the Cabloy mono
4
4
 
5
5
  ## Why testing is emphasized
6
6
 
7
- Test-driven development remains a strong default in the Cabloy monorepo.
7
+ Keep testing proportional to the backend change: cover critical business behavior using the existing Vona testing infrastructure, and add focused regression coverage when actual problems are fixed. Choose the smallest meaningful service/model, controller/API, or integration boundary for the changed contract; browser E2E is not the default backend test layer.
8
+
9
+ Test-driven development and targeted unit or framework tests remain useful when they clarify and directly prove new or changed behavior. Exhaustive upfront mock/fake matrices and bespoke harnesses are not a delivery prerequisite.
10
+
11
+ Preserve applicable authentication/authorization, tenant-isolation, transaction, concurrency, idempotency, migration, and acceptance checks without turning them into an unrelated mandatory matrix. The context, fixture, and resource-isolation rules below still apply, including the required `npm run test` after `meta.version.ts` changes. Missing runtime access must be reported, not worked around with unauthorized resets or substitute test machinery.
8
12
 
9
13
  Vona’s testing story is valuable because it is closely integrated with:
10
14
 
@@ -49,6 +49,14 @@ npm run build:zova:commerce:admin
49
49
 
50
50
  The `dev:zova:*` commands start the Zova development server, which uses `9000` in the Cabloy Basic default environment. Use this Zova standalone SSR entry for page, route, and hydration iteration. It may be used as Vona's development proxy target, but direct access to `9000` does not prove the Vona request boundary or integrated acceptance.
51
51
 
52
+ ## Proportionate frontend verification
53
+
54
+ For frontend changes, prefer a few critical user flows through the existing E2E infrastructure, together with relevant lightweight format, lint, and type checks. Select scenarios by the behavior being changed rather than running every spec or building exhaustive isolated-test matrices. Reuse the edition-aware preparation and spec/tag/`--grep` filtering below; prepare only the affected artifacts when they have changed.
55
+
56
+ Do not introduce custom source-evaluation loaders or extensive fake dependencies by default for ordinary page interactions. When an actual problem is fixed, add a focused regression test that reproduces it. Targeted unit and framework tests remain useful when they provide direct, low-cost proof; comprehensive upfront coverage is not a delivery prerequisite.
57
+
58
+ This preference does not relax applicable SSR/hydration, authentication, authorization, contract, or acceptance requirements, and UI coverage never replaces server-side enforcement. Managed E2E resource isolation remains required. If runtime verification is unavailable or not authorized, report the gap rather than adding substitute test machinery; live Provider and destructive operations retain their separate authorization boundaries.
59
+
52
60
  ## Vona integrated SSR browser acceptance
53
61
 
54
62
  The default Basic Web and Admin sites have browser smoke commands that exercise Vona integrated SSR through Vona SSR dispatch at the managed run's dynamically allocated test listener, not through the ordinary Vona development listener (`7102` by default) or the Zova standalone SSR development-server port. Vona supplies the API origin at runtime, so no Zova `.env` change or rebuild is needed solely for the test port; see [Runtime API origins in Vona integrated SSR](/fullstack/ssr-entry-modes#runtime-api-origins-in-vona-integrated-ssr).
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabloy/cli",
3
- "version": "3.1.29",
3
+ "version": "3.1.30",
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.167",
3
+ "version": "1.1.168",
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.165",
3
+ "version": "1.1.166",
4
4
  "gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
5
5
  "description": "vona cli-set-api",
6
6
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabloy/process-helper",
3
- "version": "3.1.8",
3
+ "version": "3.1.9",
4
4
  "gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
5
5
  "description": "cabloy process-helper",
6
6
  "keywords": [
@@ -0,0 +1,62 @@
1
+ import assert from 'node:assert/strict';
2
+ import ChildProcess from 'node:child_process';
3
+ import { PassThrough } from 'node:stream';
4
+ import { describe, it } from 'node:test';
5
+
6
+ import { ProcessHelper } from './index.ts';
7
+
8
+ describe('ProcessHelper child termination', { concurrency: false }, () => {
9
+ for (const { code, signal } of [
10
+ { code: 0, signal: null },
11
+ { code: 7, signal: null },
12
+ { code: null, signal: 'SIGKILL' },
13
+ { code: null, signal: null },
14
+ ] as const) {
15
+ it(`handles exit code ${code} and signal ${signal}`, async t => {
16
+ const child = new ChildProcess.ChildProcess();
17
+ t.mock.method(ChildProcess, 'spawn', () => child);
18
+ const result = new ProcessHelper().spawn({ cmd: 'test-owned-command' });
19
+ child.emit('exit', code, signal);
20
+ if (code === 0) {
21
+ assert.equal(await result, '');
22
+ } else {
23
+ await assert.rejects(result, (error: Error & { code?: number; signal?: string }) => {
24
+ if (code !== null) {
25
+ assert.equal(error.code, 10000 + code);
26
+ assert.match(error.message, /exit code: 7/);
27
+ } else {
28
+ assert.equal(error.signal, signal);
29
+ assert.match(error.message, signal ? /SIGKILL/ : /exit code: null/);
30
+ }
31
+ return true;
32
+ });
33
+ }
34
+ });
35
+ }
36
+
37
+ it('retains the termination signal alongside stderr', async t => {
38
+ const child = new ChildProcess.ChildProcess();
39
+ child.stderr = new PassThrough();
40
+ t.mock.method(ChildProcess, 'spawn', () => child);
41
+ const helper = new ProcessHelper();
42
+ t.mock.method(helper.console, 'log', async () => {});
43
+ const result = helper.spawn({ cmd: 'test-owned-command' });
44
+ child.stderr.emit('data', Buffer.from('controlled_stderr'));
45
+ child.emit('exit', null, 'SIGTERM');
46
+ await assert.rejects(result, (error: Error & { signal?: string }) => {
47
+ assert.equal(error.signal, 'SIGTERM');
48
+ assert.match(error.message, /controlled_stderr/);
49
+ assert.match(error.message, /SIGTERM/);
50
+ return true;
51
+ });
52
+ });
53
+
54
+ it('preserves spawn failures', async t => {
55
+ const child = new ChildProcess.ChildProcess();
56
+ t.mock.method(ChildProcess, 'spawn', () => child);
57
+ const failure = new Error('controlled_spawn_failure');
58
+ const result = new ProcessHelper().spawn({ cmd: 'test-owned-command' });
59
+ child.emit('error', failure);
60
+ await assert.rejects(result, error => error === failure);
61
+ });
62
+ });
@@ -172,12 +172,17 @@ export class ProcessHelper {
172
172
  proc.once('error', err => {
173
173
  reject(err);
174
174
  });
175
- proc.once('exit', code => {
175
+ proc.once('exit', (code, signal) => {
176
176
  // if (options.gracefull) childs.delete(proc);
177
- if (code) {
178
- const message = stderr || `spawn ${cmd} ${args.join(' ')} fail, exit code: ${code}`;
177
+ if (code !== 0) {
178
+ const status = signal ? `signal: ${signal}` : `exit code: ${code}`;
179
+ const message =
180
+ signal || code === null
181
+ ? `${stderr ? `${stderr}\n` : ''}spawn ${cmd} ${args.join(' ')} fail, ${status}`
182
+ : stderr || `spawn ${cmd} ${args.join(' ')} fail, ${status}`;
179
183
  const err = new Error(message);
180
- (err as any).code = 10000 + Number(code);
184
+ if (code !== null) (err as any).code = 10000 + code;
185
+ (err as any).signal = signal;
181
186
  return reject(err);
182
187
  }
183
188
  resolve(stdout);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vona",
3
- "version": "5.1.112",
3
+ "version": "5.1.113",
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": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vona-core",
3
- "version": "5.1.49",
3
+ "version": "5.1.50",
4
4
  "gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
5
5
  "description": "vona",
6
6
  "keywords": [