@astryxdesign/cli 0.6.6-canary.349c479 → 0.6.6-canary.5b5b76f
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 +21 -21
- package/api/build/help/help.mjs +1 -1
- package/api/doctor/theme-checks.mjs +1 -1
- package/api/init/run/run.mjs +1 -0
- package/api/layout/check/check.d.mts +1 -0
- package/api/layout/check/check.mjs +1 -0
- package/api/layout/expand/expand.d.mts +1 -0
- package/api/layout/expand/expand.mjs +1 -0
- package/api/layout/grammar/grammar.d.mts +1 -0
- package/api/layout/grammar/grammar.mjs +1 -0
- 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/theme/build/build.mjs +2 -0
- package/assets/docs/author-a-theme.doc.mjs +1 -1
- package/assets/docs/theme.doc.dense.mjs +1 -1
- package/clients/cli/commands/build-theme.mjs +4 -2
- package/clients/cli/commands/layout-check.doc.mjs +1 -0
- package/clients/cli/commands/layout-expand.doc.mjs +1 -0
- package/clients/cli/commands/layout-grammar.doc.mjs +1 -0
- package/clients/cli/commands/layout.deprecation-lifecycle.test.mjs +140 -0
- package/clients/cli/commands/layout.doc.mjs +1 -0
- package/clients/cli/commands/layout.mjs +6 -11
- package/clients/cli/lib/define-command.mjs +4 -0
- package/foundation/response/response-types.doc.mjs +3 -3
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -78,24 +78,24 @@ Options:
|
|
|
78
78
|
|
|
79
79
|
<!-- BEGIN GENERATED: commands -->
|
|
80
80
|
|
|
81
|
-
| Command | Description
|
|
82
|
-
| ------------- |
|
|
83
|
-
| `blog` | Read the Astryx blog from the published feed
|
|
84
|
-
| `build` | Build a page: the template to start from, or the workflow playbook (no query)
|
|
85
|
-
| `component` | List components or print component docs
|
|
86
|
-
| `discover` | Browse and search integrations: the ones you have and the ones you could add
|
|
87
|
-
| `docs` | Print reference docs
|
|
88
|
-
| `doctor` | Diagnose Astryx projects and integration packages
|
|
89
|
-
| `gap-report` | Report a missing component or feature to the package that owns it
|
|
90
|
-
| `hook` | List hooks or print hook docs
|
|
91
|
-
| `init` | Initialize the design system in your project
|
|
92
|
-
| `integration` | Author and verify an Astryx integration package
|
|
93
|
-
| `layout` | Generate XDS layouts from compressed expressions (XLE/XLO)
|
|
94
|
-
| `search` | Search components, hooks, docs, templates, and themes in one ranked list
|
|
95
|
-
| `swizzle` | Copy component source for customization
|
|
96
|
-
| `template` | List, show, or scaffold page and block templates
|
|
97
|
-
| `theme` | Add, switch, build, and author themes
|
|
98
|
-
| `upgrade` | Update your code after upgrading Astryx, and refresh ShadCN-copied components
|
|
81
|
+
| Command | Description |
|
|
82
|
+
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
83
|
+
| `blog` | Read the Astryx blog from the published feed |
|
|
84
|
+
| `build` | Build a page: the template to start from, or the workflow playbook (no query) |
|
|
85
|
+
| `component` | List components or print component docs |
|
|
86
|
+
| `discover` | Browse and search integrations: the ones you have and the ones you could add |
|
|
87
|
+
| `docs` | Print reference docs |
|
|
88
|
+
| `doctor` | Diagnose Astryx projects and integration packages |
|
|
89
|
+
| `gap-report` | Report a missing component or feature to the package that owns it |
|
|
90
|
+
| `hook` | List hooks or print hook docs |
|
|
91
|
+
| `init` | Initialize the design system in your project |
|
|
92
|
+
| `integration` | Author and verify an Astryx integration package |
|
|
93
|
+
| `layout` | Generate XDS layouts from compressed expressions (XLE/XLO) [DEPRECATED: DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.] |
|
|
94
|
+
| `search` | Search components, hooks, docs, templates, and themes in one ranked list |
|
|
95
|
+
| `swizzle` | Copy component source for customization |
|
|
96
|
+
| `template` | List, show, or scaffold page and block templates |
|
|
97
|
+
| `theme` | Add, switch, build, and author themes |
|
|
98
|
+
| `upgrade` | Update your code after upgrading Astryx, and refresh ShadCN-copied components |
|
|
99
99
|
|
|
100
100
|
<!-- END GENERATED: commands -->
|
|
101
101
|
<!-- Generated by scripts/generate-cli-readme.mjs from `astryx manifest`. Run `pnpm -F @astryxdesign/cli readme`. -->
|
|
@@ -482,9 +482,9 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
482
482
|
| `integration.template-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking Core template-id conflicts as {id, severity: warning, integrationPackage, integrationType, integrationName, coreMatches, message, command}. |
|
|
483
483
|
| `integration.component-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command. |
|
|
484
484
|
| `integration.doc-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` \| `error`) and `relationship` (`replaces` \| `extends` \| `accidental`). |
|
|
485
|
-
| `layout.expand` | The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, written (the output path, or null when nothing was written), and demoMediaReplaced (count of demo media placeholders).
|
|
486
|
-
| `layout.check` | The validation result: a valid flag, the detected form, errors (each with line/col, message, formatted text, and suggestions), warnings, and the expression re-printed in both canonical surfaces (compact and outline).
|
|
487
|
-
| `layout.grammar` | The XLE/XLO grammar cheatsheet: a text field with the full reference plus an aliases map (short name → canonical component) generated from this install's registry.
|
|
485
|
+
| `layout.expand` | The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, written (the output path, or null when nothing was written), and demoMediaReplaced (count of demo media placeholders). Carries `meta.deprecations` with DEP-0006 and its replacement commands. |
|
|
486
|
+
| `layout.check` | The validation result: a valid flag, the detected form, errors (each with line/col, message, formatted text, and suggestions), warnings, and the expression re-printed in both canonical surfaces (compact and outline). Carries `meta.deprecations` with DEP-0006 and its replacement commands. |
|
|
487
|
+
| `layout.grammar` | The XLE/XLO grammar cheatsheet: a text field with the full reference plus an aliases map (short name → canonical component) generated from this install's registry. Carries `meta.deprecations` with DEP-0006 and its replacement commands. |
|
|
488
488
|
|
|
489
489
|
<!-- END GENERATED: response-types -->
|
|
490
490
|
<!-- Generated by scripts/generate-cli-readme.mjs from the response-types EnumDoc. Run `pnpm -F @astryxdesign/cli readme`. -->
|
package/api/build/help/help.mjs
CHANGED
|
@@ -63,7 +63,7 @@ export function buildHelp() {
|
|
|
63
63
|
"Keep the template's page frame, gap, and padding values. Replace its data, copy, and sections.",
|
|
64
64
|
'No <div>/raw HTML for layout — use VStack/HStack/Grid/Stack/Card etc.',
|
|
65
65
|
'No style={{}} — use component props, and design tokens for values.',
|
|
66
|
-
|
|
66
|
+
"Wrap the app in <Theme theme={...}> (import {Theme} from '@astryxdesign/core') and import core reset.css + astryx.css.",
|
|
67
67
|
],
|
|
68
68
|
related: [
|
|
69
69
|
{
|
|
@@ -736,7 +736,7 @@ export async function checkAppThemes(cwd) {
|
|
|
736
736
|
label: 'App imports the theme module',
|
|
737
737
|
status: 'warn',
|
|
738
738
|
message: `Could not prove that project source imports ${state.module.path}${importEvidence.parseFailures ? `; ${importEvidence.parseFailures} source file(s) could not be parsed` : ''}.`,
|
|
739
|
-
fix: `Import {themes, defaultThemeSlug} from the generated module and render <Theme theme={themes[defaultThemeSlug]}>.`,
|
|
739
|
+
fix: `Import {themes, defaultThemeSlug} from the generated module and {Theme} from '@astryxdesign/core', then render <Theme theme={themes[defaultThemeSlug]}>.`,
|
|
740
740
|
});
|
|
741
741
|
}
|
|
742
742
|
|
package/api/init/run/run.mjs
CHANGED
|
@@ -54,6 +54,7 @@ export function getNextSteps(invocation) {
|
|
|
54
54
|
' 4. Add and wire a theme:',
|
|
55
55
|
' npm install @astryxdesign/theme-neutral',
|
|
56
56
|
` ${invocation} theme add neutral --import`,
|
|
57
|
+
" import { Theme } from '@astryxdesign/core'",
|
|
57
58
|
" import { themes, defaultThemeSlug } from './astryx-themes'",
|
|
58
59
|
' <Theme theme={themes[defaultThemeSlug]}>...</Theme>',
|
|
59
60
|
` Extend an imported theme to customize it. Run \`${invocation} theme eject <slug>\` only to fork source.`,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
+
* @deprecated DEP-0006: Use `build`, `template`, and `docs layout` instead. Removal in CLN-0006.
|
|
5
6
|
* `astryx layout check "<expr>" [--form compact|outline]`
|
|
6
7
|
* Validates without expanding; echoes both canonical surfaces.
|
|
7
8
|
*
|
|
@@ -15,6 +15,7 @@ import {toCompact, toOutline} from '../../../foundation/xle/print.mjs';
|
|
|
15
15
|
import {analyze, formatIssue} from '../_adapter.mjs';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
+
* @deprecated DEP-0006: Use `build`, `template`, and `docs layout` instead. Removal in CLN-0006.
|
|
18
19
|
* `astryx layout check "<expr>" [--form compact|outline]`
|
|
19
20
|
* Validates without expanding; echoes both canonical surfaces.
|
|
20
21
|
*
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
+
* @deprecated DEP-0006: Use `build`, `template`, and `docs layout` instead. Removal in CLN-0006.
|
|
5
6
|
* `astryx layout grammar` — the agent cheatsheet, with the alias table
|
|
6
7
|
* generated from this branch's registry (never hand-maintained).
|
|
7
8
|
*
|
|
@@ -13,6 +13,7 @@ import {buildRegistry} from '../../../foundation/xle/registry.mjs';
|
|
|
13
13
|
import {MAX_REPEAT} from '../../../foundation/xle/expand.mjs';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
+
* @deprecated DEP-0006: Use `build`, `template`, and `docs layout` instead. Removal in CLN-0006.
|
|
16
17
|
* `astryx layout grammar` — the agent cheatsheet, with the alias table
|
|
17
18
|
* generated from this branch's registry (never hand-maintained).
|
|
18
19
|
*
|
|
@@ -20,7 +20,7 @@ export const doc = {
|
|
|
20
20
|
'expression without generating any TSX, and echoes it back in both canonical surfaces ' +
|
|
21
21
|
'(compact and outline). Validation failures are reported in the layout.check envelope ' +
|
|
22
22
|
'(valid: false) with line/col and suggestions (not thrown) so callers can lint an ' +
|
|
23
|
-
'expression and surface fixes.',
|
|
23
|
+
'expression and surface fixes. **Deprecated (DEP-0006).** Use `build`, `template`, and `docs layout` instead. This function will be removed in a future minor release.',
|
|
24
24
|
importPath: '@astryxdesign/cli/api',
|
|
25
25
|
signature:
|
|
26
26
|
'layoutCheck(expression: string, options?: LayoutCheckOptions): Promise<LayoutCheckResponse>',
|
|
@@ -20,7 +20,7 @@ export const doc = {
|
|
|
20
20
|
'expression, then expands it into ready-to-use XDS TSX, auto-routing structural children ' +
|
|
21
21
|
'into the right slots, scaffolding typed useState for interactive controls, and splicing or ' +
|
|
22
22
|
'importing any referenced template blocks. Returns the code (and metadata) in a layout.expand ' +
|
|
23
|
-
'envelope, optionally writing it to a path within cwd.',
|
|
23
|
+
'envelope, optionally writing it to a path within cwd. **Deprecated (DEP-0006).** Use `build`, `template`, and `docs layout` instead. This function will be removed in a future minor release.',
|
|
24
24
|
importPath: '@astryxdesign/cli/api',
|
|
25
25
|
signature:
|
|
26
26
|
'layoutExpand(expression: string, options?: LayoutExpandOptions): Promise<LayoutExpandResponse>',
|
|
@@ -18,7 +18,7 @@ export const doc = {
|
|
|
18
18
|
description:
|
|
19
19
|
'The reference behind `astryx layout grammar`: the agent cheatsheet for writing XLE/XLO ' +
|
|
20
20
|
"layout expressions, with the alias table generated from this branch's registry rather than " +
|
|
21
|
-
'hand-maintained, so short names always reflect the components actually installed.',
|
|
21
|
+
'hand-maintained, so short names always reflect the components actually installed. **Deprecated (DEP-0006).** Use `build`, `template`, and `docs layout` instead. This function will be removed in a future minor release.',
|
|
22
22
|
importPath: '@astryxdesign/cli/api',
|
|
23
23
|
signature:
|
|
24
24
|
'layoutGrammar(options?: LayoutGrammarOptions): Promise<LayoutGrammarResponse>',
|
|
@@ -2956,6 +2956,7 @@ async function themeBuildInternal(
|
|
|
2956
2956
|
logger.log(`
|
|
2957
2957
|
Install in your app (paths are relative to a file in src/; adjust if yours lives elsewhere):
|
|
2958
2958
|
|
|
2959
|
+
import { Theme } from '@astryxdesign/core';
|
|
2959
2960
|
import { ${exportName} } from '${jsImport}';
|
|
2960
2961
|
import '${cssImport}';
|
|
2961
2962
|
|
|
@@ -2965,6 +2966,7 @@ Install in your app (paths are relative to a file in src/; adjust if yours lives
|
|
|
2965
2966
|
|
|
2966
2967
|
Or with a <link> tag:
|
|
2967
2968
|
|
|
2969
|
+
import { Theme } from '@astryxdesign/core';
|
|
2968
2970
|
import { ${exportName} } from '${jsImport}';
|
|
2969
2971
|
|
|
2970
2972
|
<link rel="stylesheet" href="${cssImport}" />
|
|
@@ -118,7 +118,7 @@ export const docs = {
|
|
|
118
118
|
['ocean.d.ts', 'TypeScript declarations for the theme and icon registry exports'],
|
|
119
119
|
['ocean.variants.d.ts', "(Optional) Module augmentations for custom component prop values"],
|
|
120
120
|
]},
|
|
121
|
-
{type: 'code', lang: 'tsx', label: 'Using a custom built theme', code: "import {oceanTheme} from './themes/ocean';\nimport './themes/ocean.css';\n\n<Theme theme={oceanTheme}>\n <App />\n</Theme>"},
|
|
121
|
+
{type: 'code', lang: 'tsx', label: 'Using a custom built theme', code: "import {Theme} from '@astryxdesign/core';\nimport {oceanTheme} from './themes/ocean';\nimport './themes/ocean.css';\n\n<Theme theme={oceanTheme}>\n <App />\n</Theme>"},
|
|
122
122
|
{type: 'prose', text: "After upgrading Astryx, rerun `astryx theme build` for every custom prebuilt theme. Deploy the regenerated files together. The build also warns when the theme names font families it does not load. See {@link generic:typography} for the full recipe."},
|
|
123
123
|
{type: 'prose', text: 'For the runtime vs built tradeoff, see the Runtime vs Built section of {@link generic:use-a-theme}.'},
|
|
124
124
|
],
|
|
@@ -9,7 +9,7 @@ export const docsDense = {
|
|
|
9
9
|
section: 'Wrap your app in a theme',
|
|
10
10
|
title: 'Quick start',
|
|
11
11
|
content: [
|
|
12
|
-
{type: 'prose', text:
|
|
12
|
+
{type: 'prose', text: "Install a theme, wrap in `<Theme>` (`import {Theme} from '@astryxdesign/core'`). {@link generic:use-a-theme} for full guide."},
|
|
13
13
|
],
|
|
14
14
|
},
|
|
15
15
|
{
|
|
@@ -361,7 +361,8 @@ function printThemeApp(result) {
|
|
|
361
361
|
emit(
|
|
362
362
|
text('Wire the generated module once in the app root:'),
|
|
363
363
|
code(
|
|
364
|
-
|
|
364
|
+
"import {Theme} from '@astryxdesign/core';\n" +
|
|
365
|
+
`import {themes, defaultThemeSlug} from './${stem}';\n\n` +
|
|
365
366
|
'<Theme theme={themes[defaultThemeSlug]}>\n <App />\n</Theme>',
|
|
366
367
|
),
|
|
367
368
|
);
|
|
@@ -823,7 +824,8 @@ export function registerTheme(program) {
|
|
|
823
824
|
'Use it in your app (import path is relative to a file in src/ — adjust if yours lives elsewhere):',
|
|
824
825
|
),
|
|
825
826
|
code(
|
|
826
|
-
|
|
827
|
+
"import { Theme } from '@astryxdesign/core';\n" +
|
|
828
|
+
`import { ${exportName} } from '${entryModule}';\n\n` +
|
|
827
829
|
`<Theme theme={${exportName}}>\n <App />\n</Theme>`,
|
|
828
830
|
),
|
|
829
831
|
text(
|
|
@@ -62,5 +62,6 @@ export const doc = {
|
|
|
62
62
|
},
|
|
63
63
|
],
|
|
64
64
|
deprecated: 'DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.',
|
|
65
|
+
notes: [{"type": "prose", "text": "**Deprecated (DEP-0006).** Use `astryx build` to choose the template to start from, `astryx template` to scaffold it, and `astryx docs layout` for layout guidance. This command will be removed in a future minor release."}],
|
|
65
66
|
related: ['layout expand', 'layout grammar'],
|
|
66
67
|
};
|
|
@@ -82,5 +82,6 @@ export const doc = {
|
|
|
82
82
|
},
|
|
83
83
|
],
|
|
84
84
|
deprecated: 'DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.',
|
|
85
|
+
notes: [{"type": "prose", "text": "**Deprecated (DEP-0006).** Use `astryx build` to choose the template to start from, `astryx template` to scaffold it, and `astryx docs layout` for layout guidance. This command will be removed in a future minor release."}],
|
|
85
86
|
related: ['layout check', 'layout grammar'],
|
|
86
87
|
};
|
|
@@ -27,5 +27,6 @@ export const doc = {
|
|
|
27
27
|
{code: 1, when: 'the component registry cannot be read'},
|
|
28
28
|
],
|
|
29
29
|
deprecated: 'DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.',
|
|
30
|
+
notes: [{"type": "prose", "text": "**Deprecated (DEP-0006).** Use `astryx build` to choose the template to start from, `astryx template` to scaffold it, and `astryx docs layout` for layout guidance. This command will be removed in a future minor release."}],
|
|
30
31
|
related: ['layout expand', 'layout check'],
|
|
31
32
|
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Deprecation lifecycle coverage for the layout command group (DEP-0006).
|
|
5
|
+
*
|
|
6
|
+
* Mirrors the DEP-0005 theme-add-lifecycle tests: pins the JSON
|
|
7
|
+
* `meta.deprecations` entry, the human-mode stderr warning, the help label,
|
|
8
|
+
* and the docs reference pages.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {describe, it, expect} from 'vitest';
|
|
12
|
+
import {runCli} from '../../../test-utils/run-cli.mjs';
|
|
13
|
+
|
|
14
|
+
const SLOW = 30_000;
|
|
15
|
+
|
|
16
|
+
describe('layout DEP-0006 lifecycle', () => {
|
|
17
|
+
it('JSON mode carries meta.deprecations with DEP-0006 and its replacements', async () => {
|
|
18
|
+
const result = await runCli(['layout', 'grammar', '--json']);
|
|
19
|
+
expect(result.status).toBe(0);
|
|
20
|
+
const envelope = JSON.parse(result.stdout);
|
|
21
|
+
expect(envelope.meta).toBeDefined();
|
|
22
|
+
expect(envelope.meta.deprecations).toEqual([
|
|
23
|
+
{
|
|
24
|
+
id: 'DEP-0006',
|
|
25
|
+
replacements: ['build', 'template', 'docs layout'],
|
|
26
|
+
},
|
|
27
|
+
]);
|
|
28
|
+
// Canonical data is unchanged
|
|
29
|
+
expect(envelope.type).toBe('layout.grammar');
|
|
30
|
+
expect(envelope.data.text).toBeDefined();
|
|
31
|
+
expect(envelope.data.aliases).toBeDefined();
|
|
32
|
+
}, SLOW);
|
|
33
|
+
|
|
34
|
+
it('human mode emits one stderr deprecation warning', async () => {
|
|
35
|
+
const result = await runCli(['layout', 'grammar']);
|
|
36
|
+
expect(result.status).toBe(0);
|
|
37
|
+
expect(result.stderr).toContain('[DEP-0006]');
|
|
38
|
+
expect(result.stderr).toContain('astryx layout is deprecated');
|
|
39
|
+
expect(result.stderr).toContain('astryx build');
|
|
40
|
+
expect(result.stderr).toContain('astryx template');
|
|
41
|
+
expect(result.stderr).toContain('astryx docs layout');
|
|
42
|
+
}, SLOW);
|
|
43
|
+
|
|
44
|
+
it('JSON mode does NOT emit the stderr warning', async () => {
|
|
45
|
+
const result = await runCli(['layout', 'grammar', '--json']);
|
|
46
|
+
expect(result.stderr).not.toContain('[DEP-0006]');
|
|
47
|
+
}, SLOW);
|
|
48
|
+
|
|
49
|
+
it('layout --help labels the command as deprecated', async () => {
|
|
50
|
+
const result = await runCli(['layout', '--help']);
|
|
51
|
+
expect(result.stdout).toContain('DEPRECATED');
|
|
52
|
+
expect(result.stdout).toContain('DEP-0006');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('layout expand --json carries the same meta.deprecations', async () => {
|
|
56
|
+
const result = await runCli([
|
|
57
|
+
'layout', 'expand', 'V[g6] > C*2', '--json',
|
|
58
|
+
]);
|
|
59
|
+
expect(result.status).toBe(0);
|
|
60
|
+
const envelope = JSON.parse(result.stdout);
|
|
61
|
+
expect(envelope.meta.deprecations).toEqual([
|
|
62
|
+
{
|
|
63
|
+
id: 'DEP-0006',
|
|
64
|
+
replacements: ['build', 'template', 'docs layout'],
|
|
65
|
+
},
|
|
66
|
+
]);
|
|
67
|
+
expect(envelope.type).toBe('layout.expand');
|
|
68
|
+
}, SLOW);
|
|
69
|
+
|
|
70
|
+
it('layout check --json carries the same meta.deprecations', async () => {
|
|
71
|
+
const result = await runCli([
|
|
72
|
+
'layout', 'check', 'V[g6] > C*2', '--json',
|
|
73
|
+
]);
|
|
74
|
+
expect(result.status).toBe(0);
|
|
75
|
+
const envelope = JSON.parse(result.stdout);
|
|
76
|
+
expect(envelope.meta.deprecations).toEqual([
|
|
77
|
+
{
|
|
78
|
+
id: 'DEP-0006',
|
|
79
|
+
replacements: ['build', 'template', 'docs layout'],
|
|
80
|
+
},
|
|
81
|
+
]);
|
|
82
|
+
expect(envelope.type).toBe('layout.check');
|
|
83
|
+
}, SLOW);
|
|
84
|
+
|
|
85
|
+
// FR29d: every reference page names DEP-0006 and the replacements.
|
|
86
|
+
// Removing the label from any single page must fail this test.
|
|
87
|
+
describe('docs reference pages name DEP-0006', () => {
|
|
88
|
+
const COMMAND_PAGES = [
|
|
89
|
+
'cli/commands/layout',
|
|
90
|
+
'cli/commands/layout-expand',
|
|
91
|
+
'cli/commands/layout-check',
|
|
92
|
+
'cli/commands/layout-grammar',
|
|
93
|
+
];
|
|
94
|
+
|
|
95
|
+
const FUNCTION_PAGES = [
|
|
96
|
+
'cli/api/functions/layout-expand',
|
|
97
|
+
'cli/api/functions/layout-check',
|
|
98
|
+
'cli/api/functions/layout-grammar',
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
for (const page of COMMAND_PAGES) {
|
|
102
|
+
it(`${page} names DEP-0006 and replacements`, async () => {
|
|
103
|
+
const result = await runCli(['docs', page, '--json']);
|
|
104
|
+
expect(result.status, result.stderr).toBe(0);
|
|
105
|
+
const body = result.stdout;
|
|
106
|
+
expect(body).toContain('DEP-0006');
|
|
107
|
+
expect(body).toContain('build');
|
|
108
|
+
expect(body).toContain('template');
|
|
109
|
+
expect(body).toContain('docs layout');
|
|
110
|
+
}, SLOW);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
for (const page of FUNCTION_PAGES) {
|
|
114
|
+
it(`${page} names DEP-0006 and replacements`, async () => {
|
|
115
|
+
const result = await runCli(['docs', page, '--json']);
|
|
116
|
+
expect(result.status, result.stderr).toBe(0);
|
|
117
|
+
const body = result.stdout;
|
|
118
|
+
expect(body).toContain('DEP-0006');
|
|
119
|
+
expect(body).toContain('build');
|
|
120
|
+
expect(body).toContain('template');
|
|
121
|
+
expect(body).toContain('docs layout');
|
|
122
|
+
}, SLOW);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('response-types reference names DEP-0006 in each layout entry description', async () => {
|
|
127
|
+
const result = await runCli(['docs', 'cli/api/enums/response-types', '--json']);
|
|
128
|
+
expect(result.status, result.stderr).toBe(0);
|
|
129
|
+
const envelope = JSON.parse(result.stdout);
|
|
130
|
+
// The enum page has a table in its content; each row is [value, description].
|
|
131
|
+
const tables = envelope.data.content.filter(b => b.type === 'table');
|
|
132
|
+
const rows = tables.flatMap(t => t.rows || []);
|
|
133
|
+
for (const type of ['layout.expand', 'layout.check', 'layout.grammar']) {
|
|
134
|
+
const row = rows.find(r => r[0] && r[0].includes(type));
|
|
135
|
+
expect(row, `${type} not found in response-types table`).toBeDefined();
|
|
136
|
+
expect(row[1], `${type} description missing DEP-0006`).toContain('DEP-0006');
|
|
137
|
+
expect(row[1], `${type} description missing replacements`).toContain('replacement');
|
|
138
|
+
}
|
|
139
|
+
}, SLOW);
|
|
140
|
+
});
|
|
@@ -31,5 +31,6 @@ export const doc = {
|
|
|
31
31
|
{code: 1, when: 'no subcommand (help is printed) or an unknown subcommand'},
|
|
32
32
|
],
|
|
33
33
|
deprecated: 'DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.',
|
|
34
|
+
notes: [{"type": "prose", "text": "**Deprecated (DEP-0006).** Use `astryx build` to choose the template to start from, `astryx template` to scaffold it, and `astryx docs layout` for layout guidance. This command will be removed in a future minor release."}],
|
|
34
35
|
related: ['template', 'build'],
|
|
35
36
|
};
|
|
@@ -63,17 +63,12 @@ import {NO_RESULT_SET, resultSet} from '../../../foundation/debug/index.mjs';
|
|
|
63
63
|
* DEP-0006: the `astryx layout` command group is deprecated.
|
|
64
64
|
*
|
|
65
65
|
* Human mode: one stderr warning per invocation.
|
|
66
|
-
* JSON mode: `meta.
|
|
66
|
+
* JSON mode: `meta.deprecations` array in the response envelope.
|
|
67
67
|
*/
|
|
68
|
-
const
|
|
68
|
+
const LAYOUT_DEPRECATION = Object.freeze({
|
|
69
69
|
id: 'DEP-0006',
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
'astryx build "<idea>" — choose the template to start from',
|
|
73
|
-
'astryx template <name> <path> — scaffold it',
|
|
74
|
-
'astryx docs layout — layout guidance',
|
|
75
|
-
],
|
|
76
|
-
};
|
|
70
|
+
replacements: ['build', 'template', 'docs layout'],
|
|
71
|
+
});
|
|
77
72
|
|
|
78
73
|
function warnDeprecated() {
|
|
79
74
|
if (!isJsonMode()) {
|
|
@@ -91,10 +86,10 @@ function warnDeprecated() {
|
|
|
91
86
|
* Add deprecation metadata to a JSON response before output.
|
|
92
87
|
* Canonical stdout (type, data) is unchanged; the metadata sits in `meta`.
|
|
93
88
|
* @param {{type: string, data: unknown}} result
|
|
94
|
-
* @returns {{type: string, data: unknown, meta: {
|
|
89
|
+
* @returns {{type: string, data: unknown, meta: {deprecations: [typeof LAYOUT_DEPRECATION]}}}
|
|
95
90
|
*/
|
|
96
91
|
function withDeprecation(result) {
|
|
97
|
-
return {...result, meta: {
|
|
92
|
+
return {...result, meta: {deprecations: [LAYOUT_DEPRECATION]}};
|
|
98
93
|
}
|
|
99
94
|
|
|
100
95
|
/** The largest layout expression read from --file or stdin. */
|
|
@@ -122,6 +122,10 @@ export function defineCommand(parent, doc, {fn, action} = {}) {
|
|
|
122
122
|
const cmd = parent.command(argSpec ? `${token} ${argSpec}` : token);
|
|
123
123
|
Object.defineProperty(cmd, COMMAND_DOCS, {value: {doc, fn}, configurable: true});
|
|
124
124
|
if (doc.summary) cmd.description(doc.summary);
|
|
125
|
+
if (doc.deprecated) {
|
|
126
|
+
const base = cmd.description() || '';
|
|
127
|
+
cmd.description(`${base} [DEPRECATED: ${doc.deprecated}]`);
|
|
128
|
+
}
|
|
125
129
|
|
|
126
130
|
const paramDesc = (/** @type {string | undefined} */ name) =>
|
|
127
131
|
(fn?.params ?? []).find(p => p.name === name)?.description ?? '';
|
|
@@ -357,17 +357,17 @@ export const doc = {
|
|
|
357
357
|
{
|
|
358
358
|
value: 'layout.expand',
|
|
359
359
|
description:
|
|
360
|
-
'The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, written (the output path, or null when nothing was written), and demoMediaReplaced (count of demo media placeholders).',
|
|
360
|
+
'The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, written (the output path, or null when nothing was written), and demoMediaReplaced (count of demo media placeholders). Carries `meta.deprecations` with DEP-0006 and its replacement commands.',
|
|
361
361
|
},
|
|
362
362
|
{
|
|
363
363
|
value: 'layout.check',
|
|
364
364
|
description:
|
|
365
|
-
'The validation result: a valid flag, the detected form, errors (each with line/col, message, formatted text, and suggestions), warnings, and the expression re-printed in both canonical surfaces (compact and outline).',
|
|
365
|
+
'The validation result: a valid flag, the detected form, errors (each with line/col, message, formatted text, and suggestions), warnings, and the expression re-printed in both canonical surfaces (compact and outline). Carries `meta.deprecations` with DEP-0006 and its replacement commands.',
|
|
366
366
|
},
|
|
367
367
|
{
|
|
368
368
|
value: 'layout.grammar',
|
|
369
369
|
description:
|
|
370
|
-
"The XLE/XLO grammar cheatsheet: a text field with the full reference plus an aliases map (short name → canonical component) generated from this install's registry.",
|
|
370
|
+
"The XLE/XLO grammar cheatsheet: a text field with the full reference plus an aliases map (short name → canonical component) generated from this install's registry. Carries `meta.deprecations` with DEP-0006 and its replacement commands.",
|
|
371
371
|
},
|
|
372
372
|
],
|
|
373
373
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.6.6-canary.
|
|
3
|
+
"version": "0.6.6-canary.5b5b76f",
|
|
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.6.6-canary.
|
|
105
|
-
"@astryxdesign/core": "0.6.6-canary.
|
|
106
|
-
"@astryxdesign/lab": "0.6.6-canary.
|
|
107
|
-
"@astryxdesign/theme-neutral": "0.6.6-canary.
|
|
104
|
+
"@astryxdesign/charts": "0.6.6-canary.5b5b76f",
|
|
105
|
+
"@astryxdesign/core": "0.6.6-canary.5b5b76f",
|
|
106
|
+
"@astryxdesign/lab": "0.6.6-canary.5b5b76f",
|
|
107
|
+
"@astryxdesign/theme-neutral": "0.6.6-canary.5b5b76f"
|
|
108
108
|
},
|
|
109
109
|
"peerDependenciesMeta": {
|
|
110
110
|
"@astryxdesign/charts": {
|
|
@@ -121,10 +121,10 @@
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
|
-
"@astryxdesign/charts": "0.6.6-canary.
|
|
125
|
-
"@astryxdesign/core": "0.6.6-canary.
|
|
126
|
-
"@astryxdesign/lab": "0.6.6-canary.
|
|
127
|
-
"@astryxdesign/theme-neutral": "0.6.6-canary.
|
|
124
|
+
"@astryxdesign/charts": "0.6.6-canary.5b5b76f",
|
|
125
|
+
"@astryxdesign/core": "0.6.6-canary.5b5b76f",
|
|
126
|
+
"@astryxdesign/lab": "0.6.6-canary.5b5b76f",
|
|
127
|
+
"@astryxdesign/theme-neutral": "0.6.6-canary.5b5b76f",
|
|
128
128
|
"@heroicons/react": "^2.2.0",
|
|
129
129
|
"@stylexjs/stylex": "^0.19.0",
|
|
130
130
|
"@types/babel__core": "^7.20.5",
|