From 6403a992e4e9d0eb96161cf20ba2613f1da38efd Mon Sep 17 00:00:00 2001 From: Oscar Busk Date: Thu, 12 Aug 2021 23:47:14 +0200 Subject: [PATCH 1/2] Add `.gitignore` to examples that lack them (#28003) * Only copy .gitignores to examples that are actual packages. `custom-server` is just a `.md` redirecting users to the documentation. * Add .gitignores to examples that lack them --- examples/with-clerk/.gitignore | 34 ++++++++++++++++++++++++++++++ examples/with-deta-base/.gitignore | 34 ++++++++++++++++++++++++++++++ examples/with-mqtt-js/.gitignore | 34 ++++++++++++++++++++++++++++++ scripts/check-examples.sh | 2 +- 4 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 examples/with-clerk/.gitignore create mode 100644 examples/with-deta-base/.gitignore create mode 100644 examples/with-mqtt-js/.gitignore diff --git a/examples/with-clerk/.gitignore b/examples/with-clerk/.gitignore new file mode 100644 index 0000000000000..1437c53f70bc2 --- /dev/null +++ b/examples/with-clerk/.gitignore @@ -0,0 +1,34 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# vercel +.vercel diff --git a/examples/with-deta-base/.gitignore b/examples/with-deta-base/.gitignore new file mode 100644 index 0000000000000..1437c53f70bc2 --- /dev/null +++ b/examples/with-deta-base/.gitignore @@ -0,0 +1,34 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# vercel +.vercel diff --git a/examples/with-mqtt-js/.gitignore b/examples/with-mqtt-js/.gitignore new file mode 100644 index 0000000000000..1437c53f70bc2 --- /dev/null +++ b/examples/with-mqtt-js/.gitignore @@ -0,0 +1,34 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# vercel +.vercel diff --git a/scripts/check-examples.sh b/scripts/check-examples.sh index e1bd31cf06d34..15eeeec3bf173 100755 --- a/scripts/check-examples.sh +++ b/scripts/check-examples.sh @@ -1,8 +1,8 @@ #!/bin/bash for folder in examples/* ; do - cp -n packages/create-next-app/templates/default/gitignore $folder/.gitignore; if [ -f "$folder/package.json" ]; then + cp -n packages/create-next-app/templates/default/gitignore $folder/.gitignore; cat $folder/package.json | jq '.license = "MIT" | .private = true' | sponge $folder/package.json fi if [ -f "$folder/tsconfig.json" ]; then From 1552b8341e5b512a2827485a4a9689cd429c520e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A6=88=EB=88=85?= Date: Fri, 13 Aug 2021 07:26:44 +0900 Subject: [PATCH 2/2] Fix `generateBuildId` type that can be async function (#28040) [The current documentation ensures it can be async function](https://github.com/vercel/next.js/blob/v11.1.1-canary.1/docs/api-reference/next.config.js/configuring-the-build-id.md?plain=1#L13), so this PR fixes the TypeScript type of it. --- packages/next/build/generate-build-id.ts | 2 +- packages/next/server/config-shared.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/build/generate-build-id.ts b/packages/next/build/generate-build-id.ts index aed1d6c864e9a..af4f78763f38c 100644 --- a/packages/next/build/generate-build-id.ts +++ b/packages/next/build/generate-build-id.ts @@ -1,5 +1,5 @@ export async function generateBuildId( - generate: () => string | null, + generate: () => string | null | Promise, fallback: () => string ): Promise { let buildId = await generate() diff --git a/packages/next/server/config-shared.ts b/packages/next/server/config-shared.ts index 36ad014accc3c..c372c4568b461 100644 --- a/packages/next/server/config-shared.ts +++ b/packages/next/server/config-shared.ts @@ -70,7 +70,7 @@ export type NextConfig = { [key: string]: any } & { cleanDistDir?: boolean assetPrefix?: string useFileSystemPublicRoutes?: boolean - generateBuildId?: () => string | null + generateBuildId?: () => string | null | Promise generateEtags?: boolean pageExtensions?: string[] compress?: boolean