From 8ed4c1ca3e7815f5e3649081e0da169a540c9a23 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Fri, 1 Sep 2023 21:45:11 +0000 Subject: [PATCH 01/13] Update ./docs/versions/next.json for v7.5.0-alpha.0 --- docs/versions/next.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/versions/next.json b/docs/versions/next.json index b9164a2dcd0d..93bfe5e23009 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1,6 +1 @@ -{ - "version": "7.4.0-alpha.2", - "info": { - "plain": "- Addon-docs: Resolve `mdx-react-shim` & `@storybook/global` correctly - [#23941](https://github.com/storybookjs/storybook/pull/23941), thanks [@ndelangen](https://github.com/ndelangen)!\n- Addons: Fix key is not a prop warning - [#23935](https://github.com/storybookjs/storybook/pull/23935), thanks [@kasperpeulen](https://github.com/kasperpeulen)!\n- CLI: Pass package manager to postinstall - [#23913](https://github.com/storybookjs/storybook/pull/23913), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Provide guidance for users who try to initialize Storybook on an empty dir - [#23874](https://github.com/storybookjs/storybook/pull/23874), thanks [@yannbf](https://github.com/yannbf)!\n- Logger: Fix double error messages/stack - [#23919](https://github.com/storybookjs/storybook/pull/23919), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Categorize server errors - [#23912](https://github.com/storybookjs/storybook/pull/23912), thanks [@yannbf](https://github.com/yannbf)!\n- Maintenance: Remove need for `react` as peerDependency - [#23897](https://github.com/storybookjs/storybook/pull/23897), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Remove sourcemaps generation - [#23936](https://github.com/storybookjs/storybook/pull/23936), thanks [@ndelangen](https://github.com/ndelangen)!\n- Preset: Add common preset overrides mechanism - [#23915](https://github.com/storybookjs/storybook/pull/23915), thanks [@yannbf](https://github.com/yannbf)!\n- UI: Add an experimental API for adding sidebar bottom toolbar - [#23778](https://github.com/storybookjs/storybook/pull/23778), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Add an experimental API for adding sidebar top toolbar - [#23811](https://github.com/storybookjs/storybook/pull/23811), thanks [@ndelangen](https://github.com/ndelangen)!" - } -} +{"version":"7.5.0-alpha.0","info":{"plain":"- Addon API: Improve the updateStatus API - [#24007](https://github.com/storybookjs/storybook/pull/24007), thanks [@ndelangen](https://github.com/ndelangen)!\n- CLI: Add more information to `storybook info` command - [#24003](https://github.com/storybookjs/storybook/pull/24003), thanks [@JReinhold](https://github.com/JReinhold)!\n- CLI: Add uncaughtException handler - [#24018](https://github.com/storybookjs/storybook/pull/24018), thanks [@yannbf](https://github.com/yannbf)!\n- CLI: Remove random commas in storybook upgrade logs - [#22333](https://github.com/storybookjs/storybook/pull/22333), thanks [@joaonunomota](https://github.com/joaonunomota)!\n- Doc Blocks: Add `title` to `Meta` prop types - [#23370](https://github.com/storybookjs/storybook/pull/23370), thanks [@iqbalcodes6602](https://github.com/iqbalcodes6602)!\n- Docs: Fix TOC import - [#24047](https://github.com/storybookjs/storybook/pull/24047), thanks [@shilman](https://github.com/shilman)!\n- Docs: Fix table of contents scroll behavior - [#23986](https://github.com/storybookjs/storybook/pull/23986), thanks [@almoghaimo](https://github.com/almoghaimo)!\n- Telemetry: Filter addon options to protect sensitive info - [#24000](https://github.com/storybookjs/storybook/pull/24000), thanks [@shilman](https://github.com/shilman)!\n- Types: Remove `@types/react` dep from `@storybook/types` - [#24042](https://github.com/storybookjs/storybook/pull/24042), thanks [@JReinhold](https://github.com/JReinhold)!"}} From a88829dd8a84d967bc5150990ab92e12f5f85794 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Mon, 4 Sep 2023 02:25:35 +0000 Subject: [PATCH 02/13] Update ./docs/versions/next.json for v7.5.0-alpha.1 --- docs/versions/next.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/versions/next.json b/docs/versions/next.json index 93bfe5e23009..739652e36af9 100644 --- a/docs/versions/next.json +++ b/docs/versions/next.json @@ -1 +1 @@ -{"version":"7.5.0-alpha.0","info":{"plain":"- Addon API: Improve the updateStatus API - [#24007](https://github.com/storybookjs/storybook/pull/24007), thanks [@ndelangen](https://github.com/ndelangen)!\n- CLI: Add more information to `storybook info` command - [#24003](https://github.com/storybookjs/storybook/pull/24003), thanks [@JReinhold](https://github.com/JReinhold)!\n- CLI: Add uncaughtException handler - [#24018](https://github.com/storybookjs/storybook/pull/24018), thanks [@yannbf](https://github.com/yannbf)!\n- CLI: Remove random commas in storybook upgrade logs - [#22333](https://github.com/storybookjs/storybook/pull/22333), thanks [@joaonunomota](https://github.com/joaonunomota)!\n- Doc Blocks: Add `title` to `Meta` prop types - [#23370](https://github.com/storybookjs/storybook/pull/23370), thanks [@iqbalcodes6602](https://github.com/iqbalcodes6602)!\n- Docs: Fix TOC import - [#24047](https://github.com/storybookjs/storybook/pull/24047), thanks [@shilman](https://github.com/shilman)!\n- Docs: Fix table of contents scroll behavior - [#23986](https://github.com/storybookjs/storybook/pull/23986), thanks [@almoghaimo](https://github.com/almoghaimo)!\n- Telemetry: Filter addon options to protect sensitive info - [#24000](https://github.com/storybookjs/storybook/pull/24000), thanks [@shilman](https://github.com/shilman)!\n- Types: Remove `@types/react` dep from `@storybook/types` - [#24042](https://github.com/storybookjs/storybook/pull/24042), thanks [@JReinhold](https://github.com/JReinhold)!"}} +{"version":"7.5.0-alpha.1","info":{"plain":"- Core: Add CJS entrypoints to errors in core events - [#24038](https://github.com/storybookjs/storybook/pull/24038), thanks [@yannbf](https://github.com/yannbf)!"}} From 39ea6ba5b7a77db16d1788d1b9c0e18091aa570b Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Mon, 4 Sep 2023 16:13:17 +0200 Subject: [PATCH 03/13] Merge pull request #24015 from johnhunter/node-version-nvmrc Development: Manage Node version with .nvmrc --- .github/workflows/canary-release-pr.yml | 3 +-- .github/workflows/danger-js.yml | 4 ++-- .github/workflows/prepare-patch-release.yml | 2 +- .github/workflows/prepare-prerelease.yml | 2 +- .github/workflows/publish.yml | 2 +- .gitignore | 1 - .nvmrc | 1 + CONTRIBUTING.md | 15 +++++++++++++-- package.json | 6 +----- 9 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 .nvmrc diff --git a/.github/workflows/canary-release-pr.yml b/.github/workflows/canary-release-pr.yml index 4b1504cfd1bf..827f24a2c5f8 100644 --- a/.github/workflows/canary-release-pr.yml +++ b/.github/workflows/canary-release-pr.yml @@ -58,8 +58,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '16' - + node-version-file: '.nvmrc' - name: Cache dependencies uses: actions/cache@v3 with: diff --git a/.github/workflows/danger-js.yml b/.github/workflows/danger-js.yml index f83519953b4b..eddb5dee1fe7 100644 --- a/.github/workflows/danger-js.yml +++ b/.github/workflows/danger-js.yml @@ -21,10 +21,10 @@ jobs: name: Danger JS runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: '16' - - uses: actions/checkout@v3 + node-version-file: '.nvmrc' - name: Danger JS uses: danger/danger-js@11.2.6 env: diff --git a/.github/workflows/prepare-patch-release.yml b/.github/workflows/prepare-patch-release.yml index c88022c7ea01..e4f8e38df502 100644 --- a/.github/workflows/prepare-patch-release.yml +++ b/.github/workflows/prepare-patch-release.yml @@ -33,7 +33,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '16' + node-version-file: '.nvmrc' - name: Cache dependencies uses: actions/cache@v3 diff --git a/.github/workflows/prepare-prerelease.yml b/.github/workflows/prepare-prerelease.yml index 1250aedcfaa3..e68a7e1ef63a 100644 --- a/.github/workflows/prepare-prerelease.yml +++ b/.github/workflows/prepare-prerelease.yml @@ -54,7 +54,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '16' + node-version-file: '.nvmrc' - name: Cache dependencies uses: actions/cache@v3 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 18e23c174162..863b4e9ae7e2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -45,7 +45,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '16' + node-version-file: '.nvmrc' - name: Cache dependencies uses: actions/cache@v3 diff --git a/.gitignore b/.gitignore index 29c025aadf26..63f9445af854 100644 --- a/.gitignore +++ b/.gitignore @@ -37,7 +37,6 @@ coverage/ /**/LICENSE code/docs/public package-lock.json -.nvmrc storybook-static .jest-test-results.json *.jar diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000000..59ea99ee63cb --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +16.20 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cc26a6bff211..78993afd8386 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,13 +1,24 @@ # Getting started -Storybook is developed against a specific node version. We recommend using [Volta](https://volta.sh/) as it will automatically install the correct node and yarn version when you first use the repo. If you chose not to use Volta please ensure you you have node version 16 installed (suggestion: v16.5) +Storybook is developed against a specific node version which is defined in an `.nvmrc` file. You can use any Node version manager that uses the `.nvmrc` configuration file (we recommend [fnm](https://fnm.vercel.app/)). + +## Using fnm as a Node version manager + +- Install fnm [as per instructions](https://github.com/Schniz/fnm/tree/master#installation) +- In your shell setup include the `use-on-cd`, `corepack-enabled` and `version-file-strategy recursive` parameters in the `fnm env` command, e.g. + + ```sh + eval "$(fnm env --use-on-cd --corepack-enabled --version-file-strategy recursive)" + ``` + +## Running the local development environment - Ensure if you are using Windows to use the Windows Subsystem for Linux (WSL). - Run `yarn start` in the root directory to run a basic test Storybook "sandbox". The `yarn start` script will generate a React Vite TypeScript sandbox with a set of test stories inside it, as well as taking all steps required to get it running (building the various packages we need etc). There is no need to run `yarn` or `yarn install` as `yarn start` will do this for you. -## Issues +### Issues If you run `yarn start` and encounter the following error, try rerunning `yarn start` a second time: diff --git a/package.json b/package.json index 7c606bfbed07..562cce14091e 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,5 @@ "test": "cd code; yarn test", "upload-bench": "cd scripts; yarn upload-bench" }, - "packageManager": "yarn@3.5.1", - "volta": { - "node": "16.20.1", - "yarn": "3.5.1" - } + "packageManager": "yarn@3.5.1" } From a896513363238e66674fac01ef233979b694e281 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Wed, 30 Aug 2023 13:55:35 +0800 Subject: [PATCH 04/13] Merge pull request #24000 from storybookjs/shilman/filter-addons-telemetry Telemetry: Filter addon options to protect sensitive info (cherry picked from commit 7b4f37f4d7a97b6e21a8dd730d37f8ffb18a2fd0) --- .../telemetry/src/storybook-metadata.test.ts | 27 +++++++++++++++++++ code/lib/telemetry/src/storybook-metadata.ts | 4 ++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/code/lib/telemetry/src/storybook-metadata.test.ts b/code/lib/telemetry/src/storybook-metadata.test.ts index ab64dc26e9a1..83a206a92761 100644 --- a/code/lib/telemetry/src/storybook-metadata.test.ts +++ b/code/lib/telemetry/src/storybook-metadata.test.ts @@ -349,6 +349,33 @@ describe('storybook-metadata', () => { expect(res.refCount).toEqual(2); }); + test('only reports addon options for addon-essentials', async () => { + const res = await computeStorybookMetadata({ + packageJson: packageJsonMock, + mainConfig: { + ...mainJsMock, + addons: [ + { name: '@storybook/addon-essentials', options: { controls: false } }, + { name: 'addon-foo', options: { foo: 'bar' } }, + ], + }, + }); + expect(res.addons).toMatchInlineSnapshot(` + Object { + "@storybook/addon-essentials": Object { + "options": Object { + "controls": false, + }, + "version": "x.x.x", + }, + "addon-foo": Object { + "options": undefined, + "version": "x.x.x", + }, + } + `); + }); + test.each(Object.entries(metaFrameworks))( 'should detect the supported metaframework: %s', async (metaFramework, name) => { diff --git a/code/lib/telemetry/src/storybook-metadata.ts b/code/lib/telemetry/src/storybook-metadata.ts index 01a54d9c9ec0..2c70b566f97d 100644 --- a/code/lib/telemetry/src/storybook-metadata.ts +++ b/code/lib/telemetry/src/storybook-metadata.ts @@ -114,7 +114,9 @@ export const computeStorybookMetadata = async ({ if (typeof addon === 'string') { addonName = sanitizeAddonName(addon); } else { - options = addon.options; + if (addon.name.includes('addon-essentials')) { + options = addon.options; + } addonName = sanitizeAddonName(addon.name); } From ebe172e5ed15fcda9c5adad2a104eec6ca894800 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Fri, 1 Sep 2023 18:49:23 +0200 Subject: [PATCH 05/13] Merge pull request #24018 from storybookjs/yann/string-width-issue CLI: Add uncaughtException handler (cherry picked from commit a66b8b22455f6032f94a85f13aa9a39b763ba917) --- code/lib/cli/bin/index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/code/lib/cli/bin/index.js b/code/lib/cli/bin/index.js index 812bff5291c2..7131e95a311d 100755 --- a/code/lib/cli/bin/index.js +++ b/code/lib/cli/bin/index.js @@ -6,4 +6,21 @@ if (majorNodeVersion < 16) { process.exit(1); } +// The Storybook CLI has a catch block for all of its commands, but if an error +// occurs before the command even runs, for instance, if an import fails, then +// such error will fall under the uncaughtException handler. +// This is the earliest moment we can catch such errors. +process.once('uncaughtException', (error) => { + if (error.message.includes('string-width')) { + console.error( + [ + '🔴 Error: It looks like you are having a known issue with package hoisting.', + 'Please check the following issue for details and solutions: https://github.com/storybookjs/storybook/issues/22431#issuecomment-1630086092\n\n', + ].join('\n') + ); + } + + throw error; +}); + require('../dist/generate.js'); From 4c80e0537089c504afccc9f0321e4f977a5c0ace Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Sat, 2 Sep 2023 01:14:46 +0800 Subject: [PATCH 06/13] Merge pull request #24047 from storybookjs/shilman/fix-tocbot-import Docs: Fix TOC import (cherry picked from commit 2995f493028aeb85ea3325cdcae85781af2f7733) --- code/ui/blocks/src/components/TableOfContents.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ui/blocks/src/components/TableOfContents.tsx b/code/ui/blocks/src/components/TableOfContents.tsx index 892f1e137f20..65d0e1bc0069 100644 --- a/code/ui/blocks/src/components/TableOfContents.tsx +++ b/code/ui/blocks/src/components/TableOfContents.tsx @@ -1,7 +1,7 @@ import React, { useEffect } from 'react'; import type { FC, ReactElement } from 'react'; import { styled } from '@storybook/theming'; -import tocbot from 'tocbot'; +import * as tocbot from 'tocbot'; export interface TocParameters { /** CSS selector for the container to search for headings. */ From 27a0887ebb8b0c62edaf8834012a1acb0c019a7f Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Mon, 4 Sep 2023 08:40:40 +0800 Subject: [PATCH 07/13] Merge pull request #24038 from storybookjs/yann/fix-cjs-entries-on-core-events Core: Add CJS entrypoints to errors in core events (cherry picked from commit 509dc79955b81a94aa754051451749852db41401) --- code/lib/cli/package.json | 1 + code/lib/core-common/package.json | 1 + code/lib/core-events/manager-errors.js | 4 ++++ code/lib/core-events/preview-errors.js | 4 ++++ code/lib/core-events/server-errors.js | 4 ++++ code/yarn.lock | 2 ++ 6 files changed, 16 insertions(+) create mode 100644 code/lib/core-events/manager-errors.js create mode 100644 code/lib/core-events/preview-errors.js create mode 100644 code/lib/core-events/server-errors.js diff --git a/code/lib/cli/package.json b/code/lib/cli/package.json index 8dbcdb6b8c9c..74ab0adb636e 100644 --- a/code/lib/cli/package.json +++ b/code/lib/cli/package.json @@ -61,6 +61,7 @@ "@ndelangen/get-tarball": "^3.0.7", "@storybook/codemod": "workspace:*", "@storybook/core-common": "workspace:*", + "@storybook/core-events": "workspace:*", "@storybook/core-server": "workspace:*", "@storybook/csf-tools": "workspace:*", "@storybook/node-logger": "workspace:*", diff --git a/code/lib/core-common/package.json b/code/lib/core-common/package.json index 56aad7f9f473..d6dd5a49d7fd 100644 --- a/code/lib/core-common/package.json +++ b/code/lib/core-common/package.json @@ -44,6 +44,7 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { + "@storybook/core-events": "workspace:*", "@storybook/node-logger": "workspace:*", "@storybook/types": "workspace:*", "@types/find-cache-dir": "^3.2.1", diff --git a/code/lib/core-events/manager-errors.js b/code/lib/core-events/manager-errors.js new file mode 100644 index 000000000000..6a1ce1522c1b --- /dev/null +++ b/code/lib/core-events/manager-errors.js @@ -0,0 +1,4 @@ +// This is required for projects that require paths such as `@storybook/core-events/manager-errors` +// but in CJS, while not in ESM mode. Else an error like this will occur: +// ENOENT: no such file or directory, open '/xyz/node_modules/@storybook/core-events/manager-errors.js' +module.exports = require('./dist/errors/manager-errors'); diff --git a/code/lib/core-events/preview-errors.js b/code/lib/core-events/preview-errors.js new file mode 100644 index 000000000000..a98055ba796d --- /dev/null +++ b/code/lib/core-events/preview-errors.js @@ -0,0 +1,4 @@ +// This is required for projects that require paths such as `@storybook/core-events/preview-errors` +// but in CJS, while not in ESM mode. Else an error like this will occur: +// ENOENT: no such file or directory, open '/xyz/node_modules/@storybook/core-events/preview-errors.js' +module.exports = require('./dist/errors/preview-errors'); diff --git a/code/lib/core-events/server-errors.js b/code/lib/core-events/server-errors.js new file mode 100644 index 000000000000..5f4eb31a408c --- /dev/null +++ b/code/lib/core-events/server-errors.js @@ -0,0 +1,4 @@ +// This is required for projects that require paths such as `@storybook/core-events/server-errors` +// but in CJS, while not in ESM mode. Else an error like this will occur: +// ENOENT: no such file or directory, open '/xyz/node_modules/@storybook/core-events/server-errors.js' +module.exports = require('./dist/errors/server-errors'); diff --git a/code/yarn.lock b/code/yarn.lock index 6c80e860b68a..3caa8171c40e 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6571,6 +6571,7 @@ __metadata: "@storybook/client-api": "workspace:*" "@storybook/codemod": "workspace:*" "@storybook/core-common": "workspace:*" + "@storybook/core-events": "workspace:*" "@storybook/core-server": "workspace:*" "@storybook/csf-tools": "workspace:*" "@storybook/node-logger": "workspace:*" @@ -6719,6 +6720,7 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/core-common@workspace:lib/core-common" dependencies: + "@storybook/core-events": "workspace:*" "@storybook/node-logger": "workspace:*" "@storybook/types": "workspace:*" "@types/find-cache-dir": ^3.2.1 From a3d9706d094f6cb8400f6adce69aa9600c9aecd8 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 1 Sep 2023 16:02:45 +0200 Subject: [PATCH 08/13] Merge pull request #24042 from storybookjs/remove-types-react Types: Remove `@types/react` dep from `@storybook/types` (cherry picked from commit 5bd426472aa3d6d715f0ee6478eff5574c43d4fe) --- code/lib/types/package.json | 1 - code/yarn.lock | 1 - 2 files changed, 2 deletions(-) diff --git a/code/lib/types/package.json b/code/lib/types/package.json index b8b9ea5c6c55..894c1ca7fc04 100644 --- a/code/lib/types/package.json +++ b/code/lib/types/package.json @@ -47,7 +47,6 @@ "@storybook/channels": "workspace:*", "@types/babel__core": "^7.0.0", "@types/express": "^4.7.0", - "@types/react": "^16.14.34", "file-system-cache": "2.3.0" }, "devDependencies": { diff --git a/code/yarn.lock b/code/yarn.lock index 3caa8171c40e..86a64db65192 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -8050,7 +8050,6 @@ __metadata: "@types/babel__core": ^7.0.0 "@types/express": ^4.7.0 "@types/node": ^16.0.0 - "@types/react": ^16.14.34 file-system-cache: 2.3.0 typescript: ~4.9.3 languageName: unknown From 3a2e15b751f08e1711d3a4389ab0b1fcd5c25339 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Mon, 4 Sep 2023 16:17:01 +0200 Subject: [PATCH 09/13] Merge pull request #24062 from oruman/patch-1 Vue3: Remove console.log in sourceDecorator (cherry picked from commit a024424dbcf37291ae1bc9195a94b718493e3546) --- code/renderers/vue3/src/docs/sourceDecorator.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/code/renderers/vue3/src/docs/sourceDecorator.ts b/code/renderers/vue3/src/docs/sourceDecorator.ts index 5c1e9e51b0e5..f0e254f082ae 100644 --- a/code/renderers/vue3/src/docs/sourceDecorator.ts +++ b/code/renderers/vue3/src/docs/sourceDecorator.ts @@ -247,7 +247,6 @@ export function generateTemplateSource( .map((child) => child.content) .join('') : ''; - console.log(' vnode ', vnode, ' childSources ', childSources, ' attributes ', attributes); const name = typeof type === 'string' ? type From 86775b822841a38513b6261e8c2ac89b28d47afd Mon Sep 17 00:00:00 2001 From: Shaun Evening Date: Tue, 5 Sep 2023 11:43:22 -0400 Subject: [PATCH 10/13] Merge pull request #24079 from storybookjs/cli/fix-add-command CLI: Fix packageManager handling in `sb add` (cherry picked from commit 0cb9932cd75c31d4987b92d4925faf7d38d9de00) --- code/addons/themes/postinstall.js | 2 +- code/lib/cli/src/add.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/addons/themes/postinstall.js b/code/addons/themes/postinstall.js index c84a4e88e4b4..01a9b3151e89 100644 --- a/code/addons/themes/postinstall.js +++ b/code/addons/themes/postinstall.js @@ -2,7 +2,7 @@ const { spawn } = require('child_process'); const PACKAGE_MANAGER_TO_COMMAND = { npm: 'npx', - yarn1: 'yarn dlx', + yarn1: 'npx', yarn2: 'yarn dlx', pnpm: 'pnpm dlx', }; diff --git a/code/lib/cli/src/add.ts b/code/lib/cli/src/add.ts index a163e1f1e34f..71437b314b1c 100644 --- a/code/lib/cli/src/add.ts +++ b/code/lib/cli/src/add.ts @@ -91,6 +91,6 @@ export async function add( await writeConfig(main); if (!options.skipPostinstall && isStorybookAddon) { - await postinstallAddon(addonName, { packageManager: pkgMgr }); + await postinstallAddon(addonName, { packageManager: packageManager.type }); } } From f8dd2a96f8adaad94cbf688bbfd0ab42063c5eef Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Thu, 7 Sep 2023 18:35:14 +0200 Subject: [PATCH 11/13] Merge pull request #24100 from storybookjs/revert-24033-fix-angular-prerelease-sandbox Revert: Sandboxes: Use Node 18 to generate Angular prerelease sandboxes (cherry picked from commit 32e8c0bd3d28ab614707c5af2fb2d2b68ed8c8a3) --- code/lib/cli/src/sandbox-templates.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/lib/cli/src/sandbox-templates.ts b/code/lib/cli/src/sandbox-templates.ts index bbfdaef49ef6..7fb52574ea3a 100644 --- a/code/lib/cli/src/sandbox-templates.ts +++ b/code/lib/cli/src/sandbox-templates.ts @@ -285,6 +285,8 @@ const baseTemplates = { builder: '@storybook/builder-webpack5', }, skipTasks: ['e2e-tests-dev', 'bench'], + // TODO: Can be enabled once we re-revert this PR: https://github.com/storybookjs/storybook/pull/24033 + inDevelopment: true, }, 'angular-cli/default-ts': { name: 'Angular CLI (latest)', From 36d408e8538a22c300b76e26b052ac12418247c0 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Fri, 8 Sep 2023 09:01:23 +0000 Subject: [PATCH 12/13] Write changelog for 7.4.1 --- CHANGELOG.md | 10 ++++++++++ code/package.json | 3 ++- docs/versions/latest.json | 7 +------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a0baacd83b2..990f03183105 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 7.4.1 + +- CLI: Add uncaughtException handler - [#24018](https://github.com/storybookjs/storybook/pull/24018), thanks [@yannbf](https://github.com/yannbf)! +- CLI: Fix packageManager handling in `sb add` - [#24079](https://github.com/storybookjs/storybook/pull/24079), thanks [@Integrayshaun](https://github.com/Integrayshaun)! +- Core: Add CJS entrypoints to errors in core events - [#24038](https://github.com/storybookjs/storybook/pull/24038), thanks [@yannbf](https://github.com/yannbf)! +- Docs: Fix TOC import - [#24047](https://github.com/storybookjs/storybook/pull/24047), thanks [@shilman](https://github.com/shilman)! +- Telemetry: Filter addon options to protect sensitive info - [#24000](https://github.com/storybookjs/storybook/pull/24000), thanks [@shilman](https://github.com/shilman)! +- Types: Remove `@types/react` dep from `@storybook/types` - [#24042](https://github.com/storybookjs/storybook/pull/24042), thanks [@JReinhold](https://github.com/JReinhold)! +- Vue3: Remove console.log in sourceDecorator - [#24062](https://github.com/storybookjs/storybook/pull/24062), thanks [@oruman](https://github.com/oruman)! + ## 7.4.0 - Addon-docs: Resolve `mdx-react-shim` & `@storybook/global` correctly - [#23941](https://github.com/storybookjs/storybook/pull/23941), thanks [@ndelangen](https://github.com/ndelangen)! diff --git a/code/package.json b/code/package.json index 4f9fe2399e47..b77f6ca1b6e6 100644 --- a/code/package.json +++ b/code/package.json @@ -327,5 +327,6 @@ "Dependency Upgrades" ] ] - } + }, + "deferredNextVersion": "7.4.1" } diff --git a/docs/versions/latest.json b/docs/versions/latest.json index 4325d5d96acf..af61adb7efb2 100644 --- a/docs/versions/latest.json +++ b/docs/versions/latest.json @@ -1,6 +1 @@ -{ - "version": "7.4.0", - "info": { - "plain": "- Addon-docs: Resolve `mdx-react-shim` & `@storybook/global` correctly - [#23941](https://github.com/storybookjs/storybook/pull/23941), thanks [@ndelangen](https://github.com/ndelangen)!\n- Addons: Fix key is not a prop warning - [#23935](https://github.com/storybookjs/storybook/pull/23935), thanks [@kasperpeulen](https://github.com/kasperpeulen)!\n- Build: Migrate @storybook/scripts to strict-ts - [#23818](https://github.com/storybookjs/storybook/pull/23818), thanks [@stilt0n](https://github.com/stilt0n)!\n- CLI: Exclude addon-styling from upgrade - [#23841](https://github.com/storybookjs/storybook/pull/23841), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Improve autotitle stories format handling in GFM automigration - [#23964](https://github.com/storybookjs/storybook/pull/23964), thanks [@yannbf](https://github.com/yannbf)!\n- CLI: Install latest version of non-core addon - [#23956](https://github.com/storybookjs/storybook/pull/23956), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Pass package manager to postinstall - [#23913](https://github.com/storybookjs/storybook/pull/23913), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- CLI: Provide guidance for users who try to initialize Storybook on an empty dir - [#23874](https://github.com/storybookjs/storybook/pull/23874), thanks [@yannbf](https://github.com/yannbf)!\n- CLI: Set server init generator to use Webpack5 - [#23971](https://github.com/storybookjs/storybook/pull/23971), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Add error categorization framework - [#23653](https://github.com/storybookjs/storybook/pull/23653), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Fix error thrown if `docs.defaultName` is unset - [#23893](https://github.com/storybookjs/storybook/pull/23893), thanks [@stilt0n](https://github.com/stilt0n)!\n- Core: Fix indexing for non-prefixed `stories.*` stories - [#23974](https://github.com/storybookjs/storybook/pull/23974), thanks [@shilman](https://github.com/shilman)!\n- Core: Fix race-condition relating to `addons.setConfig` - [#23802](https://github.com/storybookjs/storybook/pull/23802), thanks [@ndelangen](https://github.com/ndelangen)!\n- Core: Throw an error when detecting empty stories field - [#23942](https://github.com/storybookjs/storybook/pull/23942), thanks [@yannbf](https://github.com/yannbf)!\n- Dependencies: Upgrade `escodegen` to fix security issue - [#23973](https://github.com/storybookjs/storybook/pull/23973), thanks [@shilman](https://github.com/shilman)!\n- Index: Fix `*.story.*` CSF indexing - [#23852](https://github.com/storybookjs/storybook/pull/23852), thanks [@shilman](https://github.com/shilman)!\n- Logger: Fix double error messages/stack - [#23919](https://github.com/storybookjs/storybook/pull/23919), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Categorize server errors - [#23912](https://github.com/storybookjs/storybook/pull/23912), thanks [@yannbf](https://github.com/yannbf)!\n- Maintenance: Move filtering of sidebar into the state - [#23911](https://github.com/storybookjs/storybook/pull/23911), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Remove need for `react` as peerDependency - [#23897](https://github.com/storybookjs/storybook/pull/23897), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Remove sourcemaps generation - [#23936](https://github.com/storybookjs/storybook/pull/23936), thanks [@ndelangen](https://github.com/ndelangen)!\n- Maintenance: Revert \"WebpackBuilder: Remove need for `react` as peerDependency\" - [#23882](https://github.com/storybookjs/storybook/pull/23882), thanks [@vanessayuenn](https://github.com/vanessayuenn)!\n- Manager API: Fix `api.getAddonState`default value - [#23804](https://github.com/storybookjs/storybook/pull/23804), thanks [@sookmax](https://github.com/sookmax)!\n- Preset: Add common preset overrides mechanism - [#23915](https://github.com/storybookjs/storybook/pull/23915), thanks [@yannbf](https://github.com/yannbf)!\n- Publish: Don't distribute src files or unnecessary template files - [#23853](https://github.com/storybookjs/storybook/pull/23853), thanks [@shilman](https://github.com/shilman)!\n- Shortcuts: Execute preventDefault only if keyboard shortcuts are enabled - [#23412](https://github.com/storybookjs/storybook/pull/23412), thanks [@Spielboerg](https://github.com/Spielboerg)!\n- Types: Fix `React.ReactElement` not found - [#23967](https://github.com/storybookjs/storybook/pull/23967), thanks [@abu-osos](https://github.com/abu-osos)!\n- UI: Add an experimental API for adding sidebar bottom toolbar - [#23778](https://github.com/storybookjs/storybook/pull/23778), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Add an experimental API for adding sidebar filter functions at runtime - [#23722](https://github.com/storybookjs/storybook/pull/23722), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Add an experimental API for adding sidebar top toolbar - [#23811](https://github.com/storybookjs/storybook/pull/23811), thanks [@ndelangen](https://github.com/ndelangen)!\n- UI: Removal of experimental components - [#23907](https://github.com/storybookjs/storybook/pull/23907), thanks [@ndelangen](https://github.com/ndelangen)!\n- Vue3: Add support for Global Apps install - [#23772](https://github.com/storybookjs/storybook/pull/23772), thanks [@chakAs3](https://github.com/chakAs3)!\n- Vue3: Use slot value directly if it's a string in source decorator - [#23784](https://github.com/storybookjs/storybook/pull/23784), thanks [@nasvillanueva](https://github.com/nasvillanueva)!" - } -} +{"version":"7.4.1","info":{"plain":"- CLI: Add uncaughtException handler - [#24018](https://github.com/storybookjs/storybook/pull/24018), thanks [@yannbf](https://github.com/yannbf)!\n- CLI: Fix packageManager handling in `sb add` - [#24079](https://github.com/storybookjs/storybook/pull/24079), thanks [@Integrayshaun](https://github.com/Integrayshaun)!\n- Core: Add CJS entrypoints to errors in core events - [#24038](https://github.com/storybookjs/storybook/pull/24038), thanks [@yannbf](https://github.com/yannbf)!\n- Docs: Fix TOC import - [#24047](https://github.com/storybookjs/storybook/pull/24047), thanks [@shilman](https://github.com/shilman)!\n- Telemetry: Filter addon options to protect sensitive info - [#24000](https://github.com/storybookjs/storybook/pull/24000), thanks [@shilman](https://github.com/shilman)!\n- Types: Remove `@types/react` dep from `@storybook/types` - [#24042](https://github.com/storybookjs/storybook/pull/24042), thanks [@JReinhold](https://github.com/JReinhold)!\n- Vue3: Remove console.log in sourceDecorator - [#24062](https://github.com/storybookjs/storybook/pull/24062), thanks [@oruman](https://github.com/oruman)!"}} From fe201ea08834908477bbe8140e1aa5f4dd3f3087 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Fri, 8 Sep 2023 11:04:30 +0200 Subject: [PATCH 13/13] Fix parallelism --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5e7cc4a22d24..617cdac42c28 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -609,22 +609,22 @@ workflows: requires: - build - create-sandboxes: - parallelism: 35 + parallelism: 34 requires: - build # - smoke-test-sandboxes: # disabled for now # requires: # - create-sandboxes - build-sandboxes: - parallelism: 35 + parallelism: 34 requires: - create-sandboxes - chromatic-sandboxes: - parallelism: 32 + parallelism: 31 requires: - build-sandboxes - e2e-production: - parallelism: 32 + parallelism: 31 requires: - build-sandboxes - e2e-dev: @@ -632,7 +632,7 @@ workflows: requires: - create-sandboxes - test-runner-production: - parallelism: 32 + parallelism: 31 requires: - build-sandboxes # TODO: reenable once we find out the source of flakyness