Skip to content

Commit e6bbabe

Browse files
committed
Merge branch 'main' into mk/ttl-support
Release-as: 4.0.0-beta.12
2 parents fd48686 + 38fdd62 commit e6bbabe

Some content is hidden

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

57 files changed

+39
-21
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,6 @@ Temporary Items
143143

144144
# CLI
145145
.netlify
146-
demo/.next
146+
demos/default/.next
147147
.parcel-cache
148148
lib

CHANGELOG.md

+18

cypress/config/ci.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"baseUrl": "http://localhost:3000",
3-
"integrationFolder": "../cypress/integration",
4-
"pluginsFile": "../cypress/plugins",
5-
"screenshotsFolder": "../cypress/screenshots",
6-
"supportFile": "../cypress/support/index.js",
7-
"videoFolder": "../cypress/videos"
3+
"integrationFolder": "../../cypress/integration",
4+
"pluginsFile": "../../cypress/plugins",
5+
"screenshotsFolder": "../../cypress/screenshots",
6+
"supportFile": "../../cypress/support/index.js",
7+
"videoFolder": "../../cypress/videos"
88
}

cypress/integration/preview.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ describe('Preview Mode', () => {
22
it('enters and exits preview mode', () => {
33
// preview mode is off by default
44
cy.visit('/previewTest')
5-
cy.findByText('Number: 4')
5+
cy.findByText('Is preview? No')
66

77
// enter preview mode
88
cy.request('/api/enterPreview').then(
@@ -11,11 +11,11 @@ describe('Preview Mode', () => {
1111
}
1212
)
1313
cy.visit('/previewTest')
14-
cy.findByText('Number: 3')
14+
cy.findByText('Is preview? Yes!')
1515

1616
// exit preview mode
1717
cy.request('/api/exitPreview')
1818
cy.visit('/previewTest')
19-
cy.findByText('Number: 4')
19+
cy.findByText('Is preview? No')
2020
})
2121
})

demo/local-plugin/index.js

-1
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

demos/default/local-plugin/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('../../../lib')

demo/netlify.toml renamed to demos/default/netlify.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ package = "@netlify/plugin-local-install-core"
2121
package = "netlify-plugin-cypress"
2222

2323
[context.deploy-preview.plugins.inputs]
24-
configFile = "../cypress/config/ci.json"
24+
configFile = "../../cypress/config/ci.json"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

netlify.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[build]
2-
base="demo/"
2+
base="demos/default"

package-lock.json

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

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"name": "@netlify/plugin-nextjs",
3-
"version": "4.0.0-beta.9",
3+
"version": "4.0.0-beta.11",
44
"description": "Run Next.js seamlessly on Netlify",
55
"main": "lib/index.js",
66
"files": [
77
"lib/**/*",
88
"manifest.yml"
99
],
1010
"scripts": {
11-
"build:demo": "next build demo",
11+
"build:demo": "next build demos/default",
1212
"cy:open": "cypress open --config-file cypress/config/all.json",
13-
"cy:run": "cypress run --config-file ../cypress/config/ci.json",
14-
"dev:demo": "next dev demo",
13+
"cy:run": "cypress run --config-file ../../cypress/config/ci.json",
14+
"dev:demo": "next dev demos/default",
1515
"format": "run-s format:check-fix:*",
1616
"format:ci": "run-s format:check:*",
1717
"format:check-fix:lint": "run-e format:check:lint format:fix:lint",

src/helpers/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ exports.generateRedirects = async ({ netlifyConfig, basePath, i18n }) => {
8383
// These can be ignored, as they're static files handled by the CDN
8484
return
8585
}
86-
if (i18n.defaultLocale && route.startsWith(`/${i18n.defaultLocale}/`)) {
86+
if (i18n?.defaultLocale && route.startsWith(`/${i18n.defaultLocale}/`)) {
8787
route = route.slice(i18n.defaultLocale.length + 1)
8888
}
8989
hasIsr = true

test/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const { join } = require('pathe')
1313
const { matchMiddleware, stripLocale, matchesRedirect, matchesRewrite } = require('../src/helpers/files')
1414

1515
const FIXTURES_DIR = `${__dirname}/fixtures`
16-
const SAMPLE_PROJECT_DIR = `${__dirname}/../demo`
16+
const SAMPLE_PROJECT_DIR = `${__dirname}/../demos/default`
1717
const constants = {
1818
INTERNAL_FUNCTIONS_SRC: '.netlify/internal-functions',
1919
PUBLISH_DIR: '.next',
@@ -302,7 +302,7 @@ describe('onBuild()', () => {
302302
'.next/BUILD_ID',
303303
'.next/static/chunks/webpack-middleware*.js',
304304
'!.next/server/**/*.js.nft.json',
305-
'!../node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*',
305+
'!../../node_modules/next/dist/compiled/@ampproject/toolbox-optimizer/**/*',
306306
`!node_modules/next/dist/server/lib/squoosh/**/*.wasm`,
307307
`!node_modules/next/dist/next-server/server/lib/squoosh/**/*.wasm`,
308308
'!node_modules/next/dist/compiled/webpack/bundle4.js',

0 commit comments

Comments
 (0)