@astryxdesign/cli 0.7.16 → 0.7.17-canary.gb36275e
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 +13 -23
- package/api/build/_adapter.d.mts +5 -0
- package/api/build/_adapter.mjs +49 -34
- package/api/build/blocks/blocks.d.mts +7 -5
- package/api/build/blocks/blocks.mjs +113 -26
- package/api/build/build.doc.mjs +2 -1
- package/api/build/kit/rank.mjs +59 -12
- package/api/build/kit/weights.d.mts +16 -3
- package/api/build/kit/weights.json +1 -1
- package/api/build/kit/weights.mjs +238 -31
- package/api/build/kit/word-model.d.mts +23 -0
- package/api/build/kit/word-model.mjs +46 -0
- package/api/build/kit/words.d.mts +42 -0
- package/api/build/kit/words.mjs +82 -1
- package/api/component/__fixtures__/resolutions/modules.txt +4 -5
- package/api/component/list/list.d.mts +1 -1
- package/api/component/list/list.mjs +46 -5
- package/api/discover/_adapter.d.mts +1 -1
- package/api/docs/_adapter.d.mts +26 -2
- package/api/docs/_adapter.mjs +217 -5
- package/api/docs/docs.d.mts +3 -0
- package/api/docs/docs.doc.mjs +7 -1
- package/api/docs/docs.mjs +12 -0
- package/api/docs/docs.type.d.mts +5 -0
- package/api/docs/docs.type.mjs +2 -0
- package/api/docs/node/node.mjs +1 -1
- package/api/doctor/_adapter.d.mts +27 -5
- package/api/doctor/_adapter.mjs +77 -6
- package/api/doctor/built-checks.mjs +38 -13
- package/api/doctor/doctor.d.mts +4 -3
- package/api/doctor/doctor.mjs +14 -7
- package/api/doctor/theme-checks.mjs +121 -17
- package/api/render/_adapter.mjs +531 -192
- package/api/render/render.doc.mjs +11 -3
- package/api/render/render.type.d.mts +30 -0
- package/api/render/render.type.mjs +19 -0
- package/api/search/ORDERING.md +1 -1
- package/api/search/_candidate-score.mjs +51 -32
- package/api/search/_fit-order.mjs +3 -3
- package/api/search/_result.d.mts +5 -5
- package/api/search/_score.d.mts +6 -1
- package/api/search/_score.mjs +15 -3
- package/api/search/search.d.mts +1 -1
- package/api/theme/_adapter.mjs +10 -0
- package/api/theme/build/build.d.mts +47 -0
- package/api/theme/build/build.mjs +147 -25
- package/api/theme/theme.type.d.mts +10 -0
- package/api/theme/theme.type.mjs +7 -1
- package/api/theme-edit/_adapter.d.mts +48 -0
- package/api/theme-edit/_adapter.mjs +675 -42
- package/api/theme-edit/_check.d.mts +28 -22
- package/api/theme-edit/_check.mjs +1481 -252
- package/api/theme-edit/_color.d.mts +9 -0
- package/api/theme-edit/_color.mjs +41 -1
- package/api/theme-edit/_compiler.mjs +9 -0
- package/api/theme-edit/_context.mjs +60 -3
- package/api/theme-edit/_css.mjs +21 -1
- package/api/theme-edit/_edit.d.mts +22 -0
- package/api/theme-edit/_edit.mjs +1196 -88
- package/api/theme-edit/_how-commands.d.mts +57 -0
- package/api/theme-edit/_how-commands.mjs +536 -1
- package/api/theme-edit/_how-question.d.mts +65 -0
- package/api/theme-edit/_how-question.mjs +4401 -225
- package/api/theme-edit/_how.mjs +104 -4
- package/api/theme-edit/_marks.d.mts +31 -5
- package/api/theme-edit/_marks.mjs +57 -5
- package/api/theme-edit/_normal.d.mts +153 -0
- package/api/theme-edit/_normal.mjs +661 -0
- package/api/theme-edit/_palette.mjs +10 -4
- package/api/theme-edit/_parts.d.mts +8 -0
- package/api/theme-edit/_parts.mjs +103 -2
- package/api/theme-edit/_preview-app.d.mts +7 -1
- package/api/theme-edit/_preview-app.mjs +205 -17
- package/api/theme-edit/_preview.d.mts +64 -8
- package/api/theme-edit/_preview.mjs +447 -89
- package/api/theme-edit/_settings.d.mts +176 -5
- package/api/theme-edit/_settings.mjs +1936 -128
- package/api/theme-edit/_tables.d.mts +6 -0
- package/api/theme-edit/_tables.mjs +32 -1
- package/api/theme-edit/theme-edit.type.d.mts +10 -1
- package/api/theme-edit/theme-edit.type.mjs +4 -1
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +3 -3
- package/assets/codemods/run-codemod.mjs +73 -6
- package/assets/codemods/transforms/next/index.mjs +11 -1
- package/assets/codemods/transforms/next/migrate-item-swipe-actions-to-swipe.mjs +394 -0
- package/assets/docs/author-a-theme.doc.mjs +1 -0
- package/assets/docs/theme.doc.dense.mjs +2 -2
- package/assets/docs/theme.doc.mjs +1 -1
- package/assets/docs/tree/check-your-docs.doc.mjs +1 -1
- package/assets/docs/tree/cli-command.doc.mjs +2 -3
- package/assets/docs/tree/render-pages.doc.mjs +43 -2
- package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
- package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
- package/assets/docs/use-a-theme.doc.mjs +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.tsx +38 -0
- package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.tsx +36 -0
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/template.doc.mjs +5 -4
- package/assets/templates/pages/ai-chat-landing/template.doc.mjs +2 -1
- package/assets/templates/pages/blank/template.doc.mjs +1 -1
- package/assets/templates/pages/canvas-editor/template.doc.mjs +4 -2
- package/assets/templates/pages/centered-hero/template.doc.mjs +9 -1
- package/assets/templates/pages/classic-gallery/template.doc.mjs +1 -1
- package/assets/templates/pages/contact-form/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard/template.doc.mjs +3 -2
- package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-composition/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-progress/template.doc.mjs +6 -3
- package/assets/templates/pages/detail-page/template.doc.mjs +10 -3
- package/assets/templates/pages/documentation/template.doc.mjs +4 -1
- package/assets/templates/pages/documentation-design/template.doc.mjs +7 -1
- package/assets/templates/pages/documentation-technical/template.doc.mjs +7 -1
- package/assets/templates/pages/editor/template.doc.mjs +2 -8
- package/assets/templates/pages/file-explorer/template.doc.mjs +1 -1
- package/assets/templates/pages/form-two-column/template.doc.mjs +4 -3
- package/assets/templates/pages/form-wizard/template.doc.mjs +5 -3
- package/assets/templates/pages/gallery-hero/template.doc.mjs +4 -2
- package/assets/templates/pages/ide/page.tsx +24 -2
- package/assets/templates/pages/kanban-board/template.doc.mjs +1 -9
- package/assets/templates/pages/library/template.doc.mjs +4 -1
- package/assets/templates/pages/login/template.doc.mjs +2 -1
- package/assets/templates/pages/login-card/template.doc.mjs +2 -1
- package/assets/templates/pages/login-split/template.doc.mjs +2 -1
- package/assets/templates/pages/login-sso/template.doc.mjs +4 -2
- package/assets/templates/pages/mixed-gallery/template.doc.mjs +2 -1
- package/assets/templates/pages/product-detail/template.doc.mjs +4 -2
- package/assets/templates/pages/product-gallery/template.doc.mjs +2 -1
- package/assets/templates/pages/settings-dialog/template.doc.mjs +2 -1
- package/assets/templates/pages/settings-sidebar/template.doc.mjs +2 -1
- package/assets/templates/pages/shell-nav/template.doc.mjs +4 -2
- package/assets/templates/pages/shell-side-nav/template.doc.mjs +5 -3
- package/assets/templates/pages/shell-top-nav/template.doc.mjs +2 -1
- package/assets/templates/pages/side-gallery/template.doc.mjs +9 -1
- package/assets/templates/pages/table-filter/template.doc.mjs +9 -8
- package/assets/templates/pages/table-grouped/template.doc.mjs +4 -2
- package/assets/templates/pages/table-page/template.doc.mjs +5 -4
- package/assets/templates/pages/table-tree/template.doc.mjs +6 -3
- package/assets/templates/pages/theme-showcase/template.doc.mjs +2 -9
- package/assets/templates/pages/work-item-detail/template.doc.mjs +1 -0
- package/authoring/debug/parse.d.mts +3 -3
- package/authoring/doctypes/_schema.d.mts +3 -3
- package/authoring/doctypes/command/command.doc.mjs +1 -1
- package/authoring/doctypes/template/template.doc.mjs +1 -1
- package/authoring/doctypes/template/type.ts +9 -0
- package/clients/cli/bin/astryx.mjs +6 -9
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/component.doc.mjs +1 -1
- package/clients/cli/commands/component.mjs +20 -2
- package/clients/cli/commands/docs.doc.mjs +7 -1
- package/clients/cli/commands/docs.mjs +3 -1
- package/clients/cli/commands/doctor.mjs +22 -14
- package/clients/cli/commands/experimental/render.mjs +32 -1
- package/clients/cli/commands/experimental/theme.mjs +65 -14
- package/clients/cli/commands/experimental-render.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
- package/clients/cli/commands/search.doc.mjs +2 -1
- package/clients/cli/commands/search.mjs +6 -1
- package/clients/cli/commands/template.mjs +4 -2
- package/clients/cli/commands/theme-build.doc.mjs +5 -1
- package/clients/cli/commands/theme.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +153 -5
- package/clients/cli/commands/upgrade.mjs +42 -7
- package/clients/cli/index.mjs +1 -1
- package/clients/cli/lib/component-format.mjs +205 -98
- package/clients/cli/lib/hook-format.mjs +9 -19
- package/clients/cli/manifest.generated.json +1 -1
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/config/theme-state.d.mts +13 -1
- package/foundation/config/theme-state.mjs +47 -7
- package/foundation/discovery/component-discovery.d.mts +11 -0
- package/foundation/discovery/component-discovery.mjs +27 -2
- package/foundation/discovery/component-replacement.mjs +130 -1
- package/foundation/discovery/entry-name-files.d.mts +43 -0
- package/foundation/discovery/entry-name-files.mjs +264 -0
- package/foundation/discovery/hook-discovery.d.mts +8 -2
- package/foundation/discovery/hook-discovery.mjs +20 -7
- package/foundation/discovery/package-exports.d.mts +10 -0
- package/foundation/discovery/package-exports.mjs +56 -3
- package/foundation/discovery/runner-allowlist.d.mts +1 -0
- package/foundation/discovery/runner-allowlist.mjs +2 -0
- package/foundation/discovery/template-adapter.d.mts +52 -0
- package/foundation/discovery/template-adapter.mjs +173 -10
- package/foundation/discovery/theme-imports.d.mts +14 -0
- package/foundation/discovery/theme-imports.mjs +43 -1
- package/foundation/doc-compiler/import.mjs +7 -1
- package/foundation/doc-compiler/parse-readable.mjs +4 -1
- package/foundation/doc-compiler/stored-docs.d.mts +22 -0
- package/foundation/doc-compiler/stored-docs.mjs +49 -0
- package/foundation/fs/cache-eviction.d.mts +21 -0
- package/foundation/fs/cache-eviction.mjs +73 -0
- package/foundation/fs/gather-cache.d.mts +25 -4
- package/foundation/fs/gather-cache.mjs +163 -53
- package/foundation/fs/jiti-cache.d.mts +19 -1
- package/foundation/fs/jiti-cache.mjs +130 -6
- package/foundation/fs/kept-tree.d.mts +60 -0
- package/foundation/fs/kept-tree.mjs +154 -0
- package/foundation/fs/module-loader.d.mts +18 -2
- package/foundation/fs/module-loader.mjs +92 -20
- package/foundation/identity/provider-identity.d.mts +6 -0
- package/foundation/identity/provider-identity.mjs +10 -1
- package/foundation/render/embedded-imports.d.mts +5 -4
- package/foundation/render/embedded-imports.mjs +7 -16
- package/foundation/render/file-header.d.mts +66 -0
- package/foundation/render/file-header.mjs +118 -0
- package/foundation/render/host-answer.d.mts +18 -0
- package/foundation/render/host-answer.mjs +46 -0
- package/foundation/render/host-exit.d.mts +1 -0
- package/foundation/render/host-exit.mjs +6 -1
- package/foundation/render/html-reader.d.mts +55 -2
- package/foundation/render/html-reader.mjs +145 -26
- package/foundation/render/markup-edits.d.mts +57 -0
- package/foundation/render/markup-edits.mjs +182 -0
- package/foundation/render/page-host.mjs +29 -12
- package/foundation/render/page-worker.mjs +83 -13
- package/foundation/render/render-page.d.mts +34 -2
- package/foundation/render/render-page.mjs +210 -29
- package/foundation/render/source-block.d.mts +73 -6
- package/foundation/render/source-block.mjs +170 -19
- package/foundation/render/ts-paths.d.mts +53 -6
- package/foundation/render/ts-paths.mjs +286 -41
- package/foundation/response/error-codes.d.mts +3 -1
- package/foundation/response/error-codes.d.ts +1 -0
- package/foundation/response/error-codes.doc.mjs +12 -1
- package/foundation/response/error-codes.mjs +10 -0
- package/foundation/text/string-utils.d.mts +3 -2
- package/foundation/text/string-utils.mjs +16 -3
- package/foundation/text/suggest-order.d.mts +9 -0
- package/foundation/text/suggest-order.mjs +13 -0
- package/host/index.mjs +8 -6
- package/package.json +6 -6
|
@@ -10,15 +10,18 @@ export const doc = {
|
|
|
10
10
|
keywords: [
|
|
11
11
|
'tree',
|
|
12
12
|
'hierarchy',
|
|
13
|
-
'nested
|
|
13
|
+
'nested',
|
|
14
|
+
'rows',
|
|
14
15
|
'drilldown',
|
|
15
16
|
'expand',
|
|
16
17
|
'collapse',
|
|
17
18
|
'resizable',
|
|
18
19
|
'expandable',
|
|
19
|
-
'file
|
|
20
|
+
'file',
|
|
21
|
+
'browser',
|
|
20
22
|
'repository',
|
|
21
|
-
'
|
|
23
|
+
'rollup',
|
|
24
|
+
'parents',
|
|
22
25
|
],
|
|
23
26
|
isReady: true,
|
|
24
27
|
category: 'Table - Tree/Hierarchical List',
|
|
@@ -6,16 +6,9 @@ export const doc = {
|
|
|
6
6
|
name: 'Theme Showcase',
|
|
7
7
|
displayName: 'Theme Showcase',
|
|
8
8
|
description:
|
|
9
|
-
'Multi-surface comparison shell:
|
|
9
|
+
'Multi-surface comparison shell: sample product screens (a storefront with an account dialog, checkout, chat, activity and inventory) rendered in the active theme on one responsive canvas. A theme preview and design-system showcase, with an embeddable content view for an existing app shell.',
|
|
10
10
|
category: 'Shell - Top Nav',
|
|
11
|
-
keywords: [
|
|
12
|
-
'theme',
|
|
13
|
-
'tokens',
|
|
14
|
-
'palette',
|
|
15
|
-
'typography',
|
|
16
|
-
'styling',
|
|
17
|
-
'design system preview',
|
|
18
|
-
],
|
|
11
|
+
keywords: ['theme', 'styling', 'design system', 'preview'],
|
|
19
12
|
isReady: true,
|
|
20
13
|
// The standalone entry demonstrates an application shell; the named preview
|
|
21
14
|
// composes into its host without nesting AppShell. Keep it out of the gallery.
|
|
@@ -44,8 +44,8 @@ declare const eventSchema: z.ZodObject<{
|
|
|
44
44
|
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
45
45
|
options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
46
46
|
optionSources: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
47
|
-
default: "default";
|
|
48
47
|
cli: "cli";
|
|
48
|
+
default: "default";
|
|
49
49
|
env: "env";
|
|
50
50
|
config: "config";
|
|
51
51
|
implied: "implied";
|
|
@@ -75,16 +75,16 @@ declare const eventSchema: z.ZodObject<{
|
|
|
75
75
|
resultCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
76
76
|
emptyResult: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
|
|
77
77
|
resultKind: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
78
|
-
template: "template";
|
|
79
78
|
command: "command";
|
|
79
|
+
none: "none";
|
|
80
80
|
component: "component";
|
|
81
|
+
template: "template";
|
|
81
82
|
doc: "doc";
|
|
82
83
|
theme: "theme";
|
|
83
84
|
hook: "hook";
|
|
84
85
|
integration: "integration";
|
|
85
86
|
migration: "migration";
|
|
86
87
|
mixed: "mixed";
|
|
87
|
-
none: "none";
|
|
88
88
|
}>>>;
|
|
89
89
|
directMatch: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
|
|
90
90
|
stdout: z.ZodString;
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
/** Every authored doc-kind discriminant accepted by parseDoc. */
|
|
5
5
|
export const AuthoredDocKindSchema: z.ZodEnum<{
|
|
6
6
|
function: "function";
|
|
7
|
+
page: "page";
|
|
7
8
|
command: "command";
|
|
8
9
|
component: "component";
|
|
9
10
|
generic: "generic";
|
|
10
|
-
page: "page";
|
|
11
11
|
block: "block";
|
|
12
12
|
schema: "schema";
|
|
13
13
|
enum: "enum";
|
|
@@ -643,10 +643,10 @@ export const NamespaceDocKindSchema: z.ZodObject<{
|
|
|
643
643
|
accepts: z.ZodObject<{
|
|
644
644
|
kinds: z.ZodArray<z.ZodEnum<{
|
|
645
645
|
function: "function";
|
|
646
|
+
page: "page";
|
|
646
647
|
command: "command";
|
|
647
648
|
component: "component";
|
|
648
649
|
generic: "generic";
|
|
649
|
-
page: "page";
|
|
650
650
|
block: "block";
|
|
651
651
|
schema: "schema";
|
|
652
652
|
enum: "enum";
|
|
@@ -664,10 +664,10 @@ export const NamespaceDocKindSchema: z.ZodObject<{
|
|
|
664
664
|
group: z.ZodString;
|
|
665
665
|
kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
666
666
|
function: "function";
|
|
667
|
+
page: "page";
|
|
667
668
|
command: "command";
|
|
668
669
|
component: "component";
|
|
669
670
|
generic: "generic";
|
|
670
|
-
page: "page";
|
|
671
671
|
block: "block";
|
|
672
672
|
schema: "schema";
|
|
673
673
|
enum: "enum";
|
|
@@ -241,7 +241,7 @@ export const doc = {
|
|
|
241
241
|
args: [{name: 'query', param: 'query', required: true}],
|
|
242
242
|
options: [
|
|
243
243
|
{flag: '--type <domain>', param: 'options.type', choices: ['component', 'hook', 'doc', 'template', 'theme']},
|
|
244
|
-
{flag: '--verbose', cliOnly: true, description: "Also print each result's score and match reason."},
|
|
244
|
+
{flag: '--verbose', cliOnly: true, description: "Also print each result's score and match reason, and its whole description."},
|
|
245
245
|
],
|
|
246
246
|
examples: [{label: 'Terminal', cli: 'astryx search button --json'}],
|
|
247
247
|
exitCodes: [{code: 1, when: 'The --type value is not a known domain.'}],
|
|
@@ -56,7 +56,7 @@ export const doc = {
|
|
|
56
56
|
name: 'keywords',
|
|
57
57
|
type: 'string[]',
|
|
58
58
|
description:
|
|
59
|
-
"Search keywords for CLI discovery: the ideas, domains, and other names a builder might use for what the template serves (e.g. ['monitoring', 'uptime', 'on-call'] for a service-health dashboard). Lowercase. `astryx search` matches them as it matches the description and `astryx build` ranks page templates on them, so keep them out of `description`. Integration templates need @astryxdesign/cli 0.6.6 or later: earlier CLIs reject the field and drop that template, and CLIs before 0.6.4 also hide the package's doc topics.",
|
|
59
|
+
"Search keywords for CLI discovery: the ideas, domains, and other names a builder might use for what the template serves (e.g. ['monitoring', 'uptime', 'on-call'] for a service-health dashboard). Lowercase. One keyword names one concept: write a list of words as separate keywords (['kpi', 'tiles'], not 'kpi tiles'). Write several words as one keyword only for a term the words do not mean apart, such as 'table of contents' or 'reading pane': when `astryx build` chooses the start and its alternatives, such a keyword counts only when the request names the whole phrase, in order, never through its words alone. Inside a phrase, build skips search's stopwords and one-letter words, so 'sign in' matches as 'sign' and 'on-call' as 'call'. `astryx search` matches them as it matches the description and `astryx build` ranks page templates on them, so keep them out of `description`. Integration templates need @astryxdesign/cli 0.6.6 or later: earlier CLIs reject the field and drop that template, and CLIs before 0.6.4 also hide the package's doc topics.",
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
name: 'replaces',
|
|
@@ -29,6 +29,15 @@ export interface BaseTemplateDoc extends AuthoredDocGraphFields {
|
|
|
29
29
|
/** Search keywords for CLI discovery: the ideas, domains, and other names a
|
|
30
30
|
* builder might use for what this template serves (e.g. `['monitoring',
|
|
31
31
|
* 'uptime', 'on-call']` for a service-health dashboard). Lowercase.
|
|
32
|
+
* One keyword names one concept: write a list of words as separate
|
|
33
|
+
* keywords (`['kpi', 'tiles']`, not `'kpi tiles'`). Write several words as
|
|
34
|
+
* one keyword only for a term the words do not mean apart, such as
|
|
35
|
+
* `'table of contents'` or `'reading pane'`: when `astryx build` chooses
|
|
36
|
+
* the start and its alternatives, such a keyword counts only when the
|
|
37
|
+
* request names the whole phrase, in order, never through its words
|
|
38
|
+
* alone. Inside a phrase, build skips search's
|
|
39
|
+
* stopwords and one-letter words, so `'sign in'` matches as `'sign'` and
|
|
40
|
+
* `'on-call'` as `'call'`.
|
|
32
41
|
* `astryx search` matches them as it matches the description, and
|
|
33
42
|
* `astryx build` ranks page templates on them, so the `description` can
|
|
34
43
|
* stay a description of the layout. Integration templates need
|
|
@@ -33,10 +33,10 @@ import {
|
|
|
33
33
|
|
|
34
34
|
// Node's compile cache keeps the compiled form of the CLI's modules between
|
|
35
35
|
// runs, so a run skips most of their compiling. It lives in a folder of the
|
|
36
|
-
// user's own in the system temp folder (node-compile-cache-<uid>).
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
// folder the user owns that no one else can reach, since a shared folder
|
|
36
|
+
// user's own in the system temp folder (node-compile-cache-<uid>). A machine's
|
|
37
|
+
// first run makes that folder and writes the cache at once, so the next run
|
|
38
|
+
// (most often the same session's next command) reads it. It is used only
|
|
39
|
+
// while it is a real folder the user owns that no one else can reach, since a shared folder
|
|
40
40
|
// could hold planted cache files (foundation/env/private-dir.mjs, the check
|
|
41
41
|
// the kept search catalogs use too). Where the system has no user ids
|
|
42
42
|
// (Windows), ownership cannot be checked, so the cache stays off.
|
|
@@ -46,11 +46,8 @@ try {
|
|
|
46
46
|
const uid = currentUid();
|
|
47
47
|
if (!process.env.NODE_DISABLE_COMPILE_CACHE && uid != null) {
|
|
48
48
|
const cacheDir = join(tmpdir(), `node-compile-cache-${uid}`);
|
|
49
|
-
if (!existsSync(cacheDir)) {
|
|
50
|
-
|
|
51
|
-
} else if (isPrivateDir(cacheDir)) {
|
|
52
|
-
nodeModule.enableCompileCache?.(cacheDir);
|
|
53
|
-
}
|
|
49
|
+
if (!existsSync(cacheDir)) mkdirSync(cacheDir, {mode: 0o700});
|
|
50
|
+
if (isPrivateDir(cacheDir)) nodeModule.enableCompileCache?.(cacheDir);
|
|
54
51
|
}
|
|
55
52
|
} catch {
|
|
56
53
|
// A run without the cache is the same run, only slower.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"cd573d20260f7cc6982f712db227ecebec0ebd190d03f15c44f30f9e4f0fa6a3"}
|
|
@@ -95,9 +95,16 @@ function summarize(result) {
|
|
|
95
95
|
* @param {string} requestedName
|
|
96
96
|
* @param {'full'|'compact'|'brief'} detail
|
|
97
97
|
* @param {Awaited<ReturnType<typeof resolveTheme>>} themeData
|
|
98
|
+
* @param {string} [scopePackage] - the `--package` the read was scoped to
|
|
98
99
|
* @returns {import('../formatters/index.mjs').Block[]}
|
|
99
100
|
*/
|
|
100
|
-
function componentDetailBlocks(
|
|
101
|
+
function componentDetailBlocks(
|
|
102
|
+
result,
|
|
103
|
+
requestedName,
|
|
104
|
+
detail,
|
|
105
|
+
themeData,
|
|
106
|
+
scopePackage,
|
|
107
|
+
) {
|
|
101
108
|
const requested = (requestedName.split('/').pop() ?? requestedName).replace(
|
|
102
109
|
/^XDS/,
|
|
103
110
|
'',
|
|
@@ -110,6 +117,12 @@ function componentDetailBlocks(result, requestedName, detail, themeData) {
|
|
|
110
117
|
result.data.replaces === requested
|
|
111
118
|
? result.data.name
|
|
112
119
|
: requested;
|
|
120
|
+
// The command that prints this read's props whole names the read's own
|
|
121
|
+
// selector and scope, so it resolves to the same component.
|
|
122
|
+
const scope = scopePackage ? ` --package ${scopePackage}` : '';
|
|
123
|
+
const propsCommand = requestedName
|
|
124
|
+
? `component ${requestedName}${scope} --props`
|
|
125
|
+
: null;
|
|
113
126
|
switch (result.type) {
|
|
114
127
|
case 'component.detail': {
|
|
115
128
|
/** @type {import('../formatters/index.mjs').Block[]} */
|
|
@@ -126,12 +139,15 @@ function componentDetailBlocks(result, requestedName, detail, themeData) {
|
|
|
126
139
|
)
|
|
127
140
|
: detail === 'compact'
|
|
128
141
|
? code(
|
|
129
|
-
formatCompact(result.data, resolvedName, result.data.import
|
|
142
|
+
formatCompact(result.data, resolvedName, result.data.import, {
|
|
143
|
+
propsCommand,
|
|
144
|
+
}),
|
|
130
145
|
)
|
|
131
146
|
: code(
|
|
132
147
|
formatFull(result.data, {
|
|
133
148
|
themeData,
|
|
134
149
|
importHint: result.data.import,
|
|
150
|
+
propsCommand,
|
|
135
151
|
}),
|
|
136
152
|
),
|
|
137
153
|
);
|
|
@@ -425,6 +441,7 @@ export function registerComponent(program) {
|
|
|
425
441
|
row.selector,
|
|
426
442
|
detail,
|
|
427
443
|
themeData,
|
|
444
|
+
options.package,
|
|
428
445
|
),
|
|
429
446
|
);
|
|
430
447
|
continue;
|
|
@@ -472,6 +489,7 @@ export function registerComponent(program) {
|
|
|
472
489
|
name ?? '',
|
|
473
490
|
detail,
|
|
474
491
|
themeData,
|
|
492
|
+
options.package,
|
|
475
493
|
),
|
|
476
494
|
);
|
|
477
495
|
break;
|
|
@@ -32,6 +32,11 @@ export const doc = {
|
|
|
32
32
|
{name: 'section', param: 'section', required: false},
|
|
33
33
|
],
|
|
34
34
|
options: [
|
|
35
|
+
{
|
|
36
|
+
flag: '--list',
|
|
37
|
+
param: 'options.list',
|
|
38
|
+
description: 'List every topic (the same as giving no topic)',
|
|
39
|
+
},
|
|
35
40
|
{
|
|
36
41
|
flag: '--index',
|
|
37
42
|
param: 'options.index',
|
|
@@ -51,6 +56,7 @@ export const doc = {
|
|
|
51
56
|
],
|
|
52
57
|
examples: [
|
|
53
58
|
{label: 'List topics', cli: 'astryx docs'},
|
|
59
|
+
{label: 'The same list, asked for by flag', cli: 'astryx docs --list'},
|
|
54
60
|
{label: "A topic's sections", cli: 'astryx docs theme'},
|
|
55
61
|
{label: 'A whole topic as JSON', cli: 'astryx docs spacing --json'},
|
|
56
62
|
{label: 'One section', cli: 'astryx docs theme quick-start'},
|
|
@@ -72,7 +78,7 @@ export const doc = {
|
|
|
72
78
|
{code: 0, when: 'success'},
|
|
73
79
|
{
|
|
74
80
|
code: 1,
|
|
75
|
-
when: 'unknown topic or route, a section that matches no section or more than one,
|
|
81
|
+
when: 'unknown topic or route, a section that matches no section or more than one, a --depth that is not a number of levels or all, or --list given a topic or section',
|
|
76
82
|
},
|
|
77
83
|
],
|
|
78
84
|
related: ['search', 'component', 'hook', 'template'],
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Usage:
|
|
18
18
|
* astryx docs List available topics
|
|
19
|
+
* astryx docs --list The same list, asked for by flag
|
|
19
20
|
* astryx docs <topic> List the topic's sections (a topic
|
|
20
21
|
* with one section prints whole)
|
|
21
22
|
* astryx docs <topic> <section> Print one section
|
|
@@ -650,7 +651,7 @@ export function registerDocs(program) {
|
|
|
650
651
|
action: async (
|
|
651
652
|
/** @type {string | undefined} */ topic,
|
|
652
653
|
/** @type {string | undefined} */ sectionName,
|
|
653
|
-
/** @type {{index?: boolean, full?: boolean, depth?: string}} */ options = {},
|
|
654
|
+
/** @type {{list?: boolean, index?: boolean, full?: boolean, depth?: string}} */ options = {},
|
|
654
655
|
) => {
|
|
655
656
|
const run = getCliInvocation();
|
|
656
657
|
const lang = program.opts().lang || null;
|
|
@@ -697,6 +698,7 @@ export function registerDocs(program) {
|
|
|
697
698
|
lang,
|
|
698
699
|
zh,
|
|
699
700
|
dense,
|
|
701
|
+
list: options.list,
|
|
700
702
|
index: listSections,
|
|
701
703
|
...(depth != null ? {depth, detail: childDetail} : {}),
|
|
702
704
|
});
|
|
@@ -22,14 +22,7 @@ import {
|
|
|
22
22
|
validateIntegration,
|
|
23
23
|
} from '../../../api/integration/validate-integration.mjs';
|
|
24
24
|
import {jsonOut} from '../../../foundation/response/json.mjs';
|
|
25
|
-
import {
|
|
26
|
-
emit,
|
|
27
|
-
list,
|
|
28
|
-
section,
|
|
29
|
-
record,
|
|
30
|
-
records,
|
|
31
|
-
text,
|
|
32
|
-
} from '../formatters/index.mjs';
|
|
25
|
+
import {emit, list, section, records, text} from '../formatters/index.mjs';
|
|
33
26
|
import {defineCommand} from '../lib/define-command.mjs';
|
|
34
27
|
import {doc as doctorCommand} from './doctor.doc.mjs';
|
|
35
28
|
import {doc as doctorIntegrationGroup} from './doctor-integration.doc.mjs';
|
|
@@ -58,6 +51,15 @@ const STATUS = {
|
|
|
58
51
|
info: '[info]',
|
|
59
52
|
};
|
|
60
53
|
|
|
54
|
+
/** A doctor check's fields in text order: the status column, then the rest. */
|
|
55
|
+
const CHECK_FIELDS = /** @type {const} */ ([
|
|
56
|
+
'status',
|
|
57
|
+
'id',
|
|
58
|
+
'label',
|
|
59
|
+
'message',
|
|
60
|
+
'fix',
|
|
61
|
+
]);
|
|
62
|
+
|
|
61
63
|
/** @param {string} status */
|
|
62
64
|
function statusToken(status) {
|
|
63
65
|
return STATUS[/** @type {keyof typeof STATUS} */ (status)] ?? status;
|
|
@@ -80,15 +82,21 @@ function printHuman(report) {
|
|
|
80
82
|
? 'No failures — but review the [warn] warnings above when you can.'
|
|
81
83
|
: 'All checks passed. Your Astryx setup looks healthy.';
|
|
82
84
|
|
|
83
|
-
//
|
|
85
|
+
// One check per line, status first so the counted value stays a column.
|
|
86
|
+
// The legend names each field by its JSON key, so text and --json map one
|
|
87
|
+
// to one.
|
|
88
|
+
const summaryFields = /** @type {const} */ (['pass', 'warn', 'fail', 'info']);
|
|
84
89
|
emit(
|
|
85
|
-
section('astryx doctor
|
|
90
|
+
section('astryx doctor', `Each check: ${CHECK_FIELDS.join(', ')}`),
|
|
86
91
|
records(report.checks, {
|
|
87
|
-
fields: [
|
|
88
|
-
|
|
92
|
+
fields: [...CHECK_FIELDS],
|
|
93
|
+
layout: 'inline',
|
|
94
|
+
format: {status: statusToken, fix: fix => `fix: ${fix}`},
|
|
89
95
|
}),
|
|
90
|
-
section(
|
|
91
|
-
|
|
96
|
+
section(
|
|
97
|
+
'summary',
|
|
98
|
+
summaryFields.map(key => `${key}: ${report.summary[key]}`).join(', '),
|
|
99
|
+
),
|
|
92
100
|
text(closing),
|
|
93
101
|
);
|
|
94
102
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import {getCliInvocation} from '../../../../foundation/env/package-manager.mjs';
|
|
17
|
+
import {shellArg} from '../../../../foundation/text/shell-arg.mjs';
|
|
17
18
|
import {jsonOut} from '../../../../foundation/response/json.mjs';
|
|
18
19
|
import {resultSet} from '../../../../foundation/debug/index.mjs';
|
|
19
20
|
import {emit, section, text, record, list} from '../../formatters/index.mjs';
|
|
@@ -76,11 +77,12 @@ export function registerExperimentalRender(group, program) {
|
|
|
76
77
|
...(d.warnings.length > 0
|
|
77
78
|
? [section('Warnings'), list(d.warnings.map(w => w.message))]
|
|
78
79
|
: []),
|
|
79
|
-
text(`Give it back: ${run} experimental render --reverse ${d.output}`),
|
|
80
|
+
text(`Give it back: ${run} experimental render --reverse ${shellArg(d.output)}`),
|
|
80
81
|
);
|
|
81
82
|
return answered;
|
|
82
83
|
}
|
|
83
84
|
const d = result.data;
|
|
85
|
+
const edits = d.edits ?? [];
|
|
84
86
|
emit(
|
|
85
87
|
section(d.mode === 'embedded' ? `Restored ${d.output}` : `Rebuilt ${d.output}`),
|
|
86
88
|
record({
|
|
@@ -98,6 +100,12 @@ export function registerExperimentalRender(group, program) {
|
|
|
98
100
|
...(d.unknown?.length ? {unknown: d.unknown.join(', ')} : {}),
|
|
99
101
|
}
|
|
100
102
|
: {}),
|
|
103
|
+
...(d.format === undefined ? {} : {format: d.format}),
|
|
104
|
+
...(d.renderedBy ? {renderedBy: d.renderedBy} : {}),
|
|
105
|
+
...(d.packages ? {packages: d.packages.join(', ') || 'none'} : {}),
|
|
106
|
+
...(d.title === undefined ? {} : {title: d.title}),
|
|
107
|
+
...(d.edited === undefined ? {} : {edited: d.edited}),
|
|
108
|
+
...(d.stylesEdited === undefined ? {} : {stylesEdited: d.stylesEdited}),
|
|
101
109
|
}),
|
|
102
110
|
...(d.mode === 'rebuilt'
|
|
103
111
|
? [
|
|
@@ -106,6 +114,29 @@ export function registerExperimentalRender(group, program) {
|
|
|
106
114
|
),
|
|
107
115
|
]
|
|
108
116
|
: []),
|
|
117
|
+
...(d.edited
|
|
118
|
+
? [
|
|
119
|
+
section('Changed after the render'),
|
|
120
|
+
...(edits.length > 0
|
|
121
|
+
? edits.map(edit =>
|
|
122
|
+
record({
|
|
123
|
+
was: edit.was ?? '(added after the render)',
|
|
124
|
+
now: edit.now ?? '(removed after the render)',
|
|
125
|
+
...(edit.file ? {file: edit.file, line: edit.line} : {}),
|
|
126
|
+
}),
|
|
127
|
+
)
|
|
128
|
+
: [text(d.stylesEdited ? 'Only the styles changed after the render; the text did not.' : 'The markup changed after the render, but its text did not: only attributes, elements or formatting.')]),
|
|
129
|
+
...(d.moreEdits ? [record({moreEdits: d.moreEdits})] : []),
|
|
130
|
+
text('The restored files are the page as rendered, without these changes: make them in the restored files, then render again.'),
|
|
131
|
+
]
|
|
132
|
+
: []),
|
|
133
|
+
...(d.mode === 'embedded'
|
|
134
|
+
? [
|
|
135
|
+
text(
|
|
136
|
+
`Render it again: ${run} experimental render ${shellArg(d.output)} --out ${shellArg(d.input)}${d.title === undefined ? '' : ` --title ${shellArg(d.title)}`}`,
|
|
137
|
+
),
|
|
138
|
+
]
|
|
139
|
+
: []),
|
|
109
140
|
);
|
|
110
141
|
return answered;
|
|
111
142
|
},
|
|
@@ -49,6 +49,10 @@ import {
|
|
|
49
49
|
dialValueFits,
|
|
50
50
|
newFlagList,
|
|
51
51
|
editorCompileProblem,
|
|
52
|
+
editorFollowCompile,
|
|
53
|
+
editorBuildExtra,
|
|
54
|
+
editorLoadedFonts,
|
|
55
|
+
editorColorModes,
|
|
52
56
|
editorThemeHold,
|
|
53
57
|
editorThemeRefusal,
|
|
54
58
|
editorMissingSource,
|
|
@@ -484,7 +488,16 @@ function flagValues(name) {
|
|
|
484
488
|
*/
|
|
485
489
|
function changeBlocks(r) {
|
|
486
490
|
const d = r.data;
|
|
487
|
-
|
|
491
|
+
// The status line names the value as saved, with a quote or space mark
|
|
492
|
+
// the text output would fold written as its CSS escape (\201C), so the
|
|
493
|
+
// text and the JSON name the same value.
|
|
494
|
+
const s = {
|
|
495
|
+
...d.setting,
|
|
496
|
+
value: String(d.setting.value).replace(
|
|
497
|
+
/[\u00A0\u00AB\u00BB\u2000-\u200B\u2018-\u201F\u2039\u203A\u202F\u3000\u300C-\u300F]/g,
|
|
498
|
+
c => `\\${c.codePointAt(0)?.toString(16).toUpperCase()} `,
|
|
499
|
+
),
|
|
500
|
+
};
|
|
488
501
|
const status =
|
|
489
502
|
d.was != null
|
|
490
503
|
? `[ok] ${d.theme}: ${s.thing} ${d.was} -> ${s.value}`
|
|
@@ -639,7 +652,14 @@ function strayOption(command, rest) {
|
|
|
639
652
|
},
|
|
640
653
|
);
|
|
641
654
|
}
|
|
642
|
-
|
|
655
|
+
// A value pasted with a token's label (`'--color-accent: #e11d48'`) is
|
|
656
|
+
// a value, read by the label reader, not an option.
|
|
657
|
+
const word = rest.find(
|
|
658
|
+
w =>
|
|
659
|
+
typeof w === 'string' &&
|
|
660
|
+
w.startsWith('--') &&
|
|
661
|
+
!/^--[a-z0-9-]+\s*:\s*\S/i.test(w),
|
|
662
|
+
);
|
|
643
663
|
if (word == null) return null;
|
|
644
664
|
return cliError(
|
|
645
665
|
`unknown option '${word}': only the thing a change names may start with -- (a design token such as --color-accent).`,
|
|
@@ -777,6 +797,24 @@ function defineGroup(parent, doc) {
|
|
|
777
797
|
return cmd;
|
|
778
798
|
}
|
|
779
799
|
|
|
800
|
+
/**
|
|
801
|
+
* A preview command's result, once it is in: this client owns its process,
|
|
802
|
+
* so a stop that lands while the result is printed is held, and a printed
|
|
803
|
+
* ok never ends with exit 130. The API itself leaves no listener behind.
|
|
804
|
+
* @template T
|
|
805
|
+
* @param {Promise<T>} result
|
|
806
|
+
* @returns {Promise<T>}
|
|
807
|
+
*/
|
|
808
|
+
async function resultStands(result) {
|
|
809
|
+
const r = await result;
|
|
810
|
+
for (const sig of /** @type {const} */ (['SIGINT', 'SIGTERM']))
|
|
811
|
+
if (!process.listeners(sig).includes(heldStop)) process.on(sig, heldStop);
|
|
812
|
+
return r;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
/** A stop after a preview command finished: its result stands. */
|
|
816
|
+
function heldStop() {}
|
|
817
|
+
|
|
780
818
|
/**
|
|
781
819
|
* Register `theme` and its subcommands under the `experimental` group.
|
|
782
820
|
* @param {import('commander').Command} group the `experimental` command
|
|
@@ -908,6 +946,9 @@ export function registerExperimentalTheme(group, program) {
|
|
|
908
946
|
// A declaration pasted as one argument (`--color-accent: #e11d48`,
|
|
909
947
|
// or `--color-accent:#e11d48`) is the token and its value; with no
|
|
910
948
|
// value otherwise, the missing-argument error the parser gives.
|
|
949
|
+
// A pasted JSON object of settings goes to the editor whole, which
|
|
950
|
+
// gives one set line per entry.
|
|
951
|
+
if (!value.length && /^\s*\{/.test(thing)) value = [''];
|
|
911
952
|
if (!value.length) {
|
|
912
953
|
// Any thing, a token or a dial, with `:` or `=` (`accent: red`,
|
|
913
954
|
// `--color-accent=#e11d48`).
|
|
@@ -1026,13 +1067,15 @@ export function registerExperimentalTheme(group, program) {
|
|
|
1026
1067
|
program,
|
|
1027
1068
|
() =>
|
|
1028
1069
|
previewFlagsOnce('add', ['theme', 'template', 'top', 'path']) ??
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1070
|
+
resultStands(
|
|
1071
|
+
themeEditPreviewAdd([words ?? []].flat().join(' ') || undefined, {
|
|
1072
|
+
cwd: process.cwd(),
|
|
1073
|
+
theme: o.theme,
|
|
1074
|
+
template: o.template,
|
|
1075
|
+
top: o.top,
|
|
1076
|
+
path: o.path,
|
|
1077
|
+
}),
|
|
1078
|
+
),
|
|
1036
1079
|
r => {
|
|
1037
1080
|
const {matched, skipped, ...rest} = r.data;
|
|
1038
1081
|
return [
|
|
@@ -1073,10 +1116,12 @@ export function registerExperimentalTheme(group, program) {
|
|
|
1073
1116
|
program,
|
|
1074
1117
|
() =>
|
|
1075
1118
|
previewFlagsOnce('app', ['theme']) ??
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1119
|
+
resultStands(
|
|
1120
|
+
themeEditPreviewApp(dir, {
|
|
1121
|
+
cwd: process.cwd(),
|
|
1122
|
+
theme: o.theme,
|
|
1123
|
+
}),
|
|
1124
|
+
),
|
|
1080
1125
|
r => [
|
|
1081
1126
|
`[ok] new app in ${r.data.folder} with the theme preview`,
|
|
1082
1127
|
...project(/** @type {any} */ (r.data)),
|
|
@@ -1157,7 +1202,9 @@ export function registerExperimentalTheme(group, program) {
|
|
|
1157
1202
|
program,
|
|
1158
1203
|
() =>
|
|
1159
1204
|
previewFlagsOnce('remove', ['path']) ??
|
|
1160
|
-
|
|
1205
|
+
resultStands(
|
|
1206
|
+
themeEditPreviewRemove(page, {cwd: process.cwd(), path: o.path}),
|
|
1207
|
+
),
|
|
1161
1208
|
r => [
|
|
1162
1209
|
r.data.pages.length
|
|
1163
1210
|
? `[ok] removed ${page} from the theme preview`
|
|
@@ -1303,9 +1350,13 @@ export function registerExperimentalTheme(group, program) {
|
|
|
1303
1350
|
build: 'compile',
|
|
1304
1351
|
explain: editorThemeRefusal,
|
|
1305
1352
|
preflight: editorCompileProblem,
|
|
1353
|
+
follow: editorFollowCompile,
|
|
1306
1354
|
missingSource: editorMissingSource,
|
|
1307
1355
|
template: editorThemeTemplate,
|
|
1308
1356
|
hold: editorThemeHold,
|
|
1357
|
+
loadedFonts: editorLoadedFonts,
|
|
1358
|
+
extraData: editorBuildExtra,
|
|
1359
|
+
colorModes: editorColorModes,
|
|
1309
1360
|
},
|
|
1310
1361
|
);
|
|
1311
1362
|
}
|
|
@@ -16,7 +16,7 @@ export const doc = {
|
|
|
16
16
|
summary:
|
|
17
17
|
'Render a page to one self-contained HTML file, or turn one back into a page',
|
|
18
18
|
description:
|
|
19
|
-
"Renders the page's default export with the project's own Astryx components and writes ONE static HTML file that needs nothing beside it: no script runs and nothing loads from the network, so it opens anywhere, including a sandboxed frame with a strict content security policy, and follows the viewer's light or dark scheme. The page's own StyleX compiles, only the Core CSS rules the page uses are inlined, local images become data: URIs, and the page's source is embedded. Warnings name anything that may not look as meant, such as a component that did not render the text it was given (ListItem takes label=, not children). --reverse writes the embedded source back byte for byte; a file with Astryx markup but no embedded source is rebuilt from its components (text and layout only, as a starting point); any other HTML is refused. Experimental: it may change or be removed in a patch release.",
|
|
19
|
+
"Renders the page's default export with the project's own Astryx components and writes ONE static HTML file that needs nothing beside it: no script runs and nothing loads from the network, so it opens anywhere, including a sandboxed frame with a strict content security policy, and follows the viewer's light or dark scheme. The page's own StyleX compiles, only the Core CSS rules the page uses are inlined, local images become data: URIs, and the page's source is embedded. Warnings name anything that may not look as meant, such as a component that did not render the text it was given (ListItem takes label=, not children). The file opens with a plain note for whoever opens it next: the CLI version and render format that made it, the page's path, the files it carries, the packages it rendered with, and the exact commands that give the page back and render it again. --reverse (the way back, or unrender) writes the embedded source back byte for byte and names any text someone changed in the HTML after the render, with the file and line that hold the old text; a file with Astryx markup but no embedded source is rebuilt from its components (text and layout only, as a starting point); any other HTML is refused. Experimental: it may change or be removed in a patch release.",
|
|
20
20
|
fn: 'render',
|
|
21
21
|
args: [{name: 'file', param: 'file', required: false}],
|
|
22
22
|
options: [
|
|
@@ -53,7 +53,7 @@ export const doc = {
|
|
|
53
53
|
{code: 0, when: 'the file was written (warnings included)'},
|
|
54
54
|
{
|
|
55
55
|
code: 1,
|
|
56
|
-
when: 'no file, a wrong extension, a missing file, a page that does not compile, has no default export, imports a package that is not installed, reads a browser API while rendering, throws, crashes Node, or takes over 60 seconds; a file to write outside the current folder; with --reverse, an existing output without --overwrite, a damaged embedded source, or HTML that is not an Astryx page',
|
|
56
|
+
when: 'no file, a wrong extension, a missing file, a page that does not compile, has no default export, imports a package that is not installed, reads a browser API while rendering, throws, crashes Node, or takes over 60 seconds; a file to write outside the current folder; with --reverse, an existing output without --overwrite, a damaged embedded source, a file in a newer render format than this CLI reads, or HTML that is not an Astryx page',
|
|
57
57
|
},
|
|
58
58
|
],
|
|
59
59
|
related: ['template', 'build'],
|
|
@@ -14,7 +14,7 @@ export const doc = {
|
|
|
14
14
|
stability: 'experimental',
|
|
15
15
|
summary: 'Compile standalone themes or one keyed theme family',
|
|
16
16
|
description:
|
|
17
|
-
|
|
17
|
+
"Compiles defineTheme() sources through the same theme pipeline into scoped CSS, standard ESM, and type declarations. Compiling a theme made by experimental theme editor (themes/<theme>/<theme>.theme.ts, or its app copy src/themes/<theme>/<Theme>Theme.ts) takes that theme's lock and also writes its app copy in src/themes/<theme>/ again; --check fails while that copy is behind or gone. Ordinary mode writes one complete set per theme. --family combines one selected extension tree into the three files named by the required --family-key, ready for one CSS load and identity-only switching. With --check it writes nothing and reports source drift. --icons-specifier keeps its existing generated-module behavior. It prints one line per built theme and one line naming fonts the themes do not load; --detail full adds the install example and the font recipe, once for a batch.",
|
|
18
18
|
fn: 'themeBuild',
|
|
19
19
|
args: [
|
|
20
20
|
{
|
|
@@ -39,7 +39,7 @@ export const doc = {
|
|
|
39
39
|
flag: '-o, --out <path>',
|
|
40
40
|
param: 'options.out',
|
|
41
41
|
description:
|
|
42
|
-
|
|
42
|
+
"Output CSS file path, relative or absolute; the .js and .d.ts are written beside it (default: <theme name>.css next to the source). A folder, or a path ending in /, writes <theme name>.css into it. The path should end in .css; another name still builds, with a warning. A build never replaces the theme source (ERR_THEME_INVALID). At a path --out names, it replaces its own earlier outputs, and the output of another theme source with a warning that names both sources; any other existing file fails with ERR_FILE_EXISTS and nothing is written. Into a folder the theme editor made (folder <slug>/ holds <slug>.settings.json), a source outside that folder builds there too, with a warning; to keep the editor folder to its own theme, build beside the source, or pass an --out outside it. A build writes only inside the working directory, the defaults beside the source too (ERR_PATH_TRAVERSAL); --check writes nothing, so it compares outputs anywhere and refuses only a relative path that escapes the working directory. Single theme only: refused with more than one file or with --family (ERR_THEME_INVALID) An --out in an editor theme's app copy folder (src/themes/<theme>/, the folder itself too) is refused (ERR_INVALID_ARGUMENT): the editor writes that folder after every build",
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
flag: '--icons-specifier <specifier>',
|
|
@@ -89,7 +89,7 @@ export const doc = {
|
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
code: 1,
|
|
92
|
-
when:
|
|
92
|
+
when: "a build or validation error (an error envelope), or --check finds stale or missing outputs (the check result, with upToDate false, the stale files and code ERR_THEME_STALE, is still printed: it is a result, not an error). One exception: an editor theme whose settings changed after its build is refused (ERR_THEME_INVALID, an error envelope) before any file is checked, with `editor show <theme>` to build it again. An editor theme run from a folder other than its app root is refused (ERR_INVALID_ARGUMENT) with the `cd` to the root and the same command; `--family` does not take an editor theme (ERR_INVALID_ARGUMENT); its damaged or unbuildable settings are refused (ERR_THEME_INVALID). An editor theme's compile also writes its app copy in src/themes/<theme>/ from what it just built (its font stylesheet from the fonts the theme loads now), and --check also compares that copy once the theme's outputs are current: a copy that is kept back, missing a file or not the current build fails the check with the same check result (upToDate false, code ERR_THEME_STALE) and appCopyStale naming why. The copy's own files, its source included, are not compile targets (ERR_INVALID_ARGUMENT, naming the theme to compile)",
|
|
93
93
|
},
|
|
94
94
|
],
|
|
95
95
|
related: ['experimental theme add', 'experimental theme list'],
|