From bf63829a5e374a0b734a50d5e13035676685df78 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Mon, 18 Sep 2023 12:46:49 +0200 Subject: [PATCH 1/6] Merge pull request #24206 from storybookjs/norbert/improve-type-of-statusupdate Types: Allow `null` in value of `experimental_updateStatus` to clear status (cherry picked from commit 2bf4dc506aa3cefce0cbdde3e8306125297ae700) --- code/lib/types/src/modules/api-stories.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/types/src/modules/api-stories.ts b/code/lib/types/src/modules/api-stories.ts index 45acc19e35c7..b6c150242a2a 100644 --- a/code/lib/types/src/modules/api-stories.ts +++ b/code/lib/types/src/modules/api-stories.ts @@ -183,7 +183,7 @@ export interface API_StatusObject { } export type API_StatusState = Record>; -export type API_StatusUpdate = Record; +export type API_StatusUpdate = Record; export type API_FilterFunction = ( item: API_PreparedIndexEntry & { status: Record } From b38266079f3fe36063607e7a12fb4e645d94e13c Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 19 Sep 2023 08:36:18 +0200 Subject: [PATCH 2/6] Merge pull request #24208 from storybookjs/norbert/filter-angular-prerelease Build: Filter `angular-cli/prerelease` in sandbox generation (cherry picked from commit f49c9a24128110d9df272a153901e72564dbec75) --- .github/workflows/generate-sandboxes-main.yml | 2 +- .github/workflows/generate-sandboxes-next.yml | 2 +- code/lib/cli/src/sandbox-templates.ts | 5 ++-- scripts/sandbox/generate.ts | 28 +++++++++++++------ scripts/tasks/generate.ts | 3 +- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/.github/workflows/generate-sandboxes-main.yml b/.github/workflows/generate-sandboxes-main.yml index 66cd1b800d37..474542495848 100644 --- a/.github/workflows/generate-sandboxes-main.yml +++ b/.github/workflows/generate-sandboxes-main.yml @@ -43,7 +43,7 @@ jobs: run: yarn wait-on http://localhost:6001 working-directory: ./code - name: Generate - run: yarn generate-sandboxes --local-registry + run: yarn generate-sandboxes --local-registry --exclude=angular-cli/prerelease working-directory: ./code - name: Publish run: yarn publish-sandboxes --remote=https://storybook-bot:${{ secrets.PAT_STORYBOOK_BOT}}@github.com/storybookjs/sandboxes.git --push --branch=main diff --git a/.github/workflows/generate-sandboxes-next.yml b/.github/workflows/generate-sandboxes-next.yml index f22e7cb4a50b..f6ab2f7c822f 100644 --- a/.github/workflows/generate-sandboxes-next.yml +++ b/.github/workflows/generate-sandboxes-next.yml @@ -43,7 +43,7 @@ jobs: run: yarn wait-on http://localhost:6001 working-directory: ./code - name: Generate - run: yarn generate-sandboxes --local-registry + run: yarn generate-sandboxes --local-registry --exclude=angular-cli/prerelease working-directory: ./code - name: Publish run: yarn publish-sandboxes --remote=https://storybook-bot:${{ secrets.PAT_STORYBOOK_BOT}}@github.com/storybookjs/sandboxes.git --push --branch=next diff --git a/code/lib/cli/src/sandbox-templates.ts b/code/lib/cli/src/sandbox-templates.ts index 7fb52574ea3a..b2c4e3b6b17c 100644 --- a/code/lib/cli/src/sandbox-templates.ts +++ b/code/lib/cli/src/sandbox-templates.ts @@ -285,7 +285,7 @@ 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 + // TODO: Should be removed after we merge this PR: https://github.com/storybookjs/storybook/pull/24188 inDevelopment: true, }, 'angular-cli/default-ts': { @@ -575,7 +575,8 @@ export const merged: TemplateKey[] = [ ]; export const daily: TemplateKey[] = [ ...merged, - 'angular-cli/prerelease', + // TODO: Should be re-added after we merge this PR: https://github.com/storybookjs/storybook/pull/24188 + // 'angular-cli/prerelease', 'cra/default-js', 'react-vite/default-js', 'vue3-vite/default-js', diff --git a/scripts/sandbox/generate.ts b/scripts/sandbox/generate.ts index b74ae5a28d03..0e477b1a6220 100755 --- a/scripts/sandbox/generate.ts +++ b/scripts/sandbox/generate.ts @@ -202,11 +202,16 @@ const runGenerators = async ( }; export const options = createOptions({ - template: { - type: 'string', - description: 'Which template would you like to create?', + templates: { + type: 'string[]', + description: 'Which templates would you like to create?', values: Object.keys(sandboxTemplates), }, + exclude: { + type: 'string[]', + description: 'Space-delimited list of templates to exclude. Takes precedence over --templates', + promptType: false, + }, localRegistry: { type: 'boolean', description: 'Generate reproduction from local registry?', @@ -220,7 +225,8 @@ export const options = createOptions({ }); export const generate = async ({ - template, + templates, + exclude, localRegistry, debug, }: OptionValues) => { @@ -230,11 +236,11 @@ export const generate = async ({ ...configuration, })) .filter(({ dirName }) => { - if (template) { - return dirName === template; + let include = Array.isArray(templates) ? templates.includes(dirName) : true; + if (Array.isArray(exclude) && include) { + include = !exclude.includes(dirName); } - - return true; + return include; }); await runGenerators(generatorConfigs, localRegistry, debug); @@ -243,7 +249,11 @@ export const generate = async ({ if (require.main === module) { program .description('Generate sandboxes from a set of possible templates') - .option('--template