Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(cli): template replaces needs CLI 0.6.4 and keywords 0.6.6, not 0.7.0 (#7265)

Joey83c521e54696
diff --git a/.changeset/template-replaces-keywords-cli-floor.md b/.changeset/template-replaces-keywords-cli-floor.md
new file mode 100644
index 0000000000..7103a71724
--- /dev/null
+++ b/.changeset/template-replaces-keywords-cli-floor.md
@@ -0,0 +1,9 @@
+---
+'@astryxdesign/cli': patch
+---
+
+[fix] A template that sets `replaces` needs `@astryxdesign/cli` 0.6.4, and one that sets `keywords` needs 0.6.6, not 0.7.0.
+
+Published 0.6.4 applies a template's `replaces`, and published 0.6.6 reads its `keywords`. `integration verify` asked for `">=0.7.0"` for both, a range no released CLI satisfies, and npm leaves the CLI uninstalled in an app that installs a package with that optional peer. `integration verify` now accepts `">=0.6.4"` for `replaces` and `">=0.6.6"` for `keywords`, and still refuses a range that admits an older CLI. Its messages now say what older CLIs do. Before 0.6.6 a template that sets `keywords` is dropped, and before 0.6.4 the package's doc topics are hidden too.
+
+@josephfarina
diff --git a/packages/cli/api/integration/pack-check.mjs b/packages/cli/api/integration/pack-check.mjs
index 861bad7886..98f4b9d23c 100644
--- a/packages/cli/api/integration/pack-check.mjs
+++ b/packages/cli/api/integration/pack-check.mjs
@@ -1131,8 +1131,8 @@ export async function integrationPackCheck(options = {}) {
}
}
// A template that sets `replaces` (spec:AST-035) or `keywords` needs a CLI
- // that reads the field: an older CLI drops that template and hides the
- // package's docs.
+ // that reads the field: an older CLI drops that template and can hide the
+ // package's docs. Each field has its own floor.
if (loaded.templates) {
const found = await discoverIntegrationTemplatesForOne(loaded).catch(
() => ({templates: [], errors: []}),
diff --git a/packages/cli/api/integration/pack-check.test.mjs b/packages/cli/api/integration/pack-check.test.mjs
index c209ea35bf..4223058f53 100644
--- a/packages/cli/api/integration/pack-check.test.mjs
+++ b/packages/cli/api/integration/pack-check.test.mjs
@@ -1025,9 +1025,11 @@ describe('integrationPackCheck', () => {
expect(await codes()).toContain('replaces_needs_cli');
peer('^0.6.0');
expect(await codes()).toContain('replaces_needs_cli');
- // `replaces` still needs 0.7.0.
- peer('>=0.6.4');
+ // Published 0.6.3 rejects `replaces`; published 0.6.4 applies it.
+ peer('>=0.6.3');
expect(await codes()).toContain('replaces_needs_cli');
+ peer('>=0.6.4');
+ expect(await codes()).not.toContain('replaces_needs_cli');
peer('>=0.7.0');
expect(await codes()).not.toContain('replaces_needs_cli');
}, 120_000);
@@ -1062,6 +1064,12 @@ describe('integrationPackCheck', () => {
expect(await codes()).toContain('keywords_needs_cli');
peer('^0.6.0');
expect(await codes()).toContain('keywords_needs_cli');
+ // Published 0.6.4 and 0.6.5 drop a template that sets `keywords`;
+ // published 0.6.6 reads it.
+ peer('>=0.6.5');
+ expect(await codes()).toContain('keywords_needs_cli');
+ peer('>=0.6.6');
+ expect(await codes()).not.toContain('keywords_needs_cli');
peer('>=0.7.0');
expect(await codes()).not.toContain('keywords_needs_cli');
}, 120_000);
diff --git a/packages/cli/assets/docs/tree/checks.doc.mjs b/packages/cli/assets/docs/tree/checks.doc.mjs
index 00f25b87d2..d974fdab49 100644
--- a/packages/cli/assets/docs/tree/checks.doc.mjs
+++ b/packages/cli/assets/docs/tree/checks.doc.mjs
@@ -107,7 +107,7 @@ export const docs = {
'It lists the components, templates, themes, docs, and codemods the temporary app sees, and compares them with your source.',
"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.",
'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.',
- '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.',
+ 'It fails a package that needs an `@astryxdesign/cli` peer and lacks it: `>=0.6.6` for a template that sets `keywords`, and `>=0.6.4` for a template that sets `replaces`, a docs section, a placed guide, a doc section with an `id`, or a theme.',
],
},
{
diff --git a/packages/cli/assets/docs/tree/replace-a-core-template.doc.mjs b/packages/cli/assets/docs/tree/replace-a-core-template.doc.mjs
index 0e992a6470..e03e3dc61d 100644
--- a/packages/cli/assets/docs/tree/replace-a-core-template.doc.mjs
+++ b/packages/cli/assets/docs/tree/replace-a-core-template.doc.mjs
@@ -92,7 +92,7 @@ export default {
label: 'package.json',
code: `{
"peerDependencies": {
- "@astryxdesign/cli": ">=0.7.0"
+ "@astryxdesign/cli": ">=0.6.4"
},
"peerDependenciesMeta": {
"@astryxdesign/cli": {
diff --git a/packages/cli/assets/docs/tree/template-doc-overview.doc.mjs b/packages/cli/assets/docs/tree/template-doc-overview.doc.mjs
index a51ca83853..4aa5671e7a 100644
--- a/packages/cli/assets/docs/tree/template-doc-overview.doc.mjs
+++ b/packages/cli/assets/docs/tree/template-doc-overview.doc.mjs
@@ -84,7 +84,7 @@ export const docs = {
},
{
type: 'prose',
- 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.',
+ text: 'Note: `keywords` needs `@astryxdesign/cli` 0.6.6 or later. A stable CLI before 0.6.6 rejects the field and drops that template, and one before 0.6.4 also 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.',
},
],
},
diff --git a/packages/cli/assets/docs/tree/troubleshooting.doc.mjs b/packages/cli/assets/docs/tree/troubleshooting.doc.mjs
index fa625fd49c..354670a2cf 100644
--- a/packages/cli/assets/docs/tree/troubleshooting.doc.mjs
+++ b/packages/cli/assets/docs/tree/troubleshooting.doc.mjs
@@ -91,7 +91,7 @@ export const docs = {
],
[
'`replaces_needs_cli`: The package has a template that sets `replaces` but declares no @astryxdesign/cli peer.',
- "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.",
+ "Run `npm pkg set 'peerDependencies.@astryxdesign/cli=>=0.6.4'` and `npm pkg set 'peerDependenciesMeta.@astryxdesign/cli.optional=true' --json`. A stable CLI before 0.6.4 rejects `replaces`, drops that template, and hides your doc topics.",
],
[
'`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 = {
],
[
'`keywords_needs_cli`: The package has a template that sets `keywords` but declares no @astryxdesign/cli peer.',
- 'The same fix as `replaces_needs_cli`: a stable CLI before 0.7.0 rejects `keywords`, drops that template, and hides your doc topics.',
+ "Run `npm pkg set 'peerDependencies.@astryxdesign/cli=>=0.6.6'` and `npm pkg set 'peerDependenciesMeta.@astryxdesign/cli.optional=true' --json`. A stable CLI before 0.6.6 rejects `keywords` and drops that template, and one before 0.6.4 also hides your doc topics.",
],
[
'`themes_need_cli`: The package ships a theme but declares no @astryxdesign/cli peer.',
@@ -143,7 +143,7 @@ export const docs = {
],
[
'Your docs section, templates, or themes are missing only in some apps',
- '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.',
+ 'Those apps run a CLI too old to read them: a stable CLI before 0.6.6 for a template that sets `keywords`, or before 0.6.4 for a template that sets `replaces`, a docs section, or a theme. Update `@astryxdesign/cli` there, and keep your optional `@astryxdesign/cli` peer so npm warns about an old CLI.',
],
],
},
diff --git a/packages/cli/assets/docs/tree/versioning.doc.mjs b/packages/cli/assets/docs/tree/versioning.doc.mjs
index cf167f9863..253f72c00d 100644
--- a/packages/cli/assets/docs/tree/versioning.doc.mjs
+++ b/packages/cli/assets/docs/tree/versioning.doc.mjs
@@ -110,7 +110,7 @@ export const docs = {
[
'`@astryxdesign/cli`',
'You ship a docs section, a placed guide, a template that sets `replaces` or `keywords`, a doc section with an `id`, or a theme',
- '`>=0.7.0` when you ship a template that sets `replaces` or `keywords`, otherwise `>=0.6.4`. Optional in `peerDependenciesMeta`',
+ '`>=0.6.6` when you ship a template that sets `keywords`, otherwise `>=0.6.4`. Optional in `peerDependenciesMeta`',
],
],
},
@@ -140,7 +140,7 @@ export const docs = {
'An unknown field in `astryx.integration.mjs` is ignored with an `unknown_manifest_key` warning, and the rest of the manifest still loads.',
'A named export that the CLI does not know is ignored with no warning, so `debug` and `gapReport` are safe to add.',
'A stable CLI before 0.7.0 prints each `{@link ...}` as written.',
- '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.',
+ 'Published 0.6.3 and earlier reject a template that sets `replaces` or `keywords`, drop that template, and hide every doc topic your package ships. Published 0.6.4 and 0.6.5 still drop a template that sets `keywords`.',
'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.',
'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.',
],
diff --git a/packages/cli/authoring/doctypes/template/template.doc.mjs b/packages/cli/authoring/doctypes/template/template.doc.mjs
index 33016a198b..10b4c2799a 100644
--- a/packages/cli/authoring/doctypes/template/template.doc.mjs
+++ b/packages/cli/authoring/doctypes/template/template.doc.mjs
@@ -56,13 +56,13 @@ export const doc = {
name: 'keywords',
type: 'string[]',
description:
- "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.",
+ "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.6.6 or later: earlier CLIs reject the field and drop that template, and CLIs before 0.6.4 also hide the package's doc topics.",
},
{
name: 'replaces',
type: 'string',
description:
- "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.",
+ "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.6.4 or later: earlier CLIs reject the field, drop that template, and hide the package's doc topics.",
},
{
name: 'isReady',
diff --git a/packages/cli/authoring/doctypes/template/type.ts b/packages/cli/authoring/doctypes/template/type.ts
index 590d999e1c..662346050d 100644
--- a/packages/cli/authoring/doctypes/template/type.ts
+++ b/packages/cli/authoring/doctypes/template/type.ts
@@ -32,8 +32,9 @@ export interface BaseTemplateDoc extends AuthoredDocGraphFields {
* `astryx search` matches them as it matches the description, and
* `astryx build` ranks page templates on them, so the `description` can
* stay a description of the layout. 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. */
+ * `@astryxdesign/cli` 0.6.6 or later: earlier CLIs reject the field and
+ * drop that template, and CLIs before 0.6.4 also hide the package's doc
+ * topics. */
keywords?: string[];
/** Optional stable slug override and prior aliases for registry output. */
@@ -43,7 +44,7 @@ export interface BaseTemplateDoc extends AuthoredDocGraphFields {
* replaces for unqualified lookup (find it with
* `astryx --json template --list --package @astryxdesign/core`). The Core
* original stays selectable with `--package @astryxdesign/core`. Needs
- * `@astryxdesign/cli` 0.7.0 or later: earlier CLIs reject the field,
+ * `@astryxdesign/cli` 0.6.4 or later: earlier CLIs reject the field,
* drop that template, and hide the package's doc topics. */
replaces?: string;
/** Whether this template is ready for use. Templates with
diff --git a/packages/cli/foundation/integrations/cli-requirement.mjs b/packages/cli/foundation/integrations/cli-requirement.mjs
index 33787d51dc..0c4212edce 100644
--- a/packages/cli/foundation/integrations/cli-requirement.mjs
+++ b/packages/cli/foundation/integrations/cli-requirement.mjs
@@ -26,11 +26,21 @@ export const CLI_PACKAGE = '@astryxdesign/cli';
export const NAMESPACE_DOCS_CLI = '0.6.4';
/**
- * The first CLI release that reads a template's `replaces` and `keywords`. A
- * release before it rejects either field, drops that template, and hides the
- * package's doc topics.
+ * The first stable CLI release that applies a template's `replaces`
+ * (spec:AST-035 FR1). Published 0.6.3 and earlier reject the field, drop that
+ * template, and hide every doc topic the package ships. Published 0.6.4 lists
+ * the template, keeps the topics, answers the Core id with the replacement,
+ * and still selects the Core original with `--package @astryxdesign/core`.
*/
-export const REPLACES_CLI = '0.7.0';
+export const TEMPLATE_REPLACES_CLI = '0.6.4';
+
+/**
+ * The first stable CLI release that reads a template's `keywords`. Published
+ * 0.6.4 and 0.6.5 reject the field and drop that template but keep the
+ * package's doc topics; 0.6.3 and earlier also hide them. Published 0.6.6
+ * lists the template, and search matches its keywords.
+ */
+export const KEYWORDS_CLI = '0.6.6';
/**
* The first stable CLI release that applies a component's `replaces`
@@ -166,9 +176,10 @@ export function docsTreeCliProblem(pkg) {
}
/**
- * Why a package with a template that sets `replaces` would lose templates and
- * doc topics on an older CLI (spec:AST-035), or null when its declared CLI
- * range admits only CLIs that read the field.
+ * Why a package with a template that sets `replaces` would lose that template
+ * and its doc topics on an older CLI (spec:AST-035 FR1), or null when its
+ * declared CLI range admits only CLIs that apply the field. Published 0.6.3
+ * rejects the field; published 0.6.4 applies it.
* @param {any} pkg package.json
* @returns {string | null}
*/
@@ -177,7 +188,7 @@ export function replacesCliProblem(pkg) {
pkg,
'has a template that sets `replaces`',
"rejects the field, drops that template, and hides the package's doc topics",
- REPLACES_CLI,
+ TEMPLATE_REPLACES_CLI,
);
}
@@ -235,9 +246,10 @@ export function themesCliProblem(pkg) {
/**
* Why a package with a template that sets `keywords` would lose that template
- * and its doc topics on an older CLI, or null when its declared CLI range
- * admits only CLIs that read the field. Published 0.6.3 rejects the field,
- * drops that template, and hides the package's doc topics.
+ * on an older CLI, or null when its declared CLI range admits only CLIs that
+ * read the field. Published 0.6.4 and 0.6.5 reject the field and drop that
+ * template; 0.6.3 and earlier also hide the package's doc topics. Published
+ * 0.6.6 reads it.
* @param {any} pkg package.json
* @returns {string | null}
*/
@@ -245,8 +257,8 @@ export function keywordsCliProblem(pkg) {
return cliRangeProblem(
pkg,
'has a template that sets `keywords`',
- "rejects the field, drops that template, and hides the package's doc topics",
- REPLACES_CLI,
+ "rejects the field and drops that template, and one before 0.6.4 also hides the package's doc topics",
+ KEYWORDS_CLI,
);
}
diff --git a/packages/cli/foundation/integrations/cli-requirement.test.mjs b/packages/cli/foundation/integrations/cli-requirement.test.mjs
index 92dcfe7c8d..21ba88f53b 100644
--- a/packages/cli/foundation/integrations/cli-requirement.test.mjs
+++ b/packages/cli/foundation/integrations/cli-requirement.test.mjs
@@ -6,9 +6,10 @@ import {semverCompare} from '../env/semver.mjs';
import * as requirement from './cli-requirement.mjs';
import {
COMPONENT_REPLACES_CLI,
+ KEYWORDS_CLI,
NAMESPACE_DOCS_CLI,
- REPLACES_CLI,
SECTION_IDS_CLI,
+ TEMPLATE_REPLACES_CLI,
cliRangeProblem,
componentReplacesCliProblem,
THEMES_CLI,
@@ -91,20 +92,78 @@ describe('docsTreeCliProblem', () => {
});
describe('replacesCliProblem', () => {
- it('asks a package that sets replaces for a CLI that reads the field', () => {
+ // Published 0.6.4 applies a template's `replaces`. Published 0.6.3 and
+ // earlier reject the field, drop the template, and hide the package's doc
+ // topics.
+ it('asks a package that sets replaces for a CLI from 0.6.4', () => {
expect(replacesCliProblem({name: '@acme/kit'})).toContain(
'sets `replaces`',
);
- expect(
- replacesCliProblem({peerDependencies: {'@astryxdesign/cli': '^0.6.0'}}),
- ).toContain('admits a stable CLI before');
- expect(
- replacesCliProblem({peerDependencies: {'@astryxdesign/cli': '>=0.7.0'}}),
- ).toBeNull();
- // Unlike the docs tree, `replaces` still needs 0.7.0.
- expect(
- replacesCliProblem({peerDependencies: {'@astryxdesign/cli': '>=0.6.4'}}),
- ).toContain('admits a stable CLI before 0.7.0');
+ expect(replacesCliProblem({name: '@acme/kit'})).toContain(
+ "A stable CLI before 0.6.4 rejects the field, drops that template, and hides the package's doc topics.",
+ );
+ for (const range of ['>=0.6.4', '^0.6.4', '>=0.6.5', '>=0.7.0']) {
+ expect(
+ replacesCliProblem({peerDependencies: {'@astryxdesign/cli': range}}),
+ ).toBeNull();
+ }
+ for (const range of ['>=0.6.3', '^0.6.0', '*']) {
+ expect(
+ replacesCliProblem({peerDependencies: {'@astryxdesign/cli': range}}),
+ ).toContain('admits a stable CLI before 0.6.4');
+ }
+ });
+});
+
+describe('keywordsCliProblem', () => {
+ // Published 0.6.6 reads a template's `keywords`. Published 0.6.4 and 0.6.5
+ // reject the field and drop the template; 0.6.3 and earlier also hide the
+ // package's doc topics.
+ it('asks a package that sets keywords for a CLI from 0.6.6', () => {
+ expect(keywordsCliProblem({name: '@acme/kit'})).toContain(
+ 'sets `keywords`',
+ );
+ expect(keywordsCliProblem({name: '@acme/kit'})).toContain(
+ "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.",
+ );
+ for (const range of ['>=0.6.6', '^0.6.6', '>=0.6.7', '>=0.7.0']) {
+ expect(
+ keywordsCliProblem({peerDependencies: {'@astryxdesign/cli': range}}),
+ ).toBeNull();
+ }
+ for (const range of ['>=0.6.5', '>=0.6.4', '^0.6.4', '^0.6.0']) {
+ expect(
+ keywordsCliProblem({peerDependencies: {'@astryxdesign/cli': range}}),
+ ).toContain('admits a stable CLI before 0.6.6');
+ }
+ });
+});
+
+describe('template replaces and keywords floors in the shipped docs', () => {
+ // The range an author is told to declare is the range `integration verify`
+ // accepts, so following the docs never fails the check or asks for a CLI
+ // no release satisfies.
+ const read = (/** @type {string} */ file) =>
+ fs.readFileSync(new URL(file, import.meta.url), 'utf-8');
+
+ it('shows the replaces floor in the replace-a-core-template guide', () => {
+ const named = [
+ ...read(
+ '../../assets/docs/tree/replace-a-core-template.doc.mjs',
+ ).matchAll(/"@astryxdesign\/cli":\s*">=(\d+\.\d+\.\d+)"/g),
+ ].map(match => match[1]);
+ expect(named.length).toBeGreaterThan(0);
+ expect(new Set(named)).toEqual(new Set([TEMPLATE_REPLACES_CLI]));
+ });
+
+ it.each([
+ ['`replaces_needs_cli`', TEMPLATE_REPLACES_CLI],
+ ['`keywords_needs_cli`', KEYWORDS_CLI],
+ ])('gives the %s fix the floor the check asks for', (code, floor) => {
+ const row = read('../../assets/docs/tree/troubleshooting.doc.mjs')
+ .split('],')
+ .find(part => part.includes(`${code}:`));
+ expect(row).toContain(`@astryxdesign/cli=>=${floor}'`);
});
});
@@ -193,17 +252,17 @@ describe('themesCliProblem and sectionIdsCliProblem', () => {
}
});
- it('keeps 0.7.0 for replaces and keywords', () => {
+ it('gives replaces and keywords their own floors', () => {
+ // `>=0.6.4` admits published 0.6.4 and 0.6.5, which drop a template that
+ // sets `keywords` but apply one that sets `replaces`.
const pkg = {peerDependencies: {'@astryxdesign/cli': '>=0.6.4'}};
expect(docsTreeCliProblem(pkg)).toBeNull();
- expect(replacesCliProblem(pkg)).toContain(
- 'admits a stable CLI before 0.7.0',
- );
+ expect(replacesCliProblem(pkg)).toBeNull();
expect(keywordsCliProblem(pkg)).toContain(
- 'admits a stable CLI before 0.7.0',
+ 'admits a stable CLI before 0.6.6',
);
expect(
- keywordsCliProblem({peerDependencies: {'@astryxdesign/cli': '>=0.7.0'}}),
+ keywordsCliProblem({peerDependencies: {'@astryxdesign/cli': '>=0.6.6'}}),
).toBeNull();
});
@@ -211,7 +270,13 @@ describe('themesCliProblem and sectionIdsCliProblem', () => {
const {version} = JSON.parse(
fs.readFileSync(new URL('../../package.json', import.meta.url), 'utf-8'),
);
- for (const floor of [NAMESPACE_DOCS_CLI, THEMES_CLI, SECTION_IDS_CLI]) {
+ for (const floor of [
+ NAMESPACE_DOCS_CLI,
+ THEMES_CLI,
+ SECTION_IDS_CLI,
+ TEMPLATE_REPLACES_CLI,
+ KEYWORDS_CLI,
+ ]) {
expect(semverCompare(floor, version.split('-')[0])).toBeLessThanOrEqual(
0,
);
@@ -252,8 +317,8 @@ describe('every feature check names its CLI floor', () => {
const FLOORS = {
componentReplacesCliProblem: COMPONENT_REPLACES_CLI,
docsTreeCliProblem: '0.6.4',
- replacesCliProblem: REPLACES_CLI,
- keywordsCliProblem: REPLACES_CLI,
+ replacesCliProblem: TEMPLATE_REPLACES_CLI,
+ keywordsCliProblem: KEYWORDS_CLI,
sectionIdsCliProblem: '0.6.4',
themesCliProblem: '0.6.4',
};
@@ -279,8 +344,10 @@ describe('every feature check names its CLI floor', () => {
// Tied to the next patch slot: the first stable release that ships
// component replacement.
componentReplacesCliProblem: '0.6.7',
- replacesCliProblem: '0.7.0',
- keywordsCliProblem: '0.7.0',
+ // Measured on published releases: 0.6.4 applies a template's
+ // `replaces`, and 0.6.6 reads its `keywords`.
+ replacesCliProblem: '0.6.4',
+ keywordsCliProblem: '0.6.6',
});
});
});