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

[docs-infra] Allow developers to build their CodeSandbox export #40878

Merged
merged 3 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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 @@ const 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
Loading