From 41fbb0d4dd6e9cbd405464fa080b6ac8029e9537 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Dec 2021 18:18:35 +0100 Subject: [PATCH] fix(deps): update dependency netlify-headers-parser to v6 (#3760) Co-authored-by: Renovate Bot Co-authored-by: ehmicky Co-authored-by: ehmicky --- npm-shrinkwrap.json | 41 ++++++++++++++++++++++++++++++++++------- package.json | 2 +- src/utils/headers.js | 4 +++- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 881d47cc4cb..ac45e46d544 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -84,7 +84,7 @@ "mock-require": "^3.0.3", "multiparty": "^4.2.1", "netlify": "^10.0.0", - "netlify-headers-parser": "^5.0.0", + "netlify-headers-parser": "^6.0.0", "netlify-redirect-parser": "^13.0.0", "netlify-redirector": "^0.2.1", "node-fetch": "^2.6.0", @@ -3027,6 +3027,21 @@ "node": ">=8" } }, + "node_modules/@netlify/config/node_modules/netlify-headers-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/netlify-headers-parser/-/netlify-headers-parser-5.0.0.tgz", + "integrity": "sha512-C953bI/T4jcmO0Ey+z+DWtXfJ38P5Lj0JGhphFMU+WO1i3fdFD+eAzcS1+oTuZ2JoOS9ZNArtzSTtvxDSnL+VQ==", + "dependencies": { + "escape-string-regexp": "^4.0.0", + "is-plain-obj": "^3.0.0", + "map-obj": "^4.2.1", + "path-exists": "^4.0.0", + "toml": "^3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.14.0 || >=16.0.0" + } + }, "node_modules/@netlify/config/node_modules/netlify-redirect-parser": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-12.0.0.tgz", @@ -15186,9 +15201,9 @@ } }, "node_modules/netlify-headers-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/netlify-headers-parser/-/netlify-headers-parser-5.0.0.tgz", - "integrity": "sha512-C953bI/T4jcmO0Ey+z+DWtXfJ38P5Lj0JGhphFMU+WO1i3fdFD+eAzcS1+oTuZ2JoOS9ZNArtzSTtvxDSnL+VQ==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/netlify-headers-parser/-/netlify-headers-parser-6.0.0.tgz", + "integrity": "sha512-nQkKdMs875uWdjOykbSwIeYCxW8LGb+Gk421o2Jl6jaXvb23ltP/WqsqLngpBuL5G6Jl5SnI6sE2VwjbaLsJSg==", "dependencies": { "escape-string-regexp": "^4.0.0", "is-plain-obj": "^3.0.0", @@ -24131,6 +24146,18 @@ } } }, + "netlify-headers-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/netlify-headers-parser/-/netlify-headers-parser-5.0.0.tgz", + "integrity": "sha512-C953bI/T4jcmO0Ey+z+DWtXfJ38P5Lj0JGhphFMU+WO1i3fdFD+eAzcS1+oTuZ2JoOS9ZNArtzSTtvxDSnL+VQ==", + "requires": { + "escape-string-regexp": "^4.0.0", + "is-plain-obj": "^3.0.0", + "map-obj": "^4.2.1", + "path-exists": "^4.0.0", + "toml": "^3.0.0" + } + }, "netlify-redirect-parser": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-12.0.0.tgz", @@ -33356,9 +33383,9 @@ } }, "netlify-headers-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/netlify-headers-parser/-/netlify-headers-parser-5.0.0.tgz", - "integrity": "sha512-C953bI/T4jcmO0Ey+z+DWtXfJ38P5Lj0JGhphFMU+WO1i3fdFD+eAzcS1+oTuZ2JoOS9ZNArtzSTtvxDSnL+VQ==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/netlify-headers-parser/-/netlify-headers-parser-6.0.0.tgz", + "integrity": "sha512-nQkKdMs875uWdjOykbSwIeYCxW8LGb+Gk421o2Jl6jaXvb23ltP/WqsqLngpBuL5G6Jl5SnI6sE2VwjbaLsJSg==", "requires": { "escape-string-regexp": "^4.0.0", "is-plain-obj": "^3.0.0", diff --git a/package.json b/package.json index 6454d870b3e..864ceb4dcb3 100644 --- a/package.json +++ b/package.json @@ -153,7 +153,7 @@ "mock-require": "^3.0.3", "multiparty": "^4.2.1", "netlify": "^10.0.0", - "netlify-headers-parser": "^5.0.0", + "netlify-headers-parser": "^6.0.0", "netlify-redirect-parser": "^13.0.0", "netlify-redirector": "^0.2.1", "node-fetch": "^2.6.0", diff --git a/src/utils/headers.js b/src/utils/headers.js index 0dc9d6f08f6..3c6a3dea2e2 100644 --- a/src/utils/headers.js +++ b/src/utils/headers.js @@ -1,4 +1,5 @@ -const { parseAllHeaders } = require('netlify-headers-parser') +// TODO: use static `import` after migrating this repository to pure ES modules +const netlifyHeadersParser = import('netlify-headers-parser') const { log } = require('./command-helpers') const { NETLIFYDEVERR } = require('./logo') @@ -25,6 +26,7 @@ const getHeaderValues = function ({ values }) { } const parseHeaders = async function ({ configPath, headersFiles }) { + const { parseAllHeaders } = await netlifyHeadersParser const { errors, headers } = await parseAllHeaders({ headersFiles, netlifyConfigPath: configPath,