netlify-cli 15.5.0 → 15.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "15.5.0",
4
+ "version": "15.6.0",
5
5
  "author": "Netlify Inc.",
6
6
  "type": "module",
7
7
  "engines": {
@@ -44,13 +44,13 @@
44
44
  "dependencies": {
45
45
  "@bugsnag/js": "7.20.2",
46
46
  "@fastify/static": "6.10.2",
47
- "@netlify/build": "29.12.2",
48
- "@netlify/build-info": "7.0.6",
49
- "@netlify/config": "20.4.5",
47
+ "@netlify/build": "29.12.6",
48
+ "@netlify/build-info": "7.0.7",
49
+ "@netlify/config": "20.5.1",
50
50
  "@netlify/edge-bundler": "8.16.2",
51
51
  "@netlify/framework-info": "9.8.10",
52
52
  "@netlify/local-functions-proxy": "1.1.1",
53
- "@netlify/zip-it-and-ship-it": "9.8.1",
53
+ "@netlify/zip-it-and-ship-it": "9.9.1",
54
54
  "@octokit/rest": "19.0.11",
55
55
  "@skn0tt/lambda-local": "2.0.3",
56
56
  "ansi-escapes": "6.2.0",
@@ -91,7 +91,7 @@
91
91
  "from2-array": "0.0.4",
92
92
  "fuzzy": "0.1.3",
93
93
  "get-port": "5.1.1",
94
- "gh-release-fetch": "4.0.1",
94
+ "gh-release-fetch": "4.0.2",
95
95
  "git-repo-info": "2.1.1",
96
96
  "gitconfiglocal": "2.1.0",
97
97
  "hasbin": "1.2.3",
@@ -114,7 +114,7 @@
114
114
  "log-update": "5.0.1",
115
115
  "minimist": "1.2.8",
116
116
  "multiparty": "4.2.3",
117
- "netlify": "13.1.8",
117
+ "netlify": "13.1.9",
118
118
  "netlify-headers-parser": "7.1.2",
119
119
  "netlify-redirect-parser": "14.1.3",
120
120
  "netlify-redirector": "0.4.0",
@@ -527,6 +527,7 @@ export default class BaseCommand extends Command {
527
527
  pathPrefix,
528
528
  scheme,
529
529
  offline,
530
+ siteFeatureFlagPrefix: 'cli',
530
531
  })
531
532
  } catch (error_) {
532
533
  const isUserError = error_.customErrorInfo !== undefined && error_.customErrorInfo.type === 'resolveConfig'
@@ -16,7 +16,6 @@ export const detectNetlifyLambda = async function ({ packageJson } = {}) {
16
16
 
17
17
  const matchingScripts = Object.entries(scripts).filter(([, script]) => script.match(/netlify-lambda\s+build/))
18
18
 
19
- // eslint-disable-next-line fp/no-loops
20
19
  for (const [key, script] of matchingScripts) {
21
20
  // E.g. ["netlify-lambda", "build", "functions/folder"]
22
21
  const match = minimist(script.split(' '), {
@@ -87,7 +87,14 @@ export const createHandler = function (options) {
87
87
 
88
88
  let requestQuery = request.query
89
89
  if (request.header('x-netlify-original-search')) {
90
- requestQuery = Object.fromEntries(new URLSearchParams(request.header('x-netlify-original-search')))
90
+ const newRequestQuery = {}
91
+ const searchParams = new URLSearchParams(request.header('x-netlify-original-search'))
92
+
93
+ for (const key of searchParams.keys()) {
94
+ newRequestQuery[key] = searchParams.getAll(key)
95
+ }
96
+
97
+ requestQuery = newRequestQuery
91
98
  delete request.headers['x-netlify-original-search']
92
99
  }
93
100
 
package/src/utils/dev.mjs CHANGED
@@ -167,7 +167,6 @@ export const getDotEnvVariables = async ({ devConfig, env, site }) => {
167
167
  * @return {void}
168
168
  */
169
169
  export const injectEnvVariables = (env) => {
170
- // eslint-disable-next-line fp/no-loops
171
170
  for (const [key, variable] of Object.entries(env)) {
172
171
  const existsInProcess = process.env[key] !== undefined
173
172
  const [usedSource, ...overriddenSources] = existsInProcess ? ['process', ...variable.sources] : variable.sources
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Allows us to check if a feature flag is enabled for a site.
3
+ * Due to versioning of the cli, and the desire to remove flags from
4
+ * our feature flag service when they should always evaluate to true,
5
+ * we can't just look for the presense of {featureFlagName: true}, as
6
+ * the absense of a flag should also evaluate to the flag being enabled.
7
+ * Instead, we return that the feature flag is enabled if it isn't
8
+ * specifically set to false in the response
9
+ * @param {*} siteInfo
10
+ * @param {string} flagName
11
+ *
12
+ * @returns {boolean}
13
+ */
14
+ export const isFeatureFlagEnabled = (flagName, siteInfo) => {
15
+ if (siteInfo.feature_flags && siteInfo.feature_flags[flagName] !== false) {
16
+ return true
17
+ }
18
+ return false
19
+ }