Skip to content

Commit

Permalink
Merge pull request #24038 from storybookjs/yann/fix-cjs-entries-on-co…
Browse files Browse the repository at this point in the history
…re-events

Core: Add CJS entrypoints to errors in core events
(cherry picked from commit 509dc79)
  • Loading branch information
shilman authored and storybook-bot committed Sep 8, 2023
1 parent 4c80e05 commit 27a0887
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/lib/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"@ndelangen/get-tarball": "^3.0.7",
"@storybook/codemod": "workspace:*",
"@storybook/core-common": "workspace:*",
"@storybook/core-events": "workspace:*",
"@storybook/core-server": "workspace:*",
"@storybook/csf-tools": "workspace:*",
"@storybook/node-logger": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions code/lib/core-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/core-events": "workspace:*",
"@storybook/node-logger": "workspace:*",
"@storybook/types": "workspace:*",
"@types/find-cache-dir": "^3.2.1",
Expand Down
4 changes: 4 additions & 0 deletions code/lib/core-events/manager-errors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This is required for projects that require paths such as `@storybook/core-events/manager-errors`
// but in CJS, while not in ESM mode. Else an error like this will occur:
// ENOENT: no such file or directory, open '/xyz/node_modules/@storybook/core-events/manager-errors.js'
module.exports = require('./dist/errors/manager-errors');
4 changes: 4 additions & 0 deletions code/lib/core-events/preview-errors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This is required for projects that require paths such as `@storybook/core-events/preview-errors`
// but in CJS, while not in ESM mode. Else an error like this will occur:
// ENOENT: no such file or directory, open '/xyz/node_modules/@storybook/core-events/preview-errors.js'
module.exports = require('./dist/errors/preview-errors');
4 changes: 4 additions & 0 deletions code/lib/core-events/server-errors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This is required for projects that require paths such as `@storybook/core-events/server-errors`
// but in CJS, while not in ESM mode. Else an error like this will occur:
// ENOENT: no such file or directory, open '/xyz/node_modules/@storybook/core-events/server-errors.js'
module.exports = require('./dist/errors/server-errors');
2 changes: 2 additions & 0 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6571,6 +6571,7 @@ __metadata:
"@storybook/client-api": "workspace:*"
"@storybook/codemod": "workspace:*"
"@storybook/core-common": "workspace:*"
"@storybook/core-events": "workspace:*"
"@storybook/core-server": "workspace:*"
"@storybook/csf-tools": "workspace:*"
"@storybook/node-logger": "workspace:*"
Expand Down Expand Up @@ -6719,6 +6720,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/core-common@workspace:lib/core-common"
dependencies:
"@storybook/core-events": "workspace:*"
"@storybook/node-logger": "workspace:*"
"@storybook/types": "workspace:*"
"@types/find-cache-dir": ^3.2.1
Expand Down

0 comments on commit 27a0887

Please sign in to comment.