Commit graph

69 commits

Author SHA1 Message Date
Steven
4466ba436b
chore(examples): use default prettier for examples/templates (#60530)
## Description
This PR ensures that the default prettier config is used for examples
and templates.

This config is compatible with `prettier@3` as well (upgrading prettier
is bigger change that can be a future PR).

## Changes
- Updated `.prettierrc.json` in root with `"trailingComma": "es5"` (will
be needed upgrading to prettier@3)
- Added `examples/.prettierrc.json` with default config (this will
change every example)
- Added `packages/create-next-app/templates/.prettierrc.json` with
default config (this will change every template)

## Related

- Fixes #54402
- Closes #54409
2024-01-11 16:01:44 -07:00
Takashi Sato
e6e6609674
Remove unused target: es5 from tsconfig.json in create-next-app (#60521)
fixes #58640

When there is no tsconfig.json, `npm run dev` generates `tsconfig.json`,
which has no `target` option.
But create-next-app generates `tsconfig.json` with `"target": "es5"`

Related to: #44567
Related to: #14390
2024-01-11 14:35:17 +00:00
JJ Kasper
b16187213e
Use next.config.mjs for CNA templates (#60494)
As `.mjs` support for `next.config` is stable now we can swap our
default to use it instead.

Closes NEXT-2052
2024-01-10 14:04:57 -08:00
leung018
66597be8a7
Add .yarn/install-state.gz to .gitignore (#56637)
### Reason for making this change
https://yarnpkg.com/getting-started/qa#:~:text=yarn%2Finstall%2Dstate.,your%20workspaces%20all%20over%20again.
In the official documentation of `yarn`, it is stated that `.yarn/install-state.gz` is an optimization file that developer shouldn't ever have to commit. However, currently, when running `create-next-app`, `.yarn/install-state.gz` is being commited.

### Remaining work
I apologize for only modifying one template initially to initiate the discussion first.

If this change is agreed upon,  it should be synchronized with other `.gitignore` templates. Would it be possible to follow a similar approach as in https://github.com/vercel/next.js/pull/47241? I would appreciate any assistance in syncing this change.
2023-10-18 16:34:48 +00:00
Hamir Mahal
9288ef4921
feat: add self-documenting .env.example file (#56469)
- fixes #56468

Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2023-10-12 21:55:14 +00:00
Jake Boone
3cd4b975c3
create-next-app templates: Change bun run dev commands to bun dev (#55603)
[As of Bun v1.0.0](https://bun.sh/blog/bun-v1.0#changelog-since-v0-8), `bun dev` runs the "dev" script from package.json. Therefore, as with Yarn and pnpm, the "run" command is not necessary.

This PR changes the `create-next-app` README templates to show `bun dev` instead of `bun run dev`.
2023-09-19 19:04:33 +00:00
YOSHIKI
7db5c64e94
docs: add bun run dev command to template readme for create-next-app (#55504)
## For Contributors

### Improving Documentation

- [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR.
- [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide

### What?
add bun run dev command to template readme for create-next-app
2023-09-18 18:18:58 +00:00
stefanprobst
42227559c6
fix: don't add forceConsistentCasingInFileNames to tsconfig when ts version >= 5.0 (#51564)
Currently, Next.js enforces that `forceConsistentCasingInFileNames: true` is added to a user's `tsconfig.json`.

This PR removes that behavior for CNA templates, and when the typescript version is >= 5.0.0, because since ts 5.0 `forceConsistentCasingInFileNames` is `true` by default. See https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/

related: https://github.com/vercel/next.js/issues/45617
2023-08-15 19:12:40 +00:00
Grace Yun
6c3560dbbd
[create-next-app] fix template css for top / bottom alignment (#53227)
Fixes a small CSS regression with the `create-next-app` template(s). Especially evident with templates using Tailwind CSS.

Before:
<img width="1047" alt="image" src="https://github.com/vercel/next.js/assets/74513600/9d3e8ef4-52b9-4590-be26-ee91f4bd65dd">

After:
![image](https://github.com/vercel/next.js/assets/74513600/952ca166-59df-40d1-bb6d-cb2fbc592c3b)
2023-07-26 20:41:08 +00:00
Facundo Giuliani
a26bac9604
Update default moduleResolution in tsconfig.json from node to bundler (#51957)
This updates our `moduleResolution` to `bundler` as this matches our heuristics much more closely so is more accurate. This shouldn't be a breaking change is it should be compatible with our previous default. 

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-07-18 15:11:09 +00:00
JJ Kasper
9c5d0448ee
Update font handling in CNA templates (#48364)
We don't need to apply the font className to individual usage and can
just apply it to the the top element for easier usage.

x-ref: [slack
thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1681343520829629)
2023-04-13 17:25:24 -07:00
Karl Horky
3ad55721d1
Remove incorrect entries for pnpm debug log (#47241)
**Reasons for making this change:**

- it is contained within `node_modules/`, which is already ignored
- the previous versions, which were not in `node_modules/`, did not have
a period at the beginning of the filename

Links to documentation supporting these rule changes:

**Changelog with proof here:**


ba4b2db1f2/pnpm/CHANGELOG.md (L3330)

History:

- my PR to remove this from `github/gitignore` here:
https://github.com/github/gitignore/pull/4250
- First introduced in `github/gitignore` in
https://github.com/github/gitignore/pull/3732 by `@sakurayang` (merged
by `@martinwoodward`)

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-03-26 22:26:05 -07:00
Balázs Orbán
2a8961b36b
fix(cli): unify styles/content of templates (#47294)
### What?

- fixes some typos
  - [x] getting started by editing "filename"
  - [x] match app/pages content
  - [x] fix utm params 
- [x] Reverted different text coloring in the CLI as they were hard to
read on a dark background
- [x] removes 13 ([Slack
thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1679151687968809?thread_ts=1679123593.519319&cid=C03KAR5DCKC))


### Why?

Unifying the styles across all templates

### How?

Used
https://github.com/vercel/next.js/tree/canary/packages/create-next-app/templates/default/js
as the base and made sure that all other templates match its content and
styling.

Related: #46927. This PR was extracted from #47238 to make reviewing
easier.

fix NEXT-851 ([link](https://linear.app/vercel/issue/NEXT-851))

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-03-20 15:33:44 -07:00
Tom Ballinger
474b115e6d
Remove baseUrl from create-next-app ts/jsconfig.json (#46458)
Fixes #46288

Makes TypeScript behavior match runtime by no longer allowing files to
be imported absolutely relative to project root without using a relative
path or a path alias. This changes behavior introduced in
https://github.com/vercel/next.js/pull/44672 which also added the paths
alias `@/*: ["./*"]`, which works without a baseUrl.

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
2023-02-27 12:16:04 -08:00
Hannes Bornö
9b2e3c5ec7
Use next/font in create-next-app (#45897)
Rmove `@next/font` package and use `next/font` in create-next-app.

Fixes NEXT-484

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## 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`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-20 16:42:18 +01:00
JJ Kasper
893328905f
Update prompts for CNA and add default @/* alias (#44672)
This adds prompts for using a `src/` directory and experimental `app/`
directory with create-next-app. Also adds `jsconfig` and `tsconfig`
options to alias `@/*` by default.

x-ref: [slack
thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1672856097701429)


## 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`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
2023-01-09 15:41:12 -08:00
Junya Kono
554d061326
docs: add pnpm to template readme (#44427)
Add pnpm command to execute npm script



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## 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`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-12-30 22:14:25 +00:00
Grace Yun
43c9d8940d
Wrap CSS variable in var (#44153)
Adds missing CSS var() wrapper + spelling error, caught in [Discussion
#9094](https://github.com/vercel/vercel/discussions/9094).

Closes: #44126
Closes: https://github.com/vercel/next.js/pull/44127 

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## 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`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-12-19 12:05:46 -08:00
Grace Yun
68d06fe015
Update README templates to include snippet on next/font (#44088)
Updates the README templates for `create-next-app` to include
information on the addition of the `next/font` library.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## 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`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-12-19 11:49:41 -08:00
Grace Yun
783a3cede1
Remove swcMinify from Next config in CNA template (#43782)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-12-07 14:09:29 +01:00
Grace Yun
d464ef8f18
Update create-next-app template (#43482)
Refreshes `create-next-app` template designed by @evilrabbit. Credits to
members of Vercel's Design team @dizzyup + @emilkowalski for support on
CSS optimizations + code clean up.

The refreshed template includes one new dependency: `@next/font`. The
main script + related test have been updated to reflect this.

**Before:**

![Before -
Dark](https://user-images.githubusercontent.com/74513600/204942683-2847fda2-a538-4aff-b988-37d554c6d77f.png)
![Before -
Light](https://user-images.githubusercontent.com/74513600/204942685-7592f34a-4132-42c3-b4ce-25138ce66c71.png)

**After:**

![After -
Dark](https://user-images.githubusercontent.com/74513600/204942715-ad35649d-6881-43ea-ae58-5d9f95cc755a.png)
![After -
Light](https://user-images.githubusercontent.com/74513600/204942717-46e99c5c-6594-4035-acd4-a10e31ce22f9.png)

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## 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`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-12-02 22:01:04 -08:00
C. Lewis
389c77f205
feat(create-next-app): JS/TS prompt (with appDir support); enhanced testing (#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 https://github.com/vercel/next.js/discussions/41745#discussioncomment-3985833_

---

I added the `--ts, --typescript` flag to `create-next-app` in https://github.com/vercel/next.js/pull/24655, and since then I have seen it used very frequently, including in recent issues (such as https://github.com/vercel/next.js/issues/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:
1f47d9b0bf

And the PR that brought the diff up to 59 files (mostly owed to `app` template dirs and file structure refactors):
bd3ae4afd3 ([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>
2022-10-31 05:43:39 +00:00
Karl Horky
d402bb71ab
Remove swcMinify: true since this is 13's default (#41869) 2022-10-26 10:51:28 -07:00
Steven
be904d79ac
Open deploy link in new window for examples (#40804)
Let's open the deploy link in a new window so the link isn't blocked
when running an an iframe, such as Stackblitz.

Previously, this would print the following error:

> Refused to display 'https://vercel.com/' in a frame because it set
'X-Frame-Options' to 'deny'
2022-09-22 09:33:36 -07:00
JJ Kasper
0ab6ad5241
Update default gitignore templates (#39051) 2022-07-26 20:08:40 -05:00
Sam Becker
82c1e00c17
Add dark mode to default templates for Create Next App (#38671)
* Add dark mode to Create Next App

* Lint create-next-app css

* Widen boxes to optimize linebreaks

* Add color scheme to html, remove layout edits
2022-07-18 11:40:51 -05:00
Maia Teegarden
f2b8a6b60f
Enable swc minifier in create next apps (#38215)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## 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.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-07-06 17:14:01 +00:00
Ephraim Atta-Duncan
2c80444f87
Simplify .env.local gitignores (#34471)
* ignore all .env files in default template

* ignore all .env files in typescript template

* ignore all local .env files in default template

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* ignore all local .env files in typescript template

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-02-18 15:26:17 -06:00
Syed Basim
708f75180a
add pnpm debug file in gitignore templates (#34091)
Add pnpm debug (`.pnpm-debug.log`) file in gitignore templates.
2022-02-08 18:02:39 +00:00
Mohsen Azimi
0fd2f3ba98
Add types to nextConfig in default template (#34029)
Enable editors to suggest properties for the config object. Also let TypeScript check for type errors in the configuration when using TypeScript

Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-02-06 15:13:38 +00:00
Manny Becerra
36eba95227
Fixes #33153: Updating cross-references from master to main + canary (#33198)
* copy cleanup in env. variables docs

* copy cleanup in fast refresh docs

* Supplements #33153 - updating existing cross-references to `master` branch to renamed default branch of `main`

* Supplements #33153 - updating existing cross-references to `master` branch to renamed default branch of `main`

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-01-12 02:55:35 +01:00
C. Lewis
e2e747ef2d
fix(create-next-app): starter styling errors (#28096)
Fixes #27770.

Projects initialized with `create-next-app` should not only be totally functional in terms of styling, but ideally there would be as minimal CSS as possible to serve as a "jumping off point" for users (related: #24709, where I initially proposed this fix).

However, minor issues with the specific styling approaches in the template created by `create-next-app` break the page for small viewports. This is caused by an improper use of `display: flex` in conjunction with `min-height: 100vh` on the `.container` class, and I imagine it places a drag on the initial user experience due to the fact that every user who creates a project with `create-next-app` must *independently fix* this viewport sizing issue themselves.

For example, the top of the viewport on a small display (here, iPhone SE):

![image](https://user-images.githubusercontent.com/1657236/129430078-229d5fab-b719-458c-8a94-10fb8be3490d.png)

Notice the "Welcome to Next.js" message is missing: Its container is larger than the viewport, and is set to be a flex column with `justify-center`—so we are staring at the center of the container. To demonstrate better, here is the full page render for before and after this PR:

![image](https://user-images.githubusercontent.com/1657236/129430409-52134198-651a-4cf8-915d-68b699febd77.png)

This PR adjusts the styling to fix this issue, and also other styling issues on small screens, like grid width issues causing text to overflow (and the footer padding as seen above):

![image](https://user-images.githubusercontent.com/1657236/129430114-1dda7674-3b02-45d4-a4b3-37fc5053c6c4.png)

After these changes, and minor padding tweaks, this is the top of the viewport on an iPhone X (full render above):

![image](https://user-images.githubusercontent.com/1657236/129430224-1991c1a6-8c7e-4246-b4a5-44919fb850c6.png)

And on an iPhone SE:

![image](https://user-images.githubusercontent.com/1657236/129430259-4408c52f-6fc6-4f22-9cc6-bbdbbe8d7a1a.png)
2021-09-24 17:13:05 +00:00
Houssein Djirdeh
7a1c9eb17e
[ESLint] Introduce a new setup process when next lint is run for the first time (#26584)
This PR introduces an improved developer experience when `next lint` is run for the first time.

### Current behavior

`eslint-config-next` is a required package that must be installed before proceeding with `next lint` or `next build`:

![image](https://user-images.githubusercontent.com/12476932/123468791-43088100-d5c0-11eb-9ad0-5beb80b6c968.png)

Although this has helped many developers start using the new ESLint config, this has also resulted in a few issues:

- Users are required to install the full config (`eslint-config-next`) even if they do not use it or use the Next.js plugin directly (`eslint-plugin-next`).
  - #26348

- There's some confusion  on why `eslint-config-next` needs to be installed or how it should be used instead of `eslint-plugin-next`.
  - #26574
  - #26475
  - #26438

### New behavior

Instead of enforcing `eslint-config-next` as a required package, this PR prompts the user by asking what config they would like to start. This happens when `next lint` is run for the first time **and** if no ESLint configuration is detected in the application.

<img src="https://user-images.githubusercontent.com/12476932/124331177-e1668a80-db5c-11eb-8915-38d3dc20f5d4.gif" width="800" />

- The CLI will take care of installing `eslint` or `eslint-config-next` if either is not already installed
- Users now have the option to choose between a strict configuration (`next/core-web-vitals`) or just the base configuration (`next`)
- For users that decide to create their own ESLint configuration, or already have an existing one, **installing `eslint-config-next` will not be a requirement for `next lint` or `next build` to run**. A warning message will just show if the Next.js ESLint plugin is not detected in an ESLint config. 

  <img width="682" alt="Screen Shot 2021-06-25 at 3 02 12 PM" src="https://user-images.githubusercontent.com/12476932/123473329-6cc4a680-d5c6-11eb-9a57-d5c0b89a2732.png">

---

In addition, this PR also:

- Fixes #26348
- Updates documentation to make it more clear what approach to take for new and existing ESLint configurations
2021-08-04 21:53:15 +00:00
Paco
d0f41f3b49
Update create-next-app template favicons (#26289) 2021-06-18 15:29:11 -05:00
Houssein Djirdeh
bbc28ccae0
next lint + ESLint in Create Next App (#25064)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2021-06-03 14:01:24 +02:00
Gerald Monaco
1ee97b3c5d
Enable Strict Mode in new create-next-app projects (#25696) 2021-06-02 12:08:54 +02:00
Ahmed Essam
5e255b5fa2
Made template look correct in IE11 (#24245)
## Bug

Fixes #21324

## Documentation / Examples

- [X] Make sure the linting passes
2021-04-20 19:18:41 +00:00
Gary Meehan
c3d06a275f
Switch Create Next App default template to use next/image (#24076)
Follow PR to #23887 to add next/image.

Only other change was wrapping the image in a span to allow for the margin that was previously on the actual `<img>`

## Documentation / Examples

- [x] Make sure the linting passes
2021-04-15 12:50:39 +00:00
Gary Meehan
4f7f5f30de
Increase base Lighthouse score of default Create Next App template (#23887) 2021-04-12 11:16:53 +02:00
Lee Robinson
5a73859fe8
Update docs and Create Next App to use API Middlewares by default. (#21639) 2021-01-28 23:34:03 +00:00
Luc Leray
8eaabe2fb0
Fix deploy buttons URLs (#20834)
Fix all deploy button URLs in the Next.js repo to follow the following format:
```
https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/<EXAMPLE_NAME>&project-name=<EXAMPLE_NAME>&repository-name=<EXAMPLE_NAME>
```

The detailed docs for the Deploy Button can be found here: https://vercel.com/docs/more/deploy-button.

Also updates legacy Vercel import flow URLs (starting with vercel.com/import or with vercel.com/new/project), to use the new vercel.com/new URLs.

---

For example, for the `hello-world` example:

The URL is https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world

And the deploy button looks like this:
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world)

---

For reference, I used the following regexes to search for the incorrect URLs

```
\(https://vercel.com/import/git\?s=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
\(https://vercel.com/import/git\?c=1&s=https://github.com/vercel/next.js/tree/canary/examples/([^&]*)(.*)\)
\(https://vercel.com/import/project\?template=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
https://vercel.com/import/git
https://vercel.com/import/select-scope
https://vercel.com/import
https://vercel.com/new/project
```
2021-01-07 01:40:29 +00:00
Erik August Johnson
76c0efb3dd
Update README-template.md for API endpoint info (#20024)
Adds brief summary in Getting Started to explain the `pages/api` functionality. The intention here is reduce confusion to new users of Next.js as to what `pages/api` is and how it works.
2020-12-14 09:22:55 +00:00
Sam Poder
c5b20d06fa
Remove Random Blank Line in create-next-app (#17328)
There was a blank line, this PR removes it :D
2020-09-24 08:57:48 +00:00
Tanmay Laud
f00ad581a1
Added .gitignore to examples that are deployed to vercel (#15127)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-16 10:52:23 -04:00
Mohamed SADAT
aacfa79ddf
feat(create-next-app): Use CSS and CSS modules in default application template (#13983)
Hello 👋

This PR is to replace styled-jsx by Global CSS and CSS modules in the default Next.js template according to the issue [#13965](https://github.com/vercel/next.js/issues/13965) opened by @Timer
2020-06-10 21:25:27 +00:00
Joe Haddad
4a12fb0a5f
Normalize example gitignores (#13768)
This removes a bunch of unnecessary `.gitignore`s and fixes some CMS examples that don't ignore `node_modules` etc.
2020-06-04 20:39:52 +00:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
Tim Neutkens
483bd3ddda
Rename ZEIT to Vercel (#12075)
* Find/replace

* Update more URLs

* More rename

* Fix remaining examples

* More updates

* Update create-next-app

* Update remaining text

* Update

Co-authored-by: Shu Uesugi <shu@chibicode.com>
2020-04-21 11:47:12 +02:00
JJ Kasper
28ca0a7086
Add API route to default CNA template (#11981) 2020-04-17 16:28:58 -05:00
Shu Uesugi
7b0802eb40
Use function for function components (#11695) 2020-04-06 10:44:40 +02:00