Commit graph

1568 commits

Author SHA1 Message Date
Tim Neutkens
4e96e044d2 v13.2.5-canary.5 2023-03-16 21:53:59 +01:00
Balázs Orbán
8c98a207f2
feat(cli): introduce --tailwind flag (#46927)
### What?

This PR introduces a new `--tailwind` flag to the `create-next-app` CLI,
to make it easier to bootstrap a Next.js app with Tailwind CSS
pre-configured. This is going to be the **default**. To opt-out of
Tailwind CSS, you can use the `--no-tailwind` flag.

### Why?

Tailwind CSS is one of the most popular styling solutions right now, and
we would like to make it easier to get started.

Currently, the closest you can come to this is by running `pnpm create
next-app -e with-tailwindcss` which will clone the
https://github.com/vercel/next.js/tree/canary/examples/with-tailwindcss
example. But that example is not configured for the App Router. This PR
will let you add Tailwind CSS to both `app/`, `pages/`, and start out
with TypeScript or JavaScript via the CLI prompts.

(Some community feedback
https://twitter.com/dev_jonaskaas/status/1632367991827443713,
https://twitter.com/samselikoff/status/1634662473331617794)

### How?

We are adding 4 new templates to the CLI bundle.

> Note: The styling is not pixel-perfect compared to the current
templates (using CSS modules) to require fewer overrides, but I tried to
match it as close as possible. Here are a few screenshots:

<details>
<summary><b>Current, light</b></summary>
<img
src="https://user-images.githubusercontent.com/18369201/224733372-9dba86fe-9191-471d-ad9f-ab904c47f544.png"/>
</details>

<details>
<summary><b>Tailwind (new), light</b></summary>
<img
src="https://user-images.githubusercontent.com/18369201/224733610-038d9d0f-634d-4b69-b5c2-a5056b56760c.png"/>
</details>

<details>
<summary><b>Current, dark, responsive</b></summary>
<img
src="https://user-images.githubusercontent.com/18369201/224733790-9b4d730c-0336-4dbe-bc10-1cae1d7fd145.png"/>
</details>

<details>
<summary><b>Tailwind (new), dark, responsive</b></summary>
<img
src="https://user-images.githubusercontent.com/18369201/224734375-28384bbc-2c3a-4125-8f29-c102f3b7aa1d.png"/>
</details>

#### For reviewers

This introduces 4 new templates, with a very similar code base to the
original ones. To keep the PR focused, I decided to copy over duplicate
code, but we could potentially create a shared folder for files that are
the same across templates to somewhat reduce the CLI size. Not sure if
it's worth it, let me know. Probably fine for now, but something to
consider if we are adding more permutations in the future.

---

~Work remaining:~

- [x] app+ts
	- [x] layout
	- [x] dark mode
	- [x] media queries
	- [x] animations
- [x] app+js
- [x] pages+ts
- [x] pages+js
- [x] prompt/config
- [x] deprecate Tailwind CSS example in favor of CLI
- [x] update docs
- [x] add test
- [x] add [Prettier
plugin](https://github.com/tailwindlabs/prettier-plugin-tailwindcss)
 
Closes NEXT-772
Related #45814, #44286
2023-03-16 16:06:27 +01:00
Tim Neutkens
e6f33ec3a1 v13.2.5-canary.4 2023-03-15 11:55:55 +01:00
JJ Kasper
6706a2a6ba
v13.2.5-canary.3 2023-03-13 21:46:07 -07:00
Steamed_EGG
d08caa88ba
Fix: Update README templates in create-next-app (#47037)
To make them up to date with other templates

<!-- 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?



### How?

Closes NEXT-
Fixes #

-->
### Why?

I was using `create-next-app` to create my new app using the new `app`
directory but found out that `README.md` is outdated:
It shows informations for API Routes, which removed in #45819 in favor
of route handlers.

---------
2023-03-13 13:20:39 -07:00
JJ Kasper
0b3e357808
v13.2.5-canary.2 2023-03-13 11:46:11 -07:00
Tim Neutkens
287ad83399 v13.2.5-canary.1 2023-03-11 20:41:30 +01:00
Tim Neutkens
7d48edfe8e v13.2.5-canary.0 2023-03-10 18:06:16 +01:00
JJ Kasper
05f6de1086
v13.2.4 2023-03-09 16:41:28 -08:00
JJ Kasper
1ce3b36179
v13.2.4-canary.9 2023-03-09 14:46:45 -08:00
JJ Kasper
715f96fb49
v13.2.4-canary.8 2023-03-08 16:06:57 -08:00
JJ Kasper
f99ae5af97
v13.2.4-canary.7 2023-03-08 11:52:58 -08:00
JJ Kasper
85ec94ffd7
v13.2.4-canary.6 2023-03-07 14:10:34 -08:00
JJ Kasper
a5a13fe930
v13.2.4-canary.5 2023-03-06 23:30:31 -08:00
JJ Kasper
a0c5a630f9
v13.2.4-canary.4 2023-03-05 10:26:29 -08:00
JJ Kasper
8d9b0b111f
v13.2.4-canary.3 2023-03-04 14:41:44 -08:00
JJ Kasper
f2989f747f
v13.2.4-canary.2 2023-03-03 17:36:25 -08:00
JJ Kasper
f7bfaff83b
v13.2.4-canary.1 2023-03-02 18:35:39 -08:00
JJ Kasper
262501eb68
v13.2.4-canary.0 2023-03-01 19:38:37 -08:00
JJ Kasper
7f0b9e262b
v13.2.3 2023-03-01 00:46:27 -08:00
JJ Kasper
419ade23b6
v13.2.3-canary.1 2023-03-01 00:26:46 -08:00
JJ Kasper
cccf4f2a29
v13.2.3-canary.0 2023-02-28 22:40:40 -08:00
JJ Kasper
5d48d7e6ed
v13.2.2 2023-02-28 17:48:09 -08:00
JJ Kasper
250a2f59b3
v13.2.2-canary.5 2023-02-28 16:31:35 -08:00
JJ Kasper
89a9bd9f74
v13.2.2-canary.4 2023-02-28 12:36:40 -08:00
teobler
b6b7933377
fix: generate next-env.d.ts file during next lint command (#46249)
fixes #46104

## Bug

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

---------

Co-authored-by: Wyatt Johnson <accounts+github@wyattjoh.ca>
2023-02-28 11:51:22 -08:00
Tim Neutkens
3609bdbffe v13.2.2-canary.3 2023-02-28 10:15:03 +01:00
JJ Kasper
6b276042ee
v13.2.2-canary.2 2023-02-27 17:17:33 -08: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
JJ Kasper
ff4e06afd1
v13.2.2-canary.1 2023-02-25 12:51:34 -08:00
JJ Kasper
e0e81ea049
v13.2.2-canary.0 2023-02-24 16:58:01 -08:00
JJ Kasper
8d83d85e53
v13.2.1 2023-02-23 17:56:27 -08:00
JJ Kasper
10ada08332
v13.2.1-canary.0 2023-02-23 17:29:49 -08:00
Lee Robinson
4f0d76c40b
Migrate create-next-app and e2e tests to Metadata API. (#45819)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-02-23 23:40:06 +00:00
Balázs Orbán
1275fdc0d6
fix(cli): add navigation compat types to default next-env.d.ts (#46321)
Until #45819 is landed, we should have the `compat` version (#45919), since the template has a `pages` folder.

[Slack thread](https://vercel.slack.com/archives/C03KAR5DCKC/p1677183585403679)

## 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-23 21:43:10 +00:00
JJ Kasper
cf8ca960c4
v13.2.0 2023-02-23 10:10:30 -08:00
Jimmy Lai
c4a3846821 v13.1.7-canary.32 2023-02-23 18:38:15 +01:00
Tim Neutkens
0d0a980415 v13.1.7-canary.30 2023-02-23 16:01:03 +01:00
Tim Neutkens
884dacc6b1 v13.1.7-canary.29 2023-02-23 15:11:19 +01:00
Tim Neutkens
2882eb4ebd v13.1.7-canary.28 2023-02-23 09:27:43 +01:00
JJ Kasper
0302576239
v13.1.7-canary.27 2023-02-22 13:47:53 -08:00
Jimmy Lai
bd8cf3a4b7 v13.1.7-canary.26 2023-02-22 16:15:07 +01:00
Tim Neutkens
1567f42c2e v13.1.7-canary.25 2023-02-22 10:36:00 +01:00
JJ Kasper
1dc7694218
v13.1.7-canary.24 2023-02-21 23:48:09 -08:00
JJ Kasper
d548318b28
v13.1.7-canary.23 2023-02-21 18:01:56 -08:00
Jan Kaifer
16aa8e9b7e
fix: CNA issues when using @/ in custom import alias (#46184)
unrelated changes:
- add missing await
- fix TYPO in test comment


This issue was caused by the fact that we have been replacing `@/` ->
`[importAlias]` even in tsconfig.json itself.

fixes #45884
2023-02-21 16:45:32 -08:00
Tim Neutkens
04c6c8cfca v13.1.7-canary.22 2023-02-21 19:50:53 +01: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
Tim Neutkens
c4db007220 v13.1.7-canary.21 2023-02-18 20:36:22 +01:00
JJ Kasper
0bc4d568b3
v13.1.7-canary.20 2023-02-17 23:25:51 -08:00