@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,318 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file The import specifier an integration component is reported under has to
|
|
5
|
+
* be the SAME at every surface, and it has to resolve.
|
|
6
|
+
*
|
|
7
|
+
* `component` reports it as ownership metadata and `search` reports it on every
|
|
8
|
+
* hit. Each used to resolve it independently, and they disagreed: `component`
|
|
9
|
+
* honored a doc-authored `import` and otherwise derived the subpath from the
|
|
10
|
+
* doc's directory against the owning package's `exports`, while `search` handed
|
|
11
|
+
* back the bare package name — a specifier that does not resolve for a package
|
|
12
|
+
* whose components live behind subpaths. An agent that searched and then
|
|
13
|
+
* imported what it was told got a broken file.
|
|
14
|
+
*
|
|
15
|
+
* The two now share one resolver and one precedence rule, so the agreement is
|
|
16
|
+
* structural. These tests pin the property rather than the implementation: ask
|
|
17
|
+
* both surfaces about the same component and require the same answer, across
|
|
18
|
+
* every shape a real package's `exports` takes.
|
|
19
|
+
*
|
|
20
|
+
* Fixtures live under a repo-local temp dir, not /tmp, because Vite refuses to
|
|
21
|
+
* dynamically import a module from outside the project root.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import {afterEach, beforeEach, describe, expect, it} from 'vitest';
|
|
25
|
+
import * as fs from 'node:fs';
|
|
26
|
+
import * as path from 'node:path';
|
|
27
|
+
import {component} from './component.mjs';
|
|
28
|
+
import {search} from '../search/search.mjs';
|
|
29
|
+
import {resolveIntegrationImportPath} from '../../foundation/discovery/component-discovery.mjs';
|
|
30
|
+
|
|
31
|
+
const SLOW = 30_000;
|
|
32
|
+
|
|
33
|
+
let tmpDir;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* A consumer project with one configured integration that ships a single
|
|
37
|
+
* component, `AcmeCarousel`, in a directory named after the concept rather
|
|
38
|
+
* than after the component — the shape real packages use when one entry point
|
|
39
|
+
* exports several components, and the case the bare-package answer got wrong.
|
|
40
|
+
*
|
|
41
|
+
* @param {object} [options]
|
|
42
|
+
* @param {Record<string, string>} [options.exports] the owning package's
|
|
43
|
+
* `exports` map; omit it for a package that publishes no subpaths.
|
|
44
|
+
* @param {string} [options.docImport] an `import` the component's doc states
|
|
45
|
+
* for itself, which is canonical and must win over any resolved subpath.
|
|
46
|
+
*/
|
|
47
|
+
function scaffold({exports: exportsMap, docImport} = {}) {
|
|
48
|
+
fs.writeFileSync(
|
|
49
|
+
path.join(tmpDir, 'package.json'),
|
|
50
|
+
JSON.stringify({name: 'consumer', version: '1.0.0'}),
|
|
51
|
+
);
|
|
52
|
+
fs.writeFileSync(
|
|
53
|
+
path.join(tmpDir, 'astryx.config.mjs'),
|
|
54
|
+
"export default {integrations: ['@acme/widgets']};\n",
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const pkgDir = path.join(tmpDir, 'node_modules', '@acme', 'widgets');
|
|
58
|
+
const componentDir = path.join(pkgDir, 'src', 'Carousel');
|
|
59
|
+
fs.mkdirSync(componentDir, {recursive: true});
|
|
60
|
+
|
|
61
|
+
fs.writeFileSync(
|
|
62
|
+
path.join(pkgDir, 'package.json'),
|
|
63
|
+
JSON.stringify({
|
|
64
|
+
name: '@acme/widgets',
|
|
65
|
+
version: '1.0.0',
|
|
66
|
+
...(exportsMap ? {exports: exportsMap} : {}),
|
|
67
|
+
}),
|
|
68
|
+
);
|
|
69
|
+
fs.writeFileSync(
|
|
70
|
+
path.join(pkgDir, 'astryx.integration.mjs'),
|
|
71
|
+
"export default {components: './src'};\n",
|
|
72
|
+
);
|
|
73
|
+
fs.writeFileSync(
|
|
74
|
+
path.join(componentDir, 'AcmeCarousel.tsx'),
|
|
75
|
+
'export const AcmeCarousel = () => null;\n',
|
|
76
|
+
);
|
|
77
|
+
fs.writeFileSync(
|
|
78
|
+
path.join(componentDir, 'AcmeCarousel.doc.mjs'),
|
|
79
|
+
`export const docs = ${JSON.stringify(
|
|
80
|
+
{
|
|
81
|
+
type: 'component',
|
|
82
|
+
name: 'AcmeCarousel',
|
|
83
|
+
displayName: 'Acme Carousel',
|
|
84
|
+
keywords: ['carousel', 'slides'],
|
|
85
|
+
usage: {description: 'A carousel that cycles through slides.'},
|
|
86
|
+
props: [],
|
|
87
|
+
...(docImport ? {import: docImport} : {}),
|
|
88
|
+
},
|
|
89
|
+
null,
|
|
90
|
+
2,
|
|
91
|
+
)};\n`,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** The import `search` reports for a named component, or null. */
|
|
96
|
+
function searchImportFor(result, name) {
|
|
97
|
+
for (const group of Object.values(result.data ?? {})) {
|
|
98
|
+
if (!Array.isArray(group)) continue;
|
|
99
|
+
const hit = group.find(entry => entry?.name === name);
|
|
100
|
+
if (hit) return hit.import ?? null;
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Both surfaces' answer for AcmeCarousel, as `{detail, found}`. */
|
|
106
|
+
async function bothSurfaces() {
|
|
107
|
+
const detail = await component('AcmeCarousel', {cwd: tmpDir});
|
|
108
|
+
const found = await search('carousel', {cwd: tmpDir});
|
|
109
|
+
return {detail: detail.data.import, found: searchImportFor(found, 'AcmeCarousel')};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const SUBPATH_EXPORTS = {
|
|
113
|
+
'.': './src/index.js',
|
|
114
|
+
'./Carousel': './src/Carousel/index.js',
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
beforeEach(() => {
|
|
118
|
+
tmpDir = fs.mkdtempSync(path.join(process.cwd(), '.astryx-import-agreement-test-'));
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
afterEach(() => {
|
|
122
|
+
fs.rmSync(tmpDir, {recursive: true, force: true});
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
describe('integration component import specifiers', () => {
|
|
126
|
+
it(
|
|
127
|
+
'component and search report the same import for the same component',
|
|
128
|
+
async () => {
|
|
129
|
+
scaffold({exports: SUBPATH_EXPORTS});
|
|
130
|
+
const {detail, found} = await bothSurfaces();
|
|
131
|
+
|
|
132
|
+
expect(detail).toBe('@acme/widgets/Carousel');
|
|
133
|
+
expect(found).toBe(detail);
|
|
134
|
+
},
|
|
135
|
+
SLOW,
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
it(
|
|
139
|
+
'neither surface reports the bare package when a subpath is exported',
|
|
140
|
+
async () => {
|
|
141
|
+
scaffold({exports: SUBPATH_EXPORTS});
|
|
142
|
+
const {detail, found} = await bothSurfaces();
|
|
143
|
+
|
|
144
|
+
expect(detail).not.toBe('@acme/widgets');
|
|
145
|
+
expect(found).not.toBe('@acme/widgets');
|
|
146
|
+
},
|
|
147
|
+
SLOW,
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
it(
|
|
151
|
+
'both fall back to the package root when it exports no matching subpath',
|
|
152
|
+
async () => {
|
|
153
|
+
scaffold();
|
|
154
|
+
const {detail, found} = await bothSurfaces();
|
|
155
|
+
|
|
156
|
+
// The bare package is the honest answer here: it is what a consumer
|
|
157
|
+
// would have to write by hand. What matters is that both agree on it.
|
|
158
|
+
expect(detail).toBe('@acme/widgets');
|
|
159
|
+
expect(found).toBe('@acme/widgets');
|
|
160
|
+
},
|
|
161
|
+
SLOW,
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
it(
|
|
165
|
+
'a doc-authored import wins at both surfaces, over any resolved subpath',
|
|
166
|
+
async () => {
|
|
167
|
+
// The alias case: the package canonically publishes this component under
|
|
168
|
+
// a name that is not its directory, and says so in its doc. Resolving the
|
|
169
|
+
// directory would produce `/Carousel`, which is why the two surfaces have
|
|
170
|
+
// to share the precedence rule and not just the resolver.
|
|
171
|
+
scaffold({exports: SUBPATH_EXPORTS, docImport: '@acme/widgets/Alias'});
|
|
172
|
+
const {detail, found} = await bothSurfaces();
|
|
173
|
+
|
|
174
|
+
expect(detail).toBe('@acme/widgets/Alias');
|
|
175
|
+
expect(found).toBe(detail);
|
|
176
|
+
},
|
|
177
|
+
SLOW,
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
it(
|
|
181
|
+
'a doc-authored import is honored even with no exports map at all',
|
|
182
|
+
async () => {
|
|
183
|
+
scaffold({docImport: '@acme/widgets/Alias'});
|
|
184
|
+
const {detail, found} = await bothSurfaces();
|
|
185
|
+
|
|
186
|
+
expect(detail).toBe('@acme/widgets/Alias');
|
|
187
|
+
expect(found).toBe(detail);
|
|
188
|
+
},
|
|
189
|
+
SLOW,
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
it(
|
|
193
|
+
'a wildcard exports map resolves to the exported subpath at both surfaces',
|
|
194
|
+
async () => {
|
|
195
|
+
// `./*` publishes `./Carousel` exactly as a literal key would, so the
|
|
196
|
+
// subpath is the correct answer. An earlier version of this test asserted
|
|
197
|
+
// only that the two surfaces AGREED, and both agreed on the bare package
|
|
198
|
+
// — a specifier that need not resolve at all here, since this package
|
|
199
|
+
// publishes no `.` export. Agreement is necessary and not sufficient.
|
|
200
|
+
scaffold({exports: {'./*': './src/*/index.js'}});
|
|
201
|
+
const {detail, found} = await bothSurfaces();
|
|
202
|
+
|
|
203
|
+
expect(detail).toBe('@acme/widgets/Carousel');
|
|
204
|
+
expect(found).toBe(detail);
|
|
205
|
+
},
|
|
206
|
+
SLOW,
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
it(
|
|
210
|
+
'a wildcard whose target is null does not publish the subpath',
|
|
211
|
+
async () => {
|
|
212
|
+
// `null` blocks a subpath rather than publishing it, so the honest answer
|
|
213
|
+
// is the package root at both surfaces.
|
|
214
|
+
scaffold({exports: {'.': './src/index.js', './*': null}});
|
|
215
|
+
const {detail, found} = await bothSurfaces();
|
|
216
|
+
|
|
217
|
+
expect(detail).toBe('@acme/widgets');
|
|
218
|
+
expect(found).toBe(detail);
|
|
219
|
+
},
|
|
220
|
+
SLOW,
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
it(
|
|
224
|
+
'a prefixed wildcard only matches the subpaths it covers',
|
|
225
|
+
async () => {
|
|
226
|
+
// `./components/*` does not cover `./Carousel`, so this falls back.
|
|
227
|
+
scaffold({exports: {'.': './src/index.js', './components/*': './src/*/index.js'}});
|
|
228
|
+
const {detail, found} = await bothSurfaces();
|
|
229
|
+
|
|
230
|
+
expect(detail).toBe('@acme/widgets');
|
|
231
|
+
expect(found).toBe(detail);
|
|
232
|
+
},
|
|
233
|
+
SLOW,
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
it(
|
|
237
|
+
'an exact key still wins where a wildcard would also match',
|
|
238
|
+
async () => {
|
|
239
|
+
scaffold({
|
|
240
|
+
exports: {
|
|
241
|
+
'.': './src/index.js',
|
|
242
|
+
'./Carousel': './src/Carousel/index.js',
|
|
243
|
+
'./*': './src/*/index.js',
|
|
244
|
+
},
|
|
245
|
+
});
|
|
246
|
+
const {detail, found} = await bothSurfaces();
|
|
247
|
+
|
|
248
|
+
expect(detail).toBe('@acme/widgets/Carousel');
|
|
249
|
+
expect(found).toBe(detail);
|
|
250
|
+
},
|
|
251
|
+
SLOW,
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
it(
|
|
255
|
+
'one matching pattern among several is enough',
|
|
256
|
+
async () => {
|
|
257
|
+
scaffold({
|
|
258
|
+
exports: {
|
|
259
|
+
'.': './src/index.js',
|
|
260
|
+
'./blocks/*': './src/blocks/*.js',
|
|
261
|
+
'./*': './src/*/index.js',
|
|
262
|
+
'./themes/*': './themes/*.css',
|
|
263
|
+
},
|
|
264
|
+
});
|
|
265
|
+
const {detail, found} = await bothSurfaces();
|
|
266
|
+
|
|
267
|
+
expect(detail).toBe('@acme/widgets/Carousel');
|
|
268
|
+
expect(found).toBe(detail);
|
|
269
|
+
},
|
|
270
|
+
SLOW,
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
it(
|
|
274
|
+
'a conditional export object still counts as published',
|
|
275
|
+
async () => {
|
|
276
|
+
// The target may be a conditions object rather than a string; what
|
|
277
|
+
// matters for a specifier is that the subpath is published at all.
|
|
278
|
+
scaffold({
|
|
279
|
+
exports: {
|
|
280
|
+
'.': './src/index.js',
|
|
281
|
+
'./Carousel': {import: './src/Carousel/index.js', require: './cjs/Carousel.js'},
|
|
282
|
+
},
|
|
283
|
+
});
|
|
284
|
+
const {detail, found} = await bothSurfaces();
|
|
285
|
+
|
|
286
|
+
expect(detail).toBe('@acme/widgets/Carousel');
|
|
287
|
+
expect(found).toBe(detail);
|
|
288
|
+
},
|
|
289
|
+
SLOW,
|
|
290
|
+
);
|
|
291
|
+
|
|
292
|
+
it('resolves from disk for a record that carries no parsed exports map', () => {
|
|
293
|
+
// `loadIntegrations` parses the map onto every integration it loads, but a
|
|
294
|
+
// record built by hand — as several tests and callers do — has no such
|
|
295
|
+
// field. Resolution must read the manifest rather than quietly reporting
|
|
296
|
+
// the bare package, because a silent degradation is how the original bug
|
|
297
|
+
// reached users. `undefined` means "nobody parsed it"; `null` means the
|
|
298
|
+
// loader looked and there was none.
|
|
299
|
+
scaffold({exports: SUBPATH_EXPORTS});
|
|
300
|
+
const pkgDir = path.join(tmpDir, 'node_modules', '@acme', 'widgets');
|
|
301
|
+
const docPath = path.join(pkgDir, 'src', 'Carousel', 'AcmeCarousel.doc.mjs');
|
|
302
|
+
|
|
303
|
+
expect(
|
|
304
|
+
resolveIntegrationImportPath(
|
|
305
|
+
{packageDir: pkgDir, docPath, packageName: '@acme/widgets'},
|
|
306
|
+
'AcmeCarousel',
|
|
307
|
+
),
|
|
308
|
+
).toBe('@acme/widgets/Carousel');
|
|
309
|
+
|
|
310
|
+
// A parsed `null` is an answer, not a gap: it must not fall back to a read.
|
|
311
|
+
expect(
|
|
312
|
+
resolveIntegrationImportPath(
|
|
313
|
+
{exportsMap: null, packageDir: pkgDir, docPath, packageName: '@acme/widgets'},
|
|
314
|
+
'AcmeCarousel',
|
|
315
|
+
),
|
|
316
|
+
).toBe('@acme/widgets');
|
|
317
|
+
});
|
|
318
|
+
});
|
package/api/doctor/doctor.d.mts
CHANGED
|
@@ -32,19 +32,43 @@ export function checkThemes(ctx: DoctorContext): DoctorCheck;
|
|
|
32
32
|
*/
|
|
33
33
|
export function checkConfig(ctx: DoctorContext): Promise<DoctorCheck>;
|
|
34
34
|
/**
|
|
35
|
-
* Check 6 —
|
|
35
|
+
* Check 6 — integrations that are loaded without an astryx.config entry.
|
|
36
|
+
*
|
|
37
|
+
* The CLI autolinks an installed dependency that ships an
|
|
38
|
+
* `astryx.integration.*` manifest, so a project can be getting components,
|
|
39
|
+
* templates, themes, docs and codemods from a package nothing in the project mentions.
|
|
40
|
+
* Two questions follow, and this line is the answer to both:
|
|
41
|
+
*
|
|
42
|
+
* - "Why can the CLI see this?" — asked by an author who greps the project
|
|
43
|
+
* for the package name and finds nothing. Reading our source should not be
|
|
44
|
+
* part of that answer.
|
|
45
|
+
* - "Can I delete this dependency?" — asked by an unused-dependency sweep,
|
|
46
|
+
* which decides by looking for source imports. In exactly this population
|
|
47
|
+
* there are none: the manifest is the whole link. Naming the dependency
|
|
48
|
+
* here marks it load-bearing.
|
|
49
|
+
*
|
|
50
|
+
* Always informational. Doctor is a CI gate, and a project that acquired an
|
|
51
|
+
* integration correctly has done nothing to warn about — the point is to say
|
|
52
|
+
* what is loaded, never to push anyone into writing a config entry.
|
|
53
|
+
*
|
|
54
|
+
* @param {DoctorContext} ctx
|
|
55
|
+
* @returns {DoctorCheck}
|
|
56
|
+
*/
|
|
57
|
+
export function checkImplicitIntegrations(ctx: DoctorContext): DoctorCheck;
|
|
58
|
+
/**
|
|
59
|
+
* Check 7 — agent docs exist and contain the Astryx section markers.
|
|
36
60
|
* @param {DoctorContext} ctx
|
|
37
61
|
* @returns {DoctorCheck}
|
|
38
62
|
*/
|
|
39
63
|
export function checkAgentDocs(ctx: DoctorContext): DoctorCheck;
|
|
40
64
|
/**
|
|
41
|
-
* Check
|
|
65
|
+
* Check 8 — @astryxdesign/core peer dependencies are satisfied by installed packages.
|
|
42
66
|
* @param {DoctorContext} ctx
|
|
43
67
|
* @returns {DoctorCheck}
|
|
44
68
|
*/
|
|
45
69
|
export function checkPeerDeps(ctx: DoctorContext): DoctorCheck;
|
|
46
70
|
/**
|
|
47
|
-
* Check
|
|
71
|
+
* Check 9 — report the detected package manager, and say so when the project's
|
|
48
72
|
* own declaration disagrees with what is on disk.
|
|
49
73
|
*
|
|
50
74
|
* Two states are worth surfacing rather than guessing past, because in both the
|
|
@@ -140,6 +164,11 @@ export type DoctorContext = {
|
|
|
140
164
|
* - theme value read from config, or null.
|
|
141
165
|
*/
|
|
142
166
|
configTheme: string | null;
|
|
167
|
+
/**
|
|
168
|
+
* Every integration the project loaded, or null when the project could not be
|
|
169
|
+
* read at all.
|
|
170
|
+
*/
|
|
171
|
+
integrations?: import("../../foundation/integrations/integrations.mjs").LoadedIntegration[] | null | undefined;
|
|
143
172
|
/**
|
|
144
173
|
* - Error thrown while resolving the config
|
|
145
174
|
* path (e.g. multiple config files present), surfaced by checkConfig as a FAIL.
|
|
@@ -16,7 +16,8 @@ export const doc = {
|
|
|
16
16
|
description:
|
|
17
17
|
'Runs a series of side-effect-free diagnostics: Node version, ' +
|
|
18
18
|
'@astryxdesign/core install and version alignment with the CLI, installed ' +
|
|
19
|
-
'themes and wiring, astryx.config validity,
|
|
19
|
+
'themes and wiring, astryx.config validity, integrations linked from ' +
|
|
20
|
+
'package.json without a config entry, agent docs, core peer ' +
|
|
20
21
|
'dependencies, and the detected package manager, and returns a structured ' +
|
|
21
22
|
'report. It only reads (never installs, writes, or mutates), so it is safe ' +
|
|
22
23
|
'as a CI gate and for agents to invoke.',
|
package/api/doctor/doctor.mjs
CHANGED
|
@@ -52,6 +52,9 @@ const _require = createRequire(import.meta.url);
|
|
|
52
52
|
* @property {string|null} coreDir - Resolved core package directory, or null.
|
|
53
53
|
* @property {string|null} configPath - Resolved astryx.config.mjs path, or null.
|
|
54
54
|
* @property {string|null} configTheme - theme value read from config, or null.
|
|
55
|
+
* @property {import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]|null} [integrations]
|
|
56
|
+
* Every integration the project loaded, or null when the project could not be
|
|
57
|
+
* read at all.
|
|
55
58
|
* @property {Error|null} [configError] - Error thrown while resolving the config
|
|
56
59
|
* path (e.g. multiple config files present), surfaced by checkConfig as a FAIL.
|
|
57
60
|
*/
|
|
@@ -354,7 +357,91 @@ export async function checkConfig(ctx) {
|
|
|
354
357
|
}
|
|
355
358
|
|
|
356
359
|
/**
|
|
357
|
-
* Check 6 —
|
|
360
|
+
* Check 6 — integrations that are loaded without an astryx.config entry.
|
|
361
|
+
*
|
|
362
|
+
* The CLI autolinks an installed dependency that ships an
|
|
363
|
+
* `astryx.integration.*` manifest, so a project can be getting components,
|
|
364
|
+
* templates, themes, docs and codemods from a package nothing in the project mentions.
|
|
365
|
+
* Two questions follow, and this line is the answer to both:
|
|
366
|
+
*
|
|
367
|
+
* - "Why can the CLI see this?" — asked by an author who greps the project
|
|
368
|
+
* for the package name and finds nothing. Reading our source should not be
|
|
369
|
+
* part of that answer.
|
|
370
|
+
* - "Can I delete this dependency?" — asked by an unused-dependency sweep,
|
|
371
|
+
* which decides by looking for source imports. In exactly this population
|
|
372
|
+
* there are none: the manifest is the whole link. Naming the dependency
|
|
373
|
+
* here marks it load-bearing.
|
|
374
|
+
*
|
|
375
|
+
* Always informational. Doctor is a CI gate, and a project that acquired an
|
|
376
|
+
* integration correctly has done nothing to warn about — the point is to say
|
|
377
|
+
* what is loaded, never to push anyone into writing a config entry.
|
|
378
|
+
*
|
|
379
|
+
* @param {DoctorContext} ctx
|
|
380
|
+
* @returns {DoctorCheck}
|
|
381
|
+
*/
|
|
382
|
+
export function checkImplicitIntegrations(ctx) {
|
|
383
|
+
const id = 'implicit-integrations';
|
|
384
|
+
const label = 'Implicitly linked integrations';
|
|
385
|
+
|
|
386
|
+
if (ctx.integrations == null) {
|
|
387
|
+
return {
|
|
388
|
+
id,
|
|
389
|
+
label,
|
|
390
|
+
status: 'info',
|
|
391
|
+
message: 'Skipped — the project configuration could not be read.',
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
const implicit = ctx.integrations.filter(
|
|
396
|
+
integration => integration.__autolinked,
|
|
397
|
+
);
|
|
398
|
+
|
|
399
|
+
if (implicit.length === 0) {
|
|
400
|
+
return {
|
|
401
|
+
id,
|
|
402
|
+
label,
|
|
403
|
+
status: 'info',
|
|
404
|
+
message:
|
|
405
|
+
ctx.integrations.length > 0
|
|
406
|
+
? 'None — every loaded integration is named in astryx.config.'
|
|
407
|
+
: 'None — no installed dependency ships an astryx.integration.* manifest.',
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
const described = implicit.map(integration => {
|
|
412
|
+
const version = integration.version ? `@${integration.version}` : '';
|
|
413
|
+
// An npm alias installs a package under a different key. The package's own
|
|
414
|
+
// name is its identity; the KEY is what package.json says and what a
|
|
415
|
+
// dependency sweep reads, so when they differ both have to be here.
|
|
416
|
+
const alias =
|
|
417
|
+
integration.__spec && integration.__spec !== integration.name
|
|
418
|
+
? ` (declared as "${integration.__spec}")`
|
|
419
|
+
: '';
|
|
420
|
+
const roots = ['components', 'templates', 'themes', 'docs', 'codemods'].filter(
|
|
421
|
+
root => integration[/** @type {'components'} */ (root)],
|
|
422
|
+
);
|
|
423
|
+
const contributes = roots.length > 0 ? roots.join(', ') : 'nothing';
|
|
424
|
+
return `${integration.name}${version}${alias} from ${integration.__dependencyField}, contributing ${contributes}`;
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
const plural = implicit.length === 1 ? '' : 's';
|
|
428
|
+
return {
|
|
429
|
+
id,
|
|
430
|
+
label,
|
|
431
|
+
status: 'info',
|
|
432
|
+
message:
|
|
433
|
+
`${implicit.length} integration${plural} loaded from installed ` +
|
|
434
|
+
`dependencies with no astryx.config entry: ${described.join('; ')}.`,
|
|
435
|
+
fix:
|
|
436
|
+
'Nothing to fix. Keep these dependencies installed. The CLI links them ' +
|
|
437
|
+
'from package.json, so an unused-dependency check that looks only for ' +
|
|
438
|
+
'source imports will report them as unused. Add them to `integrations` ' +
|
|
439
|
+
'in astryx.config.* to make the link explicit.',
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Check 7 — agent docs exist and contain the Astryx section markers.
|
|
358
445
|
* @param {DoctorContext} ctx
|
|
359
446
|
* @returns {DoctorCheck}
|
|
360
447
|
*/
|
|
@@ -408,7 +495,7 @@ export function checkAgentDocs(ctx) {
|
|
|
408
495
|
}
|
|
409
496
|
|
|
410
497
|
/**
|
|
411
|
-
* Check
|
|
498
|
+
* Check 8 — @astryxdesign/core peer dependencies are satisfied by installed packages.
|
|
412
499
|
* @param {DoctorContext} ctx
|
|
413
500
|
* @returns {DoctorCheck}
|
|
414
501
|
*/
|
|
@@ -495,7 +582,7 @@ export function checkPeerDeps(ctx) {
|
|
|
495
582
|
}
|
|
496
583
|
|
|
497
584
|
/**
|
|
498
|
-
* Check
|
|
585
|
+
* Check 9 — report the detected package manager, and say so when the project's
|
|
499
586
|
* own declaration disagrees with what is on disk.
|
|
500
587
|
*
|
|
501
588
|
* Two states are worth surfacing rather than guessing past, because in both the
|
|
@@ -561,6 +648,7 @@ export const SYNC_CHECKS = [
|
|
|
561
648
|
checkCoreInstalled,
|
|
562
649
|
checkVersionAlignment,
|
|
563
650
|
checkThemes,
|
|
651
|
+
checkImplicitIntegrations,
|
|
564
652
|
checkAgentDocs,
|
|
565
653
|
checkPeerDeps,
|
|
566
654
|
checkPackageManager,
|
|
@@ -587,12 +675,16 @@ export async function runChecks(options = {}) {
|
|
|
587
675
|
configError = /** @type {Error} */ (err);
|
|
588
676
|
}
|
|
589
677
|
|
|
590
|
-
// Resolve a possible theme key from config
|
|
678
|
+
// Resolve a possible theme key from config, and the integrations the project
|
|
679
|
+
// actually loaded (best-effort; never throws).
|
|
591
680
|
let configTheme = null;
|
|
681
|
+
/** @type {import('../../foundation/integrations/integrations.mjs').LoadedIntegration[]|null} */
|
|
682
|
+
let integrations = null;
|
|
592
683
|
try {
|
|
593
684
|
const project = await Project.load(cwd);
|
|
594
685
|
configTheme =
|
|
595
686
|
/** @type {{theme?: string}} */ (project.config ?? {}).theme ?? null;
|
|
687
|
+
integrations = project.loadedIntegrations;
|
|
596
688
|
} catch {
|
|
597
689
|
// Best-effort: a missing/invalid config leaves configTheme null.
|
|
598
690
|
}
|
|
@@ -604,6 +696,7 @@ export async function runChecks(options = {}) {
|
|
|
604
696
|
coreDir,
|
|
605
697
|
configPath,
|
|
606
698
|
configTheme,
|
|
699
|
+
integrations,
|
|
607
700
|
configError,
|
|
608
701
|
};
|
|
609
702
|
|
|
@@ -11,7 +11,12 @@ import * as fs from 'node:fs';
|
|
|
11
11
|
import * as os from 'node:os';
|
|
12
12
|
import * as path from 'node:path';
|
|
13
13
|
import {fileURLToPath} from 'node:url';
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
doctor,
|
|
16
|
+
checkImplicitIntegrations,
|
|
17
|
+
checkVersionAlignment,
|
|
18
|
+
checkPackageManager,
|
|
19
|
+
} from './doctor.mjs';
|
|
15
20
|
|
|
16
21
|
const REPO = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../..');
|
|
17
22
|
const cwd = REPO;
|
|
@@ -208,3 +213,87 @@ describe('checkPackageManager', () => {
|
|
|
208
213
|
expect(c.message).toContain('yarn.lock');
|
|
209
214
|
});
|
|
210
215
|
});
|
|
216
|
+
|
|
217
|
+
describe('checkImplicitIntegrations', () => {
|
|
218
|
+
/** @param {object} [fields] */
|
|
219
|
+
const autolinked = (fields = {}) => ({
|
|
220
|
+
name: '@acme/widgets',
|
|
221
|
+
version: '1.0.0',
|
|
222
|
+
components: '/abs/components',
|
|
223
|
+
__spec: '@acme/widgets',
|
|
224
|
+
__autolinked: true,
|
|
225
|
+
__dependencyField: 'dependencies',
|
|
226
|
+
...fields,
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
it('skips when the project could not be read', () => {
|
|
230
|
+
const c = checkImplicitIntegrations({integrations: null});
|
|
231
|
+
expect(c.status).toBe('info');
|
|
232
|
+
expect(c.message).toContain('Skipped');
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
it('reports none when nothing is installed', () => {
|
|
236
|
+
const c = checkImplicitIntegrations({integrations: []});
|
|
237
|
+
expect(c.status).toBe('info');
|
|
238
|
+
expect(c.message).toContain('no installed dependency');
|
|
239
|
+
expect(c.fix).toBeUndefined();
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
it('reports none when every loaded integration is configured', () => {
|
|
243
|
+
const c = checkImplicitIntegrations({
|
|
244
|
+
integrations: [autolinked({__autolinked: false})],
|
|
245
|
+
});
|
|
246
|
+
expect(c.status).toBe('info');
|
|
247
|
+
expect(c.message).toContain('named in astryx.config');
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it('names the package, the field, and what it contributes', () => {
|
|
251
|
+
const c = checkImplicitIntegrations({
|
|
252
|
+
integrations: [
|
|
253
|
+
autolinked({templates: '/abs/templates', themes: '/abs/themes'}),
|
|
254
|
+
],
|
|
255
|
+
});
|
|
256
|
+
expect(c.message).toContain('@acme/widgets@1.0.0');
|
|
257
|
+
expect(c.message).toContain('from dependencies');
|
|
258
|
+
expect(c.message).toContain(
|
|
259
|
+
'contributing components, templates, themes',
|
|
260
|
+
);
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
it('names the declared key too when an npm alias makes them differ', () => {
|
|
264
|
+
const c = checkImplicitIntegrations({
|
|
265
|
+
integrations: [
|
|
266
|
+
autolinked({
|
|
267
|
+
name: '@acme/ui',
|
|
268
|
+
version: '0.1.22',
|
|
269
|
+
__spec: '@acme/legacy-ui',
|
|
270
|
+
}),
|
|
271
|
+
],
|
|
272
|
+
});
|
|
273
|
+
expect(c.message).toContain('@acme/ui@0.1.22');
|
|
274
|
+
expect(c.message).toContain('declared as "@acme/legacy-ui"');
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
it('marks the dependency load-bearing for an unused-dependency check', () => {
|
|
278
|
+
const c = checkImplicitIntegrations({integrations: [autolinked()]});
|
|
279
|
+
expect(c.fix).toContain('unused-dependency check');
|
|
280
|
+
expect(c.fix).toContain('astryx.config');
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
it('is always informational, so the CI gate stays green', () => {
|
|
284
|
+
for (const integrations of [
|
|
285
|
+
null,
|
|
286
|
+
[],
|
|
287
|
+
[autolinked()],
|
|
288
|
+
[autolinked({components: undefined})],
|
|
289
|
+
[autolinked({__autolinked: false})],
|
|
290
|
+
]) {
|
|
291
|
+
expect(checkImplicitIntegrations({integrations}).status).toBe('info');
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
it('is part of the report doctor returns', async () => {
|
|
296
|
+
const r = await doctor({cwd});
|
|
297
|
+
expect(r.data.checks.map(c => c.id)).toContain('implicit-integrations');
|
|
298
|
+
}, SLOW);
|
|
299
|
+
});
|