@vercel/build-utils 6.7.3 → 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,17 @@
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
+
9
+ ## 6.7.4
10
+
11
+ ### Patch Changes
12
+
13
+ - Remove usage of `env` from Edge Functions and Middleware ([#10018](https://github.com/vercel/vercel/pull/10018))
14
+
3
15
  ## 6.7.3
4
16
 
5
17
  ### Patch Changes
@@ -21,11 +21,6 @@ export declare class EdgeFunction {
21
21
  * The list of files to be included in the edge function bundle.
22
22
  */
23
23
  files: Files;
24
- /**
25
- * Extra environment variables in use for the user code, to be
26
- * assigned to the edge function.
27
- */
28
- envVarsInUse?: string[];
29
24
  /**
30
25
  * Extra binary files to be included in the edge function
31
26
  */
@@ -11,7 +11,6 @@ class EdgeFunction {
11
11
  this.deploymentTarget = params.deploymentTarget;
12
12
  this.entrypoint = params.entrypoint;
13
13
  this.files = params.files;
14
- this.envVarsInUse = params.envVarsInUse;
15
14
  this.assets = params.assets;
16
15
  this.regions = params.regions;
17
16
  this.framework = params.framework;
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
@@ -28193,7 +28193,6 @@ class EdgeFunction {
28193
28193
  this.deploymentTarget = params.deploymentTarget;
28194
28194
  this.entrypoint = params.entrypoint;
28195
28195
  this.files = params.files;
28196
- this.envVarsInUse = params.envVarsInUse;
28197
28196
  this.assets = params.assets;
28198
28197
  this.regions = params.regions;
28199
28198
  this.framework = params.framework;
@@ -29718,7 +29717,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
29718
29717
  return (mod && mod.__esModule) ? mod : { "default": mod };
29719
29718
  };
29720
29719
  Object.defineProperty(exports, "__esModule", ({ value: true }));
29721
- 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;
29722
29721
  const file_blob_1 = __importDefault(__webpack_require__(8361));
29723
29722
  exports.FileBlob = file_blob_1.default;
29724
29723
  const file_fs_ref_1 = __importDefault(__webpack_require__(6274));
@@ -29779,6 +29778,8 @@ const clone_env_1 = __webpack_require__(651);
29779
29778
  Object.defineProperty(exports, "cloneEnv", ({ enumerable: true, get: function () { return clone_env_1.cloneEnv; } }));
29780
29779
  const hard_link_dir_1 = __webpack_require__(7264);
29781
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; } }));
29782
29783
  var edge_function_1 = __webpack_require__(323);
29783
29784
  Object.defineProperty(exports, "EdgeFunction", ({ enumerable: true, get: function () { return edge_function_1.EdgeFunction; } }));
29784
29785
  var read_config_file_1 = __webpack_require__(2212);
@@ -30160,6 +30161,41 @@ function hasProp(obj, key) {
30160
30161
  Object.defineProperty(exports, "__esModule", ({ value: true }));
30161
30162
 
30162
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
+
30163
30199
  /***/ }),
30164
30200
 
30165
30201
  /***/ 8089:
@@ -30226,6 +30262,14 @@ module.exports = require("fs");
30226
30262
 
30227
30263
  /***/ }),
30228
30264
 
30265
+ /***/ 9225:
30266
+ /***/ ((module) => {
30267
+
30268
+ "use strict";
30269
+ module.exports = require("fs/promises");
30270
+
30271
+ /***/ }),
30272
+
30229
30273
  /***/ 8605:
30230
30274
  /***/ ((module) => {
30231
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.3",
3
+ "version": "6.7.5",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",