@netlify/build 18.21.4 → 18.21.8
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 +4 -4
- package/types/config/functions.d.ts +10 -12
- package/types/index.d.ts +5 -0
- package/types/netlify_event_handler.d.ts +19 -0
- package/types/netlify_plugin.d.ts +7 -8
- package/types/netlify_plugin_constants.d.ts +42 -0
- package/types/netlify_plugin_options.d.ts +2 -42
- package/types/options/index.d.ts +1 -1
- package/types/options/netlify_plugin_build_util.d.ts +1 -1
- package/types/netlify_event.d.ts +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/build",
|
|
3
|
-
"version": "18.21.
|
|
3
|
+
"version": "18.21.8",
|
|
4
4
|
"description": "Netlify build module",
|
|
5
5
|
"main": "src/core/main.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@netlify/plugin-edge-handlers": "^1.11.22",
|
|
62
62
|
"@netlify/plugins-list": "^4.1.0",
|
|
63
63
|
"@netlify/run-utils": "^2.0.0",
|
|
64
|
-
"@netlify/zip-it-and-ship-it": "^4.29.
|
|
64
|
+
"@netlify/zip-it-and-ship-it": "^4.29.1",
|
|
65
65
|
"@sindresorhus/slugify": "^1.1.0",
|
|
66
66
|
"@ungap/from-entries": "^0.2.1",
|
|
67
67
|
"ansi-escapes": "^4.3.2",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"log-process-errors": "^6.0.0",
|
|
81
81
|
"make-dir": "^3.0.2",
|
|
82
82
|
"map-obj": "^4.0.0",
|
|
83
|
-
"memoize-one": "^
|
|
83
|
+
"memoize-one": "^6.0.0",
|
|
84
84
|
"os-name": "^4.0.1",
|
|
85
85
|
"p-event": "^4.1.0",
|
|
86
86
|
"p-every": "^2.0.0",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"moize": "^6.0.0",
|
|
124
124
|
"path-key": "^3.1.1",
|
|
125
125
|
"process-exists": "^4.0.0",
|
|
126
|
-
"sinon": "^
|
|
126
|
+
"sinon": "^12.0.0",
|
|
127
127
|
"yarn": "^1.22.4"
|
|
128
128
|
},
|
|
129
129
|
"engines": {
|
|
@@ -3,36 +3,34 @@ type GlobPattern = string
|
|
|
3
3
|
/* eslint-disable camelcase -- some properties are named in snake case in this API */
|
|
4
4
|
type FunctionsObject = {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* a list of additional paths to include in the function bundle. Although our build system includes statically referenced files (like `require("./some-file.js")`) by default, `included_files` lets you specify additional files or directories and reference them dynamically in function code. You can use `*` to match any character or prefix an entry with `!` to exclude files. Paths are relative to the [base directory](https://docs.netlify.com/configure-builds/get-started/#definitions-1).
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
included_files?: string[]
|
|
9
9
|
} & (
|
|
10
10
|
| {
|
|
11
11
|
/**
|
|
12
12
|
* the function bundling method used in [`@netlify/zip-it-and-ship-it`](https://github.com/netlify/zip-it-and-ship-it).
|
|
13
13
|
*/
|
|
14
|
-
node_bundler
|
|
14
|
+
node_bundler?: 'zisi' | 'nft'
|
|
15
15
|
}
|
|
16
16
|
| {
|
|
17
17
|
/**
|
|
18
18
|
* the function bundling method used in [`@netlify/zip-it-and-ship-it`](https://github.com/netlify/zip-it-and-ship-it).
|
|
19
19
|
*/
|
|
20
|
-
node_bundler
|
|
20
|
+
node_bundler?: 'esbuild'
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* a list of Node.js modules that are copied to the bundled artifact without adjusting their source or references during the bundling process.
|
|
24
24
|
* This property helps handle dependencies that can’t be inlined, such as modules with native add-ons.
|
|
25
25
|
*/
|
|
26
|
-
external_node_modules
|
|
26
|
+
external_node_modules?: string[]
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
* a list of additional paths to include in the function bundle. Although our build system includes statically referenced files (like `require("./some-file.js")`) by default, `included_files` lets you specify additional files or directories and reference them dynamically in function code. You can use `*` to match any character or prefix an entry with `!` to exclude files. Paths are relative to the [base directory](https://docs.netlify.com/configure-builds/get-started/#definitions-1).
|
|
30
|
-
*/
|
|
31
|
-
included_files: string[]
|
|
32
|
-
|
|
33
|
-
ignored_node_modules: string[]
|
|
28
|
+
ignored_node_modules?: string[]
|
|
34
29
|
}
|
|
35
30
|
)
|
|
36
31
|
/* eslint-enable camelcase */
|
|
37
32
|
|
|
38
|
-
export type Functions =
|
|
33
|
+
export type Functions = {
|
|
34
|
+
'*': FunctionsObject
|
|
35
|
+
[pattern: GlobPattern]: FunctionsObject
|
|
36
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
1
|
export { NetlifyPlugin } from './netlify_plugin'
|
|
2
|
+
export { NetlifyPluginOptions } from './netlify_plugin_options'
|
|
3
|
+
export { OnBuild, OnEnd, OnError, OnPostBuild, OnPreBuild, OnSuccess } from './netlify_event_handler'
|
|
4
|
+
export { NetlifyConfig } from './config/netlify_config'
|
|
5
|
+
export { NetlifyPluginUtils } from './options'
|
|
6
|
+
export { NetlifyPluginConstants } from './netlify_plugin_constants'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PluginInputs } from './config/inputs'
|
|
2
|
+
import { NetlifyPluginOptions } from './netlify_plugin_options'
|
|
3
|
+
|
|
4
|
+
interface NetlifyEventHandler<PluginOptions extends NetlifyPluginOptions = NetlifyPluginOptions> {
|
|
5
|
+
(options: PluginOptions): void | Promise<void>
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type OnPreBuild<TInputs extends PluginInputs = PluginInputs> = NetlifyEventHandler<NetlifyPluginOptions<TInputs>>
|
|
9
|
+
export type OnBuild<TInputs extends PluginInputs = PluginInputs> = NetlifyEventHandler<NetlifyPluginOptions<TInputs>>
|
|
10
|
+
export type OnPostBuild<TInputs extends PluginInputs = PluginInputs> = NetlifyEventHandler<
|
|
11
|
+
NetlifyPluginOptions<TInputs>
|
|
12
|
+
>
|
|
13
|
+
export type OnError<TInputs extends PluginInputs = PluginInputs> = NetlifyEventHandler<
|
|
14
|
+
NetlifyPluginOptions<TInputs> & { error: Error }
|
|
15
|
+
>
|
|
16
|
+
export type OnSuccess<TInputs extends PluginInputs = PluginInputs> = NetlifyEventHandler<NetlifyPluginOptions<TInputs>>
|
|
17
|
+
export type OnEnd<TInputs extends PluginInputs = PluginInputs> = NetlifyEventHandler<
|
|
18
|
+
NetlifyPluginOptions<TInputs> & { error?: Error }
|
|
19
|
+
>
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
import { PluginInputs } from './config/inputs'
|
|
2
|
-
import {
|
|
3
|
-
import { NetlifyPluginOptions } from './netlify_plugin_options'
|
|
2
|
+
import { OnBuild, OnEnd, OnError, OnPostBuild, OnPreBuild, OnSuccess } from './netlify_event_handler'
|
|
4
3
|
|
|
5
4
|
export interface NetlifyPlugin<TInputs extends PluginInputs = PluginInputs> {
|
|
6
5
|
/**
|
|
7
6
|
* Runs before the build command is executed.
|
|
8
7
|
*/
|
|
9
|
-
onPreBuild?:
|
|
8
|
+
onPreBuild?: OnPreBuild<TInputs>
|
|
10
9
|
/**
|
|
11
10
|
* runs directly after the build command is executed and before Functions? bundling and Edge Handlers bundling.
|
|
12
11
|
*/
|
|
13
|
-
onBuild?:
|
|
12
|
+
onBuild?: OnBuild<TInputs>
|
|
14
13
|
/**
|
|
15
14
|
* runs after the build command completes; after onBuild? tasks, Functions? bundling, and Edge Handlers bundling are executed; and before the deploy stage. Can be used to prevent a build from being deployed.
|
|
16
15
|
*/
|
|
17
|
-
onPostBuild?:
|
|
16
|
+
onPostBuild?: OnPostBuild<TInputs>
|
|
18
17
|
/**
|
|
19
18
|
* runs when an error occurs in the build or deploy stage, failing the build. Can’t be used to prevent a build from being deployed.
|
|
20
19
|
*/
|
|
21
|
-
onError?:
|
|
20
|
+
onError?: OnError<TInputs>
|
|
22
21
|
/**
|
|
23
22
|
* runs when the deploy succeeds. Can’t be used to prevent a build from being deployed.
|
|
24
23
|
*/
|
|
25
|
-
onSuccess?:
|
|
24
|
+
onSuccess?: OnSuccess<TInputs>
|
|
26
25
|
/**
|
|
27
26
|
* runs after completion of the deploy stage, regardless of build error or success; is useful for resources cleanup. Can’t be used to prevent a build from being deployed.
|
|
28
27
|
*/
|
|
29
|
-
onEnd?:
|
|
28
|
+
onEnd?: OnEnd<TInputs>
|
|
30
29
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface NetlifyPluginConstants {
|
|
2
|
+
/**
|
|
3
|
+
* path to the Netlify configuration file.
|
|
4
|
+
* `undefined` if none was used.
|
|
5
|
+
*/
|
|
6
|
+
CONFIG_PATH?: string
|
|
7
|
+
/**
|
|
8
|
+
* directory that contains the deploy-ready HTML files and assets generated by the build. Its value is always defined, but the target might not have been created yet.
|
|
9
|
+
*/
|
|
10
|
+
PUBLISH_DIR: string
|
|
11
|
+
/**
|
|
12
|
+
* the directory where function source code lives.
|
|
13
|
+
* `undefined` if no `netlify/functions` directory exists in the base directory and if not specified by the user.
|
|
14
|
+
*/
|
|
15
|
+
FUNCTIONS_SRC?: string
|
|
16
|
+
/**
|
|
17
|
+
* the directory where internal function source code lives. This is where build plugins should place auto-generated functions.
|
|
18
|
+
* `undefined` if the version of @netlify/build does not support internal functions
|
|
19
|
+
*/
|
|
20
|
+
INTERNAL_FUNCTIONS_SRC?: string
|
|
21
|
+
/**
|
|
22
|
+
* the directory where built serverless functions are placed before deployment. Its value is always defined, but the target might not have been created yet.
|
|
23
|
+
*/
|
|
24
|
+
FUNCTIONS_DIST: string
|
|
25
|
+
/**
|
|
26
|
+
* the directory where Edge Handlers source code lives.
|
|
27
|
+
* `undefined` if no `netlify/edge-handlers` directory exists in the base directory and if not specified in `netlify.toml`.
|
|
28
|
+
*/
|
|
29
|
+
EDGE_HANDLERS_SRC?: string
|
|
30
|
+
/**
|
|
31
|
+
* boolean indicating whether the build was [run locally](https://docs.netlify.com/cli/get-started/#run-builds-locally) or on Netlify
|
|
32
|
+
*/
|
|
33
|
+
IS_LOCAL: boolean
|
|
34
|
+
/**
|
|
35
|
+
* version of Netlify Build as a `major.minor.patch` string
|
|
36
|
+
*/
|
|
37
|
+
NETLIFY_BUILD_VERSION: string
|
|
38
|
+
/**
|
|
39
|
+
* the Netlify site ID
|
|
40
|
+
*/
|
|
41
|
+
SITE_ID: string
|
|
42
|
+
}
|
|
@@ -1,51 +1,10 @@
|
|
|
1
1
|
import { PluginInputs } from './config/inputs'
|
|
2
2
|
import { NetlifyConfig } from './config/netlify_config'
|
|
3
|
+
import { NetlifyPluginConstants } from './netlify_plugin_constants'
|
|
3
4
|
import { NetlifyPluginUtils } from './options/netlify_plugin_utils'
|
|
4
5
|
import { JSONValue } from './utils/json_value'
|
|
5
6
|
|
|
6
7
|
export interface NetlifyPluginOptions<TInputs extends PluginInputs = PluginInputs> {
|
|
7
|
-
constants: {
|
|
8
|
-
/**
|
|
9
|
-
* path to the Netlify configuration file.
|
|
10
|
-
* `undefined` if none was used.
|
|
11
|
-
*/
|
|
12
|
-
CONFIG_PATH?: string
|
|
13
|
-
/**
|
|
14
|
-
* directory that contains the deploy-ready HTML files and assets generated by the build. Its value is always defined, but the target might not have been created yet.
|
|
15
|
-
*/
|
|
16
|
-
PUBLISH_DIR: string
|
|
17
|
-
/**
|
|
18
|
-
* the directory where function source code lives.
|
|
19
|
-
* `undefined` if no `netlify/functions` directory exists in the base directory and if not specified by the user.
|
|
20
|
-
*/
|
|
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
|
|
27
|
-
/**
|
|
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.
|
|
29
|
-
*/
|
|
30
|
-
FUNCTIONS_DIST: string
|
|
31
|
-
/**
|
|
32
|
-
* the directory where Edge Handlers source code lives.
|
|
33
|
-
* `undefined` if no `netlify/edge-handlers` directory exists in the base directory and if not specified in `netlify.toml`.
|
|
34
|
-
*/
|
|
35
|
-
EDGE_HANDLERS_SRC?: string
|
|
36
|
-
/**
|
|
37
|
-
* boolean indicating whether the build was [run locally](https://docs.netlify.com/cli/get-started/#run-builds-locally) or on Netlify
|
|
38
|
-
*/
|
|
39
|
-
IS_LOCAL: boolean
|
|
40
|
-
/**
|
|
41
|
-
* version of Netlify Build as a `major.minor.patch` string
|
|
42
|
-
*/
|
|
43
|
-
NETLIFY_BUILD_VERSION: string
|
|
44
|
-
/**
|
|
45
|
-
* the Netlify site ID
|
|
46
|
-
*/
|
|
47
|
-
SITE_ID: string
|
|
48
|
-
}
|
|
49
8
|
/**
|
|
50
9
|
* If your plugin requires additional values from the user, you can specify these requirements in an `inputs` array in the plugin’s [`manifest.yml` file](https://docs.netlify.com/configure-builds/build-plugins/create-plugins/#anatomy-of-a-plugin).
|
|
51
10
|
*/
|
|
@@ -59,5 +18,6 @@ export interface NetlifyPluginOptions<TInputs extends PluginInputs = PluginInput
|
|
|
59
18
|
* The data fields are normalized to prevent plugin errors. If the site has no `package.json`, the argument is an empty object.
|
|
60
19
|
*/
|
|
61
20
|
packageJson: Partial<Record<string, JSONValue>>
|
|
21
|
+
constants: NetlifyPluginConstants
|
|
62
22
|
utils: NetlifyPluginUtils
|
|
63
23
|
}
|
package/types/options/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { NetlifyPluginUtils } from './netlify_plugin_utils'
|