@vercel/build-utils 6.7.4 → 6.7.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 6.7.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Publish missing build-utils ([`cd35071f6`](https://github.com/vercel/vercel/commit/cd35071f609d615d47bc04634c123b33768436cb))
8
+
3
9
  ## 6.7.4
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -17,7 +17,8 @@ import { getPlatformEnv } from './get-platform-env';
17
17
  import { getPrefixedEnvVars } from './get-prefixed-env-vars';
18
18
  import { cloneEnv } from './clone-env';
19
19
  import { hardLinkDir } from './hard-link-dir';
20
- export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, downloadFile, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, getPrefixedEnvVars, streamToBuffer, debug, isSymbolicLink, isDirectory, getLambdaOptionsFromFunction, scanParentDirs, getIgnoreFilter, cloneEnv, hardLinkDir, };
20
+ import { validateNpmrc } from './validate-npmrc';
21
+ export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, downloadFile, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, getPrefixedEnvVars, streamToBuffer, debug, isSymbolicLink, isDirectory, getLambdaOptionsFromFunction, scanParentDirs, getIgnoreFilter, cloneEnv, hardLinkDir, validateNpmrc, };
21
22
  export { EdgeFunction } from './edge-function';
22
23
  export { readConfigFile } from './fs/read-config-file';
23
24
  export { normalizePath } from './fs/normalize-path';
package/dist/index.js CHANGED
@@ -29717,7 +29717,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
29717
29717
  return (mod && mod.__esModule) ? mod : { "default": mod };
29718
29718
  };
29719
29719
  Object.defineProperty(exports, "__esModule", ({ value: true }));
29720
- exports.normalizePath = exports.readConfigFile = exports.EdgeFunction = exports.hardLinkDir = exports.cloneEnv = exports.getIgnoreFilter = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isDirectory = exports.isSymbolicLink = exports.debug = exports.streamToBuffer = exports.getPrefixedEnvVars = exports.getPlatformEnv = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.getEnvForPackageManager = exports.runCustomInstallCommand = exports.runShellScript = exports.runPipInstall = exports.runBundleInstall = exports.runNpmInstall = exports.getNodeBinPath = exports.walkParentDirs = exports.spawnCommand = exports.execCommand = exports.runPackageJsonScript = exports.installDependencies = exports.getScriptName = exports.spawnAsync = exports.rename = exports.glob = exports.getWriteableDirectory = exports.downloadFile = exports.download = exports.Prerender = exports.createLambda = exports.NodejsLambda = exports.Lambda = exports.FileRef = exports.FileFsRef = exports.FileBlob = void 0;
29720
+ exports.normalizePath = exports.readConfigFile = exports.EdgeFunction = exports.validateNpmrc = exports.hardLinkDir = exports.cloneEnv = exports.getIgnoreFilter = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isDirectory = exports.isSymbolicLink = exports.debug = exports.streamToBuffer = exports.getPrefixedEnvVars = exports.getPlatformEnv = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.getEnvForPackageManager = exports.runCustomInstallCommand = exports.runShellScript = exports.runPipInstall = exports.runBundleInstall = exports.runNpmInstall = exports.getNodeBinPath = exports.walkParentDirs = exports.spawnCommand = exports.execCommand = exports.runPackageJsonScript = exports.installDependencies = exports.getScriptName = exports.spawnAsync = exports.rename = exports.glob = exports.getWriteableDirectory = exports.downloadFile = exports.download = exports.Prerender = exports.createLambda = exports.NodejsLambda = exports.Lambda = exports.FileRef = exports.FileFsRef = exports.FileBlob = void 0;
29721
29721
  const file_blob_1 = __importDefault(__webpack_require__(8361));
29722
29722
  exports.FileBlob = file_blob_1.default;
29723
29723
  const file_fs_ref_1 = __importDefault(__webpack_require__(6274));
@@ -29778,6 +29778,8 @@ const clone_env_1 = __webpack_require__(651);
29778
29778
  Object.defineProperty(exports, "cloneEnv", ({ enumerable: true, get: function () { return clone_env_1.cloneEnv; } }));
29779
29779
  const hard_link_dir_1 = __webpack_require__(7264);
29780
29780
  Object.defineProperty(exports, "hardLinkDir", ({ enumerable: true, get: function () { return hard_link_dir_1.hardLinkDir; } }));
29781
+ const validate_npmrc_1 = __webpack_require__(5405);
29782
+ Object.defineProperty(exports, "validateNpmrc", ({ enumerable: true, get: function () { return validate_npmrc_1.validateNpmrc; } }));
29781
29783
  var edge_function_1 = __webpack_require__(323);
29782
29784
  Object.defineProperty(exports, "EdgeFunction", ({ enumerable: true, get: function () { return edge_function_1.EdgeFunction; } }));
29783
29785
  var read_config_file_1 = __webpack_require__(2212);
@@ -30159,6 +30161,41 @@ function hasProp(obj, key) {
30159
30161
  Object.defineProperty(exports, "__esModule", ({ value: true }));
30160
30162
 
30161
30163
 
30164
+ /***/ }),
30165
+
30166
+ /***/ 5405:
30167
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
30168
+
30169
+ "use strict";
30170
+
30171
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
30172
+ exports.validateNpmrc = void 0;
30173
+ const path_1 = __webpack_require__(5622);
30174
+ const promises_1 = __webpack_require__(9225);
30175
+ /**
30176
+ * Checks if there is a `.npmrc` in the cwd (project root) and makes sure it
30177
+ * doesn't contain a `use-node-version`. This config setting is not supported
30178
+ * since it causes the package manager to install the Node.js version which in
30179
+ * the case of newer Node.js versions is not compatible with AWS due to
30180
+ * outdated GLIBC binaries.
30181
+ *
30182
+ * @see https://pnpm.io/npmrc#use-node-version
30183
+ *
30184
+ * @param cwd The current working directory (e.g. project root);
30185
+ */
30186
+ async function validateNpmrc(cwd) {
30187
+ const npmrc = await (0, promises_1.readFile)((0, path_1.join)(cwd, '.npmrc'), 'utf-8').catch(err => {
30188
+ if (err.code !== 'ENOENT')
30189
+ throw err;
30190
+ });
30191
+ const nodeRegExp = /(?<!#.*)use-node-version/;
30192
+ if (npmrc?.match(nodeRegExp)) {
30193
+ throw new Error('Detected unsupported "use-node-version" in your ".npmrc". Please use "engines" in your "package.json" instead.');
30194
+ }
30195
+ }
30196
+ exports.validateNpmrc = validateNpmrc;
30197
+
30198
+
30162
30199
  /***/ }),
30163
30200
 
30164
30201
  /***/ 8089:
@@ -30225,6 +30262,14 @@ module.exports = require("fs");
30225
30262
 
30226
30263
  /***/ }),
30227
30264
 
30265
+ /***/ 9225:
30266
+ /***/ ((module) => {
30267
+
30268
+ "use strict";
30269
+ module.exports = require("fs/promises");
30270
+
30271
+ /***/ }),
30272
+
30228
30273
  /***/ 8605:
30229
30274
  /***/ ((module) => {
30230
30275
 
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Checks if there is a `.npmrc` in the cwd (project root) and makes sure it
3
+ * doesn't contain a `use-node-version`. This config setting is not supported
4
+ * since it causes the package manager to install the Node.js version which in
5
+ * the case of newer Node.js versions is not compatible with AWS due to
6
+ * outdated GLIBC binaries.
7
+ *
8
+ * @see https://pnpm.io/npmrc#use-node-version
9
+ *
10
+ * @param cwd The current working directory (e.g. project root);
11
+ */
12
+ export declare function validateNpmrc(cwd: string): Promise<void>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateNpmrc = void 0;
4
+ const path_1 = require("path");
5
+ const promises_1 = require("fs/promises");
6
+ /**
7
+ * Checks if there is a `.npmrc` in the cwd (project root) and makes sure it
8
+ * doesn't contain a `use-node-version`. This config setting is not supported
9
+ * since it causes the package manager to install the Node.js version which in
10
+ * the case of newer Node.js versions is not compatible with AWS due to
11
+ * outdated GLIBC binaries.
12
+ *
13
+ * @see https://pnpm.io/npmrc#use-node-version
14
+ *
15
+ * @param cwd The current working directory (e.g. project root);
16
+ */
17
+ async function validateNpmrc(cwd) {
18
+ const npmrc = await (0, promises_1.readFile)((0, path_1.join)(cwd, '.npmrc'), 'utf-8').catch(err => {
19
+ if (err.code !== 'ENOENT')
20
+ throw err;
21
+ });
22
+ const nodeRegExp = /(?<!#.*)use-node-version/;
23
+ if (npmrc?.match(nodeRegExp)) {
24
+ throw new Error('Detected unsupported "use-node-version" in your ".npmrc". Please use "engines" in your "package.json" instead.');
25
+ }
26
+ }
27
+ exports.validateNpmrc = validateNpmrc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "6.7.4",
3
+ "version": "6.7.5",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",