Skip to content

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

TypeScript

test(cli): resolve-theme's icon-registry case links stone's dependencies (#9952)

Christopher Chedeau1181a20f9101
diff --git a/packages/cli/clients/cli/lib/resolve-theme.test.mjs b/packages/cli/clients/cli/lib/resolve-theme.test.mjs
index a67025aad0..b4240ddc40 100644
--- a/packages/cli/clients/cli/lib/resolve-theme.test.mjs
+++ b/packages/cli/clients/cli/lib/resolve-theme.test.mjs
@@ -410,11 +410,19 @@ describe('resolveTheme source precedence', () => {
type: 'module',
dependencies: {'@astryxdesign/core': '*'},
});
- fs.symlinkSync(
- path.join(process.cwd(), 'node_modules'),
- path.join(dir, 'node_modules'),
- 'dir',
+ // The ejected theme imports what the stone package declares. So the app
+ // links stone's dependencies, not those of the folder the run starts in.
+ const stoneModules = path.resolve(
+ import.meta.dirname,
+ '../../../../themes/stone/node_modules',
);
+ // Stone's dev install links the workspace Core, which this case builds with.
+ expect(
+ fs.realpathSync(path.join(stoneModules, '@astryxdesign', 'core')),
+ ).toBe(
+ fs.realpathSync(path.resolve(import.meta.dirname, '../../../../core')),
+ );
+ fs.symlinkSync(stoneModules, path.join(dir, 'node_modules'), 'dir');
fs.mkdirSync(path.join(dir, 'src'));
fs.writeFileSync(path.join(dir, 'tsconfig.json'), '{}\n');