@netlify/build 35.0.0 → 35.0.2

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.
@@ -1,4 +1,4 @@
1
- import stripAnsi from 'strip-ansi';
1
+ import { stripVTControlCharacters } from 'node:util';
2
2
  // Remove ANSI sequences from `error.message`
3
3
  export const removeErrorColors = function (error) {
4
4
  if (!(error instanceof Error)) {
@@ -6,8 +6,8 @@ export const removeErrorColors = function (error) {
6
6
  }
7
7
  // Setting error values might fail if they are getters or are non-writable.
8
8
  try {
9
- error.message = stripAnsi(error.message);
10
- error.stack = stripAnsi(error.stack);
9
+ error.message = stripVTControlCharacters(error.message);
10
+ error.stack = stripVTControlCharacters(error.stack);
11
11
  }
12
12
  catch {
13
13
  // continue
@@ -1,6 +1,6 @@
1
+ import { stripVTControlCharacters } from 'node:util';
1
2
  import { cwd } from 'process';
2
3
  import cleanStack from 'clean-stack';
3
- import stripAnsi from 'strip-ansi';
4
4
  // Clean stack traces:
5
5
  // - remove our internal code, e.g. the logic spawning plugins
6
6
  // - remove node modules and Node.js internals
@@ -22,7 +22,7 @@ export const cleanStacks = function ({ stack, rawStack, debug }) {
22
22
  };
23
23
  const cleanStackLine = function (lines, line) {
24
24
  const lineA = line.replace(getCwd(), '');
25
- const lineB = stripAnsi(lineA);
25
+ const lineB = stripVTControlCharacters(lineA);
26
26
  if (!STACK_LINE_REGEXP.test(lineB)) {
27
27
  return `${lines}\n${lineA}`;
28
28
  }
@@ -2,7 +2,6 @@ import { promises as fs } from 'node:fs';
2
2
  import { normalize } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { pathExists } from 'path-exists';
5
- import { isFile } from 'path-type';
6
5
  import { logInstallMissingPlugins, logInstallIntegrations } from '../log/messages/install.js';
7
6
  import { addExactDependencies } from './main.js';
8
7
  // Automatically install plugins if not already installed.
@@ -58,8 +57,14 @@ const ensureDir = async function (logs, autoPluginsDir) {
58
57
  }
59
58
  // If `.netlify` exists but is not a directory, we remove it first
60
59
  const autoPluginsParent = normalize(`${autoPluginsDir}/..`);
61
- if (await isFile(autoPluginsParent)) {
62
- await fs.unlink(autoPluginsParent);
60
+ try {
61
+ const stat = await fs.stat(autoPluginsParent);
62
+ if (stat.isFile()) {
63
+ await fs.unlink(autoPluginsParent);
64
+ }
65
+ }
66
+ catch {
67
+ // do nothing since it doesn't exist
63
68
  }
64
69
  await fs.mkdir(autoPluginsDir, { recursive: true });
65
70
  };
@@ -1,9 +1,6 @@
1
- import _pEvery from 'p-every';
2
1
  import pLocate from 'p-locate';
3
2
  import semver from 'semver';
4
3
  import { CONDITIONS } from './plugin_conditions.js';
5
- // the types of that package seem to be not correct and demand a `pEvery.default()` usage which is wrong
6
- const pEvery = _pEvery;
7
4
  /**
8
5
  * Retrieve the `expectedVersion` of a plugin:
9
6
  * - This is the version which should be run
@@ -66,7 +63,7 @@ const getCompatibleEntry = async function ({ versions, nodeVersion, packageJson,
66
63
  if (conditions.length === 0 && pinnedVersion === undefined) {
67
64
  return false;
68
65
  }
69
- return await pEvery(conditions, async ({ type, condition }) => CONDITIONS[type].test(condition, { nodeVersion, packageJson, packagePath, buildDir }));
66
+ return (await Promise.all(conditions.map(async ({ type, condition }) => CONDITIONS[type].test(condition, { nodeVersion, packageJson, packagePath, buildDir })))).every(Boolean);
70
67
  });
71
68
  if (compatibleEntry) {
72
69
  systemLog(`Used compatible version '${compatibleEntry.version}' for plugin '${packageName}' (pinned version is ${pinnedVersion})`);
@@ -98,7 +95,7 @@ const getFirstCompatibleEntry = async function ({ versions, nodeVersion, package
98
95
  if (conditions.length === 0) {
99
96
  return true;
100
97
  }
101
- return await pEvery(conditions, async ({ type, condition }) => CONDITIONS[type].test(condition, { nodeVersion, packageJson, packagePath, buildDir }));
98
+ return (await Promise.all(conditions.map(async ({ type, condition }) => CONDITIONS[type].test(condition, { nodeVersion, packageJson, packagePath, buildDir })))).every(Boolean);
102
99
  });
103
100
  if (compatibleEntry) {
104
101
  return compatibleEntry;
@@ -1,11 +1,11 @@
1
- import { locatePath } from 'locate-path';
1
+ import fsSync from 'node:fs';
2
2
  import { addErrorInfo } from '../../error/info.js';
3
3
  // Retrieve "manifest.yml" path for a specific plugin
4
4
  export const getManifestPath = async function ({ pluginDir, packageDir, packageName }) {
5
5
  const dirs = [pluginDir, packageDir]
6
6
  .filter(Boolean)
7
7
  .flatMap((dir) => MANIFEST_FILENAMES.map((filename) => `${dir}/${filename}`));
8
- const manifestPath = await locatePath(dirs);
8
+ const manifestPath = dirs.find((dir) => fsSync.existsSync(dir));
9
9
  validateManifestExists(manifestPath, packageName);
10
10
  return manifestPath;
11
11
  };
@@ -1,10 +1,7 @@
1
1
  import { join } from 'path';
2
- import _pEvery from 'p-every';
3
2
  import semver from 'semver';
4
3
  import { importJsonFile } from '../utils/json.js';
5
4
  import { resolvePath } from '../utils/resolve.js';
6
- // the types of that package seem to be not correct and demand a `pEvery.default()` usage which is wrong
7
- const pEvery = _pEvery;
8
5
  /**
9
6
  * Plugins can use `compatibility.{version}.nodeVersion: 'allowedNodeVersion'`
10
7
  * to deliver different plugin versions based on the Node.js version
@@ -25,7 +22,7 @@ const siteDependenciesTest = async function (allowedSiteDependencies, { packageJ
25
22
  // noop
26
23
  }
27
24
  }
28
- return await pEvery(Object.entries(allowedSiteDependencies), ([dependencyName, allowedVersion]) => siteDependencyTest({ dependencyName, allowedVersion, siteDependencies, buildDir }));
25
+ return (await Promise.all(Object.entries(allowedSiteDependencies).map(async ([dependencyName, allowedVersion]) => siteDependencyTest({ dependencyName, allowedVersion, siteDependencies, buildDir })))).every(Boolean);
29
26
  };
30
27
  const siteDependencyTest = async function ({ dependencyName, allowedVersion, siteDependencies, buildDir, }) {
31
28
  const siteDependency = siteDependencies[dependencyName];
@@ -1,4 +1,4 @@
1
- import stripAnsi from 'strip-ansi';
1
+ import { stripVTControlCharacters } from 'node:util';
2
2
  // Remove colors from statuses
3
3
  export const removeStatusesColors = function (statuses) {
4
4
  return statuses.map(removeStatusColors);
@@ -13,6 +13,6 @@ const removeAttrColor = function (status, attribute) {
13
13
  if (value === undefined) {
14
14
  return {};
15
15
  }
16
- const valueA = stripAnsi(value);
16
+ const valueA = stripVTControlCharacters(value);
17
17
  return { [attribute]: valueA };
18
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "35.0.0",
3
+ "version": "35.0.2",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -69,8 +69,8 @@
69
69
  "@bugsnag/js": "^8.0.0",
70
70
  "@netlify/blobs": "^10.0.7",
71
71
  "@netlify/cache-utils": "^6.0.3",
72
- "@netlify/config": "^24.0.0",
73
- "@netlify/edge-bundler": "14.2.2",
72
+ "@netlify/config": "^24.0.1",
73
+ "@netlify/edge-bundler": "14.4.0",
74
74
  "@netlify/functions-utils": "^6.2.0",
75
75
  "@netlify/git-utils": "^6.0.2",
76
76
  "@netlify/opentelemetry-utils": "^2.0.1",
@@ -89,21 +89,18 @@
89
89
  "indent-string": "^5.0.0",
90
90
  "is-plain-obj": "^4.0.0",
91
91
  "keep-func-props": "^6.0.0",
92
- "locate-path": "^7.0.0",
93
92
  "log-process-errors": "^11.0.0",
94
93
  "map-obj": "^5.0.0",
95
94
  "memoize-one": "^6.0.0",
96
95
  "minimatch": "^9.0.4",
97
96
  "os-name": "^6.0.0",
98
97
  "p-event": "^6.0.0",
99
- "p-every": "^2.0.0",
100
98
  "p-filter": "^4.0.0",
101
99
  "p-locate": "^6.0.0",
102
100
  "p-map": "^7.0.0",
103
101
  "p-reduce": "^3.0.0",
104
102
  "package-directory": "^8.0.0",
105
103
  "path-exists": "^5.0.0",
106
- "path-type": "^6.0.0",
107
104
  "pretty-ms": "^9.0.0",
108
105
  "ps-list": "^8.0.0",
109
106
  "read-package-up": "^11.0.0",
@@ -113,7 +110,6 @@
113
110
  "safe-json-stringify": "^1.2.0",
114
111
  "semver": "^7.3.8",
115
112
  "string-width": "^7.0.0",
116
- "strip-ansi": "^7.0.0",
117
113
  "supports-color": "^10.0.0",
118
114
  "terminal-link": "^4.0.0",
119
115
  "ts-node": "^10.9.1",
@@ -138,7 +134,7 @@
138
134
  "moize": "^6.0.0",
139
135
  "npm-run-all2": "^6.0.0",
140
136
  "process-exists": "^5.0.0",
141
- "sinon": "^21.0.0",
137
+ "tinyspy": "^4.0.3",
142
138
  "tmp-promise": "^3.0.2",
143
139
  "tsd": "^0.32.0",
144
140
  "vitest": "^3.0.0",
@@ -156,5 +152,5 @@
156
152
  "engines": {
157
153
  "node": ">=18.14.0"
158
154
  },
159
- "gitHead": "5100d463cb9b606b91a6a9b5c3fbe9c143716701"
155
+ "gitHead": "1f098009f518b66b0d6604910aff38824d7f9a69"
160
156
  }