vercel 33.0.1 → 33.1.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 +68 -31
  2. package/package.json +11 -11
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.0.12",
62516
+ version: "13.0.13",
62517
62517
  main: "dist/index.js",
62518
62518
  typings: "dist/index.d.ts",
62519
62519
  homepage: "https://vercel.com",
@@ -62550,7 +62550,7 @@ var require_package = __commonJS2({
62550
62550
  typescript: "4.9.5"
62551
62551
  },
62552
62552
  dependencies: {
62553
- "@vercel/build-utils": "7.4.1",
62553
+ "@vercel/build-utils": "7.5.0",
62554
62554
  "@vercel/routing-utils": "3.1.0",
62555
62555
  "@zeit/fetch": "5.2.0",
62556
62556
  "async-retry": "1.2.3",
@@ -165376,7 +165376,7 @@ async function processDeployment({
165376
165376
  now.url = deployment.url;
165377
165377
  output2.stopSpinner();
165378
165378
  printInspectUrl(output2, deployment.inspectorUrl, deployStamp);
165379
- const isProdDeployment = requestBody.target === "production";
165379
+ const isProdDeployment = deployment.target === "production";
165380
165380
  const previewUrl = `https://${deployment.url}`;
165381
165381
  output2.print(
165382
165382
  prependEmoji(
@@ -168549,12 +168549,18 @@ async function writeBuildResultV2(outputDir, buildResult, build2, vercelConfig)
168549
168549
  `The build result from "${build2.use}" is missing the "output" property.${updateMessage}`
168550
168550
  );
168551
168551
  }
168552
- const lambdas = /* @__PURE__ */ new Map();
168552
+ const existingFunctions = /* @__PURE__ */ new Map();
168553
168553
  const overrides = {};
168554
168554
  for (const [path11, output2] of Object.entries(buildResult.output)) {
168555
168555
  const normalizedPath = stripDuplicateSlashes(path11);
168556
168556
  if (isLambda(output2)) {
168557
- await writeLambda(outputDir, output2, normalizedPath, void 0, lambdas);
168557
+ await writeLambda(
168558
+ outputDir,
168559
+ output2,
168560
+ normalizedPath,
168561
+ void 0,
168562
+ existingFunctions
168563
+ );
168558
168564
  } else if (isPrerender(output2)) {
168559
168565
  if (!output2.lambda) {
168560
168566
  throw new Error(
@@ -168566,7 +168572,7 @@ async function writeBuildResultV2(outputDir, buildResult, build2, vercelConfig)
168566
168572
  output2.lambda,
168567
168573
  normalizedPath,
168568
168574
  void 0,
168569
- lambdas
168575
+ existingFunctions
168570
168576
  );
168571
168577
  let fallback = output2.fallback;
168572
168578
  if (fallback) {
@@ -168613,7 +168619,12 @@ async function writeBuildResultV2(outputDir, buildResult, build2, vercelConfig)
168613
168619
  vercelConfig?.cleanUrls
168614
168620
  );
168615
168621
  } else if (isEdgeFunction(output2)) {
168616
- await writeEdgeFunction(outputDir, output2, normalizedPath);
168622
+ await writeEdgeFunction(
168623
+ outputDir,
168624
+ output2,
168625
+ normalizedPath,
168626
+ existingFunctions
168627
+ );
168617
168628
  } else {
168618
168629
  throw new Error(
168619
168630
  `Unsupported output type: "${output2.type}" for ${normalizedPath}`
@@ -168679,8 +168690,30 @@ async function writeStaticFile(outputDir, file, path11, overrides, cleanUrls = f
168679
168690
  }
168680
168691
  await (0, import_build_utils8.downloadFile)(file, dest);
168681
168692
  }
168682
- async function writeEdgeFunction(outputDir, edgeFunction, path11) {
168693
+ async function writeFunctionSymlink(outputDir, dest, fn2, existingFunctions) {
168694
+ const existingPath = existingFunctions.get(fn2);
168695
+ if (!existingPath)
168696
+ return false;
168697
+ const destDir = (0, import_path24.dirname)(dest);
168698
+ const targetDest = (0, import_path24.join)(outputDir, "functions", `${existingPath}.func`);
168699
+ const target = (0, import_path24.relative)(destDir, targetDest);
168700
+ await import_fs_extra15.default.mkdirp(destDir);
168701
+ await import_fs_extra15.default.symlink(target, dest);
168702
+ return true;
168703
+ }
168704
+ async function writeEdgeFunction(outputDir, edgeFunction, path11, existingFunctions) {
168683
168705
  const dest = (0, import_path24.join)(outputDir, "functions", `${path11}.func`);
168706
+ if (existingFunctions) {
168707
+ if (await writeFunctionSymlink(
168708
+ outputDir,
168709
+ dest,
168710
+ edgeFunction,
168711
+ existingFunctions
168712
+ )) {
168713
+ return;
168714
+ }
168715
+ existingFunctions.set(edgeFunction, path11);
168716
+ }
168684
168717
  await import_fs_extra15.default.mkdirp(dest);
168685
168718
  const ops = [];
168686
168719
  ops.push((0, import_build_utils8.download)(edgeFunction.files, dest));
@@ -168699,22 +168732,14 @@ async function writeEdgeFunction(outputDir, edgeFunction, path11) {
168699
168732
  );
168700
168733
  await Promise.all(ops);
168701
168734
  }
168702
- async function writeLambda(outputDir, lambda, path11, functionConfiguration, lambdas) {
168735
+ async function writeLambda(outputDir, lambda, path11, functionConfiguration, existingFunctions) {
168703
168736
  const dest = (0, import_path24.join)(outputDir, "functions", `${path11}.func`);
168704
- const existingLambdaPath = lambdas?.get(lambda);
168705
- if (existingLambdaPath) {
168706
- const destDir = (0, import_path24.dirname)(dest);
168707
- const targetDest = (0, import_path24.join)(
168708
- outputDir,
168709
- "functions",
168710
- `${existingLambdaPath}.func`
168711
- );
168712
- const target = (0, import_path24.relative)(destDir, targetDest);
168713
- await import_fs_extra15.default.mkdirp(destDir);
168714
- await import_fs_extra15.default.symlink(target, dest);
168715
- return;
168737
+ if (existingFunctions) {
168738
+ if (await writeFunctionSymlink(outputDir, dest, lambda, existingFunctions)) {
168739
+ return;
168740
+ }
168741
+ existingFunctions.set(lambda, path11);
168716
168742
  }
168717
- lambdas?.set(lambda, path11);
168718
168743
  await import_fs_extra15.default.mkdirp(dest);
168719
168744
  const ops = [];
168720
168745
  if (lambda.files) {
@@ -186584,9 +186609,9 @@ var init_server = __esm({
186584
186609
  });
186585
186610
  }
186586
186611
  if (startMiddlewareResult) {
186587
- const { port, pid } = startMiddlewareResult;
186612
+ const { port, pid, shutdown } = startMiddlewareResult;
186588
186613
  middlewarePid = pid;
186589
- this.devServerPids.add(pid);
186614
+ this.shutdownCallbacks.set(pid, shutdown);
186590
186615
  const middlewareReqHeaders = nodeHeadersToFetchHeaders(req.headers);
186591
186616
  const proxyHeaders = this.getProxyHeaders(req, requestId, true);
186592
186617
  for (const [name, value] of nodeHeadersToFetchHeaders(proxyHeaders)) {
@@ -186951,8 +186976,8 @@ Please ensure that ${cmd(err.path)} is properly installed`;
186951
186976
  }
186952
186977
  if (devServerResult) {
186953
186978
  requestId = generateRequestId(this.podId, true);
186954
- const { port, pid } = devServerResult;
186955
- this.devServerPids.add(pid);
186979
+ const { port, pid, shutdown } = devServerResult;
186980
+ this.shutdownCallbacks.set(pid, shutdown);
186956
186981
  res.once("close", () => {
186957
186982
  this.killBuilderDevServer(pid);
186958
186983
  });
@@ -187129,7 +187154,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
187129
187154
  this.watchAggregationTimeout = 500;
187130
187155
  this.filter = (path11) => Boolean(path11);
187131
187156
  this.podId = Math.random().toString(32).slice(-5);
187132
- this.devServerPids = /* @__PURE__ */ new Set();
187157
+ this.shutdownCallbacks = /* @__PURE__ */ new Map();
187133
187158
  }
187134
187159
  get address() {
187135
187160
  if (!this._address) {
@@ -187756,7 +187781,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
187756
187781
  debug3(`Closing file watcher`);
187757
187782
  ops.push(this.watcher.close());
187758
187783
  }
187759
- for (const pid of this.devServerPids) {
187784
+ for (const pid of this.shutdownCallbacks.keys()) {
187760
187785
  ops.push(this.killBuilderDevServer(pid));
187761
187786
  }
187762
187787
  try {
@@ -187772,7 +187797,13 @@ Please ensure that ${cmd(err.path)} is properly installed`;
187772
187797
  async killBuilderDevServer(pid) {
187773
187798
  const { debug: debug3 } = this.output;
187774
187799
  debug3(`Killing builder dev server with PID ${pid}`);
187775
- this.devServerPids.delete(pid);
187800
+ const shutdownCb = this.shutdownCallbacks.get(pid);
187801
+ this.shutdownCallbacks.delete(pid);
187802
+ if (shutdownCb) {
187803
+ debug3(`Running shutdown callback for PID ${pid}`);
187804
+ await shutdownCb();
187805
+ return;
187806
+ }
187776
187807
  try {
187777
187808
  await treeKill(pid);
187778
187809
  debug3(`Killed builder dev server with PID ${pid}`);
@@ -198503,7 +198534,7 @@ function createProxy(client2) {
198503
198534
 
198504
198535
  // src/util/extension/exec.ts
198505
198536
  async function execExtension(client2, name, args2, cwd) {
198506
- const { debug: debug3 } = client2.output;
198537
+ const { debug: debug3, log: log2 } = client2.output;
198507
198538
  const extensionCommand = `vercel-${name}`;
198508
198539
  const { packageJsonPath, lockfilePath } = await (0, import_build_utils4.scanParentDirs)(cwd);
198509
198540
  const baseFile = lockfilePath || packageJsonPath;
@@ -198545,7 +198576,7 @@ async function execExtension(client2, name, args2, cwd) {
198545
198576
  });
198546
198577
  proxy.close();
198547
198578
  if (result instanceof Error) {
198548
- debug3(`error running extension: ${result.message}`);
198579
+ log2(`Error running extension ${extensionCommand}: ${result.message}`);
198549
198580
  }
198550
198581
  return result.exitCode;
198551
198582
  }
@@ -198956,6 +198987,12 @@ var main13 = async () => {
198956
198987
  });
198957
198988
  return 1;
198958
198989
  }
198990
+ if ((0, import_error_utils33.isErrnoException)(err) && err.code === "rate_limited") {
198991
+ output.prettyError({
198992
+ message: "Rate limited. Too many requests to the same endpoint: /teams"
198993
+ });
198994
+ return 1;
198995
+ }
198959
198996
  console.error(error("Not able to load teams"));
198960
198997
  return 1;
198961
198998
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "33.0.1",
3
+ "version": "33.1.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.4.1",
24
+ "@vercel/build-utils": "7.5.0",
25
25
  "@vercel/fun": "1.1.0",
26
- "@vercel/go": "3.0.4",
27
- "@vercel/hydrogen": "1.0.1",
28
- "@vercel/next": "4.0.16",
29
- "@vercel/node": "3.0.14",
26
+ "@vercel/go": "3.0.5",
27
+ "@vercel/hydrogen": "1.0.2",
28
+ "@vercel/next": "4.0.17",
29
+ "@vercel/node": "3.0.16",
30
30
  "@vercel/python": "4.1.0",
31
- "@vercel/redwood": "2.0.5",
32
- "@vercel/remix-builder": "2.0.15",
31
+ "@vercel/redwood": "2.0.6",
32
+ "@vercel/remix-builder": "2.0.17",
33
33
  "@vercel/ruby": "2.0.4",
34
- "@vercel/static-build": "2.0.16",
34
+ "@vercel/static-build": "2.0.17",
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.19",
82
- "@vercel/client": "13.0.12",
81
+ "@vercel-internals/types": "1.0.20",
82
+ "@vercel/client": "13.0.13",
83
83
  "@vercel/error-utils": "2.0.2",
84
84
  "@vercel/frameworks": "2.0.6",
85
85
  "@vercel/fs-detectors": "5.1.6",