@astryxdesign/cli 0.7.0-canary.fe57f54 → 0.7.1-canary.ff40b78
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.
- package/CHANGELOG.md +167 -0
- package/api/doctor/doctor.d.mts +30 -2
- package/api/doctor/doctor.doc.mjs +2 -1
- package/api/doctor/doctor.mjs +153 -3
- package/api/doctor/doctor.test.mjs +250 -4
- package/assets/codemods/__tests__/registry.test.mjs +1 -0
- package/assets/codemods/registry.mjs +1 -0
- package/assets/codemods/transforms/next/index.mjs +1 -27
- package/assets/codemods/transforms/v0.7.0/__tests__/preserve-bottom-sheet-content-padding.test.mjs +178 -0
- package/assets/codemods/transforms/v0.7.0/__tests__/rename-empty-search-results-text.test.mjs +202 -0
- package/assets/codemods/transforms/v0.7.0/index.mjs +52 -0
- package/assets/codemods/transforms/v0.7.0/preserve-bottom-sheet-content-padding.mjs +242 -0
- package/assets/codemods/transforms/v0.7.0/rename-empty-search-results-text.mjs +254 -0
- package/assets/docs/spacing.doc.mjs +2 -2
- package/assets/docs/tree/tokens-spacing.doc.mjs +15 -15
- package/assets/templates/blocks/components/BottomSheet/BottomSheetHeights.tsx +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetMobileKeyboard.tsx +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetNoScrim.tsx +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSnapPoints.tsx +1 -1
- package/assets/templates/blocks/components/Dialog/DialogAdaptivePresentation.tsx +1 -1
- package/assets/templates/pages/table-filter/page.tsx +8 -3
- package/assets/templates/pages/table-inbox/page.tsx +3 -1
- package/assets/templates/themes/butter/butterTheme.ts +12 -0
- package/assets/templates/themes/chocolate/chocolateTheme.ts +12 -0
- package/assets/templates/themes/matcha/matchaTheme.ts +14 -14
- package/assets/templates/themes/neutral/neutralTheme.ts +12 -0
- package/assets/templates/themes/stone/stoneTheme.ts +12 -0
- package/assets/templates/themes/y2k/y2kTheme.ts +10 -10
- package/assets/theme.template.ts +1 -1
- package/clients/cli/commands/doctor.doc.mjs +1 -1
- package/clients/cli/commands/doctor.test.mjs +33 -0
- package/foundation/discovery/theming-targets.test.mjs +9 -1
- package/package.json +9 -9
- /package/assets/codemods/transforms/{next → v0.7.0}/__tests__/migrate-deprecated-theme-surface.test.mjs +0 -0
- /package/assets/codemods/transforms/{next → v0.7.0}/__tests__/migrate-field-input-styling.test.mjs +0 -0
- /package/assets/codemods/transforms/{next → v0.7.0}/__tests__/validate-data-token-ownership.test.mjs +0 -0
- /package/assets/codemods/transforms/{next → v0.7.0}/migrate-deprecated-theme-surface-v0.6-data.mjs +0 -0
- /package/assets/codemods/transforms/{next → v0.7.0}/migrate-deprecated-theme-surface.mjs +0 -0
- /package/assets/codemods/transforms/{next → v0.7.0}/migrate-field-input-styling.mjs +0 -0
- /package/assets/codemods/transforms/{next → v0.7.0}/validate-data-token-ownership.mjs +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,172 @@
|
|
|
1
1
|
# @xds/cli
|
|
2
2
|
|
|
3
|
+
# 0.7.0
|
|
4
|
+
|
|
5
|
+
#### Breaking Changes
|
|
6
|
+
|
|
7
|
+
- `theme add` now imports built themes; use `theme eject` to copy theme source. (#7138)
|
|
8
|
+
The old contract copied theme source with `theme add <slug> [path] [--overwrite] [--package <package>]` and returned `theme.add` JSON. The `ThemeAddResponse` type and the `theme.add` response type are removed, with their `ThemeAddResponse.type`, `ThemeAddResponse.data`, and `ThemeAddResponse.meta` fields. The replacement imports the built theme with `theme add <slug> [--package <package>]` and returns `theme.app`; `--import` remains an accepted no-op. Plain `theme add` now returns `theme.app` with the owner `package` directly after `type`. Local themes carry no package.
|
|
9
|
+
|
|
10
|
+
A path after `theme add` now exits 1 with `ERR_INVALID_ARGUMENT`, and `--overwrite` exits 1 with `ERR_INVALID_OPTION`; neither writes files. To migrate a script that copied source, run `theme eject` with the same slug, path, `--overwrite`, and `--package` arguments. A script that already runs `theme add --import` keeps the same meaning and needs no change.
|
|
11
|
+
|
|
12
|
+
- `init --remove-agents` says when there was nothing to remove. (#6623)
|
|
13
|
+
Migration: a consumer reading `data.removed` as a boolean keeps working; a consumer that narrowed on the literal `true` must accept the corrected value.
|
|
14
|
+
- Four commands refuse silently ignored option pairs. (#7132)
|
|
15
|
+
Migration: remove the option the command was ignoring.
|
|
16
|
+
- Refuse invalid input that used to silently succeed. (#7149)
|
|
17
|
+
Migration: pass a valid type or package, an integer limit, or the documented arguments, and catch `ERR_AMBIGUOUS_COMPONENT` for a multi-package name.
|
|
18
|
+
- An empty-string argument no longer discards the rest of the command. (#6620)
|
|
19
|
+
Migration: remove the empty string from the invocation; omit the argument to list.
|
|
20
|
+
- `doctor integration validate` exits 1 when there is no package.json. (#7150)
|
|
21
|
+
A missing package.json now produces a `no_package` error, so the existing error-severity exit rule applies. A directory with package.json but no integration manifest still exits 0.
|
|
22
|
+
|
|
23
|
+
Migration: run the command in a directory that has a `package.json`, or handle exit 1 for that case.
|
|
24
|
+
|
|
25
|
+
- Move canonical data-color defaults from generated theme CSS to the public StyleX `dataVars` group. (#6834)
|
|
26
|
+
Import `dataVars` from `@astryxdesign/core/theme/dataTokens.stylex` for CSS-capable code. Canvas and other non-CSS APIs continue to use `resolveThemeToken()` or `useTheme().token()`. Rebuild committed theme CSS with `astryx theme build`; concrete themes now emit only explicitly authored data-color overrides.
|
|
27
|
+
|
|
28
|
+
Old usage: Generated theme CSS owned the canonical `--color-data-*` root defaults.
|
|
29
|
+
|
|
30
|
+
Replacement: The public StyleX `dataVars` group in `@astryxdesign/core/theme/dataTokens.stylex` owns the defaults; concrete themes emit only explicitly authored data-color overrides.
|
|
31
|
+
|
|
32
|
+
Migration: Import `dataVars` from `@astryxdesign/core/theme/dataTokens.stylex` for CSS-capable code. Canvas and other non-CSS APIs continue to use `resolveThemeToken()` or `useTheme().token()`. Rebuild committed theme CSS with `astryx theme build`.
|
|
33
|
+
|
|
34
|
+
Codemod: `astryx upgrade` runs `validate-data-token-ownership`, which rewrites nothing and reports fallback-less `var(--color-data-*)` uses (whole or embedded source strings, and stylesheets) and stale generated theme CSS for manual migration.
|
|
35
|
+
|
|
36
|
+
- Doctor fails when the CLI cannot load what astryx.config asks for (#7130)
|
|
37
|
+
A new `configured-integrations` check fails when an integration named in astryx.config cannot be loaded: not installed, installed without a manifest, or a manifest that throws or fails its schema. Such an integration is withdrawn whole and contributes nothing. The config check fails, instead of warning, when astryx.config imports but the CLI cannot load the project from it.
|
|
38
|
+
|
|
39
|
+
Unchanged: a problem inside one contribution kind (an invalid component doc, a missing or unreadable root, or an unresolved replacement) stays a warning under `integration-issues`, and an autolinked dependency that cannot be loaded stays informational.
|
|
40
|
+
|
|
41
|
+
No codemod applies: nothing in a project's source changes; install the integration, repair its manifest, or edit `integrations` in astryx.config.
|
|
42
|
+
|
|
43
|
+
What counts as configured is every name astryx.config lists, including a package set aside for a provider conflict and the package being authored when its own config names it. Migration: install the integration, fix its manifest, or remove it from `integrations`; fix the astryx.config field the message names.
|
|
44
|
+
|
|
45
|
+
- Typeahead, Tokenizer, CheckboxList, RadioList, and Slider no longer accept root `xstyle`, `className`, or `style`. Style the field with `containerXstyle`/`containerClassName`/`containerStyle` (the Field box; no effect inside InputGroup or a `horizontal-labels` FormLayout) and the visual control box with `controlXstyle`/`controlClassName`/`controlStyle`. Base props now reach the primary semantic control: the combobox input for Typeahead and Tokenizer, the `role="group"`/`role="radiogroup"` element for CheckboxList and RadioList, and the `role="slider"` thumb for Slider (the `role="group"` control in range mode). A caller `aria-describedby` is kept alongside the field's own description and status, on these components and on TextInput, TextArea, and NumberInput, which previously dropped it. CLI templates use the new props. (#7339)
|
|
46
|
+
Migration: rename root `xstyle`/`className`/`style` to the part they styled before: `containerXstyle`/`containerClassName`/`containerStyle` on all five components, except a Typeahead inside InputGroup, whose root styling painted the control surface and moves to `controlXstyle`/`controlClassName`/`controlStyle`. The release's `astryx upgrade` codemod, `migrate-field-input-styling`, performs these renames on JSX usage.
|
|
47
|
+
|
|
48
|
+
Not rewritten by the codemod, so update by hand:
|
|
49
|
+
|
|
50
|
+
- `ref` and `id`, plus `data-*` (except Typeahead and Tokenizer `data-testid`, which marked the control surface), `aria-*`, and DOM event handlers such as `onClick`, previously landed on the outer Field (or were dropped by RadioList and Slider). They now land on the primary semantic control. Update code that measured, queried, or listened on the outer field, and wrap the component in your own element when you need an outer boundary.
|
|
51
|
+
- Typeahead and Tokenizer refs are now `HTMLInputElement`.
|
|
52
|
+
- A consumer `onKeyDown` on Typeahead or Tokenizer still runs after the built-in key handling, cannot cancel it, and still fires for keys on the clear button and tokens; for keys on the input it now runs on the combobox input itself.
|
|
53
|
+
- RadioList and Slider used to drop DOM event handlers; they now run after the component's own handling, so a Slider `onPointerDown`, `onKeyDown`, `onFocus`, or `onBlur` that never fired before now fires (on the thumb, or on the group in range mode).
|
|
54
|
+
- Tokenizer's `onFocus`/`onBlur` keep their meaning: focus entering or leaving the field.
|
|
55
|
+
- Styling passed through a wrapper's own props or a spread is not rewritten and now fails type-checking at that callsite.
|
|
56
|
+
|
|
57
|
+
Untyped callers get a development warning and the value is ignored.
|
|
58
|
+
|
|
59
|
+
From #5656 by @harjothkhara.
|
|
60
|
+
|
|
61
|
+
- Selector, MultiSelector, and ComplexSelector no longer accept root `xstyle`, `className`, or `style`. Style the field with `containerXstyle`/`containerClassName`/`containerStyle` (the Field box; no effect inside InputGroup, a `horizontal-labels` FormLayout, or with `renderTrigger`) and the visual control box with `controlXstyle`/`controlClassName`/`controlStyle`. Base props such as `ref`, `id`, `data-*` (including `data-testid`), `aria-*`, and DOM handlers reach the trigger button that carries the combobox role (or, with `renderTrigger`, the caller's control), and a caller `aria-describedby` is kept alongside the field's own description and status instead of being replaced. Handlers keep their existing order: a ComplexSelector `onClick` on its own trigger can still cancel opening, and newly forwarded handlers (including those reaching a `renderTrigger` control) run after the built-in toggle and keyboard handling. CLI templates use the new props. (#7341)
|
|
62
|
+
Migration: rename root `xstyle`/`className`/`style` on these components to `controlXstyle`/`controlClassName`/`controlStyle`, which style the same element as before. Not a rename: a `data-testid` or other base prop now lands on the trigger button rather than the bordered box around it (query the box with `.closest()` if a test measured it), and with `renderTrigger` base props and `ref` now reach the caller's control. Rename JSX usage by hand, or run `astryx upgrade`; it runs `migrate-field-input-styling`, which does not follow styling passed through a wrapper's own props or a spread, which now fails type-checking at that callsite, so rename it there. Untyped callers get a development warning and the value is ignored.
|
|
63
|
+
|
|
64
|
+
From #5656 by @harjothkhara.
|
|
65
|
+
|
|
66
|
+
- TextInput, TextArea, NumberInput, and FileInput no longer accept root `xstyle`, `className`, or `style`. Style the field with `containerXstyle`/`containerClassName`/`containerStyle` (the Field box; no effect inside InputGroup or a `horizontal-labels` FormLayout) and the visual control box with `controlXstyle`/`controlClassName`/`controlStyle`. Base props such as `ref`, `id`, `data-*`, `aria-*`, and DOM handlers reach the native control, and a caller `id` is now honored there. CLI templates use the new props. (#7336)
|
|
67
|
+
Migration: rename root `xstyle`/`className`/`style` on these components to `controlXstyle`/`controlClassName`/`controlStyle`, which style the same element as before. `astryx upgrade` rewrites JSX usage; styling passed through a wrapper's own props or a spread is not rewritten and now fails type-checking at that callsite, so rename it there. Untyped callers get a development warning and the value is ignored. Not rewritten by the codemod: a caller `id` used to be replaced by a generated one and now reaches the native control (the label stays associated), so remove an `id` you passed but relied on being ignored. Other base props already reached the native control and are unchanged.
|
|
68
|
+
|
|
69
|
+
From #5656 by @harjothkhara.
|
|
70
|
+
|
|
71
|
+
- matcha's and y2k's spacing steps are rem (`--spacing-2: 0.75rem`), so their gaps and padding follow the reader's root font size like the core scale. Every step is the same pixel value at the default 16px root; a reader with a larger root font size now sees proportionally larger spacing on these themes. The CLI's copies of both theme templates and the annotated theme template's spacing example change the same way. (#7374)
|
|
72
|
+
Migration: nothing to change to take the new behaviour. To keep fixed pixel spacing on one of these themes, extend it and override the steps in px, which is honoured as written: `defineTheme({name: 'app', extends: matchaTheme, tokens: {'--spacing-2': '12px'}})`.
|
|
73
|
+
- On touch devices narrower than the `lg` breakpoint (`(width < 1024px) and (pointer: coarse)`), the 14px-base first-party themes now floor their type base to 16px and re-derive the ratio so Display 1 keeps its desktop size: neutral and chocolate (base 14, ratio 1.2 → 1.1736) and butter and stone (base 14, ratio 1.25 → 1.2225). On phones, body, label and code text rise from 14px to 16px; supporting text, the headings and Display 2 and 3 grow by 1–2px; only Display 1 holds its desktop size. Desktop sizes are unchanged. gothic, matcha and y2k already use a 16px base and need no rule. The CLI's theme templates carry the same rule, so a newly scaffolded theme gets it too. (#6699)
|
|
74
|
+
An app theme that extends one of these four themes and sets its own `typography.scale` or type-size tokens inherits this rule, and on touch + narrow screens the rule replaces those values (a base-18 child drops to a 16px body and a 42px Display 1). Append your own rule for the same condition with the values you want; a later rule for the same condition wins.
|
|
75
|
+
|
|
76
|
+
Migration: nothing to change to take the new phone scale. To keep the previous 14px phone scale in an app, extend the theme and append a later rule for the same condition: `defineTheme({name: 'app', extends: neutralTheme, adaptations: {rules: [{when: {pointer: 'coarse', width: {below: 'lg'}}, value: {typography: {scale: {base: 14, ratio: 1.2}}}}]}})`. For butter and stone use `ratio: 1.25` and also set `tokens: {'--text-supporting-size': '12px'}` in that rule's value, because those themes pin supporting text at 12px rather than the 11px the scale alone gives. This cannot be rewritten by a codemod: whether an app wants the floor is a product choice.
|
|
77
|
+
|
|
78
|
+
- Stop reading the Astryx-owned agent variables ASTRYX_AGENT_ID, ASTRYX_AGENT_SESSION_ID, and ASTRYX_AGENT_METADATA (#7127)
|
|
79
|
+
The theme-import change already stopped reading `ASTRYX_THEME`; these three were the last Astryx-owned agent variables. A test now fails on any `process.env.ASTRYX_*` read in the CLI source.
|
|
80
|
+
|
|
81
|
+
Migration: set `AGENT` and `AGENT_SESSION_ID`, which the CLI already reads, instead of the Astryx-prefixed variants. `ASTRYX_AGENT_METADATA` has no replacement variable.
|
|
82
|
+
|
|
83
|
+
- Remove the deprecated component-theming compatibility surface scheduled for 0.7.0. Components now emit only canonical target classes and reflected `data-*` prop/state selectors. Theme discovery and build output no longer expose deprecated targets, and `ThemePropsOptions` plus `ComponentThemingTarget.deprecatedFor` are removed. The `theme targets --json` response drops the `ThemeTargetEntry.deprecatedFor` field, because no target it lists is deprecated. (#7302)
|
|
84
|
+
Migration: run the required codemod `migrate-deprecated-theme-surface` with `astryx upgrade --from <your 0.6 version> --apply --path .` after upgrading.
|
|
85
|
+
|
|
86
|
+
The codemod renames removed target keys inside theme `components` maps (an imported `defineTheme()` call, an object typed as an Astryx theme, or a theme object with a static `name`), renames target classes in CSS, and replaces target-qualified bare prop/value/state classes with reflected `data-*` selectors, using every bare class the final 0.6 release emitted. It leaves dynamic/computed theme keys, unqualified or unknown classes, and CSS embedded in JavaScript/TypeScript strings for manual review. It adds `TODO(astryx upgrade)` when old and canonical keys coexist, and when a bare class Astryx once emitted has no known meaning on the target it qualifies.
|
|
87
|
+
|
|
88
|
+
The four per-component clear-icon aliases all become the shared `input-clear-icon`, which styles every input's clear icon. In CSS the codemod keeps each rule on its component with `:where(.astryx-<component> *)`, which adds no specificity. Theme keys cannot carry that scope, so the codemod adds a TODO naming the CSS selector to use.
|
|
89
|
+
|
|
90
|
+
Code that passed `{legacyNames}` to `themeProps()` or set `deprecatedFor` in a component doc should delete that argument or field; the canonical target is unchanged.
|
|
91
|
+
|
|
92
|
+
Rename theme keys and CSS target classes with this complete mapping:
|
|
93
|
+
|
|
94
|
+
- `base-table` → `table`
|
|
95
|
+
- `checkbox` → `checkbox-indicator`
|
|
96
|
+
- `codeblock` → `code-block`
|
|
97
|
+
- `codeblock-copy-button` → `code-block-copy-button`
|
|
98
|
+
- `codeblock-header` → `code-block-header`
|
|
99
|
+
- `codeblock-title` → `code-block-title`
|
|
100
|
+
- `date-input-clear-icon` → `input-clear-icon`
|
|
101
|
+
- `date-range-input-clear-icon` → `input-clear-icon`
|
|
102
|
+
- `hovercard` → `hover-card`
|
|
103
|
+
- `multi-selector-clear-icon` → `input-clear-icon`
|
|
104
|
+
- `navicon` → `nav-icon`
|
|
105
|
+
- `popover-surface` → `popover`
|
|
106
|
+
- `progressbar` → `progress-bar`
|
|
107
|
+
- `progressbar-fill` → `progress-bar-fill`
|
|
108
|
+
- `progressbar-mark` → `progress-bar-mark`
|
|
109
|
+
- `progressbar-track` → `progress-bar-track`
|
|
110
|
+
- `radio` → `radio-indicator`
|
|
111
|
+
- `radio-dot` → `radio-indicator-dot`
|
|
112
|
+
- `selector-clear-icon` → `input-clear-icon`
|
|
113
|
+
- `statusdot` → `status-dot`
|
|
114
|
+
- `textarea` → `text-area`
|
|
115
|
+
|
|
116
|
+
For custom CSS, replace removed bare selectors with the corresponding reflected attribute on a canonical target—for example, `.astryx-button.primary.sm` becomes `.astryx-button[data-variant="primary"][data-size="sm"]`, and `.astryx-switch.checked` becomes `.astryx-switch[data-checked="checked"]`. Review unqualified classes such as `.primary` manually because they may be application-owned.
|
|
117
|
+
|
|
118
|
+
- Remove the `astryx layout` command group. (#7137)
|
|
119
|
+
Removes the deprecated `astryx layout` command group (`expand`, `check`, `grammar`), its three response types (`layout.expand`, `layout.check`, `layout.grammar`), and the programmatic API exports (`layoutExpand`, `layoutCheck`, `layoutGrammar`).
|
|
120
|
+
|
|
121
|
+
Use `astryx build` to choose the template to start from, `astryx template` to scaffold it, and `astryx docs layout` for layout guidance. The layout guide is unaffected. The error codes `ERR_LAYOUT_PARSE` and `ERR_LAYOUT_INVALID` are retained.
|
|
122
|
+
|
|
123
|
+
Removed JSON ids: `LayoutBlockReference.mode` `LayoutBlockReference.name` `LayoutCheckOptions.cwd` `LayoutCheckOptions.form` `LayoutCheckOptions.loose` `LayoutCheckResponse.data` `LayoutCheckResponse.data.compact` `LayoutCheckResponse.data.errors` `LayoutCheckResponse.data.form` `LayoutCheckResponse.data.outline` `LayoutCheckResponse.data.valid` `LayoutCheckResponse.data.warnings` `LayoutCheckResponse.type` `LayoutExpandOptions.cwd` `LayoutExpandOptions.form` `LayoutExpandOptions.loose` `LayoutExpandOptions.name` `LayoutExpandOptions.targetPath` `LayoutExpandResponse.data` `LayoutExpandResponse.data.blocksReferenced` `LayoutExpandResponse.data.code` `LayoutExpandResponse.data.componentsUsed` `LayoutExpandResponse.data.demoMediaReplaced` `LayoutExpandResponse.data.form` `LayoutExpandResponse.data.states` `LayoutExpandResponse.data.todos` `LayoutExpandResponse.data.warnings` `LayoutExpandResponse.data.written` `LayoutExpandResponse.type` `LayoutGrammarOptions.cwd` `LayoutGrammarResponse.data` `LayoutGrammarResponse.data.aliases` `LayoutGrammarResponse.data.text` `LayoutGrammarResponse.type` `LayoutIssue.col` `LayoutIssue.formatted` `LayoutIssue.line` `LayoutIssue.message` `LayoutIssue.suggestions`
|
|
124
|
+
|
|
125
|
+
- Spacing tokens are rem (`--spacing-2: 0.5rem`), so gaps and padding follow the reader's root font size the way the type scale does. Every token value is unchanged at the default 16px root. (#7359)
|
|
126
|
+
One change shows at the default root: the `useTableRowExpansion` chevron now sits centered in its fixed 40px column instead of running past its edge (its button moves from 24–48px to 8–32px of the column). Under a theme with a larger spacing scale, such as matcha, the chevron is visible again and the detail panel lines up with the first column instead of starting 20px past it.
|
|
127
|
+
|
|
128
|
+
Old usage: The `--spacing-*` defaults were fixed px (`--spacing-2: 8px`), so `useTheme().token()`, `resolveThemeToken()`, `tokenDefaults` and `spacingDefaults` returned px strings, and spacing stayed the same size when a reader raised the browser font size.
|
|
129
|
+
|
|
130
|
+
Replacement: The defaults are rem with the same value at a 16px root (`--spacing-2: 0.5rem`, `--spacing-4: 1rem`), and those readers return the rem string.
|
|
131
|
+
|
|
132
|
+
Migration: CSS that reads `var(--spacing-*)` needs no change. Code that parses a spacing token as a px number converts the rem value with the root font size, or reads the element's computed length. A theme that wants fixed px spacing sets the tokens back, for example `defineTheme({tokens: {'--spacing-2': '8px'}})`.
|
|
133
|
+
|
|
134
|
+
Codemod: None. A token read and parsed at runtime cannot be found and rewritten statically, and CSS uses need no rewrite.
|
|
135
|
+
|
|
136
|
+
- `theme build` exits 1 when it reports private `--_*` variables. (#6872)
|
|
137
|
+
The old contract reported private-variable errors but exited 0. The corrected contract keeps the same warnings, receipts, generated files, and `--check` output, but exits 1.
|
|
138
|
+
|
|
139
|
+
To migrate, a CI step that relied on exit 0 must fix the theme's private `--_*` inputs.
|
|
140
|
+
|
|
141
|
+
#### New Features
|
|
142
|
+
|
|
143
|
+
- `astryx upgrade` adds `padding={0}` to BottomSheet elements that do not set `padding`, keeping their unpadded content box now that BottomSheet pads like Dialog. Sheets whose only child is a Section or a Layout are left unchanged. A sheet with a Layout anywhere in its content also gets a TODO comment, because `padding={0}` removes the inset between that Layout's regions and the Layout's own `padding` restores only its outer edges. A shadowed `BottomSheet` binding is left alone, and a second run changes nothing. (#6884)
|
|
144
|
+
- `astryx upgrade` runs `migrate-field-input-styling`, which renames root `xstyle`/`className`/`style` on Field-composed inputs to the part they styled before: `controlXstyle`/`controlClassName`/`controlStyle` on TextInput, TextArea, NumberInput, FileInput, DateInput, DateRangeInput, DateTimeInput, TimeInput, Selector, MultiSelector, and ComplexSelector, and `containerXstyle`/`containerClassName`/`containerStyle` on Typeahead, Tokenizer, CheckboxList, RadioList, and Slider. It rewrites JSX written directly on an Astryx import (named, aliased, or namespace). Spreads and wrappers that forward their own styling props are left for manual migration, and a callsite that already sets the target prop gets a TODO instead of a rename. (#7342)
|
|
145
|
+
- `astryx upgrade` renames `emptySearchResultsText` to `emptySearchText` on `Tokenizer`, `Typeahead`, `BaseTypeahead`, and `ChatComposerInput` trigger objects, for the release that removes the old name. (#7289)
|
|
146
|
+
|
|
147
|
+
#### Fixes
|
|
148
|
+
|
|
149
|
+
- `template` and `build` follow the project's package manager. The nearest directory from the target up to the workspace root that has a `packageManager` field or a lockfile decides. With neither, the command uses npm, whatever package manager launched the CLI. When that directory's lockfiles disagree and nothing it commits picks one, `installCommand` is `null` and the note names the missing packages, the directory, and the lockfiles that disagree, instead of guessing a command that would write a second lockfile. (#7343)
|
|
150
|
+
- Teach generated palette references in the full custom-theme authoring guide. (#7268)
|
|
151
|
+
- Generate Neutral's runtime palette references from the stops its theme uses, and fail verification when the package or CLI template copy drifts. (#7255)
|
|
152
|
+
|
|
153
|
+
#### Documentation
|
|
154
|
+
|
|
155
|
+
- Clarify release-branch codemod promotion and version ownership. (#7293)
|
|
156
|
+
|
|
157
|
+
#### Contributors
|
|
158
|
+
|
|
159
|
+
Thanks to everyone who contributed to this release:
|
|
160
|
+
|
|
161
|
+
- @cixzhang
|
|
162
|
+
- @harjothkhara
|
|
163
|
+
- @imdreamrunner
|
|
164
|
+
- @josephfarina
|
|
165
|
+
- @rubyycheung
|
|
166
|
+
- @vjeux
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
3
170
|
# 0.6.8
|
|
4
171
|
|
|
5
172
|
#### Fixes
|
package/api/doctor/doctor.d.mts
CHANGED
|
@@ -49,6 +49,25 @@ export function checkConfig(ctx: DoctorContext): Promise<DoctorCheck>;
|
|
|
49
49
|
* @returns {DoctorCheck}
|
|
50
50
|
*/
|
|
51
51
|
export function checkImplicitIntegrations(ctx: DoctorContext): DoctorCheck;
|
|
52
|
+
/**
|
|
53
|
+
* Every integration named in astryx.config loads.
|
|
54
|
+
*
|
|
55
|
+
* A configured integration that cannot be loaded (not installed, no
|
|
56
|
+
* manifest, or a manifest that throws or fails its schema) is withdrawn
|
|
57
|
+
* whole, because none of its contribution roots is trustworthy
|
|
58
|
+
* (spec:AST-035 FR9). The project then runs without something it asked
|
|
59
|
+
* for, so this fails the CI gate.
|
|
60
|
+
*
|
|
61
|
+
* Two neighbours stay as they were. A problem inside one contribution kind
|
|
62
|
+
* leaves the rest of the integration working, so `integration-issues` keeps
|
|
63
|
+
* warning about it (spec:AST-035 FR9). An autolinked dependency that cannot
|
|
64
|
+
* be loaded stays informational in `implicit-integrations`: the project did
|
|
65
|
+
* not ask for it.
|
|
66
|
+
*
|
|
67
|
+
* @param {DoctorContext} ctx
|
|
68
|
+
* @returns {DoctorCheck}
|
|
69
|
+
*/
|
|
70
|
+
export function checkConfiguredIntegrations(ctx: DoctorContext): DoctorCheck;
|
|
52
71
|
/**
|
|
53
72
|
* Check 7 — agent docs exist and contain the Astryx section markers.
|
|
54
73
|
* @param {DoctorContext} ctx
|
|
@@ -253,13 +272,22 @@ export type DoctorContext = {
|
|
|
253
272
|
severity: "warning" | "error";
|
|
254
273
|
message: string;
|
|
255
274
|
}[] | null | undefined;
|
|
275
|
+
autolinkFailures?: {
|
|
276
|
+
spec: string;
|
|
277
|
+
error: string;
|
|
278
|
+
}[] | null | undefined;
|
|
256
279
|
/**
|
|
280
|
+
* Every name astryx.config lists, from the provider ledger: the package it
|
|
281
|
+
* reached (or failed to reach) and why loading failed, if it did. Set aside
|
|
282
|
+
* for a provider conflict, replaced by the package being authored, or
|
|
283
|
+
* repeated under another name all still count as configured.
|
|
257
284
|
* installed dependencies whose integration manifest could not be loaded
|
|
258
285
|
* Combined project-level integration issues, including cross-package template replacement warnings.
|
|
259
286
|
*/
|
|
260
|
-
|
|
287
|
+
configuredIntegrations?: {
|
|
261
288
|
spec: string;
|
|
262
|
-
|
|
289
|
+
label: string;
|
|
290
|
+
error: string | null;
|
|
263
291
|
}[] | null | undefined;
|
|
264
292
|
/**
|
|
265
293
|
* - Error thrown while resolving the config
|
|
@@ -18,7 +18,8 @@ export const doc = {
|
|
|
18
18
|
description:
|
|
19
19
|
'Runs a series of diagnostics: Node version, ' +
|
|
20
20
|
'@astryxdesign/core install and version alignment with the CLI, installed ' +
|
|
21
|
-
'themes and wiring, astryx.config validity,
|
|
21
|
+
'themes and wiring, astryx.config validity, whether every integration ' +
|
|
22
|
+
'astryx.config names loads (a failed one fails the run), integrations linked from ' +
|
|
22
23
|
'package.json without a config entry, core peer dependencies, ' +
|
|
23
24
|
'integration provider identity and contribution issues, agent docs, the ' +
|
|
24
25
|
'detected package manager, and the health of the docs the CLI reads (authoring ' +
|
package/api/doctor/doctor.mjs
CHANGED
|
@@ -82,6 +82,11 @@ import {checkAppThemes, checkThemes} from './theme-checks.mjs';
|
|
|
82
82
|
* could not be built, when it could not.
|
|
83
83
|
* @property {Array<{package: string, code: string, severity: 'warning'|'error', message: string}>|null} [integrationIssues]
|
|
84
84
|
* @property {Array<{spec: string, error: string}>|null} [autolinkFailures]
|
|
85
|
+
* @property {Array<{spec: string, label: string, error: string|null}>|null} [configuredIntegrations]
|
|
86
|
+
* Every name astryx.config lists, from the provider ledger: the package it
|
|
87
|
+
* reached (or failed to reach) and why loading failed, if it did. Set aside
|
|
88
|
+
* for a provider conflict, replaced by the package being authored, or
|
|
89
|
+
* repeated under another name all still count as configured.
|
|
85
90
|
* installed dependencies whose integration manifest could not be loaded
|
|
86
91
|
* Combined project-level integration issues, including cross-package template replacement warnings.
|
|
87
92
|
* @property {Error|null} [configError] - Error thrown while resolving the config
|
|
@@ -319,12 +324,12 @@ export async function checkConfig(ctx) {
|
|
|
319
324
|
}
|
|
320
325
|
// Importing is not the whole test: the CLI also validates the config, and
|
|
321
326
|
// a config it rejects leaves every project-aware command without the
|
|
322
|
-
// project.
|
|
327
|
+
// project. Doctor is the CI gate, so that fails.
|
|
323
328
|
if (ctx.projectError) {
|
|
324
329
|
return {
|
|
325
330
|
id: 'config',
|
|
326
331
|
label: 'astryx.config.mjs',
|
|
327
|
-
status: '
|
|
332
|
+
status: 'fail',
|
|
328
333
|
message: `astryx.config.mjs loads, but the CLI could not load the project from it: ${firstLine(ctx.projectError)}`,
|
|
329
334
|
fix: 'Fix what the message names. `astryx docs authoring config` lists every field astryx.config accepts.',
|
|
330
335
|
};
|
|
@@ -475,6 +480,88 @@ function describeUnreadableManifests(failures) {
|
|
|
475
480
|
);
|
|
476
481
|
}
|
|
477
482
|
|
|
483
|
+
/**
|
|
484
|
+
* Every integration named in astryx.config loads.
|
|
485
|
+
*
|
|
486
|
+
* A configured integration that cannot be loaded (not installed, no
|
|
487
|
+
* manifest, or a manifest that throws or fails its schema) is withdrawn
|
|
488
|
+
* whole, because none of its contribution roots is trustworthy
|
|
489
|
+
* (spec:AST-035 FR9). The project then runs without something it asked
|
|
490
|
+
* for, so this fails the CI gate.
|
|
491
|
+
*
|
|
492
|
+
* Two neighbours stay as they were. A problem inside one contribution kind
|
|
493
|
+
* leaves the rest of the integration working, so `integration-issues` keeps
|
|
494
|
+
* warning about it (spec:AST-035 FR9). An autolinked dependency that cannot
|
|
495
|
+
* be loaded stays informational in `implicit-integrations`: the project did
|
|
496
|
+
* not ask for it.
|
|
497
|
+
*
|
|
498
|
+
* @param {DoctorContext} ctx
|
|
499
|
+
* @returns {DoctorCheck}
|
|
500
|
+
*/
|
|
501
|
+
export function checkConfiguredIntegrations(ctx) {
|
|
502
|
+
const id = 'configured-integrations';
|
|
503
|
+
const label = 'Configured integrations';
|
|
504
|
+
if (ctx.integrations == null) {
|
|
505
|
+
// The config check reports a config the CLI cannot load.
|
|
506
|
+
return {
|
|
507
|
+
id,
|
|
508
|
+
label,
|
|
509
|
+
status: 'info',
|
|
510
|
+
message: skippedBecause(ctx, 'the project configuration could not be read'),
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
// What counts as configured is what astryx.config names, read from the
|
|
514
|
+
// provider ledger so a package set aside for a provider conflict, or the
|
|
515
|
+
// package being authored when its own config names it, still counts.
|
|
516
|
+
const configured =
|
|
517
|
+
ctx.configuredIntegrations ??
|
|
518
|
+
ctx.integrations
|
|
519
|
+
.filter(integration => !integration.__autolinked && !integration.__local)
|
|
520
|
+
.map(integration => ({
|
|
521
|
+
spec: integration.__spec,
|
|
522
|
+
label: integration.name ?? integration.__spec,
|
|
523
|
+
error:
|
|
524
|
+
integration.__loadError == null
|
|
525
|
+
? null
|
|
526
|
+
: String(integration.__loadError),
|
|
527
|
+
}));
|
|
528
|
+
if (configured.length === 0) {
|
|
529
|
+
return {
|
|
530
|
+
id,
|
|
531
|
+
label,
|
|
532
|
+
status: 'info',
|
|
533
|
+
message: 'No integration is named in astryx.config.',
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
const plural = configured.length === 1 ? '' : 's';
|
|
537
|
+
const withdrawn = configured.filter(entry => entry.error != null);
|
|
538
|
+
if (withdrawn.length > 0) {
|
|
539
|
+
const listed = withdrawn
|
|
540
|
+
.map(
|
|
541
|
+
entry =>
|
|
542
|
+
`${entry.label} (${firstLine(String(entry.error)).slice(0, 160)})`,
|
|
543
|
+
)
|
|
544
|
+
.join('; ');
|
|
545
|
+
return {
|
|
546
|
+
id,
|
|
547
|
+
label,
|
|
548
|
+
status: 'fail',
|
|
549
|
+
message:
|
|
550
|
+
`${withdrawn.length} of ${configured.length} integration${plural} named in astryx.config could not be loaded, ` +
|
|
551
|
+
`so ${withdrawn.length === 1 ? 'it contributes' : 'they contribute'} nothing: ${listed}.`,
|
|
552
|
+
fix:
|
|
553
|
+
'Install each one, fix its astryx.integration.* manifest (`astryx doctor integration validate <package>` says what is wrong), ' +
|
|
554
|
+
'or remove it from `integrations` in astryx.config.',
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
return {
|
|
558
|
+
id,
|
|
559
|
+
label,
|
|
560
|
+
status: 'pass',
|
|
561
|
+
message: `${configured.length} integration${plural} named in astryx.config loaded: ${configured.map(entry => entry.label).join(', ')}.`,
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
|
|
478
565
|
/**
|
|
479
566
|
* Check 7 — agent docs exist and contain the Astryx section markers.
|
|
480
567
|
* @param {DoctorContext} ctx
|
|
@@ -1201,6 +1288,7 @@ export const SYNC_CHECKS = [
|
|
|
1201
1288
|
checkCoreInstalled,
|
|
1202
1289
|
checkVersionAlignment,
|
|
1203
1290
|
checkImplicitIntegrations,
|
|
1291
|
+
checkConfiguredIntegrations,
|
|
1204
1292
|
checkProviderIdentity,
|
|
1205
1293
|
checkIntegrationIssues,
|
|
1206
1294
|
checkAgentDocs,
|
|
@@ -1244,6 +1332,8 @@ export async function runChecks(options = {}) {
|
|
|
1244
1332
|
let integrationIssues = null;
|
|
1245
1333
|
/** @type {Array<{spec: string, error: string}>|null} */
|
|
1246
1334
|
let autolinkFailures = null;
|
|
1335
|
+
/** @type {Array<{spec: string, label: string, error: string|null}>|null} */
|
|
1336
|
+
let configuredIntegrations = null;
|
|
1247
1337
|
/** @type {string|null} */
|
|
1248
1338
|
let projectError = null;
|
|
1249
1339
|
/** @type {import('../../foundation/config/project.mjs').Project | null} */
|
|
@@ -1261,7 +1351,66 @@ export async function runChecks(options = {}) {
|
|
|
1261
1351
|
integrations = project.loadedIntegrations;
|
|
1262
1352
|
// An installed dependency whose manifest cannot be loaded is kept out of
|
|
1263
1353
|
// loadedIntegrations on purpose. The provider ledger still records it.
|
|
1264
|
-
|
|
1354
|
+
const ledgerMap = providerLedgerOf(project);
|
|
1355
|
+
const ledger = [...ledgerMap.values()];
|
|
1356
|
+
// The package that stands for a configured name: when the package
|
|
1357
|
+
// being authored replaces the configured copy, the authored package's
|
|
1358
|
+
// outcome is the one that matters, so a broken authored manifest fails
|
|
1359
|
+
// the check even though the configured copy itself loaded. A package
|
|
1360
|
+
// set aside for a provider conflict keeps its own outcome.
|
|
1361
|
+
/** @param {import('../../foundation/integrations/provider-resolution.mjs').ProviderLedgerEntry} entry */
|
|
1362
|
+
const standsFor = entry => {
|
|
1363
|
+
let current = entry;
|
|
1364
|
+
const seen = new Set();
|
|
1365
|
+
while (
|
|
1366
|
+
current.outcome === 'set-aside' &&
|
|
1367
|
+
current.reason === 'replaced-by-authored' &&
|
|
1368
|
+
current.winner != null &&
|
|
1369
|
+
!seen.has(current.winner) &&
|
|
1370
|
+
ledgerMap.has(current.winner)
|
|
1371
|
+
) {
|
|
1372
|
+
seen.add(current.winner);
|
|
1373
|
+
current = /** @type {typeof entry} */ (ledgerMap.get(current.winner));
|
|
1374
|
+
}
|
|
1375
|
+
return current;
|
|
1376
|
+
};
|
|
1377
|
+
// Every package a configured name reached, however it was resolved.
|
|
1378
|
+
configuredIntegrations = ledger
|
|
1379
|
+
.filter(entry =>
|
|
1380
|
+
entry.refs.some(
|
|
1381
|
+
ref => ref.source === 'configured' && ref.repeat !== true,
|
|
1382
|
+
),
|
|
1383
|
+
)
|
|
1384
|
+
.map(entry => {
|
|
1385
|
+
const ref = entry.refs.find(
|
|
1386
|
+
candidate => candidate.source === 'configured',
|
|
1387
|
+
);
|
|
1388
|
+
const effective = standsFor(entry);
|
|
1389
|
+
// When node_modules/<name> links back to the package being authored,
|
|
1390
|
+
// the configured and local candidates share one real path and one
|
|
1391
|
+
// entry whose outcome is the set-aside; the authored (`local`)
|
|
1392
|
+
// candidate on that entry carries the load error, so it is the
|
|
1393
|
+
// outcome that counts. Reading it from the ref, not by comparing
|
|
1394
|
+
// paths, holds whether or not the working directory is itself a
|
|
1395
|
+
// symlink.
|
|
1396
|
+
const authored = effective.refs.find(
|
|
1397
|
+
candidate => candidate.source === 'local',
|
|
1398
|
+
);
|
|
1399
|
+
const authoredError =
|
|
1400
|
+
authored?.integration?.__loadError ?? authored?.error ?? null;
|
|
1401
|
+
const loadError =
|
|
1402
|
+
effective.outcome === 'load-failed'
|
|
1403
|
+
? (effective.error ?? 'its manifest could not be loaded')
|
|
1404
|
+
: authoredError != null
|
|
1405
|
+
? String(authoredError)
|
|
1406
|
+
: null;
|
|
1407
|
+
return {
|
|
1408
|
+
spec: ref?.spec ?? entry.label,
|
|
1409
|
+
label: entry.integration?.name ?? ref?.spec ?? entry.label,
|
|
1410
|
+
error: loadError,
|
|
1411
|
+
};
|
|
1412
|
+
});
|
|
1413
|
+
autolinkFailures = ledger
|
|
1265
1414
|
.filter(
|
|
1266
1415
|
entry =>
|
|
1267
1416
|
entry.outcome === 'load-failed' &&
|
|
@@ -1300,6 +1449,7 @@ export async function runChecks(options = {}) {
|
|
|
1300
1449
|
docsCatalogError,
|
|
1301
1450
|
integrationIssues,
|
|
1302
1451
|
autolinkFailures,
|
|
1452
|
+
configuredIntegrations,
|
|
1303
1453
|
configError,
|
|
1304
1454
|
projectError,
|
|
1305
1455
|
};
|