@netlify/build 29.20.6 → 29.20.7

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 +9 -12
  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,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/lib/core/bin.js CHANGED
@@ -5,7 +5,7 @@ import yargs from 'yargs';
5
5
  import { hideBin } from 'yargs/helpers';
6
6
  import { normalizeCliFeatureFlags } from './feature_flags.js';
7
7
  import { FLAGS } from './flags.js';
8
- import build from './main.js';
8
+ import { buildSite } from './main.js';
9
9
  import { FALLBACK_SEVERITY_ENTRY } from './severity.js';
10
10
  // CLI entry point.
11
11
  // Before adding logic to this file, please consider adding it to the main
@@ -17,7 +17,7 @@ const runCli = async function () {
17
17
  const flagsA = includeKeys(flags, isUserFlag);
18
18
  const state = { done: false };
19
19
  process.on('exit', onExit.bind(undefined, state));
20
- const { severityCode, logs } = await build(flagsA);
20
+ const { severityCode, logs } = await buildSite(flagsA);
21
21
  printLogs(logs);
22
22
  process.exitCode = severityCode;
23
23
  state.done = true;
@@ -0,0 +1,84 @@
1
+ import type { BuildFlags } from './types.js';
2
+ export declare const startBuild: (flags: Partial<BuildFlags>) => {
3
+ rootTracingContext: import("@opentelemetry/api").Context | undefined;
4
+ debug: boolean;
5
+ systemLogFile: number | undefined;
6
+ errorMonitor: any;
7
+ logs: import("../log/logger.js").BufferedLogs | undefined;
8
+ timers: never[];
9
+ env: Record<string, unknown>;
10
+ token: string;
11
+ mode: import("./types.js").Mode;
12
+ offline: boolean;
13
+ telemetry: boolean;
14
+ verbose: boolean;
15
+ functionsDistDir: string;
16
+ edgeFunctionsDistDir: string;
17
+ cacheDir: string;
18
+ sendStatus: boolean;
19
+ saveConfig: boolean;
20
+ apiHost?: string | undefined;
21
+ testOpts: import("./types.js").TestOptions;
22
+ statsd: {
23
+ port: number;
24
+ };
25
+ timeline: string;
26
+ cachedConfig: Record<string, unknown>;
27
+ siteId: string;
28
+ dry: false;
29
+ context: string;
30
+ statsdOpts: {
31
+ host?: number | undefined;
32
+ port: number;
33
+ };
34
+ };
35
+ export declare const execBuild: any;
36
+ export declare const runAndReportBuild: ({ pluginsOptions, netlifyConfig, configOpts, siteInfo, configPath, outputConfigPath, headersPath, redirectsPath, packagePath, buildDir, repositoryRoot, nodePath, packageJson, userNodeVersion, childEnv, context, branch, buildbotServerSocket, constants, dry, mode, api, errorMonitor, deployId, errorParams, logs, debug, systemLog, verbose, timers, sendStatus, saveConfig, testOpts, featureFlags, timeline, devCommand, quiet, integrations, explicitSecretKeys, edgeFunctionsBootstrapURL, }: {
37
+ pluginsOptions: any;
38
+ netlifyConfig: any;
39
+ configOpts: any;
40
+ siteInfo: any;
41
+ configPath: any;
42
+ outputConfigPath: any;
43
+ headersPath: any;
44
+ redirectsPath: any;
45
+ packagePath: any;
46
+ buildDir: any;
47
+ repositoryRoot: any;
48
+ nodePath: any;
49
+ packageJson: any;
50
+ userNodeVersion: any;
51
+ childEnv: any;
52
+ context: any;
53
+ branch: any;
54
+ buildbotServerSocket: any;
55
+ constants: any;
56
+ dry: any;
57
+ mode: any;
58
+ api: any;
59
+ errorMonitor: any;
60
+ deployId: any;
61
+ errorParams: any;
62
+ logs: any;
63
+ debug: any;
64
+ systemLog: any;
65
+ verbose: any;
66
+ timers: any;
67
+ sendStatus: any;
68
+ saveConfig: any;
69
+ testOpts: any;
70
+ featureFlags: any;
71
+ timeline: any;
72
+ devCommand: any;
73
+ quiet: any;
74
+ integrations: any;
75
+ explicitSecretKeys: any;
76
+ edgeFunctionsBootstrapURL: any;
77
+ }) => Promise<{
78
+ pluginsOptions: any;
79
+ netlifyConfig: any;
80
+ stepsCount: number | undefined;
81
+ timers: any;
82
+ configMutations: never[] | undefined;
83
+ metrics: never[] | undefined;
84
+ }>;
@@ -0,0 +1,65 @@
1
+ export function getConfigOpts({ config, defaultConfig, cwd, repositoryRoot, packagePath, apiHost, token, siteId, context, branch, baseRelDir, envOpt, mode, offline, deployId, buildId, testOpts, featureFlags, }: {
2
+ config: any;
3
+ defaultConfig: any;
4
+ cwd: any;
5
+ repositoryRoot: any;
6
+ packagePath: any;
7
+ apiHost: any;
8
+ token: any;
9
+ siteId: any;
10
+ context: any;
11
+ branch: any;
12
+ baseRelDir: any;
13
+ envOpt: any;
14
+ mode: any;
15
+ offline: any;
16
+ deployId: any;
17
+ buildId: any;
18
+ testOpts: any;
19
+ featureFlags: any;
20
+ }): {
21
+ config: any;
22
+ defaultConfig: any;
23
+ cwd: any;
24
+ packagePath: any;
25
+ repositoryRoot: any;
26
+ context: any;
27
+ branch: any;
28
+ baseRelDir: any;
29
+ host: any;
30
+ token: any;
31
+ siteId: any;
32
+ deployId: any;
33
+ buildId: any;
34
+ mode: any;
35
+ offline: any;
36
+ env: any;
37
+ testOpts: any;
38
+ featureFlags: any;
39
+ };
40
+ export const loadConfig: any;
41
+ export function resolveUpdatedConfig(configOpts: any, configMutations: any): Promise<any>;
42
+ export function saveUpdatedConfig({ configMutations, buildDir, repositoryRoot, configPath, outputConfigPath, headersPath, redirectsPath, logs, featureFlags, context, branch, debug, saveConfig, }: {
43
+ configMutations: any;
44
+ buildDir: any;
45
+ repositoryRoot: any;
46
+ configPath?: string | undefined;
47
+ outputConfigPath?: any;
48
+ headersPath: any;
49
+ redirectsPath: any;
50
+ logs: any;
51
+ featureFlags: any;
52
+ context: any;
53
+ branch: any;
54
+ debug: any;
55
+ saveConfig: any;
56
+ }): Promise<void>;
57
+ export function restoreUpdatedConfig({ configMutations, buildDir, repositoryRoot, configPath, headersPath, redirectsPath, saveConfig, }: {
58
+ configMutations: any;
59
+ buildDir: any;
60
+ repositoryRoot: any;
61
+ configPath?: string | undefined;
62
+ headersPath: any;
63
+ redirectsPath: any;
64
+ saveConfig: any;
65
+ }): Promise<void>;
@@ -0,0 +1,26 @@
1
+ export function getConstants({ configPath, buildDir, packagePath, functionsDistDir, edgeFunctionsDistDir, cacheDir, netlifyConfig, siteInfo: { id: siteId }, apiHost, token, mode, }: {
2
+ configPath: any;
3
+ buildDir: any;
4
+ packagePath: any;
5
+ functionsDistDir: any;
6
+ edgeFunctionsDistDir: any;
7
+ cacheDir: any;
8
+ netlifyConfig: any;
9
+ siteInfo: {
10
+ id: any;
11
+ };
12
+ apiHost: any;
13
+ token: any;
14
+ mode: any;
15
+ }): Promise<Record<string, any> & Record<string, unknown>>;
16
+ export function addMutableConstants({ constants, buildDir, netlifyConfig: { build: { publish, edge_functions: edgeFunctions }, functionsDirectory, }, }: {
17
+ constants: any;
18
+ buildDir: any;
19
+ netlifyConfig: {
20
+ build: {
21
+ publish: any;
22
+ edge_functions: any;
23
+ };
24
+ functionsDirectory: any;
25
+ };
26
+ }): Promise<Record<string, any> & Record<string, unknown>>;
@@ -0,0 +1,18 @@
1
+ export function startDev(devCommand: any, flags?: {}): Promise<{
2
+ success: boolean;
3
+ severityCode: number;
4
+ netlifyConfig: any;
5
+ logs: import("../log/logger.js").BufferedLogs | undefined;
6
+ configMutations: any;
7
+ error?: undefined;
8
+ } | {
9
+ success: boolean;
10
+ severityCode: number;
11
+ logs: import("../log/logger.js").BufferedLogs | undefined;
12
+ error: {
13
+ message: any;
14
+ stack: any;
15
+ };
16
+ netlifyConfig?: undefined;
17
+ configMutations?: undefined;
18
+ }>;
@@ -0,0 +1,8 @@
1
+ export function doDryRun({ buildDir, steps, netlifyConfig, constants, buildbotServerSocket, logs }: {
2
+ buildDir: any;
3
+ steps: any;
4
+ netlifyConfig: any;
5
+ constants: any;
6
+ buildbotServerSocket: any;
7
+ logs: any;
8
+ }): Promise<void>;
@@ -0,0 +1,3 @@
1
+ export type FeatureFlags = Record<string, boolean>;
2
+ export declare const normalizeCliFeatureFlags: (cliFeatureFlags: string) => FeatureFlags;
3
+ export declare const DEFAULT_FEATURE_FLAGS: FeatureFlags;
@@ -0,0 +1,230 @@
1
+ export const FLAGS: {
2
+ config: {
3
+ string: boolean;
4
+ describe: string;
5
+ };
6
+ defaultConfig: {
7
+ string: boolean;
8
+ describe: string;
9
+ coerce: (value: any) => any;
10
+ hidden: boolean;
11
+ };
12
+ cachedConfig: {
13
+ string: boolean;
14
+ describe: string;
15
+ coerce: (value: any) => any;
16
+ hidden: boolean;
17
+ };
18
+ cachedConfigPath: {
19
+ string: boolean;
20
+ describe: string;
21
+ hidden: boolean;
22
+ };
23
+ cwd: {
24
+ string: boolean;
25
+ describe: string;
26
+ };
27
+ repositoryRoot: {
28
+ string: boolean;
29
+ describe: string;
30
+ };
31
+ packagePath: {
32
+ string: boolean;
33
+ describe: string;
34
+ };
35
+ apiHost: {
36
+ string: boolean;
37
+ describe: string;
38
+ };
39
+ token: {
40
+ string: boolean;
41
+ describe: string;
42
+ };
43
+ siteId: {
44
+ string: boolean;
45
+ describe: string;
46
+ };
47
+ deployId: {
48
+ string: boolean;
49
+ describe: string;
50
+ };
51
+ buildId: {
52
+ string: boolean;
53
+ describe: string;
54
+ };
55
+ context: {
56
+ string: boolean;
57
+ describe: string;
58
+ };
59
+ branch: {
60
+ string: boolean;
61
+ describe: string;
62
+ };
63
+ framework: {
64
+ string: boolean;
65
+ describe: string;
66
+ hidden: boolean;
67
+ };
68
+ baseRelDir: {
69
+ boolean: boolean;
70
+ describe: string;
71
+ hidden: boolean;
72
+ };
73
+ dry: {
74
+ alias: string;
75
+ boolean: boolean;
76
+ describe: string;
77
+ };
78
+ nodePath: {
79
+ string: boolean;
80
+ describe: string;
81
+ };
82
+ functionsDistDir: {
83
+ string: boolean;
84
+ describe: string;
85
+ hidden: boolean;
86
+ };
87
+ edgeFunctionsDistDir: {
88
+ string: boolean;
89
+ describe: string;
90
+ hidden: boolean;
91
+ };
92
+ cacheDir: {
93
+ string: boolean;
94
+ describe: string;
95
+ hidden: boolean;
96
+ };
97
+ buildbotServerSocket: {
98
+ string: boolean;
99
+ describe: string;
100
+ hidden: boolean;
101
+ };
102
+ telemetry: {
103
+ boolean: boolean;
104
+ describe: string;
105
+ };
106
+ mode: {
107
+ string: boolean;
108
+ describe: string;
109
+ hidden: boolean;
110
+ };
111
+ debug: {
112
+ boolean: boolean;
113
+ describe: string;
114
+ hidden: boolean;
115
+ };
116
+ systemLogFile: {
117
+ type: string;
118
+ describe: string;
119
+ hidden: boolean;
120
+ };
121
+ verbose: {
122
+ boolean: boolean;
123
+ describe: string;
124
+ hidden: boolean;
125
+ };
126
+ sendStatus: {
127
+ boolean: boolean;
128
+ describe: string;
129
+ hidden: boolean;
130
+ };
131
+ saveConfig: {
132
+ boolean: boolean;
133
+ describe: string;
134
+ hidden: boolean;
135
+ };
136
+ outputConfigPath: {
137
+ type: string;
138
+ describe: string;
139
+ hidden: boolean;
140
+ };
141
+ testOpts: {
142
+ describe: string;
143
+ hidden: boolean;
144
+ };
145
+ featureFlags: {
146
+ describe: string;
147
+ hidden: boolean;
148
+ };
149
+ statsd: {
150
+ describe: string;
151
+ hidden: boolean;
152
+ };
153
+ 'statsd.host': {
154
+ type: string;
155
+ describe: string;
156
+ hidden: boolean;
157
+ };
158
+ 'statsd.port': {
159
+ type: string;
160
+ describe: string;
161
+ hidden: boolean;
162
+ };
163
+ tracing: {
164
+ describe: string;
165
+ hidden: boolean;
166
+ };
167
+ 'tracing.enabled': {
168
+ boolean: boolean;
169
+ describe: string;
170
+ hidden: boolean;
171
+ };
172
+ 'tracing.apiKey': {
173
+ string: boolean;
174
+ describe: string;
175
+ hidden: boolean;
176
+ };
177
+ 'tracing.httpProtocol': {
178
+ string: boolean;
179
+ describe: string;
180
+ hidden: boolean;
181
+ };
182
+ 'tracing.host': {
183
+ string: boolean;
184
+ describe: string;
185
+ hidden: boolean;
186
+ };
187
+ 'tracing.port': {
188
+ number: boolean;
189
+ describe: string;
190
+ hidden: boolean;
191
+ };
192
+ 'tracing.traceId': {
193
+ string: boolean;
194
+ describe: string;
195
+ hidden: boolean;
196
+ };
197
+ 'tracing.parentSpanId': {
198
+ string: boolean;
199
+ describe: string;
200
+ hidden: boolean;
201
+ };
202
+ 'tracing.sampleRate': {
203
+ number: boolean;
204
+ describe: string;
205
+ hidden: boolean;
206
+ };
207
+ 'tracing.traceFlags': {
208
+ number: boolean;
209
+ describe: string;
210
+ hidden: boolean;
211
+ };
212
+ offline: {
213
+ boolean: boolean;
214
+ describe: string;
215
+ };
216
+ buffer: {
217
+ boolean: boolean;
218
+ describe: string;
219
+ };
220
+ timeline: {
221
+ string: boolean;
222
+ describe: string;
223
+ hidden: boolean;
224
+ };
225
+ explicitSecretKeys: {
226
+ type: string;
227
+ describe: string;
228
+ hidden: boolean;
229
+ };
230
+ };
@@ -0,0 +1,7 @@
1
+ export function warnOnLingeringProcesses({ mode, logs, testOpts: { silentLingeringProcesses }, }: {
2
+ mode: any;
3
+ logs: any;
4
+ testOpts: {
5
+ silentLingeringProcesses?: boolean | undefined;
6
+ };
7
+ }): Promise<void>;
@@ -0,0 +1,14 @@
1
+ import { BuildFlags } from './types.js';
2
+ /**
3
+ * Main entry point of Netlify Build.
4
+ * Runs a builds and returns whether it succeeded or not.
5
+ *
6
+ * @param flags - build configuration CLI flags
7
+ */
8
+ export declare function buildSite(flags?: Partial<BuildFlags>): Promise<{
9
+ success: boolean;
10
+ severityCode: number;
11
+ logs: any;
12
+ netlifyConfig?: any;
13
+ configMutations?: any;
14
+ }>;
package/lib/core/main.js CHANGED
@@ -9,8 +9,6 @@ import { stopTracing, setMultiSpanAttributes } from '../tracing/main.js';
9
9
  import { execBuild, startBuild } from './build.js';
10
10
  import { reportMetrics } from './report_metrics.js';
11
11
  import { getSeverity } from './severity.js';
12
- export { startDev } from './dev.js';
13
- export { runCoreSteps } from '../steps/run_core_steps.js';
14
12
  const tracer = trace.getTracer('core');
15
13
  /**
16
14
  * Main entry point of Netlify Build.
@@ -18,7 +16,7 @@ const tracer = trace.getTracer('core');
18
16
  *
19
17
  * @param flags - build configuration CLI flags
20
18
  */
21
- export default async function buildSite(flags = {}) {
19
+ export async function buildSite(flags = {}) {
22
20
  const { errorMonitor, framework, mode, logs, debug, systemLogFile, testOpts, statsdOpts, dry, telemetry, buildId, deployId, rootTracingContext, ...flagsA } = startBuild(flags);
23
21
  const errorParams = { errorMonitor, mode, logs, debug, testOpts };
24
22
  const systemLog = getSystemLogger(logs, debug, systemLogFile);
@@ -0,0 +1,9 @@
1
+ export function warnOnMissingSideFiles({ buildDir, netlifyConfig: { build: { publish }, }, logs, }: {
2
+ buildDir: any;
3
+ netlifyConfig: {
4
+ build: {
5
+ publish: any;
6
+ };
7
+ };
8
+ logs: any;
9
+ }): Promise<void>;
@@ -0,0 +1,38 @@
1
+ import type { BuildFlags, Mode, TestOptions, TracingOptions } from './types.js';
2
+ export type ResolvedFlags = {
3
+ env: Record<string, unknown>;
4
+ token: string;
5
+ mode: Mode;
6
+ offline: boolean;
7
+ telemetry: boolean;
8
+ verbose: boolean;
9
+ /** The dist directory of the functions @default `.netlify/functions/` */
10
+ functionsDistDir: string;
11
+ /** The dist directory of the edge functions @default `.netlify/edge-functions-dist/` */
12
+ edgeFunctionsDistDir: string;
13
+ /** The directory that is used for storing the cache @default `.netlify/cache/` */
14
+ cacheDir: string;
15
+ debug: boolean;
16
+ sendStatus: boolean;
17
+ saveConfig: boolean;
18
+ /** Netlify API endpoint @default `api.netlify.com` */
19
+ apiHost?: string;
20
+ testOpts: TestOptions;
21
+ statsd: {
22
+ port: number;
23
+ };
24
+ timeline: 'build' | string;
25
+ cachedConfig: Record<string, unknown>;
26
+ siteId: string;
27
+ dry: false;
28
+ context: 'production' | string;
29
+ statsdOpts: {
30
+ host?: number;
31
+ port: number;
32
+ };
33
+ bugsnagKey?: string;
34
+ systemLogFile?: number;
35
+ tracingOpts: TracingOptions;
36
+ };
37
+ /** Normalize CLI flags */
38
+ export declare const normalizeFlags: (flags: Partial<BuildFlags>, logs: any) => ResolvedFlags;
@@ -0,0 +1,12 @@
1
+ import { InputStatsDOptions } from '../report/statsd.js';
2
+ export type Metric = {
3
+ type: 'increment';
4
+ name: string;
5
+ value: number;
6
+ tags: Record<string, string | string[]>;
7
+ };
8
+ /**
9
+ * Record number of functions build and differentiate between autogenerated and user generated.
10
+ * Sends to statsd daemon.
11
+ */
12
+ export declare const reportMetrics: (statsdOpts: InputStatsDOptions, metrics: Metric[]) => Promise<void>;
@@ -0,0 +1,38 @@
1
+ declare const SEVERITY_MAP: {
2
+ success: {
3
+ severityCode: number;
4
+ status: string;
5
+ };
6
+ none: {
7
+ severityCode: number;
8
+ status: string;
9
+ };
10
+ info: {
11
+ severityCode: number;
12
+ status: string;
13
+ };
14
+ warning: {
15
+ severityCode: number;
16
+ status: string;
17
+ };
18
+ error: {
19
+ severityCode: number;
20
+ status: string;
21
+ };
22
+ };
23
+ export type Severity = keyof typeof SEVERITY_MAP;
24
+ /** Map error severities to exit codes and status (used for telemetry purposes) */
25
+ export declare const FALLBACK_SEVERITY_ENTRY: {
26
+ severityCode: number;
27
+ status: string;
28
+ };
29
+ /**
30
+ * Used to extract exit codes and respective status strings
31
+ * 1|2|3 indicate whether this was a user|plugin|system error.
32
+ */
33
+ export declare const getSeverity: (severity?: Severity) => {
34
+ severityCode: number;
35
+ status: string;
36
+ success: boolean;
37
+ };
38
+ export {};
@@ -0,0 +1,83 @@
1
+ import { NetlifyConfig } from '../../types/index.js';
2
+ export type Mode = 'buildbot' | 'cli' | 'require';
3
+ export type BuildCLIFlags = {
4
+ cachedConfig: Record<string, unknown>;
5
+ /** Netlify Site ID */
6
+ siteId: string;
7
+ /** Netlify API token for authentication */
8
+ token: string;
9
+ /**
10
+ * Run in dry mode, i.e. printing steps without executing them
11
+ * @default false
12
+ */
13
+ dry: boolean;
14
+ debug?: unknown;
15
+ /** Build context */
16
+ context: 'production' | string;
17
+ /** The invoking service of netlify build */
18
+ mode: Mode;
19
+ telemetry: boolean;
20
+ /** Distributed tracing properties for this build*/
21
+ tracing: TracingOptions;
22
+ /**
23
+ * Buffer output instead of printing it
24
+ * @default false
25
+ */
26
+ buffer?: boolean;
27
+ offline: boolean;
28
+ cwd?: string;
29
+ /** A list of all the feature flags passed to netlify/build */
30
+ featureFlags: Record<string, boolean>;
31
+ /**
32
+ * Print only essential/error output
33
+ * @default false
34
+ */
35
+ quiet?: boolean;
36
+ statsd?: {
37
+ host?: string;
38
+ port?: number;
39
+ };
40
+ };
41
+ export type BuildFlags = BuildCLIFlags & {
42
+ env?: Record<string, unknown>;
43
+ };
44
+ export type BuildResult = {
45
+ success: boolean;
46
+ severityCode: SeverityCode;
47
+ netlifyConfig?: NetlifyConfig;
48
+ configMutations?: any;
49
+ logs?: string[];
50
+ };
51
+ export declare enum SeverityCode {
52
+ success = 1,
53
+ buildCancelled = 2,
54
+ userError = 3,
55
+ pluginError = 4,
56
+ systemError = 5
57
+ }
58
+ export type TestOptions = {
59
+ errorMonitor?: any;
60
+ };
61
+ export type ErrorParam = {
62
+ errorMonitor: any;
63
+ mode: Mode;
64
+ logs: string[];
65
+ debug: any;
66
+ testOpts?: TestOptions;
67
+ childEnv?: any;
68
+ netlifyConfig?: NetlifyConfig;
69
+ };
70
+ export type TracingOptions = {
71
+ enabled: boolean;
72
+ httpProtocol: string;
73
+ host: string;
74
+ port: number;
75
+ /** API Key used for a dedicated trace provider */
76
+ apiKey: string;
77
+ /** Sample rate being used for this trace, this allows for consistent probability sampling */
78
+ sampleRate: number;
79
+ /** Properties of the root span and trace id used to stitch context */
80
+ traceId: string;
81
+ traceFlags: number;
82
+ parentSpanId: string;
83
+ };
@@ -0,0 +1 @@
1
+ export function getUserNodeVersion(nodePath: any): Promise<string | null>;