Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Fix sandbox generation scripts #22620

Merged
merged 6 commits into from
May 18, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions code/lib/cli/src/sandbox-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ const baseTemplates = {
'html-vite/default-js': {
name: 'HTML Vite JS',
script:
'npm create vite@latest --yes . -- --template vanilla && echo "export default {}" > vite.config.js',
'npm create vite@latest --yes . -- --template vanilla && cd {{beforeDir}} && echo "export default {}" > vite.config.js',
expected: {
framework: '@storybook/html-vite',
renderer: '@storybook/html',
Expand All @@ -237,7 +237,7 @@ const baseTemplates = {
'html-vite/default-ts': {
name: 'HTML Vite TS',
script:
'npm create vite@latest --yes . -- --template vanilla-ts && echo "export default {}" > vite.config.js',
'npm create vite@latest --yes . -- --template vanilla-ts && cd {{beforeDir}} && echo "export default {}" > vite.config.js',
expected: {
framework: '@storybook/html-vite',
renderer: '@storybook/html',
Expand Down Expand Up @@ -324,7 +324,7 @@ const baseTemplates = {
'lit-vite/default-js': {
name: 'Lit Vite (JS)',
script:
'npm create vite@latest --yes . -- --template lit && echo "export default {}" > vite.config.js',
'npm create vite@latest --yes . -- --template lit && cd {{beforeDir}} && echo "export default {}" > vite.config.js',
expected: {
framework: '@storybook/web-components-vite',
renderer: '@storybook/web-components',
Expand All @@ -336,7 +336,7 @@ const baseTemplates = {
'lit-vite/default-ts': {
name: 'Lit Vite (TS)',
script:
'npm create vite@latest --yes . -- --template lit-ts && echo "export default {}" > vite.config.js',
'npm create vite@latest --yes . -- --template lit-ts && cd {{beforeDir}} && echo "export default {}" > vite.config.js',
expected: {
framework: '@storybook/web-components-vite',
renderer: '@storybook/web-components',
Expand All @@ -348,7 +348,7 @@ const baseTemplates = {
'vue-cli/default-js': {
name: 'Vue-CLI (Default JS)',
script:
'npx -p @vue/cli vue create . --default --packageManager=yarn --force --merge && echo "module.exports = {}" > webpack.config.js',
'npx -p @vue/cli vue create . --default --packageManager=yarn --force --merge && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js',
expected: {
framework: '@storybook/vue3-webpack5',
renderer: '@storybook/vue3',
Expand All @@ -360,7 +360,7 @@ const baseTemplates = {
'vue-cli/vue2-default-js': {
name: 'Vue-CLI (Vue2 JS)',
script:
'npx -p @vue/cli vue create . --default --packageManager=yarn --force --merge --preset="Default (Vue 2)" && echo "module.exports = {}" > webpack.config.js',
'npx -p @vue/cli vue create . --default --packageManager=yarn --force --merge --preset="Default (Vue 2)" && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these vite commands were not using {{beforeDir}} but rather . so it worked without this change. I think it's better to use {{beforeDir}} so can you change the . to {{beforeDir}} and test it if all works well?

expected: {
framework: '@storybook/vue-webpack5',
renderer: '@storybook/vue',
Expand All @@ -372,7 +372,7 @@ const baseTemplates = {
'preact-webpack5/default-js': {
name: 'Preact CLI (Default JS)',
script:
'npx preact-cli create default {{beforeDir}} --name preact-app --yarn --no-install && echo "module.exports = {}" > webpack.config.js',
'npx preact-cli create default {{beforeDir}} --name preact-app --yarn --no-install && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js',
expected: {
framework: '@storybook/preact-webpack5',
renderer: '@storybook/preact',
Expand All @@ -383,7 +383,7 @@ const baseTemplates = {
'preact-webpack5/default-ts': {
name: 'Preact CLI (Default TS)',
script:
'npx preact-cli create typescript {{beforeDir}} --name preact-app --yarn --no-install && echo "module.exports = {}" > webpack.config.js',
'npx preact-cli create typescript {{beforeDir}} --name preact-app --yarn --no-install && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js',
expected: {
framework: '@storybook/preact-webpack5',
renderer: '@storybook/preact',
Expand Down