vercel 47.0.0 → 47.0.2

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 +75 -15
  2. package/package.json +11 -11
package/dist/index.js CHANGED
@@ -47228,7 +47228,7 @@ var require_package = __commonJS2({
47228
47228
  "../client/package.json"(exports2, module2) {
47229
47229
  module2.exports = {
47230
47230
  name: "@vercel/client",
47231
- version: "16.0.0",
47231
+ version: "16.0.1",
47232
47232
  main: "dist/index.js",
47233
47233
  typings: "dist/index.d.ts",
47234
47234
  homepage: "https://vercel.com",
@@ -47267,7 +47267,7 @@ var require_package = __commonJS2({
47267
47267
  vitest: "2.0.1"
47268
47268
  },
47269
47269
  dependencies: {
47270
- "@vercel/build-utils": "12.0.0",
47270
+ "@vercel/build-utils": "12.1.0",
47271
47271
  "@vercel/error-utils": "2.0.3",
47272
47272
  "@vercel/microfrontends": "1.2.2",
47273
47273
  "@vercel/routing-utils": "5.1.1",
@@ -94419,6 +94419,13 @@ var init_telemetry = __esm({
94419
94419
  value: this.redactedValue
94420
94420
  });
94421
94421
  }
94422
+ trackLoginState(state) {
94423
+ if (state === "started")
94424
+ this.loginAttempt = (0, import_node_crypto.randomUUID)();
94425
+ this.track({ key: `login:attempt:${this.loginAttempt}`, value: state });
94426
+ if (state !== "started")
94427
+ this.loginAttempt = void 0;
94428
+ }
94422
94429
  trackCliFlagHelp(command, subcommands) {
94423
94430
  let subcommand;
94424
94431
  if (subcommands) {
@@ -126444,15 +126451,17 @@ var require_get_monorepo_default_settings = __commonJS2({
126444
126451
  })
126445
126452
  ]);
126446
126453
  if (monorepoManager === "turbo") {
126447
- const [turboJSONBuf, packageJSONBuf] = await Promise.all([
126454
+ const [turboJSONBuf, turboJSONCBuf, packageJSONBuf] = await Promise.all([
126448
126455
  detectorFilesystem.readFile("turbo.json").catch(() => null),
126456
+ detectorFilesystem.readFile("turbo.jsonc").catch(() => null),
126449
126457
  detectorFilesystem.readFile("package.json").catch(() => null)
126450
126458
  ]);
126451
126459
  let hasBuildPipeline = false;
126452
126460
  let hasTurboTasks = false;
126453
126461
  let turboSemVer = null;
126454
- if (turboJSONBuf !== null) {
126455
- const turboJSON = import_json5.default.parse(turboJSONBuf.toString("utf-8"));
126462
+ const turboConfigBuf = turboJSONBuf || turboJSONCBuf;
126463
+ if (turboConfigBuf !== null) {
126464
+ const turboJSON = import_json5.default.parse(turboConfigBuf.toString("utf-8"));
126456
126465
  hasTurboTasks = "tasks" in (turboJSON || {});
126457
126466
  if (turboJSON?.pipeline?.build || turboJSON?.tasks?.build) {
126458
126467
  hasBuildPipeline = true;
@@ -179454,6 +179463,16 @@ var init_login2 = __esm({
179454
179463
  "use strict";
179455
179464
  init_telemetry();
179456
179465
  LoginTelemetryClient = class extends TelemetryClient {
179466
+ /**
179467
+ * Tracks the state of the login process.
179468
+ * - `started` when the user initiates the login process.
179469
+ * - `canceled` when the user cancels the login process.
179470
+ * - `error` when the user encounters an error during the login process.
179471
+ * - `success` when the user successfully logs in.
179472
+ */
179473
+ trackState(...args2) {
179474
+ this.trackLoginState(...args2);
179475
+ }
179457
179476
  };
179458
179477
  }
179459
179478
  });
@@ -179467,7 +179486,7 @@ async function login2(client2) {
179467
179486
  const [deviceAuthorizationError, deviceAuthorization] = await processDeviceAuthorizationResponse(deviceAuthorizationResponse);
179468
179487
  if (deviceAuthorizationError) {
179469
179488
  printError(deviceAuthorizationError);
179470
- return 1;
179489
+ return "error";
179471
179490
  }
179472
179491
  const {
179473
179492
  device_code,
@@ -179477,10 +179496,15 @@ async function login2(client2) {
179477
179496
  expiresAt,
179478
179497
  interval
179479
179498
  } = deviceAuthorization;
179499
+ let canceled = false;
179500
+ const handleCancel = () => {
179501
+ canceled = true;
179502
+ rl.close();
179503
+ };
179480
179504
  const rl = import_node_readline.default.createInterface({
179481
179505
  input: process.stdin,
179482
179506
  output: process.stdout
179483
- }).on("SIGINT", () => process.exit(0));
179507
+ }).on("SIGINT", handleCancel);
179484
179508
  rl.question(
179485
179509
  `
179486
179510
  Visit ${import_chalk107.default.bold(
@@ -179493,20 +179517,41 @@ async function login2(client2) {
179493
179517
  ${import_chalk107.default.grey("Press [ENTER] to open the browser")}
179494
179518
  `,
179495
179519
  () => {
179520
+ if (canceled)
179521
+ return;
179496
179522
  open6.default(verification_uri_complete);
179497
179523
  output_manager_default.print((0, import_ansi_escapes6.eraseLines)(2));
179498
179524
  output_manager_default.spinner("Waiting for authentication...");
179499
- rl.close();
179525
+ if (!canceled) {
179526
+ rl.close();
179527
+ }
179500
179528
  }
179501
179529
  );
179530
+ if (canceled) {
179531
+ rl.off("SIGINT", handleCancel);
179532
+ return "canceled";
179533
+ }
179502
179534
  output_manager_default.spinner("Waiting for authentication...");
179503
179535
  let intervalMs = interval * 1e3;
179504
179536
  let error3 = new Error(
179505
179537
  "Timed out waiting for authentication. Please try again."
179506
179538
  );
179507
179539
  async function pollForToken() {
179508
- while (Date.now() < expiresAt) {
179509
- await new Promise((resolve13) => setTimeout(resolve13, intervalMs));
179540
+ while (Date.now() < expiresAt && !canceled) {
179541
+ await new Promise((resolve13) => {
179542
+ const timeoutId = setTimeout(resolve13, intervalMs);
179543
+ const checkCancellation = () => {
179544
+ if (canceled) {
179545
+ clearTimeout(timeoutId);
179546
+ resolve13();
179547
+ } else {
179548
+ setTimeout(checkCancellation, 50);
179549
+ }
179550
+ };
179551
+ checkCancellation();
179552
+ });
179553
+ if (canceled)
179554
+ break;
179510
179555
  const [tokenResponseError, tokenResponse] = await deviceAccessTokenRequest({ device_code });
179511
179556
  if (tokenResponseError) {
179512
179557
  if (tokenResponseError.message.includes("timeout")) {
@@ -179568,11 +179613,16 @@ async function login2(client2) {
179568
179613
  }
179569
179614
  error3 = await pollForToken();
179570
179615
  output_manager_default.stopSpinner();
179616
+ rl.off("SIGINT", handleCancel);
179571
179617
  rl.close();
179572
- if (!error3)
179573
- return 0;
179618
+ if (canceled) {
179619
+ return "canceled";
179620
+ }
179621
+ if (!error3) {
179622
+ return "success";
179623
+ }
179574
179624
  printError(error3);
179575
- return 1;
179625
+ return "error";
179576
179626
  }
179577
179627
  var import_node_readline, import_chalk107, open6, import_ansi_escapes6;
179578
179628
  var init_future = __esm({
@@ -179604,7 +179654,8 @@ async function login3(client2) {
179604
179654
  const flagsSpecification = getFlagsSpecification(loginCommand.options);
179605
179655
  const telemetry2 = new LoginTelemetryClient({
179606
179656
  opts: {
179607
- store: client2.telemetryEventStore
179657
+ store: client2.telemetryEventStore,
179658
+ isDebug: output_manager_default.isDebugEnabled()
179608
179659
  }
179609
179660
  });
179610
179661
  try {
@@ -179615,7 +179666,16 @@ async function login3(client2) {
179615
179666
  }
179616
179667
  if (parsedArgs.flags["--future"]) {
179617
179668
  telemetry2.trackCliFlagFuture("login");
179618
- return await login2(client2);
179669
+ telemetry2.trackState("started");
179670
+ const status3 = await login2(client2);
179671
+ telemetry2.trackState(status3);
179672
+ switch (status3) {
179673
+ case "canceled":
179674
+ case "success":
179675
+ return 0;
179676
+ case "error":
179677
+ return 1;
179678
+ }
179619
179679
  }
179620
179680
  if (parsedArgs.flags["--help"]) {
179621
179681
  telemetry2.trackCliFlagHelp("login");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "47.0.0",
3
+ "version": "47.0.2",
4
4
  "preferGlobal": true,
5
5
  "license": "Apache-2.0",
6
6
  "description": "The command-line interface for Vercel",
@@ -22,20 +22,20 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@vercel/blob": "1.0.2",
25
- "@vercel/build-utils": "12.0.0",
25
+ "@vercel/build-utils": "12.1.0",
26
26
  "@vercel/detect-agent": "0.2.0",
27
27
  "@vercel/fun": "1.1.6",
28
28
  "@vercel/go": "3.2.3",
29
- "@vercel/express": "0.0.11",
30
- "@vercel/hono": "0.0.19",
29
+ "@vercel/express": "0.0.13",
30
+ "@vercel/hono": "0.0.21",
31
31
  "@vercel/hydrogen": "1.2.4",
32
- "@vercel/next": "4.12.3",
33
- "@vercel/node": "5.3.18",
32
+ "@vercel/next": "4.12.4",
33
+ "@vercel/node": "5.3.20",
34
34
  "@vercel/python": "5.0.0",
35
35
  "@vercel/redwood": "2.3.6",
36
36
  "@vercel/remix-builder": "5.4.12",
37
37
  "@vercel/ruby": "2.2.1",
38
- "@vercel/static-build": "2.7.21",
38
+ "@vercel/static-build": "2.7.22",
39
39
  "chokidar": "4.0.0",
40
40
  "jose": "5.9.6"
41
41
  },
@@ -82,11 +82,11 @@
82
82
  "@types/which": "3.0.0",
83
83
  "@types/write-json-file": "2.2.1",
84
84
  "@types/yauzl-promise": "2.1.0",
85
- "@vercel/client": "16.0.0",
85
+ "@vercel/client": "16.0.1",
86
86
  "@vercel/detect-agent": "0.2.0",
87
87
  "@vercel/error-utils": "2.0.3",
88
88
  "@vercel/frameworks": "3.8.2",
89
- "@vercel/fs-detectors": "5.4.16",
89
+ "@vercel/fs-detectors": "5.5.0",
90
90
  "@vercel/routing-utils": "5.1.1",
91
91
  "@vitest/expect": "2.1.3",
92
92
  "ajv": "6.12.3",
@@ -166,9 +166,9 @@
166
166
  "write-json-file": "2.2.0",
167
167
  "xdg-app-paths": "5.1.0",
168
168
  "yauzl-promise": "2.1.3",
169
- "@vercel-internals/constants": "1.0.4",
170
169
  "@vercel-internals/get-package-json": "1.0.0",
171
- "@vercel-internals/types": "3.0.6"
170
+ "@vercel-internals/types": "3.0.6",
171
+ "@vercel-internals/constants": "1.0.4"
172
172
  },
173
173
  "scripts": {
174
174
  "test": "jest --reporters=default --reporters=jest-junit --env node --verbose --bail",