@astryxdesign/cli 0.3.0-canary.fbc60c5 → 0.3.0-canary.fcbc342
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/README.md +8 -8
- package/api/blog/blog.doc.mjs +2 -2
- package/api/build/build.doc.mjs +1 -1
- package/api/component/component.doc.mjs +1 -1
- package/api/discover/discover.doc.mjs +2 -2
- package/api/docs/docs.doc.mjs +2 -2
- package/api/doctor/doctor.doc.mjs +3 -3
- package/api/hook/hook.doc.mjs +1 -1
- package/api/init/init.doc.mjs +1 -1
- package/api/integration/summarizeIssues.doc.mjs +1 -1
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/json/assertResponse.doc.mjs +2 -2
- package/api/json/isError.doc.mjs +1 -1
- package/api/json/parseResponse.doc.mjs +2 -2
- package/api/layout/layoutCheck.doc.mjs +1 -1
- package/api/layout/layoutExpand.doc.mjs +1 -1
- package/api/layout/layoutGrammar.doc.mjs +1 -1
- package/api/swizzle/swizzle.doc.mjs +1 -1
- package/api/template/template.test.mjs +38 -13
- package/api/theme/listThemes.doc.mjs +2 -2
- package/api/theme/themeAdd.doc.mjs +1 -1
- package/api/theme/themeBuild.doc.mjs +3 -3
- package/api/theme/themeList.doc.mjs +2 -2
- package/api/upgrade/upgrade.doc.mjs +1 -1
- package/assets/codemods/transforms/next/__tests__/next-codemods.test.mjs +92 -0
- package/assets/codemods/transforms/next/index.mjs +11 -1
- package/assets/codemods/transforms/next/rename-dropdown-menu-radio-dot-target.mjs +152 -0
- package/assets/codemods/transforms/v0.3.0/__tests__/migrate-grid-minchildwidth-to-columns.test.mjs +82 -0
- package/assets/codemods/transforms/v0.3.0/__tests__/migrate-table-rowexpansion-to-tree.test.mjs +201 -0
- package/assets/codemods/transforms/v0.3.0/index.mjs +8 -0
- package/assets/codemods/transforms/v0.3.0/migrate-grid-minchildwidth-to-columns.mjs +38 -2
- package/assets/codemods/transforms/v0.3.0/migrate-table-rowexpansion-to-tree.mjs +214 -0
- package/assets/docs/browser-support.doc.mjs +6 -6
- package/assets/docs/getting-started.doc.mjs +3 -3
- package/assets/docs/icons.doc.mjs +3 -3
- package/assets/docs/illustrations.doc.mjs +2 -2
- package/assets/docs/internationalization.doc.mjs +1 -1
- package/assets/docs/layout.doc.dense.mjs +1 -1
- package/assets/docs/migration.doc.mjs +1 -1
- package/assets/docs/principles.doc.mjs +1 -1
- package/assets/docs/styling-libraries.doc.mjs +1 -1
- package/assets/docs/styling.doc.mjs +4 -4
- package/assets/docs/theme.doc.mjs +3 -3
- package/assets/docs/typography.doc.mjs +2 -2
- package/assets/templates/blocks/components/AspectRatio/AspectRatioCircleImage.tsx +1 -1
- package/assets/templates/blocks/components/AspectRatio/AspectRatioImageGallery.tsx +1 -1
- package/assets/templates/blocks/components/AspectRatio/AspectRatioShowcase.tsx +3 -3
- package/assets/templates/blocks/components/AspectRatio/AspectRatioSquareImage.tsx +1 -1
- package/assets/templates/blocks/components/AspectRatio/AspectRatioWidescreen.tsx +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarFallbackChain.tsx +6 -6
- package/assets/templates/blocks/components/Avatar/AvatarGroup.tsx +5 -5
- package/assets/templates/blocks/components/Avatar/AvatarInteractive.tsx +2 -2
- package/assets/templates/blocks/components/Avatar/AvatarShowcase.tsx +4 -4
- package/assets/templates/blocks/components/Avatar/AvatarTooltip.tsx +4 -4
- package/assets/templates/blocks/components/Avatar/AvatarUserCard.tsx +3 -3
- package/assets/templates/blocks/components/Avatar/AvatarWithImage.tsx +4 -4
- package/assets/templates/blocks/components/Avatar/AvatarWithStatus.tsx +3 -3
- package/assets/templates/blocks/components/ChatComposerDrawer/ChatComposerDrawerAttachments.tsx +5 -5
- package/assets/templates/blocks/components/Lightbox/LightboxGallery.tsx +4 -4
- package/assets/templates/blocks/components/Lightbox/LightboxShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Lightbox/LightboxVideo.tsx +1 -1
- package/assets/templates/blocks/components/Lightbox/LightboxZoom.tsx +2 -2
- package/assets/templates/blocks/components/MediaTheme/MediaThemeImageOverlay.tsx +1 -1
- package/assets/templates/blocks/components/MediaTheme/MediaThemeLightScrim.tsx +1 -1
- package/assets/templates/blocks/components/MediaTheme/MediaThemeShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Overlay/OverlayBottomStrip.tsx +1 -1
- package/assets/templates/blocks/components/Overlay/OverlayHoverReveal.tsx +1 -1
- package/assets/templates/blocks/components/Overlay/OverlayShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Stepper/StepperHorizontal.doc.mjs +14 -0
- package/assets/templates/blocks/components/Stepper/StepperHorizontal.tsx +24 -0
- package/assets/templates/blocks/components/Stepper/StepperIndicatorModes.doc.mjs +14 -0
- package/assets/templates/blocks/components/Stepper/StepperIndicatorModes.tsx +68 -0
- package/assets/templates/blocks/components/Stepper/StepperMultiStepForm.doc.mjs +14 -0
- package/assets/templates/blocks/components/Stepper/StepperMultiStepForm.tsx +92 -0
- package/assets/templates/blocks/components/Stepper/StepperOnTrackVertical.doc.mjs +14 -0
- package/assets/templates/blocks/components/Stepper/StepperOnTrackVertical.tsx +41 -0
- package/assets/templates/blocks/components/Stepper/StepperShowcase.doc.mjs +15 -0
- package/assets/templates/blocks/components/Stepper/StepperShowcase.tsx +25 -0
- package/assets/templates/blocks/components/Stepper/StepperStatus.doc.mjs +14 -0
- package/assets/templates/blocks/components/Stepper/StepperStatus.tsx +50 -0
- package/assets/templates/blocks/components/Stepper/StepperVerticalOnboarding.doc.mjs +14 -0
- package/assets/templates/blocks/components/Stepper/StepperVerticalOnboarding.tsx +40 -0
- package/assets/templates/blocks/components/Table/TableRowExpansionTable.tsx +61 -58
- package/assets/templates/blocks/components/TextArea/TextAreaStates.tsx +1 -1
- package/assets/templates/blocks/components/TopNav/TopNavMegaMenu.tsx +1 -1
- package/assets/templates/pages/centered-hero/page.tsx +1 -1
- package/assets/templates/pages/classic-gallery/page.tsx +10 -10
- package/assets/templates/pages/detail-page/page.tsx +5 -5
- package/assets/templates/pages/form-two-column/page.tsx +1 -1
- package/assets/templates/pages/gallery-hero/page.tsx +3 -3
- package/assets/templates/pages/library/page.tsx +30 -30
- package/assets/templates/pages/login/page.tsx +1 -2
- package/assets/templates/pages/login-card/page.tsx +1 -2
- package/assets/templates/pages/login-split/page.tsx +5 -6
- package/assets/templates/pages/login-sso/page.tsx +2 -3
- package/assets/templates/pages/mixed-gallery/page.tsx +5 -5
- package/assets/templates/pages/payment-form/page.tsx +3 -3
- package/assets/templates/pages/product-detail/page.tsx +7 -7
- package/assets/templates/pages/product-gallery/page.tsx +6 -6
- package/assets/templates/pages/shell-top-nav/page.tsx +2 -2
- package/assets/templates/pages/side-gallery/page.tsx +9 -9
- package/assets/templates/pages/table-page-chart/page.tsx +6 -6
- package/assets/templates/pages/theme-showcase/page.tsx +6 -6
- package/assets/templates/themes/neutral/neutralTheme.ts +4 -1
- package/authoring/codemod/codemod.doc.mjs +2 -2
- package/authoring/config/config.doc.mjs +1 -1
- package/authoring/doctypes/base/type.ts +21 -0
- package/authoring/doctypes/command/command.doc.mjs +2 -2
- package/authoring/doctypes/component/component.doc.mjs +7 -7
- package/authoring/doctypes/enum/enum.doc.mjs +2 -2
- package/authoring/doctypes/function/function.doc.mjs +3 -3
- package/authoring/doctypes/hook/hook.doc.mjs +3 -3
- package/authoring/doctypes/reference/reference.doc.mjs +3 -3
- package/authoring/doctypes/schema/schema.doc.mjs +1 -1
- package/authoring/doctypes/template/template.doc.mjs +3 -3
- package/clients/cli/commands/build-theme.registry.test.mjs +14 -1
- package/clients/cli/commands/build.doc.mjs +1 -1
- package/clients/cli/commands/component.doc.mjs +1 -1
- package/clients/cli/commands/doctor.doc.mjs +2 -2
- package/clients/cli/commands/layout-expand.doc.mjs +1 -1
- package/clients/cli/commands/layout.doc.mjs +1 -1
- package/clients/cli/commands/manifest.doc.mjs +3 -3
- package/clients/cli/commands/search.doc.mjs +1 -1
- package/clients/cli/commands/theme-add.doc.mjs +1 -1
- package/clients/cli/commands/theme-build.doc.mjs +1 -1
- package/clients/cli/commands/theme-list.doc.mjs +1 -1
- package/clients/cli/commands/theme.doc.mjs +2 -2
- package/clients/cli/commands/validate-integration.doc.mjs +2 -2
- package/foundation/agent-docs/agent-docs.mjs +3 -4
- package/foundation/agent-docs/agent-docs.test.mjs +8 -0
- package/foundation/discovery/template-adapter.d.mts +6 -3
- package/foundation/discovery/template-adapter.mjs +33 -13
- package/foundation/response/response-types.doc.mjs +7 -7
- package/foundation/response/response.doc.mjs +5 -5
- package/package.json +9 -9
|
@@ -150,13 +150,13 @@ export const doc = {
|
|
|
150
150
|
type: 'list',
|
|
151
151
|
style: 'unordered',
|
|
152
152
|
items: [
|
|
153
|
-
"PageTemplateDoc (type: 'page')
|
|
154
|
-
"BlockTemplateDoc (type: 'block')
|
|
153
|
+
"PageTemplateDoc (type: 'page'): a full page template; `name` doubles as its display value.",
|
|
154
|
+
"BlockTemplateDoc (type: 'block'): an example of a component; requires `exampleFor` and `aspectRatio`.",
|
|
155
155
|
],
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
158
|
type: 'prose',
|
|
159
|
-
text: "`category` uses the shared TemplateCategory taxonomy: 'Group - Variant' strings (e.g. 'Table - Bulk Actions'). Not every value maps to an existing template
|
|
159
|
+
text: "`category` uses the shared TemplateCategory taxonomy: 'Group - Variant' strings (e.g. 'Table - Bulk Actions'). Not every value maps to an existing template; unused values are reserved so authors get autocomplete for the full taxonomy.",
|
|
160
160
|
},
|
|
161
161
|
],
|
|
162
162
|
};
|
|
@@ -60,7 +60,10 @@ function renderedClassLiterals() {
|
|
|
60
60
|
const full = path.join(dir, entry.name);
|
|
61
61
|
if (entry.isDirectory()) {
|
|
62
62
|
walk(full);
|
|
63
|
-
} else if (
|
|
63
|
+
} else if (
|
|
64
|
+
(entry.name.endsWith('.tsx') || entry.name.endsWith('.ts')) &&
|
|
65
|
+
!entry.name.includes('.test.')
|
|
66
|
+
) {
|
|
64
67
|
const text = fs.readFileSync(full, 'utf8');
|
|
65
68
|
for (const re of [
|
|
66
69
|
/themeProps\(\s*'([^']+)'/g,
|
|
@@ -71,6 +74,16 @@ function renderedClassLiterals() {
|
|
|
71
74
|
classes.add(m[1]);
|
|
72
75
|
}
|
|
73
76
|
}
|
|
77
|
+
// Renamed targets emit their old name too, via themeProps'
|
|
78
|
+
// `legacyNames`. Those classes are just as rendered as the primary
|
|
79
|
+
// one, so a doc entry for the old name is still backed by real output.
|
|
80
|
+
const legacyRe = /legacyNames:\s*\[([^\]]*)\]/g;
|
|
81
|
+
let lm;
|
|
82
|
+
while ((lm = legacyRe.exec(text)) !== null) {
|
|
83
|
+
for (const nm of lm[1].matchAll(/'([^']+)'/g)) {
|
|
84
|
+
classes.add(nm[1]);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
74
87
|
}
|
|
75
88
|
}
|
|
76
89
|
};
|
|
@@ -17,7 +17,7 @@ export const doc = {
|
|
|
17
17
|
'Build a page: composition kit for an idea, or the workflow playbook (no args)',
|
|
18
18
|
description:
|
|
19
19
|
'The assemble-a-page entry point. With no query it returns the how-to-build-a-page ' +
|
|
20
|
-
'playbook; with a query it groups the unified search hits into a composition kit
|
|
20
|
+
'playbook; with a query it groups the unified search hits into a composition kit: ' +
|
|
21
21
|
'the closest templates, drop-in blocks, and idea-specific components and hooks.',
|
|
22
22
|
fn: 'build',
|
|
23
23
|
args: [{name: 'query', param: 'query', required: false}],
|
|
@@ -69,7 +69,7 @@ export const doc = {
|
|
|
69
69
|
{code: 0, when: 'success'},
|
|
70
70
|
{
|
|
71
71
|
code: 1,
|
|
72
|
-
when: 'unknown component, category, or package
|
|
72
|
+
when: 'unknown component, category, or package, or @astryxdesign/core cannot be resolved',
|
|
73
73
|
},
|
|
74
74
|
],
|
|
75
75
|
related: ['search', 'hook', 'docs', 'template', 'swizzle'],
|
|
@@ -15,8 +15,8 @@ export const doc = {
|
|
|
15
15
|
namespace: 'cli',
|
|
16
16
|
summary: 'Diagnose your XDS setup and report problems with fixes',
|
|
17
17
|
description:
|
|
18
|
-
'Runs read-only diagnostics
|
|
19
|
-
'alignment, installed themes, config validity, agent docs, and the package manager
|
|
18
|
+
'Runs read-only diagnostics: Node version, @astryxdesign/core install and version ' +
|
|
19
|
+
'alignment, installed themes, config validity, agent docs, and the package manager, ' +
|
|
20
20
|
'and reports pass/warn/fail with an actionable fix for each problem. Safe as a CI gate.',
|
|
21
21
|
fn: 'doctor',
|
|
22
22
|
examples: [
|
|
@@ -17,7 +17,7 @@ export const doc = {
|
|
|
17
17
|
summary: 'Expand a layout expression into validated XDS TSX',
|
|
18
18
|
description:
|
|
19
19
|
'Parses and validates a compressed XLE/XLO expression, then expands it into ' +
|
|
20
|
-
'ready-to-use XDS TSX
|
|
20
|
+
'ready-to-use XDS TSX, routing children into slots, scaffolding typed useState for ' +
|
|
21
21
|
'interactive controls, and splicing referenced blocks. Writes to a path, or returns the code.',
|
|
22
22
|
fn: 'layoutExpand',
|
|
23
23
|
args: [
|
|
@@ -16,7 +16,7 @@ export const doc = {
|
|
|
16
16
|
summary: 'Generate XDS layouts from compressed expressions (XLE/XLO)',
|
|
17
17
|
description:
|
|
18
18
|
'The layout command group. Running astryx layout with no subcommand prints the ' +
|
|
19
|
-
'subcommand list; the work happens in the subcommands
|
|
19
|
+
'subcommand list; the work happens in the subcommands: expand an expression into ' +
|
|
20
20
|
'TSX (expand), validate one (check), or print the grammar cheatsheet (grammar).',
|
|
21
21
|
subcommands: ['expand', 'check', 'grammar'],
|
|
22
22
|
examples: [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @file CommandDoc for `astryx manifest`. A CLI-only capability manifest with no
|
|
5
5
|
* wrapped API function (so no `fn`); it emits the full command surface — args,
|
|
6
|
-
* flags, subcommands, and JSON response types
|
|
6
|
+
* flags, subcommands, and JSON response types, as a single typed envelope.
|
|
7
7
|
* @position packages/cli/clients/cli/commands — command documentation
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -15,8 +15,8 @@ export const doc = {
|
|
|
15
15
|
namespace: 'cli',
|
|
16
16
|
summary: 'Print the full CLI capability manifest (use with --json).',
|
|
17
17
|
description:
|
|
18
|
-
'Emits the complete CLI surface
|
|
19
|
-
'subcommands, and JSON response types
|
|
18
|
+
'Emits the complete CLI surface: every command with its arguments, options, ' +
|
|
19
|
+
'subcommands, and JSON response types, as a single typed envelope for agents and ' +
|
|
20
20
|
'tooling to introspect. Intended to be run with --json.',
|
|
21
21
|
examples: [
|
|
22
22
|
{label: 'Full manifest', cli: 'astryx manifest --json'},
|
|
@@ -15,7 +15,7 @@ export const doc = {
|
|
|
15
15
|
namespace: 'cli',
|
|
16
16
|
summary: 'Search components, hooks, docs, and templates in one ranked list',
|
|
17
17
|
description:
|
|
18
|
-
'Terminal front-end to search()
|
|
18
|
+
'Terminal front-end to search(): prints one ranked, greppable list across ' +
|
|
19
19
|
'every content domain, each row carrying a follow-up command to act on it.',
|
|
20
20
|
fn: 'search',
|
|
21
21
|
args: [{name: 'query', param: 'query', required: true}],
|
|
@@ -16,7 +16,7 @@ export const doc = {
|
|
|
16
16
|
namespace: 'cli',
|
|
17
17
|
summary: 'Scaffold a theme into your project as editable source',
|
|
18
18
|
description:
|
|
19
|
-
"Copies a bundled theme's source into your project so you own it
|
|
19
|
+
"Copies a bundled theme's source into your project so you own it, no theme package " +
|
|
20
20
|
'needed. Writes are staged then renamed, rolling back on failure. Running it with no ' +
|
|
21
21
|
'slug, or with --list, lists the bundled themes instead.',
|
|
22
22
|
fn: 'themeAdd',
|
|
@@ -17,7 +17,7 @@ export const doc = {
|
|
|
17
17
|
summary: 'Compile a defineTheme file to CSS + JS',
|
|
18
18
|
description:
|
|
19
19
|
'Compiles a file that calls defineTheme() into a scoped CSS file, a JS module, and ' +
|
|
20
|
-
'type declarations
|
|
20
|
+
'type declarations: the exact CSS the <Theme> runtime emits. With --check it writes ' +
|
|
21
21
|
'nothing and instead reports whether the committed outputs have drifted from source.',
|
|
22
22
|
fn: 'themeBuild',
|
|
23
23
|
args: [{name: 'file', param: 'file', required: true}],
|
|
@@ -16,7 +16,7 @@ export const doc = {
|
|
|
16
16
|
namespace: 'cli',
|
|
17
17
|
summary: 'List themes available to add',
|
|
18
18
|
description:
|
|
19
|
-
'Lists the themes bundled with this CLI build
|
|
19
|
+
'Lists the themes bundled with this CLI build (the ones theme add can scaffold), ' +
|
|
20
20
|
'each with its slug, display name, description, and maintained flag.',
|
|
21
21
|
fn: 'themeList',
|
|
22
22
|
examples: [{label: 'List bundled themes', cli: 'astryx theme list --json'}],
|
|
@@ -13,10 +13,10 @@ export const doc = {
|
|
|
13
13
|
name: 'theme',
|
|
14
14
|
displayName: 'astryx theme',
|
|
15
15
|
namespace: 'cli',
|
|
16
|
-
summary: 'Theme tools
|
|
16
|
+
summary: 'Theme tools: build, export, and manage themes',
|
|
17
17
|
description:
|
|
18
18
|
'The theme command group. Running astryx theme with no subcommand prints the ' +
|
|
19
|
-
'subcommand list; the work happens in the subcommands
|
|
19
|
+
'subcommand list; the work happens in the subcommands: compile a theme (build), ' +
|
|
20
20
|
'scaffold one into your project (add), or list the bundled themes (list).',
|
|
21
21
|
subcommands: ['build', 'add', 'list'],
|
|
22
22
|
examples: [
|
|
@@ -16,8 +16,8 @@ export const doc = {
|
|
|
16
16
|
namespace: 'cli',
|
|
17
17
|
summary: 'Validate an Astryx integration package (manifest + contributions)',
|
|
18
18
|
description:
|
|
19
|
-
'Validates ONE integration at a time
|
|
20
|
-
'installed package resolved by name
|
|
19
|
+
'Validates ONE integration at a time: the local package rooted at cwd, or an ' +
|
|
20
|
+
'installed package resolved by name, schema-checking its manifest, verifying each ' +
|
|
21
21
|
'declared contribution root, and reporting every finding. Safe as a CI gate.',
|
|
22
22
|
fn: 'validateIntegration',
|
|
23
23
|
args: [{name: 'package', param: 'pkg', required: false}],
|
|
@@ -341,10 +341,9 @@ export function generateCompressedIndex(version, {coreDir, invocation = getCliIn
|
|
|
341
341
|
|
|
342
342
|
// Rules — the top error-preventers.
|
|
343
343
|
lines.push('RULES:');
|
|
344
|
-
lines.push('- No <div> — components do all layout/spacing
|
|
345
|
-
lines.push('- Frame first:
|
|
346
|
-
lines.push('- Dense data = rows (Table, List/Item)
|
|
347
|
-
lines.push('- Status → StatusDot/Token; Badge only for counts and enumerated states, never decoration.');
|
|
344
|
+
lines.push('- No <div> — components do all layout/spacing, page frame included.');
|
|
345
|
+
lines.push('- Frame first: read `astryx docs layout` before writing any page or screen — page frame, region widths, breakpoint behavior.');
|
|
346
|
+
lines.push('- Dense data = rows (Table, List/Item), never Card-wrapped list items; Card is for standalone widgets. Status = StatusDot/Token; Badge = counts only.');
|
|
348
347
|
// Styling guidance tailored to the project's configured system — never
|
|
349
348
|
// recommend a path that isn't compiled here (xstyle needs the StyleX compiler;
|
|
350
349
|
// utilities need Tailwind). Tokens are always the source of truth.
|
|
@@ -46,6 +46,14 @@ describe('generateCompressedIndex', () => {
|
|
|
46
46
|
expect(result).toMatch(/never override --color-/);
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
+
it('sends frame choice to the layout doc rather than naming a shell', () => {
|
|
50
|
+
const result = generateCompressedIndex('1.0.0');
|
|
51
|
+
const frameRule = result.split('\n').find(l => l.includes('Frame first'));
|
|
52
|
+
expect(frameRule).toContain('astryx docs layout');
|
|
53
|
+
expect(result).not.toMatch(/AppShell/);
|
|
54
|
+
expect(frameRule).not.toMatch(/https?:/);
|
|
55
|
+
});
|
|
56
|
+
|
|
49
57
|
it('includes the post-generation self-check rule', () => {
|
|
50
58
|
const result = generateCompressedIndex('1.0.0');
|
|
51
59
|
expect(result).toContain('SELF-CHECK before you finish');
|
|
@@ -11,11 +11,14 @@ export function pkgOf(t: {
|
|
|
11
11
|
package?: string;
|
|
12
12
|
}): string;
|
|
13
13
|
/**
|
|
14
|
-
* Replace demo
|
|
15
|
-
*
|
|
14
|
+
* Replace demo asset references with a placeholder so scaffolded pages
|
|
15
|
+
* render with zero setup. Images get a self-contained data URI; videos
|
|
16
|
+
* (which have no equivalent inline placeholder — see VIDEO_EXTENSIONS) are
|
|
17
|
+
* stripped to an empty src instead of being mis-replaced with image data.
|
|
18
|
+
* Builders drop in their own media either way.
|
|
16
19
|
*
|
|
17
20
|
* @param {string} source - Template source code.
|
|
18
|
-
* @returns {string} Source with demo
|
|
21
|
+
* @returns {string} Source with demo asset references replaced.
|
|
19
22
|
*/
|
|
20
23
|
export function stripTemplateAssetRefs(source: string): string;
|
|
21
24
|
/**
|
|
@@ -153,15 +153,33 @@ const PLACEHOLDER_IMAGE =
|
|
|
153
153
|
'data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20400%20300%22%20preserveAspectRatio%3D%22xMidYMid%20slice%22%3E%3Crect%20width%3D%22400%22%20height%3D%22300%22%20fill%3D%22%23f5f6f8%22%2F%3E%3Cg%20transform%3D%22translate%28200%20150%29%22%20fill%3D%22none%22%20stroke%3D%22%23c2cad6%22%20stroke-width%3D%225%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%22-44%22%20y%3D%22-44%22%20width%3D%2288%22%20height%3D%2288%22%20rx%3D%2216%22%2F%3E%3Ccircle%20cx%3D%2218%22%20cy%3D%22-18%22%20r%3D%222.5%22%20fill%3D%22%23c2cad6%22%20stroke%3D%22none%22%2F%3E%3Cpath%20d%3D%22M-34%2030%20L-8%200%20L10%2018%20L20%208%20L34%2024%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E';
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
|
-
*
|
|
157
|
-
* (
|
|
158
|
-
*
|
|
156
|
+
* Extensions that need a video-safe placeholder rather than the image data
|
|
157
|
+
* URI (see stripTemplateAssetRefs). There's no equivalent self-contained
|
|
158
|
+
* inline placeholder for video: unlike an SVG data URI, a `<video src>`
|
|
159
|
+
* needs actual encoded media, and hand-authoring a valid tiny MP4/WebM
|
|
160
|
+
* blob isn't something we can do reliably here — an unverifiable, possibly
|
|
161
|
+
* still-broken binary would just trade one silent failure for another.
|
|
162
|
+
* Rather than mis-render image data as video (the original bug) or guess at
|
|
163
|
+
* binary bytes, video sources are stripped to an empty string so the
|
|
164
|
+
* scaffolded example is honest about needing the builder to supply their
|
|
165
|
+
* own file, instead of silently pointing at something that can't play.
|
|
159
166
|
*
|
|
160
|
-
* @type {
|
|
167
|
+
* @type {Set<string>}
|
|
161
168
|
*/
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
169
|
+
const VIDEO_EXTENSIONS = new Set(['mp4', 'webm', 'mov', 'ogv']);
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Demo-asset sources to strip from scaffolded projects. Template demo imagery
|
|
173
|
+
* is self-hosted under the docsite's `/template-assets/*` dir (committed there,
|
|
174
|
+
* mirrored into the sandbox preview by scripts/sync-templates.js). Those paths
|
|
175
|
+
* only resolve inside the Astryx docsite/sandbox, so on scaffold they're
|
|
176
|
+
* replaced — a scaffolded project has no `/template-assets/` dir and would
|
|
177
|
+
* otherwise 404. Genuine third-party URLs (e.g. brand logos from
|
|
178
|
+
* paypalobjects.com) are intentionally left untouched.
|
|
179
|
+
*
|
|
180
|
+
* @type {RegExp}
|
|
181
|
+
*/
|
|
182
|
+
const DEMO_ASSET_PATTERN = /\/template-assets\/[\w-]+\.(\w+)/g;
|
|
165
183
|
|
|
166
184
|
/**
|
|
167
185
|
* Normalize path into Unix path (using forward slashes) for consistent comparison
|
|
@@ -175,16 +193,18 @@ function toPosixPath(p) {
|
|
|
175
193
|
}
|
|
176
194
|
|
|
177
195
|
/**
|
|
178
|
-
* Replace demo
|
|
179
|
-
*
|
|
196
|
+
* Replace demo asset references with a placeholder so scaffolded pages
|
|
197
|
+
* render with zero setup. Images get a self-contained data URI; videos
|
|
198
|
+
* (which have no equivalent inline placeholder — see VIDEO_EXTENSIONS) are
|
|
199
|
+
* stripped to an empty src instead of being mis-replaced with image data.
|
|
200
|
+
* Builders drop in their own media either way.
|
|
180
201
|
*
|
|
181
202
|
* @param {string} source - Template source code.
|
|
182
|
-
* @returns {string} Source with demo
|
|
203
|
+
* @returns {string} Source with demo asset references replaced.
|
|
183
204
|
*/
|
|
184
205
|
export function stripTemplateAssetRefs(source) {
|
|
185
|
-
return
|
|
186
|
-
(
|
|
187
|
-
source,
|
|
206
|
+
return source.replace(DEMO_ASSET_PATTERN, (match, extension) =>
|
|
207
|
+
VIDEO_EXTENSIONS.has(extension.toLowerCase()) ? '' : PLACEHOLDER_IMAGE,
|
|
188
208
|
);
|
|
189
209
|
}
|
|
190
210
|
/**
|
|
@@ -21,7 +21,7 @@ export const doc = {
|
|
|
21
21
|
{
|
|
22
22
|
value: 'component.list',
|
|
23
23
|
description:
|
|
24
|
-
'The component catalog grouped by category: `detail` (the level
|
|
24
|
+
'The component catalog grouped by category: `detail` (the level: names | compact | full) and `components`, the grouped map of names+package, brief entries, or a full ComponentDoc per entry.',
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
value: 'component.detail',
|
|
@@ -61,14 +61,14 @@ export const doc = {
|
|
|
61
61
|
{
|
|
62
62
|
value: 'docs.detail.section',
|
|
63
63
|
description:
|
|
64
|
-
'A single ReferenceSection of a topic
|
|
64
|
+
'A single ReferenceSection of a topic: the first whose title contains the section query.',
|
|
65
65
|
},
|
|
66
66
|
|
|
67
67
|
// blog (read from the published RSS feed)
|
|
68
68
|
{
|
|
69
69
|
value: 'blog.list',
|
|
70
70
|
description:
|
|
71
|
-
'The feed URL plus every post parsed from the RSS feed
|
|
71
|
+
'The feed URL plus every post parsed from the RSS feed, each with slug, title, description, date, type, authors, link, and plaintext URL.',
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
value: 'blog.detail',
|
|
@@ -89,7 +89,7 @@ export const doc = {
|
|
|
89
89
|
{
|
|
90
90
|
value: 'discover.detail.doc',
|
|
91
91
|
description:
|
|
92
|
-
'The validated ComponentDoc for one external component
|
|
92
|
+
'The validated ComponentDoc for one external component: an @scope/name/Component query, or a free-text term resolving to exactly one component.',
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
value: 'discover.search',
|
|
@@ -154,7 +154,7 @@ export const doc = {
|
|
|
154
154
|
{
|
|
155
155
|
value: 'hook.list',
|
|
156
156
|
description:
|
|
157
|
-
'The hook catalog grouped by category: `detail` (the level
|
|
157
|
+
'The hook catalog grouped by category: `detail` (the level: names | compact | full) and `components`, the grouped map of hook names, brief entries, or a full HookDoc per entry.',
|
|
158
158
|
},
|
|
159
159
|
{value: 'hook.detail', description: "One hook's full authored HookDoc."},
|
|
160
160
|
{
|
|
@@ -176,7 +176,7 @@ export const doc = {
|
|
|
176
176
|
{
|
|
177
177
|
value: 'theme.list',
|
|
178
178
|
description:
|
|
179
|
-
'Every bundled theme as a ThemeListEntry[]
|
|
179
|
+
'Every bundled theme as a ThemeListEntry[]: each with slug, displayName, description, and a maintained flag.',
|
|
180
180
|
},
|
|
181
181
|
{
|
|
182
182
|
value: 'theme.add',
|
|
@@ -193,7 +193,7 @@ export const doc = {
|
|
|
193
193
|
{
|
|
194
194
|
value: 'upgrade.status',
|
|
195
195
|
description:
|
|
196
|
-
'A short-circuit outcome with no codemods run
|
|
196
|
+
'A short-circuit outcome with no codemods run (up_to_date, no_codemods, or config_fixable), each carrying the agent-docs summary.',
|
|
197
197
|
},
|
|
198
198
|
{
|
|
199
199
|
value: 'upgrade.run',
|
|
@@ -47,7 +47,7 @@ export const doc = {
|
|
|
47
47
|
name: 'data',
|
|
48
48
|
type: 'unknown',
|
|
49
49
|
description:
|
|
50
|
-
"The command's payload. Structural by design
|
|
50
|
+
"The command's payload. Structural by design, narrowed by the " +
|
|
51
51
|
'per-command return type, not by a map in the serializer.',
|
|
52
52
|
required: true,
|
|
53
53
|
},
|
|
@@ -63,7 +63,7 @@ export const doc = {
|
|
|
63
63
|
name: 'Error envelope',
|
|
64
64
|
type: '{ apiVersion: number; error: string; code: ErrorCode; suggestions?: Suggestion[] }',
|
|
65
65
|
description:
|
|
66
|
-
'Emitted for every failure in --json mode
|
|
66
|
+
'Emitted for every failure in --json mode, including uncaught throws ' +
|
|
67
67
|
'and Commander parse errors, which are converted to this shape.',
|
|
68
68
|
fields: [
|
|
69
69
|
{
|
|
@@ -86,7 +86,7 @@ export const doc = {
|
|
|
86
86
|
name: 'code',
|
|
87
87
|
type: 'ErrorCode',
|
|
88
88
|
description:
|
|
89
|
-
'Stable, machine-readable identifier
|
|
89
|
+
'Stable, machine-readable identifier; always present, append-only, ' +
|
|
90
90
|
'and never changes meaning. Branch on this.',
|
|
91
91
|
required: true,
|
|
92
92
|
example: "'ERR_UNKNOWN_COMPONENT'",
|
|
@@ -95,7 +95,7 @@ export const doc = {
|
|
|
95
95
|
name: 'suggestions',
|
|
96
96
|
type: 'Suggestion[]',
|
|
97
97
|
description:
|
|
98
|
-
'Optional "did you mean
|
|
98
|
+
'Optional "did you mean..." hints, present only when candidates exist.',
|
|
99
99
|
fields: [
|
|
100
100
|
{
|
|
101
101
|
name: 'suggestions[].name',
|
|
@@ -146,7 +146,7 @@ export const doc = {
|
|
|
146
146
|
{
|
|
147
147
|
type: 'prose',
|
|
148
148
|
text:
|
|
149
|
-
'`code` is the stable contract
|
|
149
|
+
'`code` is the stable contract; see the error-codes enum (ErrorCode) ' +
|
|
150
150
|
'for the full append-only list. Branch on `code`, never on the `error` ' +
|
|
151
151
|
'prose, which can be reworded or localized at any time.',
|
|
152
152
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.3.0-canary.
|
|
3
|
+
"version": "0.3.0-canary.fcbc342",
|
|
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",
|
|
@@ -84,10 +84,10 @@
|
|
|
84
84
|
"zod": "^4.4.3"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@astryxdesign/charts": "0.3.0-canary.
|
|
88
|
-
"@astryxdesign/core": "0.3.0-canary.
|
|
89
|
-
"@astryxdesign/lab": "0.3.0-canary.
|
|
90
|
-
"@astryxdesign/theme-neutral": "0.3.0-canary.
|
|
87
|
+
"@astryxdesign/charts": "0.3.0-canary.fcbc342",
|
|
88
|
+
"@astryxdesign/core": "0.3.0-canary.fcbc342",
|
|
89
|
+
"@astryxdesign/lab": "0.3.0-canary.fcbc342",
|
|
90
|
+
"@astryxdesign/theme-neutral": "0.3.0-canary.fcbc342",
|
|
91
91
|
"gpt-tokenizer": "^3.4.0"
|
|
92
92
|
},
|
|
93
93
|
"peerDependenciesMeta": {
|
|
@@ -105,10 +105,10 @@
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
|
-
"@astryxdesign/charts": "0.3.0-canary.
|
|
109
|
-
"@astryxdesign/core": "0.3.0-canary.
|
|
110
|
-
"@astryxdesign/lab": "0.3.0-canary.
|
|
111
|
-
"@astryxdesign/theme-neutral": "0.3.0-canary.
|
|
108
|
+
"@astryxdesign/charts": "0.3.0-canary.fcbc342",
|
|
109
|
+
"@astryxdesign/core": "0.3.0-canary.fcbc342",
|
|
110
|
+
"@astryxdesign/lab": "0.3.0-canary.fcbc342",
|
|
111
|
+
"@astryxdesign/theme-neutral": "0.3.0-canary.fcbc342",
|
|
112
112
|
"gpt-tokenizer": "^3.4.0"
|
|
113
113
|
},
|
|
114
114
|
"scripts": {
|