@astryxdesign/cli 0.6.7-canary.83c521e → 0.6.7-canary.aa286c8
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/api/integration/pack-check.mjs +2 -2
- package/api/integration/pack-check.test.mjs +2 -10
- package/assets/docs/tree/checks.doc.mjs +1 -1
- package/assets/docs/tree/replace-a-core-template.doc.mjs +1 -1
- package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
- package/assets/docs/tree/troubleshooting.doc.mjs +3 -3
- package/assets/docs/tree/versioning.doc.mjs +2 -2
- package/authoring/doctypes/template/template.doc.mjs +2 -2
- package/authoring/doctypes/template/type.ts +3 -4
- package/foundation/integrations/cli-requirement.d.mts +10 -21
- package/foundation/integrations/cli-requirement.mjs +13 -25
- package/foundation/integrations/cli-requirement.test.mjs +23 -90
- package/package.json +9 -9
|
@@ -1131,8 +1131,8 @@ export async function integrationPackCheck(options = {}) {
|
|
|
1131
1131
|
}
|
|
1132
1132
|
}
|
|
1133
1133
|
// A template that sets `replaces` (spec:AST-035) or `keywords` needs a CLI
|
|
1134
|
-
// that reads the field: an older CLI drops that template and
|
|
1135
|
-
// package's docs.
|
|
1134
|
+
// that reads the field: an older CLI drops that template and hides the
|
|
1135
|
+
// package's docs.
|
|
1136
1136
|
if (loaded.templates) {
|
|
1137
1137
|
const found = await discoverIntegrationTemplatesForOne(loaded).catch(
|
|
1138
1138
|
() => ({templates: [], errors: []}),
|
|
@@ -1025,11 +1025,9 @@ describe('integrationPackCheck', () => {
|
|
|
1025
1025
|
expect(await codes()).toContain('replaces_needs_cli');
|
|
1026
1026
|
peer('^0.6.0');
|
|
1027
1027
|
expect(await codes()).toContain('replaces_needs_cli');
|
|
1028
|
-
//
|
|
1029
|
-
peer('>=0.6.3');
|
|
1030
|
-
expect(await codes()).toContain('replaces_needs_cli');
|
|
1028
|
+
// `replaces` still needs 0.7.0.
|
|
1031
1029
|
peer('>=0.6.4');
|
|
1032
|
-
expect(await codes()).
|
|
1030
|
+
expect(await codes()).toContain('replaces_needs_cli');
|
|
1033
1031
|
peer('>=0.7.0');
|
|
1034
1032
|
expect(await codes()).not.toContain('replaces_needs_cli');
|
|
1035
1033
|
}, 120_000);
|
|
@@ -1064,12 +1062,6 @@ describe('integrationPackCheck', () => {
|
|
|
1064
1062
|
expect(await codes()).toContain('keywords_needs_cli');
|
|
1065
1063
|
peer('^0.6.0');
|
|
1066
1064
|
expect(await codes()).toContain('keywords_needs_cli');
|
|
1067
|
-
// Published 0.6.4 and 0.6.5 drop a template that sets `keywords`;
|
|
1068
|
-
// published 0.6.6 reads it.
|
|
1069
|
-
peer('>=0.6.5');
|
|
1070
|
-
expect(await codes()).toContain('keywords_needs_cli');
|
|
1071
|
-
peer('>=0.6.6');
|
|
1072
|
-
expect(await codes()).not.toContain('keywords_needs_cli');
|
|
1073
1065
|
peer('>=0.7.0');
|
|
1074
1066
|
expect(await codes()).not.toContain('keywords_needs_cli');
|
|
1075
1067
|
}, 120_000);
|
|
@@ -107,7 +107,7 @@ export const docs = {
|
|
|
107
107
|
'It lists the components, templates, themes, docs, and codemods the temporary app sees, and compares them with your source.',
|
|
108
108
|
"It resolves each component's `import`, and each template's public import, the way Node does, and checks that the module exports the component, or a default export for a template.",
|
|
109
109
|
'For each theme, it rebuilds the source, compares the built module and production CSS with the authored outputs, and proves the module, CSS, and optional font CSS exports resolve from the packed package.',
|
|
110
|
-
'It fails a package that needs an `@astryxdesign/cli` peer and lacks it: `>=0.
|
|
110
|
+
'It fails a package that needs an `@astryxdesign/cli` peer and lacks it: `>=0.7.0` for a template that sets `replaces` or `keywords`, and `>=0.6.4` for a docs section, a placed guide, a doc section with an `id`, or a theme.',
|
|
111
111
|
],
|
|
112
112
|
},
|
|
113
113
|
{
|
|
@@ -84,7 +84,7 @@ export const docs = {
|
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
type: 'prose',
|
|
87
|
-
text: 'Note: `keywords` needs `@astryxdesign/cli` 0.
|
|
87
|
+
text: 'Note: `keywords` needs `@astryxdesign/cli` 0.7.0 or later. A stable CLI before 0.7.0 rejects the field, drops that template, and hides your doc topics: `template --list` and `search` print one warning, and `docs` and `build` say nothing. Declare the CLI floor as an optional peer ({@link generic:versioning}); `integration verify` fails until you do.',
|
|
88
88
|
},
|
|
89
89
|
],
|
|
90
90
|
},
|
|
@@ -91,7 +91,7 @@ export const docs = {
|
|
|
91
91
|
],
|
|
92
92
|
[
|
|
93
93
|
'`replaces_needs_cli`: The package has a template that sets `replaces` but declares no @astryxdesign/cli peer.',
|
|
94
|
-
"Run `npm pkg set 'peerDependencies.@astryxdesign/cli=>=0.
|
|
94
|
+
"Run `npm pkg set 'peerDependencies.@astryxdesign/cli=>=0.7.0'` and `npm pkg set 'peerDependenciesMeta.@astryxdesign/cli.optional=true' --json`. A stable CLI before 0.7.0 rejects `replaces`, drops that template, and hides your doc topics.",
|
|
95
95
|
],
|
|
96
96
|
[
|
|
97
97
|
'`component_replaces_needs_cli` (a warning): The package has a component that sets `replaces` but declares no @astryxdesign/cli peer, or a peer range that admits an earlier CLI.',
|
|
@@ -99,7 +99,7 @@ export const docs = {
|
|
|
99
99
|
],
|
|
100
100
|
[
|
|
101
101
|
'`keywords_needs_cli`: The package has a template that sets `keywords` but declares no @astryxdesign/cli peer.',
|
|
102
|
-
|
|
102
|
+
'The same fix as `replaces_needs_cli`: a stable CLI before 0.7.0 rejects `keywords`, drops that template, and hides your doc topics.',
|
|
103
103
|
],
|
|
104
104
|
[
|
|
105
105
|
'`themes_need_cli`: The package ships a theme but declares no @astryxdesign/cli peer.',
|
|
@@ -143,7 +143,7 @@ export const docs = {
|
|
|
143
143
|
],
|
|
144
144
|
[
|
|
145
145
|
'Your docs section, templates, or themes are missing only in some apps',
|
|
146
|
-
'Those apps run a CLI too old to read them: a stable CLI before 0.
|
|
146
|
+
'Those apps run a CLI too old to read them: a stable CLI before 0.7.0 for a template that sets `replaces` or `keywords`, or before 0.6.4 for a docs section or a theme. Update `@astryxdesign/cli` there, and keep your optional `@astryxdesign/cli` peer so npm warns about an old CLI.',
|
|
147
147
|
],
|
|
148
148
|
],
|
|
149
149
|
},
|
|
@@ -110,7 +110,7 @@ export const docs = {
|
|
|
110
110
|
[
|
|
111
111
|
'`@astryxdesign/cli`',
|
|
112
112
|
'You ship a docs section, a placed guide, a template that sets `replaces` or `keywords`, a doc section with an `id`, or a theme',
|
|
113
|
-
'`>=0.
|
|
113
|
+
'`>=0.7.0` when you ship a template that sets `replaces` or `keywords`, otherwise `>=0.6.4`. Optional in `peerDependenciesMeta`',
|
|
114
114
|
],
|
|
115
115
|
],
|
|
116
116
|
},
|
|
@@ -140,7 +140,7 @@ export const docs = {
|
|
|
140
140
|
'An unknown field in `astryx.integration.mjs` is ignored with an `unknown_manifest_key` warning, and the rest of the manifest still loads.',
|
|
141
141
|
'A named export that the CLI does not know is ignored with no warning, so `debug` and `gapReport` are safe to add.',
|
|
142
142
|
'A stable CLI before 0.7.0 prints each `{@link ...}` as written.',
|
|
143
|
-
'
|
|
143
|
+
'A stable CLI before 0.7.0 rejects a template that sets `replaces` or `keywords`, drops that template, and can hide every doc topic your package ships.',
|
|
144
144
|
'A stable CLI before 0.6.4 cannot read a docs section, a section `id`, or a theme folder that `integration add theme` writes. It can then hide every doc topic your package ships.',
|
|
145
145
|
'Stable 0.6.3 still loads your components, but 0.6.0 cannot read the component docs that `integration add component` writes: `component AcmeCarousel` fails there.',
|
|
146
146
|
],
|
|
@@ -56,13 +56,13 @@ export const doc = {
|
|
|
56
56
|
name: 'keywords',
|
|
57
57
|
type: 'string[]',
|
|
58
58
|
description:
|
|
59
|
-
"Search keywords for CLI discovery: the ideas, domains, and other names a builder might use for what the template serves (e.g. ['monitoring', 'uptime', 'on-call'] for a service-health dashboard). Lowercase. `astryx search` matches them as it matches the description and `astryx build` ranks page templates on them, so keep them out of `description`. Integration templates need @astryxdesign/cli 0.
|
|
59
|
+
"Search keywords for CLI discovery: the ideas, domains, and other names a builder might use for what the template serves (e.g. ['monitoring', 'uptime', 'on-call'] for a service-health dashboard). Lowercase. `astryx search` matches them as it matches the description and `astryx build` ranks page templates on them, so keep them out of `description`. Integration templates need @astryxdesign/cli 0.7.0 or later: earlier CLIs reject the field, drop that template, and hide the package's doc topics.",
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
name: 'replaces',
|
|
63
63
|
type: 'string',
|
|
64
64
|
description:
|
|
65
|
-
"Integration templates only: the exact id of the Core template this one replaces for unqualified lookup. Find it with `astryx --json template --list --package @astryxdesign/core`; the Core original stays selectable with `--package @astryxdesign/core`. A page replaces only a Core page and a block only a Core block. Needs @astryxdesign/cli 0.
|
|
65
|
+
"Integration templates only: the exact id of the Core template this one replaces for unqualified lookup. Find it with `astryx --json template --list --package @astryxdesign/core`; the Core original stays selectable with `--package @astryxdesign/core`. A page replaces only a Core page and a block only a Core block. Needs @astryxdesign/cli 0.7.0 or later: earlier CLIs reject the field, drop that template, and hide the package's doc topics.",
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
name: 'isReady',
|
|
@@ -32,9 +32,8 @@ export interface BaseTemplateDoc extends AuthoredDocGraphFields {
|
|
|
32
32
|
* `astryx search` matches them as it matches the description, and
|
|
33
33
|
* `astryx build` ranks page templates on them, so the `description` can
|
|
34
34
|
* stay a description of the layout. Integration templates need
|
|
35
|
-
* `@astryxdesign/cli` 0.
|
|
36
|
-
*
|
|
37
|
-
* topics. */
|
|
35
|
+
* `@astryxdesign/cli` 0.7.0 or later: earlier CLIs reject the field, drop
|
|
36
|
+
* that template, and hide the package's doc topics. */
|
|
38
37
|
keywords?: string[];
|
|
39
38
|
|
|
40
39
|
/** Optional stable slug override and prior aliases for registry output. */
|
|
@@ -44,7 +43,7 @@ export interface BaseTemplateDoc extends AuthoredDocGraphFields {
|
|
|
44
43
|
* replaces for unqualified lookup (find it with
|
|
45
44
|
* `astryx --json template --list --package @astryxdesign/core`). The Core
|
|
46
45
|
* original stays selectable with `--package @astryxdesign/core`. Needs
|
|
47
|
-
* `@astryxdesign/cli` 0.
|
|
46
|
+
* `@astryxdesign/cli` 0.7.0 or later: earlier CLIs reject the field,
|
|
48
47
|
* drop that template, and hide the package's doc topics. */
|
|
49
48
|
replaces?: string;
|
|
50
49
|
/** Whether this template is ready for use. Templates with
|
|
@@ -30,10 +30,9 @@ export function cliRangeProblem(pkg: any, feature: string, loss: string, floor:
|
|
|
30
30
|
*/
|
|
31
31
|
export function docsTreeCliProblem(pkg: any): string | null;
|
|
32
32
|
/**
|
|
33
|
-
* Why a package with a template that sets `replaces` would lose
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* rejects the field; published 0.6.4 applies it.
|
|
33
|
+
* Why a package with a template that sets `replaces` would lose templates and
|
|
34
|
+
* doc topics on an older CLI (spec:AST-035), or null when its declared CLI
|
|
35
|
+
* range admits only CLIs that read the field.
|
|
37
36
|
* @param {any} pkg package.json
|
|
38
37
|
* @returns {string | null}
|
|
39
38
|
*/
|
|
@@ -68,10 +67,9 @@ export function sectionIdsCliProblem(pkg: any): string | null;
|
|
|
68
67
|
export function themesCliProblem(pkg: any): string | null;
|
|
69
68
|
/**
|
|
70
69
|
* Why a package with a template that sets `keywords` would lose that template
|
|
71
|
-
* on an older CLI, or null when its declared CLI range
|
|
72
|
-
* read the field. Published 0.6.
|
|
73
|
-
* template
|
|
74
|
-
* 0.6.6 reads it.
|
|
70
|
+
* and its doc topics on an older CLI, or null when its declared CLI range
|
|
71
|
+
* admits only CLIs that read the field. Published 0.6.3 rejects the field,
|
|
72
|
+
* drops that template, and hides the package's doc topics.
|
|
75
73
|
* @param {any} pkg package.json
|
|
76
74
|
* @returns {string | null}
|
|
77
75
|
*/
|
|
@@ -100,20 +98,11 @@ export const CLI_PACKAGE: "@astryxdesign/cli";
|
|
|
100
98
|
*/
|
|
101
99
|
export const NAMESPACE_DOCS_CLI: "0.6.4";
|
|
102
100
|
/**
|
|
103
|
-
* The first
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* the template, keeps the topics, answers the Core id with the replacement,
|
|
107
|
-
* and still selects the Core original with `--package @astryxdesign/core`.
|
|
101
|
+
* The first CLI release that reads a template's `replaces` and `keywords`. A
|
|
102
|
+
* release before it rejects either field, drops that template, and hides the
|
|
103
|
+
* package's doc topics.
|
|
108
104
|
*/
|
|
109
|
-
export const
|
|
110
|
-
/**
|
|
111
|
-
* The first stable CLI release that reads a template's `keywords`. Published
|
|
112
|
-
* 0.6.4 and 0.6.5 reject the field and drop that template but keep the
|
|
113
|
-
* package's doc topics; 0.6.3 and earlier also hide them. Published 0.6.6
|
|
114
|
-
* lists the template, and search matches its keywords.
|
|
115
|
-
*/
|
|
116
|
-
export const KEYWORDS_CLI: "0.6.6";
|
|
105
|
+
export const REPLACES_CLI: "0.7.0";
|
|
117
106
|
/**
|
|
118
107
|
* The first stable CLI release that applies a component's `replaces`
|
|
119
108
|
* (spec:AST-035 FR10). It is also the opt-in: a CLI applies a package's
|
|
@@ -26,21 +26,11 @@ export const CLI_PACKAGE = '@astryxdesign/cli';
|
|
|
26
26
|
export const NAMESPACE_DOCS_CLI = '0.6.4';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* The first
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* the template, keeps the topics, answers the Core id with the replacement,
|
|
33
|
-
* and still selects the Core original with `--package @astryxdesign/core`.
|
|
29
|
+
* The first CLI release that reads a template's `replaces` and `keywords`. A
|
|
30
|
+
* release before it rejects either field, drops that template, and hides the
|
|
31
|
+
* package's doc topics.
|
|
34
32
|
*/
|
|
35
|
-
export const
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* The first stable CLI release that reads a template's `keywords`. Published
|
|
39
|
-
* 0.6.4 and 0.6.5 reject the field and drop that template but keep the
|
|
40
|
-
* package's doc topics; 0.6.3 and earlier also hide them. Published 0.6.6
|
|
41
|
-
* lists the template, and search matches its keywords.
|
|
42
|
-
*/
|
|
43
|
-
export const KEYWORDS_CLI = '0.6.6';
|
|
33
|
+
export const REPLACES_CLI = '0.7.0';
|
|
44
34
|
|
|
45
35
|
/**
|
|
46
36
|
* The first stable CLI release that applies a component's `replaces`
|
|
@@ -176,10 +166,9 @@ export function docsTreeCliProblem(pkg) {
|
|
|
176
166
|
}
|
|
177
167
|
|
|
178
168
|
/**
|
|
179
|
-
* Why a package with a template that sets `replaces` would lose
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
* rejects the field; published 0.6.4 applies it.
|
|
169
|
+
* Why a package with a template that sets `replaces` would lose templates and
|
|
170
|
+
* doc topics on an older CLI (spec:AST-035), or null when its declared CLI
|
|
171
|
+
* range admits only CLIs that read the field.
|
|
183
172
|
* @param {any} pkg package.json
|
|
184
173
|
* @returns {string | null}
|
|
185
174
|
*/
|
|
@@ -188,7 +177,7 @@ export function replacesCliProblem(pkg) {
|
|
|
188
177
|
pkg,
|
|
189
178
|
'has a template that sets `replaces`',
|
|
190
179
|
"rejects the field, drops that template, and hides the package's doc topics",
|
|
191
|
-
|
|
180
|
+
REPLACES_CLI,
|
|
192
181
|
);
|
|
193
182
|
}
|
|
194
183
|
|
|
@@ -246,10 +235,9 @@ export function themesCliProblem(pkg) {
|
|
|
246
235
|
|
|
247
236
|
/**
|
|
248
237
|
* Why a package with a template that sets `keywords` would lose that template
|
|
249
|
-
* on an older CLI, or null when its declared CLI range
|
|
250
|
-
* read the field. Published 0.6.
|
|
251
|
-
* template
|
|
252
|
-
* 0.6.6 reads it.
|
|
238
|
+
* and its doc topics on an older CLI, or null when its declared CLI range
|
|
239
|
+
* admits only CLIs that read the field. Published 0.6.3 rejects the field,
|
|
240
|
+
* drops that template, and hides the package's doc topics.
|
|
253
241
|
* @param {any} pkg package.json
|
|
254
242
|
* @returns {string | null}
|
|
255
243
|
*/
|
|
@@ -257,8 +245,8 @@ export function keywordsCliProblem(pkg) {
|
|
|
257
245
|
return cliRangeProblem(
|
|
258
246
|
pkg,
|
|
259
247
|
'has a template that sets `keywords`',
|
|
260
|
-
"rejects the field
|
|
261
|
-
|
|
248
|
+
"rejects the field, drops that template, and hides the package's doc topics",
|
|
249
|
+
REPLACES_CLI,
|
|
262
250
|
);
|
|
263
251
|
}
|
|
264
252
|
|
|
@@ -6,10 +6,9 @@ import {semverCompare} from '../env/semver.mjs';
|
|
|
6
6
|
import * as requirement from './cli-requirement.mjs';
|
|
7
7
|
import {
|
|
8
8
|
COMPONENT_REPLACES_CLI,
|
|
9
|
-
KEYWORDS_CLI,
|
|
10
9
|
NAMESPACE_DOCS_CLI,
|
|
10
|
+
REPLACES_CLI,
|
|
11
11
|
SECTION_IDS_CLI,
|
|
12
|
-
TEMPLATE_REPLACES_CLI,
|
|
13
12
|
cliRangeProblem,
|
|
14
13
|
componentReplacesCliProblem,
|
|
15
14
|
THEMES_CLI,
|
|
@@ -92,78 +91,20 @@ describe('docsTreeCliProblem', () => {
|
|
|
92
91
|
});
|
|
93
92
|
|
|
94
93
|
describe('replacesCliProblem', () => {
|
|
95
|
-
|
|
96
|
-
// earlier reject the field, drop the template, and hide the package's doc
|
|
97
|
-
// topics.
|
|
98
|
-
it('asks a package that sets replaces for a CLI from 0.6.4', () => {
|
|
94
|
+
it('asks a package that sets replaces for a CLI that reads the field', () => {
|
|
99
95
|
expect(replacesCliProblem({name: '@acme/kit'})).toContain(
|
|
100
96
|
'sets `replaces`',
|
|
101
97
|
);
|
|
102
|
-
expect(
|
|
103
|
-
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
replacesCliProblem({peerDependencies: {'@astryxdesign/cli': range}}),
|
|
113
|
-
).toContain('admits a stable CLI before 0.6.4');
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
describe('keywordsCliProblem', () => {
|
|
119
|
-
// Published 0.6.6 reads a template's `keywords`. Published 0.6.4 and 0.6.5
|
|
120
|
-
// reject the field and drop the template; 0.6.3 and earlier also hide the
|
|
121
|
-
// package's doc topics.
|
|
122
|
-
it('asks a package that sets keywords for a CLI from 0.6.6', () => {
|
|
123
|
-
expect(keywordsCliProblem({name: '@acme/kit'})).toContain(
|
|
124
|
-
'sets `keywords`',
|
|
125
|
-
);
|
|
126
|
-
expect(keywordsCliProblem({name: '@acme/kit'})).toContain(
|
|
127
|
-
"A stable CLI before 0.6.6 rejects the field and drops that template, and one before 0.6.4 also hides the package's doc topics.",
|
|
128
|
-
);
|
|
129
|
-
for (const range of ['>=0.6.6', '^0.6.6', '>=0.6.7', '>=0.7.0']) {
|
|
130
|
-
expect(
|
|
131
|
-
keywordsCliProblem({peerDependencies: {'@astryxdesign/cli': range}}),
|
|
132
|
-
).toBeNull();
|
|
133
|
-
}
|
|
134
|
-
for (const range of ['>=0.6.5', '>=0.6.4', '^0.6.4', '^0.6.0']) {
|
|
135
|
-
expect(
|
|
136
|
-
keywordsCliProblem({peerDependencies: {'@astryxdesign/cli': range}}),
|
|
137
|
-
).toContain('admits a stable CLI before 0.6.6');
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
describe('template replaces and keywords floors in the shipped docs', () => {
|
|
143
|
-
// The range an author is told to declare is the range `integration verify`
|
|
144
|
-
// accepts, so following the docs never fails the check or asks for a CLI
|
|
145
|
-
// no release satisfies.
|
|
146
|
-
const read = (/** @type {string} */ file) =>
|
|
147
|
-
fs.readFileSync(new URL(file, import.meta.url), 'utf-8');
|
|
148
|
-
|
|
149
|
-
it('shows the replaces floor in the replace-a-core-template guide', () => {
|
|
150
|
-
const named = [
|
|
151
|
-
...read(
|
|
152
|
-
'../../assets/docs/tree/replace-a-core-template.doc.mjs',
|
|
153
|
-
).matchAll(/"@astryxdesign\/cli":\s*">=(\d+\.\d+\.\d+)"/g),
|
|
154
|
-
].map(match => match[1]);
|
|
155
|
-
expect(named.length).toBeGreaterThan(0);
|
|
156
|
-
expect(new Set(named)).toEqual(new Set([TEMPLATE_REPLACES_CLI]));
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
it.each([
|
|
160
|
-
['`replaces_needs_cli`', TEMPLATE_REPLACES_CLI],
|
|
161
|
-
['`keywords_needs_cli`', KEYWORDS_CLI],
|
|
162
|
-
])('gives the %s fix the floor the check asks for', (code, floor) => {
|
|
163
|
-
const row = read('../../assets/docs/tree/troubleshooting.doc.mjs')
|
|
164
|
-
.split('],')
|
|
165
|
-
.find(part => part.includes(`${code}:`));
|
|
166
|
-
expect(row).toContain(`@astryxdesign/cli=>=${floor}'`);
|
|
98
|
+
expect(
|
|
99
|
+
replacesCliProblem({peerDependencies: {'@astryxdesign/cli': '^0.6.0'}}),
|
|
100
|
+
).toContain('admits a stable CLI before');
|
|
101
|
+
expect(
|
|
102
|
+
replacesCliProblem({peerDependencies: {'@astryxdesign/cli': '>=0.7.0'}}),
|
|
103
|
+
).toBeNull();
|
|
104
|
+
// Unlike the docs tree, `replaces` still needs 0.7.0.
|
|
105
|
+
expect(
|
|
106
|
+
replacesCliProblem({peerDependencies: {'@astryxdesign/cli': '>=0.6.4'}}),
|
|
107
|
+
).toContain('admits a stable CLI before 0.7.0');
|
|
167
108
|
});
|
|
168
109
|
});
|
|
169
110
|
|
|
@@ -252,17 +193,17 @@ describe('themesCliProblem and sectionIdsCliProblem', () => {
|
|
|
252
193
|
}
|
|
253
194
|
});
|
|
254
195
|
|
|
255
|
-
it('
|
|
256
|
-
// `>=0.6.4` admits published 0.6.4 and 0.6.5, which drop a template that
|
|
257
|
-
// sets `keywords` but apply one that sets `replaces`.
|
|
196
|
+
it('keeps 0.7.0 for replaces and keywords', () => {
|
|
258
197
|
const pkg = {peerDependencies: {'@astryxdesign/cli': '>=0.6.4'}};
|
|
259
198
|
expect(docsTreeCliProblem(pkg)).toBeNull();
|
|
260
|
-
expect(replacesCliProblem(pkg)).
|
|
199
|
+
expect(replacesCliProblem(pkg)).toContain(
|
|
200
|
+
'admits a stable CLI before 0.7.0',
|
|
201
|
+
);
|
|
261
202
|
expect(keywordsCliProblem(pkg)).toContain(
|
|
262
|
-
'admits a stable CLI before 0.
|
|
203
|
+
'admits a stable CLI before 0.7.0',
|
|
263
204
|
);
|
|
264
205
|
expect(
|
|
265
|
-
keywordsCliProblem({peerDependencies: {'@astryxdesign/cli': '>=0.
|
|
206
|
+
keywordsCliProblem({peerDependencies: {'@astryxdesign/cli': '>=0.7.0'}}),
|
|
266
207
|
).toBeNull();
|
|
267
208
|
});
|
|
268
209
|
|
|
@@ -270,13 +211,7 @@ describe('themesCliProblem and sectionIdsCliProblem', () => {
|
|
|
270
211
|
const {version} = JSON.parse(
|
|
271
212
|
fs.readFileSync(new URL('../../package.json', import.meta.url), 'utf-8'),
|
|
272
213
|
);
|
|
273
|
-
for (const floor of [
|
|
274
|
-
NAMESPACE_DOCS_CLI,
|
|
275
|
-
THEMES_CLI,
|
|
276
|
-
SECTION_IDS_CLI,
|
|
277
|
-
TEMPLATE_REPLACES_CLI,
|
|
278
|
-
KEYWORDS_CLI,
|
|
279
|
-
]) {
|
|
214
|
+
for (const floor of [NAMESPACE_DOCS_CLI, THEMES_CLI, SECTION_IDS_CLI]) {
|
|
280
215
|
expect(semverCompare(floor, version.split('-')[0])).toBeLessThanOrEqual(
|
|
281
216
|
0,
|
|
282
217
|
);
|
|
@@ -317,8 +252,8 @@ describe('every feature check names its CLI floor', () => {
|
|
|
317
252
|
const FLOORS = {
|
|
318
253
|
componentReplacesCliProblem: COMPONENT_REPLACES_CLI,
|
|
319
254
|
docsTreeCliProblem: '0.6.4',
|
|
320
|
-
replacesCliProblem:
|
|
321
|
-
keywordsCliProblem:
|
|
255
|
+
replacesCliProblem: REPLACES_CLI,
|
|
256
|
+
keywordsCliProblem: REPLACES_CLI,
|
|
322
257
|
sectionIdsCliProblem: '0.6.4',
|
|
323
258
|
themesCliProblem: '0.6.4',
|
|
324
259
|
};
|
|
@@ -344,10 +279,8 @@ describe('every feature check names its CLI floor', () => {
|
|
|
344
279
|
// Tied to the next patch slot: the first stable release that ships
|
|
345
280
|
// component replacement.
|
|
346
281
|
componentReplacesCliProblem: '0.6.7',
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
replacesCliProblem: '0.6.4',
|
|
350
|
-
keywordsCliProblem: '0.6.6',
|
|
282
|
+
replacesCliProblem: '0.7.0',
|
|
283
|
+
keywordsCliProblem: '0.7.0',
|
|
351
284
|
});
|
|
352
285
|
});
|
|
353
286
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.6.7-canary.
|
|
3
|
+
"version": "0.6.7-canary.aa286c8",
|
|
4
4
|
"displayName": "CLI",
|
|
5
5
|
"description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -101,10 +101,10 @@
|
|
|
101
101
|
"zod": "^4.4.3"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
|
-
"@astryxdesign/charts": "0.6.7-canary.
|
|
105
|
-
"@astryxdesign/core": "0.6.7-canary.
|
|
106
|
-
"@astryxdesign/lab": "0.6.7-canary.
|
|
107
|
-
"@astryxdesign/theme-neutral": "0.6.7-canary.
|
|
104
|
+
"@astryxdesign/charts": "0.6.7-canary.aa286c8",
|
|
105
|
+
"@astryxdesign/core": "0.6.7-canary.aa286c8",
|
|
106
|
+
"@astryxdesign/lab": "0.6.7-canary.aa286c8",
|
|
107
|
+
"@astryxdesign/theme-neutral": "0.6.7-canary.aa286c8"
|
|
108
108
|
},
|
|
109
109
|
"peerDependenciesMeta": {
|
|
110
110
|
"@astryxdesign/charts": {
|
|
@@ -121,10 +121,10 @@
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
|
-
"@astryxdesign/charts": "0.6.7-canary.
|
|
125
|
-
"@astryxdesign/core": "0.6.7-canary.
|
|
126
|
-
"@astryxdesign/lab": "0.6.7-canary.
|
|
127
|
-
"@astryxdesign/theme-neutral": "0.6.7-canary.
|
|
124
|
+
"@astryxdesign/charts": "0.6.7-canary.aa286c8",
|
|
125
|
+
"@astryxdesign/core": "0.6.7-canary.aa286c8",
|
|
126
|
+
"@astryxdesign/lab": "0.6.7-canary.aa286c8",
|
|
127
|
+
"@astryxdesign/theme-neutral": "0.6.7-canary.aa286c8",
|
|
128
128
|
"@heroicons/react": "^2.2.0",
|
|
129
129
|
"@stylexjs/stylex": "^0.19.0",
|
|
130
130
|
"@types/babel__core": "^7.20.5",
|