@astryxdesign/cli 0.6.3-canary.f22695a → 0.6.3
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 +1 -2
- package/api/build/build.type.d.mts +2 -2
- package/api/build/build.type.mjs +2 -2
- package/api/component/component.type.d.mts +6 -6
- package/api/component/component.type.mjs +19 -19
- package/api/discover/discover.type.d.mts +4 -4
- package/api/discover/discover.type.mjs +10 -10
- package/api/docs/_adapter.d.mts +24 -37
- package/api/docs/_adapter.mjs +83 -169
- package/api/docs/detail/detail.mjs +63 -14
- package/api/docs/detail/section/section.d.mts +1 -1
- package/api/docs/detail/section/section.mjs +20 -44
- package/api/docs/detail/section/section.test.mjs +0 -41
- package/api/docs/docs.d.mts +2 -7
- package/api/docs/docs.doc.mjs +10 -27
- package/api/docs/docs.mjs +9 -16
- package/api/docs/docs.test.mjs +0 -6
- package/api/docs/docs.type.d.mts +3 -40
- package/api/docs/docs.type.mjs +8 -36
- package/api/docs/integrationDocs.test.mjs +0 -106
- package/api/doctor/doctor.d.mts +0 -48
- package/api/doctor/doctor.mjs +0 -232
- package/api/doctor/doctor.test.mjs +0 -196
- package/api/hook/hook.type.d.mts +3 -3
- package/api/hook/hook.type.mjs +11 -11
- package/api/hook/list/list.d.mts +1 -1
- package/api/integration/add-contribution.mjs +3 -5
- package/api/integration/add-contribution.test.mjs +4 -4
- package/api/integration/integration-authoring.type.d.mts +1 -1
- package/api/integration/pack-check.mjs +7 -49
- package/api/integration/pack-check.test.mjs +0 -249
- package/api/search/search.d.mts +1 -1
- package/api/search/search.mjs +5 -5
- package/api/search/search.type.d.mts +2 -2
- package/api/search/search.type.mjs +1 -1
- package/api/swizzle/swizzle.type.d.mts +2 -2
- package/api/swizzle/swizzle.type.mjs +2 -2
- package/api/template/template.d.mts +1 -1
- package/api/template/template.type.d.mts +6 -6
- package/api/template/template.type.mjs +12 -12
- package/api/theme/build/build.mjs +6 -20
- package/api/theme/build/build.test.mjs +0 -127
- package/api/theme/palette/generate/generate.mjs +1 -1
- package/api/theme/palette/generate/generator.d.mts +13 -10
- package/api/theme/palette/generate/generator.mjs +3 -7
- package/api/theme/theme.type.d.mts +11 -170
- package/api/theme/theme.type.mjs +27 -94
- package/api/upgrade/_adapter.mjs +5 -71
- package/api/upgrade/upgrade.doc.mjs +3 -4
- package/api/upgrade/upgrade.type.d.mts +5 -5
- package/api/upgrade/upgrade.type.mjs +11 -11
- package/assets/codemods/integration-discovery.mjs +2 -40
- package/assets/codemods/integration-discovery.test.mjs +0 -58
- package/assets/codemods/transforms/v0.3.0/__tests__/unwrap-authoring-factories.test.mjs +5 -27
- package/assets/codemods/transforms/v0.3.0/unwrap-authoring-factories.mjs +5 -20
- package/assets/docs/README.md +0 -9
- package/assets/docs/cli-integrations.doc.mjs +15 -86
- package/assets/docs/styling-libraries.doc.mjs +1 -1
- package/assets/docs/working-with-ai.doc.mjs +1 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.doc.mjs +3 -19
- package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +65 -383
- package/authoring/_shared/contract.ts +0 -22
- package/authoring/codemod/codemod.doc.mjs +1 -6
- package/authoring/codemod/parse.d.mts +8 -8
- package/authoring/codemod/parse.mjs +6 -8
- package/authoring/config/parse.d.mts +13 -13
- package/authoring/config/parse.mjs +8 -8
- package/authoring/config/type.ts +3 -3
- package/authoring/debug/parse.d.mts +5 -5
- package/authoring/debug/parse.mjs +3 -3
- package/authoring/doctypes/_schema.d.mts +23 -788
- package/authoring/doctypes/_schema.mjs +39 -492
- package/authoring/doctypes/base/type.ts +0 -40
- package/authoring/doctypes/command/command.doc.mjs +2 -3
- package/authoring/doctypes/command/parse.d.mts +2 -2
- package/authoring/doctypes/command/parse.mjs +1 -1
- package/authoring/doctypes/command/type.ts +2 -3
- package/authoring/doctypes/component/component.doc.mjs +3 -6
- package/authoring/doctypes/component/parse.d.mts +2 -2
- package/authoring/doctypes/component/parse.mjs +1 -1
- package/authoring/doctypes/component/type.ts +3 -4
- package/authoring/doctypes/enum/parse.d.mts +2 -2
- package/authoring/doctypes/enum/parse.mjs +1 -1
- package/authoring/doctypes/enum/type.ts +1 -3
- package/authoring/doctypes/function/function.doc.mjs +0 -4
- package/authoring/doctypes/function/parse.d.mts +2 -2
- package/authoring/doctypes/function/parse.mjs +1 -1
- package/authoring/doctypes/function/type.ts +2 -6
- package/authoring/doctypes/hook/hook.doc.mjs +0 -4
- package/authoring/doctypes/hook/parse.d.mts +2 -2
- package/authoring/doctypes/hook/parse.mjs +1 -1
- package/authoring/doctypes/hook/type.ts +2 -3
- package/authoring/doctypes/legacy.d.mts +6 -8
- package/authoring/doctypes/legacy.mjs +4 -5
- package/authoring/doctypes/parse.d.mts +18 -20
- package/authoring/doctypes/parse.mjs +10 -16
- package/authoring/doctypes/parse.test.mjs +3 -77
- package/authoring/doctypes/reference/parse.d.mts +2 -2
- package/authoring/doctypes/reference/parse.mjs +5 -8
- package/authoring/doctypes/reference/reference.doc.mjs +4 -17
- package/authoring/doctypes/reference/type.ts +5 -51
- package/authoring/doctypes/schema/parse.d.mts +2 -2
- package/authoring/doctypes/schema/parse.mjs +1 -1
- package/authoring/doctypes/schema/type.ts +2 -3
- package/authoring/doctypes/template/parse.d.mts +1 -92
- package/authoring/doctypes/template/parse.mjs +2 -36
- package/authoring/doctypes/template/parse.test.mjs +2 -8
- package/authoring/doctypes/template/template.doc.mjs +0 -4
- package/authoring/doctypes/template/type.ts +2 -5
- package/authoring/doctypes/types.ts +9 -10
- package/authoring/gap-report/parse.d.mts +10 -10
- package/authoring/gap-report/parse.mjs +6 -6
- package/authoring/gap-report/type.ts +1 -1
- package/authoring/index.d.mts +0 -1
- package/authoring/index.d.ts +17 -49
- package/authoring/index.mjs +0 -1
- package/authoring/integration/integration.doc.mjs +6 -13
- package/authoring/integration/parse.d.mts +2 -2
- package/authoring/integration/parse.mjs +1 -1
- package/authoring/integration/parse.test.mjs +1 -10
- package/authoring/integration/schema.d.mts +4 -6
- package/authoring/integration/schema.mjs +3 -9
- package/authoring/integration/type.ts +6 -23
- package/authoring/shadcn/receipt.d.mts +6 -6
- package/clients/cli/commands/docs.doc.mjs +3 -13
- package/clients/cli/commands/docs.mjs +21 -121
- package/clients/cli/commands/docs.test.mjs +0 -88
- package/clients/cli/commands/integration-authoring.test.mjs +9 -13
- package/clients/cli/commands/theme-palette-generate.doc.mjs +4 -8
- package/clients/cli/commands/upgrade.doc.mjs +2 -2
- package/clients/cli/formatters/index.mjs +1 -162
- package/clients/cli/formatters/index.test.mjs +0 -91
- package/clients/cli/lib/manifest.mjs +2 -7
- package/foundation/config/project.mjs +6 -21
- package/foundation/discovery/component-discovery.d.mts +1 -1
- package/foundation/discovery/component-discovery.mjs +1 -2
- package/foundation/discovery/docs-discovery.d.mts +4 -11
- package/foundation/discovery/docs-discovery.mjs +88 -208
- package/foundation/discovery/docs-discovery.test.mjs +13 -279
- package/foundation/discovery/template-adapter.mjs +1 -2
- package/foundation/integrations/autolink.mjs +5 -12
- package/foundation/integrations/integration-warnings.mjs +0 -6
- package/foundation/integrations/integrations.d.mts +2 -46
- package/foundation/integrations/integrations.mjs +8 -167
- package/foundation/integrations/integrations.test.mjs +1 -384
- package/foundation/integrations/validate-contributions.d.mts +0 -2
- package/foundation/integrations/validate-contributions.mjs +0 -10
- package/foundation/response/json-contract.test.mjs +17 -46
- package/foundation/response/response-types.doc.mjs +1 -6
- package/package.json +11 -9
- package/api/docs/compiled-topics.test.mjs +0 -78
- package/api/docs/index/index.d.mts +0 -18
- package/api/docs/index/index.mjs +0 -32
- package/api/docs/index/index.test.mjs +0 -62
- package/api/upgrade/project-context.test.mjs +0 -272
- package/assets/docs/authoring.doc.mjs +0 -14
- package/assets/templates/blocks/components/Timer/TimerFormats.doc.mjs +0 -14
- package/assets/templates/blocks/components/Timer/TimerFormats.tsx +0 -34
- package/assets/templates/blocks/components/Timer/TimerInline.doc.mjs +0 -14
- package/assets/templates/blocks/components/Timer/TimerInline.tsx +0 -14
- package/assets/templates/blocks/components/Timer/TimerShowcase.doc.mjs +0 -13
- package/assets/templates/blocks/components/Timer/TimerShowcase.tsx +0 -47
- package/assets/templates/blocks/components/Timer/TimerTypography.doc.mjs +0 -14
- package/assets/templates/blocks/components/Timer/TimerTypography.tsx +0 -31
- package/authoring/doctypes/base/graph-fields.doc.d.mts +0 -9
- package/authoring/doctypes/base/graph-fields.doc.mjs +0 -62
- package/authoring/doctypes/load-contract.test.mjs +0 -207
- package/authoring/doctypes/namespace/namespace.doc.d.mts +0 -9
- package/authoring/doctypes/namespace/namespace.doc.mjs +0 -132
- package/authoring/doctypes/namespace/parse.d.mts +0 -12
- package/authoring/doctypes/namespace/parse.mjs +0 -25
- package/authoring/doctypes/namespace/parse.test.mjs +0 -165
- package/authoring/doctypes/namespace/type.ts +0 -71
- package/authoring/identity/identity.doc.d.mts +0 -9
- package/authoring/identity/identity.doc.mjs +0 -61
- package/authoring/identity/type.ts +0 -132
- package/foundation/discovery/authoring-self-docs.d.mts +0 -69
- package/foundation/discovery/authoring-self-docs.mjs +0 -214
- package/foundation/discovery/authoring-self-docs.test.mjs +0 -154
- package/foundation/discovery/docs-output-budget.d.mts +0 -28
- package/foundation/discovery/docs-output-budget.mjs +0 -50
- package/foundation/discovery/docs-section-key.d.mts +0 -98
- package/foundation/discovery/docs-section-key.mjs +0 -221
- package/foundation/discovery/docs-section-key.test.mjs +0 -224
- package/foundation/doc-compiler/compile.d.mts +0 -162
- package/foundation/doc-compiler/compile.mjs +0 -262
- package/foundation/doc-compiler/doc-compiler.test.mjs +0 -687
- package/foundation/doc-compiler/ir.d.mts +0 -9
- package/foundation/doc-compiler/ir.mjs +0 -287
- package/foundation/doc-compiler/lenses.d.mts +0 -33
- package/foundation/doc-compiler/lenses.mjs +0 -127
- package/foundation/identity/provider-identity.d.mts +0 -90
- package/foundation/identity/provider-identity.mjs +0 -320
- package/foundation/identity/provider-identity.test.mjs +0 -254
- package/foundation/identity/providers.d.mts +0 -7
- package/foundation/identity/providers.mjs +0 -16
- package/foundation/integrations/provider-conflicts.test.mjs +0 -125
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
* v0.3.0 removes the authoring factories. Authoring is now types + parsers: an
|
|
7
7
|
* author writes a plain object and stamps its `type` directly. This transform
|
|
8
|
-
* rewrites factory
|
|
9
|
-
*
|
|
10
|
-
* factory imports:
|
|
8
|
+
* rewrites every factory call to the plain object the factory used to return,
|
|
9
|
+
* then drops the now-dead factory imports:
|
|
11
10
|
*
|
|
12
11
|
* createConfig(o) / createIntegration(o) -> o (no discriminant)
|
|
13
12
|
* createComponentDoc(o) -> { ...o, type: 'component' }
|
|
@@ -26,9 +25,8 @@
|
|
|
26
25
|
*
|
|
27
26
|
* Import aliases are followed (`import {createDoc as mk}` → calls to `mk`), and
|
|
28
27
|
* the factory specifiers are removed afterward (the whole import statement goes
|
|
29
|
-
* if nothing else was imported from it).
|
|
30
|
-
*
|
|
31
|
-
* the surviving type imports.
|
|
28
|
+
* if nothing else was imported from it). Run this BEFORE
|
|
29
|
+
* `migrate-authoring-imports`, which repoints the surviving type imports.
|
|
32
30
|
*/
|
|
33
31
|
|
|
34
32
|
export const meta = {
|
|
@@ -37,24 +35,13 @@ export const meta = {
|
|
|
37
35
|
'Rewrites createConfig/createIntegration/createComponentDoc/' +
|
|
38
36
|
'createFunctionDoc/createDoc/createPageTemplate/createBlockTemplate/' +
|
|
39
37
|
'createCodemod/createConfigCodemod calls to the plain object they returned ' +
|
|
40
|
-
|
|
38
|
+
"(stamping the doc/template/codemod `type` discriminant), and removes the " +
|
|
41
39
|
'now-dead factory imports. Authoring is types + parsers in v0.3.0 — there ' +
|
|
42
40
|
'are no factories.',
|
|
43
41
|
pr: '#4612',
|
|
44
42
|
fileExtensions: ['.js', '.jsx', '.ts', '.tsx', '.mjs', '.cjs'],
|
|
45
43
|
};
|
|
46
44
|
|
|
47
|
-
/** Legacy Astryx authoring entrypoints that exported the removed factories. */
|
|
48
|
-
const AUTHORING_SOURCES = new Set([
|
|
49
|
-
'@astryxdesign/cli/config',
|
|
50
|
-
'@astryxdesign/cli/doc',
|
|
51
|
-
'@astryxdesign/cli/integration',
|
|
52
|
-
'@astryxdesign/cli/template',
|
|
53
|
-
'@astryxdesign/cli/codemod',
|
|
54
|
-
'@astryxdesign/core/authoring',
|
|
55
|
-
'@astryxdesign/core/config',
|
|
56
|
-
]);
|
|
57
|
-
|
|
58
45
|
/**
|
|
59
46
|
* Factory name → the `type` discriminant it stamped, or `null` for the config /
|
|
60
47
|
* integration factories, which were pure typed-identity (no discriminant).
|
|
@@ -121,7 +108,6 @@ export default function transformer(file, api) {
|
|
|
121
108
|
/** @type {Map<string, string>} */
|
|
122
109
|
const localToFactory = new Map();
|
|
123
110
|
root.find(j.ImportDeclaration).forEach((/** @type {any} */ path) => {
|
|
124
|
-
if (!AUTHORING_SOURCES.has(path.node.source.value)) return;
|
|
125
111
|
for (const spec of path.node.specifiers ?? []) {
|
|
126
112
|
if (spec.type !== 'ImportSpecifier') continue;
|
|
127
113
|
const importedName = spec.imported?.name;
|
|
@@ -177,7 +163,6 @@ export default function transformer(file, api) {
|
|
|
177
163
|
// Drop the now-dead factory import specifiers; remove any import statement
|
|
178
164
|
// left empty.
|
|
179
165
|
root.find(j.ImportDeclaration).forEach((/** @type {any} */ path) => {
|
|
180
|
-
if (!AUTHORING_SOURCES.has(path.node.source.value)) return;
|
|
181
166
|
const specs = path.node.specifiers ?? [];
|
|
182
167
|
const kept = specs.filter(
|
|
183
168
|
(/** @type {any} */ spec) =>
|
package/assets/docs/README.md
CHANGED
|
@@ -48,12 +48,3 @@ The material is usually good; the finding is placement, not quality. It goes in
|
|
|
48
48
|
**Fits no row?** It is still not caller-facing. Default it to [Contributing](https://github.com/facebook/astryx/wiki/Contributing), or `CONTRIBUTING.md` when it is a step someone follows with the repo cloned. Never default it back to this directory.
|
|
49
49
|
|
|
50
50
|
Worked example: a responsive-and-interaction readiness rubric is grading criteria → **Component-Audit-Rubric**, or **Component-Lifecycle** if it is a promotion gate.
|
|
51
|
-
|
|
52
|
-
## Sections are read one at a time
|
|
53
|
-
|
|
54
|
-
`astryx docs <topic> --index` lists a topic's sections, and readers then open
|
|
55
|
-
one section by its key. A section's key is its `id`, or a key derived from its
|
|
56
|
-
title when it has none. Give a section an `id` when its title may change, since
|
|
57
|
-
readers and extensions link to the key. Two sections in one topic cannot share
|
|
58
|
-
a key. Keep each section small enough to read on its own: `astryx doctor` fails
|
|
59
|
-
any section over 32 KB.
|
|
@@ -20,11 +20,7 @@ export const docs = {
|
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
type: 'prose',
|
|
23
|
-
text: 'The authoring CLI owns the integration file. The first `astryx integration add` creates `astryx.integration.mjs`; each later add declares its root only after writing a valid contribution behind it. Identity (name and version) still comes from package.json. For the consumer side, run `astryx docs getting-started`.',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
type: 'prose',
|
|
27
|
-
text: 'Every file an integration author writes is documented field by field in `npx astryx docs authoring`: the manifest, astryx.config, codemods, identity, and each doc type. `npx astryx docs authoring --index` lists them, and `npx astryx docs authoring <key>` reads one.',
|
|
23
|
+
text: 'The authoring CLI owns the integration file. The first `astryx integration add` creates `astryx.integration.mjs`; each later add declares its root only after writing a valid contribution behind it. Identity (name and version) still comes from package.json. For the consumer side, run `npx astryx docs getting-started`.',
|
|
28
24
|
},
|
|
29
25
|
{
|
|
30
26
|
type: 'prose',
|
|
@@ -52,7 +48,7 @@ export const docs = {
|
|
|
52
48
|
content: [
|
|
53
49
|
{
|
|
54
50
|
type: 'prose',
|
|
55
|
-
text: 'Do not start by hand-editing a manifest. Add the contribution you mean to ship; Astryx creates the manifest, writes every required file, preserves an existing custom root, and updates an existing package.json files allowlist without creating one.
|
|
51
|
+
text: 'Do not start by hand-editing a manifest. Add the contribution you mean to ship; Astryx creates the manifest, writes every required file, preserves an existing custom root, and updates an existing package.json files allowlist without creating one.',
|
|
56
52
|
},
|
|
57
53
|
{
|
|
58
54
|
type: 'code',
|
|
@@ -84,17 +80,17 @@ export const docs = {
|
|
|
84
80
|
content: [
|
|
85
81
|
{
|
|
86
82
|
type: 'prose',
|
|
87
|
-
text: 'A useful theme package usually ships more than colors. Start with the source theme,
|
|
83
|
+
text: 'A useful theme package usually ships more than colors. Start with the source theme, then add the guides its consumers need. Each command writes a complete contribution and keeps the package manifest in sync.',
|
|
88
84
|
},
|
|
89
85
|
{
|
|
90
86
|
type: 'code',
|
|
91
87
|
lang: 'bash',
|
|
92
88
|
label: 'In the provider package',
|
|
93
|
-
code: 'astryx integration add theme ocean\nastryx theme palette generate
|
|
89
|
+
code: 'astryx integration add theme ocean\nastryx theme palette generate palette.config.json --out themes/ocean/tokens/ocean.palette.ts\nastryx integration add doc brand-theme\nastryx integration add doc theme-migration\nastryx theme list --package @acme/brand-integration\nastryx docs brand-theme\nastryx integration pack --check\nnpm pack',
|
|
94
90
|
},
|
|
95
91
|
{
|
|
96
92
|
type: 'prose',
|
|
97
|
-
text:
|
|
93
|
+
text: 'Edit the generated theme and guide files before publishing. Palette generation writes an importable TypeScript candidate and a reproducibility receipt; import the candidate from the theme and list both nested files in that theme catalog entry. `integration pack --check` runs the real package lifecycle and compares local discovery with the npm tarball, so a missing source file or files allowlist entry fails before a consumer sees it.',
|
|
98
94
|
},
|
|
99
95
|
{
|
|
100
96
|
type: 'code',
|
|
@@ -108,25 +104,6 @@ export const docs = {
|
|
|
108
104
|
},
|
|
109
105
|
],
|
|
110
106
|
},
|
|
111
|
-
{
|
|
112
|
-
title: 'Contribution Kinds at a Glance',
|
|
113
|
-
category: 'guide',
|
|
114
|
-
content: [
|
|
115
|
-
{
|
|
116
|
-
type: 'prose',
|
|
117
|
-
text: 'Each contribution kind uses a different metadata suffix, type stamp, and discovery rule. The table below prevents the most common first-time authoring mistake — using the wrong file or export convention.',
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
type: 'code',
|
|
121
|
-
lang: 'text',
|
|
122
|
-
code: "Kind Metadata suffix type stamp Source file\n──────── ───────────────────────── ───────────── ──────────────────────\nComponent Name.doc.{ts,mjs,js} 'component' Name.tsx (same stem)\nTemplate Name.template.{ts,mjs,js} 'page'/'block' Name.tsx (same stem)\nDoc topic topic.doc.{ts,mjs,js} 'generic' (none — docs are prose)\nCodemod <version>/<id>.{ts,mjs,js} 'code'/'config' (the codemod IS the source)\nTheme manifest.json entry — <slug>/<entry>.ts",
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
type: 'prose',
|
|
126
|
-
text: 'The `type` stamp is how new docs should be authored — it routes parsing to the correct schema at the load boundary. Legacy docs without a stamp still load via shape-sniffing for backward compatibility, but unstamped docs rely on heuristics (presence of `props`, `params`, etc.) and may parse under the wrong schema if the shape is ambiguous. Always stamp new integration contributions.',
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
107
|
{
|
|
131
108
|
title: 'The Integration File',
|
|
132
109
|
category: 'guide',
|
|
@@ -152,7 +129,7 @@ export const docs = {
|
|
|
152
129
|
content: [
|
|
153
130
|
{
|
|
154
131
|
type: 'prose',
|
|
155
|
-
text:
|
|
132
|
+
text: 'Export your components from your library however you like, and consumers still import them from your package. For each component the CLI should document, ship a `.doc.{ts,mjs,js}` file with the same stem, for example `AcmeCarousel.tsx` alongside `AcmeCarousel.doc.ts`.',
|
|
156
133
|
},
|
|
157
134
|
{
|
|
158
135
|
type: 'prose',
|
|
@@ -161,7 +138,7 @@ export const docs = {
|
|
|
161
138
|
{
|
|
162
139
|
type: 'code',
|
|
163
140
|
lang: 'typescript',
|
|
164
|
-
code: "// AcmeCarousel.doc.ts\nexport default {\n type: 'component',\n name: 'AcmeCarousel',\n description: 'A carousel that cycles through slides.',\n // props, usage, examples, ...\n}
|
|
141
|
+
code: "// AcmeCarousel.doc.ts\nexport default {\n type: 'component',\n name: 'AcmeCarousel',\n description: 'A carousel that cycles through slides.',\n // props, usage, examples, ...\n};",
|
|
165
142
|
},
|
|
166
143
|
],
|
|
167
144
|
},
|
|
@@ -171,7 +148,7 @@ export const docs = {
|
|
|
171
148
|
content: [
|
|
172
149
|
{
|
|
173
150
|
type: 'prose',
|
|
174
|
-
text: "Templates are usually not exported from the package directly. Instead, consumers browse them through the CLI and materialize them into their app. Define a template as a plain object with `type: 'page'` (full pages) or `type: 'block'` (smaller chunks)
|
|
151
|
+
text: "Templates are usually not exported from the package directly. Instead, consumers browse them through the CLI and materialize them into their app. Define a template as a plain object stamped with `type: 'page'` (full pages) or `type: 'block'` (smaller chunks) in a `.template.{ts,mjs,js}` file next to the source, for example `AcmeLandingPage.tsx` and `AcmeLandingPage.template.ts`.",
|
|
175
152
|
},
|
|
176
153
|
{
|
|
177
154
|
type: 'prose',
|
|
@@ -184,7 +161,7 @@ export const docs = {
|
|
|
184
161
|
},
|
|
185
162
|
{
|
|
186
163
|
type: 'prose',
|
|
187
|
-
text: 'The CLI needs both files at consume time. `integration add` includes the templates root when package.json already has a files allowlist. It never creates an exports map, because doing that can make previously-open deep imports private; when a map already exists, it adds the generated source subpath without replacing author-owned entries.
|
|
164
|
+
text: 'The CLI needs both files at consume time. `integration add` includes the templates root when package.json already has a files allowlist. It never creates an exports map, because doing that can make previously-open deep imports private; when a map already exists, it adds the generated source subpath without replacing author-owned entries. `integration pack --check` proves the source and metadata survive the tarball and verifies every component through the public import its metadata advertises.',
|
|
188
165
|
},
|
|
189
166
|
],
|
|
190
167
|
},
|
|
@@ -194,7 +171,7 @@ export const docs = {
|
|
|
194
171
|
content: [
|
|
195
172
|
{
|
|
196
173
|
type: 'prose',
|
|
197
|
-
text: "Point the integration file's `docs` field at a directory of reference docs and every `{topic}.doc.{ts,mjs,js}` under it becomes a topic the CLI serves: `astryx docs` lists it, `astryx docs <topic>` prints it, `astryx search` indexes it, and `astryx init` names it in the agent block. A topic is a plain object
|
|
174
|
+
text: "Point the integration file's `docs` field at a directory of reference docs and every `{topic}.doc.{ts,mjs,js}` under it becomes a topic the CLI serves: `astryx docs` lists it, `astryx docs <topic>` prints it, `astryx search` indexes it, and `astryx init` names it in the agent block. A topic is a plain object stamped `type: 'generic'`, the same shape core's own topics use.",
|
|
198
175
|
},
|
|
199
176
|
{
|
|
200
177
|
type: 'code',
|
|
@@ -212,7 +189,7 @@ export const docs = {
|
|
|
212
189
|
},
|
|
213
190
|
{
|
|
214
191
|
type: 'prose',
|
|
215
|
-
text: "`extends: 'x'` merges onto a topic instead of owning it: a section
|
|
192
|
+
text: "`extends: 'x'` merges onto a topic instead of owning it: a section whose title matches one in the base replaces that section, and a section the base does not have is appended. Reach for it to correct or add to a topic you do not want to fork: a fork of someone else's guide stops receiving their fixes the day you write it.",
|
|
216
193
|
},
|
|
217
194
|
{
|
|
218
195
|
type: 'list',
|
|
@@ -238,33 +215,16 @@ export const docs = {
|
|
|
238
215
|
{
|
|
239
216
|
type: 'code',
|
|
240
217
|
lang: 'text',
|
|
241
|
-
code: 'themes/\n manifest.json\n ocean/\n oceanTheme.ts
|
|
218
|
+
code: 'themes/\n manifest.json\n ocean/\n oceanTheme.ts',
|
|
242
219
|
},
|
|
243
220
|
{
|
|
244
221
|
type: 'prose',
|
|
245
|
-
text:
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
type: 'list',
|
|
249
|
-
style: 'unordered',
|
|
250
|
-
items: [
|
|
251
|
-
'`slug` — lowercase kebab-case starting with a letter (e.g. `"ocean"`). Must be unique within the catalog.',
|
|
252
|
-
'`displayName` — human-readable label (e.g. `"Ocean"`).',
|
|
253
|
-
'`description` — string description of the theme.',
|
|
254
|
-
'`maintained` — boolean indicating active maintenance.',
|
|
255
|
-
'`entry` — source file relative to `themes/<slug>/` (e.g. `"oceanTheme.ts"`).',
|
|
256
|
-
'`exportName` — a valid JS identifier naming the runtime export in the entry file (e.g. `"oceanTheme"`). Astryx parses the source without executing it and rejects missing or type-only exports.',
|
|
257
|
-
'`files` — non-empty array of filenames relative to `themes/<slug>/`. Must include the entry file and every local static import the entry source uses. Astryx validates that every listed file exists on disk and that every local import in the entry names a file in this list.',
|
|
258
|
-
],
|
|
222
|
+
text: "The root catalog uses the same entry contract as Astryx's bundled themes: `slug`, `displayName`, `description`, `maintained`, `entry`, `exportName`, and `files`. `entry` and every file are relative to `themes/<slug>/`; `exportName` identifies a named runtime export in the entry source. Astryx parses that source without executing it, requires every local static import and re-export to name a file in `files`, and rejects missing or type-only exports.",
|
|
259
223
|
},
|
|
260
224
|
{
|
|
261
225
|
type: 'code',
|
|
262
226
|
lang: 'json',
|
|
263
|
-
code: '{\n "version": 1,\n "themes": [{\n "slug": "ocean",\n "displayName": "Ocean",\n "description": "Ocean theme
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
type: 'prose',
|
|
267
|
-
text: 'The generated candidate is already importable: it exports `black`, `white`, `palette`, and a default palette value. Import it directly from `./tokens/ocean.palette`. A wrapper or palette-refs module is optional application code, not generator output; list it only if you create it.',
|
|
227
|
+
code: '{\n "version": 1,\n "themes": [{\n "slug": "ocean",\n "displayName": "Ocean",\n "description": "Ocean theme.",\n "maintained": true,\n "entry": "oceanTheme.ts",\n "exportName": "oceanTheme",\n "files": ["oceanTheme.ts"]\n }]\n}',
|
|
268
228
|
},
|
|
269
229
|
{
|
|
270
230
|
type: 'prose',
|
|
@@ -307,41 +267,10 @@ export const docs = {
|
|
|
307
267
|
type: 'prose',
|
|
308
268
|
text: "Ship codemods so `astryx upgrade` can migrate consumers across breaking changes in your package. Point the integration file's `codemods` field at your codemods root, and author each one as a plain object stamped with `type: 'code'` (transforms source files) or `type: 'config'` (rewrites the consumer's `astryx.config`).",
|
|
309
269
|
},
|
|
310
|
-
{
|
|
311
|
-
type: 'prose',
|
|
312
|
-
text: 'The codemods root uses a version-folder-first layout. Each folder name is an exact semver string (no `v` prefix) matching the version the codemod migrates TO. Each module under it is a kebab-case `.ts`, `.mjs`, or `.js` file whose default export is the codemod envelope:',
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
type: 'code',
|
|
316
|
-
lang: 'text',
|
|
317
|
-
code: 'codemods/\n 0.2.0/\n rename-widget-prop.ts\n 0.3.0/\n update-theme-import.ts\n config/rename-integration.ts',
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
type: 'prose',
|
|
321
|
-
text: 'Codemod ids (the extension-less relative path under the version folder, e.g. `rename-widget-prop`, `config/rename-integration`) must be unique within a package across all versions. A duplicate id across versions is a hard error.',
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
type: 'prose',
|
|
325
|
-
text: 'The loader automatically skips test and fixture files so you can colocate tests with transforms. Reserved names: files matching `*.test.*`, `*.spec.*`, or `*.fixture.*`, and any file under a `__tests__/` or `__fixtures__/` directory. These are never loaded as codemods regardless of their extension.',
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
type: 'code',
|
|
329
|
-
lang: 'text',
|
|
330
|
-
code: 'codemods/\n 0.2.0/\n rename-widget-prop.ts # loaded as a codemod\n rename-widget-prop.test.ts # skipped (reserved name)\n __tests__/\n rename-widget-prop.test.ts # skipped (reserved directory)',
|
|
331
|
-
},
|
|
332
270
|
{
|
|
333
271
|
type: 'code',
|
|
334
272
|
lang: 'typescript',
|
|
335
|
-
code: "// codemods/
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
type: 'prose',
|
|
339
|
-
text: "`astryx upgrade` is dry-run by default — it previews which codemods would run and what files would change, without writing anything. Pass `--apply` to write the changes. There is no `--dry-run` flag; omitting `--apply` is the dry run. The `--integration` flag resolves each value beneath the project's `node_modules` (for example, `--integration @acme/widgets`). Absolute paths and `.` or `..` segments are rejected; other slash-separated values remain beneath `node_modules`.",
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
type: 'code',
|
|
343
|
-
lang: 'bash',
|
|
344
|
-
code: '# Preview what would change (dry-run, the default)\nastryx upgrade --from 0.1.0\n\n# Apply the migration\nastryx upgrade --from 0.1.0 --apply',
|
|
273
|
+
code: "// codemods/v2-rename-prop.ts\nexport default {\n type: 'code',\n // title, description, transform, ...\n};",
|
|
345
274
|
},
|
|
346
275
|
{
|
|
347
276
|
type: 'prose',
|
|
@@ -4,27 +4,11 @@
|
|
|
4
4
|
export const doc = {
|
|
5
5
|
type: 'block',
|
|
6
6
|
exampleFor: 'Toolbar',
|
|
7
|
-
alsoExampleFor: ['OverflowList'],
|
|
8
7
|
name: 'Toolbar — Table Filter',
|
|
9
8
|
displayName: 'Toolbar — Table Filter',
|
|
10
9
|
description:
|
|
11
|
-
'
|
|
10
|
+
'A compact toolbar with a search input, Status and Priority filter selectors, and an overflow menu. Use above a data table to let users search, filter, and access view options.',
|
|
12
11
|
isReady: true,
|
|
13
|
-
aspectRatio: 16 /
|
|
14
|
-
componentsUsed: [
|
|
15
|
-
'Toolbar',
|
|
16
|
-
'Selector',
|
|
17
|
-
'TextInput',
|
|
18
|
-
'OverflowList',
|
|
19
|
-
'Popover',
|
|
20
|
-
'Button',
|
|
21
|
-
'Icon',
|
|
22
|
-
'Link',
|
|
23
|
-
'Text',
|
|
24
|
-
'CheckboxList',
|
|
25
|
-
'Layout',
|
|
26
|
-
'Section',
|
|
27
|
-
'Table',
|
|
28
|
-
'EmptyState',
|
|
29
|
-
],
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['Toolbar', 'Selector', 'TextInput', 'MoreMenu', 'Layout', 'Table'],
|
|
30
14
|
};
|