Skip to content

Commit f847729

Browse files
committed
Merge branch 'main' into mk/wasm-support
2 parents 3563bb8 + 05a9d58 commit f847729

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+521
-1375
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.27.1",
2+
"packages/runtime": "4.27.3",
33
"packages/next": "1.3.1"
44
}

cypress/integration/middleware/enhanced.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('Enhanced middleware', () => {
1818
})
1919

2020
it('modifies the page props', () => {
21-
cy.request('/_next/data/build-id/static.json').then((response) => {
21+
cy.request('/_next/data/build-id/en/static.json').then((response) => {
2222
expect(response.body).to.have.nested.property('pageProps.showAd', true)
2323
expect(response.body)
2424
.to.have.nested.property('pageProps.message')

cypress/integration/middleware/standard.spec.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,22 @@ describe('Middleware matchers', () => {
3737
})
3838

3939
it('matches when headers are sent', () => {
40-
cy.request('/_next/data/build-id/static.json').then((response) => {
40+
cy.request('/_next/data/build-id/en/static.json').then((response) => {
4141
expect(response.headers).to.have.property('x-is-deno', 'true')
4242
expect(response.headers).to.have.property('x-modified-edge', 'true')
4343
})
4444
})
45+
46+
it('correctly handles negative lookaheads', () => {
47+
cy.request('/shows/11').then((response) => {
48+
expect(response.headers).to.have.property('x-is-deno', 'true')
49+
expect(response.headers).to.have.property('x-modified-edge', 'true')
50+
})
51+
cy.request('/shows/99').then((response) => {
52+
expect(response.headers).not.to.have.property('x-is-deno', 'true')
53+
expect(response.headers).not.to.have.property('x-modified-edge', 'true')
54+
})
55+
})
4556
})
4657

4758
describe('Middleware with edge API', () => {

cypress/integration/nx/general.spec.ts

+7
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,11 @@ describe('Default site', () => {
1616
expect(res.headers['content-type']).to.match(/javascript/)
1717
})
1818
})
19+
20+
it('serves API routes', () => {
21+
cy.request('/api/hello').then((res) => {
22+
expect(res.status).to.eq(200)
23+
expect(res.body).to.deep.eq({ body: 'Hello world' })
24+
})
25+
})
1926
})

demos/middleware/middleware.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const config = {
9494
'/api/:all*',
9595
'/headers',
9696
{ source: '/static' },
97-
{ source: '/shows/:all*' },
97+
{ source: '/shows/((?!99|88).*)' },
9898
{
9999
source: '/conditional',
100100
has: [

demos/middleware/next.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ const nextConfig = {
77
ignoreDuringBuilds: true,
88
},
99
generateBuildId: () => 'build-id',
10+
i18n: {
11+
defaultLocale: 'en',
12+
locales: ['en'],
13+
},
1014
}
1115

1216
module.exports = nextConfig

demos/nx-next-monorepo-demo/libs/.gitkeep

Whitespace-only changes.

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

+3-3
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
command = "npm run start"
88
targetPort = 4200
99

10+
[[plugins]]
11+
package = "../plugin-wrapper"
12+
1013
[[plugins]]
1114
package = "@netlify/plugin-nextjs"
1215

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

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

+67-12
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
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
},
1010
"private": true,
1111
"dependencies": {
12+
"@netlify/plugin-nextjs": "file:plugin-wrapper",
1213
"@nrwl/next": "14.7.11",
1314
"core-js": "^3.6.5",
1415
"next": "12.3.1",
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.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("../../../packages/runtime")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
name: '@netlify/plugin-nextjs'

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

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "local-plugin",
3+
"version": "1.0.0-alpha-local-wrapper",
4+
"main": "index.js",
5+
"license": "MIT",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
}
9+
}

demos/server-components/README.md

-34
This file was deleted.

demos/server-components/components/comment-form.js

-22
This file was deleted.

0 commit comments

Comments
 (0)