vercel 33.4.0 → 33.5.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.
Files changed (2) hide show
  1. package/dist/index.js +65 -21
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -62513,7 +62513,7 @@ var require_package = __commonJS2({
62513
62513
  "../client/package.json"(exports2, module2) {
62514
62514
  module2.exports = {
62515
62515
  name: "@vercel/client",
62516
- version: "13.1.0",
62516
+ version: "13.1.2",
62517
62517
  main: "dist/index.js",
62518
62518
  typings: "dist/index.d.ts",
62519
62519
  homepage: "https://vercel.com",
@@ -62550,7 +62550,8 @@ var require_package = __commonJS2({
62550
62550
  typescript: "4.9.5"
62551
62551
  },
62552
62552
  dependencies: {
62553
- "@vercel/build-utils": "7.5.1",
62553
+ "@vercel/build-utils": "7.6.0",
62554
+ "@vercel/error-utils": "2.0.2",
62554
62555
  "@vercel/routing-utils": "3.1.0",
62555
62556
  "@zeit/fetch": "5.2.0",
62556
62557
  "async-retry": "1.2.3",
@@ -68605,6 +68606,7 @@ var require_create_deployment = __commonJS2({
68605
68606
  var import_upload = require_upload();
68606
68607
  var import_utils = require_utils8();
68607
68608
  var import_errors4 = require_errors3();
68609
+ var import_error_utils34 = require_dist2();
68608
68610
  var import_build_utils19 = require("@vercel/build-utils");
68609
68611
  var import_tar_fs2 = __toESM4(require_tar_fs());
68610
68612
  var import_zlib = require("zlib");
@@ -68664,25 +68666,37 @@ var require_create_deployment = __commonJS2({
68664
68666
  }
68665
68667
  const workPath = typeof path11 === "string" ? path11 : path11[0];
68666
68668
  let files;
68667
- if (clientOptions.archive === "tgz") {
68668
- debug3("Packing tarball");
68669
- const tarStream = import_tar_fs2.default.pack(workPath, {
68670
- entries: fileList.map((file) => (0, import_path44.relative)(workPath, file))
68671
- }).pipe((0, import_zlib.createGzip)());
68672
- const tarBuffer = await (0, import_build_utils19.streamToBuffer)(tarStream);
68673
- debug3("Packed tarball");
68674
- files = /* @__PURE__ */ new Map([
68675
- [
68676
- (0, import_hashes.hash)(tarBuffer),
68677
- {
68678
- names: [(0, import_path44.join)(workPath, ".vercel/source.tgz")],
68679
- data: tarBuffer,
68680
- mode: 438
68681
- }
68682
- ]
68683
- ]);
68684
- } else {
68685
- files = await (0, import_hashes.hashes)(fileList);
68669
+ try {
68670
+ if (clientOptions.archive === "tgz") {
68671
+ debug3("Packing tarball");
68672
+ const tarStream = import_tar_fs2.default.pack(workPath, {
68673
+ entries: fileList.map((file) => (0, import_path44.relative)(workPath, file))
68674
+ }).pipe((0, import_zlib.createGzip)());
68675
+ const tarBuffer = await (0, import_build_utils19.streamToBuffer)(tarStream);
68676
+ debug3("Packed tarball");
68677
+ files = /* @__PURE__ */ new Map([
68678
+ [
68679
+ (0, import_hashes.hash)(tarBuffer),
68680
+ {
68681
+ names: [(0, import_path44.join)(workPath, ".vercel/source.tgz")],
68682
+ data: tarBuffer,
68683
+ mode: 438
68684
+ }
68685
+ ]
68686
+ ]);
68687
+ } else {
68688
+ files = await (0, import_hashes.hashes)(fileList);
68689
+ }
68690
+ } catch (err) {
68691
+ if (clientOptions.prebuilt && (0, import_error_utils34.isErrnoException)(err) && err.code === "ENOENT" && err.path) {
68692
+ const errPath = (0, import_path44.relative)(workPath, err.path);
68693
+ err.message = `File does not exist: "${(0, import_path44.relative)(workPath, errPath)}"`;
68694
+ if (errPath.split(import_path44.sep).includes("node_modules")) {
68695
+ err.message = `Please ensure project dependencies have been installed:
68696
+ ${err.message}`;
68697
+ }
68698
+ }
68699
+ throw err;
68686
68700
  }
68687
68701
  debug3(`Yielding a 'hashes-calculated' event with ${files.size} hashes`);
68688
68702
  yield { type: "hashes-calculated", payload: (0, import_hashes.mapToObject)(files) };
@@ -170821,9 +170835,11 @@ async function doBuild(client2, project, buildsJson, cwd2, outputDir) {
170821
170835
  overrides: mergedOverrides,
170822
170836
  framework,
170823
170837
  crons: mergedCrons,
170838
+ /** @deprecated Replaced by Variants. Remove once fully replaced. */
170824
170839
  flags: mergedFlags
170825
170840
  };
170826
170841
  await import_fs_extra18.default.writeJSON((0, import_path28.join)(outputDir, "config.json"), config3, { spaces: 2 });
170842
+ await writeVariantsJson(client2, buildResults.values(), outputDir);
170827
170843
  const relOutputDir = (0, import_path28.relative)(cwd2, outputDir);
170828
170844
  output2.print(
170829
170845
  `${prependEmoji(
@@ -170930,6 +170946,34 @@ function mergeFlags(buildResults) {
170930
170946
  return [];
170931
170947
  });
170932
170948
  }
170949
+ async function writeVariantsJson({ output: output2 }, buildResults, outputDir) {
170950
+ const variantsFilePath = (0, import_path28.join)(outputDir, "variants.json");
170951
+ let hasVariants = true;
170952
+ const variants = await import_fs_extra18.default.readJSON(variantsFilePath).catch((error4) => {
170953
+ if (error4.code === "ENOENT") {
170954
+ hasVariants = false;
170955
+ return { definitions: {} };
170956
+ }
170957
+ throw error4;
170958
+ });
170959
+ for (const result of buildResults) {
170960
+ if (!("variants" in result) || !result.variants)
170961
+ continue;
170962
+ for (const [key, defintion] of Object.entries(result.variants)) {
170963
+ if (result.variants[key]) {
170964
+ output2.warn(
170965
+ `The variant "${key}" was found multiple times. Only its first occurrence will be considered.`
170966
+ );
170967
+ continue;
170968
+ }
170969
+ hasVariants = true;
170970
+ variants.definitions[key] = defintion;
170971
+ }
170972
+ }
170973
+ if (hasVariants) {
170974
+ await import_fs_extra18.default.writeJSON(variantsFilePath, variants, { spaces: 2 });
170975
+ }
170976
+ }
170933
170977
  async function writeBuildJson(buildsJson, outputDir) {
170934
170978
  await import_fs_extra18.default.writeJSON((0, import_path28.join)(outputDir, "builds.json"), buildsJson, { spaces: 2 });
170935
170979
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "33.4.0",
3
+ "version": "33.5.0",
4
4
  "preferGlobal": true,
5
5
  "license": "Apache-2.0",
6
6
  "description": "The command-line interface for Vercel",
@@ -21,17 +21,17 @@
21
21
  "node": ">= 16"
22
22
  },
23
23
  "dependencies": {
24
- "@vercel/build-utils": "7.5.1",
24
+ "@vercel/build-utils": "7.6.0",
25
25
  "@vercel/fun": "1.1.0",
26
26
  "@vercel/go": "3.0.5",
27
27
  "@vercel/hydrogen": "1.0.2",
28
- "@vercel/next": "4.1.0",
29
- "@vercel/node": "3.0.17",
28
+ "@vercel/next": "4.1.1",
29
+ "@vercel/node": "3.0.18",
30
30
  "@vercel/python": "4.1.1",
31
- "@vercel/redwood": "2.0.6",
32
- "@vercel/remix-builder": "2.0.18",
31
+ "@vercel/redwood": "2.0.7",
32
+ "@vercel/remix-builder": "2.0.19",
33
33
  "@vercel/ruby": "2.0.5",
34
- "@vercel/static-build": "2.1.0",
34
+ "@vercel/static-build": "2.3.0",
35
35
  "chokidar": "3.3.1"
36
36
  },
37
37
  "devDependencies": {
@@ -78,8 +78,8 @@
78
78
  "@types/yauzl-promise": "2.1.0",
79
79
  "@vercel-internals/constants": "1.0.4",
80
80
  "@vercel-internals/get-package-json": "1.0.0",
81
- "@vercel-internals/types": "1.0.21",
82
- "@vercel/client": "13.1.0",
81
+ "@vercel-internals/types": "1.0.22",
82
+ "@vercel/client": "13.1.2",
83
83
  "@vercel/error-utils": "2.0.2",
84
84
  "@vercel/frameworks": "2.0.6",
85
85
  "@vercel/fs-detectors": "5.1.6",