* Merge multiple log statements
It is inefficient to use multiple console.log satements, and if something is logged to the console in the middle of execution, it will be in the center of the text, making it hard to read.
This pull request merges multiple console.logs into one.
In addition, it reduces the bundle size.
* ensure formatting matches
* update test
Co-authored-by: JJ Kasper <jj@jjsweb.site>
This fixes our package manager detection which was changed slightly in https://github.com/vercel/next.js/pull/34947 for `pnpm` support to ensure the default case still attempts detecting the available package manager if no preference is specified in the command args. This also adds a test case to ensure the install succeeds when we fail to detect a valid `yarn` binary and no preference is set via the `npm_config_user_agent` env variable.
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
Fixes: https://github.com/vercel/next.js/issues/35607
Fixes: https://github.com/vercel/next.js/issues/35599
* feat: support `pnpm` with `create-next-app`
* test: add `--use-pnpm` tests
* docs: mention `--use-pnpm` flag in docs
* test: remove `only`
* Update test/integration/create-next-app/index.test.ts
Co-authored-by: Steven <steven@ceriously.com>
* chore: add pnpm action setup to tests
* chore: use latest pnpm
* chore: debug
* chore: debug
* fix: fall back to `yarn` instead of `npm`
* test: run all tests
Co-authored-by: Steven <steven@ceriously.com>
Add description for `--use-npm` flag that shows up as part of the help information.
## Bug
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
## Feature
- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
## Documentation / Examples
- [ ] Make sure the linting passes
If a user does not specify `--example` when using create-next-app then just spin up the default template and only prompt them for the name of their project.
if a user does specify `--example` (with no string after it) then show them the example picker.
Closes#13960
Was going through _document and noticed some variable shadowing going on. Added a rule for it to our eslint configuration and went through all warnings with @Timer.
fix#12136
I add a prompt if there is an error when trying to download example files.
Maybe could be better to add an error class and in create-app.ts on every "console.error" trow a new Exception and manage it in catch. What you think ? 👯
This addresses #11910 in which `-e default` was not working because there was no example with the name `default`. This PR checks if a user inputted `default` as the example argument for `create-next-app` and if so it will use the local `default` template in the create-next-app directory.
Closes#11910
* Confirm if user wants example when creating app
* Only ask user to choose example if they provide --example flag
* Simplify the search
* Added test
* Use a select to pick the template
* Updated test
* check for lowercase and updated no example message
* Add message if no template is selected
* Updated tests
* Handle error if fetching the examples fails
* Fixed tests
* Updated test timeout
* Update examples.ts
Co-authored-by: merelinguist <merelinguist@users.noreply.github.com>
Co-authored-by: Luis Alvarez <luis@zeit.co>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
* Completely rewrite Create Next App
* Sort imports
* Show what package manager is being used
* Fix project name suggestion
* Update tests for new implementation
* Use normal prepublish command for on-install
* Upgrade Node version
* Switch to 8.16
* Disable v8 cache
* Swap out update check package and fix CLI boot