Skip to content

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

TypeScript

fix(cli): swizzle marks its output folder so the copy compiles below the theme (#10483)

Cindy Zhang44b9aa57d5a6
diff --git a/.changeset/swizzle-writes-marker.md b/.changeset/swizzle-writes-marker.md
new file mode 100644
index 0000000000..a786a11a32
--- /dev/null
+++ b/.changeset/swizzle-writes-marker.md
@@ -0,0 +1,8 @@
+---
+'@astryxdesign/cli': patch
+'@astryxdesign/build': patch
+---
+
+[fix] `astryx swizzle` writes an `astryx-swizzle.json` marker into an output folder it owns (one the copy creates, an empty one, or one it marked before), naming each package the folder's copies came from and its version. `@astryxdesign/build`'s Babel, PostCSS and Vite integrations, and `withAstryx()` under webpack, compile the copies under that folder below `astryx-theme`, so a theme's component overrides reach a swizzled component as they reach the package component. For a folder that already holds other files it writes no marker and says what it found and how to add the marker by hand; the `swizzle.copy` receipt reports this in a new optional `marker` field. Under Turbopack and with the stock StyleX plugins, a copy's styles still land above the theme. The marker is not listed among the copy's files.
+
+@cixzhang
diff --git a/docs/specs/AST-080-package-stylesheets/spec.md b/docs/specs/AST-080-package-stylesheets/spec.md
index 6e4a805ac1..58643e5513 100644
--- a/docs/specs/AST-080-package-stylesheets/spec.md
+++ b/docs/specs/AST-080-package-stylesheets/spec.md
@@ -280,8 +280,7 @@ first.
output.
- The FR7 exception for a swizzled copy holds in the Babel, PostCSS, and Vite
integrations. `withAstryx()` under Turbopack does not read the
- `astryx-swizzle.json` marker, and `astryx swizzle` does not write it, so a
- product adds the marker to the copy's folder (FR5, FR7). Under webpack,
+ `astryx-swizzle.json` marker that `astryx swizzle` writes (FR5, FR7). Under webpack,
`withAstryx()` makes each app module depend on the marker paths above it, so
a cached build recompiles a copy when its marker appears or disappears (FR7).
- Under Turbopack no maintained StyleX compiler runs in the native pipeline, so
diff --git a/docs/specs/AST-110-swizzle-output/spec.md b/docs/specs/AST-110-swizzle-output/spec.md
index 2e0be84134..a245f6f7ca 100644
--- a/docs/specs/AST-110-swizzle-output/spec.md
+++ b/docs/specs/AST-110-swizzle-output/spec.md
@@ -116,7 +116,11 @@ and the repository proves it before a change that could break it merges.
and custom properties as the package component of that version, so a theme,
`xstyle`, and product CSS reach it the same way. Swizzle marks its output
directory as Astryx source with an `astryx-swizzle.json` file that names the
- owner package and its version. `@astryxdesign/build` compiles every module
+ owner package and its version. It writes the marker only into an output
+ directory it owns: one the copy creates, an empty one, or one it marked
+ before. For any other directory it writes no marker, and the `swizzle.copy`
+ result and the command's output name what the directory holds and how to add
+ the marker by hand. `@astryxdesign/build` compiles every module
under a marked directory in its library pass, with the library class prefix,
into `astryx-base` below `astryx-theme`, so a theme's component overrides
apply to the copy as they do to the package component. This placement holds
@@ -175,9 +179,6 @@ and the repository proves it before a change that could break it merges.
`--overwrite` and replaces with it (FR4).
- `@astryxdesign/build`'s Next integration under Turbopack compiles modules
under an `astryx-swizzle.json` directory in the library pass (FR5).
-- The styling overview states that a copy's rules land in `astryx-base` with
- `@astryxdesign/build`, and above `astryx-theme` with the stock StyleX plugins
- (FR5).
- The `swizzle` command doc states FR1 and FR6 for product teams.
### Known gaps
@@ -185,9 +186,6 @@ and the repository proves it before a change that could break it merges.
- The copy sends `../X/file` imports to the public `X` entry, which lacks the
internal helpers, and deep StyleX modules are missing from Core's exports
(FR1, FR2).
-- `astryx swizzle` does not write the `astryx-swizzle.json` marker, so a copy's
- styles land in the app's cascade layer above the theme's, and theme component
- overrides stop applying, until the product adds the marker (FR5).
- Copies include spec records and test files and leave out nested folders
(FR2), and `swizzle --list` offers folders that are not components
(`spec:AST-035` FR12).
@@ -224,6 +222,7 @@ and the repository proves it before a change that could break it merges.
| FR3 | `sharedContexts.test.tsx` "gives each React its own context under a key, and one per React": a second React instance loads a copy of the shared-context module | Two copies on one React; a copy on a second React in the same process | Two copies on one React getting different contexts, or a copy on a second React getting the same context object, fails |
| FR4 | Scan each output for private data-attribute names and selectors; compare copied owner modules with the package's | Components that reach an owner module | A hand-written private attribute name or selector, or an edited owner module, in the output |
| FR5 | Render package and copy side by side under a theme with component overrides; compare | Default; each variant; a theme component override; a copy built by `@astryxdesign/build` | A theme override, documented class name, data attribute, or theme target reaches one and not the other |
+| FR5 | Swizzle into a new folder, an empty one, a marked one, and one holding a product module; read the folder and the `swizzle.copy` result | Default output; `--output` to a product folder; a folder of earlier copies with no marker | A marker lands in a folder that holds a product module, a new, empty or marked folder is left unmarked, or the result omits what a skipped folder holds |
| FR6 | The component's own interaction and accessibility checks run against the copy | Keyboard, pointer, screen-reader tree | A check that passes on the package fails on the copy |
| FR7 | The required test lane's swizzle proof and the release-time proof; both cover Core's list and every integration package's components through `--package` | A change to component source; a change to the swizzle copy; an unrelated change; Core, Lab, Charts, RichText, Vega | An offered component missing from the proof, a failure that does not block, a new required context, the proof adding wall-clock time to the slowest required check, or the proof pushing its job past the pull-request time budget |
diff --git a/packages/build/README.md b/packages/build/README.md
index 2975a04dec..119a6ea88c 100644
--- a/packages/build/README.md
+++ b/packages/build/README.md
@@ -253,7 +253,7 @@ Library patterns (configurable):
- `packages/themes/`
- `node_modules/@astryxdesign/`
-A swizzled copy is library code too. The Babel, PostCSS, and Vite integrations compile every module under a folder that holds an `astryx-swizzle.json` marker with the library prefix into `@layer astryx-base`, so a theme's component overrides reach the copy as they reach the package component. `astryx swizzle` does not write the marker yet: add it to the swizzle output folder, naming the package the copy came from and its version, such as `{"packages": {"@astryxdesign/core": "0.7.10"}}`. The build reads only whether the file is there. Under webpack, use `withAstryx()` with a marked copy: it makes each app module depend on the marker paths above it, so a dev session or a cached build recompiles a copy when its marker appears or disappears. In another setup that caches transforms, restart the dev server and delete that cache after adding or removing a marker. Turbopack builds do not read the marker yet.
+A swizzled copy is library code too. The Babel, PostCSS, and Vite integrations compile every module under a folder that holds an `astryx-swizzle.json` marker with the library prefix into `@layer astryx-base`, so a theme's component overrides reach the copy as they reach the package component. `astryx swizzle` writes the marker into an output folder it owns (one the copy creates, an empty one, or one it marked before), naming each package the folder's copies came from and its version, such as `{"packages": {"@astryxdesign/core": "0.7.10"}}`. To mark a folder that holds only swizzled copies by hand, add that file to it; the build reads only whether the file is there. Keep the product's own components out of a marked folder. Under webpack, use `withAstryx()` with a marked copy: it makes each app module depend on the marker paths above it, so a dev session or a cached build recompiles a copy when its marker appears or disappears. In another setup that caches transforms, restart the dev server and delete that cache after adding or removing a marker. Turbopack builds do not read the marker yet.
### PostCSS plugin (`@astryxdesign/build/postcss`)
diff --git a/packages/cli/api/swizzle/copy/copy.mjs b/packages/cli/api/swizzle/copy/copy.mjs
index 1e6e445344..4b42ecf3ad 100644
--- a/packages/cli/api/swizzle/copy/copy.mjs
+++ b/packages/cli/api/swizzle/copy/copy.mjs
@@ -473,16 +473,51 @@ export async function swizzleCopy(component, options = {}) {
);
}
+ // The marker tells @astryxdesign/build that the output folder holds Astryx
+ // source, so the copy compiles below the theme as the package does.
+ const markerDest = confineWrite(path.join(outputBase, SWIZZLE_MARKER), cwd, {
+ allowAbsolute: true,
+ label: 'output file',
+ });
+ const markerExisting = readExisting(markerDest);
+ const markerContent = swizzleMarkerContent(
+ markerExisting,
+ owner.ownerPackage,
+ ownerVersion,
+ );
+ // Every module under the marker compiles as Astryx source, so swizzle marks
+ // only a folder it owns: one the copy creates, an empty one, or one it
+ // marked before. Any other folder is reported with what it holds.
+ const foundInOutputBase =
+ markerExisting == null &&
+ fs.existsSync(outputBase) &&
+ fs.statSync(outputBase).isDirectory()
+ ? fs.readdirSync(outputBase).sort()
+ : [];
+ const marksOutputBase = foundInOutputBase.length === 0;
+ const writes = marksOutputBase
+ ? [
+ ...outputs,
+ {
+ dest: markerDest,
+ content: markerContent,
+ marker: true,
+ unchanged: markerExisting === markerContent,
+ },
+ ]
+ : outputs;
+
const outputDirExisted = fs.existsSync(outputDir);
/** @type {string[]} folders this run created, outermost first */
const createdDirs = [];
/** @type {Array<{dest: string, original: Buffer|null}>} */
const written = [];
let copied = 0;
- for (const output of outputs) {
+ for (const output of writes) {
+ const counts = !('marker' in output);
// An identical file is already in place: it is part of this copy, unwritten.
if (output.unchanged) {
- copied++;
+ if (counts) copied++;
continue;
}
try {
@@ -491,7 +526,7 @@ export async function swizzleCopy(component, options = {}) {
if (firstCreated != null) createdDirs.push(firstCreated);
written.push({dest: output.dest, original});
fs.writeFileSync(output.dest, output.content);
- copied++;
+ if (counts) copied++;
} catch (err) {
const unrestored = undoCopy(written);
for (const dir of [...createdDirs].reverse()) {
@@ -516,10 +551,44 @@ export async function swizzleCopy(component, options = {}) {
usesStyleX: outputs.some(o => o.content.includes('@stylexjs/stylex')),
dependencies: plan.dependencies,
};
+ data.marker = marksOutputBase
+ ? {path: toPosix(path.relative(cwd, markerDest)), written: true}
+ : {
+ path: toPosix(path.relative(cwd, markerDest)),
+ written: false,
+ found: foundInOutputBase.slice(0, 5),
+ };
if (feedback) data.feedback = feedback;
return {type: 'swizzle.copy', package: data.package, data};
}
+/** The file that marks a swizzle output folder as Astryx source. */
+const SWIZZLE_MARKER = 'astryx-swizzle.json';
+
+/**
+ * The marker's content after a copy from `ownerPackage`: the packages the
+ * folder's copies came from, each with its version. Unreadable content is
+ * replaced.
+ * @param {string|null} existing
+ * @param {string} ownerPackage
+ * @param {string} version
+ * @returns {string}
+ */
+function swizzleMarkerContent(existing, ownerPackage, version) {
+ /** @type {Record<string, string>} */
+ let packages = {};
+ try {
+ const parsed = existing == null ? null : JSON.parse(existing);
+ if (parsed?.packages && typeof parsed.packages === 'object') {
+ packages = {...parsed.packages};
+ }
+ } catch {
+ // Unreadable content is rewritten below.
+ }
+ packages[ownerPackage] = version;
+ return `${JSON.stringify({packages}, null, 2)}\n`;
+}
+
/**
* Undo the writes of a copy that failed part-way, newest first: delete the
* files the copy created and put back the bytes of the files it replaced. A
diff --git a/packages/cli/api/swizzle/swizzle.doc.mjs b/packages/cli/api/swizzle/swizzle.doc.mjs
index a712eee1ae..554a16ab01 100644
--- a/packages/cli/api/swizzle/swizzle.doc.mjs
+++ b/packages/cli/api/swizzle/swizzle.doc.mjs
@@ -21,8 +21,12 @@ export const doc = {
'the owner package exports: names the package exports are imported from its ' +
'public paths, and every internal module the component needs is ' +
"copied beside it in the package's folder layout. Tests, stories and docs are not " +
- 'copied. The receipt flags whether any copied file uses StyleX and lists each npm ' +
- 'package the copy imports with the range the owner package declares. With no name ' +
+ 'copied. An output folder swizzle owns (one the copy creates, an empty one, or one it ' +
+ 'marked before) gets an astryx-swizzle.json marker naming each package its copies came from, ' +
+ "with its version, so @astryxdesign/build's Babel, PostCSS and Vite integrations, and " +
+ 'withAstryx() under webpack, compile the copy below the theme. The receipt flags whether ' +
+ 'any copied file uses StyleX and lists each npm package the copy imports with the range ' +
+ 'the owner package declares. With no name ' +
'(or list) it returns the swizzlable component names instead. An integration ' +
'component that replaces a Core component is what that Core name copies; ' +
"options.package '@astryxdesign/core' copies the original. The list names Core " +
@@ -81,7 +85,7 @@ export const doc = {
{
type: 'swizzle.copy',
description:
- 'A receipt after copying the component into the project: the component name, owning package, output directory, files-copied count, the copied file names (relative to the component folder; the internal modules copied beside it start with `../`, e.g. `../InputGroup/groupStyles.ts`), whether any file uses StyleX, and, when the owner has an issues URL, feedback ({issuesUrl, ghCommand?}): where to report the gap that led to swizzling.',
+ 'A receipt after copying the component into the project: the component name, owning package, output directory, files-copied count, the copied file names (relative to the component folder; the internal modules copied beside it start with `../`, e.g. `../InputGroup/groupStyles.ts`), whether any file uses StyleX, the npm packages the copy imports with the ranges the owner declares (dependencies), the output folder\'s astryx-swizzle.json (marker: {path, written, found?}; written is false for a folder swizzle does not own, and found names up to five entries it already holds), and, when the owner has an issues URL, feedback ({issuesUrl, ghCommand?}): where to report the gap that led to swizzling.',
},
],
throws: [
diff --git a/packages/cli/api/swizzle/swizzle.type.mjs b/packages/cli/api/swizzle/swizzle.type.mjs
index 75868e04c4..0796a36fd5 100644
--- a/packages/cli/api/swizzle/swizzle.type.mjs
+++ b/packages/cli/api/swizzle/swizzle.type.mjs
@@ -37,6 +37,7 @@
* @property {string[]} data.files Copied file names, relative to the component folder; the internal modules copied beside it start with `../` (spec:AST-110 FR2).
* @property {boolean} data.usesStyleX Whether any copied file uses StyleX (requires build-time setup).
* @property {Record<string, string>} data.dependencies Each npm package the copied files import, other than the owner package, with the version range the owner package declares (`*` when it declares none). The copy builds once the product installs them (spec:AST-110 FR1).
+ * @property {{path: string, written: boolean, found?: string[]}} [data.marker] The output folder's astryx-swizzle.json, relative to the project (spec:AST-110 FR5). Swizzle writes it only into a folder it owns: one the copy creates, an empty one, or one it marked before. When it does not, `written` is false and `found` names up to five entries already in the folder.
* @property {SwizzleFeedback} [data.feedback]
*/
diff --git a/packages/cli/assets/docs/styling-overview.doc.mjs b/packages/cli/assets/docs/styling-overview.doc.mjs
index 99c853dc24..5d8d5087ef 100644
--- a/packages/cli/assets/docs/styling-overview.doc.mjs
+++ b/packages/cli/assets/docs/styling-overview.doc.mjs
@@ -160,6 +160,10 @@ export const docs = {
type: 'prose',
text: 'If a swizzled component fails at runtime with a `stylex.create` error, the app is missing a StyleX compiler: see the StyleX Build Setup section of {@link generic:tokens-and-setup}.',
},
+ {
+ type: 'prose',
+ text: '`{@command swizzle <Component>}` writes an `astryx-swizzle.json` marker into an output folder it owns (one the copy creates, an empty one, or one it marked before); every module under that folder then compiles as Astryx source, so keep copies in a folder of their own, such as the default `components/astryx`. For a folder that already holds other files it writes no marker and says how to add one by hand. With `@astryxdesign/build`\'s Babel, PostCSS and Vite integrations, or `withAstryx()` under webpack, a copy under that folder compiles into `astryx-base`, below `astryx-theme`, so theme component overrides reach it as they reach the package component. Under Turbopack, and with the stock StyleX plugins above, a copy\'s rules land in your own styles, above `astryx-theme`, and theme component overrides do not reach it.',
+ },
],
},
{
diff --git a/packages/cli/clients/cli/commands/swizzle.doc.mjs b/packages/cli/clients/cli/commands/swizzle.doc.mjs
index 617917cd87..cc8911a15a 100644
--- a/packages/cli/clients/cli/commands/swizzle.doc.mjs
+++ b/packages/cli/clients/cli/commands/swizzle.doc.mjs
@@ -22,6 +22,10 @@ export const doc = {
"is copied beside it in the package's folder layout. " +
'Tests, stories and docs are not copied. It lists the npm packages the copy imports, ' +
'with the ranges the owner package declares, to install if your project lacks them. ' +
+ 'An output folder swizzle owns (one the copy ' +
+ 'creates, an empty one, or one it marked before) gets an astryx-swizzle.json marker naming ' +
+ "each package its copies came from, so @astryxdesign/build's Babel, PostCSS and Vite " +
+ 'integrations, and withAstryx() under webpack, compile the copy below your theme. ' +
'With no name it lists the swizzlable components. ' +
'An integration component that replaces a Core component is what that Core name ' +
'copies; --package @astryxdesign/core copies the original. --list lists Core ' +
diff --git a/packages/cli/clients/cli/commands/swizzle.mjs b/packages/cli/clients/cli/commands/swizzle.mjs
index 7aca687ba2..c4f35d68dc 100644
--- a/packages/cli/clients/cli/commands/swizzle.mjs
+++ b/packages/cli/clients/cli/commands/swizzle.mjs
@@ -113,6 +113,18 @@ export function registerSwizzle(program) {
);
}
+ const {marker} = result.data;
+ if (marker) {
+ const folder = marker.path.replace(/\/?astryx-swizzle\.json$/, '') || '.';
+ out.push(
+ text(
+ marker.written
+ ? `Marked ${folder}/ with astryx-swizzle.json: with @astryxdesign/build's Babel, PostCSS and Vite integrations, or withAstryx() under webpack, every module under it compiles below your theme, so theme overrides reach the copy. Keep only swizzled copies there. Turbopack does not read the marker yet.`
+ : `Did not mark ${folder}/ with astryx-swizzle.json: it already holds ${(marker.found ?? []).join(', ')} and no astryx-swizzle.json. If it holds only swizzled copies, add ${marker.path} to mark it, so theme overrides reach them; keep the product's own components out of a marked folder.`,
+ ),
+ );
+ }
+
// StyleX build requirement — swizzled StyleX source throws on import
// ("Unexpected 'stylex.create' call at runtime") unless the consumer's
// build runs a StyleX compiler, so the page does not render at all.
diff --git a/packages/cli/clients/cli/commands/swizzle.routing.test.mjs b/packages/cli/clients/cli/commands/swizzle.routing.test.mjs
index 6528ce1543..07348bc407 100644
--- a/packages/cli/clients/cli/commands/swizzle.routing.test.mjs
+++ b/packages/cli/clients/cli/commands/swizzle.routing.test.mjs
@@ -198,6 +198,86 @@ describe('swizzle — the npm packages a copy imports', () => {
});
});
+describe('swizzle — the astryx-swizzle.json marker', () => {
+ it('marks the output folder with each package the copies came from and its version', async () => {
+ buildFakeCore(project);
+ writeProjectPackageJson(project);
+ buildIntegration(project, {issuesUrl: 'https://example.com/meta/issues'});
+ const marker = path.join(project, 'components', 'astryx', 'astryx-swizzle.json');
+
+ const core = await runCli(['--json', 'swizzle', 'Button', '-f'], project);
+ expect(core.code).toBe(0);
+ expect(JSON.parse(fs.readFileSync(marker, 'utf-8'))).toEqual({
+ packages: {'@astryxdesign/core': '0.0.13'},
+ });
+ // The marker is not one of the copy's files.
+ const coreEnv = JSON.parse(core.stdout);
+ expect(coreEnv.data.files.some(f => f.includes('astryx-swizzle'))).toBe(false);
+ expect(coreEnv.data.marker).toEqual({path: 'components/astryx/astryx-swizzle.json', written: true});
+
+ const integration = await runCli(['--json', 'swizzle', 'MetaAppShell', '-f'], project);
+ expect(integration.code).toBe(0);
+ expect(JSON.parse(fs.readFileSync(marker, 'utf-8'))).toEqual({
+ packages: {'@astryxdesign/core': '0.0.13', '@test/meta': '1.2.3'},
+ });
+ });
+
+ it('does not mark a folder that holds files swizzle did not write, and says how to add the marker', async () => {
+ buildFakeCore(project);
+ writeProjectPackageJson(project);
+ // The product's own components live in src/components.
+ fs.mkdirSync(path.join(project, 'src', 'components'), {recursive: true});
+ fs.writeFileSync(path.join(project, 'src', 'components', 'Header.tsx'), `export const Header = 1;\n`);
+
+ const json = await runCli(['--json', 'swizzle', 'Button', '--output', 'src/components', '-f'], project);
+ expect(json.code).toBe(0);
+ expect(JSON.parse(json.stdout).data.marker).toEqual({
+ path: 'src/components/astryx-swizzle.json',
+ written: false,
+ found: ['Header.tsx'],
+ });
+ expect(fs.existsSync(path.join(project, 'src', 'components', 'astryx-swizzle.json'))).toBe(false);
+
+ const text = await runCli(['swizzle', 'Button', '--output', 'src/components', '-f'], project);
+ expect(text.stdout).toContain(
+ 'Did not mark src/components/ with astryx-swizzle.json: it already holds Button, Header.tsx and no astryx-swizzle.json',
+ );
+ expect(text.stdout).toContain('add src/components/astryx-swizzle.json to mark it');
+ });
+
+ it('leaves a folder of earlier copies unmarked on re-swizzle, and names what it holds', async () => {
+ buildFakeCore(project);
+ writeProjectPackageJson(project);
+ // Copies from a swizzle that wrote no marker.
+ fs.mkdirSync(path.join(project, 'components', 'astryx', 'Button'), {recursive: true});
+ fs.writeFileSync(path.join(project, 'components', 'astryx', 'Button', 'Button.tsx'), `export const Button = 1;\n`);
+
+ const result = await runCli(['swizzle', 'Button', '-f'], project);
+ expect(result.code).toBe(0);
+ expect(fs.existsSync(path.join(project, 'components', 'astryx', 'astryx-swizzle.json'))).toBe(false);
+ expect(result.stdout).toContain('it already holds Button and no astryx-swizzle.json');
+ expect(result.stdout).toContain('add components/astryx/astryx-swizzle.json to mark it');
+ });
+
+ it('reports a write failure when the output path is a file', async () => {
+ buildFakeCore(project);
+ writeProjectPackageJson(project);
+ fs.writeFileSync(path.join(project, 'notes.txt'), 'notes\n');
+ const result = await runCli(['--json', 'swizzle', 'Button', '--output', 'notes.txt'], project);
+ expect(result.code).not.toBe(0);
+ expect(JSON.parse(result.stdout).code).toBe('ERR_WRITE_FAILED');
+ });
+
+ it('marks a folder the copy creates, and says what the marker does', async () => {
+ buildFakeCore(project);
+ writeProjectPackageJson(project);
+ const result = await runCli(['swizzle', 'Button', '--output', 'src/astryx', '-f'], project);
+ expect(result.code).toBe(0);
+ expect(fs.existsSync(path.join(project, 'src', 'astryx', 'astryx-swizzle.json'))).toBe(true);
+ expect(result.stdout).toContain('Marked src/astryx/ with astryx-swizzle.json');
+ });
+});
+
describe('swizzle — integration-owned components', () => {
it('copies the component and the unexported helper it imports, without its test or doc, and routes feedback to the integration issuesUrl', async () => {
buildFakeCore(project);
diff --git a/packages/cli/clients/cli/commands/write-failure.test.mjs b/packages/cli/clients/cli/commands/write-failure.test.mjs
index 9f71634c3d..fb621358ee 100644
--- a/packages/cli/clients/cli/commands/write-failure.test.mjs
+++ b/packages/cli/clients/cli/commands/write-failure.test.mjs
@@ -146,6 +146,8 @@ describe.skipIf(asRoot)('a swizzle that fails part-way undoes what it wrote', ()
for (const file of middle) {
expect(fs.existsSync(path.join(outDir, file))).toBe(false);
}
+ // The marker is written last, so a failed copy leaves none.
+ expect(fs.existsSync(path.join(dir, 'out', 'astryx-swizzle.json'))).toBe(false);
});
it('undoes the copy when a destination cannot be read back', async () => {
diff --git a/packages/cli/test/__golden__/no-icon-set/docs-topics.json b/packages/cli/test/__golden__/no-icon-set/docs-topics.json
index 205d92ef48..ee2f38c7f1 100644
--- a/packages/cli/test/__golden__/no-icon-set/docs-topics.json
+++ b/packages/cli/test/__golden__/no-icon-set/docs-topics.json
@@ -249,7 +249,7 @@
"what-each-file-does",
"further-reading"
],
- "skeleton": "2bb79103d25e7b1f1a0cb160776a00d871056f95a6b8a728bb5c4c487475a25f",
+ "skeleton": "ef4e4158ed2cdf854f1136340b28822987012bda257287dff750fea105ec5d8d",
"mentions": []
},
"theme": {