Skip to content

Commit

Permalink
Merge pull request #25199 from storybookjs/norbert/add-internalreact1…
Browse files Browse the repository at this point in the history
…6-sandbox

Build: Add sandbox for react-16
  • Loading branch information
yannbf authored Dec 18, 2023
2 parents 9cd9f65 + d9dca67 commit 405dfee
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -706,30 +706,30 @@ workflows:
requires:
- build
- create-sandboxes:
parallelism: 31
parallelism: 32
requires:
- build
# - smoke-test-sandboxes: # disabled for now
# requires:
# - create-sandboxes
- build-sandboxes:
parallelism: 31
parallelism: 32
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 28
parallelism: 29
requires:
- build-sandboxes
- e2e-production:
parallelism: 26
parallelism: 27
requires:
- build-sandboxes
- e2e-dev:
parallelism: 2
requires:
- create-sandboxes
- test-runner-production:
parallelism: 26
parallelism: 27
requires:
- build-sandboxes

Expand Down
13 changes: 13 additions & 0 deletions code/lib/cli/src/sandbox-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,18 @@ const internalTemplates = {
},
skipTasks: ['bench'],
},
'internal/react16-webpack': {
name: 'React 16 (Webpack | TypeScript)',
script:
'yarn create webpack5-react {{beforeDir}} --version-react=16 --version-react-dom=16 --version-@types/react=16 --version-@types/react-dom=16',
expected: {
framework: '@storybook/react-webpack5',
renderer: '@storybook/react',
builder: '@storybook/builder-webpack5',
},
skipTasks: ['e2e-tests-dev', 'bench'],
isInternal: true,
},
'internal/server-webpack5': {
name: 'Server Webpack5',
script: 'yarn init -y && echo "module.exports = {}" > webpack.config.js',
Expand Down Expand Up @@ -617,6 +629,7 @@ export const daily: TemplateKey[] = [
'qwik-vite/default-ts',
'preact-vite/default-js',
'html-vite/default-js',
'internal/react16-webpack',
];

export const templatesByCadence = { normal, merged, daily };
15 changes: 14 additions & 1 deletion scripts/get-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async function checkParallelism(cadence?: Cadence, scriptName?: TaskKey) {
let isIncorrect = false;

cadences.forEach((cad) => {
summary.push(`\n${cad}`);
summary.push(`\n${chalk.bold(cad)}`);
const cadenceTemplates = Object.entries(allTemplates).filter(([key]) =>
templatesByCadence[cad].includes(key as TemplateKey)
);
Expand All @@ -110,6 +110,7 @@ async function checkParallelism(cadence?: Cadence, scriptName?: TaskKey) {
scripts.forEach((script) => {
const templateKeysPerScript = potentialTemplateKeys.filter((t) => {
const currentTemplate = allTemplates[t] as Template;

return (
currentTemplate.inDevelopment !== true &&
!currentTemplate.skipTasks?.includes(script as SkippableTask)
Expand Down Expand Up @@ -153,6 +154,18 @@ async function checkParallelism(cadence?: Cadence, scriptName?: TaskKey) {
summary.unshift('✅ The parallelism count is correct for all jobs in .circleci/config.yml:');
console.log(summary.concat('\n').join('\n'));
}

const inDevelopmentTemplates = Object.entries(allTemplates)
.filter(([_, t]) => t.inDevelopment)
.map(([k]) => k);

if (inDevelopmentTemplates.length > 0) {
console.log(
`👇 Some templates were skipped as they are flagged to be in development. Please review if they should still contain this flag:\n${inDevelopmentTemplates
.map((k) => `- ${k}`)
.join('\n')}`
);
}
}

type RunOptions = { cadence?: Cadence; task?: TaskKey; check: boolean };
Expand Down

0 comments on commit 405dfee

Please sign in to comment.