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

feat(create-docusaurus): ask user for preferred language when no language CLI option provided #9442

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
3 changes: 2 additions & 1 deletion admin/scripts/generateExamples.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ async function generateTemplateExample(template) {
// Run the docusaurus script to create the template in the examples folder
const command = template.endsWith('-typescript')
? template.replace('-typescript', ' -- --typescript')
: template;
: `${template} -- --javascript`;

shell.exec(
// We use the published init script on purpose, because the local init is
// too new and could generate upcoming/unavailable config options.
Expand Down
2 changes: 1 addition & 1 deletion admin/scripts/test-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ git diff --name-only -- '*.json' | sed 's, ,\\&,g' | xargs git checkout --
cd ..

# Build skeleton website with new version
npm_config_registry="$CUSTOM_REGISTRY_URL" npx create-docusaurus@"$NEW_VERSION" test-website classic $EXTRA_OPTS
npm_config_registry="$CUSTOM_REGISTRY_URL" npx create-docusaurus@"$NEW_VERSION" test-website classic --javascript $EXTRA_OPTS

# Stop Docker container
if [[ -z "${KEEP_CONTAINER:-true}" ]] && ( $(docker container inspect "$CONTAINER_NAME" > /dev/null 2>&1) ); then
Expand Down
4 changes: 2 additions & 2 deletions packages/create-docusaurus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For Docusaurus maintainers, templates can be tested with:
```bash
cd `git rev-parse --show-toplevel` # Back to repo root
rm -rf test-website
yarn create-docusaurus test-website classic
yarn create-docusaurus test-website classic --javascript
cd test-website
yarn start
```
Expand All @@ -37,7 +37,7 @@ Use the following to test the templates against local packages:
```bash
cd `git rev-parse --show-toplevel` # Back to repo root
rm -rf test-website-in-workspace
yarn create-docusaurus test-website-in-workspace classic
yarn create-docusaurus test-website-in-workspace classic --javascript
cd test-website-in-workspace
yarn build
yarn start
Expand Down
1 change: 1 addition & 0 deletions packages/create-docusaurus/bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ program
'Do not run package manager immediately after scaffolding',
)
.option('-t, --typescript', 'Use the TypeScript template variant')
.option('-j, --javascript', 'Use the JavaScript template variant')
.option(
'-g, --git-strategy <strategy>',
`Only used if the template is a git repository.
Expand Down
Loading
Loading