@netlify/build 18.19.2 → 18.21.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": "18.
|
|
3
|
+
"version": "18.21.1",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"main": "src/core/main.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"@netlify/functions-utils": "^2.0.0",
|
|
60
60
|
"@netlify/git-utils": "^2.0.0",
|
|
61
61
|
"@netlify/plugin-edge-handlers": "^1.11.22",
|
|
62
|
-
"@netlify/plugins-list": "^4.0
|
|
62
|
+
"@netlify/plugins-list": "^4.1.0",
|
|
63
63
|
"@netlify/run-utils": "^2.0.0",
|
|
64
|
-
"@netlify/zip-it-and-ship-it": "^4.28.
|
|
64
|
+
"@netlify/zip-it-and-ship-it": "^4.28.2",
|
|
65
65
|
"@sindresorhus/slugify": "^1.1.0",
|
|
66
66
|
"@ungap/from-entries": "^0.2.1",
|
|
67
67
|
"ansi-escapes": "^4.3.2",
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
"strip-ansi": "^6.0.0",
|
|
104
104
|
"supports-color": "^8.0.0",
|
|
105
105
|
"tmp-promise": "^3.0.2",
|
|
106
|
+
"ts-node": "^10.4.0",
|
|
106
107
|
"update-notifier": "^5.0.0",
|
|
107
108
|
"uuid": "^8.0.0",
|
|
108
109
|
"yargs": "^15.3.1"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const { getLogic } = require('./logic')
|
|
4
|
+
const { registerTypeScript } = require('./typescript')
|
|
4
5
|
const { validatePlugin } = require('./validate')
|
|
5
6
|
|
|
6
7
|
// Load context passed to every plugin method.
|
|
@@ -9,6 +10,7 @@ const { validatePlugin } = require('./validate')
|
|
|
9
10
|
// Do it when parent requests it using the `load` event.
|
|
10
11
|
// Also figure out the list of plugin steps. This is also passed to the parent.
|
|
11
12
|
const load = function ({ pluginPath, inputs, packageJson }) {
|
|
13
|
+
registerTypeScript(pluginPath)
|
|
12
14
|
const logic = getLogic({ pluginPath, inputs })
|
|
13
15
|
|
|
14
16
|
validatePlugin(logic)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const { extname } = require('path')
|
|
4
|
+
|
|
5
|
+
const { register } = require('ts-node')
|
|
6
|
+
|
|
7
|
+
// Allow local plugins to be written with TypeScript.
|
|
8
|
+
// Local plugins cannot be transpiled by the build command since they can be run
|
|
9
|
+
// before it. Therefore, we type-check and transpile them automatically using
|
|
10
|
+
// `ts-node`.
|
|
11
|
+
const registerTypeScript = function (pluginPath) {
|
|
12
|
+
if (!isTypeScriptPlugin(pluginPath)) {
|
|
13
|
+
return
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
register()
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const isTypeScriptPlugin = function (pluginPath) {
|
|
20
|
+
return TYPESCRIPT_EXTENSIONS.has(extname(pluginPath))
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const TYPESCRIPT_EXTENSIONS = new Set(['.ts', '.tsx', '.mts', '.cts'])
|
|
24
|
+
|
|
25
|
+
module.exports = { registerTypeScript }
|
|
@@ -19,6 +19,11 @@ export interface NetlifyPluginOptions<TInputs extends PluginInputs = PluginInput
|
|
|
19
19
|
* `undefined` if no `netlify/functions` directory exists in the base directory and if not specified by the user.
|
|
20
20
|
*/
|
|
21
21
|
FUNCTIONS_SRC?: string
|
|
22
|
+
/**
|
|
23
|
+
* the directory where internal function source code lives. This is where build plugins should place auto-generated functions.
|
|
24
|
+
* `undefined` if the version of @netlify/build does not support internal functions
|
|
25
|
+
*/
|
|
26
|
+
INTERNAL_FUNCTIONS_SRC?: string
|
|
22
27
|
/**
|
|
23
28
|
* the directory where built serverless functions are placed before deployment. Its value is always defined, but the target might not have been created yet.
|
|
24
29
|
*/
|