@vercel/build-utils 7.11.0 → 8.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Remove legacy `avoidTopLevelInstall` logic ([#11513](https://github.com/vercel/vercel/pull/11513))
8
+
9
+ ### Patch Changes
10
+
11
+ - [build-utils] Add `VERCEL_PROJECT_PRODUCTION_URL` framework env var prefix ([#11506](https://github.com/vercel/vercel/pull/11506))
12
+
13
+ ## 7.12.0
14
+
15
+ ### Minor Changes
16
+
17
+ - Trigger release ([#11465](https://github.com/vercel/vercel/pull/11465))
18
+
3
19
  ## 7.11.0
4
20
 
5
21
  ### Minor Changes
@@ -0,0 +1 @@
1
+ export declare function getInstalledPackageVersion(packageName: string, path?: string | string[]): Promise<string | undefined>;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var get_installed_package_version_exports = {};
30
+ __export(get_installed_package_version_exports, {
31
+ getInstalledPackageVersion: () => getInstalledPackageVersion
32
+ });
33
+ module.exports = __toCommonJS(get_installed_package_version_exports);
34
+ var import_debug = __toESM(require("./debug"));
35
+ async function getInstalledPackageVersion(packageName, path) {
36
+ try {
37
+ const resolved = require.resolve(`${packageName}/package.json`, {
38
+ paths: path ? Array.isArray(path) ? path : [path] : [process.cwd()]
39
+ });
40
+ const version = require(resolved).version;
41
+ return version;
42
+ } catch (err) {
43
+ (0, import_debug.default)(
44
+ `Could not resolve package "${packageName}". Package is not installed.`,
45
+ err
46
+ );
47
+ return void 0;
48
+ }
49
+ }
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ getInstalledPackageVersion
53
+ });
@@ -30,7 +30,8 @@ function getPrefixedEnvVars({
30
30
  "VERCEL_URL",
31
31
  "VERCEL_ENV",
32
32
  "VERCEL_REGION",
33
- "VERCEL_BRANCH_URL"
33
+ "VERCEL_BRANCH_URL",
34
+ "VERCEL_PROJECT_PRODUCTION_URL"
34
35
  ];
35
36
  const newEnvs = {};
36
37
  if (envPrefix && envs.VERCEL_URL) {
package/dist/index.d.ts CHANGED
@@ -28,3 +28,4 @@ export * from './schemas';
28
28
  export * from './types';
29
29
  export * from './errors';
30
30
  export { NODE_VERSIONS } from './fs/node-version';
31
+ export { getInstalledPackageVersion } from './get-installed-package-version';
package/dist/index.js CHANGED
@@ -20729,6 +20729,7 @@ __export(src_exports, {
20729
20729
  getDiscontinuedNodeVersions: () => getDiscontinuedNodeVersions,
20730
20730
  getEnvForPackageManager: () => getEnvForPackageManager,
20731
20731
  getIgnoreFilter: () => get_ignore_filter_default,
20732
+ getInstalledPackageVersion: () => getInstalledPackageVersion,
20732
20733
  getLambdaOptionsFromFunction: () => getLambdaOptionsFromFunction,
20733
20734
  getLatestNodeVersion: () => getLatestNodeVersion,
20734
20735
  getNodeBinPath: () => getNodeBinPath,
@@ -22357,7 +22358,8 @@ function getPrefixedEnvVars({
22357
22358
  "VERCEL_URL",
22358
22359
  "VERCEL_ENV",
22359
22360
  "VERCEL_REGION",
22360
- "VERCEL_BRANCH_URL"
22361
+ "VERCEL_BRANCH_URL",
22362
+ "VERCEL_PROJECT_PRODUCTION_URL"
22361
22363
  ];
22362
22364
  const newEnvs = {};
22363
22365
  if (envPrefix && envs.VERCEL_URL) {
@@ -22586,6 +22588,23 @@ var buildsSchema = {
22586
22588
  }
22587
22589
  }
22588
22590
  };
22591
+
22592
+ // src/get-installed-package-version.ts
22593
+ async function getInstalledPackageVersion(packageName, path7) {
22594
+ try {
22595
+ const resolved = require.resolve(`${packageName}/package.json`, {
22596
+ paths: path7 ? Array.isArray(path7) ? path7 : [path7] : [process.cwd()]
22597
+ });
22598
+ const version = require(resolved).version;
22599
+ return version;
22600
+ } catch (err) {
22601
+ debug(
22602
+ `Could not resolve package "${packageName}". Package is not installed.`,
22603
+ err
22604
+ );
22605
+ return void 0;
22606
+ }
22607
+ }
22589
22608
  // Annotate the CommonJS export names for ESM import in node:
22590
22609
  0 && (module.exports = {
22591
22610
  EdgeFunction,
@@ -22608,6 +22627,7 @@ var buildsSchema = {
22608
22627
  getDiscontinuedNodeVersions,
22609
22628
  getEnvForPackageManager,
22610
22629
  getIgnoreFilter,
22630
+ getInstalledPackageVersion,
22611
22631
  getLambdaOptionsFromFunction,
22612
22632
  getLatestNodeVersion,
22613
22633
  getNodeBinPath,
package/dist/types.d.ts CHANGED
@@ -60,7 +60,6 @@ export interface Meta {
60
60
  filesRemoved?: string[];
61
61
  env?: Env;
62
62
  buildEnv?: Env;
63
- avoidTopLevelInstall?: boolean;
64
63
  [key: string]: unknown;
65
64
  }
66
65
  export interface BuildOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "7.11.0",
3
+ "version": "8.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",