@astryxdesign/cli 0.6.3-canary.f22695a → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/api/build/build.type.d.mts +2 -2
- package/api/build/build.type.mjs +2 -2
- package/api/component/component.type.d.mts +6 -6
- package/api/component/component.type.mjs +19 -19
- package/api/discover/discover.type.d.mts +4 -4
- package/api/discover/discover.type.mjs +10 -10
- package/api/docs/_adapter.d.mts +24 -37
- package/api/docs/_adapter.mjs +83 -169
- package/api/docs/detail/detail.mjs +63 -14
- package/api/docs/detail/section/section.d.mts +1 -1
- package/api/docs/detail/section/section.mjs +20 -44
- package/api/docs/detail/section/section.test.mjs +0 -41
- package/api/docs/docs.d.mts +2 -7
- package/api/docs/docs.doc.mjs +10 -27
- package/api/docs/docs.mjs +9 -16
- package/api/docs/docs.test.mjs +0 -6
- package/api/docs/docs.type.d.mts +3 -40
- package/api/docs/docs.type.mjs +8 -36
- package/api/docs/integrationDocs.test.mjs +0 -106
- package/api/doctor/doctor.d.mts +0 -48
- package/api/doctor/doctor.mjs +0 -232
- package/api/doctor/doctor.test.mjs +0 -196
- package/api/hook/hook.type.d.mts +3 -3
- package/api/hook/hook.type.mjs +11 -11
- package/api/hook/list/list.d.mts +1 -1
- package/api/integration/add-contribution.mjs +3 -5
- package/api/integration/add-contribution.test.mjs +4 -4
- package/api/integration/integration-authoring.type.d.mts +1 -1
- package/api/integration/pack-check.mjs +7 -49
- package/api/integration/pack-check.test.mjs +0 -249
- package/api/search/search.d.mts +1 -1
- package/api/search/search.mjs +5 -5
- package/api/search/search.type.d.mts +2 -2
- package/api/search/search.type.mjs +1 -1
- package/api/swizzle/swizzle.type.d.mts +2 -2
- package/api/swizzle/swizzle.type.mjs +2 -2
- package/api/template/template.d.mts +1 -1
- package/api/template/template.type.d.mts +6 -6
- package/api/template/template.type.mjs +12 -12
- package/api/theme/build/build.mjs +6 -20
- package/api/theme/build/build.test.mjs +0 -127
- package/api/theme/palette/generate/generate.mjs +1 -1
- package/api/theme/palette/generate/generator.d.mts +13 -10
- package/api/theme/palette/generate/generator.mjs +3 -7
- package/api/theme/theme.type.d.mts +11 -170
- package/api/theme/theme.type.mjs +27 -94
- package/api/upgrade/_adapter.mjs +5 -71
- package/api/upgrade/upgrade.doc.mjs +3 -4
- package/api/upgrade/upgrade.type.d.mts +5 -5
- package/api/upgrade/upgrade.type.mjs +11 -11
- package/assets/codemods/integration-discovery.mjs +2 -40
- package/assets/codemods/integration-discovery.test.mjs +0 -58
- package/assets/codemods/transforms/v0.3.0/__tests__/unwrap-authoring-factories.test.mjs +5 -27
- package/assets/codemods/transforms/v0.3.0/unwrap-authoring-factories.mjs +5 -20
- package/assets/docs/README.md +0 -9
- package/assets/docs/cli-integrations.doc.mjs +15 -86
- package/assets/docs/styling-libraries.doc.mjs +1 -1
- package/assets/docs/working-with-ai.doc.mjs +1 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.doc.mjs +3 -19
- package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +65 -383
- package/authoring/_shared/contract.ts +0 -22
- package/authoring/codemod/codemod.doc.mjs +1 -6
- package/authoring/codemod/parse.d.mts +8 -8
- package/authoring/codemod/parse.mjs +6 -8
- package/authoring/config/parse.d.mts +13 -13
- package/authoring/config/parse.mjs +8 -8
- package/authoring/config/type.ts +3 -3
- package/authoring/debug/parse.d.mts +5 -5
- package/authoring/debug/parse.mjs +3 -3
- package/authoring/doctypes/_schema.d.mts +23 -788
- package/authoring/doctypes/_schema.mjs +39 -492
- package/authoring/doctypes/base/type.ts +0 -40
- package/authoring/doctypes/command/command.doc.mjs +2 -3
- package/authoring/doctypes/command/parse.d.mts +2 -2
- package/authoring/doctypes/command/parse.mjs +1 -1
- package/authoring/doctypes/command/type.ts +2 -3
- package/authoring/doctypes/component/component.doc.mjs +3 -6
- package/authoring/doctypes/component/parse.d.mts +2 -2
- package/authoring/doctypes/component/parse.mjs +1 -1
- package/authoring/doctypes/component/type.ts +3 -4
- package/authoring/doctypes/enum/parse.d.mts +2 -2
- package/authoring/doctypes/enum/parse.mjs +1 -1
- package/authoring/doctypes/enum/type.ts +1 -3
- package/authoring/doctypes/function/function.doc.mjs +0 -4
- package/authoring/doctypes/function/parse.d.mts +2 -2
- package/authoring/doctypes/function/parse.mjs +1 -1
- package/authoring/doctypes/function/type.ts +2 -6
- package/authoring/doctypes/hook/hook.doc.mjs +0 -4
- package/authoring/doctypes/hook/parse.d.mts +2 -2
- package/authoring/doctypes/hook/parse.mjs +1 -1
- package/authoring/doctypes/hook/type.ts +2 -3
- package/authoring/doctypes/legacy.d.mts +6 -8
- package/authoring/doctypes/legacy.mjs +4 -5
- package/authoring/doctypes/parse.d.mts +18 -20
- package/authoring/doctypes/parse.mjs +10 -16
- package/authoring/doctypes/parse.test.mjs +3 -77
- package/authoring/doctypes/reference/parse.d.mts +2 -2
- package/authoring/doctypes/reference/parse.mjs +5 -8
- package/authoring/doctypes/reference/reference.doc.mjs +4 -17
- package/authoring/doctypes/reference/type.ts +5 -51
- package/authoring/doctypes/schema/parse.d.mts +2 -2
- package/authoring/doctypes/schema/parse.mjs +1 -1
- package/authoring/doctypes/schema/type.ts +2 -3
- package/authoring/doctypes/template/parse.d.mts +1 -92
- package/authoring/doctypes/template/parse.mjs +2 -36
- package/authoring/doctypes/template/parse.test.mjs +2 -8
- package/authoring/doctypes/template/template.doc.mjs +0 -4
- package/authoring/doctypes/template/type.ts +2 -5
- package/authoring/doctypes/types.ts +9 -10
- package/authoring/gap-report/parse.d.mts +10 -10
- package/authoring/gap-report/parse.mjs +6 -6
- package/authoring/gap-report/type.ts +1 -1
- package/authoring/index.d.mts +0 -1
- package/authoring/index.d.ts +17 -49
- package/authoring/index.mjs +0 -1
- package/authoring/integration/integration.doc.mjs +6 -13
- package/authoring/integration/parse.d.mts +2 -2
- package/authoring/integration/parse.mjs +1 -1
- package/authoring/integration/parse.test.mjs +1 -10
- package/authoring/integration/schema.d.mts +4 -6
- package/authoring/integration/schema.mjs +3 -9
- package/authoring/integration/type.ts +6 -23
- package/authoring/shadcn/receipt.d.mts +6 -6
- package/clients/cli/commands/docs.doc.mjs +3 -13
- package/clients/cli/commands/docs.mjs +21 -121
- package/clients/cli/commands/docs.test.mjs +0 -88
- package/clients/cli/commands/integration-authoring.test.mjs +9 -13
- package/clients/cli/commands/theme-palette-generate.doc.mjs +4 -8
- package/clients/cli/commands/upgrade.doc.mjs +2 -2
- package/clients/cli/formatters/index.mjs +1 -162
- package/clients/cli/formatters/index.test.mjs +0 -91
- package/clients/cli/lib/manifest.mjs +2 -7
- package/foundation/config/project.mjs +6 -21
- package/foundation/discovery/component-discovery.d.mts +1 -1
- package/foundation/discovery/component-discovery.mjs +1 -2
- package/foundation/discovery/docs-discovery.d.mts +4 -11
- package/foundation/discovery/docs-discovery.mjs +88 -208
- package/foundation/discovery/docs-discovery.test.mjs +13 -279
- package/foundation/discovery/template-adapter.mjs +1 -2
- package/foundation/integrations/autolink.mjs +5 -12
- package/foundation/integrations/integration-warnings.mjs +0 -6
- package/foundation/integrations/integrations.d.mts +2 -46
- package/foundation/integrations/integrations.mjs +8 -167
- package/foundation/integrations/integrations.test.mjs +1 -384
- package/foundation/integrations/validate-contributions.d.mts +0 -2
- package/foundation/integrations/validate-contributions.mjs +0 -10
- package/foundation/response/json-contract.test.mjs +17 -46
- package/foundation/response/response-types.doc.mjs +1 -6
- package/package.json +11 -9
- package/api/docs/compiled-topics.test.mjs +0 -78
- package/api/docs/index/index.d.mts +0 -18
- package/api/docs/index/index.mjs +0 -32
- package/api/docs/index/index.test.mjs +0 -62
- package/api/upgrade/project-context.test.mjs +0 -272
- package/assets/docs/authoring.doc.mjs +0 -14
- package/assets/templates/blocks/components/Timer/TimerFormats.doc.mjs +0 -14
- package/assets/templates/blocks/components/Timer/TimerFormats.tsx +0 -34
- package/assets/templates/blocks/components/Timer/TimerInline.doc.mjs +0 -14
- package/assets/templates/blocks/components/Timer/TimerInline.tsx +0 -14
- package/assets/templates/blocks/components/Timer/TimerShowcase.doc.mjs +0 -13
- package/assets/templates/blocks/components/Timer/TimerShowcase.tsx +0 -47
- package/assets/templates/blocks/components/Timer/TimerTypography.doc.mjs +0 -14
- package/assets/templates/blocks/components/Timer/TimerTypography.tsx +0 -31
- package/authoring/doctypes/base/graph-fields.doc.d.mts +0 -9
- package/authoring/doctypes/base/graph-fields.doc.mjs +0 -62
- package/authoring/doctypes/load-contract.test.mjs +0 -207
- package/authoring/doctypes/namespace/namespace.doc.d.mts +0 -9
- package/authoring/doctypes/namespace/namespace.doc.mjs +0 -132
- package/authoring/doctypes/namespace/parse.d.mts +0 -12
- package/authoring/doctypes/namespace/parse.mjs +0 -25
- package/authoring/doctypes/namespace/parse.test.mjs +0 -165
- package/authoring/doctypes/namespace/type.ts +0 -71
- package/authoring/identity/identity.doc.d.mts +0 -9
- package/authoring/identity/identity.doc.mjs +0 -61
- package/authoring/identity/type.ts +0 -132
- package/foundation/discovery/authoring-self-docs.d.mts +0 -69
- package/foundation/discovery/authoring-self-docs.mjs +0 -214
- package/foundation/discovery/authoring-self-docs.test.mjs +0 -154
- package/foundation/discovery/docs-output-budget.d.mts +0 -28
- package/foundation/discovery/docs-output-budget.mjs +0 -50
- package/foundation/discovery/docs-section-key.d.mts +0 -98
- package/foundation/discovery/docs-section-key.mjs +0 -221
- package/foundation/discovery/docs-section-key.test.mjs +0 -224
- package/foundation/doc-compiler/compile.d.mts +0 -162
- package/foundation/doc-compiler/compile.mjs +0 -262
- package/foundation/doc-compiler/doc-compiler.test.mjs +0 -687
- package/foundation/doc-compiler/ir.d.mts +0 -9
- package/foundation/doc-compiler/ir.mjs +0 -287
- package/foundation/doc-compiler/lenses.d.mts +0 -33
- package/foundation/doc-compiler/lenses.mjs +0 -127
- package/foundation/identity/provider-identity.d.mts +0 -90
- package/foundation/identity/provider-identity.mjs +0 -320
- package/foundation/identity/provider-identity.test.mjs +0 -254
- package/foundation/identity/providers.d.mts +0 -7
- package/foundation/identity/providers.mjs +0 -16
- package/foundation/integrations/provider-conflicts.test.mjs +0 -125
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @file Provider-identity conflicts proved against the repository's real
|
|
5
|
-
* integration packages instead of hand-written fixtures: the Lab package as it
|
|
6
|
-
* ships, beside a copy of Charts whose manifest also claims Lab's provider ID.
|
|
7
|
-
*
|
|
8
|
-
* Fixtures live under a repo-local temp dir, not /tmp, because Vite refuses to
|
|
9
|
-
* dynamically import a module from outside the project root.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import {afterEach, beforeEach, describe, expect, it} from 'vitest';
|
|
13
|
-
import * as fs from 'node:fs';
|
|
14
|
-
import * as path from 'node:path';
|
|
15
|
-
import {fileURLToPath} from 'node:url';
|
|
16
|
-
import {Project} from '../config/project.mjs';
|
|
17
|
-
import {doctor} from '../../api/doctor/doctor.mjs';
|
|
18
|
-
import {runCli} from '../../test-utils/run-cli.mjs';
|
|
19
|
-
|
|
20
|
-
const REPO = path.resolve(
|
|
21
|
-
path.dirname(fileURLToPath(import.meta.url)),
|
|
22
|
-
'../../../..',
|
|
23
|
-
);
|
|
24
|
-
const CHARTS = path.join(REPO, 'packages', 'charts');
|
|
25
|
-
const SLOW = 60_000;
|
|
26
|
-
|
|
27
|
-
/** Both packages are named; Lab is named as the one used, Charts as set aside. */
|
|
28
|
-
const WINNER_NAMED =
|
|
29
|
-
/@astryxdesign\/charts@\S+ and @astryxdesign\/lab@\S+ both claim provider ID "@astryxdesign\/lab"\. @astryxdesign\/lab@\S+ loads first and is used; @astryxdesign\/charts@\S+ contributes nothing/u;
|
|
30
|
-
|
|
31
|
-
let consumer;
|
|
32
|
-
let chartsManifest;
|
|
33
|
-
|
|
34
|
-
beforeEach(() => {
|
|
35
|
-
consumer = fs.mkdtempSync(
|
|
36
|
-
path.join(process.cwd(), '.astryx-provider-conflict-'),
|
|
37
|
-
);
|
|
38
|
-
const scope = path.join(consumer, 'node_modules', '@astryxdesign');
|
|
39
|
-
fs.mkdirSync(scope, {recursive: true});
|
|
40
|
-
fs.symlinkSync(
|
|
41
|
-
path.join(REPO, 'packages', 'lab'),
|
|
42
|
-
path.join(scope, 'lab'),
|
|
43
|
-
'dir',
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
const charts = path.join(scope, 'charts');
|
|
47
|
-
fs.cpSync(CHARTS, charts, {
|
|
48
|
-
recursive: true,
|
|
49
|
-
filter: source => {
|
|
50
|
-
const [top] = path.relative(CHARTS, source).split(path.sep);
|
|
51
|
-
return top !== 'node_modules' && top !== 'dist';
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
chartsManifest = path.join(charts, 'astryx.integration.mjs');
|
|
55
|
-
const shipped = fs.readFileSync(chartsManifest, 'utf8');
|
|
56
|
-
const claimed = shipped.replace(
|
|
57
|
-
'export default {',
|
|
58
|
-
"export default {\n providerId: '@astryxdesign/lab',",
|
|
59
|
-
);
|
|
60
|
-
expect(claimed).not.toBe(shipped);
|
|
61
|
-
fs.writeFileSync(chartsManifest, claimed);
|
|
62
|
-
|
|
63
|
-
fs.writeFileSync(
|
|
64
|
-
path.join(consumer, 'package.json'),
|
|
65
|
-
JSON.stringify({name: 'consumer', private: true}),
|
|
66
|
-
);
|
|
67
|
-
fs.writeFileSync(
|
|
68
|
-
path.join(consumer, 'astryx.config.mjs'),
|
|
69
|
-
"export default {integrations: ['@astryxdesign/lab', '@astryxdesign/charts']};\n",
|
|
70
|
-
);
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
afterEach(() => {
|
|
74
|
-
fs.rmSync(consumer, {recursive: true, force: true});
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
describe('provider identity conflicts in the real integration packages', () => {
|
|
78
|
-
it('keeps Lab, sets Charts aside, and names both on every surface', async () => {
|
|
79
|
-
const project = await Project.load(consumer, {fresh: true});
|
|
80
|
-
const components = await project.components();
|
|
81
|
-
expect(
|
|
82
|
-
components.filter(component => component.package === '@astryxdesign/lab')
|
|
83
|
-
.length,
|
|
84
|
-
).toBeGreaterThan(0);
|
|
85
|
-
expect(
|
|
86
|
-
components.some(component => component.package === '@astryxdesign/charts'),
|
|
87
|
-
).toBe(false);
|
|
88
|
-
const conflicts = (await project.issues()).filter(
|
|
89
|
-
issue => issue.code === 'duplicate_provider',
|
|
90
|
-
);
|
|
91
|
-
expect(conflicts).toEqual([
|
|
92
|
-
expect.objectContaining({
|
|
93
|
-
package: expect.stringMatching(/^@astryxdesign\/charts@\S+$/u),
|
|
94
|
-
severity: 'warning',
|
|
95
|
-
message: expect.stringMatching(WINNER_NAMED),
|
|
96
|
-
}),
|
|
97
|
-
]);
|
|
98
|
-
|
|
99
|
-
const report = await doctor({cwd: consumer});
|
|
100
|
-
const check = report.data.checks.find(
|
|
101
|
-
candidate => candidate.id === 'provider-identity',
|
|
102
|
-
);
|
|
103
|
-
expect(check?.status).toBe('warn');
|
|
104
|
-
expect(check?.message).toMatch(WINNER_NAMED);
|
|
105
|
-
|
|
106
|
-
const cli = await runCli(['component', '--list'], consumer);
|
|
107
|
-
expect(cli.status).toBe(0);
|
|
108
|
-
expect(cli.stderr).toMatch(WINNER_NAMED);
|
|
109
|
-
}, SLOW);
|
|
110
|
-
|
|
111
|
-
it('loads both real packages without an issue once their IDs differ', async () => {
|
|
112
|
-
fs.copyFileSync(path.join(CHARTS, 'astryx.integration.mjs'), chartsManifest);
|
|
113
|
-
|
|
114
|
-
const project = await Project.load(consumer, {fresh: true});
|
|
115
|
-
const components = await project.components();
|
|
116
|
-
expect(
|
|
117
|
-
components.some(component => component.package === '@astryxdesign/charts'),
|
|
118
|
-
).toBe(true);
|
|
119
|
-
expect(
|
|
120
|
-
(await project.issues()).filter(
|
|
121
|
-
issue => issue.code === 'duplicate_provider',
|
|
122
|
-
),
|
|
123
|
-
).toEqual([]);
|
|
124
|
-
}, SLOW);
|
|
125
|
-
});
|