From 2b97cf8730a2bb9a7e8fa1de1b12dfa14aac921e Mon Sep 17 00:00:00 2001 From: Saunved Date: Sun, 24 Jul 2022 01:48:29 +0530 Subject: [PATCH 1/5] Build addons/actions with tsup Ref: https://github.com/storybookjs/storybook/issues/18732 --- addons/actions/manager.js | 2 +- addons/actions/package.json | 28 +++++++++++++++++++++++++++- addons/actions/preview.js | 2 +- yarn.lock | 1 + 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/addons/actions/manager.js b/addons/actions/manager.js index 4e287d25b151..8a2eae4ffce1 100644 --- a/addons/actions/manager.js +++ b/addons/actions/manager.js @@ -1 +1 @@ -import './dist/esm/manager'; +import './dist/manager'; diff --git a/addons/actions/package.json b/addons/actions/package.json index f02bab04ca01..028a40af8804 100644 --- a/addons/actions/package.json +++ b/addons/actions/package.json @@ -21,6 +21,24 @@ "url": "https://opencollective.com/storybook" }, "license": "MIT", + "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" + }, + "./register": { + "require": "./dist/manager.js", + "import": "./dist/manager.mjs", + "types": "./dist/manager.d.ts" + }, + "./package.json": "./package.json" + }, "main": "dist/cjs/index.js", "module": "dist/esm/index.js", "types": "dist/types/index.d.ts", @@ -32,9 +50,10 @@ ], "scripts": { "check": "tsc --noEmit", - "prepare": "node ../../scripts/prepare.js" + "prepare": "esrun ../../scripts/prepare/bundle.ts" }, "dependencies": { + "@digitak/esrun": "^3.2.2", "@storybook/addons": "7.0.0-alpha.13", "@storybook/api": "7.0.0-alpha.13", "@storybook/client-logger": "7.0.0-alpha.13", @@ -73,6 +92,13 @@ "publishConfig": { "access": "public" }, + "bundler": { + "entries": [ + "./src/index.ts", + "./src/manager.tsx", + "./src/preset/preview.tsx" + ] + }, "gitHead": "9ac4d2e0a05eb945713a0e6689abc3b12359e181", "storybook": { "displayName": "Actions", diff --git a/addons/actions/preview.js b/addons/actions/preview.js index 7817e1d278d2..94710963e2f7 100644 --- a/addons/actions/preview.js +++ b/addons/actions/preview.js @@ -1 +1 @@ -export * from './dist/esm/preset/preview'; +import './dist/preset/preview'; diff --git a/yarn.lock b/yarn.lock index c088b4aaa746..6a949fbe3567 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6875,6 +6875,7 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-actions@workspace:addons/actions" dependencies: + "@digitak/esrun": ^3.2.2 "@storybook/addons": 7.0.0-alpha.13 "@storybook/api": 7.0.0-alpha.13 "@storybook/client-logger": 7.0.0-alpha.13 From d26425f8e14504d5d215c6cd23f486f2af5be322 Mon Sep 17 00:00:00 2001 From: Saunved Date: Sun, 24 Jul 2022 01:54:32 +0530 Subject: [PATCH 2/5] Update package.json references --- addons/actions/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/actions/package.json b/addons/actions/package.json index 028a40af8804..2c16784e466d 100644 --- a/addons/actions/package.json +++ b/addons/actions/package.json @@ -39,9 +39,9 @@ }, "./package.json": "./package.json" }, - "main": "dist/cjs/index.js", - "module": "dist/esm/index.js", - "types": "dist/types/index.d.ts", + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", "files": [ "dist/**/*", "README.md", From 43970fe0bc8374fded1f1bf43d002f32f209ff5a Mon Sep 17 00:00:00 2001 From: Saunved Date: Thu, 11 Aug 2022 11:20:28 -0700 Subject: [PATCH 3/5] Fix register.js export --- code/addons/actions/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index 5a260c68982a..b1072697e69f 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -32,7 +32,7 @@ "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" }, - "./register": { + "./register.js": { "require": "./dist/manager.js", "import": "./dist/manager.mjs", "types": "./dist/manager.d.ts" From b54c60c4d652295f056b4b2b30b41ef439051d82 Mon Sep 17 00:00:00 2001 From: Saunved Date: Thu, 11 Aug 2022 12:42:21 -0700 Subject: [PATCH 4/5] Add preview to exports --- code/addons/actions/package.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index b1072697e69f..db0fe0446a78 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -32,6 +32,11 @@ "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", From 0c8bd9d4fa3cd0c9d0a07e562423accfec5c3570 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 12 Aug 2022 01:59:23 +0200 Subject: [PATCH 5/5] fix by removing a deprecated feature.. hmmm odd! --- code/lib/channel-postmessage/src/index.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/code/lib/channel-postmessage/src/index.ts b/code/lib/channel-postmessage/src/index.ts index 46bed82a1d5d..2d697ddf6908 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 });