diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index a62f4496c2b..382c1a0b966 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -59,7 +59,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addon-highlight": "7.0.0-alpha.28", diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index b8752bef277..8d7c1982578 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -32,7 +32,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index 7f1ac0c9db4..38ce21c03a0 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -59,7 +59,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index 2b668f48acb..aeefefc54a2 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -54,7 +54,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 397a75d0113..d109233ccad 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -46,7 +46,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@babel/plugin-transform-react-jsx": "^7.12.12", diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index f25c1d6a7d1..bf7577c86e4 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -30,7 +30,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/addon-actions": "7.0.0-alpha.28", diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 106d246b2e6..07b27e3d072 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -34,7 +34,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index 71a20c31bbb..13f66088777 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -32,7 +32,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@devtools-ds/object-inspector": "^1.1.2", diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index fc5cddd934f..642a75b6f13 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -56,7 +56,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/addons/links/package.json b/code/addons/links/package.json index 577ae135f50..b91bab71a46 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -60,7 +60,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index ac0a58e85bc..d941f5c964e 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -58,7 +58,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index b3797923d98..6db8004ed1f 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -61,7 +61,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/addons/storyshots/storyshots-core/package.json b/code/addons/storyshots/storyshots-core/package.json index fd822ae915c..c7ec03f96f5 100644 --- a/code/addons/storyshots/storyshots-core/package.json +++ b/code/addons/storyshots/storyshots-core/package.json @@ -33,7 +33,7 @@ "scripts": { "build-storybook": "sb build", "example": "jest storyshot.test", - "prep": "node ../../../../scripts/prepare.js", + "prepare": "node ../../../../scripts/prepare.js", "storybook": "yarn sb dev -p 6006" }, "dependencies": { diff --git a/code/addons/storyshots/storyshots-puppeteer/package.json b/code/addons/storyshots/storyshots-puppeteer/package.json index 0e7dc561bc8..6213408ac26 100644 --- a/code/addons/storyshots/storyshots-puppeteer/package.json +++ b/code/addons/storyshots/storyshots-puppeteer/package.json @@ -30,7 +30,7 @@ "*.d.ts" ], "scripts": { - "prep": "node ../../../../scripts/prepare.js" + "prepare": "node ../../../../scripts/prepare.js" }, "dependencies": { "@axe-core/puppeteer": "^4.2.0", diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index 9c064c5e21f..f86bd585d6c 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -32,7 +32,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index 77bbea20b8d..39ffb2b8093 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -54,7 +54,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index 96d90be44c7..edbc52c5e28 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -56,7 +56,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index 558e8c31798..f26db98de8e 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -31,7 +31,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index 2959fc6c36f..5964cf3905c 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -27,7 +27,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/builder-webpack5": "7.0.0-alpha.28", diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index ca36d62524b..f2ce10b38d4 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -47,7 +47,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/builder-webpack5": "7.0.0-alpha.28", diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index 3bfcdfeaf23..b5d36828a83 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -47,7 +47,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/builder-webpack5": "7.0.0-alpha.28", diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index e256c589c90..318a6281b74 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -48,7 +48,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@joshwooding/vite-plugin-react-docgen-typescript": "^0.0.5", diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index ed8c8a9564e..547a910280c 100644 --- a/code/frameworks/react-webpack5/package.json +++ b/code/frameworks/react-webpack5/package.json @@ -48,7 +48,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/builder-webpack5": "7.0.0-alpha.28", diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index 1d41c6cb78f..a985c979a8d 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -47,7 +47,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/builder-webpack5": "7.0.0-alpha.28", diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index 667182aabb3..28dcced1751 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -48,7 +48,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addon-svelte-csf": "^2.0.0", diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index 1a39e1279b3..203d2217270 100644 --- a/code/frameworks/svelte-webpack5/package.json +++ b/code/frameworks/svelte-webpack5/package.json @@ -48,7 +48,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/builder-webpack5": "7.0.0-alpha.28", diff --git a/code/frameworks/vue-webpack5/package.json b/code/frameworks/vue-webpack5/package.json index f07e59c956d..92ad04337de 100644 --- a/code/frameworks/vue-webpack5/package.json +++ b/code/frameworks/vue-webpack5/package.json @@ -47,7 +47,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/builder-webpack5": "7.0.0-alpha.28", diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index a58c0e01422..07a13c2f01f 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -48,7 +48,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/builder-vite": "7.0.0-alpha.28", diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index 5023e32057e..ae37a9ec7fc 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -47,7 +47,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/builder-webpack5": "7.0.0-alpha.28", diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index e9381697b39..f5946faaa28 100644 --- a/code/frameworks/web-components-webpack5/package.json +++ b/code/frameworks/web-components-webpack5/package.json @@ -49,7 +49,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@babel/preset-env": "^7.12.11", diff --git a/code/lib/addons/package.json b/code/lib/addons/package.json index 94f1673afa0..5fa7f85e4bb 100644 --- a/code/lib/addons/package.json +++ b/code/lib/addons/package.json @@ -31,7 +31,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/api": "7.0.0-alpha.28", diff --git a/code/lib/api/package.json b/code/lib/api/package.json index 92b243a8b19..ec63bdb7560 100644 --- a/code/lib/api/package.json +++ b/code/lib/api/package.json @@ -29,7 +29,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/channels": "7.0.0-alpha.28", diff --git a/code/lib/blocks/package.json b/code/lib/blocks/package.json index 13a761fbd7c..9648a6b1711 100644 --- a/code/lib/blocks/package.json +++ b/code/lib/blocks/package.json @@ -38,7 +38,7 @@ "*.d.ts" ], "scripts": { - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/api": "7.0.0-alpha.28", diff --git a/code/lib/builder-manager/package.json b/code/lib/builder-manager/package.json index b5b73a1a6cc..4e2ab57aef0 100644 --- a/code/lib/builder-manager/package.json +++ b/code/lib/builder-manager/package.json @@ -38,7 +38,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@fal-works/esbuild-plugin-global-externals": "^2.1.2", diff --git a/code/lib/builder-vite/package.json b/code/lib/builder-vite/package.json index 012bfbb6ef6..134aaa098d1 100644 --- a/code/lib/builder-vite/package.json +++ b/code/lib/builder-vite/package.json @@ -15,7 +15,7 @@ "types": "dist/types/index.d.ts", "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@joshwooding/vite-plugin-react-docgen-typescript": "0.0.5", diff --git a/code/lib/builder-webpack5/package.json b/code/lib/builder-webpack5/package.json index 453ea5650f3..8d1075900a3 100644 --- a/code/lib/builder-webpack5/package.json +++ b/code/lib/builder-webpack5/package.json @@ -30,7 +30,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@babel/core": "^7.12.10", diff --git a/code/lib/channel-postmessage/package.json b/code/lib/channel-postmessage/package.json index 4290ac7664b..e0158dd7337 100644 --- a/code/lib/channel-postmessage/package.json +++ b/code/lib/channel-postmessage/package.json @@ -31,7 +31,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/channels": "7.0.0-alpha.28", diff --git a/code/lib/channel-websocket/package.json b/code/lib/channel-websocket/package.json index 0edb392c6f1..1755413d698 100644 --- a/code/lib/channel-websocket/package.json +++ b/code/lib/channel-websocket/package.json @@ -31,7 +31,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/channels": "7.0.0-alpha.28", diff --git a/code/lib/channels/package.json b/code/lib/channels/package.json index 0b86dbbb7ac..741927102bb 100644 --- a/code/lib/channels/package.json +++ b/code/lib/channels/package.json @@ -39,7 +39,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "core-js": "^3.8.2", diff --git a/code/lib/cli-sb/package.json b/code/lib/cli-sb/package.json index 7127805b2f3..0ab6dc552ac 100644 --- a/code/lib/cli-sb/package.json +++ b/code/lib/cli-sb/package.json @@ -22,7 +22,7 @@ "bin": "./index.js", "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/cli": "7.0.0-alpha.28" diff --git a/code/lib/cli-storybook/package.json b/code/lib/cli-storybook/package.json index 46fe7015de7..a8c3b05f352 100644 --- a/code/lib/cli-storybook/package.json +++ b/code/lib/cli-storybook/package.json @@ -25,7 +25,7 @@ }, "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/cli": "7.0.0-alpha.28" diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index fe68d8225cc..6b56a8bc36d 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -35,7 +35,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js", + "prepare": "node ../../../scripts/prepare.js", "test": "jest test/**/*.test.js" }, "dependencies": { diff --git a/code/lib/client-api/package.json b/code/lib/client-api/package.json index 8c75c99e454..5f1a9dd4485 100644 --- a/code/lib/client-api/package.json +++ b/code/lib/client-api/package.json @@ -31,7 +31,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/lib/client-logger/package.json b/code/lib/client-logger/package.json index f3f84c4f724..8105f0b4d0f 100644 --- a/code/lib/client-logger/package.json +++ b/code/lib/client-logger/package.json @@ -39,7 +39,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "core-js": "^3.8.2", diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index f4f18ffb56a..0e824297454 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -32,7 +32,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@babel/types": "^7.12.11", diff --git a/code/lib/components/package.json b/code/lib/components/package.json index ad87f7042ed..829b1c93b5d 100644 --- a/code/lib/components/package.json +++ b/code/lib/components/package.json @@ -48,7 +48,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/client-logger": "7.0.0-alpha.28", diff --git a/code/lib/core-client/package.json b/code/lib/core-client/package.json index 46e71f76e3a..b6980a8e88e 100644 --- a/code/lib/core-client/package.json +++ b/code/lib/core-client/package.json @@ -31,7 +31,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/lib/core-common/package.json b/code/lib/core-common/package.json index 2455d4a6f8e..c68915d30d5 100644 --- a/code/lib/core-common/package.json +++ b/code/lib/core-common/package.json @@ -43,7 +43,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@babel/core": "^7.12.10", diff --git a/code/lib/core-events/package.json b/code/lib/core-events/package.json index f9aa768fa75..45d61a89e33 100644 --- a/code/lib/core-events/package.json +++ b/code/lib/core-events/package.json @@ -39,7 +39,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "core-js": "^3.8.2" diff --git a/code/lib/core-server/package.json b/code/lib/core-server/package.json index f2110e30290..c183f85b66e 100644 --- a/code/lib/core-server/package.json +++ b/code/lib/core-server/package.json @@ -30,7 +30,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@aw-web-design/x-default-browser": "1.4.88", diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json index e856272d47f..811ad8e5b2a 100644 --- a/code/lib/core-webpack/package.json +++ b/code/lib/core-webpack/package.json @@ -39,7 +39,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/core-common": "7.0.0-alpha.28", diff --git a/code/lib/csf-tools/package.json b/code/lib/csf-tools/package.json index aa78a8f28b2..d8c3d3a3e16 100644 --- a/code/lib/csf-tools/package.json +++ b/code/lib/csf-tools/package.json @@ -31,7 +31,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@babel/core": "^7.12.10", diff --git a/code/lib/docs-tools/package.json b/code/lib/docs-tools/package.json index 19ddbe3e01e..98e005f7104 100644 --- a/code/lib/docs-tools/package.json +++ b/code/lib/docs-tools/package.json @@ -31,7 +31,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@babel/core": "^7.12.10", diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index dafcff0eac4..6d3f8a6c0c9 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -31,7 +31,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/lib/node-logger/package.json b/code/lib/node-logger/package.json index 21c98013742..1c9d2b3fbc4 100644 --- a/code/lib/node-logger/package.json +++ b/code/lib/node-logger/package.json @@ -31,7 +31,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@types/npmlog": "^4.1.2", diff --git a/code/lib/postinstall/package.json b/code/lib/postinstall/package.json index c2881b2ae4e..7eebf81dfa6 100644 --- a/code/lib/postinstall/package.json +++ b/code/lib/postinstall/package.json @@ -32,7 +32,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "core-js": "^3.8.2" diff --git a/code/lib/preview-web/package.json b/code/lib/preview-web/package.json index 050b63763d7..72e010408f9 100644 --- a/code/lib/preview-web/package.json +++ b/code/lib/preview-web/package.json @@ -31,7 +31,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/lib/preview-web/src/PreviewWeb.test.ts b/code/lib/preview-web/src/PreviewWeb.test.ts index 37599226e3d..2efa7ab9a64 100644 --- a/code/lib/preview-web/src/PreviewWeb.test.ts +++ b/code/lib/preview-web/src/PreviewWeb.test.ts @@ -1,5 +1,5 @@ /// ; - +import { jest, jest as mockJest, it, describe, beforeEach, afterEach, expect } from '@jest/globals'; import global from 'global'; import merge from 'lodash/merge'; import { @@ -31,7 +31,6 @@ import { logger } from '@storybook/client-logger'; import { addons, mockChannel as createMockChannel } from '@storybook/addons'; import type { AnyFramework } from '@storybook/csf'; import type { ModuleImportFn, WebProjectAnnotations } from '@storybook/store'; -import { expect } from '@jest/globals'; import { mocked } from 'ts-jest/utils'; import { PreviewWeb } from './PreviewWeb'; @@ -60,8 +59,8 @@ const mockStoryIndex = jest.fn(() => storyIndex); let mockFetchResult; jest.mock('global', () => ({ - ...(jest.requireActual('global') as any), - history: { replaceState: jest.fn() }, + ...(mockJest.requireActual('global') as any), + history: { replaceState: mockJest.fn() }, document: { location: { pathname: 'pathname', @@ -70,7 +69,7 @@ jest.mock('global', () => ({ }, window: { location: { - reload: jest.fn(), + reload: mockJest.fn(), }, }, FEATURES: { @@ -349,8 +348,12 @@ describe('PreviewWeb', () => { }); describe('after selection changes', () => { - beforeEach(() => jest.useFakeTimers()); - afterEach(() => jest.useRealTimers()); + beforeEach(() => { + jest.useFakeTimers(); + }); + afterEach(() => { + jest.useRealTimers(); + }); it('DOES NOT try again if CSF file changes', async () => { document.location.search = '?id=component-one--missing'; @@ -1563,49 +1566,140 @@ describe('PreviewWeb', () => { expect(teardownRenderToDOM).not.toHaveBeenCalled(); }); - // For https://github.com/storybookjs/storybook/issues/17214 - it('does NOT render a second time if preparing', async () => { - document.location.search = '?id=component-one--a'; + describe('while preparing', () => { + // For https://github.com/storybookjs/storybook/issues/17214 + it('does NOT render a second time in story mode', async () => { + document.location.search = '?id=component-one--a'; - const [gate, openGate] = createGate(); - const [importedGate, openImportedGate] = createGate(); - importFn - .mockImplementationOnce(async (...args) => { - await gate; - return importFn(...args); - }) - .mockImplementationOnce(async (...args) => { - // The second time we `import()` we open the "imported" gate - openImportedGate(); - await gate; - return importFn(...args); + const [gate, openGate] = createGate(); + const [importedGate, openImportedGate] = createGate(); + importFn + .mockImplementationOnce(async (...args) => { + await gate; + return importFn(...args); + }) + .mockImplementationOnce(async (...args) => { + // The second time we `import()` we open the "imported" gate + openImportedGate(); + await gate; + return importFn(...args); + }); + + const preview = new PreviewWeb(); + // We can't wait for the initialize function, as it waits for `renderSelection()` + // which prepares, but it does emit `CURRENT_STORY_WAS_SET` right before that + preview.initialize({ importFn, getProjectAnnotations }); + await waitForEvents([CURRENT_STORY_WAS_SET]); + + mockChannel.emit.mockClear(); + projectAnnotations.renderToDOM.mockClear(); + emitter.emit(SET_CURRENT_STORY, { + storyId: 'component-one--a', + viewMode: 'story', }); + await importedGate; + // We are blocking import so this won't render yet + expect(projectAnnotations.renderToDOM).not.toHaveBeenCalled(); - const preview = new PreviewWeb(); - // We can't wait for the initialize function, as it waits for `renderSelection()` - // which prepares, but it does emit `CURRENT_STORY_WAS_SET` right before that - preview.initialize({ importFn, getProjectAnnotations }); - await waitForEvents([CURRENT_STORY_WAS_SET]); + mockChannel.emit.mockClear(); + openGate(); + await waitForRender(); - mockChannel.emit.mockClear(); - projectAnnotations.renderToDOM.mockClear(); - emitter.emit(SET_CURRENT_STORY, { - storyId: 'component-one--a', - viewMode: 'story', + // We should only render *once* + expect(projectAnnotations.renderToDOM).toHaveBeenCalledTimes(1); + + // We should not show an error either + expect(preview.view.showErrorDisplay).not.toHaveBeenCalled(); }); - await importedGate; - // We are blocking import so this won't render yet - expect(projectAnnotations.renderToDOM).not.toHaveBeenCalled(); - mockChannel.emit.mockClear(); - openGate(); - await waitForRender(); + // For https://github.com/storybookjs/storybook/issues/19015 + it('does NOT render a second time in template docs mode', async () => { + document.location.search = '?id=component-one--docs&viewMode=docs'; - // We should only render *once* - expect(projectAnnotations.renderToDOM).toHaveBeenCalledTimes(1); + const [gate, openGate] = createGate(); + const [importedGate, openImportedGate] = createGate(); + importFn + .mockImplementationOnce(async (...args) => { + await gate; + return importFn(...args); + }) + .mockImplementationOnce(async (...args) => { + // The second time we `import()` we open the "imported" gate + openImportedGate(); + await gate; + return importFn(...args); + }); - // We should not show an error either - expect(preview.view.showErrorDisplay).not.toHaveBeenCalled(); + const preview = new PreviewWeb(); + // We can't wait for the initialize function, as it waits for `renderSelection()` + // which prepares, but it does emit `CURRENT_STORY_WAS_SET` right before that + preview.initialize({ importFn, getProjectAnnotations }); + await waitForEvents([CURRENT_STORY_WAS_SET]); + + mockChannel.emit.mockClear(); + projectAnnotations.renderToDOM.mockClear(); + emitter.emit(SET_CURRENT_STORY, { + storyId: 'component-one--docs', + viewMode: 'docs', + }); + await importedGate; + // We are blocking import so this won't render yet + expect(docsRenderer.render).not.toHaveBeenCalled(); + + mockChannel.emit.mockClear(); + openGate(); + await waitForRender(); + + // We should only render *once* + expect(docsRenderer.render).toHaveBeenCalledTimes(1); + + // We should not show an error either + expect(preview.view.showErrorDisplay).not.toHaveBeenCalled(); + }); + + it('does NOT render a second time in standalone docs mode', async () => { + document.location.search = '?id=introduction--docs&viewMode=docs'; + + const [gate, openGate] = createGate(); + const [importedGate, openImportedGate] = createGate(); + importFn + .mockImplementationOnce(async (...args) => { + await gate; + return importFn(...args); + }) + .mockImplementationOnce(async (...args) => { + // The second time we `import()` we open the "imported" gate + openImportedGate(); + await gate; + return importFn(...args); + }); + + const preview = new PreviewWeb(); + // We can't wait for the initialize function, as it waits for `renderSelection()` + // which prepares, but it does emit `CURRENT_STORY_WAS_SET` right before that + preview.initialize({ importFn, getProjectAnnotations }); + await waitForEvents([CURRENT_STORY_WAS_SET]); + + mockChannel.emit.mockClear(); + projectAnnotations.renderToDOM.mockClear(); + emitter.emit(SET_CURRENT_STORY, { + storyId: 'introduction--docs', + viewMode: 'docs', + }); + await importedGate; + // We are blocking import so this won't render yet + expect(docsRenderer.render).not.toHaveBeenCalled(); + + mockChannel.emit.mockClear(); + openGate(); + await waitForRender(); + + // We should only render *once* + expect(docsRenderer.render).toHaveBeenCalledTimes(1); + + // We should not show an error either + expect(preview.view.showErrorDisplay).not.toHaveBeenCalled(); + }); }); }); @@ -2715,8 +2809,12 @@ describe('PreviewWeb', () => { }); describe('if it was previously rendered', () => { - beforeEach(() => jest.useFakeTimers()); - afterEach(() => jest.useRealTimers()); + beforeEach(() => { + jest.useFakeTimers(); + }); + afterEach(() => { + jest.useRealTimers(); + }); it('is reloaded when it is re-selected', async () => { document.location.search = '?id=component-one--a'; const preview = await createAndRenderPreview(); diff --git a/code/lib/preview-web/src/PreviewWeb.tsx b/code/lib/preview-web/src/PreviewWeb.tsx index 3178ae7611f..444c582c917 100644 --- a/code/lib/preview-web/src/PreviewWeb.tsx +++ b/code/lib/preview-web/src/PreviewWeb.tsx @@ -34,7 +34,8 @@ import { MaybePromise, Preview } from './Preview'; import { UrlStore } from './UrlStore'; import { WebView } from './WebView'; -import { PREPARE_ABORTED, StoryRender } from './render/StoryRender'; +import { PREPARE_ABORTED } from './render/Render'; +import { StoryRender } from './render/StoryRender'; import { TemplateDocsRender } from './render/TemplateDocsRender'; import { StandaloneDocsRender } from './render/StandaloneDocsRender'; diff --git a/code/lib/preview-web/src/render/Render.ts b/code/lib/preview-web/src/render/Render.ts index 64b1458cb88..95d15245336 100644 --- a/code/lib/preview-web/src/render/Render.ts +++ b/code/lib/preview-web/src/render/Render.ts @@ -19,3 +19,5 @@ export interface Render { torndown: boolean; renderToElement: (canvasElement: HTMLElement, renderStoryToElement?: any) => Promise; } + +export const PREPARE_ABORTED = new Error('prepareAborted'); diff --git a/code/lib/preview-web/src/render/StandaloneDocsRender.test.ts b/code/lib/preview-web/src/render/StandaloneDocsRender.test.ts new file mode 100644 index 00000000000..492f33dc0bd --- /dev/null +++ b/code/lib/preview-web/src/render/StandaloneDocsRender.test.ts @@ -0,0 +1,52 @@ +import { jest, describe, it, expect } from '@jest/globals'; +import { Channel } from '@storybook/channels'; +import { AnyFramework } from '@storybook/csf'; +import { StoryStore } from '@storybook/store'; +import type { StandaloneDocsIndexEntry } from '@storybook/store'; +import { PREPARE_ABORTED } from './Render'; + +import { StandaloneDocsRender } from './StandaloneDocsRender'; + +const entry = { + type: 'docs', + id: 'introduction--docs', + name: 'Docs', + title: 'Introduction', + importPath: './Introduction.mdx', + storiesImports: [], + standalone: true, +} as StandaloneDocsIndexEntry; + +const createGate = (): [Promise, (_?: any) => void] => { + let openGate = (_?: any) => {}; + const gate = new Promise((resolve) => { + openGate = resolve; + }); + return [gate, openGate]; +}; + +describe('StandaloneDocsRender', () => { + it('throws PREPARE_ABORTED if torndown during prepare', async () => { + const [importGate, openImportGate] = createGate(); + const mockStore = { + loadEntry: jest.fn(async () => { + await importGate; + return {}; + }), + }; + + const render = new StandaloneDocsRender( + new Channel(), + mockStore as unknown as StoryStore, + entry + ); + + const preparePromise = render.prepare(); + + render.teardown(); + + openImportGate(); + + await expect(preparePromise).rejects.toThrowError(PREPARE_ABORTED); + }); +}); diff --git a/code/lib/preview-web/src/render/StandaloneDocsRender.ts b/code/lib/preview-web/src/render/StandaloneDocsRender.ts index c6d99edef02..27581c2ad9b 100644 --- a/code/lib/preview-web/src/render/StandaloneDocsRender.ts +++ b/code/lib/preview-web/src/render/StandaloneDocsRender.ts @@ -3,7 +3,7 @@ import { CSFFile, ModuleExports, StoryStore } from '@storybook/store'; import { Channel, IndexEntry } from '@storybook/addons'; import { DOCS_RENDERED } from '@storybook/core-events'; -import { Render, RenderType } from './Render'; +import { Render, RenderType, PREPARE_ABORTED } from './Render'; import type { DocsContextProps } from '../docs-context/DocsContextProps'; import type { DocsRenderFunction } from '../docs-context/DocsRenderFunction'; import { DocsContext } from '../docs-context/DocsContext'; @@ -26,7 +26,7 @@ export class StandaloneDocsRender implements Re public rerender?: () => Promise; - public teardown?: (options: { viewModeChanged?: boolean }) => Promise; + public teardownRender?: (options: { viewModeChanged?: boolean }) => Promise; public torndown = false; @@ -51,6 +51,8 @@ export class StandaloneDocsRender implements Re async prepare() { this.preparing = true; const { entryExports, csfFiles = [] } = await this.store.loadEntry(this.id); + if (this.torndown) throw PREPARE_ABORTED; + this.csfFiles = csfFiles; this.exports = entryExports; @@ -96,7 +98,7 @@ export class StandaloneDocsRender implements Re }; this.rerender = async () => renderDocs(); - this.teardown = async ({ viewModeChanged }: { viewModeChanged?: boolean } = {}) => { + this.teardownRender = async ({ viewModeChanged }: { viewModeChanged?: boolean } = {}) => { if (!viewModeChanged || !canvasElement) return; renderer.unmount(canvasElement); this.torndown = true; @@ -104,4 +106,9 @@ export class StandaloneDocsRender implements Re return renderDocs(); } + + async teardown({ viewModeChanged }: { viewModeChanged?: boolean } = {}) { + this.teardownRender?.({ viewModeChanged }); + this.torndown = true; + } } diff --git a/code/lib/preview-web/src/render/StoryRender.test.ts b/code/lib/preview-web/src/render/StoryRender.test.ts new file mode 100644 index 00000000000..7ec87a7d150 --- /dev/null +++ b/code/lib/preview-web/src/render/StoryRender.test.ts @@ -0,0 +1,54 @@ +import { jest, describe, it, expect } from '@jest/globals'; +import { Channel } from '@storybook/channels'; +import { AnyFramework } from '@storybook/csf'; +import { StoryStore } from '@storybook/store'; +import type { StoryIndexEntry } from '@storybook/store'; +import { PREPARE_ABORTED } from './Render'; + +import { StoryRender } from './StoryRender'; + +const entry = { + type: 'story', + id: 'component--a', + name: 'A', + title: 'component', + importPath: './component.stories.ts', +} as StoryIndexEntry; + +const createGate = (): [Promise, (_?: any) => void] => { + let openGate = (_?: any) => {}; + const gate = new Promise((resolve) => { + openGate = resolve; + }); + return [gate, openGate]; +}; + +describe('StoryRender', () => { + it('throws PREPARE_ABORTED if torndown during prepare', async () => { + const [importGate, openImportGate] = createGate(); + const mockStore = { + loadStory: jest.fn(async () => { + await importGate; + return {}; + }), + cleanupStory: jest.fn(), + }; + + const render = new StoryRender( + new Channel(), + mockStore as unknown as StoryStore, + jest.fn(), + {} as any, + entry.id, + 'story' + ); + + const preparePromise = render.prepare(); + + render.teardown(); + + openImportGate(); + + await expect(preparePromise).rejects.toThrowError(PREPARE_ABORTED); + }); +}); diff --git a/code/lib/preview-web/src/render/StoryRender.ts b/code/lib/preview-web/src/render/StoryRender.ts index 70b6b8fd86a..5e9e3ac02f7 100644 --- a/code/lib/preview-web/src/render/StoryRender.ts +++ b/code/lib/preview-web/src/render/StoryRender.ts @@ -20,7 +20,7 @@ import { STORY_RENDERED, PLAY_FUNCTION_THREW_EXCEPTION, } from '@storybook/core-events'; -import { Render, RenderType } from './Render'; +import { Render, RenderType, PREPARE_ABORTED } from './Render'; const { AbortController } = global; @@ -60,8 +60,6 @@ export type RenderContextCallbacks = Pick< 'showMain' | 'showError' | 'showException' >; -export const PREPARE_ABORTED = new Error('prepareAborted'); - export class StoryRender implements Render { public type: RenderType = 'story'; @@ -275,7 +273,7 @@ export class StoryRender implements Render, (_?: any) => void] => { + let openGate = (_?: any) => {}; + const gate = new Promise((resolve) => { + openGate = resolve; + }); + return [gate, openGate]; +}; + +describe('TemplateDocsRender', () => { + it('throws PREPARE_ABORTED if torndown during prepare', async () => { + const [importGate, openImportGate] = createGate(); + const mockStore = { + loadEntry: jest.fn(async () => { + await importGate; + return {}; + }), + }; + + const render = new TemplateDocsRender( + new Channel(), + mockStore as unknown as StoryStore, + entry + ); + + const preparePromise = render.prepare(); + + render.teardown(); + + openImportGate(); + + await expect(preparePromise).rejects.toThrowError(PREPARE_ABORTED); + }); +}); diff --git a/code/lib/preview-web/src/render/TemplateDocsRender.ts b/code/lib/preview-web/src/render/TemplateDocsRender.ts index 7399ca73496..1d3be018ae8 100644 --- a/code/lib/preview-web/src/render/TemplateDocsRender.ts +++ b/code/lib/preview-web/src/render/TemplateDocsRender.ts @@ -3,7 +3,7 @@ import { CSFFile, Story, StoryStore } from '@storybook/store'; import { Channel, IndexEntry } from '@storybook/addons'; import { DOCS_RENDERED } from '@storybook/core-events'; -import { Render, RenderType } from './Render'; +import { Render, RenderType, PREPARE_ABORTED } from './Render'; import type { DocsContextProps } from '../docs-context/DocsContextProps'; import type { DocsRenderFunction } from '../docs-context/DocsRenderFunction'; import { DocsContext } from '../docs-context/DocsContext'; @@ -29,7 +29,7 @@ export class TemplateDocsRender implements Rend public rerender?: () => Promise; - public teardown?: (options: { viewModeChanged?: boolean }) => Promise; + public teardownRender?: (options: { viewModeChanged?: boolean }) => Promise; public torndown = false; @@ -54,9 +54,10 @@ export class TemplateDocsRender implements Rend async prepare() { this.preparing = true; const { entryExports, csfFiles = [] } = await this.store.loadEntry(this.id); + if (this.torndown) throw PREPARE_ABORTED; const { importPath, title } = this.entry; - const primaryCsfFile = await this.store.processCSFFileWithCache( + const primaryCsfFile = this.store.processCSFFileWithCache( entryExports, importPath, title @@ -112,12 +113,16 @@ export class TemplateDocsRender implements Rend }; this.rerender = async () => renderDocs(); - this.teardown = async ({ viewModeChanged }: { viewModeChanged?: boolean } = {}) => { + this.teardownRender = async ({ viewModeChanged }: { viewModeChanged?: boolean }) => { if (!viewModeChanged || !canvasElement) return; renderer.unmount(canvasElement); - this.torndown = true; }; return renderDocs(); } + + async teardown({ viewModeChanged }: { viewModeChanged?: boolean } = {}) { + this.teardownRender?.({ viewModeChanged }); + this.torndown = true; + } } diff --git a/code/lib/router/package.json b/code/lib/router/package.json index 4220d07f375..a7bed98e317 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -31,7 +31,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "ts-node ../../../scripts/prebundle.ts" + "prepare": "ts-node ../../../scripts/prebundle.ts" }, "dependencies": { "@storybook/client-logger": "7.0.0-alpha.28", diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json index 2b1e206dbb4..ac82557135c 100644 --- a/code/lib/source-loader/package.json +++ b/code/lib/source-loader/package.json @@ -32,7 +32,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/lib/store/package.json b/code/lib/store/package.json index 6d5bfa474b1..296ecf055df 100644 --- a/code/lib/store/package.json +++ b/code/lib/store/package.json @@ -31,7 +31,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/lib/telemetry/package.json b/code/lib/telemetry/package.json index d83b9f54047..5f26f9c04cc 100644 --- a/code/lib/telemetry/package.json +++ b/code/lib/telemetry/package.json @@ -31,7 +31,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prepare": "node ../../../scripts/prepare.js" }, "dependencies": { "@storybook/client-logger": "7.0.0-alpha.28", diff --git a/code/lib/theming/package.json b/code/lib/theming/package.json index 8a63aee4dde..79a529e0abf 100644 --- a/code/lib/theming/package.json +++ b/code/lib/theming/package.json @@ -44,7 +44,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/client-logger": "7.0.0-alpha.28", diff --git a/code/lib/ui/package.json b/code/lib/ui/package.json index 0de001dd414..0011ff4dbed 100644 --- a/code/lib/ui/package.json +++ b/code/lib/ui/package.json @@ -49,7 +49,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "devDependencies": { "@babel/core": "^7.12.10", diff --git a/code/nx.json b/code/nx.json index 060c2a0fbda..a64d3d54ab0 100644 --- a/code/nx.json +++ b/code/nx.json @@ -10,8 +10,8 @@ "default": { "runner": "@nrwl/nx-cloud", "options": { - "cacheableOperations": ["build", "test", "lint", "package", "prep"], - "strictlyOrderedTargets": ["build", "package", "prep"], + "cacheableOperations": ["build", "test", "lint", "package", "prepare"], + "strictlyOrderedTargets": ["build", "package", "prepare"], "accessToken": "NGVmYTkxMmItYzY3OS00MjkxLTk1ZDktZDFmYTFmNmVlNGY4fHJlYWQ=", "canTrackAnalytics": false, "showUsageWarnings": true diff --git a/code/presets/html-webpack/package.json b/code/presets/html-webpack/package.json index 1a2849ffc2c..fb34ea7684a 100644 --- a/code/presets/html-webpack/package.json +++ b/code/presets/html-webpack/package.json @@ -47,7 +47,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/core-webpack": "7.0.0-alpha.28", diff --git a/code/presets/preact-webpack/package.json b/code/presets/preact-webpack/package.json index d097ed36181..b16c4c682a5 100644 --- a/code/presets/preact-webpack/package.json +++ b/code/presets/preact-webpack/package.json @@ -47,7 +47,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@babel/plugin-transform-react-jsx": "^7.12.12", diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index 58eb8e0b10d..5d6b6796434 100644 --- a/code/presets/react-webpack/package.json +++ b/code/presets/react-webpack/package.json @@ -68,7 +68,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@babel/preset-flow": "^7.12.1", diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index 5d01fda9371..9c9031a370b 100644 --- a/code/presets/server-webpack/package.json +++ b/code/presets/server-webpack/package.json @@ -52,7 +52,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/core-server": "7.0.0-alpha.28", diff --git a/code/presets/svelte-webpack/package.json b/code/presets/svelte-webpack/package.json index 4c261053d1b..66d181c3e11 100644 --- a/code/presets/svelte-webpack/package.json +++ b/code/presets/svelte-webpack/package.json @@ -62,7 +62,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/core-webpack": "7.0.0-alpha.28", diff --git a/code/presets/vue-webpack/package.json b/code/presets/vue-webpack/package.json index 9f089188732..6131f3ee805 100644 --- a/code/presets/vue-webpack/package.json +++ b/code/presets/vue-webpack/package.json @@ -57,7 +57,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/core-webpack": "7.0.0-alpha.28", diff --git a/code/presets/vue3-webpack/package.json b/code/presets/vue3-webpack/package.json index 0bd4c542da7..cbb2a2ae80e 100644 --- a/code/presets/vue3-webpack/package.json +++ b/code/presets/vue3-webpack/package.json @@ -57,7 +57,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/core-webpack": "7.0.0-alpha.28", diff --git a/code/presets/web-components-webpack/package.json b/code/presets/web-components-webpack/package.json index 36a4d31db15..a4865fea263 100644 --- a/code/presets/web-components-webpack/package.json +++ b/code/presets/web-components-webpack/package.json @@ -49,7 +49,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@babel/plugin-syntax-dynamic-import": "^7.8.3", diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json index b36446fafd4..74e8f95129c 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -47,7 +47,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index e2e7b466012..0cca925f617 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -47,7 +47,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index c22ce03906b..b6fb2de2862 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -48,7 +48,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index 7e5da684073..51a36232d04 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -47,7 +47,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index 11708fca1c2..819d1939b48 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -51,7 +51,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/renderers/vue/package.json b/code/renderers/vue/package.json index 8b1d2fa59e8..f12707176e6 100644 --- a/code/renderers/vue/package.json +++ b/code/renderers/vue/package.json @@ -47,7 +47,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index 271ff46ca49..39c5a3c6018 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -47,7 +47,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index ae0c72fab70..9fca4526540 100644 --- a/code/renderers/web-components/package.json +++ b/code/renderers/web-components/package.json @@ -49,7 +49,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "../../../scripts/prepare/bundle.ts" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.28", diff --git a/scripts/bootstrap.js b/scripts/bootstrap.js index ad9e248bb64..4fc16a11063 100755 --- a/scripts/bootstrap.js +++ b/scripts/bootstrap.js @@ -74,9 +74,9 @@ function run() { defaultValue: true, option: '--prep', command: () => { - log.info(prefix, 'prep'); + log.info(prefix, 'prepare'); spawn( - `nx run-many --target="prep" --all --parallel --exclude=@storybook/addon-storyshots,@storybook/addon-storyshots-puppeteer -- --reset` + `nx run-many --target="prepare" --all --parallel --exclude=@storybook/addon-storyshots,@storybook/addon-storyshots-puppeteer -- --reset` ); }, order: 2, @@ -86,9 +86,9 @@ function run() { defaultValue: true, option: '--retry', command: () => { - log.info(prefix, 'prep'); + log.info(prefix, 'prepare'); spawn( - `nx run-many --target=prep --all --parallel --only-failed ${ + `nx run-many --target=prepare --all --parallel --only-failed ${ process.env.CI ? `--max-parallel=${maxConcurrentTasks}` : '' }` ); @@ -122,7 +122,7 @@ function run() { command: () => { log.info(prefix, 'build'); spawn( - `nx run-many --target="prep" --all --parallel=8 ${ + `nx run-many --target="prepare" --all --parallel=8 ${ process.env.CI ? `--max-parallel=${maxConcurrentTasks}` : '' } -- --reset --optimized` ); diff --git a/scripts/build-package.js b/scripts/build-package.js index 70468be2e0e..f9df57b1f7c 100644 --- a/scripts/build-package.js +++ b/scripts/build-package.js @@ -113,7 +113,7 @@ async function run() { } selection?.filter(Boolean).forEach(async (v) => { - const commmand = (await readJSON(resolve(v.location, 'package.json'))).scripts.prep; + const commmand = (await readJSON(resolve(v.location, 'package.json'))).scripts.prepare; const cwd = resolve(__dirname, '..', 'code', v.location); const sub = require('execa').command( `${commmand}${watchMode ? ' --watch' : ''}${prodMode ? ' --optimized' : ''}`, diff --git a/scripts/prepare.js b/scripts/prepare.js index 45157da8ea2..2511464abe5 100644 --- a/scripts/prepare.js +++ b/scripts/prepare.js @@ -68,7 +68,7 @@ const hasFlag = (flags, name) => !!flags.find((s) => s.startsWith(`--${name}`)); const modules = true; -async function prep({ cwd, flags }) { +async function prepare({ cwd, flags }) { const { packageJson } = await readPkgUp(cwd); const message = chalk.gray(`Built: ${chalk.bold(`${packageJson.name}@${packageJson.version}`)}`); console.time(message); @@ -101,4 +101,4 @@ async function prep({ cwd, flags }) { const flags = process.argv.slice(2); const cwd = process.cwd(); -prep({ cwd, flags }); +prepare({ cwd, flags }); diff --git a/scripts/sandbox.ts b/scripts/sandbox.ts index febfd49f114..9c044b660dc 100644 --- a/scripts/sandbox.ts +++ b/scripts/sandbox.ts @@ -267,7 +267,11 @@ async function addStories(paths: string[], { mainConfig }: { mainConfig: ConfigF const relativeCodeDir = path.join('..', '..', '..', 'code'); const extraStories = extraStoryDirsAndExistence .filter(([, exists]) => exists) - .map(([p]) => path.join(relativeCodeDir, p, '*.stories.@(js|jsx|ts|tsx)')); + .map(([p]) => ({ + directory: path.join(relativeCodeDir, p), + titlePrefix: p.split('/').slice(-4, -2).join('/'), + files: '*.stories.@(js|jsx|ts|tsx)', + })); mainConfig.setFieldValue(['stories'], [...stories, ...extraStories]); }