From 6fbdf6adf0b5b0c1e7890cc347d9d784175065d8 Mon Sep 17 00:00:00 2001 From: Krzysztof Sakwerda Date: Thu, 18 Jul 2024 13:09:29 +0200 Subject: [PATCH 1/2] fix: correct path to the `@storybook/theming/create` alias The path to the `@storybook/theming/create` included `package.json` which made it impossible to resolve the alias. ``` '@storybook/theming/create': '/node_modules/storybook/package.json/core/theming/create.js', ``` '@storybook/theming/create': '/node_modules/storybook/core/theming/create.js', --- code/addons/docs/src/preset.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts index 0ad19b34bd58..5c6ebfae958e 100644 --- a/code/addons/docs/src/preset.ts +++ b/code/addons/docs/src/preset.ts @@ -70,7 +70,7 @@ async function webpack( */ const cliPath = require.resolve('storybook/package.json'); const themingPath = join(cliPath, '..', 'core', 'theming', 'index.js'); - const themingCreatePath = join(cliPath, 'core', 'theming', 'create.js'); + const themingCreatePath = join(cliPath, '..', 'core', 'theming', 'create.js'); const componentsPath = join(cliPath, '..', 'core', 'components', 'index.js'); const blocksPath = dirname(require.resolve('@storybook/blocks/package.json')); From 57d0cd7ddb447920309e02d094eb2f525d3e97d3 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 19 Jul 2024 12:27:22 +0200 Subject: [PATCH 2/2] consistency --- code/addons/docs/src/preset.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts index 5c6ebfae958e..8d359204c227 100644 --- a/code/addons/docs/src/preset.ts +++ b/code/addons/docs/src/preset.ts @@ -68,11 +68,11 @@ async function webpack( * * In the future the `@storybook/theming` and `@storybook/components` can be removed, as they should be singletons in the future due to the peerDependency on `storybook` package. */ - const cliPath = require.resolve('storybook/package.json'); - const themingPath = join(cliPath, '..', 'core', 'theming', 'index.js'); - const themingCreatePath = join(cliPath, '..', 'core', 'theming', 'create.js'); + const cliPath = dirname(require.resolve('storybook/package.json')); + const themingPath = join(cliPath, 'core', 'theming', 'index.js'); + const themingCreatePath = join(cliPath, 'core', 'theming', 'create.js'); - const componentsPath = join(cliPath, '..', 'core', 'components', 'index.js'); + const componentsPath = join(cliPath, 'core', 'components', 'index.js'); const blocksPath = dirname(require.resolve('@storybook/blocks/package.json')); if (Array.isArray(webpackConfig.resolve?.alias)) { alias = [...webpackConfig.resolve?.alias];