diff --git a/code/addons/actions/manager.js b/code/addons/actions/manager.js index 4e287d25b15..8a2eae4ffce 100644 --- a/code/addons/actions/manager.js +++ b/code/addons/actions/manager.js @@ -1 +1 @@ -import './dist/esm/manager'; +import './dist/manager'; diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index 97d390dbda9..e4a1fe1a385 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -21,9 +21,32 @@ "url": "https://opencollective.com/storybook" }, "license": "MIT", - "main": "dist/cjs/index.js", - "module": "dist/esm/index.js", - "types": "dist/types/index.d.ts", + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./manager": { + "require": "./dist/manager.js", + "import": "./dist/manager.mjs", + "types": "./dist/manager.d.ts" + }, + "./preview": { + "require": "./dist/preview.js", + "import": "./dist/preview.mjs", + "types": "./dist/preview.d.ts" + }, + "./register.js": { + "require": "./dist/manager.js", + "import": "./dist/manager.mjs", + "types": "./dist/manager.d.ts" + }, + "./package.json": "./package.json" + }, + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", "files": [ "dist/**/*", "README.md", @@ -32,7 +55,7 @@ ], "scripts": { "check": "../../../scripts/node_modules/.bin/tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.34", @@ -72,6 +95,13 @@ "publishConfig": { "access": "public" }, + "bundler": { + "entries": [ + "./src/index.ts", + "./src/manager.tsx", + "./src/preview.ts" + ] + }, "gitHead": "fc90fc875462421c1faa35862ac4bc436de8e75f", "storybook": { "displayName": "Actions", diff --git a/code/addons/actions/preview.js b/code/addons/actions/preview.js index 7817e1d278d..49ad602f79f 100644 --- a/code/addons/actions/preview.js +++ b/code/addons/actions/preview.js @@ -1 +1 @@ -export * from './dist/esm/preset/preview'; +export * from './dist/preview'; diff --git a/code/addons/actions/src/preset/addArgs.ts b/code/addons/actions/src/addArgs.ts similarity index 100% rename from code/addons/actions/src/preset/addArgs.ts rename to code/addons/actions/src/addArgs.ts diff --git a/code/addons/actions/src/preset/addArgsHelpers.test.ts b/code/addons/actions/src/addArgsHelpers.test.ts similarity index 100% rename from code/addons/actions/src/preset/addArgsHelpers.test.ts rename to code/addons/actions/src/addArgsHelpers.test.ts diff --git a/code/addons/actions/src/preset/addArgsHelpers.ts b/code/addons/actions/src/addArgsHelpers.ts similarity index 97% rename from code/addons/actions/src/preset/addArgsHelpers.ts rename to code/addons/actions/src/addArgsHelpers.ts index 45b5207d6e6..c375c03fdb1 100644 --- a/code/addons/actions/src/preset/addArgsHelpers.ts +++ b/code/addons/actions/src/addArgsHelpers.ts @@ -1,5 +1,5 @@ import type { Args, AnyFramework, ArgsEnhancer } from '@storybook/csf'; -import { action } from '../index'; +import { action } from './runtime/action'; // interface ActionsParameter { // disable?: boolean; diff --git a/code/addons/actions/src/addDecorator.ts b/code/addons/actions/src/addDecorator.ts new file mode 100644 index 00000000000..4318a96ebad --- /dev/null +++ b/code/addons/actions/src/addDecorator.ts @@ -0,0 +1,3 @@ +import { withActions } from './runtime/withActions'; + +export const decorators = [withActions]; diff --git a/code/addons/actions/src/index.ts b/code/addons/actions/src/index.ts index 221afdabf34..af315cb7543 100644 --- a/code/addons/actions/src/index.ts +++ b/code/addons/actions/src/index.ts @@ -2,7 +2,7 @@ export * from './constants'; export * from './models'; -export * from './preview'; +export * from './runtime'; if (module && module.hot && module.hot.decline) { module.hot.decline(); diff --git a/code/addons/actions/src/preset/addDecorator.ts b/code/addons/actions/src/preset/addDecorator.ts deleted file mode 100644 index f0044588cc2..00000000000 --- a/code/addons/actions/src/preset/addDecorator.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { withActions } from '../index'; - -export const decorators = [withActions]; diff --git a/code/addons/actions/src/preset/preview.tsx b/code/addons/actions/src/preview.ts similarity index 100% rename from code/addons/actions/src/preset/preview.tsx rename to code/addons/actions/src/preview.ts diff --git a/code/addons/actions/src/preview/__tests__/action.test.js b/code/addons/actions/src/runtime/__tests__/action.test.js similarity index 100% rename from code/addons/actions/src/preview/__tests__/action.test.js rename to code/addons/actions/src/runtime/__tests__/action.test.js diff --git a/code/addons/actions/src/preview/__tests__/actions.test.js b/code/addons/actions/src/runtime/__tests__/actions.test.js similarity index 100% rename from code/addons/actions/src/preview/__tests__/actions.test.js rename to code/addons/actions/src/runtime/__tests__/actions.test.js diff --git a/code/addons/actions/src/preview/__tests__/configureActions.test.js b/code/addons/actions/src/runtime/__tests__/configureActions.test.js similarity index 100% rename from code/addons/actions/src/preview/__tests__/configureActions.test.js rename to code/addons/actions/src/runtime/__tests__/configureActions.test.js diff --git a/code/addons/actions/src/preview/action.ts b/code/addons/actions/src/runtime/action.ts similarity index 100% rename from code/addons/actions/src/preview/action.ts rename to code/addons/actions/src/runtime/action.ts diff --git a/code/addons/actions/src/preview/actions.ts b/code/addons/actions/src/runtime/actions.ts similarity index 100% rename from code/addons/actions/src/preview/actions.ts rename to code/addons/actions/src/runtime/actions.ts diff --git a/code/addons/actions/src/preview/configureActions.ts b/code/addons/actions/src/runtime/configureActions.ts similarity index 100% rename from code/addons/actions/src/preview/configureActions.ts rename to code/addons/actions/src/runtime/configureActions.ts diff --git a/code/addons/actions/src/preview/decorateAction.ts b/code/addons/actions/src/runtime/decorateAction.ts similarity index 100% rename from code/addons/actions/src/preview/decorateAction.ts rename to code/addons/actions/src/runtime/decorateAction.ts diff --git a/code/addons/actions/src/preview/index.ts b/code/addons/actions/src/runtime/index.ts similarity index 100% rename from code/addons/actions/src/preview/index.ts rename to code/addons/actions/src/runtime/index.ts diff --git a/code/addons/actions/src/preview/withActions.ts b/code/addons/actions/src/runtime/withActions.ts similarity index 100% rename from code/addons/actions/src/preview/withActions.ts rename to code/addons/actions/src/runtime/withActions.ts diff --git a/code/lib/channel-postmessage/src/index.ts b/code/lib/channel-postmessage/src/index.ts index 46bed82a1d5..2d697ddf690 100644 --- a/code/lib/channel-postmessage/src/index.ts +++ b/code/lib/channel-postmessage/src/index.ts @@ -98,11 +98,6 @@ export class PostmsgTransport { ...eventOptions, }; - // backwards compat: convert depth to maxDepth - if (options && Number.isInteger(options.depth)) { - stringifyOptions.maxDepth = options.depth; - } - const frames = this.getFrames(target); const query = qs.parse(location.search, { ignoreQueryPrefix: true });