diff --git a/code/lib/cli/src/sandbox-templates.ts b/code/lib/cli/src/sandbox-templates.ts index 9ca026b4c8d0..30773df41ea6 100644 --- a/code/lib/cli/src/sandbox-templates.ts +++ b/code/lib/cli/src/sandbox-templates.ts @@ -95,7 +95,10 @@ type BaseTemplates = Template & { const baseTemplates = { 'cra/default-js': { name: 'Create React App Latest (Webpack | JavaScript)', - script: 'npx create-react-app {{beforeDir}}', + script: ` + npx create-react-app {{beforeDir}} && cd {{beforeDir}} && \ + jq '.browserslist.production[0] = ">0.9%"' package.json > tmp.json && mv tmp.json package.json + `, expected: { // TODO: change this to @storybook/cra once that package is created framework: '@storybook/react-webpack5', @@ -120,7 +123,10 @@ const baseTemplates = { }, 'cra/default-ts': { name: 'Create React App Latest (Webpack | TypeScript)', - script: 'npx create-react-app {{beforeDir}} --template typescript', + script: ` + npx create-react-app {{beforeDir}} --template typescript && cd {{beforeDir}} && \ + jq '.browserslist.production[0] = ">0.9%"' package.json > tmp.json && mv tmp.json package.json + `, // Re-enable once https://github.com/storybookjs/storybook/issues/19351 is fixed. skipTasks: ['smoke-test', 'bench'], expected: { diff --git a/scripts/sandbox/generate.ts b/scripts/sandbox/generate.ts index b95093062601..22c50716cc81 100755 --- a/scripts/sandbox/generate.ts +++ b/scripts/sandbox/generate.ts @@ -38,7 +38,7 @@ const sbInit = async ( flags?: string[], debug?: boolean ) => { - const sbCliBinaryPath = join(__dirname, `../../code/lib/cli/bin/index.js`); + const sbCliBinaryPath = join(__dirname, `../../code/lib/cli/bin/index.cjs`); console.log(`🎁 Installing storybook`); const env = { STORYBOOK_DISABLE_TELEMETRY: 'true', ...envVars }; const fullFlags = ['--yes', ...(flags || [])];