@netlify/build 18.25.0 → 19.0.1
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": "
|
|
3
|
+
"version": "19.0.1",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"main": "src/core/main.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
"license": "MIT",
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@bugsnag/js": "^7.0.0",
|
|
57
|
-
"@netlify/cache-utils": "^
|
|
58
|
-
"@netlify/config": "^
|
|
59
|
-
"@netlify/functions-utils": "^
|
|
60
|
-
"@netlify/git-utils": "^
|
|
57
|
+
"@netlify/cache-utils": "^3.0.0",
|
|
58
|
+
"@netlify/config": "^16.0.0",
|
|
59
|
+
"@netlify/functions-utils": "^3.0.0",
|
|
60
|
+
"@netlify/git-utils": "^3.0.0",
|
|
61
61
|
"@netlify/plugin-edge-handlers": "^1.11.22",
|
|
62
62
|
"@netlify/plugins-list": "^4.2.0",
|
|
63
|
-
"@netlify/run-utils": "^
|
|
63
|
+
"@netlify/run-utils": "^3.0.0",
|
|
64
64
|
"@netlify/zip-it-and-ship-it": "^4.30.0",
|
|
65
65
|
"@sindresorhus/slugify": "^1.1.0",
|
|
66
66
|
"@ungap/from-entries": "^0.2.1",
|
|
@@ -127,6 +127,6 @@
|
|
|
127
127
|
"yarn": "^1.22.4"
|
|
128
128
|
},
|
|
129
129
|
"engines": {
|
|
130
|
-
"node": ">=
|
|
130
|
+
"node": "^12.20.0 || ^14.14.0 || >=16.0.0"
|
|
131
131
|
}
|
|
132
132
|
}
|
|
@@ -9,9 +9,9 @@ const { validatePlugin } = require('./validate')
|
|
|
9
9
|
// This also validates the plugin.
|
|
10
10
|
// Do it when parent requests it using the `load` event.
|
|
11
11
|
// Also figure out the list of plugin steps. This is also passed to the parent.
|
|
12
|
-
const load =
|
|
13
|
-
registerTypeScript(pluginPath)
|
|
14
|
-
const logic =
|
|
12
|
+
const load = function ({ pluginPath, inputs, packageJson }) {
|
|
13
|
+
const tsNodeService = registerTypeScript(pluginPath)
|
|
14
|
+
const logic = getLogic({ pluginPath, inputs, tsNodeService })
|
|
15
15
|
|
|
16
16
|
validatePlugin(logic)
|
|
17
17
|
|
|
@@ -4,18 +4,18 @@ const { addTsErrorInfo } = require('./typescript')
|
|
|
4
4
|
|
|
5
5
|
// Require the plugin file and fire its top-level function.
|
|
6
6
|
// The returned object is the `logic` which includes all event handlers.
|
|
7
|
-
const getLogic =
|
|
8
|
-
const logic =
|
|
7
|
+
const getLogic = function ({ pluginPath, inputs, tsNodeService }) {
|
|
8
|
+
const logic = requireLogic(pluginPath, tsNodeService)
|
|
9
9
|
const logicA = loadLogic({ logic, inputs })
|
|
10
10
|
return logicA
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const requireLogic =
|
|
13
|
+
const requireLogic = function (pluginPath, tsNodeService) {
|
|
14
14
|
try {
|
|
15
15
|
// eslint-disable-next-line node/global-require, import/no-dynamic-require
|
|
16
16
|
return require(pluginPath)
|
|
17
17
|
} catch (error) {
|
|
18
|
-
|
|
18
|
+
addTsErrorInfo(error, tsNodeService)
|
|
19
19
|
error.message = `Could not import plugin:\n${error.message}`
|
|
20
20
|
throw error
|
|
21
21
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const { extname } = require('path')
|
|
4
4
|
|
|
5
|
-
const execa = require('execa')
|
|
6
5
|
const { register } = require('ts-node')
|
|
7
6
|
|
|
8
7
|
const { addErrorInfo } = require('../../error/info')
|
|
@@ -16,29 +15,23 @@ const registerTypeScript = function (pluginPath) {
|
|
|
16
15
|
return
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
register()
|
|
18
|
+
return register()
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
// On TypeScript errors, adds information about the `ts-node` configuration,
|
|
23
22
|
// which includes the resolved `tsconfig.json`.
|
|
24
|
-
const addTsErrorInfo =
|
|
25
|
-
if (
|
|
23
|
+
const addTsErrorInfo = function (error, tsNodeService) {
|
|
24
|
+
if (tsNodeService === undefined) {
|
|
26
25
|
return
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
const {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const safeJsonParse = function (stdout) {
|
|
37
|
-
try {
|
|
38
|
-
return JSON.parse(stdout)
|
|
39
|
-
} catch (error) {
|
|
40
|
-
return { stdout, parsingError: error.message }
|
|
41
|
-
}
|
|
28
|
+
const {
|
|
29
|
+
config: {
|
|
30
|
+
raw: { compilerOptions },
|
|
31
|
+
},
|
|
32
|
+
options: tsNodeOptions,
|
|
33
|
+
} = tsNodeService
|
|
34
|
+
addErrorInfo(error, { tsConfig: { compilerOptions, tsNodeOptions } })
|
|
42
35
|
}
|
|
43
36
|
|
|
44
37
|
const isTypeScriptPlugin = function (pluginPath) {
|
|
@@ -10,7 +10,7 @@ const {
|
|
|
10
10
|
const { addErrorInfo } = require('../error/info')
|
|
11
11
|
|
|
12
12
|
// Local plugins and `package.json`-installed plugins use user's preferred Node.js version if higher than our minimum
|
|
13
|
-
// supported version
|
|
13
|
+
// supported version. Else default to the system Node version.
|
|
14
14
|
// Local and programmatic builds use `@netlify/build` Node.js version, which is
|
|
15
15
|
// usually the system's Node.js version.
|
|
16
16
|
// If the user Node version does not satisfy our supported engine range use our own system Node version
|