From d5eae31f706710d318d08203b9d72d826b8dbb7c Mon Sep 17 00:00:00 2001 From: Nick Taylor Date: Fri, 11 Aug 2023 09:52:02 -0400 Subject: [PATCH 1/2] chore: move to paths relative to monorepo root for new monorepo support --- demos/base-path/netlify.toml | 8 ++++---- demos/canary/netlify.toml | 6 +++--- demos/custom-routes/netlify.toml | 6 +++--- demos/default/netlify.toml | 10 +++++----- demos/middleware/netlify.toml | 8 ++++---- demos/next-auth/netlify.toml | 8 ++++---- demos/next-export/netlify.toml | 8 ++++---- demos/next-export/package.json | 1 + demos/next-i18next/netlify.toml | 8 ++++---- demos/next-with-edge-functions/netlify.toml | 6 +++--- demos/nx-next-monorepo-demo/netlify.toml | 8 ++++---- demos/static-root/netlify.toml | 8 ++++---- 12 files changed, 43 insertions(+), 42 deletions(-) diff --git a/demos/base-path/netlify.toml b/demos/base-path/netlify.toml index 5f177303b5..b074dc08cf 100644 --- a/demos/base-path/netlify.toml +++ b/demos/base-path/netlify.toml @@ -1,12 +1,12 @@ [build] -command = "next build" -publish = ".next" +command = "npm run build -w demos/base-path" +publish = "demos/base-path/.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" +CYPRESS_CACHE_FOLDER = "node_modules/.CypressBinary" [[plugins]] package = "@netlify/plugin-nextjs" @@ -16,4 +16,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "../plugin-wrapper" +package = "demos/plugin-wrapper" diff --git a/demos/canary/netlify.toml b/demos/canary/netlify.toml index 72f2054ba7..11ca2e6161 100644 --- a/demos/canary/netlify.toml +++ b/demos/canary/netlify.toml @@ -1,6 +1,6 @@ [build] -command = "next build" -publish = ".next" +command = "npm run build -w demos/canary" +publish = "demos/canary/.next" ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;" [build.environment] @@ -15,4 +15,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "../plugin-wrapper" +package = "demos/plugin-wrapper" diff --git a/demos/custom-routes/netlify.toml b/demos/custom-routes/netlify.toml index 86b1877202..aa24a141fd 100644 --- a/demos/custom-routes/netlify.toml +++ b/demos/custom-routes/netlify.toml @@ -1,6 +1,6 @@ [build] -command = "next build" -publish = ".next" +command = "npm run build -w demos/custom-routes" +publish = "demos/custom-routes/.next" ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;" [[plugins]] @@ -11,4 +11,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "../plugin-wrapper" +package = "demos/plugin-wrapper" diff --git a/demos/default/netlify.toml b/demos/default/netlify.toml index 61c0e4b2a1..9dfa9446b7 100644 --- a/demos/default/netlify.toml +++ b/demos/default/netlify.toml @@ -1,12 +1,12 @@ [build] -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;" +command = "npm run build -w demos/default" +publish = "demos/default/.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" +CYPRESS_CACHE_FOLDER = "node_modules/.CypressBinary" # set TERM variable for terminal output TERM = "xterm" NODE_VERSION = "16.15.1" @@ -28,4 +28,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "../plugin-wrapper" +package = "demos/plugin-wrapper" diff --git a/demos/middleware/netlify.toml b/demos/middleware/netlify.toml index 0aac8b1df0..cb1d715b49 100644 --- a/demos/middleware/netlify.toml +++ b/demos/middleware/netlify.toml @@ -1,7 +1,7 @@ [build] -command = "npm run build" -publish = ".next" -ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;" +command = "npm run build -w demos/middleware" +publish = "demos/middleware/.next" +ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ./; fi;" [build.environment] NEXT_SPLIT_API_ROUTES = "true" @@ -15,7 +15,7 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "../plugin-wrapper" +package = "demos/plugin-wrapper" # Uncomment this if testing the built files rather than dev # [dev] # framework = "#static" diff --git a/demos/next-auth/netlify.toml b/demos/next-auth/netlify.toml index 08fd64f70b..229ace679d 100644 --- a/demos/next-auth/netlify.toml +++ b/demos/next-auth/netlify.toml @@ -1,7 +1,7 @@ [build] -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;" +command = "npm run build -w demos/next-auth" +publish = "demos/next-auth/.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" @@ -14,4 +14,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "../plugin-wrapper" +package = "demos/plugin-wrapper" diff --git a/demos/next-export/netlify.toml b/demos/next-export/netlify.toml index af12f4fff9..7a23d01ece 100644 --- a/demos/next-export/netlify.toml +++ b/demos/next-export/netlify.toml @@ -1,7 +1,7 @@ [build] -command = "next build && next export" -publish = "out" -ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;" +command = "npm run build -w demos/next-export" +publish = "demos/next-export/out" +ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ./; fi;" [build.environment] NETLIFY_NEXT_PLUGIN_SKIP = "true" @@ -14,4 +14,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "../plugin-wrapper" +package = "demos/plugin-wrapper" diff --git a/demos/next-export/package.json b/demos/next-export/package.json index 94c7336aa3..040fe8f1b4 100644 --- a/demos/next-export/package.json +++ b/demos/next-export/package.json @@ -17,6 +17,7 @@ "typescript": "^4.6.3" }, "scripts": { + "build": "next build && next export", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { diff --git a/demos/next-i18next/netlify.toml b/demos/next-i18next/netlify.toml index 86b1877202..89b1610330 100644 --- a/demos/next-i18next/netlify.toml +++ b/demos/next-i18next/netlify.toml @@ -1,7 +1,7 @@ [build] -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;" +command = "npm run build -w demos/next-i18next" +publish = "demos/next-i18next/.next" +ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ./; fi;" [[plugins]] package = "@netlify/plugin-nextjs" @@ -11,4 +11,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "../plugin-wrapper" +package = "demos/plugin-wrapper" diff --git a/demos/next-with-edge-functions/netlify.toml b/demos/next-with-edge-functions/netlify.toml index 88c1a087f5..7870b65182 100644 --- a/demos/next-with-edge-functions/netlify.toml +++ b/demos/next-with-edge-functions/netlify.toml @@ -1,6 +1,6 @@ [build] -command = "next build" -publish = ".next" +command = "npm run build -w demos/next-with-edge-functions" +publish = "demos/next-with-edge-functions/.next" [[plugins]] package = "@netlify/plugin-nextjs" @@ -10,4 +10,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "../plugin-wrapper" +package = "demos/plugin-wrapper" diff --git a/demos/nx-next-monorepo-demo/netlify.toml b/demos/nx-next-monorepo-demo/netlify.toml index 06ab9c9677..dedb35da10 100644 --- a/demos/nx-next-monorepo-demo/netlify.toml +++ b/demos/nx-next-monorepo-demo/netlify.toml @@ -1,18 +1,18 @@ [build] -command = "npm run build" +command = "npm run build -w demos/nx-next-monorepo-demo" publish = "dist/apps/demo-monorepo/.next" -ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;" +ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ./; fi;" [build.environment] NEXT_SPLIT_API_ROUTES = "true" NEXT_BUNDLE_BASED_ON_NFT_FILES = "true" [dev] -command = "npm run start" +command = "npm run start -w demos/nx-next-monorepo-demo" targetPort = 4200 [[plugins]] -package = "../plugin-wrapper" +package = "demos/plugin-wrapper" [[plugins]] package = "@netlify/plugin-nextjs" diff --git a/demos/static-root/netlify.toml b/demos/static-root/netlify.toml index 72f2054ba7..d695a0750b 100644 --- a/demos/static-root/netlify.toml +++ b/demos/static-root/netlify.toml @@ -1,7 +1,7 @@ [build] -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;" +command = "npm run build -w demos/static-root" +publish = "demos/static-root/.next" +ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ./; fi;" [build.environment] NEXT_SPLIT_API_ROUTES = "true" @@ -15,4 +15,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "../plugin-wrapper" +package = "demos/plugin-wrapper" From 49c61086546f7867a5d05aedd20c3bc63e3d0d1c Mon Sep 17 00:00:00 2001 From: Nick Taylor Date: Fri, 11 Aug 2023 11:04:50 -0400 Subject: [PATCH 2/2] chore: updated plugin path so it's not recognized as a plugin package --- demos/base-path/netlify.toml | 2 +- demos/canary/netlify.toml | 2 +- demos/custom-routes/netlify.toml | 2 +- demos/default/netlify.toml | 2 +- demos/middleware/netlify.toml | 2 +- demos/next-auth/netlify.toml | 2 +- demos/next-export/netlify.toml | 2 +- demos/next-i18next/netlify.toml | 2 +- demos/next-with-edge-functions/netlify.toml | 2 +- demos/nx-next-monorepo-demo/netlify.toml | 2 +- demos/static-root/netlify.toml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/demos/base-path/netlify.toml b/demos/base-path/netlify.toml index b074dc08cf..cac8c4710a 100644 --- a/demos/base-path/netlify.toml +++ b/demos/base-path/netlify.toml @@ -16,4 +16,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "demos/plugin-wrapper" +package = "./demos/plugin-wrapper" diff --git a/demos/canary/netlify.toml b/demos/canary/netlify.toml index 11ca2e6161..97804ebad2 100644 --- a/demos/canary/netlify.toml +++ b/demos/canary/netlify.toml @@ -15,4 +15,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "demos/plugin-wrapper" +package = "./demos/plugin-wrapper" diff --git a/demos/custom-routes/netlify.toml b/demos/custom-routes/netlify.toml index aa24a141fd..4aa2b37bc7 100644 --- a/demos/custom-routes/netlify.toml +++ b/demos/custom-routes/netlify.toml @@ -11,4 +11,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "demos/plugin-wrapper" +package = "./demos/plugin-wrapper" diff --git a/demos/default/netlify.toml b/demos/default/netlify.toml index 9dfa9446b7..a2e981e1de 100644 --- a/demos/default/netlify.toml +++ b/demos/default/netlify.toml @@ -28,4 +28,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "demos/plugin-wrapper" +package = "./demos/plugin-wrapper" diff --git a/demos/middleware/netlify.toml b/demos/middleware/netlify.toml index cb1d715b49..b073c1ee0a 100644 --- a/demos/middleware/netlify.toml +++ b/demos/middleware/netlify.toml @@ -15,7 +15,7 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "demos/plugin-wrapper" +package = "./demos/plugin-wrapper" # Uncomment this if testing the built files rather than dev # [dev] # framework = "#static" diff --git a/demos/next-auth/netlify.toml b/demos/next-auth/netlify.toml index 229ace679d..0ef411f203 100644 --- a/demos/next-auth/netlify.toml +++ b/demos/next-auth/netlify.toml @@ -14,4 +14,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "demos/plugin-wrapper" +package = "./demos/plugin-wrapper" diff --git a/demos/next-export/netlify.toml b/demos/next-export/netlify.toml index 7a23d01ece..df3050b510 100644 --- a/demos/next-export/netlify.toml +++ b/demos/next-export/netlify.toml @@ -14,4 +14,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "demos/plugin-wrapper" +package = "./demos/plugin-wrapper" diff --git a/demos/next-i18next/netlify.toml b/demos/next-i18next/netlify.toml index 89b1610330..9a3743fba6 100644 --- a/demos/next-i18next/netlify.toml +++ b/demos/next-i18next/netlify.toml @@ -11,4 +11,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "demos/plugin-wrapper" +package = "./demos/plugin-wrapper" diff --git a/demos/next-with-edge-functions/netlify.toml b/demos/next-with-edge-functions/netlify.toml index 7870b65182..c50f1f924e 100644 --- a/demos/next-with-edge-functions/netlify.toml +++ b/demos/next-with-edge-functions/netlify.toml @@ -10,4 +10,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "demos/plugin-wrapper" +package = "./demos/plugin-wrapper" diff --git a/demos/nx-next-monorepo-demo/netlify.toml b/demos/nx-next-monorepo-demo/netlify.toml index dedb35da10..3d4861d120 100644 --- a/demos/nx-next-monorepo-demo/netlify.toml +++ b/demos/nx-next-monorepo-demo/netlify.toml @@ -12,7 +12,7 @@ command = "npm run start -w demos/nx-next-monorepo-demo" targetPort = 4200 [[plugins]] -package = "demos/plugin-wrapper" +package = "./demos/plugin-wrapper" [[plugins]] package = "@netlify/plugin-nextjs" diff --git a/demos/static-root/netlify.toml b/demos/static-root/netlify.toml index d695a0750b..73a78f8403 100644 --- a/demos/static-root/netlify.toml +++ b/demos/static-root/netlify.toml @@ -15,4 +15,4 @@ package = "@netlify/plugin-nextjs" package = "@netlify/plugin-local-install-core" [[plugins]] -package = "demos/plugin-wrapper" +package = "./demos/plugin-wrapper"