@vercel/build-utils 5.2.0 → 5.3.0

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.
@@ -14,7 +14,7 @@ const allOptions = [
14
14
  major: 12,
15
15
  range: '12.x',
16
16
  runtime: 'nodejs12.x',
17
- discontinueDate: new Date('2022-08-09'),
17
+ discontinueDate: new Date('2022-10-01'),
18
18
  },
19
19
  {
20
20
  major: 10,
@@ -0,0 +1,14 @@
1
+ declare type Envs = {
2
+ [key: string]: string | undefined;
3
+ };
4
+ /**
5
+ * Get the framework-specific prefixed System Environment Variables.
6
+ * See https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables
7
+ * @param envPrefix - Prefix, typically from `@vercel/frameworks`
8
+ * @param envs - Environment Variables, typically from `process.env`
9
+ */
10
+ export declare function getPrefixedEnvVars({ envPrefix, envs, }: {
11
+ envPrefix: string | undefined;
12
+ envs: Envs;
13
+ }): Envs;
14
+ export {};
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPrefixedEnvVars = void 0;
4
+ /**
5
+ * Get the framework-specific prefixed System Environment Variables.
6
+ * See https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables
7
+ * @param envPrefix - Prefix, typically from `@vercel/frameworks`
8
+ * @param envs - Environment Variables, typically from `process.env`
9
+ */
10
+ function getPrefixedEnvVars({ envPrefix, envs, }) {
11
+ const vercelSystemEnvPrefix = 'VERCEL_';
12
+ const newEnvs = {};
13
+ if (envPrefix && envs.VERCEL_URL) {
14
+ Object.keys(envs)
15
+ .filter(key => key.startsWith(vercelSystemEnvPrefix))
16
+ .forEach(key => {
17
+ const newKey = `${envPrefix}${key}`;
18
+ if (!(newKey in envs)) {
19
+ newEnvs[newKey] = envs[key];
20
+ }
21
+ });
22
+ // Tell turbo to exclude all Vercel System Env Vars
23
+ // See https://github.com/vercel/turborepo/pull/1622
24
+ newEnvs.TURBO_CI_VENDOR_ENV_KEY = `${envPrefix}${vercelSystemEnvPrefix}`;
25
+ }
26
+ return newEnvs;
27
+ }
28
+ exports.getPrefixedEnvVars = getPrefixedEnvVars;
package/dist/index.d.ts CHANGED
@@ -14,7 +14,8 @@ import streamToBuffer from './fs/stream-to-buffer';
14
14
  import debug from './debug';
15
15
  import getIgnoreFilter from './get-ignore-filter';
16
16
  import { getPlatformEnv } from './get-platform-env';
17
- export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, downloadFile, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename, execAsync, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, streamToBuffer, debug, isSymbolicLink, getLambdaOptionsFromFunction, scanParentDirs, getIgnoreFilter, };
17
+ import { getPrefixedEnvVars } from './get-prefixed-env-vars';
18
+ export { FileBlob, FileFsRef, FileRef, Lambda, NodejsLambda, createLambda, Prerender, download, downloadFile, DownloadedFiles, getWriteableDirectory, glob, GlobOptions, rename, execAsync, spawnAsync, getScriptName, installDependencies, runPackageJsonScript, execCommand, spawnCommand, walkParentDirs, getNodeBinPath, runNpmInstall, runBundleInstall, runPipInstall, runShellScript, runCustomInstallCommand, getEnvForPackageManager, getNodeVersion, getLatestNodeVersion, getDiscontinuedNodeVersions, getSpawnOptions, getPlatformEnv, getPrefixedEnvVars, streamToBuffer, debug, isSymbolicLink, getLambdaOptionsFromFunction, scanParentDirs, getIgnoreFilter, };
18
19
  export { EdgeFunction } from './edge-function';
19
20
  export { readConfigFile } from './fs/read-config-file';
20
21
  export { normalizePath } from './fs/normalize-path';
package/dist/index.js CHANGED
@@ -30666,7 +30666,7 @@ const allOptions = [
30666
30666
  major: 12,
30667
30667
  range: '12.x',
30668
30668
  runtime: 'nodejs12.x',
30669
- discontinueDate: new Date('2022-08-09'),
30669
+ discontinueDate: new Date('2022-10-01'),
30670
30670
  },
30671
30671
  {
30672
30672
  major: 10,
@@ -31429,6 +31429,42 @@ const getPlatformEnv = (name) => {
31429
31429
  exports.getPlatformEnv = getPlatformEnv;
31430
31430
 
31431
31431
 
31432
+ /***/ }),
31433
+
31434
+ /***/ 6838:
31435
+ /***/ ((__unused_webpack_module, exports) => {
31436
+
31437
+ "use strict";
31438
+
31439
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
31440
+ exports.getPrefixedEnvVars = void 0;
31441
+ /**
31442
+ * Get the framework-specific prefixed System Environment Variables.
31443
+ * See https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables
31444
+ * @param envPrefix - Prefix, typically from `@vercel/frameworks`
31445
+ * @param envs - Environment Variables, typically from `process.env`
31446
+ */
31447
+ function getPrefixedEnvVars({ envPrefix, envs, }) {
31448
+ const vercelSystemEnvPrefix = 'VERCEL_';
31449
+ const newEnvs = {};
31450
+ if (envPrefix && envs.VERCEL_URL) {
31451
+ Object.keys(envs)
31452
+ .filter(key => key.startsWith(vercelSystemEnvPrefix))
31453
+ .forEach(key => {
31454
+ const newKey = `${envPrefix}${key}`;
31455
+ if (!(newKey in envs)) {
31456
+ newEnvs[newKey] = envs[key];
31457
+ }
31458
+ });
31459
+ // Tell turbo to exclude all Vercel System Env Vars
31460
+ // See https://github.com/vercel/turborepo/pull/1622
31461
+ newEnvs.TURBO_CI_VENDOR_ENV_KEY = `${envPrefix}${vercelSystemEnvPrefix}`;
31462
+ }
31463
+ return newEnvs;
31464
+ }
31465
+ exports.getPrefixedEnvVars = getPrefixedEnvVars;
31466
+
31467
+
31432
31468
  /***/ }),
31433
31469
 
31434
31470
  /***/ 2855:
@@ -31462,7 +31498,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
31462
31498
  return (mod && mod.__esModule) ? mod : { "default": mod };
31463
31499
  };
31464
31500
  Object.defineProperty(exports, "__esModule", ({ value: true }));
31465
- exports.normalizePath = exports.readConfigFile = exports.EdgeFunction = exports.getIgnoreFilter = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isSymbolicLink = exports.debug = exports.streamToBuffer = 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.execAsync = 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;
31501
+ exports.normalizePath = exports.readConfigFile = exports.EdgeFunction = exports.getIgnoreFilter = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = 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.execAsync = 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;
31466
31502
  const file_blob_1 = __importDefault(__webpack_require__(2397));
31467
31503
  exports.FileBlob = file_blob_1.default;
31468
31504
  const file_fs_ref_1 = __importDefault(__webpack_require__(9331));
@@ -31517,6 +31553,8 @@ const get_ignore_filter_1 = __importDefault(__webpack_require__(1148));
31517
31553
  exports.getIgnoreFilter = get_ignore_filter_1.default;
31518
31554
  const get_platform_env_1 = __webpack_require__(4678);
31519
31555
  Object.defineProperty(exports, "getPlatformEnv", ({ enumerable: true, get: function () { return get_platform_env_1.getPlatformEnv; } }));
31556
+ const get_prefixed_env_vars_1 = __webpack_require__(6838);
31557
+ Object.defineProperty(exports, "getPrefixedEnvVars", ({ enumerable: true, get: function () { return get_prefixed_env_vars_1.getPrefixedEnvVars; } }));
31520
31558
  var edge_function_1 = __webpack_require__(8038);
31521
31559
  Object.defineProperty(exports, "EdgeFunction", ({ enumerable: true, get: function () { return edge_function_1.EdgeFunction; } }));
31522
31560
  var read_config_file_1 = __webpack_require__(7792);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -47,5 +47,5 @@
47
47
  "typescript": "4.3.4",
48
48
  "yazl": "2.5.1"
49
49
  },
50
- "gitHead": "32afd67d29d46f67027091ab9695d8ff330355b5"
50
+ "gitHead": "47e3381c6df661168e8be335cc58df03f3cf2414"
51
51
  }