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 b91296c5025f..69e858f1d14f 100644 --- a/code/lib/cli/src/sandbox-templates.ts +++ b/code/lib/cli/src/sandbox-templates.ts @@ -296,7 +296,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': { @@ -586,7 +586,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