@cratis/pi 8.13.0 → 8.15.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 (27) hide show
  1. package/package/corpus/skills/cratis-code-review/SKILL.md +1 -1
  2. package/package/corpus/skills/cratis-components-diagnose-screen/SKILL.md +1 -1
  3. package/package/corpus/skills/cratis-components-theme-application/SKILL.md +5 -2
  4. package/package/corpus/skills/cratis-migrate-arc-22-to-23/SKILL.md +59 -0
  5. package/package/corpus/skills/cratis-migrate-arc-22-to-23/references/csharp.md +121 -0
  6. package/package/corpus/skills/cratis-migrate-arc-23-to-24/SKILL.md +60 -0
  7. package/package/corpus/skills/cratis-migrate-arc-23-to-24/references/csharp.md +91 -0
  8. package/package/corpus/skills/cratis-migrate-arc-23-to-24/references/typescript.md +26 -0
  9. package/package/corpus/skills/cratis-migrate-components-3-to-4/SKILL.md +72 -0
  10. package/package/corpus/skills/cratis-migrate-components-3-to-4/references/typescript.md +137 -0
  11. package/package/corpus/skills/cratis-platform-upgrade-application/SKILL.md +2 -2
  12. package/package/corpus/skills/cratis-platform-upgrade-application/references/typescript.md +1 -1
  13. package/package/corpus/skills/cratis-specifications-exercise-backend/SKILL.md +1 -0
  14. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-command-results.md +34 -1
  15. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-decision-reads.md +4 -7
  16. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-query-scenario.md +7 -8
  17. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-read-models.md +1 -1
  18. package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp.md +25 -3
  19. package/package/corpus/skills/cratis-specifications-observe-ui/SKILL.md +20 -0
  20. package/package/corpus/skills/cratis-specifications-observe-ui/references/typescript.md +17 -0
  21. package/package/corpus/skills/cratis-specifications-test-application-ui/SKILL.md +9 -2
  22. package/package/corpus/skills/cratis-specifications-test-application-ui/references/typescript.md +45 -1
  23. package/package/corpus/skills/cratis-specifications-test-typescript-behavior/SKILL.md +21 -0
  24. package/package/corpus/skills/cratis-specifications-test-typescript-behavior/references/typescript.md +58 -3
  25. package/package/profile-catalog.json +78 -0
  26. package/package.json +1 -1
  27. package/package/corpus/skills/cratis-components-theme-application/references/upgrade-from-previous-major.md +0 -141
@@ -12,6 +12,7 @@
12
12
  - Fake time
13
13
  - Arc command decision
14
14
  - Generated command client validation
15
+ - Proxies against a stubbed fetch
15
16
  - Specs without globals
16
17
  - Common mistakes and recovery
17
18
 
@@ -345,14 +346,68 @@ Start from a draft the rules accept, prove it passes, then change exactly one fi
345
346
 
346
347
  What the local result covers:
347
348
 
348
- - **Mirrored rules.** With the default generation setting the proxy carries the backend validator's translatable rules, for example `NotEmpty()` as `notEmpty()` and `LessThanOrEqualTo(12)` as `lessThanOrEqual(12)`. `notEmpty()` rejects `null`, `undefined`, a blank string and an empty array.
349
- - **Required properties.** A non-optional property fails only when it is `null` or `undefined`. An empty string `''` passes this check but can fail a mirrored rule such as `notEmpty()` or `minLength(1)`.
350
- - **Not translated.** `Must`, `MustAsync`, custom validators, conditional rules (`When`, `Unless`) and any rule that needs a dependency exist only on the server. A project generated with client validation set to `server` carries no generated rules at all.
349
+ - **Mirrored rules.** With the default generation setting the proxy carries the backend validator's translatable rules, for example `NotEmpty()` as `notEmpty()` and `LessThanOrEqualTo(12)` as `lessThanOrEqual(12)`. Data-annotation attributes such as `[Required]` (as `notEmpty()`), `[StringLength]`, `[Range]` and `[RegularExpression]` are mirrored the same way. `notEmpty()` rejects `null`, `undefined`, a blank string and an empty array.
350
+ - **Required properties.** A non-optional property fails only when it is `null` or `undefined`. An empty string `''` passes this check but can fail a mirrored rule such as `notEmpty()` or `minLength(1)`. A property bound to a route parameter is not checked.
351
+ - **Not translated.** `Must`, `MustAsync`, custom validators, conditional rules (`When`, `Unless`), a rule whose severity is computed per request, and any rule that needs a dependency exist only on the server. A project generated with client validation set to `server` carries no generated rules at all.
352
+
353
+ How the result is shaped:
354
+
355
+ - **Rules run first.** When a mirrored rule blocks, the result holds only the rule failures; the required-property check has not run. Do not expect `<name> is required` next to a rule failure in the same result.
356
+ - **Only blocking results make it invalid.** A rule with warning or information severity leaves `isValid` and `isSuccess` `true` and is still listed in `validationResults`. Assert `isValid` for a refusal and the member for the field; a non-empty `validationResults` alone is not a refusal. Without a declared blocking severity and with default caller options, only `Error` blocks locally. With a declared floor, findings at or above it and `Unknown` block; caller options cannot weaken that floor. `validateClientSide()` lists advisory findings without marking the draft invalid.
357
+ - **A draft with nothing to report** returns `CommandResult.empty`.
358
+ - **`validate()` merges.** When the request is sent and succeeds, the returned result also lists the local non-blocking results.
359
+
360
+ Members that do not exist or do something else:
361
+
362
+ | Tempting | Reality |
363
+ | --- | --- |
364
+ | `command.isValid`, `command.errors`, `command.validationResults` | None is on the proxy. Read `isValid` and `validationResults` from the returned `CommandResult`; it has no `errors` member. |
365
+ | `command.validation.validate(command)` | Runs only the generated rules and returns a `ValidationResult[]`: no required-property check, no severity filtering. `validation` is `undefined` on a proxy without rules. Call `validateClientSide()` instead. |
366
+ | `validateClientSide(severity)` | Takes no arguments. Only `execute(allowedSeverity?, ignoreWarnings?)` takes the warning arguments. |
367
+ | `query.validateClientSide()`, `query.validate()` | Query proxies have neither. Their local checks run inside `perform` and `subscribe`; see Proxies against a stubbed fetch. |
351
368
 
352
369
  A passing local result is therefore not proof that the server accepts the command. Prove each server-only rule in a backend spec through the command pipeline (see `cratis-specifications-exercise-backend`). Do not stub `fetch` with a canned failure and call that proof of the rule: it proves only how the caller handles a refusal.
353
370
 
354
371
  To see which rules a proxy carries, read the generated file; never edit it. How a screen uses the two calls is in `cratis-arc-react-bind-slice`.
355
372
 
373
+ ## Proxies against a stubbed fetch
374
+
375
+ Stub `fetch` only to prove what a real proxy sends or how it reads an answer. To prove what a screen does with a result, stub the proxy's `execute`, `perform` or `subscribe` instead (see `cratis-specifications-test-application-ui`); to prove what the server answers, use `cratis-arc-testing-typescript` for an Arc Node server or `cratis-specifications-exercise-backend` for a C# backend.
376
+
377
+ ```typescript
378
+ const fetchStub = sinon.stub(globalThis, 'fetch').resolves({ status: 200, json: async () => envelope } as Response);
379
+ command.setOrigin('http://localhost');
380
+
381
+ const result = await command.execute();
382
+
383
+ fetchStub.should.have.been.calledOnce;
384
+ ```
385
+
386
+ Under the node environment there is no document to take the origin from, so set it on the proxy before the call. Set a valid origin in Node before testing the request. Without it, URL construction fails before `fetch`: command calls and observable-query `perform()` reject; snapshot-query `perform()` returns an exception result. Restore the stub in `afterEach`.
387
+
388
+ What the proxy does before it calls `fetch`:
389
+
390
+ | Proxy call | Local outcome without a request |
391
+ | --- | --- |
392
+ | `command.execute()`, `command.validate()` | A blocking rule or a missing required property resolves a validation failure. |
393
+ | `query.perform(args)` | A failing generated rule resolves `QueryResult.validationFailed`. A required request parameter that is absent, `null`, `undefined` or `''` resolves an unsuccessful result whose data is the query's default value, and logs a warning. |
394
+ | `observableQuery.subscribe(callback, args)` | A failing generated rule delivers the validation failure to the callback. A missing required parameter delivers a successful empty result holding the default value. No connection opens in either case. |
395
+
396
+ Assert `fetchStub.should.not.have.been.called` to prove a local refusal sent nothing.
397
+
398
+ What the proxy reads from the answer:
399
+
400
+ - **The body is the result.** The flags (`isSuccess`, `isAuthorized`, `isValid`, `hasExceptions`) and `validationResults` come from the JSON envelope exactly as written. For command calls and query `perform()`, model unauthorized outcomes with a complete result envelope containing `isAuthorized: false` and `isSuccess: false`, not a bare `401` or `403`. Polling subscriptions are different: they recognize those statuses and can synthesize an unauthorized result. Commands special-case `404`; queries using Auto can retry `405` or `501` with GET.
401
+ - **A status code alone models nothing.** A stub answering `401` or `403` with an empty body does not produce an unauthorized result. The body cannot be parsed, so a command resolves a failed result with an exception message and a query resolves an unsuccessful result with its default value. For an unauthorized result, put `isAuthorized: false` and `isSuccess: false` in the envelope. Whether a real server answers `401` or `403` is a server-pipeline fact a stub cannot establish.
402
+ - **A rejected `fetch`.** A command resolves `CommandResult.failed` with the error in `exceptionMessages`. A snapshot query's `perform` resolves a result with `hasExceptions` `true` and the default value as data; an abort is rethrown. An observable query's `perform` rejects.
403
+ - **Query HTTP method.** A query is sent with `GET` unless the application configures another method or the spec calls `setHttpMethod`. Assert the method only when the spec set it.
404
+
405
+ What a stubbed `fetch` cannot stand in for:
406
+
407
+ - **Observable delivery.** `subscribe` receives results over a WebSocket or an event source, not from `fetch`; only the polling transport reads them with `fetch`. Stub `subscribe`, capture its callback and push results through it.
408
+ - **The server's decision.** The envelope is the spec's own text. It shows the client handles that shape, not that any command, validator, policy or route produces it.
409
+ - **Shared transport state.** A spec that lets a query reach the stub leaves module-level state behind; call `resetSharedMultiplexer()` and `resetQueryHttpMethodResolution()` from `@cratis/arc/queries` in `afterEach`.
410
+
356
411
  ## Specs without globals
357
412
 
358
413
  When the package does not expose global suite functions, import them from the runner. The example uses Vitest matchers; keep the package's assertion style and naming regardless of how the suite functions are bound:
@@ -1797,6 +1797,62 @@
1797
1797
  ],
1798
1798
  "languages": []
1799
1799
  },
1800
+ {
1801
+ "id": "cratis/migrate/arc-22-to-23",
1802
+ "description": "Temporary: move a C# application from Arc 22 to Arc 23; remove when the upgrade is merged.",
1803
+ "composes": [],
1804
+ "availableTargets": [
1805
+ "cratis-migrate-arc-22-to-23"
1806
+ ],
1807
+ "languages": [
1808
+ "csharp"
1809
+ ],
1810
+ "migration": {
1811
+ "product": "arc",
1812
+ "from": 22,
1813
+ "to": 23,
1814
+ "packages": {
1815
+ "nuget": [
1816
+ "Cratis",
1817
+ "Cratis.Arc",
1818
+ "Cratis.Arc.Core",
1819
+ "Cratis.Arc.Chronicle",
1820
+ "Cratis.Arc.Mcp"
1821
+ ],
1822
+ "npm": [
1823
+ "@cratis/arc",
1824
+ "@cratis/arc.react"
1825
+ ]
1826
+ }
1827
+ }
1828
+ },
1829
+ {
1830
+ "id": "cratis/migrate/arc-23-to-24",
1831
+ "description": "Temporary: move a C# or TypeScript application from Arc 23 to Arc 24; remove when the upgrade is merged.",
1832
+ "composes": [],
1833
+ "availableTargets": [
1834
+ "cratis-migrate-arc-23-to-24"
1835
+ ],
1836
+ "languages": [
1837
+ "csharp",
1838
+ "typescript"
1839
+ ],
1840
+ "migration": {
1841
+ "product": "arc",
1842
+ "from": 23,
1843
+ "to": 24,
1844
+ "packages": {
1845
+ "nuget": [
1846
+ "Cratis.Arc",
1847
+ "Cratis",
1848
+ "Cratis.Arc.Availability"
1849
+ ],
1850
+ "npm": [
1851
+ "@cratis/arc"
1852
+ ]
1853
+ }
1854
+ }
1855
+ },
1800
1856
  {
1801
1857
  "id": "cratis/migrate/arc-24-to-25",
1802
1858
  "description": "Temporary: move a C# application from Arc 24 to Arc 25; remove when the upgrade is merged.",
@@ -1822,6 +1878,28 @@
1822
1878
  }
1823
1879
  }
1824
1880
  },
1881
+ {
1882
+ "id": "cratis/migrate/components-3-to-4",
1883
+ "description": "Temporary: move a TypeScript application from Components 3 to Components 4; remove when the upgrade is merged.",
1884
+ "composes": [],
1885
+ "availableTargets": [
1886
+ "cratis-migrate-components-3-to-4"
1887
+ ],
1888
+ "languages": [
1889
+ "typescript"
1890
+ ],
1891
+ "migration": {
1892
+ "product": "components",
1893
+ "from": 3,
1894
+ "to": 4,
1895
+ "packages": {
1896
+ "npm": [
1897
+ "@cratis/components",
1898
+ "@cratis/components.migrator"
1899
+ ]
1900
+ }
1901
+ }
1902
+ },
1825
1903
  {
1826
1904
  "id": "cratis/modeling/screenplay-stage",
1827
1905
  "composes": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "8.13.0",
3
+ "version": "8.15.0",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [
@@ -1,141 +0,0 @@
1
- # Upgrade Cratis Components from the previous major
2
-
3
- ## Contents
4
-
5
- - When this applies
6
- - Order
7
- - Run a codemod
8
- - What each codemod does and refuses
9
- - Dependencies
10
- - Removed root namespaces
11
- - Removed subpaths and symbols
12
- - Provider and pass-through changes
13
- - Verify
14
- - Avoid
15
-
16
- A one-time task. General package upgrades are in `cratis-platform-upgrade-application`; this reference holds the Components-specific steps. Paths and names in examples are illustrative.
17
-
18
- ## When this applies
19
-
20
- The application is on the major of `@cratis/components` that rendered through PrimeReact, and moves to the major that owns its own markup. You recognise the old major by any of these in the application:
21
-
22
- - Component namespaces imported from the package root: `import { Canvas } from '@cratis/components'` used as `<Canvas.Canvas>`.
23
- - `styledMode()`, `CratisPreset` or `primeReactStyles` in the provider setup.
24
- - Imports from `@cratis/components/styled` or `@cratis/components/compatibility`.
25
-
26
- This is not a version bump: imports, provider configuration, CSS selectors and some callbacks change. "Old major" and "new major" below mean these two.
27
-
28
- ## Order
29
-
30
- Work on a branch. A checkpoint is source, package manifest and lockfile together. Save one only when the application's lint, type check, specs and production build pass. Steps 3 to 6 share one checkpoint: the application does not compile between the package upgrade and the fixes that follow it, so errors left by steps 3 to 5 are expected and the checks must pass only at step 6.
31
-
32
- 1. **Baseline.** Make every check pass on the old major. Save the rollback checkpoint.
33
- 2. **Root imports, still on the old major.** Preview and apply `cratis-components-remove-root-namespace-imports`. The subpaths it writes exist in both majors. Review the diff and every diagnostic, rerun the checks on the old major and save the import-only checkpoint.
34
- 3. **Upgrade the package** to the new major. Then, by hand: the stylesheet imports (Default path in this skill), the provider (below), removed presets and symbols (below), and part names in `pt` and CSS. Type errors remain until step 6 is done; do not checkpoint here.
35
- 4. **Button props.** Preview and apply `cratis-components-button-variant-tone`, then resolve its diagnostics and `TODO(cratis-codemod)` comments.
36
- 5. **Change handlers.** Preview and apply `cratis-components-change-handler`, then resolve its diagnostics and `TODO(cratis-codemod)` comments. A command form field's `onChange` stays a type error until you move it by hand (below).
37
- 6. **Run the checks.** When they pass with no diagnostic and no `TODO(cratis-codemod)` left, save the upgrade checkpoint.
38
- 7. **Replace remaining direct PrimeReact usage** in separate batches (see `cratis-components-choose-control`, `references/from-primereact.md`). Remove PrimeReact packages only when no import, provider, theme or tool still uses them.
39
-
40
- Steps 4 and 5 produce source for the new major, so they come after step 3. Step 2 comes first because the two later codemods find components through their subpath imports.
41
-
42
- To abandon a step, return source, manifest and lockfile to the previous checkpoint together, reinstall from that lockfile and rerun its checks.
43
-
44
- ## Run a codemod
45
-
46
- All three commands ship in `@cratis/components.migrator`. Run them from the application directory whose installed Components package is being upgraded, with the migrator in the same major as the new Components major. Never use `latest`.
47
-
48
- ```sh
49
- # The caret range of the Components major you are upgrading to.
50
- TOOLING_RANGE='^<new major>.0.0'
51
-
52
- npx --package "@cratis/components.migrator@$TOOLING_RANGE" \
53
- cratis-components-remove-root-namespace-imports --check src
54
- npx --package "@cratis/components.migrator@$TOOLING_RANGE" \
55
- cratis-components-remove-root-namespace-imports src
56
- ```
57
-
58
- - The path argument (`src` here) only selects the files to scan. The installed `@cratis/components` is resolved from the working directory, so run from the application directory rather than passing a path into the app from elsewhere.
59
- - Replace `<new major>` with the number; the other two commands take the same form. With pnpm use `pnpm dlx --package …`, with Yarn 2 or later `yarn dlx --package …`.
60
- - `--check` writes nothing. It exits non-zero when a rewrite is pending or a case needs manual review; that exit does not mean the tool failed.
61
- - An apply run rewrites the safe cases, reports the rest and exits non-zero while any refused case remains.
62
- - Before scanning, the migrator checks the installed `@cratis/components`. It accepts only the old major or the new major, and otherwise scans and writes nothing.
63
- - Requires Node.js 20 or later. The codemods bring their own TypeScript, scan `.js`, `.jsx`, `.mjs`, `.cjs`, `.ts`, `.tsx`, `.mts` and `.cts` recursively, skip `node_modules` and `dist`, and are safe to rerun.
64
- - A codemod does not remove imports it leaves unused. Run the formatter and lint afterwards.
65
-
66
- **Coming from a major older than the old major (edge case):** the migrator refuses the installed package. Change the imports by hand, install the new major, then run the codemods.
67
-
68
- ## What each codemod does and refuses
69
-
70
- | Codemod | Rewrites | Leaves for you (reported) |
71
- | --- | --- | --- |
72
- | `cratis-components-remove-root-namespace-imports` | `import { X } from '@cratis/components'` to `import * as X from '@cratis/components/<subpath>'`, and `export { X } from '@cratis/components'` to `export * as X from '@cratis/components/<subpath>'`, for every root namespace. Aliases and type-only imports are kept; mixed setup and namespace imports are split. | Whole-package imports (`import * as`, default, `import = require`), dynamic `import()`, `require()`, `export *` re-exports, side-effect imports, unknown symbols, and the `Compatibility` namespace. |
73
- | `cratis-components-button-variant-tone` | Literal `Button` props: `text` → `variant='ghost'`, `link` → `variant='link'`, `outlined` → `variant='outline'`, `rounded` → `shape='pill'`, and `severity` → `tone` (`secondary`, `contrast` → `neutral`; `info`, `help` → `accent`; `success` → `positive`; `warn` → `caution`; `danger` → `critical`). | Dynamic values, JSX spreads, duplicate props, and a new prop with a non-literal value beside the old prop it replaces. |
74
- | `cratis-components-change-handler` | A callback that only forwards one event field, on a standalone `Dropdown` `onChange` and on a command form field's `onValueChange`: it now receives the value itself. The field is `event.value` for `Dropdown`, `DropdownField` and `MultiSelectField`, `target.value` for the text, password, text area and color fields, `target.checked` for the checkbox and toggle fields, and `target.valueAsNumber` for the number and slider fields (`currentTarget` likewise). | Callbacks with several statements, several uses of the event, or use of the native event. An `event.value` callback whose parameter is not typed as the old change event, because `.value` may belong to the selected value. `onChange` on a command form field (see below). |
75
-
76
- - The first codemod keeps namespace access (`Canvas.Canvas` still resolves). Converting to named imports is optional cleanup by hand.
77
- - When several of `link`, `text` and `outlined` are set, the Button codemod keeps one variant in that order of precedence. A literal new prop (`variant`, `tone`, `shape`) wins over the old prop it replaces.
78
- - The Button codemod removes an old prop only when discarding its value cannot change what runs: a bare prop or a literal value. When the value is an expression that would no longer be evaluated, as `text` in `<Button link text={record()} />`, the whole prop group stays unchanged and is reported for manual review.
79
- - A refused case stays unchanged and is reported. The Button and change-handler codemods also mark it with one `TODO(cratis-codemod)` comment, with three exceptions that are reported only: a Button prop that is not safe to remove (above), an untyped `event.value` callback and `onChange` on a command form field.
80
- - **`onChange` on a command form field** is no longer a prop and fails type checking. Move the side effect to the enclosing `CommandForm`'s `onFieldChange(command, fieldName, oldValue, newValue)`.
81
- - After the change-handler codemod, remove a `DropdownChangeEvent` type import that is no longer used.
82
-
83
- ## Dependencies
84
-
85
- - The new major has no PrimeReact, PrimeIcons or Prime theme dependency. Uninstall those packages only when the application no longer imports them directly; otherwise keep them, with their provider, CSS and license, for the surfaces that still use them.
86
- - `pixi.js` is now an optional peer. Install it when the application imports from the `Canvas` or `PivotViewer` subpath; keep one resolution of it in the application.
87
- - `AutoCommandForm` needs an Arc release that honours an explicit field name. Update `@cratis/arc` and `@cratis/arc.react` together, to the same version, inside the range the Components package declares.
88
- - Add the recommended config of `@cratis/eslint-plugin-components` (same major as Components) after `@cratis/eslint-config`; its `no-root-barrel-import` rule keeps root namespace imports from returning.
89
-
90
- ## Removed root namespaces
91
-
92
- The package root is setup-only: provider, configuration and message types. Every component comes from its subpath.
93
-
94
- | Old root namespace | Subpath |
95
- | --- | --- |
96
- | `Canvas`, `Chat`, `CommandDialog`, `CommandForm`, `Common`, `DataPage`, `DataTables`, `Dialogs`, `Display`, `Dropdown`, `Filter`, `Notifications`, `ObjectContentEditor`, `ObjectNavigationalBar`, `PivotViewer`, `SchemaEditor`, `TimeMachine`, `Toolbar` | `@cratis/components/<same name>` |
97
- | `Types` | `@cratis/components/types` |
98
- | `CommandStepper` | The codemod maps the namespace to `@cratis/components/CommandDialog`, because the old namespace was that whole module. In new code import the `CommandStepper` component from `@cratis/components/CommandStepper`. |
99
- | `Compatibility` | None. Replace its contracts with the typed parts of each component, then delete the import. |
100
-
101
- `@cratis/components/CommandForm/fields` and `@cratis/components/CommandForm` are the same module.
102
-
103
- ## Removed subpaths and symbols
104
-
105
- | Removed | Do instead |
106
- | --- | --- |
107
- | `@cratis/components/styled`; `styledMode`, `StyledModeOptions`, `CratisPreset`, `primeReactStyles` | Remove the renderer configuration. Import `tokens`, `styles` and optionally `theme`; assign product values to `--cratis-*` tokens directly. |
108
- | `@cratis/components/compatibility`; the `Compatibility` namespace and its pass-through contract, sentinel and assert helpers | Use each component's typed parts (`DialogParts`, `DataTableParts`, `TablePaginatorParts`, `StepperParts`, `ToolbarParts`) and `data-cratis-part` selectors. |
109
- | `@cratis/components/primereact-v10-palette` | Map product tokens to `--cratis-*`, or use the baseline theme. |
110
- | `primeReactCssLayer`, `primeReactCssLayerOrder` | Delete, unless the product still owns direct PrimeReact CSS. Layer order belongs in product CSS. |
111
- | `cratisDarkModeSelector` | The product's own theme selector, with the matching `--cratis-*` values assigned under it. |
112
- | `PivotViewerOptimized` | `PivotViewer`. |
113
- | `CommandStepperContent` | No replacement. Use `CommandStepper` or `StepperCommandDialog`. |
114
- | Internal helpers that were exported by accident from `Canvas` (`getInitials`, `reactionsExcludingUser`, mention and emoji helpers) and `Filter` (`buildFilterValues`, `buildRangeValues`, `RenderedHistogramBucket`) | No replacement. Inline the logic the application needs. |
115
-
116
- ## Provider and pass-through changes
117
-
118
- - `CratisComponentsProvider` takes locale, labels, icons, routing, dialog header actions and the toast region (Provider configuration in this skill). Renderer keys are type errors: `license`, `theme`, `defaults`, `pt`, `ripple`, `unstyled` and z-index settings. Remove them; configure a PrimeReact provider that is still needed on its own.
119
- - `value.locales` is still accepted for the old paginator and date labels. Move them to `value.messages`.
120
- - `pt` stays, with new keys and plain HTML attributes as values. `ptOptions` and `unstyled` are accepted and do nothing.
121
- - Rename pass-through keys to Cratis parts. Dialog: `mask` → `backdrop`, `headerTitle` → `title`, `closeButton` → `close`. DataTable: `thead` → `head`, `tbody` → `body`, `bodyRow` → `row`. Every part is in [parts](parts.md).
122
- - Replace `.p-*` selectors with `[data-cratis-part='…']` selectors and the state attributes in this skill.
123
-
124
- ## Verify
125
-
126
- - No component is imported from the package root, and no `TODO(cratis-codemod)` remains.
127
- - `tokens` and `styles` load in every host entry.
128
- - `pt` keys and CSS selectors name Cratis parts.
129
- - With the keyboard only: open and dismiss a dialog, move through a stepper, filter and page a table, enter a date, pick a dropdown value, act on a toast.
130
- - Check each scheme the application supports, then run the checks in Verify in this skill.
131
- - If a changed control loses behaviour the application needs, stay on the last passing checkpoint until it is resolved.
132
-
133
- ## Avoid
134
-
135
- - Upgrading the package before the root-import codemod has run and passed on the old major.
136
- - Running the Button or change-handler codemod before the upgrade.
137
- - Fetching the migrator with `latest`.
138
- - Treating a non-zero `--check` exit as a tool failure.
139
- - Deleting a `TODO(cratis-codemod)` without resolving the case it marks.
140
- - Uninstalling PrimeReact while a direct import of it remains.
141
- - Recreating a product → PrimeReact → Cratis token chain. Map product values to `--cratis-*` directly.