@netlify/build 33.4.3 → 33.4.5

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.
@@ -31,7 +31,10 @@ export declare const startBuild: (flags: Partial<BuildFlags>) => {
31
31
  port: number;
32
32
  };
33
33
  };
34
- export declare const execBuild: any;
34
+ export declare const execBuild: ({ timers, ...opts }: {
35
+ [x: string]: any;
36
+ timers: any;
37
+ }, ...args: any[]) => Promise<any>;
35
38
  export declare const runAndReportBuild: ({ pluginsOptions, netlifyConfig, defaultConfig, configOpts, siteInfo, configPath, outputConfigPath, headersPath, redirectsPath, packagePath, buildDir, repositoryRoot, nodePath, packageJson, userNodeVersion, childEnv, context, branch, buildbotServerSocket, constants, dry, mode, api, token, errorMonitor, deployId, errorParams, logs, debug, systemLog, systemLogFile, verbose, timers, sendStatus, saveConfig, testOpts, featureFlags, timeline, devCommand, quiet, integrations, explicitSecretKeys, enhancedSecretScan, edgeFunctionsBootstrapURL, eventHandlers, }: {
36
39
  pluginsOptions: any;
37
40
  netlifyConfig: any;
@@ -39,7 +39,10 @@ export function getConfigOpts({ config, defaultConfig, cwd, repositoryRoot, pack
39
39
  testOpts: any;
40
40
  featureFlags: any;
41
41
  };
42
- export const loadConfig: any;
42
+ export const loadConfig: ({ timers, ...opts }: {
43
+ [x: string]: any;
44
+ timers: any;
45
+ }, ...args: any[]) => Promise<any>;
43
46
  export function resolveUpdatedConfig(configOpts: any, configMutations: any, defaultConfig: any): Promise<import("packages/config/lib/main.js").Config>;
44
47
  export function saveUpdatedConfig({ configMutations, buildDir, repositoryRoot, configPath, outputConfigPath, headersPath, redirectsPath, logs, featureFlags, context, branch, debug, saveConfig, }: {
45
48
  configMutations: any;
@@ -1,4 +1,4 @@
1
- import { packageDirectory } from 'pkg-dir';
1
+ import { packageDirectory } from 'package-directory';
2
2
  import { logInstallLocalPluginsDeps } from '../log/messages/install.js';
3
3
  import { installDependencies } from './main.js';
4
4
  // Install dependencies of local plugins.
@@ -1,6 +1,6 @@
1
1
  import logProcessErrors from 'log-process-errors';
2
2
  import { errorToJson } from '../../error/build.js';
3
- import { addDefaultErrorInfo, isBuildError } from '../../error/info.js';
3
+ import { addDefaultErrorInfo } from '../../error/info.js';
4
4
  import { normalizeError } from '../../error/parse/normalize.js';
5
5
  import { sendEventToParent } from '../ipc.js';
6
6
  // Handle any top-level error and communicate it back to parent
@@ -13,14 +13,12 @@ export const handleError = async function (error, verbose) {
13
13
  // On uncaught exceptions and unhandled rejections, print the stack trace.
14
14
  // Also, prevent child processes from crashing on uncaught exceptions.
15
15
  export const handleProcessErrors = function () {
16
- logProcessErrors({ log: handleProcessError, exitOn: [] });
16
+ logProcessErrors({ onError: handleProcessError, exit: false });
17
17
  };
18
- const handleProcessError = async function (error, level, originalError) {
19
- if (level !== 'error') {
20
- console[level](error);
18
+ const handleProcessError = async function (error, event) {
19
+ if (event === 'warning') {
20
+ console.warn(error);
21
21
  return;
22
22
  }
23
- // Do not use log-process-errors prettification with errors thrown by `utils.build.*`
24
- const errorA = isBuildError(originalError) ? originalError : error;
25
- await handleError(errorA);
23
+ await handleError(error);
26
24
  };
@@ -1,5 +1,8 @@
1
1
  import { PackageJson } from 'read-package-up';
2
- export declare const getPluginsOptions: any;
2
+ export declare const getPluginsOptions: ({ timers, ...opts }: {
3
+ [x: string]: any;
4
+ timers: any;
5
+ }, ...args: any[]) => Promise<any>;
3
6
  /**
4
7
  * Retrieve information about @netlify/build when an error happens there and not
5
8
  * in a plugin
@@ -3,7 +3,10 @@ import { NetlifyConfig } from '../index.js';
3
3
  import { BufferedLogs } from '../log/logger.js';
4
4
  import { PluginsOptions } from './node_version.js';
5
5
  export type ChildProcess = ExecaChildProcess<string>;
6
- export declare const startPlugins: any;
6
+ export declare const startPlugins: ({ timers, ...opts }: {
7
+ [x: string]: any;
8
+ timers: any;
9
+ }, ...args: any[]) => Promise<any>;
7
10
  export declare const stopPlugins: ({ childProcesses, logs, verbose, pluginOptions, netlifyConfig, }: {
8
11
  logs: BufferedLogs;
9
12
  verbose: boolean;
@@ -1,6 +1,5 @@
1
1
  import { rm, stat } from 'node:fs/promises';
2
2
  import { resolve } from 'node:path';
3
- import { listFrameworks } from '@netlify/framework-info';
4
3
  const dirExists = async (path) => {
5
4
  try {
6
5
  await stat(path);
@@ -29,19 +28,6 @@ const coreStep = async (input) => {
29
28
  return {};
30
29
  };
31
30
  const condition = async (input) => {
32
- // We don't want to clear directories for Remix or Remix-based frameworks,
33
- // due to the way they run Netlify Dev.
34
- try {
35
- const frameworks = await listFrameworks({ projectDir: input.buildDir });
36
- for (const framework of frameworks) {
37
- if (framework.id === 'hydrogen' || framework.id === 'remix') {
38
- return false;
39
- }
40
- }
41
- }
42
- catch {
43
- // no-op
44
- }
45
31
  const dirs = await getDirtyDirs(input);
46
32
  return dirs.length > 0;
47
33
  };
@@ -1,16 +1,21 @@
1
1
  export declare const TOP_PARENT_TAG = "run_netlify_build";
2
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
- }) => {
3
+ type MeasureDurationOptions = {
4
+ metricName?: string;
5
+ parentTag?: string;
6
+ category?: string;
7
+ tags?: string[];
8
+ };
9
+ export declare const measureDuration: (func: any, stageTag: any, options?: MeasureDurationOptions) => ({ timers, ...opts }: {
10
+ [x: string]: any;
11
+ timers: any;
12
+ }, ...args: any[]) => Promise<any>;
13
+ export declare const createTimer: (stageTag: any, durationNs: any, { metricName, parentTag, category, tags, }?: MeasureDurationOptions) => {
10
14
  metricName: string;
11
15
  stageTag: any;
12
16
  parentTag: string;
13
17
  durationNs: any;
14
- category: undefined;
15
- tags: undefined;
18
+ category: string | undefined;
19
+ tags: string[] | undefined;
16
20
  };
21
+ export {};
package/lib/time/main.js CHANGED
@@ -12,9 +12,10 @@ export const initTimers = function () {
12
12
  // - return a plain object. This may or may not contain a modified `timers`.
13
13
  // The `durationNs` will be returned by the function. A new `timers` with the
14
14
  // additional duration timer will be returned as well.
15
- const kMeasureDuration = function (func, stageTag, { parentTag = undefined, category = undefined } = {}) {
15
+ const kMeasureDuration = function (func, stageTag, options = {}) {
16
16
  return async function measuredFunc({ timers, ...opts }, ...args) {
17
17
  const timerNs = startTimer();
18
+ const { parentTag, category } = options;
18
19
  const { timers: timersA = timers, ...returnObject } = await func({ timers, ...opts }, ...args);
19
20
  const { tags = {} } = returnObject;
20
21
  const durationNs = endTimer(timerNs);
@@ -32,6 +33,6 @@ const kMeasureDuration = function (func, stageTag, { parentTag = undefined, cate
32
33
  // Ensure the wrapped function `name` is not `anonymous` in stack traces
33
34
  export const measureDuration = keepFuncProps(kMeasureDuration);
34
35
  // Create a new object representing a completed timer
35
- export const createTimer = function (stageTag, durationNs, { metricName = DEFAULT_METRIC_NAME, parentTag = TOP_PARENT_TAG, category = undefined, tags = undefined } = {}) {
36
+ export const createTimer = function (stageTag, durationNs, { metricName = DEFAULT_METRIC_NAME, parentTag = TOP_PARENT_TAG, category = undefined, tags = undefined, } = {}) {
36
37
  return { metricName, stageTag, parentTag, durationNs, category, tags };
37
38
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "33.4.3",
3
+ "version": "33.4.5",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -67,11 +67,11 @@
67
67
  "license": "MIT",
68
68
  "dependencies": {
69
69
  "@bugsnag/js": "^8.0.0",
70
- "@netlify/blobs": "^9.1.5",
70
+ "@netlify/blobs": "^9.1.6",
71
71
  "@netlify/cache-utils": "^6.0.3",
72
72
  "@netlify/config": "^23.0.10",
73
73
  "@netlify/edge-bundler": "14.0.6",
74
- "@netlify/framework-info": "^10.0.4",
74
+ "@netlify/framework-info": "^10.0.5",
75
75
  "@netlify/functions-utils": "^6.0.10",
76
76
  "@netlify/git-utils": "^6.0.2",
77
77
  "@netlify/opentelemetry-utils": "^2.0.1",
@@ -91,9 +91,9 @@
91
91
  "indent-string": "^5.0.0",
92
92
  "is-plain-obj": "^4.0.0",
93
93
  "js-yaml": "^4.0.0",
94
- "keep-func-props": "^4.0.0",
94
+ "keep-func-props": "^6.0.0",
95
95
  "locate-path": "^7.0.0",
96
- "log-process-errors": "^8.0.0",
96
+ "log-process-errors": "^11.0.0",
97
97
  "map-obj": "^5.0.0",
98
98
  "memoize-one": "^6.0.0",
99
99
  "minimatch": "^9.0.4",
@@ -104,9 +104,9 @@
104
104
  "p-locate": "^6.0.0",
105
105
  "p-map": "^7.0.0",
106
106
  "p-reduce": "^3.0.0",
107
+ "package-directory": "^8.0.0",
107
108
  "path-exists": "^5.0.0",
108
109
  "path-type": "^6.0.0",
109
- "pkg-dir": "^8.0.0",
110
110
  "pretty-ms": "^9.0.0",
111
111
  "ps-list": "^8.0.0",
112
112
  "read-package-up": "^11.0.0",
@@ -157,5 +157,5 @@
157
157
  "engines": {
158
158
  "node": ">=18.14.0"
159
159
  },
160
- "gitHead": "4a0f587ae4efe1c2e62c25c11374e3fbaa9aebce"
160
+ "gitHead": "1a41d31d5a79a167a3e50c446de48ba60b161cbb"
161
161
  }