@netlify/build 29.29.4 → 29.31.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.
Files changed (70) hide show
  1. package/lib/core/constants.d.ts +93 -4
  2. package/lib/core/constants.js +5 -4
  3. package/lib/core/types.d.ts +1 -1
  4. package/lib/index.d.ts +7 -1
  5. package/lib/plugins/child/systemLog.d.ts +1 -1
  6. package/lib/plugins/child/systemLog.js +4 -2
  7. package/lib/plugins_core/blobs_upload/index.d.ts +2 -26
  8. package/lib/plugins_core/blobs_upload/index.js +10 -6
  9. package/lib/plugins_core/functions/index.d.ts +1 -1
  10. package/lib/plugins_core/pre_cleanup/index.d.ts +2 -18
  11. package/lib/plugins_core/pre_cleanup/index.js +3 -5
  12. package/lib/plugins_core/pre_dev_cleanup/index.d.ts +2 -0
  13. package/lib/plugins_core/pre_dev_cleanup/index.js +42 -0
  14. package/lib/plugins_core/secrets_scanning/index.d.ts +2 -16
  15. package/lib/plugins_core/secrets_scanning/index.js +2 -2
  16. package/lib/plugins_core/types.d.ts +40 -0
  17. package/lib/plugins_core/types.js +1 -0
  18. package/lib/steps/get.d.ts +4 -4
  19. package/lib/steps/get.js +2 -1
  20. package/lib/types/config/build.d.ts +45 -0
  21. package/lib/types/config/build.js +1 -0
  22. package/lib/types/config/functions.d.ts +30 -0
  23. package/lib/types/config/functions.js +1 -0
  24. package/lib/types/config/inputs.d.ts +3 -0
  25. package/lib/types/config/inputs.js +1 -0
  26. package/lib/types/config/netlify_config.d.ts +55 -0
  27. package/lib/types/config/netlify_config.js +1 -0
  28. package/lib/types/netlify_event_handler.d.ts +16 -0
  29. package/lib/types/netlify_event_handler.js +1 -0
  30. package/lib/types/netlify_plugin.d.ts +28 -0
  31. package/lib/types/netlify_plugin.js +1 -0
  32. package/lib/types/netlify_plugin_options.d.ts +24 -0
  33. package/lib/types/netlify_plugin_options.js +1 -0
  34. package/lib/types/options/netlify_plugin_build_util.d.ts +6 -0
  35. package/lib/types/options/netlify_plugin_build_util.js +1 -0
  36. package/lib/types/options/netlify_plugin_cache_util.d.ts +29 -0
  37. package/lib/types/options/netlify_plugin_cache_util.js +1 -0
  38. package/lib/types/options/netlify_plugin_functions_util.d.ts +28 -0
  39. package/lib/types/options/netlify_plugin_functions_util.js +1 -0
  40. package/lib/types/options/netlify_plugin_git_util.d.ts +41 -0
  41. package/lib/types/options/netlify_plugin_git_util.js +1 -0
  42. package/lib/types/options/netlify_plugin_run_util.d.ts +17 -0
  43. package/lib/types/options/netlify_plugin_run_util.js +1 -0
  44. package/lib/types/options/netlify_plugin_status_util.d.ts +24 -0
  45. package/lib/types/options/netlify_plugin_status_util.js +1 -0
  46. package/{types → lib/types}/options/netlify_plugin_utils.d.ts +12 -13
  47. package/lib/types/options/netlify_plugin_utils.js +1 -0
  48. package/lib/types/utils/json_value.d.ts +3 -0
  49. package/lib/types/utils/json_value.js +1 -0
  50. package/{types → lib/types}/utils/many.d.ts +5 -5
  51. package/lib/types/utils/many.js +1 -0
  52. package/lib/utils/blobs.d.ts +9 -8
  53. package/lib/utils/blobs.js +11 -6
  54. package/package.json +2 -2
  55. package/types/config/build.d.ts +0 -52
  56. package/types/config/functions.d.ts +0 -36
  57. package/types/config/inputs.d.ts +0 -7
  58. package/types/config/netlify_config.d.ts +0 -66
  59. package/types/index.d.ts +0 -7
  60. package/types/netlify_event_handler.d.ts +0 -29
  61. package/types/netlify_plugin.d.ts +0 -29
  62. package/types/netlify_plugin_constants.d.ts +0 -66
  63. package/types/netlify_plugin_options.d.ts +0 -25
  64. package/types/options/netlify_plugin_build_util.d.ts +0 -7
  65. package/types/options/netlify_plugin_cache_util.d.ts +0 -39
  66. package/types/options/netlify_plugin_functions_util.d.ts +0 -32
  67. package/types/options/netlify_plugin_git_util.d.ts +0 -41
  68. package/types/options/netlify_plugin_run_util.d.ts +0 -24
  69. package/types/options/netlify_plugin_status_util.d.ts +0 -24
  70. package/types/utils/json_value.d.ts +0 -1
@@ -1,25 +0,0 @@
1
- import type { PluginInputs, StringKeys } from './config/inputs.js'
2
- import type { NetlifyConfig } from './config/netlify_config.js'
3
- import type { NetlifyPluginConstants } from './netlify_plugin_constants.js'
4
- import type { NetlifyPluginUtils } from './options/netlify_plugin_utils.js'
5
- import type { JSONValue } from './utils/json_value.js'
6
-
7
- export interface NetlifyPluginOptions<TInputs extends PluginInputs<StringKeys<TInputs>> = PluginInputs> {
8
- /**
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).
10
- */
11
- inputs: TInputs
12
- /**
13
- * @see https://docs.netlify.com/configure-builds/build-plugins/create-plugins/#netlifyconfig
14
- */
15
- netlifyConfig: NetlifyConfig
16
- /**
17
- * When an event handler executes, the contents of the `package.json` in a site's base directory get passed to a plugin.
18
- * The data fields are normalized to prevent plugin errors. If the site has no `package.json`, the argument is an empty object.
19
- */
20
- packageJson: Partial<Record<string, JSONValue>>
21
- constants: NetlifyPluginConstants
22
- utils: NetlifyPluginUtils
23
- featureFlags?: Record<string, unknown>
24
- systemLog?(message: string): void
25
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * Report errors or cancel builds
3
- */
4
- export type NetlifyPluginBuildUtil = Record<
5
- 'failBuild' | 'failPlugin' | 'cancelBuild',
6
- (message: string, options?: { error?: Error }) => never
7
- >
@@ -1,39 +0,0 @@
1
- import type { Many } from '../utils/many.js'
2
-
3
- /**
4
- * Cache files between builds
5
- */
6
- export type NetlifyPluginCacheUtil = {
7
- save(
8
- path: Many<string>,
9
- options?: {
10
- ttl?: number
11
- digests?: string[]
12
- /**
13
- * @default `process.cwd()`
14
- */
15
- cwd?: string
16
- },
17
- ): Promise<boolean>
18
- list(options?: {
19
- /**
20
- * @default `process.cwd()`
21
- */
22
- cwd?: string
23
- /**
24
- * @default 1
25
- */
26
- depth?: number
27
- }): Promise<string[]>
28
- } & Record<
29
- 'restore' | 'remove' | 'has',
30
- (
31
- path: Many<string>,
32
- options?: {
33
- /**
34
- * @default `process.cwd()`
35
- */
36
- cwd?: string
37
- },
38
- ) => Promise<boolean>
39
- >
@@ -1,32 +0,0 @@
1
- import type { listFunctions, listFunctionsFiles } from '@netlify/zip-it-and-ship-it'
2
-
3
- type Resolved<T> = T extends Promise<infer U> ? U : T
4
-
5
- export type ListedFunction = Resolved<ReturnType<typeof listFunctions>>[0]
6
- export type ListedFunctionFile = Resolved<ReturnType<typeof listFunctionsFiles>>[0]
7
-
8
- export interface NetlifyPluginFunctionsUtil {
9
- /**
10
- * Returns the list of Netlify Functions main files as a Promise resolving to an array of objects with the following properties:
11
- *
12
- * - `name`: Function name, as used in the URL `https://{hostname}/.netlify/functions/{name}`
13
- * - `mainFile`: absolute path to the Function's main file
14
- * - `extension`: file extension of the Function's main file. For Go Functions, this might be an empty string. For Node.js Functions, this is either `.js` or `.zip`.
15
- * - `runtime` `"js" | "go"`: Function's language runtime. TypeScript Functions use the "js" runtime
16
- */
17
- list(): Promise<Array<ListedFunction>>
18
-
19
- /**
20
- * Same as `list()` except it also returns the files required by the Functions' main files. This is much slower. The object have the following additional member:
21
- *
22
- * - `srcFile`: absolute path to the file
23
- */
24
- listAll(): Promise<Array<ListedFunctionFile>>
25
-
26
- /**
27
- * Add a Functions file or directory to a build.
28
- *
29
- * @param path Path to the function file or directory.
30
- */
31
- add(path: string): Promise<void>
32
- }
@@ -1,41 +0,0 @@
1
- /**
2
- * Retrieve Git-related information such as the list of modified/created/deleted files
3
- * @see https://github.com/netlify/build/blob/master/packages/git-utils/README.md
4
- */
5
- export interface NetlifyPluginGitUtil {
6
- fileMatch(globPattern: string): readonly string[]
7
- /**
8
- * Array of all modified files.
9
- */
10
- modifiedFiles: readonly string[]
11
- /**
12
- * Array of all created files.
13
- */
14
- createdFiles: readonly string[]
15
- /**
16
- * Array of all deleted files.
17
- */
18
- deletedFiles: readonly string[]
19
- /**
20
- * Array of commits with details.
21
- */
22
- commits: ReadonlyArray<{
23
- sha: string
24
- parents: string
25
- author: {
26
- name: string
27
- email: string
28
- date: string
29
- }
30
- committer: {
31
- name: string
32
- email: string
33
- date: string
34
- }
35
- message: string
36
- }>
37
- /**
38
- * How many lines of code have changed
39
- */
40
- linesOfCode(): Promise<number>
41
- }
@@ -1,24 +0,0 @@
1
- import type { Options as ExecaOptions, ExecaChildProcess } from 'execa'
2
-
3
- type NetlifyPluginRunUtilOptions = Omit<ExecaOptions, 'preferLocal'> & {
4
- /**
5
- * @default true
6
- */
7
- preferLocal?: ExecaOptions['preferLocal']
8
- }
9
-
10
- type NetlifyPluginRunUtilResult = ExecaChildProcess
11
-
12
- /**
13
- * Run commands and processes
14
- * @see https://github.com/netlify/build/blob/master/packages/run-utils/README.md
15
- */
16
- export interface NetlifyPluginRunUtil {
17
- (
18
- file: string,
19
- // eslint-disable-next-line fp/no-arguments -- params are named `arguments` in the docs. Unrelated to JS's `arguments`
20
- arguments?: readonly string[],
21
- options?: NetlifyPluginRunUtilOptions,
22
- ): Promise<NetlifyPluginRunUtilResult>
23
- command(command: string, options?: NetlifyPluginRunUtilOptions): Promise<NetlifyPluginRunUtilResult>
24
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * Display information in the deploy summary
3
- */
4
- export interface NetlifyPluginStatusUtil {
5
- /**
6
- * Only one status is shown per plugin.
7
- * Calling `utils.status.show()` twice overrides the previous status.
8
- */
9
- show(options: {
10
- /**
11
- * Default to the plugin's name followed by a generic title.
12
- */
13
- title?: string
14
- /**
15
- * Message below the title
16
- */
17
- summary: string
18
- /**
19
- * Detailed information shown in a collapsible section.
20
- * @default ""
21
- */
22
- text?: string
23
- }): void
24
- }
@@ -1 +0,0 @@
1
- export type JSONValue = string | number | boolean | null | { [key: string]: JSONValue } | Array<JSONValue>