Merge pull request #18805 from abdlqader/feat/lib-addons-to-tsup

Build lib/addons with ts-up
This commit is contained in:
Norbert de Langen 2022-09-27 10:24:52 +03:00 committed by GitHub
commit c548f34399
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 38 additions and 9 deletions

View File

@ -1,3 +1,5 @@
/// <reference types="webpack-env" />
import type { AnyFramework, DecoratorFunction } from '@storybook/csf'; import type { AnyFramework, DecoratorFunction } from '@storybook/csf';
import deprecate from 'util-deprecate'; import deprecate from 'util-deprecate';
import { dedent } from 'ts-dedent'; import { dedent } from 'ts-dedent';

View File

@ -1,3 +1,5 @@
/// <reference types="webpack-env" />
export * from './constants'; export * from './constants';
export * from './models'; export * from './models';
export * from './preview'; export * from './preview';

View File

@ -1,3 +1,5 @@
/// <reference types="webpack-env" />
if (module && module.hot && module.hot.decline) { if (module && module.hot && module.hot.decline) {
module.hot.decline(); module.hot.decline();
} }

View File

@ -1,3 +1,5 @@
/// <reference types="webpack-env" />
import { addons } from '@storybook/addons'; import { addons } from '@storybook/addons';
import { normalize, sep } from 'upath'; import { normalize, sep } from 'upath';
import { ADD_TESTS, defineJestParameter } from './shared'; import { ADD_TESTS, defineJestParameter } from './shared';

View File

@ -1,3 +1,5 @@
/// <reference types="webpack-env" />
import { dedent } from 'ts-dedent'; import { dedent } from 'ts-dedent';
let hasWarned = false; let hasWarned = false;

View File

@ -1,3 +1,5 @@
/// <reference types="webpack-env" />
if (module && module.hot && module.hot.decline) { if (module && module.hot && module.hot.decline) {
module.hot.decline(); module.hot.decline();
} }

View File

@ -1,3 +1,5 @@
/// <reference types="webpack-env" />
if (module && module.hot && module.hot.decline) { if (module && module.hot && module.hot.decline) {
module.hot.decline(); module.hot.decline();
} }

View File

@ -1,3 +1,5 @@
/// <reference types="webpack-env" />
import { ADDON_ID, PANEL_ID } from './events'; import { ADDON_ID, PANEL_ID } from './events';
export { ADDON_ID, PANEL_ID }; export { ADDON_ID, PANEL_ID };

View File

@ -20,9 +20,17 @@
}, },
"license": "MIT", "license": "MIT",
"sideEffects": false, "sideEffects": false,
"main": "dist/cjs/index.js", "exports": {
"module": "dist/esm/index.js", ".": {
"types": "dist/types/index.d.ts", "require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"./package.json": "./package.json"
},
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [ "files": [
"dist/**/*", "dist/**/*",
"README.md", "README.md",
@ -31,7 +39,7 @@
], ],
"scripts": { "scripts": {
"check": "../../../scripts/node_modules/.bin/tsc --noEmit", "check": "../../../scripts/node_modules/.bin/tsc --noEmit",
"prep": "node ../../../scripts/prepare.js" "prep": "../../../scripts/prepare/bundle.ts"
}, },
"dependencies": { "dependencies": {
"@storybook/api": "7.0.0-alpha.34", "@storybook/api": "7.0.0-alpha.34",
@ -50,5 +58,10 @@
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
"bundler": {
"entries": [
"./src/index.ts"
]
},
"gitHead": "fc90fc875462421c1faa35862ac4bc436de8e75f" "gitHead": "fc90fc875462421c1faa35862ac4bc436de8e75f"
} }

View File

@ -215,13 +215,13 @@ export default {
'@storybook/addons': [ '@storybook/addons': [
'AddonStore', 'AddonStore',
'Channel', 'Channel',
'addons',
'makeDecorator',
'isSupportedType',
'types',
'mockChannel',
'HooksContext', 'HooksContext',
'addons',
'applyHooks', 'applyHooks',
'isSupportedType',
'makeDecorator',
'mockChannel',
'types',
'useArgs', 'useArgs',
'useCallback', 'useCallback',
'useChannel', 'useChannel',