@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
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'function',
|
|
6
|
+
kind: 'api',
|
|
7
|
+
name: 'integrationAdd',
|
|
8
|
+
displayName: 'integrationAdd()',
|
|
9
|
+
summary: 'Add one working contribution to an integration package.',
|
|
10
|
+
description:
|
|
11
|
+
'Creates every file required by the selected contribution, creates the integration manifest on first use, updates an existing package files allowlist without creating one, and verifies the contribution through the same inventory contract used by integrationPackCheck.',
|
|
12
|
+
importPath: '@astryxdesign/cli/api',
|
|
13
|
+
signature:
|
|
14
|
+
'integrationAdd(kind: IntegrationAddKind, name: string, options?: IntegrationAddOptions): Promise<IntegrationAddResponse>',
|
|
15
|
+
keywords: [
|
|
16
|
+
'integration',
|
|
17
|
+
'add',
|
|
18
|
+
'author',
|
|
19
|
+
'scaffold',
|
|
20
|
+
'component',
|
|
21
|
+
'doc',
|
|
22
|
+
'template',
|
|
23
|
+
'codemod',
|
|
24
|
+
'theme',
|
|
25
|
+
],
|
|
26
|
+
params: [
|
|
27
|
+
{
|
|
28
|
+
name: 'kind',
|
|
29
|
+
type: 'IntegrationAddKind',
|
|
30
|
+
description: 'Contribution kind.',
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'name',
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'Contribution name, or the literal agent-doc line.',
|
|
37
|
+
required: true,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'options.cwd',
|
|
41
|
+
type: 'string',
|
|
42
|
+
description: 'Directory inside the integration package.',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'options.dryRun',
|
|
46
|
+
type: 'boolean',
|
|
47
|
+
description: 'Validate and return the planned receipt without writing.',
|
|
48
|
+
default: 'false',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'options.templateType',
|
|
52
|
+
type: "'page' | 'block'",
|
|
53
|
+
description: 'Template type. Only valid for template.',
|
|
54
|
+
default: "'page'",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'options.replaces',
|
|
58
|
+
type: 'string',
|
|
59
|
+
description: 'Existing topic to replace. Only valid for doc.',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'options.extends',
|
|
63
|
+
type: 'string',
|
|
64
|
+
description: 'Existing topic to extend. Only valid for doc.',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'options.to',
|
|
68
|
+
type: 'string',
|
|
69
|
+
description: 'Exact target semver. Required for codemod.',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
returns: [
|
|
73
|
+
{
|
|
74
|
+
type: 'integration.add',
|
|
75
|
+
description:
|
|
76
|
+
'A typed receipt naming every affected project-relative path and whether writes occurred.',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
examples: [
|
|
80
|
+
{
|
|
81
|
+
label: 'Add a component',
|
|
82
|
+
code: "await integrationAdd('component', 'AcmeWidget');",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: 'Preview a doc topic',
|
|
86
|
+
code: "await integrationAdd('doc', 'deploying', {dryRun: true});",
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
command: 'integration add',
|
|
90
|
+
related: [
|
|
91
|
+
'integrationAddComponent',
|
|
92
|
+
'integrationAddDoc',
|
|
93
|
+
'integrationAddTemplate',
|
|
94
|
+
'integrationAddCodemod',
|
|
95
|
+
'integrationAddAgentDoc',
|
|
96
|
+
'integrationAddTheme',
|
|
97
|
+
'integrationPackCheck',
|
|
98
|
+
'validateIntegration',
|
|
99
|
+
],
|
|
100
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
5
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'function',
|
|
6
|
+
kind: 'api',
|
|
7
|
+
name: 'integrationAddAgentDoc',
|
|
8
|
+
displayName: 'integrationAddAgentDoc()',
|
|
9
|
+
summary: 'Append one validated agent-guidance line.',
|
|
10
|
+
description:
|
|
11
|
+
'Converges the integration manifest to contain the literal guidance line exactly once while preserving comments and refusing malformed existing state.',
|
|
12
|
+
importPath: '@astryxdesign/cli/api',
|
|
13
|
+
signature:
|
|
14
|
+
'integrationAddAgentDoc(line: string, options?: IntegrationAddAgentDocOptions): Promise<IntegrationAddResponse>',
|
|
15
|
+
keywords: ['integration', 'agent', 'guidance', 'author', 'api'],
|
|
16
|
+
params: [
|
|
17
|
+
{
|
|
18
|
+
name: 'line',
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'Literal guidance line to append.',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'options.cwd',
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Directory inside the integration package.',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'options.dryRun',
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
description: 'Return the exact write plan without changing files.',
|
|
32
|
+
default: 'false',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
returns: [
|
|
36
|
+
{
|
|
37
|
+
type: 'integration.add',
|
|
38
|
+
description: 'The shared typed authoring receipt.',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
examples: [
|
|
42
|
+
{
|
|
43
|
+
label: 'Add agent guidance',
|
|
44
|
+
code: "await integrationAddAgentDoc('Use AcmeWidget for account status.');",
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
command: 'integration add agent-doc',
|
|
48
|
+
related: ['integrationAdd', 'integrationPackCheck'],
|
|
49
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
5
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'function',
|
|
6
|
+
kind: 'api',
|
|
7
|
+
name: 'integrationAddCodemod',
|
|
8
|
+
displayName: 'integrationAddCodemod()',
|
|
9
|
+
summary: 'Add a safe identity codemod at an exact target version.',
|
|
10
|
+
description:
|
|
11
|
+
'Creates a non-throwing identity transform under the exact semver folder and declares the codemods root on first use.',
|
|
12
|
+
importPath: '@astryxdesign/cli/api',
|
|
13
|
+
signature:
|
|
14
|
+
'integrationAddCodemod(name: string, options: IntegrationAddCodemodOptions): Promise<IntegrationAddResponse>',
|
|
15
|
+
keywords: ['integration', 'codemod', 'upgrade', 'migration', 'author', 'api'],
|
|
16
|
+
params: [
|
|
17
|
+
{
|
|
18
|
+
name: 'name',
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'Lowercase kebab-case codemod id.',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'options.to',
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Exact target semver version.',
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'options.cwd',
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'Directory inside the integration package.',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'options.dryRun',
|
|
36
|
+
type: 'boolean',
|
|
37
|
+
description: 'Return the exact write plan without changing files.',
|
|
38
|
+
default: 'false',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
returns: [
|
|
42
|
+
{
|
|
43
|
+
type: 'integration.add',
|
|
44
|
+
description: 'The shared typed authoring receipt.',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
examples: [
|
|
48
|
+
{
|
|
49
|
+
label: 'Add a codemod',
|
|
50
|
+
code: "await integrationAddCodemod('rename-status', {to: '1.2.0'});",
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
command: 'integration add codemod',
|
|
54
|
+
related: ['integrationAdd', 'integrationPackCheck'],
|
|
55
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
5
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'function',
|
|
6
|
+
kind: 'api',
|
|
7
|
+
name: 'integrationAddComponent',
|
|
8
|
+
displayName: 'integrationAddComponent()',
|
|
9
|
+
summary: 'Add a complete component contribution.',
|
|
10
|
+
description:
|
|
11
|
+
'Creates the same-stem component source and metadata pair, declares the components root on first use, preserves existing package allowlists, and publishes an exact source subpath when the package already has an exports map.',
|
|
12
|
+
importPath: '@astryxdesign/cli/api',
|
|
13
|
+
signature:
|
|
14
|
+
'integrationAddComponent(name: string, options?: IntegrationAddComponentOptions): Promise<IntegrationAddResponse>',
|
|
15
|
+
keywords: ['integration', 'component', 'author', 'api', 'scaffold'],
|
|
16
|
+
params: [
|
|
17
|
+
{
|
|
18
|
+
name: 'name',
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'PascalCase component export name.',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'options.cwd',
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Directory inside the integration package.',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'options.dryRun',
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
description: 'Return the exact write plan without changing files.',
|
|
32
|
+
default: 'false',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
returns: [
|
|
36
|
+
{
|
|
37
|
+
type: 'integration.add',
|
|
38
|
+
description: 'The shared typed authoring receipt.',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
examples: [
|
|
42
|
+
{
|
|
43
|
+
label: 'Add a component',
|
|
44
|
+
code: "await integrationAddComponent('AcmeWidget');",
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
command: 'integration add component',
|
|
48
|
+
related: ['integrationAdd', 'integrationPackCheck'],
|
|
49
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
5
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'function',
|
|
6
|
+
kind: 'api',
|
|
7
|
+
name: 'integrationAddDoc',
|
|
8
|
+
displayName: 'integrationAddDoc()',
|
|
9
|
+
summary: 'Add a complete reference-doc contribution.',
|
|
10
|
+
description:
|
|
11
|
+
'Creates a valid generic topic, declares the docs root on first use, and supports an intentional replaces or extends relationship.',
|
|
12
|
+
importPath: '@astryxdesign/cli/api',
|
|
13
|
+
signature:
|
|
14
|
+
'integrationAddDoc(name: string, options?: IntegrationAddDocOptions): Promise<IntegrationAddResponse>',
|
|
15
|
+
keywords: ['integration', 'doc', 'topic', 'author', 'api'],
|
|
16
|
+
params: [
|
|
17
|
+
{
|
|
18
|
+
name: 'name',
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'URL-safe topic name.',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'options.cwd',
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Directory inside the integration package.',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'options.dryRun',
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
description: 'Return the exact write plan without changing files.',
|
|
32
|
+
default: 'false',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'options.replaces',
|
|
36
|
+
type: 'string',
|
|
37
|
+
description: 'Existing topic this topic replaces.',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'options.extends',
|
|
41
|
+
type: 'string',
|
|
42
|
+
description: 'Existing topic this topic extends.',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
returns: [
|
|
46
|
+
{
|
|
47
|
+
type: 'integration.add',
|
|
48
|
+
description: 'The shared typed authoring receipt.',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
examples: [
|
|
52
|
+
{
|
|
53
|
+
label: 'Add a replacement topic',
|
|
54
|
+
code: "await integrationAddDoc('getting-started-meta', {replaces: 'getting-started'});",
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
command: 'integration add doc',
|
|
58
|
+
related: ['integrationAdd', 'integrationPackCheck'],
|
|
59
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
5
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'function',
|
|
6
|
+
kind: 'api',
|
|
7
|
+
name: 'integrationAddTemplate',
|
|
8
|
+
displayName: 'integrationAddTemplate()',
|
|
9
|
+
summary: 'Add a complete page or block template contribution.',
|
|
10
|
+
description:
|
|
11
|
+
'Creates the same-stem template source and metadata pair, declares the templates root on first use, and publishes an exact source subpath when the package already has an exports map.',
|
|
12
|
+
importPath: '@astryxdesign/cli/api',
|
|
13
|
+
signature:
|
|
14
|
+
'integrationAddTemplate(name: string, options?: IntegrationAddTemplateOptions): Promise<IntegrationAddResponse>',
|
|
15
|
+
keywords: ['integration', 'template', 'page', 'block', 'author', 'api'],
|
|
16
|
+
params: [
|
|
17
|
+
{
|
|
18
|
+
name: 'name',
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'Lowercase kebab-case template id.',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'options.cwd',
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Directory inside the integration package.',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'options.dryRun',
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
description: 'Return the exact write plan without changing files.',
|
|
32
|
+
default: 'false',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'options.type',
|
|
36
|
+
type: "'page' | 'block'",
|
|
37
|
+
description: 'Template kind.',
|
|
38
|
+
default: "'page'",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
returns: [
|
|
42
|
+
{
|
|
43
|
+
type: 'integration.add',
|
|
44
|
+
description: 'The shared typed authoring receipt.',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
examples: [
|
|
48
|
+
{
|
|
49
|
+
label: 'Add a block',
|
|
50
|
+
code: "await integrationAddTemplate('account-card', {type: 'block'});",
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
command: 'integration add template',
|
|
54
|
+
related: ['integrationAdd', 'integrationPackCheck'],
|
|
55
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
5
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'function',
|
|
6
|
+
kind: 'api',
|
|
7
|
+
name: 'integrationAddTheme',
|
|
8
|
+
displayName: 'integrationAddTheme()',
|
|
9
|
+
summary: 'Add a source theme to an integration package.',
|
|
10
|
+
description:
|
|
11
|
+
'Creates an integration manifest when the package has none, writes a minimal named-export defineTheme source file, adds its entry to the root theme catalog, declares the optional themes root on first use, and includes the manifest and root in package.json files when the package already uses an allowlist. Every path is confined to the package and existing theme files are never overwritten.',
|
|
12
|
+
importPath: '@astryxdesign/cli/api',
|
|
13
|
+
signature:
|
|
14
|
+
'integrationAddTheme(name: string, options?: IntegrationAddThemeOptions): Promise<IntegrationAddResponse>',
|
|
15
|
+
keywords: ['integration', 'add', 'theme', 'author', 'source', 'scaffold'],
|
|
16
|
+
params: [
|
|
17
|
+
{
|
|
18
|
+
name: 'name',
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'Lowercase kebab-case theme name and catalog slug.',
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'options.cwd',
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Directory inside the integration package.',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'options.dryRun',
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
description:
|
|
32
|
+
'Validate and return the same receipt without writing; data.written is false and data.dryRun is true.',
|
|
33
|
+
default: 'false',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
returns: [
|
|
37
|
+
{
|
|
38
|
+
type: 'integration.add',
|
|
39
|
+
description:
|
|
40
|
+
'A typed receipt naming the contribution kind and name, root path and whether it was declared, manifest path, every affected project-relative path, whether writes occurred, and whether this was a dry run.',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
throws: [
|
|
44
|
+
{
|
|
45
|
+
code: 'ERR_INVALID_ARGUMENT',
|
|
46
|
+
when: 'the theme name is not lowercase kebab-case',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
code: 'ERR_FILE_NOT_FOUND',
|
|
50
|
+
when: 'no package.json exists',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
code: 'ERR_FILE_EXISTS',
|
|
54
|
+
when: 'the theme slug or source file already exists',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
code: 'ERR_PATH_TRAVERSAL',
|
|
58
|
+
when: 'a declared themes root escapes the package',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
code: 'ERR_INTEGRATION_ROOT_CONFLICT',
|
|
62
|
+
when: 'the manifest root changed to another path while the command was writing',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
code: 'ERR_THEME_INVALID',
|
|
66
|
+
when: 'the package, integration manifest, or theme catalog is invalid',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
code: 'ERR_WRITE_FAILED',
|
|
70
|
+
when: 'a staged write fails and prior writes are rolled back',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
examples: [
|
|
74
|
+
{
|
|
75
|
+
label: 'Add a theme',
|
|
76
|
+
code: "await integrationAddTheme('ocean');",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
label: 'Preview writes',
|
|
80
|
+
code: "await integrationAddTheme('ocean', {dryRun: true});",
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
command: 'integration add',
|
|
84
|
+
related: ['themeList', 'themeAdd', 'validateIntegration'],
|
|
85
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
5
|
+
export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
|
|
4
|
+
export const doc = {
|
|
5
|
+
type: 'function',
|
|
6
|
+
kind: 'api',
|
|
7
|
+
name: 'integrationPackCheck',
|
|
8
|
+
displayName: 'integrationPackCheck()',
|
|
9
|
+
summary: 'Prove an integration package survives npm packing.',
|
|
10
|
+
description:
|
|
11
|
+
"Validates the local integration, runs the package lifecycle, packs with npm, checks required files against npm's authoritative tarball list, extracts the real tarball into a scratch consumer, compares local and packed contribution inventories, and resolves every packed component through its documented public import to verify that module exports the component.",
|
|
12
|
+
importPath: '@astryxdesign/cli/api',
|
|
13
|
+
signature:
|
|
14
|
+
'integrationPackCheck(options?: IntegrationPackCheckOptions): Promise<IntegrationPackCheckResponse>',
|
|
15
|
+
keywords: ['integration', 'pack', 'check', 'publish', 'tarball', 'consumer'],
|
|
16
|
+
params: [
|
|
17
|
+
{
|
|
18
|
+
name: 'options.cwd',
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'Directory inside the integration package.',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
returns: [
|
|
24
|
+
{
|
|
25
|
+
type: 'integration.pack-check',
|
|
26
|
+
description:
|
|
27
|
+
'Package identity, tarball facts, local and packed inventories, and issues.',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
examples: [
|
|
31
|
+
{label: 'Check the local package', code: 'await integrationPackCheck();'},
|
|
32
|
+
],
|
|
33
|
+
command: 'integration pack',
|
|
34
|
+
related: ['integrationAdd', 'validateIntegration'],
|
|
35
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
* Parse npm's JSON pack result into the facts the checker needs.
|
|
6
|
+
* @param {string} output
|
|
7
|
+
* @returns {{filename: string, fileCount: number, size: number, unpackedSize: number, packedPaths: Set<string>}}
|
|
8
|
+
*/
|
|
9
|
+
export function parseNpmPackOutput(output: string): {
|
|
10
|
+
filename: string;
|
|
11
|
+
fileCount: number;
|
|
12
|
+
size: number;
|
|
13
|
+
unpackedSize: number;
|
|
14
|
+
packedPaths: Set<string>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Verify an integration package is ready to publish.
|
|
18
|
+
*
|
|
19
|
+
* Validates the local structure, cross-references every declared contribution
|
|
20
|
+
* file against the real `npm pack` file list, extracts the tarball into a
|
|
21
|
+
* scratch consumer, and compares local vs packed discovery results exactly.
|
|
22
|
+
*
|
|
23
|
+
* @param {import('./pack-check.type.mjs').IntegrationPackCheckOptions} [options]
|
|
24
|
+
* @returns {Promise<import('./pack-check.type.mjs').IntegrationPackCheckResponse>}
|
|
25
|
+
*/
|
|
26
|
+
export function integrationPackCheck(options?: import("./pack-check.type.mjs").IntegrationPackCheckOptions): Promise<import("./pack-check.type.mjs").IntegrationPackCheckResponse>;
|
|
27
|
+
export type Issue = import("../../foundation/integrations/issue").AstryxIntegrationIssue;
|