From 753d32b272a468091d286b13e2283acf73d96cb9 Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 5 Aug 2024 16:46:47 +0300 Subject: [PATCH 01/12] [code-infra] Set explicit Netlify `base` folder --- netlify.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/netlify.toml b/netlify.toml index 767f5a910c795..abc7586dd818a 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,6 +3,7 @@ # HTML files and assets generated by the build. If a base directory has # been specified, include it in the publish directory path. publish = "docs/export/" + base = "/docs" # Default build command. command = "pnpm docs:build" From cf0ddb63657418a89da9c4ad7d7e678829cfeb5a Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 5 Aug 2024 16:55:19 +0300 Subject: [PATCH 02/12] test paths --- netlify.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/netlify.toml b/netlify.toml index abc7586dd818a..cb2e1d9b7ed76 100644 --- a/netlify.toml +++ b/netlify.toml @@ -2,8 +2,8 @@ # Directory (relative to root of your repo) that contains the deploy-ready # HTML files and assets generated by the build. If a base directory has # been specified, include it in the publish directory path. - publish = "docs/export/" - base = "/docs" + publish = "export/" + base = "docs/" # Default build command. command = "pnpm docs:build" @@ -14,4 +14,4 @@ PNPM_FLAGS = "--shamefully-hoist" [[plugins]] - package = "./node_modules/@mui/monorepo/packages/netlify-plugin-cache-docs" + package = "../node_modules/@mui/monorepo/packages/netlify-plugin-cache-docs" From f7a1d266d243001ec664fbb9e2771cf396c181f4 Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 5 Aug 2024 17:02:23 +0300 Subject: [PATCH 03/12] Use `docs` package command --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index cb2e1d9b7ed76..445e81e0514a9 100644 --- a/netlify.toml +++ b/netlify.toml @@ -6,7 +6,7 @@ base = "docs/" # Default build command. - command = "pnpm docs:build" + command = "pnpm build" [build.environment] NODE_VERSION = "18" From 2b97a5eb8dae92a46f07b44ca8ba6a7c979f3fed Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 5 Aug 2024 17:47:36 +0300 Subject: [PATCH 04/12] Move netlify functions relate to the new `base` --- {netlify => docs/netlify}/functions/deploy-succeeded.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {netlify => docs/netlify}/functions/deploy-succeeded.js (100%) diff --git a/netlify/functions/deploy-succeeded.js b/docs/netlify/functions/deploy-succeeded.js similarity index 100% rename from netlify/functions/deploy-succeeded.js rename to docs/netlify/functions/deploy-succeeded.js From 38bcc9ef09a2c053110fc5b48e9c38e42eab63d4 Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 5 Aug 2024 17:48:56 +0300 Subject: [PATCH 05/12] Add ESLint ignore --- docs/netlify/functions/deploy-succeeded.js | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/netlify/functions/deploy-succeeded.js b/docs/netlify/functions/deploy-succeeded.js index d59ce476da813..385bec41de9c5 100644 --- a/docs/netlify/functions/deploy-succeeded.js +++ b/docs/netlify/functions/deploy-succeeded.js @@ -1,3 +1,4 @@ +// eslint-disable-next-line import/no-unresolved const fetch = require('node-fetch'); /** From 64a63190009ce0e3e9e63bd4c88e713cc238f843 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 7 Aug 2024 10:52:36 +0300 Subject: [PATCH 06/12] Revert `base` directory changes --- netlify.toml | 7 +++---- {docs/netlify => netlify}/functions/deploy-succeeded.js | 0 2 files changed, 3 insertions(+), 4 deletions(-) rename {docs/netlify => netlify}/functions/deploy-succeeded.js (100%) diff --git a/netlify.toml b/netlify.toml index 445e81e0514a9..767f5a910c795 100644 --- a/netlify.toml +++ b/netlify.toml @@ -2,11 +2,10 @@ # Directory (relative to root of your repo) that contains the deploy-ready # HTML files and assets generated by the build. If a base directory has # been specified, include it in the publish directory path. - publish = "export/" - base = "docs/" + publish = "docs/export/" # Default build command. - command = "pnpm build" + command = "pnpm docs:build" [build.environment] NODE_VERSION = "18" @@ -14,4 +13,4 @@ PNPM_FLAGS = "--shamefully-hoist" [[plugins]] - package = "../node_modules/@mui/monorepo/packages/netlify-plugin-cache-docs" + package = "./node_modules/@mui/monorepo/packages/netlify-plugin-cache-docs" diff --git a/docs/netlify/functions/deploy-succeeded.js b/netlify/functions/deploy-succeeded.js similarity index 100% rename from docs/netlify/functions/deploy-succeeded.js rename to netlify/functions/deploy-succeeded.js From d8091e074c82d12ccdbd46e3da0c39f6ff46d13d Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 7 Aug 2024 11:18:14 +0300 Subject: [PATCH 07/12] Try using re-exported `netlify-plugin-cache-docs` --- netlify.toml | 2 +- packages/netlify-plugin-cache-docs/index.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 packages/netlify-plugin-cache-docs/index.js diff --git a/netlify.toml b/netlify.toml index 767f5a910c795..25bf422e747a5 100644 --- a/netlify.toml +++ b/netlify.toml @@ -13,4 +13,4 @@ PNPM_FLAGS = "--shamefully-hoist" [[plugins]] - package = "./node_modules/@mui/monorepo/packages/netlify-plugin-cache-docs" + package = "./packages/netlify-plugin-cache-docs" diff --git a/packages/netlify-plugin-cache-docs/index.js b/packages/netlify-plugin-cache-docs/index.js new file mode 100644 index 0000000000000..e8530f898af36 --- /dev/null +++ b/packages/netlify-plugin-cache-docs/index.js @@ -0,0 +1 @@ +module.exports = require('@mui/monorepo/packages/netlify-plugin-cache-docs'); From 59d8160b2527b37e69b5cef803f51a40d699bc13 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 7 Aug 2024 11:21:06 +0300 Subject: [PATCH 08/12] Add plugin manifest --- packages/netlify-plugin-cache-docs/manifest.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/netlify-plugin-cache-docs/manifest.yml diff --git a/packages/netlify-plugin-cache-docs/manifest.yml b/packages/netlify-plugin-cache-docs/manifest.yml new file mode 100644 index 0000000000000..46be74dddcce9 --- /dev/null +++ b/packages/netlify-plugin-cache-docs/manifest.yml @@ -0,0 +1 @@ +name: netlify-plugin-cache-docs From 89f97fddd1db36b37f1d5bc7ce38c7dd426229fe Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 7 Aug 2024 11:51:40 +0300 Subject: [PATCH 09/12] Remove no longer necessary comment --- netlify/functions/deploy-succeeded.js | 1 - 1 file changed, 1 deletion(-) diff --git a/netlify/functions/deploy-succeeded.js b/netlify/functions/deploy-succeeded.js index 385bec41de9c5..d59ce476da813 100644 --- a/netlify/functions/deploy-succeeded.js +++ b/netlify/functions/deploy-succeeded.js @@ -1,4 +1,3 @@ -// eslint-disable-next-line import/no-unresolved const fetch = require('node-fetch'); /** From 1b534f5d8fe2cf8bed6070521359ec0a3abbdee9 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 7 Aug 2024 11:51:52 +0300 Subject: [PATCH 10/12] Try without `docs/.next` caching --- netlify.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/netlify.toml b/netlify.toml index 25bf422e747a5..2e433db4dd107 100644 --- a/netlify.toml +++ b/netlify.toml @@ -12,5 +12,3 @@ NODE_OPTIONS = "--max_old_space_size=4096" PNPM_FLAGS = "--shamefully-hoist" -[[plugins]] - package = "./packages/netlify-plugin-cache-docs" From c9efc1ab497feac98d81afe5dfc27a1a32a972af Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 7 Aug 2024 16:58:58 +0300 Subject: [PATCH 11/12] Use native node fetch --- netlify/functions/deploy-succeeded.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/netlify/functions/deploy-succeeded.js b/netlify/functions/deploy-succeeded.js index d59ce476da813..ad2d1a868b5ae 100644 --- a/netlify/functions/deploy-succeeded.js +++ b/netlify/functions/deploy-succeeded.js @@ -1,5 +1,3 @@ -const fetch = require('node-fetch'); - /** * @param {object} event * @param {string} event.body - https://jsoneditoronline.org/#left=cloud.fb1a4fa30a4f475fa6887071c682e2c1 From de065b64e2fada4c81d78752f62880303e2e5551 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 7 Aug 2024 16:59:49 +0300 Subject: [PATCH 12/12] Bring back the cache plugin --- netlify.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netlify.toml b/netlify.toml index 2e433db4dd107..25bf422e747a5 100644 --- a/netlify.toml +++ b/netlify.toml @@ -12,3 +12,5 @@ NODE_OPTIONS = "--max_old_space_size=4096" PNPM_FLAGS = "--shamefully-hoist" +[[plugins]] + package = "./packages/netlify-plugin-cache-docs"