@astryxdesign/cli 0.7.0-canary.2e0dbb5 → 0.7.0-canary.3045eda

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 (43) hide show
  1. package/api/doctor/doctor.d.mts +30 -2
  2. package/api/doctor/doctor.doc.mjs +2 -1
  3. package/api/doctor/doctor.mjs +153 -3
  4. package/api/doctor/doctor.test.mjs +250 -4
  5. package/assets/codemods/transforms/next/__tests__/migrate-field-input-styling.test.mjs +108 -0
  6. package/assets/codemods/transforms/next/__tests__/preserve-bottom-sheet-content-padding.test.mjs +178 -0
  7. package/assets/codemods/transforms/next/__tests__/rename-empty-search-results-text.test.mjs +202 -0
  8. package/assets/codemods/transforms/next/index.mjs +24 -0
  9. package/assets/codemods/transforms/next/migrate-field-input-styling.mjs +198 -0
  10. package/assets/codemods/transforms/next/preserve-bottom-sheet-content-padding.mjs +242 -0
  11. package/assets/codemods/transforms/next/rename-empty-search-results-text.mjs +254 -0
  12. package/assets/docs/spacing.doc.mjs +2 -2
  13. package/assets/docs/tree/tokens-spacing.doc.mjs +15 -15
  14. package/assets/templates/blocks/components/BottomSheet/BottomSheetHeights.tsx +1 -1
  15. package/assets/templates/blocks/components/BottomSheet/BottomSheetMobileKeyboard.tsx +1 -1
  16. package/assets/templates/blocks/components/BottomSheet/BottomSheetNoScrim.tsx +1 -1
  17. package/assets/templates/blocks/components/BottomSheet/BottomSheetSnapPoints.tsx +1 -1
  18. package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorDeadlinePicker.tsx +1 -1
  19. package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorShowcase.tsx +1 -1
  20. package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorTreeSearch.tsx +1 -1
  21. package/assets/templates/blocks/components/Dialog/DialogAdaptivePresentation.tsx +1 -1
  22. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +1 -1
  23. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.tsx +1 -1
  24. package/assets/templates/blocks/components/Selector/SelectorClearable.tsx +1 -1
  25. package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +2 -2
  26. package/assets/templates/blocks/components/Selector/SelectorShowcase.tsx +1 -1
  27. package/assets/templates/blocks/components/Selector/SelectorWithSections.tsx +1 -1
  28. package/assets/templates/blocks/components/SelectorOption/SelectorOptionBasic.tsx +1 -1
  29. package/assets/templates/blocks/components/SelectorOption/SelectorOptionShowcase.tsx +1 -1
  30. package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +1 -1
  31. package/assets/templates/pages/canvas-editor/page.tsx +1 -1
  32. package/assets/templates/pages/table-filter/page.tsx +11 -6
  33. package/assets/templates/pages/table-inbox/page.tsx +3 -1
  34. package/assets/templates/themes/butter/butterTheme.ts +12 -0
  35. package/assets/templates/themes/chocolate/chocolateTheme.ts +12 -0
  36. package/assets/templates/themes/matcha/matchaTheme.ts +14 -14
  37. package/assets/templates/themes/neutral/neutralTheme.ts +12 -0
  38. package/assets/templates/themes/stone/stoneTheme.ts +12 -0
  39. package/assets/templates/themes/y2k/y2kTheme.ts +10 -10
  40. package/assets/theme.template.ts +1 -1
  41. package/clients/cli/commands/doctor.doc.mjs +1 -1
  42. package/clients/cli/commands/doctor.test.mjs +33 -0
  43. package/package.json +9 -9
@@ -17,7 +17,7 @@ export default function InternationalizationProviderOverrides() {
17
17
  },
18
18
  }}>
19
19
  <Selector
20
- style={{width: 300}}
20
+ controlStyle={{width: 300}}
21
21
  label="Billing region"
22
22
  options={[
23
23
  {value: 'americas', label: 'Americas'},
@@ -9,7 +9,7 @@ export default function SelectorClearable() {
9
9
  const [value, setValue] = useState<string | null>('engineering');
10
10
  return (
11
11
  <Selector
12
- style={{width: 300}}
12
+ controlStyle={{width: 300}}
13
13
  label="Department"
14
14
  options={[
15
15
  {value: 'engineering', label: 'Engineering'},
@@ -32,7 +32,7 @@ export default function SelectorOptionDescriptions() {
32
32
  return (
33
33
  <Stack direction="vertical" gap={6}>
34
34
  <Selector
35
- style={{width: 320}}
35
+ controlStyle={{width: 320}}
36
36
  label="Visibility"
37
37
  description="Default trigger: one line at the size token."
38
38
  options={VISIBILITY}
@@ -40,7 +40,7 @@ export default function SelectorOptionDescriptions() {
40
40
  onChange={setCondensed}
41
41
  />
42
42
  <Selector
43
- style={{width: 320}}
43
+ controlStyle={{width: 320}}
44
44
  label="Visibility"
45
45
  description="A stacked SelectorOption: the description gets its own line, and the trigger grows by exactly one line."
46
46
  options={VISIBILITY}
@@ -9,7 +9,7 @@ export default function SelectorShowcase() {
9
9
  const [value, setValue] = useState<string | undefined>();
10
10
  return (
11
11
  <Selector
12
- style={{width: 300}}
12
+ controlStyle={{width: 300}}
13
13
  label="Fruit"
14
14
  options={['Apple', 'Banana', 'Orange', 'Mango', 'Pineapple']}
15
15
  placeholder="Select a fruit..."
@@ -9,7 +9,7 @@ export default function SelectorWithSections() {
9
9
  const [value, setValue] = useState<string | undefined>();
10
10
  return (
11
11
  <Selector
12
- style={{width: 300}}
12
+ controlStyle={{width: 300}}
13
13
  label="Office"
14
14
  options={[
15
15
  {
@@ -22,7 +22,7 @@ export default function SelectorOptionBasic() {
22
22
 
23
23
  return (
24
24
  <Selector
25
- style={{width: 300}}
25
+ controlStyle={{width: 300}}
26
26
  label="Role"
27
27
  options={roles}
28
28
  value={value}
@@ -25,7 +25,7 @@ export default function SelectorOptionShowcase() {
25
25
 
26
26
  return (
27
27
  <Selector
28
- style={{width: 300}}
28
+ controlStyle={{width: 300}}
29
29
  label="Role"
30
30
  options={roles}
31
31
  value={value}
@@ -231,7 +231,7 @@ export default function ToolbarTableFilter() {
231
231
  hasClear
232
232
  options={field.options}
233
233
  value={clauses[field.key] ?? null}
234
- xstyle={clauses[field.key] != null ? styles.filterFill : undefined}
234
+ controlXstyle={clauses[field.key] != null ? styles.filterFill : undefined}
235
235
  onChange={value => setClauses(prev => ({...prev, [field.key]: value}))}
236
236
  renderValue={option =>
237
237
  `${field.label} is ${option.label ?? option.value}`
@@ -2329,7 +2329,7 @@ export default function CanvasEditor() {
2329
2329
  // enough for the longest option
2330
2330
  // ("100%") to avoid truncation.
2331
2331
  width={92}
2332
- xstyle={[
2332
+ controlXstyle={[
2333
2333
  styles.toolBarControl,
2334
2334
  styles.toolBarTrailing,
2335
2335
  ]}
@@ -2084,7 +2084,8 @@ function FilterOverflow({
2084
2084
  isOpen={isOpen}
2085
2085
  onOpenChange={setIsOpen}
2086
2086
  label={label}
2087
- height="hug">
2087
+ height="hug"
2088
+ padding={0}>
2088
2089
  {body}
2089
2090
  </BottomSheet>
2090
2091
  </>
@@ -3249,7 +3250,7 @@ export default function TableFilterTemplate() {
3249
3250
  renderValue={option =>
3250
3251
  `${field.label} ${field.operatorLabel} ${option.label ?? option.value}`
3251
3252
  }
3252
- xstyle={active ? styles.filterFill : undefined}
3253
+ controlXstyle={active ? styles.filterFill : undefined}
3253
3254
  onChange={next =>
3254
3255
  setFieldFilter(
3255
3256
  field.key,
@@ -3318,7 +3319,7 @@ export default function TableFilterTemplate() {
3318
3319
  }
3319
3320
  options={[...field.options]}
3320
3321
  value={multiValues[field.key]}
3321
- xstyle={
3322
+ controlXstyle={
3322
3323
  multiValues[field.key].length > 0 ? styles.filterFill : undefined
3323
3324
  }
3324
3325
  onChange={next => setMultiValues(field.key, next)}
@@ -3341,7 +3342,7 @@ export default function TableFilterTemplate() {
3341
3342
  value={quoteDraft}
3342
3343
  onChange={commitQuote}
3343
3344
  contentXstyle={styles.quotePopover}
3344
- xstyle={hasQuoteFilter ? styles.filterFill : undefined}>
3345
+ controlXstyle={hasQuoteFilter ? styles.filterFill : undefined}>
3345
3346
  {(range, onChange, close) => (
3346
3347
  <VStack gap={4}>
3347
3348
  <VStack gap={0}>
@@ -4087,7 +4088,10 @@ export default function TableFilterTemplate() {
4087
4088
  isOpen={isCompactSurface && isViewOpen}
4088
4089
  onOpenChange={setIsViewOpen}
4089
4090
  label="View options"
4090
- height="tall">
4091
+ height="tall"
4092
+ // The tab strip compensates against a container inset, so the sheet
4093
+ // publishes none and the wrapper below owns the top band.
4094
+ padding={0}>
4091
4095
  {/* The inset is the wrapper's, so the strip's own box starts at the tab
4092
4096
  row and its scroll arrow lands on the tabs rather than above them. */}
4093
4097
  <VStack gap={0} paddingBlockStart={SHEET_TOP_INSET}>
@@ -4313,7 +4317,8 @@ export default function TableFilterTemplate() {
4313
4317
  isOpen={isCompactSurface && activeJob != null}
4314
4318
  onOpenChange={open => !open && setActiveJobId(null)}
4315
4319
  label="Job details"
4316
- height="tall">
4320
+ height="tall"
4321
+ padding={0}>
4317
4322
  {detailBody}
4318
4323
  </BottomSheet>
4319
4324
  );
@@ -1773,7 +1773,9 @@ function ComposeWindow({
1773
1773
  // cheaper answer to the same problem: there is not much to drag out of
1774
1774
  // the way in the first place.
1775
1775
  height="hug"
1776
- hasScrim={false}>
1776
+ hasScrim={false}
1777
+ // The Layout below owns the inset; the sheet adds none of its own.
1778
+ padding={0}>
1777
1779
  {/* The grab handle floats over the top edge, out of flow, about 12px
1778
1780
  down. The Layout's own padding is not quite enough to clear it — the
1779
1781
  heading came up level with the pill, four pixels under it — so the
@@ -65,6 +65,18 @@ export const butterTheme = defineTheme({
65
65
  },
66
66
  },
67
67
 
68
+ // Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
69
+ // re-derive the ratio so Display 1 keeps its desktop size:
70
+ // ratio' = 1.25 * (14/16)^(1/6) ~= 1.2225. Body 14 -> 16px, display-1 stays 53px.
71
+ adaptations: {
72
+ rules: [
73
+ {
74
+ when: {pointer: 'coarse', width: {below: 'lg'}},
75
+ value: {typography: {scale: {base: 16, ratio: 1.2225}}},
76
+ },
77
+ ],
78
+ },
79
+
68
80
  motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},
69
81
 
70
82
  syntax: butterSyntax,
@@ -55,6 +55,18 @@ export const chocolateTheme = defineTheme({
55
55
  },
56
56
  },
57
57
 
58
+ // Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
59
+ // re-derive the ratio so Display 1 keeps its desktop size:
60
+ // ratio' = 1.2 * (14/16)^(1/6) ~= 1.1736. Body 14 -> 16px, display-1 stays 42px.
61
+ adaptations: {
62
+ rules: [
63
+ {
64
+ when: {pointer: 'coarse', width: {below: 'lg'}},
65
+ value: {typography: {scale: {base: 16, ratio: 1.1736}}},
66
+ },
67
+ ],
68
+ },
69
+
58
70
  motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},
59
71
 
60
72
  syntax: chocolateSyntax,
@@ -180,20 +180,20 @@ export const matchaTheme = defineTheme({
180
180
  // =========================================================================
181
181
  // Spacing
182
182
  // =========================================================================
183
- '--spacing-0-5': '3px',
184
- '--spacing-1': '6px',
185
- '--spacing-1-5': '9px',
186
- '--spacing-2': '12px',
187
- '--spacing-3': '18px',
188
- '--spacing-4': '24px',
189
- '--spacing-5': '30px',
190
- '--spacing-6': '36px',
191
- '--spacing-7': '42px',
192
- '--spacing-8': '48px',
193
- '--spacing-9': '54px',
194
- '--spacing-10': '60px',
195
- '--spacing-11': '66px',
196
- '--spacing-12': '72px',
183
+ '--spacing-0-5': '0.1875rem',
184
+ '--spacing-1': '0.375rem',
185
+ '--spacing-1-5': '0.5625rem',
186
+ '--spacing-2': '0.75rem',
187
+ '--spacing-3': '1.125rem',
188
+ '--spacing-4': '1.5rem',
189
+ '--spacing-5': '1.875rem',
190
+ '--spacing-6': '2.25rem',
191
+ '--spacing-7': '2.625rem',
192
+ '--spacing-8': '3rem',
193
+ '--spacing-9': '3.375rem',
194
+ '--spacing-10': '3.75rem',
195
+ '--spacing-11': '4.125rem',
196
+ '--spacing-12': '4.5rem',
197
197
 
198
198
  // =========================================================================
199
199
  // Radius — soft and rounded
@@ -95,6 +95,18 @@ export const neutralTheme = defineTheme({
95
95
  },
96
96
  },
97
97
 
98
+ // Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
99
+ // re-derive the ratio so Display 1 keeps its desktop size:
100
+ // ratio' = 1.2 * (14/16)^(1/6) ~= 1.1736. Body 14 -> 16px, display-1 stays 42px.
101
+ adaptations: {
102
+ rules: [
103
+ {
104
+ when: {pointer: 'coarse', width: {below: 'lg'}},
105
+ value: {typography: {scale: {base: 16, ratio: 1.1736}}},
106
+ },
107
+ ],
108
+ },
109
+
98
110
  // Motion: snappier than default to match shadcn/Tailwind conventions.
99
111
  // Produces: fast-min=95ms, fast=125ms, fast-max=165ms,
100
112
  // medium-min=225ms, medium=300ms, medium-max=400ms.
@@ -81,6 +81,18 @@ export const stoneTheme = defineTheme({
81
81
  },
82
82
  },
83
83
 
84
+ // Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
85
+ // re-derive the ratio so Display 1 keeps its desktop size:
86
+ // ratio' = 1.25 * (14/16)^(1/6) ~= 1.2225. Body 14 -> 16px, display-1 stays 53px.
87
+ adaptations: {
88
+ rules: [
89
+ {
90
+ when: {pointer: 'coarse', width: {below: 'lg'}},
91
+ value: {typography: {scale: {base: 16, ratio: 1.2225}}},
92
+ },
93
+ ],
94
+ },
95
+
84
96
  motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},
85
97
 
86
98
  syntax: stoneSyntax,
@@ -63,16 +63,16 @@ export const y2kTheme = defineTheme({
63
63
  // =========================================================================
64
64
  // Spacing — comfortable preset (base=6)
65
65
  // =========================================================================
66
- '--spacing-0-5': '3px',
67
- '--spacing-1': '6px',
68
- '--spacing-1-5': '9px',
69
- '--spacing-2': '12px',
70
- '--spacing-3': '18px',
71
- '--spacing-4': '24px',
72
- '--spacing-5': '30px',
73
- '--spacing-6': '36px',
74
- '--spacing-7': '42px',
75
- '--spacing-8': '48px',
66
+ '--spacing-0-5': '0.1875rem',
67
+ '--spacing-1': '0.375rem',
68
+ '--spacing-1-5': '0.5625rem',
69
+ '--spacing-2': '0.75rem',
70
+ '--spacing-3': '1.125rem',
71
+ '--spacing-4': '1.5rem',
72
+ '--spacing-5': '1.875rem',
73
+ '--spacing-6': '2.25rem',
74
+ '--spacing-7': '2.625rem',
75
+ '--spacing-8': '3rem',
76
76
 
77
77
  // Size — comfortable preset
78
78
  '--size-element-sm': '32px',
@@ -373,7 +373,7 @@ export const myTheme = defineTheme({
373
373
  // {
374
374
  // // Narrow at every pointer precision.
375
375
  // when: {width: {below: 'md'}},
376
- // value: {tokens: {'--spacing-4': '12px'}},
376
+ // value: {tokens: {'--spacing-4': '0.75rem'}},
377
377
  // },
378
378
  // {
379
379
  // // Taller controls under a finger or stylus at every width.
@@ -16,7 +16,7 @@ export const doc = {
16
16
  summary: 'Diagnose Astryx projects and integration packages',
17
17
  description:
18
18
  'Runs read-only project health diagnostics by default: Node version, @astryxdesign/core ' +
19
- 'install and version alignment, theme packages, generated app themes when present, earlier copied-theme migration, config, integrations (linked without a config entry, ' +
19
+ 'install and version alignment, theme packages, generated app themes when present, earlier copied-theme migration, config, integrations (every one astryx.config names must load, linked without a config entry, ' +
20
20
  'provider identity, contribution issues), agent docs, core peer dependencies, package manager, ' +
21
21
  "and the docs the CLI reads. It writes nothing, but loading astryx.config runs that file's code. " +
22
22
  'The `integration` subcommands provide authoring checks for one integration package.',
@@ -403,3 +403,36 @@ describe('doctor — text output mirrors the JSON', () => {
403
403
  }
404
404
  }, 60_000);
405
405
  });
406
+
407
+ describe('doctor — a configured integration that cannot load', () => {
408
+ it('sets exit code 1 and reports it in the JSON', async () => {
409
+ const dir = fs.mkdtempSync(path.join(process.cwd(), '.astryx-doctor-exit-'));
410
+ const prevCwd = process.cwd();
411
+ const prevExit = process.exitCode;
412
+ process.exitCode = undefined;
413
+ try {
414
+ fs.writeFileSync(path.join(dir, 'package.json'), '{"name":"app"}');
415
+ fs.writeFileSync(
416
+ path.join(dir, 'astryx.config.mjs'),
417
+ "export default { integrations: ['@acme/missing'] };\n",
418
+ );
419
+ const coreDir = path.join(dir, 'node_modules', '@astryxdesign', 'core');
420
+ fs.mkdirSync(coreDir, {recursive: true});
421
+ fs.writeFileSync(
422
+ path.join(coreDir, 'package.json'),
423
+ JSON.stringify({name: '@astryxdesign/core', version: '0.6.3'}),
424
+ );
425
+ process.chdir(dir);
426
+ await createProgram().parseAsync(['node', 'astryx', '--json', 'doctor']);
427
+ expect(process.exitCode).toBe(1);
428
+ const {data} = JSON.parse(logCalls.join('\n'));
429
+ expect(
430
+ data.checks.find(c => c.id === 'configured-integrations'),
431
+ ).toMatchObject({status: 'fail'});
432
+ } finally {
433
+ process.chdir(prevCwd);
434
+ process.exitCode = prevExit;
435
+ fs.rmSync(dir, {recursive: true, force: true});
436
+ }
437
+ }, 60_000);
438
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.0-canary.2e0dbb5",
3
+ "version": "0.7.0-canary.3045eda",
4
4
  "displayName": "CLI",
5
5
  "description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
6
6
  "author": "Meta Open Source",
@@ -101,10 +101,10 @@
101
101
  "zod": "^4.4.3"
102
102
  },
103
103
  "peerDependencies": {
104
- "@astryxdesign/charts": "0.7.0-canary.2e0dbb5",
105
- "@astryxdesign/core": "0.7.0-canary.2e0dbb5",
106
- "@astryxdesign/lab": "0.7.0-canary.2e0dbb5",
107
- "@astryxdesign/theme-neutral": "0.7.0-canary.2e0dbb5"
104
+ "@astryxdesign/charts": "0.7.0-canary.3045eda",
105
+ "@astryxdesign/core": "0.7.0-canary.3045eda",
106
+ "@astryxdesign/lab": "0.7.0-canary.3045eda",
107
+ "@astryxdesign/theme-neutral": "0.7.0-canary.3045eda"
108
108
  },
109
109
  "peerDependenciesMeta": {
110
110
  "@astryxdesign/charts": {
@@ -121,10 +121,10 @@
121
121
  }
122
122
  },
123
123
  "devDependencies": {
124
- "@astryxdesign/charts": "0.7.0-canary.2e0dbb5",
125
- "@astryxdesign/core": "0.7.0-canary.2e0dbb5",
126
- "@astryxdesign/lab": "0.7.0-canary.2e0dbb5",
127
- "@astryxdesign/theme-neutral": "0.7.0-canary.2e0dbb5",
124
+ "@astryxdesign/charts": "0.7.0-canary.3045eda",
125
+ "@astryxdesign/core": "0.7.0-canary.3045eda",
126
+ "@astryxdesign/lab": "0.7.0-canary.3045eda",
127
+ "@astryxdesign/theme-neutral": "0.7.0-canary.3045eda",
128
128
  "@heroicons/react": "^2.2.0",
129
129
  "@stylexjs/stylex": "^0.19.0",
130
130
  "@types/babel__core": "^7.20.5",