Skip to content

Commit

Permalink
[docs-infra] Allow developers to build their CodeSandbox export (mui#…
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored and mostafa-rio committed Feb 3, 2024
1 parent 9250870 commit 0f68884
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
9 changes: 9 additions & 0 deletions docs/src/modules/sandbox/CodeSandbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ describe('CodeSandbox', () => {
devDependencies: {
'react-scripts': 'latest',
},
scripts: {
start: 'react-scripts start',
build: 'react-scripts build',
test: 'react-scripts test',
eject: 'react-scripts eject',
},
},
},
'public/index.html': {
Expand Down Expand Up @@ -130,7 +136,10 @@ ReactDOM.createRoot(document.querySelector("#root")).render(
},
main: 'index.tsx',
scripts: {
build: 'react-scripts build',
eject: 'react-scripts eject',
start: 'react-scripts start',
test: 'react-scripts test',
},
},
},
Expand Down
18 changes: 12 additions & 6 deletions docs/src/modules/sandbox/CodeSandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,14 @@ function createReactApp(demoData: DemoData) {
description,
dependencies,
devDependencies,
scripts: {
start: 'react-scripts start',
build: 'react-scripts build',
test: 'react-scripts test',
eject: 'react-scripts eject',
},
...(demoData.codeVariant === 'TS' && {
main: 'index.tsx',
scripts: {
start: 'react-scripts start',
},
}),
},
};
Expand Down Expand Up @@ -155,11 +158,14 @@ ReactDOM.createRoot(document.querySelector("#root")${type}).render(
description,
dependencies,
devDependencies,
scripts: {
start: 'react-scripts start',
build: 'react-scripts build',
test: 'react-scripts test',
eject: 'react-scripts eject',
},
...(templateData.codeVariant === 'TS' && {
main: 'index.tsx',
scripts: {
start: 'react-scripts start',
},
}),
},
};
Expand Down

0 comments on commit 0f68884

Please sign in to comment.