Skip to content

Commit

Permalink
Merge pull request #18775 from storybookjs/feat/addons-actions-tsup
Browse files Browse the repository at this point in the history
Build addons-actions with ts-up
  • Loading branch information
ndelangen committed Sep 27, 2022
2 parents 88876b8 + 40aadb9 commit b42f0ed
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 16 deletions.
2 changes: 1 addition & 1 deletion code/addons/actions/manager.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import './dist/esm/manager';
import './dist/manager';
38 changes: 34 additions & 4 deletions code/addons/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -72,6 +95,13 @@
"publishConfig": {
"access": "public"
},
"bundler": {
"entries": [
"./src/index.ts",
"./src/manager.tsx",
"./src/preview.ts"
]
},
"gitHead": "fc90fc875462421c1faa35862ac4bc436de8e75f",
"storybook": {
"displayName": "Actions",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/preview.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './dist/esm/preset/preview';
export * from './dist/preview';
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 3 additions & 0 deletions code/addons/actions/src/addDecorator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { withActions } from './runtime/withActions';

export const decorators = [withActions];
2 changes: 1 addition & 1 deletion code/addons/actions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 0 additions & 3 deletions code/addons/actions/src/preset/addDecorator.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions code/lib/channel-postmessage/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit b42f0ed

Please sign in to comment.