@astryxdesign/cli 0.7.16 → 0.7.17-canary.g49a475f
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 +76 -86
- package/api/build/_adapter.d.mts +12 -0
- package/api/build/_adapter.mjs +51 -34
- package/api/build/blocks/blocks.d.mts +7 -5
- package/api/build/blocks/blocks.mjs +113 -26
- package/api/build/build.doc.mjs +4 -3
- package/api/build/build.type.d.mts +2 -2
- package/api/build/build.type.mjs +3 -3
- package/api/build/kit/kind.d.mts +2 -1
- package/api/build/kit/kind.mjs +199 -10
- package/api/build/kit/kit.mjs +6 -4
- package/api/build/kit/rank.d.mts +4 -2
- package/api/build/kit/rank.mjs +125 -24
- package/api/build/kit/start.d.mts +5 -4
- package/api/build/kit/start.mjs +12 -8
- package/api/build/kit/weights.d.mts +39 -3
- package/api/build/kit/weights.json +1 -1
- package/api/build/kit/weights.mjs +340 -43
- 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 +48 -0
- package/api/build/kit/words.mjs +90 -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 +48 -6
- package/api/discover/_adapter.d.mts +1 -1
- package/api/discover/search/search.mjs +3 -2
- package/api/docs/_adapter.d.mts +26 -2
- package/api/docs/_adapter.mjs +219 -6
- 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 +83 -10
- package/api/doctor/built-checks.mjs +40 -14
- 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/icon/_records.mjs +2 -1
- package/api/index.d.mts +2 -0
- package/api/index.mjs +2 -0
- package/api/integration/_adapter.d.mts +44 -0
- package/api/integration/_adapter.mjs +77 -1
- package/api/integration/authoring-checks.mjs +6 -6
- package/api/integration/example-scope.d.mts +14 -0
- package/api/integration/example-scope.mjs +44 -0
- package/api/integration/example-scope.type.d.mts +29 -0
- package/api/integration/example-scope.type.mjs +25 -0
- package/api/integration/integrationExampleScope.doc.d.mts +11 -0
- package/api/integration/integrationExampleScope.doc.mjs +59 -0
- package/api/integration/validate-integration.mjs +19 -1
- package/api/integration/validate-integration.type.d.mts +9 -0
- package/api/integration/validate-integration.type.mjs +1 -1
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/render/_adapter.mjs +591 -195
- package/api/render/render.doc.mjs +11 -3
- package/api/render/render.type.d.mts +52 -0
- package/api/render/render.type.mjs +31 -1
- package/api/search/ORDERING.md +1 -1
- package/api/search/_adapter.d.mts +9 -0
- package/api/search/_adapter.mjs +85 -0
- package/api/search/_candidate-score.mjs +51 -32
- package/api/search/_fit-order.mjs +3 -3
- package/api/search/_gather-components.d.mts +3 -2
- package/api/search/_gather-components.mjs +12 -3
- package/api/search/_lexical.d.mts +5 -0
- package/api/search/_lexical.mjs +8 -2
- package/api/search/_result.d.mts +11 -9
- package/api/search/_result.mjs +4 -4
- package/api/search/_score.d.mts +6 -1
- package/api/search/_score.mjs +15 -3
- package/api/search/search-index.mjs +7 -1
- package/api/search/search.d.mts +1 -1
- package/api/theme/_adapter.mjs +12 -1
- package/api/theme/build/build.d.mts +75 -0
- package/api/theme/build/build.mjs +243 -58
- package/api/theme/build/font-warning.d.mts +7 -0
- package/api/theme/build/font-warning.mjs +17 -0
- package/api/theme/theme.type.d.mts +10 -0
- package/api/theme/theme.type.mjs +7 -1
- package/api/theme-edit/_adapter.d.mts +63 -2
- package/api/theme-edit/_adapter.mjs +771 -57
- package/api/theme-edit/_check.d.mts +40 -22
- package/api/theme-edit/_check.mjs +2029 -336
- package/api/theme-edit/_color.d.mts +10 -0
- package/api/theme-edit/_color.mjs +49 -1
- package/api/theme-edit/_compiler.mjs +9 -0
- package/api/theme-edit/_context.d.mts +3 -3
- package/api/theme-edit/_context.mjs +111 -48
- package/api/theme-edit/_css.d.mts +14 -0
- package/api/theme-edit/_css.mjs +46 -1
- package/api/theme-edit/_edit.d.mts +18 -4
- package/api/theme-edit/_edit.mjs +1685 -155
- package/api/theme-edit/_how-commands.d.mts +65 -0
- package/api/theme-edit/_how-commands.mjs +633 -1
- package/api/theme-edit/_how-question.d.mts +84 -0
- package/api/theme-edit/_how-question.mjs +5124 -281
- package/api/theme-edit/_how.mjs +140 -29
- package/api/theme-edit/_marks.d.mts +31 -5
- package/api/theme-edit/_marks.mjs +57 -5
- package/api/theme-edit/_name-rule.d.mts +11 -0
- package/api/theme-edit/_name-rule.mjs +12 -0
- package/api/theme-edit/_normal.d.mts +257 -0
- package/api/theme-edit/_normal.mjs +1252 -0
- package/api/theme-edit/_palette.mjs +10 -4
- package/api/theme-edit/_parts.d.mts +10 -1
- package/api/theme-edit/_parts.mjs +179 -3
- package/api/theme-edit/_preview-app.d.mts +7 -1
- package/api/theme-edit/_preview-app.mjs +515 -148
- package/api/theme-edit/_preview.d.mts +100 -14
- package/api/theme-edit/_preview.mjs +549 -137
- package/api/theme-edit/_settings.d.mts +347 -30
- package/api/theme-edit/_settings.mjs +2971 -327
- package/api/theme-edit/_tables.d.mts +6 -0
- package/api/theme-edit/_tables.mjs +44 -1
- package/api/theme-edit/_vet.d.mts +18 -0
- package/api/theme-edit/_vet.mjs +32 -0
- 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/themeEditHow.doc.mjs +1 -1
- package/api/theme-edit/themeEditNew.doc.d.mts +0 -1
- package/api/theme-edit/themeEditNew.doc.mjs +7 -4
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +3 -3
- package/api/theme-edit/themeEditPreviewRemove.doc.mjs +2 -2
- package/api/upgrade/run/run.mjs +4 -3
- package/assets/codemods/integration-discovery.mjs +2 -1
- package/assets/codemods/run-codemod.mjs +87 -7
- 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/component-list.generated.json +1 -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/checks.doc.mjs +1 -1
- package/assets/docs/tree/cli-command.doc.mjs +2 -3
- package/assets/docs/tree/render-pages.doc.mjs +44 -3
- package/assets/docs/tree/single-component.doc.mjs +4 -0
- 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/search-catalog.generated.json +2 -0
- 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/Hooks/useContainerRevealHookUsage.tsx +2 -2
- 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/assets/theme.template.ts +6 -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/component/categories.d.mts +37 -0
- package/authoring/doctypes/component/categories.mjs +54 -0
- package/authoring/doctypes/template/template.doc.mjs +1 -1
- package/authoring/doctypes/template/type.ts +9 -0
- package/authoring/example/example.doc.d.mts +12 -0
- package/authoring/example/example.doc.mjs +69 -0
- package/authoring/example/preview.d.mts +92 -0
- package/authoring/example/preview.mjs +994 -0
- package/authoring/example/type.ts +102 -0
- package/authoring/index.d.mts +1 -0
- package/authoring/index.d.ts +12 -0
- package/authoring/index.mjs +3 -1
- 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 +22 -3
- package/clients/cli/commands/docs.doc.mjs +7 -1
- package/clients/cli/commands/docs.mjs +3 -1
- package/clients/cli/commands/doctor.mjs +32 -14
- package/clients/cli/commands/experimental/render.mjs +42 -1
- package/clients/cli/commands/experimental/theme.mjs +163 -28
- 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-how.doc.mjs +87 -1
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +10 -3
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +2 -2
- 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/experimental-theme-preview-remove.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-preview.doc.mjs +2 -1
- package/clients/cli/commands/experimental-theme.doc.mjs +5 -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 +209 -8
- package/clients/cli/commands/upgrade.mjs +42 -7
- package/clients/cli/index.mjs +1 -1
- package/clients/cli/lib/cli-error.mjs +2 -1
- package/clients/cli/lib/component-format.mjs +205 -98
- package/clients/cli/lib/hook-format.mjs +9 -19
- package/clients/cli/lib/json-shim.mjs +77 -21
- package/clients/cli/lib/manifest.mjs +3 -2
- 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/authoring-self-docs.mjs +1 -0
- package/foundation/discovery/component-discovery.d.mts +11 -0
- package/foundation/discovery/component-discovery.mjs +56 -8
- package/foundation/discovery/component-replacement.mjs +130 -1
- package/foundation/discovery/copied-passages.mjs +2 -1
- package/foundation/discovery/doc-types.mjs +4 -3
- 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 +22 -8
- package/foundation/discovery/icon-definition-discovery.mjs +2 -1
- package/foundation/discovery/icon-set-checks.mjs +2 -1
- package/foundation/discovery/icon-set-discovery.mjs +2 -1
- package/foundation/discovery/integration-doc-files.mjs +2 -1
- package/foundation/discovery/package-exports.d.mts +10 -0
- package/foundation/discovery/package-exports.mjs +56 -3
- package/foundation/discovery/prop-drift.mjs +9 -9
- package/foundation/discovery/runner-allowlist.d.mts +1 -0
- package/foundation/discovery/runner-allowlist.mjs +2 -0
- package/foundation/discovery/stored-component-list.d.mts +43 -0
- package/foundation/discovery/stored-component-list.mjs +90 -0
- package/foundation/discovery/stored-search-catalog.d.mts +115 -0
- package/foundation/discovery/stored-search-catalog.mjs +297 -0
- package/foundation/discovery/stored-self-audit.d.mts +26 -10
- package/foundation/discovery/stored-self-audit.mjs +38 -18
- package/foundation/discovery/template-adapter.d.mts +52 -0
- package/foundation/discovery/template-adapter.mjs +176 -12
- package/foundation/discovery/template-icons.mjs +2 -1
- package/foundation/discovery/theme-discovery.mjs +3 -2
- package/foundation/discovery/theme-imports.d.mts +14 -0
- package/foundation/discovery/theme-imports.mjs +43 -1
- package/foundation/discovery/theming-targets.mjs +3 -2
- package/foundation/doc-compiler/import.mjs +7 -1
- package/foundation/doc-compiler/inputs.mjs +3 -2
- 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/env/semver.mjs +3 -1
- package/foundation/fonts/font-stylesheet.d.mts +31 -0
- package/foundation/fonts/font-stylesheet.mjs +115 -0
- package/foundation/fs/cache-eviction.d.mts +21 -0
- package/foundation/fs/cache-eviction.mjs +73 -0
- package/foundation/fs/file-protection.mjs +4 -3
- package/foundation/fs/gather-cache.d.mts +25 -4
- package/foundation/fs/gather-cache.mjs +164 -55
- 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/listing-cache.d.mts +7 -0
- package/foundation/fs/listing-cache.mjs +10 -0
- package/foundation/fs/module-loader.d.mts +24 -2
- package/foundation/fs/module-loader.mjs +94 -21
- package/foundation/fs/paths.d.mts +18 -0
- package/foundation/fs/paths.mjs +15 -2
- package/foundation/identity/provider-identity.d.mts +6 -0
- package/foundation/identity/provider-identity.mjs +10 -1
- package/foundation/integrations/contribution-inventory.mjs +4 -3
- package/foundation/integrations/example-code.d.mts +63 -0
- package/foundation/integrations/example-code.mjs +416 -0
- package/foundation/integrations/public-imports.d.mts +9 -0
- package/foundation/integrations/public-imports.mjs +3 -2
- package/foundation/integrations/validate-contributions.mjs +17 -45
- package/foundation/render/embedded-files.d.mts +6 -0
- package/foundation/render/embedded-files.mjs +25 -5
- package/foundation/render/embedded-imports.d.mts +39 -7
- package/foundation/render/embedded-imports.mjs +66 -27
- 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 +121 -13
- package/foundation/render/picture-chrome.d.mts +4 -0
- package/foundation/render/picture-chrome.mjs +185 -0
- package/foundation/render/picture-playwright.d.mts +4 -0
- package/foundation/render/picture-playwright.mjs +34 -0
- package/foundation/render/rebuild.mjs +2 -1
- package/foundation/render/render-page.d.mts +35 -3
- package/foundation/render/render-page.mjs +316 -42
- package/foundation/render/source-block.d.mts +85 -6
- package/foundation/render/source-block.mjs +211 -20
- package/foundation/render/ts-paths.d.mts +69 -6
- package/foundation/render/ts-paths.mjs +326 -40
- 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 +11 -1
- package/foundation/response/response-types.doc.mjs +2 -2
- package/foundation/text/compare-text.d.mts +14 -0
- package/foundation/text/compare-text.mjs +68 -0
- package/foundation/text/string-utils.d.mts +3 -2
- package/foundation/text/string-utils.mjs +18 -4
- package/foundation/text/suggest-order.d.mts +9 -0
- package/foundation/text/suggest-order.mjs +15 -1
- package/foundation/xle/expand.mjs +2 -1
- package/host/index.mjs +8 -6
- package/package.json +7 -6
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Types for reading a doc example as a module that runs on its own.
|
|
5
|
+
* @input Nothing; types only.
|
|
6
|
+
* @output ExampleScope, PreviewableExample, ExampleProblem and the names they
|
|
7
|
+
* compose from.
|
|
8
|
+
* @position packages/cli/authoring/example — the contract `preview.mjs`
|
|
9
|
+
* implements and `example.doc.mjs` documents.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Why an example that is not `kind: 'setup'` cannot run on its own.
|
|
14
|
+
* - `example_does_not_compile`: the code is not a TSX module (a top-level
|
|
15
|
+
* `return`, code that stops partway, a syntax error).
|
|
16
|
+
* - `example_renders_nothing`: no default export, no component, and no JSX
|
|
17
|
+
* at the end.
|
|
18
|
+
* - `example_undefined_name`: a name the example never defines or imports
|
|
19
|
+
* and its scope does not provide.
|
|
20
|
+
* - `example_server_only`: it imports code that runs only on a server,
|
|
21
|
+
* renders an async server component, or reads `process.env`.
|
|
22
|
+
* - `example_import_unresolvable`: it imports a relative path, or a package
|
|
23
|
+
* its package does not declare.
|
|
24
|
+
*/
|
|
25
|
+
export type ExampleProblemCode =
|
|
26
|
+
| 'example_does_not_compile'
|
|
27
|
+
| 'example_renders_nothing'
|
|
28
|
+
| 'example_undefined_name'
|
|
29
|
+
| 'example_server_only'
|
|
30
|
+
| 'example_import_unresolvable';
|
|
31
|
+
|
|
32
|
+
/** One reason an example cannot preview, with what to change. */
|
|
33
|
+
export interface ExampleProblem {
|
|
34
|
+
code: ExampleProblemCode;
|
|
35
|
+
/** What is wrong and what it breaks, as one clause. */
|
|
36
|
+
message: string;
|
|
37
|
+
/** What to change, as one or two sentences. */
|
|
38
|
+
fix: string;
|
|
39
|
+
/**
|
|
40
|
+
* The names an `example_undefined_name` problem found, in order of use, or
|
|
41
|
+
* the server component an `example_server_only` problem found.
|
|
42
|
+
*/
|
|
43
|
+
names?: string[];
|
|
44
|
+
/** The import an import problem is about. */
|
|
45
|
+
specifier?: string;
|
|
46
|
+
/** Where a `example_does_not_compile` problem is, 1-based. */
|
|
47
|
+
line?: number;
|
|
48
|
+
/** Where a `example_does_not_compile` problem is, 0-based. */
|
|
49
|
+
column?: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** A name an example may use without importing it, and where it comes from. */
|
|
53
|
+
export interface ExampleScopeName {
|
|
54
|
+
name: string;
|
|
55
|
+
/** The module specifier an app imports the name from. */
|
|
56
|
+
import: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* What an example may use without importing it, and what it may import, as
|
|
61
|
+
* JSON: one tool can build it (`integrationExampleScope` in
|
|
62
|
+
* `@astryxdesign/cli/api`) and store it, and another read examples with it.
|
|
63
|
+
* When two lists give one name, the package's own wins over Core's, and
|
|
64
|
+
* Core's over React's.
|
|
65
|
+
*/
|
|
66
|
+
export interface ExampleScope {
|
|
67
|
+
/** The package the example documents. It may import itself. */
|
|
68
|
+
packageName: string;
|
|
69
|
+
/** Each component the package documents. */
|
|
70
|
+
packageNames: ReadonlyArray<ExampleScopeName>;
|
|
71
|
+
/** Each component and hook Core documents. */
|
|
72
|
+
coreNames: ReadonlyArray<ExampleScopeName>;
|
|
73
|
+
/** React's named exports. `React` itself is the namespace. */
|
|
74
|
+
reactNames: ReadonlyArray<string>;
|
|
75
|
+
/**
|
|
76
|
+
* The packages the package declares in `dependencies`,
|
|
77
|
+
* `peerDependencies` and `optionalDependencies`. React and Core may always
|
|
78
|
+
* be imported.
|
|
79
|
+
*/
|
|
80
|
+
dependencies: ReadonlyArray<string>;
|
|
81
|
+
/**
|
|
82
|
+
* The package's own import specifiers whose module runs only on a server
|
|
83
|
+
* (it imports `server-only`), such as `'@acme/widgets/server'`. Every scope
|
|
84
|
+
* also counts `server-only`, `next/headers`, `next/server`, `next/cache` and
|
|
85
|
+
* a Node built-in the package does not install.
|
|
86
|
+
*/
|
|
87
|
+
serverOnlyModules?: ReadonlyArray<string>;
|
|
88
|
+
/**
|
|
89
|
+
* The package's documented components that only a server renders: async
|
|
90
|
+
* function components. An example that renders one is server-only.
|
|
91
|
+
*/
|
|
92
|
+
serverComponents?: ReadonlyArray<string>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* An example read as a module. A previewable example's `module` imports
|
|
97
|
+
* every scope name it uses and default-exports what it renders.
|
|
98
|
+
*/
|
|
99
|
+
export type PreviewableExample =
|
|
100
|
+
| {previewable: true; module: string}
|
|
101
|
+
| {previewable: false; setup: true}
|
|
102
|
+
| {previewable: false; setup: false; problems: ExampleProblem[]};
|
package/authoring/index.d.mts
CHANGED
|
@@ -19,5 +19,6 @@ export { parseNamespace } from "./doctypes/namespace/parse.mjs";
|
|
|
19
19
|
export { parseTheme } from "./doctypes/theme/parse.mjs";
|
|
20
20
|
export { parseIconDefinition } from "./doctypes/icon-definition/parse.mjs";
|
|
21
21
|
export { parseLegacyDoc } from "./doctypes/legacy.mjs";
|
|
22
|
+
export { previewableExample } from "./example/preview.mjs";
|
|
22
23
|
export { parseGapReportHandler, parseGapReportReceipt } from "./gap-report/parse.mjs";
|
|
23
24
|
export { parseIconSet, parseIconSetData } from "./doctypes/icon-set/parse.mjs";
|
package/authoring/index.d.ts
CHANGED
|
@@ -88,6 +88,18 @@ export {parseDiscoverCatalog} from './discover/parse.mjs';
|
|
|
88
88
|
export {parseCodemod} from './codemod/parse.mjs';
|
|
89
89
|
export {parseDebugEvent} from './debug/parse.mjs';
|
|
90
90
|
|
|
91
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
92
|
+
// EXAMPLES — whether a doc example runs on its own, as a live preview does.
|
|
93
|
+
// ═══════════════════════════════════════════════════════════════════════
|
|
94
|
+
export {previewableExample} from './example/preview.mjs';
|
|
95
|
+
export type {
|
|
96
|
+
ExampleScope,
|
|
97
|
+
ExampleScopeName,
|
|
98
|
+
PreviewableExample,
|
|
99
|
+
ExampleProblem,
|
|
100
|
+
ExampleProblemCode,
|
|
101
|
+
} from './example/type.js';
|
|
102
|
+
|
|
91
103
|
// ═══════════════════════════════════════════════════════════════════════
|
|
92
104
|
// FIELD & SUB-TYPES — the building blocks of the docs above. Import these
|
|
93
105
|
// only to annotate a part directly (or to read/render docs); you rarely
|
package/authoring/index.mjs
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Authoring is a pure data contract: TYPES authors write plain objects against,
|
|
7
7
|
* and PARSERS the CLI calls to turn `unknown` into the typed shape (or throw a
|
|
8
|
-
* readable error) at the load boundary.
|
|
8
|
+
* readable error) at the load boundary. `previewableExample` reads a doc
|
|
9
|
+
* example as the module a live preview runs, or says why it cannot run. Zod is an implementation detail sealed
|
|
9
10
|
* inside each parser — it is never exported here and never appears in a public
|
|
10
11
|
* type. There are no `create*` factories: author a plain object and stamp its
|
|
11
12
|
* `type` directly.
|
|
@@ -39,3 +40,4 @@ export {parseIconSet, parseIconSetData} from './doctypes/icon-set/parse.mjs';
|
|
|
39
40
|
/** @experimental Icon definitions may change or be removed in a patch release. */
|
|
40
41
|
export {parseIconDefinition} from './doctypes/icon-definition/parse.mjs';
|
|
41
42
|
export {parseLegacyDoc} from './doctypes/legacy.mjs';
|
|
43
|
+
export {previewableExample} from './example/preview.mjs';
|
|
@@ -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":"fffc57e8f9aeee09a38706cfc22866b56c25c2818634aa067aa83991681efc8e"}
|
|
@@ -31,6 +31,7 @@ import {Project} from '../../../foundation/config/project.mjs';
|
|
|
31
31
|
import {warnOnIntegrationIssues} from '../../../foundation/integrations/integration-warnings.mjs';
|
|
32
32
|
import {doc as componentCommand} from './component.doc.mjs';
|
|
33
33
|
import {doc as componentFn} from '../../../api/component/component.doc.mjs';
|
|
34
|
+
import {compareText} from '../../../foundation/text/compare-text.mjs';
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
37
|
* The api layer's component() widens its return to `{type: string, data: unknown}`,
|
|
@@ -95,9 +96,16 @@ function summarize(result) {
|
|
|
95
96
|
* @param {string} requestedName
|
|
96
97
|
* @param {'full'|'compact'|'brief'} detail
|
|
97
98
|
* @param {Awaited<ReturnType<typeof resolveTheme>>} themeData
|
|
99
|
+
* @param {string} [scopePackage] - the `--package` the read was scoped to
|
|
98
100
|
* @returns {import('../formatters/index.mjs').Block[]}
|
|
99
101
|
*/
|
|
100
|
-
function componentDetailBlocks(
|
|
102
|
+
function componentDetailBlocks(
|
|
103
|
+
result,
|
|
104
|
+
requestedName,
|
|
105
|
+
detail,
|
|
106
|
+
themeData,
|
|
107
|
+
scopePackage,
|
|
108
|
+
) {
|
|
101
109
|
const requested = (requestedName.split('/').pop() ?? requestedName).replace(
|
|
102
110
|
/^XDS/,
|
|
103
111
|
'',
|
|
@@ -110,6 +118,12 @@ function componentDetailBlocks(result, requestedName, detail, themeData) {
|
|
|
110
118
|
result.data.replaces === requested
|
|
111
119
|
? result.data.name
|
|
112
120
|
: requested;
|
|
121
|
+
// The command that prints this read's props whole names the read's own
|
|
122
|
+
// selector and scope, so it resolves to the same component.
|
|
123
|
+
const scope = scopePackage ? ` --package ${scopePackage}` : '';
|
|
124
|
+
const propsCommand = requestedName
|
|
125
|
+
? `component ${requestedName}${scope} --props`
|
|
126
|
+
: null;
|
|
113
127
|
switch (result.type) {
|
|
114
128
|
case 'component.detail': {
|
|
115
129
|
/** @type {import('../formatters/index.mjs').Block[]} */
|
|
@@ -126,12 +140,15 @@ function componentDetailBlocks(result, requestedName, detail, themeData) {
|
|
|
126
140
|
)
|
|
127
141
|
: detail === 'compact'
|
|
128
142
|
? code(
|
|
129
|
-
formatCompact(result.data, resolvedName, result.data.import
|
|
143
|
+
formatCompact(result.data, resolvedName, result.data.import, {
|
|
144
|
+
propsCommand,
|
|
145
|
+
}),
|
|
130
146
|
)
|
|
131
147
|
: code(
|
|
132
148
|
formatFull(result.data, {
|
|
133
149
|
themeData,
|
|
134
150
|
importHint: result.data.import,
|
|
151
|
+
propsCommand,
|
|
135
152
|
}),
|
|
136
153
|
),
|
|
137
154
|
);
|
|
@@ -380,7 +397,7 @@ export function registerComponent(program) {
|
|
|
380
397
|
const firstGroup = Object.entries(groups)[0];
|
|
381
398
|
const entries =
|
|
382
399
|
options.category && firstGroup ? firstGroup[1] : Object.values(groups).flat();
|
|
383
|
-
const sorted = [...entries].sort((a, b) => a.name
|
|
400
|
+
const sorted = [...entries].sort((a, b) => compareText(a.name, b.name));
|
|
384
401
|
|
|
385
402
|
emit(
|
|
386
403
|
options.category && firstGroup
|
|
@@ -425,6 +442,7 @@ export function registerComponent(program) {
|
|
|
425
442
|
row.selector,
|
|
426
443
|
detail,
|
|
427
444
|
themeData,
|
|
445
|
+
options.package,
|
|
428
446
|
),
|
|
429
447
|
);
|
|
430
448
|
continue;
|
|
@@ -472,6 +490,7 @@ export function registerComponent(program) {
|
|
|
472
490
|
name ?? '',
|
|
473
491
|
detail,
|
|
474
492
|
themeData,
|
|
493
|
+
options.package,
|
|
475
494
|
),
|
|
476
495
|
);
|
|
477
496
|
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
|
}
|
|
@@ -308,6 +316,16 @@ function printIntegrationValidation(data, seen) {
|
|
|
308
316
|
}),
|
|
309
317
|
]
|
|
310
318
|
: []),
|
|
319
|
+
...(data.exampleCode && data.exampleCode.unchecked.length > 0
|
|
320
|
+
? [
|
|
321
|
+
text(
|
|
322
|
+
`[info] Examples not checked: ${data.exampleCode.unchecked.length}:`,
|
|
323
|
+
),
|
|
324
|
+
records(data.exampleCode.unchecked, {
|
|
325
|
+
fields: ['file', 'example', 'reason'],
|
|
326
|
+
}),
|
|
327
|
+
]
|
|
328
|
+
: []),
|
|
311
329
|
);
|
|
312
330
|
}
|
|
313
331
|
|
|
@@ -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({
|
|
@@ -90,6 +92,7 @@ export function registerExperimentalRender(group, program) {
|
|
|
90
92
|
output: d.output,
|
|
91
93
|
files: d.files.join(', '),
|
|
92
94
|
...(d.missing?.length ? {missing: d.missing.join(', ')} : {}),
|
|
95
|
+
...(d.aliased ? {aliased: d.aliased.imports.map(a => `${a.import} (${a.file})`).join(', ')} : {}),
|
|
93
96
|
...(d.mode === 'rebuilt'
|
|
94
97
|
? {
|
|
95
98
|
components: (d.components ?? []).join(', ') || 'none',
|
|
@@ -98,6 +101,12 @@ export function registerExperimentalRender(group, program) {
|
|
|
98
101
|
...(d.unknown?.length ? {unknown: d.unknown.join(', ')} : {}),
|
|
99
102
|
}
|
|
100
103
|
: {}),
|
|
104
|
+
...(d.format === undefined ? {} : {format: d.format}),
|
|
105
|
+
...(d.renderedBy ? {renderedBy: d.renderedBy} : {}),
|
|
106
|
+
...(d.packages ? {packages: d.packages.join(', ') || 'none'} : {}),
|
|
107
|
+
...(d.title === undefined ? {} : {title: d.title}),
|
|
108
|
+
...(d.edited === undefined ? {} : {edited: d.edited}),
|
|
109
|
+
...(d.stylesEdited === undefined ? {} : {stylesEdited: d.stylesEdited}),
|
|
101
110
|
}),
|
|
102
111
|
...(d.mode === 'rebuilt'
|
|
103
112
|
? [
|
|
@@ -106,6 +115,38 @@ export function registerExperimentalRender(group, program) {
|
|
|
106
115
|
),
|
|
107
116
|
]
|
|
108
117
|
: []),
|
|
118
|
+
...(d.aliased
|
|
119
|
+
? [
|
|
120
|
+
text(
|
|
121
|
+
`The page imports ${d.aliased.imports.length === 1 ? 'a file' : 'files'} through a path alias this project does not have, so ${d.aliased.imports.length === 1 ? 'it' : 'they'} came back in the page's own layout. To build or render the page again, set the "paths" of ${d.aliased.config} (create it if it is not there) to: ${Object.entries(d.aliased.paths)
|
|
122
|
+
.map(([key, targets]) => `${JSON.stringify(key)}: ${JSON.stringify(targets)}`)
|
|
123
|
+
.join(', ')}.`,
|
|
124
|
+
),
|
|
125
|
+
]
|
|
126
|
+
: []),
|
|
127
|
+
...(d.edited
|
|
128
|
+
? [
|
|
129
|
+
section('Changed after the render'),
|
|
130
|
+
...(edits.length > 0
|
|
131
|
+
? edits.map(edit =>
|
|
132
|
+
record({
|
|
133
|
+
was: edit.was ?? '(added after the render)',
|
|
134
|
+
now: edit.now ?? '(removed after the render)',
|
|
135
|
+
...(edit.file ? {file: edit.file, line: edit.line} : {}),
|
|
136
|
+
}),
|
|
137
|
+
)
|
|
138
|
+
: [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.')]),
|
|
139
|
+
...(d.moreEdits ? [record({moreEdits: d.moreEdits})] : []),
|
|
140
|
+
text('The restored files are the page as rendered, without these changes: make them in the restored files, then render again.'),
|
|
141
|
+
]
|
|
142
|
+
: []),
|
|
143
|
+
...(d.mode === 'embedded'
|
|
144
|
+
? [
|
|
145
|
+
text(
|
|
146
|
+
`Render it again: ${run} experimental render ${shellArg(d.output)} --out ${shellArg(d.input)}${d.title === undefined ? '' : ` --title ${shellArg(d.title)}`}`,
|
|
147
|
+
),
|
|
148
|
+
]
|
|
149
|
+
: []),
|
|
109
150
|
);
|
|
110
151
|
return answered;
|
|
111
152
|
},
|