@netlify/build 29.20.6 → 29.20.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.
Files changed (154) hide show
  1. package/lib/core/bin.d.ts +2 -0
  2. package/lib/core/bin.js +2 -2
  3. package/lib/core/build.d.ts +84 -0
  4. package/lib/core/config.d.ts +65 -0
  5. package/lib/core/constants.d.ts +26 -0
  6. package/lib/core/dev.d.ts +18 -0
  7. package/lib/core/dry.d.ts +8 -0
  8. package/lib/core/feature_flags.d.ts +3 -0
  9. package/lib/core/flags.d.ts +230 -0
  10. package/lib/core/lingering.d.ts +7 -0
  11. package/lib/core/main.d.ts +14 -0
  12. package/lib/core/main.js +1 -3
  13. package/lib/core/missing_side_file.d.ts +9 -0
  14. package/lib/core/normalize_flags.d.ts +38 -0
  15. package/lib/core/report_metrics.d.ts +12 -0
  16. package/lib/core/severity.d.ts +38 -0
  17. package/lib/core/types.d.ts +83 -0
  18. package/lib/core/user_node_version.d.ts +1 -0
  19. package/lib/env/changes.d.ts +6 -0
  20. package/lib/env/main.d.ts +4 -0
  21. package/lib/env/metadata.d.ts +1 -0
  22. package/lib/error/api.d.ts +1 -0
  23. package/lib/error/build.d.ts +7 -0
  24. package/lib/error/cancel.d.ts +4 -0
  25. package/lib/error/colors.d.ts +1 -0
  26. package/lib/error/handle.d.ts +17 -0
  27. package/lib/error/info.d.ts +6 -0
  28. package/lib/error/monitor/location.d.ts +1 -0
  29. package/lib/error/monitor/normalize.d.ts +1 -0
  30. package/lib/error/monitor/print.d.ts +22 -0
  31. package/lib/error/monitor/report.d.ts +7 -0
  32. package/lib/error/monitor/start.d.ts +7 -0
  33. package/lib/error/parse/clean_stack.d.ts +5 -0
  34. package/lib/error/parse/location.d.ts +5 -0
  35. package/lib/error/parse/normalize.d.ts +1 -0
  36. package/lib/error/parse/parse.d.ts +39 -0
  37. package/lib/error/parse/plugin.d.ts +9 -0
  38. package/lib/error/parse/properties.d.ts +5 -0
  39. package/lib/error/parse/serialize_log.d.ts +14 -0
  40. package/lib/error/parse/serialize_status.d.ts +16 -0
  41. package/lib/error/parse/stack.d.ts +11 -0
  42. package/lib/error/report.d.ts +6 -0
  43. package/lib/error/type.d.ts +3 -0
  44. package/lib/index.d.ts +5 -0
  45. package/lib/index.js +6 -0
  46. package/lib/install/functions.d.ts +1 -0
  47. package/lib/install/local.d.ts +8 -0
  48. package/lib/install/main.d.ts +9 -0
  49. package/lib/install/missing.d.ts +12 -0
  50. package/lib/log/colors.d.ts +19 -0
  51. package/lib/log/description.d.ts +3 -0
  52. package/lib/log/header.d.ts +2 -0
  53. package/lib/log/header_func.d.ts +2 -0
  54. package/lib/log/logger.d.ts +32 -0
  55. package/lib/log/messages/compatibility.d.ts +6 -0
  56. package/lib/log/messages/config.d.ts +21 -0
  57. package/lib/log/messages/core.d.ts +12 -0
  58. package/lib/log/messages/core_steps.d.ts +21 -0
  59. package/lib/log/messages/dry.d.ts +18 -0
  60. package/lib/log/messages/install.d.ts +4 -0
  61. package/lib/log/messages/ipc.d.ts +7 -0
  62. package/lib/log/messages/mutations.d.ts +16 -0
  63. package/lib/log/messages/plugins.d.ts +8 -0
  64. package/lib/log/messages/status.d.ts +1 -0
  65. package/lib/log/messages/steps.d.ts +10 -0
  66. package/lib/log/serialize.d.ts +2 -0
  67. package/lib/log/stream.d.ts +10 -0
  68. package/lib/log/theme.d.ts +19 -0
  69. package/lib/plugins/child/diff.d.ts +2 -0
  70. package/lib/plugins/child/error.d.ts +2 -0
  71. package/lib/plugins/child/lazy.d.ts +1 -0
  72. package/lib/plugins/child/load.d.ts +14 -0
  73. package/lib/plugins/child/logic.d.ts +5 -0
  74. package/lib/plugins/child/main.d.ts +1 -0
  75. package/lib/plugins/child/run.d.ts +18 -0
  76. package/lib/plugins/child/status.d.ts +1 -0
  77. package/lib/plugins/child/typescript.d.ts +2 -0
  78. package/lib/plugins/child/utils.d.ts +32 -0
  79. package/lib/plugins/child/validate.d.ts +1 -0
  80. package/lib/plugins/compatibility.d.ts +33 -0
  81. package/lib/plugins/error.d.ts +4 -0
  82. package/lib/plugins/events.d.ts +5 -0
  83. package/lib/plugins/expected_version.d.ts +10 -0
  84. package/lib/plugins/internal.d.ts +1 -0
  85. package/lib/plugins/ipc.d.ts +10 -0
  86. package/lib/plugins/list.d.ts +9 -0
  87. package/lib/plugins/load.d.ts +9 -0
  88. package/lib/plugins/manifest/check.d.ts +10 -0
  89. package/lib/plugins/manifest/load.d.ts +7 -0
  90. package/lib/plugins/manifest/main.d.ts +18 -0
  91. package/lib/plugins/manifest/path.d.ts +5 -0
  92. package/lib/plugins/manifest/validate.d.ts +1 -0
  93. package/lib/plugins/node_version.d.ts +22 -0
  94. package/lib/plugins/options.d.ts +18 -0
  95. package/lib/plugins/pinned_version.d.ts +24 -0
  96. package/lib/plugins/resolve.d.ts +17 -0
  97. package/lib/plugins/spawn.d.ts +2 -0
  98. package/lib/plugins_core/add.d.ts +13 -0
  99. package/lib/plugins_core/build_command.d.ts +36 -0
  100. package/lib/plugins_core/deploy/buildbot_client.d.ts +12 -0
  101. package/lib/plugins_core/deploy/index.d.ts +30 -0
  102. package/lib/plugins_core/edge_functions/index.d.ts +27 -0
  103. package/lib/plugins_core/edge_functions/lib/error.d.ts +1 -0
  104. package/lib/plugins_core/edge_functions/validate_manifest/validate_edge_functions_manifest.d.ts +2 -0
  105. package/lib/plugins_core/functions/error.d.ts +1 -0
  106. package/lib/plugins_core/functions/feature_flags.d.ts +2 -0
  107. package/lib/plugins_core/functions/index.d.ts +53 -0
  108. package/lib/plugins_core/functions/utils.d.ts +11 -0
  109. package/lib/plugins_core/functions/zisi.d.ts +22 -0
  110. package/lib/plugins_core/functions_install/index.d.ts +6 -0
  111. package/lib/plugins_core/list.d.ts +8 -0
  112. package/lib/plugins_core/save_artifacts/index.d.ts +26 -0
  113. package/lib/plugins_core/secrets_scanning/index.d.ts +16 -0
  114. package/lib/plugins_core/secrets_scanning/utils.d.ts +67 -0
  115. package/lib/report/statsd.d.ts +29 -0
  116. package/lib/status/add.d.ts +9 -0
  117. package/lib/status/colors.d.ts +1 -0
  118. package/lib/status/load_error.d.ts +6 -0
  119. package/lib/status/report.d.ts +14 -0
  120. package/lib/status/success.d.ts +5 -0
  121. package/lib/steps/core_step.d.ts +50 -0
  122. package/lib/steps/error.d.ts +48 -0
  123. package/lib/steps/get.d.ts +8 -0
  124. package/lib/steps/plugin.d.ts +39 -0
  125. package/lib/steps/return.d.ts +55 -0
  126. package/lib/steps/run_core_steps.d.ts +5 -0
  127. package/lib/steps/run_step.d.ts +52 -0
  128. package/lib/steps/run_steps.d.ts +44 -0
  129. package/lib/steps/update_config.d.ts +23 -0
  130. package/lib/telemetry/main.d.ts +18 -0
  131. package/lib/time/aggregate.d.ts +1 -0
  132. package/lib/time/main.d.ts +16 -0
  133. package/lib/time/measure.d.ts +10 -0
  134. package/lib/time/report.d.ts +14 -0
  135. package/lib/tracing/main.d.ts +29 -0
  136. package/lib/utils/errors.d.ts +1 -0
  137. package/lib/utils/json.d.ts +7 -0
  138. package/lib/utils/omit.d.ts +1 -0
  139. package/lib/utils/package.d.ts +10 -0
  140. package/lib/utils/remove_falsy.d.ts +1 -0
  141. package/lib/utils/resolve.d.ts +8 -0
  142. package/lib/utils/runtime.d.ts +1 -0
  143. package/lib/utils/semver.d.ts +2 -0
  144. package/package.json +12 -15
  145. package/types/config/inputs.d.ts +1 -1
  146. package/types/config/netlify_config.d.ts +4 -4
  147. package/types/index.d.ts +7 -7
  148. package/types/netlify_event_handler.d.ts +2 -2
  149. package/types/netlify_plugin.d.ts +2 -2
  150. package/types/netlify_plugin_options.d.ts +5 -5
  151. package/types/options/netlify_plugin_cache_util.d.ts +1 -1
  152. package/types/options/netlify_plugin_run_util.d.ts +1 -1
  153. package/types/options/netlify_plugin_utils.d.ts +6 -6
  154. package/types/options/index.d.ts +0 -1
@@ -0,0 +1,9 @@
1
+ export function addStatus({ newStatus, statuses, event, packageName, pluginPackageJson: { version } }: {
2
+ newStatus: any;
3
+ statuses: any;
4
+ event: any;
5
+ packageName: any;
6
+ pluginPackageJson?: {
7
+ version: any;
8
+ } | undefined;
9
+ }): any;
@@ -0,0 +1 @@
1
+ export function removeStatusesColors(statuses: any): any;
@@ -0,0 +1,6 @@
1
+ export function addPluginLoadErrorStatus({ error, packageName, version, debug }: {
2
+ error: any;
3
+ packageName: any;
4
+ version: any;
5
+ debug: any;
6
+ }): void;
@@ -0,0 +1,14 @@
1
+ export function reportStatuses({ statuses, childEnv, api, mode, pluginsOptions, netlifyConfig, errorMonitor, deployId, logs, debug, sendStatus, testOpts, }: {
2
+ statuses: any;
3
+ childEnv: any;
4
+ api: any;
5
+ mode: any;
6
+ pluginsOptions: any;
7
+ netlifyConfig: any;
8
+ errorMonitor: any;
9
+ deployId: any;
10
+ logs: any;
11
+ debug: any;
12
+ sendStatus: any;
13
+ testOpts: any;
14
+ }): Promise<void>;
@@ -0,0 +1,5 @@
1
+ export function getSuccessStatus(newStatus: any, { steps, event, packageName }: {
2
+ steps: any;
3
+ event: any;
4
+ packageName: any;
5
+ }): any;
@@ -0,0 +1,50 @@
1
+ export declare const fireCoreStep: ({ coreStep, coreStepId, coreStepName, configPath, outputConfigPath, buildDir, repositoryRoot, packagePath, constants, buildbotServerSocket, events, logs, nodePath, childEnv, context, branch, envChanges, errorParams, configOpts, netlifyConfig, configMutations, headersPath, redirectsPath, featureFlags, debug, systemLog, saveConfig, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, }: {
2
+ coreStep: any;
3
+ coreStepId: any;
4
+ coreStepName: any;
5
+ configPath: any;
6
+ outputConfigPath: any;
7
+ buildDir: any;
8
+ repositoryRoot: any;
9
+ packagePath: any;
10
+ constants: any;
11
+ buildbotServerSocket: any;
12
+ events: any;
13
+ logs: any;
14
+ nodePath: any;
15
+ childEnv: any;
16
+ context: any;
17
+ branch: any;
18
+ envChanges: any;
19
+ errorParams: any;
20
+ configOpts: any;
21
+ netlifyConfig: any;
22
+ configMutations: any;
23
+ headersPath: any;
24
+ redirectsPath: any;
25
+ featureFlags: any;
26
+ debug: any;
27
+ systemLog: any;
28
+ saveConfig: any;
29
+ userNodeVersion: any;
30
+ explicitSecretKeys: any;
31
+ edgeFunctionsBootstrapURL: any;
32
+ }) => Promise<{
33
+ newEnvChanges: any;
34
+ netlifyConfig: any;
35
+ configMutations: any;
36
+ headersPath: any;
37
+ redirectsPath: any;
38
+ tags: any;
39
+ metrics: any;
40
+ newError?: undefined;
41
+ } | {
42
+ newError: any;
43
+ newEnvChanges?: undefined;
44
+ netlifyConfig?: undefined;
45
+ configMutations?: undefined;
46
+ headersPath?: undefined;
47
+ redirectsPath?: undefined;
48
+ tags?: undefined;
49
+ metrics?: undefined;
50
+ }>;
@@ -0,0 +1,48 @@
1
+ export function handleStepError({ event, newError, childEnv, mode, api, errorMonitor, deployId, coreStep, netlifyConfig, logs, debug, testOpts, }: {
2
+ event: any;
3
+ newError: any;
4
+ childEnv: any;
5
+ mode: any;
6
+ api: any;
7
+ errorMonitor: any;
8
+ deployId: any;
9
+ coreStep: any;
10
+ netlifyConfig: any;
11
+ logs: any;
12
+ debug: any;
13
+ testOpts: any;
14
+ }): Promise<{
15
+ failedPlugin: any[];
16
+ newStatus: {
17
+ state: any;
18
+ title: any;
19
+ summary: any;
20
+ text: string | undefined;
21
+ extraData: any;
22
+ };
23
+ }> | Promise<{
24
+ newError: any;
25
+ newStatus: {
26
+ state: any;
27
+ title: any;
28
+ summary: any;
29
+ text: string | undefined;
30
+ extraData: any;
31
+ };
32
+ }> | {
33
+ newError: any;
34
+ newStatus: {
35
+ state: any;
36
+ title: any;
37
+ summary: any;
38
+ text: string | undefined;
39
+ extraData: any;
40
+ };
41
+ } | {
42
+ newError: any;
43
+ };
44
+ export function getPluginErrorType(error: any, loadedFrom: any): {
45
+ type?: undefined;
46
+ } | {
47
+ type: string;
48
+ };
@@ -0,0 +1,8 @@
1
+ export function getSteps(steps: any): {
2
+ steps: any;
3
+ events: any[];
4
+ };
5
+ export function getDevSteps(command: any, steps: any): {
6
+ steps: any;
7
+ events: any[];
8
+ };
@@ -0,0 +1,39 @@
1
+ export function firePluginStep({ event, childProcess, packageName, packagePath, pluginPackageJson, loadedFrom, origin, envChanges, errorParams, configOpts, netlifyConfig, configMutations, headersPath, redirectsPath, constants, steps, error, logs, featureFlags, debug, verbose, }: {
2
+ event: any;
3
+ childProcess: any;
4
+ packageName: any;
5
+ packagePath: any;
6
+ pluginPackageJson: any;
7
+ loadedFrom: any;
8
+ origin: any;
9
+ envChanges: any;
10
+ errorParams: any;
11
+ configOpts: any;
12
+ netlifyConfig: any;
13
+ configMutations: any;
14
+ headersPath: any;
15
+ redirectsPath: any;
16
+ constants: any;
17
+ steps: any;
18
+ error: any;
19
+ logs: any;
20
+ featureFlags: any;
21
+ debug: any;
22
+ verbose: any;
23
+ }): Promise<{
24
+ newEnvChanges: any;
25
+ netlifyConfig: any;
26
+ configMutations: any;
27
+ headersPath: any;
28
+ redirectsPath: any;
29
+ newStatus: any;
30
+ newError?: undefined;
31
+ } | {
32
+ newError: any;
33
+ newEnvChanges?: undefined;
34
+ netlifyConfig?: undefined;
35
+ configMutations?: undefined;
36
+ headersPath?: undefined;
37
+ redirectsPath?: undefined;
38
+ newStatus?: undefined;
39
+ }>;
@@ -0,0 +1,55 @@
1
+ export function getStepReturn({ event, packageName, newError, newEnvChanges, newStatus, coreStep, coreStepName: timerName, childEnv, mode, api, errorMonitor, deployId, netlifyConfig, configMutations, headersPath, redirectsPath, logs, debug, timers, durationNs, testOpts, systemLog, quiet, metrics, }: {
2
+ event: any;
3
+ packageName: any;
4
+ newError: any;
5
+ newEnvChanges: any;
6
+ newStatus: any;
7
+ coreStep: any;
8
+ coreStepName?: string | undefined;
9
+ childEnv: any;
10
+ mode: any;
11
+ api: any;
12
+ errorMonitor: any;
13
+ deployId: any;
14
+ netlifyConfig: any;
15
+ configMutations: any;
16
+ headersPath: any;
17
+ redirectsPath: any;
18
+ logs: any;
19
+ debug: any;
20
+ timers: any;
21
+ durationNs: any;
22
+ testOpts: any;
23
+ systemLog: any;
24
+ quiet: any;
25
+ metrics: any;
26
+ }): Promise<{
27
+ failedPlugin: any[];
28
+ newStatus: {
29
+ state: any;
30
+ title: any;
31
+ summary: any;
32
+ text: string | undefined;
33
+ extraData: any;
34
+ };
35
+ }> | Promise<{
36
+ newError: any;
37
+ newStatus: {
38
+ state: any;
39
+ title: any;
40
+ summary: any;
41
+ text: string | undefined;
42
+ extraData: any;
43
+ };
44
+ }> | {
45
+ newError: any;
46
+ } | {
47
+ newEnvChanges: any;
48
+ netlifyConfig: any;
49
+ configMutations: any;
50
+ headersPath: any;
51
+ redirectsPath: any;
52
+ newStatus: any;
53
+ timers: any;
54
+ metrics: any;
55
+ };
@@ -0,0 +1,5 @@
1
+ import type { BuildFlags, BuildResult } from '../core/types.js';
2
+ /**
3
+ * Runs specific core steps for a build and returns whether it succeeded or not.
4
+ */
5
+ export declare const runCoreSteps: (buildSteps: string[], flags?: Partial<BuildFlags>) => Promise<BuildResult>;
@@ -0,0 +1,52 @@
1
+ export declare const runStep: ({ event, childProcess, packageName, coreStep, coreStepId, coreStepName, coreStepDescription, pluginPackageJson, loadedFrom, origin, condition, configPath, outputConfigPath, buildDir, packagePath, repositoryRoot, nodePath, index, childEnv, context, branch, envChanges, constants, steps, buildbotServerSocket, events, mode, api, errorMonitor, deployId, errorParams, error, failedPlugins, configOpts, netlifyConfig, configMutations, headersPath, redirectsPath, logs, debug, systemLog, verbose, saveConfig, timers, testOpts, featureFlags, quiet, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, }: {
2
+ event: any;
3
+ childProcess: any;
4
+ packageName: any;
5
+ coreStep: any;
6
+ coreStepId: any;
7
+ coreStepName: any;
8
+ coreStepDescription: any;
9
+ pluginPackageJson: any;
10
+ loadedFrom: any;
11
+ origin: any;
12
+ condition: any;
13
+ configPath: any;
14
+ outputConfigPath: any;
15
+ buildDir: any;
16
+ packagePath: any;
17
+ repositoryRoot: any;
18
+ nodePath: any;
19
+ index: any;
20
+ childEnv: any;
21
+ context: any;
22
+ branch: any;
23
+ envChanges: any;
24
+ constants: any;
25
+ steps: any;
26
+ buildbotServerSocket: any;
27
+ events: any;
28
+ mode: any;
29
+ api: any;
30
+ errorMonitor: any;
31
+ deployId: any;
32
+ errorParams: any;
33
+ error: any;
34
+ failedPlugins: any;
35
+ configOpts: any;
36
+ netlifyConfig: any;
37
+ configMutations: any;
38
+ headersPath: any;
39
+ redirectsPath: any;
40
+ logs: any;
41
+ debug: any;
42
+ systemLog: any;
43
+ verbose: any;
44
+ saveConfig: any;
45
+ timers: any;
46
+ testOpts: any;
47
+ featureFlags: any;
48
+ quiet: any;
49
+ userNodeVersion: any;
50
+ explicitSecretKeys: any;
51
+ edgeFunctionsBootstrapURL: any;
52
+ }) => Promise<{}>;
@@ -0,0 +1,44 @@
1
+ export function runSteps({ steps, buildbotServerSocket, events, configPath, outputConfigPath, headersPath, redirectsPath, buildDir, packagePath, repositoryRoot, nodePath, childEnv, context, branch, constants, mode, api, errorMonitor, deployId, errorParams, netlifyConfig, configOpts, logs, debug, systemLog, verbose, saveConfig, timers, testOpts, featureFlags, quiet, userNodeVersion, explicitSecretKeys, edgeFunctionsBootstrapURL, }: {
2
+ steps: any;
3
+ buildbotServerSocket: any;
4
+ events: any;
5
+ configPath: any;
6
+ outputConfigPath: any;
7
+ headersPath: any;
8
+ redirectsPath: any;
9
+ buildDir: any;
10
+ packagePath: any;
11
+ repositoryRoot: any;
12
+ nodePath: any;
13
+ childEnv: any;
14
+ context: any;
15
+ branch: any;
16
+ constants: any;
17
+ mode: any;
18
+ api: any;
19
+ errorMonitor: any;
20
+ deployId: any;
21
+ errorParams: any;
22
+ netlifyConfig: any;
23
+ configOpts: any;
24
+ logs: any;
25
+ debug: any;
26
+ systemLog: any;
27
+ verbose: any;
28
+ saveConfig: any;
29
+ timers: any;
30
+ testOpts: any;
31
+ featureFlags: any;
32
+ quiet: any;
33
+ userNodeVersion: any;
34
+ explicitSecretKeys: any;
35
+ edgeFunctionsBootstrapURL: any;
36
+ }): Promise<{
37
+ stepsCount: number;
38
+ netlifyConfig: any;
39
+ statuses: never[];
40
+ failedPlugins: never[];
41
+ timers: any;
42
+ configMutations: never[];
43
+ metrics: never[];
44
+ }>;
@@ -0,0 +1,23 @@
1
+ export function updateNetlifyConfig({ configOpts, netlifyConfig, headersPath, redirectsPath, configMutations, newConfigMutations, configSideFiles, errorParams, logs, debug, }: {
2
+ configOpts: any;
3
+ netlifyConfig: any;
4
+ headersPath: any;
5
+ redirectsPath: any;
6
+ configMutations: any;
7
+ newConfigMutations: any;
8
+ configSideFiles: any;
9
+ errorParams: any;
10
+ logs: any;
11
+ debug: any;
12
+ }): Promise<{
13
+ netlifyConfig: any;
14
+ configMutations: any;
15
+ headersPath?: undefined;
16
+ redirectsPath?: undefined;
17
+ } | {
18
+ netlifyConfig: any;
19
+ configMutations: any[];
20
+ headersPath: any;
21
+ redirectsPath: any;
22
+ }>;
23
+ export function listConfigSideFiles(sideFiles: any): Promise<string[]>;
@@ -0,0 +1,18 @@
1
+ export declare const trackBuildComplete: ({ deployId, buildId, status, stepsCount, pluginsOptions, durationNs, siteInfo, telemetry, userNodeVersion, framework, testOpts: { telemetryOrigin, telemetryTimeout }, }: {
2
+ deployId: any;
3
+ buildId: any;
4
+ status: any;
5
+ stepsCount: any;
6
+ pluginsOptions: any;
7
+ durationNs: any;
8
+ siteInfo: any;
9
+ telemetry: any;
10
+ userNodeVersion: any;
11
+ framework: any;
12
+ testOpts: {
13
+ telemetryOrigin?: string | undefined;
14
+ telemetryTimeout?: {
15
+ request: number;
16
+ } | undefined;
17
+ };
18
+ }) => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const addAggregatedTimers: (timers: any) => any[];
@@ -0,0 +1,16 @@
1
+ export declare const TOP_PARENT_TAG = "run_netlify_build";
2
+ export declare const initTimers: () => never[];
3
+ export declare const measureDuration: any;
4
+ export declare const createTimer: (stageTag: any, durationNs: any, { metricName, parentTag, category, tags }?: {
5
+ metricName?: string | undefined;
6
+ parentTag?: string | undefined;
7
+ category?: undefined;
8
+ tags?: undefined;
9
+ }) => {
10
+ metricName: string;
11
+ stageTag: any;
12
+ parentTag: string;
13
+ durationNs: any;
14
+ category: undefined;
15
+ tags: undefined;
16
+ };
@@ -0,0 +1,10 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ /** Starts a timer */
3
+ export declare const startTimer: NodeJS.HRTime;
4
+ /** Stops a timer */
5
+ export declare const endTimer: ([startSecs, startNsecs]: [number, number]) => number;
6
+ /**
7
+ * statsd expects milliseconds integers.
8
+ * To prevent double rounding errors, rounding should only be applied once.
9
+ */
10
+ export declare const roundTimerToMillisecs: (durationNs: number) => number;
@@ -0,0 +1,14 @@
1
+ import { InputStatsDOptions } from '../report/statsd.js';
2
+ interface Timer {
3
+ metricName: string;
4
+ stageTag: string;
5
+ parentTag: string;
6
+ durationNs: number;
7
+ tags: Record<string, string | string[]>;
8
+ }
9
+ /**
10
+ * Record the duration of a build phase, for monitoring.
11
+ * Sends to statsd daemon.
12
+ */
13
+ export declare const reportTimers: (timers: Timer[], statsdOpts: InputStatsDOptions, framework?: string) => Promise<void>;
14
+ export {};
@@ -0,0 +1,29 @@
1
+ import type { TracingOptions } from '../core/types.js';
2
+ /** Starts the tracing SDK, if there's already a tracing service this will be a no-op */
3
+ export declare const startTracing: (options: TracingOptions, logger: (...args: any[]) => void) => import("@opentelemetry/api").Context | undefined;
4
+ /** Stops the tracing service if there's one running. This will flush any ongoing events */
5
+ export declare const stopTracing: () => Promise<void>;
6
+ /** Sets attributes to be propagated across child spans under the current context */
7
+ export declare const setMultiSpanAttributes: (attributes: {
8
+ [key: string]: string;
9
+ }) => import("@opentelemetry/api").Context;
10
+ /** Add error information to the current active span (if any) */
11
+ export declare const addErrorToActiveSpan: (error: Error) => void;
12
+ /** Attributes used for the root span of our execution */
13
+ export type RootExecutionAttributes = {
14
+ 'build.id': string;
15
+ 'site.id': string;
16
+ 'deploy.id': string;
17
+ 'deploy.context': string;
18
+ };
19
+ /** Attributes used for the execution of each build step */
20
+ export type StepExecutionAttributes = {
21
+ 'build.execution.step.name': string;
22
+ 'build.execution.step.package_name': string;
23
+ 'build.execution.step.package_path': string;
24
+ 'build.execution.step.build_dir': string;
25
+ 'build.execution.step.id': string;
26
+ 'build.execution.step.loaded_from': string;
27
+ 'build.execution.step.origin': string;
28
+ 'build.execution.step.event': string;
29
+ };
@@ -0,0 +1 @@
1
+ export function addAsyncErrorMessage(asyncFunc: any, message: any): (...args: any[]) => Promise<any>;
@@ -0,0 +1,7 @@
1
+ import type { PackageJson } from 'read-pkg-up';
2
+ export type RootPackageJson = {
3
+ name: string;
4
+ version: string;
5
+ };
6
+ export declare const importJsonFile: (filePath: string) => Promise<PackageJson>;
7
+ export declare const ROOT_PACKAGE_JSON: RootPackageJson;
@@ -0,0 +1 @@
1
+ export declare const omit: <T extends object>(obj: T, keys: (keyof T)[]) => Partial<T>;
@@ -0,0 +1,10 @@
1
+ import { Options, PackageJson } from 'read-pkg-up';
2
+ type PackageResult = {
3
+ packageJson: PackageJson;
4
+ packageDir?: string;
5
+ };
6
+ /**
7
+ * Retrieve `package.json` from a specific directory
8
+ */
9
+ export declare const getPackageJson: (cwd: string, options?: Omit<Options, 'cwd'>) => Promise<PackageResult>;
10
+ export {};
@@ -0,0 +1 @@
1
+ export declare const removeFalsy: <T extends Record<PropertyKey, unknown>>(obj: T) => Partial<T>;
@@ -0,0 +1,8 @@
1
+ export function tryResolvePath(path: any, basedir: any): Promise<{
2
+ path: any;
3
+ error?: undefined;
4
+ } | {
5
+ error: any;
6
+ path?: undefined;
7
+ }>;
8
+ export function resolvePath(path: any, basedir: any): Promise<any>;
@@ -0,0 +1 @@
1
+ export function isRuntime(pluginOption: any): boolean;
@@ -0,0 +1,2 @@
1
+ export function isPreviousMajor(versionA: any, versionB: any): boolean;
2
+ export function getMajorVersion(version: any): string | undefined;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "29.20.6",
3
+ "version": "29.20.8",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
- "exports": "./lib/core/main.js",
7
- "main": "./lib/core/main.js",
8
- "types": "./types/index.d.ts",
6
+ "exports": "./lib/index.js",
7
+ "main": "./lib/index.js",
8
+ "types": "./lib/index.d.ts",
9
9
  "bin": {
10
10
  "netlify-build": "./bin.js"
11
11
  },
@@ -13,6 +13,7 @@
13
13
  "bin.js",
14
14
  "lib/**/*.js",
15
15
  "lib/**/*.yml",
16
+ "lib/**/*.d.ts",
16
17
  "types/**/*.d.ts"
17
18
  ],
18
19
  "author": "Netlify Inc.",
@@ -24,9 +25,10 @@
24
25
  "prebuild": "rm -rf lib",
25
26
  "postbuild": "npx copyfiles \"src/**/*.yml\" lib/ -u 1",
26
27
  "build": "tsc",
27
- "test": "ava",
28
+ "test:types": "tsd",
29
+ "test": "ava && tsd",
28
30
  "test:dev": "ava -w",
29
- "test:ci": "c8 -r lcovonly -r text -r json ava",
31
+ "test:ci": "c8 -r lcovonly -r text -r json ava && tsd",
30
32
  "test:measure": "../../tools/tests-duration.js"
31
33
  },
32
34
  "keywords": [
@@ -66,13 +68,13 @@
66
68
  "@honeycombio/opentelemetry-node": "^0.4.0",
67
69
  "@netlify/cache-utils": "^5.1.5",
68
70
  "@netlify/config": "^20.8.0",
69
- "@netlify/edge-bundler": "8.18.0",
71
+ "@netlify/edge-bundler": "8.19.0",
70
72
  "@netlify/framework-info": "^9.8.10",
71
- "@netlify/functions-utils": "^5.2.23",
73
+ "@netlify/functions-utils": "^5.2.24",
72
74
  "@netlify/git-utils": "^5.1.1",
73
75
  "@netlify/plugins-list": "^6.71.0",
74
76
  "@netlify/run-utils": "^5.1.1",
75
- "@netlify/zip-it-and-ship-it": "9.16.0",
77
+ "@netlify/zip-it-and-ship-it": "9.17.0",
76
78
  "@opentelemetry/api": "^1.4.1",
77
79
  "@sindresorhus/slugify": "^2.0.0",
78
80
  "ansi-escapes": "^6.0.0",
@@ -143,10 +145,5 @@
143
145
  "engines": {
144
146
  "node": "^14.16.0 || >=16.0.0"
145
147
  },
146
- "tsd": {
147
- "compilerOptions": {
148
- "module": "commonjs"
149
- }
150
- },
151
- "gitHead": "3e09f4b70b666e0f9aabfc6065dd391a13c11e2f"
148
+ "gitHead": "a6e1eb4b78f326abcec554b345f6b8eb942b3600"
152
149
  }
@@ -1,4 +1,4 @@
1
- import { JSONValue } from '../utils/json_value'
1
+ import type { JSONValue } from '../utils/json_value.d.ts'
2
2
 
3
3
  // Helper type to be used as a workaround for the fact that `interface`s don't have implicit
4
4
  // index signatures: https://github.com/microsoft/TypeScript/issues/15300
@@ -1,8 +1,8 @@
1
- import { Many } from '../utils/many'
1
+ import type { Many } from '../utils/many.d.ts'
2
2
 
3
- import { Build } from './build'
4
- import { Functions } from './functions'
5
- import { PluginInputs } from './inputs'
3
+ import type { Build } from './build.d.ts'
4
+ import type { Functions } from './functions.d.ts'
5
+ import type { PluginInputs } from './inputs.d.ts'
6
6
 
7
7
  type HttpStatusCode = number
8
8
 
package/types/index.d.ts CHANGED
@@ -1,7 +1,7 @@
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'
7
- export { ListedFunction, ListedFunctionFile } from './options/netlify_plugin_functions_util'
1
+ export type { NetlifyPlugin } from './netlify_plugin.d.ts'
2
+ export type { NetlifyPluginOptions } from './netlify_plugin_options.d.ts'
3
+ export type { OnBuild, OnEnd, OnError, OnPostBuild, OnPreBuild, OnSuccess } from './netlify_event_handler.d.ts'
4
+ export type { NetlifyConfig } from './config/netlify_config.d.ts'
5
+ export type { NetlifyPluginUtils } from './options/netlify_plugin_utils.js'
6
+ export type { NetlifyPluginConstants } from './netlify_plugin_constants.d.ts'
7
+ export type { ListedFunction, ListedFunctionFile } from './options/netlify_plugin_functions_util.d.ts'
@@ -1,5 +1,5 @@
1
- import { PluginInputs, StringKeys } from './config/inputs'
2
- import { NetlifyPluginOptions } from './netlify_plugin_options'
1
+ import type { PluginInputs, StringKeys } from './config/inputs.d.ts'
2
+ import type { NetlifyPluginOptions } from './netlify_plugin_options.d.ts'
3
3
 
4
4
  interface NetlifyEventHandler<PluginOptions extends NetlifyPluginOptions = NetlifyPluginOptions> {
5
5
  (options: PluginOptions): void | Promise<void>
@@ -1,5 +1,5 @@
1
- import { PluginInputs } from './config/inputs'
2
- import { OnBuild, OnEnd, OnError, OnPostBuild, OnPreBuild, OnSuccess } from './netlify_event_handler'
1
+ import type { PluginInputs } from './config/inputs.d.ts'
2
+ import type { OnBuild, OnEnd, OnError, OnPostBuild, OnPreBuild, OnSuccess } from './netlify_event_handler.d.ts'
3
3
 
4
4
  export interface NetlifyPlugin<TInputs extends PluginInputs = PluginInputs> {
5
5
  /**
@@ -1,8 +1,8 @@
1
- import { PluginInputs, StringKeys } from './config/inputs'
2
- import { NetlifyConfig } from './config/netlify_config'
3
- import { NetlifyPluginConstants } from './netlify_plugin_constants'
4
- import { NetlifyPluginUtils } from './options/netlify_plugin_utils'
5
- import { JSONValue } from './utils/json_value'
1
+ import type { PluginInputs, StringKeys } from './config/inputs.d.ts'
2
+ import type { NetlifyConfig } from './config/netlify_config.d.ts'
3
+ import type { NetlifyPluginConstants } from './netlify_plugin_constants.d.ts'
4
+ import type { NetlifyPluginUtils } from './options/netlify_plugin_utils.d.ts'
5
+ import type { JSONValue } from './utils/json_value.d.ts'
6
6
 
7
7
  export interface NetlifyPluginOptions<TInputs extends PluginInputs<StringKeys<TInputs>> = PluginInputs> {
8
8
  /**