@astryxdesign/cli 0.1.4-canary.a234521 → 0.1.4-canary.a30efd1

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 CHANGED
@@ -36,7 +36,7 @@ Thanks to everyone who contributed to this release:
36
36
  - Strict config + integration v1 schema (integrations, issuesUrl, hooks.postCodemod) and new @astryxdesign/cli/integration export.
37
37
  - File-based codemod API (createCodemod/createConfigCodemod) with the @astryxdesign/cli/codemod export and integration codemod discovery in upgrade.
38
38
  - component, template, and upgrade now print a one-line non-blocking warning when a configured integration has validation issues, pointing to validate-integration.
39
- - Add a Kanban Board page template: color-coded status columns, draggable task cards with priority tags, and board toolbar. Based on a design by @cg-hub18.
39
+ - Add a Kanban Board page template: color-coded status columns, draggable task cards with priority tags, and board toolbar.
40
40
  - Add frame-first layout guidance: new `astryx docs layout` topic (shell choice, region budgets, app archetypes, cards-vs-rows policy, responsive contracts), layout rules in the generated agent cheat sheet, and layout anti-patterns in `docs principles`.
41
41
  - Add a v0.1.3 config codemod that migrates astryx.config layout.components to experimental.xle.components.
42
42
  - Add v0.1.0 codemods for migrating `declare module "@xds/core/..."` type augmentations and `.xds-*` / `[data-xds-theme]` / `@layer xds-theme` CSS surfaces to their `@astryxdesign`/`astryx-*` equivalents.
@@ -80,7 +80,6 @@ Thanks to everyone who contributed to this release:
80
80
  Thanks to everyone who contributed to this release:
81
81
 
82
82
  - @AKnassa
83
- - @cg-hub18
84
83
  - @ejhammond
85
84
  - @ernestt
86
85
  - @harshavardhan194
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.1.4-canary.a234521",
3
+ "version": "0.1.4-canary.a30efd1",
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",
@@ -75,10 +75,10 @@
75
75
  "zod": "^4.4.3"
76
76
  },
77
77
  "peerDependencies": {
78
- "@astryxdesign/charts": "0.1.4-canary.a234521",
79
- "@astryxdesign/core": "0.1.4-canary.a234521",
80
- "@astryxdesign/lab": "0.1.4-canary.a234521",
81
- "@astryxdesign/theme-neutral": "0.1.4-canary.a234521",
78
+ "@astryxdesign/charts": "0.1.4-canary.a30efd1",
79
+ "@astryxdesign/core": "0.1.4-canary.a30efd1",
80
+ "@astryxdesign/lab": "0.1.4-canary.a30efd1",
81
+ "@astryxdesign/theme-neutral": "0.1.4-canary.a30efd1",
82
82
  "gpt-tokenizer": "^3.4.0"
83
83
  },
84
84
  "peerDependenciesMeta": {
@@ -96,10 +96,10 @@
96
96
  }
97
97
  },
98
98
  "devDependencies": {
99
- "@astryxdesign/charts": "0.1.4-canary.a234521",
100
- "@astryxdesign/core": "0.1.4-canary.a234521",
101
- "@astryxdesign/lab": "0.1.4-canary.a234521",
102
- "@astryxdesign/theme-neutral": "0.1.4-canary.a234521",
99
+ "@astryxdesign/charts": "0.1.4-canary.a30efd1",
100
+ "@astryxdesign/core": "0.1.4-canary.a30efd1",
101
+ "@astryxdesign/lab": "0.1.4-canary.a30efd1",
102
+ "@astryxdesign/theme-neutral": "0.1.4-canary.a30efd1",
103
103
  "gpt-tokenizer": "^3.4.0"
104
104
  },
105
105
  "scripts": {
@@ -99,43 +99,5 @@ describe('runCodemods — unified config codemod path', () => {
99
99
  expect(fs.readFileSync(path.join(srcDir, 'a.ts'), 'utf-8')).toContain(
100
100
  'const bar = 1',
101
101
  );
102
- // writtenFiles must be returned (consumed by upgrade.mjs to run the
103
- // post-codemod formatting/lint hooks). Regression guard: it was previously
104
- // built internally but omitted from the return object, so hooks received an
105
- // empty file list and silently skipped, leaving codemod output unformatted.
106
- expect(result.writtenFiles).toEqual([path.join(srcDir, 'a.ts')]);
107
- });
108
-
109
- it('returns writtenFiles for every changed file (post-codemod hook input)', async () => {
110
- const srcDir = path.join(tmpDir, 'src');
111
- fs.mkdirSync(srcDir);
112
- fs.writeFileSync(path.join(srcDir, 'a.ts'), 'const foo = 1;\n');
113
- fs.writeFileSync(path.join(srcDir, 'b.ts'), 'const foo = 2;\n');
114
- fs.writeFileSync(path.join(srcDir, 'c.ts'), 'const untouched = 3;\n');
115
-
116
- const versionManifests = [
117
- {
118
- version: '0.1.3',
119
- transforms: [
120
- {
121
- name: 'synthetic-code-codemod',
122
- meta: {title: 'Synthetic code codemod'},
123
- transform: file => file.source.replace(/foo/g, 'bar'),
124
- },
125
- ],
126
- },
127
- ];
128
-
129
- const result = await runCodemods(versionManifests, {
130
- apply: true,
131
- path: './src',
132
- silent: true,
133
- });
134
-
135
- expect(result.totalFilesChanged).toBe(2);
136
- // Only the two files that actually changed are reported (not c.ts).
137
- expect([...result.writtenFiles].sort()).toEqual(
138
- [path.join(srcDir, 'a.ts'), path.join(srcDir, 'b.ts')].sort(),
139
- );
140
102
  });
141
103
  });
@@ -178,7 +178,6 @@ function toUnifiedEntry(transformEntry, version) {
178
178
  * @param {string|undefined} options.codemod - Run only this specific transform
179
179
  * @param {Set<string>} [options.skipCodemods] - Transform names to exclude
180
180
  * @param {boolean} [options.silent] - Suppress all human-facing output (for --json)
181
- * @returns {{totalFilesChanged: number, totalTransformsApplied: number, totalValidationBlocked: number, writtenFiles: string[], errors: Array, skippedOptional: Array}}
182
181
  */
183
182
  export async function runCodemods(
184
183
  versionManifests,
@@ -406,7 +405,6 @@ export async function runCodemods(
406
405
  totalFilesChanged,
407
406
  totalTransformsApplied,
408
407
  totalValidationBlocked,
409
- writtenFiles,
410
408
  errors,
411
409
  skippedOptional,
412
410
  };
@@ -7,7 +7,7 @@ export const doc = {
7
7
  name: 'Code — Terminal',
8
8
  displayName: 'Code — Terminal',
9
9
  description:
10
- 'A dark terminal-style command block: a bash CodeBlock wrapped in SyntaxTheme with the GitHub Dark preset, copy button on, and no line numbers. Use for shell sessions or CLI output that should read as a terminal even on light pages. Reach for a dark syntax preset instead of hand-rolling a dark box with custom CSS.',
10
+ 'A dark terminal-style command block: a bash CodeBlock wrapped in SyntaxTheme with the GitHub Dark preset, copy button on, and no line numbers. Use for shell sessions or CLI output that should read as a terminal even on light pages reach for a dark syntax preset instead of hand-rolling a dark box with custom CSS.',
11
11
  isReady: true,
12
12
  aspectRatio: 16 / 9,
13
13
  componentsUsed: ['CodeBlock', 'SyntaxTheme'],
@@ -3,45 +3,66 @@
3
3
  'use client';
4
4
 
5
5
  import {useMemo} from 'react';
6
- import {CommandPalette} from '@astryxdesign/core/CommandPalette';
6
+ import {
7
+ CommandPalette,
8
+ CommandPaletteList,
9
+ CommandPaletteGroup,
10
+ CommandPaletteItem,
11
+ } from '@astryxdesign/core/CommandPalette';
7
12
  import {createStaticSource} from '@astryxdesign/core/Typeahead';
13
+ import {Stack} from '@astryxdesign/core/Layout';
14
+ import {Text} from '@astryxdesign/core/Text';
8
15
 
9
16
  export default function CommandPaletteGroupShowcase() {
10
17
  const source = useMemo(
11
18
  () =>
12
19
  createStaticSource([
13
- {
14
- id: 'index',
15
- label: 'index.tsx',
16
- auxiliaryData: {group: 'Recent Files'},
17
- },
20
+ {id: 'index', label: 'index.tsx', auxiliaryData: {group: 'Recent Files'}},
18
21
  {id: 'app', label: 'App.tsx', auxiliaryData: {group: 'Recent Files'}},
19
- {
20
- id: 'settings',
21
- label: 'Open Settings',
22
- auxiliaryData: {group: 'Commands'},
23
- },
24
- {
25
- id: 'terminal',
26
- label: 'Toggle Terminal',
27
- auxiliaryData: {group: 'Commands'},
28
- },
29
- {
30
- id: 'theme',
31
- label: 'Color Theme',
32
- auxiliaryData: {group: 'Preferences'},
33
- },
22
+ {id: 'settings', label: 'Open Settings', auxiliaryData: {group: 'Commands'}},
23
+ {id: 'terminal', label: 'Toggle Terminal', auxiliaryData: {group: 'Commands'}},
24
+ {id: 'theme', label: 'Color Theme', auxiliaryData: {group: 'Preferences'}},
34
25
  {id: 'font', label: 'Font Size', auxiliaryData: {group: 'Preferences'}},
35
26
  ]),
36
27
  [],
37
28
  );
38
29
 
39
30
  return (
40
- <CommandPalette
41
- isOpen
42
- isInline
43
- onOpenChange={() => {}}
44
- searchSource={source}
45
- />
31
+ <Stack direction="vertical" gap={4}>
32
+ <Stack direction="vertical" gap={1}>
33
+ <Text type="supporting" color="secondary">
34
+ Data-driven grouping (auxiliaryData.group)
35
+ </Text>
36
+ <CommandPalette
37
+ isOpen
38
+ isInline
39
+ onOpenChange={() => {}}
40
+ searchSource={source}
41
+ />
42
+ </Stack>
43
+ <Stack direction="vertical" gap={1}>
44
+ <Text type="supporting" color="secondary">
45
+ Composed form (CommandPaletteGroup + CommandPaletteItem)
46
+ </Text>
47
+ <CommandPaletteList>
48
+ <CommandPaletteGroup heading="Navigation">
49
+ <CommandPaletteItem value="home" onSelect={() => {}}>
50
+ Home
51
+ </CommandPaletteItem>
52
+ <CommandPaletteItem value="dashboard" onSelect={() => {}}>
53
+ Dashboard
54
+ </CommandPaletteItem>
55
+ </CommandPaletteGroup>
56
+ <CommandPaletteGroup heading="Actions">
57
+ <CommandPaletteItem value="new-file" onSelect={() => {}}>
58
+ New File
59
+ </CommandPaletteItem>
60
+ <CommandPaletteItem value="save" onSelect={() => {}}>
61
+ Save All
62
+ </CommandPaletteItem>
63
+ </CommandPaletteGroup>
64
+ </CommandPaletteList>
65
+ </Stack>
66
+ </Stack>
46
67
  );
47
68
  }
@@ -3,10 +3,16 @@
3
3
  'use client';
4
4
 
5
5
  import {useMemo, type CSSProperties} from 'react';
6
- import {CommandPalette} from '@astryxdesign/core/CommandPalette';
6
+ import {
7
+ CommandPalette,
8
+ CommandPaletteList,
9
+ CommandPaletteItem,
10
+ } from '@astryxdesign/core/CommandPalette';
7
11
  import {Text} from '@astryxdesign/core/Text';
8
12
  import {Kbd} from '@astryxdesign/core/Kbd';
13
+ import {Icon} from '@astryxdesign/core/Icon';
9
14
  import {createStaticSource} from '@astryxdesign/core/Typeahead';
15
+ import {Stack} from '@astryxdesign/core/Layout';
10
16
  import type {SearchableItem} from '@astryxdesign/core/Typeahead';
11
17
 
12
18
  const itemLabel: CSSProperties = {
@@ -17,21 +23,9 @@ type CommandItem = SearchableItem<{shortcut?: string}>;
17
23
 
18
24
  const commands: CommandItem[] = [
19
25
  {id: 'save', label: 'Save File', auxiliaryData: {shortcut: 'mod+s'}},
20
- {
21
- id: 'find',
22
- label: 'Find in Files',
23
- auxiliaryData: {shortcut: 'mod+shift+f'},
24
- },
25
- {
26
- id: 'palette',
27
- label: 'Command Palette',
28
- auxiliaryData: {shortcut: 'mod+shift+p'},
29
- },
30
- {
31
- id: 'terminal',
32
- label: 'Toggle Terminal',
33
- auxiliaryData: {shortcut: 'ctrl+`'},
34
- },
26
+ {id: 'find', label: 'Find in Files', auxiliaryData: {shortcut: 'mod+shift+f'}},
27
+ {id: 'palette', label: 'Command Palette', auxiliaryData: {shortcut: 'mod+shift+p'}},
28
+ {id: 'terminal', label: 'Toggle Terminal', auxiliaryData: {shortcut: 'ctrl+`'}},
35
29
  {id: 'sidebar', label: 'Toggle Sidebar', auxiliaryData: {shortcut: 'mod+b'}},
36
30
  ];
37
31
 
@@ -39,21 +33,50 @@ export default function CommandPaletteItemShowcase() {
39
33
  const source = useMemo(() => createStaticSource(commands), []);
40
34
 
41
35
  return (
42
- <CommandPalette
43
- isOpen
44
- isInline
45
- onOpenChange={() => {}}
46
- searchSource={source}
47
- renderItem={(item: CommandItem) => (
48
- <>
49
- <Text type="body" style={itemLabel}>
50
- {item.label}
51
- </Text>
52
- {item.auxiliaryData?.shortcut && (
53
- <Kbd keys={item.auxiliaryData.shortcut} />
36
+ <Stack direction="vertical" gap={4}>
37
+ <Stack direction="vertical" gap={1}>
38
+ <Text type="supporting" color="secondary">
39
+ Custom renderItem with keyboard shortcuts
40
+ </Text>
41
+ <CommandPalette
42
+ isOpen
43
+ isInline
44
+ onOpenChange={() => {}}
45
+ searchSource={source}
46
+ renderItem={(item: CommandItem) => (
47
+ <>
48
+ <Text type="body" style={itemLabel}>
49
+ {item.label}
50
+ </Text>
51
+ {item.auxiliaryData?.shortcut && (
52
+ <Kbd keys={item.auxiliaryData.shortcut} />
53
+ )}
54
+ </>
54
55
  )}
55
- </>
56
- )}
57
- />
56
+ />
57
+ </Stack>
58
+ <Stack direction="vertical" gap={1}>
59
+ <Text type="supporting" color="secondary">
60
+ Composed items with icons and states
61
+ </Text>
62
+ <CommandPaletteList>
63
+ <CommandPaletteItem value="home" onSelect={() => {}}>
64
+ <Icon icon="externalLink" size="sm" />
65
+ <Text type="body" style={itemLabel}>Home</Text>
66
+ </CommandPaletteItem>
67
+ <CommandPaletteItem value="search" isHighlighted onSelect={() => {}}>
68
+ <Icon icon="search" size="sm" />
69
+ <Text type="body" style={itemLabel}>Search (highlighted)</Text>
70
+ </CommandPaletteItem>
71
+ <CommandPaletteItem value="selected" isSelected onSelect={() => {}}>
72
+ <Icon icon="check" size="sm" />
73
+ <Text type="body" style={itemLabel}>Selected item</Text>
74
+ </CommandPaletteItem>
75
+ <CommandPaletteItem value="disabled" isDisabled>
76
+ <Text type="body" style={itemLabel}>Disabled item</Text>
77
+ </CommandPaletteItem>
78
+ </CommandPaletteList>
79
+ </Stack>
80
+ </Stack>
58
81
  );
59
82
  }
@@ -1,15 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
- export const doc = {
5
- type: 'block',
6
- exampleFor: 'CommandPaletteInput',
7
- name: 'CommandPaletteInput — With End Content',
8
- displayName: 'CommandPaletteInput — With End Content',
9
- description:
10
- 'Custom placeholder and a keyboard shortcut badge in the trailing slot via endContent.',
11
- isReady: true,
12
- isShowcase: false,
13
- aspectRatio: 4 / 3,
14
- componentsUsed: ['CommandPalette', 'CommandPaletteInput', 'Kbd'],
15
- };
@@ -1,39 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- 'use client';
4
-
5
- import {useMemo} from 'react';
6
- import {
7
- CommandPalette,
8
- CommandPaletteInput,
9
- } from '@astryxdesign/core/CommandPalette';
10
- import {Kbd} from '@astryxdesign/core/Kbd';
11
- import {createStaticSource} from '@astryxdesign/core/Typeahead';
12
-
13
- export default function CommandPaletteInputBasic() {
14
- const source = useMemo(
15
- () =>
16
- createStaticSource([
17
- {id: 'home', label: 'Home'},
18
- {id: 'settings', label: 'Settings'},
19
- {id: 'profile', label: 'Profile'},
20
- {id: 'help', label: 'Help'},
21
- ]),
22
- [],
23
- );
24
-
25
- return (
26
- <CommandPalette
27
- isOpen
28
- isInline
29
- onOpenChange={() => {}}
30
- searchSource={source}
31
- input={
32
- <CommandPaletteInput
33
- placeholder="Search commands, files, or actions..."
34
- endContent={<Kbd keys="mod+k" />}
35
- />
36
- }
37
- />
38
- );
39
- }
@@ -1,15 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
- export const doc = {
5
- type: 'block',
6
- exampleFor: 'CommandPaletteInput',
7
- name: 'CommandPaletteInput',
8
- displayName: 'Command Palette Input',
9
- description:
10
- 'Command palette search input with a custom placeholder and a keyboard shortcut hint in the endContent slot.',
11
- isReady: true,
12
- isShowcase: true,
13
- aspectRatio: 4 / 3,
14
- componentsUsed: ['CommandPalette', 'CommandPaletteInput', 'Kbd'],
15
- };
@@ -1,39 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- 'use client';
4
-
5
- import {useMemo} from 'react';
6
- import {
7
- CommandPalette,
8
- CommandPaletteInput,
9
- } from '@astryxdesign/core/CommandPalette';
10
- import {Kbd} from '@astryxdesign/core/Kbd';
11
- import {createStaticSource} from '@astryxdesign/core/Typeahead';
12
-
13
- export default function CommandPaletteInputShowcase() {
14
- const source = useMemo(
15
- () =>
16
- createStaticSource([
17
- {id: 'home', label: 'Home'},
18
- {id: 'settings', label: 'Settings'},
19
- {id: 'profile', label: 'Profile'},
20
- {id: 'help', label: 'Help'},
21
- ]),
22
- [],
23
- );
24
-
25
- return (
26
- <CommandPalette
27
- isOpen
28
- isInline
29
- onOpenChange={() => {}}
30
- searchSource={source}
31
- input={
32
- <CommandPaletteInput
33
- placeholder="Search commands, files, or actions..."
34
- endContent={<Kbd keys="mod+k" />}
35
- />
36
- }
37
- />
38
- );
39
- }
@@ -1,15 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
- export const doc = {
5
- type: 'block',
6
- exampleFor: 'CommandPaletteList',
7
- name: 'CommandPaletteList — Item States',
8
- displayName: 'CommandPaletteList — Item States',
9
- description:
10
- 'Flat list showing the highlighted, selected, and disabled item states. Use CommandPaletteGroup to add section headings.',
11
- isReady: true,
12
- isShowcase: false,
13
- aspectRatio: 4 / 3,
14
- componentsUsed: ['CommandPaletteList', 'CommandPaletteItem'],
15
- };
@@ -1,27 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- 'use client';
4
-
5
- import {
6
- CommandPaletteList,
7
- CommandPaletteItem,
8
- } from '@astryxdesign/core/CommandPalette';
9
-
10
- export default function CommandPaletteListBasic() {
11
- return (
12
- <CommandPaletteList>
13
- <CommandPaletteItem value="home" onSelect={() => {}}>
14
- Go Home
15
- </CommandPaletteItem>
16
- <CommandPaletteItem value="settings" isHighlighted onSelect={() => {}}>
17
- Open Settings
18
- </CommandPaletteItem>
19
- <CommandPaletteItem value="profile" isSelected onSelect={() => {}}>
20
- View Profile
21
- </CommandPaletteItem>
22
- <CommandPaletteItem value="help" isDisabled onSelect={() => {}}>
23
- Help (unavailable)
24
- </CommandPaletteItem>
25
- </CommandPaletteList>
26
- );
27
- }
@@ -1,15 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
4
- export const doc = {
5
- type: 'block',
6
- exampleFor: 'CommandPaletteList',
7
- name: 'CommandPaletteList',
8
- displayName: 'Command Palette List',
9
- description:
10
- 'Scrollable command palette list with grouped items, including a highlighted item, composed without a full CommandPalette.',
11
- isReady: true,
12
- isShowcase: true,
13
- aspectRatio: 4 / 3,
14
- componentsUsed: ['CommandPaletteList', 'CommandPaletteGroup', 'CommandPaletteItem'],
15
- };
@@ -1,38 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- 'use client';
4
-
5
- import {
6
- CommandPaletteList,
7
- CommandPaletteGroup,
8
- CommandPaletteItem,
9
- } from '@astryxdesign/core/CommandPalette';
10
-
11
- export default function CommandPaletteListShowcase() {
12
- return (
13
- <CommandPaletteList>
14
- <CommandPaletteGroup heading="Navigation">
15
- <CommandPaletteItem value="home" onSelect={() => {}}>
16
- Go Home
17
- </CommandPaletteItem>
18
- <CommandPaletteItem value="settings" onSelect={() => {}}>
19
- Open Settings
20
- </CommandPaletteItem>
21
- <CommandPaletteItem value="profile" onSelect={() => {}}>
22
- View Profile
23
- </CommandPaletteItem>
24
- </CommandPaletteGroup>
25
- <CommandPaletteGroup heading="Actions">
26
- <CommandPaletteItem value="new-file" onSelect={() => {}}>
27
- New File
28
- </CommandPaletteItem>
29
- <CommandPaletteItem value="search" isHighlighted onSelect={() => {}}>
30
- Search Files
31
- </CommandPaletteItem>
32
- <CommandPaletteItem value="save" onSelect={() => {}}>
33
- Save All
34
- </CommandPaletteItem>
35
- </CommandPaletteGroup>
36
- </CommandPaletteList>
37
- );
38
- }