2016-10-06 01:52:50 +02:00
|
|
|
{
|
2018-10-01 01:02:10 +02:00
|
|
|
"name": "nextjs-project",
|
2021-09-21 19:17:16 +02:00
|
|
|
"version": "0.0.0",
|
2018-10-01 01:02:10 +02:00
|
|
|
"private": true,
|
2022-07-06 17:08:00 +02:00
|
|
|
"workspaces": [
|
|
|
|
"packages/*"
|
|
|
|
],
|
2016-10-06 01:52:50 +02:00
|
|
|
"scripts": {
|
2023-11-03 02:25:18 +01:00
|
|
|
"new-error": "turbo gen error",
|
|
|
|
"new-test": "turbo gen test",
|
2023-05-10 03:14:37 +02:00
|
|
|
"clean": "lerna clean -y && lerna bootstrap && lerna run clean && lerna exec 'node ../../scripts/rm.mjs dist'",
|
2023-06-14 06:31:40 +02:00
|
|
|
"build": "turbo run build --remote-cache-timeout 60 --summarize true",
|
2018-10-01 01:02:10 +02:00
|
|
|
"lerna": "lerna",
|
2022-09-30 16:54:38 +02:00
|
|
|
"dev": "turbo run dev --parallel",
|
2023-02-08 00:30:02 +01:00
|
|
|
"test-types": "tsc",
|
2023-03-03 00:09:48 +01:00
|
|
|
"test-unit": "jest test/unit/ packages/next/ packages/font",
|
2022-05-29 06:35:16 +02:00
|
|
|
"test-dev": "cross-env NEXT_TEST_MODE=dev pnpm testheadless",
|
|
|
|
"test-start": "cross-env NEXT_TEST_MODE=start pnpm testheadless",
|
|
|
|
"test-deploy": "cross-env NEXT_TEST_MODE=deploy pnpm testheadless",
|
2023-01-03 23:43:55 +01:00
|
|
|
"testonly-dev": "cross-env NEXT_TEST_MODE=dev pnpm testonly",
|
|
|
|
"testonly-start": "cross-env NEXT_TEST_MODE=start pnpm testonly",
|
|
|
|
"testonly-deploy": "cross-env NEXT_TEST_MODE=deploy pnpm testonly",
|
|
|
|
"test": "pnpm testheadless",
|
2023-02-08 00:30:02 +01:00
|
|
|
"testonly": "jest --runInBand",
|
2022-05-29 06:35:16 +02:00
|
|
|
"testheadless": "cross-env HEADLESS=true pnpm testonly",
|
2020-05-21 14:07:27 +02:00
|
|
|
"genstats": "cross-env LOCAL_STATS=true node .github/actions/next-stats-action/src/index.js",
|
2019-03-17 17:43:03 +01:00
|
|
|
"git-reset": "git reset --hard HEAD",
|
|
|
|
"git-clean": "git clean -d -x -e node_modules -e packages -f",
|
2023-06-23 19:42:50 +02:00
|
|
|
"typescript": "tsc --noEmit",
|
2022-09-30 16:54:38 +02:00
|
|
|
"lint-typescript": "turbo run typescript",
|
2021-08-25 19:33:57 +02:00
|
|
|
"lint-eslint": "eslint . --ext js,jsx,ts,tsx --max-warnings=0 --config .eslintrc.json --no-eslintrc",
|
2023-04-06 17:16:29 +02:00
|
|
|
"lint-no-typescript": "run-p prettier-check lint-eslint lint-language",
|
2023-05-28 06:02:31 +02:00
|
|
|
"types-and-precompiled": "run-p lint-typescript check-precompiled",
|
2021-08-24 14:52:45 +02:00
|
|
|
"lint": "run-p test-types lint-typescript prettier-check lint-eslint lint-language",
|
2022-05-29 06:35:16 +02:00
|
|
|
"lint-fix": "pnpm prettier-fix && eslint . --ext js,jsx,ts,tsx --fix --max-warnings=0 --config .eslintrc.json --no-eslintrc",
|
2021-06-22 18:03:12 +02:00
|
|
|
"lint-language": "alex .",
|
2020-09-14 04:53:19 +02:00
|
|
|
"prettier-check": "prettier --check .",
|
2023-05-28 06:02:31 +02:00
|
|
|
"check-examples": "./scripts/check-examples.sh",
|
|
|
|
"get-test-timings": "node run-tests.js --timings --write-timings -g 1/1",
|
2020-09-14 04:53:19 +02:00
|
|
|
"prettier-fix": "prettier --write .",
|
2019-07-11 02:59:53 +02:00
|
|
|
"types": "lerna run types --stream",
|
2023-05-28 06:02:31 +02:00
|
|
|
"check-precompiled": "./scripts/check-pre-compiled.sh",
|
2022-05-31 02:05:27 +02:00
|
|
|
"prepublishOnly": "turbo run build",
|
2023-03-25 20:59:51 +01:00
|
|
|
"release-canary": "git checkout canary && git pull && lerna version prerelease --preid canary --force-publish && release --pre --skip-questions --show-url",
|
|
|
|
"release-stable": "lerna version --force-publish",
|
|
|
|
"publish-canary": "node -e 'import(\"open\").then(open => open.default(\"https://github.com/vercel/next.js/actions/workflows/trigger_release.yml\"))'",
|
|
|
|
"publish-stable": "pnpm publish-canary",
|
2019-04-09 17:52:03 +02:00
|
|
|
"lint-staged": "lint-staged",
|
2021-07-01 13:41:27 +02:00
|
|
|
"next-with-deps": "./scripts/next-with-deps.sh",
|
2023-01-05 22:27:05 +01:00
|
|
|
"next": "cross-env NEXT_TELEMETRY_DISABLED=1 node --trace-deprecation --enable-source-maps packages/next/dist/bin/next",
|
|
|
|
"next-no-sourcemaps": "cross-env NEXT_TELEMETRY_DISABLED=1 node --trace-deprecation packages/next/dist/bin/next",
|
2023-05-10 03:14:37 +02:00
|
|
|
"clean-trace-jaeger": "node scripts/rm.mjs test/integration/basic/.next && TRACE_TARGET=JAEGER pnpm next build test/integration/basic",
|
2023-01-05 22:27:05 +01:00
|
|
|
"debug": "cross-env NEXT_TELEMETRY_DISABLED=1 node --inspect packages/next/dist/bin/next",
|
2024-01-09 23:37:49 +01:00
|
|
|
"postinstall": "node scripts/git-configure.mjs && node scripts/install-native.mjs",
|
2023-08-04 21:40:20 +02:00
|
|
|
"version": "pnpm install --no-frozen-lockfile && IS_PUBLISH=yes ./scripts/check-pre-compiled.sh && git add .",
|
2023-03-02 03:15:02 +01:00
|
|
|
"prepare": "husky install",
|
2023-04-29 17:03:22 +02:00
|
|
|
"sync-react": "node ./scripts/sync-react.js",
|
|
|
|
"update-google-fonts": "node ./scripts/update-google-fonts.js"
|
2016-10-06 01:52:50 +02:00
|
|
|
},
|
2018-10-01 01:02:10 +02:00
|
|
|
"devDependencies": {
|
2023-10-12 15:57:09 +02:00
|
|
|
"@actions/core": "1.10.1",
|
2023-10-17 04:25:57 +02:00
|
|
|
"@babel/core": "7.22.5",
|
|
|
|
"@babel/eslint-parser": "7.22.5",
|
|
|
|
"@babel/generator": "7.22.5",
|
|
|
|
"@babel/parser": "7.22.5",
|
|
|
|
"@babel/plugin-proposal-object-rest-spread": "7.20.7",
|
|
|
|
"@babel/preset-flow": "7.22.5",
|
|
|
|
"@babel/preset-react": "7.22.5",
|
2024-02-05 20:18:08 +01:00
|
|
|
"@edge-runtime/jest-environment": "2.3.4",
|
2023-08-20 05:14:16 +02:00
|
|
|
"@emotion/cache": "11.11.0",
|
|
|
|
"@emotion/react": "11.11.1",
|
2019-12-12 00:54:40 +01:00
|
|
|
"@fullhuman/postcss-purgecss": "1.3.0",
|
2023-02-11 13:37:00 +01:00
|
|
|
"@mdx-js/loader": "2.2.1",
|
|
|
|
"@mdx-js/react": "2.2.1",
|
2022-05-29 06:35:16 +02:00
|
|
|
"@next/bundle-analyzer": "workspace:*",
|
|
|
|
"@next/env": "workspace:*",
|
|
|
|
"@next/eslint-plugin-next": "workspace:*",
|
2022-09-22 00:10:24 +02:00
|
|
|
"@next/font": "workspace:*",
|
2022-05-29 06:35:16 +02:00
|
|
|
"@next/mdx": "workspace:*",
|
|
|
|
"@next/plugin-storybook": "workspace:*",
|
|
|
|
"@next/polyfill-module": "workspace:*",
|
|
|
|
"@next/polyfill-nomodule": "workspace:*",
|
|
|
|
"@next/swc": "workspace:*",
|
2023-07-27 16:39:51 +02:00
|
|
|
"@next/third-parties": "workspace:*",
|
2023-03-16 17:35:07 +01:00
|
|
|
"@opentelemetry/api": "1.4.1",
|
2023-08-23 15:07:30 +02:00
|
|
|
"@picocss/pico": "1.5.10",
|
2024-01-08 17:05:05 +01:00
|
|
|
"@replayio/jest": "27.2.35",
|
|
|
|
"@replayio/playwright": "1.1.8",
|
|
|
|
"@replayio/replay": "0.20.1",
|
2021-06-18 02:40:22 +02:00
|
|
|
"@svgr/webpack": "5.5.0",
|
2022-03-05 22:45:30 +01:00
|
|
|
"@swc/cli": "0.1.55",
|
2023-09-15 17:41:05 +02:00
|
|
|
"@swc/core": "1.3.85",
|
2024-02-05 11:22:32 +01:00
|
|
|
"@swc/helpers": "0.5.5",
|
2023-09-04 13:53:41 +02:00
|
|
|
"@testing-library/jest-dom": "6.1.2",
|
2022-04-05 23:51:47 +02:00
|
|
|
"@testing-library/react": "13.0.0",
|
2020-02-12 02:16:42 +01:00
|
|
|
"@types/cheerio": "0.22.16",
|
2023-06-23 19:42:50 +02:00
|
|
|
"@types/cookie": "0.3.3",
|
|
|
|
"@types/cross-spawn": "6.0.0",
|
2020-04-19 19:58:31 +02:00
|
|
|
"@types/fs-extra": "8.1.0",
|
2023-06-23 19:42:50 +02:00
|
|
|
"@types/glob": "7.1.1",
|
2022-08-17 01:29:55 +02:00
|
|
|
"@types/html-validator": "5.0.3",
|
2020-02-04 20:08:03 +01:00
|
|
|
"@types/http-proxy": "1.17.3",
|
2023-10-19 19:38:24 +02:00
|
|
|
"@types/jest": "29.5.5",
|
2023-06-08 17:52:17 +02:00
|
|
|
"@types/node": "20.2.5",
|
2022-09-09 00:17:15 +02:00
|
|
|
"@types/node-fetch": "2.6.1",
|
2023-11-08 00:55:06 +01:00
|
|
|
"@types/react": "18.2.37",
|
|
|
|
"@types/react-dom": "18.2.15",
|
2023-09-07 20:46:05 +02:00
|
|
|
"@types/relay-runtime": "14.1.13",
|
2021-09-13 14:36:25 +02:00
|
|
|
"@types/selenium-webdriver": "4.0.15",
|
2024-02-08 12:00:34 +01:00
|
|
|
"@types/sharp": "0.29.3",
|
2019-04-02 16:09:34 +02:00
|
|
|
"@types/string-hash": "1.1.1",
|
2023-04-21 11:33:23 +02:00
|
|
|
"@types/trusted-types": "2.0.3",
|
2023-12-12 11:27:15 +01:00
|
|
|
"@typescript-eslint/eslint-plugin": "6.14.0",
|
|
|
|
"@typescript-eslint/parser": "6.14.0",
|
2021-08-06 17:20:05 +02:00
|
|
|
"@vercel/fetch": "6.1.1",
|
2024-01-04 13:02:40 +01:00
|
|
|
"@vercel/og": "0.6.2",
|
2019-05-23 09:52:36 +02:00
|
|
|
"abort-controller": "3.0.0",
|
2021-06-22 18:03:12 +02:00
|
|
|
"alex": "9.1.0",
|
2023-03-30 21:24:02 +02:00
|
|
|
"amphtml-validator": "1.0.35",
|
2023-03-31 04:29:10 +02:00
|
|
|
"ansi-escapes": "4.3.2",
|
2019-09-10 19:11:55 +02:00
|
|
|
"async-sema": "3.0.1",
|
2024-01-18 17:14:38 +01:00
|
|
|
"browserslist": "4.22.2",
|
2022-12-04 04:49:00 +01:00
|
|
|
"buffer": "5.6.0",
|
2017-02-16 23:53:39 +01:00
|
|
|
"cheerio": "0.22.0",
|
2020-05-11 02:48:57 +02:00
|
|
|
"cookie": "0.4.1",
|
2020-05-16 23:15:12 +02:00
|
|
|
"cors": "2.8.5",
|
2019-05-23 09:52:36 +02:00
|
|
|
"coveralls": "3.0.3",
|
2022-05-29 06:35:16 +02:00
|
|
|
"create-next-app": "workspace:*",
|
2020-12-01 19:02:07 +01:00
|
|
|
"critters": "0.0.6",
|
2019-12-26 21:01:22 +01:00
|
|
|
"cross-env": "6.0.3",
|
2019-02-26 21:57:32 +01:00
|
|
|
"cross-spawn": "6.0.5",
|
2023-08-18 15:55:22 +02:00
|
|
|
"dd-trace": "4.12.0",
|
2022-01-02 23:16:17 +01:00
|
|
|
"es5-ext": "0.10.53",
|
2019-11-25 22:52:29 +01:00
|
|
|
"escape-string-regexp": "2.0.0",
|
2024-02-02 02:06:02 +01:00
|
|
|
"eslint": "8.56.0",
|
2022-05-29 21:59:38 +02:00
|
|
|
"eslint-config-next": "workspace:*",
|
2024-02-02 02:06:02 +01:00
|
|
|
"eslint-formatter-codeframe": "7.32.1",
|
|
|
|
"eslint-plugin-eslint-plugin": "5.2.1",
|
|
|
|
"eslint-plugin-import": "2.29.1",
|
|
|
|
"eslint-plugin-jest": "27.6.3",
|
|
|
|
"eslint-plugin-jsdoc": "48.0.4",
|
|
|
|
"eslint-plugin-react": "7.33.2",
|
|
|
|
"eslint-plugin-react-hooks": "4.6.0",
|
2022-06-29 22:57:51 +02:00
|
|
|
"event-stream": "4.0.1",
|
2019-07-17 22:53:56 +02:00
|
|
|
"execa": "2.0.3",
|
fix: InferGetServerSidePropsType and InferGetStaticPropsType (#40635)
## Problem
Currently the Next.js infer utility (`InferGetServerSidePropsType` and
`InferGetStaticPropsType`) types can lead to a wrong inferred types
(`never`). This happens if these functions return something different
than: `{props: {}}`.
**Example:** `getServerSideProps`
```typescript
export async function getServerSideProps({ query }: GetServerSidePropsContext) {
if (query.foo) {
return {
notFound: true,
}
}
return {
props: {
foo: "bar"
},
}
}
type PageProps = InferGetServerSidePropsType<typeof getServerSideProps>
// => type PageProps = never
```
**Example:** `getStaticProps`
```typescript
import type { InferGetStaticPropsType, GetStaticPropsContext } from 'next'
export async function getStaticProps(context: GetStaticPropsContext) {
if (context.params?.bar) {
return {
notFound: true,
}
}
return {
props: {
foo: 'bar',
},
}
}
type PageProps = InferGetStaticPropsType<typeof getStaticProps>
// => type PageProps = never
```
This is because the first infer condition of the utility type is not
satified leading to a never result.
```typescript
export type InferGetServerSidePropsType<T> = T extends GetServerSideProps<
infer P, // <- NOT SATISFIED
any
>
? P
: T extends (
context?: GetServerSidePropsContext<any>
) => Promise<GetServerSidePropsResult<infer P>>
? P
: never // <- NOT SATISFIED
```
## Solution
I have experimented with different solutions ending with a much simpler
type, that is faster to execute, easier to read and universally usable
for both prop variations.
```typescript
/**
* Flow:
* - Make sure getStaticProps is a function
* - Get its return type
* - Extract the one that contains {props: any}
* - Return the props
*/
export type InferGetStaticPropsType<T extends (args: any) => any> = Extract<
Awaited<ReturnType<T>>,
{ props: any }
>['props']
```
## Bug
- [x] Related issues: fixes #36615, #15913,
https://twitter.com/leeerob/status/1563540593003106306
- [x] Type tests added
## Future thoughts
Since `InferGetStaticPropsType` and `InferGetServerSidePropsType` are
now the same, it's api could be merged into one utility type (e.g:
InferNextProps). I recommend doing this in a different PR.
## Additional info
I have tested this approach using the following [external
package](https://www.npmjs.com/package/infer-next-props-type)
(@timneutkens sorry for the late PR). Since about 12 Month I haven't
received any negative feedback (issues) regarding this approach.
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-09-21 00:25:01 +02:00
|
|
|
"expect-type": "0.14.2",
|
2019-05-23 09:52:36 +02:00
|
|
|
"express": "4.17.0",
|
2021-06-18 19:12:20 +02:00
|
|
|
"faker": "5.5.3",
|
2019-07-11 19:02:43 +02:00
|
|
|
"faunadb": "2.6.1",
|
2022-12-04 04:49:00 +01:00
|
|
|
"find-up": "4.1.0",
|
2020-05-29 01:23:35 +02:00
|
|
|
"firebase": "7.14.5",
|
2022-03-08 17:15:09 +01:00
|
|
|
"flat": "5.0.2",
|
2020-03-21 17:02:05 +01:00
|
|
|
"fs-extra": "9.0.0",
|
2020-05-11 02:48:57 +02:00
|
|
|
"get-port": "5.1.1",
|
2023-09-11 23:48:29 +02:00
|
|
|
"get-port-please": "3.1.1",
|
2020-05-21 14:07:27 +02:00
|
|
|
"glob": "7.1.6",
|
|
|
|
"gzip-size": "5.1.1",
|
2022-02-01 01:13:46 +01:00
|
|
|
"html-validator": "5.1.18",
|
2022-12-04 04:49:00 +01:00
|
|
|
"http-proxy": "1.18.1",
|
2022-12-07 17:11:29 +01:00
|
|
|
"husky": "8.0.0",
|
2024-02-08 12:00:34 +01:00
|
|
|
"image-size": "0.9.3",
|
2022-03-07 21:29:11 +01:00
|
|
|
"is-animated": "2.0.2",
|
2018-12-04 10:59:12 +01:00
|
|
|
"isomorphic-unfetch": "3.0.0",
|
2023-10-19 19:38:24 +02:00
|
|
|
"jest": "29.7.0",
|
|
|
|
"jest-environment-jsdom": "29.7.0",
|
|
|
|
"jest-extended": "4.0.2",
|
2023-06-12 19:14:13 +02:00
|
|
|
"jest-junit": "16.0.0",
|
2023-01-04 00:45:05 +01:00
|
|
|
"json5": "2.2.3",
|
2023-11-24 16:48:12 +01:00
|
|
|
"kleur": "^4.1.0",
|
2020-05-12 21:58:21 +02:00
|
|
|
"ky": "0.19.1",
|
|
|
|
"ky-universal": "0.6.0",
|
2021-02-12 13:34:25 +01:00
|
|
|
"lerna": "4.0.0",
|
2020-05-02 21:47:16 +02:00
|
|
|
"lint-staged": "10.1.7",
|
2022-12-04 04:49:00 +01:00
|
|
|
"lodash": "4.17.20",
|
2020-05-15 23:15:15 +02:00
|
|
|
"lost": "8.3.1",
|
2020-05-21 14:07:27 +02:00
|
|
|
"minimatch": "3.0.4",
|
2019-08-20 21:19:45 +02:00
|
|
|
"moment": "^2.24.0",
|
2022-05-29 06:35:16 +02:00
|
|
|
"nanoid": "3.1.30",
|
2022-05-29 21:59:38 +02:00
|
|
|
"next": "workspace:*",
|
2022-01-19 17:48:11 +01:00
|
|
|
"node-fetch": "2.6.7",
|
2023-11-03 02:25:18 +01:00
|
|
|
"node-plop": "0.31.1",
|
2019-11-27 20:26:40 +01:00
|
|
|
"npm-run-all": "4.1.5",
|
2019-12-12 16:51:38 +01:00
|
|
|
"nprogress": "0.2.0",
|
2023-08-07 02:11:03 +02:00
|
|
|
"octokit": "3.1.0",
|
2023-03-25 20:59:51 +01:00
|
|
|
"open": "9.0.0",
|
2023-06-21 21:47:21 +02:00
|
|
|
"outdent": "0.8.0",
|
2019-12-11 17:51:10 +01:00
|
|
|
"pixrem": "5.0.0",
|
2023-08-12 01:25:01 +02:00
|
|
|
"playwright-chromium": "1.35.1",
|
|
|
|
"playwright-core": "1.35.1",
|
2023-09-29 23:57:35 +02:00
|
|
|
"postcss": "8.4.31",
|
2020-05-15 23:15:15 +02:00
|
|
|
"postcss-nested": "4.2.1",
|
2019-12-11 17:51:10 +01:00
|
|
|
"postcss-pseudoelements": "5.0.0",
|
2019-11-25 22:52:29 +01:00
|
|
|
"postcss-short-size": "4.0.0",
|
|
|
|
"postcss-trolling": "0.1.7",
|
2023-06-09 16:58:19 +02:00
|
|
|
"prettier": "2.8.8",
|
2020-05-21 14:07:27 +02:00
|
|
|
"pretty-bytes": "5.3.0",
|
|
|
|
"pretty-ms": "7.0.0",
|
2021-09-13 15:49:29 +02:00
|
|
|
"random-seed": "0.3.0",
|
2022-06-15 17:14:43 +02:00
|
|
|
"react": "18.2.0",
|
2022-04-05 23:51:47 +02:00
|
|
|
"react-17": "npm:react@17.0.2",
|
2024-02-09 10:13:45 +01:00
|
|
|
"react-builtin": "npm:react@18.3.0-canary-ba5e6a832-20240208",
|
2022-06-15 17:14:43 +02:00
|
|
|
"react-dom": "18.2.0",
|
2022-04-05 23:51:47 +02:00
|
|
|
"react-dom-17": "npm:react-dom@17.0.2",
|
2024-02-09 10:13:45 +01:00
|
|
|
"react-dom-builtin": "npm:react-dom@18.3.0-canary-ba5e6a832-20240208",
|
|
|
|
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-ba5e6a832-20240208",
|
|
|
|
"react-experimental-builtin": "npm:react@0.0.0-experimental-ba5e6a832-20240208",
|
|
|
|
"react-server-dom-turbopack": "18.3.0-canary-ba5e6a832-20240208",
|
|
|
|
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-ba5e6a832-20240208",
|
|
|
|
"react-server-dom-webpack": "18.3.0-canary-ba5e6a832-20240208",
|
|
|
|
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-ba5e6a832-20240208",
|
2020-01-04 17:40:18 +01:00
|
|
|
"react-ssr-prepass": "1.0.8",
|
2022-03-05 22:45:30 +01:00
|
|
|
"react-virtualized": "9.22.3",
|
2022-02-01 19:18:55 +01:00
|
|
|
"relay-compiler": "13.0.2",
|
|
|
|
"relay-runtime": "13.0.2",
|
2022-06-24 22:02:40 +02:00
|
|
|
"release": "6.3.1",
|
2019-05-23 09:52:36 +02:00
|
|
|
"request-promise-core": "1.1.2",
|
2021-09-13 14:36:25 +02:00
|
|
|
"resolve-from": "5.0.0",
|
2022-07-27 06:12:54 +02:00
|
|
|
"sass": "1.54.0",
|
2023-12-21 14:50:57 +01:00
|
|
|
"satori": "0.10.9",
|
2024-02-09 10:13:45 +01:00
|
|
|
"scheduler-builtin": "npm:scheduler@0.24.0-canary-ba5e6a832-20240208",
|
|
|
|
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-ba5e6a832-20240208",
|
2020-08-21 20:50:24 +02:00
|
|
|
"seedrandom": "3.0.5",
|
2021-09-13 14:36:25 +02:00
|
|
|
"selenium-webdriver": "4.0.0-beta.4",
|
2022-05-29 06:35:16 +02:00
|
|
|
"semver": "7.3.7",
|
2021-10-29 18:12:46 +02:00
|
|
|
"shell-quote": "1.7.3",
|
2022-12-04 04:49:00 +01:00
|
|
|
"strip-ansi": "6.0.0",
|
2023-06-08 18:24:03 +02:00
|
|
|
"styled-components": "6.0.0-rc.3",
|
2022-12-20 00:58:50 +01:00
|
|
|
"styled-jsx": "5.1.1",
|
2020-11-06 03:33:14 +01:00
|
|
|
"styled-jsx-plugin-postcss": "3.0.2",
|
2024-02-01 01:29:04 +01:00
|
|
|
"swr": "^2.2.4",
|
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
|
|
|
"tailwindcss": "3.2.7",
|
2017-09-27 20:11:02 +02:00
|
|
|
"taskr": "1.1.0",
|
2020-10-23 09:52:37 +02:00
|
|
|
"tree-kill": "1.2.2",
|
2022-02-25 01:59:18 +01:00
|
|
|
"tsec": "0.2.1",
|
2024-02-05 01:03:06 +01:00
|
|
|
"turbo": "1.12.2",
|
2023-09-07 20:46:05 +02:00
|
|
|
"typescript": "5.2.2",
|
2022-12-04 04:49:00 +01:00
|
|
|
"unfetch": "4.2.0",
|
2018-10-12 15:32:17 +02:00
|
|
|
"wait-port": "0.2.2",
|
2024-01-25 20:18:12 +01:00
|
|
|
"webpack": "5.90.0",
|
2022-12-04 04:49:00 +01:00
|
|
|
"webpack-bundle-analyzer": "4.7.0",
|
2022-12-07 17:11:29 +01:00
|
|
|
"whatwg-fetch": "3.0.0",
|
2023-11-29 04:22:45 +01:00
|
|
|
"ws": "8.2.3",
|
|
|
|
"yargs": "16.2.0"
|
2018-11-03 17:42:43 +01:00
|
|
|
},
|
2019-10-23 03:02:59 +02:00
|
|
|
"resolutions": {
|
2024-01-25 20:18:12 +01:00
|
|
|
"webpack": "5.90.0",
|
2024-01-18 17:14:38 +01:00
|
|
|
"browserslist": "4.22.2",
|
|
|
|
"caniuse-lite": "1.0.30001579",
|
2023-06-08 22:35:12 +02:00
|
|
|
"@types/node": "20.2.5",
|
2023-10-17 04:25:57 +02:00
|
|
|
"@babel/core": "7.22.5",
|
|
|
|
"@babel/parser": "7.22.5",
|
|
|
|
"@babel/types": "7.22.5",
|
|
|
|
"@babel/traverse": "7.22.5",
|
2023-11-08 00:55:06 +01:00
|
|
|
"@types/react": "18.2.37",
|
|
|
|
"@types/react-dom": "18.2.15"
|
2019-10-23 03:02:59 +02:00
|
|
|
},
|
2018-11-03 17:42:43 +01:00
|
|
|
"engines": {
|
2023-10-17 23:15:31 +02:00
|
|
|
"node": ">=18.17.0",
|
2024-02-09 22:46:19 +01:00
|
|
|
"pnpm": "8.15.1"
|
2022-06-17 19:36:37 +02:00
|
|
|
},
|
2024-02-09 22:46:19 +01:00
|
|
|
"packageManager": "pnpm@8.15.1"
|
2016-10-06 01:52:50 +02:00
|
|
|
}
|