Skip to content

chore: rearrange plugin wrapper #1668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions demos/base-path/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff
# so Netlify caches it
CYPRESS_CACHE_FOLDER = "../node_modules/.CypressBinary"

[dev]
framework = "#static"

[[plugins]]
package = "../plugin-wrapper/"
package = "@netlify/plugin-nextjs"

# This is a fake plugin, that makes it run npm install
[[plugins]]
package = "@netlify/plugin-local-install-core"
# [[context.deploy-preview.plugins]]
# package = "netlify-plugin-cypress"

[[plugins]]
package = "../plugin-wrapper"
11 changes: 5 additions & 6 deletions demos/custom-routes/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ command = "next build"
publish = ".next"
ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;"

[dev]
framework = "#static"

[[plugins]]
package = "../plugin-wrapper/"
package = "@netlify/plugin-nextjs"

# This is a fake plugin, that makes it run npm install
[[plugins]]
package = "@netlify/plugin-local-install-core"
# [[context.deploy-preview.plugins]]
# package = "netlify-plugin-cypress"

[[plugins]]
package = "../plugin-wrapper"
15 changes: 9 additions & 6 deletions demos/default/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ TERM = "xterm"
NODE_VERSION = "16.15.1"

[[headers]]
for = "/_next/image/*"
[headers.values]
Strict-Transport-Security = "max-age=31536000"
X-Test = 'foobar'
for = "/_next/image/*"

[headers.values]
Strict-Transport-Security = "max-age=31536000"
X-Test = 'foobar'

[[plugins]]
package = "../plugin-wrapper/"
package = "@netlify/plugin-nextjs"

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

[[plugins]]
package = "../plugin-wrapper"
11 changes: 3 additions & 8 deletions demos/middleware/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,14 @@ publish = ".next"
ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;"

[[plugins]]
# Switch these when testing `ntl dev`
# package = "@netlify/plugin-nextjs"
package = "../plugin-wrapper/"
package = "@netlify/plugin-nextjs"

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

[functions]
included_files = [
"!node_modules/sharp/vendor/8.12.2/darwin-*/**/*",
"!node_modules/sharp/build/Release/sharp-darwin-*"
]
[[plugins]]
package = "../plugin-wrapper"
# Uncomment this if testing the built files rather than dev
# [dev]
# framework = "#static"
Expand Down
8 changes: 4 additions & 4 deletions demos/next-auth/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff
TERM = "xterm"
NODE_VERSION = "17"

[dev]
framework = "#static"

[[plugins]]
package = "../plugin-wrapper/"
package = "@netlify/plugin-nextjs"

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

[[plugins]]
package = "../plugin-wrapper"
9 changes: 5 additions & 4 deletions demos/next-export/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff
NETLIFY_NEXT_PLUGIN_SKIP = "true"
NODE_VERSION = "17"

[dev]
framework = "#static"

[[plugins]]
package = "../plugin-wrapper/"
package = "@netlify/plugin-nextjs"

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

[[plugins]]
package = "../plugin-wrapper"
9 changes: 4 additions & 5 deletions demos/next-i18next/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ command = "next build"
publish = ".next"
ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;"

[build.environment]
TERM = "xterm"
NODE_VERSION = "17"

[[plugins]]
package = "../plugin-wrapper/"
package = "@netlify/plugin-nextjs"

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

[[plugins]]
package = "../plugin-wrapper"
10 changes: 3 additions & 7 deletions demos/next-with-edge-functions/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
command = "next build"
publish = ".next"

[dev]
framework = "#static"

[[plugins]]
package = "../plugin-wrapper/"
package = "@netlify/plugin-nextjs"

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

[[edge_functions]]
path = "/"
function = "helloOnTheEdge"
[[plugins]]
package = "../plugin-wrapper"
13 changes: 5 additions & 8 deletions demos/nx-next-monorepo-demo/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@ command = "npm run start"
targetPort = 4200

[[plugins]]
package = "../plugin-wrapper"

[build.environment]
# cache Cypress binary in local "node_modules" folder
# so Netlify caches it
CYPRESS_CACHE_FOLDER = "../node_modules/.CypressBinary"
# set TERM variable for terminal output
TERM = "xterm"
package = "@netlify/plugin-nextjs"

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

[[plugins]]
package = "../plugin-wrapper"
5 changes: 5 additions & 0 deletions demos/plugin-wrapper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# plugin-wrapper

This empty plugin exists to ensure the demo sites can use `"@netlify/plugin-local-install-core"` to run `npm install`,
which in turn builds the runtime package. This is needed because `npm install` isn't run in the site if the dependencies
are unchanged.
3 changes: 1 addition & 2 deletions demos/plugin-wrapper/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// eslint-disable-next-line n/no-unpublished-require
module.exports = require('../../packages/runtime/lib')
module.exports = {}
12 changes: 3 additions & 9 deletions demos/server-components/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@ publish = ".next"
ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;"

[[plugins]]
package = "../plugin-wrapper/"
package = "@netlify/plugin-nextjs"

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

[functions]
included_files = [
"!node_modules/sharp/vendor/8.12.2/darwin-*/**/*",
"!node_modules/sharp/build/Release/sharp-darwin-*"
]

[dev]
framework = "#static"
[[plugins]]
package = "../plugin-wrapper"
15 changes: 5 additions & 10 deletions demos/static-root/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@ command = "next build"
publish = ".next"
ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;"

[build.environment]
# cache Cypress binary in local "node_modules" folder
# so Netlify caches it
CYPRESS_CACHE_FOLDER = "../node_modules/.CypressBinary"
NODE_VERSION = "17"

[dev]
framework = "#static"

[[plugins]]
package = "../plugin-wrapper/"
package = "@netlify/plugin-nextjs"

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

[[plugins]]
package = "../plugin-wrapper"
6 changes: 5 additions & 1 deletion demos/turborepo-next-monorepo-demo/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ publish = "apps/web/.next"
command = "npm run dev"

[[plugins]]
package = "./packages/local-plugin"
package = "@netlify/plugin-nextjs"

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

[[plugins]]
package = "../plugin-wrapper"

[[edge_functions]]
path = "/edge"
function = "edge"

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading