Skip to content

Commit 886917e

Browse files
committed
Merge branch 'main' into mk/canary-demo
2 parents f646397 + 05c24d2 commit 886917e

File tree

31 files changed

+618
-593
lines changed

31 files changed

+618
-593
lines changed

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"packages/runtime": "4.24.3",
2+
"packages/runtime": "4.26.0",
33
"packages/next": "1.3.1"
44
}

cypress/integration/middleware/standard.spec.ts

+8
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,11 @@ describe('Middleware matchers', () => {
4343
})
4444
})
4545
})
46+
47+
describe('Middleware with edge API', () => {
48+
it('serves API routes from the edge runtime', () => {
49+
cy.request('/api/edge').then((response) => {
50+
expect(response.body).to.include('Hello world')
51+
})
52+
})
53+
})

demos/base-path/netlify.toml

+5-6
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff
88
# so Netlify caches it
99
CYPRESS_CACHE_FOLDER = "../node_modules/.CypressBinary"
1010

11-
[dev]
12-
framework = "#static"
13-
1411
[[plugins]]
15-
package = "../plugin-wrapper/"
12+
package = "@netlify/plugin-nextjs"
1613

14+
# This is a fake plugin, that makes it run npm install
1715
[[plugins]]
1816
package = "@netlify/plugin-local-install-core"
19-
# [[context.deploy-preview.plugins]]
20-
# package = "netlify-plugin-cypress"
17+
18+
[[plugins]]
19+
package = "../plugin-wrapper"

demos/custom-routes/netlify.toml

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ command = "next build"
33
publish = ".next"
44
ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;"
55

6-
[dev]
7-
framework = "#static"
8-
96
[[plugins]]
10-
package = "../plugin-wrapper/"
7+
package = "@netlify/plugin-nextjs"
118

9+
# This is a fake plugin, that makes it run npm install
1210
[[plugins]]
1311
package = "@netlify/plugin-local-install-core"
14-
# [[context.deploy-preview.plugins]]
15-
# package = "netlify-plugin-cypress"
12+
13+
[[plugins]]
14+
package = "../plugin-wrapper"

demos/default/netlify.toml

+9-6
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@ TERM = "xterm"
1212
NODE_VERSION = "16.15.1"
1313

1414
[[headers]]
15-
for = "/_next/image/*"
16-
17-
[headers.values]
18-
Strict-Transport-Security = "max-age=31536000"
19-
X-Test = 'foobar'
15+
for = "/_next/image/*"
16+
17+
[headers.values]
18+
Strict-Transport-Security = "max-age=31536000"
19+
X-Test = 'foobar'
2020

2121
[[plugins]]
22-
package = "../plugin-wrapper/"
22+
package = "@netlify/plugin-nextjs"
2323

2424
# This is a fake plugin, that makes it run npm install
2525
[[plugins]]
2626
package = "@netlify/plugin-local-install-core"
27+
28+
[[plugins]]
29+
package = "../plugin-wrapper"

demos/middleware/netlify.toml

+3-8
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,14 @@ publish = ".next"
44
ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;"
55

66
[[plugins]]
7-
# Switch these when testing `ntl dev`
8-
# package = "@netlify/plugin-nextjs"
9-
package = "../plugin-wrapper/"
7+
package = "@netlify/plugin-nextjs"
108

119
# This is a fake plugin, that makes it run npm install
1210
[[plugins]]
1311
package = "@netlify/plugin-local-install-core"
1412

15-
[functions]
16-
included_files = [
17-
"!node_modules/sharp/vendor/8.12.2/darwin-*/**/*",
18-
"!node_modules/sharp/build/Release/sharp-darwin-*"
19-
]
13+
[[plugins]]
14+
package = "../plugin-wrapper"
2015
# Uncomment this if testing the built files rather than dev
2116
# [dev]
2217
# framework = "#static"

demos/middleware/pages/api/edge.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const config = {
2+
runtime: 'experimental-edge',
3+
}
4+
5+
export default (req) => new Response('Hello world!')

demos/next-auth/netlify.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff
77
TERM = "xterm"
88
NODE_VERSION = "17"
99

10-
[dev]
11-
framework = "#static"
12-
1310
[[plugins]]
14-
package = "../plugin-wrapper/"
11+
package = "@netlify/plugin-nextjs"
1512

1613
# This is a fake plugin, that makes it run npm install
1714
[[plugins]]
1815
package = "@netlify/plugin-local-install-core"
16+
17+
[[plugins]]
18+
package = "../plugin-wrapper"

demos/next-export/netlify.toml

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff
77
NETLIFY_NEXT_PLUGIN_SKIP = "true"
88
NODE_VERSION = "17"
99

10-
[dev]
11-
framework = "#static"
12-
1310
[[plugins]]
14-
package = "../plugin-wrapper/"
11+
package = "@netlify/plugin-nextjs"
1512

13+
# This is a fake plugin, that makes it run npm install
1614
[[plugins]]
1715
package = "@netlify/plugin-local-install-core"
16+
17+
[[plugins]]
18+
package = "../plugin-wrapper"

demos/next-i18next/netlify.toml

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ command = "next build"
33
publish = ".next"
44
ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;"
55

6-
[build.environment]
7-
TERM = "xterm"
8-
NODE_VERSION = "17"
9-
106
[[plugins]]
11-
package = "../plugin-wrapper/"
7+
package = "@netlify/plugin-nextjs"
128

139
# This is a fake plugin, that makes it run npm install
1410
[[plugins]]
1511
package = "@netlify/plugin-local-install-core"
12+
13+
[[plugins]]
14+
package = "../plugin-wrapper"

demos/next-with-edge-functions/netlify.toml

+3-7
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
command = "next build"
33
publish = ".next"
44

5-
[dev]
6-
framework = "#static"
7-
85
[[plugins]]
9-
package = "../plugin-wrapper/"
6+
package = "@netlify/plugin-nextjs"
107

118
# This is a fake plugin, that makes it run npm install
129
[[plugins]]
1310
package = "@netlify/plugin-local-install-core"
1411

15-
[[edge_functions]]
16-
path = "/"
17-
function = "helloOnTheEdge"
12+
[[plugins]]
13+
package = "../plugin-wrapper"

demos/nx-next-monorepo-demo/netlify.toml

+5-8
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ command = "npm run start"
88
targetPort = 4200
99

1010
[[plugins]]
11-
package = "../plugin-wrapper"
12-
13-
[build.environment]
14-
# cache Cypress binary in local "node_modules" folder
15-
# so Netlify caches it
16-
CYPRESS_CACHE_FOLDER = "../node_modules/.CypressBinary"
17-
# set TERM variable for terminal output
18-
TERM = "xterm"
11+
package = "@netlify/plugin-nextjs"
1912

13+
# This is a fake plugin, that makes it run npm install
2014
[[plugins]]
2115
package = "@netlify/plugin-local-install-core"
16+
17+
[[plugins]]
18+
package = "../plugin-wrapper"

demos/nx-next-monorepo-demo/package-lock.json

+13-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/nx-next-monorepo-demo/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"next": "12.3.1",
1515
"react": "18.2.0",
1616
"react-dom": "18.2.0",
17-
"regenerator-runtime": "0.13.7",
17+
"regenerator-runtime": "0.13.10",
1818
"tslib": "^2.3.0"
1919
},
2020
"devDependencies": {

demos/plugin-wrapper/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# plugin-wrapper
2+
3+
This empty plugin exists to ensure the demo sites can use `"@netlify/plugin-local-install-core"` to run `npm install`,
4+
which in turn builds the runtime package. This is needed because `npm install` isn't run in the site if the dependencies
5+
are unchanged.

demos/plugin-wrapper/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
// eslint-disable-next-line n/no-unpublished-require
2-
module.exports = require('../../packages/runtime/lib')
1+
module.exports = {}

demos/server-components/netlify.toml

+3-9
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,11 @@ publish = ".next"
44
ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;"
55

66
[[plugins]]
7-
package = "../plugin-wrapper/"
7+
package = "@netlify/plugin-nextjs"
88

99
# This is a fake plugin, that makes it run npm install
1010
[[plugins]]
1111
package = "@netlify/plugin-local-install-core"
1212

13-
[functions]
14-
included_files = [
15-
"!node_modules/sharp/vendor/8.12.2/darwin-*/**/*",
16-
"!node_modules/sharp/build/Release/sharp-darwin-*"
17-
]
18-
19-
[dev]
20-
framework = "#static"
13+
[[plugins]]
14+
package = "../plugin-wrapper"

demos/static-root/netlify.toml

+5-10
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,12 @@ command = "next build"
33
publish = ".next"
44
ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;"
55

6-
[build.environment]
7-
# cache Cypress binary in local "node_modules" folder
8-
# so Netlify caches it
9-
CYPRESS_CACHE_FOLDER = "../node_modules/.CypressBinary"
10-
NODE_VERSION = "17"
11-
12-
[dev]
13-
framework = "#static"
14-
156
[[plugins]]
16-
package = "../plugin-wrapper/"
7+
package = "@netlify/plugin-nextjs"
178

9+
# This is a fake plugin, that makes it run npm install
1810
[[plugins]]
1911
package = "@netlify/plugin-local-install-core"
12+
13+
[[plugins]]
14+
package = "../plugin-wrapper"

demos/turborepo-next-monorepo-demo/netlify.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ publish = "apps/web/.next"
99
command = "npm run dev"
1010

1111
[[plugins]]
12-
package = "./packages/local-plugin"
12+
package = "@netlify/plugin-nextjs"
1313

14+
# This is a fake plugin, that makes it run npm install
1415
[[plugins]]
1516
package = "@netlify/plugin-local-install-core"
1617

18+
[[plugins]]
19+
package = "../plugin-wrapper"
20+
1721
[[edge_functions]]
1822
path = "/edge"
1923
function = "edge"

0 commit comments

Comments
 (0)