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(swizzle): ask user preferred language if no language CLI option provided #9681

Merged
merged 6 commits into from
Feb 15, 2024

Conversation

yixiaojiu
Copy link
Contributor

@yixiaojiu yixiaojiu commented Dec 29, 2023

Pre-flight checklist

Motivation

Following the issue #9402, I created a prompt that just shows up when neither --javascript or --typescript is passed

fix #9402

Usage screenshot

image

Related issues/PRs

#9402

@yixiaojiu yixiaojiu requested a review from slorber as a code owner December 29, 2023 03:26
@facebook-github-bot
Copy link
Contributor

Hi @yixiaojiu!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Copy link

netlify bot commented Dec 29, 2023

[V2]

Name Link
🔨 Latest commit 5a74613
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/65ce0da5969ce80008c34e99
😎 Deploy Preview https://deploy-preview-9681--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Dec 29, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 67 🟢 98 🟢 96 🟢 100 🟠 88 Report
/docs/installation 🟠 89 🟢 96 🟢 100 🟢 100 🟠 88 Report
/docs/category/getting-started 🟠 75 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog 🟠 70 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 65 🟢 96 🟢 100 🟢 100 🟠 88 Report
/blog/tags/release 🟠 71 🟢 100 🟢 100 🟠 80 🟠 88 Report
/blog/tags 🟠 76 🟢 100 🟢 100 🟢 90 🟠 88 Report

@yixiaojiu yixiaojiu requested a review from Josh-Cena as a code owner February 15, 2024 12:06
@slorber slorber added pr: new feature This PR adds a new API or behavior. to backport This PR is planned to be backported to a stable version of Docusaurus labels Feb 15, 2024
@slorber slorber changed the title feat(swizzle): added a language prompt when no flag is provided feat(swizzle): ask user preferred language if no language CLI option provided Feb 15, 2024
@slorber
Copy link
Collaborator

slorber commented Feb 15, 2024

Thanks, LGTM 👍

This will be in v3.2

I refactored a bit, deduplicating the prompting util extracted in #9442

Also:

  • asking for language after choosing theme
  • do not prompt if theme only supports JS
  • throw if theme only supports JS and user provides --typescript option

Fail-fast if user uses --typescript option with a theme that does not support TS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior. to backport This PR is planned to be backported to a stable version of Docusaurus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The swizzle CLI should prompt for TS usage
3 participants