From d186b2d9f365cf3b067fbc2c8bfebdbc74f9fa1e Mon Sep 17 00:00:00 2001 From: Shea McKinney Date: Thu, 2 May 2024 14:24:58 -0700 Subject: [PATCH 1/4] Remove dotenv cleanup and add to function bundle --- src/index.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/index.js b/src/index.js index 6020745..e064b80 100644 --- a/src/index.js +++ b/src/index.js @@ -73,12 +73,6 @@ module.exports = { netlifyConfig.functions['*'].external_node_modules = []; } netlifyConfig.functions['*'].external_node_modules.push('dotenv'); - - // Ensure that the .env file we are writing gets bundled with the func. - if (!Array.isArray(netlifyConfig.functions['*'].included_files)) { - netlifyConfig.functions['*'].included_files = []; - } - netlifyConfig.functions['*'].included_files.push('.env'); } // Contextualize the secrets. @@ -121,12 +115,4 @@ module.exports = { summary: `Added environment variables from vault to environment and LAMBDA`, }); }, - // Remove env file if on Netilfy. - async onPostBuild() { - const isNetlify = process.env.NETLIFY || false; - const envFilePath = path.resolve(process.cwd(), '.env'); - if (isNetlify) { - fs.unlinkSync(envFilePath); - } - }, }; From ffc58a89b3faea6f39f2993e3462d398a571ed77 Mon Sep 17 00:00:00 2001 From: Shea McKinney Date: Tue, 14 May 2024 09:17:21 -0700 Subject: [PATCH 2/4] NoJira: Add peerDependencies on next plugin and next. --- package.json | 12 ++++++++++++ src/index.js | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 0e86138..9e97d71 100644 --- a/package.json +++ b/package.json @@ -26,5 +26,17 @@ "eslint-config-airbnb": "^19.0.4", "eslint-config-prettier": "^5.1.0", "eslint-plugin-prettier": "^5.0.0" + }, + "peerDependencies": { + "@netlify/plugin-nextjs": ">5", + "next": ">13.5.6" + }, + "peerDependenciesMeta": { + "@netlify/plugin-nextjs": { + "optional": true + }, + "next": { + "optional": true + } } } diff --git a/src/index.js b/src/index.js index e064b80..2fb55a4 100644 --- a/src/index.js +++ b/src/index.js @@ -112,7 +112,7 @@ module.exports = { // Display success information status.show({ - summary: `Added environment variables from vault to environment and LAMBDA`, + summary: `Added ${secretsToWrite.length} environment variables from vault to this build.`, }); }, }; From b52168ac793cfba3615529fb6efb144c2eeb42a6 Mon Sep 17 00:00:00 2001 From: Shea McKinney Date: Tue, 14 May 2024 09:26:52 -0700 Subject: [PATCH 3/4] Be more specific. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9e97d71..6d85c0a 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "eslint-plugin-prettier": "^5.0.0" }, "peerDependencies": { - "@netlify/plugin-nextjs": ">5", + "@netlify/plugin-nextjs": ">5.2", "next": ">13.5.6" }, "peerDependenciesMeta": { From 7f2cb1eca428aa334845819577096d0cd2fa31e3 Mon Sep 17 00:00:00 2001 From: Shea McKinney Date: Tue, 14 May 2024 09:28:42 -0700 Subject: [PATCH 4/4] Greater than or equal to. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6d85c0a..51a22f9 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,8 @@ "eslint-plugin-prettier": "^5.0.0" }, "peerDependencies": { - "@netlify/plugin-nextjs": ">5.2", - "next": ">13.5.6" + "@netlify/plugin-nextjs": ">=5.2", + "next": ">=13.5.6" }, "peerDependenciesMeta": { "@netlify/plugin-nextjs": {