@astryxdesign/cli 0.6.3-canary.1ffe66d → 0.6.3-canary.287212a

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 CHANGED
@@ -470,7 +470,7 @@ Every response has a `type` discriminant. The full set is below (generated from
470
470
  | `integration.add` | A contribution-writer receipt: kind, name, optional root {path, created}, integration-manifest path, every affected project-relative path, written, and dryRun. |
471
471
  | `integration.pack-check` | The packed-package check: name, version, packable, tarball {filename, fileCount, size, unpackedSize} or null, inventory {manifest, roots [{kind, path, expectedFiles, missingFiles, complete}], expectedFiles, packedFiles}, contributions {local, packed}, each null or {themes [{slug, exportName}], components, templates [{id, type, name}], codemods [{version, id}], docs, agentDocsAppend}, and issues [{code, severity, message}]. |
472
472
  | `integration.validate` | The validation result: the package name and version (both null when no local manifest is found) plus issues, an AstryxIntegrationIssue[] of {code, severity: warning \| error, message}. |
473
- | `integration.template-conflicts` | The integration identity, structural issues, and non-blocking Core template-id conflicts as {id, severity: warning, integrationPackage, integrationType, integrationName, coreMatches, message, command}. |
473
+ | `integration.template-conflicts` | The integration identity, issues, and conflicts as {severity: info \| warning, relationship: replaces \| accidental, replaces?, command}. |
474
474
  | `integration.component-conflicts` | The integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command. |
475
475
  | `integration.doc-conflicts` | The integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` \| `error`) and `relationship` (`replaces` \| `extends` \| `accidental`). |
476
476
  | `layout.expand` | The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, and written (the output path, or null when nothing was written). |
@@ -4,14 +4,8 @@
4
4
  * @file Integration authoring diagnostics against the built-in Core catalog.
5
5
  *
6
6
  * Templates may intentionally replace Core identities; undeclared same-id
7
- * overlaps stay fail-closed and require package selection. The CLI package
8
- * version gates replacement-specific fields so 0.6.x keeps its released shape.
9
- * Docs have explicit `replaces` / `extends` relationships with parallel
10
- * validation semantics.
11
- *
12
- * @input Integration packages, built-in catalogs, and the CLI release boundary.
13
- * @output Typed template, component, and documentation authoring diagnostics.
14
- * @position Public integration-authoring API over private discovery adapters.
7
+ * overlaps stay fail-closed and require package selection. Docs have explicit
8
+ * `replaces` / `extends` relationships with parallel validation semantics.
15
9
  */
16
10
 
17
11
  import {getCliInvocation} from '../../foundation/env/package-manager.mjs';
@@ -30,7 +24,6 @@ import {
30
24
  discoverCoreTemplates,
31
25
  discoverIntegrationTemplatesForOne,
32
26
  } from '../../foundation/discovery/template-adapter.mjs';
33
- import {expandedTemplateConflictSchemaActive} from '../../foundation/discovery/template-conflict-release.mjs';
34
27
  import {
35
28
  validateInstalledIntegration,
36
29
  validateLocalIntegration,
@@ -106,7 +99,6 @@ export async function integrationTemplateConflicts(pkg, options = {}) {
106
99
  ]);
107
100
  addErrors(issues, errors, 'invalid_template');
108
101
 
109
- const expandedConflictSchema = expandedTemplateConflictSchemaActive();
110
102
  const replacementResolution = applyTemplateReplacements(
111
103
  [...coreTemplates, ...templates],
112
104
  errors.filter(error => error.replacementTarget != null),
@@ -152,29 +144,21 @@ export async function integrationTemplateConflicts(pkg, options = {}) {
152
144
  const sameIdCore = coreById.get(template.dirName);
153
145
  const replacementIsActive = activeReplacementIds.has(template.dirName);
154
146
 
155
- if (
156
- expandedConflictSchema &&
157
- replacementIsActive &&
158
- template.replaces != null
159
- ) {
160
- // This branch is unreachable before the package reaches 0.7.0. Keep the
161
- // published 0.6.x conflict typedef narrow until the activation change.
162
- conflicts.push(
163
- /** @type {any} */ ({
164
- id: template.dirName,
165
- severity: 'info',
166
- relationship: 'replaces',
167
- replaces: template.replaces,
168
- integrationPackage: name,
169
- integrationType: template.type,
170
- integrationName: template.name,
171
- coreMatches: coreById.get(template.replaces) ?? [],
172
- message:
173
- `Intentional replacement: "${template.dirName}" replaces the Core template ` +
174
- `"${template.replaces}" for unqualified lookup.`,
175
- command: `${run} template ${shellArg(template.replaces)} --package ${shellArg('@astryxdesign/core')}`,
176
- }),
177
- );
147
+ if (replacementIsActive && template.replaces != null) {
148
+ conflicts.push({
149
+ id: template.dirName,
150
+ severity: 'info',
151
+ relationship: 'replaces',
152
+ replaces: template.replaces,
153
+ integrationPackage: name,
154
+ integrationType: template.type,
155
+ integrationName: template.name,
156
+ coreMatches: coreById.get(template.replaces) ?? [],
157
+ message:
158
+ `Intentional replacement: "${template.dirName}" replaces the Core template ` +
159
+ `"${template.replaces}" for unqualified lookup.`,
160
+ command: `${run} template ${shellArg(template.replaces)} --package ${shellArg('@astryxdesign/core')}`,
161
+ });
178
162
  }
179
163
 
180
164
  if (
@@ -190,24 +174,20 @@ export async function integrationTemplateConflicts(pkg, options = {}) {
190
174
  conflicts.push({
191
175
  id: template.dirName,
192
176
  severity: 'warning',
193
- ...(expandedConflictSchema ? {relationship: 'accidental'} : {}),
177
+ relationship: 'accidental',
194
178
  integrationPackage: name,
195
179
  integrationType: template.type,
196
180
  integrationName: template.name,
197
181
  coreMatches: sameIdCore,
198
- message: expandedConflictSchema
199
- ? compatibleKind
200
- ? `Template id "${template.dirName}" conflicts with Core (${coreKinds}). Consider renaming it, or set replaces: ${JSON.stringify(template.dirName)} in its metadata to replace the Core template.`
201
- : `Template id "${template.dirName}" conflicts with Core (${coreKinds}), but a ${template.type} template cannot replace a different template kind. Rename the integration template.`
202
- : `Template id "${template.dirName}" conflicts with Core (${coreKinds}). Consider renaming the integration template. If you keep it, always select it with --package.`,
182
+ message: compatibleKind
183
+ ? `Template id "${template.dirName}" conflicts with Core (${coreKinds}). Consider renaming it, or set replaces: ${JSON.stringify(template.dirName)} in its metadata to replace the Core template.`
184
+ : `Template id "${template.dirName}" conflicts with Core (${coreKinds}), but a ${template.type} template cannot replace a different template kind. Rename the integration template.`,
203
185
  command: `${run} template ${shellArg(template.dirName)} --package ${shellArg(name)}`,
204
186
  });
205
187
  }
206
188
  }
207
189
  conflicts.sort((a, b) =>
208
- `${a.id}:${'relationship' in a ? a.relationship : ''}`.localeCompare(
209
- `${b.id}:${'relationship' in b ? b.relationship : ''}`,
210
- ),
190
+ `${a.id}:${a.relationship}`.localeCompare(`${b.id}:${b.relationship}`),
211
191
  );
212
192
 
213
193
  return {
@@ -2,16 +2,9 @@
2
2
 
3
3
  /**
4
4
  * @file Hermetic integration authoring checks against the real Core catalogs.
5
- * @input Integration fixtures and the post-0.7 conflict projection.
6
- * @output Coverage for replacement validation and public diagnostics.
7
- * @position Unit coverage; the 0.6.x compatibility shape has its own fixture.
8
5
  */
9
6
 
10
- import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
11
-
12
- vi.mock('../../foundation/discovery/template-conflict-release.mjs', () => ({
13
- expandedTemplateConflictSchemaActive: () => true,
14
- }));
7
+ import {afterEach, beforeEach, describe, expect, it} from 'vitest';
15
8
  import * as fs from 'node:fs';
16
9
  import * as path from 'node:path';
17
10
  import {discoverCoreTemplates} from '../../foundation/discovery/template-adapter.mjs';
@@ -10,7 +10,9 @@ export type CoreTemplateMatch = {
10
10
  };
11
11
  export type IntegrationTemplateConflict = {
12
12
  id: string;
13
- severity: "warning";
13
+ severity: "info" | "warning";
14
+ relationship: "replaces" | "accidental";
15
+ replaces?: string | undefined;
14
16
  integrationPackage: string;
15
17
  integrationType: "page" | "block";
16
18
  integrationName: string;
@@ -1,11 +1,6 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
- /**
4
- * @file Colocated public types for integration authoring diagnostics.
5
- * @input Stable response fields exposed by integration-authoring APIs.
6
- * @output JSDoc typedefs consumed by declarations, commands, and callers.
7
- * @position Public type boundary for integration diagnostics.
8
- */
3
+ /** @file Colocated types for integration authoring diagnostics. */
9
4
 
10
5
  /**
11
6
  * @typedef {object} IntegrationAuthoringOptions
@@ -21,7 +16,9 @@
21
16
  /**
22
17
  * @typedef {object} IntegrationTemplateConflict
23
18
  * @property {string} id
24
- * @property {'warning'} severity
19
+ * @property {'info' | 'warning'} severity
20
+ * @property {'replaces' | 'accidental'} relationship
21
+ * @property {string} [replaces]
25
22
  * @property {string} integrationPackage
26
23
  * @property {'page' | 'block'} integrationType
27
24
  * @property {string} integrationName
@@ -3,9 +3,6 @@
3
3
 
4
4
  /**
5
5
  * @file FunctionDoc for integration template-conflict diagnostics.
6
- * @input The stable 0.6.x `integrationTemplateConflicts` API contract.
7
- * @output Generated CLI API reference metadata.
8
- * @position Consumer-facing documentation for the public authoring API.
9
6
  */
10
7
  /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
11
8
  export const doc: import("@astryxdesign/cli/authoring").FunctionDoc;
@@ -2,9 +2,6 @@
2
2
 
3
3
  /**
4
4
  * @file FunctionDoc for integration template-conflict diagnostics.
5
- * @input The stable 0.6.x `integrationTemplateConflicts` API contract.
6
- * @output Generated CLI API reference metadata.
7
- * @position Consumer-facing documentation for the public authoring API.
8
5
  */
9
6
 
10
7
  /** @type {import('@astryxdesign/cli/authoring').FunctionDoc} */
@@ -14,11 +11,12 @@ export const doc = {
14
11
  name: 'integrationTemplateConflicts',
15
12
  namespace: 'cli/api',
16
13
  displayName: 'integrationTemplateConflicts()',
17
- summary: 'Find integration template ids that also exist in Core.',
14
+ summary: 'Validate integration template replacements and Core id overlaps.',
18
15
  description:
19
- 'Loads one local or installed integration, compares its template ids with the ' +
20
- 'built-in Core page and block templates, and returns non-blocking conflicts with ' +
21
- 'the exact package-qualified CLI command required to keep an intentional overlap.',
16
+ 'Loads one local or installed integration, validates its template replacement ' +
17
+ 'declarations against the built-in Core page and block templates, and reports ' +
18
+ 'intentional replacements, missing targets, ambiguous declarations, type ' +
19
+ 'mismatches, and undeclared same-id conflicts.',
22
20
  importPath: '@astryxdesign/cli/api',
23
21
  signature:
24
22
  'integrationTemplateConflicts(pkg?: string, options?: IntegrationAuthoringOptions): Promise<IntegrationTemplateConflictResponse>',
@@ -41,7 +39,7 @@ export const doc = {
41
39
  {
42
40
  type: 'integration.template-conflicts',
43
41
  description:
44
- 'The integration identity, structural issues, and every Core template-id conflict with a package-qualified command.',
42
+ 'The integration identity, structural and replacement-declaration issues, intentional Core replacements, and undeclared same-id conflicts.',
45
43
  },
46
44
  ],
47
45
  examples: [
@@ -2,16 +2,9 @@
2
2
 
3
3
  /**
4
4
  * @file Command-level coverage for `astryx doctor integration` authoring checks.
5
- * @input Integration fixtures and the post-0.7 conflict projection.
6
- * @output Assertions for human and typed command responses.
7
- * @position CLI adapter coverage; 0.6.x API shape is verified separately.
8
5
  */
9
6
 
10
7
  import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
11
-
12
- vi.mock('../../../foundation/discovery/template-conflict-release.mjs', () => ({
13
- expandedTemplateConflictSchemaActive: () => true,
14
- }));
15
8
  import * as fs from 'node:fs';
16
9
  import * as path from 'node:path';
17
10
  import {Command} from 'commander';
@@ -3,12 +3,7 @@
3
3
  /**
4
4
  * @file `astryx doctor` project health and integration-authoring diagnostics.
5
5
  * Human output uses plain stable tokens; every leaf also has a typed JSON
6
- * response. Template-conflict fields follow the package release boundary.
7
- * Exit 1 means a check found an error, while warnings remain exit 0.
8
- *
9
- * @input Typed Doctor and integration-authoring API responses.
10
- * @output Human-readable records or pass-through typed JSON.
11
- * @position CLI presentation adapter for project and integration health.
6
+ * response. Exit 1 means a check found an error, while warnings remain exit 0.
12
7
  */
13
8
 
14
9
  import {runChecks} from '../../../api/doctor/doctor.mjs';
@@ -131,41 +126,26 @@ function printTemplateConflicts(data) {
131
126
  ...issueBlocks(data.issues),
132
127
  ];
133
128
  if (data.conflicts.length === 0 && data.issues.length === 0) {
134
- output.push(text('[ok] No template ids conflict with Core.'));
135
- } else if (data.conflicts.length > 0) {
136
- const expanded = data.conflicts.some(
137
- conflict => 'relationship' in conflict,
129
+ output.push(
130
+ text('[ok] No template replacements or id conflicts with Core.'),
138
131
  );
132
+ } else if (data.conflicts.length > 0) {
139
133
  output.push(
140
134
  records(data.conflicts, {
141
- fields: expanded
142
- ? [
143
- 'severity',
144
- 'relationship',
145
- 'id',
146
- 'replaces',
147
- 'integrationPackage',
148
- 'integrationType',
149
- 'integrationName',
150
- 'message',
151
- 'command',
152
- ]
153
- : [
154
- 'severity',
155
- 'id',
156
- 'integrationPackage',
157
- 'integrationType',
158
- 'integrationName',
159
- 'message',
160
- 'command',
161
- ],
135
+ fields: [
136
+ 'severity',
137
+ 'relationship',
138
+ 'id',
139
+ 'replaces',
140
+ 'integrationPackage',
141
+ 'integrationType',
142
+ 'integrationName',
143
+ 'message',
144
+ 'command',
145
+ ],
162
146
  format: {severity: statusToken},
163
147
  }),
164
- text(
165
- expanded
166
- ? `${data.conflicts.length} Core template relationship(s).`
167
- : `${data.conflicts.length} Core template conflict(s). Renaming is recommended but optional; keep the package-qualified command if the overlap is intentional.`,
168
- ),
148
+ text(`${data.conflicts.length} Core template relationship(s).`),
169
149
  );
170
150
  }
171
151
  emit(...output);
@@ -219,9 +199,7 @@ function printDocConflicts(data) {
219
199
  issue => issue.severity === 'error' || issue.code === 'invalid_doc_graph',
220
200
  )
221
201
  ) {
222
- output.push(
223
- text('[ok] The docs tree and every link in these docs check out.'),
224
- );
202
+ output.push(text('[ok] The docs tree and every link in these docs check out.'));
225
203
  }
226
204
  if (data.findings.length === 0) {
227
205
  output.push(text('[ok] No doc topics overlap with Core.'));
@@ -5,11 +5,7 @@
5
5
  * @file EnumDoc for the `type` discriminant carried on every --json success
6
6
  * envelope. The vocabulary mirrors the RESPONSE_TYPES map (each command's
7
7
  * `jsonOut(...)` call sites) in `clients/cli/lib/manifest.mjs`; a consumer
8
- * switches on `type` to narrow the `data` payload. Descriptions follow the
9
- * currently published response projection, not a future package-version boundary.
10
- *
11
- * @input Public response discriminants and their currently released payloads.
12
- * @output Generated consumer reference for every typed JSON success response.
8
+ * switches on `type` to narrow the `data` payload.
13
9
  * @position packages/cli/foundation/response — enum documentation
14
10
  */
15
11
  /** @type {import('@astryxdesign/cli/authoring').EnumDoc} */
@@ -4,11 +4,7 @@
4
4
  * @file EnumDoc for the `type` discriminant carried on every --json success
5
5
  * envelope. The vocabulary mirrors the RESPONSE_TYPES map (each command's
6
6
  * `jsonOut(...)` call sites) in `clients/cli/lib/manifest.mjs`; a consumer
7
- * switches on `type` to narrow the `data` payload. Descriptions follow the
8
- * currently published response projection, not a future package-version boundary.
9
- *
10
- * @input Public response discriminants and their currently released payloads.
11
- * @output Generated consumer reference for every typed JSON success response.
7
+ * switches on `type` to narrow the `data` payload.
12
8
  * @position packages/cli/foundation/response — enum documentation
13
9
  */
14
10
 
@@ -65,7 +61,7 @@ export const doc = {
65
61
  {
66
62
  value: 'docs.list',
67
63
  description:
68
- "All reference-doc topics as DocsListEntry[] ({topic, description, package, replaces?}), in read order; meta.namespaces lists the docs tree's top-level namespaces, and meta.notLoaded each package whose docs did not load.",
64
+ 'All reference-doc topics as DocsListEntry[] ({topic, description, package, replaces?}), in read order; meta.namespaces lists the docs tree\'s top-level namespaces, and meta.notLoaded each package whose docs did not load.',
69
65
  },
70
66
  {
71
67
  value: 'docs.detail',
@@ -295,7 +291,7 @@ export const doc = {
295
291
  {
296
292
  value: 'integration.template-conflicts',
297
293
  description:
298
- 'The integration identity, structural issues, and non-blocking Core template-id conflicts as {id, severity: warning, integrationPackage, integrationType, integrationName, coreMatches, message, command}.',
294
+ 'The integration identity, issues, and conflicts as {severity: info | warning, relationship: replaces | accidental, replaces?, command}.',
299
295
  },
300
296
  {
301
297
  value: 'integration.component-conflicts',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.6.3-canary.1ffe66d",
3
+ "version": "0.6.3-canary.287212a",
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.3-canary.1ffe66d",
105
- "@astryxdesign/core": "0.6.3-canary.1ffe66d",
106
- "@astryxdesign/lab": "0.6.3-canary.1ffe66d",
107
- "@astryxdesign/theme-neutral": "0.6.3-canary.1ffe66d"
104
+ "@astryxdesign/charts": "0.6.3-canary.287212a",
105
+ "@astryxdesign/core": "0.6.3-canary.287212a",
106
+ "@astryxdesign/lab": "0.6.3-canary.287212a",
107
+ "@astryxdesign/theme-neutral": "0.6.3-canary.287212a"
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.3-canary.1ffe66d",
125
- "@astryxdesign/core": "0.6.3-canary.1ffe66d",
126
- "@astryxdesign/lab": "0.6.3-canary.1ffe66d",
127
- "@astryxdesign/theme-neutral": "0.6.3-canary.1ffe66d",
124
+ "@astryxdesign/charts": "0.6.3-canary.287212a",
125
+ "@astryxdesign/core": "0.6.3-canary.287212a",
126
+ "@astryxdesign/lab": "0.6.3-canary.287212a",
127
+ "@astryxdesign/theme-neutral": "0.6.3-canary.287212a",
128
128
  "@heroicons/react": "^2.2.0",
129
129
  "@stylexjs/stylex": "^0.19.0",
130
130
  "@types/babel__core": "^7.20.5",
@@ -1,73 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file Final-0.6.x compatibility coverage for integration-template conflicts.
5
- * @input A future replacement declaration plus an ordinary released conflict.
6
- * @output Proof that 0.6.x omits replacement-specific public fields.
7
- * @position Regression fixture for the stable conflict response boundary.
8
- */
9
-
10
- import {afterEach, beforeEach, describe, expect, it} from 'vitest';
11
- import * as fs from 'node:fs';
12
- import * as path from 'node:path';
13
- import {discoverCoreTemplates} from '../../foundation/discovery/template-adapter.mjs';
14
- import {integrationTemplateConflicts} from './authoring-checks.mjs';
15
-
16
- let tmpDir;
17
-
18
- function writeTemplate(pkgDir, id, type, replaces) {
19
- const stem = path.join(pkgDir, 'templates', id);
20
- fs.mkdirSync(path.dirname(stem), {recursive: true});
21
- fs.writeFileSync(
22
- `${stem}.doc.mjs`,
23
- `export default {type: ${JSON.stringify(type)}, name: ${JSON.stringify(id)}, description: 'fixture'${replaces == null ? '' : `, replaces: ${JSON.stringify(replaces)}`}};\n`,
24
- );
25
- fs.writeFileSync(
26
- `${stem}.tsx`,
27
- `export default function Fixture() { return ${JSON.stringify(id)}; }\n`,
28
- );
29
- }
30
-
31
- beforeEach(() => {
32
- tmpDir = fs.mkdtempSync(
33
- path.join(process.cwd(), '.astryx-template-conflict-compat-'),
34
- );
35
- });
36
-
37
- afterEach(() => {
38
- fs.rmSync(tmpDir, {recursive: true, force: true});
39
- });
40
-
41
- describe('integration-template conflict compatibility on 0.6.x', () => {
42
- it('preserves the released warning-only conflict shape', async () => {
43
- const corePages = (await discoverCoreTemplates()).filter(
44
- candidate => candidate.type === 'page',
45
- );
46
- const target = corePages[0];
47
- const accidental = corePages[1];
48
- expect(target).toBeDefined();
49
- expect(accidental).toBeDefined();
50
-
51
- fs.writeFileSync(
52
- path.join(tmpDir, 'package.json'),
53
- JSON.stringify({name: '@acme/widgets', version: '1.0.0'}),
54
- );
55
- fs.writeFileSync(
56
- path.join(tmpDir, 'astryx.integration.mjs'),
57
- `export default {templates: './templates'};\n`,
58
- );
59
- writeTemplate(tmpDir, 'acme-future-shell', target.type, target.dirName);
60
- writeTemplate(tmpDir, accidental.dirName, accidental.type);
61
-
62
- const report = await integrationTemplateConflicts(undefined, {cwd: tmpDir});
63
-
64
- expect(report.data.issues).toEqual([]);
65
- expect(report.data.conflicts).toHaveLength(1);
66
- expect(report.data.conflicts[0]).toMatchObject({
67
- id: accidental.dirName,
68
- severity: 'warning',
69
- });
70
- expect(report.data.conflicts[0]).not.toHaveProperty('relationship');
71
- expect(report.data.conflicts[0]).not.toHaveProperty('replaces');
72
- });
73
- });
@@ -1,13 +0,0 @@
1
- // @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
2
- // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
-
4
- /**
5
- * Whether this release exposes replacement relationships in the public conflict API.
6
- * Both the supported version and a deliberate projection update are required;
7
- * a routine package-version bump cannot expand the public shape by itself.
8
- *
9
- * @param {string} [version]
10
- * @param {'warning-only' | 'expanded'} [projection]
11
- * @returns {boolean}
12
- */
13
- export function expandedTemplateConflictSchemaActive(version?: string, projection?: "warning-only" | "expanded"): boolean;
@@ -1,40 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file Release boundary for the expanded integration-template conflict schema.
5
- *
6
- * @input The CLI package version and an explicit public-schema projection.
7
- * @output Whether replacement-specific conflict fields may reach the stable API.
8
- * @position Private compatibility gate for integration authoring diagnostics.
9
- */
10
-
11
- import * as fs from 'node:fs';
12
- import * as path from 'node:path';
13
- import {semverCompare} from '../env/semver.mjs';
14
- import {CLI_ROOT} from '../fs/paths.mjs';
15
-
16
- const EXPANDED_TEMPLATE_CONFLICT_SCHEMA_CLI = '0.7.0';
17
- /** @type {'warning-only' | 'expanded'} */
18
- const TEMPLATE_CONFLICT_SCHEMA_PROJECTION = 'warning-only';
19
- const CLI_VERSION = JSON.parse(
20
- fs.readFileSync(path.join(CLI_ROOT, 'package.json'), 'utf8'),
21
- ).version;
22
-
23
- /**
24
- * Whether this release exposes replacement relationships in the public conflict API.
25
- * Both the supported version and a deliberate projection update are required;
26
- * a routine package-version bump cannot expand the public shape by itself.
27
- *
28
- * @param {string} [version]
29
- * @param {'warning-only' | 'expanded'} [projection]
30
- * @returns {boolean}
31
- */
32
- export function expandedTemplateConflictSchemaActive(
33
- version = CLI_VERSION,
34
- projection = TEMPLATE_CONFLICT_SCHEMA_PROJECTION,
35
- ) {
36
- return (
37
- projection === 'expanded' &&
38
- semverCompare(version, EXPANDED_TEMPLATE_CONFLICT_SCHEMA_CLI) >= 0
39
- );
40
- }
@@ -1,40 +0,0 @@
1
- // Copyright (c) Meta Platforms, Inc. and affiliates.
2
-
3
- /**
4
- * @file Unit coverage for the integration-template conflict release boundary.
5
- * @input CLI versions and explicit warning-only or expanded projections.
6
- * @output Boolean activation assertions for the expanded conflict schema.
7
- * @position Colocated coverage for the private release gate.
8
- */
9
-
10
- import {describe, expect, it} from 'vitest';
11
- import {expandedTemplateConflictSchemaActive} from './template-conflict-release.mjs';
12
-
13
- describe('expandedTemplateConflictSchemaActive', () => {
14
- it.each(['0.6.3', '0.6.4', '0.6.99'])(
15
- 'keeps %s narrow even when the expanded projection is requested',
16
- version => {
17
- expect(expandedTemplateConflictSchemaActive(version, 'expanded')).toBe(
18
- false,
19
- );
20
- },
21
- );
22
-
23
- it.each(['0.7.0-rc.1', '0.7.0', '0.8.0'])(
24
- 'does not let version %s expand the warning-only projection',
25
- version => {
26
- expect(
27
- expandedTemplateConflictSchemaActive(version, 'warning-only'),
28
- ).toBe(false);
29
- },
30
- );
31
-
32
- it.each(['0.7.0-rc.1', '0.7.0', '0.8.0'])(
33
- 'allows the deliberate expanded projection in %s',
34
- version => {
35
- expect(expandedTemplateConflictSchemaActive(version, 'expanded')).toBe(
36
- true,
37
- );
38
- },
39
- );
40
- });