@cratis/pi 8.5.0 → 8.7.0

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 (217) hide show
  1. package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +5 -3
  2. package/package/corpus/harnesses/copilot/instructions/react.instructions.md +3 -1
  3. package/package/corpus/harnesses/copilot/instructions/reactors.instructions.md +3 -1
  4. package/package/corpus/harnesses/copilot/instructions/specs.csharp.instructions.md +6 -3
  5. package/package/corpus/harnesses/copilot/instructions/vertical-slices.instructions.md +5 -2
  6. package/package/corpus/rules/glossary.md +5 -3
  7. package/package/corpus/rules/react.md +3 -1
  8. package/package/corpus/rules/reactors.md +3 -1
  9. package/package/corpus/rules/specs.csharp.md +6 -3
  10. package/package/corpus/rules/vertical-slices.md +5 -2
  11. package/package/corpus/skills/cratis-application-growth/SKILL.md +1 -2
  12. package/package/corpus/skills/cratis-application-growth/references/csharp.md +0 -2
  13. package/package/corpus/skills/cratis-application-growth/references/move-and-untangle.md +1 -2
  14. package/package/corpus/skills/cratis-application-growth/references/rename-window.md +1 -3
  15. package/package/corpus/skills/cratis-application-growth/references/service-and-delivery.md +3 -2
  16. package/package/corpus/skills/cratis-application-growth/references/stages.md +2 -2
  17. package/package/corpus/skills/cratis-arc-authorize-request/SKILL.md +2 -2
  18. package/package/corpus/skills/cratis-arc-authorize-request/references/authproxy.md +19 -0
  19. package/package/corpus/skills/cratis-arc-authorize-request/references/csharp-query-security.md +15 -0
  20. package/package/corpus/skills/cratis-arc-authorize-request/references/csharp.md +12 -3
  21. package/package/corpus/skills/cratis-arc-declare-command/SKILL.md +2 -0
  22. package/package/corpus/skills/cratis-arc-declare-command/references/csharp-chronicle.md +46 -7
  23. package/package/corpus/skills/cratis-arc-declare-command/references/csharp-controller.md +3 -1
  24. package/package/corpus/skills/cratis-arc-declare-command/references/csharp-history.md +4 -1
  25. package/package/corpus/skills/cratis-arc-declare-command/references/csharp.md +31 -4
  26. package/package/corpus/skills/cratis-arc-declare-command/references/go.md +1 -1
  27. package/package/corpus/skills/cratis-arc-diagnose-live-query/references/csharp.md +24 -2
  28. package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/csharp.md +49 -0
  29. package/package/corpus/skills/cratis-arc-expose-query/SKILL.md +3 -1
  30. package/package/corpus/skills/cratis-arc-expose-query/references/csharp.md +27 -4
  31. package/package/corpus/skills/cratis-arc-generate-proxies/SKILL.md +1 -0
  32. package/package/corpus/skills/cratis-arc-generate-proxies/references/csharp.md +49 -2
  33. package/package/corpus/skills/cratis-arc-generate-proxies/references/typescript.md +9 -0
  34. package/package/corpus/skills/cratis-arc-host-application/SKILL.md +1 -1
  35. package/package/corpus/skills/cratis-arc-host-application/references/csharp-configuration.md +54 -0
  36. package/package/corpus/skills/cratis-arc-host-application/references/csharp-deployment.md +98 -0
  37. package/package/corpus/skills/cratis-arc-host-application/references/csharp-http.md +9 -1
  38. package/package/corpus/skills/cratis-arc-host-application/references/csharp-identity.md +84 -2
  39. package/package/corpus/skills/cratis-arc-host-application/references/csharp.md +2 -0
  40. package/package/corpus/skills/cratis-arc-invoke-command/references/csharp.md +2 -1
  41. package/package/corpus/skills/cratis-arc-isolate-tenant/SKILL.md +18 -1
  42. package/package/corpus/skills/cratis-arc-page-query/references/csharp.md +2 -0
  43. package/package/corpus/skills/cratis-arc-react-bind-slice/SKILL.md +18 -16
  44. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-commands.md +8 -3
  45. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-host.md +84 -16
  46. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-identity.md +22 -2
  47. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-instant-feedback.md +81 -0
  48. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-localization.md +80 -0
  49. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-navigation.md +103 -0
  50. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-queries.md +40 -1
  51. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript-structure.md +117 -0
  52. package/package/corpus/skills/cratis-arc-react-bind-slice/references/typescript.md +7 -3
  53. package/package/corpus/skills/cratis-arc-react-separate-view-model/SKILL.md +3 -3
  54. package/package/corpus/skills/cratis-arc-react-separate-view-model/references/typescript.md +27 -6
  55. package/package/corpus/skills/cratis-arc-validate-command/references/csharp-rules.md +23 -2
  56. package/package/corpus/skills/cratis-arc-validate-command/references/csharp.md +28 -2
  57. package/package/corpus/skills/cratis-authproxy-configure/SKILL.md +136 -0
  58. package/package/corpus/skills/cratis-authproxy-configure/references/admission.md +125 -0
  59. package/package/corpus/skills/cratis-authproxy-configure/references/aspire.md +154 -0
  60. package/package/corpus/skills/cratis-authproxy-configure/references/operations.md +122 -0
  61. package/package/corpus/skills/cratis-authproxy-configure/references/services-and-routing.md +114 -0
  62. package/package/corpus/skills/cratis-authproxy-configure/references/sessions-and-logout.md +126 -0
  63. package/package/corpus/skills/cratis-authproxy-configure/references/sign-in-providers.md +116 -0
  64. package/package/corpus/skills/cratis-authproxy-configure/references/tenant-resolution.md +135 -0
  65. package/package/corpus/skills/cratis-choreography-run-workflow/SKILL.md +117 -0
  66. package/package/corpus/skills/cratis-choreography-run-workflow/references/csharp-chronicle.md +164 -0
  67. package/package/corpus/skills/cratis-choreography-run-workflow/references/csharp.md +354 -0
  68. package/package/corpus/skills/cratis-chronicle-cli-operations/SKILL.md +2 -2
  69. package/package/corpus/skills/cratis-chronicle-cli-operations/references/project-tooling.md +28 -0
  70. package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp-services.md +13 -2
  71. package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp.md +12 -0
  72. package/package/corpus/skills/cratis-chronicle-connect-application/references/kotlin.md +2 -0
  73. package/package/corpus/skills/cratis-chronicle-connect-application/references/typescript.md +10 -1
  74. package/package/corpus/skills/cratis-chronicle-constrain-append/SKILL.md +8 -1
  75. package/package/corpus/skills/cratis-chronicle-constrain-append/references/csharp.md +35 -3
  76. package/package/corpus/skills/cratis-chronicle-constrain-append/references/go.md +1 -1
  77. package/package/corpus/skills/cratis-chronicle-constrain-append/references/operations.md +70 -0
  78. package/package/corpus/skills/cratis-chronicle-deploy-kernel/SKILL.md +2 -0
  79. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/configuration.md +27 -0
  80. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/container-and-kubernetes.md +293 -0
  81. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/kernel-options.md +13 -6
  82. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/network-and-tls.md +45 -0
  83. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/storage.md +91 -1
  84. package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/upgrade-and-recovery.md +9 -0
  85. package/package/corpus/skills/cratis-chronicle-evolve-event/SKILL.md +12 -0
  86. package/package/corpus/skills/cratis-chronicle-inspect-observer/SKILL.md +11 -1
  87. package/package/corpus/skills/cratis-chronicle-inspect-observer/references/csharp.md +1 -1
  88. package/package/corpus/skills/cratis-chronicle-project-view/SKILL.md +1 -1
  89. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-fluent.md +14 -3
  90. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-model-bound.md +3 -0
  91. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp-reading.md +3 -2
  92. package/package/corpus/skills/cratis-chronicle-project-view/references/csharp.md +23 -0
  93. package/package/corpus/skills/cratis-chronicle-project-view/references/elixir.md +1 -0
  94. package/package/corpus/skills/cratis-chronicle-project-view/references/go.md +2 -1
  95. package/package/corpus/skills/cratis-chronicle-project-view/references/java.md +2 -0
  96. package/package/corpus/skills/cratis-chronicle-project-view/references/kotlin.md +1 -0
  97. package/package/corpus/skills/cratis-chronicle-project-view/references/typescript.md +1 -1
  98. package/package/corpus/skills/cratis-chronicle-protect-decision/SKILL.md +2 -0
  99. package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp-scopes.md +40 -3
  100. package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp.md +20 -2
  101. package/package/corpus/skills/cratis-chronicle-protect-decision/references/elixir.md +7 -0
  102. package/package/corpus/skills/cratis-chronicle-protect-decision/references/go.md +9 -1
  103. package/package/corpus/skills/cratis-chronicle-protect-decision/references/java.md +8 -0
  104. package/package/corpus/skills/cratis-chronicle-protect-decision/references/kotlin.md +9 -0
  105. package/package/corpus/skills/cratis-chronicle-protect-decision/references/typescript.md +7 -0
  106. package/package/corpus/skills/cratis-chronicle-protect-personal-data/references/csharp.md +24 -1
  107. package/package/corpus/skills/cratis-chronicle-publish-contract/SKILL.md +1 -1
  108. package/package/corpus/skills/cratis-chronicle-publish-contract/references/csharp.md +41 -0
  109. package/package/corpus/skills/cratis-chronicle-publish-contract/references/webhook-signature-wire-format.md +82 -0
  110. package/package/corpus/skills/cratis-chronicle-react-to-fact/SKILL.md +17 -0
  111. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp-outputs.md +3 -1
  112. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp.md +35 -2
  113. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/elixir.md +11 -0
  114. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/java.md +1 -0
  115. package/package/corpus/skills/cratis-chronicle-react-to-fact/references/kotlin.md +1 -0
  116. package/package/corpus/skills/cratis-chronicle-record-event/SKILL.md +1 -1
  117. package/package/corpus/skills/cratis-chronicle-record-event/references/csharp-coordination.md +31 -2
  118. package/package/corpus/skills/cratis-chronicle-record-event/references/csharp-history.md +21 -4
  119. package/package/corpus/skills/cratis-chronicle-record-event/references/csharp.md +20 -2
  120. package/package/corpus/skills/cratis-chronicle-record-event/references/go.md +1 -1
  121. package/package/corpus/skills/cratis-chronicle-record-event/references/java.md +1 -1
  122. package/package/corpus/skills/cratis-chronicle-record-event/references/kotlin.md +3 -0
  123. package/package/corpus/skills/cratis-chronicle-reduce-state/SKILL.md +2 -1
  124. package/package/corpus/skills/cratis-chronicle-reduce-state/references/csharp.md +3 -1
  125. package/package/corpus/skills/cratis-chronicle-reduce-state/references/java.md +10 -1
  126. package/package/corpus/skills/cratis-chronicle-reduce-state/references/kotlin.md +10 -1
  127. package/package/corpus/skills/cratis-chronicle-reduce-state/references/typescript.md +27 -5
  128. package/package/corpus/skills/cratis-chronicle-select-client/SKILL.md +18 -0
  129. package/package/corpus/skills/cratis-chronicle-select-client/references/elixir.md +21 -1
  130. package/package/corpus/skills/cratis-chronicle-select-client/references/go.md +13 -0
  131. package/package/corpus/skills/cratis-chronicle-select-client/references/java.md +15 -0
  132. package/package/corpus/skills/cratis-chronicle-select-client/references/kotlin.md +15 -0
  133. package/package/corpus/skills/cratis-chronicle-select-client/references/typescript.md +16 -0
  134. package/package/corpus/skills/cratis-code-review/references/csharp-diagnostics.md +28 -2
  135. package/package/corpus/skills/cratis-code-review/references/csharp.md +1 -1
  136. package/package/corpus/skills/cratis-components-accessibility/SKILL.md +6 -8
  137. package/package/corpus/skills/cratis-components-accessibility/references/typescript.md +32 -14
  138. package/package/corpus/skills/cratis-components-build-canvas/SKILL.md +4 -3
  139. package/package/corpus/skills/cratis-components-build-canvas/references/typescript-props.md +1 -1
  140. package/package/corpus/skills/cratis-components-build-canvas/references/typescript.md +4 -2
  141. package/package/corpus/skills/cratis-components-choose-control/SKILL.md +13 -7
  142. package/package/corpus/skills/cratis-components-choose-control/references/from-primereact.md +116 -0
  143. package/package/corpus/skills/cratis-components-choose-control/references/menu.md +90 -0
  144. package/package/corpus/skills/cratis-components-choose-control/references/typescript-composition.md +48 -0
  145. package/package/corpus/skills/cratis-components-choose-control/references/typescript.md +2 -2
  146. package/package/corpus/skills/cratis-components-compose-toolbar/SKILL.md +2 -1
  147. package/package/corpus/skills/cratis-components-compose-toolbar/references/floating-toolbar.md +146 -0
  148. package/package/corpus/skills/cratis-components-diagnose-screen/SKILL.md +102 -0
  149. package/package/corpus/skills/cratis-components-display-list/SKILL.md +10 -10
  150. package/package/corpus/skills/cratis-components-display-list/references/typescript-custom-panel.md +74 -0
  151. package/package/corpus/skills/cratis-components-display-list/references/typescript-datatables.md +2 -7
  152. package/package/corpus/skills/cratis-components-display-list/references/typescript.md +3 -2
  153. package/package/corpus/skills/cratis-components-submit-form/references/typescript-commandform.md +72 -2
  154. package/package/corpus/skills/cratis-components-submit-form/references/typescript.md +5 -3
  155. package/package/corpus/skills/cratis-components-theme-application/SKILL.md +17 -15
  156. package/package/corpus/skills/cratis-components-theme-application/references/localization.md +166 -0
  157. package/package/corpus/skills/cratis-components-theme-application/references/typescript.md +18 -14
  158. package/package/corpus/skills/cratis-components-theme-application/references/upgrade-from-previous-major.md +141 -0
  159. package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +2 -0
  160. package/package/corpus/skills/cratis-engineering-csharp-conventions/references/csharp-domain-philosophy.md +31 -3
  161. package/package/corpus/skills/cratis-engineering-csharp-conventions/references/csharp-fundamentals-helpers.md +119 -0
  162. package/package/corpus/skills/cratis-engineering-csharp-conventions/references/csharp.md +4 -0
  163. package/package/corpus/skills/cratis-fundamentals-concept/references/csharp-serialization.md +70 -0
  164. package/package/corpus/skills/cratis-fundamentals-concept/references/csharp.md +8 -0
  165. package/package/corpus/skills/cratis-fundamentals-concept/references/go.md +1 -0
  166. package/package/corpus/skills/cratis-fundamentals-concept/references/typescript-serialization.md +33 -0
  167. package/package/corpus/skills/cratis-fundamentals-name-value/references/csharp.md +2 -1
  168. package/package/corpus/skills/cratis-fundamentals-type-discovery/references/csharp-diagnostics.md +5 -0
  169. package/package/corpus/skills/cratis-fundamentals-type-discovery/references/go-dependency-injection.md +3 -0
  170. package/package/corpus/skills/cratis-modeling-design-event-model/SKILL.md +6 -4
  171. package/package/corpus/skills/cratis-modeling-design-event-model/references/command-inventory.md +7 -1
  172. package/package/corpus/skills/cratis-modeling-design-event-model/references/model-first.md +13 -1
  173. package/package/corpus/skills/cratis-modeling-design-event-model/references/review-one-slice.md +6 -0
  174. package/package/corpus/skills/cratis-multi-service-local-orchestration/SKILL.md +6 -6
  175. package/package/corpus/skills/cratis-multi-service-local-orchestration/references/csharp-aspire.md +116 -28
  176. package/package/corpus/skills/cratis-multi-service-local-orchestration/references/docker-compose.md +2 -2
  177. package/package/corpus/skills/cratis-observability/references/chronicle-kernel-export.md +46 -0
  178. package/package/corpus/skills/cratis-orleans-jobs/SKILL.md +4 -2
  179. package/package/corpus/skills/cratis-platform-build-application/SKILL.md +8 -0
  180. package/package/corpus/skills/cratis-platform-build-application/references/cratis-identity.md +71 -0
  181. package/package/corpus/skills/cratis-platform-build-application/references/studio-repository.md +96 -0
  182. package/package/corpus/skills/cratis-platform-deliver-slice/SKILL.md +14 -8
  183. package/package/corpus/skills/cratis-platform-deliver-slice/references/csharp.md +167 -3
  184. package/package/corpus/skills/cratis-platform-deliver-slice/references/eventual-consistency.md +150 -0
  185. package/package/corpus/skills/cratis-platform-diagnose-slice/SKILL.md +1 -1
  186. package/package/corpus/skills/cratis-platform-start-application/SKILL.md +21 -0
  187. package/package/corpus/skills/cratis-platform-start-application/references/csharp.md +77 -3
  188. package/package/corpus/skills/cratis-platform-upgrade-application/SKILL.md +118 -0
  189. package/package/corpus/skills/cratis-platform-upgrade-application/references/csharp.md +117 -0
  190. package/package/corpus/skills/cratis-platform-upgrade-application/references/java.md +53 -0
  191. package/package/corpus/skills/cratis-platform-upgrade-application/references/kotlin.md +53 -0
  192. package/package/corpus/skills/cratis-platform-upgrade-application/references/typescript.md +71 -0
  193. package/package/corpus/skills/cratis-screenplay-accept-model/references/csharp.md +29 -0
  194. package/package/corpus/skills/cratis-screenplay-accept-model/references/read-the-evidence.md +82 -1
  195. package/package/corpus/skills/cratis-screenplay-declare-slice/SKILL.md +1 -1
  196. package/package/corpus/skills/cratis-screenplay-declare-slice/references/structure-and-imports.md +10 -0
  197. package/package/corpus/skills/cratis-screenplay-onboard-workspace/SKILL.md +5 -4
  198. package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/cli.md +19 -2
  199. package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/smallest-model.md +87 -0
  200. package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/typescript.md +13 -0
  201. package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/workspace-mcp.md +5 -0
  202. package/package/corpus/skills/cratis-specifications-exercise-backend/SKILL.md +2 -0
  203. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-colocated.md +101 -0
  204. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-command-results.md +3 -1
  205. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-decision-reads.md +1 -0
  206. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-events.md +1 -0
  207. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-integration.md +4 -2
  208. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-reactors.md +3 -3
  209. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp.md +34 -1
  210. package/package/corpus/skills/cratis-specifications-exercise-backend/references/elixir.md +2 -0
  211. package/package/corpus/skills/cratis-specifications-isolate-behavior/SKILL.md +1 -1
  212. package/package/corpus/skills/cratis-specifications-isolate-behavior/references/csharp-running.md +10 -3
  213. package/package/corpus/skills/cratis-specifications-test-application-ui/references/typescript.md +22 -4
  214. package/package/corpus/skills/cratis-specifications-test-typescript-behavior/SKILL.md +2 -1
  215. package/package/corpus/skills/cratis-specifications-test-typescript-behavior/references/typescript.md +40 -0
  216. package/package/profile-catalog.json +15 -0
  217. package/package.json +1 -1
@@ -39,7 +39,9 @@ Use this reference for the React frontend regardless of the backend SDK; a React
39
39
 
40
40
  ## Runner and structure
41
41
 
42
- Dev dependencies of the frontend project: `vitest`, `chai`, `chai-as-promised`, `sinon`, `sinon-chai`, typings for the Mocha-style globals (`@types/mocha`), and a reflect-metadata polyfill (`reflect-metadata` or `@cratis/fundamentals/reflection`). View models carry `tsyringe` decorators, and `tsyringe` throws on import without the polyfill. Rendering specs also need `@testing-library/react` and `jsdom`. Use what the app already has.
42
+ Dev dependencies of the frontend project: `vitest`, `chai`, `chai-as-promised`, `sinon`, `sinon-chai`, typings for the Mocha-style globals (`@types/mocha`), typings for the assertion libraries that do not bundle their own (`@types/chai`, `@types/chai-as-promised`, `@types/sinon`, `@types/sinon-chai`), and a reflect-metadata polyfill (`reflect-metadata` or `@cratis/fundamentals/reflection`). View models carry `tsyringe` decorators, and `tsyringe` throws on import without the polyfill. Mounted specs also need `@testing-library/react`, its peer `@testing-library/dom` (the package manager does not add it for you) and `jsdom`. Use what the app already has.
43
+
44
+ The frontend's TypeScript configuration includes the spec files in the strict type check, so missing typings fail the build, not only the specs. Installing a typings package for globals is not enough when the configuration does not load it: if the type check cannot find `describe`, `it` or `beforeEach`, name the package in `compilerOptions.types`, as `"types": ["mocha"]`. `"types": ["vitest/globals"]` types the same globals from Vitest itself and needs no `@types/mocha`. Keep the entries the configuration already lists.
43
45
 
44
46
  Setup file, listed in `test.setupFiles`:
45
47
 
@@ -48,14 +50,19 @@ import 'reflect-metadata';
48
50
  import * as chai from 'chai';
49
51
  import * as chaiAsPromised from 'chai-as-promised';
50
52
  import * as sinonChai from 'sinon-chai';
51
- import { afterEach } from 'vitest';
52
- import { cleanup } from '@testing-library/react';
53
53
 
54
54
  chai.should();
55
55
  chai.use(sinonChai.default);
56
56
  chai.use(chaiAsPromised.default);
57
+ ```
57
58
 
58
- afterEach(() => cleanup()); // only when the project has rendering specs
59
+ Only a project with mounted specs adds the Testing Library import and cleanup to the setup file. Leave both out of a suite that runs view-model and static-markup specs in Node:
60
+
61
+ ```ts
62
+ import { afterEach } from 'vitest';
63
+ import { cleanup } from '@testing-library/react';
64
+
65
+ afterEach(() => cleanup());
59
66
  ```
60
67
 
61
68
  Vitest can define its own spy assertions under the same names on the shared chai as getter-only properties, which sinon-chai cannot overwrite. If `chai.use(sinonChai.default)` throws, delete those names first:
@@ -74,6 +81,17 @@ Vitest `test` options that Cratis frontends use:
74
81
  - Use the Node environment for view-model and static-markup specs. Mounted specs need jsdom: set `environment: 'jsdom'` for a DOM-only project or add `// @vitest-environment jsdom` at the top of each mounted spec. Keep both discovery globs either way.
75
82
  - `isolate: false` and `fileParallelism: false`. Spec files share module state, so caches and prototype stubs carry from one file to the next unless you reset them (see Isolation and reset).
76
83
 
84
+ Where the runner lives:
85
+
86
+ - **First frontend spec in a templated app.** The `cratis` template ships no spec runner: no runner packages, no `test` section and no `test` script. With the first frontend spec add the dev dependencies above (typings included; leave out the Testing Library and jsdom packages until there is a mounted spec), the globals typings entry in `compilerOptions.types` of `.frontend/tsconfig.json`, the setup file, a `test` section in the existing Vite configuration under `.frontend/` and a script `"test": "vitest run --config .frontend/vite.config.ts"`. Keep one Vite configuration for build and specs; import `defineConfig` from `vitest/config` in it so `test` is typed.
87
+ - **Globs follow the configuration's root.** That configuration sets `root` to `.frontend/`, while specs sit beside the code in the project folder above it. Patterns resolve against that root, so a pattern without `../` only reaches files under `.frontend/`. Prefix each pattern that targets files above it with `../`: `include: ['../**/for_*/when_*/**/*.{ts,tsx}', '../**/for_*/**/when_*.{ts,tsx}']`.
88
+ - **Co-located project (backend and frontend in one folder).** Setting `exclude` replaces Vitest's defaults, which keep dependencies and version-control folders out at any depth. Keep those exclusions recursive across the scanned tree and add the project's own: `exclude: ['../**/node_modules/**', '../**/.git/**', '../**/given/**', '../bin/**', '../obj/**', '../wwwroot/**']`. A `'../node_modules/**'` pattern covers only the top-level folder, so `for_*/when_*` files in a nested dependency would be collected. `bin` and `obj` are the backend's build output and `wwwroot` is the served frontend output; none of them holds specs to run.
89
+ - **Several applications in one repository (edge case).** The workspace root owns the runner packages, one shared setup file and the shared scripts, for example `"g:test": "cd $INIT_CWD && vitest run --config .frontend/vite.config.ts"`. Each application keeps its own `.frontend/vite.config.ts`, points `test.setupFiles` at the shared setup file and declares `"test": "yarn g:test"`. Do not copy the setup file into each application.
90
+
91
+ When a component mixes rendering with wiring and you want to specify its initial app-owned markup, consider extracting the rendering. One component binds the queries, commands and dialogs and passes data and callbacks down; the other takes only data and callbacks as props. Render the second one with props in a spec under `for_<Component>/` (see Static markup in [Rendering specs](typescript-rendering.md)); it needs no proxy stubs. A component that already takes only props needs no split, and provider-driven behavior stays in mounted specs.
92
+
93
+ Under `isolate: false` the spec files in one worker share a module registry. Unless that registry is reset between files, a module evaluated by an earlier file stays cached, so a later file's `vi.mock` of it may not apply and which version a spec gets depends on load order. In such a project do not use `vi.mock` on a module that other spec files import for real. If a project that disables isolation mocks modules, call `vi.resetModules()` in the setup file, which runs before each spec file, so cached modules do not carry across files; spec files then add no `vi.resetModules()` of their own. Register a mock in the setup file only when it is meant to be shared by the whole suite. With Vitest's default isolation each spec file gets its own module registry: keep `vi.mock` local to the file and add no reset.
94
+
77
95
  Run the affected specs with the app's non-watch test command (for Vitest, `vitest run` with the spec path filter). Also run the project's non-fixing lint and type check, for example its `lint:ci` script and `tsc --noEmit -p <spec-tsconfig>` when it has a standalone spec config. Use the workspace check for project references, and ensure it includes the spec files.
78
96
 
79
97
  Cratis exports no `given` for UI specs. Add one to the app, for example `given.ts` at the frontend root:
@@ -63,7 +63,7 @@ The syntax for every item is in your language reference.
63
63
 
64
64
  ### Runner and discovery
65
65
 
66
- - **Package or workspace test project**: use the owning configuration so the existing environment and setup apply.
66
+ - **Package or workspace test project**: use the owning configuration so the existing environment and setup apply; in a workspace, run the owning package's test script from its folder when that script starts the runner, or the configured root runner with a project or path filter when the package has none. Read the script before passing it a filter: only a script that forwards its arguments to the runner accepts one.
67
67
  - **Global or imported suite functions**: match neighboring specs; binding these functions is independent of file discovery.
68
68
  - **Include and exclude patterns**: use the configured single-file form for one outcome or a directory for several; check extensions, suffixes, and fixture exclusions separately.
69
69
  - **Environment**: use the project's default; select a file-level environment only when that file needs browser facilities.
@@ -72,6 +72,7 @@ The syntax for every item is in your language reference.
72
72
  - **Spec type configuration**: include the declarations for the assertions and any globals the project uses; runtime setup alone does not declare types.
73
73
  - **File isolation**: keep files isolated when mocking imports, so one file cannot depend on a module evaluation from another.
74
74
  - **Focused run**: select the owning project and the file or folder; check the collected cases when filtering by name.
75
+ - **Coverage exclusions**: keep spec folders, build output, and declaration files out of the coverage report.
75
76
 
76
77
  ### Structure
77
78
 
@@ -3,6 +3,7 @@
3
3
  ## Contents
4
4
 
5
5
  - Runner setup
6
+ - Running in a workspace
6
7
  - The given helper
7
8
  - Worked example
8
9
  - Given context lifetime
@@ -82,6 +83,45 @@ const standardDecorators = {
82
83
 
83
84
  Run `yarn vitest run <file-or-folder>` using the owning configuration. In a workspace, select the owning project with `--project <name>` where needed. Confirm the expected cases are listed and pass. If the run is empty, check the configuration and project, the file argument and `include`/`exclude`, and any `-t` name filter independently.
84
85
 
86
+ ## Running in a workspace
87
+
88
+ When the owning package has a `test` script, run it from that package's folder: `yarn test`. Read the script first. When it starts Vitest, it applies that package's runner configuration, so its include patterns, environment and setup file are in effect. When it also passes its arguments on to Vitest, as a script ending in `vitest run` does, `yarn test for_ReminderPlanner` focuses the run on one spec folder. A script that starts another runner, or that ends in a fixed file list or a chained command, does not take a Vitest filter: use that runner's own filter syntax, or call Vitest directly with the owning configuration. When the package has no `test` script and the root configuration covers it, run the root runner with a path or project filter instead, from the workspace root: `yarn vitest run <package-folder>`, or `yarn vitest run --project <name>` when the root configuration defines projects. Either way, confirm the run lists a nonzero number of cases.
89
+
90
+ In a Yarn workspace, the root `package.json` commonly holds the runner commands once, and each package's `test` script forwards to them:
91
+
92
+ | Root script | Runs | Package script that forwards to it |
93
+ | --- | --- | --- |
94
+ | `g:test` | Vitest once, in the folder the command was started from | `"test": "yarn g:test"` |
95
+ | `g:test:watch` | Vitest in watch mode, in the same folder | `"test:watch": "yarn g:test:watch"` |
96
+
97
+ ```json
98
+ {
99
+ "scripts": {
100
+ "g:test": "cd $INIT_CWD && vitest run",
101
+ "g:test:watch": "cd $INIT_CWD && vitest --watch"
102
+ }
103
+ }
104
+ ```
105
+
106
+ `$INIT_CWD` is the folder the command was started from, so each package runs with its own configuration. If Vitest does not discover a package's configuration by itself, for example when it sits in a subfolder such as `.frontend`, pass `--config` in whichever script launches Vitest, root or package: `vitest run --config .frontend/vite.config.ts`. That path is resolved from the package folder. Use the scripts the workspace already has and add these only when a workspace has none.
107
+
108
+ - **Whole workspace:** when the root has a `test` script that runs every package's `test` script, use it before finishing, not to prove one new spec.
109
+ - **Anti-pattern:** starting Vitest for one package's specs without loading the configuration that owns them. Its include patterns and setup file do not apply, and the run can collect zero cases. From the workspace root this is fine when the root configuration covers the package, or when the package's configuration is passed explicitly: `yarn vitest run --config <package-folder>/.frontend/vite.config.ts`.
110
+
111
+ For coverage, install the coverage provider package for the runner (`@vitest/coverage-v8` for the `v8` provider), add `--coverage` to the same Vitest invocation that discovers the specs (`yarn test --coverage` when the package script forwards its arguments to Vitest, `yarn vitest run <package-folder> --coverage` from the workspace root otherwise), and keep spec folders, build output and declaration files out of the report. Merge `coverage` into the `test` block of the existing configuration, beside its `include`, `exclude` and other settings; this fragment shows only the added part:
112
+
113
+ ```typescript
114
+ test: {
115
+ // existing include, exclude, setupFiles …
116
+ coverage: {
117
+ provider: 'v8',
118
+ exclude: ['**/for_*/**', '**/dist/**', '**/*.d.ts']
119
+ }
120
+ }
121
+ ```
122
+
123
+ Add the package's other output folders, such as a web root the frontend builds into. `coverage.exclude` only shapes the report. Spec collection is unchanged: `test.include` selects the candidate files and `test.exclude` removes matches from them.
124
+
85
125
  ## The given helper
86
126
 
87
127
  In an Arc Node server package, import the published helper: `import { given } from '@cratis/arc.testing';`. Elsewhere, import the local helper the adjacent specs import. When the package has none, add this plain helper beside the package's sources:
@@ -31,6 +31,7 @@
31
31
  "cratis-arc-page-query",
32
32
  "cratis-arc-select-backend-sdk",
33
33
  "cratis-arc-validate-command",
34
+ "cratis-authproxy-configure",
34
35
  "cratis-chronicle-connect-application",
35
36
  "cratis-chronicle-constrain-append",
36
37
  "cratis-chronicle-evolve-event",
@@ -54,6 +55,7 @@
54
55
  "cratis-platform-build-application",
55
56
  "cratis-platform-deliver-slice",
56
57
  "cratis-platform-diagnose-slice",
58
+ "cratis-platform-upgrade-application",
57
59
  "cratis-platform-verify-service-handoff",
58
60
  "cratis-specifications-exercise-backend"
59
61
  ],
@@ -207,6 +209,7 @@
207
209
  "cratis-arc-isolate-tenant",
208
210
  "cratis-arc-page-query",
209
211
  "cratis-arc-validate-command",
212
+ "cratis-authproxy-configure",
210
213
  "cratis-chronicle-connect-application",
211
214
  "cratis-chronicle-constrain-append",
212
215
  "cratis-chronicle-evolve-event",
@@ -254,6 +257,7 @@
254
257
  "cratis-arc-isolate-tenant",
255
258
  "cratis-arc-page-query",
256
259
  "cratis-arc-validate-command",
260
+ "cratis-authproxy-configure",
257
261
  "cratis-chronicle-connect-application",
258
262
  "cratis-chronicle-constrain-append",
259
263
  "cratis-chronicle-evolve-event",
@@ -335,6 +339,7 @@
335
339
  "cratis-arc-isolate-tenant",
336
340
  "cratis-arc-page-query",
337
341
  "cratis-arc-validate-command",
342
+ "cratis-authproxy-configure",
338
343
  "cratis-chronicle-connect-application",
339
344
  "cratis-chronicle-constrain-append",
340
345
  "cratis-chronicle-evolve-event",
@@ -350,6 +355,7 @@
350
355
  "cratis-observability",
351
356
  "cratis-platform-deliver-slice",
352
357
  "cratis-platform-start-application",
358
+ "cratis-platform-upgrade-application",
353
359
  "cratis-specifications-exercise-backend"
354
360
  ],
355
361
  "languages": [
@@ -437,6 +443,7 @@
437
443
  "cratis-observability",
438
444
  "cratis-platform-deliver-slice",
439
445
  "cratis-platform-start-application",
446
+ "cratis-platform-upgrade-application",
440
447
  "cratis-specifications-exercise-backend"
441
448
  ],
442
449
  "languages": [
@@ -480,6 +487,7 @@
480
487
  "cratis-observability",
481
488
  "cratis-platform-deliver-slice",
482
489
  "cratis-platform-start-application",
490
+ "cratis-platform-upgrade-application",
483
491
  "cratis-specifications-exercise-backend"
484
492
  ],
485
493
  "languages": [
@@ -779,6 +787,7 @@
779
787
  "availableTargets": [
780
788
  "cratis-arc-authorize-request",
781
789
  "cratis-arc-isolate-tenant",
790
+ "cratis-authproxy-configure",
782
791
  "cratis-code-review",
783
792
  "cratis-performance-review",
784
793
  "cratis-security-review"
@@ -1326,6 +1335,7 @@
1326
1335
  "cratis-components-choose-control",
1327
1336
  "cratis-components-compose-toolbar",
1328
1337
  "cratis-components-coordinate-feedback",
1338
+ "cratis-components-diagnose-screen",
1329
1339
  "cratis-components-display-list",
1330
1340
  "cratis-components-edit-schema-data",
1331
1341
  "cratis-components-explore-data",
@@ -1926,6 +1936,7 @@
1926
1936
  "cratis-arc-react-bind-slice",
1927
1937
  "cratis-arc-react-separate-view-model",
1928
1938
  "cratis-arc-validate-command",
1939
+ "cratis-authproxy-configure",
1929
1940
  "cratis-chronicle-connect-application",
1930
1941
  "cratis-chronicle-constrain-append",
1931
1942
  "cratis-chronicle-deploy-kernel",
@@ -1943,6 +1954,7 @@
1943
1954
  "cratis-components-choose-control",
1944
1955
  "cratis-components-compose-toolbar",
1945
1956
  "cratis-components-coordinate-feedback",
1957
+ "cratis-components-diagnose-screen",
1946
1958
  "cratis-components-display-list",
1947
1959
  "cratis-components-edit-schema-data",
1948
1960
  "cratis-components-explore-data",
@@ -1961,6 +1973,7 @@
1961
1973
  "cratis-platform-deliver-slice",
1962
1974
  "cratis-platform-diagnose-slice",
1963
1975
  "cratis-platform-start-application",
1976
+ "cratis-platform-upgrade-application",
1964
1977
  "cratis-platform-verify-service-handoff",
1965
1978
  "cratis-screenplay-accept-model",
1966
1979
  "cratis-screenplay-author-extension",
@@ -2076,6 +2089,7 @@
2076
2089
  "cratis/engineering/dotnet"
2077
2090
  ],
2078
2091
  "availableTargets": [
2092
+ "cratis-choreography-run-workflow",
2079
2093
  "cratis-engineering-csharp-conventions",
2080
2094
  "cratis-fundamentals-concept",
2081
2095
  "cratis-fundamentals-name-value",
@@ -2267,6 +2281,7 @@
2267
2281
  "cratis-arc-invoke-command",
2268
2282
  "cratis-arc-page-query",
2269
2283
  "cratis-arc-validate-command",
2284
+ "cratis-choreography-run-workflow",
2270
2285
  "cratis-chronicle-connect-application",
2271
2286
  "cratis-chronicle-constrain-append",
2272
2287
  "cratis-chronicle-evolve-event",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "8.5.0",
3
+ "version": "8.7.0",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [