@astryxdesign/cli 0.6.0 → 0.6.1
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/CHANGELOG.md +48 -1
- package/README.md +76 -67
- package/api/build/build.test.mjs +37 -0
- package/api/build/build.type.mjs +1 -1
- package/api/build/kit/kit.mjs +31 -1
- package/api/component/_adapter.mjs +14 -28
- package/api/component/integration-import-agreement.test.mjs +318 -0
- package/api/doctor/doctor.d.mts +32 -3
- package/api/doctor/doctor.doc.mjs +2 -1
- package/api/doctor/doctor.mjs +97 -4
- package/api/doctor/doctor.test.mjs +90 -1
- package/api/gap-report/gap-report-worker.d.mts +4 -0
- package/api/gap-report/gap-report-worker.mjs +73 -0
- package/api/gap-report/gap-report.d.mts +81 -0
- package/api/gap-report/gap-report.doc.d.mts +9 -0
- package/api/gap-report/gap-report.doc.mjs +127 -0
- package/api/gap-report/gap-report.mjs +707 -0
- package/api/gap-report/gap-report.test.mjs +1210 -0
- package/api/gap-report/gap-report.type.d.mts +88 -0
- package/api/gap-report/gap-report.type.mjs +69 -0
- package/api/index.d.mts +8 -1
- package/api/index.mjs +24 -1
- package/api/integration/add-contribution.d.mts +44 -0
- package/api/integration/add-contribution.mjs +1160 -0
- package/api/integration/add-contribution.test.mjs +733 -0
- package/api/integration/add-helpers.d.mts +80 -0
- package/api/integration/add-helpers.mjs +333 -0
- package/api/integration/add-helpers.test.mjs +161 -0
- package/api/integration/add-theme.d.mts +10 -0
- package/api/integration/add-theme.mjs +332 -0
- package/api/integration/add-theme.test.mjs +194 -0
- package/api/integration/integration-authoring.type.d.mts +55 -0
- package/api/integration/integration-authoring.type.mjs +76 -0
- package/api/integration/integration-block-exports.test.mjs +4 -0
- package/api/integration/integrationAdd.doc.d.mts +5 -0
- package/api/integration/integrationAdd.doc.mjs +100 -0
- package/api/integration/integrationAddAgentDoc.doc.d.mts +5 -0
- package/api/integration/integrationAddAgentDoc.doc.mjs +49 -0
- package/api/integration/integrationAddCodemod.doc.d.mts +5 -0
- package/api/integration/integrationAddCodemod.doc.mjs +55 -0
- package/api/integration/integrationAddComponent.doc.d.mts +5 -0
- package/api/integration/integrationAddComponent.doc.mjs +49 -0
- package/api/integration/integrationAddDoc.doc.d.mts +5 -0
- package/api/integration/integrationAddDoc.doc.mjs +59 -0
- package/api/integration/integrationAddTemplate.doc.d.mts +5 -0
- package/api/integration/integrationAddTemplate.doc.mjs +55 -0
- package/api/integration/integrationAddTheme.doc.d.mts +5 -0
- package/api/integration/integrationAddTheme.doc.mjs +85 -0
- package/api/integration/integrationPackCheck.doc.d.mts +5 -0
- package/api/integration/integrationPackCheck.doc.mjs +35 -0
- package/api/integration/pack-check.d.mts +27 -0
- package/api/integration/pack-check.mjs +795 -0
- package/api/integration/pack-check.test.mjs +569 -0
- package/api/integration/pack-check.type.d.mts +45 -0
- package/api/integration/pack-check.type.mjs +56 -0
- package/api/integration/public-api.test.mjs +21 -0
- package/api/integration/validate-integration.mjs +221 -11
- package/api/integration/validate-integration.test.mjs +189 -5
- package/api/integration/validateIntegration.doc.mjs +2 -2
- package/api/json/index.ts +1 -0
- package/api/search/search.mjs +19 -1
- package/api/theme/_adapter.d.mts +26 -28
- package/api/theme/_adapter.mjs +101 -38
- package/api/theme/add/add.d.mts +2 -1
- package/api/theme/add/add.mjs +56 -20
- package/api/theme/add/add.test.mjs +1 -0
- package/api/theme/build/build.d.mts +25 -0
- package/api/theme/build/build.mjs +101 -70
- package/api/theme/build/build.test.mjs +77 -44
- package/api/theme/integration-themes.test.mjs +183 -0
- package/api/theme/list/list.d.mts +10 -2
- package/api/theme/list/list.mjs +31 -10
- package/api/theme/list/list.test.mjs +102 -23
- package/api/theme/listThemes.doc.d.mts +1 -5
- package/api/theme/listThemes.doc.mjs +6 -13
- package/api/theme/targets/targets.test.mjs +22 -8
- package/api/theme/theme.d.mts +1 -1
- package/api/theme/theme.mjs +1 -1
- package/api/theme/theme.type.d.mts +9 -0
- package/api/theme/theme.type.mjs +3 -1
- package/api/theme/themeAdd.doc.d.mts +1 -4
- package/api/theme/themeAdd.doc.mjs +31 -31
- package/api/theme/themeBuild.doc.mjs +1 -1
- package/api/theme/themeList.doc.d.mts +1 -4
- package/api/theme/themeList.doc.mjs +7 -15
- package/api/theme/themeListAvailable.doc.d.mts +8 -0
- package/api/theme/themeListAvailable.doc.mjs +57 -0
- package/api/theme/themeTargets.doc.mjs +21 -7
- package/api/upgrade/_adapter.d.mts +2 -0
- package/api/upgrade/_adapter.mjs +1 -0
- package/api/upgrade/registry/registry.d.mts +40 -0
- package/api/upgrade/registry/registry.mjs +1154 -0
- package/api/upgrade/registry/registry.test.mjs +826 -0
- package/api/upgrade/run/run.mjs +49 -8
- package/api/upgrade/status/status.d.mts +6 -4
- package/api/upgrade/status/status.mjs +26 -8
- package/api/upgrade/upgrade.d.mts +2 -2
- package/api/upgrade/upgrade.doc.mjs +33 -9
- package/api/upgrade/upgrade.mjs +34 -7
- package/api/upgrade/upgrade.test.mjs +198 -8
- package/api/upgrade/upgrade.type.d.mts +90 -1
- package/api/upgrade/upgrade.type.mjs +51 -2
- package/assets/docs/cli-integrations.doc.mjs +152 -28
- package/assets/docs/getting-started.doc.mjs +1 -1
- package/assets/docs/{shadcn-compatibility.doc.mjs → shadcn-compatibility.doc.draft.mjs} +23 -13
- package/assets/docs/styling.doc.mjs +3 -3
- package/assets/docs/theme.doc.dense.mjs +2 -2
- package/assets/docs/theme.doc.mjs +23 -13
- package/assets/docs/theme.doc.zh.mjs +1 -1
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.doc.mjs +2 -1
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.tsx +38 -12
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadShowcase.doc.mjs +15 -0
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadShowcase.tsx +87 -0
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherReviewFlow.doc.mjs +23 -0
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSwitcherReviewFlow.tsx +75 -0
- package/assets/templates/blocks/components/BreadcrumbItem/BreadcrumbItemShowcase.tsx +5 -19
- package/assets/templates/blocks/components/Center/CenterHorizontal.doc.mjs +3 -2
- package/assets/templates/blocks/components/Center/CenterHorizontal.tsx +4 -5
- package/assets/templates/blocks/components/Toast/ToastAction.tsx +2 -1
- package/assets/templates/blocks/components/Toast/ToastDeduplication.tsx +2 -1
- package/assets/templates/blocks/components/Toast/ToastDismiss.tsx +2 -1
- package/assets/templates/blocks/components/Toast/ToastShowcase.tsx +2 -1
- package/assets/templates/blocks/components/Toast/ToastStacking.tsx +2 -1
- package/assets/templates/blocks/components/Toast/ToastTypes.tsx +2 -1
- package/assets/templates/pages/dashboard/template.doc.mjs +2 -2
- package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +3 -2
- package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +3 -2
- package/assets/templates/pages/dashboard-comparison/template.doc.mjs +3 -3
- package/assets/templates/pages/dashboard-composition/template.doc.mjs +2 -2
- package/assets/templates/pages/dashboard-progress/template.doc.mjs +2 -2
- package/assets/templates/pages/dashboard-scorecard/template.doc.mjs +2 -2
- package/assets/templates/themes/butter/butterTheme.ts +3 -3
- package/assets/templates/themes/neutral/neutralTheme.ts +2 -2
- package/assets/templates/themes/stone/stoneTheme.ts +3 -3
- package/assets/theme.template.ts +4 -7
- package/authoring/config/config.doc.mjs +9 -1
- package/authoring/config/parse.d.mts +2 -0
- package/authoring/config/parse.mjs +28 -3
- package/authoring/config/parse.test.mjs +25 -3
- package/authoring/config/type.ts +3 -0
- package/authoring/doctypes/_schema.d.mts +3 -0
- package/authoring/doctypes/_schema.mjs +6 -1
- package/authoring/doctypes/base/type.ts +6 -6
- package/authoring/doctypes/component/component.doc.mjs +6 -0
- package/authoring/doctypes/component/type.ts +2 -0
- package/authoring/gap-report/parse.d.mts +63 -0
- package/authoring/gap-report/parse.mjs +121 -0
- package/authoring/gap-report/parse.test.mjs +172 -0
- package/authoring/gap-report/type.ts +107 -0
- package/authoring/index.d.mts +1 -0
- package/authoring/index.d.ts +12 -0
- package/authoring/index.mjs +4 -0
- package/authoring/integration/integration.doc.mjs +14 -2
- package/authoring/integration/parse.test.mjs +9 -4
- package/authoring/integration/schema.d.mts +2 -0
- package/authoring/integration/schema.mjs +1 -0
- package/authoring/integration/type.ts +23 -6
- package/authoring/shadcn/receipt.d.mts +219 -0
- package/authoring/shadcn/receipt.mjs +248 -0
- package/authoring/shadcn/receipt.test.mjs +187 -0
- package/authoring/shadcn/source-variants.d.mts +28 -0
- package/authoring/shadcn/source-variants.mjs +176 -0
- package/authoring/shadcn/source-variants.test.mjs +120 -0
- package/clients/cli/commands/build-theme.mjs +54 -19
- package/clients/cli/commands/build-theme.variants.test.mjs +15 -12
- package/clients/cli/commands/component/index.mjs +1 -1
- package/clients/cli/commands/docs.test.mjs +1 -0
- package/clients/cli/commands/doctor-integration.doc.mjs +1 -1
- package/clients/cli/commands/gap-report.doc.mjs +73 -0
- package/clients/cli/commands/gap-report.mjs +114 -0
- package/clients/cli/commands/gap-report.test.mjs +198 -0
- package/clients/cli/commands/import-hint-correctness.test.mjs +88 -0
- package/clients/cli/commands/integration-add.doc.mjs +88 -0
- package/clients/cli/commands/integration-authoring.test.mjs +177 -0
- package/clients/cli/commands/integration-pack.doc.mjs +34 -0
- package/clients/cli/commands/integration-real-world.test.mjs +618 -0
- package/clients/cli/commands/integration.doc.mjs +28 -0
- package/clients/cli/commands/integration.mjs +153 -0
- package/clients/cli/commands/theme-add.doc.mjs +11 -6
- package/clients/cli/commands/theme-list.doc.mjs +21 -5
- package/clients/cli/commands/theme-targets.behavior.test.mjs +19 -2
- package/clients/cli/commands/theme.doc.mjs +2 -2
- package/clients/cli/commands/upgrade.doc.mjs +17 -4
- package/clients/cli/commands/upgrade.mjs +12 -1
- package/clients/cli/commands/upgrade.test.mjs +41 -0
- package/clients/cli/index.mjs +5 -0
- package/clients/cli/lib/component-format.mjs +42 -26
- package/clients/cli/lib/component-format.test.mjs +34 -3
- package/clients/cli/lib/manifest.mjs +12 -0
- package/foundation/config/project-themes.test.mjs +127 -0
- package/foundation/config/project.d.mts +23 -4
- package/foundation/config/project.mjs +96 -9
- package/foundation/config/project.test.mjs +132 -6
- package/foundation/discovery/component-discovery.d.mts +36 -0
- package/foundation/discovery/component-discovery.mjs +96 -0
- package/foundation/discovery/theme-discovery.d.mts +39 -0
- package/foundation/discovery/theme-discovery.mjs +650 -0
- package/foundation/discovery/theme-discovery.test.mjs +375 -0
- package/foundation/discovery/theming-targets.d.mts +16 -0
- package/foundation/discovery/theming-targets.mjs +39 -3
- package/foundation/discovery/theming-targets.test.mjs +139 -0
- package/foundation/integrations/autolink.d.mts +96 -0
- package/foundation/integrations/autolink.mjs +265 -0
- package/foundation/integrations/autolink.test.mjs +430 -0
- package/foundation/integrations/contribution-inventory.d.mts +152 -0
- package/foundation/integrations/contribution-inventory.mjs +497 -0
- package/foundation/integrations/contribution-inventory.test.mjs +361 -0
- package/foundation/integrations/integrations.d.mts +73 -9
- package/foundation/integrations/integrations.mjs +158 -8
- package/foundation/integrations/integrations.test.mjs +152 -29
- package/foundation/integrations/manifest-writer.d.mts +56 -0
- package/foundation/integrations/manifest-writer.mjs +328 -0
- package/foundation/integrations/manifest-writer.test.mjs +229 -0
- package/foundation/integrations/validate-contributions.mjs +81 -6
- package/foundation/response/error-codes.d.mts +4 -1
- package/foundation/response/error-codes.doc.mjs +16 -1
- package/foundation/response/error-codes.mjs +10 -1
- package/foundation/response/response-types.doc.mjs +23 -2
- package/package.json +8 -1
|
@@ -16,14 +16,28 @@ describe('themeTargets (api/theme/targets)', () => {
|
|
|
16
16
|
expect(result.data.filter).toBeNull();
|
|
17
17
|
expect(result.data.targets.length).toBeGreaterThan(100);
|
|
18
18
|
expect(result.data.componentCount).toBeGreaterThan(50);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
const allowedKeys = new Set([
|
|
20
|
+
'className',
|
|
21
|
+
'component',
|
|
22
|
+
'deprecatedFor',
|
|
23
|
+
'key',
|
|
24
|
+
'props',
|
|
25
|
+
'states',
|
|
26
|
+
]);
|
|
27
|
+
for (const target of result.data.targets) {
|
|
28
|
+
expect(target).toMatchObject({
|
|
29
|
+
className: expect.any(String),
|
|
30
|
+
component: expect.any(String),
|
|
31
|
+
key: expect.any(String),
|
|
32
|
+
props: expect.any(Array),
|
|
33
|
+
states: expect.any(Array),
|
|
34
|
+
});
|
|
35
|
+
expect(Object.keys(target).filter(key => !allowedKeys.has(key))).toEqual(
|
|
36
|
+
[],
|
|
37
|
+
);
|
|
38
|
+
if (target.deprecatedFor !== undefined) {
|
|
39
|
+
expect(target.deprecatedFor).toEqual(expect.any(String));
|
|
40
|
+
}
|
|
27
41
|
}
|
|
28
42
|
}, 60_000);
|
|
29
43
|
|
package/api/theme/theme.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ export { themeAdd } from "./add/add.mjs";
|
|
|
5
5
|
export { themeTemplate } from "./template/template.mjs";
|
|
6
6
|
export { themeTargets } from "./targets/targets.mjs";
|
|
7
7
|
export { themePaletteGenerate } from "./palette/generate/generate.mjs";
|
|
8
|
-
export { themeList } from "./list/list.mjs";
|
|
9
8
|
export { listThemes } from "./_adapter.mjs";
|
|
10
9
|
export { themeBuild, importSpecifier } from "./build/build.mjs";
|
|
11
10
|
export { COMPACT_11_STOPS, DEFAULT_21_STOPS, PALETTE_RECIPE, generatePaletteSet, generateTonalPalette, parseStopList, validateStops } from "./palette/generate/generator.mjs";
|
|
11
|
+
export { themeList, themeListAvailable } from "./list/list.mjs";
|
package/api/theme/theme.mjs
CHANGED
|
@@ -65,6 +65,10 @@ export type ThemeListEntry = {
|
|
|
65
65
|
displayName: string;
|
|
66
66
|
description: string;
|
|
67
67
|
maintained: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* owner package for project-aware listings
|
|
70
|
+
*/
|
|
71
|
+
package?: string | undefined;
|
|
68
72
|
};
|
|
69
73
|
/**
|
|
70
74
|
* xds --json theme list
|
|
@@ -82,6 +86,7 @@ export type ThemeAddResponse = {
|
|
|
82
86
|
slug: string;
|
|
83
87
|
displayName: string;
|
|
84
88
|
maintained: boolean;
|
|
89
|
+
package: string;
|
|
85
90
|
outputDir: string;
|
|
86
91
|
entry: string;
|
|
87
92
|
exportName: string;
|
|
@@ -112,6 +117,10 @@ export type ThemeTargetEntry = {
|
|
|
112
117
|
component: string;
|
|
113
118
|
props: string[];
|
|
114
119
|
states: string[];
|
|
120
|
+
/**
|
|
121
|
+
* - exact canonical replacement for a deprecated target
|
|
122
|
+
*/
|
|
123
|
+
deprecatedFor?: string | undefined;
|
|
115
124
|
};
|
|
116
125
|
/**
|
|
117
126
|
* xds --json theme targets [filter]
|
package/api/theme/theme.type.mjs
CHANGED
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
* @property {string} displayName
|
|
56
56
|
* @property {string} description
|
|
57
57
|
* @property {boolean} maintained
|
|
58
|
+
* @property {string} [package] owner package for project-aware listings
|
|
58
59
|
*/
|
|
59
60
|
|
|
60
61
|
/**
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
* xds --json theme add <slug>
|
|
69
70
|
* @typedef {object} ThemeAddResponse
|
|
70
71
|
* @property {'theme.add'} type
|
|
71
|
-
* @property {{slug: string, displayName: string, maintained: boolean, outputDir: string, entry: string, exportName: string, files: string[]}} data
|
|
72
|
+
* @property {{slug: string, displayName: string, maintained: boolean, package: string, outputDir: string, entry: string, exportName: string, files: string[]}} data
|
|
72
73
|
*/
|
|
73
74
|
|
|
74
75
|
/**
|
|
@@ -90,6 +91,7 @@
|
|
|
90
91
|
* @property {string} component
|
|
91
92
|
* @property {string[]} props
|
|
92
93
|
* @property {string[]} states
|
|
94
|
+
* @property {string} [deprecatedFor] - exact canonical replacement for a deprecated target
|
|
93
95
|
*/
|
|
94
96
|
|
|
95
97
|
/**
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @file FunctionDoc for `themeAdd()` / `astryx theme add`.
|
|
6
|
-
* API function it documents; the response-shape source of truth stays in
|
|
7
|
-
* `theme.type.mjs`.
|
|
8
|
-
* @position packages/cli/api/theme — function documentation
|
|
5
|
+
* @file FunctionDoc for `themeAdd()` / `astryx theme add`.
|
|
9
6
|
*/
|
|
10
7
|
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
11
8
|
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file FunctionDoc for `themeAdd()` / `astryx theme add`.
|
|
5
|
-
* API function it documents; the response-shape source of truth stays in
|
|
6
|
-
* `theme.type.mjs`.
|
|
7
|
-
* @position packages/cli/api/theme — function documentation
|
|
4
|
+
* @file FunctionDoc for `themeAdd()` / `astryx theme add`.
|
|
8
5
|
*/
|
|
9
6
|
|
|
10
7
|
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
@@ -13,80 +10,83 @@ export const doc = {
|
|
|
13
10
|
kind: 'api',
|
|
14
11
|
name: 'themeAdd',
|
|
15
12
|
displayName: 'themeAdd()',
|
|
16
|
-
summary: '
|
|
13
|
+
summary: 'Copy an available theme into a project as editable source.',
|
|
17
14
|
description:
|
|
18
|
-
|
|
19
|
-
"consumer's project so they own it, no theme package needed. Writes are staged to temp " +
|
|
20
|
-
'files then renamed, rolling back partials on failure so a failed write never leaves a ' +
|
|
21
|
-
'half-written theme. Returns a theme.add receipt describing where the files landed and how ' +
|
|
22
|
-
'to import them.',
|
|
15
|
+
'Resolves a theme from the CLI bundle or an installed integration and copies every catalog-listed source file into the consumer project. Writes are staged and existing files require explicit overwrite. Duplicate slugs fail closed until the caller selects an owner package.',
|
|
23
16
|
importPath: '@astryxdesign/cli/api',
|
|
24
17
|
signature:
|
|
25
|
-
'themeAdd(slug: string, options?: {targetPath?: string, overwrite?: boolean, cwd?: string}): Promise<ThemeAddResponse>',
|
|
26
|
-
keywords: ['theme', 'add', '
|
|
18
|
+
'themeAdd(slug: string, options?: {targetPath?: string, overwrite?: boolean, cwd?: string, package?: string}): Promise<ThemeAddResponse>',
|
|
19
|
+
keywords: ['theme', 'add', 'integration', 'scaffold', 'copy', 'eject'],
|
|
27
20
|
params: [
|
|
28
21
|
{
|
|
29
22
|
name: 'slug',
|
|
30
23
|
type: 'string',
|
|
31
24
|
description:
|
|
32
|
-
'Slug of the
|
|
25
|
+
'Slug of the available theme to copy (matched case-insensitively).',
|
|
33
26
|
required: true,
|
|
34
27
|
},
|
|
35
28
|
{
|
|
36
29
|
name: 'options.targetPath',
|
|
37
30
|
type: 'string',
|
|
38
31
|
description:
|
|
39
|
-
'Destination directory for
|
|
32
|
+
'Destination directory for copied files. Must resolve within cwd.',
|
|
40
33
|
default: "'src/themes/<slug>'",
|
|
41
34
|
},
|
|
42
35
|
{
|
|
43
36
|
name: 'options.overwrite',
|
|
44
37
|
type: 'boolean',
|
|
45
|
-
description:
|
|
46
|
-
'Replace existing files instead of refusing when a destination file already exists.',
|
|
38
|
+
description: 'Replace existing files instead of refusing.',
|
|
47
39
|
default: 'false',
|
|
48
40
|
},
|
|
49
41
|
{
|
|
50
42
|
name: 'options.cwd',
|
|
51
43
|
type: 'string',
|
|
52
|
-
description:
|
|
44
|
+
description:
|
|
45
|
+
'Project directory used for integration discovery and target paths.',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'options.package',
|
|
49
|
+
type: 'string',
|
|
50
|
+
description: 'Exact owner package used to disambiguate a shared slug.',
|
|
53
51
|
},
|
|
54
52
|
],
|
|
55
53
|
returns: [
|
|
56
54
|
{
|
|
57
55
|
type: 'theme.add',
|
|
58
56
|
description:
|
|
59
|
-
'
|
|
57
|
+
'Copy receipt with slug, displayName, maintained flag, owner package, outputDir, entry, exportName, and files.',
|
|
60
58
|
},
|
|
61
59
|
{
|
|
62
60
|
type: 'theme.list',
|
|
63
61
|
description:
|
|
64
|
-
'The
|
|
62
|
+
'The CLI list affordance routes a bare `astryx theme add` or `--list` to themeListAvailable() and returns every available theme with its owner.',
|
|
65
63
|
},
|
|
66
64
|
],
|
|
67
65
|
throws: [
|
|
68
|
-
{code: 'ERR_UNKNOWN_THEME', when: 'no bundled theme matches the slug'},
|
|
69
|
-
{code: 'ERR_PATH_TRAVERSAL', when: 'the target path escapes cwd'},
|
|
70
66
|
{
|
|
71
|
-
code: '
|
|
72
|
-
when: '
|
|
67
|
+
code: 'ERR_UNKNOWN_THEME',
|
|
68
|
+
when: 'no available theme matches the slug and package',
|
|
73
69
|
},
|
|
70
|
+
{code: 'ERR_AMBIGUOUS_THEME', when: 'more than one package owns the slug'},
|
|
74
71
|
{
|
|
75
|
-
code: '
|
|
76
|
-
when: '
|
|
72
|
+
code: 'ERR_THEME_INVALID',
|
|
73
|
+
when: 'the selected installed package has a blocking integration or theme-catalog error',
|
|
77
74
|
},
|
|
75
|
+
{code: 'ERR_PATH_TRAVERSAL', when: 'the target path escapes cwd'},
|
|
76
|
+
{code: 'ERR_NO_SOURCE', when: 'a catalog-listed source file is missing'},
|
|
78
77
|
{
|
|
79
|
-
code: '
|
|
80
|
-
when: '
|
|
78
|
+
code: 'ERR_FILE_EXISTS',
|
|
79
|
+
when: 'a destination exists and overwrite is not set',
|
|
81
80
|
},
|
|
81
|
+
{code: 'ERR_WRITE_FAILED', when: 'writing files fails'},
|
|
82
82
|
],
|
|
83
83
|
examples: [
|
|
84
|
-
{label: '
|
|
84
|
+
{label: 'Copy a bundled theme', code: "await themeAdd('ocean');"},
|
|
85
85
|
{
|
|
86
|
-
label: '
|
|
87
|
-
code: "await themeAdd('ocean', {
|
|
86
|
+
label: 'Copy an integration theme',
|
|
87
|
+
code: "await themeAdd('ocean', {package: '@acme/themes'});",
|
|
88
88
|
},
|
|
89
89
|
],
|
|
90
90
|
command: 'theme add',
|
|
91
|
-
related: ['themeList', 'listThemes'
|
|
91
|
+
related: ['themeList', 'listThemes'],
|
|
92
92
|
};
|
|
@@ -73,7 +73,7 @@ export const doc = {
|
|
|
73
73
|
{
|
|
74
74
|
type: 'theme.build',
|
|
75
75
|
description:
|
|
76
|
-
'Build receipt: theme name, token- and component-override counts, output size in KB, the written outputs {css, js, dts, and variantsDts when custom prop values were augmented}, and
|
|
76
|
+
'Build receipt: theme name, token- and component-override counts, output size in KB, the written outputs {css, js, dts, and variantsDts when custom prop values were augmented}, and validation warnings—including exact canonical replacements for deprecated component target keys. Resolves to null instead when the theme produced no CSS (nothing to build).',
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
type: 'theme.build.check',
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @file FunctionDoc for
|
|
6
|
-
* API function it documents; the response-shape source of truth stays in
|
|
7
|
-
* `theme.type.mjs`.
|
|
8
|
-
* @position packages/cli/api/theme — function documentation
|
|
5
|
+
* @file FunctionDoc for the synchronous bundled-theme compatibility API.
|
|
9
6
|
*/
|
|
10
7
|
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
11
8
|
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file FunctionDoc for
|
|
5
|
-
* API function it documents; the response-shape source of truth stays in
|
|
6
|
-
* `theme.type.mjs`.
|
|
7
|
-
* @position packages/cli/api/theme — function documentation
|
|
4
|
+
* @file FunctionDoc for the synchronous bundled-theme compatibility API.
|
|
8
5
|
*/
|
|
9
6
|
|
|
10
7
|
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
@@ -13,11 +10,9 @@ export const doc = {
|
|
|
13
10
|
kind: 'api',
|
|
14
11
|
name: 'themeList',
|
|
15
12
|
displayName: 'themeList()',
|
|
16
|
-
summary: 'List
|
|
13
|
+
summary: 'List themes bundled with this CLI build.',
|
|
17
14
|
description:
|
|
18
|
-
'Projects the bundled-theme manifest into
|
|
19
|
-
'can scaffold. A pure projection of the manifest read by listThemes(); no I/O beyond that read, ' +
|
|
20
|
-
'and it returns synchronously.',
|
|
15
|
+
'Projects the bundled-theme manifest into a synchronous theme.list envelope. This preserves the original programmatic API contract. The CLI command uses themeListAvailable() so installed integrations also appear.',
|
|
21
16
|
importPath: '@astryxdesign/cli/api',
|
|
22
17
|
signature: 'themeList(): ThemeListResponse',
|
|
23
18
|
keywords: ['theme', 'list', 'themes', 'bundled', 'available'],
|
|
@@ -26,18 +21,15 @@ export const doc = {
|
|
|
26
21
|
{
|
|
27
22
|
type: 'theme.list',
|
|
28
23
|
description:
|
|
29
|
-
'Every bundled theme as
|
|
24
|
+
'Every bundled theme as ThemeListEntry[]: slug, displayName, description, and maintained flag.',
|
|
30
25
|
},
|
|
31
26
|
],
|
|
32
27
|
throws: [
|
|
33
28
|
{
|
|
34
29
|
code: 'ERR_NO_SOURCE',
|
|
35
|
-
when: 'the bundled-theme manifest
|
|
30
|
+
when: 'the bundled-theme manifest cannot be read or parsed',
|
|
36
31
|
},
|
|
37
32
|
],
|
|
38
|
-
examples: [
|
|
39
|
-
|
|
40
|
-
],
|
|
41
|
-
command: 'theme list',
|
|
42
|
-
related: ['themeAdd', 'listThemes', 'themeBuild'],
|
|
33
|
+
examples: [{label: 'List bundled themes', code: 'const {data} = themeList();'}],
|
|
34
|
+
related: ['themeListAvailable', 'themeAdd', 'listThemes'],
|
|
43
35
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @file FunctionDoc for the project-aware `astryx theme list` API.
|
|
6
|
+
*/
|
|
7
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
8
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file FunctionDoc for the project-aware `astryx theme list` API.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
8
|
+
export const doc = {
|
|
9
|
+
type: 'function',
|
|
10
|
+
kind: 'api',
|
|
11
|
+
name: 'themeListAvailable',
|
|
12
|
+
displayName: 'themeListAvailable()',
|
|
13
|
+
summary: 'List bundled and installed integration themes.',
|
|
14
|
+
description:
|
|
15
|
+
'Loads Project for the requested directory, combines the CLI bundle with source themes from installed integrations, and projects each entry with its owner package. An unreadable project configuration degrades to the bundled catalog.',
|
|
16
|
+
importPath: '@astryxdesign/cli/api',
|
|
17
|
+
signature:
|
|
18
|
+
'themeListAvailable(options?: {cwd?: string, package?: string}): Promise<ThemeListResponse>',
|
|
19
|
+
keywords: ['theme', 'list', 'themes', 'integration', 'available', 'package'],
|
|
20
|
+
params: [
|
|
21
|
+
{
|
|
22
|
+
name: 'options.cwd',
|
|
23
|
+
type: 'string',
|
|
24
|
+
description: 'Project directory whose installed integrations contribute themes.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'options.package',
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: 'Optional exact owner-package filter.',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
returns: [
|
|
33
|
+
{
|
|
34
|
+
type: 'theme.list',
|
|
35
|
+
description:
|
|
36
|
+
'Every available theme as ThemeListEntry[]: slug, displayName, description, maintained flag, and owner package.',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
throws: [
|
|
40
|
+
{
|
|
41
|
+
code: 'ERR_NO_SOURCE',
|
|
42
|
+
when: 'the CLI bundled-theme manifest cannot be read or parsed',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
examples: [
|
|
46
|
+
{
|
|
47
|
+
label: 'List project themes',
|
|
48
|
+
code: 'const {data} = await themeListAvailable();',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: 'List one package',
|
|
52
|
+
code: "await themeListAvailable({package: '@acme/themes'});",
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
command: 'theme list',
|
|
56
|
+
related: ['themeList', 'themeAdd'],
|
|
57
|
+
};
|
|
@@ -16,15 +16,25 @@ export const doc = {
|
|
|
16
16
|
summary: 'List every component theming target a theme can override.',
|
|
17
17
|
description:
|
|
18
18
|
'Enumerates the whole themeable surface: each `defineTheme` components key, the stable ' +
|
|
19
|
-
'class it paints, the component that declares it,
|
|
20
|
-
'override keys under it
|
|
19
|
+
'class it paints, the component that declares it, the props and states that are legal ' +
|
|
20
|
+
'override keys under it, and the canonical replacement when a listed target is deprecated. ' +
|
|
21
|
+
'Same source as the Theming table `astryx component <Name>` prints ' +
|
|
21
22
|
'(the component docs), so the list cannot drift from the components, and `theme build` ' +
|
|
22
23
|
'validates overrides against this exact set. A filter naming a component gives that ' +
|
|
23
|
-
|
|
24
|
+
"component's set; anything else is a substring search over the keys.",
|
|
24
25
|
importPath: '@astryxdesign/cli/api',
|
|
25
26
|
signature:
|
|
26
27
|
'themeTargets(filter?: string, ctx?: {cwd?: string}): Promise<ThemeTargetsResponse>',
|
|
27
|
-
keywords: [
|
|
28
|
+
keywords: [
|
|
29
|
+
'theme',
|
|
30
|
+
'targets',
|
|
31
|
+
'defineTheme',
|
|
32
|
+
'components',
|
|
33
|
+
'override',
|
|
34
|
+
'class',
|
|
35
|
+
'states',
|
|
36
|
+
'audit',
|
|
37
|
+
],
|
|
28
38
|
params: [
|
|
29
39
|
{
|
|
30
40
|
name: 'filter',
|
|
@@ -35,18 +45,22 @@ export const doc = {
|
|
|
35
45
|
{
|
|
36
46
|
name: 'ctx.cwd',
|
|
37
47
|
type: 'string',
|
|
38
|
-
description:
|
|
48
|
+
description:
|
|
49
|
+
"Directory the project's @astryxdesign/core is resolved from.",
|
|
39
50
|
},
|
|
40
51
|
],
|
|
41
52
|
returns: [
|
|
42
53
|
{
|
|
43
54
|
type: 'theme.targets',
|
|
44
55
|
description:
|
|
45
|
-
'The echoed filter, how many components are represented, and the targets: each {key, className, component, props, states}.',
|
|
56
|
+
'The echoed filter, how many components are represented, and the targets: each {key, className, component, props, states, deprecatedFor?}.',
|
|
46
57
|
},
|
|
47
58
|
],
|
|
48
59
|
throws: [
|
|
49
|
-
{
|
|
60
|
+
{
|
|
61
|
+
code: 'ERR_CORE_NOT_FOUND',
|
|
62
|
+
when: '@astryxdesign/core cannot be resolved from cwd',
|
|
63
|
+
},
|
|
50
64
|
{code: 'ERR_UNKNOWN_COMPONENT', when: 'a filter matches no target'},
|
|
51
65
|
],
|
|
52
66
|
examples: [
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* @property {string[]} [integration]
|
|
21
21
|
* @property {string} [path]
|
|
22
22
|
* @property {boolean} [installDeps]
|
|
23
|
+
* @property {boolean} [registry]
|
|
23
24
|
*/
|
|
24
25
|
/**
|
|
25
26
|
* Detect the installed target version from node_modules.
|
|
@@ -217,6 +218,7 @@ export type UpgradeOptions = {
|
|
|
217
218
|
integration?: string[] | undefined;
|
|
218
219
|
path?: string | undefined;
|
|
219
220
|
installDeps?: boolean | undefined;
|
|
221
|
+
registry?: boolean | undefined;
|
|
220
222
|
};
|
|
221
223
|
export type AgentDocsRefreshPlan = {
|
|
222
224
|
cwd: string;
|
package/api/upgrade/_adapter.mjs
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/** @param {string} root */
|
|
5
|
+
export function discoverRegistryReceipts(root: string): string[];
|
|
6
|
+
/**
|
|
7
|
+
* @param {{apply?: boolean, path?: string}} options
|
|
8
|
+
* @param {{cwd?: string, fetchImpl?: typeof fetch, registryOrigin?: string, expectedVersion?: string, requireExpectedVersion?: boolean}} [ctx]
|
|
9
|
+
*/
|
|
10
|
+
export function reconcileRegistryCompositions(options?: {
|
|
11
|
+
apply?: boolean;
|
|
12
|
+
path?: string;
|
|
13
|
+
}, { cwd, fetchImpl, registryOrigin, expectedVersion, requireExpectedVersion, }?: {
|
|
14
|
+
cwd?: string;
|
|
15
|
+
fetchImpl?: typeof fetch;
|
|
16
|
+
registryOrigin?: string;
|
|
17
|
+
expectedVersion?: string;
|
|
18
|
+
requireExpectedVersion?: boolean;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
summary: import("../upgrade.type.mjs").RegistryCompositionSummary;
|
|
21
|
+
writtenFiles: string[];
|
|
22
|
+
}>;
|
|
23
|
+
/** @param {import('../upgrade.type.mjs').RegistryCompositionSummary} summary */
|
|
24
|
+
export function logRegistryCompositionSummary(summary: import("../upgrade.type.mjs").RegistryCompositionSummary): void;
|
|
25
|
+
/**
|
|
26
|
+
* Standalone `astryx upgrade --registry` leaf.
|
|
27
|
+
* @param {{apply?: boolean, path?: string}} options
|
|
28
|
+
* @param {{cwd?: string, fetchImpl?: typeof fetch, registryOrigin?: string, expectedVersion?: string, requireExpectedVersion?: boolean}} [ctx]
|
|
29
|
+
* @returns {Promise<import('../upgrade.type.mjs').UpgradeRegistryResponse>}
|
|
30
|
+
*/
|
|
31
|
+
export function registryUpgrade(options?: {
|
|
32
|
+
apply?: boolean;
|
|
33
|
+
path?: string;
|
|
34
|
+
}, ctx?: {
|
|
35
|
+
cwd?: string;
|
|
36
|
+
fetchImpl?: typeof fetch;
|
|
37
|
+
registryOrigin?: string;
|
|
38
|
+
expectedVersion?: string;
|
|
39
|
+
requireExpectedVersion?: boolean;
|
|
40
|
+
}): Promise<import("../upgrade.type.mjs").UpgradeRegistryResponse>;
|