@astryxdesign/cli 0.1.4-canary.37c19d3 → 0.1.4-canary.38ede5f

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 (30) hide show
  1. package/docs/getting-started.doc.mjs +4 -0
  2. package/docs/migration.doc.mjs +134 -0
  3. package/docs/styling.doc.mjs +53 -0
  4. package/package.json +10 -10
  5. package/src/commands/agent-docs.mjs +7 -5
  6. package/src/commands/agent-docs.test.mjs +33 -0
  7. package/src/commands/build-theme.color-scheme.test.mjs +153 -0
  8. package/src/commands/build-theme.mjs +8 -1
  9. package/src/commands/build-theme.variants.test.mjs +7 -18
  10. package/src/commands/init.mjs +1 -1
  11. package/src/commands/swizzle.mjs +34 -0
  12. package/src/commands/swizzle.routing.test.mjs +67 -0
  13. package/templates/blocks/components/Collapsible/CollapsibleWithoutCard.tsx +25 -23
  14. package/templates/pages/classic-gallery/page.tsx +1 -1
  15. package/templates/pages/dashboard/page.tsx +1 -1
  16. package/templates/pages/documentation/page.tsx +1 -1
  17. package/templates/pages/incident-console/page.tsx +580 -0
  18. package/templates/pages/incident-console/template.doc.mjs +12 -0
  19. package/templates/pages/messaging-shell/page.tsx +676 -0
  20. package/templates/pages/messaging-shell/template.doc.mjs +12 -0
  21. package/templates/pages/mixed-gallery/page.tsx +1 -1
  22. package/templates/pages/payment-form/page.tsx +2 -6
  23. package/templates/pages/product-detail/page.tsx +3 -11
  24. package/templates/pages/product-gallery/page.tsx +1 -1
  25. package/templates/pages/settings/page.tsx +1 -1
  26. package/templates/pages/side-gallery/page.tsx +1 -1
  27. package/templates/pages/table-page/page.tsx +1 -1
  28. package/templates/pages/table-page-chart/page.tsx +1 -1
  29. package/templates/pages/table-page-heatmap-status/page.tsx +1 -1
  30. package/templates/pages/table-page-shoe-store-heatmap/page.tsx +1 -1
@@ -277,3 +277,70 @@ describe('swizzle — ambiguous ownership', () => {
277
277
  expect(out).toContain(`from '@astryxdesign/core/theme'`);
278
278
  });
279
279
  });
280
+
281
+ /**
282
+ * Build a fake @astryxdesign/core with a component that imports StyleX directly
283
+ * (so the swizzle StyleX-build note should fire) and one that doesn't.
284
+ */
285
+ function buildStyleXCore(project) {
286
+ const core = path.join(project, 'node_modules', '@astryxdesign', 'core');
287
+ // StyleX component.
288
+ const styledDir = path.join(core, 'src', 'Styled');
289
+ fs.mkdirSync(styledDir, {recursive: true});
290
+ fs.writeFileSync(
291
+ path.join(core, 'package.json'),
292
+ '{"name":"@astryxdesign/core","version":"0.0.13"}',
293
+ );
294
+ fs.writeFileSync(
295
+ path.join(styledDir, 'Styled.tsx'),
296
+ [
297
+ `import * as stylex from '@stylexjs/stylex';`,
298
+ `const styles = stylex.create({base: {color: 'red'}});`,
299
+ `export const Styled = () => null;`,
300
+ '',
301
+ ].join('\n'),
302
+ );
303
+ // Plain component (no StyleX).
304
+ const plainDir = path.join(core, 'src', 'Plain');
305
+ fs.mkdirSync(plainDir, {recursive: true});
306
+ fs.writeFileSync(
307
+ path.join(plainDir, 'Plain.tsx'),
308
+ `export const Plain = () => null;\n`,
309
+ );
310
+ return core;
311
+ }
312
+
313
+ describe('swizzle — StyleX build setup note (#3373)', () => {
314
+ it('reports usesStyleX and prints a setup note for StyleX components', () => {
315
+ buildStyleXCore(project);
316
+ writeProjectPackageJson(project);
317
+
318
+ // JSON payload carries the machine-readable flag.
319
+ const jsonResult = runCli(['--json', 'swizzle', 'Styled', '-f'], project);
320
+ expect(jsonResult.code).toBe(0);
321
+ const env = JSON.parse(jsonResult.stdout);
322
+ expect(env.data.usesStyleX).toBe(true);
323
+
324
+ // Human output surfaces the compiler requirement + Next.js caveat.
325
+ const humanResult = runCli(['swizzle', 'Styled', '-f'], project);
326
+ expect(humanResult.code).toBe(0);
327
+ expect(humanResult.stdout).toMatch(/StyleX compiler/i);
328
+ expect(humanResult.stdout).toMatch(/unstyled/i);
329
+ expect(humanResult.stdout).toMatch(/next\/font/i);
330
+ expect(humanResult.stdout).toMatch(/astryx docs styling/);
331
+ });
332
+
333
+ it('does not print the StyleX note for components without StyleX', () => {
334
+ buildStyleXCore(project);
335
+ writeProjectPackageJson(project);
336
+
337
+ const jsonResult = runCli(['--json', 'swizzle', 'Plain', '-f'], project);
338
+ expect(jsonResult.code).toBe(0);
339
+ const env = JSON.parse(jsonResult.stdout);
340
+ expect(env.data.usesStyleX).toBe(false);
341
+
342
+ const humanResult = runCli(['swizzle', 'Plain', '-f'], project);
343
+ expect(humanResult.code).toBe(0);
344
+ expect(humanResult.stdout).not.toMatch(/StyleX compiler/i);
345
+ });
346
+ });
@@ -2,34 +2,36 @@
2
2
 
3
3
  'use client';
4
4
 
5
- import {Collapsible} from '@astryxdesign/core/Collapsible';
5
+ import {Collapsible, CollapsibleGroup} from '@astryxdesign/core/Collapsible';
6
6
  import {Divider} from '@astryxdesign/core/Divider';
7
7
  import {Text} from '@astryxdesign/core/Text';
8
8
  import {VStack} from '@astryxdesign/core/Layout';
9
9
 
10
10
  export default function CollapsibleWithoutCard() {
11
11
  return (
12
- <VStack gap={3} style={{width: '100%', maxWidth: 400}}>
13
- <Collapsible trigger="Deployment Details">
14
- <Text type="body">
15
- Last deployed on April 18, 2026 at 3:42 PM by Sarah Chen. Build
16
- duration was 2m 14s with zero warnings.
17
- </Text>
18
- </Collapsible>
19
- <Divider />
20
- <Collapsible trigger="Environment Variables" defaultIsOpen={false}>
21
- <Text type="body">
22
- 12 variables configured. Last updated March 30, 2026. All secrets are
23
- encrypted at rest with AES-256.
24
- </Text>
25
- </Collapsible>
26
- <Divider />
27
- <Collapsible trigger="Build Logs" defaultIsOpen={false}>
28
- <Text type="body">
29
- Build completed successfully. 847 modules compiled, 0 errors, 0
30
- warnings. Bundle size: 142 KB gzipped.
31
- </Text>
32
- </Collapsible>
33
- </VStack>
12
+ <CollapsibleGroup type="single" defaultValue="deployment">
13
+ <VStack gap={3} style={{width: '100%', maxWidth: 400}}>
14
+ <Collapsible trigger="Deployment Details" value="deployment">
15
+ <Text type="body">
16
+ Last deployed on April 18, 2026 at 3:42 PM by Sarah Chen. Build
17
+ duration was 2m 14s with zero warnings.
18
+ </Text>
19
+ </Collapsible>
20
+ <Divider />
21
+ <Collapsible trigger="Environment Variables" value="environment">
22
+ <Text type="body">
23
+ 12 variables configured. Last updated March 30, 2026. All secrets
24
+ are encrypted at rest with AES-256.
25
+ </Text>
26
+ </Collapsible>
27
+ <Divider />
28
+ <Collapsible trigger="Build Logs" value="logs">
29
+ <Text type="body">
30
+ Build completed successfully. 847 modules compiled, 0 errors, 0
31
+ warnings. Bundle size: 142 KB gzipped.
32
+ </Text>
33
+ </Collapsible>
34
+ </VStack>
35
+ </CollapsibleGroup>
34
36
  );
35
37
  }
@@ -110,7 +110,7 @@ export default function ClassicGalleryTemplate() {
110
110
 
111
111
  return (
112
112
  <Layout
113
- height="auto"
113
+ height="fill"
114
114
  content={
115
115
  <LayoutContent padding={0}>
116
116
  <Center axis="horizontal">
@@ -729,7 +729,7 @@ function TableCard<T extends {id: string}>({
729
729
  export default function DashboardTemplate() {
730
730
  return (
731
731
  <Layout
732
- height="auto"
732
+ height="fill"
733
733
  content={
734
734
  <LayoutContent padding={6}>
735
735
  <VStack gap={6}>
@@ -209,7 +209,7 @@ const COMPONENT_CATEGORIES = [
209
209
  export default function DocumentationOverviewPage() {
210
210
  return (
211
211
  <Layout
212
- height="auto"
212
+ height="fill"
213
213
  contentWidth={1200}
214
214
  content={
215
215
  <LayoutContent padding={8}>