From d4bf6448f1775b9365f54ba2619fd90e5d17ca21 Mon Sep 17 00:00:00 2001 From: Dee Bryant Date: Sat, 7 Oct 2023 17:07:37 +1100 Subject: [PATCH 001/115] fix(a11y): remove redundant styling rules, update icon colour, fix alignment --- code/addons/a11y/src/components/Report/Item.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/code/addons/a11y/src/components/Report/Item.tsx b/code/addons/a11y/src/components/Report/Item.tsx index 94a92f26a0ff..2d34ee58d745 100644 --- a/code/addons/a11y/src/components/Report/Item.tsx +++ b/code/addons/a11y/src/components/Report/Item.tsx @@ -21,16 +21,14 @@ const Wrapper = styled.div(({ theme }) => ({ }, })); -const Icon = styled(Icons)(({ theme }) => ({ +const Icon = styled(Icons)({ height: 10, width: 10, minWidth: 10, - color: theme.textMutedColor, marginRight: 10, transition: 'transform 0.1s ease-in-out', - alignSelf: 'center', - display: 'inline-flex', -})); + verticalAlign: 'inherit', +}); const HeaderBar = styled.div(({ theme }) => ({ padding: theme.layoutMargin, @@ -78,7 +76,6 @@ export const Item = (props: ItemProps) => { onToggle(!open)} role="button"> Date: Mon, 9 Oct 2023 16:23:47 +0900 Subject: [PATCH 002/115] fix: remove negative margin when layout is centered or padded --- code/ui/blocks/src/components/Preview.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/code/ui/blocks/src/components/Preview.tsx b/code/ui/blocks/src/components/Preview.tsx index 18306e8e4da9..a4651ba72184 100644 --- a/code/ui/blocks/src/components/Preview.tsx +++ b/code/ui/blocks/src/components/Preview.tsx @@ -52,7 +52,6 @@ const ChildrenContainer = styled.div( layout === 'centered' || layout === 'padded' ? { padding: '30px 20px', - margin: -10, '& .innerZoomElementWrapper > *': { width: 'auto', border: '10px solid transparent!important', From 1ad0785220c3356cd2397290fbab934a2068194f Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 31 Oct 2023 11:41:10 +0100 Subject: [PATCH 003/115] move react and @storybook from peer deps to dev deps --- code/addons/a11y/package.json | 26 +++++--------- code/addons/actions/package.json | 36 +++++++------------ code/addons/backgrounds/package.json | 24 ++++--------- code/addons/controls/package.json | 20 ++++------- code/addons/interactions/package.json | 30 ++++++---------- code/addons/jest/package.json | 24 ++++--------- code/addons/links/package.json | 11 +++--- code/addons/measure/package.json | 22 ++++-------- code/addons/outline/package.json | 22 ++++-------- code/addons/storysource/package.json | 25 ++++--------- code/addons/themes/package.json | 18 ++-------- code/addons/toolbars/package.json | 20 +++-------- code/addons/viewport/package.json | 21 +++-------- code/deprecated/addons/package.json | 4 --- code/deprecated/manager-api-shim/package.json | 12 ------- code/frameworks/angular/package.json | 3 -- code/frameworks/ember/package.json | 4 +-- code/frameworks/html-webpack5/package.json | 4 +-- code/frameworks/preact-webpack5/package.json | 4 +-- code/frameworks/server-webpack5/package.json | 4 --- code/frameworks/svelte-webpack5/package.json | 2 -- code/frameworks/vue-vite/package.json | 2 -- code/frameworks/vue-webpack5/package.json | 2 -- code/frameworks/vue3-vite/package.json | 2 -- code/frameworks/vue3-webpack5/package.json | 2 -- .../web-components-vite/package.json | 4 --- .../web-components-webpack5/package.json | 4 +-- code/lib/manager-api/package.json | 22 ++++++------ code/lib/preview-api/package.json | 1 - code/lib/router/package.json | 6 ++-- code/lib/source-loader/package.json | 4 --- 31 files changed, 103 insertions(+), 282 deletions(-) diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index b7c4447b294a..c7e4fca85b7c 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -61,10 +61,12 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { - "@storybook/addon-highlight": "workspace:*", + "@storybook/addon-highlight": "workspace:*" + }, + "devDependencies": { "@storybook/channels": "workspace:*", "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", @@ -74,27 +76,15 @@ "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", + "@testing-library/react": "^11.2.2", "axe-core": "^4.2.0", "lodash": "^4.17.21", - "react-resize-detector": "^7.1.2" - }, - "devDependencies": { - "@testing-library/react": "^11.2.2", + "react": "^16.8.0", + "react-dom": "^16.8.0", + "react-resize-detector": "^7.1.2", "resize-observer-polyfill": "^1.5.1", "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - }, "publishConfig": { "access": "public" }, diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index f83e8bc69038..33dbe09ebc2d 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -81,40 +81,30 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "workspace:*", - "@storybook/components": "workspace:*", - "@storybook/core-events": "workspace:*", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "workspace:*", - "@storybook/preview-api": "workspace:*", - "@storybook/theming": "workspace:*", - "@storybook/types": "workspace:*", + "@types/lodash": "^4.14.167", + "@types/uuid": "^9.0.1", "dequal": "^2.0.2", "lodash": "^4.17.21", "polished": "^4.2.2", - "prop-types": "^15.7.2", - "react-inspector": "^6.0.0", "telejson": "^7.2.0", "ts-dedent": "^2.0.0", "uuid": "^9.0.0" }, "devDependencies": { - "@types/lodash": "^4.14.167", - "@types/uuid": "^9.0.1", + "@storybook/client-logger": "workspace:*", + "@storybook/components": "workspace:*", + "@storybook/core-events": "workspace:*", + "@storybook/manager-api": "workspace:*", + "@storybook/preview-api": "workspace:*", + "@storybook/theming": "workspace:*", + "@storybook/types": "workspace:*", + "prop-types": "^15.7.2", + "react": "^16.8.0", + "react-dom": "^16.8.0", + "react-inspector": "^6.0.0", "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - }, "publishConfig": { "access": "public" }, diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index 3615aabc45aa..34d8b47c9268 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -77,32 +77,22 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { + "@storybook/global": "^5.0.0", + "memoizerific": "^1.11.3", + "ts-dedent": "^2.0.0" + }, + "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-events": "workspace:*", - "@storybook/global": "^5.0.0", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", - "memoizerific": "^1.11.3", - "ts-dedent": "^2.0.0" - }, - "devDependencies": { + "react": "^16.8.0", + "react-dom": "^16.8.0", "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - }, "publishConfig": { "access": "public" }, diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index b91fbab0e762..bc6c44fc4da0 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -69,6 +69,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { + "lodash": "^4.17.21", + "ts-dedent": "^2.0.0" + }, + "devDependencies": { "@storybook/blocks": "workspace:*", "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", @@ -79,20 +83,8 @@ "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", - "lodash": "^4.17.21", - "ts-dedent": "^2.0.0" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } + "react": "^16.8.0", + "react-dom": "^16.8.0" }, "publishConfig": { "access": "public" diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index f2cf6bcfd25a..115019706e95 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -73,15 +73,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "workspace:*", - "@storybook/components": "workspace:*", - "@storybook/core-common": "workspace:*", - "@storybook/core-events": "workspace:*", "@storybook/global": "^5.0.0", - "@storybook/instrumenter": "workspace:*", - "@storybook/manager-api": "workspace:*", - "@storybook/preview-api": "workspace:*", - "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", "jest-mock": "^27.0.6", "polished": "^4.2.2", @@ -89,24 +81,22 @@ }, "devDependencies": { "@devtools-ds/object-inspector": "^1.1.2", + "@storybook/client-logger": "workspace:*", + "@storybook/components": "workspace:*", + "@storybook/core-common": "workspace:*", + "@storybook/core-events": "workspace:*", + "@storybook/instrumenter": "workspace:*", "@storybook/jest": "next", + "@storybook/manager-api": "workspace:*", + "@storybook/preview-api": "workspace:*", "@storybook/testing-library": "next", + "@storybook/theming": "workspace:*", "@types/node": "^18.0.0", "formik": "^2.2.9", + "react": "^16.8.0", + "react-dom": "^16.8.0", "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - }, "publishConfig": { "access": "public" }, diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index db1c1cca97c6..71d203b5d024 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -71,32 +71,22 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { + "@storybook/global": "^5.0.0", + "tiny-invariant": "^1.3.1", + "upath": "^2.0.1" + }, + "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-events": "workspace:*", - "@storybook/global": "^5.0.0", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", + "react": "^16.8.0", + "react-dom": "^16.8.0", "react-resize-detector": "^7.1.2", - "tiny-invariant": "^1.3.1", - "upath": "^2.0.1" - }, - "devDependencies": { "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - }, "publishConfig": { "access": "public" }, diff --git a/code/addons/links/package.json b/code/addons/links/package.json index fabf13f85980..b7d99d23c33f 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -81,18 +81,17 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/client-logger": "workspace:*", - "@storybook/core-events": "workspace:*", "@storybook/csf": "^0.1.0", "@storybook/global": "^5.0.0", + "ts-dedent": "^2.0.0" + }, + "devDependencies": { + "@storybook/client-logger": "workspace:*", + "@storybook/core-events": "workspace:*", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/router": "workspace:*", "@storybook/types": "workspace:*", - "prop-types": "^15.7.2", - "ts-dedent": "^2.0.0" - }, - "devDependencies": { "fs-extra": "^11.1.0", "typescript": "~4.9.3" }, diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index 33e427def043..ca65b77e0be0 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -76,30 +76,20 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { + "@storybook/global": "^5.0.0", + "tiny-invariant": "^1.3.1" + }, + "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-events": "workspace:*", - "@storybook/global": "^5.0.0", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/types": "workspace:*", - "tiny-invariant": "^1.3.1" - }, - "devDependencies": { + "react": "^16.8.0", + "react-dom": "^16.8.0", "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - }, "publishConfig": { "access": "public" }, diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index ec9d26a4c0ba..87b2049b6c8f 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -79,30 +79,20 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { + "@storybook/global": "^5.0.0", + "ts-dedent": "^2.0.0" + }, + "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-events": "workspace:*", - "@storybook/global": "^5.0.0", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/types": "workspace:*", - "ts-dedent": "^2.0.0" - }, - "devDependencies": { + "react": "^16.8.0", + "react-dom": "^16.8.0", "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - }, "publishConfig": { "access": "public" }, diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index 291c6f2b7754..8a025c757118 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -54,6 +54,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { + "estraverse": "^5.2.0", + "tiny-invariant": "^1.3.1" + }, + "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/manager-api": "workspace:*", @@ -61,28 +65,13 @@ "@storybook/router": "workspace:*", "@storybook/source-loader": "workspace:*", "@storybook/theming": "workspace:*", - "estraverse": "^5.2.0", - "prop-types": "^15.7.2", - "react-syntax-highlighter": "^15.5.0", - "tiny-invariant": "^1.3.1" - }, - "devDependencies": { "@types/react": "^16.14.34", "@types/react-syntax-highlighter": "11.0.5", + "react": "^16.8.0", + "react-dom": "^16.8.0", + "react-syntax-highlighter": "^15.5.0", "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - }, "publishConfig": { "access": "public" }, diff --git a/code/addons/themes/package.json b/code/addons/themes/package.json index d92d206471ab..bc5abc7bf716 100644 --- a/code/addons/themes/package.json +++ b/code/addons/themes/package.json @@ -74,6 +74,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { + "ts-dedent": "^2.0.0" + }, + "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-events": "workspace:*", @@ -81,23 +84,8 @@ "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", - "ts-dedent": "^2.0.0" - }, - "devDependencies": { "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - }, "publishConfig": { "access": "public" }, diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index e3907a368d01..c790d19ab9a0 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -68,28 +68,16 @@ "check": "../../../scripts/prepare/check.ts", "prep": "../../../scripts/prepare/bundle.ts" }, - "dependencies": { + "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", - "@storybook/theming": "workspace:*" - }, - "devDependencies": { + "@storybook/theming": "workspace:*", + "react": "^16.8.0", + "react-dom": "^16.8.0", "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - }, "publishConfig": { "access": "public" }, diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index dca40fc0913e..8f7fe6f22268 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -74,6 +74,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { + "memoizerific": "^1.11.3" + }, + "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-events": "workspace:*", @@ -81,24 +84,10 @@ "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", - "memoizerific": "^1.11.3", - "prop-types": "^15.7.2" - }, - "devDependencies": { + "react": "^16.8.0", + "react-dom": "^16.8.0", "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - }, "publishConfig": { "access": "public" }, diff --git a/code/deprecated/addons/package.json b/code/deprecated/addons/package.json index 961dfe7ea3f4..e65a247f1dcc 100644 --- a/code/deprecated/addons/package.json +++ b/code/deprecated/addons/package.json @@ -48,10 +48,6 @@ "@storybook/preview-api": "workspace:*", "@storybook/types": "workspace:*" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, "publishConfig": { "access": "public" }, diff --git a/code/deprecated/manager-api-shim/package.json b/code/deprecated/manager-api-shim/package.json index 58d4f764459f..d4ce9b661516 100644 --- a/code/deprecated/manager-api-shim/package.json +++ b/code/deprecated/manager-api-shim/package.json @@ -46,18 +46,6 @@ "@storybook/client-logger": "workspace:*", "@storybook/manager-api": "workspace:*" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - } - }, "publishConfig": { "access": "public" }, diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index 6e43cde9f465..6b95c6fd0eb9 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -46,7 +46,6 @@ "@storybook/core-webpack": "workspace:*", "@storybook/docs-tools": "workspace:*", "@storybook/global": "^5.0.0", - "@storybook/manager-api": "workspace:*", "@storybook/node-logger": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/telemetry": "workspace:*", @@ -102,8 +101,6 @@ "@angular/platform-browser": ">=14.1.0 < 17.0.0", "@angular/platform-browser-dynamic": ">=14.1.0 < 17.0.0", "@babel/core": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", "rxjs": "^6.0.0 || ^7.4.0", "typescript": "^4.0.0 || ^5.0.0", "zone.js": ">= 0.11.1 < 1.0.0" diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index 8d814a49eea3..d377e03aa654 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -49,9 +49,7 @@ "@types/ember__component": "4.0.8", "babel-plugin-ember-modules-api-polyfill": "^2.12.0", "babel-plugin-htmlbars-inline-precompile": "2 || 3", - "ember-source": "~3.28.1", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + "ember-source": "~3.28.1" }, "engines": { "node": ">=16.0.0" diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index 0c3a6b8ed06e..4493641dc31d 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -58,9 +58,7 @@ "typescript": "~4.9.3" }, "peerDependencies": { - "@babel/core": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + "@babel/core": "*" }, "engines": { "node": ">=16.0.0" diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index c29cf3bf9390..e6e64e5a5bf2 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -59,9 +59,7 @@ }, "peerDependencies": { "@babel/core": "*", - "preact": "^8.0.0||^10.0.0", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + "preact": "^8.0.0||^10.0.0" }, "engines": { "node": ">=16.0.0" diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index adff9861ad8f..0cfb92706892 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -56,10 +56,6 @@ "devDependencies": { "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, "engines": { "node": ">=16.0.0" }, diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index 211dc8619d79..c330271913b5 100644 --- a/code/frameworks/svelte-webpack5/package.json +++ b/code/frameworks/svelte-webpack5/package.json @@ -59,8 +59,6 @@ }, "peerDependencies": { "@babel/core": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", "svelte": "^3.48.0 || ^4.0.0", "svelte-loader": "*" }, diff --git a/code/frameworks/vue-vite/package.json b/code/frameworks/vue-vite/package.json index 02530f95c3af..e960ac9c81d6 100644 --- a/code/frameworks/vue-vite/package.json +++ b/code/frameworks/vue-vite/package.json @@ -60,8 +60,6 @@ "vue": "^2.7.10" }, "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", "vite": "^3.0.0 || ^4.0.0 || ^5.0.0", "vue": "^2.7.0" }, diff --git a/code/frameworks/vue-webpack5/package.json b/code/frameworks/vue-webpack5/package.json index 409f59dcc0d2..fbbd912661f5 100644 --- a/code/frameworks/vue-webpack5/package.json +++ b/code/frameworks/vue-webpack5/package.json @@ -63,8 +63,6 @@ "@babel/core": "*", "babel-loader": "^7.0.0 || ^8.0.0 || ^9.0.0", "css-loader": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", "vue": "^2.6.8", "vue-loader": "^15.7.0", "vue-template-compiler": "^2.6.8" diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index 7bfa46d097ba..4bb6a82a0a0b 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -60,8 +60,6 @@ "vite": "^4.0.0" }, "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" }, "engines": { diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index 109fd849241d..8dad80dfe875 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -62,8 +62,6 @@ "@babel/core": "*", "@vue/compiler-sfc": "^3.0.0", "babel-loader": "^7.0.0 || ^8.0.0 || ^9.0.0", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", "vue": "^3.0.0" }, "engines": { diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index a0a54ed82570..bbaa29a65aa1 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -57,10 +57,6 @@ "@types/node": "^18.0.0", "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, "engines": { "node": "^14.18 || >=16" }, diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index 04846971c98d..2bc432111c59 100644 --- a/code/frameworks/web-components-webpack5/package.json +++ b/code/frameworks/web-components-webpack5/package.json @@ -62,9 +62,7 @@ "typescript": "~4.9.3" }, "peerDependencies": { - "lit": "^2.0.0 || ^3.0.0", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + "lit": "^2.0.0 || ^3.0.0" }, "engines": { "node": ">=16.0.0" diff --git a/code/lib/manager-api/package.json b/code/lib/manager-api/package.json index 7f5049fd3220..0236eb95bf97 100644 --- a/code/lib/manager-api/package.json +++ b/code/lib/manager-api/package.json @@ -43,14 +43,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "workspace:*", - "@storybook/client-logger": "workspace:*", - "@storybook/core-events": "workspace:*", - "@storybook/csf": "^0.1.0", - "@storybook/global": "^5.0.0", - "@storybook/router": "workspace:*", - "@storybook/theming": "workspace:*", - "@storybook/types": "workspace:*", "dequal": "^2.0.2", "lodash": "^4.17.21", "memoizerific": "^1.11.3", @@ -61,16 +53,22 @@ }, "devDependencies": { "@jest/globals": "^29.3.1", + "@storybook/channels": "workspace:*", + "@storybook/client-logger": "workspace:*", + "@storybook/core-events": "workspace:*", + "@storybook/csf": "^0.1.0", + "@storybook/global": "^5.0.0", + "@storybook/router": "workspace:*", + "@storybook/theming": "workspace:*", + "@storybook/types": "workspace:*", "@types/lodash": "^4.14.167", "@types/qs": "^6", "flush-promises": "^1.0.2", "qs": "^6.10.0", + "react": "^16.8.0", + "react-dom": "^16.8.0", "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, "publishConfig": { "access": "public" }, diff --git a/code/lib/preview-api/package.json b/code/lib/preview-api/package.json index 19f8e142ea5a..8ca98275a338 100644 --- a/code/lib/preview-api/package.json +++ b/code/lib/preview-api/package.json @@ -87,7 +87,6 @@ "@jest/globals": "^29.5.0", "@storybook/core-common": "workspace:*", "ansi-to-html": "^0.6.11", - "react": "^16.14.0", "slash": "^5.0.0" }, "publishConfig": { diff --git a/code/lib/router/package.json b/code/lib/router/package.json index d178b97ad1e7..5879f8c9dff0 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -57,14 +57,12 @@ "@storybook/global": "^5.0.0", "dequal": "^2.0.2", "lodash": "^4.17.21", + "react": "^16.8.0", + "react-dom": "^16.8.0", "react-router-dom": "6.0.2", "ts-dedent": "^2.0.0", "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, "publishConfig": { "access": "public" }, diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json index a3a8240f147d..f11477663256 100644 --- a/code/lib/source-loader/package.json +++ b/code/lib/source-loader/package.json @@ -55,10 +55,6 @@ "jest-specific-snapshot": "^8.0.0", "typescript": "~4.9.3" }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" - }, "publishConfig": { "access": "public" }, From c2b2b1ac42c10ac1dd8b534b9a6de1dee61278b3 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Tue, 31 Oct 2023 15:33:10 +0100 Subject: [PATCH 004/115] globalize packages when bundling --- code/addons/a11y/package.json | 2 +- code/lib/manager-api/src/globals.ts | 14 ++ code/lib/manager-api/src/index.tsx | 2 + code/ui/manager/src/globals/exports.ts | 2 + code/yarn.lock | 175 ++++--------------------- scripts/prepare/bundle.ts | 16 +++ 6 files changed, 62 insertions(+), 149 deletions(-) create mode 100644 code/lib/manager-api/src/globals.ts diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index c7e4fca85b7c..c67948b5e1dc 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -61,7 +61,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addon-highlight": "workspace:*" diff --git a/code/lib/manager-api/src/globals.ts b/code/lib/manager-api/src/globals.ts new file mode 100644 index 000000000000..04328c6bd040 --- /dev/null +++ b/code/lib/manager-api/src/globals.ts @@ -0,0 +1,14 @@ +// keep in sync with code/ui/manager/src/globals/types.ts +export const GLOBALIZED_PACKAGES = [ + 'react', + 'react-dom', + '@storybook/components', + '@storybook/channels', + '@storybook/core-events', + '@storybook/router', + '@storybook/theming', + '@storybook/api', + '@storybook/manager-api', + '@storybook/addons', + '@storybook/client-logger', +]; diff --git a/code/lib/manager-api/src/index.tsx b/code/lib/manager-api/src/index.tsx index 951dc494a93a..9e1a8b802358 100644 --- a/code/lib/manager-api/src/index.tsx +++ b/code/lib/manager-api/src/index.tsx @@ -506,5 +506,7 @@ export function useArgTypes(): ArgTypes { export { addons } from './lib/addons'; +export { GLOBALIZED_PACKAGES } from './globals'; + /* deprecated */ export { mockChannel, types, type Addon, type AddonStore } from './lib/addons'; diff --git a/code/ui/manager/src/globals/exports.ts b/code/ui/manager/src/globals/exports.ts index ef2523f0e06a..c51d42680e37 100644 --- a/code/ui/manager/src/globals/exports.ts +++ b/code/ui/manager/src/globals/exports.ts @@ -215,6 +215,7 @@ export default { '@storybook/api': [ 'ActiveTabs', 'Consumer', + 'GLOBALIZED_PACKAGES', 'ManagerContext', 'Provider', 'addons', @@ -247,6 +248,7 @@ export default { '@storybook/manager-api': [ 'ActiveTabs', 'Consumer', + 'GLOBALIZED_PACKAGES', 'ManagerContext', 'Provider', 'addons', diff --git a/code/yarn.lock b/code/yarn.lock index bdd11c54000c..be92a427d622 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5788,17 +5788,11 @@ __metadata: "@testing-library/react": ^11.2.2 axe-core: ^4.2.0 lodash: ^4.17.21 + react: ^16.8.0 + react-dom: ^16.8.0 react-resize-detector: ^7.1.2 resize-observer-polyfill: ^1.5.1 typescript: ~4.9.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true languageName: unknown linkType: soft @@ -5820,19 +5814,13 @@ __metadata: lodash: ^4.17.21 polished: ^4.2.2 prop-types: ^15.7.2 + react: ^16.8.0 + react-dom: ^16.8.0 react-inspector: ^6.0.0 telejson: ^7.2.0 ts-dedent: ^2.0.0 typescript: ~4.9.3 uuid: ^9.0.0 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true languageName: unknown linkType: soft @@ -5849,16 +5837,10 @@ __metadata: "@storybook/theming": "workspace:*" "@storybook/types": "workspace:*" memoizerific: ^1.11.3 + react: ^16.8.0 + react-dom: ^16.8.0 ts-dedent: ^2.0.0 typescript: ~4.9.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true languageName: unknown linkType: soft @@ -5877,15 +5859,9 @@ __metadata: "@storybook/theming": "workspace:*" "@storybook/types": "workspace:*" lodash: ^4.17.21 + react: ^16.8.0 + react-dom: ^16.8.0 ts-dedent: ^2.0.0 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true languageName: unknown linkType: soft @@ -6005,16 +5981,10 @@ __metadata: formik: ^2.2.9 jest-mock: ^27.0.6 polished: ^4.2.2 + react: ^16.8.0 + react-dom: ^16.8.0 ts-dedent: ^2.2.0 typescript: ~4.9.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true languageName: unknown linkType: soft @@ -6029,18 +5999,12 @@ __metadata: "@storybook/manager-api": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/theming": "workspace:*" + react: ^16.8.0 + react-dom: ^16.8.0 react-resize-detector: ^7.1.2 tiny-invariant: ^1.3.1 typescript: ~4.9.3 upath: ^2.0.1 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true languageName: unknown linkType: soft @@ -6057,7 +6021,6 @@ __metadata: "@storybook/router": "workspace:*" "@storybook/types": "workspace:*" fs-extra: ^11.1.0 - prop-types: ^15.7.2 ts-dedent: ^2.0.0 typescript: ~4.9.3 peerDependencies: @@ -6093,16 +6056,10 @@ __metadata: "@storybook/manager-api": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/types": "workspace:*" + react: ^16.8.0 + react-dom: ^16.8.0 tiny-invariant: ^1.3.1 typescript: ~4.9.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true languageName: unknown linkType: soft @@ -6117,16 +6074,10 @@ __metadata: "@storybook/manager-api": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/types": "workspace:*" + react: ^16.8.0 + react-dom: ^16.8.0 ts-dedent: ^2.0.0 typescript: ~4.9.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true languageName: unknown linkType: soft @@ -6254,18 +6205,11 @@ __metadata: "@types/react": ^16.14.34 "@types/react-syntax-highlighter": 11.0.5 estraverse: ^5.2.0 - prop-types: ^15.7.2 + react: ^16.8.0 + react-dom: ^16.8.0 react-syntax-highlighter: ^15.5.0 tiny-invariant: ^1.3.1 typescript: ~4.9.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true languageName: unknown linkType: soft @@ -6282,14 +6226,6 @@ __metadata: "@storybook/types": "workspace:*" ts-dedent: ^2.0.0 typescript: ~4.9.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true languageName: unknown linkType: soft @@ -6302,15 +6238,9 @@ __metadata: "@storybook/manager-api": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/theming": "workspace:*" + react: ^16.8.0 + react-dom: ^16.8.0 typescript: ~4.9.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true languageName: unknown linkType: soft @@ -6326,16 +6256,9 @@ __metadata: "@storybook/preview-api": "workspace:*" "@storybook/theming": "workspace:*" memoizerific: ^1.11.3 - prop-types: ^15.7.2 + react: ^16.8.0 + react-dom: ^16.8.0 typescript: ~4.9.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true languageName: unknown linkType: soft @@ -6346,9 +6269,6 @@ __metadata: "@storybook/manager-api": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/types": "workspace:*" - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -6377,7 +6297,6 @@ __metadata: "@storybook/core-webpack": "workspace:*" "@storybook/docs-tools": "workspace:*" "@storybook/global": ^5.0.0 - "@storybook/manager-api": "workspace:*" "@storybook/node-logger": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/telemetry": "workspace:*" @@ -6417,8 +6336,6 @@ __metadata: "@angular/platform-browser": ">=14.1.0 < 17.0.0" "@angular/platform-browser-dynamic": ">=14.1.0 < 17.0.0" "@babel/core": "*" - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 rxjs: ^6.0.0 || ^7.4.0 typescript: ^4.0.0 || ^5.0.0 zone.js: ">= 0.11.1 < 1.0.0" @@ -6434,14 +6351,6 @@ __metadata: dependencies: "@storybook/client-logger": "workspace:*" "@storybook/manager-api": "workspace:*" - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true languageName: unknown linkType: soft @@ -7066,8 +6975,6 @@ __metadata: babel-plugin-ember-modules-api-polyfill: ^2.12.0 babel-plugin-htmlbars-inline-precompile: 2 || 3 ember-source: ~3.28.1 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -7126,8 +7033,6 @@ __metadata: typescript: ~4.9.3 peerDependencies: "@babel/core": "*" - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -7229,14 +7134,13 @@ __metadata: lodash: ^4.17.21 memoizerific: ^1.11.3 qs: ^6.10.0 + react: ^16.8.0 + react-dom: ^16.8.0 semver: ^7.3.7 store2: ^2.14.2 telejson: ^7.2.0 ts-dedent: ^2.0.0 typescript: ~4.9.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -7410,8 +7314,6 @@ __metadata: peerDependencies: "@babel/core": "*" preact: ^8.0.0||^10.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -7635,7 +7537,6 @@ __metadata: lodash: ^4.17.21 memoizerific: ^1.11.3 qs: ^6.10.0 - react: ^16.14.0 slash: ^5.0.0 synchronous-promise: ^2.0.15 ts-dedent: ^2.0.0 @@ -7981,12 +7882,11 @@ __metadata: lodash: ^4.17.21 memoizerific: ^1.11.3 qs: ^6.10.0 + react: ^16.8.0 + react-dom: ^16.8.0 react-router-dom: 6.0.2 ts-dedent: ^2.0.0 typescript: ~4.9.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -8000,9 +7900,6 @@ __metadata: "@storybook/server": "workspace:*" "@types/node": ^18.0.0 typescript: ~4.9.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -8035,9 +7932,6 @@ __metadata: lodash: ^4.17.21 prettier: ^2.8.0 typescript: ~4.9.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -8085,8 +7979,6 @@ __metadata: typescript: ~4.9.3 peerDependencies: "@babel/core": "*" - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 svelte: ^3.48.0 || ^4.0.0 svelte-loader: "*" languageName: unknown @@ -8228,8 +8120,6 @@ __metadata: vue: ^2.7.10 vue-docgen-api: ^4.40.0 peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 vite: ^3.0.0 || ^4.0.0 || ^5.0.0 vue: ^2.7.0 languageName: unknown @@ -8252,8 +8142,6 @@ __metadata: "@babel/core": "*" babel-loader: ^7.0.0 || ^8.0.0 || ^9.0.0 css-loader: "*" - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 vue: ^2.6.8 vue-loader: ^15.7.0 vue-template-compiler: ^2.6.8 @@ -8274,8 +8162,6 @@ __metadata: vite: ^4.0.0 vue-docgen-api: ^4.40.0 peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 vite: ^3.0.0 || ^4.0.0 || ^5.0.0 languageName: unknown linkType: soft @@ -8296,8 +8182,6 @@ __metadata: "@babel/core": "*" "@vue/compiler-sfc": ^3.0.0 babel-loader: ^7.0.0 || ^8.0.0 || ^9.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 vue: ^3.0.0 languageName: unknown linkType: soft @@ -8365,9 +8249,6 @@ __metadata: "@types/node": ^18.0.0 magic-string: ^0.30.0 typescript: ~4.9.3 - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -8385,8 +8266,6 @@ __metadata: typescript: ~4.9.3 peerDependencies: lit: ^2.0.0 || ^3.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -27305,7 +27184,7 @@ __metadata: languageName: node linkType: hard -"react@npm:^16.14.0": +"react@npm:^16.14.0, react@npm:^16.8.0": version: 16.14.0 resolution: "react@npm:16.14.0" dependencies: diff --git a/scripts/prepare/bundle.ts b/scripts/prepare/bundle.ts index a15f71cd6a34..e1c4715a260a 100755 --- a/scripts/prepare/bundle.ts +++ b/scripts/prepare/bundle.ts @@ -63,6 +63,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { ...extraExternals, ...Object.keys(dependencies || {}), ...Object.keys(peerDependencies || {}), + ...GLOBALIZED_PACKAGES, ]; const allEntries = entries.map((e: string) => slash(join(cwd, e))); @@ -157,6 +158,21 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { /* UTILS */ +// keep in sync with code/lib/manager-api/src/index.ts +const GLOBALIZED_PACKAGES = [ + 'react', + 'react-dom', + '@storybook/components', + '@storybook/channels', + '@storybook/core-events', + '@storybook/router', + '@storybook/theming', + '@storybook/api', + '@storybook/manager-api', + '@storybook/addons', + '@storybook/client-logger', +]; + async function getDTSConfigs({ formats, entries, From 6538477c3e243d7ea99c2f6fc3e6170786dbc230 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 1 Nov 2023 11:33:47 +0100 Subject: [PATCH 005/115] add feature for fast-build based on `--test` CLI flag --- code/lib/core-server/src/presets/common-preset.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts index 8d2ac3b7e2d4..360688f613ff 100644 --- a/code/lib/core-server/src/presets/common-preset.ts +++ b/code/lib/core-server/src/presets/common-preset.ts @@ -185,8 +185,13 @@ export const previewAnnotations = async (base: any, options: Options) => { return [...config, ...base]; }; +const fastBuildFeatures = (value: boolean) => ({ + fastBuildEmptyBlocks: value, +}); + export const features = async ( - existing: StorybookConfig['features'] + existing: StorybookConfig['features'], + options: Options ): Promise => ({ ...existing, warnOnLegacyHierarchySeparator: true, @@ -194,6 +199,7 @@ export const features = async ( storyStoreV7: true, argTypeTargetsV7: true, legacyDecoratorFileOrder: false, + ...fastBuildFeatures(!!options.test), }); export const csfIndexer: Indexer = { From 9a72ed04cc3c407c59edc0776b195e8ae392fa4e Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 1 Nov 2023 13:35:24 +0100 Subject: [PATCH 006/115] globalize `@storybook/blocks` if `fastBuildEmptyBlocks` is set to true --- code/builders/builder-vite/src/vite-config.ts | 6 ++++++ .../builder-webpack5/src/preview/iframe-webpack.config.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/code/builders/builder-vite/src/vite-config.ts b/code/builders/builder-vite/src/vite-config.ts index 24db49249909..a38bd8bb52d5 100644 --- a/code/builders/builder-vite/src/vite-config.ts +++ b/code/builders/builder-vite/src/vite-config.ts @@ -77,6 +77,12 @@ export async function commonConfig( export async function pluginConfig(options: Options) { const frameworkName = await getFrameworkName(options); + const { features } = options; + const globalsObj: Record = globals; + + if (features?.fastBuildEmptyBlocks) { + globalsObj['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; + } const plugins = [ codeGeneratorPlugin(options), diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index 01b294f48fb0..d5a67c7e2730 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -217,6 +217,12 @@ export default async ( `); } + const globalObj: Record = globals; + + if (features?.fastBuildEmptyBlocks) { + globalObj['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; + } + return { name: 'preview', mode: isProd ? 'production' : 'development', From bbcf2bc812714af85eedbe85fd207a31218632ca Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 1 Nov 2023 13:56:08 +0100 Subject: [PATCH 007/115] add test flag to CLIoptions add fastBuildEmptyBlocks to features interface --- code/lib/types/src/modules/core-common.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index 0f2a9f54c271..056129678c58 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -156,6 +156,7 @@ export interface CLIOptions { quiet?: boolean; versionUpdates?: boolean; docs?: boolean; + test?: boolean; debugWebpack?: boolean; webpackStatsJson?: string | boolean; outputDir?: string; @@ -310,6 +311,11 @@ export interface StorybookConfig { * Apply decorators from preview.js before decorators from addons or frameworks */ legacyDecoratorFileOrder?: boolean; + + /** + * Globalize @storybook/blocks + */ + fastBuildEmptyBlocks?: boolean; }; /** From ab399bda457fb6440eb06962fbc5b8e68fb1e2b8 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 2 Nov 2023 09:50:40 +0100 Subject: [PATCH 008/115] use separate bundling technique for addons, manager packages --- code/addons/a11y/package.json | 35 +-- code/addons/actions/package.json | 36 +-- code/addons/backgrounds/package.json | 44 +-- code/addons/controls/package.json | 33 +- code/addons/essentials/package.json | 115 ++----- code/addons/gfm/package.json | 19 +- code/addons/highlight/package.json | 30 +- code/addons/interactions/package.json | 47 +-- code/addons/jest/package.json | 34 +- code/addons/links/package.json | 46 +-- code/addons/measure/package.json | 30 +- code/addons/outline/package.json | 43 +-- code/addons/storysource/package.json | 23 +- code/addons/themes/package.json | 37 +-- code/addons/toolbars/package.json | 33 +- code/addons/viewport/package.json | 43 +-- .../src/utils/warnOnIncompatibleAddons.ts | 2 +- code/lib/manager-api/package.json | 18 +- code/lib/manager-api/src/globals.ts | 14 - code/lib/manager-api/src/index.tsx | 2 - code/lib/preview/package.json | 3 + .../preview/scripts/generate-exports-file.ts | 71 +++++ code/lib/preview/src/globals/definitions.ts | 37 +++ code/lib/preview/src/globals/exports.ts | 276 ++++++++++++++++ code/lib/preview/src/globals/types.ts | 5 + code/lib/router/package.json | 14 + code/lib/theming/package.json | 14 + code/ui/manager/src/globals/definitions.ts | 2 + code/ui/manager/src/globals/exports.ts | 3 +- code/ui/manager/src/globals/runtime.ts | 2 + code/ui/manager/src/globals/types.ts | 1 + code/ui/manager/src/typings.d.ts | 1 + code/yarn.lock | 8 +- scripts/package.json | 1 + scripts/prepare/addon-bundle.ts | 296 ++++++++++++++++++ scripts/prepare/bundle.ts | 16 - scripts/yarn.lock | 8 + 37 files changed, 935 insertions(+), 507 deletions(-) delete mode 100644 code/lib/manager-api/src/globals.ts create mode 100644 code/lib/preview/scripts/generate-exports-file.ts create mode 100644 code/lib/preview/src/globals/definitions.ts create mode 100644 code/lib/preview/src/globals/exports.ts create mode 100755 scripts/prepare/addon-bundle.ts diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index c67948b5e1dc..e87a4caa0192 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -32,21 +32,9 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, - "./preview": { - "types": "./dist/preview.d.ts", - "require": "./dist/preview.js", - "import": "./dist/preview.mjs" - }, - "./register": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, + "./manager": "./dist/manager.js", + "./preview": "./dist/preview.js", + "./register": "./dist/manager.js", "./package.json": "./package.json" }, "main": "dist/index.js", @@ -61,23 +49,22 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { - "@storybook/addon-highlight": "workspace:*" + "@storybook/addon-highlight": "workspace:*", + "axe-core": "^4.2.0" }, "devDependencies": { "@storybook/channels": "workspace:*", "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", - "@storybook/core-events": "workspace:*", "@storybook/global": "^5.0.0", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", "@testing-library/react": "^11.2.2", - "axe-core": "^4.2.0", "lodash": "^4.17.21", "react": "^16.8.0", "react-dom": "^16.8.0", @@ -89,9 +76,13 @@ "access": "public" }, "bundler": { - "entries": [ - "./src/index.ts", - "./src/manager.tsx", + "exportEntries": [ + "./src/index.ts" + ], + "managerEntries": [ + "./src/manager.tsx" + ], + "previewEntries": [ "./src/preview.tsx" ] }, diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index 33dbe09ebc2d..3d38d53cb8c7 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -33,21 +33,9 @@ "require": "./dist/decorator.js", "import": "./dist/decorator.mjs" }, - "./manager": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, - "./preview": { - "types": "./dist/preview.d.ts", - "require": "./dist/preview.js", - "import": "./dist/preview.mjs" - }, - "./register.js": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, + "./manager": "./dist/manager.js", + "./preview": "./dist/preview.js", + "./register.js": "./dist/manager.js", "./package.json": "./package.json" }, "main": "dist/index.js", @@ -58,14 +46,8 @@ "*": [ "dist/index.d.ts" ], - "manager": [ - "dist/manager.d.ts" - ], "decorator": [ "dist/decorator.d.ts" - ], - "preview": [ - "dist/preview.d.ts" ] } }, @@ -78,7 +60,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { "@storybook/global": "^5.0.0", @@ -109,10 +91,14 @@ "access": "public" }, "bundler": { - "entries": [ - "./src/index.ts", + "exportEntries": [ "./src/decorator.ts", - "./src/manager.tsx", + "./src/index.ts" + ], + "managerEntries": [ + "./src/manager.tsx" + ], + "previewEntries": [ "./src/preview.ts" ] }, diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index 34d8b47c9268..96784440fbb3 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -32,39 +32,14 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, - "./preview": { - "types": "./dist/preview.d.ts", - "require": "./dist/preview.js", - "import": "./dist/preview.mjs" - }, - "./register": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, + "./manager": "./dist/manager.js", + "./preview": "./dist/preview.js", + "./register": "./dist/manager.js", "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "dist/index.d.ts" - ], - "manager": [ - "dist/manager.d.ts" - ], - "preview": [ - "dist/preview.d.ts" - ] - } - }, "files": [ "dist/**/*", "README.md", @@ -74,7 +49,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { "@storybook/global": "^5.0.0", @@ -84,7 +59,6 @@ "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", - "@storybook/core-events": "workspace:*", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", @@ -97,9 +71,13 @@ "access": "public" }, "bundler": { - "entries": [ - "./src/index.ts", - "./src/manager.tsx", + "exportEntries": [ + "./src/index.ts" + ], + "managerEntries": [ + "./src/manager.tsx" + ], + "previewEntries": [ "./src/preview.tsx" ] }, diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index bc6c44fc4da0..f838241ea31f 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -32,31 +32,13 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, - "./register": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, + "./manager": "./dist/manager.js", + "./register": "./dist/manager.js", "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "dist/index.d.ts" - ], - "manager": [ - "dist/manager.d.ts" - ] - } - }, "files": [ "dist/**/*", "README.md", @@ -66,7 +48,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { "lodash": "^4.17.21", @@ -90,11 +72,12 @@ "access": "public" }, "bundler": { - "entries": [ - "./src/index.ts", - "./src/manager.tsx" + "exportEntries": [ + "./src/index.ts" ], - "platform": "browser" + "managerEntries": [ + "./src/manager.tsx" + ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index d6ce73f6357a..68e464ba1ff8 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -28,81 +28,21 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./actions/preview": { - "types": "./dist/actions/preview.d.ts", - "require": "./dist/actions/preview.js", - "import": "./dist/actions/preview.mjs" - }, - "./actions/manager": { - "types": "./dist/actions/manager.d.ts", - "require": "./dist/actions/manager.js", - "import": "./dist/actions/manager.mjs" - }, - "./backgrounds/preview": { - "types": "./dist/backgrounds/preview.d.ts", - "require": "./dist/backgrounds/preview.js", - "import": "./dist/backgrounds/preview.mjs" - }, - "./backgrounds/manager": { - "types": "./dist/backgrounds/manager.d.ts", - "require": "./dist/backgrounds/manager.js", - "import": "./dist/backgrounds/manager.mjs" - }, - "./controls/manager": { - "types": "./dist/controls/manager.d.ts", - "require": "./dist/controls/manager.js", - "import": "./dist/controls/manager.mjs" - }, - "./docs/preview": { - "types": "./dist/docs/preview.d.ts", - "require": "./dist/docs/preview.js", - "import": "./dist/docs/preview.mjs" - }, - "./docs/preset": { - "types": "./dist/docs/preset.d.ts", - "require": "./dist/docs/preset.js", - "import": "./dist/docs/preset.mjs" - }, - "./docs/mdx-react-shim": { - "types": "./dist/docs/mdx-react-shim.d.ts", - "require": "./dist/docs/mdx-react-shim.js", - "import": "./dist/docs/mdx-react-shim.mjs" - }, - "./highlight/preview": { - "types": "./dist/highlight/preview.d.ts", - "require": "./dist/highlight/preview.js", - "import": "./dist/highlight/preview.mjs" - }, - "./measure/preview": { - "types": "./dist/measure/preview.d.ts", - "require": "./dist/measure/preview.js", - "import": "./dist/measure/preview.mjs" - }, - "./measure/manager": { - "types": "./dist/measure/manager.d.ts", - "require": "./dist/measure/manager.js", - "import": "./dist/measure/manager.mjs" - }, - "./outline/preview": { - "types": "./dist/outline/preview.d.ts", - "require": "./dist/outline/preview.js", - "import": "./dist/outline/preview.mjs" - }, - "./outline/manager": { - "types": "./dist/outline/manager.d.ts", - "require": "./dist/outline/manager.js", - "import": "./dist/outline/manager.mjs" - }, - "./toolbars/manager": { - "types": "./dist/toolbars/manager.d.ts", - "require": "./dist/toolbars/manager.js", - "import": "./dist/toolbars/manager.mjs" - }, - "./viewport/manager": { - "types": "./dist/viewport/manager.d.ts", - "require": "./dist/viewport/manager.js", - "import": "./dist/viewport/manager.mjs" - }, + "./actions/preview": "./dist/actions/preview.js", + "./actions/manager": "./dist/actions/manager.js", + "./backgrounds/preview": "./dist/backgrounds/preview.js", + "./backgrounds/manager": "./dist/backgrounds/manager.js", + "./controls/manager": "./dist/controls/manager.js", + "./docs/preview": "./dist/docs/preview.js", + "./docs/preset": "./dist/docs/preset.js", + "./docs/mdx-react-shim": "./dist/docs/mdx-react-shim.js", + "./highlight/preview": "./dist/highlight/preview.js", + "./measure/preview": "./dist/measure/preview.js", + "./measure/manager": "./dist/measure/manager.js", + "./outline/preview": "./dist/outline/preview.js", + "./outline/manager": "./dist/outline/manager.js", + "./toolbars/manager": "./dist/toolbars/manager.js", + "./viewport/manager": "./dist/viewport/manager.js", "./package.json": "./package.json" }, "main": "dist/index.js", @@ -117,7 +57,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { "@storybook/addon-actions": "workspace:*", @@ -147,25 +87,28 @@ "access": "public" }, "bundler": { - "entries": [ + "nodeEntries": [ "./src/index.ts", - "./src/actions/preview.ts", + "./src/docs/preset.ts", + "./src/docs/mdx-react-shim.ts" + ], + "managerEntries": [ "./src/actions/manager.ts", - "./src/backgrounds/preview.ts", "./src/backgrounds/manager.ts", "./src/controls/manager.ts", - "./src/docs/preview.ts", - "./src/docs/preset.ts", - "./src/docs/mdx-react-shim.ts", - "./src/highlight/preview.ts", - "./src/measure/preview.ts", "./src/measure/manager.ts", - "./src/outline/preview.ts", "./src/outline/manager.ts", "./src/toolbars/manager.ts", "./src/viewport/manager.ts" ], - "platform": "node" + "previewEntries": [ + "./src/actions/preview.ts", + "./src/backgrounds/preview.ts", + "./src/docs/preview.ts", + "./src/highlight/preview.ts", + "./src/measure/preview.ts", + "./src/outline/preview.ts" + ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json index 1172c50bfd7f..9f1017672f6a 100644 --- a/code/addons/gfm/package.json +++ b/code/addons/gfm/package.json @@ -25,16 +25,8 @@ }, "license": "MIT", "exports": { - ".": { - "types": "./dist/index.d.ts", - "node": "./dist/index.js", - "require": "./dist/index.js" - }, - "./preset": { - "types": "./dist/index.d.ts", - "node": "./dist/index.js", - "require": "./dist/index.js" - }, + ".": "./dist/index.js", + "./preset": "./dist/index.js", "./package.json": "./package.json" }, "main": "dist/index.js", @@ -49,7 +41,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { "@storybook/node-logger": "workspace:*", @@ -63,11 +55,8 @@ "access": "public" }, "bundler": { - "entries": [ + "nodeEntries": [ "./src/index.ts" - ], - "formats": [ - "cjs" ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 620a06eb25ea..8a7230d12841 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -30,26 +30,12 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./preview": { - "types": "./dist/preview.d.ts", - "require": "./dist/preview.js", - "import": "./dist/preview.mjs" - }, + "./preview": "./dist/preview.js", "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "dist/index.d.ts" - ], - "preview": [ - "dist/preview.d.ts" - ] - } - }, "files": [ "dist/**/*", "README.md", @@ -59,14 +45,14 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { - "@storybook/core-events": "workspace:*", - "@storybook/global": "^5.0.0", - "@storybook/preview-api": "workspace:*" + "@storybook/global": "^5.0.0" }, "devDependencies": { + "@storybook/core-events": "workspace:*", + "@storybook/preview-api": "workspace:*", "@types/webpack-env": "^1.16.0", "typescript": "~4.9.3" }, @@ -74,8 +60,10 @@ "access": "public" }, "bundler": { - "entries": [ - "./src/index.ts", + "exportEntries": [ + "./src/index.ts" + ], + "previewEntries": [ "./src/preview.ts" ] }, diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index 115019706e95..c87fe8ba90d1 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -28,39 +28,14 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, - "./preview": { - "types": "./dist/preview.d.ts", - "require": "./dist/preview.js", - "import": "./dist/preview.mjs" - }, - "./register.js": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, + "./manager": "./dist/manager.js", + "./preview": "./dist/preview.js", + "./register.js": "./dist/manager.js", "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "dist/index.d.ts" - ], - "manager": [ - "dist/manager.d.ts" - ], - "preview": [ - "dist/preview.d.ts" - ] - } - }, "files": [ "dist/**/*", "README.md", @@ -70,7 +45,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { "@storybook/global": "^5.0.0", @@ -101,10 +76,16 @@ "access": "public" }, "bundler": { - "entries": [ - "./src/index.ts", - "./src/manager.tsx", - "./src/preview.ts", + "exportEntries": [ + "./src/index.ts" + ], + "managerEntries": [ + "./src/manager.tsx" + ], + "previewEntries": [ + "./src/preview.ts" + ], + "nodeEntries": [ "./src/preset.ts" ] }, diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index 71d203b5d024..9baeac4cb6ee 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -34,31 +34,13 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, - "./register": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, + "./manager": "./dist/manager.js", + "./register": "./dist/manager.js", "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "dist/index.d.ts" - ], - "manager": [ - "dist/manager.d.ts" - ] - } - }, "files": [ "dist/**/*", "README.md", @@ -68,11 +50,12 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { "@storybook/global": "^5.0.0", "tiny-invariant": "^1.3.1", + "ts-dedent": "^2.0.0", "upath": "^2.0.1" }, "devDependencies": { @@ -91,11 +74,12 @@ "access": "public" }, "bundler": { - "entries": [ - "./src/index.ts", - "./src/manager.tsx" + "exportEntries": [ + "./src/index.ts" ], - "platform": "browser" + "managerEntries": [ + "./src/manager.tsx" + ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { diff --git a/code/addons/links/package.json b/code/addons/links/package.json index b7d99d23c33f..5943120a1bf8 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -28,26 +28,14 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, - "./preview": { - "types": "./dist/preview.d.ts", - "require": "./dist/preview.js", - "import": "./dist/preview.mjs" - }, "./react": { "types": "./dist/react/index.d.ts", "require": "./dist/react/index.js", "import": "./dist/react/index.mjs" }, - "./register": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, + "./manager": "./dist/manager.js", + "./preview": "./dist/preview.js", + "./register": "./dist/manager.js", "./package.json": "./package.json" }, "main": "dist/index.js", @@ -58,12 +46,6 @@ "*": [ "dist/index.d.ts" ], - "manager": [ - "dist/manager.d.ts" - ], - "preview": [ - "dist/preview.d.ts" - ], "react": [ "dist/react/index.d.ts" ] @@ -78,7 +60,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { "@storybook/csf": "^0.1.0", @@ -96,26 +78,26 @@ "typescript": "~4.9.3" }, "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "peerDependenciesMeta": { "react": { "optional": true - }, - "react-dom": { - "optional": true } }, "publishConfig": { "access": "public" }, "bundler": { - "entries": [ - "./src/index.ts", - "./src/manager.ts", - "./src/preview.ts", - "./src/react/index.ts" + "exportEntries": [ + "./src/react/index.ts", + "./src/index.ts" + ], + "managerEntries": [ + "./src/manager.ts" + ], + "previewEntries": [ + "./src/preview.ts" ], "post": "./scripts/fix-preview-api-reference.ts" }, diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index ca65b77e0be0..8b716663bd69 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -31,21 +31,9 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, - "./preview": { - "types": "./dist/preview.d.ts", - "require": "./dist/preview.js", - "import": "./dist/preview.mjs" - }, - "./register": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, + "./manager": "./dist/manager.js", + "./preview": "./dist/preview.js", + "./register": "./dist/manager.js", "./package.json": "./package.json" }, "main": "dist/index.js", @@ -73,7 +61,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { "@storybook/global": "^5.0.0", @@ -94,9 +82,13 @@ "access": "public" }, "bundler": { - "entries": [ - "./src/index.ts", - "./src/manager.tsx", + "exportEntries": [ + "./src/index.ts" + ], + "managerEntries": [ + "./src/manager.tsx" + ], + "previewEntries": [ "./src/preview.tsx" ] }, diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index 87b2049b6c8f..c0770fd94542 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -34,39 +34,14 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, - "./preview": { - "types": "./dist/preview.d.ts", - "require": "./dist/preview.js", - "import": "./dist/preview.mjs" - }, - "./register": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, + "./manager": "./dist/manager.js", + "./preview": "./dist/preview.js", + "./register": "./dist/manager.js", "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "dist/index.d.ts" - ], - "manager": [ - "dist/manager.d.ts" - ], - "preview": [ - "dist/preview.d.ts" - ] - } - }, "files": [ "dist/**/*", "README.md", @@ -76,7 +51,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { "@storybook/global": "^5.0.0", @@ -97,9 +72,13 @@ "access": "public" }, "bundler": { - "entries": [ - "./src/index.ts", - "./src/manager.tsx", + "exportEntries": [ + "./src/index.ts" + ], + "managerEntries": [ + "./src/manager.tsx" + ], + "previewEntries": [ "./src/preview.tsx" ] }, diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index 8a025c757118..f90898cc2dcb 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -28,15 +28,8 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./preset": { - "types": "./dist/preset.d.ts", - "require": "./dist/preset.js" - }, - "./manager": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, + "./preset": "./dist/preset.js", + "./manager": "./dist/manager.js", "./package.json": "./package.json" }, "main": "dist/index.js", @@ -51,7 +44,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { "estraverse": "^5.2.0", @@ -76,9 +69,13 @@ "access": "public" }, "bundler": { - "entries": [ - "./src/index.ts", - "./src/manager.tsx", + "exportEntries": [ + "./src/index.ts" + ], + "managerEntries": [ + "./src/manager.tsx" + ], + "nodeEntries": [ "./src/preset.ts" ] }, diff --git a/code/addons/themes/package.json b/code/addons/themes/package.json index bc5abc7bf716..63cf379c4852 100644 --- a/code/addons/themes/package.json +++ b/code/addons/themes/package.json @@ -33,35 +33,14 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, - "./preview": { - "types": "./dist/preview.d.ts", - "require": "./dist/preview.js", - "import": "./dist/preview.mjs" - }, + "./manager": "./dist/manager.js", + "./preview": "./dist/preview.js", "./package.json": "./package.json", "./postinstall": "./postinstall.js" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "dist/index.d.ts" - ], - "manager": [ - "dist/manager.d.ts" - ], - "preview": [ - "dist/preview.d.ts" - ] - } - }, "files": [ "dist/**/*", "README.md", @@ -71,7 +50,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { "ts-dedent": "^2.0.0" @@ -90,9 +69,13 @@ "access": "public" }, "bundler": { - "entries": [ - "./src/index.ts", - "./src/manager.tsx", + "exportEntries": [ + "./src/index.ts" + ], + "managerEntries": [ + "./src/manager.tsx" + ], + "previewEntries": [ "./src/preview.tsx" ] }, diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index c790d19ab9a0..4f1fc5f45cc3 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -32,31 +32,13 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, - "./register": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, + "./manager": "./dist/manager.js", + "./register": "./dist/manager.js", "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "dist/index.d.ts" - ], - "manager": [ - "dist/manager.d.ts" - ] - } - }, "files": [ "dist/**/*", "README.md", @@ -66,7 +48,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "devDependencies": { "@storybook/client-logger": "workspace:*", @@ -82,11 +64,12 @@ "access": "public" }, "bundler": { - "entries": [ - "./src/index.ts", - "./src/manager.tsx" + "exportEntries": [ + "./src/index.ts" ], - "platform": "browser" + "managerEntries": [ + "./src/manager.tsx" + ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index 8f7fe6f22268..096b04547331 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -29,39 +29,14 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, - "./preview": { - "types": "./dist/preview.d.ts", - "require": "./dist/preview.ts", - "import": "./dist/preview.mjs" - }, - "./register": { - "types": "./dist/manager.d.ts", - "require": "./dist/manager.js", - "import": "./dist/manager.mjs" - }, + "./manager": "./dist/manager.js", + "./preview": "./dist/preview.ts", + "./register": "./dist/manager.js", "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "dist/index.d.ts" - ], - "manager": [ - "dist/manager.d.ts" - ], - "preview": [ - "dist/preview.d.ts" - ] - } - }, "files": [ "dist/**/*", "README.md", @@ -71,7 +46,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/bundle.ts" + "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { "memoizerific": "^1.11.3" @@ -92,10 +67,14 @@ "access": "public" }, "bundler": { - "entries": [ - "./src/index.ts", + "exportEntries": [ "./src/models/index.ts", - "./src/manager.tsx", + "./src/index.ts" + ], + "managerEntries": [ + "./src/manager.tsx" + ], + "previewEntries": [ "./src/preview.ts" ] }, diff --git a/code/lib/core-server/src/utils/warnOnIncompatibleAddons.ts b/code/lib/core-server/src/utils/warnOnIncompatibleAddons.ts index a850d49809ad..23e17c77bc56 100644 --- a/code/lib/core-server/src/utils/warnOnIncompatibleAddons.ts +++ b/code/lib/core-server/src/utils/warnOnIncompatibleAddons.ts @@ -1,5 +1,5 @@ import type { StorybookConfig } from '@storybook/types'; -import { logger } from '@storybook/client-logger'; +import { logger } from '@storybook/node-logger'; import chalk from 'chalk'; import dedent from 'ts-dedent'; diff --git a/code/lib/manager-api/package.json b/code/lib/manager-api/package.json index 0236eb95bf97..a507a15c944e 100644 --- a/code/lib/manager-api/package.json +++ b/code/lib/manager-api/package.json @@ -43,6 +43,8 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { + "@storybook/csf": "^0.1.0", + "@storybook/global": "^5.0.0", "dequal": "^2.0.2", "lodash": "^4.17.21", "memoizerific": "^1.11.3", @@ -56,8 +58,6 @@ "@storybook/channels": "workspace:*", "@storybook/client-logger": "workspace:*", "@storybook/core-events": "workspace:*", - "@storybook/csf": "^0.1.0", - "@storybook/global": "^5.0.0", "@storybook/router": "workspace:*", "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", @@ -75,6 +75,20 @@ "bundler": { "entries": [ "./src/index.tsx" + ], + "externals": [ + "react", + "react-dom", + "@storybook/addons", + "@storybook/api", + "@storybook/channels", + "@storybook/client-logger", + "@storybook/components", + "@storybook/core-events", + "@storybook/manager-api", + "@storybook/router", + "@storybook/theming", + "@storybook/types" ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" diff --git a/code/lib/manager-api/src/globals.ts b/code/lib/manager-api/src/globals.ts deleted file mode 100644 index 04328c6bd040..000000000000 --- a/code/lib/manager-api/src/globals.ts +++ /dev/null @@ -1,14 +0,0 @@ -// keep in sync with code/ui/manager/src/globals/types.ts -export const GLOBALIZED_PACKAGES = [ - 'react', - 'react-dom', - '@storybook/components', - '@storybook/channels', - '@storybook/core-events', - '@storybook/router', - '@storybook/theming', - '@storybook/api', - '@storybook/manager-api', - '@storybook/addons', - '@storybook/client-logger', -]; diff --git a/code/lib/manager-api/src/index.tsx b/code/lib/manager-api/src/index.tsx index 9e1a8b802358..951dc494a93a 100644 --- a/code/lib/manager-api/src/index.tsx +++ b/code/lib/manager-api/src/index.tsx @@ -506,7 +506,5 @@ export function useArgTypes(): ArgTypes { export { addons } from './lib/addons'; -export { GLOBALIZED_PACKAGES } from './globals'; - /* deprecated */ export { mockChannel, types, type Addon, type AddonStore } from './lib/addons'; diff --git a/code/lib/preview/package.json b/code/lib/preview/package.json index 9815cd1e5982..9e08388ec691 100644 --- a/code/lib/preview/package.json +++ b/code/lib/preview/package.json @@ -62,12 +62,15 @@ "@storybook/global": "^5.0.0", "@storybook/preview-api": "workspace:*", "browser-dtector": "^3.4.0", + "fs-extra": "^11.1.0", + "ts-dedent": "^2.0.0", "typescript": "~4.9.3" }, "publishConfig": { "access": "public" }, "bundler": { + "pre": "./scripts/generate-exports-file.ts", "browserEntries": [ "./src/runtime.ts" ], diff --git a/code/lib/preview/scripts/generate-exports-file.ts b/code/lib/preview/scripts/generate-exports-file.ts new file mode 100644 index 000000000000..afdbea8ff6e6 --- /dev/null +++ b/code/lib/preview/scripts/generate-exports-file.ts @@ -0,0 +1,71 @@ +/* eslint-disable no-console */ +import fs from 'fs-extra'; +import path from 'path'; +import { dedent } from 'ts-dedent'; +import { ESLint } from '../../../../scripts/node_modules/eslint'; +import { values } from '../src/globals/runtime'; + +const location = path.join(__dirname, '..', 'src', 'globals', 'exports.ts'); +let attempts = 0; + +function removeDefault(input: string) { + return input !== 'default'; +} + +const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +async function generate(text: string) { + console.log('Linting...'); + + const eslint = new ESLint({ + cwd: path.join(__dirname, '..'), + fix: true, + }); + const output = await eslint.lintText(text, { filePath: location }); + + console.log('Writing...'); + + await fs.writeFile(location, output[0].output); +} + +const run = async () => { + const data = Object.entries(values).reduce>((acc, [key, value]) => { + acc[key] = Object.keys(value).filter(removeDefault); + return acc; + }, {}); + + console.log('Generating...'); + + const text = dedent` + // this file is generated by generate-exports-file.ts + // this is done to prevent runtime dependencies from making it's way into the build/start script of the manager + // the manager builder needs to know which dependencies are 'globalized' in the ui + + export default ${JSON.stringify(data, null, 2)} as const;`; + + await fs.ensureFile(location); + + const tryGenerate = async () => { + attempts += 1; + + await generate(text).catch(async (e) => { + if (attempts > 5) { + throw e; + } + + console.log('Retrying...'); + + await wait(1000); + await tryGenerate(); + }); + }; + + await tryGenerate(); + + console.log('Done!'); +}; + +run().catch((e) => { + console.error(e); + process.exitCode = 1; +}); diff --git a/code/lib/preview/src/globals/definitions.ts b/code/lib/preview/src/globals/definitions.ts new file mode 100644 index 000000000000..54345610b3cd --- /dev/null +++ b/code/lib/preview/src/globals/definitions.ts @@ -0,0 +1,37 @@ +import type { ModuleInfo } from '@fal-works/esbuild-plugin-global-externals'; +import Exports from './exports'; +import type { Definitions } from './types'; +import { globals } from './types'; + +/* + * We create a map of a module's name to a ModuleInfo. + * Which is a config object for a esbuild-plugin, to swap a import of a module to a reference of a global variable. + * To get this plugin to do the best job it can, it needs to know all the exports in the ModuleInfo config object. + * We generate this information via a script into `exports.ts`. + * + * It's really important that there are no actual to the runtime of the modules, hence the cumbersome generation. + * But we also want to ensure we don't miss any exports, or globals. + * + * So in order to add additional modules to be swapped for globals, you need to add them to: + * - `Keys` in `types.ts` + * - `values` in `runtime.ts`. + * + * If you forget to do either, TypeScript will complain. + * + * This `definitions.ts` file is consumed by the `builder-manager` package, + * The `runtime.ts` file is used inside the manager's browser code runtime. + */ + +const createModuleInfo = (m: keyof typeof globals): Required => ({ + type: 'esm', + varName: globals[m], + namedExports: Exports[m], + defaultExport: true, +}); + +export const definitions = Object.keys(globals).reduce((acc, key) => { + acc[key as keyof typeof globals] = createModuleInfo(key as keyof typeof globals); + return acc; +}, {} as Definitions); + +export const GLOBALIZED_PACKAGES = Object.keys(globals); diff --git a/code/lib/preview/src/globals/exports.ts b/code/lib/preview/src/globals/exports.ts new file mode 100644 index 000000000000..9687091b1299 --- /dev/null +++ b/code/lib/preview/src/globals/exports.ts @@ -0,0 +1,276 @@ +// this file is generated by generate-exports-file.ts +// this is done to prevent runtime dependencies from making it's way into the build/start script of the manager +// the manager builder needs to know which dependencies are 'globalized' in the ui + +export default { + '@storybook/channel-postmessage': [ + 'KEY', + 'PostMessageTransport', + 'PostmsgTransport', + 'createChannel', + ], + '@storybook/channel-websocket': ['WebsocketTransport', 'createChannel'], + '@storybook/channels': [ + 'Channel', + 'PostMessageTransport', + 'WebsocketTransport', + 'createBrowserChannel', + 'createPostMessageChannel', + 'createWebSocketChannel', + ], + '@storybook/client-logger': ['deprecate', 'logger', 'once', 'pretty'], + '@storybook/core-events': [ + 'CHANNEL_CREATED', + 'CONFIG_ERROR', + 'CURRENT_STORY_WAS_SET', + 'DOCS_PREPARED', + 'DOCS_RENDERED', + 'FORCE_REMOUNT', + 'FORCE_RE_RENDER', + 'GLOBALS_UPDATED', + 'IGNORED_EXCEPTION', + 'NAVIGATE_URL', + 'PLAY_FUNCTION_THREW_EXCEPTION', + 'PRELOAD_ENTRIES', + 'PREVIEW_BUILDER_PROGRESS', + 'PREVIEW_KEYDOWN', + 'REGISTER_SUBSCRIPTION', + 'REQUEST_WHATS_NEW_DATA', + 'RESET_STORY_ARGS', + 'RESULT_WHATS_NEW_DATA', + 'SELECT_STORY', + 'SET_CONFIG', + 'SET_CURRENT_STORY', + 'SET_GLOBALS', + 'SET_INDEX', + 'SET_STORIES', + 'SET_WHATS_NEW_CACHE', + 'SHARED_STATE_CHANGED', + 'SHARED_STATE_SET', + 'STORIES_COLLAPSE_ALL', + 'STORIES_EXPAND_ALL', + 'STORY_ARGS_UPDATED', + 'STORY_CHANGED', + 'STORY_ERRORED', + 'STORY_INDEX_INVALIDATED', + 'STORY_MISSING', + 'STORY_PREPARED', + 'STORY_RENDERED', + 'STORY_RENDER_PHASE_CHANGED', + 'STORY_SPECIFIED', + 'STORY_THREW_EXCEPTION', + 'STORY_UNCHANGED', + 'TELEMETRY_ERROR', + 'TOGGLE_WHATS_NEW_NOTIFICATIONS', + 'UPDATE_GLOBALS', + 'UPDATE_QUERY_PARAMS', + 'UPDATE_STORY_ARGS', + ], + '@storybook/preview-api': [ + 'ClientApi', + 'DocsContext', + 'HooksContext', + 'Preview', + 'PreviewWeb', + 'StoryStore', + 'addArgTypes', + 'addArgTypesEnhancer', + 'addArgs', + 'addArgsEnhancer', + 'addDecorator', + 'addLoader', + 'addParameters', + 'addStepRunner', + 'addons', + 'applyHooks', + 'combineArgs', + 'combineParameters', + 'composeConfigs', + 'composeStepRunners', + 'composeStories', + 'composeStory', + 'decorateStory', + 'defaultDecorateStory', + 'filterArgTypes', + 'getQueryParam', + 'getQueryParams', + 'inferControls', + 'makeDecorator', + 'mockChannel', + 'normalizeStory', + 'prepareMeta', + 'prepareStory', + 'sanitizeStoryContextUpdate', + 'setGlobalRender', + 'setProjectAnnotations', + 'simulateDOMContentLoaded', + 'simulatePageLoad', + 'sortStoriesV7', + 'start', + 'useArgs', + 'useCallback', + 'useChannel', + 'useEffect', + 'useGlobals', + 'useMemo', + 'useParameter', + 'useReducer', + 'useRef', + 'useState', + 'useStoryContext', + 'userOrAutoTitle', + 'userOrAutoTitleFromSpecifier', + ], + '@storybook/global': ['global'], + '@storybook/addons': [ + 'AddonStore', + 'HooksContext', + 'addons', + 'applyHooks', + 'makeDecorator', + 'mockChannel', + 'useArgs', + 'useCallback', + 'useChannel', + 'useEffect', + 'useGlobals', + 'useMemo', + 'useParameter', + 'useReducer', + 'useRef', + 'useState', + 'useStoryContext', + ], + '@storybook/client-api': [ + 'ClientApi', + 'DEEPLY_EQUAL', + 'HooksContext', + 'StoryStore', + 'UNTARGETED', + 'addArgTypes', + 'addArgTypesEnhancer', + 'addArgs', + 'addArgsEnhancer', + 'addDecorator', + 'addLoader', + 'addParameters', + 'addStepRunner', + 'applyHooks', + 'combineArgs', + 'combineParameters', + 'composeConfigs', + 'composeStepRunners', + 'composeStories', + 'composeStory', + 'decorateStory', + 'deepDiff', + 'defaultDecorateStory', + 'filterArgTypes', + 'getArrayField', + 'getField', + 'getObjectField', + 'getQueryParam', + 'getQueryParams', + 'getSingletonField', + 'getValuesFromArgTypes', + 'groupArgsByTarget', + 'inferControls', + 'mapArgsToTypes', + 'noTargetArgs', + 'normalizeComponentAnnotations', + 'normalizeInputType', + 'normalizeInputTypes', + 'normalizeProjectAnnotations', + 'normalizeStory', + 'prepareContext', + 'prepareMeta', + 'prepareStory', + 'processCSFFile', + 'sanitizeStoryContextUpdate', + 'setGlobalRender', + 'setProjectAnnotations', + 'sortStoriesV6', + 'sortStoriesV7', + 'useAddonState', + 'useArgs', + 'useCallback', + 'useChannel', + 'useEffect', + 'useGlobals', + 'useMemo', + 'useParameter', + 'useReducer', + 'useRef', + 'useSharedState', + 'useState', + 'useStoryContext', + 'userOrAutoTitle', + 'userOrAutoTitleFromSpecifier', + 'validateOptions', + ], + '@storybook/core-client': ['ClientApi', 'StoryStore', 'start'], + '@storybook/preview-web': [ + 'DocsContext', + 'Preview', + 'PreviewWeb', + 'PreviewWithSelection', + 'composeConfigs', + 'simulateDOMContentLoaded', + 'simulatePageLoad', + ], + '@storybook/store': [ + 'DEEPLY_EQUAL', + 'HooksContext', + 'StoryStore', + 'UNTARGETED', + 'applyHooks', + 'combineArgs', + 'combineParameters', + 'composeConfigs', + 'composeStepRunners', + 'composeStories', + 'composeStory', + 'decorateStory', + 'deepDiff', + 'defaultDecorateStory', + 'filterArgTypes', + 'getArrayField', + 'getField', + 'getObjectField', + 'getSingletonField', + 'getValuesFromArgTypes', + 'groupArgsByTarget', + 'inferControls', + 'mapArgsToTypes', + 'noTargetArgs', + 'normalizeComponentAnnotations', + 'normalizeInputType', + 'normalizeInputTypes', + 'normalizeProjectAnnotations', + 'normalizeStory', + 'prepareContext', + 'prepareMeta', + 'prepareStory', + 'processCSFFile', + 'sanitizeStoryContextUpdate', + 'setProjectAnnotations', + 'sortStoriesV6', + 'sortStoriesV7', + 'useAddonState', + 'useArgs', + 'useCallback', + 'useChannel', + 'useEffect', + 'useGlobals', + 'useMemo', + 'useParameter', + 'useReducer', + 'useRef', + 'useSharedState', + 'useState', + 'useStoryContext', + 'userOrAutoTitle', + 'userOrAutoTitleFromSpecifier', + 'validateOptions', + ], +} as const; diff --git a/code/lib/preview/src/globals/types.ts b/code/lib/preview/src/globals/types.ts index 40ed603cd598..0b8d1afccbae 100644 --- a/code/lib/preview/src/globals/types.ts +++ b/code/lib/preview/src/globals/types.ts @@ -1,4 +1,6 @@ // Here we map the name of a module to their NAME in the global scope. +import type { ModuleInfo } from '@fal-works/esbuild-plugin-global-externals'; + export const globals = { '@storybook/addons': '__STORYBOOK_MODULE_ADDONS__', '@storybook/global': '__STORYBOOK_MODULE_GLOBAL__', @@ -12,4 +14,7 @@ export const globals = { '@storybook/preview-web': '__STORYBOOK_MODULE_PREVIEW_WEB__', '@storybook/preview-api': '__STORYBOOK_MODULE_PREVIEW_API__', '@storybook/store': '__STORYBOOK_MODULE_STORE__', + '@storybook/types': '__STORYBOOK_MODULE_TYPES__', }; + +export type Definitions = Required>>; diff --git a/code/lib/router/package.json b/code/lib/router/package.json index 5879f8c9dff0..9c6d741e58db 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -71,6 +71,20 @@ "entries": [ "./src/index.ts", "./src/utils.ts" + ], + "externals": [ + "react", + "react-dom", + "@storybook/addons", + "@storybook/api", + "@storybook/channels", + "@storybook/client-logger", + "@storybook/components", + "@storybook/core-events", + "@storybook/manager-api", + "@storybook/router", + "@storybook/theming", + "@storybook/types" ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" diff --git a/code/lib/theming/package.json b/code/lib/theming/package.json index f0e714c37798..c71190f37fae 100644 --- a/code/lib/theming/package.json +++ b/code/lib/theming/package.json @@ -79,6 +79,20 @@ "./src/index.ts", "./src/create.ts" ], + "externals": [ + "react", + "react-dom", + "@storybook/addons", + "@storybook/api", + "@storybook/channels", + "@storybook/client-logger", + "@storybook/components", + "@storybook/core-events", + "@storybook/manager-api", + "@storybook/router", + "@storybook/theming", + "@storybook/types" + ], "post": "./scripts/fix-theme-type-export.ts" }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" diff --git a/code/ui/manager/src/globals/definitions.ts b/code/ui/manager/src/globals/definitions.ts index 9122fca70262..93ca581ac658 100644 --- a/code/ui/manager/src/globals/definitions.ts +++ b/code/ui/manager/src/globals/definitions.ts @@ -33,3 +33,5 @@ export const definitions = Object.keys(Keys).reduce((acc, key) => { acc[key as keyof typeof Keys] = createModuleInfo(key as keyof typeof Keys); return acc; }, {} as Definitions); + +export const GLOBALIZED_PACKAGES = Object.keys(Keys); diff --git a/code/ui/manager/src/globals/exports.ts b/code/ui/manager/src/globals/exports.ts index c51d42680e37..f56ba153dd82 100644 --- a/code/ui/manager/src/globals/exports.ts +++ b/code/ui/manager/src/globals/exports.ts @@ -215,7 +215,6 @@ export default { '@storybook/api': [ 'ActiveTabs', 'Consumer', - 'GLOBALIZED_PACKAGES', 'ManagerContext', 'Provider', 'addons', @@ -248,7 +247,6 @@ export default { '@storybook/manager-api': [ 'ActiveTabs', 'Consumer', - 'GLOBALIZED_PACKAGES', 'ManagerContext', 'Provider', 'addons', @@ -280,4 +278,5 @@ export default { ], '@storybook/addons': ['addons', 'types', 'mockChannel'], '@storybook/client-logger': ['deprecate', 'logger', 'once', 'pretty'], + '@storybook/types': ['Addon_TypesEnum'], } as const; diff --git a/code/ui/manager/src/globals/runtime.ts b/code/ui/manager/src/globals/runtime.ts index 5850699f171d..a018a8f94924 100644 --- a/code/ui/manager/src/globals/runtime.ts +++ b/code/ui/manager/src/globals/runtime.ts @@ -7,6 +7,7 @@ import * as STORYBOOKEVENTS from '@storybook/core-events'; import * as STORYBOOKROUTER from '@storybook/router'; import * as STORYBOOKTHEMING from '@storybook/theming'; import * as STORYBOOKMANAGERAPI from '@storybook/manager-api'; +import * as STORYBOOKTYPES from '@storybook/types'; import * as STORYBOOKCLIENTLOGGER from '@storybook/client-logger'; import type { Keys } from './types'; @@ -29,4 +30,5 @@ export const values: Required> = { mockChannel: STORYBOOKMANAGERAPI.mockChannel, }, '@storybook/client-logger': STORYBOOKCLIENTLOGGER, + '@storybook/types': STORYBOOKTYPES, }; diff --git a/code/ui/manager/src/globals/types.ts b/code/ui/manager/src/globals/types.ts index 2861e45f632a..9038e9375460 100644 --- a/code/ui/manager/src/globals/types.ts +++ b/code/ui/manager/src/globals/types.ts @@ -13,6 +13,7 @@ export enum Keys { '@storybook/manager-api' = '__STORYBOOKAPI__', '@storybook/addons' = '__STORYBOOKADDONS__', '@storybook/client-logger' = '__STORYBOOKCLIENTLOGGER__', + '@storybook/types' = '__STORYBOOKTYPES__', } export type Definitions = Required>>; diff --git a/code/ui/manager/src/typings.d.ts b/code/ui/manager/src/typings.d.ts index 2ff3df07e63e..4917a0ec8692 100644 --- a/code/ui/manager/src/typings.d.ts +++ b/code/ui/manager/src/typings.d.ts @@ -26,4 +26,5 @@ declare var __STORYBOOKAPI__: any; declare var __STORYBOOKADDONS__: any; declare var __STORYBOOKCLIENTLOGGER__: any; declare var __STORYBOOK_ADDONS_CHANNEL__: any; +declare var __STORYBOOKTYPES__: any; declare var sendTelemetryError: (error: any) => void; diff --git a/code/yarn.lock b/code/yarn.lock index be92a427d622..92948f58ced2 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5779,7 +5779,6 @@ __metadata: "@storybook/channels": "workspace:*" "@storybook/client-logger": "workspace:*" "@storybook/components": "workspace:*" - "@storybook/core-events": "workspace:*" "@storybook/global": ^5.0.0 "@storybook/manager-api": "workspace:*" "@storybook/preview-api": "workspace:*" @@ -5830,7 +5829,6 @@ __metadata: dependencies: "@storybook/client-logger": "workspace:*" "@storybook/components": "workspace:*" - "@storybook/core-events": "workspace:*" "@storybook/global": ^5.0.0 "@storybook/manager-api": "workspace:*" "@storybook/preview-api": "workspace:*" @@ -6003,6 +6001,7 @@ __metadata: react-dom: ^16.8.0 react-resize-detector: ^7.1.2 tiny-invariant: ^1.3.1 + ts-dedent: ^2.0.0 typescript: ~4.9.3 upath: ^2.0.1 languageName: unknown @@ -6025,12 +6024,9 @@ __metadata: typescript: ~4.9.3 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 peerDependenciesMeta: react: optional: true - react-dom: - optional: true languageName: unknown linkType: soft @@ -7563,6 +7559,8 @@ __metadata: "@storybook/global": ^5.0.0 "@storybook/preview-api": "workspace:*" browser-dtector: ^3.4.0 + fs-extra: ^11.1.0 + ts-dedent: ^2.0.0 typescript: ~4.9.3 languageName: unknown linkType: soft diff --git a/scripts/package.json b/scripts/package.json index b6020c436390..719ba17c7774 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -111,6 +111,7 @@ "babel-eslint": "^10.1.0", "babel-loader": "^9.1.2", "boxen": "^5.1.2", + "browser-assert": "^1.2.1", "chalk": "^4.1.0", "codecov": "^3.8.1", "commander": "^6.2.1", diff --git a/scripts/prepare/addon-bundle.ts b/scripts/prepare/addon-bundle.ts new file mode 100755 index 000000000000..24a2bac52331 --- /dev/null +++ b/scripts/prepare/addon-bundle.ts @@ -0,0 +1,296 @@ +#!/usr/bin/env ../../node_modules/.bin/ts-node + +import * as fs from 'fs-extra'; +import path, { dirname, join, relative } from 'path'; +import type { Options } from 'tsup'; +import type { PackageJson } from 'type-fest'; +import { build } from 'tsup'; +import aliasPlugin from 'esbuild-plugin-alias'; +import dedent from 'ts-dedent'; +import slash from 'slash'; +import { exec } from '../utils/exec'; + +import { GLOBALIZED_PACKAGES as PREVIEW_GLOBALIZED_PACKAGES } from '../../code/lib/preview/src/globals/definitions'; +import { GLOBALIZED_PACKAGES as MANAGER_GLOBALIZED_PACKAGES } from '../../code/ui/manager/src/globals/definitions'; + +/* TYPES */ + +type Formats = 'esm' | 'cjs'; +type BundlerConfig = { + previewEntries: string[]; + managerEntries: string[]; + nodeEntries: string[]; + exportEntries: string[]; + externals: string[]; + pre: string; + post: string; + formats: Formats[]; +}; +type PackageJsonWithBundlerConfig = PackageJson & { + bundler: BundlerConfig; +}; +type DtsConfigSection = Pick; + +/* MAIN */ + +const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { + const { + name, + dependencies, + peerDependencies, + bundler: { + managerEntries = [], + previewEntries = [], + nodeEntries = [], + exportEntries = [], + externals: extraExternals = [], + pre, + post, + formats = ['esm', 'cjs'], + }, + } = (await fs.readJson(join(cwd, 'package.json'))) as PackageJsonWithBundlerConfig; + + if (pre) { + await exec(`node -r ${__dirname}/../node_modules/esbuild-register/register.js ${pre}`, { cwd }); + } + + const reset = hasFlag(flags, 'reset'); + const watch = hasFlag(flags, 'watch'); + const optimized = hasFlag(flags, 'optimized'); + + if (reset) { + await fs.emptyDir(join(process.cwd(), 'dist')); + } + + const tasks: Promise[] = []; + + const commonOptions: Options = { + outDir: join(process.cwd(), 'dist'), + silent: true, + treeshake: true, + shims: false, + watch, + clean: false, + esbuildPlugins: [ + aliasPlugin({ + process: require.resolve('../node_modules/process/browser.js'), + util: require.resolve('../node_modules/util/util.js'), + assert: require.resolve('browser-assert'), + }), + ], + }; + + const commonExternals = [ + name, + ...extraExternals, + ...Object.keys(dependencies || {}), + ...Object.keys(peerDependencies || {}), + ]; + + if (exportEntries.length > 0) { + const { dtsConfig, tsConfigExists } = await getDTSConfigs({ + formats, + entries: exportEntries, + optimized, + }); + + console.log({ + exportEntries, + commonExternals, + MANAGER_GLOBALIZED_PACKAGES, + PREVIEW_GLOBALIZED_PACKAGES, + }); + + tasks.push( + build({ + ...commonOptions, + ...(optimized ? dtsConfig : {}), + entry: exportEntries, + format: ['esm'], + target: ['chrome100', 'safari15', 'firefox91'], + platform: 'browser', + external: [ + ...commonExternals, + ...MANAGER_GLOBALIZED_PACKAGES, + ...PREVIEW_GLOBALIZED_PACKAGES, + ], + esbuildOptions: (options) => { + /* eslint-disable no-param-reassign */ + options.conditions = ['module']; + options.platform = 'browser'; + Object.assign(options, getESBuildOptions(optimized)); + /* eslint-enable no-param-reassign */ + }, + }), + build({ + ...commonOptions, + ...(optimized ? dtsConfig : {}), + entry: exportEntries, + format: ['cjs'], + target: 'node16', + platform: 'node', + external: commonExternals, + esbuildOptions: (options) => { + /* eslint-disable no-param-reassign */ + options.conditions = ['module']; + options.platform = 'node'; + Object.assign(options, getESBuildOptions(optimized)); + /* eslint-enable no-param-reassign */ + }, + }) + ); + + if (tsConfigExists && !optimized) { + tasks.push(...exportEntries.map(generateDTSMapperFile)); + } + } + + if (managerEntries.length > 0) { + tasks.push( + build({ + ...commonOptions, + entry: managerEntries.map((e: string) => slash(join(cwd, e))), + outExtension: () => ({ + js: '.js', + }), + format: ['esm'], + target: ['chrome100', 'safari15', 'firefox91'], + platform: 'browser', + external: [...commonExternals, ...MANAGER_GLOBALIZED_PACKAGES], + esbuildOptions: (options) => { + /* eslint-disable no-param-reassign */ + options.conditions = ['module']; + options.platform = 'browser'; + Object.assign(options, getESBuildOptions(optimized)); + /* eslint-enable no-param-reassign */ + }, + }) + ); + } + if (previewEntries.length > 0) { + tasks.push( + build({ + ...commonOptions, + entry: previewEntries.map((e: string) => slash(join(cwd, e))), + outExtension: () => ({ + js: '.js', + }), + format: ['esm'], + target: ['chrome100', 'safari15', 'firefox91'], + platform: 'browser', + external: [...commonExternals, ...PREVIEW_GLOBALIZED_PACKAGES], + esbuildOptions: (c) => { + /* eslint-disable no-param-reassign */ + c.conditions = ['module']; + c.platform = 'browser'; + Object.assign(c, getESBuildOptions(optimized)); + /* eslint-enable no-param-reassign */ + }, + }) + ); + } + if (nodeEntries.length > 0) { + tasks.push( + build({ + ...commonOptions, + entry: nodeEntries.map((e: string) => slash(join(cwd, e))), + format: ['cjs'], + target: 'node16', + platform: 'node', + external: commonExternals, + esbuildOptions: (c) => { + /* eslint-disable no-param-reassign */ + c.platform = 'node'; + Object.assign(c, getESBuildOptions(optimized)); + /* eslint-enable no-param-reassign */ + }, + }) + ); + } + + await Promise.all(tasks); + + if (post) { + await exec( + `node -r ${__dirname}/../node_modules/esbuild-register/register.js ${post}`, + { cwd }, + { debug: true } + ); + } + + console.log('done'); +}; + +/* UTILS */ + +// keep in sync with code/lib/manager-api/src/index.ts + +async function getDTSConfigs({ + formats, + entries, + optimized, +}: { + formats: Formats[]; + entries: string[]; + optimized: boolean; +}) { + const tsConfigPath = join(cwd, 'tsconfig.json'); + const tsConfigExists = await fs.pathExists(tsConfigPath); + + const dtsBuild = optimized && formats[0] && tsConfigExists ? formats[0] : undefined; + + const dtsConfig: DtsConfigSection = { + tsconfig: tsConfigPath, + dts: { + entry: entries, + resolve: true, + }, + }; + + return { dtsBuild, dtsConfig, tsConfigExists }; +} + +function getESBuildOptions(optimized: boolean) { + return { + logLevel: 'error', + legalComments: 'none', + minifyWhitespace: optimized, + minifyIdentifiers: false, + minifySyntax: optimized, + }; +} + +async function generateDTSMapperFile(file: string) { + const { name: entryName, dir } = path.parse(file); + + const pathName = join(process.cwd(), dir.replace('./src', 'dist'), `${entryName}.d.ts`); + const srcName = join(process.cwd(), file); + const rel = relative(dirname(pathName), dirname(srcName)).split(path.sep).join(path.posix.sep); + + await fs.ensureFile(pathName); + await fs.writeFile( + pathName, + dedent` + // dev-mode + export * from '${rel}/${entryName}'; + `, + { encoding: 'utf-8' } + ); +} + +const hasFlag = (flags: string[], name: string) => !!flags.find((s) => s.startsWith(`--${name}`)); + +/* SELF EXECUTION */ + +const flags = process.argv.slice(2); +const cwd = process.cwd(); + +run({ cwd, flags }).catch((err: unknown) => { + // We can't let the stack try to print, it crashes in a way that sets the exit code to 0. + // Seems to have something to do with running JSON.parse() on binary / base64 encoded sourcemaps + // in @cspotcode/source-map-support + if (err instanceof Error) { + console.error(err.stack); + } + process.exit(1); +}); diff --git a/scripts/prepare/bundle.ts b/scripts/prepare/bundle.ts index e1c4715a260a..a15f71cd6a34 100755 --- a/scripts/prepare/bundle.ts +++ b/scripts/prepare/bundle.ts @@ -63,7 +63,6 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { ...extraExternals, ...Object.keys(dependencies || {}), ...Object.keys(peerDependencies || {}), - ...GLOBALIZED_PACKAGES, ]; const allEntries = entries.map((e: string) => slash(join(cwd, e))); @@ -158,21 +157,6 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { /* UTILS */ -// keep in sync with code/lib/manager-api/src/index.ts -const GLOBALIZED_PACKAGES = [ - 'react', - 'react-dom', - '@storybook/components', - '@storybook/channels', - '@storybook/core-events', - '@storybook/router', - '@storybook/theming', - '@storybook/api', - '@storybook/manager-api', - '@storybook/addons', - '@storybook/client-logger', -]; - async function getDTSConfigs({ formats, entries, diff --git a/scripts/yarn.lock b/scripts/yarn.lock index 504a13091f02..b6a3663544c1 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -2989,6 +2989,7 @@ __metadata: babel-eslint: ^10.1.0 babel-loader: ^9.1.2 boxen: ^5.1.2 + browser-assert: ^1.2.1 chalk: ^4.1.0 codecov: ^3.8.1 commander: ^6.2.1 @@ -5312,6 +5313,13 @@ __metadata: languageName: node linkType: hard +"browser-assert@npm:^1.2.1": + version: 1.2.1 + resolution: "browser-assert@npm:1.2.1" + checksum: 902abf999f92c9c951fdb6d7352c09eea9a84706258699655f7e7906e42daa06a1ae286398a755872740e05a6a71c43c5d1a0c0431d67a8cdb66e5d859a3fc0c + languageName: node + linkType: hard + "browserslist@npm:^4.21.10, browserslist@npm:^4.21.9": version: 4.21.10 resolution: "browserslist@npm:4.21.10" From 51f2cf9bf38f1e010ba9cd27884127e9f8a27c5a Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 2 Nov 2023 10:06:44 +0100 Subject: [PATCH 009/115] update eslint rules --- code/.eslintrc.js | 66 +++++++++++++++---- code/addons/essentials/src/actions/preview.ts | 1 - .../essentials/src/backgrounds/preview.ts | 1 - .../essentials/src/highlight/preview.ts | 1 - code/addons/essentials/src/measure/preview.ts | 1 - code/addons/essentials/src/outline/preview.ts | 1 - 6 files changed, 53 insertions(+), 18 deletions(-) diff --git a/code/.eslintrc.js b/code/.eslintrc.js index e967113bb8eb..640a66f0bf1f 100644 --- a/code/.eslintrc.js +++ b/code/.eslintrc.js @@ -1,7 +1,19 @@ const path = require('path'); +const fs = require('fs'); const scriptPath = path.join(__dirname, '..', 'scripts'); +const addonsPackages = fs + .readdirSync(path.join(__dirname, 'addons')) + .filter((p) => fs.statSync(path.join(__dirname, 'addons', p)).isDirectory()); +const libPackages = fs + .readdirSync(path.join(__dirname, 'lib')) + .filter((p) => fs.statSync(path.join(__dirname, 'lib', p)).isDirectory()); +const uiPackages = fs + .readdirSync(path.join(__dirname, 'ui')) + .filter((p) => fs.statSync(path.join(__dirname, 'ui', p)).isDirectory()) + .filter((p) => !p.startsWith('.')); + module.exports = { root: true, extends: [path.join(scriptPath, '.eslintrc.js')], @@ -53,7 +65,6 @@ module.exports = { project: null, }, rules: { - // '@typescript-eslint/no-var-requires': 'off', '@typescript-eslint/dot-notation': 'off', '@typescript-eslint/no-implied-eval': 'off', '@typescript-eslint/no-throw-literal': 'off', @@ -70,15 +81,7 @@ module.exports = { }, { // these packages use pre-bundling, dependencies will be bundled, and will be in devDepenencies - files: [ - 'addons/**/*', - 'frameworks/**/*', - 'lib/**/*', - 'builders/**/*', - 'deprecated/**/*', - 'renderers/**/*', - 'ui/**/*', - ], + files: ['frameworks/**/*', 'builders/**/*', 'deprecated/**/*', 'renderers/**/*'], excludedFiles: ['frameworks/angular/**/*', 'frameworks/ember/**/*', 'lib/core-server/**/*'], rules: { 'import/no-extraneous-dependencies': [ @@ -88,11 +91,47 @@ module.exports = { }, }, { - files: ['**/ui/*', '**/ui/.storybook/*'], + files: ['**/ui/.storybook/**'], rules: { - 'import/no-extraneous-dependencies': ['error', { packageDir: __dirname }], + 'import/no-extraneous-dependencies': [ + 'error', + { packageDir: [__dirname], devDependencies: true }, + ], }, }, + ...addonsPackages.map((directory) => ({ + files: [path.join('**', 'addons', directory, '**', '*.*')], + rules: { + 'import/no-extraneous-dependencies': [ + 'error', + { + packageDir: [__dirname, path.join(__dirname, 'addons', directory)], + devDependencies: true, + }, + ], + }, + })), + ...uiPackages.map((directory) => ({ + files: [path.join('**', 'ui', directory, '**', '*.*')], + rules: { + 'import/no-extraneous-dependencies': [ + 'error', + { packageDir: [__dirname, path.join(__dirname, 'ui', directory)], devDependencies: true }, + ], + }, + })), + ...libPackages.map((directory) => ({ + files: [path.join('**', 'lib', directory, '**', '*.*')], + rules: { + 'import/no-extraneous-dependencies': [ + 'error', + { + packageDir: [__dirname, path.join(__dirname, 'lib', directory)], + devDependencies: true, + }, + ], + }, + })), { files: [ '**/__tests__/**', @@ -114,7 +153,6 @@ module.exports = { 'react/require-default-props': 'off', }, }, - { files: '**/.storybook/config.js', rules: { 'global-require': 'off' } }, { files: ['**/*.stories.*'], rules: { @@ -124,6 +162,8 @@ module.exports = { { files: ['**/*.tsx', '**/*.ts'], rules: { + 'no-shadow': 'off', + '@typescript-eslint/ban-types': 'warn', // should become error, in the future 'react/require-default-props': 'off', 'react/prop-types': 'off', // we should use types 'react/forbid-prop-types': 'off', // we should use types diff --git a/code/addons/essentials/src/actions/preview.ts b/code/addons/essentials/src/actions/preview.ts index 86c6d5f2e656..12b8c76bf2cb 100644 --- a/code/addons/essentials/src/actions/preview.ts +++ b/code/addons/essentials/src/actions/preview.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/export */ // TODO: We need to configure an eslint-import typescript resolver for export maps to be considered export * from '@storybook/addon-actions/preview'; diff --git a/code/addons/essentials/src/backgrounds/preview.ts b/code/addons/essentials/src/backgrounds/preview.ts index 5e56121e4a03..3bb1f96c3d80 100644 --- a/code/addons/essentials/src/backgrounds/preview.ts +++ b/code/addons/essentials/src/backgrounds/preview.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/export */ // TODO: We need to configure an eslint-import typescript resolver for export maps to be considered export * from '@storybook/addon-backgrounds/preview'; diff --git a/code/addons/essentials/src/highlight/preview.ts b/code/addons/essentials/src/highlight/preview.ts index ffcf62555af2..242ee3332bd3 100644 --- a/code/addons/essentials/src/highlight/preview.ts +++ b/code/addons/essentials/src/highlight/preview.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/export */ // TODO: We need to configure an eslint-import typescript resolver for export maps to be considered export * from '@storybook/addon-highlight/preview'; diff --git a/code/addons/essentials/src/measure/preview.ts b/code/addons/essentials/src/measure/preview.ts index f18769ff001a..a7b4307edb44 100644 --- a/code/addons/essentials/src/measure/preview.ts +++ b/code/addons/essentials/src/measure/preview.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/export */ // TODO: We need to configure an eslint-import typescript resolver for export maps to be considered export * from '@storybook/addon-measure/preview'; diff --git a/code/addons/essentials/src/outline/preview.ts b/code/addons/essentials/src/outline/preview.ts index 1cc44b9689a8..e54411194b51 100644 --- a/code/addons/essentials/src/outline/preview.ts +++ b/code/addons/essentials/src/outline/preview.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/export */ // TODO: We need to configure an eslint-import typescript resolver for export maps to be considered export * from '@storybook/addon-outline/preview'; From d241d0302ee64fab58c02ea4f1f7f26872335567 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Thu, 2 Nov 2023 10:48:55 +0100 Subject: [PATCH 010/115] Simplify globals type, so that it is mutable --- code/builders/builder-vite/src/vite-config.ts | 3 +-- .../builder-webpack5/src/preview/iframe-webpack.config.ts | 4 +--- code/lib/preview/src/globals/types.ts | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/code/builders/builder-vite/src/vite-config.ts b/code/builders/builder-vite/src/vite-config.ts index a38bd8bb52d5..cdb1575c7b8b 100644 --- a/code/builders/builder-vite/src/vite-config.ts +++ b/code/builders/builder-vite/src/vite-config.ts @@ -78,10 +78,9 @@ export async function commonConfig( export async function pluginConfig(options: Options) { const frameworkName = await getFrameworkName(options); const { features } = options; - const globalsObj: Record = globals; if (features?.fastBuildEmptyBlocks) { - globalsObj['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; + globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } const plugins = [ diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index d5a67c7e2730..cb2afc5ce43c 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -217,10 +217,8 @@ export default async ( `); } - const globalObj: Record = globals; - if (features?.fastBuildEmptyBlocks) { - globalObj['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; + globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } return { diff --git a/code/lib/preview/src/globals/types.ts b/code/lib/preview/src/globals/types.ts index 40ed603cd598..fc694751d092 100644 --- a/code/lib/preview/src/globals/types.ts +++ b/code/lib/preview/src/globals/types.ts @@ -1,5 +1,5 @@ // Here we map the name of a module to their NAME in the global scope. -export const globals = { +export const globals: Record = { '@storybook/addons': '__STORYBOOK_MODULE_ADDONS__', '@storybook/global': '__STORYBOOK_MODULE_GLOBAL__', '@storybook/channel-postmessage': '__STORYBOOK_MODULE_CHANNEL_POSTMESSAGE__', // @deprecated: remove in 8.0 From d1b9518c49533df2b03b1e2bb43992b529460f76 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 2 Nov 2023 11:45:50 +0100 Subject: [PATCH 011/115] fix blocks dep --- code/addons/controls/package.json | 3 +-- code/yarn.lock | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index ee680363bd24..456cbfd0e649 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -51,15 +51,14 @@ "prep": "../../../scripts/prepare/addon-bundle.ts" }, "dependencies": { + "@storybook/blocks": "workspace:*", "lodash": "^4.17.21", "ts-dedent": "^2.0.0" }, "devDependencies": { - "@storybook/blocks": "workspace:*", "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-common": "workspace:*", - "@storybook/core-events": "workspace:*", "@storybook/manager-api": "workspace:*", "@storybook/node-logger": "workspace:*", "@storybook/preview-api": "workspace:*", diff --git a/code/yarn.lock b/code/yarn.lock index ea64774e473a..557e187305be 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6068,7 +6068,6 @@ __metadata: "@storybook/client-logger": "workspace:*" "@storybook/components": "workspace:*" "@storybook/core-common": "workspace:*" - "@storybook/core-events": "workspace:*" "@storybook/manager-api": "workspace:*" "@storybook/node-logger": "workspace:*" "@storybook/preview-api": "workspace:*" From 533d728a661e26b7b91662d0e9a94aebf554546b Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 12:52:27 +0100 Subject: [PATCH 012/115] move from using `features` to useing a new property in presets called `build` then add a new property in there called `test` --- code/builders/builder-vite/src/vite-config.ts | 4 ++-- .../src/preview/iframe-webpack.config.ts | 4 +++- .../core-server/src/presets/common-preset.ts | 18 +++++++++++++----- code/lib/types/src/modules/core-common.ts | 13 +++++++++---- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/code/builders/builder-vite/src/vite-config.ts b/code/builders/builder-vite/src/vite-config.ts index cdb1575c7b8b..da7b7d6ef775 100644 --- a/code/builders/builder-vite/src/vite-config.ts +++ b/code/builders/builder-vite/src/vite-config.ts @@ -77,9 +77,9 @@ export async function commonConfig( export async function pluginConfig(options: Options) { const frameworkName = await getFrameworkName(options); - const { features } = options; + const { test } = await options.presets.apply('build'); - if (features?.fastBuildEmptyBlocks) { + if (test?.emptyBlocks) { globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index cb2afc5ce43c..6da8c9cc7e5d 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -90,6 +90,7 @@ export default async ( entries, nonNormalizedStories, modulesCount = 1000, + { test }, ] = await Promise.all([ presets.apply('core'), presets.apply('frameworkOptions'), @@ -102,6 +103,7 @@ export default async ( presets.apply('entries', []), presets.apply('stories', []), options.cache?.get('modulesCount').catch(() => {}), + options.presets.apply('build'), ]); const stories = normalizeStories(nonNormalizedStories, { @@ -217,7 +219,7 @@ export default async ( `); } - if (features?.fastBuildEmptyBlocks) { + if (test?.emptyBlocks) { globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts index 360688f613ff..6049d81a4f4e 100644 --- a/code/lib/core-server/src/presets/common-preset.ts +++ b/code/lib/core-server/src/presets/common-preset.ts @@ -185,13 +185,12 @@ export const previewAnnotations = async (base: any, options: Options) => { return [...config, ...base]; }; -const fastBuildFeatures = (value: boolean) => ({ - fastBuildEmptyBlocks: value, +const testBuildFeatures = (value: boolean) => ({ + emptyBlocks: value, }); export const features = async ( - existing: StorybookConfig['features'], - options: Options + existing: StorybookConfig['features'] ): Promise => ({ ...existing, warnOnLegacyHierarchySeparator: true, @@ -199,9 +198,18 @@ export const features = async ( storyStoreV7: true, argTypeTargetsV7: true, legacyDecoratorFileOrder: false, - ...fastBuildFeatures(!!options.test), }); +export const build = async (value: StorybookConfig['build'], options: Options) => { + return { + ...value, + test: { + ...testBuildFeatures(!!options.test), + ...value?.test, + }, + }; +}; + export const csfIndexer: Indexer = { test: /(stories|story)\.(m?js|ts)x?$/, createIndex: async (fileName, options) => (await readCsf(fileName, options)).parse().indexInputs, diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index 056129678c58..e1100853f5ee 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -76,6 +76,7 @@ export interface Presets { apply(extension: 'managerEntries', config: [], args?: any): Promise; apply(extension: 'refs', config?: [], args?: any): Promise; apply(extension: 'core', config?: {}, args?: any): Promise; + apply(extension: 'build', config?: {}, args?: any): Promise; apply(extension: string, config?: T, args?: unknown): Promise; } @@ -311,11 +312,15 @@ export interface StorybookConfig { * Apply decorators from preview.js before decorators from addons or frameworks */ legacyDecoratorFileOrder?: boolean; + }; - /** - * Globalize @storybook/blocks - */ - fastBuildEmptyBlocks?: boolean; + build: { + test: { + /** + * Globalize @storybook/blocks + */ + emptyBlocks?: boolean; + }; }; /** From af3225f874adfb701b41aa692b7fe6bf22746444 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 12:53:59 +0100 Subject: [PATCH 013/115] flip the test.build around --- code/builders/builder-vite/src/vite-config.ts | 4 ++-- .../builder-webpack5/src/preview/iframe-webpack.config.ts | 6 +++--- code/lib/types/src/modules/core-common.ts | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/builders/builder-vite/src/vite-config.ts b/code/builders/builder-vite/src/vite-config.ts index da7b7d6ef775..92148bafdff8 100644 --- a/code/builders/builder-vite/src/vite-config.ts +++ b/code/builders/builder-vite/src/vite-config.ts @@ -77,9 +77,9 @@ export async function commonConfig( export async function pluginConfig(options: Options) { const frameworkName = await getFrameworkName(options); - const { test } = await options.presets.apply('build'); + const { build } = await options.presets.apply('test'); - if (test?.emptyBlocks) { + if (build?.emptyBlocks) { globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index 6da8c9cc7e5d..c41d0ece4767 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -90,7 +90,7 @@ export default async ( entries, nonNormalizedStories, modulesCount = 1000, - { test }, + { build }, ] = await Promise.all([ presets.apply('core'), presets.apply('frameworkOptions'), @@ -103,7 +103,7 @@ export default async ( presets.apply('entries', []), presets.apply('stories', []), options.cache?.get('modulesCount').catch(() => {}), - options.presets.apply('build'), + options.presets.apply('test'), ]); const stories = normalizeStories(nonNormalizedStories, { @@ -219,7 +219,7 @@ export default async ( `); } - if (test?.emptyBlocks) { + if (build?.emptyBlocks) { globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index e1100853f5ee..9d186fc3ce9c 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -76,7 +76,7 @@ export interface Presets { apply(extension: 'managerEntries', config: [], args?: any): Promise; apply(extension: 'refs', config?: [], args?: any): Promise; apply(extension: 'core', config?: {}, args?: any): Promise; - apply(extension: 'build', config?: {}, args?: any): Promise; + apply(extension: 'test', config?: {}, args?: any): Promise; apply(extension: string, config?: T, args?: unknown): Promise; } @@ -314,8 +314,8 @@ export interface StorybookConfig { legacyDecoratorFileOrder?: boolean; }; - build: { - test: { + test: { + build: { /** * Globalize @storybook/blocks */ From c100c46c8bf00a7117765f4b347f57b930560b93 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 12:54:45 +0100 Subject: [PATCH 014/115] forgot to change it in common-preset --- code/lib/core-server/src/presets/common-preset.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts index 6049d81a4f4e..1de6bfbfda25 100644 --- a/code/lib/core-server/src/presets/common-preset.ts +++ b/code/lib/core-server/src/presets/common-preset.ts @@ -200,12 +200,12 @@ export const features = async ( legacyDecoratorFileOrder: false, }); -export const build = async (value: StorybookConfig['build'], options: Options) => { +export const test = async (value: StorybookConfig['test'], options: Options) => { return { ...value, - test: { + build: { ...testBuildFeatures(!!options.test), - ...value?.test, + ...value?.build, }, }; }; From 8c2d7206494a69d08169cb1b38ec654546f5a968 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 13:33:50 +0100 Subject: [PATCH 015/115] swap it again --- code/builders/builder-vite/src/vite-config.ts | 4 ++-- .../builder-webpack5/src/preview/iframe-webpack.config.ts | 6 +++--- code/lib/core-server/src/presets/common-preset.ts | 6 +++--- code/lib/types/src/modules/core-common.ts | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/code/builders/builder-vite/src/vite-config.ts b/code/builders/builder-vite/src/vite-config.ts index 92148bafdff8..da7b7d6ef775 100644 --- a/code/builders/builder-vite/src/vite-config.ts +++ b/code/builders/builder-vite/src/vite-config.ts @@ -77,9 +77,9 @@ export async function commonConfig( export async function pluginConfig(options: Options) { const frameworkName = await getFrameworkName(options); - const { build } = await options.presets.apply('test'); + const { test } = await options.presets.apply('build'); - if (build?.emptyBlocks) { + if (test?.emptyBlocks) { globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index c41d0ece4767..6da8c9cc7e5d 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -90,7 +90,7 @@ export default async ( entries, nonNormalizedStories, modulesCount = 1000, - { build }, + { test }, ] = await Promise.all([ presets.apply('core'), presets.apply('frameworkOptions'), @@ -103,7 +103,7 @@ export default async ( presets.apply('entries', []), presets.apply('stories', []), options.cache?.get('modulesCount').catch(() => {}), - options.presets.apply('test'), + options.presets.apply('build'), ]); const stories = normalizeStories(nonNormalizedStories, { @@ -219,7 +219,7 @@ export default async ( `); } - if (build?.emptyBlocks) { + if (test?.emptyBlocks) { globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts index 1de6bfbfda25..6049d81a4f4e 100644 --- a/code/lib/core-server/src/presets/common-preset.ts +++ b/code/lib/core-server/src/presets/common-preset.ts @@ -200,12 +200,12 @@ export const features = async ( legacyDecoratorFileOrder: false, }); -export const test = async (value: StorybookConfig['test'], options: Options) => { +export const build = async (value: StorybookConfig['build'], options: Options) => { return { ...value, - build: { + test: { ...testBuildFeatures(!!options.test), - ...value?.build, + ...value?.test, }, }; }; diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index 9d186fc3ce9c..e1100853f5ee 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -76,7 +76,7 @@ export interface Presets { apply(extension: 'managerEntries', config: [], args?: any): Promise; apply(extension: 'refs', config?: [], args?: any): Promise; apply(extension: 'core', config?: {}, args?: any): Promise; - apply(extension: 'test', config?: {}, args?: any): Promise; + apply(extension: 'build', config?: {}, args?: any): Promise; apply(extension: string, config?: T, args?: unknown): Promise; } @@ -314,8 +314,8 @@ export interface StorybookConfig { legacyDecoratorFileOrder?: boolean; }; - test: { - build: { + build: { + test: { /** * Globalize @storybook/blocks */ From f1ed2af485b2f46db52f4dbb73150d3be3956fed Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Thu, 2 Nov 2023 09:26:31 +0100 Subject: [PATCH 016/115] Dependencies: Remove lerna --- code/lerna.json | 6 - code/package.json | 4 - code/yarn.lock | 2534 ++------------------------------ scripts/run-registry.ts | 4 +- scripts/utils/list-packages.ts | 22 - scripts/utils/workspace.ts | 13 +- 6 files changed, 160 insertions(+), 2423 deletions(-) delete mode 100644 code/lerna.json delete mode 100644 scripts/utils/list-packages.ts diff --git a/code/lerna.json b/code/lerna.json deleted file mode 100644 index c4881ba783a9..000000000000 --- a/code/lerna.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "npmClient": "yarn", - "useWorkspaces": true, - "registry": "https://registry.npmjs.org", - "version": "7.1.0-alpha.29" -} diff --git a/code/package.json b/code/package.json index f13e9ac50618..2b996643bff9 100644 --- a/code/package.json +++ b/code/package.json @@ -43,9 +43,6 @@ "lint:package": "sort-package-json", "local-registry": "ts-node --swc --project=../scripts/tsconfig.json ../scripts/run-registry.ts", "publish-sandboxes": "ts-node --swc ../scripts/sandbox/publish.ts", - "publish:debug": "npm run publish:latest -- --npm-tag=debug --no-push", - "publish:latest": "lerna publish --exact --concurrency 1 --force-publish", - "publish:next": "npm run publish:latest -- --npm-tag=next", "storybook:blocks": "STORYBOOK_BLOCKS_ONLY=true yarn storybook:ui", "storybook:blocks:build": "STORYBOOK_BLOCKS_ONLY=true yarn storybook:ui:build", "storybook:blocks:chromatic": "STORYBOOK_BLOCKS_ONLY=true yarn storybook:ui:chromatic --project-token=${CHROMATIC_TOKEN_STORYBOOK_BLOCKS:-MISSING_PROJECT_TOKEN}", @@ -243,7 +240,6 @@ "jest-os-detection": "^1.3.1", "jest-serializer-html": "^7.1.0", "jest-watch-typeahead": "^2.2.1", - "lerna": "^6.4.0", "lint-staged": "^13.2.2", "lodash": "^4.17.21", "node-gyp": "^9.3.1", diff --git a/code/yarn.lock b/code/yarn.lock index 1757ba3b922b..f84d93099ec7 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -3027,13 +3027,6 @@ __metadata: languageName: node linkType: hard -"@gar/promisify@npm:^1.1.3": - version: 1.1.3 - resolution: "@gar/promisify@npm:1.1.3" - checksum: 0b3c9958d3cd17f4add3574975e3115ae05dc7f1298a60810414b16f6f558c137b5fb3cd3905df380bacfd955ec13f67c1e6710cbb5c246a7e8d65a8289b2bff - languageName: node - linkType: hard - "@gitbeaker/core@npm:^35.8.1": version: 35.8.1 resolution: "@gitbeaker/core@npm:35.8.1" @@ -3496,13 +3489,6 @@ __metadata: languageName: node linkType: hard -"@hutson/parse-repository-url@npm:^3.0.0": - version: 3.0.2 - resolution: "@hutson/parse-repository-url@npm:3.0.2" - checksum: d9197757ecad2df18d29d3e1d1fe0716d458fd88b849c71cbec9e78239f911074c97e8d764dfd8ed890431c1137e52dd7a337207fd65be20ce0784f7860ae4d1 - languageName: node - linkType: hard - "@hypnosphi/create-react-context@npm:^0.3.1": version: 0.3.1 resolution: "@hypnosphi/create-react-context@npm:0.3.1" @@ -3530,13 +3516,6 @@ __metadata: languageName: node linkType: hard -"@isaacs/string-locale-compare@npm:^1.1.0": - version: 1.1.0 - resolution: "@isaacs/string-locale-compare@npm:1.1.0" - checksum: d67226ff7ac544a495c77df38187e69e0e3a0783724777f86caadafb306e2155dc3b5787d5927916ddd7fb4a53561ac8f705448ac3235d18ea60da5854829fdf - languageName: node - linkType: hard - "@istanbuljs/load-nyc-config@npm:^1.0.0": version: 1.1.0 resolution: "@istanbuljs/load-nyc-config@npm:1.1.0" @@ -3724,7 +3703,7 @@ __metadata: languageName: node linkType: hard -"@jest/schemas@npm:^29.4.3, @jest/schemas@npm:^29.6.3": +"@jest/schemas@npm:^29.6.3": version: 29.6.3 resolution: "@jest/schemas@npm:29.6.3" dependencies: @@ -3925,108 +3904,6 @@ __metadata: languageName: node linkType: hard -"@lerna/child-process@npm:6.6.2": - version: 6.6.2 - resolution: "@lerna/child-process@npm:6.6.2" - dependencies: - chalk: "npm:^4.1.0" - execa: "npm:^5.0.0" - strong-log-transformer: "npm:^2.1.0" - checksum: 94517af1b95eff91b7d7f02678837866b8cf4304ff8b94e8ee31c12541baee1c6b5eb0fbf21e6d8ed5d558dc176197f98f127195e90e159e2ddb9943f1ad7cf3 - languageName: node - linkType: hard - -"@lerna/create@npm:6.6.2": - version: 6.6.2 - resolution: "@lerna/create@npm:6.6.2" - dependencies: - "@lerna/child-process": "npm:6.6.2" - dedent: "npm:^0.7.0" - fs-extra: "npm:^9.1.0" - init-package-json: "npm:^3.0.2" - npm-package-arg: "npm:8.1.1" - p-reduce: "npm:^2.1.0" - pacote: "npm:15.1.1" - pify: "npm:^5.0.0" - semver: "npm:^7.3.4" - slash: "npm:^3.0.0" - validate-npm-package-license: "npm:^3.0.4" - validate-npm-package-name: "npm:^4.0.0" - yargs-parser: "npm:20.2.4" - checksum: e37f3acc3ab65f1170b962ef180e5a39f5fd15c0ee08fb0532ea2ad923230897a67bb26f06495013c377dcab8040cefd7a9ed875b9333d835cfd43b5024d2f71 - languageName: node - linkType: hard - -"@lerna/legacy-package-management@npm:6.6.2": - version: 6.6.2 - resolution: "@lerna/legacy-package-management@npm:6.6.2" - dependencies: - "@npmcli/arborist": "npm:6.2.3" - "@npmcli/run-script": "npm:4.1.7" - "@nrwl/devkit": "npm:>=15.5.2 < 16" - "@octokit/rest": "npm:19.0.3" - byte-size: "npm:7.0.0" - chalk: "npm:4.1.0" - clone-deep: "npm:4.0.1" - cmd-shim: "npm:5.0.0" - columnify: "npm:1.6.0" - config-chain: "npm:1.1.12" - conventional-changelog-core: "npm:4.2.4" - conventional-recommended-bump: "npm:6.1.0" - cosmiconfig: "npm:7.0.0" - dedent: "npm:0.7.0" - dot-prop: "npm:6.0.1" - execa: "npm:5.0.0" - file-url: "npm:3.0.0" - find-up: "npm:5.0.0" - fs-extra: "npm:9.1.0" - get-port: "npm:5.1.1" - get-stream: "npm:6.0.0" - git-url-parse: "npm:13.1.0" - glob-parent: "npm:5.1.2" - globby: "npm:11.1.0" - graceful-fs: "npm:4.2.10" - has-unicode: "npm:2.0.1" - inquirer: "npm:8.2.4" - is-ci: "npm:2.0.0" - is-stream: "npm:2.0.0" - libnpmpublish: "npm:7.1.4" - load-json-file: "npm:6.2.0" - make-dir: "npm:3.1.0" - minimatch: "npm:3.0.5" - multimatch: "npm:5.0.0" - node-fetch: "npm:2.6.7" - npm-package-arg: "npm:8.1.1" - npm-packlist: "npm:5.1.1" - npm-registry-fetch: "npm:14.0.3" - npmlog: "npm:6.0.2" - p-map: "npm:4.0.0" - p-map-series: "npm:2.1.0" - p-queue: "npm:6.6.2" - p-waterfall: "npm:2.1.1" - pacote: "npm:15.1.1" - pify: "npm:5.0.0" - pretty-format: "npm:29.4.3" - read-cmd-shim: "npm:3.0.0" - read-package-json: "npm:5.0.1" - resolve-from: "npm:5.0.0" - semver: "npm:7.3.8" - signal-exit: "npm:3.0.7" - slash: "npm:3.0.0" - ssri: "npm:9.0.1" - strong-log-transformer: "npm:2.1.0" - tar: "npm:6.1.11" - temp-dir: "npm:1.0.0" - tempy: "npm:1.0.0" - upath: "npm:2.0.1" - uuid: "npm:8.3.2" - write-file-atomic: "npm:4.0.1" - write-pkg: "npm:4.0.0" - yargs: "npm:16.2.0" - checksum: 21087b65a0999852212d3cf8b9e94b4cf158324211a47d3655fadee84a59b6ec8b62dc133266a2204324cfbd0871d9cec65cfc8da802a6ee4b2f8effc5ed6614 - languageName: node - linkType: hard - "@lit-labs/react@npm:^1.0.2": version: 1.2.1 resolution: "@lit-labs/react@npm:1.2.1" @@ -4181,59 +4058,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/arborist@npm:6.2.3": - version: 6.2.3 - resolution: "@npmcli/arborist@npm:6.2.3" - dependencies: - "@isaacs/string-locale-compare": "npm:^1.1.0" - "@npmcli/fs": "npm:^3.1.0" - "@npmcli/installed-package-contents": "npm:^2.0.0" - "@npmcli/map-workspaces": "npm:^3.0.2" - "@npmcli/metavuln-calculator": "npm:^5.0.0" - "@npmcli/name-from-folder": "npm:^2.0.0" - "@npmcli/node-gyp": "npm:^3.0.0" - "@npmcli/package-json": "npm:^3.0.0" - "@npmcli/query": "npm:^3.0.0" - "@npmcli/run-script": "npm:^6.0.0" - bin-links: "npm:^4.0.1" - cacache: "npm:^17.0.4" - common-ancestor-path: "npm:^1.0.1" - hosted-git-info: "npm:^6.1.1" - json-parse-even-better-errors: "npm:^3.0.0" - json-stringify-nice: "npm:^1.1.4" - minimatch: "npm:^6.1.6" - nopt: "npm:^7.0.0" - npm-install-checks: "npm:^6.0.0" - npm-package-arg: "npm:^10.1.0" - npm-pick-manifest: "npm:^8.0.1" - npm-registry-fetch: "npm:^14.0.3" - npmlog: "npm:^7.0.1" - pacote: "npm:^15.0.8" - parse-conflict-json: "npm:^3.0.0" - proc-log: "npm:^3.0.0" - promise-all-reject-late: "npm:^1.0.0" - promise-call-limit: "npm:^1.0.1" - read-package-json-fast: "npm:^3.0.2" - semver: "npm:^7.3.7" - ssri: "npm:^10.0.1" - treeverse: "npm:^3.0.0" - walk-up-path: "npm:^1.0.0" - bin: - arborist: bin/index.js - checksum: 1422ba03aa5689379e976825198c9bf960ddb363a6bd6e4286527707b158b3467b3aafcfac957ce4e62502778943cb2dc0bee4dd207e3de5d3533fc066173f66 - languageName: node - linkType: hard - -"@npmcli/fs@npm:^2.1.0": - version: 2.1.2 - resolution: "@npmcli/fs@npm:2.1.2" - dependencies: - "@gar/promisify": "npm:^1.1.3" - semver: "npm:^7.3.5" - checksum: c50d087733d0d8df23be24f700f104b19922a28677aa66fdbe06ff6af6431cc4a5bb1e27683cbc661a5dafa9bafdc603e6a0378121506dfcd394b2b6dd76a187 - languageName: node - linkType: hard - "@npmcli/fs@npm:^3.1.0": version: 3.1.0 resolution: "@npmcli/fs@npm:3.1.0" @@ -4243,7 +4067,7 @@ __metadata: languageName: node linkType: hard -"@npmcli/git@npm:^4.0.0, @npmcli/git@npm:^4.1.0": +"@npmcli/git@npm:^4.0.0": version: 4.1.0 resolution: "@npmcli/git@npm:4.1.0" dependencies: @@ -4259,7 +4083,7 @@ __metadata: languageName: node linkType: hard -"@npmcli/installed-package-contents@npm:^2.0.0, @npmcli/installed-package-contents@npm:^2.0.1": +"@npmcli/installed-package-contents@npm:^2.0.1": version: 2.0.2 resolution: "@npmcli/installed-package-contents@npm:2.0.2" dependencies: @@ -4271,54 +4095,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/map-workspaces@npm:^3.0.2": - version: 3.0.4 - resolution: "@npmcli/map-workspaces@npm:3.0.4" - dependencies: - "@npmcli/name-from-folder": "npm:^2.0.0" - glob: "npm:^10.2.2" - minimatch: "npm:^9.0.0" - read-package-json-fast: "npm:^3.0.0" - checksum: caeb5f911d9b7ae0be01436442e6ec6b25aef750fe923de7a653eb62999d35b9f8be67c3f856790350ac86d9cea4a52532859b621eea81738f576302ecdd7475 - languageName: node - linkType: hard - -"@npmcli/metavuln-calculator@npm:^5.0.0": - version: 5.0.1 - resolution: "@npmcli/metavuln-calculator@npm:5.0.1" - dependencies: - cacache: "npm:^17.0.0" - json-parse-even-better-errors: "npm:^3.0.0" - pacote: "npm:^15.0.0" - semver: "npm:^7.3.5" - checksum: 0632e433de619da2c02215eabd1fa1e020eddccfe382ef5c8bd605f5fc8f636a4e7fe95ed59577325f7284cf4ee626980cbbaa27d8e7a7575cab409841a30578 - languageName: node - linkType: hard - -"@npmcli/move-file@npm:^2.0.0": - version: 2.0.1 - resolution: "@npmcli/move-file@npm:2.0.1" - dependencies: - mkdirp: "npm:^1.0.4" - rimraf: "npm:^3.0.2" - checksum: 11b2151e6d1de6f6eb23128de5aa8a429fd9097d839a5190cb77aa47a6b627022c42d50fa7c47a00f1c9f8f0c1560092b09b061855d293fa0741a2a94cfb174d - languageName: node - linkType: hard - -"@npmcli/name-from-folder@npm:^2.0.0": - version: 2.0.0 - resolution: "@npmcli/name-from-folder@npm:2.0.0" - checksum: 1aa551771d98ab366d4cb06b33efd3bb62b609942f6d9c3bb667c10e5bb39a223d3e330022bc980a44402133e702ae67603862099ac8254dad11f90e77409827 - languageName: node - linkType: hard - -"@npmcli/node-gyp@npm:^2.0.0": - version: 2.0.0 - resolution: "@npmcli/node-gyp@npm:2.0.0" - checksum: 8de88f4a602e8f868f10c660250429d34a51aaa10cb4d0f1f919d7920632be22cc47ad0e4d75097cd68e07fec5b93e41803ae3f03c1a3370badd865461e6b486 - languageName: node - linkType: hard - "@npmcli/node-gyp@npm:^3.0.0": version: 3.0.0 resolution: "@npmcli/node-gyp@npm:3.0.0" @@ -4326,29 +4102,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/package-json@npm:^3.0.0": - version: 3.1.1 - resolution: "@npmcli/package-json@npm:3.1.1" - dependencies: - "@npmcli/git": "npm:^4.1.0" - glob: "npm:^10.2.2" - json-parse-even-better-errors: "npm:^3.0.0" - normalize-package-data: "npm:^5.0.0" - npm-normalize-package-bin: "npm:^3.0.1" - proc-log: "npm:^3.0.0" - checksum: fc3052a36cb65c011da75dfdb051b631557e5ccc7b25b64be87cb363e8f2e99d78fcf94495f456406ada2c75afaff8177a2a06a46594f15eb0b4e667110a415e - languageName: node - linkType: hard - -"@npmcli/promise-spawn@npm:^3.0.0": - version: 3.0.0 - resolution: "@npmcli/promise-spawn@npm:3.0.0" - dependencies: - infer-owner: "npm:^1.0.4" - checksum: 934225972d7b3e456e76b2eae40b3ece2478a361d99aa56c79f65ef7c66aa83cd55330ee44daf43174b76649b25d722b9f85120a4591cac53d884423f315465c - languageName: node - linkType: hard - "@npmcli/promise-spawn@npm:^6.0.0, @npmcli/promise-spawn@npm:^6.0.1": version: 6.0.2 resolution: "@npmcli/promise-spawn@npm:6.0.2" @@ -4358,28 +4111,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/query@npm:^3.0.0": - version: 3.0.1 - resolution: "@npmcli/query@npm:3.0.1" - dependencies: - postcss-selector-parser: "npm:^6.0.10" - checksum: 497f03887121df13dbbc7a008772708746ecb9d8b9dbb1d8a8cdc5eb03ff6dbce0e78cbc48102e7cd3d2f3abc2faf22fd5348bb3c33efd13e2077faf8d71efde - languageName: node - linkType: hard - -"@npmcli/run-script@npm:4.1.7": - version: 4.1.7 - resolution: "@npmcli/run-script@npm:4.1.7" - dependencies: - "@npmcli/node-gyp": "npm:^2.0.0" - "@npmcli/promise-spawn": "npm:^3.0.0" - node-gyp: "npm:^9.0.0" - read-package-json-fast: "npm:^2.0.3" - which: "npm:^2.0.2" - checksum: f658434967a9308c367a258d31073d3e0c563e0b5122108f1dc6360575bfeb05705aa53a9575f63151900b9e4cfa31057df3953bf6157645eee2937ba0f7678a - languageName: node - linkType: hard - "@npmcli/run-script@npm:^6.0.0": version: 6.0.2 resolution: "@npmcli/run-script@npm:6.0.2" @@ -4393,15 +4124,6 @@ __metadata: languageName: node linkType: hard -"@nrwl/cli@npm:15.9.7": - version: 15.9.7 - resolution: "@nrwl/cli@npm:15.9.7" - dependencies: - nx: "npm:15.9.7" - checksum: 7fe454ae5a752abcc310edda6bd30ba4c9b7228d3c903231549d3a578825aaca4a49250b4ff73809aa02d8abc5478c6ac80ae1306b519f89a6f8cfedfb71c2cf - languageName: node - linkType: hard - "@nrwl/devkit@npm:17.0.2": version: 17.0.2 resolution: "@nrwl/devkit@npm:17.0.2" @@ -4411,95 +4133,6 @@ __metadata: languageName: node linkType: hard -"@nrwl/devkit@npm:>=15.5.2 < 16": - version: 15.9.7 - resolution: "@nrwl/devkit@npm:15.9.7" - dependencies: - ejs: "npm:^3.1.7" - ignore: "npm:^5.0.4" - semver: "npm:7.5.4" - tmp: "npm:~0.2.1" - tslib: "npm:^2.3.0" - peerDependencies: - nx: ">= 14.1 <= 16" - checksum: bbf384f2e8ba6608ca17c977f9b2992ccef8f022c9687689b374acaaf94c252ebddd2389ef6e8f978af650e8c85819cc3fef440c5d873c4009e8f4c999d08f73 - languageName: node - linkType: hard - -"@nrwl/nx-darwin-arm64@npm:15.9.7": - version: 15.9.7 - resolution: "@nrwl/nx-darwin-arm64@npm:15.9.7" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - -"@nrwl/nx-darwin-x64@npm:15.9.7": - version: 15.9.7 - resolution: "@nrwl/nx-darwin-x64@npm:15.9.7" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - -"@nrwl/nx-linux-arm-gnueabihf@npm:15.9.7": - version: 15.9.7 - resolution: "@nrwl/nx-linux-arm-gnueabihf@npm:15.9.7" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - -"@nrwl/nx-linux-arm64-gnu@npm:15.9.7": - version: 15.9.7 - resolution: "@nrwl/nx-linux-arm64-gnu@npm:15.9.7" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - -"@nrwl/nx-linux-arm64-musl@npm:15.9.7": - version: 15.9.7 - resolution: "@nrwl/nx-linux-arm64-musl@npm:15.9.7" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - -"@nrwl/nx-linux-x64-gnu@npm:15.9.7": - version: 15.9.7 - resolution: "@nrwl/nx-linux-x64-gnu@npm:15.9.7" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - -"@nrwl/nx-linux-x64-musl@npm:15.9.7": - version: 15.9.7 - resolution: "@nrwl/nx-linux-x64-musl@npm:15.9.7" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - -"@nrwl/nx-win32-arm64-msvc@npm:15.9.7": - version: 15.9.7 - resolution: "@nrwl/nx-win32-arm64-msvc@npm:15.9.7" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - -"@nrwl/nx-win32-x64-msvc@npm:15.9.7": - version: 15.9.7 - resolution: "@nrwl/nx-win32-x64-msvc@npm:15.9.7" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - -"@nrwl/tao@npm:15.9.7": - version: 15.9.7 - resolution: "@nrwl/tao@npm:15.9.7" - dependencies: - nx: "npm:15.9.7" - bin: - tao: index.js - checksum: 6ef6d77da018ad0ebaddc9bd4608d859211458e65979fc034e3c1e2bdfc77041c4ef43c24ab1dac108c48e8461de3bd266978948e523d4d6214d942895d26253 - languageName: node - linkType: hard - "@nrwl/tao@npm:17.0.2": version: 17.0.2 resolution: "@nrwl/tao@npm:17.0.2" @@ -4632,13 +4265,6 @@ __metadata: languageName: node linkType: hard -"@octokit/auth-token@npm:^3.0.0": - version: 3.0.4 - resolution: "@octokit/auth-token@npm:3.0.4" - checksum: abdf5e2da36344de9727c70ba782d58004f5ae1da0f65fa9bc9216af596ef23c0e4675f386df2f6886806612558091d603564051b693b0ad1986aa6160b7a231 - languageName: node - linkType: hard - "@octokit/core@npm:^2.4.3": version: 2.5.4 resolution: "@octokit/core@npm:2.5.4" @@ -4668,21 +4294,6 @@ __metadata: languageName: node linkType: hard -"@octokit/core@npm:^4.0.0": - version: 4.2.4 - resolution: "@octokit/core@npm:4.2.4" - dependencies: - "@octokit/auth-token": "npm:^3.0.0" - "@octokit/graphql": "npm:^5.0.0" - "@octokit/request": "npm:^6.0.0" - "@octokit/request-error": "npm:^3.0.0" - "@octokit/types": "npm:^9.0.0" - before-after-hook: "npm:^2.2.0" - universal-user-agent: "npm:^6.0.0" - checksum: e54081a56884e628d1804837fddcd48c10d516117bb891551c8dc9d8e3dad449aeb9b4677ca71e8f0e76268c2b7656c953099506679aaa4666765228474a3ce6 - languageName: node - linkType: hard - "@octokit/endpoint@npm:^6.0.1": version: 6.0.12 resolution: "@octokit/endpoint@npm:6.0.12" @@ -4694,17 +4305,6 @@ __metadata: languageName: node linkType: hard -"@octokit/endpoint@npm:^7.0.0": - version: 7.0.6 - resolution: "@octokit/endpoint@npm:7.0.6" - dependencies: - "@octokit/types": "npm:^9.0.0" - is-plain-object: "npm:^5.0.0" - universal-user-agent: "npm:^6.0.0" - checksum: fd147a55010b54af7567bf90791359f7096a1c9916a2b7c72f8afd0c53141338b3d78da3a4ab3e3bdfeb26218a1b73735432d8987ccc04996b1019219299f115 - languageName: node - linkType: hard - "@octokit/graphql@npm:^4.3.1, @octokit/graphql@npm:^4.5.8": version: 4.8.0 resolution: "@octokit/graphql@npm:4.8.0" @@ -4716,17 +4316,6 @@ __metadata: languageName: node linkType: hard -"@octokit/graphql@npm:^5.0.0": - version: 5.0.6 - resolution: "@octokit/graphql@npm:5.0.6" - dependencies: - "@octokit/request": "npm:^6.0.0" - "@octokit/types": "npm:^9.0.0" - universal-user-agent: "npm:^6.0.0" - checksum: de1d839d97fe6d96179925f6714bf96e7af6f77929892596bb4211adab14add3291fc5872b269a3d0e91a4dcf248d16096c82606c4a43538cf241b815c2e2a36 - languageName: node - linkType: hard - "@octokit/openapi-types@npm:^12.11.0": version: 12.11.0 resolution: "@octokit/openapi-types@npm:12.11.0" @@ -4734,27 +4323,6 @@ __metadata: languageName: node linkType: hard -"@octokit/openapi-types@npm:^14.0.0": - version: 14.0.0 - resolution: "@octokit/openapi-types@npm:14.0.0" - checksum: d122bbfd4997ea7e056c7fcf5b3240982b5b090b816671eca01829ac5ce19d2a19f6da35d126ae19a956a4203c68302d8fb33d5c00c77996b4e4a746878ea589 - languageName: node - linkType: hard - -"@octokit/openapi-types@npm:^18.0.0": - version: 18.1.1 - resolution: "@octokit/openapi-types@npm:18.1.1" - checksum: 856d3bb9f8c666e837dd5e8b8c216ee4342b9ed63ff8da922ca4ce5883ed1dfbec73390eb13d69fbcb4703a4c8b8b6a586df3b0e675ff93bf3d46b5b4fe0968e - languageName: node - linkType: hard - -"@octokit/plugin-enterprise-rest@npm:6.0.1": - version: 6.0.1 - resolution: "@octokit/plugin-enterprise-rest@npm:6.0.1" - checksum: 26bd0a30582954efcd29b41e16698db79e9d20e3f88c4069b43b183223cee69862621f18b6a7a1c9257b1cd07c24477e403b75c74688660ecf31d467b9d8fd9e - languageName: node - linkType: hard - "@octokit/plugin-paginate-rest@npm:^2.16.8, @octokit/plugin-paginate-rest@npm:^2.2.0": version: 2.21.3 resolution: "@octokit/plugin-paginate-rest@npm:2.21.3" @@ -4766,17 +4334,6 @@ __metadata: languageName: node linkType: hard -"@octokit/plugin-paginate-rest@npm:^3.0.0": - version: 3.1.0 - resolution: "@octokit/plugin-paginate-rest@npm:3.1.0" - dependencies: - "@octokit/types": "npm:^6.41.0" - peerDependencies: - "@octokit/core": ">=4" - checksum: 6a4eed9be518b7b7a05c30340dc4cec6a3bf8cfa6fa7fc3fa65b4193a3c47628e39469113643ea2eea38648dbc998482209ed35014344eaea78effd5629e36f3 - languageName: node - linkType: hard - "@octokit/plugin-request-log@npm:^1.0.0, @octokit/plugin-request-log@npm:^1.0.4": version: 1.0.4 resolution: "@octokit/plugin-request-log@npm:1.0.4" @@ -4808,18 +4365,6 @@ __metadata: languageName: node linkType: hard -"@octokit/plugin-rest-endpoint-methods@npm:^6.0.0": - version: 6.8.1 - resolution: "@octokit/plugin-rest-endpoint-methods@npm:6.8.1" - dependencies: - "@octokit/types": "npm:^8.1.1" - deprecation: "npm:^2.3.1" - peerDependencies: - "@octokit/core": ">=3" - checksum: 1ab8d3042fac9673f7152a783551c60cdbd3fa1383e6fc026f0ab5aca9105419e1cfa12c6e7955b5904a8c7dc9d2da413b31f3f6c45f6fb048cfb378b4e3dd66 - languageName: node - linkType: hard - "@octokit/request-error@npm:^2.0.5, @octokit/request-error@npm:^2.1.0": version: 2.1.0 resolution: "@octokit/request-error@npm:2.1.0" @@ -4831,17 +4376,6 @@ __metadata: languageName: node linkType: hard -"@octokit/request-error@npm:^3.0.0": - version: 3.0.3 - resolution: "@octokit/request-error@npm:3.0.3" - dependencies: - "@octokit/types": "npm:^9.0.0" - deprecation: "npm:^2.0.0" - once: "npm:^1.4.0" - checksum: 1e252ac193c8af23b709909911aa327ed5372cbafcba09e4aff41e0f640a7c152579ab0a60311a92e37b4e7936392d59ee4c2feae5cdc387ee8587a33d8afa60 - languageName: node - linkType: hard - "@octokit/request@npm:^5.4.0, @octokit/request@npm:^5.6.0, @octokit/request@npm:^5.6.3": version: 5.6.3 resolution: "@octokit/request@npm:5.6.3" @@ -4856,32 +4390,6 @@ __metadata: languageName: node linkType: hard -"@octokit/request@npm:^6.0.0": - version: 6.2.8 - resolution: "@octokit/request@npm:6.2.8" - dependencies: - "@octokit/endpoint": "npm:^7.0.0" - "@octokit/request-error": "npm:^3.0.0" - "@octokit/types": "npm:^9.0.0" - is-plain-object: "npm:^5.0.0" - node-fetch: "npm:^2.6.7" - universal-user-agent: "npm:^6.0.0" - checksum: 6b6079ed45bac44c4579b40990bfd1905b03d4bc4e5255f3d5a10cf5182171578ebe19abeab32ebb11a806f1131947f2a06b7a077bd7e77ade7b15fe2882174b - languageName: node - linkType: hard - -"@octokit/rest@npm:19.0.3": - version: 19.0.3 - resolution: "@octokit/rest@npm:19.0.3" - dependencies: - "@octokit/core": "npm:^4.0.0" - "@octokit/plugin-paginate-rest": "npm:^3.0.0" - "@octokit/plugin-request-log": "npm:^1.0.4" - "@octokit/plugin-rest-endpoint-methods": "npm:^6.0.0" - checksum: ee9c3d537dba827d47af9eb7f4a2f78d81a6441a45e81a4c9b4a5adada0fa2ccf2759fdfac9f3c53543c22fefa21a0c68417773d74e3b4a5101189fd7950ee6e - languageName: node - linkType: hard - "@octokit/rest@npm:^16.43.0 || ^17.11.0 || ^18.12.0, @octokit/rest@npm:^18.12.0": version: 18.12.0 resolution: "@octokit/rest@npm:18.12.0" @@ -4924,7 +4432,7 @@ __metadata: languageName: node linkType: hard -"@octokit/types@npm:^6.0.3, @octokit/types@npm:^6.16.1, @octokit/types@npm:^6.39.0, @octokit/types@npm:^6.40.0, @octokit/types@npm:^6.41.0": +"@octokit/types@npm:^6.0.3, @octokit/types@npm:^6.16.1, @octokit/types@npm:^6.39.0, @octokit/types@npm:^6.40.0": version: 6.41.0 resolution: "@octokit/types@npm:6.41.0" dependencies: @@ -4933,35 +4441,6 @@ __metadata: languageName: node linkType: hard -"@octokit/types@npm:^8.1.1": - version: 8.2.1 - resolution: "@octokit/types@npm:8.2.1" - dependencies: - "@octokit/openapi-types": "npm:^14.0.0" - checksum: 85a97bca714b88ea0d34066b4821e48ba4f8dda8f3970f1a00deb02b3e3f1cc315720d25430082dc651c400717510273193ac6af610268488160bb9e6a30bef8 - languageName: node - linkType: hard - -"@octokit/types@npm:^9.0.0": - version: 9.3.2 - resolution: "@octokit/types@npm:9.3.2" - dependencies: - "@octokit/openapi-types": "npm:^18.0.0" - checksum: 2925479aa378a4491762b4fcf381bdc7daca39b4e0b2dd7062bce5d74a32ed7d79d20d3c65ceaca6d105cf4b1f7417fea634219bf90f79a57d03e2dac629ec45 - languageName: node - linkType: hard - -"@parcel/watcher@npm:2.0.4": - version: 2.0.4 - resolution: "@parcel/watcher@npm:2.0.4" - dependencies: - node-addon-api: "npm:^3.2.1" - node-gyp: "npm:latest" - node-gyp-build: "npm:^4.3.0" - checksum: 7c7e8fa2879371135039cf6559122808fc37d436701dd804f3e0b4897d5690a2c92c73795ad4a015d8715990bfb4226dc6d14fea429522fcb5662ce370508e8d - languageName: node - linkType: hard - "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -8025,7 +7504,6 @@ __metadata: jest-os-detection: "npm:^1.3.1" jest-serializer-html: "npm:^7.1.0" jest-watch-typeahead: "npm:^2.2.1" - lerna: "npm:^6.4.0" lint-staged: "npm:^13.2.2" lodash: "npm:^4.17.21" node-gyp: "npm:^9.3.1" @@ -9624,13 +9102,6 @@ __metadata: languageName: node linkType: hard -"@types/minimist@npm:^1.2.0": - version: 1.2.3 - resolution: "@types/minimist@npm:1.2.3" - checksum: e57d18f3c49b286eb5e63f2f6ec77d9a71beace3d9ef21cc3ee5a8eb4161520918b7eb0dcf20046d05339b955208a972ef474cc568542cd64b7b6365b9ec6650 - languageName: node - linkType: hard - "@types/mock-fs@npm:^4.13.1": version: 4.13.2 resolution: "@types/mock-fs@npm:4.13.2" @@ -10971,18 +10442,6 @@ __metadata: languageName: node linkType: hard -"JSONStream@npm:^1.0.4": - version: 1.3.5 - resolution: "JSONStream@npm:1.3.5" - dependencies: - jsonparse: "npm:^1.2.0" - through: "npm:>=2.2.7 <3" - bin: - JSONStream: ./bin.js - checksum: 0f54694da32224d57b715385d4a6b668d2117379d1f3223dc758459246cca58fdc4c628b83e8a8883334e454a0a30aa198ede77c788b55537c1844f686a751f2 - languageName: node - linkType: hard - "abab@npm:^2.0.3, abab@npm:^2.0.5, abab@npm:^2.0.6": version: 2.0.6 resolution: "abab@npm:2.0.6" @@ -10997,13 +10456,6 @@ __metadata: languageName: node linkType: hard -"abbrev@npm:^2.0.0": - version: 2.0.0 - resolution: "abbrev@npm:2.0.0" - checksum: f742a5a107473946f426c691c08daba61a1d15942616f300b5d32fd735be88fef5cba24201757b6c407fd564555fb48c751cfa33519b2605c8a7aadd22baf372 - languageName: node - linkType: hard - "abort-controller@npm:^3.0.0": version: 3.0.0 resolution: "abort-controller@npm:3.0.0" @@ -11093,13 +10545,6 @@ __metadata: languageName: node linkType: hard -"add-stream@npm:^1.0.0": - version: 1.0.0 - resolution: "add-stream@npm:1.0.0" - checksum: 985014a14e76ca4cb24e0fc58bb1556794cf38c5c8937de335a10584f50a371dc48e1c34a59391c7eb9c1fc908b4b86764df5d2756f701df6ba95d1ca2f63ddc - languageName: node - linkType: hard - "address@npm:^1.0.1": version: 1.2.2 resolution: "address@npm:1.2.2" @@ -11379,7 +10824,7 @@ __metadata: languageName: node linkType: hard -"aproba@npm:^1.0.3 || ^2.0.0, aproba@npm:^2.0.0": +"aproba@npm:^1.0.3 || ^2.0.0": version: 2.0.0 resolution: "aproba@npm:2.0.0" checksum: d06e26384a8f6245d8c8896e138c0388824e259a329e0c9f196b4fa533c82502a6fd449586e3604950a0c42921832a458bb3aa0aa9f0ba449cfd4f50fd0d09b5 @@ -11406,16 +10851,6 @@ __metadata: languageName: node linkType: hard -"are-we-there-yet@npm:^4.0.0": - version: 4.0.1 - resolution: "are-we-there-yet@npm:4.0.1" - dependencies: - delegates: "npm:^1.0.0" - readable-stream: "npm:^4.1.0" - checksum: ca4c89c08236a7ecbb909c29d0a7b9e02e1df9b0e438a75b317aa6bdcd0392bb20ce5365c4af571923a6c8c835aa85d50bf1f80c60453b794ee3b02dcdfd39bb - languageName: node - linkType: hard - "arg@npm:^4.1.0": version: 4.1.3 resolution: "arg@npm:4.1.3" @@ -11507,13 +10942,6 @@ __metadata: languageName: node linkType: hard -"array-differ@npm:^3.0.0": - version: 3.0.0 - resolution: "array-differ@npm:3.0.0" - checksum: c0d924cc2b7e3f5a0e6ae932e8941c5fddc0412bcecf8d5152641910e60f5e1c1e87da2b32083dec2f92f9a8f78e916ea68c22a0579794ba49886951ae783123 - languageName: node - linkType: hard - "array-equal@npm:^1.0.0": version: 1.0.0 resolution: "array-equal@npm:1.0.0" @@ -11535,13 +10963,6 @@ __metadata: languageName: node linkType: hard -"array-ify@npm:^1.0.0": - version: 1.0.0 - resolution: "array-ify@npm:1.0.0" - checksum: 75c9c072faac47bd61779c0c595e912fe660d338504ac70d10e39e1b8a4a0c9c87658703d619b9d1b70d324177ae29dc8d07dda0d0a15d005597bc4c5a59c70c - languageName: node - linkType: hard - "array-includes@npm:^3.1.6": version: 3.1.7 resolution: "array-includes@npm:3.1.7" @@ -11675,13 +11096,6 @@ __metadata: languageName: node linkType: hard -"arrify@npm:^1.0.1": - version: 1.0.1 - resolution: "arrify@npm:1.0.1" - checksum: c35c8d1a81bcd5474c0c57fe3f4bad1a4d46a5fa353cedcff7a54da315df60db71829e69104b859dff96c5d68af46bd2be259fe5e50dc6aa9df3b36bea0383ab - languageName: node - linkType: hard - "arrify@npm:^2.0.0, arrify@npm:^2.0.1": version: 2.0.1 resolution: "arrify@npm:2.0.1" @@ -11856,13 +11270,6 @@ __metadata: languageName: node linkType: hard -"at-least-node@npm:^1.0.0": - version: 1.0.0 - resolution: "at-least-node@npm:1.0.0" - checksum: 4c058baf6df1bc5a1697cf182e2029c58cd99975288a13f9e70068ef5d6f4e1f1fd7c4d2c3c4912eae44797d1725be9700995736deca441b39f3e66d8dee97ef - languageName: node - linkType: hard - "atob@npm:^2.1.2": version: 2.1.2 resolution: "atob@npm:2.1.2" @@ -11914,17 +11321,6 @@ __metadata: languageName: node linkType: hard -"axios@npm:^1.0.0": - version: 1.5.1 - resolution: "axios@npm:1.5.1" - dependencies: - follow-redirects: "npm:^1.15.0" - form-data: "npm:^4.0.0" - proxy-from-env: "npm:^1.1.0" - checksum: f9d975a17a9dff8e325e204d5e09ef07bdd1b6fa63983f184c3cf33249ee38339f1e5d8f874f89116be8942b46d1f4d5ce9ddb03757be69614f5775c2dd6da25 - languageName: node - linkType: hard - "axios@npm:^1.5.1": version: 1.6.0 resolution: "axios@npm:1.6.0" @@ -12357,18 +11753,6 @@ __metadata: languageName: node linkType: hard -"bin-links@npm:^4.0.1": - version: 4.0.2 - resolution: "bin-links@npm:4.0.2" - dependencies: - cmd-shim: "npm:^6.0.0" - npm-normalize-package-bin: "npm:^3.0.0" - read-cmd-shim: "npm:^4.0.0" - write-file-atomic: "npm:^5.0.0" - checksum: ccc576b2a54508fc02fe41ba5520c48b0e45faed7a29b5700666bc9fcf608a69958ff23bfc8e35907806c0d038e11e18da0cca857072f3be834d85e366f5d7c7 - languageName: node - linkType: hard - "binary-extensions@npm:^2.0.0": version: 2.2.0 resolution: "binary-extensions@npm:2.2.0" @@ -12924,13 +12308,6 @@ __metadata: languageName: node linkType: hard -"builtins@npm:^1.0.3": - version: 1.0.3 - resolution: "builtins@npm:1.0.3" - checksum: 493afcc1db0a56d174cc85bebe5ca69144f6fdd0007d6cbe6b2434185314c79d83cb867e492b56aa5cf421b4b8a8135bf96ba4c3ce71994cf3da154d1ea59747 - languageName: node - linkType: hard - "builtins@npm:^5.0.0": version: 5.0.1 resolution: "builtins@npm:5.0.1" @@ -12949,13 +12326,6 @@ __metadata: languageName: node linkType: hard -"byte-size@npm:7.0.0": - version: 7.0.0 - resolution: "byte-size@npm:7.0.0" - checksum: 5420787f0c50b7bdaef49222a4a0b198b9a102ef287f9045312bcdc545b1514962234aae9147f9bb3ff4c72ac879c26b47638c0e85d3d923b0e7cd7a77b6189f - languageName: node - linkType: hard - "bytes@npm:3.0.0": version: 3.0.0 resolution: "bytes@npm:3.0.0" @@ -12992,33 +12362,7 @@ __metadata: languageName: node linkType: hard -"cacache@npm:^16.1.0": - version: 16.1.3 - resolution: "cacache@npm:16.1.3" - dependencies: - "@npmcli/fs": "npm:^2.1.0" - "@npmcli/move-file": "npm:^2.0.0" - chownr: "npm:^2.0.0" - fs-minipass: "npm:^2.1.0" - glob: "npm:^8.0.1" - infer-owner: "npm:^1.0.4" - lru-cache: "npm:^7.7.1" - minipass: "npm:^3.1.6" - minipass-collect: "npm:^1.0.2" - minipass-flush: "npm:^1.0.5" - minipass-pipeline: "npm:^1.2.4" - mkdirp: "npm:^1.0.4" - p-map: "npm:^4.0.0" - promise-inflight: "npm:^1.0.1" - rimraf: "npm:^3.0.2" - ssri: "npm:^9.0.0" - tar: "npm:^6.1.11" - unique-filename: "npm:^2.0.0" - checksum: cdf6836e1c457d2a5616abcaf5d8240c0346b1f5bd6fdb8866b9d84b6dff0b54e973226dc11e0d099f35394213d24860d1989c8358d2a41b39eb912b3000e749 - languageName: node - linkType: hard - -"cacache@npm:^17.0.0, cacache@npm:^17.0.4": +"cacache@npm:^17.0.0": version: 17.1.4 resolution: "cacache@npm:17.1.4" dependencies: @@ -13113,17 +12457,6 @@ __metadata: languageName: node linkType: hard -"camelcase-keys@npm:^6.2.2": - version: 6.2.2 - resolution: "camelcase-keys@npm:6.2.2" - dependencies: - camelcase: "npm:^5.3.1" - map-obj: "npm:^4.0.0" - quick-lru: "npm:^4.0.1" - checksum: bf1a28348c0f285c6c6f68fb98a9d088d3c0269fed0cdff3ea680d5a42df8a067b4de374e7a33e619eb9d5266a448fe66c2dd1f8e0c9209ebc348632882a3526 - languageName: node - linkType: hard - "camelcase@npm:^5.0.0, camelcase@npm:^5.3.1": version: 5.3.1 resolution: "camelcase@npm:5.3.1" @@ -13185,16 +12518,6 @@ __metadata: languageName: node linkType: hard -"chalk@npm:4.1.0": - version: 4.1.0 - resolution: "chalk@npm:4.1.0" - dependencies: - ansi-styles: "npm:^4.1.0" - supports-color: "npm:^7.1.0" - checksum: 3787bd65ecd98ab3a1acc3b4f71d006268a675875e49ee6ea75fb54ba73d268b97544368358c18c42445e408e076ae8ad5cec8fbad36942a2c7ac654883dc61e - languageName: node - linkType: hard - "chalk@npm:5.3.0, chalk@npm:^5.2.0": version: 5.3.0 resolution: "chalk@npm:5.3.0" @@ -13426,7 +12749,7 @@ __metadata: languageName: node linkType: hard -"ci-info@npm:^3.2.0, ci-info@npm:^3.6.1": +"ci-info@npm:^3.2.0": version: 3.9.0 resolution: "ci-info@npm:3.9.0" checksum: 6f0109e36e111684291d46123d491bc4e7b7a1934c3a20dea28cba89f1d4a03acd892f5f6a81ed3855c38647e285a150e3c9ba062e38943bef57fee6c1554c3a @@ -13605,7 +12928,7 @@ __metadata: languageName: node linkType: hard -"clone-deep@npm:4.0.1, clone-deep@npm:^4.0.1": +"clone-deep@npm:^4.0.1": version: 4.0.1 resolution: "clone-deep@npm:4.0.1" dependencies: @@ -13653,22 +12976,6 @@ __metadata: languageName: node linkType: hard -"cmd-shim@npm:5.0.0": - version: 5.0.0 - resolution: "cmd-shim@npm:5.0.0" - dependencies: - mkdirp-infer-owner: "npm:^2.0.0" - checksum: 0ce77d641bed74e41b74f07a00cbdc4e8690787d2136e40418ca7c1bfcff9d92c0350e31785c7bb98b6c1fb8ae7dcedcdc872b98c6647c28de45e2dc7a70ae43 - languageName: node - linkType: hard - -"cmd-shim@npm:^6.0.0": - version: 6.0.1 - resolution: "cmd-shim@npm:6.0.1" - checksum: fe8fd2ad79a30193fb6f439fe4104de3129e869c58eac507d2154db95ebfd45ddfbcec8f373ed9ba5d3036b85d963e8ef5d1d28754c160b117cb77c02e4528cb - languageName: node - linkType: hard - "co@npm:3.1.0": version: 3.1.0 resolution: "co@npm:3.1.0" @@ -13795,16 +13102,6 @@ __metadata: languageName: node linkType: hard -"columnify@npm:1.6.0": - version: 1.6.0 - resolution: "columnify@npm:1.6.0" - dependencies: - strip-ansi: "npm:^6.0.1" - wcwidth: "npm:^1.0.0" - checksum: 25b90b59129331bbb8b0c838f8df69924349b83e8eab9549f431062a20a39094b8d744bb83265be38fd5d03140ce4bfbd85837c293f618925e83157ae9535f1d - languageName: node - linkType: hard - "combined-stream@npm:^1.0.8": version: 1.0.8 resolution: "combined-stream@npm:1.0.8" @@ -13856,13 +13153,6 @@ __metadata: languageName: node linkType: hard -"common-ancestor-path@npm:^1.0.1": - version: 1.0.1 - resolution: "common-ancestor-path@npm:1.0.1" - checksum: 390c08d2a67a7a106d39499c002d827d2874966d938012453fd7ca34cd306881e2b9d604f657fa7a8e6e4896d67f39ebc09bf1bfd8da8ff318e0fb7a8752c534 - languageName: node - linkType: hard - "common-path-prefix@npm:^3.0.0": version: 3.0.0 resolution: "common-path-prefix@npm:3.0.0" @@ -13877,16 +13167,6 @@ __metadata: languageName: node linkType: hard -"compare-func@npm:^2.0.0": - version: 2.0.0 - resolution: "compare-func@npm:2.0.0" - dependencies: - array-ify: "npm:^1.0.0" - dot-prop: "npm:^5.1.0" - checksum: 78bd4dd4ed311a79bd264c9e13c36ed564cde657f1390e699e0f04b8eee1fc06ffb8698ce2dfb5fbe7342d509579c82d4e248f08915b708f77f7b72234086cc3 - languageName: node - linkType: hard - "compare-versions@npm:^3.6.0": version: 3.6.0 resolution: "compare-versions@npm:3.6.0" @@ -13982,16 +13262,6 @@ __metadata: languageName: node linkType: hard -"config-chain@npm:1.1.12": - version: 1.1.12 - resolution: "config-chain@npm:1.1.12" - dependencies: - ini: "npm:^1.3.4" - proto-list: "npm:~1.2.1" - checksum: fd07fb8ca4d06d540ee64824ca4778065eefaaed59e1ad157b6a7d764370581dfb44f2dda7cf65589a9199e27f7afe73c271b2e45abe3d766a915ad926150361 - languageName: node - linkType: hard - "confusing-browser-globals@npm:^1.0.10": version: 1.0.11 resolution: "confusing-browser-globals@npm:1.0.11" @@ -14071,108 +13341,6 @@ __metadata: languageName: node linkType: hard -"conventional-changelog-angular@npm:5.0.12": - version: 5.0.12 - resolution: "conventional-changelog-angular@npm:5.0.12" - dependencies: - compare-func: "npm:^2.0.0" - q: "npm:^1.5.1" - checksum: fc0d5ba4478cd0058778000f0939a5c8f7da1c469f4d4d8ee36519cac8f41a85299ef6ea8733cc232f4ad0904a0f7c392073ade3a9b700c18ef6237c9ba69c03 - languageName: node - linkType: hard - -"conventional-changelog-core@npm:4.2.4": - version: 4.2.4 - resolution: "conventional-changelog-core@npm:4.2.4" - dependencies: - add-stream: "npm:^1.0.0" - conventional-changelog-writer: "npm:^5.0.0" - conventional-commits-parser: "npm:^3.2.0" - dateformat: "npm:^3.0.0" - get-pkg-repo: "npm:^4.0.0" - git-raw-commits: "npm:^2.0.8" - git-remote-origin-url: "npm:^2.0.0" - git-semver-tags: "npm:^4.1.1" - lodash: "npm:^4.17.15" - normalize-package-data: "npm:^3.0.0" - q: "npm:^1.5.1" - read-pkg: "npm:^3.0.0" - read-pkg-up: "npm:^3.0.0" - through2: "npm:^4.0.0" - checksum: 4c9f30350250298d9bbb56988b3093ec7de593499a796609c5877115533362815434ff6df3493649e20b1b40399fef3d42032f39e8279bb8df192b89e6e32e69 - languageName: node - linkType: hard - -"conventional-changelog-preset-loader@npm:^2.3.4": - version: 2.3.4 - resolution: "conventional-changelog-preset-loader@npm:2.3.4" - checksum: a978bcd5fc2eb12b56bc03ec59705af32e521fd27b98a209a26767c2078d423e7d8e30c09d45547371631790f0387453434c73c4541521a7473dce14d5360c7d - languageName: node - linkType: hard - -"conventional-changelog-writer@npm:^5.0.0": - version: 5.0.1 - resolution: "conventional-changelog-writer@npm:5.0.1" - dependencies: - conventional-commits-filter: "npm:^2.0.7" - dateformat: "npm:^3.0.0" - handlebars: "npm:^4.7.7" - json-stringify-safe: "npm:^5.0.1" - lodash: "npm:^4.17.15" - meow: "npm:^8.0.0" - semver: "npm:^6.0.0" - split: "npm:^1.0.0" - through2: "npm:^4.0.0" - bin: - conventional-changelog-writer: cli.js - checksum: 268b56a3e4db07ad24da7134788c889ecd024cf2e7c0bfe8ca76f83e5db79f057538c45500b052a77b7933c4d0f47e2e807c6e756cbd5ad9db365744c9ce0e7f - languageName: node - linkType: hard - -"conventional-commits-filter@npm:^2.0.7": - version: 2.0.7 - resolution: "conventional-commits-filter@npm:2.0.7" - dependencies: - lodash.ismatch: "npm:^4.4.0" - modify-values: "npm:^1.0.0" - checksum: df06fb29285b473614f5094e983d26fcc14cd0f64b2cbb2f65493fc8bd47c077c2310791d26f4b2b719e9585aaade95370e73230bff6647163164a18b9dfaa07 - languageName: node - linkType: hard - -"conventional-commits-parser@npm:^3.2.0": - version: 3.2.4 - resolution: "conventional-commits-parser@npm:3.2.4" - dependencies: - JSONStream: "npm:^1.0.4" - is-text-path: "npm:^1.0.1" - lodash: "npm:^4.17.15" - meow: "npm:^8.0.0" - split2: "npm:^3.0.0" - through2: "npm:^4.0.0" - bin: - conventional-commits-parser: cli.js - checksum: 122d7d7f991a04c8e3f703c0e4e9a25b2ecb20906f497e4486cb5c2acd9c68f6d9af745f7e79cb407538f50e840b33399274ac427b20971b98b335d1b66d3d17 - languageName: node - linkType: hard - -"conventional-recommended-bump@npm:6.1.0": - version: 6.1.0 - resolution: "conventional-recommended-bump@npm:6.1.0" - dependencies: - concat-stream: "npm:^2.0.0" - conventional-changelog-preset-loader: "npm:^2.3.4" - conventional-commits-filter: "npm:^2.0.7" - conventional-commits-parser: "npm:^3.2.0" - git-raw-commits: "npm:^2.0.8" - git-semver-tags: "npm:^4.1.1" - meow: "npm:^8.0.0" - q: "npm:^1.5.1" - bin: - conventional-recommended-bump: cli.js - checksum: 649e6230be7e96e057a542a2695710aeaee356297d307691b3398e0f18d596b4a5b3ba56307755e779d8687a13b2466844300c649eb23f44fe5f1db9f923f3f4 - languageName: node - linkType: hard - "convert-source-map@npm:^1.5.0, convert-source-map@npm:^1.5.1, convert-source-map@npm:^1.6.0, convert-source-map@npm:^1.7.0": version: 1.9.0 resolution: "convert-source-map@npm:1.9.0" @@ -14295,19 +13463,6 @@ __metadata: languageName: node linkType: hard -"cosmiconfig@npm:7.0.0": - version: 7.0.0 - resolution: "cosmiconfig@npm:7.0.0" - dependencies: - "@types/parse-json": "npm:^4.0.0" - import-fresh: "npm:^3.2.1" - parse-json: "npm:^5.0.0" - path-type: "npm:^4.0.0" - yaml: "npm:^1.10.0" - checksum: 532cb7fc3690afb00fa989d8127a824439e2e926a3d40b4e07c3e563fe1910b91ed19d611143267fa607538f324f07eeb79e917aea85859786e6e1c0c00b1cda - languageName: node - linkType: hard - "cosmiconfig@npm:^7.0.0, cosmiconfig@npm:^7.0.1": version: 7.1.0 resolution: "cosmiconfig@npm:7.1.0" @@ -14690,13 +13845,6 @@ __metadata: languageName: node linkType: hard -"dargs@npm:^7.0.0": - version: 7.0.0 - resolution: "dargs@npm:7.0.0" - checksum: ec7f6a8315a8fa2f8b12d39207615bdf62b4d01f631b96fbe536c8ad5469ab9ed710d55811e564d0d5c1d548fc8cb6cc70bf0939f2415790159f5a75e0f96c92 - languageName: node - linkType: hard - "data-uri-to-buffer@npm:^4.0.0": version: 4.0.1 resolution: "data-uri-to-buffer@npm:4.0.1" @@ -14735,13 +13883,6 @@ __metadata: languageName: node linkType: hard -"dateformat@npm:^3.0.0": - version: 3.0.3 - resolution: "dateformat@npm:3.0.3" - checksum: 2effb8bef52ff912f87a05e4adbeacff46353e91313ad1ea9ed31412db26849f5a0fcc7e3ce36dbfb84fc6c881a986d5694f84838ad0da7000d5150693e78678 - languageName: node - linkType: hard - "de-indent@npm:^1.0.2": version: 1.0.2 resolution: "de-indent@npm:1.0.2" @@ -14779,17 +13920,7 @@ __metadata: languageName: node linkType: hard -"decamelize-keys@npm:^1.1.0": - version: 1.1.1 - resolution: "decamelize-keys@npm:1.1.1" - dependencies: - decamelize: "npm:^1.1.0" - map-obj: "npm:^1.0.0" - checksum: 4ca385933127437658338c65fb9aead5f21b28d3dd3ccd7956eb29aab0953b5d3c047fbc207111672220c71ecf7a4d34f36c92851b7bbde6fca1a02c541bdd7d - languageName: node - linkType: hard - -"decamelize@npm:^1.1.0, decamelize@npm:^1.2.0": +"decamelize@npm:^1.2.0": version: 1.2.0 resolution: "decamelize@npm:1.2.0" checksum: 85c39fe8fbf0482d4a1e224ef0119db5c1897f8503bcef8b826adff7a1b11414972f6fef2d7dec2ee0b4be3863cf64ac1439137ae9e6af23a3d8dcbe26a5b4b2 @@ -14828,7 +13959,7 @@ __metadata: languageName: node linkType: hard -"dedent@npm:0.7.0, dedent@npm:^0.7.0": +"dedent@npm:^0.7.0": version: 0.7.0 resolution: "dedent@npm:0.7.0" checksum: 7c3aa00ddfe3e5fcd477958e156156a5137e3bb6ff1493ca05edff4decf29a90a057974cc77e75951f8eb801c1816cb45aea1f52d628cdd000b82b36ab839d1b @@ -15112,13 +14243,6 @@ __metadata: languageName: node linkType: hard -"detect-indent@npm:^5.0.0": - version: 5.0.0 - resolution: "detect-indent@npm:5.0.0" - checksum: 58d985dd5b4d5e5aad6fe7d8ecc74538fa92c807c894794b8505569e45651bf01a38755b65d9d3d17e512239a26d3131837cbef43cf4226968d5abf175bbcc9d - languageName: node - linkType: hard - "detect-indent@npm:^6.0.0, detect-indent@npm:^6.1.0": version: 6.1.0 resolution: "detect-indent@npm:6.1.0" @@ -15455,24 +14579,6 @@ __metadata: languageName: node linkType: hard -"dot-prop@npm:6.0.1": - version: 6.0.1 - resolution: "dot-prop@npm:6.0.1" - dependencies: - is-obj: "npm:^2.0.0" - checksum: 30e51ec6408978a6951b21e7bc4938aad01a86f2fdf779efe52330205c6bb8a8ea12f35925c2029d6dc9d1df22f916f32f828ce1e9b259b1371c580541c22b5a - languageName: node - linkType: hard - -"dot-prop@npm:^5.1.0": - version: 5.3.0 - resolution: "dot-prop@npm:5.3.0" - dependencies: - is-obj: "npm:^2.0.0" - checksum: 93f0d343ef87fe8869320e62f2459f7e70f49c6098d948cc47e060f4a3f827d0ad61e83cb82f2bd90cd5b9571b8d334289978a43c0f98fea4f0e99ee8faa0599 - languageName: node - linkType: hard - "dotenv-expand@npm:^10.0.0, dotenv-expand@npm:~10.0.0": version: 10.0.0 resolution: "dotenv-expand@npm:10.0.0" @@ -15487,13 +14593,6 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:~10.0.0": - version: 10.0.0 - resolution: "dotenv@npm:10.0.0" - checksum: 2d8d4ba64bfaff7931402aa5e8cbb8eba0acbc99fe9ae442300199af021079eafa7171ce90e150821a5cb3d74f0057721fbe7ec201a6044b68c8a7615f8c123f - languageName: node - linkType: hard - "downshift@npm:^6.0.15": version: 6.1.12 resolution: "downshift@npm:6.1.12" @@ -15909,7 +15008,7 @@ __metadata: languageName: node linkType: hard -"envinfo@npm:^7.7.3, envinfo@npm:^7.7.4": +"envinfo@npm:^7.7.3": version: 7.10.0 resolution: "envinfo@npm:7.10.0" bin: @@ -16879,7 +15978,7 @@ __metadata: languageName: node linkType: hard -"eventemitter3@npm:^4.0.0, eventemitter3@npm:^4.0.4": +"eventemitter3@npm:^4.0.0": version: 4.0.7 resolution: "eventemitter3@npm:4.0.7" checksum: 5f6d97cbcbac47be798e6355e3a7639a84ee1f7d9b199a07017f1d2f1e2fe236004d14fa5dfaeba661f94ea57805385e326236a6debbc7145c8877fbc0297c6b @@ -16911,23 +16010,6 @@ __metadata: languageName: node linkType: hard -"execa@npm:5.0.0": - version: 5.0.0 - resolution: "execa@npm:5.0.0" - dependencies: - cross-spawn: "npm:^7.0.3" - get-stream: "npm:^6.0.0" - human-signals: "npm:^2.1.0" - is-stream: "npm:^2.0.0" - merge-stream: "npm:^2.0.0" - npm-run-path: "npm:^4.0.1" - onetime: "npm:^5.1.2" - signal-exit: "npm:^3.0.3" - strip-final-newline: "npm:^2.0.0" - checksum: e110add7ca0de63aea415385ebad7236c8de281d5d9a916dbd69f59009dac3d5d631e6252c2ea5d0258220b0d22acf25649b2caf05fa162eaa1401339fc69ba4 - languageName: node - linkType: hard - "execa@npm:7.2.0": version: 7.2.0 resolution: "execa@npm:7.2.0" @@ -17229,19 +16311,6 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:3.2.7": - version: 3.2.7 - resolution: "fast-glob@npm:3.2.7" - dependencies: - "@nodelib/fs.stat": "npm:^2.0.2" - "@nodelib/fs.walk": "npm:^1.2.3" - glob-parent: "npm:^5.1.2" - merge2: "npm:^1.3.0" - micromatch: "npm:^4.0.4" - checksum: cc820a9acbd99c51267d525ed3c0c368b57d273f8d34e2401eef824390ff38ff419af3c0308d4ec1aef3dae0e24d1ac1dfe3156e5c702d63416a4c877ab7e0c4 - languageName: node - linkType: hard - "fast-glob@npm:3.3.1, fast-glob@npm:^3.0.3, fast-glob@npm:^3.2.11, fast-glob@npm:^3.2.2, fast-glob@npm:^3.2.7, fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.0, fast-glob@npm:^3.3.1": version: 3.3.1 resolution: "fast-glob@npm:3.3.1" @@ -17411,13 +16480,6 @@ __metadata: languageName: node linkType: hard -"file-url@npm:3.0.0": - version: 3.0.0 - resolution: "file-url@npm:3.0.0" - checksum: 31c5f85711bda47a471fd8d4a7217330102b74fb3b4dbd3626dd9cbe8c9afc1bf4584da2877abd84db392e3b4c2ad6d61ba4830b45a273dfbfd1172b443d8bb9 - languageName: node - linkType: hard - "filelist@npm:^1.0.4": version: 1.0.4 resolution: "filelist@npm:1.0.4" @@ -17540,17 +16602,7 @@ __metadata: languageName: node linkType: hard -"find-up@npm:5.0.0, find-up@npm:^5.0.0": - version: 5.0.0 - resolution: "find-up@npm:5.0.0" - dependencies: - locate-path: "npm:^6.0.0" - path-exists: "npm:^4.0.0" - checksum: 062c5a83a9c02f53cdd6d175a37ecf8f87ea5bbff1fdfb828f04bfa021441bc7583e8ebc0872a4c1baab96221fb8a8a275a19809fb93fbc40bd69ec35634069a - languageName: node - linkType: hard - -"find-up@npm:^2.0.0, find-up@npm:^2.1.0": +"find-up@npm:^2.1.0": version: 2.1.0 resolution: "find-up@npm:2.1.0" dependencies: @@ -17578,6 +16630,16 @@ __metadata: languageName: node linkType: hard +"find-up@npm:^5.0.0": + version: 5.0.0 + resolution: "find-up@npm:5.0.0" + dependencies: + locate-path: "npm:^6.0.0" + path-exists: "npm:^4.0.0" + checksum: 062c5a83a9c02f53cdd6d175a37ecf8f87ea5bbff1fdfb828f04bfa021441bc7583e8ebc0872a4c1baab96221fb8a8a275a19809fb93fbc40bd69ec35634069a + languageName: node + linkType: hard + "find-up@npm:^6.3.0": version: 6.3.0 resolution: "find-up@npm:6.3.0" @@ -17850,18 +16912,6 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:9.1.0, fs-extra@npm:^9.1.0": - version: 9.1.0 - resolution: "fs-extra@npm:9.1.0" - dependencies: - at-least-node: "npm:^1.0.0" - graceful-fs: "npm:^4.2.0" - jsonfile: "npm:^6.0.1" - universalify: "npm:^2.0.0" - checksum: 9b808bd884beff5cb940773018179a6b94a966381d005479f00adda6b44e5e3d4abf765135773d849cc27efe68c349e4a7b86acd7d3306d5932c14f3a4b17a92 - languageName: node - linkType: hard - "fs-extra@npm:^10.0.0, fs-extra@npm:^10.1.0": version: 10.1.0 resolution: "fs-extra@npm:10.1.0" @@ -17919,7 +16969,7 @@ __metadata: languageName: node linkType: hard -"fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0": +"fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" dependencies: @@ -18093,22 +17143,6 @@ __metadata: languageName: node linkType: hard -"gauge@npm:^5.0.0": - version: 5.0.1 - resolution: "gauge@npm:5.0.1" - dependencies: - aproba: "npm:^1.0.3 || ^2.0.0" - color-support: "npm:^1.1.3" - console-control-strings: "npm:^1.1.0" - has-unicode: "npm:^2.0.1" - signal-exit: "npm:^4.0.1" - string-width: "npm:^4.2.3" - strip-ansi: "npm:^6.0.1" - wide-align: "npm:^1.1.5" - checksum: 845f9a2534356cd0e9c1ae590ed471bbe8d74c318915b92a34e8813b8d3441ca8e0eb0fa87a48081e70b63b84d398c5e66a13b8e8040181c10b9d77e9fe3287f - languageName: node - linkType: hard - "gaxios@npm:^4.0.0": version: 4.3.3 resolution: "gaxios@npm:4.3.3" @@ -18195,21 +17229,7 @@ __metadata: languageName: node linkType: hard -"get-pkg-repo@npm:^4.0.0": - version: 4.2.1 - resolution: "get-pkg-repo@npm:4.2.1" - dependencies: - "@hutson/parse-repository-url": "npm:^3.0.0" - hosted-git-info: "npm:^4.0.0" - through2: "npm:^2.0.0" - yargs: "npm:^16.2.0" - bin: - get-pkg-repo: src/cli.js - checksum: 1338d2e048a594da4a34e7dd69d909376d72784f5ba50963a242b4b35db77533786f618b3f6a9effdee2af20af4917a3b7cf12533b4575d7f9c163886be1fb62 - languageName: node - linkType: hard - -"get-port@npm:5.1.1, get-port@npm:^5.1.1": +"get-port@npm:^5.1.1": version: 5.1.1 resolution: "get-port@npm:5.1.1" checksum: 2873877a469b24e6d5e0be490724a17edb39fafc795d1d662e7bea951ca649713b4a50117a473f9d162312cb0e946597bd0e049ed2f866e79e576e8e213d3d1c @@ -18230,13 +17250,6 @@ __metadata: languageName: node linkType: hard -"get-stream@npm:6.0.0": - version: 6.0.0 - resolution: "get-stream@npm:6.0.0" - checksum: 7cd835cb9180041e7be2cc3de236e5db9f2144515921aeb60ae78d3a46f9944439d654c2aae5b0191e41eb6e2500f0237494a2e6c0790367183f788d1c9f6dd6 - languageName: node - linkType: hard - "get-stream@npm:^4.0.0": version: 4.1.0 resolution: "get-stream@npm:4.1.0" @@ -18323,71 +17336,6 @@ __metadata: languageName: node linkType: hard -"git-raw-commits@npm:^2.0.8": - version: 2.0.11 - resolution: "git-raw-commits@npm:2.0.11" - dependencies: - dargs: "npm:^7.0.0" - lodash: "npm:^4.17.15" - meow: "npm:^8.0.0" - split2: "npm:^3.0.0" - through2: "npm:^4.0.0" - bin: - git-raw-commits: cli.js - checksum: c9cee7ce11a6703098f028d7e47986d5d3e4147d66640086734d6ee2472296b8711f91b40ad458e95acac1bc33cf2898059f1dc890f91220ff89c5fcc609ab64 - languageName: node - linkType: hard - -"git-remote-origin-url@npm:^2.0.0": - version: 2.0.0 - resolution: "git-remote-origin-url@npm:2.0.0" - dependencies: - gitconfiglocal: "npm:^1.0.0" - pify: "npm:^2.3.0" - checksum: 3a846ce98ed36b2d0b801e8ec1ab299a236cfc6fa264bfdf9f42301abfdfd8715c946507fd83a10b9db449eb609ac6f8a2a341daf52e3af0000367487f486355 - languageName: node - linkType: hard - -"git-semver-tags@npm:^4.1.1": - version: 4.1.1 - resolution: "git-semver-tags@npm:4.1.1" - dependencies: - meow: "npm:^8.0.0" - semver: "npm:^6.0.0" - bin: - git-semver-tags: cli.js - checksum: cd8c91c666901f8dd6381f4cef2aec32aa3f39e517bd8d8491f9133adf956dde9e0487d510fa0f12042fa474f21a8a88b4aa56db8b473979c7491109c57b7016 - languageName: node - linkType: hard - -"git-up@npm:^7.0.0": - version: 7.0.0 - resolution: "git-up@npm:7.0.0" - dependencies: - is-ssh: "npm:^1.4.0" - parse-url: "npm:^8.1.0" - checksum: a3fa02e1a63c7c824b5ebbf23f4a9a6b34dd80031114c5dd8adb7ef53493642e39d3d80dfef4025a452128400c35c2c138d20a0f6ae5d7d7ef70d9ba13083d34 - languageName: node - linkType: hard - -"git-url-parse@npm:13.1.0": - version: 13.1.0 - resolution: "git-url-parse@npm:13.1.0" - dependencies: - git-up: "npm:^7.0.0" - checksum: 2ef6126c42d999e240dbcdf1e96172cf7a2044ffa1ef78a518acf823df9bbe2a1ea9e6b443d42948e3c581e4d899559afc4c1de024b3eaa8eb6a4229f73285aa - languageName: node - linkType: hard - -"gitconfiglocal@npm:^1.0.0": - version: 1.0.0 - resolution: "gitconfiglocal@npm:1.0.0" - dependencies: - ini: "npm:^1.3.2" - checksum: cfcb16344834113199f209f2758ced778dc30e075ddb49b5dde659b4dd2deadee824db0a1b77e1303cb594d9e8b2240da18c67705f657aa76affb444aa349005 - languageName: node - linkType: hard - "github-from-package@npm:0.0.0": version: 0.0.0 resolution: "github-from-package@npm:0.0.0" @@ -18414,7 +17362,7 @@ __metadata: languageName: node linkType: hard -"glob-parent@npm:5.1.2, glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": +"glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" dependencies: @@ -18506,31 +17454,6 @@ __metadata: languageName: node linkType: hard -"glob@npm:^8.0.1": - version: 8.1.0 - resolution: "glob@npm:8.1.0" - dependencies: - fs.realpath: "npm:^1.0.0" - inflight: "npm:^1.0.4" - inherits: "npm:2" - minimatch: "npm:^5.0.1" - once: "npm:^1.3.0" - checksum: cb0b5cab17a59c57299376abe5646c7070f8acb89df5595b492dba3bfb43d301a46c01e5695f01154e6553168207cb60d4eaf07d3be4bc3eb9b0457c5c561d0f - languageName: node - linkType: hard - -"glob@npm:^9.2.0": - version: 9.3.5 - resolution: "glob@npm:9.3.5" - dependencies: - fs.realpath: "npm:^1.0.0" - minimatch: "npm:^8.0.2" - minipass: "npm:^4.2.4" - path-scurry: "npm:^1.6.1" - checksum: 2f6c2b9ee019ee21dc258ae97a88719614591e4c979cb4580b1b9df6f0f778a3cb38b4bdaf18dfa584637ea10f89a3c5f2533a5e449cf8741514ad18b0951f2e - languageName: node - linkType: hard - "globals@npm:^11.1.0": version: 11.12.0 resolution: "globals@npm:11.12.0" @@ -18572,7 +17495,7 @@ __metadata: languageName: node linkType: hard -"globby@npm:11.1.0, globby@npm:^11.0.1, globby@npm:^11.0.2, globby@npm:^11.1.0": +"globby@npm:^11.0.1, globby@npm:^11.0.2, globby@npm:^11.1.0": version: 11.1.0 resolution: "globby@npm:11.1.0" dependencies: @@ -18676,14 +17599,7 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:4.2.10": - version: 4.2.10 - resolution: "graceful-fs@npm:4.2.10" - checksum: 4223a833e38e1d0d2aea630c2433cfb94ddc07dfc11d511dbd6be1d16688c5be848acc31f9a5d0d0ddbfb56d2ee5a6ae0278aceeb0ca6a13f27e06b9956fb952 - languageName: node - linkType: hard - -"graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.1.15, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.3, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": +"graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.3, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: 386d011a553e02bc594ac2ca0bd6d9e4c22d7fa8cfbfc448a6d148c59ea881b092db9dbe3547ae4b88e55f1b01f7c4a2ecc53b310c042793e63aa44cf6c257f2 @@ -18783,13 +17699,6 @@ __metadata: languageName: node linkType: hard -"hard-rejection@npm:^2.1.0": - version: 2.1.0 - resolution: "hard-rejection@npm:2.1.0" - checksum: febc3343a1ad575aedcc112580835b44a89a89e01f400b4eda6e8110869edfdab0b00cd1bd4c3bfec9475a57e79e0b355aecd5be46454b6a62b9a359af60e564 - languageName: node - linkType: hard - "has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2": version: 1.0.2 resolution: "has-bigints@npm:1.0.2" @@ -18850,7 +17759,7 @@ __metadata: languageName: node linkType: hard -"has-unicode@npm:2.0.1, has-unicode@npm:^2.0.1": +"has-unicode@npm:^2.0.1": version: 2.0.1 resolution: "has-unicode@npm:2.0.1" checksum: ebdb2f4895c26bb08a8a100b62d362e49b2190bcfd84b76bc4be1a3bd4d254ec52d0dd9f2fbcc093fc5eb878b20c52146f9dfd33e2686ed28982187be593b47c @@ -19070,34 +17979,7 @@ __metadata: languageName: node linkType: hard -"hosted-git-info@npm:^3.0.6": - version: 3.0.8 - resolution: "hosted-git-info@npm:3.0.8" - dependencies: - lru-cache: "npm:^6.0.0" - checksum: af1392086ab3ab5576aa81af07be2f93ee1588407af18fd9752eb67502558e6ea0ffdd4be35ac6c8bef12fb9017f6e7705757e21b10b5ce7798da9106c9c0d9d - languageName: node - linkType: hard - -"hosted-git-info@npm:^4.0.0, hosted-git-info@npm:^4.0.1": - version: 4.1.0 - resolution: "hosted-git-info@npm:4.1.0" - dependencies: - lru-cache: "npm:^6.0.0" - checksum: 150fbcb001600336d17fdbae803264abed013548eea7946c2264c49ebe2ebd8c4441ba71dd23dd8e18c65de79d637f98b22d4760ba5fb2e0b15d62543d0fff07 - languageName: node - linkType: hard - -"hosted-git-info@npm:^5.0.0": - version: 5.2.1 - resolution: "hosted-git-info@npm:5.2.1" - dependencies: - lru-cache: "npm:^7.5.1" - checksum: c6682c2e91d774d79893e2c862d7173450455747fd57f0659337c78d37ddb56c23cb7541b296cbef4a3b47c3be307d8d57f24a6e9aa149cad243c7f126cd42ff - languageName: node - linkType: hard - -"hosted-git-info@npm:^6.0.0, hosted-git-info@npm:^6.1.1": +"hosted-git-info@npm:^6.0.0": version: 6.1.1 resolution: "hosted-git-info@npm:6.1.1" dependencies: @@ -19273,7 +18155,7 @@ __metadata: languageName: node linkType: hard -"http-cache-semantics@npm:^4.0.0, http-cache-semantics@npm:^4.1.0, http-cache-semantics@npm:^4.1.1": +"http-cache-semantics@npm:^4.0.0, http-cache-semantics@npm:^4.1.1": version: 4.1.1 resolution: "http-cache-semantics@npm:4.1.1" checksum: ce1319b8a382eb3cbb4a37c19f6bfe14e5bb5be3d09079e885e8c513ab2d3cd9214902f8a31c9dc4e37022633ceabfc2d697405deeaf1b8f3552bb4ed996fdfc @@ -19538,15 +18420,6 @@ __metadata: languageName: node linkType: hard -"ignore-walk@npm:^5.0.1": - version: 5.0.1 - resolution: "ignore-walk@npm:5.0.1" - dependencies: - minimatch: "npm:^5.0.1" - checksum: 0d157a54d6d11af0c3059fdc7679eef3b074e9a663d110a76c72788e2fb5b22087e08b21ab767718187ac3396aca4d0aa6c6473f925b19a74d9a00480ca7a76e - languageName: node - linkType: hard - "ignore-walk@npm:^6.0.0": version: 6.0.3 resolution: "ignore-walk@npm:6.0.3" @@ -19633,13 +18506,6 @@ __metadata: languageName: node linkType: hard -"infer-owner@npm:^1.0.4": - version: 1.0.4 - resolution: "infer-owner@npm:1.0.4" - checksum: a7b241e3149c26e37474e3435779487f42f36883711f198c45794703c7556bc38af224088bd4d1a221a45b8208ae2c2bcf86200383621434d0c099304481c5b9 - languageName: node - linkType: hard - "inflection@npm:^1.12.0": version: 1.13.4 resolution: "inflection@npm:1.13.4" @@ -19678,28 +18544,13 @@ __metadata: languageName: node linkType: hard -"ini@npm:^1.3.2, ini@npm:^1.3.4, ini@npm:^1.3.5, ini@npm:~1.3.0": +"ini@npm:^1.3.5, ini@npm:~1.3.0": version: 1.3.8 resolution: "ini@npm:1.3.8" checksum: ec93838d2328b619532e4f1ff05df7909760b6f66d9c9e2ded11e5c1897d6f2f9980c54dd638f88654b00919ce31e827040631eab0a3969e4d1abefa0719516a languageName: node linkType: hard -"init-package-json@npm:3.0.2, init-package-json@npm:^3.0.2": - version: 3.0.2 - resolution: "init-package-json@npm:3.0.2" - dependencies: - npm-package-arg: "npm:^9.0.1" - promzard: "npm:^0.3.0" - read: "npm:^1.0.7" - read-package-json: "npm:^5.0.0" - semver: "npm:^7.3.5" - validate-npm-package-license: "npm:^3.0.4" - validate-npm-package-name: "npm:^4.0.0" - checksum: 6efb57881d31af86006795df1def73fa997729ad57ff2e74346128653a1f21e417d194353b7733fd2edef8a79389ee9c1f56c65ce7b0809c3041229599366e6e - languageName: node - linkType: hard - "inquirer@npm:8.2.4": version: 8.2.4 resolution: "inquirer@npm:8.2.4" @@ -19723,29 +18574,6 @@ __metadata: languageName: node linkType: hard -"inquirer@npm:^8.2.4": - version: 8.2.6 - resolution: "inquirer@npm:8.2.6" - dependencies: - ansi-escapes: "npm:^4.2.1" - chalk: "npm:^4.1.1" - cli-cursor: "npm:^3.1.0" - cli-width: "npm:^3.0.0" - external-editor: "npm:^3.0.3" - figures: "npm:^3.0.0" - lodash: "npm:^4.17.21" - mute-stream: "npm:0.0.8" - ora: "npm:^5.4.1" - run-async: "npm:^2.4.0" - rxjs: "npm:^7.5.5" - string-width: "npm:^4.1.0" - strip-ansi: "npm:^6.0.0" - through: "npm:^2.3.6" - wrap-ansi: "npm:^6.0.1" - checksum: eb5724de1778265323f3a68c80acfa899378cb43c24cdcb58661386500e5696b6b0b6c700e046b7aa767fe7b4823c6f04e6ddc268173e3f84116112529016296 - languageName: node - linkType: hard - "internal-slot@npm:^1.0.4, internal-slot@npm:^1.0.5": version: 1.0.5 resolution: "internal-slot@npm:1.0.5" @@ -19939,18 +18767,7 @@ __metadata: languageName: node linkType: hard -"is-ci@npm:2.0.0": - version: 2.0.0 - resolution: "is-ci@npm:2.0.0" - dependencies: - ci-info: "npm:^2.0.0" - bin: - is-ci: bin.js - checksum: 17de4e2cd8f993c56c86472dd53dd9e2c7f126d0ee55afe610557046cdd64de0e8feadbad476edc9eeff63b060523b8673d9094ed2ab294b59efb5a66dd05a9a - languageName: node - linkType: hard - -"is-core-module@npm:^2.11.0, is-core-module@npm:^2.13.0, is-core-module@npm:^2.5.0, is-core-module@npm:^2.8.1, is-core-module@npm:^2.9.0": +"is-core-module@npm:^2.11.0, is-core-module@npm:^2.13.0, is-core-module@npm:^2.8.1, is-core-module@npm:^2.9.0": version: 2.13.0 resolution: "is-core-module@npm:2.13.0" dependencies: @@ -20217,13 +19034,6 @@ __metadata: languageName: node linkType: hard -"is-obj@npm:^2.0.0": - version: 2.0.0 - resolution: "is-obj@npm:2.0.0" - checksum: 85044ed7ba8bd169e2c2af3a178cacb92a97aa75de9569d02efef7f443a824b5e153eba72b9ae3aca6f8ce81955271aa2dc7da67a8b720575d3e38104208cb4e - languageName: node - linkType: hard - "is-path-cwd@npm:^2.2.0": version: 2.2.0 resolution: "is-path-cwd@npm:2.2.0" @@ -20245,13 +19055,6 @@ __metadata: languageName: node linkType: hard -"is-plain-obj@npm:^1.0.0, is-plain-obj@npm:^1.1.0": - version: 1.1.0 - resolution: "is-plain-obj@npm:1.1.0" - checksum: daaee1805add26f781b413fdf192fc91d52409583be30ace35c82607d440da63cc4cac0ac55136716688d6c0a2c6ef3edb2254fecbd1fe06056d6bd15975ee8c - languageName: node - linkType: hard - "is-plain-obj@npm:^3.0.0": version: 3.0.0 resolution: "is-plain-obj@npm:3.0.0" @@ -20331,22 +19134,6 @@ __metadata: languageName: node linkType: hard -"is-ssh@npm:^1.4.0": - version: 1.4.0 - resolution: "is-ssh@npm:1.4.0" - dependencies: - protocols: "npm:^2.0.1" - checksum: 3eb30d1bcb4507cd25562e7ac61a1c0aa31772134c67cec9c3afe6f4d57ec17e8c2892600a608e8e583f32f53f36465b8968c0305f2855cfbff95acfd049e113 - languageName: node - linkType: hard - -"is-stream@npm:2.0.0": - version: 2.0.0 - resolution: "is-stream@npm:2.0.0" - checksum: 687f6bbd2b995573d33e6b40b2cbc8b9186a751aa3151c23e6fd2c4ca352e323a6dc010b09103f89c9ca0bf5c8c38f3fa8b74d5d9acd1c44f1499874d7e844f9 - languageName: node - linkType: hard - "is-stream@npm:^1.1.0": version: 1.1.0 resolution: "is-stream@npm:1.1.0" @@ -20393,15 +19180,6 @@ __metadata: languageName: node linkType: hard -"is-text-path@npm:^1.0.1": - version: 1.0.1 - resolution: "is-text-path@npm:1.0.1" - dependencies: - text-extensions: "npm:^1.0.0" - checksum: 61c8650c29548febb6bf69e9541fc11abbbb087a0568df7bc471ba264e95fb254def4e610631cbab4ddb0a1a07949d06416f4ebeaf37875023fb184cdb87ee84 - languageName: node - linkType: hard - "is-typed-array@npm:^1.1.10, is-typed-array@npm:^1.1.12, is-typed-array@npm:^1.1.3, is-typed-array@npm:^1.1.9": version: 1.1.12 resolution: "is-typed-array@npm:1.1.12" @@ -21569,20 +20347,6 @@ __metadata: languageName: node linkType: hard -"json-stringify-nice@npm:^1.1.4": - version: 1.1.4 - resolution: "json-stringify-nice@npm:1.1.4" - checksum: 13673b67ba9e7fde75a103cade0b0d2dd0d21cd3b918de8d8f6cd59d48ad8c78b0e85f6f4a5842073ddfc91ebdde5ef7c81c7f51945b96a33eaddc5d41324b87 - languageName: node - linkType: hard - -"json-stringify-safe@npm:^5.0.1": - version: 5.0.1 - resolution: "json-stringify-safe@npm:5.0.1" - checksum: 7dbf35cd0411d1d648dceb6d59ce5857ec939e52e4afc37601aa3da611f0987d5cee5b38d58329ceddf3ed48bd7215229c8d52059ab01f2444a338bf24ed0f37 - languageName: node - linkType: hard - "json5@npm:^0.5.1": version: 0.5.1 resolution: "json5@npm:0.5.1" @@ -21660,7 +20424,7 @@ __metadata: languageName: node linkType: hard -"jsonparse@npm:^1.2.0, jsonparse@npm:^1.3.1": +"jsonparse@npm:^1.3.1": version: 1.3.1 resolution: "jsonparse@npm:1.3.1" checksum: 89bc68080cd0a0e276d4b5ab1b79cacd68f562467008d176dc23e16e97d4efec9e21741d92ba5087a8433526a45a7e6a9d5ef25408696c402ca1cfbc01a90bf0 @@ -21714,20 +20478,6 @@ __metadata: languageName: node linkType: hard -"just-diff-apply@npm:^5.2.0": - version: 5.5.0 - resolution: "just-diff-apply@npm:5.5.0" - checksum: d7b85371f2a5a17a108467fda35dddd95264ab438ccec7837b67af5913c57ded7246039d1df2b5bc1ade034ccf815b56d69786c5f1e07383168a066007c796c0 - languageName: node - linkType: hard - -"just-diff@npm:^6.0.0": - version: 6.0.2 - resolution: "just-diff@npm:6.0.2" - checksum: 1931ca1f0cea4cc480172165c189a84889033ad7a60bee302268ba8ca9f222b43773fd5f272a23ee618d43d85d3048411f06b635571a198159e9a85bb2495f5c - languageName: node - linkType: hard - "jwa@npm:^1.4.1": version: 1.4.1 resolution: "jwa@npm:1.4.1" @@ -21813,7 +20563,7 @@ __metadata: languageName: node linkType: hard -"kind-of@npm:^6.0.0, kind-of@npm:^6.0.2, kind-of@npm:^6.0.3": +"kind-of@npm:^6.0.0, kind-of@npm:^6.0.2": version: 6.0.3 resolution: "kind-of@npm:6.0.3" checksum: 61cdff9623dabf3568b6445e93e31376bee1cdb93f8ba7033d86022c2a9b1791a1d9510e026e6465ebd701a6dd2f7b0808483ad8838341ac52f003f512e0b4c4 @@ -21885,92 +20635,6 @@ __metadata: languageName: node linkType: hard -"lerna@npm:^6.4.0": - version: 6.6.2 - resolution: "lerna@npm:6.6.2" - dependencies: - "@lerna/child-process": "npm:6.6.2" - "@lerna/create": "npm:6.6.2" - "@lerna/legacy-package-management": "npm:6.6.2" - "@npmcli/arborist": "npm:6.2.3" - "@npmcli/run-script": "npm:4.1.7" - "@nrwl/devkit": "npm:>=15.5.2 < 16" - "@octokit/plugin-enterprise-rest": "npm:6.0.1" - "@octokit/rest": "npm:19.0.3" - byte-size: "npm:7.0.0" - chalk: "npm:4.1.0" - clone-deep: "npm:4.0.1" - cmd-shim: "npm:5.0.0" - columnify: "npm:1.6.0" - config-chain: "npm:1.1.12" - conventional-changelog-angular: "npm:5.0.12" - conventional-changelog-core: "npm:4.2.4" - conventional-recommended-bump: "npm:6.1.0" - cosmiconfig: "npm:7.0.0" - dedent: "npm:0.7.0" - dot-prop: "npm:6.0.1" - envinfo: "npm:^7.7.4" - execa: "npm:5.0.0" - fs-extra: "npm:9.1.0" - get-port: "npm:5.1.1" - get-stream: "npm:6.0.0" - git-url-parse: "npm:13.1.0" - glob-parent: "npm:5.1.2" - globby: "npm:11.1.0" - graceful-fs: "npm:4.2.10" - has-unicode: "npm:2.0.1" - import-local: "npm:^3.0.2" - init-package-json: "npm:3.0.2" - inquirer: "npm:^8.2.4" - is-ci: "npm:2.0.0" - is-stream: "npm:2.0.0" - js-yaml: "npm:^4.1.0" - libnpmaccess: "npm:^6.0.3" - libnpmpublish: "npm:7.1.4" - load-json-file: "npm:6.2.0" - make-dir: "npm:3.1.0" - minimatch: "npm:3.0.5" - multimatch: "npm:5.0.0" - node-fetch: "npm:2.6.7" - npm-package-arg: "npm:8.1.1" - npm-packlist: "npm:5.1.1" - npm-registry-fetch: "npm:^14.0.3" - npmlog: "npm:^6.0.2" - nx: "npm:>=15.5.2 < 16" - p-map: "npm:4.0.0" - p-map-series: "npm:2.1.0" - p-pipe: "npm:3.1.0" - p-queue: "npm:6.6.2" - p-reduce: "npm:2.1.0" - p-waterfall: "npm:2.1.1" - pacote: "npm:15.1.1" - pify: "npm:5.0.0" - read-cmd-shim: "npm:3.0.0" - read-package-json: "npm:5.0.1" - resolve-from: "npm:5.0.0" - rimraf: "npm:^4.4.1" - semver: "npm:^7.3.8" - signal-exit: "npm:3.0.7" - slash: "npm:3.0.0" - ssri: "npm:9.0.1" - strong-log-transformer: "npm:2.1.0" - tar: "npm:6.1.11" - temp-dir: "npm:1.0.0" - typescript: "npm:^3 || ^4" - upath: "npm:^2.0.1" - uuid: "npm:8.3.2" - validate-npm-package-license: "npm:3.0.4" - validate-npm-package-name: "npm:4.0.0" - write-file-atomic: "npm:4.0.1" - write-pkg: "npm:4.0.0" - yargs: "npm:16.2.0" - yargs-parser: "npm:20.2.4" - bin: - lerna: dist/cli.js - checksum: 4de749b9855541c5ffcebb6616ffda9369dc51a32911ad2ada6b65129017b1a4bf4ae1b71ade73dc575550d66785726567a1e55ff8a2386103200d4bf385ce31 - languageName: node - linkType: hard - "less-loader@npm:11.1.0": version: 11.1.0 resolution: "less-loader@npm:11.1.0" @@ -22042,18 +20706,6 @@ __metadata: languageName: node linkType: hard -"libnpmaccess@npm:^6.0.3": - version: 6.0.4 - resolution: "libnpmaccess@npm:6.0.4" - dependencies: - aproba: "npm:^2.0.0" - minipass: "npm:^3.1.1" - npm-package-arg: "npm:^9.0.1" - npm-registry-fetch: "npm:^13.0.0" - checksum: d7cee5ae92369a1ac6fb141082b929c853b3b6a140d9878e52ee93abca644fe052e7b5dfc3ac14c4b2f0c0945bd8bf6d5ccff608be8d8928d812df4af28cb43b - languageName: node - linkType: hard - "libnpmconfig@npm:^1.0.0": version: 1.2.1 resolution: "libnpmconfig@npm:1.2.1" @@ -22065,22 +20717,6 @@ __metadata: languageName: node linkType: hard -"libnpmpublish@npm:7.1.4": - version: 7.1.4 - resolution: "libnpmpublish@npm:7.1.4" - dependencies: - ci-info: "npm:^3.6.1" - normalize-package-data: "npm:^5.0.0" - npm-package-arg: "npm:^10.1.0" - npm-registry-fetch: "npm:^14.0.3" - proc-log: "npm:^3.0.0" - semver: "npm:^7.3.7" - sigstore: "npm:^1.4.0" - ssri: "npm:^10.0.1" - checksum: 9bfd6a00baaa12938e92675ba60d7d530462a30abb659a152dfb13c250233f531230eaeb7cf9d77f125a54b4913b434081fe7ebd684cdff0d127e8e5b7f1fb14 - languageName: node - linkType: hard - "license-webpack-plugin@npm:4.0.2": version: 4.0.2 resolution: "license-webpack-plugin@npm:4.0.2" @@ -22197,30 +20833,6 @@ __metadata: languageName: node linkType: hard -"load-json-file@npm:6.2.0": - version: 6.2.0 - resolution: "load-json-file@npm:6.2.0" - dependencies: - graceful-fs: "npm:^4.1.15" - parse-json: "npm:^5.0.0" - strip-bom: "npm:^4.0.0" - type-fest: "npm:^0.6.0" - checksum: fcb46ef75bab917f37170ba76781a1690bf67144bb53931cb0ed8e4aa20ca439e9c354fcf3594aed531f47dbeb4a49800acab7fdffd553c402ac40c987706d7b - languageName: node - linkType: hard - -"load-json-file@npm:^4.0.0": - version: 4.0.0 - resolution: "load-json-file@npm:4.0.0" - dependencies: - graceful-fs: "npm:^4.1.2" - parse-json: "npm:^4.0.0" - pify: "npm:^3.0.0" - strip-bom: "npm:^3.0.0" - checksum: 6b48f6a0256bdfcc8970be2c57f68f10acb2ee7e63709b386b2febb6ad3c86198f840889cdbe71d28f741cbaa2f23a7771206b138cd1bdd159564511ca37c1d5 - languageName: node - linkType: hard - "load-plugin@npm:^3.0.0": version: 3.0.0 resolution: "load-plugin@npm:3.0.0" @@ -22391,13 +21003,6 @@ __metadata: languageName: node linkType: hard -"lodash.ismatch@npm:^4.4.0": - version: 4.4.0 - resolution: "lodash.ismatch@npm:4.4.0" - checksum: 8f96a5dc4b8d3fc5a033dcb259d0c3148a1044fa4d02b4a0e8dce0fa1f2ef3ec4ac131e20b5cb2c985a4e9bcb1c37c0aa5af2cef70094959389617347b8fc645 - languageName: node - linkType: hard - "lodash.isnumber@npm:^3.0.3": version: 3.0.3 resolution: "lodash.isnumber@npm:3.0.3" @@ -22675,15 +21280,6 @@ __metadata: languageName: node linkType: hard -"make-dir@npm:3.1.0, make-dir@npm:^3.0.2, make-dir@npm:^3.1.0": - version: 3.1.0 - resolution: "make-dir@npm:3.1.0" - dependencies: - semver: "npm:^6.0.0" - checksum: 56aaafefc49c2dfef02c5c95f9b196c4eb6988040cf2c712185c7fe5c99b4091591a7fc4d4eafaaefa70ff763a26f6ab8c3ff60b9e75ea19876f49b18667ecaa - languageName: node - linkType: hard - "make-dir@npm:^2.0.0, make-dir@npm:^2.1.0": version: 2.1.0 resolution: "make-dir@npm:2.1.0" @@ -22694,6 +21290,15 @@ __metadata: languageName: node linkType: hard +"make-dir@npm:^3.0.2, make-dir@npm:^3.1.0": + version: 3.1.0 + resolution: "make-dir@npm:3.1.0" + dependencies: + semver: "npm:^6.0.0" + checksum: 56aaafefc49c2dfef02c5c95f9b196c4eb6988040cf2c712185c7fe5c99b4091591a7fc4d4eafaaefa70ff763a26f6ab8c3ff60b9e75ea19876f49b18667ecaa + languageName: node + linkType: hard + "make-dir@npm:^4.0.0": version: 4.0.0 resolution: "make-dir@npm:4.0.0" @@ -22710,30 +21315,6 @@ __metadata: languageName: node linkType: hard -"make-fetch-happen@npm:^10.0.6": - version: 10.2.1 - resolution: "make-fetch-happen@npm:10.2.1" - dependencies: - agentkeepalive: "npm:^4.2.1" - cacache: "npm:^16.1.0" - http-cache-semantics: "npm:^4.1.0" - http-proxy-agent: "npm:^5.0.0" - https-proxy-agent: "npm:^5.0.0" - is-lambda: "npm:^1.0.1" - lru-cache: "npm:^7.7.1" - minipass: "npm:^3.1.6" - minipass-collect: "npm:^1.0.2" - minipass-fetch: "npm:^2.0.3" - minipass-flush: "npm:^1.0.5" - minipass-pipeline: "npm:^1.2.4" - negotiator: "npm:^0.6.3" - promise-retry: "npm:^2.0.1" - socks-proxy-agent: "npm:^7.0.0" - ssri: "npm:^9.0.0" - checksum: 28ec392f63ab93511f400839dcee83107eeecfaad737d1e8487ea08b4332cd89a8f3319584222edd9f6f1d0833cf516691469496d46491863f9e88c658013949 - languageName: node - linkType: hard - "make-fetch-happen@npm:^11.0.0, make-fetch-happen@npm:^11.0.1, make-fetch-happen@npm:^11.0.3, make-fetch-happen@npm:^11.1.1": version: 11.1.1 resolution: "make-fetch-happen@npm:11.1.1" @@ -22780,20 +21361,6 @@ __metadata: languageName: node linkType: hard -"map-obj@npm:^1.0.0": - version: 1.0.1 - resolution: "map-obj@npm:1.0.1" - checksum: ccca88395e7d38671ed9f5652ecf471ecd546924be2fb900836b9da35e068a96687d96a5f93dcdfa94d9a27d649d2f10a84595590f89a347fb4dda47629dcc52 - languageName: node - linkType: hard - -"map-obj@npm:^4.0.0": - version: 4.3.0 - resolution: "map-obj@npm:4.3.0" - checksum: 1c19e1c88513c8abdab25c316367154c6a0a6a0f77e3e8c391bb7c0e093aefed293f539d026dc013d86219e5e4c25f23b0003ea588be2101ccd757bacc12d43b - languageName: node - linkType: hard - "map-or-similar@npm:^1.5.0": version: 1.5.0 resolution: "map-or-similar@npm:1.5.0" @@ -23173,25 +21740,6 @@ __metadata: languageName: node linkType: hard -"meow@npm:^8.0.0": - version: 8.1.2 - resolution: "meow@npm:8.1.2" - dependencies: - "@types/minimist": "npm:^1.2.0" - camelcase-keys: "npm:^6.2.2" - decamelize-keys: "npm:^1.1.0" - hard-rejection: "npm:^2.1.0" - minimist-options: "npm:4.1.0" - normalize-package-data: "npm:^3.0.0" - read-pkg-up: "npm:^7.0.1" - redent: "npm:^3.0.0" - trim-newlines: "npm:^3.0.0" - type-fest: "npm:^0.18.0" - yargs-parser: "npm:^20.2.3" - checksum: 9a8d90e616f783650728a90f4ea1e5f763c1c5260369e6596b52430f877f4af8ecbaa8c9d952c93bbefd6d5bda4caed6a96a20ba7d27b511d2971909b01922a2 - languageName: node - linkType: hard - "merge-descriptors@npm:1.0.1": version: 1.0.1 resolution: "merge-descriptors@npm:1.0.1" @@ -23859,41 +22407,12 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^6.1.6": - version: 6.2.0 - resolution: "minimatch@npm:6.2.0" - dependencies: - brace-expansion: "npm:^2.0.1" - checksum: 0884fcf2dd6d3cb5b76e21c33e1797f32c6d4bdd3cefe693ea4f8bb829734b2ca0eee94f0a4f622e9f9fa305f838d2b4f5251df38fcbf98bf1a03a0d07d4ce2d - languageName: node - linkType: hard - -"minimatch@npm:^8.0.2": - version: 8.0.4 - resolution: "minimatch@npm:8.0.4" +"minimatch@npm:^9.0.0, minimatch@npm:^9.0.1": + version: 9.0.3 + resolution: "minimatch@npm:9.0.3" dependencies: brace-expansion: "npm:^2.0.1" - checksum: a0a394c356dd5b4cb7f821720841a82fa6f07c9c562c5b716909d1b6ec5e56a7e4c4b5029da26dd256b7d2b3a3f38cbf9ddd8680e887b9b5282b09c05501c1ca - languageName: node - linkType: hard - -"minimatch@npm:^9.0.0, minimatch@npm:^9.0.1": - version: 9.0.3 - resolution: "minimatch@npm:9.0.3" - dependencies: - brace-expansion: "npm:^2.0.1" - checksum: 85f407dcd38ac3e180f425e86553911d101455ca3ad5544d6a7cec16286657e4f8a9aa6695803025c55e31e35a91a2252b5dc8e7d527211278b8b65b4dbd5eac - languageName: node - linkType: hard - -"minimist-options@npm:4.1.0": - version: 4.1.0 - resolution: "minimist-options@npm:4.1.0" - dependencies: - arrify: "npm:^1.0.1" - is-plain-obj: "npm:^1.1.0" - kind-of: "npm:^6.0.3" - checksum: 7871f9cdd15d1e7374e5b013e2ceda3d327a06a8c7b38ae16d9ef941e07d985e952c589e57213f7aa90a8744c60aed9524c0d85e501f5478382d9181f2763f54 + checksum: 85f407dcd38ac3e180f425e86553911d101455ca3ad5544d6a7cec16286657e4f8a9aa6695803025c55e31e35a91a2252b5dc8e7d527211278b8b65b4dbd5eac languageName: node linkType: hard @@ -23913,21 +22432,6 @@ __metadata: languageName: node linkType: hard -"minipass-fetch@npm:^2.0.3": - version: 2.1.2 - resolution: "minipass-fetch@npm:2.1.2" - dependencies: - encoding: "npm:^0.1.13" - minipass: "npm:^3.1.6" - minipass-sized: "npm:^1.0.3" - minizlib: "npm:^2.1.2" - dependenciesMeta: - encoding: - optional: true - checksum: 33ab2c5bdb3d91b9cb8bc6ae42d7418f4f00f7f7beae14b3bb21ea18f9224e792f560a6e17b6f1be12bbeb70dbe99a269f4204c60e5d99130a0777b153505c43 - languageName: node - linkType: hard - "minipass-fetch@npm:^3.0.0": version: 3.0.4 resolution: "minipass-fetch@npm:3.0.4" @@ -23980,7 +22484,7 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^3.0.0, minipass@npm:^3.1.1, minipass@npm:^3.1.6": +"minipass@npm:^3.0.0": version: 3.3.6 resolution: "minipass@npm:3.3.6" dependencies: @@ -23989,13 +22493,6 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^4.0.0, minipass@npm:^4.2.4": - version: 4.2.8 - resolution: "minipass@npm:4.2.8" - checksum: 4ea76b030d97079f4429d6e8a8affd90baf1b6a1898977c8ccce4701c5a2ba2792e033abc6709373f25c2c4d4d95440d9d5e9464b46b7b76ca44d2ce26d939ce - languageName: node - linkType: hard - "minipass@npm:^5.0.0": version: 5.0.0 resolution: "minipass@npm:5.0.0" @@ -24037,17 +22534,6 @@ __metadata: languageName: node linkType: hard -"mkdirp-infer-owner@npm:^2.0.0": - version: 2.0.0 - resolution: "mkdirp-infer-owner@npm:2.0.0" - dependencies: - chownr: "npm:^2.0.0" - infer-owner: "npm:^1.0.4" - mkdirp: "npm:^1.0.3" - checksum: 548356a586b92a16fc90eb62b953e5a23d594b56084ecdf72446f4164bbaa6a3bacd8c140672ad24f10c5f561e16c35ac3d97a5ab422832c5ed5449c72501a03 - languageName: node - linkType: hard - "mkdirp@npm:^0.5.0, mkdirp@npm:^0.5.1, mkdirp@npm:^0.5.4, mkdirp@npm:^0.5.6": version: 0.5.6 resolution: "mkdirp@npm:0.5.6" @@ -24082,13 +22568,6 @@ __metadata: languageName: node linkType: hard -"modify-values@npm:^1.0.0": - version: 1.0.1 - resolution: "modify-values@npm:1.0.1" - checksum: 6acb1b82aaf7a02f9f7b554b20cbfc159f223a79c66b0a257511c5933d50b85e12ea1220b0a90a2af6f80bc29ff784f929a52a51881867a93ae6a12ce87a729a - languageName: node - linkType: hard - "moo@npm:^0.5.0": version: 0.5.2 resolution: "moo@npm:0.5.2" @@ -24170,20 +22649,7 @@ __metadata: languageName: node linkType: hard -"multimatch@npm:5.0.0": - version: 5.0.0 - resolution: "multimatch@npm:5.0.0" - dependencies: - "@types/minimatch": "npm:^3.0.3" - array-differ: "npm:^3.0.0" - array-union: "npm:^2.1.0" - arrify: "npm:^2.0.1" - minimatch: "npm:^3.0.4" - checksum: 252ffae6d19491c169c22fc30cf8a99f6031f94a3495f187d3430b06200e9f05a7efae90ab9d834f090834e0d9c979ab55e7ad21f61a37995d807b4b0ccdcbd1 - languageName: node - linkType: hard - -"mute-stream@npm:0.0.8, mute-stream@npm:~0.0.4": +"mute-stream@npm:0.0.8": version: 0.0.8 resolution: "mute-stream@npm:0.0.8" checksum: 18d06d92e5d6d45e2b63c0e1b8f25376af71748ac36f53c059baa8b76ffac31c5ab225480494e7d35d30215ecdb18fed26ec23cafcd2f7733f2f14406bcd19e2 @@ -24391,7 +22857,7 @@ __metadata: languageName: node linkType: hard -"node-addon-api@npm:^3.0.0, node-addon-api@npm:^3.2.1": +"node-addon-api@npm:^3.0.0": version: 3.2.1 resolution: "node-addon-api@npm:3.2.1" dependencies: @@ -24439,20 +22905,6 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:2.6.7": - version: 2.6.7 - resolution: "node-fetch@npm:2.6.7" - dependencies: - whatwg-url: "npm:^5.0.0" - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - checksum: fcae80f5ac52fbf5012f5e19df2bd3915e67d3b3ad51cb5942943df2238d32ba15890fecabd0e166876a9f98a581ab50f3f10eb942b09405c49ef8da36b826c7 - languageName: node - linkType: hard - "node-fetch@npm:^2.0.0, node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.7": version: 2.7.0 resolution: "node-fetch@npm:2.7.0" @@ -24485,7 +22937,7 @@ __metadata: languageName: node linkType: hard -"node-gyp-build@npm:^4.2.2, node-gyp-build@npm:^4.3.0": +"node-gyp-build@npm:^4.2.2": version: 4.6.1 resolution: "node-gyp-build@npm:4.6.1" bin: @@ -24584,17 +23036,6 @@ __metadata: languageName: node linkType: hard -"nopt@npm:^7.0.0": - version: 7.2.0 - resolution: "nopt@npm:7.2.0" - dependencies: - abbrev: "npm:^2.0.0" - bin: - nopt: bin/nopt.js - checksum: 9bd7198df6f16eb29ff16892c77bcf7f0cc41f9fb5c26280ac0def2cf8cf319f3b821b3af83eba0e74c85807cc430a16efe0db58fe6ae1f41e69519f585b6aff - languageName: node - linkType: hard - "normalize-package-data@npm:^2.3.2, normalize-package-data@npm:^2.5.0": version: 2.5.0 resolution: "normalize-package-data@npm:2.5.0" @@ -24607,30 +23048,6 @@ __metadata: languageName: node linkType: hard -"normalize-package-data@npm:^3.0.0": - version: 3.0.3 - resolution: "normalize-package-data@npm:3.0.3" - dependencies: - hosted-git-info: "npm:^4.0.1" - is-core-module: "npm:^2.5.0" - semver: "npm:^7.3.4" - validate-npm-package-license: "npm:^3.0.1" - checksum: e5d0f739ba2c465d41f77c9d950e291ea4af78f8816ddb91c5da62257c40b76d8c83278b0d08ffbcd0f187636ebddad20e181e924873916d03e6e5ea2ef026be - languageName: node - linkType: hard - -"normalize-package-data@npm:^4.0.0": - version: 4.0.1 - resolution: "normalize-package-data@npm:4.0.1" - dependencies: - hosted-git-info: "npm:^5.0.0" - is-core-module: "npm:^2.8.1" - semver: "npm:^7.3.5" - validate-npm-package-license: "npm:^3.0.4" - checksum: 3a6ace810d1bd2fd23b98fa53790a28bbfade5380eea0f2e0cc5cbc24987db43a4780846942edee7069fa9574bf050a9ed8d35faf9079e5e4d9a737d07a136dd - languageName: node - linkType: hard - "normalize-package-data@npm:^5.0.0": version: 5.0.0 resolution: "normalize-package-data@npm:5.0.0" @@ -24664,15 +23081,6 @@ __metadata: languageName: node linkType: hard -"npm-bundled@npm:^1.1.2": - version: 1.1.2 - resolution: "npm-bundled@npm:1.1.2" - dependencies: - npm-normalize-package-bin: "npm:^1.0.1" - checksum: 3f2337789afc8cb608a0dd71cefe459531053d48a5497db14b07b985c4cab15afcae88600db9f92eae072c89b982eeeec8e4463e1d77bc03a7e90f5dacf29769 - languageName: node - linkType: hard - "npm-bundled@npm:^3.0.0": version: 3.0.0 resolution: "npm-bundled@npm:3.0.0" @@ -24691,28 +23099,14 @@ __metadata: languageName: node linkType: hard -"npm-normalize-package-bin@npm:^1.0.1": - version: 1.0.1 - resolution: "npm-normalize-package-bin@npm:1.0.1" - checksum: b0c8c05fe419a122e0ff970ccbe7874ae24b4b4b08941a24d18097fe6e1f4b93e3f6abfb5512f9c5488827a5592f2fb3ce2431c41d338802aed24b9a0c160551 - languageName: node - linkType: hard - -"npm-normalize-package-bin@npm:^2.0.0": - version: 2.0.0 - resolution: "npm-normalize-package-bin@npm:2.0.0" - checksum: 9b5283a2e423124c60fbc14244d36686b59e517d29156eacf9df8d3dc5d5bf4d9444b7669c607567ed2e089bbdbef5a2b3678cbf567284eeff3612da6939514b - languageName: node - linkType: hard - -"npm-normalize-package-bin@npm:^3.0.0, npm-normalize-package-bin@npm:^3.0.1": +"npm-normalize-package-bin@npm:^3.0.0": version: 3.0.1 resolution: "npm-normalize-package-bin@npm:3.0.1" checksum: f1831a7f12622840e1375c785c3dab7b1d82dd521211c17ee5e9610cd1a34d8b232d3fdeebf50c170eddcb321d2c644bf73dbe35545da7d588c6b3fa488db0a5 languageName: node linkType: hard -"npm-package-arg@npm:10.1.0, npm-package-arg@npm:^10.0.0, npm-package-arg@npm:^10.1.0": +"npm-package-arg@npm:10.1.0, npm-package-arg@npm:^10.0.0": version: 10.1.0 resolution: "npm-package-arg@npm:10.1.0" dependencies: @@ -24724,43 +23118,6 @@ __metadata: languageName: node linkType: hard -"npm-package-arg@npm:8.1.1": - version: 8.1.1 - resolution: "npm-package-arg@npm:8.1.1" - dependencies: - hosted-git-info: "npm:^3.0.6" - semver: "npm:^7.0.0" - validate-npm-package-name: "npm:^3.0.0" - checksum: 833f1f6b730649a4f19b5a8491f4e640f31940aa907ec86ed58d7b3ebe48bf528ad4d3f6151199944cb5a60c24e810d75e0e0ee3226af80026f91d34619b49f8 - languageName: node - linkType: hard - -"npm-package-arg@npm:^9.0.1": - version: 9.1.2 - resolution: "npm-package-arg@npm:9.1.2" - dependencies: - hosted-git-info: "npm:^5.0.0" - proc-log: "npm:^2.0.1" - semver: "npm:^7.3.5" - validate-npm-package-name: "npm:^4.0.0" - checksum: e81aa931adfc5f19fb9f10fe9eb120a0203d63b879594b1a473c64257761cdde42e32fb5d9b2e90d6944a3229e8c3ffa62ce8c31a7c9c4971d34f9219fdc0bb5 - languageName: node - linkType: hard - -"npm-packlist@npm:5.1.1": - version: 5.1.1 - resolution: "npm-packlist@npm:5.1.1" - dependencies: - glob: "npm:^8.0.1" - ignore-walk: "npm:^5.0.1" - npm-bundled: "npm:^1.1.2" - npm-normalize-package-bin: "npm:^1.0.1" - bin: - npm-packlist: bin/index.js - checksum: 8d9845883722931576e8eb10ef779407ecfe7d3aec696af76fb3ccbee776560c214ef87bad3615f98bdf0bab759a3a0e5667932cd2c29e14d2a37de22ddf601c - languageName: node - linkType: hard - "npm-packlist@npm:^7.0.0": version: 7.0.4 resolution: "npm-packlist@npm:7.0.4" @@ -24782,7 +23139,7 @@ __metadata: languageName: node linkType: hard -"npm-pick-manifest@npm:^8.0.0, npm-pick-manifest@npm:^8.0.1": +"npm-pick-manifest@npm:^8.0.0": version: 8.0.2 resolution: "npm-pick-manifest@npm:8.0.2" dependencies: @@ -24794,37 +23151,7 @@ __metadata: languageName: node linkType: hard -"npm-registry-fetch@npm:14.0.3": - version: 14.0.3 - resolution: "npm-registry-fetch@npm:14.0.3" - dependencies: - make-fetch-happen: "npm:^11.0.0" - minipass: "npm:^4.0.0" - minipass-fetch: "npm:^3.0.0" - minipass-json-stream: "npm:^1.0.1" - minizlib: "npm:^2.1.2" - npm-package-arg: "npm:^10.0.0" - proc-log: "npm:^3.0.0" - checksum: 5841f584b6a35200c7a0587f4c6bddbc6b5724b034840eb1d8879d13386e21d1bc86a4696a907559df848c19dd91b81fe10107b210dc6d28fdd300e48ea838d7 - languageName: node - linkType: hard - -"npm-registry-fetch@npm:^13.0.0": - version: 13.3.1 - resolution: "npm-registry-fetch@npm:13.3.1" - dependencies: - make-fetch-happen: "npm:^10.0.6" - minipass: "npm:^3.1.6" - minipass-fetch: "npm:^2.0.3" - minipass-json-stream: "npm:^1.0.1" - minizlib: "npm:^2.1.2" - npm-package-arg: "npm:^9.0.1" - proc-log: "npm:^2.0.0" - checksum: 86c8cdc2b0d2aa97d06031962f39442b0eacecd9989eebc88451e6b53b3c8572b89fb09cf0042ce6080e7d120353af359a75c5f60b085b5b455337d1e39e57ab - languageName: node - linkType: hard - -"npm-registry-fetch@npm:^14.0.0, npm-registry-fetch@npm:^14.0.3": +"npm-registry-fetch@npm:^14.0.0": version: 14.0.5 resolution: "npm-registry-fetch@npm:14.0.5" dependencies: @@ -24875,18 +23202,6 @@ __metadata: languageName: node linkType: hard -"npmlog@npm:6.0.2, npmlog@npm:^6.0.0, npmlog@npm:^6.0.2": - version: 6.0.2 - resolution: "npmlog@npm:6.0.2" - dependencies: - are-we-there-yet: "npm:^3.0.0" - console-control-strings: "npm:^1.1.0" - gauge: "npm:^4.0.3" - set-blocking: "npm:^2.0.0" - checksum: 0cacedfbc2f6139c746d9cd4a85f62718435ad0ca4a2d6459cd331dd33ae58206e91a0742c1558634efcde3f33f8e8e7fd3adf1bfe7978310cf00bd55cccf890 - languageName: node - linkType: hard - "npmlog@npm:^5.0.1": version: 5.0.1 resolution: "npmlog@npm:5.0.1" @@ -24899,15 +23214,15 @@ __metadata: languageName: node linkType: hard -"npmlog@npm:^7.0.1": - version: 7.0.1 - resolution: "npmlog@npm:7.0.1" +"npmlog@npm:^6.0.0": + version: 6.0.2 + resolution: "npmlog@npm:6.0.2" dependencies: - are-we-there-yet: "npm:^4.0.0" + are-we-there-yet: "npm:^3.0.0" console-control-strings: "npm:^1.1.0" - gauge: "npm:^5.0.0" + gauge: "npm:^4.0.3" set-blocking: "npm:^2.0.0" - checksum: d4e6a2aaa7b5b5d2e2ed8f8ac3770789ca0691a49f3576b6a8c97d560a4c3305d2c233a9173d62be737e6e4506bf9e89debd6120a3843c1d37315c34f90fef71 + checksum: 0cacedfbc2f6139c746d9cd4a85f62718435ad0ca4a2d6459cd331dd33ae58206e91a0742c1558634efcde3f33f8e8e7fd3adf1bfe7978310cf00bd55cccf890 languageName: node linkType: hard @@ -24927,87 +23242,6 @@ __metadata: languageName: node linkType: hard -"nx@npm:15.9.7, nx@npm:>=15.5.2 < 16": - version: 15.9.7 - resolution: "nx@npm:15.9.7" - dependencies: - "@nrwl/cli": "npm:15.9.7" - "@nrwl/nx-darwin-arm64": "npm:15.9.7" - "@nrwl/nx-darwin-x64": "npm:15.9.7" - "@nrwl/nx-linux-arm-gnueabihf": "npm:15.9.7" - "@nrwl/nx-linux-arm64-gnu": "npm:15.9.7" - "@nrwl/nx-linux-arm64-musl": "npm:15.9.7" - "@nrwl/nx-linux-x64-gnu": "npm:15.9.7" - "@nrwl/nx-linux-x64-musl": "npm:15.9.7" - "@nrwl/nx-win32-arm64-msvc": "npm:15.9.7" - "@nrwl/nx-win32-x64-msvc": "npm:15.9.7" - "@nrwl/tao": "npm:15.9.7" - "@parcel/watcher": "npm:2.0.4" - "@yarnpkg/lockfile": "npm:^1.1.0" - "@yarnpkg/parsers": "npm:3.0.0-rc.46" - "@zkochan/js-yaml": "npm:0.0.6" - axios: "npm:^1.0.0" - chalk: "npm:^4.1.0" - cli-cursor: "npm:3.1.0" - cli-spinners: "npm:2.6.1" - cliui: "npm:^7.0.2" - dotenv: "npm:~10.0.0" - enquirer: "npm:~2.3.6" - fast-glob: "npm:3.2.7" - figures: "npm:3.2.0" - flat: "npm:^5.0.2" - fs-extra: "npm:^11.1.0" - glob: "npm:7.1.4" - ignore: "npm:^5.0.4" - js-yaml: "npm:4.1.0" - jsonc-parser: "npm:3.2.0" - lines-and-columns: "npm:~2.0.3" - minimatch: "npm:3.0.5" - npm-run-path: "npm:^4.0.1" - open: "npm:^8.4.0" - semver: "npm:7.5.4" - string-width: "npm:^4.2.3" - strong-log-transformer: "npm:^2.1.0" - tar-stream: "npm:~2.2.0" - tmp: "npm:~0.2.1" - tsconfig-paths: "npm:^4.1.2" - tslib: "npm:^2.3.0" - v8-compile-cache: "npm:2.3.0" - yargs: "npm:^17.6.2" - yargs-parser: "npm:21.1.1" - peerDependencies: - "@swc-node/register": ^1.4.2 - "@swc/core": ^1.2.173 - dependenciesMeta: - "@nrwl/nx-darwin-arm64": - optional: true - "@nrwl/nx-darwin-x64": - optional: true - "@nrwl/nx-linux-arm-gnueabihf": - optional: true - "@nrwl/nx-linux-arm64-gnu": - optional: true - "@nrwl/nx-linux-arm64-musl": - optional: true - "@nrwl/nx-linux-x64-gnu": - optional: true - "@nrwl/nx-linux-x64-musl": - optional: true - "@nrwl/nx-win32-arm64-msvc": - optional: true - "@nrwl/nx-win32-x64-msvc": - optional: true - peerDependenciesMeta: - "@swc-node/register": - optional: true - "@swc/core": - optional: true - bin: - nx: bin/nx.js - checksum: 39b3c7e5efef3a10d0249db321a78fc9bb34806ae3d21ee211df29321367259841556989cbb4391b74f77d78f2629f90e65387b9414030fd921a9a03f8ccfbdc - languageName: node - linkType: hard - "nx@npm:17.0.2": version: 17.0.2 resolution: "nx@npm:17.0.2" @@ -25500,14 +23734,7 @@ __metadata: languageName: node linkType: hard -"p-map-series@npm:2.1.0": - version: 2.1.0 - resolution: "p-map-series@npm:2.1.0" - checksum: 302ca686a61c498b227fc45d4e2b2e5bfd20a03f4156a976d94c4ff7decf9cd5a815fa6846b43b37d587ffa8d4671ff2bd596fa83fe8b9113b5102da94940e2a - languageName: node - linkType: hard - -"p-map@npm:4.0.0, p-map@npm:^4.0.0": +"p-map@npm:^4.0.0": version: 4.0.0 resolution: "p-map@npm:4.0.0" dependencies: @@ -25516,30 +23743,6 @@ __metadata: languageName: node linkType: hard -"p-pipe@npm:3.1.0": - version: 3.1.0 - resolution: "p-pipe@npm:3.1.0" - checksum: 9b3076828ea7e9469c0f92c78fa44096726208d547efdb2d6148cbe135d1a70bd449de5be13e234dd669d9515343bd68527b316bf9d5639cee639e2fdde20aaf - languageName: node - linkType: hard - -"p-queue@npm:6.6.2": - version: 6.6.2 - resolution: "p-queue@npm:6.6.2" - dependencies: - eventemitter3: "npm:^4.0.4" - p-timeout: "npm:^3.2.0" - checksum: 5739ecf5806bbeadf8e463793d5e3004d08bb3f6177bd1a44a005da8fd81bb90f80e4633e1fb6f1dfd35ee663a5c0229abe26aebb36f547ad5a858347c7b0d3e - languageName: node - linkType: hard - -"p-reduce@npm:2.1.0, p-reduce@npm:^2.0.0, p-reduce@npm:^2.1.0": - version: 2.1.0 - resolution: "p-reduce@npm:2.1.0" - checksum: 27b8ff0fb044995507a06cd6357dffba0f2b98862864745972562a21885d7906ce5c794036d2aaa63ef6303158e41e19aed9f19651dfdafb38548ecec7d0de15 - languageName: node - linkType: hard - "p-retry@npm:^4.5.0": version: 4.6.2 resolution: "p-retry@npm:4.6.2" @@ -25550,7 +23753,7 @@ __metadata: languageName: node linkType: hard -"p-timeout@npm:^3.1.0, p-timeout@npm:^3.2.0": +"p-timeout@npm:^3.1.0": version: 3.2.0 resolution: "p-timeout@npm:3.2.0" dependencies: @@ -25573,44 +23776,7 @@ __metadata: languageName: node linkType: hard -"p-waterfall@npm:2.1.1": - version: 2.1.1 - resolution: "p-waterfall@npm:2.1.1" - dependencies: - p-reduce: "npm:^2.0.0" - checksum: ccae582b75a3597018a375f8eac32b93e8bfb9fc22a8e5037787ef4ebf5958d7465c2d3cbe26443971fbbfda2bcb7b645f694b91f928fc9a71fa5031e6e33f85 - languageName: node - linkType: hard - -"pacote@npm:15.1.1": - version: 15.1.1 - resolution: "pacote@npm:15.1.1" - dependencies: - "@npmcli/git": "npm:^4.0.0" - "@npmcli/installed-package-contents": "npm:^2.0.1" - "@npmcli/promise-spawn": "npm:^6.0.1" - "@npmcli/run-script": "npm:^6.0.0" - cacache: "npm:^17.0.0" - fs-minipass: "npm:^3.0.0" - minipass: "npm:^4.0.0" - npm-package-arg: "npm:^10.0.0" - npm-packlist: "npm:^7.0.0" - npm-pick-manifest: "npm:^8.0.0" - npm-registry-fetch: "npm:^14.0.0" - proc-log: "npm:^3.0.0" - promise-retry: "npm:^2.0.1" - read-package-json: "npm:^6.0.0" - read-package-json-fast: "npm:^3.0.0" - sigstore: "npm:^1.0.0" - ssri: "npm:^10.0.0" - tar: "npm:^6.1.11" - bin: - pacote: lib/bin.js - checksum: 382927250bb7a410c2fd08fe5f17e25cbb10db993578dbce81ecbf2bc28439fca20457b182e7c8982c8f18eeb571e4fd60390b3b7ce8cb08e2e43953af3df22f - languageName: node - linkType: hard - -"pacote@npm:15.2.0, pacote@npm:^15.0.0, pacote@npm:^15.0.8": +"pacote@npm:15.2.0": version: 15.2.0 resolution: "pacote@npm:15.2.0" dependencies: @@ -25684,17 +23850,6 @@ __metadata: languageName: node linkType: hard -"parse-conflict-json@npm:^3.0.0": - version: 3.0.1 - resolution: "parse-conflict-json@npm:3.0.1" - dependencies: - json-parse-even-better-errors: "npm:^3.0.0" - just-diff: "npm:^6.0.0" - just-diff-apply: "npm:^5.2.0" - checksum: 610b37181229ce3e945125c3a9548ec24d1de2d697a7ea3ef0f2660cccc6613715c2ba4bdbaf37c565133d6b61758703618a2c63d1ee29f97fd33c70a8aae323 - languageName: node - linkType: hard - "parse-diff@npm:^0.7.0": version: 0.7.1 resolution: "parse-diff@npm:0.7.1" @@ -25797,24 +23952,6 @@ __metadata: languageName: node linkType: hard -"parse-path@npm:^7.0.0": - version: 7.0.0 - resolution: "parse-path@npm:7.0.0" - dependencies: - protocols: "npm:^2.0.0" - checksum: e7646f6b998b083bbd40102643d803557ce4ae18ae1704e6cc7ae2525ea7c5400f4a3635aca3244cfe65ce4dd0ff77db1142dde4d080e8a80c364c4b3e8fe8d2 - languageName: node - linkType: hard - -"parse-url@npm:^8.1.0": - version: 8.1.0 - resolution: "parse-url@npm:8.1.0" - dependencies: - parse-path: "npm:^7.0.0" - checksum: 68b95afdf4bbf72e57c7ab66f8757c935fff888f7e2b0f1e06098b4faa19e06b6b743bddaed5bc8df4f0c2de6fc475355d787373b2fdd40092be9e4e4b996648 - languageName: node - linkType: hard - "parse5-html-rewriting-stream@npm:7.0.0": version: 7.0.0 resolution: "parse5-html-rewriting-stream@npm:7.0.0" @@ -25971,7 +24108,7 @@ __metadata: languageName: node linkType: hard -"path-scurry@npm:^1.10.1, path-scurry@npm:^1.6.1": +"path-scurry@npm:^1.10.1": version: 1.10.1 resolution: "path-scurry@npm:1.10.1" dependencies: @@ -26097,13 +24234,6 @@ __metadata: languageName: node linkType: hard -"pify@npm:5.0.0, pify@npm:^5.0.0": - version: 5.0.0 - resolution: "pify@npm:5.0.0" - checksum: 9f6f3cd1f159652692f514383efe401a06473af35a699962230ad1c4c9796df5999961461fc1a3b81eed8e3e74adb8bd032474fb3f93eb6bdbd9f33328da1ed2 - languageName: node - linkType: hard - "pify@npm:^2.3.0": version: 2.3.0 resolution: "pify@npm:2.3.0" @@ -26444,7 +24574,7 @@ __metadata: languageName: node linkType: hard -"postcss-selector-parser@npm:^6.0.0, postcss-selector-parser@npm:^6.0.10, postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4": +"postcss-selector-parser@npm:^6.0.0, postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4": version: 6.0.13 resolution: "postcss-selector-parser@npm:6.0.13" dependencies: @@ -26584,17 +24714,6 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:29.4.3": - version: 29.4.3 - resolution: "pretty-format@npm:29.4.3" - dependencies: - "@jest/schemas": "npm:^29.4.3" - ansi-styles: "npm:^5.0.0" - react-is: "npm:^18.0.0" - checksum: 3426542b0218d83ffd542374cfb23c6db00c7d0fad751b20e53debe35a420f3fd5976062e47bde79c36ff936421a3df52e1fe0048596c18200a59daa86a593bd - languageName: node - linkType: hard - "pretty-format@npm:^26.6.2": version: 26.6.2 resolution: "pretty-format@npm:26.6.2" @@ -26695,13 +24814,6 @@ __metadata: languageName: node linkType: hard -"proc-log@npm:^2.0.0, proc-log@npm:^2.0.1": - version: 2.0.1 - resolution: "proc-log@npm:2.0.1" - checksum: 701c501429775ce34cec28ef6a1c976537274b42917212fb8a5975ebcecb0a85612907fd7f99ff28ff4c2112bb84a0f4322fc9b9e1e52a8562fcbb1d5b3ce608 - languageName: node - linkType: hard - "proc-log@npm:^3.0.0": version: 3.0.0 resolution: "proc-log@npm:3.0.0" @@ -26730,20 +24842,6 @@ __metadata: languageName: node linkType: hard -"promise-all-reject-late@npm:^1.0.0": - version: 1.0.1 - resolution: "promise-all-reject-late@npm:1.0.1" - checksum: f1af0c7b0067e84d64751148ee5bb6c3e84f4a4d1316d6fe56261e1d2637cf71b49894bcbd2c6daf7d45afb1bc99efc3749be277c3e0518b70d0c5a29d037011 - languageName: node - linkType: hard - -"promise-call-limit@npm:^1.0.1": - version: 1.0.2 - resolution: "promise-call-limit@npm:1.0.2" - checksum: 500aed321d7b9212da403db369551d7190c96c8937c3b2d15c6097d1037b17fb802c7decfbc8ba6bb937f1cc1ea291e5eba10ed9ea76adc0f398ab9f7d174a58 - languageName: node - linkType: hard - "promise-inflight@npm:^1.0.1": version: 1.0.1 resolution: "promise-inflight@npm:1.0.1" @@ -26796,15 +24894,6 @@ __metadata: languageName: node linkType: hard -"promzard@npm:^0.3.0": - version: 0.3.0 - resolution: "promzard@npm:0.3.0" - dependencies: - read: "npm:1" - checksum: 7fd8dbcd9764b35092da65867cc60fdcf2ea85d77e8ed1ae348ec0af1a22616f74053ccf8dad7d8de01e1e3aafe349d77ef56653c2db3791589ac2a8ef485149 - languageName: node - linkType: hard - "prop-types-exact@npm:^1.2.0": version: 1.2.0 resolution: "prop-types-exact@npm:1.2.0" @@ -26836,20 +24925,6 @@ __metadata: languageName: node linkType: hard -"proto-list@npm:~1.2.1": - version: 1.2.4 - resolution: "proto-list@npm:1.2.4" - checksum: b9179f99394ec8a68b8afc817690185f3b03933f7b46ce2e22c1930dc84b60d09f5ad222beab4e59e58c6c039c7f7fcf620397235ef441a356f31f9744010e12 - languageName: node - linkType: hard - -"protocols@npm:^2.0.0, protocols@npm:^2.0.1": - version: 2.0.1 - resolution: "protocols@npm:2.0.1" - checksum: 016cc58a596e401004a028a2f7005e3444bf89ee8f606409c411719374d1e8bba0464fc142a065cce0d19f41669b2f7ffe25a8bde4f16ce3b6eb01fabc51f2e7 - languageName: node - linkType: hard - "proxy-addr@npm:~2.0.7": version: 2.0.7 resolution: "proxy-addr@npm:2.0.7" @@ -27117,13 +25192,6 @@ __metadata: languageName: node linkType: hard -"q@npm:^1.5.1": - version: 1.5.1 - resolution: "q@npm:1.5.1" - checksum: 7855fbdba126cb7e92ef3a16b47ba998c0786ec7fface236e3eb0135b65df36429d91a86b1fff3ab0927b4ac4ee88a2c44527c7c3b8e2a37efbec9fe34803df4 - languageName: node - linkType: hard - "qs@npm:6.11.0": version: 6.11.0 resolution: "qs@npm:6.11.0" @@ -27198,13 +25266,6 @@ __metadata: languageName: node linkType: hard -"quick-lru@npm:^4.0.1": - version: 4.0.1 - resolution: "quick-lru@npm:4.0.1" - checksum: f9b1596fa7595a35c2f9d913ac312fede13d37dc8a747a51557ab36e11ce113bbe88ef4c0154968845559a7709cb6a7e7cbe75f7972182451cd45e7f057a334d - languageName: node - linkType: hard - "quick-lru@npm:^5.1.1": version: 5.1.1 resolution: "quick-lru@npm:5.1.1" @@ -27724,31 +25785,7 @@ __metadata: languageName: node linkType: hard -"read-cmd-shim@npm:3.0.0": - version: 3.0.0 - resolution: "read-cmd-shim@npm:3.0.0" - checksum: 7a5fbd586e2336e589aa48ec9c2d77ad2486759f49d95d9b4a6b83576adb0d7ee1e5630111375678322c8b34af9834590085e85a8cb8623a7eb09a9de3fdf5ee - languageName: node - linkType: hard - -"read-cmd-shim@npm:^4.0.0": - version: 4.0.0 - resolution: "read-cmd-shim@npm:4.0.0" - checksum: e62db17ec9708f1e7c6a31f0a46d43df2069d85cf0df3b9d1d99e5ed36e29b1e8b2f8a427fd8bbb9bc40829788df1471794f9b01057e4b95ed062806e4df5ba9 - languageName: node - linkType: hard - -"read-package-json-fast@npm:^2.0.3": - version: 2.0.3 - resolution: "read-package-json-fast@npm:2.0.3" - dependencies: - json-parse-even-better-errors: "npm:^2.3.0" - npm-normalize-package-bin: "npm:^1.0.1" - checksum: c265a5d6c85f4c8ee0bf35b0b0d92800a7439e5cf4d1f5a2b3f9615a02ee2fd46bca6c2f07e244bfac1c40816eb0d28aec259ae99d7552d144dd9f971a5d2028 - languageName: node - linkType: hard - -"read-package-json-fast@npm:^3.0.0, read-package-json-fast@npm:^3.0.2": +"read-package-json-fast@npm:^3.0.0": version: 3.0.2 resolution: "read-package-json-fast@npm:3.0.2" dependencies: @@ -27758,30 +25795,6 @@ __metadata: languageName: node linkType: hard -"read-package-json@npm:5.0.1": - version: 5.0.1 - resolution: "read-package-json@npm:5.0.1" - dependencies: - glob: "npm:^8.0.1" - json-parse-even-better-errors: "npm:^2.3.1" - normalize-package-data: "npm:^4.0.0" - npm-normalize-package-bin: "npm:^1.0.1" - checksum: f7730989cb4cd4aba428320e2326dd1f866cc662b6b3aec4a327282e0e92890e2342a5f6f9ed064cd68dca9d82ec47a55a75e61f993aca0a2d003844b5bc6b1a - languageName: node - linkType: hard - -"read-package-json@npm:^5.0.0": - version: 5.0.2 - resolution: "read-package-json@npm:5.0.2" - dependencies: - glob: "npm:^8.0.1" - json-parse-even-better-errors: "npm:^2.3.1" - normalize-package-data: "npm:^4.0.0" - npm-normalize-package-bin: "npm:^2.0.0" - checksum: 78972bda869efb6191f7b70ab0ca1e7a86549a4aaf73cb379dfeb57098e4ecaa1128ba3f81485ed0b52174605ef16fce1599a551228e5f656a17a1a53a1793e7 - languageName: node - linkType: hard - "read-package-json@npm:^6.0.0": version: 6.0.4 resolution: "read-package-json@npm:6.0.4" @@ -27794,35 +25807,14 @@ __metadata: languageName: node linkType: hard -"read-pkg-up@npm:^3.0.0": - version: 3.0.0 - resolution: "read-pkg-up@npm:3.0.0" - dependencies: - find-up: "npm:^2.0.0" - read-pkg: "npm:^3.0.0" - checksum: 2cd0a180260b0d235990e6e9c8c2330a03882d36bc2eba8930e437ef23ee52a68a894e7e1ccb1c33f03bcceb270a861ee5f7eac686f238857755e2cddfb48ffd - languageName: node - linkType: hard - "read-pkg-up@npm:^7.0.1": version: 7.0.1 resolution: "read-pkg-up@npm:7.0.1" dependencies: - find-up: "npm:^4.1.0" - read-pkg: "npm:^5.2.0" - type-fest: "npm:^0.8.1" - checksum: 82b3ac9fd7c6ca1bdc1d7253eb1091a98ff3d195ee0a45386582ce3e69f90266163c34121e6a0a02f1630073a6c0585f7880b3865efcae9c452fa667f02ca385 - languageName: node - linkType: hard - -"read-pkg@npm:^3.0.0": - version: 3.0.0 - resolution: "read-pkg@npm:3.0.0" - dependencies: - load-json-file: "npm:^4.0.0" - normalize-package-data: "npm:^2.3.2" - path-type: "npm:^3.0.0" - checksum: 65acf2df89fbcd506b48b7ced56a255ba00adf7ecaa2db759c86cc58212f6fd80f1f0b7a85c848551a5d0685232e9b64f45c1fd5b48d85df2761a160767eeb93 + find-up: "npm:^4.1.0" + read-pkg: "npm:^5.2.0" + type-fest: "npm:^0.8.1" + checksum: 82b3ac9fd7c6ca1bdc1d7253eb1091a98ff3d195ee0a45386582ce3e69f90266163c34121e6a0a02f1630073a6c0585f7880b3865efcae9c452fa667f02ca385 languageName: node linkType: hard @@ -27849,26 +25841,6 @@ __metadata: languageName: node linkType: hard -"read@npm:1, read@npm:^1.0.7": - version: 1.0.7 - resolution: "read@npm:1.0.7" - dependencies: - mute-stream: "npm:~0.0.4" - checksum: 443533f05d5bb11b36ef1c6d625aae4e2ced8967e93cf546f35aa77b4eb6bd157f4256619e446bae43467f8f6619c7bc5c76983348dffaf36afedf4224f46216 - languageName: node - linkType: hard - -"readable-stream@npm:3, readable-stream@npm:^3.0.0, readable-stream@npm:^3.0.2, readable-stream@npm:^3.0.6, readable-stream@npm:^3.1.1, readable-stream@npm:^3.4.0, readable-stream@npm:^3.5.0, readable-stream@npm:^3.6.0, readable-stream@npm:^3.6.2": - version: 3.6.2 - resolution: "readable-stream@npm:3.6.2" - dependencies: - inherits: "npm:^2.0.3" - string_decoder: "npm:^1.1.1" - util-deprecate: "npm:^1.0.1" - checksum: e37be5c79c376fdd088a45fa31ea2e423e5d48854be7a22a58869b4e84d25047b193f6acb54f1012331e1bcd667ffb569c01b99d36b0bd59658fb33f513511b7 - languageName: node - linkType: hard - "readable-stream@npm:^2.0.0, readable-stream@npm:^2.0.1, readable-stream@npm:^2.2.2, readable-stream@npm:~2.3.6": version: 2.3.8 resolution: "readable-stream@npm:2.3.8" @@ -27884,7 +25856,18 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:^4.0.0, readable-stream@npm:^4.1.0": +"readable-stream@npm:^3.0.2, readable-stream@npm:^3.0.6, readable-stream@npm:^3.1.1, readable-stream@npm:^3.4.0, readable-stream@npm:^3.5.0, readable-stream@npm:^3.6.0, readable-stream@npm:^3.6.2": + version: 3.6.2 + resolution: "readable-stream@npm:3.6.2" + dependencies: + inherits: "npm:^2.0.3" + string_decoder: "npm:^1.1.1" + util-deprecate: "npm:^1.0.1" + checksum: e37be5c79c376fdd088a45fa31ea2e423e5d48854be7a22a58869b4e84d25047b193f6acb54f1012331e1bcd667ffb569c01b99d36b0bd59658fb33f513511b7 + languageName: node + linkType: hard + +"readable-stream@npm:^4.0.0": version: 4.4.2 resolution: "readable-stream@npm:4.4.2" dependencies: @@ -28579,13 +26562,6 @@ __metadata: languageName: node linkType: hard -"resolve-from@npm:5.0.0, resolve-from@npm:^5.0.0": - version: 5.0.0 - resolution: "resolve-from@npm:5.0.0" - checksum: b21cb7f1fb746de8107b9febab60095187781137fd803e6a59a76d421444b1531b641bba5857f5dc011974d8a5c635d61cec49e6bd3b7fc20e01f0fafc4efbf2 - languageName: node - linkType: hard - "resolve-from@npm:^4.0.0": version: 4.0.0 resolution: "resolve-from@npm:4.0.0" @@ -28593,6 +26569,13 @@ __metadata: languageName: node linkType: hard +"resolve-from@npm:^5.0.0": + version: 5.0.0 + resolution: "resolve-from@npm:5.0.0" + checksum: b21cb7f1fb746de8107b9febab60095187781137fd803e6a59a76d421444b1531b641bba5857f5dc011974d8a5c635d61cec49e6bd3b7fc20e01f0fafc4efbf2 + languageName: node + linkType: hard + "resolve-package-path@npm:^1.0.11": version: 1.2.7 resolution: "resolve-package-path@npm:1.2.7" @@ -28831,17 +26814,6 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^4.4.1": - version: 4.4.1 - resolution: "rimraf@npm:4.4.1" - dependencies: - glob: "npm:^9.2.0" - bin: - rimraf: dist/cjs/src/bin.js - checksum: 8c5e142d26d8b222be9dc9a1a41ba48e95d8f374e813e66a8533e87c6180174fcb3f573b9b592eca12740ebf8b78526d136acd971d4a790763d6f2232c34fa24 - languageName: node - linkType: hard - "rimraf@npm:~2.6.2": version: 2.6.3 resolution: "rimraf@npm:2.6.3" @@ -29199,17 +27171,6 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.3.8": - version: 7.3.8 - resolution: "semver@npm:7.3.8" - dependencies: - lru-cache: "npm:^6.0.0" - bin: - semver: bin/semver.js - checksum: 7e581d679530db31757301c2117721577a2bb36a301a443aac833b8efad372cda58e7f2a464fe4412ae1041cc1f63a6c1fe0ced8c57ce5aca1e0b57bb0d627b9 - languageName: node - linkType: hard - "semver@npm:7.5.3": version: 7.5.3 resolution: "semver@npm:7.5.3" @@ -29444,7 +27405,7 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:3.0.7, signal-exit@npm:^3.0.0, signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": +"signal-exit@npm:^3.0.0, signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" checksum: 25d272fa73e146048565e08f3309d5b942c1979a6f4a58a8c59d5fa299728e9c2fcd1a759ec870863b1fd38653670240cd420dad2ad9330c71f36608a6a1c912 @@ -29458,7 +27419,7 @@ __metadata: languageName: node linkType: hard -"sigstore@npm:^1.0.0, sigstore@npm:^1.3.0, sigstore@npm:^1.4.0": +"sigstore@npm:^1.3.0": version: 1.9.0 resolution: "sigstore@npm:1.9.0" dependencies: @@ -29525,13 +27486,6 @@ __metadata: languageName: node linkType: hard -"slash@npm:3.0.0, slash@npm:^3.0.0": - version: 3.0.0 - resolution: "slash@npm:3.0.0" - checksum: e18488c6a42bdfd4ac5be85b2ced3ccd0224773baae6ad42cfbb9ec74fc07f9fa8396bd35ee638084ead7a2a0818eb5e7151111544d4731ce843019dab4be47b - languageName: node - linkType: hard - "slash@npm:^1.0.0": version: 1.0.0 resolution: "slash@npm:1.0.0" @@ -29539,6 +27493,13 @@ __metadata: languageName: node linkType: hard +"slash@npm:^3.0.0": + version: 3.0.0 + resolution: "slash@npm:3.0.0" + checksum: e18488c6a42bdfd4ac5be85b2ced3ccd0224773baae6ad42cfbb9ec74fc07f9fa8396bd35ee638084ead7a2a0818eb5e7151111544d4731ce843019dab4be47b + languageName: node + linkType: hard + "slash@npm:^4.0.0": version: 4.0.0 resolution: "slash@npm:4.0.0" @@ -29659,15 +27620,6 @@ __metadata: languageName: node linkType: hard -"sort-keys@npm:^2.0.0": - version: 2.0.0 - resolution: "sort-keys@npm:2.0.0" - dependencies: - is-plain-obj: "npm:^1.0.0" - checksum: c11a6313995cb67ccf35fed4b1f6734176cc1d1e350ee311c061a2340ada4f7e23b046db064d518b63adba98c0f763739920c59fb4659a0b8482ec7a1f255081 - languageName: node - linkType: hard - "sort-object-keys@npm:^1.1.3": version: 1.1.3 resolution: "sort-object-keys@npm:1.1.3" @@ -29919,24 +27871,6 @@ __metadata: languageName: node linkType: hard -"split2@npm:^3.0.0": - version: 3.2.2 - resolution: "split2@npm:3.2.2" - dependencies: - readable-stream: "npm:^3.0.0" - checksum: 2dad5603c52b353939befa3e2f108f6e3aff42b204ad0f5f16dd12fd7c2beab48d117184ce6f7c8854f9ee5ffec6faae70d243711dd7d143a9f635b4a285de4e - languageName: node - linkType: hard - -"split@npm:^1.0.0": - version: 1.0.1 - resolution: "split@npm:1.0.1" - dependencies: - through: "npm:2" - checksum: 7f489e7ed5ff8a2e43295f30a5197ffcb2d6202c9cf99357f9690d645b19c812bccf0be3ff336fea5054cda17ac96b91d67147d95dbfc31fbb5804c61962af85 - languageName: node - linkType: hard - "sprintf-js@npm:^1.1.1": version: 1.1.3 resolution: "sprintf-js@npm:1.1.3" @@ -29958,16 +27892,7 @@ __metadata: languageName: node linkType: hard -"ssri@npm:9.0.1, ssri@npm:^9.0.0": - version: 9.0.1 - resolution: "ssri@npm:9.0.1" - dependencies: - minipass: "npm:^3.1.1" - checksum: c5d153ce03b5980d683ecaa4d805f6a03d8dc545736213803e168a1907650c46c08a4e5ce6d670a0205482b35c35713d9d286d9133bdd79853a406e22ad81f04 - languageName: node - linkType: hard - -"ssri@npm:^10.0.0, ssri@npm:^10.0.1": +"ssri@npm:^10.0.0": version: 10.0.5 resolution: "ssri@npm:10.0.5" dependencies: @@ -30351,7 +28276,7 @@ __metadata: languageName: node linkType: hard -"strong-log-transformer@npm:2.1.0, strong-log-transformer@npm:^2.1.0": +"strong-log-transformer@npm:^2.1.0": version: 2.1.0 resolution: "strong-log-transformer@npm:2.1.0" dependencies: @@ -30697,20 +28622,6 @@ __metadata: languageName: node linkType: hard -"tar@npm:6.1.11": - version: 6.1.11 - resolution: "tar@npm:6.1.11" - dependencies: - chownr: "npm:^2.0.0" - fs-minipass: "npm:^2.0.0" - minipass: "npm:^3.0.0" - minizlib: "npm:^2.1.1" - mkdirp: "npm:^1.0.3" - yallist: "npm:^4.0.0" - checksum: 5a016f5330f43815420797b87ade578e2ea60affd47439c988a3fc8f7bb6b36450d627c31ba6a839346fae248b4c8c12bb06bb0716211f37476838c7eff91f05 - languageName: node - linkType: hard - "tar@npm:^6.1.11, tar@npm:^6.1.13, tar@npm:^6.1.2": version: 6.2.0 resolution: "tar@npm:6.2.0" @@ -30747,13 +28658,6 @@ __metadata: languageName: node linkType: hard -"temp-dir@npm:1.0.0": - version: 1.0.0 - resolution: "temp-dir@npm:1.0.0" - checksum: 648669d5e154d1961217784c786acadccf0156519c19e0aceda7edc76f5bdfa32a40dd7f88ebea9238ed6e3dedf08b846161916c8947058c384761351be90a8e - languageName: node - linkType: hard - "temp-dir@npm:^2.0.0": version: 2.0.0 resolution: "temp-dir@npm:2.0.0" @@ -30770,19 +28674,6 @@ __metadata: languageName: node linkType: hard -"tempy@npm:1.0.0": - version: 1.0.0 - resolution: "tempy@npm:1.0.0" - dependencies: - del: "npm:^6.0.0" - is-stream: "npm:^2.0.0" - temp-dir: "npm:^2.0.0" - type-fest: "npm:^0.16.0" - unique-string: "npm:^2.0.0" - checksum: 6f537111fa279466bbfbad0bf0f75cd70539a3fd5871fe07c57c0dd57dc10415052f369af67df5e620899bf39ae919678ac10656411e7985c7bbefc77111cd66 - languageName: node - linkType: hard - "tempy@npm:^1.0.1": version: 1.0.1 resolution: "tempy@npm:1.0.1" @@ -30857,13 +28748,6 @@ __metadata: languageName: node linkType: hard -"text-extensions@npm:^1.0.0": - version: 1.9.0 - resolution: "text-extensions@npm:1.9.0" - checksum: 9ad5a9f723a871e2d884e132d7e93f281c60b5759c95f3f6b04704856548715d93a36c10dbaf5f12b91bf405f0cf3893bf169d4d143c0f5509563b992d385443 - languageName: node - linkType: hard - "text-table@npm:0.2.0, text-table@npm:^0.2.0": version: 0.2.0 resolution: "text-table@npm:0.2.0" @@ -30878,7 +28762,7 @@ __metadata: languageName: node linkType: hard -"through2@npm:^2.0.0, through2@npm:^2.0.3": +"through2@npm:^2.0.3": version: 2.0.5 resolution: "through2@npm:2.0.5" dependencies: @@ -30888,16 +28772,7 @@ __metadata: languageName: node linkType: hard -"through2@npm:^4.0.0": - version: 4.0.2 - resolution: "through2@npm:4.0.2" - dependencies: - readable-stream: "npm:3" - checksum: 3741564ae99990a4a79097fe7a4152c22348adc4faf2df9199a07a66c81ed2011da39f631e479fdc56483996a9d34a037ad64e76d79f18c782ab178ea9b6778c - languageName: node - linkType: hard - -"through@npm:2, through@npm:>=2.2.7 <3, through@npm:^2.3.4, through@npm:^2.3.6, through@npm:^2.3.8": +"through@npm:^2.3.4, through@npm:^2.3.6, through@npm:^2.3.8": version: 2.3.8 resolution: "through@npm:2.3.8" checksum: 4b09f3774099de0d4df26d95c5821a62faee32c7e96fb1f4ebd54a2d7c11c57fe88b0a0d49cf375de5fee5ae6bf4eb56dbbf29d07366864e2ee805349970d3cc @@ -31135,20 +29010,6 @@ __metadata: languageName: node linkType: hard -"treeverse@npm:^3.0.0": - version: 3.0.0 - resolution: "treeverse@npm:3.0.0" - checksum: 286479b9c05a8fb0538ee7d67a5502cea7704f258057c784c9c1118a2f598788b2c0f7a8d89e74648af88af0225b31766acecd78e6060736f09b21dd3fa255db - languageName: node - linkType: hard - -"trim-newlines@npm:^3.0.0": - version: 3.0.1 - resolution: "trim-newlines@npm:3.0.1" - checksum: 03cfefde6c59ff57138412b8c6be922ecc5aec30694d784f2a65ef8dcbd47faef580b7de0c949345abdc56ec4b4abf64dd1e5aea619b200316e471a3dd5bf1f6 - languageName: node - linkType: hard - "trough@npm:^1.0.0": version: 1.0.5 resolution: "trough@npm:1.0.5" @@ -31493,23 +29354,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^3 || ^4, typescript@npm:^4.9.3, typescript@npm:~4.9.3": - version: 4.9.5 - resolution: "typescript@npm:4.9.5" +"typescript@npm:^3.8.3": + version: 3.9.10 + resolution: "typescript@npm:3.9.10" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 5f6cad2e728a8a063521328e612d7876e12f0d8a8390d3b3aaa452a6a65e24e9ac8ea22beb72a924fd96ea0a49ea63bb4e251fb922b12eedfb7f7a26475e5c56 + checksum: 863cc06070fa18a0f9c6a83265fb4922a8b51bf6f2c6760fb0b73865305ce617ea4bc6477381f9f4b7c3a8cb4a455b054f5469e6e41307733fe6a2bd9aae82f8 languageName: node linkType: hard -"typescript@npm:^3.8.3": - version: 3.9.10 - resolution: "typescript@npm:3.9.10" +"typescript@npm:^4.9.3, typescript@npm:~4.9.3": + version: 4.9.5 + resolution: "typescript@npm:4.9.5" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 863cc06070fa18a0f9c6a83265fb4922a8b51bf6f2c6760fb0b73865305ce617ea4bc6477381f9f4b7c3a8cb4a455b054f5469e6e41307733fe6a2bd9aae82f8 + checksum: 5f6cad2e728a8a063521328e612d7876e12f0d8a8390d3b3aaa452a6a65e24e9ac8ea22beb72a924fd96ea0a49ea63bb4e251fb922b12eedfb7f7a26475e5c56 languageName: node linkType: hard @@ -31523,23 +29384,23 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^3 || ^4#optional!builtin, typescript@patch:typescript@npm%3A^4.9.3#optional!builtin, typescript@patch:typescript@npm%3A~4.9.3#optional!builtin": - version: 4.9.5 - resolution: "typescript@patch:typescript@npm%3A4.9.5#optional!builtin::version=4.9.5&hash=289587" +"typescript@patch:typescript@npm%3A^3.8.3#optional!builtin": + version: 3.9.10 + resolution: "typescript@patch:typescript@npm%3A3.9.10#optional!builtin::version=3.9.10&hash=3bd3d3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: e3333f887c6829dfe0ab6c1dbe0dd1e3e2aeb56c66460cb85c5440c566f900c833d370ca34eb47558c0c69e78ced4bfe09b8f4f98b6de7afed9b84b8d1dd06a1 + checksum: 9041fb3886e7d6a560f985227b8c941d17a750f2edccb5f9b3a15a2480574654d9be803ad4a14aabcc2f2553c4d272a25fd698a7c42692f03f66b009fb46883c languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^3.8.3#optional!builtin": - version: 3.9.10 - resolution: "typescript@patch:typescript@npm%3A3.9.10#optional!builtin::version=3.9.10&hash=3bd3d3" +"typescript@patch:typescript@npm%3A^4.9.3#optional!builtin, typescript@patch:typescript@npm%3A~4.9.3#optional!builtin": + version: 4.9.5 + resolution: "typescript@patch:typescript@npm%3A4.9.5#optional!builtin::version=4.9.5&hash=289587" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 9041fb3886e7d6a560f985227b8c941d17a750f2edccb5f9b3a15a2480574654d9be803ad4a14aabcc2f2553c4d272a25fd698a7c42692f03f66b009fb46883c + checksum: e3333f887c6829dfe0ab6c1dbe0dd1e3e2aeb56c66460cb85c5440c566f900c833d370ca34eb47558c0c69e78ced4bfe09b8f4f98b6de7afed9b84b8d1dd06a1 languageName: node linkType: hard @@ -31735,15 +29596,6 @@ __metadata: languageName: node linkType: hard -"unique-filename@npm:^2.0.0": - version: 2.0.1 - resolution: "unique-filename@npm:2.0.1" - dependencies: - unique-slug: "npm:^3.0.0" - checksum: 55d95cd670c4a86117ebc34d394936d712d43b56db6bc511f9ca00f666373818bf9f075fb0ab76bcbfaf134592ef26bb75aad20786c1ff1ceba4457eaba90fb8 - languageName: node - linkType: hard - "unique-filename@npm:^3.0.0": version: 3.0.0 resolution: "unique-filename@npm:3.0.0" @@ -31753,15 +29605,6 @@ __metadata: languageName: node linkType: hard -"unique-slug@npm:^3.0.0": - version: 3.0.0 - resolution: "unique-slug@npm:3.0.0" - dependencies: - imurmurhash: "npm:^0.1.4" - checksum: 617240eb921af803b47d322d75a71a363dacf2e56c29ae5d1404fad85f64f4ec81ef10ee4fd79215d0202cbe1e5a653edb0558d59c9c81d3bd538c2d58e4c026 - languageName: node - linkType: hard - "unique-slug@npm:^4.0.0": version: 4.0.0 resolution: "unique-slug@npm:4.0.0" @@ -31983,7 +29826,7 @@ __metadata: languageName: node linkType: hard -"upath@npm:2.0.1, upath@npm:^2.0.1": +"upath@npm:^2.0.1": version: 2.0.1 resolution: "upath@npm:2.0.1" checksum: 79e8e1296b00e24a093b077cfd7a238712d09290c850ce59a7a01458ec78c8d26dcc2ab50b1b9d6a84dabf6511fb4969afeb8a5c9a001aa7272b9cc74c34670f @@ -32194,15 +30037,6 @@ __metadata: languageName: node linkType: hard -"uuid@npm:8.3.2, uuid@npm:^8.0.0, uuid@npm:^8.3.2": - version: 8.3.2 - resolution: "uuid@npm:8.3.2" - bin: - uuid: dist/bin/uuid - checksum: bcbb807a917d374a49f475fae2e87fdca7da5e5530820ef53f65ba1d12131bd81a92ecf259cc7ce317cbe0f289e7d79fdfebcef9bfa3087c8c8a2fa304c9be54 - languageName: node - linkType: hard - "uuid@npm:^3.3.3": version: 3.4.0 resolution: "uuid@npm:3.4.0" @@ -32212,6 +30046,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:^8.0.0, uuid@npm:^8.3.2": + version: 8.3.2 + resolution: "uuid@npm:8.3.2" + bin: + uuid: dist/bin/uuid + checksum: bcbb807a917d374a49f475fae2e87fdca7da5e5530820ef53f65ba1d12131bd81a92ecf259cc7ce317cbe0f289e7d79fdfebcef9bfa3087c8c8a2fa304c9be54 + languageName: node + linkType: hard + "uuid@npm:^9.0.0": version: 9.0.1 resolution: "uuid@npm:9.0.1" @@ -32260,7 +30103,7 @@ __metadata: languageName: node linkType: hard -"validate-npm-package-license@npm:3.0.4, validate-npm-package-license@npm:^3.0.1, validate-npm-package-license@npm:^3.0.4": +"validate-npm-package-license@npm:^3.0.1, validate-npm-package-license@npm:^3.0.4": version: 3.0.4 resolution: "validate-npm-package-license@npm:3.0.4" dependencies: @@ -32270,24 +30113,6 @@ __metadata: languageName: node linkType: hard -"validate-npm-package-name@npm:4.0.0, validate-npm-package-name@npm:^4.0.0": - version: 4.0.0 - resolution: "validate-npm-package-name@npm:4.0.0" - dependencies: - builtins: "npm:^5.0.0" - checksum: d7f753c0aac0a2b8dd06752e7278d18165a21e28b5064d897a1b6f10350d857b339d6bd9e08dd140710433479940bec9ba151b619196780dc6e49dd8fbff6df8 - languageName: node - linkType: hard - -"validate-npm-package-name@npm:^3.0.0": - version: 3.0.0 - resolution: "validate-npm-package-name@npm:3.0.0" - dependencies: - builtins: "npm:^1.0.3" - checksum: 064f21f59aefae6cc286dd4a50b15d14adb0227e0facab4316197dfb8d06801669e997af5081966c15f7828a5e6ff1957bd20886aeb6b9d0fa430e4cb5db9c4a - languageName: node - linkType: hard - "validate-npm-package-name@npm:^5.0.0": version: 5.0.0 resolution: "validate-npm-package-name@npm:5.0.0" @@ -32834,13 +30659,6 @@ __metadata: languageName: node linkType: hard -"walk-up-path@npm:^1.0.0": - version: 1.0.0 - resolution: "walk-up-path@npm:1.0.0" - checksum: e2dc2346acfeec355c8af17095aa8689b57906f0f3ad5f3ff1b0a29a36ee41904608e9a3545a933a2cfa22f20905e2bbe5dd6469cb31b110c8e129c23103e985 - languageName: node - linkType: hard - "walker@npm:^1.0.8": version: 1.0.8 resolution: "walker@npm:1.0.8" @@ -32878,7 +30696,7 @@ __metadata: languageName: node linkType: hard -"wcwidth@npm:^1.0.0, wcwidth@npm:^1.0.1": +"wcwidth@npm:^1.0.1": version: 1.0.1 resolution: "wcwidth@npm:1.0.1" dependencies: @@ -33393,7 +31211,7 @@ __metadata: languageName: node linkType: hard -"wrap-ansi@npm:^6.0.1, wrap-ansi@npm:^6.2.0": +"wrap-ansi@npm:^6.2.0": version: 6.2.0 resolution: "wrap-ansi@npm:6.2.0" dependencies: @@ -33432,17 +31250,7 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:4.0.1": - version: 4.0.1 - resolution: "write-file-atomic@npm:4.0.1" - dependencies: - imurmurhash: "npm:^0.1.4" - signal-exit: "npm:^3.0.7" - checksum: 3a4d89bdb993937917a61e3847f75eb857dcac157ab4c956c9bab5d95ba82a482de6eff950752e06e86d1950fdc0f794cc29fe63d6ee9dba00aedc21a8b1e039 - languageName: node - linkType: hard - -"write-file-atomic@npm:^2.3.0, write-file-atomic@npm:^2.4.2": +"write-file-atomic@npm:^2.3.0": version: 2.4.3 resolution: "write-file-atomic@npm:2.4.3" dependencies: @@ -33463,41 +31271,6 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:^5.0.0": - version: 5.0.1 - resolution: "write-file-atomic@npm:5.0.1" - dependencies: - imurmurhash: "npm:^0.1.4" - signal-exit: "npm:^4.0.1" - checksum: e8c850a8e3e74eeadadb8ad23c9d9d63e4e792bd10f4836ed74189ef6e996763959f1249c5650e232f3c77c11169d239cbfc8342fc70f3fe401407d23810505d - languageName: node - linkType: hard - -"write-json-file@npm:^3.2.0": - version: 3.2.0 - resolution: "write-json-file@npm:3.2.0" - dependencies: - detect-indent: "npm:^5.0.0" - graceful-fs: "npm:^4.1.15" - make-dir: "npm:^2.1.0" - pify: "npm:^4.0.1" - sort-keys: "npm:^2.0.0" - write-file-atomic: "npm:^2.4.2" - checksum: 3eadcb6e832ac34dbba37d4eea8871d9fef0e0d77c486b13ed5f81d84a8fcecd9e1a04277e2691eb803c2bed39c2a315e98b96f492c271acee2836acc6276043 - languageName: node - linkType: hard - -"write-pkg@npm:4.0.0": - version: 4.0.0 - resolution: "write-pkg@npm:4.0.0" - dependencies: - sort-keys: "npm:^2.0.0" - type-fest: "npm:^0.4.1" - write-json-file: "npm:^3.2.0" - checksum: 8e20db5fa444dad04e3703c18d8e0f89679caa60accbee5da9ea3aa076430b3f32d99f50d8860d29044245775795455c62d12d16a7856d407e30df7b79f39505 - languageName: node - linkType: hard - "ws@npm:^6.1.0": version: 6.2.2 resolution: "ws@npm:6.2.2" @@ -33665,13 +31438,6 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:20.2.4": - version: 20.2.4 - resolution: "yargs-parser@npm:20.2.4" - checksum: 08dc341f0b9f940c2fffc1d1decf3be00e28cabd2b578a694901eccc7dcd10577f10c6aa1b040fdd9a68b2042515a60f18476543bccacf9f3ce2c8534cd87435 - languageName: node - linkType: hard - "yargs-parser@npm:21.1.1, yargs-parser@npm:^21.0.1, yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1" @@ -33699,28 +31465,13 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:^20.2.2, yargs-parser@npm:^20.2.3, yargs-parser@npm:^20.2.9": +"yargs-parser@npm:^20.2.2, yargs-parser@npm:^20.2.9": version: 20.2.9 resolution: "yargs-parser@npm:20.2.9" checksum: 0685a8e58bbfb57fab6aefe03c6da904a59769bd803a722bb098bd5b0f29d274a1357762c7258fb487512811b8063fb5d2824a3415a0a4540598335b3b086c72 languageName: node linkType: hard -"yargs@npm:16.2.0, yargs@npm:^16.2.0": - version: 16.2.0 - resolution: "yargs@npm:16.2.0" - dependencies: - cliui: "npm:^7.0.2" - escalade: "npm:^3.1.1" - get-caller-file: "npm:^2.0.5" - require-directory: "npm:^2.1.1" - string-width: "npm:^4.2.0" - y18n: "npm:^5.0.5" - yargs-parser: "npm:^20.2.2" - checksum: b1dbfefa679848442454b60053a6c95d62f2d2e21dd28def92b647587f415969173c6e99a0f3bab4f1b67ee8283bf735ebe3544013f09491186ba9e8a9a2b651 - languageName: node - linkType: hard - "yargs@npm:17.7.2, yargs@npm:^17.2.1, yargs@npm:^17.3.1, yargs@npm:^17.6.2": version: 17.7.2 resolution: "yargs@npm:17.7.2" @@ -33773,6 +31524,21 @@ __metadata: languageName: node linkType: hard +"yargs@npm:^16.2.0": + version: 16.2.0 + resolution: "yargs@npm:16.2.0" + dependencies: + cliui: "npm:^7.0.2" + escalade: "npm:^3.1.1" + get-caller-file: "npm:^2.0.5" + require-directory: "npm:^2.1.1" + string-width: "npm:^4.2.0" + y18n: "npm:^5.0.5" + yargs-parser: "npm:^20.2.2" + checksum: b1dbfefa679848442454b60053a6c95d62f2d2e21dd28def92b647587f415969173c6e99a0f3bab4f1b67ee8283bf735ebe3544013f09491186ba9e8a9a2b651 + languageName: node + linkType: hard + "yauzl@npm:^2.10.0": version: 2.10.0 resolution: "yauzl@npm:2.10.0" diff --git a/scripts/run-registry.ts b/scripts/run-registry.ts index 9184e885b4d6..8a7017b34fa1 100755 --- a/scripts/run-registry.ts +++ b/scripts/run-registry.ts @@ -11,7 +11,7 @@ import { mkdir } from 'fs/promises'; import { PACKS_DIRECTORY } from './utils/constants'; import { maxConcurrentTasks } from './utils/concurrency'; -import { listOfPackages } from './utils/list-packages'; +import { getWorkspaces } from './utils/workspace'; program .option('-O, --open', 'keep process open') @@ -137,7 +137,7 @@ const run = async () => { const [verdaccioServer, packages, version] = await Promise.all([ startVerdaccio(), - listOfPackages(), + getWorkspaces(false), currentVersion(), ]); diff --git a/scripts/utils/list-packages.ts b/scripts/utils/list-packages.ts deleted file mode 100644 index ed823bc05370..000000000000 --- a/scripts/utils/list-packages.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { exec } from 'child_process'; -import { join } from 'path'; - -export interface Package { - name: string; - version: string; - private: boolean; - location: string; -} - -export const listOfPackages = (): Promise => - new Promise((res, rej) => { - const command = `npx lerna list --json`; - exec(command, { cwd: join(__dirname, '..', '..', 'code') }, (e, result) => { - if (e) { - rej(e); - } else { - const data = JSON.parse(result.toString().trim()); - res(data); - } - }); - }); diff --git a/scripts/utils/workspace.ts b/scripts/utils/workspace.ts index 3219c558599f..a9af2eb46fa2 100644 --- a/scripts/utils/workspace.ts +++ b/scripts/utils/workspace.ts @@ -4,11 +4,14 @@ import { execaCommand } from './exec'; export type Workspace = { name: string; location: string }; -export async function getWorkspaces() { - const { stdout } = await execaCommand('yarn workspaces list --json', { - cwd: CODE_DIRECTORY, - shell: true, - }); +export async function getWorkspaces(includePrivate = true) { + const { stdout } = await execaCommand( + `yarn workspaces list --json ${includePrivate ? '' : '--no-private'}`, + { + cwd: CODE_DIRECTORY, + shell: true, + } + ); return JSON.parse(`[${stdout.split('\n').join(',')}]`) as Workspace[]; } From d8ddadd2edce3fce634ee96cb9880de9fbb0e4f8 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Thu, 2 Nov 2023 13:44:57 +0100 Subject: [PATCH 017/115] Remove publish script --- scripts/publish.sh | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100755 scripts/publish.sh diff --git a/scripts/publish.sh b/scripts/publish.sh deleted file mode 100755 index 18da8c7a83c2..000000000000 --- a/scripts/publish.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# Copyright (c) 2015-present, Facebook, Inc. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -# ****************************************************************************** -# This releases an update to the `react-scripts` package. -# Don't use `npm publish` for it. -# Read the release instructions: -# https://github.com/facebook/create-react-app/blob/master/CONTRIBUTING.md#cutting-a-release -# ****************************************************************************** - -# Start in tasks/ even if run from root directory -cd "$(dirname "$0")" - -# Exit the script on any command with non 0 return code -# We assume that all the commands in the pipeline set their return code -# properly and that we do not need to validate that the output is correct -set -e - -# Echo every command being executed -set -x - -# Go to root -cd .. -root_path=$PWD - -if [ -n "$(git status --porcelain)" ]; then - echo "Your git status is not clean. Aborting."; - exit 1; -fi - -./node_modules/.bin/lerna publish "$@" From dc610d4697f854abcbd386acc867040f2747adc6 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Thu, 2 Nov 2023 13:45:20 +0100 Subject: [PATCH 018/115] Remove generate-sb-packages-versions script --- .../scripts/generate-sb-packages-versions.js | 73 ------------------- 1 file changed, 73 deletions(-) delete mode 100755 code/lib/cli/scripts/generate-sb-packages-versions.js diff --git a/code/lib/cli/scripts/generate-sb-packages-versions.js b/code/lib/cli/scripts/generate-sb-packages-versions.js deleted file mode 100755 index 33e83428aa96..000000000000 --- a/code/lib/cli/scripts/generate-sb-packages-versions.js +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env node - -const { promisify } = require('util'); -const { readJson, writeFile } = require('fs-extra'); -const { exec } = require('child_process'); -const path = require('path'); -const semver = require('semver'); -const { default: dedent } = require('ts-dedent'); - -const rootDirectory = path.join(__dirname, '..', '..', '..'); - -const logger = console; - -const getMonorepoPackages = async () => { - const process = promisify(exec); - const contents = await process('yarn lerna ls --json', { - cwd: rootDirectory, - }); - - const projects = JSON.parse(contents.stdout); - return projects.reduce((acc, project) => { - acc[project.name] = path.join(project.location, 'package.json'); - return acc; - }, []); -}; - -const run = async () => { - const updatedVersion = process.argv[process.argv.length - 1]; - - if (!semver.valid(updatedVersion)) throw new Error(`Invalid version: ${updatedVersion}`); - - logger.log(`Generating versions.ts with v${updatedVersion}`); - - const storybookPackages = await getMonorepoPackages(); - - const packageToVersionMap = ( - await Promise.all( - Object.keys(storybookPackages).map(async (pkgName) => { - const { name, version } = await readJson(storybookPackages[pkgName]); - - return { - name, - version, - }; - }) - ) - ) - .filter(({ name }) => /^(@storybook|sb$|storybook$)/.test(name)) - // As some previous steps are asynchronous order is not always the same so sort them to avoid that - .sort((package1, package2) => package1.name.localeCompare(package2.name)) - .reduce((acc, { name }) => ({ ...acc, [name]: updatedVersion }), {}); - - const versionsPath = path.join(__dirname, '..', 'src', 'versions.ts'); - - await writeFile( - versionsPath, - dedent` - // auto generated file, do not edit - export default ${JSON.stringify(packageToVersionMap, null, 2)} - ` - ); - - logger.log(`Updating versions and formatting results at: ${versionsPath}`); - - exec(`yarn lint:js:cmd --fix ${versionsPath}`, { - cwd: path.join(__dirname, '..', '..', '..'), - }); -}; - -run().catch((e) => { - logger.error(e); - process.exit(1); -}); From 15d5831de9ba1db54916b8e24e5cdae3fc4448ec Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Thu, 2 Nov 2023 13:45:39 +0100 Subject: [PATCH 019/115] Use yarn instead of lerna in build-package script --- scripts/build-package.js | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/scripts/build-package.js b/scripts/build-package.js index 584d765a21e1..c76af11b8a09 100644 --- a/scripts/build-package.js +++ b/scripts/build-package.js @@ -4,26 +4,21 @@ const { resolve, join, posix, sep } = require('path'); const { readJSON } = require('fs-extra'); -const getStorybookPackages = async () => { - const process = require('util').promisify(require('child_process').exec); - const contents = await process('lerna ls --json', { cwd: join(__dirname, '..', 'code') }); - - const projects = JSON.parse(contents.stdout); - return projects.reduce((acc, project) => { - acc.push({ - name: project.name, - location: project.location, - }); - return acc; - }, []); -}; +async function getWorkspaces(includePrivate = true) { + const { execaCommand } = await import('execa'); + const { stdout } = await execaCommand(`yarn workspaces list --json --no-private`, { + cwd: join(__dirname, '..', 'code'), + shell: true, + }); + return JSON.parse(`[${stdout.split('\n').join(',')}]`); +} async function run() { const prompts = require('prompts'); const program = require('commander'); const chalk = require('chalk'); - const packages = await getStorybookPackages(); + const packages = await getWorkspaces(); const packageTasks = packages .map((package) => { return { From 6a619a3412f9bb0edd83857dde98f5a65d193575 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Thu, 2 Nov 2023 13:45:59 +0100 Subject: [PATCH 020/115] Remove lerna occurences from docs --- MAINTAINERS.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 3ba64ea63ce2..191dc42d5b90 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -48,7 +48,7 @@ This document outlines some of the processes that the maintainers should adhere | maintenance | Issue, or pull request related to Storybook's internal maintenance | | mdx | Issue, bug, or pull request related to MDX and Storybook | | medium | Issue or pull request that involves a significant amount of work within Storybook | -| monorepos | Issue, bug, or pull request related to Storybook and monorepos (e.g., [lerna](https://lerna.js.org/) ) | +| monorepos | Issue, bug, or pull request related to Storybook and monorepos | | mui | Issue, bug, or pull request that affects Storybook and [Material-UI](https://material-ui.com/) | | multiframework | Issue, bug, or pull request that affects multiple supported frameworks (e.g., React, Vue) | | needs more info | Issue, or bug that requires additional context from the author | diff --git a/README.md b/README.md index 4633f6efc0b8..69fe2fb71cfa 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,7 @@ Looking for a first issue to tackle? ### Development scripts -Storybook is organized as a monorepo using [Lerna](https://lerna.js.org/). Useful scripts include: +Storybook is organized as a monorepo. Useful scripts include: #### `yarn start` From 1388c64f402878fd8bbf9355675c8ca83537da94 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 2 Nov 2023 13:49:49 +0100 Subject: [PATCH 021/115] move Vite deps otimization to presets --- code/addons/docs/src/preset.ts | 10 +++++++++- code/builders/builder-vite/src/optimizeDeps.ts | 12 ++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts index 22b5834c9e9a..420713594595 100644 --- a/code/addons/docs/src/preset.ts +++ b/code/addons/docs/src/preset.ts @@ -194,4 +194,12 @@ const docsX = docs as any; ensureReactPeerDeps(); -export { webpackX as webpack, indexersX as experimental_indexers, docsX as docs }; +const optimizeDeps = [ + '@mdx-js/react', + '@storybook/addon-docs > acorn-jsx', + '@storybook/addon-docs', + '@storybook/addon-essentials/docs/mdx-react-shim', + 'markdown-to-jsx', +]; + +export { webpackX as webpack, indexersX as experimental_indexers, docsX as docs, optimizeDeps }; diff --git a/code/builders/builder-vite/src/optimizeDeps.ts b/code/builders/builder-vite/src/optimizeDeps.ts index ddb32c800403..f67cb20bc223 100644 --- a/code/builders/builder-vite/src/optimizeDeps.ts +++ b/code/builders/builder-vite/src/optimizeDeps.ts @@ -8,10 +8,6 @@ const INCLUDE_CANDIDATES = [ '@emotion/core', '@emotion/is-prop-valid', '@emotion/styled', - '@mdx-js/react', - '@storybook/addon-docs > acorn-jsx', - '@storybook/addon-docs', - '@storybook/addon-essentials/docs/mdx-react-shim', '@storybook/channels', '@storybook/client-api', '@storybook/client-logger', @@ -79,7 +75,6 @@ const INCLUDE_CANDIDATES = [ 'lodash/uniq', 'lodash/upperFirst.js', 'lodash/upperFirst', - 'markdown-to-jsx', 'memoizerific', 'overlayscrollbars', 'polished', @@ -126,6 +121,8 @@ const asyncFilter = async (arr: string[], predicate: (val: string) => Promise arr.filter((_v, index) => results[index])); export async function getOptimizeDeps(config: ViteInlineConfig, options: Options) { + const extraOptimizeDeps = await options.presets.apply('optimizeDeps', []); + const { root = process.cwd() } = config; const { normalizePath, resolveConfig } = await import('vite'); const absoluteStories = await listStories(options); @@ -136,7 +133,10 @@ export async function getOptimizeDeps(config: ViteInlineConfig, options: Options // This function converts ids which might include ` > ` to a real path, if it exists on disk. // See https://github.com/vitejs/vite/blob/67d164392e8e9081dc3f0338c4b4b8eea6c5f7da/packages/vite/src/node/optimizer/index.ts#L182-L199 const resolve = resolvedConfig.createResolver({ asSrc: false }); - const include = await asyncFilter(INCLUDE_CANDIDATES, async (id) => Boolean(await resolve(id))); + const include = await asyncFilter( + Array.from(new Set([...INCLUDE_CANDIDATES, ...extraOptimizeDeps])), + async (id) => Boolean(await resolve(id)) + ); const optimizeDeps: UserConfig['optimizeDeps'] = { ...config.optimizeDeps, From 52e38c6bcc555e893c41d42c77ec08e4b75f973a Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 14:05:13 +0100 Subject: [PATCH 022/115] add the global for `__STORYBOOK_BLOCKS_EMPTY_MODULE__` if needed. --- code/builders/builder-vite/input/iframe.html | 2 ++ .../builder-vite/src/transform-iframe-html.ts | 11 +++++++++++ code/builders/builder-vite/src/vite-config.ts | 1 + .../src/preview/iframe-webpack.config.ts | 2 ++ code/lib/preview/src/globals/types.ts | 2 +- 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/code/builders/builder-vite/input/iframe.html b/code/builders/builder-vite/input/iframe.html index 436864580ab6..867a16a4a223 100644 --- a/code/builders/builder-vite/input/iframe.html +++ b/code/builders/builder-vite/input/iframe.html @@ -22,6 +22,8 @@ window.STORIES = '[STORIES HERE]'; window.DOCS_OPTIONS = '[DOCS_OPTIONS HERE]'; + ('OTHER_GLOBLALS HERE'); + // We do this so that "module && module.hot" etc. in Storybook source code // doesn't fail (it will simply be disabled) window.module = undefined; diff --git a/code/builders/builder-vite/src/transform-iframe-html.ts b/code/builders/builder-vite/src/transform-iframe-html.ts index c0bc245e30cc..fa1e040a667d 100644 --- a/code/builders/builder-vite/src/transform-iframe-html.ts +++ b/code/builders/builder-vite/src/transform-iframe-html.ts @@ -5,6 +5,7 @@ export type PreviewHtml = string | undefined; export async function transformIframeHtml(html: string, options: Options) { const { configType, features, presets } = options; + const { test } = await presets.apply('build'); const frameworkOptions = await presets.apply | null>('frameworkOptions'); const headHtmlSnippet = await presets.apply('previewHead'); const bodyHtmlSnippet = await presets.apply('previewBody'); @@ -20,10 +21,20 @@ export async function transformIframeHtml(html: string, options: Options) { importPathMatcher: specifier.importPathMatcher.source, })); + const otherGlobals = { + ...(test.emptyBlocks ? { __STORYBOOK_BLOCKS_EMPTY_MODULE__: {} } : {}), + }; + return html .replace('[CONFIG_TYPE HERE]', configType || '') .replace('[LOGLEVEL HERE]', logLevel || '') .replace(`'[FRAMEWORK_OPTIONS HERE]'`, JSON.stringify(frameworkOptions)) + .replace( + `('OTHER_GLOBLALS HERE');`, + Object.entries(otherGlobals) + .map(([k, v]) => `window["${k}"] = ${JSON.stringify(v)};`) + .join('') + ) .replace( `'[CHANNEL_OPTIONS HERE]'`, JSON.stringify(coreOptions && coreOptions.channelOptions ? coreOptions.channelOptions : {}) diff --git a/code/builders/builder-vite/src/vite-config.ts b/code/builders/builder-vite/src/vite-config.ts index da7b7d6ef775..d0127a4942c5 100644 --- a/code/builders/builder-vite/src/vite-config.ts +++ b/code/builders/builder-vite/src/vite-config.ts @@ -80,6 +80,7 @@ export async function pluginConfig(options: Options) { const { test } = await options.presets.apply('build'); if (test?.emptyBlocks) { + // @ts-expect-error (force add empty blocks module) globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index 6da8c9cc7e5d..8de5ce612edd 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -220,6 +220,7 @@ export default async ( } if (test?.emptyBlocks) { + // @ts-expect-error (force add empty blocks module) globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } @@ -275,6 +276,7 @@ export default async ( importPathMatcher: specifier.importPathMatcher.source, })), DOCS_OPTIONS: docsOptions, + ...(test?.emptyBlocks ? { __STORYBOOK_BLOCKS_EMPTY_MODULE__: {} } : {}), }, headHtmlSnippet, bodyHtmlSnippet, diff --git a/code/lib/preview/src/globals/types.ts b/code/lib/preview/src/globals/types.ts index fc694751d092..40ed603cd598 100644 --- a/code/lib/preview/src/globals/types.ts +++ b/code/lib/preview/src/globals/types.ts @@ -1,5 +1,5 @@ // Here we map the name of a module to their NAME in the global scope. -export const globals: Record = { +export const globals = { '@storybook/addons': '__STORYBOOK_MODULE_ADDONS__', '@storybook/global': '__STORYBOOK_MODULE_GLOBAL__', '@storybook/channel-postmessage': '__STORYBOOK_MODULE_CHANNEL_POSTMESSAGE__', // @deprecated: remove in 8.0 From 33ec86a2e6f0a35daf3902ab1eb0ec677ea2aa37 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 14:27:19 +0100 Subject: [PATCH 023/115] make it optional --- code/lib/types/src/modules/core-common.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index e1100853f5ee..69362b192896 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -314,8 +314,8 @@ export interface StorybookConfig { legacyDecoratorFileOrder?: boolean; }; - build: { - test: { + build?: { + test?: { /** * Globalize @storybook/blocks */ From 40ea41205437ad09d5d1233c6408254f64f46297 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 14:31:04 +0100 Subject: [PATCH 024/115] ignore eslint warning, deal with optionality --- code/.eslintrc.js | 7 +++++++ code/builders/builder-vite/src/vite-config.ts | 4 ++-- .../builder-webpack5/src/preview/iframe-webpack.config.ts | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/code/.eslintrc.js b/code/.eslintrc.js index e967113bb8eb..a18b5a5c9b08 100644 --- a/code/.eslintrc.js +++ b/code/.eslintrc.js @@ -68,6 +68,13 @@ module.exports = { '@typescript-eslint/ban-types': 'warn', // should become error, in the future }, }, + { + // this package depends on a lot of peerDependencies we don't want to specify, because npm would install them + files: ['builder-vite/**/*.html'], + rules: { + '@typescript-eslint/no-unused-expressions': 'off', // should become error, in the future + }, + }, { // these packages use pre-bundling, dependencies will be bundled, and will be in devDepenencies files: [ diff --git a/code/builders/builder-vite/src/vite-config.ts b/code/builders/builder-vite/src/vite-config.ts index d0127a4942c5..7bf7f0356a39 100644 --- a/code/builders/builder-vite/src/vite-config.ts +++ b/code/builders/builder-vite/src/vite-config.ts @@ -77,9 +77,9 @@ export async function commonConfig( export async function pluginConfig(options: Options) { const frameworkName = await getFrameworkName(options); - const { test } = await options.presets.apply('build'); + const build = await options.presets.apply('build'); - if (test?.emptyBlocks) { + if (build?.test?.emptyBlocks) { // @ts-expect-error (force add empty blocks module) globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index 8de5ce612edd..9189e4894ef1 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -90,7 +90,7 @@ export default async ( entries, nonNormalizedStories, modulesCount = 1000, - { test }, + build, ] = await Promise.all([ presets.apply('core'), presets.apply('frameworkOptions'), @@ -276,7 +276,7 @@ export default async ( importPathMatcher: specifier.importPathMatcher.source, })), DOCS_OPTIONS: docsOptions, - ...(test?.emptyBlocks ? { __STORYBOOK_BLOCKS_EMPTY_MODULE__: {} } : {}), + ...(build?.test?.emptyBlocks ? { __STORYBOOK_BLOCKS_EMPTY_MODULE__: {} } : {}), }, headHtmlSnippet, bodyHtmlSnippet, From 5230210e40b63b08d5002a55c28400e0dd0854c3 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 14:33:52 +0100 Subject: [PATCH 025/115] adjust the eslint config to actually do it --- code/.eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/.eslintrc.js b/code/.eslintrc.js index a18b5a5c9b08..35086680644d 100644 --- a/code/.eslintrc.js +++ b/code/.eslintrc.js @@ -70,7 +70,7 @@ module.exports = { }, { // this package depends on a lot of peerDependencies we don't want to specify, because npm would install them - files: ['builder-vite/**/*.html'], + files: ['**/builder-vite/**/*.html'], rules: { '@typescript-eslint/no-unused-expressions': 'off', // should become error, in the future }, From 665ddee64f16c3f715c304eae8bc4a464d584ad2 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 14:55:12 +0100 Subject: [PATCH 026/115] oops --- .../builder-webpack5/src/preview/iframe-webpack.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index 9189e4894ef1..d4a34a5ecdb9 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -219,7 +219,7 @@ export default async ( `); } - if (test?.emptyBlocks) { + if (build?.test?.emptyBlocks) { // @ts-expect-error (force add empty blocks module) globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } From d43b004a563c73fcbc63cb426d270e9dd69bd1f5 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 15:13:38 +0100 Subject: [PATCH 027/115] fixes for types check --- code/addons/essentials/src/backgrounds/manager.ts | 1 + code/addons/essentials/src/backgrounds/preview.ts | 3 +-- code/addons/essentials/src/controls/manager.ts | 1 + code/addons/essentials/src/highlight/preview.ts | 3 +-- code/addons/essentials/src/measure/manager.ts | 1 + code/addons/essentials/src/measure/preview.ts | 3 +-- code/addons/essentials/src/outline/manager.ts | 1 + code/addons/essentials/src/outline/preview.ts | 3 +-- code/addons/essentials/src/toolbars/manager.ts | 1 + code/addons/essentials/src/viewport/manager.ts | 1 + 10 files changed, 10 insertions(+), 8 deletions(-) diff --git a/code/addons/essentials/src/backgrounds/manager.ts b/code/addons/essentials/src/backgrounds/manager.ts index 930d5ee38181..9da6a432be39 100644 --- a/code/addons/essentials/src/backgrounds/manager.ts +++ b/code/addons/essentials/src/backgrounds/manager.ts @@ -1 +1,2 @@ +// @ts-expect-error (no types needed for this) export * from '@storybook/addon-backgrounds/manager'; diff --git a/code/addons/essentials/src/backgrounds/preview.ts b/code/addons/essentials/src/backgrounds/preview.ts index 3bb1f96c3d80..cf24112788f3 100644 --- a/code/addons/essentials/src/backgrounds/preview.ts +++ b/code/addons/essentials/src/backgrounds/preview.ts @@ -1,3 +1,2 @@ -// TODO: We need to configure an eslint-import typescript resolver for export maps to be considered - +// @ts-expect-error (no types needed for this) export * from '@storybook/addon-backgrounds/preview'; diff --git a/code/addons/essentials/src/controls/manager.ts b/code/addons/essentials/src/controls/manager.ts index c902436bf5ff..933adbd4e101 100644 --- a/code/addons/essentials/src/controls/manager.ts +++ b/code/addons/essentials/src/controls/manager.ts @@ -1 +1,2 @@ +// @ts-expect-error (no types needed for this) export * from '@storybook/addon-controls/manager'; diff --git a/code/addons/essentials/src/highlight/preview.ts b/code/addons/essentials/src/highlight/preview.ts index 242ee3332bd3..e124e7a1374a 100644 --- a/code/addons/essentials/src/highlight/preview.ts +++ b/code/addons/essentials/src/highlight/preview.ts @@ -1,3 +1,2 @@ -// TODO: We need to configure an eslint-import typescript resolver for export maps to be considered - +// @ts-expect-error (no types needed for this) export * from '@storybook/addon-highlight/preview'; diff --git a/code/addons/essentials/src/measure/manager.ts b/code/addons/essentials/src/measure/manager.ts index ceef38cd36ad..688ffbed236d 100644 --- a/code/addons/essentials/src/measure/manager.ts +++ b/code/addons/essentials/src/measure/manager.ts @@ -1 +1,2 @@ +// @ts-expect-error (no types needed for this) export * from '@storybook/addon-measure/manager'; diff --git a/code/addons/essentials/src/measure/preview.ts b/code/addons/essentials/src/measure/preview.ts index a7b4307edb44..647ef4345a6d 100644 --- a/code/addons/essentials/src/measure/preview.ts +++ b/code/addons/essentials/src/measure/preview.ts @@ -1,3 +1,2 @@ -// TODO: We need to configure an eslint-import typescript resolver for export maps to be considered - +// @ts-expect-error (no types needed for this) export * from '@storybook/addon-measure/preview'; diff --git a/code/addons/essentials/src/outline/manager.ts b/code/addons/essentials/src/outline/manager.ts index 9f46ef8cbae4..d3a29db6d98b 100644 --- a/code/addons/essentials/src/outline/manager.ts +++ b/code/addons/essentials/src/outline/manager.ts @@ -1 +1,2 @@ +// @ts-expect-error (no types needed for this) export * from '@storybook/addon-outline/manager'; diff --git a/code/addons/essentials/src/outline/preview.ts b/code/addons/essentials/src/outline/preview.ts index e54411194b51..3fe09381fe8f 100644 --- a/code/addons/essentials/src/outline/preview.ts +++ b/code/addons/essentials/src/outline/preview.ts @@ -1,3 +1,2 @@ -// TODO: We need to configure an eslint-import typescript resolver for export maps to be considered - +// @ts-expect-error (no types needed for this) export * from '@storybook/addon-outline/preview'; diff --git a/code/addons/essentials/src/toolbars/manager.ts b/code/addons/essentials/src/toolbars/manager.ts index fde1c66907a1..888dfe31937d 100644 --- a/code/addons/essentials/src/toolbars/manager.ts +++ b/code/addons/essentials/src/toolbars/manager.ts @@ -1 +1,2 @@ +// @ts-expect-error (no types needed for this) export * from '@storybook/addon-toolbars/manager'; diff --git a/code/addons/essentials/src/viewport/manager.ts b/code/addons/essentials/src/viewport/manager.ts index ccbe283d4101..48bc7a850de6 100644 --- a/code/addons/essentials/src/viewport/manager.ts +++ b/code/addons/essentials/src/viewport/manager.ts @@ -1 +1,2 @@ +// @ts-expect-error (no types needed for this) export * from '@storybook/addon-viewport/manager'; From 642cfd7fe302c49a2cec3c2e7aeb6063bccfff28 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 15:24:20 +0100 Subject: [PATCH 028/115] fix --- code/lib/preview/src/globals/exports.ts | 1 + code/lib/preview/src/globals/runtime.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/code/lib/preview/src/globals/exports.ts b/code/lib/preview/src/globals/exports.ts index 9687091b1299..766f86cc071c 100644 --- a/code/lib/preview/src/globals/exports.ts +++ b/code/lib/preview/src/globals/exports.ts @@ -122,6 +122,7 @@ export default { 'userOrAutoTitleFromSpecifier', ], '@storybook/global': ['global'], + '@storybook/types': ['Addon_TypesEnum'], '@storybook/addons': [ 'AddonStore', 'HooksContext', diff --git a/code/lib/preview/src/globals/runtime.ts b/code/lib/preview/src/globals/runtime.ts index ad078c4afa8d..4b3644b449fd 100644 --- a/code/lib/preview/src/globals/runtime.ts +++ b/code/lib/preview/src/globals/runtime.ts @@ -4,6 +4,7 @@ import * as CHANNELS from '@storybook/channels'; import * as CLIENT_LOGGER from '@storybook/client-logger'; import * as CORE_EVENTS from '@storybook/core-events'; import * as PREVIEW_API from '@storybook/preview-api'; +import * as TYPES from '@storybook/types'; import * as GLOBAL from '@storybook/global'; // DEPRECATED, remove in 8.0 @@ -24,6 +25,7 @@ export const values: Required> = { '@storybook/core-events': CORE_EVENTS, '@storybook/preview-api': PREVIEW_API, '@storybook/global': GLOBAL, + '@storybook/types': TYPES, // DEPRECATED, remove in 8.0 '@storybook/addons': ADDONS, From 901516b520c0fad8aa50cbbe29ccca5d94c4fbff Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 15:30:08 +0100 Subject: [PATCH 029/115] fix --- code/builders/builder-vite/src/transform-iframe-html.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/builders/builder-vite/src/transform-iframe-html.ts b/code/builders/builder-vite/src/transform-iframe-html.ts index fa1e040a667d..66f3834da4ce 100644 --- a/code/builders/builder-vite/src/transform-iframe-html.ts +++ b/code/builders/builder-vite/src/transform-iframe-html.ts @@ -5,7 +5,7 @@ export type PreviewHtml = string | undefined; export async function transformIframeHtml(html: string, options: Options) { const { configType, features, presets } = options; - const { test } = await presets.apply('build'); + const build = await presets.apply('build'); const frameworkOptions = await presets.apply | null>('frameworkOptions'); const headHtmlSnippet = await presets.apply('previewHead'); const bodyHtmlSnippet = await presets.apply('previewBody'); @@ -22,7 +22,7 @@ export async function transformIframeHtml(html: string, options: Options) { })); const otherGlobals = { - ...(test.emptyBlocks ? { __STORYBOOK_BLOCKS_EMPTY_MODULE__: {} } : {}), + ...(build?.test.emptyBlocks ? { __STORYBOOK_BLOCKS_EMPTY_MODULE__: {} } : {}), }; return html From dda1af7f86a4ad462c39a65729b773f30928adce Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 15:55:18 +0100 Subject: [PATCH 030/115] fix --- code/builders/builder-vite/src/transform-iframe-html.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/builders/builder-vite/src/transform-iframe-html.ts b/code/builders/builder-vite/src/transform-iframe-html.ts index 66f3834da4ce..d3437d5c1460 100644 --- a/code/builders/builder-vite/src/transform-iframe-html.ts +++ b/code/builders/builder-vite/src/transform-iframe-html.ts @@ -22,7 +22,7 @@ export async function transformIframeHtml(html: string, options: Options) { })); const otherGlobals = { - ...(build?.test.emptyBlocks ? { __STORYBOOK_BLOCKS_EMPTY_MODULE__: {} } : {}), + ...(build?.test?.emptyBlocks ? { __STORYBOOK_BLOCKS_EMPTY_MODULE__: {} } : {}), }; return html From 0149d225759e208edba36b4e7fb29d125aa4864e Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 16:47:08 +0100 Subject: [PATCH 031/115] fix --- code/frameworks/nextjs/src/preset.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/code/frameworks/nextjs/src/preset.ts b/code/frameworks/nextjs/src/preset.ts index db1c276da9b4..fd726835293c 100644 --- a/code/frameworks/nextjs/src/preset.ts +++ b/code/frameworks/nextjs/src/preset.ts @@ -20,7 +20,6 @@ import { configureAliasing } from './dependency-map'; export const addons: PresetProperty<'addons', StorybookConfig> = [ dirname(require.resolve(join('@storybook/preset-react-webpack', 'package.json'))), - dirname(require.resolve(join('@storybook/builder-webpack5', 'package.json'))), ]; const defaultFrameworkOptions: FrameworkOptions = {}; From cd3ad1fb147f40ae4bbecbd5b72d17fe71b2ed1b Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 16:49:56 +0100 Subject: [PATCH 032/115] fix --- code/frameworks/nextjs/src/preset.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/code/frameworks/nextjs/src/preset.ts b/code/frameworks/nextjs/src/preset.ts index db1c276da9b4..fd726835293c 100644 --- a/code/frameworks/nextjs/src/preset.ts +++ b/code/frameworks/nextjs/src/preset.ts @@ -20,7 +20,6 @@ import { configureAliasing } from './dependency-map'; export const addons: PresetProperty<'addons', StorybookConfig> = [ dirname(require.resolve(join('@storybook/preset-react-webpack', 'package.json'))), - dirname(require.resolve(join('@storybook/builder-webpack5', 'package.json'))), ]; const defaultFrameworkOptions: FrameworkOptions = {}; From 88e116a86dd73191dfb8098174ce43bb0d13a790 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 16:59:43 +0100 Subject: [PATCH 033/115] remove need for prop-types in preact --- code/.eslintrc.js | 7 +++ code/renderers/preact/template/cli/Button.jsx | 45 ++++++------------- code/renderers/preact/template/cli/Header.jsx | 26 +++++------ code/renderers/preact/template/cli/Page.jsx | 3 ++ .../preact/template/components/Button.jsx | 15 +++---- .../preact/template/components/Form.jsx | 16 ++++--- .../preact/template/components/Html.jsx | 9 ---- .../preact/template/components/Pre.jsx | 23 +++------- .../preact/template/stories/React.js | 20 ++++----- 9 files changed, 65 insertions(+), 99 deletions(-) diff --git a/code/.eslintrc.js b/code/.eslintrc.js index 640a66f0bf1f..52ff255d8154 100644 --- a/code/.eslintrc.js +++ b/code/.eslintrc.js @@ -159,6 +159,13 @@ module.exports = { 'no-console': 'off', }, }, + { + files: ['**/renderers/preact/**/*'], + rules: { + 'react/react-in-jsx-scope': 'off', + 'react/prop-types': 'off', + }, + }, { files: ['**/*.tsx', '**/*.ts'], rules: { diff --git a/code/renderers/preact/template/cli/Button.jsx b/code/renderers/preact/template/cli/Button.jsx index eefda2bffe3f..9bcecb3710d7 100644 --- a/code/renderers/preact/template/cli/Button.jsx +++ b/code/renderers/preact/template/cli/Button.jsx @@ -1,10 +1,21 @@ -import PropTypes from 'prop-types'; import './button.css'; /** * Primary UI component for user interaction + * @param {object} props + * @param {string} [props.primary=false] + * @param {string} [props.backgroundColor] + * @param {('small' | 'medium' | 'large')} [props.size='medium'] + * @param {string} props.label + * @param {function} props.onClick */ -export const Button = ({ primary, backgroundColor, size, label, ...props }) => { +export const Button = ({ + primary = false, + backgroundColor = null, + size = 'medium', + label, + ...props +}) => { const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary'; return ( ); }; - -Button.propTypes = { - /** - * Is this the principal call to action on the page? - */ - primary: PropTypes.bool, - /** - * What background color to use - */ - backgroundColor: PropTypes.string, - /** - * How large should the button be? - */ - size: PropTypes.oneOf(['small', 'medium', 'large']), - /** - * Button contents - */ - label: PropTypes.string.isRequired, - /** - * Optional click handler - */ - onClick: PropTypes.func, -}; - -Button.defaultProps = { - backgroundColor: null, - primary: false, - size: 'medium', - onClick: undefined, -}; diff --git a/code/renderers/preact/template/cli/Header.jsx b/code/renderers/preact/template/cli/Header.jsx index 8a722e57d331..c87a04c4837e 100644 --- a/code/renderers/preact/template/cli/Header.jsx +++ b/code/renderers/preact/template/cli/Header.jsx @@ -1,9 +1,16 @@ -import PropTypes from 'prop-types'; - import { Button } from './Button'; import './header.css'; -export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => ( +/** + * Header component + * @param {object} props + * @param {object} [props.user] + * @param {string} props.user.name + * @param {function} props.onLogin + * @param {function} props.onLogout + * @param {function} props.onCreateAccount + */ +export const Header = ({ user = null, onLogin, onLogout, onCreateAccount }) => (
@@ -43,16 +50,3 @@ export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => (
); - -Header.propTypes = { - user: PropTypes.shape({ - name: PropTypes.string.isRequired, - }), - onLogin: PropTypes.func.isRequired, - onLogout: PropTypes.func.isRequired, - onCreateAccount: PropTypes.func.isRequired, -}; - -Header.defaultProps = { - user: null, -}; diff --git a/code/renderers/preact/template/cli/Page.jsx b/code/renderers/preact/template/cli/Page.jsx index 12ca119d0b04..a5bc82d9d105 100644 --- a/code/renderers/preact/template/cli/Page.jsx +++ b/code/renderers/preact/template/cli/Page.jsx @@ -2,6 +2,9 @@ import { useState } from 'preact/hooks'; import { Header } from './Header'; import './page.css'; +/** + * Simple page component + */ export const Page = () => { const [user, setUser] = useState(); diff --git a/code/renderers/preact/template/components/Button.jsx b/code/renderers/preact/template/components/Button.jsx index cd3c13987c32..e79f89f5d4b3 100644 --- a/code/renderers/preact/template/components/Button.jsx +++ b/code/renderers/preact/template/components/Button.jsx @@ -1,14 +1,11 @@ -/* eslint-disable react/react-in-jsx-scope */ -// eslint-disable-next-line import/no-extraneous-dependencies -import PropTypes from 'prop-types'; - +/** + * Button component + * @param {object} props + * @param {string} props.label + * @param {function} props.onClick + */ export const Button = ({ onClick, label }) => ( ); - -Button.propTypes = { - onClick: PropTypes.func.isRequired, - label: PropTypes.node.isRequired, -}; diff --git a/code/renderers/preact/template/components/Form.jsx b/code/renderers/preact/template/components/Form.jsx index fb58cbb10508..b2283d26ac10 100644 --- a/code/renderers/preact/template/components/Form.jsx +++ b/code/renderers/preact/template/components/Form.jsx @@ -1,8 +1,14 @@ -/* eslint-disable react/react-in-jsx-scope */ -// eslint-disable-next-line import/no-extraneous-dependencies -import PropTypes from 'prop-types'; import { useState } from 'preact/hooks'; +/** + * Header component + * @param {object} props + * @param {object} [props.user] + * @param {string} props.user.name + * @param {function} props.onLogin + * @param {function} props.onLogout + * @param {function} props.onCreateAccount + */ export const Form = ({ onSuccess }) => { const [value, setValue] = useState(''); const [complete, setComplete] = useState(false); @@ -32,7 +38,3 @@ export const Form = ({ onSuccess }) => { ); }; - -Form.propTypes = { - onSuccess: PropTypes.func.isRequired, -}; diff --git a/code/renderers/preact/template/components/Html.jsx b/code/renderers/preact/template/components/Html.jsx index 36cff8218890..b2c1f966f9e3 100644 --- a/code/renderers/preact/template/components/Html.jsx +++ b/code/renderers/preact/template/components/Html.jsx @@ -1,10 +1 @@ -/* eslint-disable react/react-in-jsx-scope */ -// eslint-disable-next-line import/no-extraneous-dependencies -import PropTypes from 'prop-types'; - -// eslint-disable-next-line react/no-danger export const Html = ({ content }) =>
; - -Html.propTypes = { - content: PropTypes.string.isRequired, -}; diff --git a/code/renderers/preact/template/components/Pre.jsx b/code/renderers/preact/template/components/Pre.jsx index 7efec93be9d6..3bf143581fac 100644 --- a/code/renderers/preact/template/components/Pre.jsx +++ b/code/renderers/preact/template/components/Pre.jsx @@ -1,21 +1,12 @@ -/* eslint-disable react/react-in-jsx-scope */ -// eslint-disable-next-line import/no-extraneous-dependencies -import PropTypes from 'prop-types'; - +/** + * Pre component + * @param {object} props + * @param {object} [props.style] + * @param {object} [props.object] + * @param {string} [props.text] + */ export const Pre = ({ style, object, text }) => (
     {object ? JSON.stringify(object, null, 2) : text}
   
); - -Pre.propTypes = { - style: PropTypes.shape({}), - object: PropTypes.shape({}), - text: PropTypes.string, -}; - -Pre.defaultProps = { - style: {}, - object: null, - text: '', -}; diff --git a/code/renderers/preact/template/stories/React.js b/code/renderers/preact/template/stories/React.js index 0c72668ebe74..1d1fa97c55d8 100644 --- a/code/renderers/preact/template/stories/React.js +++ b/code/renderers/preact/template/stories/React.js @@ -1,8 +1,11 @@ // eslint-disable-next-line import/no-extraneous-dependencies import React from 'react'; -// eslint-disable-next-line import/no-extraneous-dependencies -import PropTypes from 'prop-types'; +/** + * ReactFunctionalComponent component + * @param {object} props + * @param {string} props.label + */ export const ReactFunctionalComponent = ({ label }) => { const [clicks, setValue] = React.useState(0); return ( @@ -19,10 +22,11 @@ export const ReactFunctionalComponent = ({ label }) => { ); }; -ReactFunctionalComponent.propTypes = { - label: PropTypes.string.isRequired, -}; - +/** + * ReactClassComponent component + * @param {object} props + * @param {string} props.label + */ export class ReactClassComponent extends React.Component { state = { clicks: 0, @@ -45,7 +49,3 @@ export class ReactClassComponent extends React.Component { ); } } - -ReactClassComponent.propTypes = { - label: PropTypes.string.isRequired, -}; From 1aa38f529e43bc2f2f16c50d0030f282e9a02ef6 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 19:53:59 +0100 Subject: [PATCH 034/115] filter all addons away when removeAllAddons is true --- code/lib/core-common/src/presets.ts | 24 +++++++++++++++---- code/lib/core-server/src/build-static.ts | 3 +++ .../core-server/src/presets/common-preset.ts | 4 +++- code/lib/types/src/modules/core-common.ts | 18 +++++++++----- 4 files changed, 37 insertions(+), 12 deletions(-) diff --git a/code/lib/core-common/src/presets.ts b/code/lib/core-common/src/presets.ts index 0d1de949aa7c..5d838ecdcbc8 100644 --- a/code/lib/core-common/src/presets.ts +++ b/code/lib/core-common/src/presets.ts @@ -9,6 +9,7 @@ import type { LoadOptions, PresetConfig, Presets, + StorybookConfig, } from '@storybook/types'; import { join, parse } from 'path'; import { CriticalPresetLoadError } from '@storybook/core-events/server-errors'; @@ -17,6 +18,13 @@ import { safeResolve, safeResolveFrom } from './utils/safeResolve'; import { interopRequireDefault } from './utils/interpret-require'; import { stripAbsNodeModulesPath } from './utils/strip-abs-node-modules-path'; +type InterPresetOptions = Omit< + CLIOptions & + LoadOptions & + BuilderOptions & { isCritical?: boolean; build?: StorybookConfig['build'] }, + 'frameworkPresets' +>; + const isObject = (val: unknown): val is Record => val != null && typeof val === 'object' && Array.isArray(val) === false; const isFunction = (val: unknown): val is Function => typeof val === 'function'; @@ -241,6 +249,16 @@ export async function loadPreset( if (isObject(contents)) { const { addons: addonsInput, presets: presetsInput, ...rest } = contents; + if (storybookOptions.isCritical !== true && storybookOptions.build?.test?.removeAllAddons) { + return [ + { + name: presetName, + preset: rest, + options: presetOptions, + }, + ]; + } + const subPresets = resolvePresetFunction(presetsInput, presetOptions, storybookOptions); const subAddons = resolvePresetFunction(addonsInput, presetOptions, storybookOptions); @@ -354,11 +372,6 @@ function applyPresets( }, presetResult); } -type InterPresetOptions = Omit< - CLIOptions & LoadOptions & BuilderOptions & { isCritical?: boolean }, - 'frameworkPresets' ->; - export async function getPresets( presets: PresetConfig[], storybookOptions: InterPresetOptions @@ -379,6 +392,7 @@ export async function loadAllPresets( overridePresets: PresetConfig[]; /** Whether preset failures should be critical or not */ isCritical?: boolean; + build?: StorybookConfig['build']; } ) { const { corePresets = [], overridePresets = [], ...restOptions } = options; diff --git a/code/lib/core-server/src/build-static.ts b/code/lib/core-server/src/build-static.ts index 55dc59fbaac1..ee546c0df89c 100644 --- a/code/lib/core-server/src/build-static.ts +++ b/code/lib/core-server/src/build-static.ts @@ -94,6 +94,8 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption const [previewBuilder, managerBuilder] = await getBuilders({ ...options, presets }); const { renderer } = await presets.apply('core', {}); + const build = await presets.apply('build', {}); + const resolvedRenderer = renderer ? resolveAddonName(options.configDir, renderer, options) : undefined; @@ -111,6 +113,7 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption require.resolve('@storybook/core-server/dist/presets/common-override-preset'), ], ...options, + build, }); const [features, core, staticDirs, indexers, deprecatedStoryIndexers, stories, docsOptions] = diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts index 6049d81a4f4e..a571938e6e33 100644 --- a/code/lib/core-server/src/presets/common-preset.ts +++ b/code/lib/core-server/src/presets/common-preset.ts @@ -11,6 +11,7 @@ import { import type { CLIOptions, CoreConfig, + FastBuildFlags, Indexer, Options, PresetPropertyFn, @@ -185,8 +186,9 @@ export const previewAnnotations = async (base: any, options: Options) => { return [...config, ...base]; }; -const testBuildFeatures = (value: boolean) => ({ +const testBuildFeatures = (value: boolean): Required => ({ emptyBlocks: value, + removeAllAddons: value, }); export const features = async ( diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index 69362b192896..8137150c6313 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -257,6 +257,17 @@ export type DocsOptions = { docsMode?: boolean; }; +export interface FastBuildFlags { + /** + * Globalize @storybook/blocks + */ + emptyBlocks?: boolean; + /** + * Globalize @storybook/blocks + */ + removeAllAddons?: boolean; +} + /** * The interface for Storybook configuration in `main.ts` files. */ @@ -315,12 +326,7 @@ export interface StorybookConfig { }; build?: { - test?: { - /** - * Globalize @storybook/blocks - */ - emptyBlocks?: boolean; - }; + test?: FastBuildFlags; }; /** From be98047846a9348fab7a7167388ee1dd4f057987 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 20:56:04 +0100 Subject: [PATCH 035/115] add flag for skipping mdx stories --- .../src/presets/common-override-preset.ts | 28 +++++++++++++++++++ .../core-server/src/presets/common-preset.ts | 5 ++-- code/lib/types/src/modules/core-common.ts | 21 ++++++++++---- 3 files changed, 46 insertions(+), 8 deletions(-) diff --git a/code/lib/core-server/src/presets/common-override-preset.ts b/code/lib/core-server/src/presets/common-override-preset.ts index 55a55bb0f117..a6ea7434949e 100644 --- a/code/lib/core-server/src/presets/common-override-preset.ts +++ b/code/lib/core-server/src/presets/common-override-preset.ts @@ -1,4 +1,8 @@ import type { PresetProperty, StorybookConfig } from '@storybook/types'; +import { normalizeStories, commonGlobOptions } from '@storybook/core-common'; +import { isAbsolute, join } from 'path'; +import slash from 'slash'; +import { glob } from 'glob'; export const framework: PresetProperty<'framework', StorybookConfig> = async (config) => { // This will get called with the values from the user's main config, but before @@ -12,3 +16,27 @@ export const framework: PresetProperty<'framework', StorybookConfig> = async (co options, }; }; + +export const stories: PresetProperty<'stories', StorybookConfig> = async (entries, options) => { + if (options.build.test?.removeMDXEntries) { + const out = ( + await Promise.all( + normalizeStories(entries, { + configDir: options.configDir, + workingDir: options.configDir, + }).map(({ directory, files }) => { + const pattern = join(directory, files); + const absolutePattern = isAbsolute(pattern) ? pattern : join(options.configDir, pattern); + + return glob(slash(absolutePattern), { + ...commonGlobOptions(absolutePattern), + follow: true, + }); + }) + ) + ).reduce((carry, s) => carry.concat(s), []); + + return out.filter((s) => !s.endsWith('.mdx')); + } + return entries; +}; diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts index a571938e6e33..51d68bce2537 100644 --- a/code/lib/core-server/src/presets/common-preset.ts +++ b/code/lib/core-server/src/presets/common-preset.ts @@ -11,7 +11,7 @@ import { import type { CLIOptions, CoreConfig, - FastBuildFlags, + TestBuildFlags, Indexer, Options, PresetPropertyFn, @@ -186,9 +186,10 @@ export const previewAnnotations = async (base: any, options: Options) => { return [...config, ...base]; }; -const testBuildFeatures = (value: boolean): Required => ({ +const testBuildFeatures = (value: boolean): Required => ({ emptyBlocks: value, removeAllAddons: value, + removeMDXEntries: value, }); export const features = async ( diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index 8137150c6313..9c9860fc18c2 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -180,7 +180,10 @@ export interface StorybookConfigOptions { presetsList?: LoadedPreset[]; } -export type Options = LoadOptions & StorybookConfigOptions & CLIOptions & BuilderOptions; +export type Options = LoadOptions & + StorybookConfigOptions & + CLIOptions & + BuilderOptions & { build: TestBuildConfig }; export interface Builder { getConfig: (options: Options) => Promise; @@ -257,15 +260,23 @@ export type DocsOptions = { docsMode?: boolean; }; -export interface FastBuildFlags { +export interface TestBuildFlags { /** * Globalize @storybook/blocks */ emptyBlocks?: boolean; /** - * Globalize @storybook/blocks + * disable all addons */ removeAllAddons?: boolean; + /** + * Remove .mdx stories entries + */ + removeMDXEntries?: boolean; +} + +export interface TestBuildConfig { + test?: TestBuildFlags; } /** @@ -325,9 +336,7 @@ export interface StorybookConfig { legacyDecoratorFileOrder?: boolean; }; - build?: { - test?: FastBuildFlags; - }; + build?: TestBuildConfig; /** * Tells Storybook where to find stories. From 7a00cb2d486746e1554242d8e46177e95d889f78 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 2 Nov 2023 21:10:04 +0100 Subject: [PATCH 036/115] fixes --- code/lib/core-server/src/build-static.ts | 3 ++- code/lib/core-server/src/presets/common-override-preset.ts | 2 +- code/lib/types/src/modules/core-common.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/lib/core-server/src/build-static.ts b/code/lib/core-server/src/build-static.ts index ee546c0df89c..8bc7cce27bd0 100644 --- a/code/lib/core-server/src/build-static.ts +++ b/code/lib/core-server/src/build-static.ts @@ -92,9 +92,9 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption ...options, }); - const [previewBuilder, managerBuilder] = await getBuilders({ ...options, presets }); const { renderer } = await presets.apply('core', {}); const build = await presets.apply('build', {}); + const [previewBuilder, managerBuilder] = await getBuilders({ ...options, presets, build }); const resolvedRenderer = renderer ? resolveAddonName(options.configDir, renderer, options) @@ -138,6 +138,7 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption ...options, presets, features, + build, }; if (options.staticDir && !isEqual(staticDirs, defaultStaticDirs)) { diff --git a/code/lib/core-server/src/presets/common-override-preset.ts b/code/lib/core-server/src/presets/common-override-preset.ts index a6ea7434949e..10ed9967fa58 100644 --- a/code/lib/core-server/src/presets/common-override-preset.ts +++ b/code/lib/core-server/src/presets/common-override-preset.ts @@ -18,7 +18,7 @@ export const framework: PresetProperty<'framework', StorybookConfig> = async (co }; export const stories: PresetProperty<'stories', StorybookConfig> = async (entries, options) => { - if (options.build.test?.removeMDXEntries) { + if (options?.build?.test?.removeMDXEntries) { const out = ( await Promise.all( normalizeStories(entries, { diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index 9c9860fc18c2..ce6ee3e0856d 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -183,7 +183,7 @@ export interface StorybookConfigOptions { export type Options = LoadOptions & StorybookConfigOptions & CLIOptions & - BuilderOptions & { build: TestBuildConfig }; + BuilderOptions & { build?: TestBuildConfig }; export interface Builder { getConfig: (options: Options) => Promise; From 1a90573a130b6565ecf782d34760b1fc7b5978ff Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Fri, 3 Nov 2023 09:44:10 +0100 Subject: [PATCH 037/115] Keep known globals as type, but allow extension --- code/lib/preview/src/globals/types.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/lib/preview/src/globals/types.ts b/code/lib/preview/src/globals/types.ts index 40ed603cd598..176d4582833d 100644 --- a/code/lib/preview/src/globals/types.ts +++ b/code/lib/preview/src/globals/types.ts @@ -1,5 +1,6 @@ // Here we map the name of a module to their NAME in the global scope. -export const globals = { +// eslint-disable-next-line @typescript-eslint/naming-convention,no-underscore-dangle +const _globals = { '@storybook/addons': '__STORYBOOK_MODULE_ADDONS__', '@storybook/global': '__STORYBOOK_MODULE_GLOBAL__', '@storybook/channel-postmessage': '__STORYBOOK_MODULE_CHANNEL_POSTMESSAGE__', // @deprecated: remove in 8.0 @@ -13,3 +14,5 @@ export const globals = { '@storybook/preview-api': '__STORYBOOK_MODULE_PREVIEW_API__', '@storybook/store': '__STORYBOOK_MODULE_STORE__', }; + +export const globals: typeof _globals & Record = _globals; From ebd4fa6083a1ffc628ecf040d9db40a565ca5c85 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Fri, 3 Nov 2023 10:06:52 +0100 Subject: [PATCH 038/115] Upload test build to chromatic --- code/lib/cli/src/sandbox-templates.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/lib/cli/src/sandbox-templates.ts b/code/lib/cli/src/sandbox-templates.ts index 2dd4edb620f9..7047dc138e16 100644 --- a/code/lib/cli/src/sandbox-templates.ts +++ b/code/lib/cli/src/sandbox-templates.ts @@ -568,7 +568,7 @@ const benchTemplates = { skipTemplateStories: true, testBuild: true, }, - skipTasks: ['e2e-tests-dev', 'test-runner', 'test-runner-dev', 'e2e-tests', 'chromatic'], + skipTasks: ['e2e-tests-dev', 'test-runner', 'test-runner-dev', 'e2e-tests'], }, 'bench/react-webpack-18-ts-test-build': { ...baseTemplates['react-webpack/18-ts'], @@ -578,7 +578,7 @@ const benchTemplates = { skipTemplateStories: true, testBuild: true, }, - skipTasks: ['e2e-tests-dev', 'test-runner', 'test-runner-dev', 'e2e-tests', 'chromatic'], + skipTasks: ['e2e-tests-dev', 'test-runner', 'test-runner-dev', 'e2e-tests'], }, } satisfies Record; From 5c51f63c075fb4ffd7da248f31bf987e1b269787 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Fri, 3 Nov 2023 10:08:58 +0100 Subject: [PATCH 039/115] Update parallelism --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b7266a42c698..af3484641b13 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -507,7 +507,7 @@ workflows: requires: - create-sandboxes - chromatic-sandboxes: - parallelism: 9 + parallelism: 11 requires: - build-sandboxes - e2e-production: @@ -563,7 +563,7 @@ workflows: requires: - create-sandboxes - chromatic-sandboxes: - parallelism: 18 + parallelism: 20 requires: - build-sandboxes - e2e-production: @@ -620,7 +620,7 @@ workflows: requires: - create-sandboxes - chromatic-sandboxes: - parallelism: 33 + parallelism: 35 requires: - build-sandboxes - e2e-production: From 1c70ab25cb87df1c19e865360a51663cae1d31e3 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 3 Nov 2023 11:11:55 +0100 Subject: [PATCH 040/115] fix --- code/lib/preview/src/globals/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/preview/src/globals/types.ts b/code/lib/preview/src/globals/types.ts index 40ed603cd598..d3ff2b5c1e20 100644 --- a/code/lib/preview/src/globals/types.ts +++ b/code/lib/preview/src/globals/types.ts @@ -12,4 +12,4 @@ export const globals = { '@storybook/preview-web': '__STORYBOOK_MODULE_PREVIEW_WEB__', '@storybook/preview-api': '__STORYBOOK_MODULE_PREVIEW_API__', '@storybook/store': '__STORYBOOK_MODULE_STORE__', -}; +} as const; From 7c7661ad5f88fe7d1d18a27c71977ff2ff8b56e6 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Fri, 3 Nov 2023 11:41:12 +0100 Subject: [PATCH 041/115] Rollback my type fix, but also remove the ts-expect-errors --- code/builders/builder-vite/src/vite-config.ts | 1 - .../builder-webpack5/src/preview/iframe-webpack.config.ts | 1 - code/lib/preview/src/globals/types.ts | 7 +++++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/code/builders/builder-vite/src/vite-config.ts b/code/builders/builder-vite/src/vite-config.ts index 7bf7f0356a39..5274248afa80 100644 --- a/code/builders/builder-vite/src/vite-config.ts +++ b/code/builders/builder-vite/src/vite-config.ts @@ -80,7 +80,6 @@ export async function pluginConfig(options: Options) { const build = await options.presets.apply('build'); if (build?.test?.emptyBlocks) { - // @ts-expect-error (force add empty blocks module) globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index d4a34a5ecdb9..e34cb0d70ef1 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -220,7 +220,6 @@ export default async ( } if (build?.test?.emptyBlocks) { - // @ts-expect-error (force add empty blocks module) globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } diff --git a/code/lib/preview/src/globals/types.ts b/code/lib/preview/src/globals/types.ts index d3ff2b5c1e20..176d4582833d 100644 --- a/code/lib/preview/src/globals/types.ts +++ b/code/lib/preview/src/globals/types.ts @@ -1,5 +1,6 @@ // Here we map the name of a module to their NAME in the global scope. -export const globals = { +// eslint-disable-next-line @typescript-eslint/naming-convention,no-underscore-dangle +const _globals = { '@storybook/addons': '__STORYBOOK_MODULE_ADDONS__', '@storybook/global': '__STORYBOOK_MODULE_GLOBAL__', '@storybook/channel-postmessage': '__STORYBOOK_MODULE_CHANNEL_POSTMESSAGE__', // @deprecated: remove in 8.0 @@ -12,4 +13,6 @@ export const globals = { '@storybook/preview-web': '__STORYBOOK_MODULE_PREVIEW_WEB__', '@storybook/preview-api': '__STORYBOOK_MODULE_PREVIEW_API__', '@storybook/store': '__STORYBOOK_MODULE_STORE__', -} as const; +}; + +export const globals: typeof _globals & Record = _globals; From cadd99331e7a86060b68ea4bead15e2252f0cfc9 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 3 Nov 2023 12:20:57 +0100 Subject: [PATCH 042/115] add flag to remove autodocs entries --- code/lib/core-server/src/build-static.ts | 1 + code/lib/core-server/src/presets/common-preset.ts | 1 + code/lib/core-server/src/utils/StoryIndexGenerator.ts | 4 +++- code/lib/types/src/modules/core-common.ts | 4 ++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/code/lib/core-server/src/build-static.ts b/code/lib/core-server/src/build-static.ts index 8bc7cce27bd0..64ea764678e2 100644 --- a/code/lib/core-server/src/build-static.ts +++ b/code/lib/core-server/src/build-static.ts @@ -182,6 +182,7 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption docs: docsOptions, storiesV2Compatibility: !features?.storyStoreV7, storyStoreV7: !!features?.storyStoreV7, + build, }); initializedStoryIndexGenerator = generator.initialize().then(() => generator); diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts index 51d68bce2537..6d40c082d5db 100644 --- a/code/lib/core-server/src/presets/common-preset.ts +++ b/code/lib/core-server/src/presets/common-preset.ts @@ -190,6 +190,7 @@ const testBuildFeatures = (value: boolean): Required => ({ emptyBlocks: value, removeAllAddons: value, removeMDXEntries: value, + removeAutoDocs: value, }); export const features = async ( diff --git a/code/lib/core-server/src/utils/StoryIndexGenerator.ts b/code/lib/core-server/src/utils/StoryIndexGenerator.ts index 0f847b8917a1..2ecd774528b7 100644 --- a/code/lib/core-server/src/utils/StoryIndexGenerator.ts +++ b/code/lib/core-server/src/utils/StoryIndexGenerator.ts @@ -22,6 +22,7 @@ import type { Indexer, IndexerOptions, DeprecatedIndexer, + StorybookConfig, } from '@storybook/types'; import { userOrAutoTitleFromSpecifier, sortStoriesV7 } from '@storybook/preview-api'; import { commonGlobOptions, normalizeStoryPath } from '@storybook/core-common'; @@ -58,6 +59,7 @@ export type StoryIndexGeneratorOptions = { storyIndexers: StoryIndexer[]; indexers: Indexer[]; docs: DocsOptions; + build?: StorybookConfig['build']; }; export const AUTODOCS_TAG = 'autodocs'; @@ -335,7 +337,7 @@ export class StoryIndexGenerator { const createDocEntry = autodocs === true || (autodocs === 'tag' && hasAutodocsTag) || isStoriesMdx; - if (createDocEntry) { + if (createDocEntry && this.options.build?.test?.removeAutoDocs !== true) { const name = this.options.docs.defaultName ?? 'Docs'; const { metaId } = indexInputs[0]; const { title } = entries[0]; diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index ce6ee3e0856d..fd90146f76b0 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -273,6 +273,10 @@ export interface TestBuildFlags { * Remove .mdx stories entries */ removeMDXEntries?: boolean; + /** + * Remove autodocs + */ + removeAutoDocs?: boolean; } export interface TestBuildConfig { From 20ce118ea7ade9840e8000628d67d184b8c97671 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 3 Nov 2023 13:26:11 +0100 Subject: [PATCH 043/115] add fault-tolerant catches for getSize --- scripts/task.ts | 2 +- scripts/tasks/build.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/task.ts b/scripts/task.ts index 897957653413..c78d4c4abdf1 100644 --- a/scripts/task.ts +++ b/scripts/task.ts @@ -472,7 +472,7 @@ async function run() { logger.error(`Error running task ${getTaskKey(task)}:`); // If it is the last task, we don't need to log the full trace if (task === finalTask) { - logger.error(err.message); + logger.error(err.stack || err.message || err); } else { logger.error(err); } diff --git a/scripts/tasks/build.ts b/scripts/tasks/build.ts index 099a98ee1a90..58cb98765b48 100644 --- a/scripts/tasks/build.ts +++ b/scripts/tasks/build.ts @@ -24,11 +24,11 @@ export const build: Task = { const buildTime = now() - start; const dir = join(sandboxDir, 'storybook-static'); const getSize = promisify(dirSize); - const buildSize = await getSize(dir); - const buildSbAddonsSize = await getSize(join(dir, 'sb-addons')); - const buildSbCommonSize = await getSize(join(dir, 'sb-common-assets')); - const buildSbManagerSize = await getSize(join(dir, 'sb-manager')); - const buildSbPreviewSize = await getSize(join(dir, 'sb-preview')); + const buildSize = await getSize(dir).catch(() => 0); + const buildSbAddonsSize = await getSize(join(dir, 'sb-addons')).catch(() => 0); + const buildSbCommonSize = await getSize(join(dir, 'sb-common-assets')).catch(() => 0); + const buildSbManagerSize = await getSize(join(dir, 'sb-manager')).catch(() => 0); + const buildSbPreviewSize = await getSize(join(dir, 'sb-preview')).catch(() => 0); const buildPrebuildSize = buildSbAddonsSize + buildSbCommonSize + buildSbManagerSize + buildSbPreviewSize; From 0004278dbfe935bbad0a42498d0e1a54b29f3776 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 3 Nov 2023 13:30:33 +0100 Subject: [PATCH 044/115] better logging --- scripts/task.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/task.ts b/scripts/task.ts index c78d4c4abdf1..20dad32716c3 100644 --- a/scripts/task.ts +++ b/scripts/task.ts @@ -470,12 +470,7 @@ async function run() { } catch (err) { invariant(err instanceof Error); logger.error(`Error running task ${getTaskKey(task)}:`); - // If it is the last task, we don't need to log the full trace - if (task === finalTask) { - logger.error(err.stack || err.message || err); - } else { - logger.error(err); - } + logger.error(JSON.stringify(err, null, 2)); if (process.env.CI) { logger.error( From c596b98d5e75499012a7c9694309e56b195f76f1 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 3 Nov 2023 14:02:18 +0100 Subject: [PATCH 045/115] fix event-log-checker --- scripts/event-log-checker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/event-log-checker.ts b/scripts/event-log-checker.ts index e1f6d82bd533..a9e321c5aed8 100644 --- a/scripts/event-log-checker.ts +++ b/scripts/event-log-checker.ts @@ -70,7 +70,8 @@ async function run() { 8, `Expected 8 stories but received ${exampleStoryCount} instead.` ); - const expectedDocsCount = template.modifications?.disableDocs ? 0 : 3; + const expectedDocsCount = + template.modifications?.disableDocs || template.modifications.testBuild ? 0 : 3; assert.equal( exampleDocsCount, expectedDocsCount, From a0c1a5f010312ac227ef92e5a7200db418ad212a Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 3 Nov 2023 14:05:53 +0100 Subject: [PATCH 046/115] fix event-log-checker --- scripts/event-log-checker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/event-log-checker.ts b/scripts/event-log-checker.ts index e1f6d82bd533..a9e321c5aed8 100644 --- a/scripts/event-log-checker.ts +++ b/scripts/event-log-checker.ts @@ -70,7 +70,8 @@ async function run() { 8, `Expected 8 stories but received ${exampleStoryCount} instead.` ); - const expectedDocsCount = template.modifications?.disableDocs ? 0 : 3; + const expectedDocsCount = + template.modifications?.disableDocs || template.modifications.testBuild ? 0 : 3; assert.equal( exampleDocsCount, expectedDocsCount, From 37ce1cdcc70f2953c6841c80a888ae115a987d20 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 3 Nov 2023 14:24:05 +0100 Subject: [PATCH 047/115] fix --- scripts/event-log-checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/event-log-checker.ts b/scripts/event-log-checker.ts index a9e321c5aed8..eabfd8d9a209 100644 --- a/scripts/event-log-checker.ts +++ b/scripts/event-log-checker.ts @@ -71,7 +71,7 @@ async function run() { `Expected 8 stories but received ${exampleStoryCount} instead.` ); const expectedDocsCount = - template.modifications?.disableDocs || template.modifications.testBuild ? 0 : 3; + template.modifications?.disableDocs || template.modifications?.testBuild ? 0 : 3; assert.equal( exampleDocsCount, expectedDocsCount, From 4ea32f36fedc73b276bc2fb71be3a87bcf0ea600 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 3 Nov 2023 14:24:16 +0100 Subject: [PATCH 048/115] Discard changes to scripts/event-log-checker.ts --- scripts/event-log-checker.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/event-log-checker.ts b/scripts/event-log-checker.ts index a9e321c5aed8..e1f6d82bd533 100644 --- a/scripts/event-log-checker.ts +++ b/scripts/event-log-checker.ts @@ -70,8 +70,7 @@ async function run() { 8, `Expected 8 stories but received ${exampleStoryCount} instead.` ); - const expectedDocsCount = - template.modifications?.disableDocs || template.modifications.testBuild ? 0 : 3; + const expectedDocsCount = template.modifications?.disableDocs ? 0 : 3; assert.equal( exampleDocsCount, expectedDocsCount, From 1d9cc8282f7776a919f83fea1b47b4877857c791 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 3 Nov 2023 14:30:32 +0100 Subject: [PATCH 049/115] fix --- code/renderers/preact/template/stories/react-compat.stories.js | 1 - 1 file changed, 1 deletion(-) diff --git a/code/renderers/preact/template/stories/react-compat.stories.js b/code/renderers/preact/template/stories/react-compat.stories.js index b7895c1e8d0f..33f1078d3154 100644 --- a/code/renderers/preact/template/stories/react-compat.stories.js +++ b/code/renderers/preact/template/stories/react-compat.stories.js @@ -1,4 +1,3 @@ -/* eslint-disable react/react-in-jsx-scope */ import { ReactFunctionalComponent, ReactClassComponent } from './React'; export default { From 232610082e8a6462ec7190ffdcd0644daddcf169 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Fri, 3 Nov 2023 15:35:16 +0100 Subject: [PATCH 050/115] Disable docgen --- .../src/presets/common-override-preset.ts | 7 +++++++ code/lib/core-server/src/presets/common-preset.ts | 1 + code/lib/types/src/modules/core-common.ts | 12 ++++++++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/code/lib/core-server/src/presets/common-override-preset.ts b/code/lib/core-server/src/presets/common-override-preset.ts index 10ed9967fa58..eb1eae542400 100644 --- a/code/lib/core-server/src/presets/common-override-preset.ts +++ b/code/lib/core-server/src/presets/common-override-preset.ts @@ -40,3 +40,10 @@ export const stories: PresetProperty<'stories', StorybookConfig> = async (entrie } return entries; }; + +export const typescript: PresetProperty<'typescript', StorybookConfig> = async (input, options) => { + if (options?.build?.test?.disableDocgen) { + return { ...(input ?? {}), reactDocgen: false, check: false }; + } + return input; +}; diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts index 6d40c082d5db..a0042cb09063 100644 --- a/code/lib/core-server/src/presets/common-preset.ts +++ b/code/lib/core-server/src/presets/common-preset.ts @@ -191,6 +191,7 @@ const testBuildFeatures = (value: boolean): Required => ({ removeAllAddons: value, removeMDXEntries: value, removeAutoDocs: value, + disableDocgen: value, }); export const features = async ( diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index fd90146f76b0..f0aca6e884ee 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -262,21 +262,25 @@ export type DocsOptions = { export interface TestBuildFlags { /** - * Globalize @storybook/blocks + * The package @storybook/blocks will be excluded from the bundle, even when imported in e.g. the preview. */ emptyBlocks?: boolean; /** - * disable all addons + * Disable all addons */ removeAllAddons?: boolean; /** - * Remove .mdx stories entries + * Filter out .mdx stories entries */ removeMDXEntries?: boolean; /** - * Remove autodocs + * Override autodocs to be disabled */ removeAutoDocs?: boolean; + /** + * Override docgen to be disabled. + */ + disableDocgen?: boolean; } export interface TestBuildConfig { From 3fd600009e1d8be83b99ebe53f974cf0082c9c19 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Fri, 3 Nov 2023 15:42:08 +0100 Subject: [PATCH 051/115] Only verify templates for non-benchmarks sandboxes --- .circleci/config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index af3484641b13..6bf65d75ed68 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -330,7 +330,12 @@ jobs: command: yarn task --task build --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task build) --no-link --start-from=never --junit - run: name: Verifying Telemetry - command: yarn ts-node ./event-log-checker build $(yarn get-template --cadence << pipeline.parameters.workflow >> --task build) + command: | + TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task build) + if [[ $TEMPLATE != bench/* ]] + then + yarn ts-node ./event-log-checker build $TEMPLATE + fi working_directory: scripts - report-workflow-on-failure: template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task build) From b52d3c1e72a5d872a8ac187c7e712574602c7cb9 Mon Sep 17 00:00:00 2001 From: Shaun Lloyd Date: Fri, 3 Nov 2023 13:05:44 -0400 Subject: [PATCH 052/115] Replace aside with new Callout --- docs/addons/addon-knowledge-base.md | 12 +++-- docs/addons/addon-migration-guide.md | 4 +- docs/addons/addon-types.md | 10 ++-- docs/addons/addons-api.md | 14 +++--- docs/addons/install-addons.md | 20 +++++--- docs/addons/integration-catalog.md | 12 +++-- docs/addons/writing-addons.md | 12 ++--- docs/api/arg-types.md | 12 ++--- docs/api/cli-options.md | 18 ++++--- docs/api/csf.md | 6 +-- docs/api/doc-block-argtypes.md | 6 +-- docs/api/doc-block-canvas.md | 12 ++--- docs/api/doc-block-controls.md | 18 +++---- docs/api/doc-block-meta.md | 18 +++---- docs/api/doc-block-source.md | 12 ++--- docs/api/doc-block-stories.md | 6 +-- docs/api/doc-block-story.md | 4 +- docs/api/doc-block-unstyled.md | 12 ++--- docs/api/main-config-babel-default.md | 6 +-- docs/api/main-config-babel.md | 6 +-- docs/api/main-config-core.md | 6 +-- docs/api/main-config-indexers.md | 6 +-- docs/api/main-config-manager-head.md | 6 +-- docs/api/main-config-preview-annotations.md | 6 +-- docs/api/main-config-preview-body.md | 6 +-- docs/api/main-config-preview-head.md | 6 +-- docs/api/main-config-stories.md | 12 ++--- docs/builders/vite.md | 6 +-- docs/builders/webpack.md | 7 +-- docs/configure/babel.md | 10 ++-- docs/configure/environment-variables.md | 24 +++++---- docs/configure/overview.md | 10 ++-- docs/configure/story-rendering.md | 8 +-- docs/configure/telemetry.md | 6 +-- docs/configure/theming.md | 22 ++++---- docs/configure/typescript.md | 6 +-- docs/configure/upgrading.md | 8 +-- docs/configure/webpack.md | 16 +++--- docs/contribute/code.md | 30 +++++------ docs/contribute/how-to-reproduce.md | 22 ++++---- docs/contribute/new-snippets.md | 16 +++--- docs/essentials/actions.md | 6 +-- docs/essentials/controls.md | 32 ++++++------ docs/essentials/highlight.md | 12 ++--- docs/essentials/interactions.md | 12 ++--- docs/essentials/introduction.md | 6 +-- docs/essentials/measure-and-outline.md | 8 +-- docs/essentials/toolbars-and-globals.md | 24 ++++----- docs/faq.md | 29 +++++++---- docs/get-started/install.md | 10 ++-- docs/get-started/why-storybook.md | 2 +- docs/sharing/design-integrations.md | 8 +-- docs/sharing/package-composition.md | 4 +- docs/sharing/publish-storybook.md | 18 +++---- docs/sharing/storybook-composition.md | 32 ++++++------ docs/writing-docs/autodocs.md | 24 ++++----- docs/writing-docs/doc-blocks.md | 26 +++++----- docs/writing-docs/mdx.md | 50 ++++++++++--------- docs/writing-stories/args.md | 20 ++++---- .../build-pages-with-storybook.md | 22 ++++---- docs/writing-stories/decorators.md | 8 +-- docs/writing-stories/introduction.md | 26 ++++++---- .../naming-components-and-hierarchy.md | 6 +-- docs/writing-stories/play-function.md | 14 +++--- .../stories-for-multiple-components.md | 4 +- docs/writing-stories/typescript.md | 6 +-- docs/writing-tests/accessibility-testing.md | 6 +-- docs/writing-tests/interaction-testing.md | 6 +-- docs/writing-tests/snapshot-testing.md | 22 ++++---- .../stories-in-end-to-end-tests.md | 15 +++--- docs/writing-tests/stories-in-unit-tests.md | 12 ++--- docs/writing-tests/test-runner.md | 38 +++++++------- docs/writing-tests/visual-testing.md | 12 +++-- node_modules/.yarn-state.yml | 10 ---- 74 files changed, 531 insertions(+), 458 deletions(-) delete mode 100644 node_modules/.yarn-state.yml diff --git a/docs/addons/addon-knowledge-base.md b/docs/addons/addon-knowledge-base.md index 83f8d850d532..11cdfe497464 100644 --- a/docs/addons/addon-knowledge-base.md +++ b/docs/addons/addon-knowledge-base.md @@ -78,9 +78,11 @@ Complementing the components, also included is a set of UI primitives. Use the c | Icon | [See implementation](https://github.com/storybookjs/storybook/blob/main/code/ui/components/src/icon/icons.tsx) | [See story](https://main--5a375b97f4b14f0020b0cda3.chromatic.com/?path=/story/basics-icon--labels) | | Typography | [See implementation](https://github.com/storybookjs/storybook/tree/master/code/ui/components/src/typography) | [See story](https://main--5a375b97f4b14f0020b0cda3.chromatic.com/?path=/story/basics-typography--all) | -
+ + The color palette implemented by @storybook/components is a high-level abstraction of the @storybook/theming package. -
+ + ### Build system @@ -94,9 +96,11 @@ When you're developing your addon as a package, you can’t use `npm link` to ad } ``` -
+ + Run either yarn or npm install to install the addon. -
+ + ### Hot module replacement diff --git a/docs/addons/addon-migration-guide.md b/docs/addons/addon-migration-guide.md index f3e8b78a4812..8a7bd08c7470 100644 --- a/docs/addons/addon-migration-guide.md +++ b/docs/addons/addon-migration-guide.md @@ -4,11 +4,11 @@ title: Addon migration guide for Storybook 7.0 Storybook 7 is our first major release in over two years. While Storybook’s addon API has not changed much in the past couple of years, addons require several changes for compatibility with Storybook 7. This guide will walk you through the upgrade process. -
+ As we gather feedback from the community, we’ll update this page. We also have a general [Storybook migration guide](../migration-guide.md) if you’re looking for that. -
+ ## Dependencies diff --git a/docs/addons/addon-types.md b/docs/addons/addon-types.md index 8bb21021496d..d76edca7c7d6 100644 --- a/docs/addons/addon-types.md +++ b/docs/addons/addon-types.md @@ -44,11 +44,11 @@ Use this boilerplate code to add a new `button` to Storybook's Toolbar: -
+ The icon element used in the example loads the icons from the @storybook/components package. See [here](../faq.md#what-icons-are-available-for-my-toolbar-or-my-addon) for the list of available icons that you can use. -
+ ### Tabs @@ -68,9 +68,11 @@ Use this boilerplate code to add a new `Tab` to Storybook's UI: -
+ + Learn how to write your own addon that includes these UI elements here. -
+ + ## Preset addons diff --git a/docs/addons/addons-api.md b/docs/addons/addons-api.md index 17c05b0a50d5..42a3ccdbc24d 100644 --- a/docs/addons/addons-api.md +++ b/docs/addons/addons-api.md @@ -39,9 +39,11 @@ The `add` method allows you to register the type of UI component associated with -
-ℹ️ The render function is called with `active` and `key`. The `active` value will be true when the panel is focused on the UI. -
+ + +The render function is called with `active` and `key`. The `active` value will be true when the panel is focused on the UI. + + ### addons.register() @@ -89,11 +91,11 @@ Use the `makeDecorator` API to create decorators in the style of the official ad -
+ -ℹ️ If the story's parameters include `{ exampleParameter: { disable: true } }` (where `exampleParameter` is the `parameterName` of your addon), your decorator will not be called. + If the story's parameters include `{ exampleParameter: { disable: true } }` (where `exampleParameter` is the `parameterName` of your addon), your decorator will not be called. -
+ The `makeDecorator` API requires the following arguments: diff --git a/docs/addons/install-addons.md b/docs/addons/install-addons.md index 853ca0873c14..0990f3022ce2 100644 --- a/docs/addons/install-addons.md +++ b/docs/addons/install-addons.md @@ -35,9 +35,11 @@ Next, update [`.storybook/main.js|ts`](../configure/overview.md#configure-story- -
+ + Addons may also require addon-specific configuration. Read their respective READMEs. -
+ + Now when you run Storybook the accessibility testing addon will be enabled. @@ -60,9 +62,11 @@ For example, to use SCSS styling, run the following command to install the addon -
- 💡 Tip: Use the Webpack 5 snippet only if your framework already includes support for this version. Otherwise, use the Webpack 4 snippet. -
+ + +Use the Webpack 5 snippet only if your framework already includes support for this version. Otherwise, use the Webpack 4 snippet. + + Next, update [`.storybook/main.js|ts`](../configure/overview.md#configure-story-rendering) to the following: @@ -99,8 +103,10 @@ Consider the following example: -
+ + Preset addons may also have addon-specific configurations. Read their respective READMEs. -
+ + Now, when Storybook starts up, it will update webpack's CSS loader to use modules and adjust how styling is defined. diff --git a/docs/addons/integration-catalog.md b/docs/addons/integration-catalog.md index e2d1215c0a93..b6d018724c89 100644 --- a/docs/addons/integration-catalog.md +++ b/docs/addons/integration-catalog.md @@ -15,11 +15,11 @@ Add your addon to the catalog by publishing a npm package that follows these req - `/dist` directory containing transpiled ES5 code - `preset.js` file written as an ES5 module at the root level -
+ Get a refresher on how to [write a Storybook addon](./writing-addons.md). -
+ ### Addon metadata @@ -54,9 +54,11 @@ Use the list below as a reference when filling in the values for both the `suppo - preact - react-native -
-💡 Make sure to copy each item exactly as listed so that we can properly index your addon in our catalog. -
+ + +Make sure to copy each item exactly as listed so that we can properly index your addon in our catalog. + + ```json { diff --git a/docs/addons/writing-addons.md b/docs/addons/writing-addons.md index db951af33832..67875a7e6c3e 100644 --- a/docs/addons/writing-addons.md +++ b/docs/addons/writing-addons.md @@ -63,11 +63,11 @@ Clone the repository you just created and install its dependencies. When the ins -
+ -ℹ️ The Addon Kit uses [Typescript](https://www.typescriptlang.org/) by default. If you want to use JavaScript instead, you can run the `eject-ts` command to convert the project to JavaScript. +The Addon Kit uses [Typescript](https://www.typescriptlang.org/) by default. If you want to use JavaScript instead, you can run the `eject-ts` command to convert the project to JavaScript. -
+ ### Understanding the build system @@ -283,11 +283,11 @@ The second metadata category is related to the [integration catalog](https://sto } ``` -
+ -ℹ️ The `storybook` configuration element includes additional properties that help customize the addon's searchability and indexing. For more information, see the [Integration catalog documentation](./integration-catalog.md). +The `storybook` configuration element includes additional properties that help customize the addon's searchability and indexing. For more information, see the [Integration catalog documentation](./integration-catalog.md). -
+ One essential item to note is the `keywords` property as it maps to the catalog's tag system. Adding the `storybook-addons` ensures that the addon is discoverable in the catalog when searching for addons. The remaining keywords help with the searchability and categorization of the addon. diff --git a/docs/api/arg-types.md b/docs/api/arg-types.md index c6ae8fa6e056..5cf1a9006355 100644 --- a/docs/api/arg-types.md +++ b/docs/api/arg-types.md @@ -166,11 +166,11 @@ Specifies the type of control used to change the arg value with the [controls ad | | `'date'` | Provides a datepicker to choose a date.
`{ control: 'date' }` | | | `'text'` | Provides a freeform text input.
`{ control: 'text' }` | -
+ -💡 The `date` control will convert the date into a UNIX timestamp when the value changes. It's a known limitation that will be fixed in a future release. If you need to represent the actual date, you'll need to update the story's implementation and convert the value into a date object. +The `date` control will convert the date into a UNIX timestamp when the value changes. It's a known limitation that will be fixed in a future release. If you need to represent the actual date, you'll need to update the story's implementation and convert the value into a date object. -
+ #### `control.accept` @@ -304,13 +304,13 @@ The `argTypes` object uses the name of the arg as the key. By default, that key -
+ -💡 Be careful renaming args in this way. Users of the component you're documenting will not be able to use the documented name as a property of your component and the actual name will not displayed. +Be careful renaming args in this way. Users of the component you're documenting will not be able to use the documented name as a property of your component and the actual name will not displayed. For this reason, the `name` property is best used when defining an `argType` that is only used for documentation purposes and not an actual property of the component. For example, when [providing argTypes for each property of an object](https://stackblitz.com/edit/github-uplqzp?file=src/stories/Button.stories.tsx). -
+ ### `options` diff --git a/docs/api/cli-options.md b/docs/api/cli-options.md index e7dc90bda58b..3685881d8f75 100644 --- a/docs/api/cli-options.md +++ b/docs/api/cli-options.md @@ -4,11 +4,11 @@ title: 'CLI options' The Storybook command line interface (CLI) is the main tool you use to build and develop Storybook. -
+ Storybook collects completely anonymous data to help us improve user experience. Participation is optional, and you may [opt-out](../configure/telemetry.md#how-to-opt-out) if you'd not like to share any information. -
+ ## API commands @@ -45,11 +45,11 @@ Options include: | `--docs` | Starts Storybook in documentation mode. Learn more about it in [here](../writing-docs/build-documentation.md#preview-storybooks-documentation)
`storybook dev --docs` | | `--disable-telemetry` | Disables Storybook's telemetry. Learn more about it [here](../configure/telemetry.md)
`storybook dev --disable-telemetry` | -
+ -💡 Starting in 6.4 the `-s` flag is deprecated. Instead, use a configuration object in your `.storybook/main.js` file. See the [images and assets documentation](../configure/images-and-assets.md#serving-static-files-via-storybook) for more information. +Starting in 6.4 the `-s` flag is deprecated. Instead, use a configuration object in your `.storybook/main.js` file. See the [images and assets documentation](../configure/images-and-assets.md#serving-static-files-via-storybook) for more information. -
+ ### `build` @@ -75,6 +75,8 @@ Options include: | `--docs` | Builds Storybook in documentation mode. Learn more about it in [here](../writing-docs/build-documentation.md#publish-storybooks-documentation)
`storybook build --docs` | | `--disable-telemetry` | Disables Storybook's telemetry. Learn more about it [here](../configure/telemetry.md).
`storybook build --disable-telemetry` | -
-💡 If you're using npm instead of yarn to publish Storybook, the commands work slightly different. For example, npm run storybook build -- -o ./path/to/build. -
+ + +If you're using npm instead of yarn to publish Storybook, the commands work slightly different. For example, npm run storybook build -- -o ./path/to/build. + + diff --git a/docs/api/csf.md b/docs/api/csf.md index 76388000ed3e..60c9ba5e4355 100644 --- a/docs/api/csf.md +++ b/docs/api/csf.md @@ -6,11 +6,11 @@ title: 'Component Story Format (CSF)' Component Story Format (CSF) is the recommended way to [write stories](../writing-stories/introduction.md). It's an [open standard](https://github.com/ComponentDriven/csf) based on ES6 modules that is portable beyond Storybook. -
+ -💡 If you are writing stories in the older `storiesOf()` syntax, you can find documentation in an [advanced README](https://github.com/storybookjs/storybook/blob/next/code/lib/preview-api/docs/storiesOf.md). +If you are writing stories in the older `storiesOf()` syntax, you can find documentation in an [advanced README](https://github.com/storybookjs/storybook/blob/next/code/lib/preview-api/docs/storiesOf.md). -
+ In CSF, stories and component metadata are defined as ES Modules. Every component story file consists of a required [default export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export#Using_the_default_export) and one or more [named exports](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export). diff --git a/docs/api/doc-block-argtypes.md b/docs/api/doc-block-argtypes.md index 7ee304217ce5..2c0cc4d5b1e7 100644 --- a/docs/api/doc-block-argtypes.md +++ b/docs/api/doc-block-argtypes.md @@ -6,11 +6,11 @@ title: 'ArgTypes' The `ArgTypes` block can be used to show a static table of [arg types](./argtypes.md) for a given component, as a way to document its interface. -
+ -💡 If you’re looking for a dynamic table that shows a story’s current arg values for a story and supports users changing them, see the [`Controls`](./doc-block-controls.md) block instead. +If you’re looking for a dynamic table that shows a story’s current arg values for a story and supports users changing them, see the [`Controls`](./doc-block-controls.md) block instead. -
+ ![Screenshot of ArgTypes block](./doc-block-argtypes.png) diff --git a/docs/api/doc-block-canvas.md b/docs/api/doc-block-canvas.md index 8c27490bacb8..8c40eadd6bd1 100644 --- a/docs/api/doc-block-canvas.md +++ b/docs/api/doc-block-canvas.md @@ -23,11 +23,11 @@ import * as ButtonStories from './Button.stories'; ``` -
+ -💡 In previous versions of Storybook it was possible to pass in arbitrary components as children to `Canvas`. That is deprecated and the `Canvas` block now only supports a single story. +In previous versions of Storybook it was possible to pass in arbitrary components as children to `Canvas`. That is deprecated and the `Canvas` block now only supports a single story. -
+ ## Canvas @@ -172,11 +172,11 @@ Type: `SourceProps['code'] | SourceProps['format'] | SourceProps['language'] | S Specifies props passed to the inner `Source` block. See [SourceProps](./doc-block-source.md#sourceprops). -
+ -💡 The dark prop is ignored, as the `Source` block is always rendered in dark mode when shown as part of a `Canvas` block. +The dark prop is ignored, as the `Source` block is always rendered in dark mode when shown as part of a `Canvas` block. -
+ ### `sourceState` diff --git a/docs/api/doc-block-controls.md b/docs/api/doc-block-controls.md index 835384203a5c..60334672163f 100644 --- a/docs/api/doc-block-controls.md +++ b/docs/api/doc-block-controls.md @@ -6,17 +6,17 @@ title: 'Controls' The `Controls` block can be used to show a dynamic table of args for a given story, as a way to document its interface, and to allow you to change the args for a (separately) rendered story (via the [`Story`](./doc-block-story.md) or [`Canvas`](./doc-block-canvas.md) blocks). -
+ -💡 If you’re looking for a static table that shows a component's arg types with no controls, see the [`ArgTypes`](./doc-block-argtypes.md) block instead. +If you’re looking for a static table that shows a component's arg types with no controls, see the [`ArgTypes`](./doc-block-argtypes.md) block instead. -
+ -
+ -⚠️ The Controls doc block will only have functioning UI controls if you have also installed and registered [`@storybook/addon-controls`](../essentials/controls.md) (included in [`@storybook/addon-essentials`](../essentials/introduction.md)). +The Controls doc block will only have functioning UI controls if you have also installed and registered [`@storybook/addon-controls`](../essentials/controls.md) (included in [`@storybook/addon-essentials`](../essentials/introduction.md)). -
+ ![Screenshot of Controls block](./doc-block-controls.png) @@ -74,11 +74,11 @@ The example above applied the parameter at the [component](../writing-stories/pa -
+ -💡 This API configures Controls blocks used within docs pages. To configure the Controls addon panel, see the [Controls addon docs](../essentials/controls.md). To configure individual controls, you can specify [argTypes](./arg-types.md#control) for each. +This API configures Controls blocks used within docs pages. To configure the Controls addon panel, see the [Controls addon docs](../essentials/controls.md). To configure individual controls, you can specify [argTypes](./arg-types.md#control) for each. -
+ ### `exclude` diff --git a/docs/api/doc-block-meta.md b/docs/api/doc-block-meta.md index b4b165761353..0afcfae7de44 100644 --- a/docs/api/doc-block-meta.md +++ b/docs/api/doc-block-meta.md @@ -18,11 +18,11 @@ import * as ButtonStories from './Button.stories'; ``` -
+ -💡 The Meta block doesn’t render anything visible. +The Meta block doesn’t render anything visible. -
+ ## Meta @@ -78,11 +78,11 @@ Attaching an MDX file to a component’s stories with the `of` prop serves two p 1. Ensures the MDX content appears in the sidebar inside the component’s story list. By default, it will be named whatever the `docs.defaultName` (which defaults to `"Docs"`) option is set to in `main.js`. But this can be overridden with the [`name` prop](#name). 2. Attaches the component and its stories to the MDX file, allowing you to use other doc blocks in “attached” mode (for instance to use the `Stories` block). -
+ -💡 The `of` prop is optional. If you don’t want to attach a specific CSF file to this MDX file, you can either use the `title` prop to control the location, or emit `Meta` entirely, and let [autotitle](../configure/sidebar-and-urls.md#csf-30-auto-titles) decide where it goes. +The `of` prop is optional. If you don’t want to attach a specific CSF file to this MDX file, you can either use the `title` prop to control the location, or emit `Meta` entirely, and let [autotitle](../configure/sidebar-and-urls.md#csf-30-auto-titles) decide where it goes. -
+ ### `title` @@ -101,11 +101,11 @@ import { Meta } from '@storybook/blocks'; ``` -
+ -💡 If you want to change the sorting of the docs entry with the component’s stories, use [Story Sorting](../writing-stories/naming-components-and-hierarchy.md#sorting-stories), or add specific MDX files to your `stories` field in `main.js` in order. +If you want to change the sorting of the docs entry with the component’s stories, use [Story Sorting](../writing-stories/naming-components-and-hierarchy.md#sorting-stories), or add specific MDX files to your `stories` field in `main.js` in order. -
+ ## Attached vs. unattached diff --git a/docs/api/doc-block-source.md b/docs/api/doc-block-source.md index 0595c387a238..c4a460050430 100644 --- a/docs/api/doc-block-source.md +++ b/docs/api/doc-block-source.md @@ -92,11 +92,11 @@ Default: `parameters.docs.source.dark` Determines if the snippet is rendered in dark mode. -
+ -💡 Light mode is only supported when the `Source` block is rendered independently. When rendered as part of a [`Canvas` block](./doc-block-canvas.md)—like it is in [autodocs](../writing-docs/autodocs.md)—it will always use dark mode. +Light mode is only supported when the `Source` block is rendered independently. When rendered as part of a [`Canvas` block](./doc-block-canvas.md)—like it is in [autodocs](../writing-docs/autodocs.md)—it will always use dark mode. -
+ ### `format` @@ -147,11 +147,11 @@ Specifies how the source code is rendered. - **code**: Renders the value of [`code` prop](#code), otherwise renders static story source - **dynamic**: Renders the story source with dynamically updated arg values -
+ -💡 Note that dynamic snippets will only work if the story uses [`args`](../writing-stories/args.md) and the [`Story` block](./doc-block-story.md) for that story is rendered along with the `Source` block. +Note that dynamic snippets will only work if the story uses [`args`](../writing-stories/args.md) and the [`Story` block](./doc-block-story.md) for that story is rendered along with the `Source` block. -
+ ### `id` diff --git a/docs/api/doc-block-stories.md b/docs/api/doc-block-stories.md index 75728b54df71..b20a3496ae61 100644 --- a/docs/api/doc-block-stories.md +++ b/docs/api/doc-block-stories.md @@ -37,11 +37,11 @@ Default: `true` Determines if the collection of stories includes the primary (first) story. -
+ -💡 If a stories file contains only one story and `includePrimary={true}`, the `Stories` block will render nothing to avoid a potentially confusing situation. +If a stories file contains only one story and `includePrimary={true}`, the `Stories` block will render nothing to avoid a potentially confusing situation. -
+ ### `title` diff --git a/docs/api/doc-block-story.md b/docs/api/doc-block-story.md index 89499df3328c..0a3470429ace 100644 --- a/docs/api/doc-block-story.md +++ b/docs/api/doc-block-story.md @@ -8,11 +8,11 @@ Stories (component tests) are Storybook's fundamental building blocks. In Storybook Docs, you can render any of your stories from your CSF files in the context of an MDX file with all annotations (parameters, args, loaders, decorators, play function) applied using the `Story` block. -
+ Typically you want to use the [`Canvas` block](./doc-block-canvas.md) to render a story with a surrounding border and the source block, but you can use the `Story` block to render just the story. -
+ ![Screenshot of Story block](./doc-block-story.png) diff --git a/docs/api/doc-block-unstyled.md b/docs/api/doc-block-unstyled.md index 0fd5f03c6faa..4214e6e44c24 100644 --- a/docs/api/doc-block-unstyled.md +++ b/docs/api/doc-block-unstyled.md @@ -32,15 +32,15 @@ Yields: ![Screenshot of Unstyled Doc Block](./doc-block-unstyled.png) -
+ -ℹ️ The other blocks like [`Story`](./doc-block-story.md) and [`Canvas`](./doc-block-canvas.md) are already unstyled, so there’s no need to wrap those in the `Unstyled` block to ensure that Storybook’s styles don’t bleed into the stories. However, if you import your components directly in the MDX, you most likely want to wrap them in the Unstyled block. +The other blocks like [`Story`](./doc-block-story.md) and [`Canvas`](./doc-block-canvas.md) are already unstyled, so there’s no need to wrap those in the `Unstyled` block to ensure that Storybook’s styles don’t bleed into the stories. However, if you import your components directly in the MDX, you most likely want to wrap them in the Unstyled block. -
+ -
+ -💡 Due to how CSS inheritance works it’s best to always add the Unstyled block to the root of your MDX, and not nested into other elements. The following example will cause some Storybook styles like `color` to be inherited into `CustomComponent` because they are applied to the root `div`: +Due to how CSS inheritance works it’s best to always add the Unstyled block to the root of your MDX, and not nested into other elements. The following example will cause some Storybook styles like `color` to be inherited into `CustomComponent` because they are applied to the root `div`: ```md @@ -52,7 +52,7 @@ Yields: ``` -
+ ## Unstyled diff --git a/docs/api/main-config-babel-default.md b/docs/api/main-config-babel-default.md index e09f66f34147..b79867e1dc34 100644 --- a/docs/api/main-config-babel-default.md +++ b/docs/api/main-config-babel-default.md @@ -8,11 +8,11 @@ Type: `(config: Babel.Config, options: Options) => Babel.Config | Promise + -💡 To adjust your Storybook's Babel setup directly—not via an addon—use [`babel`](./main-config-babel.md) instead. +To adjust your Storybook's Babel setup directly—not via an addon—use [`babel`](./main-config-babel.md) instead. -
+ diff --git a/docs/api/main-config-babel.md b/docs/api/main-config-babel.md index 3cb1865560f0..a84a938b5a35 100644 --- a/docs/api/main-config-babel.md +++ b/docs/api/main-config-babel.md @@ -8,11 +8,11 @@ Type: `(config: Babel.Config, options: Options) => Babel.Config | Promise + -💡 [Addon authors](../addons/writing-presets.md#babel) should use [`babelDefault`](./main-config-babel-default.md) instead, which is applied to the preview config before any user presets have been applied. +[Addon authors](../addons/writing-presets.md#babel) should use [`babelDefault`](./main-config-babel-default.md) instead, which is applied to the preview config before any user presets have been applied. - + diff --git a/docs/api/main-config-core.md b/docs/api/main-config-core.md index f2c16bf04913..e66bd5709740 100644 --- a/docs/api/main-config-core.md +++ b/docs/api/main-config-core.md @@ -36,13 +36,13 @@ Type: Configures Storybook's builder, [Vite](../builders/vite.md) or [Webpack](../builders/webpack.md). -
+ -💡 With the new [Framework API](./new-frameworks.md), [`framework.options.builder`](./main-config-framework.md#optionsbuilder) is now the preferred way to configure the builder. +With the new [Framework API](./new-frameworks.md), [`framework.options.builder`](./main-config-framework.md#optionsbuilder) is now the preferred way to configure the builder. You should only use `core.builder.options` if you need to configure a builder that is not part of a framework. -
+ diff --git a/docs/api/main-config-indexers.md b/docs/api/main-config-indexers.md index d5efd754787a..256dd9b2c990 100644 --- a/docs/api/main-config-indexers.md +++ b/docs/api/main-config-indexers.md @@ -4,11 +4,11 @@ title: 'indexers' (⚠️ **Experimental**) -
+ -🧪 While this feature is experimental, it must be specified by the `experimental_indexers` property of [`StorybookConfig`](./main-config.md). +While this feature is experimental, it must be specified by the `experimental_indexers` property of [`StorybookConfig`](./main-config.md). -
+ Parent: [main.js|ts configuration](./main-config.md) diff --git a/docs/api/main-config-manager-head.md b/docs/api/main-config-manager-head.md index d44eb52f4a83..04ea6f89eb42 100644 --- a/docs/api/main-config-manager-head.md +++ b/docs/api/main-config-manager-head.md @@ -8,11 +8,11 @@ Type: `(head: string) => string` Programmatically adjust the manager's `` of your Storybook. For example, load a custom font or add a script. Most often used by [addon authors](../addons/writing-presets.md#ui-configuration). -
+ -💡 If you don't need to programmatically adjust the manager head, you can add scripts and styles to `manager-head.html` instead. +If you don't need to programmatically adjust the manager head, you can add scripts and styles to `manager-head.html` instead. -
+ For example, you can conditionally add scripts or styles, depending on the environment: diff --git a/docs/api/main-config-preview-annotations.md b/docs/api/main-config-preview-annotations.md index ccea95d9ea8d..8e69ae265645 100644 --- a/docs/api/main-config-preview-annotations.md +++ b/docs/api/main-config-preview-annotations.md @@ -8,11 +8,11 @@ Type: `string[] | ((config: string[], options: Options) => string[] | Promise + -💡 Mostly used by [frameworks](../contribute/framework.md#previewjs-example). Storybook users and [addon authors](../addons/writing-presets.md) should add scripts to [`preview.js`](../configure/overview.md#configure-story-rendering) instead. +Mostly used by [frameworks](../contribute/framework.md#previewjs-example). Storybook users and [addon authors](../addons/writing-presets.md) should add scripts to [`preview.js`](../configure/overview.md#configure-story-rendering) instead. - + ```ts // @storybook/nextjs framework's src/preset.ts diff --git a/docs/api/main-config-preview-body.md b/docs/api/main-config-preview-body.md index f35a05a0c4e0..4ddbf9d71010 100644 --- a/docs/api/main-config-preview-body.md +++ b/docs/api/main-config-preview-body.md @@ -8,11 +8,11 @@ Type: `(body: string) => string` Programmatically adjust the [preview ``](../configure/story-rendering.md#adding-to-body) of your Storybook. Most often used by [addon authors](../addons/writing-presets.md#ui-configuration). -
+ -💡 If you don't need to programmatically adjust the preview body, you can add scripts and styles to [`preview-body.html`](../configure/story-rendering.md#adding-to-body) instead. +If you don't need to programmatically adjust the preview body, you can add scripts and styles to [`preview-body.html`](../configure/story-rendering.md#adding-to-body) instead. -
+ For example, you can conditionally add scripts or styles, depending on the environment: diff --git a/docs/api/main-config-preview-head.md b/docs/api/main-config-preview-head.md index af29ce4442f0..fcc5f1fd3076 100644 --- a/docs/api/main-config-preview-head.md +++ b/docs/api/main-config-preview-head.md @@ -8,11 +8,11 @@ Type: `(head: string) => string` Programmatically adjust the [preview ``](../configure/story-rendering.md#adding-to-head) of your Storybook. Most often used by [addon authors](../addons/writing-presets.md#ui-configuration). -
+ -💡 If you don't need to programmatically adjust the preview head, you can add scripts and styles to [`preview-head.html`](../configure/story-rendering.md#adding-to-head) instead. +If you don't need to programmatically adjust the preview head, you can add scripts and styles to [`preview-head.html`](../configure/story-rendering.md#adding-to-head) instead. -
+ For example, you can conditionally add scripts or styles, depending on the environment: diff --git a/docs/api/main-config-stories.md b/docs/api/main-config-stories.md index 9eefa1360565..9928131f5ca0 100644 --- a/docs/api/main-config-stories.md +++ b/docs/api/main-config-stories.md @@ -33,13 +33,13 @@ Configures Storybook to load stories from the specified locations. The intention -
+ -💡 If you want to use a different naming convention, you can alter the glob using the syntax supported by [picomatch](https://github.com/micromatch/picomatch#globbing-features). +If you want to use a different naming convention, you can alter the glob using the syntax supported by [picomatch](https://github.com/micromatch/picomatch#globbing-features). Keep in mind that some addons may assume Storybook's default naming convention. -
+ ## With an array of globs @@ -115,11 +115,11 @@ When [auto-titling](../configure/sidebar-and-urls.md#csf-30-auto-titles), prefix ## With a custom implementation -
+ -💡 With [`storyStoreV7`](./main-config-features.md#storystorev7) (the default in Storybook 7), Storybook now statically analyzes the configuration file to improve performance. Loading stories with a custom implementation may de-optimize or break this ability. +With [`storyStoreV7`](./main-config-features.md#storystorev7) (the default in Storybook 7), Storybook now statically analyzes the configuration file to improve performance. Loading stories with a custom implementation may de-optimize or break this ability. -
+ You can also adjust your Storybook configuration and implement custom logic to load your stories. For example, suppose you were working on a project that includes a particular pattern that the conventional ways of loading stories could not solve. In that case, you could adjust your configuration as follows: diff --git a/docs/builders/vite.md b/docs/builders/vite.md index 819c4278ed48..2302191fcae3 100644 --- a/docs/builders/vite.md +++ b/docs/builders/vite.md @@ -83,11 +83,11 @@ By default, the Vite builder in Storybook searches for the Vite configuration fi -
+ -💡 If you do not want Storybook to load the Vite configuration file automatically, you can use the `viteConfigPath` option to point to a non-existent file. +If you do not want Storybook to load the Vite configuration file automatically, you can use the `viteConfigPath` option to point to a non-existent file. -
+ ### TypeScript diff --git a/docs/builders/webpack.md b/docs/builders/webpack.md index 130ac9bd56e1..74964ff1c368 100644 --- a/docs/builders/webpack.md +++ b/docs/builders/webpack.md @@ -74,10 +74,11 @@ If you already have an existing Webpack configuration file that you need to reus -
-💡 Projects scaffolded based on generators may require that you import their specific Webpack configuration files. We suggest reading your generator's documentation for more information. + -
+Projects scaffolded based on generators may require that you import their specific Webpack configuration files. We suggest reading your generator's documentation for more information. + + ### Debug Webpack configuration diff --git a/docs/configure/babel.md b/docs/configure/babel.md index 331add4d5e6e..94bd83590288 100644 --- a/docs/configure/babel.md +++ b/docs/configure/babel.md @@ -4,11 +4,11 @@ title: 'Babel' As of version 7.0, Storybook now re-uses your project’s Babel configuration to apply the same Babel plugins and presets in your Storybook stories as you do in your app. This makes it simpler, less buggy, easier to troubleshoot, and more consistent with other tools in the JS ecosystem. -
+ If you're not using Storybook 7, please reference the [previous documentation](../../../release-6-5/docs/configure/babel.md) for guidance on configuring your Babel setup. -
+ ## CRA (Create React App) @@ -125,11 +125,11 @@ BABEL_SHOW_CONFIG_FOR=.storybook/preview.js yarn storybook When the command finishes running, it will display the available Babel configuration for the `.storybook/preview.js` file. You can use this information to debug issues with transpilation. -
+ -💡 Due to what appears to be a Babel bug, setting this flag causes Babel transpilation to fail on the file provided. Thus you cannot actually **run** Storybook using this command. However, it will print out the configuration information as advertised, and therefore you can use this to debug your Storybook. You'll need to remove the flag to actually run your Storybook. +Due to what appears to be a Babel bug, setting this flag causes Babel transpilation to fail on the file provided. Thus you cannot actually **run** Storybook using this command. However, it will print out the configuration information as advertised, and therefore you can use this to debug your Storybook. You'll need to remove the flag to actually run your Storybook. -
+ For more info, please refer to the [Babel documentation](https://babeljs.io/docs/en/configuration#print-effective-configs). diff --git a/docs/configure/environment-variables.md b/docs/configure/environment-variables.md index 4f32cac6c51b..f943b05c5237 100644 --- a/docs/configure/environment-variables.md +++ b/docs/configure/environment-variables.md @@ -9,11 +9,11 @@ If you supply an environment variable prefixed with `STORYBOOK_`, it will be ava STORYBOOK_THEME=red STORYBOOK_DATA_KEY=12345 npm run storybook ``` -
+ -💡 Do not store any secrets (e.g., private API keys) or other types of sensitive information in your Storybook. Environment variables are embedded into the build, meaning anyone can view them by inspecting your files. +Do not store any secrets (e.g., private API keys) or other types of sensitive information in your Storybook. Environment variables are embedded into the build, meaning anyone can view them by inspecting your files. -
+ Then we can access these environment variables anywhere inside our preview JavaScript code like below: @@ -48,11 +48,11 @@ Then we can access these environment variables anywhere inside our preview JavaS You can also access these variables in your custom ``/`` using the substitution `%STORYBOOK_X%`, for example: `%STORYBOOK_THEME%` will become `red`. -
+ -💡 If using the environment variables as attributes or values in JavaScript, you may need to add quotes, as the value will be inserted directly. e.g. `` +If using the environment variables as attributes or values in JavaScript, you may need to add quotes, as the value will be inserted directly. e.g. `` -
+ ### Using .env files @@ -99,11 +99,11 @@ Out of the box, Storybook provides a [Vite builder](../builders/vite.md), which -
+ You can also use specific files for specific modes. Add a `.env.development` or `.env.production` to apply different values to your environment variables. -
+ You can also pass these environment variables when you are [building your Storybook](../sharing/publish-storybook.md) with `build-storybook`. @@ -154,9 +154,11 @@ The table below lists the available options: | Firefox | `BROWSER="firefox"` | | Chromium | `BROWSER="chromium"` | -
-💡 By default, Storybook will open a new Chrome window as part of its startup process. If you don't have Chrome installed, make sure to include one of the following options, or set your default browser accordingly. -
+ + +By default, Storybook will open a new Chrome window as part of its startup process. If you don't have Chrome installed, make sure to include one of the following options, or set your default browser accordingly. + + ## Troubleshooting diff --git a/docs/configure/overview.md b/docs/configure/overview.md index a5e877a03e46..4e11a8f5c440 100644 --- a/docs/configure/overview.md +++ b/docs/configure/overview.md @@ -4,11 +4,11 @@ title: 'Configure Storybook' Storybook is configured via a folder called `.storybook`, which contains various configuration files. -
+ Note that you can change the folder that Storybook uses by setting the `-c` flag to your `storybook dev` and `storybook build` [CLI commands](../api/cli-options.md). -
+ ## Configure your Storybook project @@ -25,11 +25,11 @@ Storybook's main configuration (i.e., the `main.js|ts`) defines your Storybook p -
+ -ℹ️ This configuration file is a [preset](../addons/addon-types.md) and, as such, has a powerful interface, which can be further customized. Read our documentation on writing [presets](../addons/writing-presets.md) to learn more. +This configuration file is a [preset](../addons/addon-types.md) and, as such, has a powerful interface, which can be further customized. Read our documentation on writing [presets](../addons/writing-presets.md) to learn more. -
+ | Configuration element | Description | | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | diff --git a/docs/configure/story-rendering.md b/docs/configure/story-rendering.md index b4b157569eab..ae98bac3d9f3 100644 --- a/docs/configure/story-rendering.md +++ b/docs/configure/story-rendering.md @@ -18,11 +18,11 @@ If you need to add extra elements to the `head` of the preview iframe, for insta -
+ Storybook will inject these tags into the _preview iframe_ where your components render, not the Storybook application UI. -
+ However, it's also possible to modify the preview head HTML programmatically using a preset defined in the `main.js` file. Read the [presets documentation](../addons/writing-presets.md#ui-configuration) for more information. @@ -54,10 +54,10 @@ If using relative sizing in your project (like `rem` or `em`), you may update th -
+ Storybook will inject these tags into the _preview iframe_ where your components render, not the Storybook application UI. -
+ Just like how you have the ability to customize the preview `head` HTML tag, you can also follow the same steps to customize the preview `body` with a preset. To obtain more information on how to do this, refer to the [presets documentation](../addons/writing-presets.md#ui-configuration). diff --git a/docs/configure/telemetry.md b/docs/configure/telemetry.md index ffd34f8069fa..1d1af24046c1 100644 --- a/docs/configure/telemetry.md +++ b/docs/configure/telemetry.md @@ -178,11 +178,11 @@ You may opt-out of the telemetry by setting Storybook's configuration element `d -
+ -💡 There is a `boot` event containing no metadata (used to ensure the telemetry is working). It is sent prior to evaluating your [Storybook configuration file](../api/main-config.md) (i.e., `main.js|ts`), so it is unaffected by the `disableTelemetry` option. If you want to ensure that the event is not sent, use the `STORYBOOK_DISABLE_TELEMETRY` environment variable. +There is a `boot` event containing no metadata (used to ensure the telemetry is working). It is sent prior to evaluating your [Storybook configuration file](../api/main-config.md) (i.e., `main.js|ts`), so it is unaffected by the `disableTelemetry` option. If you want to ensure that the event is not sent, use the `STORYBOOK_DISABLE_TELEMETRY` environment variable. -
+ ## Crash reports (disabled by default) diff --git a/docs/configure/theming.md b/docs/configure/theming.md index b7aebc90fb9e..d8a56e6e5458 100644 --- a/docs/configure/theming.md +++ b/docs/configure/theming.md @@ -87,9 +87,11 @@ Inside your `.storybook` directory, create a new file called `YourTheme.js` and -
-💡 If you're using brandImage to add your custom logo, you can use any of the most common image formats. -
+ + +If you're using brandImage to add your custom logo, you can use any of the most common image formats. + + Above, we're creating a new theme that will: @@ -135,9 +137,11 @@ With the new changes introduced, the custom theme should yield a similar result. ![Storybook custom theme loaded](./storybook-custom-theme.png) -
-💡 Many theme variables are optional, the base property is NOT. -
+ + +Many theme variables are optional, the base property is NOT. + + The `@storybook/theming` package is built using TypeScript, which should help create a valid theme for TypeScript users. The types are part of the package itself. @@ -150,11 +154,11 @@ To style these elements, insert style tags into: - For Storybook’s UI, use `.storybook/manager-head.html` - For Storybook Docs, use `.storybook/preview-head.html` -
+ -💡 Caution: The same way as you can adjust your [preview’s head tag](../configure/story-rendering.md#adding-to-head), Storybook allows you to modify the code on the manager's side, through .storybook/manager-head.html. It can be helpful when adding theme styles that target Storybook's HTML, but it comes with a cost as Storybook's inner HTML can change at any time through the release cycle. +The same way as you can adjust your [preview’s head tag](../configure/story-rendering.md#adding-to-head), Storybook allows you to modify the code on the manager's side, through .storybook/manager-head.html. It can be helpful when adding theme styles that target Storybook's HTML, but it comes with a cost as Storybook's inner HTML can change at any time through the release cycle. -
+ ## MDX component overrides diff --git a/docs/configure/typescript.md b/docs/configure/typescript.md index ba89ad2dcca4..dbe0453e399c 100644 --- a/docs/configure/typescript.md +++ b/docs/configure/typescript.md @@ -20,11 +20,11 @@ Storybook's configuration file (i.e., `main.ts`) is defined as an ESM module wri See the [main configuration API reference](../api/main-config) for more details and additional properties. -
+ -💡 See the Vite builder [TypeScript documentation](https://github.com/storybookjs/builder-vite#typescript) if using `@storybook/builder-vite`. +See the Vite builder [TypeScript documentation](https://github.com/storybookjs/builder-vite#typescript) if using `@storybook/builder-vite`. -
+ ### Extending the default configuration diff --git a/docs/configure/upgrading.md b/docs/configure/upgrading.md index 97b9d785fc20..c5e57d8d714e 100644 --- a/docs/configure/upgrading.md +++ b/docs/configure/upgrading.md @@ -27,11 +27,11 @@ After running the command the script will: - Upgrade all Storybook packages in your project to the latest stable version - Run the relevant [automigrations](../migration-guide.md#automatic-upgrade) factoring in the [breaking changes](../migration-guide.md#major-breaking-changes) between your current version and the latest stable version -
+ In addition to running the command, we also recommend checking the [MIGRATION.md file](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md), for the detailed log of relevant changes and deprecations that might affect your upgrade. -
+ ## Automigrate script @@ -71,8 +71,8 @@ To upgrade to the latest pre-release: If you'd like to downgrade to a stable version, manually edit the package version numbers in your `package.json` and re-install. -
+ Storybook collects completely anonymous data to help us improve user experience. Participation is optional, and you may [opt-out](../configure/telemetry.md#how-to-opt-out) if you'd not like to share any information. -
+ diff --git a/docs/configure/webpack.md b/docs/configure/webpack.md index b23700a38ee2..61073d7b4374 100644 --- a/docs/configure/webpack.md +++ b/docs/configure/webpack.md @@ -173,9 +173,11 @@ The following code snippet shows how you can replace the loaders from Storybook -
-💡 Projects initialized via generators (e.g, Vue CLI) may require that you import their own webpack config file (i.e., /projectRoot/node_modules/@vue/cli-service/webpack.config.js) to use a certain feature with Storybook. For other generators, make sure to check the documentation for instructions. -
+ + +Projects initialized via generators (e.g, Vue CLI) may require that you import their own webpack config file (i.e., /projectRoot/node_modules/@vue/cli-service/webpack.config.js) to use a certain feature with Storybook. For other generators, make sure to check the documentation for instructions. + + ### TypeScript Module Resolution @@ -191,6 +193,8 @@ When working with TypeScript projects, the default Webpack configuration may fai -
-💡 Learn more about Storybook's built-in TypeScript support or see this issue for more information. -
+ + +Learn more about Storybook's built-in TypeScript support or see this issue for more information. + + diff --git a/docs/contribute/code.md b/docs/contribute/code.md index 21337442dd23..39a1818e2ee6 100644 --- a/docs/contribute/code.md +++ b/docs/contribute/code.md @@ -50,11 +50,11 @@ yarn task When prompted, answer the questions as accurately as possible to allow Storybook to determine your goals. After answering these questions, you should see the entire command with the options you've selected should you require to re-run it. -
+ -💡 The `yarn task` command takes a few development shortcuts that can catch you off guard when switching branches and may require you to re-run both the `install` and `compile` tasks. You can speed up the process by running the command with the `start-from=install` flag. +The `yarn task` command takes a few development shortcuts that can catch you off guard when switching branches and may require you to re-run both the `install` and `compile` tasks. You can speed up the process by running the command with the `start-from=install` flag. -
+ ## Running tests @@ -84,11 +84,11 @@ yarn build When prompted to start the build process in `watch` mode, answer **yes** to develop in interactive mode. Afterward, choose which packages you want to build. For example, if you're going to work on a feature for `@storybook/addon-docs`, you might want to select both `@storybook/addon-docs` and `@storybook/components`. -
+ -💡 Build's `watch` mode is great for interactive development. However, for performance reasons, it only transpiles your code and doesn't execute the TypeScript compiler. If something isn't working as expected, try running the `build` command WITHOUT enabling watch mode: it will re-generate TypeScript types and perform automatic type checking for you. +Build's `watch` mode is great for interactive development. However, for performance reasons, it only transpiles your code and doesn't execute the TypeScript compiler. If something isn't working as expected, try running the `build` command WITHOUT enabling watch mode: it will re-generate TypeScript types and perform automatic type checking for you. -
+ ![Storybook package selector](./storybook-build-packages-selection-optimized.png) @@ -144,11 +144,11 @@ Before submitting your contribution, run the test suite one last time with the f yarn test ``` -
+ -💡 Storybook relies on [Jest](https://jestjs.io/) as part of it's testing suite. During the test run, if you spot that snapshot tests are failing, re-run the command with the `-u` flag to update them. +Storybook relies on [Jest](https://jestjs.io/) as part of it's testing suite. During the test run, if you spot that snapshot tests are failing, re-run the command with the `-u` flag to update them. -
+ Doing this prevents last-minute bugs and is a great way to merge your contribution faster once you submit your pull request. Failing to do so will lead to one of the maintainers mark the pull request with the **Work in Progress** label until all tests pass. @@ -173,13 +173,13 @@ yarn task --task e2e-tests --template=react-vite/default-ts --start-from=install Typically it is a good idea to start from the `install` task to ensure your local code is completely up to date. If you reproduce the failure, you can try and make fixes, [compile them](#start-developing) with `build`, then rerun the task with `--start-from=auto`. -
+ -💡 The default instructions run the code in "linked" mode, meaning built changes to Storybook library code will be reflected in the sandbox immediately (the next time you run the task). However, CI runs in "unlinked" mode, which in rare cases, will behave differently.
+The default instructions run the code in "linked" mode, meaning built changes to Storybook library code will be reflected in the sandbox immediately (the next time you run the task). However, CI runs in "unlinked" mode, which in rare cases, will behave differently.
If you are having trouble reproducing, try rerunning the command with the `--no-link` flag. If you need to do that, you'll need to run it with `--start-from=compile` after each code change. -
+ ## How to work with reproductions @@ -199,11 +199,11 @@ If you already have a reproduction on your local machine, you can similarly link npx storybook@next link --local /path/to/local-repro-directory ``` -
+ -💡 The `storybook link` command relies on [Yarn 2 linking](https://yarnpkg.com/cli/link/) under the hood. It requires your local reproduction to be using [Yarn 2](https://yarnpkg.com/) as well, which is the case if you're already enabled it with the [`storybook sandbox`](./how-to-reproduce.md) command per our contribution guidelines. The process will fail if you're trying to link a non-Yarn 2 project. +The `storybook link` command relies on [Yarn 2 linking](https://yarnpkg.com/cli/link/) under the hood. It requires your local reproduction to be using [Yarn 2](https://yarnpkg.com/) as well, which is the case if you're already enabled it with the [`storybook sandbox`](./how-to-reproduce.md) command per our contribution guidelines. The process will fail if you're trying to link a non-Yarn 2 project. -
+ ## Developing a template diff --git a/docs/contribute/how-to-reproduce.md b/docs/contribute/how-to-reproduce.md index 361d14458d1e..737599351546 100644 --- a/docs/contribute/how-to-reproduce.md +++ b/docs/contribute/how-to-reproduce.md @@ -24,9 +24,10 @@ First, open a terminal and run the following command: npx storybook@next sandbox ``` -
-💡 You can append a template name in the command to get filtered results e.g. npx storybook@next sandbox react -
+ +You can append a template name in the command to get filtered results e.g. npx storybook@next sandbox react + + Next, choose the template you want to work with: @@ -36,9 +37,10 @@ Finally, enter a location for your reproduction: ![Storybook reproduction location](./storybook-reproduction-generator-location.png) -
-💡 If you don't provide a full path for the reproduction it will be generated in the current directory. -
+ + +If you don't provide a full path for the reproduction it will be generated in the current directory. + If everything worked as it should, you should have a fully functional Storybook set up in your local environment. @@ -62,9 +64,11 @@ Then, follow GitHub's instructions to set up the repository. ![github repository instructions](./github-repository-steps-optimized.png) -
- 💡 Don't forget to replace your-username with your own account name. -
+ + +Don't forget to replace your-username with your own account name. + + ## Publish diff --git a/docs/contribute/new-snippets.md b/docs/contribute/new-snippets.md index 1698945a64ac..2175556670bb 100644 --- a/docs/contribute/new-snippets.md +++ b/docs/contribute/new-snippets.md @@ -85,9 +85,11 @@ Create the file `ember/your-component.js.mdx`, similar to the other frameworks, ``` -
-💡 Code snippets are divided into various file extensions, if you're contributing a TypeScript file use .ts.mdx, or if you're adding JavaScript files use .js.mdx . -
+ + +Code snippets are divided into various file extensions, if you're contributing a TypeScript file use .ts.mdx, or if you're adding JavaScript files use .js.mdx. + + Go through the rest of the documentation and repeat the process. @@ -113,9 +115,11 @@ Next, make sure that you have running the `Synchronize documentation (sync-docs) yarn start:docs-only ``` -
-💡 During the start process if there's an issue with the documentation, the process will stop and you'll get a notification. -
+ + +During the start process if there's an issue with the documentation, the process will stop and you'll get a notification. + + Open a browser window to `http://localhost:8000`, click the Docs link, and select your framework from the dropdown. diff --git a/docs/essentials/actions.md b/docs/essentials/actions.md index 2ffc18444046..0077ab003631 100644 --- a/docs/essentials/actions.md +++ b/docs/essentials/actions.md @@ -70,11 +70,11 @@ If you need more granular control over which `argTypes` are matched, you can adj -
+ -💡 If you're generating argTypes with another addon (like [docs](../writing-docs/introduction.md), which is the common behavior), ensure the actions addon AFTER the other addon. You can do this by listing it later in the addons registration code in [`.storybook/main.js`](../configure/overview.md#configure-story-rendering). This is default in [essentials](./introduction.md). +If you're generating argTypes with another addon (like [docs](../writing-docs/introduction.md), which is the common behavior), ensure the actions addon AFTER the other addon. You can do this by listing it later in the addons registration code in [`.storybook/main.js`](../configure/overview.md#configure-story-rendering). This is default in [essentials](./introduction.md). -
+ ## Action event handlers diff --git a/docs/essentials/controls.md b/docs/essentials/controls.md index 893661782e90..a41caf4a3ac0 100644 --- a/docs/essentials/controls.md +++ b/docs/essentials/controls.md @@ -21,11 +21,11 @@ Controls do not require any modification to your components. Stories for control To use the Controls addon, you need to write your stories using [args](../writing-stories/args.md). Storybook will automatically generate UI controls based on your args and what it can infer about your component. Still, you can configure the controls further using [argTypes](../api/argtypes.md), see below. -
+ -💡 If you have stories in the older pre-Storybook 6 style, check the args & controls migration guide to learn how to convert your existing stories for args. +If you have stories in the older pre-Storybook 6 style, check the args & controls migration guide to learn how to convert your existing stories for args. -
+ ## Choosing the control type @@ -89,11 +89,11 @@ We can specify which controls get used by declaring a custom [argType](../api/ar -
+ -💡 ArgTypes are a powerful feature that can be used to customize the controls for your stories. See the documentation about [customizing controls](#annotation) with `argTypes` annotation for more information. +ArgTypes are a powerful feature that can be used to customize the controls for your stories. See the documentation about [customizing controls](#annotation) with `argTypes` annotation for more information. -
+ This replaces the input with a radio group for a more intuitive experience. @@ -229,9 +229,11 @@ As shown above, you can configure individual controls with the “control" annot | | `color` | Provides a color picker component to handle color values.
Can be additionally configured to include a set of color presets.
`argTypes: { color: { control: { type: 'color', presetColors: ['red', 'green']} }}` | | | `date` | Provides a datepicker component to handle date selection. `argTypes: { startDate: { control: 'date' }}` | -
-💡 The date control will convert the date into a UNIX timestamp when the value changes. It's a known limitation that will be fixed in a future release. If you need to represent the actual date, you'll need to update the story's implementation and convert the value into a date object. -
+ + +The date control will convert the date into a UNIX timestamp when the value changes. It's a known limitation that will be fixed in a future release. If you need to represent the actual date, you'll need to update the story's implementation and convert the value into a date object. + + @@ -248,9 +250,11 @@ As shown above, you can configure individual controls with the “control" annot -
-💡 Numeric data types will default to a number control unless additional configuration is provided. -
+ + +Numeric data types will default to a number control unless additional configuration is provided. + + ### Parameters @@ -339,11 +343,11 @@ The previous example also removed the prop documentation from the table. In some -
+ 💡 As with other Storybook properties, such as [decorators](../writing-stories/decorators.md), you can apply the same pattern at a story level for more granular cases. -
+ ### Conditional controls diff --git a/docs/essentials/highlight.md b/docs/essentials/highlight.md index 190cfe1e84f8..0968be5d36cc 100644 --- a/docs/essentials/highlight.md +++ b/docs/essentials/highlight.md @@ -26,11 +26,11 @@ To highlight DOM elements with the addon, you'll need to emit the `HIGHLIGHT` ev -
+ -💡 We recommend choosing the most specific selector possible to avoid highlighting elements other addons use. This is because the addon tries to match selectors against the entire DOM tree. +We recommend choosing the most specific selector possible to avoid highlighting elements other addons use. This is because the addon tries to match selectors against the entire DOM tree. -
+ ### Reset highlighted elements @@ -52,11 +52,11 @@ Out of the box, Storybook automatically removes highlighted elements when transi -
+ -ℹ️ The `emit` function derived from the `useChannel` API hook creates a communication channel in Storybook's UI to listen for events and update the UI accordingly. The Highlight addon uses this channel to listen to custom events and update the highlighted elements (if any) accordingly. +The `emit` function derived from the `useChannel` API hook creates a communication channel in Storybook's UI to listen for events and update the UI accordingly. The Highlight addon uses this channel to listen to custom events and update the highlighted elements (if any) accordingly. -
+ ## Customize style diff --git a/docs/essentials/interactions.md b/docs/essentials/interactions.md index 6baff2197774..bbc1207e7cca 100644 --- a/docs/essentials/interactions.md +++ b/docs/essentials/interactions.md @@ -45,11 +45,11 @@ Next, update [`.storybook/main.js|ts`](../configure/overview.md#configure-story- -
+ -💡 Make sure to list `@storybook/addon-interactions` **after** the [`@storybook/addon-essentials`](./introduction.md) addon (or the [`@storybook/addon-actions`](./actions.md) if you've installed it individually). +Make sure to list `@storybook/addon-interactions` **after** the [`@storybook/addon-essentials`](./introduction.md) addon (or the [`@storybook/addon-actions`](./actions.md) if you've installed it individually). -
+ Now when you run Storybook, the Interactions addon will be enabled. @@ -83,8 +83,8 @@ While you can refer to the [Testing Library documentation](https://testing-libra Any `args` that have been marked as an Action, either using the [argTypes annotation](./actions.md#action-argtype-annotation) or the [argTypesRegex](./actions.md#automatically-matching-args), will be automatically converted to a [Jest mock function](https://jestjs.io/docs/mock-function-api) (spy). This allows you to make assertions about calls to these functions. -
+ -ℹ️ To mock functions in your Storybook stories for reliable and isolated component testing, use the `jest` import from `@storybook/jest`. This allows you to avoid configuring Jest globally in your project. +To mock functions in your Storybook stories for reliable and isolated component testing, use the `jest` import from `@storybook/jest`. This allows you to avoid configuring Jest globally in your project. -
+ diff --git a/docs/essentials/introduction.md b/docs/essentials/introduction.md index 7a16ef0962d9..4e89178bad28 100644 --- a/docs/essentials/introduction.md +++ b/docs/essentials/introduction.md @@ -117,8 +117,8 @@ For example, if you wanted to disable the [backgrounds addon](./backgrounds.md), -
+ -💡 You can use the following keys for each individual addon: `actions`, `backgrounds`, `controls`, `docs`, `viewport`, `toolbars`, `measure`, `outline`, and `highlight`. +You can use the following keys for each individual addon: `actions`, `backgrounds`, `controls`, `docs`, `viewport`, `toolbars`, `measure`, `outline`, and `highlight`. -
+ diff --git a/docs/essentials/measure-and-outline.md b/docs/essentials/measure-and-outline.md index e4937e793dce..d4ebe622d6e1 100644 --- a/docs/essentials/measure-and-outline.md +++ b/docs/essentials/measure-and-outline.md @@ -16,9 +16,11 @@ With Storybook's Measure addon, you can quickly visualize each component's measu -
-💡 Alternatively you can press the m key on your keyboard to toggle the addon. -
+ + +Alternatively you can press the m key on your keyboard to toggle the addon. + + ## Outline addon diff --git a/docs/essentials/toolbars-and-globals.md b/docs/essentials/toolbars-and-globals.md index aac0ecb0ea20..6f7e2916daa0 100644 --- a/docs/essentials/toolbars-and-globals.md +++ b/docs/essentials/toolbars-and-globals.md @@ -29,11 +29,11 @@ Storybook has a simple, declarative syntax for configuring toolbar menus. In you -
+ -💡 As globals are _global_ you can _only_ set `globalTypes` in [`.storybook/preview.js|ts`](../configure/overview.md#configure-story-rendering). +As globals are _global_ you can _only_ set `globalTypes` in [`.storybook/preview.js|ts`](../configure/overview.md#configure-story-rendering). -
+ When you start your Storybook, you should see a new dropdown with the `light` and `dark` options in your toolbar. @@ -127,18 +127,18 @@ In your [`.storybook/preview.js|ts`](../configure/overview.md#configure-story-re -
+ -💡 The `icon` element used in the examples loads the icons from the `@storybook/components` package. See [here](../faq.md#what-icons-are-available-for-my-toolbar-or-my-addon) for the list of available icons that you can use. +The `icon` element used in the examples loads the icons from the `@storybook/components` package. See [here](../faq.md#what-icons-are-available-for-my-toolbar-or-my-addon) for the list of available icons that you can use. -
+ -
+ -💡 The `@storybook/addon-toolbars` addon is required to use toolbars. The toolbars addon is included by default in +The `@storybook/addon-toolbars` addon is required to use toolbars. The toolbars addon is included by default in `@storybook/addon-essentials`. -
+ By adding the configuration element `right`, the text will be displayed on the right side in the toolbar menu once you connect it to a decorator. @@ -181,9 +181,9 @@ Using the example above, you can modify any story to retrieve the **Locale** `gl -
+ -💡 In Storybook 6.0, if you set the global option `passArgsFirst: false` for backward compatibility, the story context is passed as the first argument: +In Storybook 6.0, if you set the global option `passArgsFirst: false` for backward compatibility, the story context is passed as the first argument: @@ -201,7 +201,7 @@ Using the example above, you can modify any story to retrieve the **Locale** `gl -
+ ## Consuming globals from within an addon diff --git a/docs/faq.md b/docs/faq.md index b26eb9ec12fe..a03b60cc9d52 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -91,9 +91,11 @@ Create React App does not allow providing options to Jest in your `package.json` npm test -- --coverage --collectCoverageFrom='["src/**/*.{js,jsx}","!src/**/stories/*"]' ``` -
-💡 If you're using yarn as a package manager, you'll need to adjust the command accordingly. -
+ + + If you're using yarn as a package manager, you'll need to adjust the command accordingly. + + ## I see `ReferenceError: React is not defined` when using Storybook with Next.js @@ -163,9 +165,11 @@ export default { }; ``` -
-💡 Fast Refresh only works in development mode with React 16.10 or higher. -
+ + +Fast Refresh only works in development mode with React 16.10 or higher. + + ## How do I setup the new React Context Root API with Storybook? @@ -343,9 +347,12 @@ We're only covering versions 5.3 and 5.0 as they were important milestones for S | | Frameworks | [See current documentation](./api/new-frameworks.md) | Non existing feature or undocumented | Non existing feature or undocumented | | | CLI options | [See current documentation](./api/cli-options.md) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.3/docs/src/pages/configurations/cli-options) | [See versioned documentation](https://github.com/storybookjs/storybook/tree/release/5.0/docs/src/pages/configurations/cli-options) | -
+ + + With the release of version 5.3, we've updated how you can write your stories more compactly and easily. It doesn't mean that the storiesOf format has been removed. For the time being, we're still supporting it, and we have documentation for it. But be advised that this is bound to change in the future. -
+ + ## What icons are available for my toolbar or my addon? @@ -364,9 +371,11 @@ We recommend that you use [http-server](https://www.npmjs.com/package/http-serve npx http-server storybook-static ``` -
+ + Suppose you don't want to run the command above frequently. Add http-server as a development dependency and create a new script to preview your production build of Storybook. -
+ + ## Can I use Storybook with Vue 3? diff --git a/docs/get-started/install.md b/docs/get-started/install.md index ca46008635c3..beceee7c0401 100644 --- a/docs/get-started/install.md +++ b/docs/get-started/install.md @@ -18,11 +18,11 @@ Use the Storybook CLI to install it in a single command. Run this inside your _e -
+ -If you run into issues with the installation, check the [Troubleshooting section](#troubleshooting) below for guidance on how to solve it. +Check the [Troubleshooting section](#troubleshooting) below for guidance on how to solve it. -
+
@@ -110,11 +110,11 @@ Below are some of the most common installation issues and instructions on how to -
+ Storybook collects completely anonymous data to help us improve user experience. Participation is optional, and you may [opt-out](../configure/telemetry.md#how-to-opt-out) if you'd not like to share any information. -
+ If all else fails, try asking for [help](https://storybook.js.org/community#support) diff --git a/docs/get-started/why-storybook.md b/docs/get-started/why-storybook.md index 39451d4ee4b7..7322d2d57c2e 100644 --- a/docs/get-started/why-storybook.md +++ b/docs/get-started/why-storybook.md @@ -83,7 +83,7 @@ During development, run it in a separate node process. If you’re working on UI
-Does Storybook work with X? +Does Storybook work with my favorite libraries? Storybook aims to integrate with industry-standard tools and platforms to simplify setup. Thanks to our ambitious developer community, we’ve made significant progress. There are hundreds of [addons](https://storybook.js.org/addons/) and tutorials that walk through how to set up Storybook in all types of projects. diff --git a/docs/sharing/design-integrations.md b/docs/sharing/design-integrations.md index cf2e5ac4934c..d2211a7b52d9 100644 --- a/docs/sharing/design-integrations.md +++ b/docs/sharing/design-integrations.md @@ -43,9 +43,11 @@ In Figma, select the component, open the plugin, and paste the URL. Chromatic will automatically update your linked stories to reflect the most recent Storybook published on the branch you linked. That means the link persists even as you push new code. -
-💡 The plugin does not support linking stories to Figma layers. -
+ + +The plugin does not support linking stories to Figma layers. + + #### View stories in Figma diff --git a/docs/sharing/package-composition.md b/docs/sharing/package-composition.md index b7b798936c50..ba94040b90b0 100644 --- a/docs/sharing/package-composition.md +++ b/docs/sharing/package-composition.md @@ -6,11 +6,11 @@ Storybook is widely used by component libraries and design systems. Design syste For example, if you use a design system package, its stories can appear alongside your own. That makes it convenient to cross reference usage documentation without leaving Storybook. -
+ Composition via a package requires a secure integration between the service where you publish Storybook and Storybook’s own APIs. We recommend [publishing Storybook to Chromatic](./publish-storybook.md#publish-storybook-with-chromatic) for full support of these features. -
+ ## For consumers diff --git a/docs/sharing/publish-storybook.md b/docs/sharing/publish-storybook.md index 96d4a1eaefb6..0c19cb4697c3 100644 --- a/docs/sharing/publish-storybook.md +++ b/docs/sharing/publish-storybook.md @@ -31,11 +31,11 @@ First, we'll need to build Storybook as a static web application. The functional -
+ -💡 You can provide additional flags to customize the command. Read more about the flag options [here](../api/cli-options.md). +You can provide additional flags to customize the command. Read more about the flag options [here](../api/cli-options.md). -
+ Storybook will create a static web application capable of being served by any web server. Preview it locally by running the following command: @@ -103,11 +103,11 @@ In your project's root directory, add a new file called `chromatic.yml` inside t -
+ -💡 Secrets are secure environment variables provided by GitHub so that you don't need to hard code your `project-token`. Read the [official documentation](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) to learn how to configure them. +Secrets are secure environment variables provided by GitHub so that you don't need to hard code your `project-token`. Read the [official documentation](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) to learn how to configure them. -
+ Commit and push the file. Congratulations, you've successfully automated publishing your Storybook. Now whenever you open a PR you’ll get a handy link to your published Storybook in your PR checks. @@ -134,11 +134,11 @@ When you publish Storybook, you also get component history and versioning down t Since Storybook is built as a static web application, you can also publish it to any web host, including [GitHub Pages](https://docs.github.com/en/pages), [Netlify](https://www.netlify.com/), [AWS S3](https://aws.amazon.com/s3/), and more. However, features such as [Composition](./storybook-composition.md), [embedding stories](./embed.md), history, and versioning require tighter integration with Storybook APIs and secure authentication. Your hosting provider may not be capable of supporting these features. Learn about the Component Publishing Protocol (CPP) to see what. -
+ -ℹ️ Additional header configuration may be required to serve Storybook's static files correctly on your host. For more information on the required headers, see the [Migration guide](https://github.com/storybookjs/storybook/blob/main/MIGRATION.md#deploying-build-artifacts). +Additional header configuration may be required to serve Storybook's static files correctly on your host. For more information on the required headers, see the [Migration guide](https://github.com/storybookjs/storybook/blob/main/MIGRATION.md#deploying-build-artifacts). -
+
diff --git a/docs/sharing/storybook-composition.md b/docs/sharing/storybook-composition.md index 04aa8440c533..a9e50a8c54d4 100644 --- a/docs/sharing/storybook-composition.md +++ b/docs/sharing/storybook-composition.md @@ -30,9 +30,11 @@ In your [`.storybook/main.js`](../configure/overview.md#configure-story-renderin -
- 💡 Limitation: Addons in composed Storybooks will not work as they normally do in a non-composed Storybook. -
+ + +Limitation: Addons in composed Storybooks will not work as they normally do in a non-composed Storybook. + + ## Compose local Storybooks @@ -66,11 +68,11 @@ You can also compose Storybooks based on the current development environment (e. -
+ -💡 Similar to the other fields available in Storybook’s configuration file, the `refs` field can also be a function that accepts a config parameter containing Storybook’s configuration object. Check the [Webpack documentation](../builders/webpack.md#override-the-default-configuration) to learn more about it. +Similar to the other fields available in Storybook’s configuration file, the `refs` field can also be a function that accepts a config parameter containing Storybook’s configuration object. Check the [Webpack documentation](../builders/webpack.md#override-the-default-configuration) to learn more about it. -
+ ## Improve your Storybook composition @@ -91,11 +93,11 @@ If you're using Storybook 6.4, or higher, you can optimize your composition via -
+ -💡 If you already enabled automatic code splitting via the [`storyStoreV7`](https://storybook.js.org/docs/react/builders/webpack#code-splitting), you won't need this flag as it will automatically generate the `index.json` file. +If you already enabled automatic code splitting via the [`storyStoreV7`](https://storybook.js.org/docs/react/builders/webpack#code-splitting), you won't need this flag as it will automatically generate the `index.json` file. -
+ When you compose a Storybook featuring this flag, it will use the information retrieved from the file to populate the UI with your composed Storybook stories automatically. Here's an example of the output generated by the `index.json` file: @@ -117,11 +119,11 @@ If you're working with an outdated Storybook version or have a project-specific npx storybook extract ``` -
+ -💡 `storybook extract` uses [Puppeteer](https://www.npmjs.com/package/puppeteer), which downloads and installs Chromium. Set the environment `SB_CHROMIUM_PATH` to configure your local Chromium installation. +`storybook extract` uses [Puppeteer](https://www.npmjs.com/package/puppeteer), which downloads and installs Chromium. Set the environment `SB_CHROMIUM_PATH` to configure your local Chromium installation. -
+ Although a good approach to improve composition, it comes with a cost, as it will require an additional dependency being added and increased build times. Once it finishes executing, it will generate an `index.json` file in the default build directory (`storybook-static`) with the information related to your Storybook. Here’s an example of the file contents: @@ -145,8 +147,8 @@ npx storybook extract my-built-storybook-directory my-other-directory/index.json When executed, it will look up a built Storybook in the `my-built-storybook-directory` and create the `index.json` file in the `my-other-directory` with all the necessary information. -
+ -💡 If you need to use the arguments, you’ll need to include both of them, or the command will fail. +If you need to use the arguments, you’ll need to include both of them, or the command will fail. -
+ diff --git a/docs/writing-docs/autodocs.md b/docs/writing-docs/autodocs.md index 10e2c730d076..bbf0e0d3e7d6 100644 --- a/docs/writing-docs/autodocs.md +++ b/docs/writing-docs/autodocs.md @@ -68,11 +68,11 @@ To replace the default documentation template used by Storybook, you can extend -
+ -💡 Internally, Storybook uses a similar implementation to generate the default template. See the Doc Blocks [API reference](./doc-blocks.md#available-blocks) to learn more about how Doc Blocks work. +Internally, Storybook uses a similar implementation to generate the default template. See the Doc Blocks [API reference](./doc-blocks.md#available-blocks) to learn more about how Doc Blocks work. -
+ Going over the code snippet in more detail. When Storybook starts up, it will override the default template with the custom one composed of the following: @@ -107,11 +107,11 @@ Then you can use it in your `.storybook/preview.js` or an individual story file -
+ -💡 If you only need to override the documentation page for a single component, we recommend creating an MDX file and referencing it directly via the `` Doc Block. +If you only need to override the documentation page for a single component, we recommend creating an MDX file and referencing it directly via the `` Doc Block. -
+ ### Generate a table of contents @@ -141,11 +141,11 @@ By default, the table of contents on the documentation page will only show the ` | `title` | Defines a title caption for the table of contents.
Accepts one of: `string`, `null`, React element
`toc: { title: 'Table of Contents' }` | | `unsafeTocbotOptions` | Provides additional [`TocBot`](https://tscanlin.github.io/tocbot/) configuration options
`toc: { unsafeTocbotOptions: { orderedList: true } }` | -
+ -ℹ️ The `contentsSelector`, `headingSelector`, and `ignoreSelector` properties allow additional customization. For more information on using them, see the [`Tocbot` documentation](https://tscanlin.github.io/tocbot/). +The `contentsSelector`, `headingSelector`, and `ignoreSelector` properties allow additional customization. For more information on using them, see the [`Tocbot` documentation](https://tscanlin.github.io/tocbot/). -
+ @@ -227,11 +227,11 @@ Out of the box, Storybook has a set of components that you can use to customize -
+ -💡 This is not a Storybook issue but a breaking change introduced with MDX 2. For more information on this and other breaking changes, see our [MDX documentation](./mdx.md#breaking-changes). +This is not a Storybook issue but a breaking change introduced with MDX 2. For more information on this and other breaking changes, see our [MDX documentation](./mdx.md#breaking-changes). -
+ ## Troubleshooting diff --git a/docs/writing-docs/doc-blocks.md b/docs/writing-docs/doc-blocks.md index 3a0da4aeb6f7..faacdf5fa588 100644 --- a/docs/writing-docs/doc-blocks.md +++ b/docs/writing-docs/doc-blocks.md @@ -107,11 +107,11 @@ For example, you can filter out the `style` prop from all [`Controls`](../api/do -
+ -ℹ️ Parameters can also be defined at the [component](../writing-stories/parameters.md#component-parameters) (or meta) level or the [story](../writing-stories/parameters.md#story-parameters) level, allowing you to customize Doc Blocks exactly as you need, where you need. +Parameters can also be defined at the [component](../writing-stories/parameters.md#component-parameters) (or meta) level or the [story](../writing-stories/parameters.md#story-parameters) level, allowing you to customize Doc Blocks exactly as you need, where you need. -
+ The blocks that accept customization via parameters are marked in the list of available blocks below. @@ -129,11 +129,11 @@ Each block has a dedicated API reference page detailing usage, available options ### [ArgTypes](../api/doc-block-argtypes.md) -
+ Accepts parameters in the namespace `parameters.docs.argTypes`. -
+ The `ArgTypes` block can be used to show a static table of [arg types](../api/argtypes.md) for a given component as a way to document its interface. @@ -141,11 +141,11 @@ The `ArgTypes` block can be used to show a static table of [arg types](../api/ar ### [Canvas](../api/doc-block-canvas.md) -
+ Accepts parameters in the namespace `parameters.docs.canvas`. -
+ The `Canvas` block is a wrapper around a [`Story`](../api/doc-block-story.md), featuring a toolbar that allows you to interact with its content while automatically providing the required [`Source`](../api/doc-block-source.md) snippets. @@ -159,11 +159,11 @@ The `ColorPalette` block allows you to document all color-related items (e.g., s ### [Controls](../api/doc-block-controls.md) -
+ Accepts parameters in the namespace `parameters.docs.controls`. -
+ The `Controls` block can be used to show a dynamic table of args for a given story, as a way to document its interface, and to allow you to change the args for a (separately) rendered story (via the [`Story`](../api/doc-block-story.md) or [`Canvas`](../api/doc-block-canvas.md) blocks). @@ -202,11 +202,11 @@ The `Primary` block displays the primary (first defined in the stories file) sto ### [Source](../api/doc-block-source.md) -
+ Accepts parameters in the namespace `parameters.docs.source`. -
+ The `Source` block is used to render a snippet of source code directly. @@ -220,11 +220,11 @@ The `Stories` block renders the full collection of stories in a stories file. ### [Story](../api/doc-block-story.md) -
+ Accepts parameters in the namespace `parameters.docs.story`. -
+ Stories (component tests) are Storybook's fundamental building blocks. diff --git a/docs/writing-docs/mdx.md b/docs/writing-docs/mdx.md index 00142cc29d3c..1c21d78dcca7 100644 --- a/docs/writing-docs/mdx.md +++ b/docs/writing-docs/mdx.md @@ -10,11 +10,11 @@ In addition, you can write pure documentation pages in MDX and add them to Story ![MDX simple example result](./mdx-hero.png) -
+ Writing stories directly in MDX was deprecated in Storybook 7. Please reference the [previous documentation](../../../release-6-5/docs/writing-docs/mdx.md) for guidance on that feature. -
+ ## Basic example @@ -63,11 +63,11 @@ The first thing you'll notice is that the component documentation is divided int - **CSF** is great for succinctly defining stories (component examples). If you use TypeScript, it also provides type safety and auto-completion. - **MDX** is great for writing structured documentation and composing it with interactive JSX elements. -
+ -💡 If you’re coming from a previous version of Storybook, you might be accustomed to using MDX both for **documentation** and for defining **stories** in the same `.stories.mdx` file. We’ve deprecated this functionality and plan to remove it in a future version of Storybook. We provide [migration](#automigration) scripts to help you onto the new format. +If you’re coming from a previous version of Storybook, you might be accustomed to using MDX both for **documentation** and for defining **stories** in the same `.stories.mdx` file. We’ve deprecated this functionality and plan to remove it in a future version of Storybook. We provide [migration](#automigration) scripts to help you onto the new format. -
+ ### Anatomy of MDX @@ -109,11 +109,11 @@ Imports the components and stories that will be used in the JSX throughout the r -
+ -ℹ️ When providing the `of` prop to the `Meta` block, make sure that you're referencing the [**default export**](../api/csf.md#default-export) of the story file and not the component itself to prevent render issues with the generated documentation. +When providing the `of` prop to the `Meta` block, make sure that you're referencing the [**default export**](../api/csf.md#default-export) of the story file and not the component itself to prevent render issues with the generated documentation. -
+ The `Meta` block defines where the document will be placed in the sidebar. In this case, it is adjacent to the Checkbox’s stories. By default, the docs sidebar node is titled `"Docs"`, but this can be customized by passing a `name` prop (e.g., ``). If you want to place a docs node at an arbitrary point in the navigation hierarchy, you can use the `title` prop (e.g., ``). @@ -200,11 +200,11 @@ paths={[ -
+ -💡 The [`remark-gfm`](https://github.com/remarkjs/remark-gfm) package isn't provided by default during migration. We recommend installing it as a development dependency if you use its features. +The [`remark-gfm`](https://github.com/remarkjs/remark-gfm) package isn't provided by default during migration. We recommend installing it as a development dependency if you use its features. -
+ ### Automigration @@ -276,11 +276,11 @@ However, providing the `Meta` Doc Block may not be required for certain use case -
+ -💡 If you're overriding an existing auto-generated documentation page enabled via [`tags`](./autodocs.md#setup-automated-docs) configuration property, we recommend removing it to avoid errors. +If you're overriding an existing auto-generated documentation page enabled via [`tags`](./autodocs.md#setup-automated-docs) configuration property, we recommend removing it to avoid errors. -
+ Once the custom MDX documentation is loaded, Storybook will infer the title and location using the same heuristic rules to generate [auto-title stories](../configure/sidebar-and-urls.md#csf-30-auto-titles) and render it in the sidebar as a `Docs` entry. @@ -344,11 +344,11 @@ If you need to extend your documentation with additional content written in Mark -
+ -ℹ️ The `Markdown` Doc Block provides additional configuration options to customize the rendering of your documentation. For more information, refer to the [API documentation](../api/doc-block-markdown.md). +The `Markdown` Doc Block provides additional configuration options to customize the rendering of your documentation. For more information, refer to the [API documentation](../api/doc-block-markdown.md). -
+ ![Changelog markdown in an MDX story](./mdx-markdown-docs-import.png) @@ -376,9 +376,11 @@ However, cross-linking documentation isn't restricted to documentation pages. Yo -
-💡 By applying this pattern with the Controls addon, all anchors will be ignored in Canvas based on how Storybook handles URLs to track the args values. -
+ + +By applying this pattern with the Controls addon, all anchors will be ignored in Canvas based on how Storybook handles URLs to track the args values. + + ## Troubleshooting @@ -435,9 +437,11 @@ Start by running the following command inside your project directory: npx @hipster/mdx2-issue-checker ``` -
-💡 Depending on the volume, you may be required to run the command multiple times to fix all the issues. -
+ + +Depending on the volume, you may be required to run the command multiple times to fix all the issues. + + When it finishes, it will output the list of files causing issues. You can then use this information to fix the problems manually. diff --git a/docs/writing-stories/args.md b/docs/writing-stories/args.md index 26a61edfb322..e2553cfd6972 100644 --- a/docs/writing-stories/args.md +++ b/docs/writing-stories/args.md @@ -104,11 +104,11 @@ You can also define args at the global level; they will apply to every component -
+ -💡 For most uses of global args, [globals](../essentials/toolbars-and-globals.md) are a better tool for defining globally-applied settings, such as a theme. Using globals enables users to change the value with the toolbar menu. +For most uses of global args, [globals](../essentials/toolbars-and-globals.md) are a better tool for defining globally-applied settings, such as a theme. Using globals enables users to change the value with the toolbar menu. -
+ ## Args composition @@ -130,11 +130,11 @@ You can separate the arguments to a story to compose in other stories. Here's ho -
+ -💡 If you find yourself re-using the same args for most of a component's stories, you should consider using [component-level args](#component-args). +If you find yourself re-using the same args for most of a component's stories, you should consider using [component-level args](#component-args). -
+ Args are useful when writing stories for composite components that are assembled from other components. Composite components often pass their arguments unchanged to their child components, and similarly, their stories can be compositions of their child components stories. With args, you can directly compose the arguments: @@ -287,7 +287,9 @@ In Storybook 5 and before we passed the context as the first argument. If you’ -
- 💡 Note that `args` is still available as a key in the context. -
+ + + Note that `args` is still available as a key in the context. + +
diff --git a/docs/writing-stories/build-pages-with-storybook.md b/docs/writing-stories/build-pages-with-storybook.md index 07db61971f27..34dbc40c1274 100644 --- a/docs/writing-stories/build-pages-with-storybook.md +++ b/docs/writing-stories/build-pages-with-storybook.md @@ -101,11 +101,11 @@ Run the following commands to install MSW, the addon, and generate a mock servic -
+ -💡 If you're working with Angular, you'll need to adjust the command to save the mock service worker file in a different directory (e.g., `src`). +If you're working with Angular, you'll need to adjust the command to save the mock service worker file in a different directory (e.g., `src`). -
+ Update your `.storybook/preview.js` file and enable the addon via a [global decorator](./decorators.md#global-decorators). @@ -170,9 +170,11 @@ To test your screen with the mocked data, you could write a similar set of stori -
-💡 This example details how you can mock the REST request with fetch. Similar HTTP clients such as axios can be used as well. -
+ + +This example details how you can mock the REST request with fetch. Similar HTTP clients such as axios can be used as well. + + The mocked data (i.e., `TestData`) will be injected via [parameters](./parameters.md), enabling you to configure it per-story basis. @@ -306,11 +308,11 @@ ProfilePageContainer.js ProfilePageContext.js ``` -
+ It’s also often helpful to set up a “global” container context (perhaps named `GlobalContainerContext`) for container components that may be rendered on every page of your app and add them to the top level of your application. While it’s possible to place every container within this global context, it should only provide globally required containers. -
+ Let’s look at an example implementation of this approach. @@ -357,11 +359,11 @@ In the context of Storybook, instead of providing container components through c -
+ If the same context applies to all `ProfilePage` stories, we can use a [decorator](./decorators.md). -
+ #### Providing containers to your application diff --git a/docs/writing-stories/decorators.md b/docs/writing-stories/decorators.md index d8637bf72fef..ef45eec4c3c9 100644 --- a/docs/writing-stories/decorators.md +++ b/docs/writing-stories/decorators.md @@ -77,9 +77,11 @@ The second argument to a decorator function is the **story context** which in pa - `parameters`- the story's static metadata, most commonly used to control Storybook's behavior of features and addons. - `viewMode`- Storybook's current active window (e.g., canvas, docs). -
-💡 This pattern can also be applied to your own stories. Some of Storybook's supported frameworks already use it (e.g., vue 2). -
+ + +This pattern can also be applied to your own stories. Some of Storybook's supported frameworks already use it (e.g., vue 2). + + ### Using decorators to provide data diff --git a/docs/writing-stories/introduction.md b/docs/writing-stories/introduction.md index 82905a323984..146261d9af56 100644 --- a/docs/writing-stories/introduction.md +++ b/docs/writing-stories/introduction.md @@ -47,11 +47,11 @@ The _default_ export metadata controls how Storybook lists your stories and prov -
+ Starting with Storybook version 7.0, story titles are analyzed statically as part of the build process. The _default_ export must contain a `title` property that can be read statically or a `component` property from which an automatic title can be computed. Using the `id` property to customize your story URL must also be statically readable. -
+ ### Defining stories @@ -99,9 +99,11 @@ Use the _named_ exports of a CSF file to define your component’s stories. We r -
-💡 The recommendation mentioned above also applies to other frameworks, not only React. -
+ + +The recommendation mentioned above also applies to other frameworks, not only React. + + @@ -124,9 +126,11 @@ Use the _named_ exports of a CSF file to define your component’s stories. We r -
-💡 The recommendation mentioned above also applies to other frameworks, not only Solid. -
+ + +The recommendation mentioned above also applies to other frameworks, not only Solid. + + @@ -426,8 +430,8 @@ You can also reuse stories from the child `ListItem` in your `List` component. T -
+ -💡 Note that there are disadvantages in writing stories like this as you cannot take full advantage of the args mechanism and composing args as you build even more complex composite components. For more discussion, see the [multi component stories](../writing-stories/stories-for-multiple-components.md) workflow documentation. +Note that there are disadvantages in writing stories like this as you cannot take full advantage of the args mechanism and composing args as you build even more complex composite components. For more discussion, see the [multi component stories](../writing-stories/stories-for-multiple-components.md) workflow documentation. -
+ diff --git a/docs/writing-stories/naming-components-and-hierarchy.md b/docs/writing-stories/naming-components-and-hierarchy.md index 84cc47d70e0d..5757a2eda12a 100644 --- a/docs/writing-stories/naming-components-and-hierarchy.md +++ b/docs/writing-stories/naming-components-and-hierarchy.md @@ -127,11 +127,11 @@ Out of the box, Storybook sorts stories based on the order in which they are imp -
+ -ℹ️ Asides from the unique story identifier, you can also use the `title`, `name`, and import path to sort your stories using the `storySort` function. +Asides from the unique story identifier, you can also use the `title`, `name`, and import path to sort your stories using the `storySort` function. -
+ The `storySort` can also accept a configuration object. diff --git a/docs/writing-stories/play-function.md b/docs/writing-stories/play-function.md index a511792ffdd3..b83d22b3612f 100644 --- a/docs/writing-stories/play-function.md +++ b/docs/writing-stories/play-function.md @@ -57,11 +57,11 @@ Storybook's `play` functions are small code snippets that run once the story fin -
+ -💡 See the [Interaction testing documentation](../writing-tests/interaction-testing.md#api-for-user-events) for an overview of the available API events. +See the [Interaction testing documentation](../writing-tests/interaction-testing.md#api-for-user-events) for an overview of the available API events. -
+ When Storybook finishes rendering the story, it executes the steps defined within the `play` function, interacting with the component and filling the form's information. All of this without the need for user intervention. If you check your `Interactions` panel, you'll see the step-by-step flow. @@ -187,9 +187,11 @@ If you need, you can also adjust your `play` function to find elements based on -
- 💡 You can read more about the querying elements in the Testing library documentation. -
+ + +You can read more about the querying elements in the Testing library documentation. + + When Storybook loads the story, the `play` function starts its execution and queries the DOM tree expecting the element to be available when the story renders. In case there's a failure in your test, you'll be able to verify its root cause quickly. diff --git a/docs/writing-stories/stories-for-multiple-components.md b/docs/writing-stories/stories-for-multiple-components.md index f1f8c47b7bea..90e31f88f937 100644 --- a/docs/writing-stories/stories-for-multiple-components.md +++ b/docs/writing-stories/stories-for-multiple-components.md @@ -62,11 +62,11 @@ The `children` `args` as any other arg needs to be JSON serializable. It means t As they could lead into errors with your Storybook. -
+ We're currently working on improving the overall experience for the children arg and allow you to edit children arg in a control and allow you to use other types of components in the near future. But for now you need to factor in this caveat when you're implementing your stories. -
+ ## Creating a Template Component diff --git a/docs/writing-stories/typescript.md b/docs/writing-stories/typescript.md index 17d2c0b6eaca..0b7bba1a74c6 100644 --- a/docs/writing-stories/typescript.md +++ b/docs/writing-stories/typescript.md @@ -34,9 +34,9 @@ The example above passes a component type. See [**Typing custom args**](#typing- -
+ -ℹ️ We are not yet able to provide additional type safety using the `satisfies` operator with Angular and Web components. +We are not yet able to provide additional type safety using the `satisfies` operator with Angular and Web components.
More info @@ -49,7 +49,7 @@ For more information, please refer to [this discussion](https://github.com/story
-
+
diff --git a/docs/writing-tests/accessibility-testing.md b/docs/writing-tests/accessibility-testing.md index d6dbba00d27a..5d404fb3248f 100644 --- a/docs/writing-tests/accessibility-testing.md +++ b/docs/writing-tests/accessibility-testing.md @@ -203,11 +203,11 @@ Add a new [configuration file](./test-runner.md#test-hook-api-experimental) insi -
+ -💡 `preRender` and `postRender` are convenient hooks that allow you to extend the test runner's default configuration. They are **experimental** and subject to changes. Read more about them [here](./test-runner.md#test-hook-api-experimental). +`preRender` and `postRender` are convenient hooks that allow you to extend the test runner's default configuration. They are **experimental** and subject to changes. Read more about them [here](./test-runner.md#test-hook-api-experimental). -
+ When you execute the test runner (for example, with `yarn test-storybook`), it will run the accessibility audit and any [interaction tests](./interaction-testing.md) you might have configured for each component story. diff --git a/docs/writing-tests/interaction-testing.md b/docs/writing-tests/interaction-testing.md index 8f0fdd9cbab8..4080ce51ee5e 100644 --- a/docs/writing-tests/interaction-testing.md +++ b/docs/writing-tests/interaction-testing.md @@ -170,11 +170,11 @@ Storybook only runs the interaction test when you're viewing a story. Therefore, ![Interaction test with test runner](./storybook-interaction-test-runner-loginform-optimized.png) -
+ -💡 If you need, you can provide additional flags to the test-runner. Read the [documentation](./test-runner.md#cli-options) to learn more. +If you need, you can provide additional flags to the test-runner. Read the [documentation](./test-runner.md#cli-options) to learn more. -
+ ## Automate diff --git a/docs/writing-tests/snapshot-testing.md b/docs/writing-tests/snapshot-testing.md index 69b0c17c680a..8956db91bf0b 100644 --- a/docs/writing-tests/snapshot-testing.md +++ b/docs/writing-tests/snapshot-testing.md @@ -49,11 +49,11 @@ There are many other configuration options available, such as watch mode and cov ## Set up Storyshots -
+ -⛔️ Storyshots has been deprecated in favor of [test runner](./test-runner.md), which you can use for both snapshot and [visual testing](./visual-testing.md). +Storyshots has been deprecated in favor of [test runner](./test-runner.md), which you can use for both snapshot and [visual testing](./visual-testing.md). -
+ [Storyshots](https://storybook.js.org/addons/@storybook/addon-storyshots/) is a Storybook addon that enables snapshot testing, powered by [Jest](https://jestjs.io/docs/getting-started). @@ -82,9 +82,11 @@ Add a test file to your environment with the following contents to configure Sto -
-💡 You can name the test file differently to suit your needs. Bear in mind that it requires to be picked up by Jest. -
+ + +You can name the test file differently to suit your needs. Bear in mind that it requires to be picked up by Jest. + + Run your first test. Storyshots will recognize your stories (based on [.storybook/main.js's setup](https://storybook.js.org/docs/react/configure/story-rendering)) and save them in the **snapshots** directory. @@ -124,9 +126,11 @@ Next, update your test file (for example, `storybook.test.js`) to the following: -
-💡 Don't forget to replace your-custom-directory with your own. -
+ + +Don't forget to replace your-custom-directory with your own. + + When you run your tests, the snapshots will be available in the directory you've specified. diff --git a/docs/writing-tests/stories-in-end-to-end-tests.md b/docs/writing-tests/stories-in-end-to-end-tests.md index 66e068a89a71..50fa58ae0688 100644 --- a/docs/writing-tests/stories-in-end-to-end-tests.md +++ b/docs/writing-tests/stories-in-end-to-end-tests.md @@ -29,10 +29,11 @@ An example of an end-to-end test with Cypress and Storybook is testing a login c -
- 💡 The play function contains small snippets of code that run after the story renders. It allows you to sequence interactions in stories. + -
+The play function contains small snippets of code that run after the story renders. It allows you to sequence interactions in stories. + + With Cypress, you could write the following test: @@ -75,9 +76,11 @@ A real-life scenario of user flow testing with Playwright would be how to test a -
- 💡 The play function contains small snippets of code that run after the story renders. It allows you to sequence interactions in stories. -
+ + +The play function contains small snippets of code that run after the story renders. It allows you to sequence interactions in stories. + + With Playwright, you can write a test to check if the inputs are filled and match the story: diff --git a/docs/writing-tests/stories-in-unit-tests.md b/docs/writing-tests/stories-in-unit-tests.md index f96a72c9fef2..c79c31c8a901 100644 --- a/docs/writing-tests/stories-in-unit-tests.md +++ b/docs/writing-tests/stories-in-unit-tests.md @@ -28,11 +28,11 @@ Run the following command to install the addon. -
+ -ℹ️ If you're using Storybook 7 or higher, the `@storybook/testing-vue3` addon is the only one we support. For Vue 2 users, refer to the [troubleshooting section](#troubleshooting) for additional guidance. +If you're using Storybook 7 or higher, the `@storybook/testing-vue3` addon is the only one we support. For Vue 2 users, refer to the [troubleshooting section](#troubleshooting) for additional guidance. -
+ @@ -53,11 +53,11 @@ Run the following command to install the addon. -
+ -💡 You can use Testing Library out-of-the-box with [Storybook Interaction Testing](./interaction-testing.md). +You can use Testing Library out-of-the-box with [Storybook Interaction Testing](./interaction-testing.md). -
+ Once the test runs, it loads the story and renders it. [Testing Library](https://testing-library.com/) then emulates the user's behavior and checks if the component state has been updated. diff --git a/docs/writing-tests/test-runner.md b/docs/writing-tests/test-runner.md index e75bee68c549..96b08331cd75 100644 --- a/docs/writing-tests/test-runner.md +++ b/docs/writing-tests/test-runner.md @@ -52,9 +52,11 @@ Start your Storybook with: -
-💡 Storybook's test runner requires either a locally running Storybook instance or a published Storybook to run all the existing tests. -
+ + +Storybook's test runner requires either a locally running Storybook instance or a published Storybook to run all the existing tests. + + Finally, open a new terminal window and run the test-runner with: @@ -151,11 +153,11 @@ If you're publishing your Storybook with services such as [Vercel](https://verce -
+ -💡 The published Storybook must be publicly available for this example to work. We recommend running the test server using the recipe [below](#run-against-non-deployed-storybooks) if it requires authentication. +The published Storybook must be publicly available for this example to work. We recommend running the test server using the recipe [below](#run-against-non-deployed-storybooks) if it requires authentication. -
+ ### Run against non-deployed Storybooks @@ -171,11 +173,11 @@ You can use your CI provider (for example, [GitHub Actions](https://github.com/f -
+ -💡 By default Storybook outputs the [build](../sharing/publish-storybook.md#build-storybook-as-a-static-web-application) to the `storybook-static` directory. If you're using a different build directory, you'll need to adjust the recipe accordingly. +By default Storybook outputs the [build](../sharing/publish-storybook.md#build-storybook-as-a-static-web-application) to the `storybook-static` directory. If you're using a different build directory, you'll need to adjust the recipe accordingly. -
+ ### What's the difference between Chromatic and Test runner? @@ -204,11 +206,11 @@ Listed below are the available hooks and an overview of how to use them. | `preRender` | Executes before a story is rendered
`async preRender(page, context) {}` | | `postRender` | Executes after the story is rendered
`async postRender(page, context) {}` | -
+ -💡 These test hooks are experimental and may be subject to breaking changes. We encourage you to test as much as possible within the story's [play function](../writing-stories/play-function.md). +These test hooks are experimental and may be subject to breaking changes. We encourage you to test as much as possible within the story's [play function](../writing-stories/play-function.md). -
+ To enable the hooks API, you'll need to add a new configuration file inside your Storybook directory and set them up as follows: @@ -223,11 +225,11 @@ To enable the hooks API, you'll need to add a new configuration file inside your -
+ -💡 Except for the `setup` function, all other functions run asynchronously. Both `preRender` and `postRender` functions include two additional arguments, a [Playwright page](https://playwright.dev/docs/pages) and a context object which contains the `id`, `title`, and the `name` of the story. +Except for the `setup` function, all other functions run asynchronously. Both `preRender` and `postRender` functions include two additional arguments, a [Playwright page](https://playwright.dev/docs/pages) and a context object which contains the `id`, `title`, and the `name` of the story. -
+ When the test-runner executes, your existing tests will go through the following lifecycle: @@ -273,11 +275,11 @@ Suppose you run into a situation where the local and remote Storybooks appear ou -
+ -💡 The `index.json` mode is not compatible with watch mode. +The `index.json` mode is not compatible with watch mode. -
+ If you need to disable it, use the `--no-index-json` flag: diff --git a/docs/writing-tests/visual-testing.md b/docs/writing-tests/visual-testing.md index 7e303fcfa4aa..c70ed93d37e9 100644 --- a/docs/writing-tests/visual-testing.md +++ b/docs/writing-tests/visual-testing.md @@ -42,11 +42,11 @@ Run the following command after the package finishes installing: npx chromatic --project-token ``` -
+ Don't forget to replace `your-project-token` with the one provided by Chromatic. -
+ ```shell Build 1 published. @@ -54,9 +54,11 @@ Build 1 published. View it online at https://www.chromatic.com/build?appId=...&number=1. ``` -
-💡 Before running Chromatic's CLI ensure you have at least two commits added to the repository to prevent build failures, as Chromatic relies on a full Git history graph to establish the baselines. Read more about baselines in Chromatic's documentation -
+ + +Before running Chromatic's CLI ensure you have at least two commits added to the repository to prevent build failures, as Chromatic relies on a full Git history graph to establish the baselines. Read more about baselines in Chromatic's documentation + + When Chromatic finishes, it should have successfully deployed your Storybook and established the baselines, that is to say, the starting point for all your component's stories. Additionally, providing you with a link to the published Storybook that you can share with your team to gather feedback. diff --git a/node_modules/.yarn-state.yml b/node_modules/.yarn-state.yml deleted file mode 100644 index a6b1a224e847..000000000000 --- a/node_modules/.yarn-state.yml +++ /dev/null @@ -1,10 +0,0 @@ -# Warning: This file is automatically generated. Removing it is fine, but will -# cause your node_modules installation to become invalidated. - -__metadata: - version: 1 - nmMode: classic - -"@storybook/root@workspace:.": - locations: - - "" From d082ca4ce03047fbec1503510116863d0ceb9b34 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Fri, 3 Nov 2023 18:07:26 +0100 Subject: [PATCH 053/115] Override the docs entry to make it completely empty --- code/lib/core-server/src/presets/common-override-preset.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/lib/core-server/src/presets/common-override-preset.ts b/code/lib/core-server/src/presets/common-override-preset.ts index eb1eae542400..916266e65bff 100644 --- a/code/lib/core-server/src/presets/common-override-preset.ts +++ b/code/lib/core-server/src/presets/common-override-preset.ts @@ -47,3 +47,10 @@ export const typescript: PresetProperty<'typescript', StorybookConfig> = async ( } return input; }; + +export const docs: PresetProperty<'docs', StorybookConfig> = async (input, options) => { + if (options?.build?.test?.removeAutoDocs) { + return {}; + } + return input; +}; From 792816837c8e0db2547de18a9ae7ef7e0fb8553b Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Fri, 3 Nov 2023 16:22:07 +0100 Subject: [PATCH 054/115] Disable telemetry for test builds --- code/lib/core-server/src/presets/common-preset.ts | 2 +- code/lib/core-server/src/withTelemetry.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts index a0042cb09063..90ed845ac164 100644 --- a/code/lib/core-server/src/presets/common-preset.ts +++ b/code/lib/core-server/src/presets/common-preset.ts @@ -169,7 +169,7 @@ const optionalEnvToBoolean = (input: string | undefined): boolean | undefined => */ export const core = async (existing: CoreConfig, options: Options): Promise => ({ ...existing, - disableTelemetry: options.disableTelemetry === true, + disableTelemetry: options.disableTelemetry === true || options.test === true, enableCrashReports: options.enableCrashReports || optionalEnvToBoolean(process.env.STORYBOOK_ENABLE_CRASH_REPORTS), }); diff --git a/code/lib/core-server/src/withTelemetry.ts b/code/lib/core-server/src/withTelemetry.ts index 21a33636d77a..c3b541a0a64a 100644 --- a/code/lib/core-server/src/withTelemetry.ts +++ b/code/lib/core-server/src/withTelemetry.ts @@ -120,11 +120,13 @@ export async function withTelemetry( options: TelemetryOptions, run: () => Promise ): Promise { + const enableTelemtry = !(options.cliOptions.disableTelemetry || options.cliOptions.test === true); + let canceled = false; async function cancelTelemetry() { canceled = true; - if (!options.cliOptions.disableTelemetry) { + if (enableTelemtry) { await telemetry('canceled', { eventType }, { stripMetadata: true, immediate: true }); } @@ -136,8 +138,7 @@ export async function withTelemetry( process.on('SIGINT', cancelTelemetry); } - if (!options.cliOptions.disableTelemetry) - telemetry('boot', { eventType }, { stripMetadata: true }); + if (enableTelemtry) telemetry('boot', { eventType }, { stripMetadata: true }); try { return await run(); @@ -148,7 +149,8 @@ export async function withTelemetry( const { printError = logger.error } = options; printError(error); - await sendTelemetryError(error, eventType, options); + + if (enableTelemtry) await sendTelemetryError(error, eventType, options); throw error; } finally { From 1318f0181b58387b369e2fdfab3b01679372b2d5 Mon Sep 17 00:00:00 2001 From: jonniebigodes Date: Sat, 4 Nov 2023 00:35:06 +0000 Subject: [PATCH 055/115] Fix links and issues --- docs/addons/addon-knowledge-base.md | 4 ++-- docs/addons/addon-types.md | 8 ++++---- docs/addons/integration-catalog.md | 2 +- docs/api/cli-options.md | 2 +- docs/api/doc-block-controls.md | 12 ++++++------ docs/configure/environment-variables.md | 2 +- docs/configure/theming.md | 6 +++--- docs/contribute/code.md | 4 ++-- docs/contribute/how-to-reproduce.md | 6 ++++-- docs/contribute/new-snippets.md | 2 +- docs/essentials/actions.md | 2 +- docs/essentials/controls.md | 6 +++--- docs/essentials/measure-and-outline.md | 2 +- docs/faq.md | 14 +++++++------- docs/writing-stories/args.md | 8 ++++---- docs/writing-stories/build-pages-with-storybook.md | 6 +++--- docs/writing-stories/play-function.md | 2 +- docs/writing-tests/visual-testing.md | 2 +- 18 files changed, 46 insertions(+), 44 deletions(-) diff --git a/docs/addons/addon-knowledge-base.md b/docs/addons/addon-knowledge-base.md index 11cdfe497464..a3ff08ac2500 100644 --- a/docs/addons/addon-knowledge-base.md +++ b/docs/addons/addon-knowledge-base.md @@ -80,7 +80,7 @@ Complementing the components, also included is a set of UI primitives. Use the c -The color palette implemented by @storybook/components is a high-level abstraction of the @storybook/theming package. +The color palette implemented by `@storybook/components` is a high-level abstraction of the [`@storybook/theming`](https://github.com/storybookjs/storybook/tree/next/code/lib/theming/src) package. @@ -98,7 +98,7 @@ When you're developing your addon as a package, you can’t use `npm link` to ad -Run either yarn or npm install to install the addon. +Run either `yarn` or `npm install` to install the addon. diff --git a/docs/addons/addon-types.md b/docs/addons/addon-types.md index d76edca7c7d6..10be1afd1c9b 100644 --- a/docs/addons/addon-types.md +++ b/docs/addons/addon-types.md @@ -10,7 +10,7 @@ UI-based addons allow you to customize Storybook's UI with the following element ### Panels -Panel addons allow you to add your own UI in Storybook's addon panel. This is the most common type of addon in the ecosystem. For example, the official [@storybook/actions](../essentials/actions.md) and [@storybook/a11y](https://github.com/storybookjs/storybook/tree/next/code/addons/a11y) use this pattern. +Panel addons allow you to add your own UI in Storybook's addon panel. This is the most common type of addon in the ecosystem. For example, the official [`@storybook/actions`](../essentials/actions.md) and [`@storybook/a11y`](https://github.com/storybookjs/storybook/tree/next/code/addons/a11y) use this pattern. ![Storybook panel](./storybook-panel.png) @@ -28,7 +28,7 @@ Use this boilerplate code to add a new `Panel` to Storybook's UI: ### Toolbars -Toolbar addons allow you to add your own custom tools in Storybook's Toolbar. For example, the official [@storybook/backgrounds](../essentials/backgrounds.md) and the [@storybook/addon-outline/](../essentials/measure-and-outline.md#outline-addon) use this pattern. +Toolbar addons allow you to add your own custom tools in Storybook's Toolbar. For example, the official [`@storybook/backgrounds`](../essentials/backgrounds.md) and the [`@storybook/addon-outline`](../essentials/measure-and-outline.md#outline-addon) use this pattern. ![Storybook toolbar addon](./storybook-toolbar.png) @@ -46,7 +46,7 @@ Use this boilerplate code to add a new `button` to Storybook's Toolbar: -The icon element used in the example loads the icons from the @storybook/components package. See [here](../faq.md#what-icons-are-available-for-my-toolbar-or-my-addon) for the list of available icons that you can use. +The `icon` element used in the example loads the icons from the `@storybook/components` package. See [here](../faq.md#what-icons-are-available-for-my-toolbar-or-my-addon) for the list of available icons that you can use. @@ -70,7 +70,7 @@ Use this boilerplate code to add a new `Tab` to Storybook's UI: -Learn how to write your own addon that includes these UI elements here. +Learn how to write your own addon that includes these UI elements [here](./writing-addons.md). diff --git a/docs/addons/integration-catalog.md b/docs/addons/integration-catalog.md index b6d018724c89..cdf96459eb75 100644 --- a/docs/addons/integration-catalog.md +++ b/docs/addons/integration-catalog.md @@ -56,7 +56,7 @@ Use the list below as a reference when filling in the values for both the `suppo -Make sure to copy each item exactly as listed so that we can properly index your addon in our catalog. +Make sure to copy each item **exactly** as listed so that we can properly index your addon in our catalog. diff --git a/docs/api/cli-options.md b/docs/api/cli-options.md index 3685881d8f75..a89d55a94d14 100644 --- a/docs/api/cli-options.md +++ b/docs/api/cli-options.md @@ -77,6 +77,6 @@ Options include: -If you're using npm instead of yarn to publish Storybook, the commands work slightly different. For example, npm run storybook build -- -o ./path/to/build. +If you're using npm instead of yarn to publish Storybook, the commands work slightly different. For example, `npm run storybook build -- -o ./path/to/build`. diff --git a/docs/api/doc-block-controls.md b/docs/api/doc-block-controls.md index 60334672163f..7079a6a43831 100644 --- a/docs/api/doc-block-controls.md +++ b/docs/api/doc-block-controls.md @@ -12,12 +12,6 @@ If you’re looking for a static table that shows a component's arg types with n - - -The Controls doc block will only have functioning UI controls if you have also installed and registered [`@storybook/addon-controls`](../essentials/controls.md) (included in [`@storybook/addon-essentials`](../essentials/introduction.md)). - - - ![Screenshot of Controls block](./doc-block-controls.png) @@ -35,6 +29,12 @@ import * as ButtonStories from './Button.stories' ``` + + +The Controls doc block will only have functioning UI controls if you have also installed and registered [`@storybook/addon-controls`](../essentials/controls.md) (included in [`@storybook/addon-essentials`](../essentials/introduction.md)). + + + ## Controls ```js diff --git a/docs/configure/environment-variables.md b/docs/configure/environment-variables.md index f943b05c5237..d4ba9252c58c 100644 --- a/docs/configure/environment-variables.md +++ b/docs/configure/environment-variables.md @@ -50,7 +50,7 @@ You can also access these variables in your custom ``/`` using the s -If using the environment variables as attributes or values in JavaScript, you may need to add quotes, as the value will be inserted directly. e.g. `` +If using the environment variables as attributes or values in JavaScript, you may need to add quotes, as the value will be inserted directly, for example: ``. diff --git a/docs/configure/theming.md b/docs/configure/theming.md index d8a56e6e5458..73cc315f5fc6 100644 --- a/docs/configure/theming.md +++ b/docs/configure/theming.md @@ -89,7 +89,7 @@ Inside your `.storybook` directory, create a new file called `YourTheme.js` and -If you're using brandImage to add your custom logo, you can use any of the most common image formats. +If you're using `brandImage` to add your custom logo, you can use any of the most common image formats. @@ -139,7 +139,7 @@ With the new changes introduced, the custom theme should yield a similar result. -Many theme variables are optional, the base property is NOT. +Many theme variables are optional, the base property is **NOT**. @@ -156,7 +156,7 @@ To style these elements, insert style tags into: -The same way as you can adjust your [preview’s head tag](../configure/story-rendering.md#adding-to-head), Storybook allows you to modify the code on the manager's side, through .storybook/manager-head.html. It can be helpful when adding theme styles that target Storybook's HTML, but it comes with a cost as Storybook's inner HTML can change at any time through the release cycle. +The same way as you can adjust your [preview’s head tag](../configure/story-rendering.md#adding-to-head), Storybook allows you to modify the code on the manager's side, through `.storybook/manager-head.html`. It can be helpful when adding theme styles that target Storybook's HTML, but it comes with a cost as Storybook's inner HTML can change at any time through the release cycle. diff --git a/docs/contribute/code.md b/docs/contribute/code.md index 39a1818e2ee6..7ce0068157bb 100644 --- a/docs/contribute/code.md +++ b/docs/contribute/code.md @@ -86,7 +86,7 @@ When prompted to start the build process in `watch` mode, answer **yes** to deve -Build's `watch` mode is great for interactive development. However, for performance reasons, it only transpiles your code and doesn't execute the TypeScript compiler. If something isn't working as expected, try running the `build` command WITHOUT enabling watch mode: it will re-generate TypeScript types and perform automatic type checking for you. +Build's `watch` mode is great for interactive development. However, for performance reasons, it only transpiles your code and doesn't execute the TypeScript compiler. If something isn't working as expected, try running the `build` command **WITHOUT** enabling watch mode: it will re-generate TypeScript types and perform automatic type checking for you. @@ -175,7 +175,7 @@ Typically it is a good idea to start from the `install` task to ensure your loca -The default instructions run the code in "linked" mode, meaning built changes to Storybook library code will be reflected in the sandbox immediately (the next time you run the task). However, CI runs in "unlinked" mode, which in rare cases, will behave differently.
+The default instructions run the code in "linked" mode, meaning built changes to Storybook library code will be reflected in the sandbox immediately (the next time you run the task). However, CI runs in "unlinked" mode, which in rare cases, will behave differently. If you are having trouble reproducing, try rerunning the command with the `--no-link` flag. If you need to do that, you'll need to run it with `--start-from=compile` after each code change. diff --git a/docs/contribute/how-to-reproduce.md b/docs/contribute/how-to-reproduce.md index 737599351546..90036ca37e89 100644 --- a/docs/contribute/how-to-reproduce.md +++ b/docs/contribute/how-to-reproduce.md @@ -25,7 +25,8 @@ npx storybook@next sandbox ``` -You can append a template name in the command to get filtered results e.g. npx storybook@next sandbox react + +You can append a template name in the command to get filtered results (e.g., `npx storybook@next sandbox react`). @@ -40,6 +41,7 @@ Finally, enter a location for your reproduction: If you don't provide a full path for the reproduction it will be generated in the current directory. + If everything worked as it should, you should have a fully functional Storybook set up in your local environment. @@ -66,7 +68,7 @@ Then, follow GitHub's instructions to set up the repository. -Don't forget to replace your-username with your own account name. +Don't forget to replace `your-username` with your own account name. diff --git a/docs/contribute/new-snippets.md b/docs/contribute/new-snippets.md index 2175556670bb..0ba9c72067f0 100644 --- a/docs/contribute/new-snippets.md +++ b/docs/contribute/new-snippets.md @@ -87,7 +87,7 @@ Create the file `ember/your-component.js.mdx`, similar to the other frameworks, -Code snippets are divided into various file extensions, if you're contributing a TypeScript file use .ts.mdx, or if you're adding JavaScript files use .js.mdx. +Code snippets are divided into various file extensions, if you're contributing a TypeScript file use `.ts.mdx`, or if you're adding JavaScript files use `.js.mdx`. diff --git a/docs/essentials/actions.md b/docs/essentials/actions.md index 0077ab003631..70a7496f9ee3 100644 --- a/docs/essentials/actions.md +++ b/docs/essentials/actions.md @@ -72,7 +72,7 @@ If you need more granular control over which `argTypes` are matched, you can adj -If you're generating argTypes with another addon (like [docs](../writing-docs/introduction.md), which is the common behavior), ensure the actions addon AFTER the other addon. You can do this by listing it later in the addons registration code in [`.storybook/main.js`](../configure/overview.md#configure-story-rendering). This is default in [essentials](./introduction.md). +If you're generating argTypes with another addon (like [docs](../writing-docs/introduction.md), which is the common behavior), ensure the actions addon **AFTER** the other addon. You can do this by listing it later in the addons registration code in [`.storybook/main.js`](../configure/overview.md#configure-story-rendering). This is default in [essentials](./introduction.md). diff --git a/docs/essentials/controls.md b/docs/essentials/controls.md index a41caf4a3ac0..fff305286b8b 100644 --- a/docs/essentials/controls.md +++ b/docs/essentials/controls.md @@ -23,7 +23,7 @@ To use the Controls addon, you need to write your stories using [args](../writin -If you have stories in the older pre-Storybook 6 style, check the args & controls migration guide to learn how to convert your existing stories for args. +If you have stories in the older pre-Storybook 6 style, check the [args & controls migration guide](https://medium.com/storybookjs/storybook-6-migration-guide-200346241bb5) to learn how to convert your existing stories for args. @@ -231,7 +231,7 @@ As shown above, you can configure individual controls with the “control" annot -The date control will convert the date into a UNIX timestamp when the value changes. It's a known limitation that will be fixed in a future release. If you need to represent the actual date, you'll need to update the story's implementation and convert the value into a date object. +The `date` control will convert the date into a UNIX timestamp when the value changes. It's a known limitation that will be fixed in a future release. If you need to represent the actual date, you'll need to update the story's implementation and convert the value into a date object. @@ -252,7 +252,7 @@ The date control will convert the date into a UNIX timestamp when t -Numeric data types will default to a number control unless additional configuration is provided. +Numeric data types will default to a `number` control unless additional configuration is provided. diff --git a/docs/essentials/measure-and-outline.md b/docs/essentials/measure-and-outline.md index d4ebe622d6e1..277e9ee4c164 100644 --- a/docs/essentials/measure-and-outline.md +++ b/docs/essentials/measure-and-outline.md @@ -18,7 +18,7 @@ With Storybook's Measure addon, you can quickly visualize each component's measu -Alternatively you can press the m key on your keyboard to toggle the addon. +Alternatively you can press the `m` key on your keyboard to toggle the addon. diff --git a/docs/faq.md b/docs/faq.md index a03b60cc9d52..6539f6a3431f 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -93,7 +93,7 @@ npm test -- --coverage --collectCoverageFrom='["src/**/*.{js,jsx}","!src/**/stor - If you're using yarn as a package manager, you'll need to adjust the command accordingly. +If you're using [`Yarn`](https://yarnpkg.com/) as a package manager, you'll need to adjust the command accordingly. @@ -121,7 +121,7 @@ export default { ## How do I fix module resolution in special environments? -In case you are using [yarn Plug-n-Play](https://yarnpkg.com/features/pnp) or your project is set up within a mono repository environment, you might run into issues with module resolution similar to this when running Storybook: +In case you are using [Yarn Plug-n-Play](https://yarnpkg.com/features/pnp) or your project is set up within a mono repository environment, you might run into issues with module resolution similar to this when running Storybook: ```shell WARN Failed to load preset: "@storybook/react-webpack5/preset"` @@ -265,7 +265,7 @@ We're actively working to provide a better way to address this situation, but in ## Is it possible to browse the documentation for past versions of Storybook? -With the release of version 6.0, we updated our documentation as well. That doesn't mean that the old documentation was removed. We kept it to help you with your Storybook migration process. Use the content from the table below in conjunction with our migration guide . +With the release of version 6.0, we updated our documentation as well. That doesn't mean that the old documentation was removed. We kept it to help you with your Storybook migration process. Use the content from the table below in conjunction with our [migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md). We're only covering versions 5.3 and 5.0 as they were important milestones for Storybook. If you want to go back in time a little more, you'll have to check the specific release in the monorepo. @@ -350,7 +350,7 @@ We're only covering versions 5.3 and 5.0 as they were important milestones for S -With the release of version 5.3, we've updated how you can write your stories more compactly and easily. It doesn't mean that the storiesOf format has been removed. For the time being, we're still supporting it, and we have documentation for it. But be advised that this is bound to change in the future. +With the release of version 5.3, we've updated how you can write your stories more compactly and easily. It doesn't mean that the `storiesOf` format has been removed. For the time being, we're still supporting it, and we have documentation for it. But be advised that this is bound to change in the future. @@ -373,7 +373,7 @@ npx http-server storybook-static -Suppose you don't want to run the command above frequently. Add http-server as a development dependency and create a new script to preview your production build of Storybook. +Suppose you don't want to run the command above frequently. Add `http-server` as a development dependency and create a new script to preview your production build of Storybook. @@ -452,11 +452,11 @@ export default { }; ``` -With Angular, the most common issue is the placement of the `mockServiceWorker.js` file. Use this [example](https://github.com/mswjs/examples/tree/master/examples/rest-angular/) as a point of reference. +With Angular, the most common issue is the placement of the `mockServiceWorker.js` file. Use this [example](https://github.com/mswjs/examples/tree/main/examples/with-angular) as a point of reference. ## Can I use other GraphQL providers with Storybook's MSW addon? -Yes, check the [addon's examples](https://github.com/mswjs/msw-storybook-addon/tree/master/packages/docs/src/demos) to learn how to integrate different providers. +Yes, check the [addon's examples](https://github.com/mswjs/msw-storybook-addon/tree/main/packages/docs/src/demos) to learn how to integrate different providers. ## Can I mock GraphQL mutations with Storybook's MSW addon? diff --git a/docs/writing-stories/args.md b/docs/writing-stories/args.md index e2553cfd6972..b1f8adb992f7 100644 --- a/docs/writing-stories/args.md +++ b/docs/writing-stories/args.md @@ -287,9 +287,9 @@ In Storybook 5 and before we passed the context as the first argument. If you’ - + + +Note that `args` is still available as a key in the context. - Note that `args` is still available as a key in the context. - - +
diff --git a/docs/writing-stories/build-pages-with-storybook.md b/docs/writing-stories/build-pages-with-storybook.md index 12b661158809..677cf7f0199b 100644 --- a/docs/writing-stories/build-pages-with-storybook.md +++ b/docs/writing-stories/build-pages-with-storybook.md @@ -173,7 +173,7 @@ To test your screen with the mocked data, you could write a similar set of stori -This example details how you can mock the REST request with fetch. Similar HTTP clients such as axios can be used as well. +This example details how you can mock the REST request with fetch. Similar HTTP clients such as [`axios`](https://axios-http.com/) can be used as well. @@ -241,7 +241,7 @@ Inside a directory called `__mocks__`, create a new file called The code above creates a decorator which reads story-specific data off the story's [parameters](./parameters.md), enabling you to configure the mock on a per-story basis. -To use the mock in place of the real import, we use [webpack aliasing](https://webpack.js.org/configuration/resolve/#resolvealias): +To use the mock in place of the real import, we use [Webpack aliasing](https://webpack.js.org/configuration/resolve/#resolvealias): @@ -253,7 +253,7 @@ To use the mock in place of the real import, we use [webpack aliasing](https://w -Add the decorator you've just implemented to your [storybook/preview.js](../configure/overview.md#configure-story-rendering): +Add the decorator you've just implemented to your [`storybook/preview.js`](../configure/overview.md#configure-story-rendering): diff --git a/docs/writing-stories/play-function.md b/docs/writing-stories/play-function.md index b83d22b3612f..9fb0852d8f09 100644 --- a/docs/writing-stories/play-function.md +++ b/docs/writing-stories/play-function.md @@ -189,7 +189,7 @@ If you need, you can also adjust your `play` function to find elements based on -You can read more about the querying elements in the Testing library documentation. +You can read more about the querying elements in the [Testing Library documentation](https://testing-library.com/docs/queries/about/). diff --git a/docs/writing-tests/visual-testing.md b/docs/writing-tests/visual-testing.md index c70ed93d37e9..c4e2f66f68ac 100644 --- a/docs/writing-tests/visual-testing.md +++ b/docs/writing-tests/visual-testing.md @@ -56,7 +56,7 @@ View it online at https://www.chromatic.com/build?appId=...&number=1. -Before running Chromatic's CLI ensure you have at least two commits added to the repository to prevent build failures, as Chromatic relies on a full Git history graph to establish the baselines. Read more about baselines in Chromatic's documentation +Before running Chromatic's CLI ensure you have at least two commits added to the repository to prevent build failures, as Chromatic relies on a full Git history graph to establish the baselines. Read more about baselines in Chromatic's [documentation](https://www.chromatic.com/docs/branching-and-baselines?utm_source=storybook_website&utm_medium=link&utm_campaign=storybook). From f0f4ce54a79be375610f2297e3c479cffd463c13 Mon Sep 17 00:00:00 2001 From: jonniebigodes Date: Sun, 5 Nov 2023 16:06:17 +0000 Subject: [PATCH 056/115] Docs: Addon Designs removes non-existing import --- docs/snippets/angular/component-story-figma-integration.ts.mdx | 3 --- docs/snippets/react/component-story-figma-integration.js.mdx | 3 --- .../react/component-story-figma-integration.ts-4-9.mdx | 3 --- docs/snippets/react/component-story-figma-integration.ts.mdx | 3 --- docs/snippets/solid/component-story-figma-integration.js.mdx | 3 --- .../solid/component-story-figma-integration.ts-4-9.mdx | 3 --- docs/snippets/solid/component-story-figma-integration.ts.mdx | 3 --- docs/snippets/svelte/component-story-figma-integration.js.mdx | 3 --- docs/snippets/svelte/component-story-figma-integration.mdx.mdx | 3 --- docs/snippets/vue/component-story-figma-integration.js.mdx | 3 --- docs/snippets/vue/component-story-figma-integration.ts-4-9.mdx | 3 --- docs/snippets/vue/component-story-figma-integration.ts.mdx | 3 --- .../web-components/component-story-figma-integration.js.mdx | 3 --- .../web-components/component-story-figma-integration.ts.mdx | 3 --- 14 files changed, 42 deletions(-) diff --git a/docs/snippets/angular/component-story-figma-integration.ts.mdx b/docs/snippets/angular/component-story-figma-integration.ts.mdx index 5b030c422fd2..548298968037 100644 --- a/docs/snippets/angular/component-story-figma-integration.ts.mdx +++ b/docs/snippets/angular/component-story-figma-integration.ts.mdx @@ -3,14 +3,11 @@ import type { Meta, StoryObj } from '@storybook/angular/'; -import { withDesign } from 'storybook-addon-designs'; - import { MyComponent } from './MyComponent.component'; // More on default export: https://storybook.js.org/docs/angular/writing-stories/introduction#default-export const meta: Meta = { component: MyComponent, - decorators: [withDesign], }; export default meta; diff --git a/docs/snippets/react/component-story-figma-integration.js.mdx b/docs/snippets/react/component-story-figma-integration.js.mdx index 442c797e71f6..5646fc5b3e59 100644 --- a/docs/snippets/react/component-story-figma-integration.js.mdx +++ b/docs/snippets/react/component-story-figma-integration.js.mdx @@ -1,14 +1,11 @@ ```js // MyComponent.stories.js|jsx -import { withDesign } from 'storybook-addon-designs'; - import { MyComponent } from './MyComponent'; // More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export export default { component: MyComponent, - decorators: [withDesign], }; export const Example = { diff --git a/docs/snippets/react/component-story-figma-integration.ts-4-9.mdx b/docs/snippets/react/component-story-figma-integration.ts-4-9.mdx index dbc6a9eb0cc6..cf84d725d7dd 100644 --- a/docs/snippets/react/component-story-figma-integration.ts-4-9.mdx +++ b/docs/snippets/react/component-story-figma-integration.ts-4-9.mdx @@ -3,14 +3,11 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { withDesign } from 'storybook-addon-designs'; - import { MyComponent } from './MyComponent'; // More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export const meta = { component: MyComponent, - decorators: [withDesign], } satisfies Meta; export default meta; diff --git a/docs/snippets/react/component-story-figma-integration.ts.mdx b/docs/snippets/react/component-story-figma-integration.ts.mdx index 19c6080436a8..183201440bcc 100644 --- a/docs/snippets/react/component-story-figma-integration.ts.mdx +++ b/docs/snippets/react/component-story-figma-integration.ts.mdx @@ -3,14 +3,11 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { withDesign } from 'storybook-addon-designs'; - import { MyComponent } from './MyComponent'; // More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export const meta: Meta = { component: MyComponent, - decorators: [withDesign], }; export default meta; diff --git a/docs/snippets/solid/component-story-figma-integration.js.mdx b/docs/snippets/solid/component-story-figma-integration.js.mdx index 4184c0493454..e71edadfdc17 100644 --- a/docs/snippets/solid/component-story-figma-integration.js.mdx +++ b/docs/snippets/solid/component-story-figma-integration.js.mdx @@ -1,13 +1,10 @@ ```js // MyComponent.stories.js|jsx -import { withDesign } from 'storybook-addon-designs'; - import { MyComponent } from './MyComponent'; export default { component: MyComponent, - decorators: [withDesign], }; export const Example = { diff --git a/docs/snippets/solid/component-story-figma-integration.ts-4-9.mdx b/docs/snippets/solid/component-story-figma-integration.ts-4-9.mdx index c868aeadfb25..d121332d7514 100644 --- a/docs/snippets/solid/component-story-figma-integration.ts-4-9.mdx +++ b/docs/snippets/solid/component-story-figma-integration.ts-4-9.mdx @@ -3,13 +3,10 @@ import type { Meta, StoryObj } from 'storybook-solidjs'; -import { withDesign } from 'storybook-addon-designs'; - import { MyComponent } from './MyComponent'; const meta = { component: MyComponent, - decorators: [withDesign], } satisfies Meta; export default meta; diff --git a/docs/snippets/solid/component-story-figma-integration.ts.mdx b/docs/snippets/solid/component-story-figma-integration.ts.mdx index e04c4b3b1651..a105e443eb59 100644 --- a/docs/snippets/solid/component-story-figma-integration.ts.mdx +++ b/docs/snippets/solid/component-story-figma-integration.ts.mdx @@ -3,13 +3,10 @@ import type { Meta, StoryObj } from 'storybook-solidjs'; -import { withDesign } from 'storybook-addon-designs'; - import { MyComponent } from './MyComponent'; const meta: Meta = { component: MyComponent, - decorators: [withDesign], }; export default meta; diff --git a/docs/snippets/svelte/component-story-figma-integration.js.mdx b/docs/snippets/svelte/component-story-figma-integration.js.mdx index c7c65ed0e8f3..3b597ddbfee4 100644 --- a/docs/snippets/svelte/component-story-figma-integration.js.mdx +++ b/docs/snippets/svelte/component-story-figma-integration.js.mdx @@ -1,14 +1,11 @@ ```js // MyComponent.stories.js -import { withDesign } from 'storybook-addon-designs'; - import MyComponent from './MyComponent.svelte'; // More on default export: https://storybook.js.org/docs/svelte/writing-stories/introduction#default-export export default { component: { MyComponent }, - decorators: [withDesign], }; export const Example = { diff --git a/docs/snippets/svelte/component-story-figma-integration.mdx.mdx b/docs/snippets/svelte/component-story-figma-integration.mdx.mdx index 9e129d3f4c9d..d612c1cb4393 100644 --- a/docs/snippets/svelte/component-story-figma-integration.mdx.mdx +++ b/docs/snippets/svelte/component-story-figma-integration.mdx.mdx @@ -3,14 +3,11 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs'; -import { withDesign } from 'storybook-addon-designs'; - import MyComponent from './MyComponent.svelte'; -When the build scripts run, it will look for the configuration file and pre-bundle the addon's code based on the configuration provided. However, there are a few properties that are worth referencing: +When the build scripts run, it will look for the configuration file and pre-bundle the addon's code based on the configuration provided. Addons can interact with Storybook in various ways. They can define presets to modify the configuration, add behavior to the manager UI, or add behavior to the preview iframe. These different use cases require different bundle outputs because they target different runtimes and environments. Presets are executed in a Node environment. Storybook's manager and preview environments provide certain packages in the global scope, so addons don't need to bundle them or include them as dependencies in their `package.json` file. -- **entry**: Configures the files to be processed by the bundler. It can be extended to include additional files using a regex pattern. -- **format**: Enables the generation of multiple output formats. In this case, we're generating a CommonJS and an ES Module version of our addon. -- **dts**: Auto-generates type definitions for our addon. -- **platform**: Specifies the target platform for our addon. In this case, we're targeting the browser. It can be set to `node` for Node.js environments or `neutral` for universal modules. +The `tsup` configuration handles these complexities by default, but you can customize it according to their requirements. For a detailed explanation of the bundling techniques used, please refer to [the README of the addon-kit](https://github.com/storybookjs/addon-kit#bundling). ## Register the addon diff --git a/docs/snippets/common/storybook-addon-toolkit-tsup-config.ts.mdx b/docs/snippets/common/storybook-addon-toolkit-tsup-config.ts.mdx index bf7c81d23cab..e1a29601d04d 100644 --- a/docs/snippets/common/storybook-addon-toolkit-tsup-config.ts.mdx +++ b/docs/snippets/common/storybook-addon-toolkit-tsup-config.ts.mdx @@ -1,22 +1,98 @@ ```ts // tsup.config.ts -import { defineConfig } from 'tsup'; - -export default defineConfig((options) => ({ - entry: ['src/index.ts', 'src/preview.ts', 'src/manager.ts'], - splitting: false, - minify: !options.watch, - format: ['cjs', 'esm'], - dts: { - resolve: true, - }, - treeshake: true, - sourcemap: true, - clean: true, - platform: 'browser', - esbuildOptions(options) { - options.conditions = ['module']; - }, -})); +import { defineConfig, type Options } from "tsup"; +import { readFile } from "fs/promises"; +import { globalPackages as globalManagerPackages } from "@storybook/manager/globals"; +import { globalPackages as globalPreviewPackages } from "@storybook/preview/globals"; + +// The current browsers supported by Storybook v7 +const BROWSER_TARGET: Options['target'] = ["chrome100", "safari15", "firefox91"]; +const NODE_TARGET: Options['target'] = ["node16"]; + +type BundlerConfig = { + bundler?: { + exportEntries?: string[]; + nodeEntries?: string[]; + managerEntries?: string[]; + previewEntries?: string[]; + }; +}; + +export default defineConfig(async (options) => { + // reading the three types of entries from package.json, which has the following structure: + // { + // ... + // "bundler": { + // "exportEntries": ["./src/index.ts"], + // "managerEntries": ["./src/manager.ts"], + // "previewEntries": ["./src/preview.ts"] + // } + // } + const packageJson = await readFile('./package.json', 'utf8').then(JSON.parse) as BundlerConfig; + const { + bundler: { + exportEntries = [], + managerEntries = [], + previewEntries = [], + } = {}, + } = packageJson; + + const commonConfig: Options = { + splitting: false, + minify: !options.watch, + treeshake: true, + sourcemap: true, + clean: true, + }; + + const configs: Options[] = []; + + // export entries are entries meant to be manually imported by the user + // they are not meant to be loaded by the manager or preview + // they'll be usable in both node and browser environments, depending on which features and modules they depend on + if (exportEntries.length) { + configs.push({ + ...commonConfig, + entry: exportEntries, + dts: { + resolve: true, + }, + format: ["esm", 'cjs'], + target: [...BROWSER_TARGET, ...NODE_TARGET], + platform: "neutral", + external: [...globalManagerPackages, ...globalPreviewPackages], + }); + } + + // manager entries are entries meant to be loaded into the manager UI + // they'll have manager-specific packages externalized and they won't be usable in node + // they won't have types generated for them as they're usually loaded automatically by Storybook + if (managerEntries.length) { + configs.push({ + ...commonConfig, + entry: managerEntries, + format: ["esm"], + target: BROWSER_TARGET, + platform: "browser", + external: globalManagerPackages, + }); + } + + // preview entries are entries meant to be loaded into the preview iframe + // they'll have preview-specific packages externalized and they won't be usable in node + // they won't have types generated for them as they're usually loaded automatically by Storybook + if (previewEntries.length) { + configs.push({ + ...commonConfig, + entry: previewEntries, + format: ["esm"], + target: BROWSER_TARGET, + platform: "browser", + external: globalPreviewPackages, + }); + } + + return configs; +}); ``` From ec8802ce0e73a7111c78411bf899992a13e19fb9 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 9 Nov 2023 09:35:27 +0100 Subject: [PATCH 085/115] remove tsup condig from docs --- docs/addons/writing-addons.md | 12 +-- ...storybook-addon-toolkit-tsup-config.ts.mdx | 98 ------------------- 2 files changed, 1 insertion(+), 109 deletions(-) delete mode 100644 docs/snippets/common/storybook-addon-toolkit-tsup-config.ts.mdx diff --git a/docs/addons/writing-addons.md b/docs/addons/writing-addons.md index e2e603b5e3e0..9083c4210a9e 100644 --- a/docs/addons/writing-addons.md +++ b/docs/addons/writing-addons.md @@ -73,19 +73,9 @@ Clone the repository you just created and install its dependencies. When the ins Addons built in the Storybook ecosystem rely on [tsup](https://tsup.egoist.dev/), a fast, zero-config bundler powered by [esbuild](https://esbuild.github.io/) to transpile your addon's code into modern JavaScript that can run in the browser. Out of the box, the Addon Kit comes with a pre-configured `tsup` configuration file that you can use to customize the build process of your addon. - - - - - - When the build scripts run, it will look for the configuration file and pre-bundle the addon's code based on the configuration provided. Addons can interact with Storybook in various ways. They can define presets to modify the configuration, add behavior to the manager UI, or add behavior to the preview iframe. These different use cases require different bundle outputs because they target different runtimes and environments. Presets are executed in a Node environment. Storybook's manager and preview environments provide certain packages in the global scope, so addons don't need to bundle them or include them as dependencies in their `package.json` file. -The `tsup` configuration handles these complexities by default, but you can customize it according to their requirements. For a detailed explanation of the bundling techniques used, please refer to [the README of the addon-kit](https://github.com/storybookjs/addon-kit#bundling). +The `tsup` configuration handles these complexities by default, but you can customize it according to their requirements. For a detailed explanation of the bundling techniques used, please refer to [the README of the addon-kit](https://github.com/storybookjs/addon-kit#bundling), and check out the default `tsup` configuration [here](https://github.com/storybookjs/addon-kit/blob/main/tsup.config.ts). ## Register the addon diff --git a/docs/snippets/common/storybook-addon-toolkit-tsup-config.ts.mdx b/docs/snippets/common/storybook-addon-toolkit-tsup-config.ts.mdx deleted file mode 100644 index e1a29601d04d..000000000000 --- a/docs/snippets/common/storybook-addon-toolkit-tsup-config.ts.mdx +++ /dev/null @@ -1,98 +0,0 @@ -```ts -// tsup.config.ts - -import { defineConfig, type Options } from "tsup"; -import { readFile } from "fs/promises"; -import { globalPackages as globalManagerPackages } from "@storybook/manager/globals"; -import { globalPackages as globalPreviewPackages } from "@storybook/preview/globals"; - -// The current browsers supported by Storybook v7 -const BROWSER_TARGET: Options['target'] = ["chrome100", "safari15", "firefox91"]; -const NODE_TARGET: Options['target'] = ["node16"]; - -type BundlerConfig = { - bundler?: { - exportEntries?: string[]; - nodeEntries?: string[]; - managerEntries?: string[]; - previewEntries?: string[]; - }; -}; - -export default defineConfig(async (options) => { - // reading the three types of entries from package.json, which has the following structure: - // { - // ... - // "bundler": { - // "exportEntries": ["./src/index.ts"], - // "managerEntries": ["./src/manager.ts"], - // "previewEntries": ["./src/preview.ts"] - // } - // } - const packageJson = await readFile('./package.json', 'utf8').then(JSON.parse) as BundlerConfig; - const { - bundler: { - exportEntries = [], - managerEntries = [], - previewEntries = [], - } = {}, - } = packageJson; - - const commonConfig: Options = { - splitting: false, - minify: !options.watch, - treeshake: true, - sourcemap: true, - clean: true, - }; - - const configs: Options[] = []; - - // export entries are entries meant to be manually imported by the user - // they are not meant to be loaded by the manager or preview - // they'll be usable in both node and browser environments, depending on which features and modules they depend on - if (exportEntries.length) { - configs.push({ - ...commonConfig, - entry: exportEntries, - dts: { - resolve: true, - }, - format: ["esm", 'cjs'], - target: [...BROWSER_TARGET, ...NODE_TARGET], - platform: "neutral", - external: [...globalManagerPackages, ...globalPreviewPackages], - }); - } - - // manager entries are entries meant to be loaded into the manager UI - // they'll have manager-specific packages externalized and they won't be usable in node - // they won't have types generated for them as they're usually loaded automatically by Storybook - if (managerEntries.length) { - configs.push({ - ...commonConfig, - entry: managerEntries, - format: ["esm"], - target: BROWSER_TARGET, - platform: "browser", - external: globalManagerPackages, - }); - } - - // preview entries are entries meant to be loaded into the preview iframe - // they'll have preview-specific packages externalized and they won't be usable in node - // they won't have types generated for them as they're usually loaded automatically by Storybook - if (previewEntries.length) { - configs.push({ - ...commonConfig, - entry: previewEntries, - format: ["esm"], - target: BROWSER_TARGET, - platform: "browser", - external: globalPreviewPackages, - }); - } - - return configs; -}); -``` From c2f02b37d86364e633cba453560f855f3db50c16 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Thu, 9 Nov 2023 10:08:17 +0100 Subject: [PATCH 086/115] add migration notes to addon authors --- MIGRATION.md | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index c692f787fa6d..ca14c266b621 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,12 +1,13 @@

Migration

- [From version 7.5.0 to 7.6.0](#from-version-750-to-760) - - [Primary doc block accepts of prop](#primary-doc-block-accepts-of-prop) + - [Primary doc block accepts of prop](#primary-doc-block-accepts-of-prop) + - [Addons no longer need a peer dependency on React](#addons-no-longer-need-a-peer-dependency-on-react) - [From version 7.4.0 to 7.5.0](#from-version-740-to-750) - - [`storyStoreV6` and `storiesOf` is deprecated](#storystorev6-and-storiesof-is-deprecated) - - [`storyIndexers` is replaced with `experimental_indexers`](#storyindexers-is-replaced-with-experimental_indexers) + - [`storyStoreV6` and `storiesOf` is deprecated](#storystorev6-and-storiesof-is-deprecated) + - [`storyIndexers` is replaced with `experimental_indexers`](#storyindexers-is-replaced-with-experimental_indexers) - [From version 7.0.0 to 7.2.0](#from-version-700-to-720) - - [Addon API is more type-strict](#addon-api-is-more-type-strict) + - [Addon API is more type-strict](#addon-api-is-more-type-strict) - [From version 6.5.x to 7.0.0](#from-version-65x-to-700) - [7.0 breaking changes](#70-breaking-changes) - [Dropped support for Node 15 and below](#dropped-support-for-node-15-and-below) @@ -32,7 +33,7 @@ - [Deploying build artifacts](#deploying-build-artifacts) - [Dropped support for file URLs](#dropped-support-for-file-urls) - [Serving with nginx](#serving-with-nginx) - - [Ignore story files from node_modules](#ignore-story-files-from-node_modules) + - [Ignore story files from node\_modules](#ignore-story-files-from-node_modules) - [7.0 Core changes](#70-core-changes) - [7.0 feature flags removed](#70-feature-flags-removed) - [Story context is prepared before for supporting fine grained updates](#story-context-is-prepared-before-for-supporting-fine-grained-updates) @@ -44,7 +45,7 @@ - [Addon-interactions: Interactions debugger is now default](#addon-interactions-interactions-debugger-is-now-default) - [7.0 Vite changes](#70-vite-changes) - [Vite builder uses Vite config automatically](#vite-builder-uses-vite-config-automatically) - - [Vite cache moved to node_modules/.cache/.vite-storybook](#vite-cache-moved-to-node_modulescachevite-storybook) + - [Vite cache moved to node\_modules/.cache/.vite-storybook](#vite-cache-moved-to-node_modulescachevite-storybook) - [7.0 Webpack changes](#70-webpack-changes) - [Webpack4 support discontinued](#webpack4-support-discontinued) - [Babel mode v7 exclusively](#babel-mode-v7-exclusively) @@ -94,7 +95,7 @@ - [Dropped addon-docs manual babel configuration](#dropped-addon-docs-manual-babel-configuration) - [Dropped addon-docs manual configuration](#dropped-addon-docs-manual-configuration) - [Autoplay in docs](#autoplay-in-docs) - - [Removed STORYBOOK_REACT_CLASSES global](#removed-storybook_react_classes-global) + - [Removed STORYBOOK\_REACT\_CLASSES global](#removed-storybook_react_classes-global) - [7.0 Deprecations and default changes](#70-deprecations-and-default-changes) - [storyStoreV7 enabled by default](#storystorev7-enabled-by-default) - [`Story` type deprecated](#story-type-deprecated) @@ -309,10 +310,33 @@ ## From version 7.5.0 to 7.6.0 -##### Primary doc block accepts of prop +#### Primary doc block accepts of prop The `Primary` doc block now also accepts an `of` prop as described in the [Doc Blocks](#doc-blocks) section. It still accepts being passed `name` or no props at all. +#### Addons no longer need a peer dependency on React + +Historically the majority of addons have had a peer dependency on React and a handful of Storybook core packages. In most cases this has not been necessary since 7.0 because the Storybook manager makes those available on the global scope. It has created an unnecessary burden for users in non-React projects. + +We've migrated all the core addons (except for `addon-docs`) to not depend on these packages by: + +1. Moving `react`, `react-dom` and the globalized Storybook packages from `peerDependencies` to `devDependencies` +2. Added the list of globalized packages to the `externals` property in the `tsup` configuration, to ensure they are not part of the bundle. + +As of Storybook 7.6.0 the list of globalized packages can be imported like this: + +```ts +// tsup.config.ts + +import { globalPackages as globalManagerPackages } from '@storybook/manager/globals'; +import { globalPackages as globalPreviewPackages } from '@storybook/preview/globals'; + +const allGlobalPackages = [...globalManagerPackages, ...globalPreviewPackages]; +``` + +We recommend checking out [the updates we've made to the addon-kit](https://github.com/storybookjs/addon-kit/pull/60/files#diff-8fed899bdbc24789a7bb4973574e624ed6207c6ce572338bc3c3e117672b2a20), that can serve as a base for the changes you can do in your own addon. These changes are not necessary for your addon to keep working, but they will remove the need for your users to unnecessary install `react` and `react-dom` to their projects, and they'll significantly reduce the install size of your addon. +These changes should not be breaking for your users, unless you support Storybook pre-v7. + ## From version 7.4.0 to 7.5.0 #### `storyStoreV6` and `storiesOf` is deprecated From 9da858e695efc8e6196cbdc4243c15565ad490c9 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Thu, 9 Nov 2023 12:23:46 +0100 Subject: [PATCH 087/115] Disable unknownContextCritical warning in webpack config --- .../builder-webpack5/src/preview/iframe-webpack.config.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index ab97a724f491..93e1929b461a 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -300,6 +300,8 @@ export default async ( shouldCheckTs ? new ForkTsCheckerWebpackPlugin(tsCheckOptions) : null, ].filter(Boolean), module: { + // Disable warning for dynamic requires + unknownContextCritical: false, rules: [ { test: /\.stories\.([tj])sx?$|(stories|story)\.mdx$/, From c776a23d923f694251954b4c90f9616f392dbbc3 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 9 Nov 2023 13:06:07 +0100 Subject: [PATCH 088/115] change removeAllAddons to removeNonFastAddons --- code/lib/core-common/src/presets.ts | 22 +++++++++++-------- .../core-server/src/presets/common-preset.ts | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/code/lib/core-common/src/presets.ts b/code/lib/core-common/src/presets.ts index 5d838ecdcbc8..b8bef3c21c2a 100644 --- a/code/lib/core-common/src/presets.ts +++ b/code/lib/core-common/src/presets.ts @@ -249,17 +249,21 @@ export async function loadPreset( if (isObject(contents)) { const { addons: addonsInput, presets: presetsInput, ...rest } = contents; - if (storybookOptions.isCritical !== true && storybookOptions.build?.test?.removeAllAddons) { - return [ - { - name: presetName, - preset: rest, - options: presetOptions, - }, - ]; + let filter = (i: string) => true; + + if ( + storybookOptions.isCritical !== true && + storybookOptions.build?.test?.removeNonFastAddons + ) { + filter = (i: string) => + i.includes('storybook/addon-docs') || i.includes('storybook/addon-coverage'); } - const subPresets = resolvePresetFunction(presetsInput, presetOptions, storybookOptions); + const subPresets = resolvePresetFunction( + presetsInput.filter(filter), + presetOptions, + storybookOptions + ); const subAddons = resolvePresetFunction(addonsInput, presetOptions, storybookOptions); return [ diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts index a0042cb09063..0a6388ca2204 100644 --- a/code/lib/core-server/src/presets/common-preset.ts +++ b/code/lib/core-server/src/presets/common-preset.ts @@ -188,7 +188,7 @@ export const previewAnnotations = async (base: any, options: Options) => { const testBuildFeatures = (value: boolean): Required => ({ emptyBlocks: value, - removeAllAddons: value, + removeNonFastAddons: value, removeMDXEntries: value, removeAutoDocs: value, disableDocgen: value, From 107a6d7fd351adc17417f1cb868ea0dc4b3bc1e2 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 9 Nov 2023 13:18:41 +0100 Subject: [PATCH 089/115] rename --- code/lib/types/src/modules/core-common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index f0aca6e884ee..a9d7c7730b88 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -268,7 +268,7 @@ export interface TestBuildFlags { /** * Disable all addons */ - removeAllAddons?: boolean; + removeNonFastAddons?: boolean; /** * Filter out .mdx stories entries */ From c0846a745d8feee9901a3b4677f1cd88d9761b06 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 9 Nov 2023 14:10:26 +0100 Subject: [PATCH 090/115] fixes --- code/lib/core-common/src/presets.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/code/lib/core-common/src/presets.ts b/code/lib/core-common/src/presets.ts index b8bef3c21c2a..eb447ab97e95 100644 --- a/code/lib/core-common/src/presets.ts +++ b/code/lib/core-common/src/presets.ts @@ -247,24 +247,33 @@ export async function loadPreset( } if (isObject(contents)) { - const { addons: addonsInput, presets: presetsInput, ...rest } = contents; + const { addons: addonsInput = [], presets: presetsInput = [], ...rest } = contents; - let filter = (i: string) => true; + let filter = (i: PresetConfig) => { + return true; + }; if ( storybookOptions.isCritical !== true && storybookOptions.build?.test?.removeNonFastAddons ) { - filter = (i: string) => - i.includes('storybook/addon-docs') || i.includes('storybook/addon-coverage'); + filter = (i: PresetConfig) => { + const name = i.name ? i.name : i; + + return ( + !name.includes('@storybook/addon-docs') && !name.includes('@storybook/addon-coverage') + ); + }; } const subPresets = resolvePresetFunction( - presetsInput.filter(filter), + presetsInput, presetOptions, storybookOptions + ).filter(filter); + const subAddons = resolvePresetFunction(addonsInput, presetOptions, storybookOptions).filter( + filter ); - const subAddons = resolvePresetFunction(addonsInput, presetOptions, storybookOptions); return [ ...(await loadPresets([...subPresets], level + 1, storybookOptions)), From c50fb271c0251963cef288f176c380646d70ecd9 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 9 Nov 2023 14:28:21 +0100 Subject: [PATCH 091/115] ignore error --- code/lib/core-common/src/presets.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/code/lib/core-common/src/presets.ts b/code/lib/core-common/src/presets.ts index eb447ab97e95..3a3a2db0ce97 100644 --- a/code/lib/core-common/src/presets.ts +++ b/code/lib/core-common/src/presets.ts @@ -258,6 +258,7 @@ export async function loadPreset( storybookOptions.build?.test?.removeNonFastAddons ) { filter = (i: PresetConfig) => { + // @ts-expect-error (Converted from ts-ignore) const name = i.name ? i.name : i; return ( From 1cfbef70fe568f321795944aa9d22cb292e1e23c Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 10 Nov 2023 09:49:00 +0100 Subject: [PATCH 092/115] do not check for warnOnIncompatibleAddons when test CLI-flag is true --- code/lib/core-server/src/build-static.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/lib/core-server/src/build-static.ts b/code/lib/core-server/src/build-static.ts index 64ea764678e2..286723d8c1a1 100644 --- a/code/lib/core-server/src/build-static.ts +++ b/code/lib/core-server/src/build-static.ts @@ -77,7 +77,9 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption logger.warn(`you have not specified a framework in your ${options.configDir}/main.js`); } - await warnOnIncompatibleAddons(config); + if (options.test) { + await warnOnIncompatibleAddons(config); + } logger.info('=> Loading presets'); let presets = await loadAllPresets({ From f16de2fb0b92c06d9157b621035da9234c264120 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 10 Nov 2023 10:41:01 +0100 Subject: [PATCH 093/115] Angular: Handle nested module metadata --- .../src/client/angular-beta/utils/NgModulesAnalyzer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/frameworks/angular/src/client/angular-beta/utils/NgModulesAnalyzer.ts b/code/frameworks/angular/src/client/angular-beta/utils/NgModulesAnalyzer.ts index a63fdee1822b..bcf9386fb875 100644 --- a/code/frameworks/angular/src/client/angular-beta/utils/NgModulesAnalyzer.ts +++ b/code/frameworks/angular/src/client/angular-beta/utils/NgModulesAnalyzer.ts @@ -14,7 +14,7 @@ export const isComponentAlreadyDeclared = ( ): boolean => { if ( moduleDeclarations && - moduleDeclarations.some((declaration) => declaration === componentToFind) + moduleDeclarations.flat().some((declaration) => declaration === componentToFind) ) { // Found component in declarations array return true; @@ -23,7 +23,7 @@ export const isComponentAlreadyDeclared = ( return false; } - return moduleImports.some((importItem) => { + return moduleImports.flat().some((importItem) => { const extractedNgModuleMetadata = extractNgModuleMetadata(importItem); if (!extractedNgModuleMetadata) { // Not an NgModule From 31f4c95336fe1b87c5507e6dfe174ccfbd63743b Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 10 Nov 2023 10:56:35 +0100 Subject: [PATCH 094/115] disable composition when --test is true --- code/lib/core-common/src/utils/get-storybook-refs.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/lib/core-common/src/utils/get-storybook-refs.ts b/code/lib/core-common/src/utils/get-storybook-refs.ts index c0f530531b7e..accb63dfb67f 100644 --- a/code/lib/core-common/src/utils/get-storybook-refs.ts +++ b/code/lib/core-common/src/utils/get-storybook-refs.ts @@ -89,6 +89,10 @@ const toTitle = (input: string) => { }; export async function getRefs(options: Options) { + if (options.test) { + return {}; + } + const refs = await options.presets.apply>('refs', await getAutoRefs(options)); Object.entries(refs).forEach(([key, value]: [string, Ref]) => { From 959b0d034e6947999ea9dc97040cdeec3d0b0a13 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 10 Nov 2023 11:06:49 +0100 Subject: [PATCH 095/115] improve sveltedoc typings --- code/frameworks/svelte-vite/src/plugins/svelte-docgen.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/frameworks/svelte-vite/src/plugins/svelte-docgen.ts b/code/frameworks/svelte-vite/src/plugins/svelte-docgen.ts index bce6ab3c1a00..5ee6f7e53ce8 100644 --- a/code/frameworks/svelte-vite/src/plugins/svelte-docgen.ts +++ b/code/frameworks/svelte-vite/src/plugins/svelte-docgen.ts @@ -3,7 +3,7 @@ import MagicString from 'magic-string'; import path from 'path'; import fs from 'fs'; import svelteDoc from 'sveltedoc-parser'; -import type { SvelteParserOptions } from 'sveltedoc-parser'; +import type { SvelteComponentDoc, SvelteParserOptions } from 'sveltedoc-parser'; import { logger } from '@storybook/node-logger'; import { preprocess } from 'svelte/compiler'; import { createFilter } from 'vite'; @@ -120,7 +120,7 @@ export function svelteDocgen(svelteOptions: Record = {}): PluginOpt const s = new MagicString(src); - let componentDoc: any; + let componentDoc: SvelteComponentDoc & { keywords?: string[] }; try { componentDoc = await svelteDoc.parse(options); } catch (error: any) { From 0033a484f3a7c1ead35ae316bde28600e0b067e7 Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 10 Nov 2023 11:09:14 +0100 Subject: [PATCH 096/115] always exclude decorators when generating svelte source --- .../svelte/src/docs/sourceDecorator.ts | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/code/renderers/svelte/src/docs/sourceDecorator.ts b/code/renderers/svelte/src/docs/sourceDecorator.ts index 62b27773058a..dc9cfc2bf93c 100644 --- a/code/renderers/svelte/src/docs/sourceDecorator.ts +++ b/code/renderers/svelte/src/docs/sourceDecorator.ts @@ -1,10 +1,17 @@ /* eslint-disable no-underscore-dangle */ import { addons, useEffect } from '@storybook/preview-api'; import { deprecate } from '@storybook/client-logger'; -import type { ArgTypes, Args, StoryContext } from '@storybook/types'; +import type { + ArgTypes, + Args, + ArgsStoryFn, + DecoratorFunction, + StoryContext, +} from '@storybook/types'; import { SourceType, SNIPPET_RENDERED } from '@storybook/docs-tools'; -import type { SvelteRenderer } from '../types'; +import type { SvelteComponentDoc } from 'sveltedoc-parser'; +import type { SvelteRenderer, SvelteStoryResult } from '../types'; /** * Check if the source-code should be generated. @@ -140,19 +147,23 @@ export function generateSvelteSource( * * @param component Component */ -function getWrapperProperties(component: any) { +function getWrapperProperties( + component?: SvelteStoryResult['Component'] & { + __docgen?: SvelteComponentDoc & { keywords?: string[] }; + } +) { // eslint-disable-next-line @typescript-eslint/naming-convention - const { __docgen } = component; + const { __docgen } = component || {}; if (!__docgen) { return { wrapper: false }; } // the component should be declared as a wrapper - if (!__docgen.keywords.find((kw: any) => kw.name === 'wrapper')) { + if (!__docgen.keywords?.find((kw: any) => kw.name === 'wrapper')) { return { wrapper: false }; } - const slotProp = __docgen.data.find((prop: any) => + const slotProp = __docgen.data?.find((prop: any) => prop.keywords.find((kw: any) => kw.name === 'slot') ); return { wrapper: true, slotProperty: slotProp?.name as string }; @@ -163,7 +174,7 @@ function getWrapperProperties(component: any) { * @param storyFn Fn * @param context StoryContext */ -export const sourceDecorator = (storyFn: any, context: StoryContext) => { +export const sourceDecorator: DecoratorFunction = (storyFn, context) => { const channel = addons.getChannel(); const skip = skipSourceRender(context); const story = storyFn(); @@ -181,16 +192,21 @@ export const sourceDecorator = (storyFn: any, context: StoryContext)( + args, + context + ); const { wrapper, slotProperty } = getWrapperProperties(component); if (wrapper) { if (parameters.component) { deprecate('parameters.component is deprecated. Using context.component instead.'); } - component = ctxtComponent; + component = ctxComponent; } const generated = generateSvelteSource(component, args, context?.argTypes, slotProperty); From e347ebfc115b6cbfea16166998eb7842da724707 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 10 Nov 2023 14:31:49 +0100 Subject: [PATCH 097/115] do not generate sourcemaps for test builds --- code/builders/builder-vite/src/build.ts | 2 +- .../builder-webpack5/src/preview/iframe-webpack.config.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/builders/builder-vite/src/build.ts b/code/builders/builder-vite/src/build.ts index 67da9f989692..1e25b7d79c69 100644 --- a/code/builders/builder-vite/src/build.ts +++ b/code/builders/builder-vite/src/build.ts @@ -12,7 +12,7 @@ export async function build(options: Options) { build: { outDir: options.outputDir, emptyOutDir: false, // do not clean before running Vite build - Storybook has already added assets in there! - sourcemap: true, + sourcemap: !options.test, rollupOptions: { // Do not try to bundle the storybook runtime, it is copied into the output dir after the build. external: ['./sb-preview/runtime.js'], diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index 93e1929b461a..af8a0c874896 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -227,7 +227,7 @@ export default async ( name: 'preview', mode: isProd ? 'production' : 'development', bail: isProd, - devtool: 'cheap-module-source-map', + devtool: options.test ? false : 'cheap-module-source-map', entry: entries, output: { path: resolve(process.cwd(), outputDir), From 692cf75bb1aa040265f627783d54029a6ce7a68e Mon Sep 17 00:00:00 2001 From: Jeppe Reinhold Date: Fri, 10 Nov 2023 14:36:18 +0100 Subject: [PATCH 098/115] e2e test for decorated svelte source output in docs --- code/e2e-tests/framework-svelte.spec.ts | 13 +++++++++++++ .../template/stories/slot-decorators.stories.js | 1 + 2 files changed, 14 insertions(+) diff --git a/code/e2e-tests/framework-svelte.spec.ts b/code/e2e-tests/framework-svelte.spec.ts index 007f1182c781..a208aa982d9c 100644 --- a/code/e2e-tests/framework-svelte.spec.ts +++ b/code/e2e-tests/framework-svelte.spec.ts @@ -1,6 +1,7 @@ /* eslint-disable jest/no-disabled-tests */ import { test, expect } from '@playwright/test'; import process from 'process'; +import dedent from 'ts-dedent'; import { SbPage } from './util'; const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:6006'; @@ -37,4 +38,16 @@ test.describe('Svelte', () => { const argsTable = root.locator('.docblock-argstable'); await expect(argsTable).toContainText('Rounds the button'); }); + + test('Decorators are excluded from generated source code', async ({ page }) => { + const sbPage = new SbPage(page); + + await sbPage.navigateToStory('stories/renderers/svelte/slot-decorators', 'docs'); + const root = sbPage.previewRoot(); + const showCodeButton = (await root.locator('button', { hasText: 'Show Code' }).all())[0]; + await showCodeButton.click(); + const sourceCode = root.locator('pre.prismjs'); + const expectedSource = ''; + await expect(sourceCode.textContent()).resolves.toContain(expectedSource); + }); }); diff --git a/code/renderers/svelte/template/stories/slot-decorators.stories.js b/code/renderers/svelte/template/stories/slot-decorators.stories.js index 4b8095517faf..74c270fb8373 100644 --- a/code/renderers/svelte/template/stories/slot-decorators.stories.js +++ b/code/renderers/svelte/template/stories/slot-decorators.stories.js @@ -9,6 +9,7 @@ export default { args: { primary: true, }, + tags: ['autodocs'], }; export const WithDefaultRedBorder = {}; From ae0ff86d47e19fe55ead731be012321e32a7093f Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 10 Nov 2023 14:33:21 +0100 Subject: [PATCH 099/115] SWC: Introduce React and Preact specific SWC config --- code/lib/types/src/modules/core-common.ts | 23 ++++++++++--------- code/presets/preact-webpack/src/index.ts | 22 ++++++++++++++++++ code/presets/react-webpack/package.json | 4 ++-- .../src/framework-preset-react.ts | 23 +++++++++++++++++++ 4 files changed, 59 insertions(+), 13 deletions(-) diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index a9d7c7730b88..8ffe22b1d01f 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -1,11 +1,12 @@ /* eslint-disable @typescript-eslint/naming-convention */ import type { FileSystemCache } from 'file-system-cache'; - +import type { Options as SWCOptions } from '@swc/core'; import type { Options as TelejsonOptions } from 'telejson'; -import type { TransformOptions } from '@babel/core'; +import type { TransformOptions as BabelOptions } from '@babel/core'; import type { Router } from 'express'; import type { Server } from 'http'; import type { PackageJson as PackageJsonFromTypeFest } from 'type-fest'; + import type { StoriesEntry, Indexer, StoryIndexer } from './indexer'; /** @@ -70,7 +71,8 @@ export interface Presets { args?: Options ): Promise; apply(extension: 'framework', config?: {}, args?: any): Promise; - apply(extension: 'babel', config?: {}, args?: any): Promise; + apply(extension: 'babel', config?: {}, args?: any): Promise; + apply(extension: 'swc', config?: {}, args?: any): Promise; apply(extension: 'entries', config?: [], args?: any): Promise; apply(extension: 'stories', config?: [], args?: any): Promise; apply(extension: 'managerEntries', config: [], args?: any): Promise; @@ -371,10 +373,12 @@ export interface StorybookConfig { /** * Modify or return babel config. */ - babel?: ( - config: TransformOptions, - options: Options - ) => TransformOptions | Promise; + babel?: (config: BabelOptions, options: Options) => BabelOptions | Promise; + + /** + * Modify or return swc config. + */ + swc?: (config: SWCOptions, options: Options) => SWCOptions | Promise; /** * Modify or return env config. @@ -384,10 +388,7 @@ export interface StorybookConfig { /** * Modify or return babel config. */ - babelDefault?: ( - config: TransformOptions, - options: Options - ) => TransformOptions | Promise; + babelDefault?: (config: BabelOptions, options: Options) => BabelOptions | Promise; /** * Add additional scripts to run in the preview a la `.storybook/preview.js` diff --git a/code/presets/preact-webpack/src/index.ts b/code/presets/preact-webpack/src/index.ts index 758012bf73ab..e6cb9524dca3 100644 --- a/code/presets/preact-webpack/src/index.ts +++ b/code/presets/preact-webpack/src/index.ts @@ -47,3 +47,25 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = (config) => { }, }; }; + +export const swc: StorybookConfig['swc'] = (config) => { + const isDevelopment = process.env.NODE_ENV !== 'production'; + + return { + ...config, + jsc: { + ...(config?.jsc ?? {}), + transform: { + ...(config?.jsc?.transform ?? {}), + react: { + ...(config?.jsc?.transform?.react ?? {}), + runtime: 'automatic', + importSource: 'preact', + pragma: 'h', + pragmaFrag: 'Fragment', + development: isDevelopment, + }, + }, + }, + }; +}; diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index c7be54baa76e..f6ef0324349e 100644 --- a/code/presets/react-webpack/package.json +++ b/code/presets/react-webpack/package.json @@ -71,7 +71,7 @@ "dependencies": { "@babel/preset-flow": "^7.22.15", "@babel/preset-react": "^7.22.15", - "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5", + "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", "@storybook/core-webpack": "workspace:*", "@storybook/docs-tools": "workspace:*", "@storybook/node-logger": "workspace:*", @@ -83,7 +83,7 @@ "fs-extra": "^11.1.0", "magic-string": "^0.30.5", "react-docgen": "^7.0.0", - "react-refresh": "^0.11.0", + "react-refresh": "^0.14.0", "semver": "^7.3.7", "webpack": "5" }, diff --git a/code/presets/react-webpack/src/framework-preset-react.ts b/code/presets/react-webpack/src/framework-preset-react.ts index e913a32b5332..65da5b9825aa 100644 --- a/code/presets/react-webpack/src/framework-preset-react.ts +++ b/code/presets/react-webpack/src/framework-preset-react.ts @@ -83,3 +83,26 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = async (config, opti ], }; }; + +export const swc: StorybookConfig['swc'] = async (config, options) => { + const isDevelopment = options.configType !== 'PRODUCTION'; + + if (!(await applyFastRefresh(options))) { + return config; + } + + return { + ...config, + jsc: { + ...(config?.jsc ?? {}), + transform: { + ...(config?.jsc?.transform ?? {}), + react: { + ...(config?.jsc?.transform?.react ?? {}), + development: isDevelopment, + refresh: isDevelopment, + }, + }, + }, + }; +}; From c714f972d91fa99169051e873c1e4e126db04901 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 10 Nov 2023 14:47:38 +0100 Subject: [PATCH 100/115] Load swc preset options for swc loader --- .../src/preview/iframe-webpack.config.ts | 2 +- .../builder-webpack5/src/preview/loaders.ts | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index af8a0c874896..8542375d1b9d 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -322,7 +322,7 @@ export default async ( }, }, builderOptions.useSWC - ? createSWCLoader(Object.keys(virtualModuleMapping)) + ? await createSWCLoader(Object.keys(virtualModuleMapping), options) : createBabelLoader(babelOptions, typescriptOptions, Object.keys(virtualModuleMapping)), { test: /\.md$/, diff --git a/code/builders/builder-webpack5/src/preview/loaders.ts b/code/builders/builder-webpack5/src/preview/loaders.ts index a458cf8cdaea..26943cd90e06 100644 --- a/code/builders/builder-webpack5/src/preview/loaders.ts +++ b/code/builders/builder-webpack5/src/preview/loaders.ts @@ -1,7 +1,8 @@ import { getProjectRoot } from '@storybook/core-common'; -import type { Options } from '@swc/core'; +import type { Options as SwcOptions } from '@swc/core'; import { dedent } from 'ts-dedent'; import { logger } from '@storybook/node-logger'; +import type { Options } from '@storybook/types'; import type { TypescriptOptions } from '../types'; export const createBabelLoader = ( @@ -22,14 +23,24 @@ export const createBabelLoader = ( }; }; -export const createSWCLoader = (excludes: string[] = []) => { +export const createSWCLoader = async (excludes: string[] = [], options: Options) => { logger.warn(dedent` The SWC loader is an experimental feature and may change or even be removed at any time. `); - const config: Options = { + const swc = await options.presets.apply('swc', {}, options); + const typescriptOptions = await options.presets.apply<{ skipCompiler?: boolean }>( + 'typescript', + {}, + options + ); + + const config: SwcOptions = { + ...swc, jsc: { + ...(swc.jsc ?? {}), parser: { + ...(swc.jsc?.parser ?? {}), syntax: 'typescript', tsx: true, dynamicImport: true, @@ -37,7 +48,7 @@ export const createSWCLoader = (excludes: string[] = []) => { }, }; return { - test: /\.(mjs|cjs|tsx?|jsx?)$/, + test: typescriptOptions.skipCompiler ? /\.(mjs|cjs|jsx?)$/ : /\.(mjs|cjs|tsx?|jsx?)$/, use: [ { loader: require.resolve('swc-loader'), From 731281e5e5331fc0cb41510bf27f02be91c5dd12 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 10 Nov 2023 16:02:40 +0100 Subject: [PATCH 101/115] Update yarn.lock --- code/yarn.lock | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/code/yarn.lock b/code/yarn.lock index e6edb2eb9d61..d18a4c18a885 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -4464,7 +4464,7 @@ __metadata: languageName: node linkType: hard -"@pmmmwh/react-refresh-webpack-plugin@npm:^0.5.1, @pmmmwh/react-refresh-webpack-plugin@npm:^0.5.5": +"@pmmmwh/react-refresh-webpack-plugin@npm:^0.5.1, @pmmmwh/react-refresh-webpack-plugin@npm:^0.5.11": version: 0.5.11 resolution: "@pmmmwh/react-refresh-webpack-plugin@npm:0.5.11" dependencies: @@ -7060,7 +7060,7 @@ __metadata: dependencies: "@babel/preset-flow": "npm:^7.22.15" "@babel/preset-react": "npm:^7.22.15" - "@pmmmwh/react-refresh-webpack-plugin": "npm:^0.5.5" + "@pmmmwh/react-refresh-webpack-plugin": "npm:^0.5.11" "@storybook/core-webpack": "workspace:*" "@storybook/docs-tools": "workspace:*" "@storybook/node-logger": "workspace:*" @@ -7072,7 +7072,7 @@ __metadata: fs-extra: "npm:^11.1.0" magic-string: "npm:^0.30.5" react-docgen: "npm:^7.0.0" - react-refresh: "npm:^0.11.0" + react-refresh: "npm:^0.14.0" semver: "npm:^7.3.7" typescript: "npm:~4.9.3" webpack: "npm:5" @@ -25635,13 +25635,6 @@ __metadata: languageName: node linkType: hard -"react-refresh@npm:^0.11.0": - version: 0.11.0 - resolution: "react-refresh@npm:0.11.0" - checksum: cbb5616c7ba670bbd2f37ddadcdfefa66e727ea188e89733ccb8184d3b874631104b0bc016d5676a7ade4d9c79100b99b46b6ed10cd117ab5d1ddcbf8653a9f2 - languageName: node - linkType: hard - "react-refresh@npm:^0.14.0": version: 0.14.0 resolution: "react-refresh@npm:0.14.0" From 89f04a53dfd56d6616786e387a9a30945de1a035 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Sun, 12 Nov 2023 19:12:26 +0100 Subject: [PATCH 102/115] Webpack5: Fix race condition for export-order loader --- .../builder-webpack5/src/preview/iframe-webpack.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index af8a0c874896..2d64e8ab5160 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -305,6 +305,7 @@ export default async ( rules: [ { test: /\.stories\.([tj])sx?$|(stories|story)\.mdx$/, + enforce: 'post', use: [ { loader: require.resolve('@storybook/builder-webpack5/loaders/export-order-loader'), From 57db28e1c09c7ff5de829ba1e9bb0c7813aade97 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Sun, 12 Nov 2023 20:11:29 +0100 Subject: [PATCH 103/115] Update export order loader --- code/builders/builder-webpack5/package.json | 2 +- .../src/loaders/export-order-loader.ts | 16 ++++++++++++---- code/yarn.lock | 9 ++++++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index 1b1cc9d002eb..be984863be65 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -78,7 +78,7 @@ "case-sensitive-paths-webpack-plugin": "^2.4.0", "constants-browserify": "^1.0.0", "css-loader": "^6.7.1", - "es-module-lexer": "^0.9.3", + "es-module-lexer": "^1.4.1", "express": "^4.17.3", "fork-ts-checker-webpack-plugin": "^8.0.0", "fs-extra": "^11.1.0", diff --git a/code/builders/builder-webpack5/src/loaders/export-order-loader.ts b/code/builders/builder-webpack5/src/loaders/export-order-loader.ts index 2ac744fc913d..8864cf88443d 100644 --- a/code/builders/builder-webpack5/src/loaders/export-order-loader.ts +++ b/code/builders/builder-webpack5/src/loaders/export-order-loader.ts @@ -7,15 +7,23 @@ export default async function loader(this: LoaderContext, source: string) { try { // eslint-disable-next-line @typescript-eslint/naming-convention - const [_, exports] = parse(source); + const [_, exports = []] = parse(source); - if (exports.includes('__namedExportsOrder')) { + const namedExportsOrder = exports.some( + (e) => source.substring(e.s, e.e) === '__namedExportsOrder' + ); + + if (namedExportsOrder) { return callback(null, source); } const magicString = new MagicString(source); - const orderedExports = exports.filter((e) => e !== 'default'); - magicString.append(`;export const __namedExportsOrder = ${JSON.stringify(orderedExports)};`); + const orderedExports = exports.filter((e) => source.substring(e.s, e.e) !== 'default'); + magicString.append( + `;export const __namedExportsOrder = ${JSON.stringify( + orderedExports.map((e) => source.substring(e.s, e.e)) + )};` + ); const map = magicString.generateMap({ hires: true }); return callback(null, magicString.toString(), map); diff --git a/code/yarn.lock b/code/yarn.lock index e6edb2eb9d61..f56eb0bdeed6 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6169,7 +6169,7 @@ __metadata: case-sensitive-paths-webpack-plugin: "npm:^2.4.0" constants-browserify: "npm:^1.0.0" css-loader: "npm:^6.7.1" - es-module-lexer: "npm:^0.9.3" + es-module-lexer: "npm:^1.4.1" express: "npm:^4.17.3" fork-ts-checker-webpack-plugin: "npm:^8.0.0" fs-extra: "npm:^11.1.0" @@ -15247,6 +15247,13 @@ __metadata: languageName: node linkType: hard +"es-module-lexer@npm:^1.4.1": + version: 1.4.1 + resolution: "es-module-lexer@npm:1.4.1" + checksum: b7260a138668554d3f0ddcc728cb4b60c2fa463f15545cf155ecbdd5450a1348952d58298a7f48642e900ee579f21d7f5304b6b3c61b3d9fc2d4b2109b5a9dff + languageName: node + linkType: hard + "es-set-tostringtag@npm:^2.0.1": version: 2.0.1 resolution: "es-set-tostringtag@npm:2.0.1" From b90ee0e773dc5e51861fe17a18e7a41a07bf77db Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Sun, 12 Nov 2023 22:06:40 +0100 Subject: [PATCH 104/115] Await parse from es-module-lexer --- .../builder-webpack5/src/loaders/export-order-loader.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/builders/builder-webpack5/src/loaders/export-order-loader.ts b/code/builders/builder-webpack5/src/loaders/export-order-loader.ts index 8864cf88443d..3d37119302b4 100644 --- a/code/builders/builder-webpack5/src/loaders/export-order-loader.ts +++ b/code/builders/builder-webpack5/src/loaders/export-order-loader.ts @@ -6,8 +6,9 @@ export default async function loader(this: LoaderContext, source: string) { const callback = this.async(); try { - // eslint-disable-next-line @typescript-eslint/naming-convention - const [_, exports = []] = parse(source); + // Do NOT remove await here. The types are wrong! It has to be awaited, + // otherwise it will return a Promise> when wasm isn't loaded. + const [, exports = []] = await parse(source); const namedExportsOrder = exports.some( (e) => source.substring(e.s, e.e) === '__namedExportsOrder' From a0368cf432774c0400d7891142086a8e5001049c Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Mon, 13 Nov 2023 11:04:55 +0100 Subject: [PATCH 105/115] log benchmark task error --- scripts/tasks/bench.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/tasks/bench.ts b/scripts/tasks/bench.ts index 25325e1090e0..664f345d541e 100644 --- a/scripts/tasks/bench.ts +++ b/scripts/tasks/bench.ts @@ -6,6 +6,8 @@ import { PORT as servePort, serve } from './serve'; // eslint-disable-next-line @typescript-eslint/no-implied-eval const dynamicImport = new Function('specifier', 'return import(specifier)'); +const logger = console; + export const bench: Task = { description: 'Run benchmarks against a sandbox in dev mode', dependsOn: ['build'], @@ -72,6 +74,10 @@ export const bench: Task = { } }); } catch (e) { + logger.log( + `An error occurred while running the benchmarks for the ${details.sandboxDir} sandbox` + ); + logger.error(e); controllers.forEach((c) => c.abort()); throw e; } From c546502b7fe0b2d3953168a9ed218522bd2a02bb Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Mon, 13 Nov 2023 11:30:03 +0100 Subject: [PATCH 106/115] Implement builder options for test build --- code/builders/builder-vite/src/build.ts | 4 +++- .../src/preview/iframe-webpack.config.ts | 20 ++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/code/builders/builder-vite/src/build.ts b/code/builders/builder-vite/src/build.ts index 1e25b7d79c69..0a0048301bdb 100644 --- a/code/builders/builder-vite/src/build.ts +++ b/code/builders/builder-vite/src/build.ts @@ -12,11 +12,13 @@ export async function build(options: Options) { build: { outDir: options.outputDir, emptyOutDir: false, // do not clean before running Vite build - Storybook has already added assets in there! - sourcemap: !options.test, rollupOptions: { // Do not try to bundle the storybook runtime, it is copied into the output dir after the build. external: ['./sb-preview/runtime.js'], }, + ...(options.test + ? { reportCompressedSize: false, sourcemap: false, target: 'esnext', treeshake: false } + : {}), }, }).build; diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index 341a5c368694..58193fad8536 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -322,7 +322,7 @@ export default async ( fullySpecified: false, }, }, - builderOptions.useSWC + builderOptions.useSWC || options.test ? await createSWCLoader(Object.keys(virtualModuleMapping), options) : createBabelLoader(babelOptions, typescriptOptions, Object.keys(virtualModuleMapping)), { @@ -355,12 +355,26 @@ export default async ( }, runtimeChunk: true, sideEffects: true, - usedExports: isProd, + usedExports: options.test ? false : isProd, moduleIds: 'named', ...(isProd ? { minimize: true, - minimizer: builderOptions.useSWC + // eslint-disable-next-line no-nested-ternary + minimizer: options.test + ? [ + new TerserWebpackPlugin({ + minify: TerserWebpackPlugin.esbuildMinify, + terserOptions: { + compress: false, + sourceMap: false, + mangle: false, + keep_classnames: true, + keep_fnames: true, + }, + }), + ] + : builderOptions.useSWC ? [ new TerserWebpackPlugin({ minify: TerserWebpackPlugin.swcMinify, From 2eed93d2a8c26620daff1e1ed8894a8758f9c0a7 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Mon, 13 Nov 2023 11:55:13 +0100 Subject: [PATCH 107/115] Set parallel --- .../builder-webpack5/src/preview/iframe-webpack.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index 58193fad8536..83c89992935a 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -364,6 +364,7 @@ export default async ( minimizer: options.test ? [ new TerserWebpackPlugin({ + parallel: true, minify: TerserWebpackPlugin.esbuildMinify, terserOptions: { compress: false, From a67976e704088ff4339e6d1fb2e3dae67ae2cf74 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Mon, 13 Nov 2023 12:59:03 +0100 Subject: [PATCH 108/115] remove compress option --- .../builder-webpack5/src/preview/iframe-webpack.config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index 83c89992935a..0b4b69bf0065 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -367,7 +367,6 @@ export default async ( parallel: true, minify: TerserWebpackPlugin.esbuildMinify, terserOptions: { - compress: false, sourceMap: false, mangle: false, keep_classnames: true, From 72f49c16747a3524cc0b4d7baec1decca10beb71 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Mon, 13 Nov 2023 13:04:32 +0100 Subject: [PATCH 109/115] Get TS types for correct options --- .../src/preview/iframe-webpack.config.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index 0b4b69bf0065..b71a58f0547f 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -8,7 +8,8 @@ import TerserWebpackPlugin from 'terser-webpack-plugin'; import VirtualModulePlugin from 'webpack-virtual-modules'; import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'; import slash from 'slash'; - +import type { TransformOptions as EsbuildOptions } from 'esbuild'; +import type { JsMinifyOptions as SwcOptions } from '@swc/core'; import type { Options, CoreConfig, DocsOptions, PreviewAnnotation } from '@storybook/types'; import { globals } from '@storybook/preview/globals'; import { @@ -363,20 +364,18 @@ export default async ( // eslint-disable-next-line no-nested-ternary minimizer: options.test ? [ - new TerserWebpackPlugin({ + new TerserWebpackPlugin({ parallel: true, minify: TerserWebpackPlugin.esbuildMinify, terserOptions: { - sourceMap: false, - mangle: false, - keep_classnames: true, - keep_fnames: true, + sourcemap: false, + treeShaking: false, }, }), ] : builderOptions.useSWC ? [ - new TerserWebpackPlugin({ + new TerserWebpackPlugin({ minify: TerserWebpackPlugin.swcMinify, terserOptions: { sourceMap: true, From b4b31437e66d8485b99e3c411af364b00b9bad1e Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Mon, 13 Nov 2023 15:31:52 +0100 Subject: [PATCH 110/115] Remove warnOnIncompatibleAddons from static build entirely --- code/lib/core-server/src/build-static.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/code/lib/core-server/src/build-static.ts b/code/lib/core-server/src/build-static.ts index 286723d8c1a1..e6775f519829 100644 --- a/code/lib/core-server/src/build-static.ts +++ b/code/lib/core-server/src/build-static.ts @@ -3,7 +3,7 @@ import { copy, emptyDir, ensureDir } from 'fs-extra'; import { dirname, isAbsolute, join, resolve } from 'path'; import { global } from '@storybook/global'; import { deprecate, logger } from '@storybook/node-logger'; -import { telemetry, getPrecedingUpgrade } from '@storybook/telemetry'; +import { getPrecedingUpgrade, telemetry } from '@storybook/telemetry'; import type { BuilderOptions, CLIOptions, @@ -30,12 +30,11 @@ import { copyAllStaticFilesRelativeToMain, } from './utils/copy-all-static-files'; import { getBuilders } from './utils/get-builders'; -import { extractStoriesJson, convertToIndexV3 } from './utils/stories-json'; +import { convertToIndexV3, extractStoriesJson } from './utils/stories-json'; import { extractStorybookMetadata } from './utils/metadata'; import { StoryIndexGenerator } from './utils/StoryIndexGenerator'; import { summarizeIndex } from './utils/summarizeIndex'; import { defaultStaticDirs } from './utils/constants'; -import { warnOnIncompatibleAddons } from './utils/warnOnIncompatibleAddons'; export type BuildStaticStandaloneOptions = CLIOptions & LoadOptions & @@ -77,10 +76,6 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption logger.warn(`you have not specified a framework in your ${options.configDir}/main.js`); } - if (options.test) { - await warnOnIncompatibleAddons(config); - } - logger.info('=> Loading presets'); let presets = await loadAllPresets({ corePresets: [ From bd71c78366380321c5dfd6a8dd6421e59195df31 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Mon, 13 Nov 2023 15:59:30 +0100 Subject: [PATCH 111/115] use feature flags --- code/builders/builder-vite/src/build.ts | 7 ++++++- .../src/preview/iframe-webpack.config.ts | 10 +++++----- code/lib/types/src/modules/core-common.ts | 12 ++++++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/code/builders/builder-vite/src/build.ts b/code/builders/builder-vite/src/build.ts index 0a0048301bdb..ccf9f9476a5f 100644 --- a/code/builders/builder-vite/src/build.ts +++ b/code/builders/builder-vite/src/build.ts @@ -17,7 +17,12 @@ export async function build(options: Options) { external: ['./sb-preview/runtime.js'], }, ...(options.test - ? { reportCompressedSize: false, sourcemap: false, target: 'esnext', treeshake: false } + ? { + reportCompressedSize: false, + sourcemap: !options.build?.test?.disableSourcemaps, + target: 'esnext', + treeshake: !options.build?.test?.disableTreeShaking, + } : {}), }, }).build; diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index c10d36e11733..62dc85f11d55 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -228,7 +228,7 @@ export default async ( name: 'preview', mode: isProd ? 'production' : 'development', bail: isProd, - devtool: options.test ? false : 'cheap-module-source-map', + devtool: options.build?.test?.disableSourcemaps ? false : 'cheap-module-source-map', entry: entries, output: { path: resolve(process.cwd(), outputDir), @@ -323,7 +323,7 @@ export default async ( fullySpecified: false, }, }, - builderOptions.useSWC || options.test + builderOptions.useSWC || options.build?.test?.optimizeCompilation ? await createSWCLoader(Object.keys(virtualModuleMapping), options) : createBabelLoader(babelOptions, typescriptOptions, Object.keys(virtualModuleMapping)), { @@ -356,20 +356,20 @@ export default async ( }, runtimeChunk: true, sideEffects: true, - usedExports: options.test ? false : isProd, + usedExports: options.build?.test?.disableTreeShaking ? false : isProd, moduleIds: 'named', ...(isProd ? { minimize: true, // eslint-disable-next-line no-nested-ternary - minimizer: options.test + minimizer: options.build?.test?.optimizeCompilation ? [ new TerserWebpackPlugin({ parallel: true, minify: TerserWebpackPlugin.esbuildMinify, terserOptions: { compress: false, - sourceMap: false, + sourceMap: !options.build?.test?.disableSourcemaps, mangle: false, keep_classnames: true, keep_fnames: true, diff --git a/code/lib/types/src/modules/core-common.ts b/code/lib/types/src/modules/core-common.ts index 8ffe22b1d01f..47c7d88cba8b 100644 --- a/code/lib/types/src/modules/core-common.ts +++ b/code/lib/types/src/modules/core-common.ts @@ -283,6 +283,18 @@ export interface TestBuildFlags { * Override docgen to be disabled. */ disableDocgen?: boolean; + /** + * Override sourcemaps generation to be disabled. + */ + disableSourcemaps?: boolean; + /** + * Override tree-shaking (dead code elimination) to be disabled. + */ + disableTreeShaking?: boolean; + /** + * Compile/Optimize with SWC. + */ + optimizeCompilation?: boolean; } export interface TestBuildConfig { From f09246bcaeb4c486eb037301fbde530b89f1f172 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Mon, 13 Nov 2023 16:12:26 +0100 Subject: [PATCH 112/115] disable sourcemaps even if no optimizeCompilation --- .../builder-webpack5/src/preview/iframe-webpack.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index 7b239ee857ea..0c3d53165e08 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -379,7 +379,7 @@ export default async ( new TerserWebpackPlugin({ minify: TerserWebpackPlugin.swcMinify, terserOptions: { - sourceMap: true, + sourceMap: !options.build?.test?.disableSourcemaps, mangle: false, keep_fnames: true, }, @@ -389,7 +389,7 @@ export default async ( new TerserWebpackPlugin({ parallel: true, terserOptions: { - sourceMap: true, + sourceMap: !options.build?.test?.disableSourcemaps, mangle: false, keep_fnames: true, }, From e58849e6df7946ef27bbad651fd10cec45fe5cfa Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Mon, 13 Nov 2023 16:23:42 +0100 Subject: [PATCH 113/115] fix default values --- code/lib/core-server/src/presets/common-preset.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/lib/core-server/src/presets/common-preset.ts b/code/lib/core-server/src/presets/common-preset.ts index 22f75191ecf3..e953a5cd3dc7 100644 --- a/code/lib/core-server/src/presets/common-preset.ts +++ b/code/lib/core-server/src/presets/common-preset.ts @@ -192,6 +192,9 @@ const testBuildFeatures = (value: boolean): Required => ({ removeMDXEntries: value, removeAutoDocs: value, disableDocgen: value, + disableSourcemaps: value, + disableTreeShaking: value, + optimizeCompilation: value, }); export const features = async ( From 9c16b0f0be06a225fce1396d114f1171b1d4ed28 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Mon, 13 Nov 2023 21:33:55 +0100 Subject: [PATCH 114/115] Revert "Addons, core: Make `react` and Storybook packages `devDependencies` where possible" --- code/.eslintrc.js | 73 +---- code/addons/a11y/package.json | 55 ++-- code/addons/actions/package.json | 72 +++-- code/addons/backgrounds/package.json | 68 +++-- code/addons/controls/package.json | 54 +++- code/addons/docs/README.md | 2 + .../addons/docs/src/ensure-react-peer-deps.ts | 9 +- code/addons/docs/src/preset.ts | 10 +- code/addons/essentials/package.json | 115 +++++-- code/addons/essentials/src/actions/preview.ts | 1 + .../essentials/src/backgrounds/manager.ts | 1 - .../essentials/src/backgrounds/preview.ts | 4 +- .../addons/essentials/src/controls/manager.ts | 1 - .../essentials/src/highlight/preview.ts | 4 +- code/addons/essentials/src/measure/manager.ts | 1 - code/addons/essentials/src/measure/preview.ts | 4 +- code/addons/essentials/src/outline/manager.ts | 1 - code/addons/essentials/src/outline/preview.ts | 4 +- .../addons/essentials/src/toolbars/manager.ts | 1 - .../addons/essentials/src/viewport/manager.ts | 1 - code/addons/gfm/package.json | 19 +- code/addons/highlight/package.json | 30 +- code/addons/interactions/package.json | 77 +++-- code/addons/jest/package.json | 58 +++- code/addons/links/package.json | 57 ++-- code/addons/measure/package.json | 52 ++-- code/addons/outline/package.json | 65 ++-- code/addons/storysource/package.json | 48 +-- code/addons/themes/package.json | 55 +++- code/addons/toolbars/package.json | 53 +++- code/addons/viewport/package.json | 64 +++- code/builders/builder-manager/src/index.ts | 4 +- .../builder-manager/src/utils/globals.ts | 1 + .../builders/builder-vite/src/optimizeDeps.ts | 20 +- code/builders/builder-vite/src/vite-config.ts | 8 +- .../src/preview/iframe-webpack.config.ts | 7 +- code/deprecated/addons/package.json | 4 + code/deprecated/manager-api-shim/package.json | 12 + code/frameworks/angular/package.json | 3 + code/frameworks/ember/package.json | 4 +- code/frameworks/html-webpack5/package.json | 4 +- code/frameworks/preact-webpack5/package.json | 4 +- code/frameworks/server-webpack5/package.json | 4 + code/frameworks/svelte-webpack5/package.json | 2 + code/frameworks/vue-vite/package.json | 2 + code/frameworks/vue-webpack5/package.json | 2 + code/frameworks/vue3-vite/package.json | 2 + code/frameworks/vue3-webpack5/package.json | 2 + .../web-components-vite/package.json | 4 + .../web-components-webpack5/package.json | 4 +- .../src/utils/warnOnIncompatibleAddons.ts | 2 +- code/lib/manager-api/package.json | 10 +- code/lib/manager-api/src/index.tsx | 13 +- code/lib/preview-api/package.json | 1 + code/lib/preview/package.json | 3 - code/lib/preview/src/globals.ts | 2 +- code/lib/preview/src/globals/runtime.ts | 14 +- .../src/globals/{globals.ts => types.ts} | 13 +- code/lib/preview/src/runtime.ts | 10 +- code/lib/router/package.json | 20 +- code/lib/source-loader/package.json | 4 + code/lib/theming/package.json | 14 - code/renderers/preact/template/cli/Button.jsx | 45 ++- code/renderers/preact/template/cli/Header.jsx | 26 +- code/renderers/preact/template/cli/Page.jsx | 3 - .../preact/template/components/Button.jsx | 15 +- .../preact/template/components/Form.jsx | 16 +- .../preact/template/components/Html.jsx | 9 + .../preact/template/components/Pre.jsx | 23 +- .../preact/template/stories/React.js | 20 +- .../template/stories/react-compat.stories.js | 1 + code/renderers/svelte/package.json | 1 - code/ui/manager/package.json | 28 +- .../manager/scripts/generate-exports-file.ts | 13 +- code/ui/manager/src/globals-module-info.ts | 1 - code/ui/manager/src/globals.ts | 2 +- ...{globals-module-info.ts => definitions.ts} | 23 +- code/ui/manager/src/globals/exports.ts | 1 - code/ui/manager/src/globals/globals.ts | 19 -- code/ui/manager/src/globals/runtime.ts | 48 ++- code/ui/manager/src/globals/types.ts | 18 ++ code/ui/manager/src/runtime.ts | 8 +- code/ui/manager/src/typings.d.ts | 20 +- code/yarn.lock | 201 +++++++++--- scripts/package.json | 1 - scripts/prepare/addon-bundle.ts | 285 ------------------ scripts/yarn.lock | 8 - 87 files changed, 1152 insertions(+), 941 deletions(-) create mode 100644 code/builders/builder-manager/src/utils/globals.ts rename code/lib/preview/src/globals/{globals.ts => types.ts} (73%) delete mode 100644 code/ui/manager/src/globals-module-info.ts rename code/ui/manager/src/globals/{globals-module-info.ts => definitions.ts} (65%) delete mode 100644 code/ui/manager/src/globals/globals.ts create mode 100644 code/ui/manager/src/globals/types.ts delete mode 100755 scripts/prepare/addon-bundle.ts diff --git a/code/.eslintrc.js b/code/.eslintrc.js index 65a8d1034316..35086680644d 100644 --- a/code/.eslintrc.js +++ b/code/.eslintrc.js @@ -1,19 +1,7 @@ const path = require('path'); -const fs = require('fs'); const scriptPath = path.join(__dirname, '..', 'scripts'); -const addonsPackages = fs - .readdirSync(path.join(__dirname, 'addons')) - .filter((p) => fs.statSync(path.join(__dirname, 'addons', p)).isDirectory()); -const libPackages = fs - .readdirSync(path.join(__dirname, 'lib')) - .filter((p) => fs.statSync(path.join(__dirname, 'lib', p)).isDirectory()); -const uiPackages = fs - .readdirSync(path.join(__dirname, 'ui')) - .filter((p) => fs.statSync(path.join(__dirname, 'ui', p)).isDirectory()) - .filter((p) => !p.startsWith('.')); - module.exports = { root: true, extends: [path.join(scriptPath, '.eslintrc.js')], @@ -65,6 +53,7 @@ module.exports = { project: null, }, rules: { + // '@typescript-eslint/no-var-requires': 'off', '@typescript-eslint/dot-notation': 'off', '@typescript-eslint/no-implied-eval': 'off', '@typescript-eslint/no-throw-literal': 'off', @@ -88,7 +77,15 @@ module.exports = { }, { // these packages use pre-bundling, dependencies will be bundled, and will be in devDepenencies - files: ['frameworks/**/*', 'builders/**/*', 'deprecated/**/*', 'renderers/**/*'], + files: [ + 'addons/**/*', + 'frameworks/**/*', + 'lib/**/*', + 'builders/**/*', + 'deprecated/**/*', + 'renderers/**/*', + 'ui/**/*', + ], excludedFiles: ['frameworks/angular/**/*', 'frameworks/ember/**/*', 'lib/core-server/**/*'], rules: { 'import/no-extraneous-dependencies': [ @@ -98,47 +95,11 @@ module.exports = { }, }, { - files: ['**/ui/.storybook/**'], + files: ['**/ui/*', '**/ui/.storybook/*'], rules: { - 'import/no-extraneous-dependencies': [ - 'error', - { packageDir: [__dirname], devDependencies: true }, - ], + 'import/no-extraneous-dependencies': ['error', { packageDir: __dirname }], }, }, - ...addonsPackages.map((directory) => ({ - files: [path.join('**', 'addons', directory, '**', '*.*')], - rules: { - 'import/no-extraneous-dependencies': [ - 'error', - { - packageDir: [__dirname, path.join(__dirname, 'addons', directory)], - devDependencies: true, - }, - ], - }, - })), - ...uiPackages.map((directory) => ({ - files: [path.join('**', 'ui', directory, '**', '*.*')], - rules: { - 'import/no-extraneous-dependencies': [ - 'error', - { packageDir: [__dirname, path.join(__dirname, 'ui', directory)], devDependencies: true }, - ], - }, - })), - ...libPackages.map((directory) => ({ - files: [path.join('**', 'lib', directory, '**', '*.*')], - rules: { - 'import/no-extraneous-dependencies': [ - 'error', - { - packageDir: [__dirname, path.join(__dirname, 'lib', directory)], - devDependencies: true, - }, - ], - }, - })), { files: [ '**/__tests__/**', @@ -160,24 +121,16 @@ module.exports = { 'react/require-default-props': 'off', }, }, + { files: '**/.storybook/config.js', rules: { 'global-require': 'off' } }, { files: ['**/*.stories.*'], rules: { 'no-console': 'off', }, }, - { - files: ['**/renderers/preact/**/*'], - rules: { - 'react/react-in-jsx-scope': 'off', - 'react/prop-types': 'off', - }, - }, { files: ['**/*.tsx', '**/*.ts'], rules: { - 'no-shadow': 'off', - '@typescript-eslint/ban-types': 'warn', // should become error, in the future 'react/require-default-props': 'off', 'react/prop-types': 'off', // we should use types 'react/forbid-prop-types': 'off', // we should use types diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index 26118b8d2e53..444e4bd68512 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -32,9 +32,21 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": "./dist/manager.js", - "./preview": "./dist/preview.js", - "./register": "./dist/manager.js", + "./manager": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, + "./preview": { + "types": "./dist/preview.d.ts", + "require": "./dist/preview.js", + "import": "./dist/preview.mjs" + }, + "./register": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -49,40 +61,47 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addon-highlight": "workspace:*", - "axe-core": "^4.2.0" - }, - "devDependencies": { "@storybook/channels": "workspace:*", "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", + "@storybook/core-events": "workspace:*", "@storybook/global": "^5.0.0", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", - "@testing-library/react": "^11.2.2", + "axe-core": "^4.2.0", "lodash": "^4.17.21", - "react": "^16.8.0", - "react-dom": "^16.8.0", - "react-resize-detector": "^7.1.2", + "react-resize-detector": "^7.1.2" + }, + "devDependencies": { + "@testing-library/react": "^11.2.2", "resize-observer-polyfill": "^1.5.1", "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, "publishConfig": { "access": "public" }, "bundler": { - "exportEntries": [ - "./src/index.ts" - ], - "managerEntries": [ - "./src/manager.tsx" - ], - "previewEntries": [ + "entries": [ + "./src/index.ts", + "./src/manager.tsx", "./src/preview.tsx" ] }, diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index f5cdc0943122..60301b01cdad 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -33,9 +33,21 @@ "require": "./dist/decorator.js", "import": "./dist/decorator.mjs" }, - "./manager": "./dist/manager.js", - "./preview": "./dist/preview.js", - "./register.js": "./dist/manager.js", + "./manager": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, + "./preview": { + "types": "./dist/preview.d.ts", + "require": "./dist/preview.js", + "import": "./dist/preview.mjs" + }, + "./register.js": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -46,8 +58,14 @@ "*": [ "dist/index.d.ts" ], + "manager": [ + "dist/manager.d.ts" + ], "decorator": [ "dist/decorator.d.ts" + ], + "preview": [ + "dist/preview.d.ts" ] } }, @@ -60,45 +78,51 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/global": "^5.0.0", - "@types/lodash": "^4.14.167", - "@types/uuid": "^9.0.1", - "dequal": "^2.0.2", - "lodash": "^4.17.21", - "polished": "^4.2.2", - "telejson": "^7.2.0", - "ts-dedent": "^2.0.0", - "uuid": "^9.0.0" - }, - "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-events": "workspace:*", + "@storybook/global": "^5.0.0", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", + "dequal": "^2.0.2", + "lodash": "^4.17.21", + "polished": "^4.2.2", "prop-types": "^15.7.2", - "react": "^16.8.0", - "react-dom": "^16.8.0", "react-inspector": "^6.0.0", + "telejson": "^7.2.0", + "ts-dedent": "^2.0.0", + "uuid": "^9.0.0" + }, + "devDependencies": { + "@types/lodash": "^4.14.167", + "@types/uuid": "^9.0.1", "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, "publishConfig": { "access": "public" }, "bundler": { - "exportEntries": [ + "entries": [ + "./src/index.ts", "./src/decorator.ts", - "./src/index.ts" - ], - "managerEntries": [ - "./src/manager.tsx" - ], - "previewEntries": [ + "./src/manager.tsx", "./src/preview.ts" ] }, diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index 139031e1eed0..7f327cbb1aca 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -32,14 +32,39 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": "./dist/manager.js", - "./preview": "./dist/preview.js", - "./register": "./dist/manager.js", + "./manager": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, + "./preview": { + "types": "./dist/preview.d.ts", + "require": "./dist/preview.js", + "import": "./dist/preview.mjs" + }, + "./register": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "dist/index.d.ts" + ], + "manager": [ + "dist/manager.d.ts" + ], + "preview": [ + "dist/preview.d.ts" + ] + } + }, "files": [ "dist/**/*", "README.md", @@ -49,35 +74,42 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/global": "^5.0.0", - "memoizerific": "^1.11.3", - "ts-dedent": "^2.0.0" - }, - "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", + "@storybook/core-events": "workspace:*", + "@storybook/global": "^5.0.0", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", - "react": "^16.8.0", - "react-dom": "^16.8.0", + "memoizerific": "^1.11.3", + "ts-dedent": "^2.0.0" + }, + "devDependencies": { "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, "publishConfig": { "access": "public" }, "bundler": { - "exportEntries": [ - "./src/index.ts" - ], - "managerEntries": [ - "./src/manager.tsx" - ], - "previewEntries": [ + "entries": [ + "./src/index.ts", + "./src/manager.tsx", "./src/preview.tsx" ] }, diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index 553f91d0f937..f8b7e7848134 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -32,13 +32,31 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": "./dist/manager.js", - "./register": "./dist/manager.js", + "./manager": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, + "./register": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "dist/index.d.ts" + ], + "manager": [ + "dist/manager.d.ts" + ] + } + }, "files": [ "dist/**/*", "README.md", @@ -48,35 +66,43 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/blocks": "workspace:*", - "lodash": "^4.17.21", - "ts-dedent": "^2.0.0" - }, - "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-common": "workspace:*", + "@storybook/core-events": "workspace:*", "@storybook/manager-api": "workspace:*", "@storybook/node-logger": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", - "react": "^16.8.0", - "react-dom": "^16.8.0" + "lodash": "^4.17.21", + "ts-dedent": "^2.0.0" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } }, "publishConfig": { "access": "public" }, "bundler": { - "exportEntries": [ - "./src/index.ts" - ], - "managerEntries": [ + "entries": [ + "./src/index.ts", "./src/manager.tsx" - ] + ], + "platform": "browser" }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { diff --git a/code/addons/docs/README.md b/code/addons/docs/README.md index 9a9a3debad2a..025ff9bbd697 100644 --- a/code/addons/docs/README.md +++ b/code/addons/docs/README.md @@ -156,8 +156,10 @@ export default { `csfPluginOptions` is an object for configuring `@storybook/csf-plugin`. When set to `null` it tells docs not to run the `csf-plugin` at all, which can be used as an optimization, or if you're already using `csf-plugin` in your `main.js`. + > With the release of version 7.0, it is no longer possible to import `.md` files directly into Storybook using the `transcludeMarkdown` [option](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#importing-plain-markdown-files-with-transcludemarkdown-has-changed). Instead, we recommend using the [`Markdown`](https://storybook.js.org/docs/react/api/doc-block-markdown) Doc Block for importing Markdown files into your Storybook documentation. + ## TypeScript configuration As of SB6 [TypeScript is zero-config](https://storybook.js.org/docs/react/configure/typescript) and should work with SB Docs out of the box. For advanced configuration options, refer to the [Props documentation](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/props-tables.md). diff --git a/code/addons/docs/src/ensure-react-peer-deps.ts b/code/addons/docs/src/ensure-react-peer-deps.ts index 37520dff343e..6958b7e40653 100644 --- a/code/addons/docs/src/ensure-react-peer-deps.ts +++ b/code/addons/docs/src/ensure-react-peer-deps.ts @@ -7,14 +7,13 @@ export function ensureReactPeerDeps() { require.resolve('react-dom'); } catch (e) { logger.error(dedent` - Starting in 7.0, react and react-dom are now required peer dependencies of @storybook/addon-docs. + Starting in 7.0, react and react-dom are now required peer dependencies of Storybook. https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#react-peer-dependencies-required - You can continue to use Storybook without addon-docs, or you can install react and react-dom in your project: + It seems that you haven't run Storybook's CLI to upgrade to the latest version. + The upgrade command will install the required peer dependencies for you and will take + care of other important auto migrations as well. - You can use the upgrade command in Storybook's CLI to automatically install the required - peer dependencies for you. - If you want to upgrade to the latest prerelease version, please run: $ npx storybook@next upgrade --prerelease diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts index c716775bdfa9..22b5834c9e9a 100644 --- a/code/addons/docs/src/preset.ts +++ b/code/addons/docs/src/preset.ts @@ -194,12 +194,4 @@ const docsX = docs as any; ensureReactPeerDeps(); -const optimizeViteDeps = [ - '@mdx-js/react', - '@storybook/addon-docs > acorn-jsx', - '@storybook/addon-docs', - '@storybook/addon-essentials/docs/mdx-react-shim', - 'markdown-to-jsx', -]; - -export { webpackX as webpack, indexersX as experimental_indexers, docsX as docs, optimizeViteDeps }; +export { webpackX as webpack, indexersX as experimental_indexers, docsX as docs }; diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index dbe086cce288..a9722558e3f4 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -28,21 +28,81 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./actions/preview": "./dist/actions/preview.js", - "./actions/manager": "./dist/actions/manager.js", - "./backgrounds/preview": "./dist/backgrounds/preview.js", - "./backgrounds/manager": "./dist/backgrounds/manager.js", - "./controls/manager": "./dist/controls/manager.js", - "./docs/preview": "./dist/docs/preview.js", - "./docs/preset": "./dist/docs/preset.js", - "./docs/mdx-react-shim": "./dist/docs/mdx-react-shim.js", - "./highlight/preview": "./dist/highlight/preview.js", - "./measure/preview": "./dist/measure/preview.js", - "./measure/manager": "./dist/measure/manager.js", - "./outline/preview": "./dist/outline/preview.js", - "./outline/manager": "./dist/outline/manager.js", - "./toolbars/manager": "./dist/toolbars/manager.js", - "./viewport/manager": "./dist/viewport/manager.js", + "./actions/preview": { + "types": "./dist/actions/preview.d.ts", + "require": "./dist/actions/preview.js", + "import": "./dist/actions/preview.mjs" + }, + "./actions/manager": { + "types": "./dist/actions/manager.d.ts", + "require": "./dist/actions/manager.js", + "import": "./dist/actions/manager.mjs" + }, + "./backgrounds/preview": { + "types": "./dist/backgrounds/preview.d.ts", + "require": "./dist/backgrounds/preview.js", + "import": "./dist/backgrounds/preview.mjs" + }, + "./backgrounds/manager": { + "types": "./dist/backgrounds/manager.d.ts", + "require": "./dist/backgrounds/manager.js", + "import": "./dist/backgrounds/manager.mjs" + }, + "./controls/manager": { + "types": "./dist/controls/manager.d.ts", + "require": "./dist/controls/manager.js", + "import": "./dist/controls/manager.mjs" + }, + "./docs/preview": { + "types": "./dist/docs/preview.d.ts", + "require": "./dist/docs/preview.js", + "import": "./dist/docs/preview.mjs" + }, + "./docs/preset": { + "types": "./dist/docs/preset.d.ts", + "require": "./dist/docs/preset.js", + "import": "./dist/docs/preset.mjs" + }, + "./docs/mdx-react-shim": { + "types": "./dist/docs/mdx-react-shim.d.ts", + "require": "./dist/docs/mdx-react-shim.js", + "import": "./dist/docs/mdx-react-shim.mjs" + }, + "./highlight/preview": { + "types": "./dist/highlight/preview.d.ts", + "require": "./dist/highlight/preview.js", + "import": "./dist/highlight/preview.mjs" + }, + "./measure/preview": { + "types": "./dist/measure/preview.d.ts", + "require": "./dist/measure/preview.js", + "import": "./dist/measure/preview.mjs" + }, + "./measure/manager": { + "types": "./dist/measure/manager.d.ts", + "require": "./dist/measure/manager.js", + "import": "./dist/measure/manager.mjs" + }, + "./outline/preview": { + "types": "./dist/outline/preview.d.ts", + "require": "./dist/outline/preview.js", + "import": "./dist/outline/preview.mjs" + }, + "./outline/manager": { + "types": "./dist/outline/manager.d.ts", + "require": "./dist/outline/manager.js", + "import": "./dist/outline/manager.mjs" + }, + "./toolbars/manager": { + "types": "./dist/toolbars/manager.d.ts", + "require": "./dist/toolbars/manager.js", + "import": "./dist/toolbars/manager.mjs" + }, + "./viewport/manager": { + "types": "./dist/viewport/manager.d.ts", + "require": "./dist/viewport/manager.js", + "import": "./dist/viewport/manager.mjs" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -57,7 +117,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addon-actions": "workspace:*", @@ -87,28 +147,25 @@ "access": "public" }, "bundler": { - "nodeEntries": [ + "entries": [ "./src/index.ts", - "./src/docs/preset.ts", - "./src/docs/mdx-react-shim.ts" - ], - "managerEntries": [ + "./src/actions/preview.ts", "./src/actions/manager.ts", + "./src/backgrounds/preview.ts", "./src/backgrounds/manager.ts", "./src/controls/manager.ts", + "./src/docs/preview.ts", + "./src/docs/preset.ts", + "./src/docs/mdx-react-shim.ts", + "./src/highlight/preview.ts", + "./src/measure/preview.ts", "./src/measure/manager.ts", + "./src/outline/preview.ts", "./src/outline/manager.ts", "./src/toolbars/manager.ts", "./src/viewport/manager.ts" ], - "previewEntries": [ - "./src/actions/preview.ts", - "./src/backgrounds/preview.ts", - "./src/docs/preview.ts", - "./src/highlight/preview.ts", - "./src/measure/preview.ts", - "./src/outline/preview.ts" - ] + "platform": "node" }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" } diff --git a/code/addons/essentials/src/actions/preview.ts b/code/addons/essentials/src/actions/preview.ts index 12b8c76bf2cb..86c6d5f2e656 100644 --- a/code/addons/essentials/src/actions/preview.ts +++ b/code/addons/essentials/src/actions/preview.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/export */ // TODO: We need to configure an eslint-import typescript resolver for export maps to be considered export * from '@storybook/addon-actions/preview'; diff --git a/code/addons/essentials/src/backgrounds/manager.ts b/code/addons/essentials/src/backgrounds/manager.ts index 9da6a432be39..930d5ee38181 100644 --- a/code/addons/essentials/src/backgrounds/manager.ts +++ b/code/addons/essentials/src/backgrounds/manager.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-backgrounds/manager'; diff --git a/code/addons/essentials/src/backgrounds/preview.ts b/code/addons/essentials/src/backgrounds/preview.ts index cf24112788f3..5e56121e4a03 100644 --- a/code/addons/essentials/src/backgrounds/preview.ts +++ b/code/addons/essentials/src/backgrounds/preview.ts @@ -1,2 +1,4 @@ -// @ts-expect-error (no types needed for this) +/* eslint-disable import/export */ +// TODO: We need to configure an eslint-import typescript resolver for export maps to be considered + export * from '@storybook/addon-backgrounds/preview'; diff --git a/code/addons/essentials/src/controls/manager.ts b/code/addons/essentials/src/controls/manager.ts index 933adbd4e101..c902436bf5ff 100644 --- a/code/addons/essentials/src/controls/manager.ts +++ b/code/addons/essentials/src/controls/manager.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-controls/manager'; diff --git a/code/addons/essentials/src/highlight/preview.ts b/code/addons/essentials/src/highlight/preview.ts index e124e7a1374a..ffcf62555af2 100644 --- a/code/addons/essentials/src/highlight/preview.ts +++ b/code/addons/essentials/src/highlight/preview.ts @@ -1,2 +1,4 @@ -// @ts-expect-error (no types needed for this) +/* eslint-disable import/export */ +// TODO: We need to configure an eslint-import typescript resolver for export maps to be considered + export * from '@storybook/addon-highlight/preview'; diff --git a/code/addons/essentials/src/measure/manager.ts b/code/addons/essentials/src/measure/manager.ts index 688ffbed236d..ceef38cd36ad 100644 --- a/code/addons/essentials/src/measure/manager.ts +++ b/code/addons/essentials/src/measure/manager.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-measure/manager'; diff --git a/code/addons/essentials/src/measure/preview.ts b/code/addons/essentials/src/measure/preview.ts index 647ef4345a6d..f18769ff001a 100644 --- a/code/addons/essentials/src/measure/preview.ts +++ b/code/addons/essentials/src/measure/preview.ts @@ -1,2 +1,4 @@ -// @ts-expect-error (no types needed for this) +/* eslint-disable import/export */ +// TODO: We need to configure an eslint-import typescript resolver for export maps to be considered + export * from '@storybook/addon-measure/preview'; diff --git a/code/addons/essentials/src/outline/manager.ts b/code/addons/essentials/src/outline/manager.ts index d3a29db6d98b..9f46ef8cbae4 100644 --- a/code/addons/essentials/src/outline/manager.ts +++ b/code/addons/essentials/src/outline/manager.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-outline/manager'; diff --git a/code/addons/essentials/src/outline/preview.ts b/code/addons/essentials/src/outline/preview.ts index 3fe09381fe8f..1cc44b9689a8 100644 --- a/code/addons/essentials/src/outline/preview.ts +++ b/code/addons/essentials/src/outline/preview.ts @@ -1,2 +1,4 @@ -// @ts-expect-error (no types needed for this) +/* eslint-disable import/export */ +// TODO: We need to configure an eslint-import typescript resolver for export maps to be considered + export * from '@storybook/addon-outline/preview'; diff --git a/code/addons/essentials/src/toolbars/manager.ts b/code/addons/essentials/src/toolbars/manager.ts index 888dfe31937d..fde1c66907a1 100644 --- a/code/addons/essentials/src/toolbars/manager.ts +++ b/code/addons/essentials/src/toolbars/manager.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-toolbars/manager'; diff --git a/code/addons/essentials/src/viewport/manager.ts b/code/addons/essentials/src/viewport/manager.ts index 48bc7a850de6..ccbe283d4101 100644 --- a/code/addons/essentials/src/viewport/manager.ts +++ b/code/addons/essentials/src/viewport/manager.ts @@ -1,2 +1 @@ -// @ts-expect-error (no types needed for this) export * from '@storybook/addon-viewport/manager'; diff --git a/code/addons/gfm/package.json b/code/addons/gfm/package.json index 4ee994246166..61cdb72359ad 100644 --- a/code/addons/gfm/package.json +++ b/code/addons/gfm/package.json @@ -25,8 +25,16 @@ }, "license": "MIT", "exports": { - ".": "./dist/index.js", - "./preset": "./dist/index.js", + ".": { + "types": "./dist/index.d.ts", + "node": "./dist/index.js", + "require": "./dist/index.js" + }, + "./preset": { + "types": "./dist/index.d.ts", + "node": "./dist/index.js", + "require": "./dist/index.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -41,7 +49,7 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/node-logger": "workspace:*", @@ -55,8 +63,11 @@ "access": "public" }, "bundler": { - "nodeEntries": [ + "entries": [ "./src/index.ts" + ], + "formats": [ + "cjs" ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 9dd090aa9fac..ee036159d5c6 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -30,12 +30,26 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./preview": "./dist/preview.js", + "./preview": { + "types": "./dist/preview.d.ts", + "require": "./dist/preview.js", + "import": "./dist/preview.mjs" + }, "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "dist/index.d.ts" + ], + "preview": [ + "dist/preview.d.ts" + ] + } + }, "files": [ "dist/**/*", "README.md", @@ -45,14 +59,14 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/global": "^5.0.0" + "@storybook/core-events": "workspace:*", + "@storybook/global": "^5.0.0", + "@storybook/preview-api": "workspace:*" }, "devDependencies": { - "@storybook/core-events": "workspace:*", - "@storybook/preview-api": "workspace:*", "@types/webpack-env": "^1.16.0", "typescript": "~4.9.3" }, @@ -60,10 +74,8 @@ "access": "public" }, "bundler": { - "exportEntries": [ - "./src/index.ts" - ], - "previewEntries": [ + "entries": [ + "./src/index.ts", "./src/preview.ts" ] }, diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index df2a6617fa34..82c13d764f47 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -28,14 +28,39 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": "./dist/manager.js", - "./preview": "./dist/preview.js", - "./register.js": "./dist/manager.js", + "./manager": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, + "./preview": { + "types": "./dist/preview.d.ts", + "require": "./dist/preview.js", + "import": "./dist/preview.mjs" + }, + "./register.js": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "dist/index.d.ts" + ], + "manager": [ + "dist/manager.d.ts" + ], + "preview": [ + "dist/preview.d.ts" + ] + } + }, "files": [ "dist/**/*", "README.md", @@ -45,10 +70,18 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { + "@storybook/client-logger": "workspace:*", + "@storybook/components": "workspace:*", + "@storybook/core-common": "workspace:*", + "@storybook/core-events": "workspace:*", "@storybook/global": "^5.0.0", + "@storybook/instrumenter": "workspace:*", + "@storybook/manager-api": "workspace:*", + "@storybook/preview-api": "workspace:*", + "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", "jest-mock": "^27.0.6", "polished": "^4.2.2", @@ -56,36 +89,32 @@ }, "devDependencies": { "@devtools-ds/object-inspector": "^1.1.2", - "@storybook/client-logger": "workspace:*", - "@storybook/components": "workspace:*", - "@storybook/core-common": "workspace:*", - "@storybook/core-events": "workspace:*", - "@storybook/instrumenter": "workspace:*", "@storybook/jest": "next", - "@storybook/manager-api": "workspace:*", - "@storybook/preview-api": "workspace:*", "@storybook/testing-library": "next", - "@storybook/theming": "workspace:*", "@types/node": "^18.0.0", "formik": "^2.2.9", - "react": "^16.8.0", - "react-dom": "^16.8.0", "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, "publishConfig": { "access": "public" }, "bundler": { - "exportEntries": [ - "./src/index.ts" - ], - "managerEntries": [ - "./src/manager.tsx" - ], - "previewEntries": [ - "./src/preview.ts" - ], - "nodeEntries": [ + "entries": [ + "./src/index.ts", + "./src/manager.tsx", + "./src/preview.ts", "./src/preset.ts" ] }, diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index 4ff5cbda64ba..e4b8e157f50c 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -34,13 +34,31 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": "./dist/manager.js", - "./register": "./dist/manager.js", + "./manager": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, + "./register": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "dist/index.d.ts" + ], + "manager": [ + "dist/manager.d.ts" + ] + } + }, "files": [ "dist/**/*", "README.md", @@ -50,36 +68,44 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/global": "^5.0.0", - "tiny-invariant": "^1.3.1", - "ts-dedent": "^2.0.0", - "upath": "^2.0.1" - }, - "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-events": "workspace:*", + "@storybook/global": "^5.0.0", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", - "react": "^16.8.0", - "react-dom": "^16.8.0", "react-resize-detector": "^7.1.2", + "tiny-invariant": "^1.3.1", + "upath": "^2.0.1" + }, + "devDependencies": { "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, "publishConfig": { "access": "public" }, "bundler": { - "exportEntries": [ - "./src/index.ts" - ], - "managerEntries": [ + "entries": [ + "./src/index.ts", "./src/manager.tsx" - ] + ], + "platform": "browser" }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { diff --git a/code/addons/links/package.json b/code/addons/links/package.json index 61e1e01112f2..5f7a2faaf8ab 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -28,14 +28,26 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, + "./manager": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, + "./preview": { + "types": "./dist/preview.d.ts", + "require": "./dist/preview.js", + "import": "./dist/preview.mjs" + }, "./react": { "types": "./dist/react/index.d.ts", "require": "./dist/react/index.js", "import": "./dist/react/index.mjs" }, - "./manager": "./dist/manager.js", - "./preview": "./dist/preview.js", - "./register": "./dist/manager.js", + "./register": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -46,6 +58,12 @@ "*": [ "dist/index.d.ts" ], + "manager": [ + "dist/manager.d.ts" + ], + "preview": [ + "dist/preview.d.ts" + ], "react": [ "dist/react/index.d.ts" ] @@ -60,44 +78,45 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/csf": "^0.1.0", - "@storybook/global": "^5.0.0", - "ts-dedent": "^2.0.0" - }, - "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/core-events": "workspace:*", + "@storybook/csf": "^0.1.0", + "@storybook/global": "^5.0.0", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/router": "workspace:*", "@storybook/types": "workspace:*", + "prop-types": "^15.7.2", + "ts-dedent": "^2.0.0" + }, + "devDependencies": { "fs-extra": "^11.1.0", "typescript": "~4.9.3" }, "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "peerDependenciesMeta": { "react": { "optional": true + }, + "react-dom": { + "optional": true } }, "publishConfig": { "access": "public" }, "bundler": { - "exportEntries": [ - "./src/react/index.ts", - "./src/index.ts" - ], - "managerEntries": [ - "./src/manager.ts" - ], - "previewEntries": [ - "./src/preview.ts" + "entries": [ + "./src/index.ts", + "./src/manager.ts", + "./src/preview.ts", + "./src/react/index.ts" ], "post": "./scripts/fix-preview-api-reference.ts" }, diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index 5c0614c2cf31..3e8f8057bbf7 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -31,9 +31,21 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": "./dist/manager.js", - "./preview": "./dist/preview.js", - "./register": "./dist/manager.js", + "./manager": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, + "./preview": { + "types": "./dist/preview.d.ts", + "require": "./dist/preview.js", + "import": "./dist/preview.mjs" + }, + "./register": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -61,34 +73,40 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/global": "^5.0.0", - "tiny-invariant": "^1.3.1" - }, - "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-events": "workspace:*", + "@storybook/global": "^5.0.0", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/types": "workspace:*", - "react": "^16.8.0", - "react-dom": "^16.8.0", + "tiny-invariant": "^1.3.1" + }, + "devDependencies": { "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, "publishConfig": { "access": "public" }, "bundler": { - "exportEntries": [ - "./src/index.ts" - ], - "managerEntries": [ - "./src/manager.tsx" - ], - "previewEntries": [ + "entries": [ + "./src/index.ts", + "./src/manager.tsx", "./src/preview.tsx" ] }, diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index 49a5cb2d1518..6694ddc6887b 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -34,14 +34,39 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": "./dist/manager.js", - "./preview": "./dist/preview.js", - "./register": "./dist/manager.js", + "./manager": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, + "./preview": { + "types": "./dist/preview.d.ts", + "require": "./dist/preview.js", + "import": "./dist/preview.mjs" + }, + "./register": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "dist/index.d.ts" + ], + "manager": [ + "dist/manager.d.ts" + ], + "preview": [ + "dist/preview.d.ts" + ] + } + }, "files": [ "dist/**/*", "README.md", @@ -51,34 +76,40 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/global": "^5.0.0", - "ts-dedent": "^2.0.0" - }, - "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-events": "workspace:*", + "@storybook/global": "^5.0.0", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/types": "workspace:*", - "react": "^16.8.0", - "react-dom": "^16.8.0", + "ts-dedent": "^2.0.0" + }, + "devDependencies": { "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, "publishConfig": { "access": "public" }, "bundler": { - "exportEntries": [ - "./src/index.ts" - ], - "managerEntries": [ - "./src/manager.tsx" - ], - "previewEntries": [ + "entries": [ + "./src/index.ts", + "./src/manager.tsx", "./src/preview.tsx" ] }, diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index b878222586b3..55ee2742c19a 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -28,8 +28,15 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./preset": "./dist/preset.js", - "./manager": "./dist/manager.js", + "./preset": { + "types": "./dist/preset.d.ts", + "require": "./dist/preset.js" + }, + "./manager": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -44,13 +51,9 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "estraverse": "^5.2.0", - "tiny-invariant": "^1.3.1" - }, - "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/manager-api": "workspace:*", @@ -58,24 +61,35 @@ "@storybook/router": "workspace:*", "@storybook/source-loader": "workspace:*", "@storybook/theming": "workspace:*", + "estraverse": "^5.2.0", + "prop-types": "^15.7.2", + "react-syntax-highlighter": "^15.5.0", + "tiny-invariant": "^1.3.1" + }, + "devDependencies": { "@types/react": "^16.14.34", "@types/react-syntax-highlighter": "11.0.5", - "react": "^16.8.0", - "react-dom": "^16.8.0", - "react-syntax-highlighter": "^15.5.0", "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, "publishConfig": { "access": "public" }, "bundler": { - "exportEntries": [ - "./src/index.ts" - ], - "managerEntries": [ - "./src/manager.tsx" - ], - "nodeEntries": [ + "entries": [ + "./src/index.ts", + "./src/manager.tsx", "./src/preset.ts" ] }, diff --git a/code/addons/themes/package.json b/code/addons/themes/package.json index 0501d7bced91..5d8fe8b5b414 100644 --- a/code/addons/themes/package.json +++ b/code/addons/themes/package.json @@ -33,14 +33,35 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": "./dist/manager.js", - "./preview": "./dist/preview.js", + "./manager": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, + "./preview": { + "types": "./dist/preview.d.ts", + "require": "./dist/preview.js", + "import": "./dist/preview.mjs" + }, "./package.json": "./package.json", "./postinstall": "./postinstall.js" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "dist/index.d.ts" + ], + "manager": [ + "dist/manager.d.ts" + ], + "preview": [ + "dist/preview.d.ts" + ] + } + }, "files": [ "dist/**/*", "README.md", @@ -50,12 +71,9 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "ts-dedent": "^2.0.0" - }, - "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-events": "workspace:*", @@ -63,19 +81,30 @@ "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", + "ts-dedent": "^2.0.0" + }, + "devDependencies": { "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, "publishConfig": { "access": "public" }, "bundler": { - "exportEntries": [ - "./src/index.ts" - ], - "managerEntries": [ - "./src/manager.tsx" - ], - "previewEntries": [ + "entries": [ + "./src/index.ts", + "./src/manager.tsx", "./src/preview.tsx" ] }, diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index 64000884f54d..9381cf4ac5c0 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -32,13 +32,31 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": "./dist/manager.js", - "./register": "./dist/manager.js", + "./manager": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, + "./register": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "dist/index.d.ts" + ], + "manager": [ + "dist/manager.d.ts" + ] + } + }, "files": [ "dist/**/*", "README.md", @@ -48,28 +66,39 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, - "devDependencies": { + "dependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", - "@storybook/theming": "workspace:*", - "react": "^16.8.0", - "react-dom": "^16.8.0", + "@storybook/theming": "workspace:*" + }, + "devDependencies": { "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, "publishConfig": { "access": "public" }, "bundler": { - "exportEntries": [ - "./src/index.ts" - ], - "managerEntries": [ + "entries": [ + "./src/index.ts", "./src/manager.tsx" - ] + ], + "platform": "browser" }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17", "storybook": { diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index b15c49815d04..eebb85538f22 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -29,14 +29,39 @@ "require": "./dist/index.js", "import": "./dist/index.mjs" }, - "./manager": "./dist/manager.js", - "./preview": "./dist/preview.ts", - "./register": "./dist/manager.js", + "./manager": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, + "./preview": { + "types": "./dist/preview.d.ts", + "require": "./dist/preview.ts", + "import": "./dist/preview.mjs" + }, + "./register": { + "types": "./dist/manager.d.ts", + "require": "./dist/manager.js", + "import": "./dist/manager.mjs" + }, "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "dist/index.d.ts" + ], + "manager": [ + "dist/manager.d.ts" + ], + "preview": [ + "dist/preview.d.ts" + ] + } + }, "files": [ "dist/**/*", "README.md", @@ -46,12 +71,9 @@ ], "scripts": { "check": "../../../scripts/prepare/check.ts", - "prep": "../../../scripts/prepare/addon-bundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "memoizerific": "^1.11.3" - }, - "devDependencies": { "@storybook/client-logger": "workspace:*", "@storybook/components": "workspace:*", "@storybook/core-events": "workspace:*", @@ -59,22 +81,32 @@ "@storybook/manager-api": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/theming": "workspace:*", - "react": "^16.8.0", - "react-dom": "^16.8.0", + "memoizerific": "^1.11.3", + "prop-types": "^15.7.2" + }, + "devDependencies": { "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, "publishConfig": { "access": "public" }, "bundler": { - "exportEntries": [ + "entries": [ + "./src/index.ts", "./src/models/index.ts", - "./src/index.ts" - ], - "managerEntries": [ - "./src/manager.tsx" - ], - "previewEntries": [ + "./src/manager.tsx", "./src/preview.ts" ] }, diff --git a/code/builders/builder-manager/src/index.ts b/code/builders/builder-manager/src/index.ts index 89b9846184e6..eb869bb54f2a 100644 --- a/code/builders/builder-manager/src/index.ts +++ b/code/builders/builder-manager/src/index.ts @@ -9,8 +9,8 @@ import { pnpPlugin } from '@yarnpkg/esbuild-plugin-pnp'; import aliasPlugin from 'esbuild-plugin-alias'; import { stringifyProcessEnvs } from '@storybook/core-common'; -import { globalsModuleInfoMap } from '@storybook/manager/globals-module-info'; import { getTemplatePath, renderHTML } from './utils/template'; +import { definitions } from './utils/globals'; import { wrapManagerEntries } from './utils/managerEntries'; import type { BuilderBuildResult, @@ -89,7 +89,7 @@ export const getConfig: ManagerBuilder['getConfig'] = async (options) => { util: require.resolve('util/util.js'), assert: require.resolve('browser-assert'), }), - globalExternals(globalsModuleInfoMap), + globalExternals(definitions), pnpPlugin(), ], diff --git a/code/builders/builder-manager/src/utils/globals.ts b/code/builders/builder-manager/src/utils/globals.ts new file mode 100644 index 000000000000..08fda5f5a44b --- /dev/null +++ b/code/builders/builder-manager/src/utils/globals.ts @@ -0,0 +1 @@ +export { definitions } from '@storybook/manager/dist/globals'; diff --git a/code/builders/builder-vite/src/optimizeDeps.ts b/code/builders/builder-vite/src/optimizeDeps.ts index 1972fde8e8e7..ddb32c800403 100644 --- a/code/builders/builder-vite/src/optimizeDeps.ts +++ b/code/builders/builder-vite/src/optimizeDeps.ts @@ -8,9 +8,21 @@ const INCLUDE_CANDIDATES = [ '@emotion/core', '@emotion/is-prop-valid', '@emotion/styled', + '@mdx-js/react', + '@storybook/addon-docs > acorn-jsx', + '@storybook/addon-docs', + '@storybook/addon-essentials/docs/mdx-react-shim', + '@storybook/channels', + '@storybook/client-api', + '@storybook/client-logger', + '@storybook/core/client', + '@storybook/global', + '@storybook/preview-api', + '@storybook/preview-web', '@storybook/react > acorn-jsx', '@storybook/react', '@storybook/svelte', + '@storybook/types', '@storybook/vue3', 'acorn-jsx', 'acorn-walk', @@ -67,6 +79,7 @@ const INCLUDE_CANDIDATES = [ 'lodash/uniq', 'lodash/upperFirst.js', 'lodash/upperFirst', + 'markdown-to-jsx', 'memoizerific', 'overlayscrollbars', 'polished', @@ -113,8 +126,6 @@ const asyncFilter = async (arr: string[], predicate: (val: string) => Promise arr.filter((_v, index) => results[index])); export async function getOptimizeDeps(config: ViteInlineConfig, options: Options) { - const extraOptimizeDeps = await options.presets.apply('optimizeViteDeps', []); - const { root = process.cwd() } = config; const { normalizePath, resolveConfig } = await import('vite'); const absoluteStories = await listStories(options); @@ -125,10 +136,7 @@ export async function getOptimizeDeps(config: ViteInlineConfig, options: Options // This function converts ids which might include ` > ` to a real path, if it exists on disk. // See https://github.com/vitejs/vite/blob/67d164392e8e9081dc3f0338c4b4b8eea6c5f7da/packages/vite/src/node/optimizer/index.ts#L182-L199 const resolve = resolvedConfig.createResolver({ asSrc: false }); - const include = await asyncFilter( - Array.from(new Set([...INCLUDE_CANDIDATES, ...extraOptimizeDeps])), - async (id) => Boolean(await resolve(id)) - ); + const include = await asyncFilter(INCLUDE_CANDIDATES, async (id) => Boolean(await resolve(id))); const optimizeDeps: UserConfig['optimizeDeps'] = { ...config.optimizeDeps, diff --git a/code/builders/builder-vite/src/vite-config.ts b/code/builders/builder-vite/src/vite-config.ts index a89a14488dd4..5274248afa80 100644 --- a/code/builders/builder-vite/src/vite-config.ts +++ b/code/builders/builder-vite/src/vite-config.ts @@ -8,7 +8,7 @@ import type { InlineConfig, } from 'vite'; import { isPreservingSymlinks, getFrameworkName, getBuilderOptions } from '@storybook/core-common'; -import { globalsNameReferenceMap } from '@storybook/preview/globals'; +import { globals } from '@storybook/preview/globals'; import type { Options } from '@storybook/types'; import { codeGeneratorPlugin, @@ -79,10 +79,8 @@ export async function pluginConfig(options: Options) { const frameworkName = await getFrameworkName(options); const build = await options.presets.apply('build'); - const externals: Record = globalsNameReferenceMap; - if (build?.test?.emptyBlocks) { - externals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; + globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } const plugins = [ @@ -103,7 +101,7 @@ export async function pluginConfig(options: Options) { } }, }, - await externalGlobalsPlugin(externals), + await externalGlobalsPlugin(globals), ] as PluginOption[]; // TODO: framework doesn't exist, should move into framework when/if built diff --git a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts index 0c3d53165e08..da62a70ed652 100644 --- a/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts +++ b/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts @@ -11,7 +11,7 @@ import slash from 'slash'; import type { TransformOptions as EsbuildOptions } from 'esbuild'; import type { JsMinifyOptions as SwcOptions } from '@swc/core'; import type { Options, CoreConfig, DocsOptions, PreviewAnnotation } from '@storybook/types'; -import { globalsNameReferenceMap } from '@storybook/preview/globals'; +import { globals } from '@storybook/preview/globals'; import { getBuilderOptions, getRendererName, @@ -220,9 +220,8 @@ export default async ( `); } - const externals: Record = globalsNameReferenceMap; if (build?.test?.emptyBlocks) { - externals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; + globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__'; } return { @@ -243,7 +242,7 @@ export default async ( watchOptions: { ignored: /node_modules/, }, - externals, + externals: globals, ignoreWarnings: [ { message: /export '\S+' was not found in 'global'/, diff --git a/code/deprecated/addons/package.json b/code/deprecated/addons/package.json index 26a77297ebc3..b104d44dbbf9 100644 --- a/code/deprecated/addons/package.json +++ b/code/deprecated/addons/package.json @@ -48,6 +48,10 @@ "@storybook/preview-api": "workspace:*", "@storybook/types": "workspace:*" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, "publishConfig": { "access": "public" }, diff --git a/code/deprecated/manager-api-shim/package.json b/code/deprecated/manager-api-shim/package.json index 99cdefd7710b..506a4bdb27b9 100644 --- a/code/deprecated/manager-api-shim/package.json +++ b/code/deprecated/manager-api-shim/package.json @@ -46,6 +46,18 @@ "@storybook/client-logger": "workspace:*", "@storybook/manager-api": "workspace:*" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + }, "publishConfig": { "access": "public" }, diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index 446fae77f761..93b3fbad4cc2 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -46,6 +46,7 @@ "@storybook/core-webpack": "workspace:*", "@storybook/docs-tools": "workspace:*", "@storybook/global": "^5.0.0", + "@storybook/manager-api": "workspace:*", "@storybook/node-logger": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/telemetry": "workspace:*", @@ -101,6 +102,8 @@ "@angular/platform-browser": ">=14.1.0 < 18.0.0", "@angular/platform-browser-dynamic": ">=14.1.0 < 18.0.0", "@babel/core": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", "rxjs": "^6.0.0 || ^7.4.0", "typescript": "^4.0.0 || ^5.0.0", "zone.js": ">= 0.11.1 < 1.0.0" diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index 54fc623877b0..3d8d35f99ce3 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -49,7 +49,9 @@ "@types/ember__component": "4.0.8", "babel-plugin-ember-modules-api-polyfill": "^2.12.0", "babel-plugin-htmlbars-inline-precompile": "2 || 3", - "ember-source": "~3.28.1" + "ember-source": "~3.28.1", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "engines": { "node": ">=16.0.0" diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index 1710b7ef246d..a4e4b52fb3ae 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -58,7 +58,9 @@ "typescript": "~4.9.3" }, "peerDependencies": { - "@babel/core": "*" + "@babel/core": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "engines": { "node": ">=16.0.0" diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index ee517f4f4041..b7c81a0417fd 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -59,7 +59,9 @@ }, "peerDependencies": { "@babel/core": "*", - "preact": "^8.0.0||^10.0.0" + "preact": "^8.0.0||^10.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "engines": { "node": ">=16.0.0" diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index ff372339ed86..2eb448374c73 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -56,6 +56,10 @@ "devDependencies": { "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, "engines": { "node": ">=16.0.0" }, diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index 12eab81328a3..56dbb9614197 100644 --- a/code/frameworks/svelte-webpack5/package.json +++ b/code/frameworks/svelte-webpack5/package.json @@ -59,6 +59,8 @@ }, "peerDependencies": { "@babel/core": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", "svelte": "^3.48.0 || ^4.0.0", "svelte-loader": "*" }, diff --git a/code/frameworks/vue-vite/package.json b/code/frameworks/vue-vite/package.json index 2e7948237053..969aefdee12c 100644 --- a/code/frameworks/vue-vite/package.json +++ b/code/frameworks/vue-vite/package.json @@ -60,6 +60,8 @@ "vue": "^2.7.10" }, "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", "vite": "^3.0.0 || ^4.0.0 || ^5.0.0", "vue": "^2.7.0" }, diff --git a/code/frameworks/vue-webpack5/package.json b/code/frameworks/vue-webpack5/package.json index 269e5807bee9..11741d4ba256 100644 --- a/code/frameworks/vue-webpack5/package.json +++ b/code/frameworks/vue-webpack5/package.json @@ -63,6 +63,8 @@ "@babel/core": "*", "babel-loader": "^7.0.0 || ^8.0.0 || ^9.0.0", "css-loader": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", "vue": "^2.6.8", "vue-loader": "^15.7.0", "vue-template-compiler": "^2.6.8" diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index a9a31d221414..b88090051577 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -60,6 +60,8 @@ "vite": "^4.0.0" }, "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" }, "engines": { diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index a36463967749..2dc464c4d957 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -62,6 +62,8 @@ "@babel/core": "*", "@vue/compiler-sfc": "^3.0.0", "babel-loader": "^7.0.0 || ^8.0.0 || ^9.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", "vue": "^3.0.0" }, "engines": { diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index 2a06c769e711..914c2640541b 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -57,6 +57,10 @@ "@types/node": "^18.0.0", "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, "engines": { "node": "^14.18 || >=16" }, diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index 69aa1fbdeadd..16effea80b62 100644 --- a/code/frameworks/web-components-webpack5/package.json +++ b/code/frameworks/web-components-webpack5/package.json @@ -62,7 +62,9 @@ "typescript": "~4.9.3" }, "peerDependencies": { - "lit": "^2.0.0 || ^3.0.0" + "lit": "^2.0.0 || ^3.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "engines": { "node": ">=16.0.0" diff --git a/code/lib/core-server/src/utils/warnOnIncompatibleAddons.ts b/code/lib/core-server/src/utils/warnOnIncompatibleAddons.ts index 23e17c77bc56..a850d49809ad 100644 --- a/code/lib/core-server/src/utils/warnOnIncompatibleAddons.ts +++ b/code/lib/core-server/src/utils/warnOnIncompatibleAddons.ts @@ -1,5 +1,5 @@ import type { StorybookConfig } from '@storybook/types'; -import { logger } from '@storybook/node-logger'; +import { logger } from '@storybook/client-logger'; import chalk from 'chalk'; import dedent from 'ts-dedent'; diff --git a/code/lib/manager-api/package.json b/code/lib/manager-api/package.json index 63ade68d18c0..077275cb2731 100644 --- a/code/lib/manager-api/package.json +++ b/code/lib/manager-api/package.json @@ -65,20 +65,18 @@ "@types/qs": "^6", "flush-promises": "^1.0.2", "qs": "^6.10.0", - "react": "^16.8.0", - "react-dom": "^16.8.0", "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, "publishConfig": { "access": "public" }, "bundler": { "entries": [ "./src/index.tsx" - ], - "externals": [ - "react", - "react-dom" ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" diff --git a/code/lib/manager-api/src/index.tsx b/code/lib/manager-api/src/index.tsx index d44b49002ca7..951dc494a93a 100644 --- a/code/lib/manager-api/src/index.tsx +++ b/code/lib/manager-api/src/index.tsx @@ -67,8 +67,6 @@ import * as whatsnew from './modules/whatsnew'; import * as globals from './modules/globals'; import type { ModuleFn } from './lib/types'; -import { types } from './lib/addons'; - export * from './lib/shortcut'; const { ActiveTabs } = layout; @@ -508,14 +506,5 @@ export function useArgTypes(): ArgTypes { export { addons } from './lib/addons'; -/** - * We need to rename this so it's not compiled to a straight re-export - * Our globalization plugin can't handle an import and export of the same name in different lines - * @deprecated - */ -const typesX = types; - -export { typesX as types }; - /* deprecated */ -export { mockChannel, type Addon, type AddonStore } from './lib/addons'; +export { mockChannel, types, type Addon, type AddonStore } from './lib/addons'; diff --git a/code/lib/preview-api/package.json b/code/lib/preview-api/package.json index 260ec3d2036a..5b0e3d576bcc 100644 --- a/code/lib/preview-api/package.json +++ b/code/lib/preview-api/package.json @@ -87,6 +87,7 @@ "@jest/globals": "^29.5.0", "@storybook/core-common": "workspace:*", "ansi-to-html": "^0.6.11", + "react": "^16.14.0", "slash": "^5.0.0" }, "publishConfig": { diff --git a/code/lib/preview/package.json b/code/lib/preview/package.json index 8c8102acbd1e..b3651342b23a 100644 --- a/code/lib/preview/package.json +++ b/code/lib/preview/package.json @@ -27,7 +27,6 @@ }, "./globals": { "types": "./dist/globals.d.ts", - "import": "./dist/globals.js", "require": "./dist/globals.js" }, "./package.json": "./package.json" @@ -63,8 +62,6 @@ "@storybook/global": "^5.0.0", "@storybook/preview-api": "workspace:*", "browser-dtector": "^3.4.0", - "fs-extra": "^11.1.0", - "ts-dedent": "^2.0.0", "typescript": "~4.9.3" }, "publishConfig": { diff --git a/code/lib/preview/src/globals.ts b/code/lib/preview/src/globals.ts index 3b9b2321b6f0..fb7419cf52ed 100644 --- a/code/lib/preview/src/globals.ts +++ b/code/lib/preview/src/globals.ts @@ -1 +1 @@ -export * from './globals/globals'; +export * from './globals/types'; diff --git a/code/lib/preview/src/globals/runtime.ts b/code/lib/preview/src/globals/runtime.ts index f05dd3ef24cd..ad078c4afa8d 100644 --- a/code/lib/preview/src/globals/runtime.ts +++ b/code/lib/preview/src/globals/runtime.ts @@ -1,8 +1,9 @@ +import * as CHANNEL_POSTMESSAGE from '@storybook/channels/dist/postmessage/index'; +import * as CHANNEL_WEBSOCKET from '@storybook/channels/dist/websocket/index'; import * as CHANNELS from '@storybook/channels'; import * as CLIENT_LOGGER from '@storybook/client-logger'; import * as CORE_EVENTS from '@storybook/core-events'; import * as PREVIEW_API from '@storybook/preview-api'; -import * as TYPES from '@storybook/types'; import * as GLOBAL from '@storybook/global'; // DEPRECATED, remove in 8.0 @@ -11,23 +12,20 @@ import * as CLIENT_API from '@storybook/preview-api/dist/client-api'; import * as CORE_CLIENT from '@storybook/preview-api/dist/core-client'; import * as PREVIEW_WEB from '@storybook/preview-api/dist/preview-web'; import * as STORE from '@storybook/preview-api/dist/store'; -import * as CHANNEL_POSTMESSAGE from '@storybook/channels/dist/postmessage/index'; -import * as CHANNEL_WEBSOCKET from '@storybook/channels/dist/websocket/index'; -import type { globalsNameReferenceMap } from './globals'; +import type { globals } from './types'; // Here we map the name of a module to their VALUE in the global scope. -export const globalsNameValueMap: Required> = { +export const values: Required> = { + '@storybook/channel-postmessage': CHANNEL_POSTMESSAGE, // @deprecated: remove in 8.0 + '@storybook/channel-websocket': CHANNEL_WEBSOCKET, // @deprecated: remove in 8.0 '@storybook/channels': CHANNELS, '@storybook/client-logger': CLIENT_LOGGER, '@storybook/core-events': CORE_EVENTS, '@storybook/preview-api': PREVIEW_API, '@storybook/global': GLOBAL, - '@storybook/types': TYPES, // DEPRECATED, remove in 8.0 - '@storybook/channel-postmessage': CHANNEL_POSTMESSAGE, - '@storybook/channel-websocket': CHANNEL_WEBSOCKET, '@storybook/addons': ADDONS, '@storybook/client-api': CLIENT_API, '@storybook/core-client': CORE_CLIENT, diff --git a/code/lib/preview/src/globals/globals.ts b/code/lib/preview/src/globals/types.ts similarity index 73% rename from code/lib/preview/src/globals/globals.ts rename to code/lib/preview/src/globals/types.ts index 3cd77282fe49..176d4582833d 100644 --- a/code/lib/preview/src/globals/globals.ts +++ b/code/lib/preview/src/globals/types.ts @@ -1,6 +1,6 @@ -// Here we map the name of a module to their REFERENCE in the global scope. - -export const globalsNameReferenceMap = { +// Here we map the name of a module to their NAME in the global scope. +// eslint-disable-next-line @typescript-eslint/naming-convention,no-underscore-dangle +const _globals = { '@storybook/addons': '__STORYBOOK_MODULE_ADDONS__', '@storybook/global': '__STORYBOOK_MODULE_GLOBAL__', '@storybook/channel-postmessage': '__STORYBOOK_MODULE_CHANNEL_POSTMESSAGE__', // @deprecated: remove in 8.0 @@ -13,9 +13,6 @@ export const globalsNameReferenceMap = { '@storybook/preview-web': '__STORYBOOK_MODULE_PREVIEW_WEB__', '@storybook/preview-api': '__STORYBOOK_MODULE_PREVIEW_API__', '@storybook/store': '__STORYBOOK_MODULE_STORE__', - '@storybook/types': '__STORYBOOK_MODULE_TYPES__', -} as const; +}; -export const globalPackages = Object.keys(globalsNameReferenceMap) as Array< - keyof typeof globalsNameReferenceMap ->; +export const globals: typeof _globals & Record = _globals; diff --git a/code/lib/preview/src/runtime.ts b/code/lib/preview/src/runtime.ts index 6b2900b68820..603c586b9fe3 100644 --- a/code/lib/preview/src/runtime.ts +++ b/code/lib/preview/src/runtime.ts @@ -1,13 +1,15 @@ import { TELEMETRY_ERROR } from '@storybook/core-events'; import { global } from '@storybook/global'; -import { globalPackages, globalsNameReferenceMap } from './globals/globals'; -import { globalsNameValueMap } from './globals/runtime'; +import { values } from './globals/runtime'; +import { globals } from './globals/types'; import { prepareForTelemetry } from './utils'; +const getKeys = Object.keys as (obj: T) => Array; + // Apply all the globals -globalPackages.forEach((key) => { - (global as any)[globalsNameReferenceMap[key]] = globalsNameValueMap[key]; +getKeys(globals).forEach((key) => { + (global as any)[globals[key]] = values[key]; }); global.sendTelemetryError = (error: any) => { diff --git a/code/lib/router/package.json b/code/lib/router/package.json index db6dee258fce..9f72950258c1 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -57,12 +57,14 @@ "@storybook/global": "^5.0.0", "dequal": "^2.0.2", "lodash": "^4.17.21", - "react": "^16.8.0", - "react-dom": "^16.8.0", "react-router-dom": "6.0.2", "ts-dedent": "^2.0.0", "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, "publishConfig": { "access": "public" }, @@ -71,20 +73,6 @@ "entries": [ "./src/index.ts", "./src/utils.ts" - ], - "externals": [ - "react", - "react-dom", - "@storybook/addons", - "@storybook/api", - "@storybook/channels", - "@storybook/client-logger", - "@storybook/components", - "@storybook/core-events", - "@storybook/manager-api", - "@storybook/router", - "@storybook/theming", - "@storybook/types" ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" diff --git a/code/lib/source-loader/package.json b/code/lib/source-loader/package.json index 30b5cc8d8b20..909b4d002e10 100644 --- a/code/lib/source-loader/package.json +++ b/code/lib/source-loader/package.json @@ -55,6 +55,10 @@ "jest-specific-snapshot": "^8.0.0", "typescript": "~4.9.3" }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, "publishConfig": { "access": "public" }, diff --git a/code/lib/theming/package.json b/code/lib/theming/package.json index 9f709f5b9597..9936ef0858e6 100644 --- a/code/lib/theming/package.json +++ b/code/lib/theming/package.json @@ -79,20 +79,6 @@ "./src/index.ts", "./src/create.ts" ], - "externals": [ - "react", - "react-dom", - "@storybook/addons", - "@storybook/api", - "@storybook/channels", - "@storybook/client-logger", - "@storybook/components", - "@storybook/core-events", - "@storybook/manager-api", - "@storybook/router", - "@storybook/theming", - "@storybook/types" - ], "post": "./scripts/fix-theme-type-export.ts" }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" diff --git a/code/renderers/preact/template/cli/Button.jsx b/code/renderers/preact/template/cli/Button.jsx index 9bcecb3710d7..eefda2bffe3f 100644 --- a/code/renderers/preact/template/cli/Button.jsx +++ b/code/renderers/preact/template/cli/Button.jsx @@ -1,21 +1,10 @@ +import PropTypes from 'prop-types'; import './button.css'; /** * Primary UI component for user interaction - * @param {object} props - * @param {string} [props.primary=false] - * @param {string} [props.backgroundColor] - * @param {('small' | 'medium' | 'large')} [props.size='medium'] - * @param {string} props.label - * @param {function} props.onClick */ -export const Button = ({ - primary = false, - backgroundColor = null, - size = 'medium', - label, - ...props -}) => { +export const Button = ({ primary, backgroundColor, size, label, ...props }) => { const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary'; return ( ); + +Button.propTypes = { + onClick: PropTypes.func.isRequired, + label: PropTypes.node.isRequired, +}; diff --git a/code/renderers/preact/template/components/Form.jsx b/code/renderers/preact/template/components/Form.jsx index b2283d26ac10..fb58cbb10508 100644 --- a/code/renderers/preact/template/components/Form.jsx +++ b/code/renderers/preact/template/components/Form.jsx @@ -1,14 +1,8 @@ +/* eslint-disable react/react-in-jsx-scope */ +// eslint-disable-next-line import/no-extraneous-dependencies +import PropTypes from 'prop-types'; import { useState } from 'preact/hooks'; -/** - * Header component - * @param {object} props - * @param {object} [props.user] - * @param {string} props.user.name - * @param {function} props.onLogin - * @param {function} props.onLogout - * @param {function} props.onCreateAccount - */ export const Form = ({ onSuccess }) => { const [value, setValue] = useState(''); const [complete, setComplete] = useState(false); @@ -38,3 +32,7 @@ export const Form = ({ onSuccess }) => { ); }; + +Form.propTypes = { + onSuccess: PropTypes.func.isRequired, +}; diff --git a/code/renderers/preact/template/components/Html.jsx b/code/renderers/preact/template/components/Html.jsx index b2c1f966f9e3..36cff8218890 100644 --- a/code/renderers/preact/template/components/Html.jsx +++ b/code/renderers/preact/template/components/Html.jsx @@ -1 +1,10 @@ +/* eslint-disable react/react-in-jsx-scope */ +// eslint-disable-next-line import/no-extraneous-dependencies +import PropTypes from 'prop-types'; + +// eslint-disable-next-line react/no-danger export const Html = ({ content }) =>
; + +Html.propTypes = { + content: PropTypes.string.isRequired, +}; diff --git a/code/renderers/preact/template/components/Pre.jsx b/code/renderers/preact/template/components/Pre.jsx index 3bf143581fac..7efec93be9d6 100644 --- a/code/renderers/preact/template/components/Pre.jsx +++ b/code/renderers/preact/template/components/Pre.jsx @@ -1,12 +1,21 @@ -/** - * Pre component - * @param {object} props - * @param {object} [props.style] - * @param {object} [props.object] - * @param {string} [props.text] - */ +/* eslint-disable react/react-in-jsx-scope */ +// eslint-disable-next-line import/no-extraneous-dependencies +import PropTypes from 'prop-types'; + export const Pre = ({ style, object, text }) => (
     {object ? JSON.stringify(object, null, 2) : text}
   
); + +Pre.propTypes = { + style: PropTypes.shape({}), + object: PropTypes.shape({}), + text: PropTypes.string, +}; + +Pre.defaultProps = { + style: {}, + object: null, + text: '', +}; diff --git a/code/renderers/preact/template/stories/React.js b/code/renderers/preact/template/stories/React.js index 1d1fa97c55d8..0c72668ebe74 100644 --- a/code/renderers/preact/template/stories/React.js +++ b/code/renderers/preact/template/stories/React.js @@ -1,11 +1,8 @@ // eslint-disable-next-line import/no-extraneous-dependencies import React from 'react'; +// eslint-disable-next-line import/no-extraneous-dependencies +import PropTypes from 'prop-types'; -/** - * ReactFunctionalComponent component - * @param {object} props - * @param {string} props.label - */ export const ReactFunctionalComponent = ({ label }) => { const [clicks, setValue] = React.useState(0); return ( @@ -22,11 +19,10 @@ export const ReactFunctionalComponent = ({ label }) => { ); }; -/** - * ReactClassComponent component - * @param {object} props - * @param {string} props.label - */ +ReactFunctionalComponent.propTypes = { + label: PropTypes.string.isRequired, +}; + export class ReactClassComponent extends React.Component { state = { clicks: 0, @@ -49,3 +45,7 @@ export class ReactClassComponent extends React.Component { ); } } + +ReactClassComponent.propTypes = { + label: PropTypes.string.isRequired, +}; diff --git a/code/renderers/preact/template/stories/react-compat.stories.js b/code/renderers/preact/template/stories/react-compat.stories.js index 33f1078d3154..b7895c1e8d0f 100644 --- a/code/renderers/preact/template/stories/react-compat.stories.js +++ b/code/renderers/preact/template/stories/react-compat.stories.js @@ -1,3 +1,4 @@ +/* eslint-disable react/react-in-jsx-scope */ import { ReactFunctionalComponent, ReactClassComponent } from './React'; export default { diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index dd810a1b258b..ef0de3565a4e 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -59,7 +59,6 @@ "@storybook/preview-api": "workspace:*", "@storybook/types": "workspace:*", "sveltedoc-parser": "^4.2.1", - "ts-dedent": "^2.0.0", "type-fest": "~2.19" }, "devDependencies": { diff --git a/code/ui/manager/package.json b/code/ui/manager/package.json index f03882fc6411..23e28425eef9 100644 --- a/code/ui/manager/package.json +++ b/code/ui/manager/package.json @@ -24,17 +24,12 @@ "types": "./dist/index.d.ts", "import": "./dist/index.js" }, - "./runtime": { + "./dist/runtime": { "types": "./dist/runtime.d.ts", "import": "./dist/runtime.js" }, - "./globals-module-info": { - "types": "./dist/globals-module-info.d.ts", - "require": "./dist/globals-module-info.js" - }, - "./globals": { + "./dist/globals": { "types": "./dist/globals.d.ts", - "import": "./dist/globals.js", "require": "./dist/globals.js" }, "./paths": "./paths.js", @@ -43,22 +38,6 @@ "main": "dist/index.js", "module": "dist/index.js", "types": "dist/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "dist/index.d.ts" - ], - "runtime": [ - "dist/runtime.d.ts" - ], - "globals": [ - "dist/globals.d.ts" - ], - "globals-module-info": [ - "dist/globals-module-info.d.ts" - ] - } - }, "files": [ "dist/**/*", "static/**/*", @@ -118,8 +97,7 @@ "./src/runtime.ts" ], "nodeEntries": [ - "./src/globals.ts", - "./src/globals-module-info.ts" + "./src/globals.ts" ] }, "gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17" diff --git a/code/ui/manager/scripts/generate-exports-file.ts b/code/ui/manager/scripts/generate-exports-file.ts index ece5ac50391b..afdbea8ff6e6 100644 --- a/code/ui/manager/scripts/generate-exports-file.ts +++ b/code/ui/manager/scripts/generate-exports-file.ts @@ -3,7 +3,7 @@ import fs from 'fs-extra'; import path from 'path'; import { dedent } from 'ts-dedent'; import { ESLint } from '../../../../scripts/node_modules/eslint'; -import { globalsNameValueMap } from '../src/globals/runtime'; +import { values } from '../src/globals/runtime'; const location = path.join(__dirname, '..', 'src', 'globals', 'exports.ts'); let attempts = 0; @@ -29,13 +29,10 @@ async function generate(text: string) { } const run = async () => { - const data = Object.entries(globalsNameValueMap).reduce>( - (acc, [key, value]) => { - acc[key] = Object.keys(value).filter(removeDefault); - return acc; - }, - {} - ); + const data = Object.entries(values).reduce>((acc, [key, value]) => { + acc[key] = Object.keys(value).filter(removeDefault); + return acc; + }, {}); console.log('Generating...'); diff --git a/code/ui/manager/src/globals-module-info.ts b/code/ui/manager/src/globals-module-info.ts deleted file mode 100644 index 4bcbf259af79..000000000000 --- a/code/ui/manager/src/globals-module-info.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './globals/globals-module-info'; diff --git a/code/ui/manager/src/globals.ts b/code/ui/manager/src/globals.ts index 3b9b2321b6f0..d516acc55516 100644 --- a/code/ui/manager/src/globals.ts +++ b/code/ui/manager/src/globals.ts @@ -1 +1 @@ -export * from './globals/globals'; +export * from './globals/definitions'; diff --git a/code/ui/manager/src/globals/globals-module-info.ts b/code/ui/manager/src/globals/definitions.ts similarity index 65% rename from code/ui/manager/src/globals/globals-module-info.ts rename to code/ui/manager/src/globals/definitions.ts index 616148e80ca4..9122fca70262 100644 --- a/code/ui/manager/src/globals/globals-module-info.ts +++ b/code/ui/manager/src/globals/definitions.ts @@ -1,6 +1,7 @@ import type { ModuleInfo } from '@fal-works/esbuild-plugin-global-externals'; import Exports from './exports'; -import { globalPackages, globalsNameReferenceMap } from './globals'; +import { Keys } from './types'; +import type { Definitions } from './types'; /* * We create a map of a module's name to a ModuleInfo. @@ -17,16 +18,18 @@ import { globalPackages, globalsNameReferenceMap } from './globals'; * * If you forget to do either, TypeScript will complain. * - * This `globals-module-info.ts` file is consumed by the `builder-manager` package, + * This `definitions.ts` file is consumed by the `builder-manager` package, * The `runtime.ts` file is used inside the manager's browser code runtime. */ -export const globalsModuleInfoMap = globalPackages.reduce((acc, key) => { - acc[key] = { - type: 'esm', - varName: globalsNameReferenceMap[key], - namedExports: Exports[key], - defaultExport: true, - }; +const createModuleInfo = (m: keyof typeof Keys): Required => ({ + type: 'esm', + varName: Keys[m], + namedExports: Exports[m], + defaultExport: true, +}); + +export const definitions = Object.keys(Keys).reduce((acc, key) => { + acc[key as keyof typeof Keys] = createModuleInfo(key as keyof typeof Keys); return acc; -}, {} as Required>>); +}, {} as Definitions); diff --git a/code/ui/manager/src/globals/exports.ts b/code/ui/manager/src/globals/exports.ts index f56ba153dd82..ef2523f0e06a 100644 --- a/code/ui/manager/src/globals/exports.ts +++ b/code/ui/manager/src/globals/exports.ts @@ -278,5 +278,4 @@ export default { ], '@storybook/addons': ['addons', 'types', 'mockChannel'], '@storybook/client-logger': ['deprecate', 'logger', 'once', 'pretty'], - '@storybook/types': ['Addon_TypesEnum'], } as const; diff --git a/code/ui/manager/src/globals/globals.ts b/code/ui/manager/src/globals/globals.ts deleted file mode 100644 index 1ef93c38bc94..000000000000 --- a/code/ui/manager/src/globals/globals.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Here we map the name of a module to their REFERENCE in the global scope. -export const globalsNameReferenceMap = { - react: '__REACT__', - 'react-dom': '__REACT_DOM__', - '@storybook/components': '__STORYBOOK_COMPONENTS__', - '@storybook/channels': '__STORYBOOK_CHANNELS__', - '@storybook/core-events': '__STORYBOOK_CORE_EVENTS__', - '@storybook/router': '__STORYBOOK_ROUTER__', - '@storybook/theming': '__STORYBOOK_THEMING__', - '@storybook/api': '__STORYBOOK_API__', // deprecated, remove in 8.0 - '@storybook/manager-api': '__STORYBOOK_API__', - '@storybook/addons': '__STORYBOOK_ADDONS__', - '@storybook/client-logger': '__STORYBOOK_CLIENT_LOGGER__', - '@storybook/types': '__STORYBOOK_TYPES__', -} as const; - -export const globalPackages = Object.keys(globalsNameReferenceMap) as Array< - keyof typeof globalsNameReferenceMap ->; diff --git a/code/ui/manager/src/globals/runtime.ts b/code/ui/manager/src/globals/runtime.ts index 59f5f8fc1a09..5850699f171d 100644 --- a/code/ui/manager/src/globals/runtime.ts +++ b/code/ui/manager/src/globals/runtime.ts @@ -1,34 +1,32 @@ import * as REACT from 'react'; -import * as REACT_DOM from 'react-dom'; +import * as REACTDOM from 'react-dom'; -import * as COMPONENTS from '@storybook/components'; -import * as CHANNELS from '@storybook/channels'; -import * as EVENTS from '@storybook/core-events'; -import * as ROUTER from '@storybook/router'; -import * as THEMING from '@storybook/theming'; -import * as MANAGER_API from '@storybook/manager-api'; -import * as TYPES from '@storybook/types'; -import * as CLIENT_LOGGER from '@storybook/client-logger'; +import * as STORYBOOKCOMPONENTS from '@storybook/components'; +import * as STORYBOOKCHANNELS from '@storybook/channels'; +import * as STORYBOOKEVENTS from '@storybook/core-events'; +import * as STORYBOOKROUTER from '@storybook/router'; +import * as STORYBOOKTHEMING from '@storybook/theming'; +import * as STORYBOOKMANAGERAPI from '@storybook/manager-api'; +import * as STORYBOOKCLIENTLOGGER from '@storybook/client-logger'; -import type { globalsNameReferenceMap } from './globals'; +import type { Keys } from './types'; // Here we map the name of a module to their VALUE in the global scope. -export const globalsNameValueMap: Required> = { - react: REACT, - 'react-dom': REACT_DOM, - '@storybook/components': COMPONENTS, - '@storybook/channels': CHANNELS, - '@storybook/core-events': EVENTS, - '@storybook/router': ROUTER, - '@storybook/theming': THEMING, - '@storybook/api': MANAGER_API, // deprecated, remove in 8.0 - '@storybook/manager-api': MANAGER_API, +export const values: Required> = { + react: REACT as any, + 'react-dom': REACTDOM, + '@storybook/components': STORYBOOKCOMPONENTS, + '@storybook/channels': STORYBOOKCHANNELS, + '@storybook/core-events': STORYBOOKEVENTS, + '@storybook/router': STORYBOOKROUTER, + '@storybook/theming': STORYBOOKTHEMING, + '@storybook/api': STORYBOOKMANAGERAPI, // deprecated, remove in 8.0 + '@storybook/manager-api': STORYBOOKMANAGERAPI, // backwards compatibility '@storybook/addons': { - addons: MANAGER_API.addons, - types: MANAGER_API.types, - mockChannel: MANAGER_API.mockChannel, + addons: STORYBOOKMANAGERAPI.addons, + types: STORYBOOKMANAGERAPI.types, + mockChannel: STORYBOOKMANAGERAPI.mockChannel, }, - '@storybook/client-logger': CLIENT_LOGGER, - '@storybook/types': TYPES, + '@storybook/client-logger': STORYBOOKCLIENTLOGGER, }; diff --git a/code/ui/manager/src/globals/types.ts b/code/ui/manager/src/globals/types.ts new file mode 100644 index 000000000000..2861e45f632a --- /dev/null +++ b/code/ui/manager/src/globals/types.ts @@ -0,0 +1,18 @@ +import type { ModuleInfo } from '@fal-works/esbuild-plugin-global-externals'; + +// Here we map the name of a module to their NAME in the global scope. +export enum Keys { + 'react' = '__REACT__', + 'react-dom' = '__REACTDOM__', + '@storybook/components' = '__STORYBOOKCOMPONENTS__', + '@storybook/channels' = '__STORYBOOKCHANNELS__', + '@storybook/core-events' = '__STORYBOOKCOREEVENTS__', + '@storybook/router' = '__STORYBOOKROUTER__', + '@storybook/theming' = '__STORYBOOKTHEMING__', + '@storybook/api' = '__STORYBOOKAPI__', // deprecated, remove in 8.0 + '@storybook/manager-api' = '__STORYBOOKAPI__', + '@storybook/addons' = '__STORYBOOKADDONS__', + '@storybook/client-logger' = '__STORYBOOKCLIENTLOGGER__', +} + +export type Definitions = Required>>; diff --git a/code/ui/manager/src/runtime.ts b/code/ui/manager/src/runtime.ts index f66bde4de3d3..efa348ac47e0 100644 --- a/code/ui/manager/src/runtime.ts +++ b/code/ui/manager/src/runtime.ts @@ -9,8 +9,8 @@ import { CHANNEL_CREATED, TELEMETRY_ERROR } from '@storybook/core-events'; import Provider from './provider'; import { renderStorybookUI } from './index'; -import { globalsNameValueMap } from './globals/runtime'; -import { globalPackages, globalsNameReferenceMap } from './globals/globals'; +import { values } from './globals/runtime'; +import { Keys } from './globals/types'; import { prepareForTelemetry, shouldSkipError } from './utils/prepareForTelemetry'; const { FEATURES, CONFIG_TYPE } = global; @@ -58,8 +58,8 @@ class ReactProvider extends Provider { } // Apply all the globals -globalPackages.forEach((key) => { - global[globalsNameReferenceMap[key]] = globalsNameValueMap[key]; +Object.keys(Keys).forEach((key: keyof typeof Keys) => { + global[Keys[key]] = values[key]; }); global.sendTelemetryError = (error) => { diff --git a/code/ui/manager/src/typings.d.ts b/code/ui/manager/src/typings.d.ts index bce29ea466a7..2ff3df07e63e 100644 --- a/code/ui/manager/src/typings.d.ts +++ b/code/ui/manager/src/typings.d.ts @@ -15,15 +15,15 @@ declare var VERSIONCHECK: any; declare var LOGLEVEL: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent' | undefined; declare var __REACT__: any; -declare var __REACT_DOM__: any; -declare var __STORYBOOK_COMPONENTS__: any; -declare var __STORYBOOK_CHANNELS__: any; -declare var __STORYBOOK_CORE_EVENTS__: any; -declare var __STORYBOOK_ROUTER__: any; -declare var __STORYBOOK_THEMING__: any; -declare var __STORYBOOK_API__: any; -declare var __STORYBOOK_ADDONS__: any; -declare var __STORYBOOK_CLIENT_LOGGER__: any; +declare var __REACTDOM__: any; +declare var __STORYBOOKCOMPONENTS__: any; +declare var __STORYBOOKCOMPONENTSEXPERIMENTAL__: any; +declare var __STORYBOOKCHANNELS__: any; +declare var __STORYBOOKCOREEVENTS__: any; +declare var __STORYBOOKROUTER__: any; +declare var __STORYBOOKTHEMING__: any; +declare var __STORYBOOKAPI__: any; +declare var __STORYBOOKADDONS__: any; +declare var __STORYBOOKCLIENTLOGGER__: any; declare var __STORYBOOK_ADDONS_CHANNEL__: any; -declare var __STORYBOOK_TYPES__: any; declare var sendTelemetryError: (error: any) => void; diff --git a/code/yarn.lock b/code/yarn.lock index 6cc2650da012..ce57e7431391 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5345,6 +5345,7 @@ __metadata: "@storybook/channels": "workspace:*" "@storybook/client-logger": "workspace:*" "@storybook/components": "workspace:*" + "@storybook/core-events": "workspace:*" "@storybook/global": "npm:^5.0.0" "@storybook/manager-api": "workspace:*" "@storybook/preview-api": "workspace:*" @@ -5353,11 +5354,17 @@ __metadata: "@testing-library/react": "npm:^11.2.2" axe-core: "npm:^4.2.0" lodash: "npm:^4.17.21" - react: "npm:^16.8.0" - react-dom: "npm:^16.8.0" react-resize-detector: "npm:^7.1.2" resize-observer-polyfill: "npm:^1.5.1" typescript: "npm:~4.9.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true languageName: unknown linkType: soft @@ -5379,13 +5386,19 @@ __metadata: lodash: "npm:^4.17.21" polished: "npm:^4.2.2" prop-types: "npm:^15.7.2" - react: "npm:^16.8.0" - react-dom: "npm:^16.8.0" react-inspector: "npm:^6.0.0" telejson: "npm:^7.2.0" ts-dedent: "npm:^2.0.0" typescript: "npm:~4.9.3" uuid: "npm:^9.0.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true languageName: unknown linkType: soft @@ -5395,16 +5408,23 @@ __metadata: dependencies: "@storybook/client-logger": "workspace:*" "@storybook/components": "workspace:*" + "@storybook/core-events": "workspace:*" "@storybook/global": "npm:^5.0.0" "@storybook/manager-api": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/theming": "workspace:*" "@storybook/types": "workspace:*" memoizerific: "npm:^1.11.3" - react: "npm:^16.8.0" - react-dom: "npm:^16.8.0" ts-dedent: "npm:^2.0.0" typescript: "npm:~4.9.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true languageName: unknown linkType: soft @@ -5416,15 +5436,22 @@ __metadata: "@storybook/client-logger": "workspace:*" "@storybook/components": "workspace:*" "@storybook/core-common": "workspace:*" + "@storybook/core-events": "workspace:*" "@storybook/manager-api": "workspace:*" "@storybook/node-logger": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/theming": "workspace:*" "@storybook/types": "workspace:*" lodash: "npm:^4.17.21" - react: "npm:^16.8.0" - react-dom: "npm:^16.8.0" ts-dedent: "npm:^2.0.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true languageName: unknown linkType: soft @@ -5544,10 +5571,16 @@ __metadata: formik: "npm:^2.2.9" jest-mock: "npm:^27.0.6" polished: "npm:^4.2.2" - react: "npm:^16.8.0" - react-dom: "npm:^16.8.0" ts-dedent: "npm:^2.2.0" typescript: "npm:~4.9.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true languageName: unknown linkType: soft @@ -5562,13 +5595,18 @@ __metadata: "@storybook/manager-api": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/theming": "workspace:*" - react: "npm:^16.8.0" - react-dom: "npm:^16.8.0" react-resize-detector: "npm:^7.1.2" tiny-invariant: "npm:^1.3.1" - ts-dedent: "npm:^2.0.0" typescript: "npm:~4.9.3" upath: "npm:^2.0.1" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true languageName: unknown linkType: soft @@ -5585,13 +5623,17 @@ __metadata: "@storybook/router": "workspace:*" "@storybook/types": "workspace:*" fs-extra: "npm:^11.1.0" + prop-types: "npm:^15.7.2" ts-dedent: "npm:^2.0.0" typescript: "npm:~4.9.3" peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 peerDependenciesMeta: react: optional: true + react-dom: + optional: true languageName: unknown linkType: soft @@ -5617,10 +5659,16 @@ __metadata: "@storybook/manager-api": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/types": "workspace:*" - react: "npm:^16.8.0" - react-dom: "npm:^16.8.0" tiny-invariant: "npm:^1.3.1" typescript: "npm:~4.9.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true languageName: unknown linkType: soft @@ -5635,10 +5683,16 @@ __metadata: "@storybook/manager-api": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/types": "workspace:*" - react: "npm:^16.8.0" - react-dom: "npm:^16.8.0" ts-dedent: "npm:^2.0.0" typescript: "npm:~4.9.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true languageName: unknown linkType: soft @@ -5766,11 +5820,18 @@ __metadata: "@types/react": "npm:^16.14.34" "@types/react-syntax-highlighter": "npm:11.0.5" estraverse: "npm:^5.2.0" - react: "npm:^16.8.0" - react-dom: "npm:^16.8.0" + prop-types: "npm:^15.7.2" react-syntax-highlighter: "npm:^15.5.0" tiny-invariant: "npm:^1.3.1" typescript: "npm:~4.9.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true languageName: unknown linkType: soft @@ -5787,6 +5848,14 @@ __metadata: "@storybook/types": "workspace:*" ts-dedent: "npm:^2.0.0" typescript: "npm:~4.9.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true languageName: unknown linkType: soft @@ -5799,9 +5868,15 @@ __metadata: "@storybook/manager-api": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/theming": "workspace:*" - react: "npm:^16.8.0" - react-dom: "npm:^16.8.0" typescript: "npm:~4.9.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true languageName: unknown linkType: soft @@ -5817,9 +5892,16 @@ __metadata: "@storybook/preview-api": "workspace:*" "@storybook/theming": "workspace:*" memoizerific: "npm:^1.11.3" - react: "npm:^16.8.0" - react-dom: "npm:^16.8.0" + prop-types: "npm:^15.7.2" typescript: "npm:~4.9.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true languageName: unknown linkType: soft @@ -5830,6 +5912,9 @@ __metadata: "@storybook/manager-api": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/types": "workspace:*" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -5858,6 +5943,7 @@ __metadata: "@storybook/core-webpack": "workspace:*" "@storybook/docs-tools": "workspace:*" "@storybook/global": "npm:^5.0.0" + "@storybook/manager-api": "workspace:*" "@storybook/node-logger": "workspace:*" "@storybook/preview-api": "workspace:*" "@storybook/telemetry": "workspace:*" @@ -5897,6 +5983,8 @@ __metadata: "@angular/platform-browser": ">=14.1.0 < 18.0.0" "@angular/platform-browser-dynamic": ">=14.1.0 < 18.0.0" "@babel/core": "*" + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 rxjs: ^6.0.0 || ^7.4.0 typescript: ^4.0.0 || ^5.0.0 zone.js: ">= 0.11.1 < 1.0.0" @@ -5912,6 +6000,14 @@ __metadata: dependencies: "@storybook/client-logger": "workspace:*" "@storybook/manager-api": "workspace:*" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true languageName: unknown linkType: soft @@ -6204,12 +6300,12 @@ __metadata: languageName: unknown linkType: soft -"@storybook/client-logger@npm:7.5.0": - version: 7.5.0 - resolution: "@storybook/client-logger@npm:7.5.0" +"@storybook/client-logger@npm:7.4.6": + version: 7.4.6 + resolution: "@storybook/client-logger@npm:7.4.6" dependencies: "@storybook/global": "npm:^5.0.0" - checksum: 90326c49a224bf21680c04ffee94725bf75658086093ccb839a8aae39476929c4719eafb18e498a148cf0dd956d4e9a5d3b2a34d09ca4fd25e2af553458558ac + checksum: 170ad58c17e2608639533fe24aaa96ddd4d77d23b4b28f265b2cb67510fef966fc20b029e070fdc7216ba1cdb724d1210b2f8edc8aa538de32fd6e549f9010cf languageName: node linkType: hard @@ -6539,6 +6635,8 @@ __metadata: babel-plugin-ember-modules-api-polyfill: ^2.12.0 babel-plugin-htmlbars-inline-precompile: 2 || 3 ember-source: ~3.28.1 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -6597,6 +6695,8 @@ __metadata: typescript: "npm:~4.9.3" peerDependencies: "@babel/core": "*" + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -6700,13 +6800,14 @@ __metadata: lodash: "npm:^4.17.21" memoizerific: "npm:^1.11.3" qs: "npm:^6.10.0" - react: "npm:^16.8.0" - react-dom: "npm:^16.8.0" semver: "npm:^7.3.7" store2: "npm:^2.14.2" telejson: "npm:^7.2.0" ts-dedent: "npm:^2.0.0" typescript: "npm:~4.9.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -6883,6 +6984,8 @@ __metadata: peerDependencies: "@babel/core": "*" preact: ^8.0.0||^10.0.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -7106,6 +7209,7 @@ __metadata: lodash: "npm:^4.17.21" memoizerific: "npm:^1.11.3" qs: "npm:^6.10.0" + react: "npm:^16.14.0" slash: "npm:^5.0.0" synchronous-promise: "npm:^2.0.15" ts-dedent: "npm:^2.0.0" @@ -7132,8 +7236,6 @@ __metadata: "@storybook/global": "npm:^5.0.0" "@storybook/preview-api": "workspace:*" browser-dtector: "npm:^3.4.0" - fs-extra: "npm:^11.1.0" - ts-dedent: "npm:^2.0.0" typescript: "npm:~4.9.3" languageName: unknown linkType: soft @@ -7452,11 +7554,12 @@ __metadata: lodash: "npm:^4.17.21" memoizerific: "npm:^1.11.3" qs: "npm:^6.10.0" - react: "npm:^16.8.0" - react-dom: "npm:^16.8.0" react-router-dom: "npm:6.0.2" ts-dedent: "npm:^2.0.0" typescript: "npm:~4.9.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -7470,6 +7573,9 @@ __metadata: "@storybook/server": "workspace:*" "@types/node": "npm:^18.0.0" typescript: "npm:~4.9.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -7502,6 +7608,9 @@ __metadata: lodash: "npm:^4.17.21" prettier: "npm:^2.8.0" typescript: "npm:~4.9.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -7549,6 +7658,8 @@ __metadata: typescript: "npm:~4.9.3" peerDependencies: "@babel/core": "*" + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 svelte: ^3.48.0 || ^4.0.0 svelte-loader: "*" languageName: unknown @@ -7569,7 +7680,6 @@ __metadata: svelte: "npm:^4.0.0" svelte-check: "npm:3.4.6" sveltedoc-parser: "npm:^4.2.1" - ts-dedent: "npm:^2.0.0" type-fest: "npm:~2.19" typescript: "npm:^5.0.4" peerDependencies: @@ -7645,17 +7755,17 @@ __metadata: linkType: hard "@storybook/theming@npm:^7.0.2": - version: 7.5.0 - resolution: "@storybook/theming@npm:7.5.0" + version: 7.4.6 + resolution: "@storybook/theming@npm:7.4.6" dependencies: "@emotion/use-insertion-effect-with-fallbacks": "npm:^1.0.0" - "@storybook/client-logger": "npm:7.5.0" + "@storybook/client-logger": "npm:7.4.6" "@storybook/global": "npm:^5.0.0" memoizerific: "npm:^1.11.3" peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - checksum: 57da8e27c748cbec4dc1661cdd2d449949d97476d8e97933696b31d07c7361cbbcca8d7225cc00ca078daa160023b8965ddec7c23519ce0a4ef2658246b062e7 + checksum: 6250a413c346971792623bf5a907811fc009ff4a36b8f292d0f45c677269b2a50c29d84ab1e869ada7df3eb23d49614e1342bd2c88e71d4467702b92ebc42f2d languageName: node linkType: hard @@ -7713,6 +7823,8 @@ __metadata: vue: "npm:^2.7.10" vue-docgen-api: "npm:^4.40.0" peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 vite: ^3.0.0 || ^4.0.0 || ^5.0.0 vue: ^2.7.0 languageName: unknown @@ -7735,6 +7847,8 @@ __metadata: "@babel/core": "*" babel-loader: ^7.0.0 || ^8.0.0 || ^9.0.0 css-loader: "*" + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 vue: ^2.6.8 vue-loader: ^15.7.0 vue-template-compiler: ^2.6.8 @@ -7755,6 +7869,8 @@ __metadata: vite: "npm:^4.0.0" vue-docgen-api: "npm:^4.40.0" peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 vite: ^3.0.0 || ^4.0.0 || ^5.0.0 languageName: unknown linkType: soft @@ -7775,6 +7891,8 @@ __metadata: "@babel/core": "*" "@vue/compiler-sfc": ^3.0.0 babel-loader: ^7.0.0 || ^8.0.0 || ^9.0.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 vue: ^3.0.0 languageName: unknown linkType: soft @@ -7843,6 +7961,9 @@ __metadata: "@types/node": "npm:^18.0.0" magic-string: "npm:^0.30.0" typescript: "npm:~4.9.3" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -7860,6 +7981,8 @@ __metadata: typescript: "npm:~4.9.3" peerDependencies: lit: ^2.0.0 || ^3.0.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft @@ -25656,7 +25779,7 @@ __metadata: languageName: node linkType: hard -"react@npm:^16.14.0, react@npm:^16.8.0": +"react@npm:^16.14.0": version: 16.14.0 resolution: "react@npm:16.14.0" dependencies: diff --git a/scripts/package.json b/scripts/package.json index a93310ad8931..b428f9b9f228 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -111,7 +111,6 @@ "babel-eslint": "^10.1.0", "babel-loader": "^9.1.2", "boxen": "^5.1.2", - "browser-assert": "^1.2.1", "chalk": "^4.1.0", "codecov": "^3.8.1", "commander": "^6.2.1", diff --git a/scripts/prepare/addon-bundle.ts b/scripts/prepare/addon-bundle.ts deleted file mode 100755 index 757402c4600d..000000000000 --- a/scripts/prepare/addon-bundle.ts +++ /dev/null @@ -1,285 +0,0 @@ -#!/usr/bin/env ../../node_modules/.bin/ts-node - -import * as fs from 'fs-extra'; -import path, { dirname, join, relative } from 'path'; -import type { Options } from 'tsup'; -import type { PackageJson } from 'type-fest'; -import { build } from 'tsup'; -import aliasPlugin from 'esbuild-plugin-alias'; -import dedent from 'ts-dedent'; -import slash from 'slash'; -import { exec } from '../utils/exec'; - -import { globalPackages as globalPreviewPackages } from '../../code/lib/preview/src/globals/globals'; -import { globalPackages as globalManagerPackages } from '../../code/ui/manager/src/globals/globals'; - -/* TYPES */ - -type Formats = 'esm' | 'cjs'; -type BundlerConfig = { - previewEntries: string[]; - managerEntries: string[]; - nodeEntries: string[]; - exportEntries: string[]; - externals: string[]; - pre: string; - post: string; - formats: Formats[]; -}; -type PackageJsonWithBundlerConfig = PackageJson & { - bundler: BundlerConfig; -}; -type DtsConfigSection = Pick; - -/* MAIN */ - -const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { - const { - name, - dependencies, - peerDependencies, - bundler: { - managerEntries = [], - previewEntries = [], - nodeEntries = [], - exportEntries = [], - externals: extraExternals = [], - pre, - post, - formats = ['esm', 'cjs'], - }, - } = (await fs.readJson(join(cwd, 'package.json'))) as PackageJsonWithBundlerConfig; - - if (pre) { - await exec(`node -r ${__dirname}/../node_modules/esbuild-register/register.js ${pre}`, { cwd }); - } - - const reset = hasFlag(flags, 'reset'); - const watch = hasFlag(flags, 'watch'); - const optimized = hasFlag(flags, 'optimized'); - - if (reset) { - await fs.emptyDir(join(process.cwd(), 'dist')); - } - - const tasks: Promise[] = []; - - const commonOptions: Options = { - outDir: join(process.cwd(), 'dist'), - silent: true, - treeshake: true, - shims: false, - watch, - clean: false, - esbuildPlugins: [ - aliasPlugin({ - process: require.resolve('../node_modules/process/browser.js'), - util: require.resolve('../node_modules/util/util.js'), - assert: require.resolve('browser-assert'), - }), - ], - }; - - const commonExternals = [ - name, - ...extraExternals, - ...Object.keys(dependencies || {}), - ...Object.keys(peerDependencies || {}), - ]; - - if (exportEntries.length > 0) { - const { dtsConfig, tsConfigExists } = await getDTSConfigs({ - formats, - entries: exportEntries, - optimized, - }); - - tasks.push( - build({ - ...commonOptions, - ...(optimized ? dtsConfig : {}), - entry: exportEntries, - format: ['esm'], - target: ['chrome100', 'safari15', 'firefox91'], - platform: 'browser', - external: [...commonExternals, ...globalManagerPackages, ...globalPreviewPackages], - esbuildOptions: (options) => { - /* eslint-disable no-param-reassign */ - options.conditions = ['module']; - options.platform = 'browser'; - Object.assign(options, getESBuildOptions(optimized)); - /* eslint-enable no-param-reassign */ - }, - }), - build({ - ...commonOptions, - ...(optimized ? dtsConfig : {}), - entry: exportEntries, - format: ['cjs'], - target: 'node16', - platform: 'node', - external: commonExternals, - esbuildOptions: (options) => { - /* eslint-disable no-param-reassign */ - options.conditions = ['module']; - options.platform = 'node'; - Object.assign(options, getESBuildOptions(optimized)); - /* eslint-enable no-param-reassign */ - }, - }) - ); - - if (tsConfigExists && !optimized) { - tasks.push(...exportEntries.map(generateDTSMapperFile)); - } - } - - if (managerEntries.length > 0) { - tasks.push( - build({ - ...commonOptions, - entry: managerEntries.map((e: string) => slash(join(cwd, e))), - outExtension: () => ({ - js: '.js', - }), - format: ['esm'], - target: ['chrome100', 'safari15', 'firefox91'], - platform: 'browser', - external: [...commonExternals, ...globalManagerPackages], - esbuildOptions: (options) => { - /* eslint-disable no-param-reassign */ - options.conditions = ['module']; - options.platform = 'browser'; - Object.assign(options, getESBuildOptions(optimized)); - /* eslint-enable no-param-reassign */ - }, - }) - ); - } - if (previewEntries.length > 0) { - tasks.push( - build({ - ...commonOptions, - entry: previewEntries.map((e: string) => slash(join(cwd, e))), - outExtension: () => ({ - js: '.js', - }), - format: ['esm'], - target: ['chrome100', 'safari15', 'firefox91'], - platform: 'browser', - external: [...commonExternals, ...globalPreviewPackages], - esbuildOptions: (c) => { - /* eslint-disable no-param-reassign */ - c.conditions = ['module']; - c.platform = 'browser'; - Object.assign(c, getESBuildOptions(optimized)); - /* eslint-enable no-param-reassign */ - }, - }) - ); - } - if (nodeEntries.length > 0) { - tasks.push( - build({ - ...commonOptions, - entry: nodeEntries.map((e: string) => slash(join(cwd, e))), - format: ['cjs'], - target: 'node16', - platform: 'node', - external: commonExternals, - esbuildOptions: (c) => { - /* eslint-disable no-param-reassign */ - c.platform = 'node'; - Object.assign(c, getESBuildOptions(optimized)); - /* eslint-enable no-param-reassign */ - }, - }) - ); - } - - await Promise.all(tasks); - - if (post) { - await exec( - `node -r ${__dirname}/../node_modules/esbuild-register/register.js ${post}`, - { cwd }, - { debug: true } - ); - } - - console.log('done'); -}; - -/* UTILS */ - -// keep in sync with code/lib/manager-api/src/index.ts - -async function getDTSConfigs({ - formats, - entries, - optimized, -}: { - formats: Formats[]; - entries: string[]; - optimized: boolean; -}) { - const tsConfigPath = join(cwd, 'tsconfig.json'); - const tsConfigExists = await fs.pathExists(tsConfigPath); - - const dtsBuild = optimized && formats[0] && tsConfigExists ? formats[0] : undefined; - - const dtsConfig: DtsConfigSection = { - tsconfig: tsConfigPath, - dts: { - entry: entries, - resolve: true, - }, - }; - - return { dtsBuild, dtsConfig, tsConfigExists }; -} - -function getESBuildOptions(optimized: boolean) { - return { - logLevel: 'error', - legalComments: 'none', - minifyWhitespace: optimized, - minifyIdentifiers: false, - minifySyntax: optimized, - }; -} - -async function generateDTSMapperFile(file: string) { - const { name: entryName, dir } = path.parse(file); - - const pathName = join(process.cwd(), dir.replace('./src', 'dist'), `${entryName}.d.ts`); - const srcName = join(process.cwd(), file); - const rel = relative(dirname(pathName), dirname(srcName)).split(path.sep).join(path.posix.sep); - - await fs.ensureFile(pathName); - await fs.writeFile( - pathName, - dedent` - // dev-mode - export * from '${rel}/${entryName}'; - `, - { encoding: 'utf-8' } - ); -} - -const hasFlag = (flags: string[], name: string) => !!flags.find((s) => s.startsWith(`--${name}`)); - -/* SELF EXECUTION */ - -const flags = process.argv.slice(2); -const cwd = process.cwd(); - -run({ cwd, flags }).catch((err: unknown) => { - // We can't let the stack try to print, it crashes in a way that sets the exit code to 0. - // Seems to have something to do with running JSON.parse() on binary / base64 encoded sourcemaps - // in @cspotcode/source-map-support - if (err instanceof Error) { - console.error(err.stack); - } - process.exit(1); -}); diff --git a/scripts/yarn.lock b/scripts/yarn.lock index a6d22a45a644..411298c2d9b9 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -3146,7 +3146,6 @@ __metadata: babel-eslint: "npm:^10.1.0" babel-loader: "npm:^9.1.2" boxen: "npm:^5.1.2" - browser-assert: "npm:^1.2.1" chalk: "npm:^4.1.0" codecov: "npm:^3.8.1" commander: "npm:^6.2.1" @@ -5468,13 +5467,6 @@ __metadata: languageName: node linkType: hard -"browser-assert@npm:^1.2.1": - version: 1.2.1 - resolution: "browser-assert@npm:1.2.1" - checksum: 902abf999f92c9c951fdb6d7352c09eea9a84706258699655f7e7906e42daa06a1ae286398a755872740e05a6a71c43c5d1a0c0431d67a8cdb66e5d859a3fc0c - languageName: node - linkType: hard - "browserslist@npm:^4.21.10, browserslist@npm:^4.21.9": version: 4.21.10 resolution: "browserslist@npm:4.21.10" From 808266f5f9f108cd24690f6982b07df8809880e5 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Mon, 13 Nov 2023 20:51:49 +0000 Subject: [PATCH 115/115] Write changelog for 7.6.0-alpha.5 [skip ci] --- CHANGELOG.prerelease.md | 24 ++++++++++++++++++++++++ code/package.json | 3 ++- docs/versions/next.json | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.prerelease.md b/CHANGELOG.prerelease.md index 5cc2087688c0..7e7c4ea7c5c4 100644 --- a/CHANGELOG.prerelease.md +++ b/CHANGELOG.prerelease.md @@ -1,3 +1,27 @@ +## 7.6.0-alpha.5 + +- Addons, core: Make `react` and Storybook packages `devDependencies` where possible - [#24676](https://github.com/storybookjs/storybook/pull/24676), thanks [@JReinhold](https://github.com/JReinhold)! +- Angular: Handle nested module metadata - [#24798](https://github.com/storybookjs/storybook/pull/24798), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! +- Angular: Include object configured styles - [#24768](https://github.com/storybookjs/storybook/pull/24768), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! +- Angular: Support v17 - [#24717](https://github.com/storybookjs/storybook/pull/24717), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! +- ReactNative: Fix missing assert dep in docs-tools - [#24732](https://github.com/storybookjs/storybook/pull/24732), thanks [@dannyhw](https://github.com/dannyhw)! +- SWC: Add settings for react and preact - [#24805](https://github.com/storybookjs/storybook/pull/24805), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! +- Svelte: Fix source with decorators always showing the `SlotDecorator` component - [#24800](https://github.com/storybookjs/storybook/pull/24800), thanks [@JReinhold](https://github.com/JReinhold)! +- TestBuild: Disable composition when `--test` is `true` - [#24799](https://github.com/storybookjs/storybook/pull/24799), thanks [@ndelangen](https://github.com/ndelangen)! +- TestBuild: Disable docs related stuff for test builds - [#24691](https://github.com/storybookjs/storybook/pull/24691), thanks [@ndelangen](https://github.com/ndelangen)! +- TestBuild: Disable telemetry for test builds - [#24706](https://github.com/storybookjs/storybook/pull/24706), thanks [@kasperpeulen](https://github.com/kasperpeulen)! +- TestBuild: Disable warnOnIncompatibleAddons - [#24797](https://github.com/storybookjs/storybook/pull/24797), thanks [@ndelangen](https://github.com/ndelangen)! +- TestBuild: Globalize `@storybook/blocks` if `build.test.emptyBlocks` is `true` - [#24650](https://github.com/storybookjs/storybook/pull/24650), thanks [@ndelangen](https://github.com/ndelangen)! +- TestBuild: Implement builder options for test build - [#24826](https://github.com/storybookjs/storybook/pull/24826), thanks [@kasperpeulen](https://github.com/kasperpeulen)! +- TestBuild: No sourcemaps for test builds - [#24804](https://github.com/storybookjs/storybook/pull/24804), thanks [@ndelangen](https://github.com/ndelangen)! +- UI: Fix horizontal scroll bar in Canvas hidden by styling - [#24408](https://github.com/storybookjs/storybook/pull/24408), thanks [@yoshi2no](https://github.com/yoshi2no)! +- UI: Logo fixed value - [#24726](https://github.com/storybookjs/storybook/pull/24726), thanks [@black-arm](https://github.com/black-arm)! +- UI: improve A11Y remove redundant styling rules, update icon color - [#24402](https://github.com/storybookjs/storybook/pull/24402), thanks [@tolkadot](https://github.com/tolkadot)! +- Webpack5: Add export-order-loader and remove babel-plugin-named-exports-order - [#24749](https://github.com/storybookjs/storybook/pull/24749), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! +- Webpack5: Add react-docgen loader and remove babel-plugin-react-docgen - [#24762](https://github.com/storybookjs/storybook/pull/24762), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! +- Webpack5: Fix race condition for export-order loader - [#24817](https://github.com/storybookjs/storybook/pull/24817), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! +- Webpack5: Hide critical dependency warning - [#24784](https://github.com/storybookjs/storybook/pull/24784), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)! + ## 7.6.0-alpha.4 - CLI: Ensure errors with opening the browser are caught - [#24668](https://github.com/storybookjs/storybook/pull/24668), thanks [@xueyawei](https://github.com/xueyawei)! diff --git a/code/package.json b/code/package.json index bd9343258cdf..db56a5acae8d 100644 --- a/code/package.json +++ b/code/package.json @@ -325,5 +325,6 @@ "Dependency Upgrades" ] ] - } + }, + "deferredNextVersion": "7.6.0-alpha.5" } diff --git a/docs/versions/next.json b/docs/versions/next.json index c87f8fb0975b..f4ad6c1f1945 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"7.6.0-alpha.4","info":{"plain":"- CLI: Ensure errors with opening the browser are caught - [#24668](https://github.com/storybookjs/storybook/pull/24668), thanks [@xueyawei](https://github.com/xueyawei)!\n- Babel: Update all @babel/* dependencies - [#24610](https://github.com/storybookjs/storybook/pull/24610), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- CLI: Catch when prettier failed to prettify main and preview config files - [#24604](https://github.com/storybookjs/storybook/pull/24604), thanks [@kasperpeulen](https://github.com/kasperpeulen)!\n- CLI: Ignore `addon-onboarding` when checking versions - [#24634](https://github.com/storybookjs/storybook/pull/24634), thanks [@JReinhold](https://github.com/JReinhold)!\n- CLI: Use @storybook/test in template stories - [#24393](https://github.com/storybookjs/storybook/pull/24393), thanks [@yannbf](https://github.com/yannbf)!\n- Controls: Improve accessibility of BooleanControl for screen readers - [#24418](https://github.com/storybookjs/storybook/pull/24418), thanks [@danielmarcano](https://github.com/danielmarcano)!\n- Dependencies: Update @babel/traverse and @babel/core to fix vulnerability - [#24670](https://github.com/storybookjs/storybook/pull/24670), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- Dependencies: Update browserify-sign transitive dependency - [#24674](https://github.com/storybookjs/storybook/pull/24674), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- Dependencies: Update nx dependencies to v17 - [#24671](https://github.com/storybookjs/storybook/pull/24671), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- Maintenance: Split renderers preview entrypoints - [#24623](https://github.com/storybookjs/storybook/pull/24623), thanks [@ndelangen](https://github.com/ndelangen)!\n- Next.js: Add avif support - [#24611](https://github.com/storybookjs/storybook/pull/24611), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- Next.js: Fix forwarding ref for Image component - [#24648](https://github.com/storybookjs/storybook/pull/24648), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- Theming: Add theme variable to set the preview background color - [#24575](https://github.com/storybookjs/storybook/pull/24575), thanks [@JReinhold](https://github.com/JReinhold)!\n- UI: Fix button contrast-ratio - [#24525](https://github.com/storybookjs/storybook/pull/24525), thanks [@maheshchandra10](https://github.com/maheshchandra10)!\n- UI: Update zIndex on NotificationList to fix the notification not being clickable in certain cases - [#24602](https://github.com/storybookjs/storybook/pull/24602), thanks [@yoshi2no](https://github.com/yoshi2no)!"}} +{"version":"7.6.0-alpha.5","info":{"plain":"- Addons, core: Make `react` and Storybook packages `devDependencies` where possible - [#24676](https://github.com/storybookjs/storybook/pull/24676), thanks [@JReinhold](https://github.com/JReinhold)!\n- Angular: Handle nested module metadata - [#24798](https://github.com/storybookjs/storybook/pull/24798), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- Angular: Include object configured styles - [#24768](https://github.com/storybookjs/storybook/pull/24768), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- Angular: Support v17 - [#24717](https://github.com/storybookjs/storybook/pull/24717), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- ReactNative: Fix missing assert dep in docs-tools - [#24732](https://github.com/storybookjs/storybook/pull/24732), thanks [@dannyhw](https://github.com/dannyhw)!\n- SWC: Add settings for react and preact - [#24805](https://github.com/storybookjs/storybook/pull/24805), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- Svelte: Fix source with decorators always showing the `SlotDecorator` component - [#24800](https://github.com/storybookjs/storybook/pull/24800), thanks [@JReinhold](https://github.com/JReinhold)!\n- TestBuild: Disable composition when `--test` is `true` - [#24799](https://github.com/storybookjs/storybook/pull/24799), thanks [@ndelangen](https://github.com/ndelangen)!\n- TestBuild: Disable docs related stuff for test builds - [#24691](https://github.com/storybookjs/storybook/pull/24691), thanks [@ndelangen](https://github.com/ndelangen)!\n- TestBuild: Disable telemetry for test builds - [#24706](https://github.com/storybookjs/storybook/pull/24706), thanks [@kasperpeulen](https://github.com/kasperpeulen)!\n- TestBuild: Disable warnOnIncompatibleAddons - [#24797](https://github.com/storybookjs/storybook/pull/24797), thanks [@ndelangen](https://github.com/ndelangen)!\n- TestBuild: Globalize `@storybook/blocks` if `build.test.emptyBlocks` is `true` - [#24650](https://github.com/storybookjs/storybook/pull/24650), thanks [@ndelangen](https://github.com/ndelangen)!\n- TestBuild: Implement builder options for test build - [#24826](https://github.com/storybookjs/storybook/pull/24826), thanks [@kasperpeulen](https://github.com/kasperpeulen)!\n- TestBuild: No sourcemaps for test builds - [#24804](https://github.com/storybookjs/storybook/pull/24804), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Fix horizontal scroll bar in Canvas hidden by styling - [#24408](https://github.com/storybookjs/storybook/pull/24408), thanks [@yoshi2no](https://github.com/yoshi2no)!\n- UI: Logo fixed value - [#24726](https://github.com/storybookjs/storybook/pull/24726), thanks [@black-arm](https://github.com/black-arm)!\n- UI: improve A11Y remove redundant styling rules, update icon color - [#24402](https://github.com/storybookjs/storybook/pull/24402), thanks [@tolkadot](https://github.com/tolkadot)!\n- Webpack5: Add export-order-loader and remove babel-plugin-named-exports-order - [#24749](https://github.com/storybookjs/storybook/pull/24749), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- Webpack5: Add react-docgen loader and remove babel-plugin-react-docgen - [#24762](https://github.com/storybookjs/storybook/pull/24762), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- Webpack5: Fix race condition for export-order loader - [#24817](https://github.com/storybookjs/storybook/pull/24817), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!\n- Webpack5: Hide critical dependency warning - [#24784](https://github.com/storybookjs/storybook/pull/24784), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!"}}