-
Notifications
You must be signed in to change notification settings - Fork 26.2k
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
CI=true create-next-app --ts
sets up project using JS instead of TS
#42592
Labels
create-next-app
Related to our CLI tool for quickly starting a new Next.js application.
Comments
tmadeira
referenced
this issue
Nov 7, 2022
…esting (#42012) Resubmitting this PR following this comment from Tim. This work has been done already and we can build off of it to get this in faster. > Just to be clear we're planning to rework create-next-app to give you the option to choose between JavaScript or TypeScript so it'll solve this request. For `app` right now it'll stay TypeScript till that is implemented. > > _Originally posted by @timneutkens in #41745 (reply in thread) --- I added the `--ts, --typescript` flag to `create-next-app` in #24655, and since then I have seen it used very frequently, including in recent issues (such as #33314) and most Next.js tutorials on YouTube. I noticed the template logic added in this PR was also used to add the `appDir` configuration as well. We discussed a while ago adding the following user flow: - `create-next-app --js, --javascript` creates a JS project - `create-next-app --ts, --typescript` creates a TS project - `create-next-app [name]` (no `--js, --ts`) prompts the user to choose either JS or TS, with TS selected by default. ### Review Adding support for appDir and refactoring the templates brought the pain-of-review up a bit, but it's not so bad when broken into increments. The original 8-file diff is here: ctjlewis@1f47d9b And the PR that brought the diff up to 59 files (mostly owed to `app` template dirs and file structure refactors): ctjlewis@bd3ae4a ([PR link](https://github.com/ctjlewis/next.js/pull/3/files)) ### Demo https://user-images.githubusercontent.com/1657236/198586216-4691ff4c-48d4-4c6c-b7c1-705c38dd0194.mov Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
tmadeira
changed the title
Nov 7, 2022
CI=true create-next-app --ts foo
sets up project using JS instead of TSCI=true create-next-app --ts
sets up project using JS instead of TS
balazsorban44
added
create-next-app
Related to our CLI tool for quickly starting a new Next.js application.
kind: bug
and removed
bug
Issue was opened via the bug report template.
labels
Nov 7, 2022
3 tasks
ijjk
added a commit
that referenced
this issue
Nov 7, 2022
Fixes: #42592 ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md`
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
Using
npx create-next-app@latest --ts my-app
does not work in continuous integration environments (i.e., if CI env var is set). The CLI simply ignores the--ts
flag (https://github.com/vercel/next.js/blob/canary/packages/create-next-app/index.ts#L160).Expected Behavior
Project should be bootstraped with TypeScript.
(It's okay to default to JavaScript to not break existing CI expecting JS, but if the command line argument
--ts
is given explicitly then create-next-app should install TypeScript packages and use TypeScript.)Link to reproduction
CI=true npx create-next-app@latest --ts my-app
To Reproduce
CI=true npx create-next-app@latest --ts my-app
The text was updated successfully, but these errors were encountered: