@vercel/build-utils 10.4.0 → 10.5.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 10.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Display warning when yarn dynamic require error may happen ([#13143](https://github.com/vercel/vercel/pull/13143))
8
+
9
+ - [build-utils] increase max memory limit ([#13162](https://github.com/vercel/vercel/pull/13162))
10
+
11
+ ## 10.5.0
12
+
13
+ ### Minor Changes
14
+
15
+ - Disable yarn global cache before installs so build cache caches deps ([#13144](https://github.com/vercel/vercel/pull/13144))
16
+
3
17
  ## 10.4.0
4
18
 
5
19
  ### Minor Changes
@@ -521,6 +521,16 @@ async function runNpmInstall(destPath, args = [], spawnOpts, meta, nodeVersion,
521
521
  }
522
522
  meta.runNpmInstallSet = runNpmInstallSet;
523
523
  }
524
+ if (cliType === "yarn") {
525
+ const yarnVersion = detectYarnVersion(lockfileVersion);
526
+ if (["yarn@3.x", "yarn@4.x"].includes(yarnVersion)) {
527
+ await spawnAsync(
528
+ "yarn",
529
+ ["config", "set", "enableGlobalCache", "false"],
530
+ { cwd: destPath }
531
+ );
532
+ }
533
+ }
524
534
  const installTime = Date.now();
525
535
  console.log("Installing dependencies...");
526
536
  (0, import_debug.default)(`Installing to ${destPath}`);
@@ -537,6 +547,12 @@ async function runNpmInstall(destPath, args = [], spawnOpts, meta, nodeVersion,
537
547
  turboSupportsCorepackHome,
538
548
  projectCreatedAt
539
549
  });
550
+ const maySeeDynamicRequireYarnBug = process.env?.ENABLE_EXPERIMENTAL_COREPACK && packageJson?.packageManager?.startsWith("yarn") && packageJson?.type === "module";
551
+ if (maySeeDynamicRequireYarnBug) {
552
+ console.warn(
553
+ `Warning: This project may see "Error: Dynamic require of "util" is not supported". To avoid this error, remove \`"type": "module"\` from your package.json file, or use \`yarnPath\` instead of Corepack. Learn more: https://vercel.com/docs/errors/error-list#yarn-dynamic-require-of-util-is-not-supported`
554
+ );
555
+ }
540
556
  await runInstallCommand({
541
557
  packageManager: cliType,
542
558
  args,
package/dist/index.js CHANGED
@@ -23535,6 +23535,16 @@ async function runNpmInstall(destPath, args = [], spawnOpts, meta, nodeVersion,
23535
23535
  }
23536
23536
  meta.runNpmInstallSet = runNpmInstallSet;
23537
23537
  }
23538
+ if (cliType === "yarn") {
23539
+ const yarnVersion = detectYarnVersion(lockfileVersion);
23540
+ if (["yarn@3.x", "yarn@4.x"].includes(yarnVersion)) {
23541
+ await spawnAsync(
23542
+ "yarn",
23543
+ ["config", "set", "enableGlobalCache", "false"],
23544
+ { cwd: destPath }
23545
+ );
23546
+ }
23547
+ }
23538
23548
  const installTime = Date.now();
23539
23549
  console.log("Installing dependencies...");
23540
23550
  debug(`Installing to ${destPath}`);
@@ -23551,6 +23561,12 @@ async function runNpmInstall(destPath, args = [], spawnOpts, meta, nodeVersion,
23551
23561
  turboSupportsCorepackHome,
23552
23562
  projectCreatedAt
23553
23563
  });
23564
+ const maySeeDynamicRequireYarnBug = process.env?.ENABLE_EXPERIMENTAL_COREPACK && packageJson?.packageManager?.startsWith("yarn") && packageJson?.type === "module";
23565
+ if (maySeeDynamicRequireYarnBug) {
23566
+ console.warn(
23567
+ `Warning: This project may see "Error: Dynamic require of "util" is not supported". To avoid this error, remove \`"type": "module"\` from your package.json file, or use \`yarnPath\` instead of Corepack. Learn more: https://vercel.com/docs/errors/error-list#yarn-dynamic-require-of-util-is-not-supported`
23568
+ );
23569
+ }
23554
23570
  await runInstallCommand({
23555
23571
  packageManager: cliType,
23556
23572
  args,
@@ -24276,7 +24292,7 @@ var functionsSchema = {
24276
24292
  },
24277
24293
  memory: {
24278
24294
  minimum: 128,
24279
- maximum: 3009
24295
+ maximum: 10240
24280
24296
  },
24281
24297
  maxDuration: {
24282
24298
  type: "number",
package/dist/schemas.js CHANGED
@@ -38,7 +38,7 @@ const functionsSchema = {
38
38
  },
39
39
  memory: {
40
40
  minimum: 128,
41
- maximum: 3009
41
+ maximum: 10240
42
42
  },
43
43
  maxDuration: {
44
44
  type: "number",
package/dist/types.d.ts CHANGED
@@ -287,6 +287,7 @@ export interface PackageJson {
287
287
  readonly private?: boolean;
288
288
  readonly publishConfig?: PackageJson.PublishConfig;
289
289
  readonly packageManager?: string;
290
+ readonly type?: string;
290
291
  }
291
292
  export interface ConstructorVersion {
292
293
  /** major version number: 18 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "10.4.0",
3
+ "version": "10.5.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",