@netlify/build 26.1.1 → 26.1.5
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build",
|
|
3
|
-
"version": "26.1.
|
|
3
|
+
"version": "26.1.5",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./src/core/main.js",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@netlify/config": "^17.0.0",
|
|
61
61
|
"@netlify/functions-utils": "^4.0.0",
|
|
62
62
|
"@netlify/git-utils": "^4.0.0",
|
|
63
|
-
"@netlify/plugin-edge-handlers": "^3.0.
|
|
64
|
-
"@netlify/plugins-list": "^6.
|
|
63
|
+
"@netlify/plugin-edge-handlers": "^3.0.4",
|
|
64
|
+
"@netlify/plugins-list": "^6.3.0",
|
|
65
65
|
"@netlify/run-utils": "^4.0.0",
|
|
66
66
|
"@netlify/zip-it-and-ship-it": "^5.4.0",
|
|
67
67
|
"@sindresorhus/slugify": "^1.1.0",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"ts-node": "^10.4.0",
|
|
106
106
|
"update-notifier": "^5.0.0",
|
|
107
107
|
"uuid": "^8.0.0",
|
|
108
|
-
"yargs": "^
|
|
108
|
+
"yargs": "^17.3.1"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
111
|
"@netlify/nock-udp": "^1.0.0",
|
package/src/core/bin.js
CHANGED
|
@@ -4,6 +4,7 @@ import process from 'process'
|
|
|
4
4
|
|
|
5
5
|
import filterObj from 'filter-obj'
|
|
6
6
|
import yargs from 'yargs'
|
|
7
|
+
import { hideBin } from 'yargs/helpers'
|
|
7
8
|
|
|
8
9
|
import { normalizeCliFeatureFlags } from './feature_flags.js'
|
|
9
10
|
import { FLAGS } from './flags.js'
|
|
@@ -30,7 +31,10 @@ const runCli = async function () {
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
const parseFlags = function () {
|
|
33
|
-
const { featureFlags: cliFeatureFlags = '', ...flags } = yargs
|
|
34
|
+
const { featureFlags: cliFeatureFlags = '', ...flags } = yargs(hideBin(process.argv))
|
|
35
|
+
.options(FLAGS)
|
|
36
|
+
.usage(USAGE)
|
|
37
|
+
.parse()
|
|
34
38
|
const featureFlags = normalizeCliFeatureFlags(cliFeatureFlags)
|
|
35
39
|
return { ...flags, featureFlags }
|
|
36
40
|
}
|
package/src/core/flags.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/* eslint eslint-comments/no-use: off, max-lines: off */
|
|
2
2
|
|
|
3
|
+
const jsonParse = function (value) {
|
|
4
|
+
return value === undefined ? undefined : JSON.parse(value)
|
|
5
|
+
}
|
|
6
|
+
|
|
3
7
|
// All CLI flags
|
|
4
8
|
export const FLAGS = {
|
|
5
9
|
config: {
|
|
@@ -12,7 +16,7 @@ Defaults to any netlify.toml in the git repository root directory or the base di
|
|
|
12
16
|
describe: `JSON configuration object containing default values.
|
|
13
17
|
Each configuration default value is used unless overriden through the main configuration file.
|
|
14
18
|
Default: none.`,
|
|
15
|
-
coerce:
|
|
19
|
+
coerce: jsonParse,
|
|
16
20
|
hidden: true,
|
|
17
21
|
},
|
|
18
22
|
cachedConfig: {
|
|
@@ -21,7 +25,7 @@ Default: none.`,
|
|
|
21
25
|
or when using @netlify/config programmatically.
|
|
22
26
|
This is done as a performance optimization to cache the configuration loading logic.
|
|
23
27
|
Default: none.`,
|
|
24
|
-
coerce:
|
|
28
|
+
coerce: jsonParse,
|
|
25
29
|
hidden: true,
|
|
26
30
|
},
|
|
27
31
|
cachedConfigPath: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { promises as fs } from 'fs'
|
|
2
2
|
import { relative } from 'path'
|
|
3
|
-
import { promisify } from 'util'
|
|
4
3
|
|
|
5
4
|
import { listFunctions } from '@netlify/zip-it-and-ship-it'
|
|
6
5
|
|
|
@@ -8,8 +7,6 @@ import { addErrorInfo } from '../../error/info.js'
|
|
|
8
7
|
|
|
9
8
|
import { getZisiFeatureFlags } from './feature_flags.js'
|
|
10
9
|
|
|
11
|
-
const pStat = promisify(stat)
|
|
12
|
-
|
|
13
10
|
// Returns the `mainFile` of each function found in `functionsSrc`, relative to
|
|
14
11
|
// `functionsSrc`.
|
|
15
12
|
const getRelativeFunctionMainFiles = async function ({ featureFlags, functionsSrc }) {
|
|
@@ -46,7 +43,7 @@ export const validateFunctionsSrc = async function ({ functionsSrc, relativeFunc
|
|
|
46
43
|
}
|
|
47
44
|
|
|
48
45
|
try {
|
|
49
|
-
const stats = await
|
|
46
|
+
const stats = await fs.stat(functionsSrc)
|
|
50
47
|
|
|
51
48
|
if (stats.isDirectory()) {
|
|
52
49
|
return true
|