@astryxdesign/cli 0.7.4-canary.3f6ea7d → 0.7.4-canary.78641f8
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 +63 -63
- package/api/component/_adapter.mjs +4 -3
- package/api/component/component.mjs +13 -6
- package/api/component/doc-links.test.mjs +33 -0
- package/api/docs/_adapter.d.mts +80 -0
- package/api/docs/_adapter.mjs +261 -11
- package/api/docs/detail/detail.mjs +8 -0
- package/api/docs/docOverlays.test.mjs +2 -1
- package/api/docs/docs.d.mts +16 -6
- package/api/docs/docs.doc.mjs +1 -1
- package/api/docs/docs.mjs +55 -6
- package/api/docs/docs.type.d.mts +28 -2
- package/api/docs/docs.type.mjs +13 -3
- package/api/docs/guide-route-targets.test.mjs +1002 -0
- package/api/docs/index/index.mjs +9 -0
- package/api/docs/integration-tree.test.mjs +22 -0
- package/api/docs/integrationDocs.test.mjs +85 -0
- package/api/docs/list/list.mjs +7 -1
- package/api/docs/node/node.mjs +9 -1
- package/api/docs/reference-blocks.test.mjs +1 -1
- package/api/doctor/built-checks.mjs +43 -13
- package/api/doctor/built-checks.test.mjs +29 -0
- package/api/doctor/doctor.doc.mjs +2 -2
- package/api/hook/list/list.d.mts +1 -1
- package/api/integration/_adapter.d.mts +11 -2
- package/api/integration/_adapter.mjs +30 -4
- package/api/integration/authoring-checks.mjs +29 -2
- package/api/integration/authoring-checks.test.mjs +131 -1
- package/api/integration/check/check.d.mts +4 -1
- package/api/integration/check/check.mjs +34 -4
- package/api/integration/check/check.test.mjs +49 -0
- package/api/integration/example-checks.no-npm.test.mjs +140 -0
- package/api/integration/example-checks.test.mjs +776 -0
- package/api/integration/integration-check.type.d.mts +8 -0
- package/api/integration/integration-check.type.mjs +4 -1
- package/api/integration/integrationCheck.doc.mjs +8 -1
- package/api/integration/integrationDocConflicts.doc.mjs +1 -1
- package/api/integration/pack-check.mjs +65 -1
- package/api/integration/pack-check.test.mjs +63 -0
- package/api/integration/validate-integration-case-disk.test.mjs +14 -2
- package/api/integration/validate-integration-gaps.test.mjs +43 -19
- package/api/integration/validate-integration.mjs +112 -14
- package/api/integration/validate-integration.type.d.mts +23 -4
- package/api/integration/validate-integration.type.mjs +14 -5
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/search/_candidate-score.d.mts +9 -3
- package/api/search/_candidate-score.mjs +90 -3
- package/api/search/_gather-components.mjs +48 -1
- package/api/search/_gather-docs.mjs +12 -2
- package/api/search/_lexical.d.mts +12 -0
- package/api/search/_lexical.mjs +3 -0
- package/api/search/_priority.mjs +5 -2
- package/api/search/_score.d.mts +2 -1
- package/api/search/_score.mjs +4 -3
- package/api/search/search.doc.mjs +1 -1
- package/api/search/search.family-members.test.mjs +124 -0
- package/api/search/search.family-word.test.mjs +146 -0
- package/api/search/search.mjs +28 -0
- package/api/template/template-suffix.test.mjs +26 -0
- package/api/theme/themeBuild.doc.mjs +1 -1
- package/api/theme/themeList.doc.mjs +1 -1
- package/api/theme/themeTargets.doc.mjs +1 -1
- package/assets/discover/official-packages.json +16 -0
- package/assets/docs/author-a-theme.doc.mjs +15 -15
- package/assets/docs/browser-support.doc.mjs +1 -1
- package/assets/docs/getting-started.doc.mjs +16 -16
- package/assets/docs/is-my-code-good.doc.mjs +6 -6
- package/assets/docs/styling-overview.doc.mjs +5 -5
- package/assets/docs/theme.doc.mjs +5 -5
- package/assets/docs/tree/add-a-component.doc.mjs +1 -1
- package/assets/docs/tree/add-a-theme.doc.mjs +2 -2
- package/assets/docs/tree/add-a-topic.doc.mjs +6 -6
- package/assets/docs/tree/agent-guidance.doc.mjs +5 -5
- package/assets/docs/tree/authoring.doc.mjs +2 -2
- package/assets/docs/tree/block-template.doc.mjs +1 -1
- package/assets/docs/tree/check-the-props.doc.mjs +3 -3
- package/assets/docs/tree/check-your-docs.doc.mjs +6 -6
- package/assets/docs/tree/checks.doc.mjs +11 -11
- package/assets/docs/tree/ci-and-containers.doc.mjs +1 -1
- package/assets/docs/tree/cli-command.doc.mjs +6 -6
- package/assets/docs/tree/codemods.doc.mjs +7 -7
- package/assets/docs/tree/component-family.doc.mjs +1 -1
- package/assets/docs/tree/component-imports.doc.mjs +2 -2
- package/assets/docs/tree/component-lookups.doc.mjs +6 -5
- package/assets/docs/tree/computer-agent-guide.doc.mjs +7 -7
- package/assets/docs/tree/computer-integrations.doc.mjs +5 -5
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +3 -3
- package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/describe-the-component.doc.mjs +1 -1
- package/assets/docs/tree/doc-syntax.doc.mjs +219 -0
- package/assets/docs/tree/export-template-assets.doc.mjs +1 -1
- package/assets/docs/tree/extend-or-replace.doc.mjs +39 -7
- package/assets/docs/tree/font-setup.doc.mjs +1 -1
- package/assets/docs/tree/generate-a-palette.doc.mjs +1 -1
- package/assets/docs/tree/global-integrations.doc.mjs +11 -11
- package/assets/docs/tree/global.doc.mjs +2 -2
- package/assets/docs/tree/host-entry.doc.mjs +1 -1
- package/assets/docs/tree/install-once.doc.mjs +4 -4
- package/assets/docs/tree/layout.doc.mjs +1 -1
- package/assets/docs/tree/links.doc.mjs +2 -2
- package/assets/docs/tree/migration-setup.doc.mjs +15 -15
- package/assets/docs/tree/migration.doc.mjs +2 -1
- package/assets/docs/tree/other-libraries.doc.mjs +1 -1
- package/assets/docs/tree/page-template.doc.mjs +2 -2
- package/assets/docs/tree/problems.doc.mjs +8 -8
- package/assets/docs/tree/project-global-or-both.doc.mjs +2 -2
- package/assets/docs/tree/publishing.doc.mjs +7 -7
- package/assets/docs/tree/quick-start.doc.mjs +9 -9
- package/assets/docs/tree/reference.doc.mjs +2 -2
- package/assets/docs/tree/replace-a-core-component.doc.mjs +1 -1
- package/assets/docs/tree/replace-a-core-template.doc.mjs +4 -4
- package/assets/docs/tree/scaffold.doc.mjs +1 -1
- package/assets/docs/tree/sections-and-placement.doc.mjs +3 -3
- package/assets/docs/tree/see-it-in-an-app.doc.mjs +3 -3
- package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
- package/assets/docs/tree/single-component.doc.mjs +4 -4
- package/assets/docs/tree/start-a-template.doc.mjs +5 -5
- package/assets/docs/tree/styling-advanced.doc.mjs +1 -1
- package/assets/docs/tree/styling-libraries.doc.mjs +2 -1
- package/assets/docs/tree/styling.doc.mjs +1 -1
- package/assets/docs/tree/tailwind.doc.mjs +1 -1
- package/assets/docs/tree/test-in-an-app.doc.mjs +5 -5
- package/assets/docs/tree/test-template-in-app.doc.mjs +6 -6
- package/assets/docs/tree/tokens-and-setup.doc.mjs +1 -1
- package/assets/docs/tree/troubleshooting.doc.mjs +24 -20
- package/assets/docs/tree/uninstall.doc.mjs +2 -2
- package/assets/docs/tree/updates.doc.mjs +1 -1
- package/assets/docs/tree/upgrading.doc.mjs +3 -3
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +1 -1
- package/assets/docs/tree/verify-packed-template.doc.mjs +3 -3
- package/assets/docs/tree/versioning.doc.mjs +4 -4
- package/assets/docs/tree/who-answers.doc.mjs +4 -4
- package/assets/docs/tree/write-the-template-file.doc.mjs +4 -4
- package/assets/docs/use-a-theme.doc.mjs +10 -10
- package/assets/docs/use-integrations.doc.mjs +1 -1
- package/assets/docs/working-with-ai.doc.mjs +15 -15
- package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +54 -0
- package/assets/templates/themes/butter/butterPalettes.generated.receipt.json +1499 -0
- package/assets/templates/themes/butter/butterPalettes.generated.ts +550 -0
- package/assets/templates/themes/butter/butterTheme.ts +274 -234
- package/assets/templates/themes/butter/palette.config.json +484 -0
- package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +51 -0
- package/assets/templates/themes/matcha/matchaPalettes.generated.receipt.json +1502 -0
- package/assets/templates/themes/matcha/matchaPalettes.generated.ts +501 -0
- package/assets/templates/themes/matcha/matchaPalettes.ts +21 -0
- package/assets/templates/themes/matcha/matchaTheme.ts +164 -103
- package/assets/templates/themes/matcha/palette.config.json +448 -0
- package/assets/templates/themes/y2k/palette.config.json +166 -0
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +54 -0
- package/assets/templates/themes/y2k/y2kPalettes.generated.receipt.json +872 -0
- package/assets/templates/themes/y2k/y2kPalettes.generated.ts +550 -0
- package/assets/templates/themes/y2k/y2kPalettes.ts +257 -0
- package/assets/templates/themes/y2k/y2kTheme.ts +164 -391
- package/authoring/codemod/codemod.doc.mjs +1 -1
- package/authoring/config/config.doc.mjs +4 -4
- package/authoring/debug/parse.d.mts +1 -1
- package/authoring/discover/discover.doc.mjs +1 -1
- package/authoring/doctypes/_schema.d.mts +4 -0
- package/authoring/doctypes/_schema.mjs +4 -0
- package/authoring/doctypes/reference/type.ts +14 -2
- package/authoring/gap-report/gap-report.doc.mjs +1 -1
- package/authoring/integration/integration.doc.mjs +6 -6
- package/clients/cli/commands/docs.doc.mjs +1 -1
- package/clients/cli/commands/docs.mjs +27 -2
- package/clients/cli/commands/docs.test.mjs +1 -1
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +1 -1
- package/clients/cli/commands/doctor.doc.mjs +1 -1
- package/clients/cli/commands/doctor.mjs +12 -1
- package/clients/cli/commands/integration-check.doc.mjs +11 -0
- package/clients/cli/commands/integration-check.test.mjs +36 -3
- package/clients/cli/commands/integration-pack.doc.mjs +1 -1
- package/clients/cli/commands/integration-verify.doc.mjs +1 -1
- package/clients/cli/commands/integration.mjs +15 -3
- package/clients/cli/commands/theme-targets.doc.mjs +1 -1
- package/clients/cli/commands/upgrade.doc.mjs +2 -2
- package/clients/cli/lib/define-command.mjs +5 -3
- package/foundation/agent-docs/agent-docs.d.mts +14 -2
- package/foundation/agent-docs/agent-docs.mjs +65 -4
- package/foundation/agent-docs/agent-docs.test.mjs +107 -0
- package/foundation/discovery/docs-discovery.d.mts +93 -2
- package/foundation/discovery/docs-discovery.mjs +237 -8
- package/foundation/discovery/runner-allowlist.d.mts +2 -0
- package/foundation/discovery/runner-allowlist.mjs +4 -0
- package/foundation/discovery/runner-commands.d.mts +29 -13
- package/foundation/discovery/runner-commands.mjs +253 -17
- package/foundation/discovery/stray-pointers.mjs +11 -5
- package/foundation/discovery/stray-pointers.test.mjs +6 -0
- package/foundation/discovery/template-adapter.mjs +11 -0
- package/foundation/doc-compiler/compile.mjs +8 -1
- package/foundation/doc-compiler/doc-loads.test.mjs +7 -0
- package/foundation/doc-compiler/doc-syntax.d.mts +194 -0
- package/foundation/doc-compiler/doc-syntax.mjs +739 -0
- package/foundation/doc-compiler/doc-syntax.test.mjs +383 -0
- package/foundation/doc-compiler/links.d.mts +13 -16
- package/foundation/doc-compiler/links.mjs +40 -7
- package/foundation/doc-compiler/tree.d.mts +5 -0
- package/foundation/doc-compiler/tree.mjs +9 -0
- package/foundation/env/package-manager.d.mts +18 -0
- package/foundation/env/package-manager.mjs +40 -0
- package/foundation/integrations/cli-requirement.d.mts +29 -0
- package/foundation/integrations/cli-requirement.mjs +47 -0
- package/foundation/integrations/cli-requirement.test.mjs +23 -2
- package/foundation/integrations/validate-contributions.d.mts +53 -0
- package/foundation/integrations/validate-contributions.mjs +788 -0
- package/foundation/response/response-types.doc.mjs +6 -6
- package/package.json +9 -9
|
@@ -71,6 +71,20 @@ export const THEMES_CLI = '0.6.4';
|
|
|
71
71
|
*/
|
|
72
72
|
export const SECTION_IDS_CLI = '0.6.4';
|
|
73
73
|
|
|
74
|
+
/**
|
|
75
|
+
* The first CLI release that reads a doc section's `before` and `after`.
|
|
76
|
+
* Earlier releases reject the fields and hide every doc topic the package
|
|
77
|
+
* ships.
|
|
78
|
+
*/
|
|
79
|
+
export const SECTION_POSITION_CLI = '0.7.4';
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The first stable CLI release that renders doc tokens (`{@command …}`,
|
|
83
|
+
* `{@pm …}`, `{@pm-only …}`) for the reader. Every earlier release prints
|
|
84
|
+
* them as written, so readers see raw tokens.
|
|
85
|
+
*/
|
|
86
|
+
export const DOC_TOKENS_CLI = '0.7.4';
|
|
87
|
+
|
|
74
88
|
const VERSION_RE = /^v?(\d+|[xX*])(?:\.(\d+|[xX*]))?(?:\.(\d+|[xX*]))?(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
75
89
|
|
|
76
90
|
/**
|
|
@@ -226,6 +240,39 @@ export function sectionIdsCliProblem(pkg) {
|
|
|
226
240
|
);
|
|
227
241
|
}
|
|
228
242
|
|
|
243
|
+
/**
|
|
244
|
+
* Why a package with a doc section that sets `before` or `after` would lose
|
|
245
|
+
* its doc topics on an older CLI, or null when its declared CLI range admits
|
|
246
|
+
* only CLIs that read the fields (spec:AST-046 FR11).
|
|
247
|
+
* @param {any} pkg package.json
|
|
248
|
+
* @returns {string | null}
|
|
249
|
+
*/
|
|
250
|
+
export function sectionPositionCliProblem(pkg) {
|
|
251
|
+
return cliRangeProblem(
|
|
252
|
+
pkg,
|
|
253
|
+
'has a doc section that sets `before` or `after`',
|
|
254
|
+
'rejects the fields, and can hide every doc topic the package ships',
|
|
255
|
+
SECTION_POSITION_CLI,
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Why a package whose docs write doc tokens would show them raw on an older
|
|
261
|
+
* CLI, or null when its declared CLI range admits only CLIs that render
|
|
262
|
+
* them. Every release before the first that renders them prints a token as
|
|
263
|
+
* written.
|
|
264
|
+
* @param {any} pkg package.json
|
|
265
|
+
* @returns {string | null}
|
|
266
|
+
*/
|
|
267
|
+
export function docTokensCliProblem(pkg) {
|
|
268
|
+
return cliRangeProblem(
|
|
269
|
+
pkg,
|
|
270
|
+
'writes doc tokens (`{@command …}`, `{@pm …}` or `{@pm-only …}`) in its docs',
|
|
271
|
+
'prints each token as written, so readers see raw tokens instead of commands',
|
|
272
|
+
DOC_TOKENS_CLI,
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
229
276
|
/**
|
|
230
277
|
* Why a package that ships a theme would lose its themes and doc topics on an
|
|
231
278
|
* older CLI, or null when its declared CLI range admits only CLIs that read
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
KEYWORDS_CLI,
|
|
10
10
|
NAMESPACE_DOCS_CLI,
|
|
11
11
|
SECTION_IDS_CLI,
|
|
12
|
+
DOC_TOKENS_CLI,
|
|
12
13
|
TEMPLATE_REPLACES_CLI,
|
|
13
14
|
cliRangeProblem,
|
|
14
15
|
componentReplacesCliProblem,
|
|
@@ -18,6 +19,7 @@ import {
|
|
|
18
19
|
keywordsCliProblem,
|
|
19
20
|
replacesCliProblem,
|
|
20
21
|
sectionIdsCliProblem,
|
|
22
|
+
docTokensCliProblem,
|
|
21
23
|
themesCliProblem,
|
|
22
24
|
withCliPeer,
|
|
23
25
|
withDocsTreeCli,
|
|
@@ -162,7 +164,9 @@ describe('template replaces and keywords floors in the shipped docs', () => {
|
|
|
162
164
|
])('gives the %s fix the floor the check asks for', (code, floor) => {
|
|
163
165
|
const row = read('../../assets/docs/tree/troubleshooting.doc.mjs')
|
|
164
166
|
.split('],')
|
|
165
|
-
.find(part => part.includes(`${code}:`))
|
|
167
|
+
.find(part => part.includes(`${code}:`))
|
|
168
|
+
// The doc's single-quoted string escapes the command's own quotes.
|
|
169
|
+
?.replaceAll("\\'", "'");
|
|
166
170
|
expect(row).toContain(`@astryxdesign/cli=>=${floor}'`);
|
|
167
171
|
});
|
|
168
172
|
});
|
|
@@ -222,7 +226,8 @@ describe('componentReplacesCliProblem', () => {
|
|
|
222
226
|
);
|
|
223
227
|
const row = troubleshooting
|
|
224
228
|
.split('],')
|
|
225
|
-
.find(part => part.includes('`component_replaces_needs_cli`'))
|
|
229
|
+
.find(part => part.includes('`component_replaces_needs_cli`'))
|
|
230
|
+
?.replaceAll("\\'", "'");
|
|
226
231
|
expect(row).toContain(`@astryxdesign/cli=>=${COMPONENT_REPLACES_CLI}'`);
|
|
227
232
|
// Every version that row names is the floor.
|
|
228
233
|
expect(new Set(row?.match(/\d+\.\d+\.\d+/g))).toEqual(
|
|
@@ -252,6 +257,18 @@ describe('themesCliProblem and sectionIdsCliProblem', () => {
|
|
|
252
257
|
}
|
|
253
258
|
});
|
|
254
259
|
|
|
260
|
+
it('asks for a CLI from 0.7.4 for doc tokens', () => {
|
|
261
|
+
expect(docTokensCliProblem({name: '@acme/kit'})).toContain('writes doc tokens');
|
|
262
|
+
for (const range of ['>=0.7.4', '^0.7.4', '>=0.8.0']) {
|
|
263
|
+
expect(docTokensCliProblem({peerDependencies: {'@astryxdesign/cli': range}})).toBeNull();
|
|
264
|
+
}
|
|
265
|
+
for (const range of ['>=0.6.4', '^0.7.0', '>=0.7.3']) {
|
|
266
|
+
expect(
|
|
267
|
+
docTokensCliProblem({peerDependencies: {'@astryxdesign/cli': range}}),
|
|
268
|
+
).toContain('admits a stable CLI before 0.7.4');
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
|
|
255
272
|
it('gives replaces and keywords their own floors', () => {
|
|
256
273
|
// `>=0.6.4` admits published 0.6.4 and 0.6.5, which drop a template that
|
|
257
274
|
// sets `keywords` but apply one that sets `replaces`.
|
|
@@ -274,6 +291,7 @@ describe('themesCliProblem and sectionIdsCliProblem', () => {
|
|
|
274
291
|
NAMESPACE_DOCS_CLI,
|
|
275
292
|
THEMES_CLI,
|
|
276
293
|
SECTION_IDS_CLI,
|
|
294
|
+
DOC_TOKENS_CLI,
|
|
277
295
|
TEMPLATE_REPLACES_CLI,
|
|
278
296
|
KEYWORDS_CLI,
|
|
279
297
|
]) {
|
|
@@ -320,7 +338,10 @@ describe('every feature check names its CLI floor', () => {
|
|
|
320
338
|
replacesCliProblem: TEMPLATE_REPLACES_CLI,
|
|
321
339
|
keywordsCliProblem: KEYWORDS_CLI,
|
|
322
340
|
sectionIdsCliProblem: '0.6.4',
|
|
341
|
+
sectionPositionCliProblem: '0.7.4',
|
|
323
342
|
themesCliProblem: '0.6.4',
|
|
343
|
+
// The release doc tokens ship in.
|
|
344
|
+
docTokensCliProblem: '0.7.4',
|
|
324
345
|
};
|
|
325
346
|
|
|
326
347
|
it('asks each feature for the CLI release this table names', () => {
|
|
@@ -82,6 +82,59 @@ export function blockComponentsCheck(integration: LoadedIntegration): Promise<{
|
|
|
82
82
|
};
|
|
83
83
|
notes: Note[];
|
|
84
84
|
}>;
|
|
85
|
+
/**
|
|
86
|
+
* Whether no `files` entry can reach a path, read case-insensitively and
|
|
87
|
+
* generously (`{a,b}` braces, globs, a no-slash entry at any depth, an entry
|
|
88
|
+
* for the path or any folder above it), for when npm cannot say what it
|
|
89
|
+
* packs: a path this misses is out of the package however npm reads the list.
|
|
90
|
+
* @param {string} rel POSIX, relative to the package root
|
|
91
|
+
* @param {unknown} files
|
|
92
|
+
*/
|
|
93
|
+
export function outsideFiles(rel: string, files: unknown): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* The `!` entry of a `files` field that leaves out `rel` or a folder above
|
|
96
|
+
* it, as written; null when none does.
|
|
97
|
+
* @param {string} rel package-relative path
|
|
98
|
+
* @param {unknown} files the `files` field
|
|
99
|
+
* @returns {string | null}
|
|
100
|
+
*/
|
|
101
|
+
export function negatedFilesEntry(rel: string, files: unknown): string | null;
|
|
102
|
+
/**
|
|
103
|
+
* What a package's examples need to work everywhere they are shown: template
|
|
104
|
+
* lists, docs pages and catalog cards, which render each block alone from
|
|
105
|
+
* the packed package. Four `next` notes, each with a fix to paste
|
|
106
|
+
* (architecture:cli-surface INV35, DEC-11):
|
|
107
|
+
* - `component_without_example`: a published component no block template
|
|
108
|
+
* shows, as its `exampleFor` with `isShowcase: true` (or in
|
|
109
|
+
* `alsoShowcaseFor`). A block named like a showcase that sets neither is a
|
|
110
|
+
* standalone block and does not count. Exempt, because an example cannot
|
|
111
|
+
* fix them: a hidden doc (`hidden: true`), a member of a family (its
|
|
112
|
+
* family's example covers it), a doc kept off the overview
|
|
113
|
+
* (`isHiddenFromOverview: true`, for parts that only make sense inside a
|
|
114
|
+
* parent), and a `Utility` component (providers and context).
|
|
115
|
+
* - `template_category`: a template `category` written as a path, such as
|
|
116
|
+
* `components/X`, with a `"<Group> - <Variant>"` one to write.
|
|
117
|
+
* - `showcase_not_standalone`: a showcase that imports what a browser cannot
|
|
118
|
+
* load (`server-only`, `next/headers`, `next/server`, `next/cache`, a Node
|
|
119
|
+
* built-in) or reads `process.env` past `NODE_ENV`. Type-only imports and
|
|
120
|
+
* comments don't count, and live data is fine: a showcase may fetch
|
|
121
|
+
* through the app. Only the showcase's own file is read.
|
|
122
|
+
* - `template_asset_not_packed`: a file a template loads with `new URL(…,
|
|
123
|
+
* import.meta.url)` that does not exist, or that npm leaves out of the
|
|
124
|
+
* package (`npm pack --dry-run`). When npm cannot answer, an asset no
|
|
125
|
+
* `files` entry can reach is still a note, and any other is returned in
|
|
126
|
+
* `unchecked`.
|
|
127
|
+
* @param {LoadedIntegration} integration
|
|
128
|
+
* @returns {Promise<{notes: Note[], unchecked: Array<{file: string, asset: string, reason: string}>}>}
|
|
129
|
+
*/
|
|
130
|
+
export function componentExamplesCheck(integration: LoadedIntegration): Promise<{
|
|
131
|
+
notes: Note[];
|
|
132
|
+
unchecked: Array<{
|
|
133
|
+
file: string;
|
|
134
|
+
asset: string;
|
|
135
|
+
reason: string;
|
|
136
|
+
}>;
|
|
137
|
+
}>;
|
|
85
138
|
/**
|
|
86
139
|
* The component doc names the check could not judge, shaped like the doc type
|
|
87
140
|
* report so `integration check` counts them as not compared: each doc whose
|