vercel 54.1.0 → 54.2.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 (54) hide show
  1. package/dist/chunks/{add-XFFRWMRQ.js → add-FAIIANHS.js} +5 -5
  2. package/dist/chunks/{chunk-UVFXUXOZ.js → chunk-23UWSHRQ.js} +180 -11
  3. package/dist/chunks/{chunk-ZKKIBUCU.js → chunk-2OASKDFC.js} +1 -1
  4. package/dist/chunks/{chunk-MUBKPS2Z.js → chunk-DIWRR5Y4.js} +1 -1
  5. package/dist/chunks/{chunk-XNUHSM7I.js → chunk-DP5346AR.js} +1 -1
  6. package/dist/chunks/{chunk-UTXSTM52.js → chunk-E32QX22S.js} +2 -2
  7. package/dist/chunks/{chunk-X775BOSL.js → chunk-FKUVFVT2.js} +4905 -4402
  8. package/dist/chunks/{chunk-MMF4BVAP.js → chunk-H7ZZXKJ2.js} +1 -1
  9. package/dist/chunks/{chunk-FUBTAFL2.js → chunk-ISJJTUJZ.js} +1 -1
  10. package/dist/chunks/{chunk-FXOKKAK2.js → chunk-IYP3534A.js} +6 -6
  11. package/dist/chunks/{chunk-KWDV5FZH.js → chunk-J7RPHYNB.js} +1 -1
  12. package/dist/chunks/{chunk-PPIAHRII.js → chunk-JQ7RG6JF.js} +1 -1
  13. package/dist/chunks/{chunk-4OEA5ILS.js → chunk-KSMF2UFR.js} +14 -0
  14. package/dist/chunks/{chunk-V6RCNEUA.js → chunk-O2NXGZCW.js} +5 -5
  15. package/dist/chunks/{chunk-4VPRHRPA.js → chunk-QAA3JVFJ.js} +1 -1
  16. package/dist/chunks/{chunk-N4WFAZKO.js → chunk-QEYYWOB4.js} +2 -2
  17. package/dist/chunks/{chunk-LVUE7LLE.js → chunk-QH5Q2B4F.js} +1 -1
  18. package/dist/chunks/{chunk-PNA7EZB2.js → chunk-TWVG3QHM.js} +1 -1
  19. package/dist/chunks/{chunk-F2UPASLT.js → chunk-VKQT3HCH.js} +4 -4
  20. package/dist/chunks/{chunk-J3BCJYPE.js → chunk-YE6OHHJA.js} +485 -7
  21. package/dist/chunks/{chunk-FXSXQHVF.js → chunk-YNHUUJTK.js} +2 -2
  22. package/dist/chunks/{chunk-CVDYWVCD.js → chunk-ZA4ZUW7G.js} +1 -1
  23. package/dist/chunks/{chunk-IIZO5JJ2.js → chunk-ZFEECTPC.js} +1 -1
  24. package/dist/chunks/{compile-vercel-config-42PRUTEP.js → compile-vercel-config-7TPMRTKM.js} +2 -2
  25. package/dist/chunks/{delete-MXCXLO5L.js → delete-MVQKJDRS.js} +3 -3
  26. package/dist/chunks/{disable-LXQSUVY3.js → disable-YRONTYDS.js} +3 -3
  27. package/dist/chunks/{discard-CKMEANJI.js → discard-UM7Y2PMF.js} +3 -3
  28. package/dist/chunks/{edit-PKYWQTN6.js → edit-PHXJMLL2.js} +5 -5
  29. package/dist/chunks/{enable-IONDBJSL.js → enable-D26FR2VL.js} +3 -3
  30. package/dist/chunks/{export-YV3QFTMT.js → export-YLMQTP7Y.js} +3 -3
  31. package/dist/chunks/{inspect-SF355FJC.js → inspect-SJTJNJVL.js} +4 -4
  32. package/dist/chunks/{list-GEI7DMTS.js → list-6OV7HAO4.js} +3 -3
  33. package/dist/chunks/{list-ZGR3WI5L.js → list-XGSNQW5B.js} +4 -4
  34. package/dist/chunks/{ls-GYN5LXZK.js → ls-THDT5E4M.js} +5 -5
  35. package/dist/chunks/{publish-3WCELCTS.js → publish-NPM5RPLV.js} +3 -3
  36. package/dist/chunks/{query-TP56OPX6.js → query-QP5JLBXI.js} +3 -3
  37. package/dist/chunks/{reorder-QRNHPN5V.js → reorder-573FHW5Z.js} +3 -3
  38. package/dist/chunks/{restore-IGN4HUFX.js → restore-H65BVJFL.js} +3 -3
  39. package/dist/chunks/{rm-55RGOT4O.js → rm-MOVL4G2Y.js} +5 -5
  40. package/dist/chunks/{routes-2YVMQEPC.js → routes-I74KWX7Q.js} +2 -2
  41. package/dist/chunks/{rule-inspect-QVOVMKDK.js → rule-inspect-33M2FHDU.js} +5 -5
  42. package/dist/chunks/{rules-KRCW5RQK.js → rules-KVSJYT5T.js} +6 -6
  43. package/dist/chunks/{schema-3J3IBIFA.js → schema-MXM7Z52O.js} +3 -3
  44. package/dist/chunks/{update-E5UAD2DD.js → update-CSKHHR3E.js} +5 -5
  45. package/dist/commands/build/index.js +24 -19
  46. package/dist/commands/deploy/index.js +12 -12
  47. package/dist/commands/dev/index.js +69 -32
  48. package/dist/commands/env/index.js +6 -6
  49. package/dist/commands/link/index.js +9 -9
  50. package/dist/commands/list/index.js +5 -5
  51. package/dist/commands-bulk.js +2315 -1427
  52. package/dist/index.js +96 -452
  53. package/dist/version.mjs +1 -1
  54. package/package.json +24 -23
package/dist/index.js CHANGED
@@ -9,15 +9,19 @@ import {
9
9
  } from "./chunks/chunk-JFWE5ORG.js";
10
10
  import {
11
11
  box,
12
+ canAutoUpdate,
12
13
  did_you_mean_default,
13
14
  executeUpgrade,
15
+ hasAutoUpdatePreference,
14
16
  login,
15
17
  matchesCliApiTag,
18
+ require_ci_info,
19
+ setAutoUpdate,
16
20
  tryOpenApiFallback
17
- } from "./chunks/chunk-J3BCJYPE.js";
21
+ } from "./chunks/chunk-YE6OHHJA.js";
18
22
  import {
19
23
  getUpdateCommand
20
- } from "./chunks/chunk-FUBTAFL2.js";
24
+ } from "./chunks/chunk-ISJJTUJZ.js";
21
25
  import {
22
26
  Client,
23
27
  getAuthConfigFilePath,
@@ -27,14 +31,14 @@ import {
27
31
  readConfigFile,
28
32
  writeToAuthConfigFile,
29
33
  writeToConfigFile
30
- } from "./chunks/chunk-F2UPASLT.js";
34
+ } from "./chunks/chunk-VKQT3HCH.js";
31
35
  import {
32
36
  highlight
33
37
  } from "./chunks/chunk-V5P25P7F.js";
34
38
  import {
35
39
  commandNames,
36
40
  commands
37
- } from "./chunks/chunk-UVFXUXOZ.js";
41
+ } from "./chunks/chunk-23UWSHRQ.js";
38
42
  import "./chunks/chunk-IFATV36R.js";
39
43
  import "./chunks/chunk-JFVGRFME.js";
40
44
  import "./chunks/chunk-TZMIHH5D.js";
@@ -43,15 +47,15 @@ import "./chunks/chunk-ZAAKSLHC.js";
43
47
  import "./chunks/chunk-CQANJIEC.js";
44
48
  import {
45
49
  getScope
46
- } from "./chunks/chunk-KWDV5FZH.js";
50
+ } from "./chunks/chunk-J7RPHYNB.js";
47
51
  import "./chunks/chunk-4PSOOFYO.js";
48
52
  import {
49
53
  require_semver
50
54
  } from "./chunks/chunk-IB5L4LKZ.js";
51
55
  import "./chunks/chunk-76ZNZKIN.js";
52
- import "./chunks/chunk-4VPRHRPA.js";
53
- import "./chunks/chunk-ZKKIBUCU.js";
54
- import "./chunks/chunk-MMF4BVAP.js";
56
+ import "./chunks/chunk-QAA3JVFJ.js";
57
+ import "./chunks/chunk-2OASKDFC.js";
58
+ import "./chunks/chunk-H7ZZXKJ2.js";
55
59
  import {
56
60
  getLinkFromDir,
57
61
  getTeams,
@@ -62,11 +66,11 @@ import {
62
66
  readJSONFile,
63
67
  require_dist as require_dist2,
64
68
  require_lib
65
- } from "./chunks/chunk-X775BOSL.js";
69
+ } from "./chunks/chunk-FKUVFVT2.js";
66
70
  import {
67
71
  TelemetryClient,
68
72
  TelemetryEventStore
69
- } from "./chunks/chunk-4OEA5ILS.js";
73
+ } from "./chunks/chunk-KSMF2UFR.js";
70
74
  import "./chunks/chunk-ULXHXZCZ.js";
71
75
  import "./chunks/chunk-CO5D46AG.js";
72
76
  import "./chunks/chunk-N2T234LO.js";
@@ -305,10 +309,10 @@ var require_xdg_app_paths = __commonJS({
305
309
  };
306
310
  var windows = (name, isolated) => {
307
311
  const { env } = process;
308
- const homedir = os.homedir();
312
+ const homedir2 = os.homedir();
309
313
  const tmpdir = os.tmpdir();
310
- const appData = env.APPDATA || path2.join(homedir || tmpdir, "AppData", "Roaming");
311
- const localAppData = env.LOCALAPPDATA || path2.join(homedir || tmpdir, "AppData", "Local");
314
+ const appData = env.APPDATA || path2.join(homedir2 || tmpdir, "AppData", "Roaming");
315
+ const localAppData = env.LOCALAPPDATA || path2.join(homedir2 || tmpdir, "AppData", "Local");
312
316
  const object = {};
313
317
  object.cache = (options = { isolated: null }) => {
314
318
  options = _normalizeOptions(options, isolated);
@@ -391,446 +395,12 @@ var require_xdg_app_paths = __commonJS({
391
395
  }
392
396
  });
393
397
 
394
- // ../../node_modules/.pnpm/ci-info@4.1.0/node_modules/ci-info/vendors.json
395
- var require_vendors = __commonJS({
396
- "../../node_modules/.pnpm/ci-info@4.1.0/node_modules/ci-info/vendors.json"(exports, module) {
397
- module.exports = [
398
- {
399
- name: "Agola CI",
400
- constant: "AGOLA",
401
- env: "AGOLA_GIT_REF",
402
- pr: "AGOLA_PULL_REQUEST_ID"
403
- },
404
- {
405
- name: "Appcircle",
406
- constant: "APPCIRCLE",
407
- env: "AC_APPCIRCLE",
408
- pr: {
409
- env: "AC_GIT_PR",
410
- ne: "false"
411
- }
412
- },
413
- {
414
- name: "AppVeyor",
415
- constant: "APPVEYOR",
416
- env: "APPVEYOR",
417
- pr: "APPVEYOR_PULL_REQUEST_NUMBER"
418
- },
419
- {
420
- name: "AWS CodeBuild",
421
- constant: "CODEBUILD",
422
- env: "CODEBUILD_BUILD_ARN",
423
- pr: {
424
- env: "CODEBUILD_WEBHOOK_EVENT",
425
- any: [
426
- "PULL_REQUEST_CREATED",
427
- "PULL_REQUEST_UPDATED",
428
- "PULL_REQUEST_REOPENED"
429
- ]
430
- }
431
- },
432
- {
433
- name: "Azure Pipelines",
434
- constant: "AZURE_PIPELINES",
435
- env: "TF_BUILD",
436
- pr: {
437
- BUILD_REASON: "PullRequest"
438
- }
439
- },
440
- {
441
- name: "Bamboo",
442
- constant: "BAMBOO",
443
- env: "bamboo_planKey"
444
- },
445
- {
446
- name: "Bitbucket Pipelines",
447
- constant: "BITBUCKET",
448
- env: "BITBUCKET_COMMIT",
449
- pr: "BITBUCKET_PR_ID"
450
- },
451
- {
452
- name: "Bitrise",
453
- constant: "BITRISE",
454
- env: "BITRISE_IO",
455
- pr: "BITRISE_PULL_REQUEST"
456
- },
457
- {
458
- name: "Buddy",
459
- constant: "BUDDY",
460
- env: "BUDDY_WORKSPACE_ID",
461
- pr: "BUDDY_EXECUTION_PULL_REQUEST_ID"
462
- },
463
- {
464
- name: "Buildkite",
465
- constant: "BUILDKITE",
466
- env: "BUILDKITE",
467
- pr: {
468
- env: "BUILDKITE_PULL_REQUEST",
469
- ne: "false"
470
- }
471
- },
472
- {
473
- name: "CircleCI",
474
- constant: "CIRCLE",
475
- env: "CIRCLECI",
476
- pr: "CIRCLE_PULL_REQUEST"
477
- },
478
- {
479
- name: "Cirrus CI",
480
- constant: "CIRRUS",
481
- env: "CIRRUS_CI",
482
- pr: "CIRRUS_PR"
483
- },
484
- {
485
- name: "Codefresh",
486
- constant: "CODEFRESH",
487
- env: "CF_BUILD_ID",
488
- pr: {
489
- any: [
490
- "CF_PULL_REQUEST_NUMBER",
491
- "CF_PULL_REQUEST_ID"
492
- ]
493
- }
494
- },
495
- {
496
- name: "Codemagic",
497
- constant: "CODEMAGIC",
498
- env: "CM_BUILD_ID",
499
- pr: "CM_PULL_REQUEST"
500
- },
501
- {
502
- name: "Codeship",
503
- constant: "CODESHIP",
504
- env: {
505
- CI_NAME: "codeship"
506
- }
507
- },
508
- {
509
- name: "Drone",
510
- constant: "DRONE",
511
- env: "DRONE",
512
- pr: {
513
- DRONE_BUILD_EVENT: "pull_request"
514
- }
515
- },
516
- {
517
- name: "dsari",
518
- constant: "DSARI",
519
- env: "DSARI"
520
- },
521
- {
522
- name: "Earthly",
523
- constant: "EARTHLY",
524
- env: "EARTHLY_CI"
525
- },
526
- {
527
- name: "Expo Application Services",
528
- constant: "EAS",
529
- env: "EAS_BUILD"
530
- },
531
- {
532
- name: "Gerrit",
533
- constant: "GERRIT",
534
- env: "GERRIT_PROJECT"
535
- },
536
- {
537
- name: "Gitea Actions",
538
- constant: "GITEA_ACTIONS",
539
- env: "GITEA_ACTIONS"
540
- },
541
- {
542
- name: "GitHub Actions",
543
- constant: "GITHUB_ACTIONS",
544
- env: "GITHUB_ACTIONS",
545
- pr: {
546
- GITHUB_EVENT_NAME: "pull_request"
547
- }
548
- },
549
- {
550
- name: "GitLab CI",
551
- constant: "GITLAB",
552
- env: "GITLAB_CI",
553
- pr: "CI_MERGE_REQUEST_ID"
554
- },
555
- {
556
- name: "GoCD",
557
- constant: "GOCD",
558
- env: "GO_PIPELINE_LABEL"
559
- },
560
- {
561
- name: "Google Cloud Build",
562
- constant: "GOOGLE_CLOUD_BUILD",
563
- env: "BUILDER_OUTPUT"
564
- },
565
- {
566
- name: "Harness CI",
567
- constant: "HARNESS",
568
- env: "HARNESS_BUILD_ID"
569
- },
570
- {
571
- name: "Heroku",
572
- constant: "HEROKU",
573
- env: {
574
- env: "NODE",
575
- includes: "/app/.heroku/node/bin/node"
576
- }
577
- },
578
- {
579
- name: "Hudson",
580
- constant: "HUDSON",
581
- env: "HUDSON_URL"
582
- },
583
- {
584
- name: "Jenkins",
585
- constant: "JENKINS",
586
- env: [
587
- "JENKINS_URL",
588
- "BUILD_ID"
589
- ],
590
- pr: {
591
- any: [
592
- "ghprbPullId",
593
- "CHANGE_ID"
594
- ]
595
- }
596
- },
597
- {
598
- name: "LayerCI",
599
- constant: "LAYERCI",
600
- env: "LAYERCI",
601
- pr: "LAYERCI_PULL_REQUEST"
602
- },
603
- {
604
- name: "Magnum CI",
605
- constant: "MAGNUM",
606
- env: "MAGNUM"
607
- },
608
- {
609
- name: "Netlify CI",
610
- constant: "NETLIFY",
611
- env: "NETLIFY",
612
- pr: {
613
- env: "PULL_REQUEST",
614
- ne: "false"
615
- }
616
- },
617
- {
618
- name: "Nevercode",
619
- constant: "NEVERCODE",
620
- env: "NEVERCODE",
621
- pr: {
622
- env: "NEVERCODE_PULL_REQUEST",
623
- ne: "false"
624
- }
625
- },
626
- {
627
- name: "Prow",
628
- constant: "PROW",
629
- env: "PROW_JOB_ID"
630
- },
631
- {
632
- name: "ReleaseHub",
633
- constant: "RELEASEHUB",
634
- env: "RELEASE_BUILD_ID"
635
- },
636
- {
637
- name: "Render",
638
- constant: "RENDER",
639
- env: "RENDER",
640
- pr: {
641
- IS_PULL_REQUEST: "true"
642
- }
643
- },
644
- {
645
- name: "Sail CI",
646
- constant: "SAIL",
647
- env: "SAILCI",
648
- pr: "SAIL_PULL_REQUEST_NUMBER"
649
- },
650
- {
651
- name: "Screwdriver",
652
- constant: "SCREWDRIVER",
653
- env: "SCREWDRIVER",
654
- pr: {
655
- env: "SD_PULL_REQUEST",
656
- ne: "false"
657
- }
658
- },
659
- {
660
- name: "Semaphore",
661
- constant: "SEMAPHORE",
662
- env: "SEMAPHORE",
663
- pr: "PULL_REQUEST_NUMBER"
664
- },
665
- {
666
- name: "Sourcehut",
667
- constant: "SOURCEHUT",
668
- env: {
669
- CI_NAME: "sourcehut"
670
- }
671
- },
672
- {
673
- name: "Strider CD",
674
- constant: "STRIDER",
675
- env: "STRIDER"
676
- },
677
- {
678
- name: "TaskCluster",
679
- constant: "TASKCLUSTER",
680
- env: [
681
- "TASK_ID",
682
- "RUN_ID"
683
- ]
684
- },
685
- {
686
- name: "TeamCity",
687
- constant: "TEAMCITY",
688
- env: "TEAMCITY_VERSION"
689
- },
690
- {
691
- name: "Travis CI",
692
- constant: "TRAVIS",
693
- env: "TRAVIS",
694
- pr: {
695
- env: "TRAVIS_PULL_REQUEST",
696
- ne: "false"
697
- }
698
- },
699
- {
700
- name: "Vela",
701
- constant: "VELA",
702
- env: "VELA",
703
- pr: {
704
- VELA_PULL_REQUEST: "1"
705
- }
706
- },
707
- {
708
- name: "Vercel",
709
- constant: "VERCEL",
710
- env: {
711
- any: [
712
- "NOW_BUILDER",
713
- "VERCEL"
714
- ]
715
- },
716
- pr: "VERCEL_GIT_PULL_REQUEST_ID"
717
- },
718
- {
719
- name: "Visual Studio App Center",
720
- constant: "APPCENTER",
721
- env: "APPCENTER_BUILD_ID"
722
- },
723
- {
724
- name: "Woodpecker",
725
- constant: "WOODPECKER",
726
- env: {
727
- CI: "woodpecker"
728
- },
729
- pr: {
730
- CI_BUILD_EVENT: "pull_request"
731
- }
732
- },
733
- {
734
- name: "Xcode Cloud",
735
- constant: "XCODE_CLOUD",
736
- env: "CI_XCODE_PROJECT",
737
- pr: "CI_PULL_REQUEST_NUMBER"
738
- },
739
- {
740
- name: "Xcode Server",
741
- constant: "XCODE_SERVER",
742
- env: "XCS"
743
- }
744
- ];
745
- }
746
- });
747
-
748
- // ../../node_modules/.pnpm/ci-info@4.1.0/node_modules/ci-info/index.js
749
- var require_ci_info = __commonJS({
750
- "../../node_modules/.pnpm/ci-info@4.1.0/node_modules/ci-info/index.js"(exports) {
751
- "use strict";
752
- var vendors = require_vendors();
753
- var env = process.env;
754
- Object.defineProperty(exports, "_vendors", {
755
- value: vendors.map(function(v) {
756
- return v.constant;
757
- })
758
- });
759
- exports.name = null;
760
- exports.isPR = null;
761
- exports.id = null;
762
- vendors.forEach(function(vendor) {
763
- const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
764
- const isCI = envs.every(function(obj) {
765
- return checkEnv(obj);
766
- });
767
- exports[vendor.constant] = isCI;
768
- if (!isCI) {
769
- return;
770
- }
771
- exports.name = vendor.name;
772
- exports.isPR = checkPR(vendor);
773
- exports.id = vendor.constant;
774
- });
775
- exports.isCI = !!(env.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
776
- (env.BUILD_ID || // Jenkins, Cloudbees
777
- env.BUILD_NUMBER || // Jenkins, TeamCity
778
- env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
779
- env.CI_APP_ID || // Appflow
780
- env.CI_BUILD_ID || // Appflow
781
- env.CI_BUILD_NUMBER || // Appflow
782
- env.CI_NAME || // Codeship and others
783
- env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
784
- env.RUN_ID || // TaskCluster, dsari
785
- exports.name || false));
786
- function checkEnv(obj) {
787
- if (typeof obj === "string")
788
- return !!env[obj];
789
- if ("env" in obj) {
790
- return env[obj.env] && env[obj.env].includes(obj.includes);
791
- }
792
- if ("any" in obj) {
793
- return obj.any.some(function(k) {
794
- return !!env[k];
795
- });
796
- }
797
- return Object.keys(obj).every(function(k) {
798
- return env[k] === obj[k];
799
- });
800
- }
801
- function checkPR(vendor) {
802
- switch (typeof vendor.pr) {
803
- case "string":
804
- return !!env[vendor.pr];
805
- case "object":
806
- if ("env" in vendor.pr) {
807
- if ("any" in vendor.pr) {
808
- return vendor.pr.any.some(function(key) {
809
- return env[vendor.pr.env] === key;
810
- });
811
- } else {
812
- return vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne;
813
- }
814
- } else if ("any" in vendor.pr) {
815
- return vendor.pr.any.some(function(key) {
816
- return !!env[key];
817
- });
818
- } else {
819
- return checkEnv(vendor.pr);
820
- }
821
- default:
822
- return null;
823
- }
824
- }
825
- }
826
- });
827
-
828
398
  // src/index.ts
829
399
  var import_error_utils3 = __toESM(require_dist(), 1);
830
400
  var import_fs_extra2 = __toESM(require_lib(), 1);
831
401
  var import_chalk = __toESM(require_source(), 1);
832
402
  var import_epipebomb = __toESM(require_epipebomb(), 1);
833
- import { join } from "path";
403
+ import { join as join2 } from "path";
834
404
  import { existsSync as existsSync2 } from "fs";
835
405
 
836
406
  // src/util/get-latest-version/index.ts
@@ -1518,6 +1088,12 @@ var RootTelemetryClient = class extends TelemetryClient {
1518
1088
  trackDeviceId(deviceId) {
1519
1089
  super.trackDeviceId(deviceId);
1520
1090
  }
1091
+ trackVercelPluginActiveSession() {
1092
+ super.trackVercelPluginActiveSession();
1093
+ }
1094
+ trackVercelPluginVersion(version) {
1095
+ super.trackVercelPluginVersion(version);
1096
+ }
1521
1097
  trackErrorStatus(status) {
1522
1098
  super.trackErrorStatus(status);
1523
1099
  }
@@ -1598,6 +1174,45 @@ var RootTelemetryClient = class extends TelemetryClient {
1598
1174
  }
1599
1175
  };
1600
1176
 
1177
+ // src/util/telemetry/vercel-plugin.ts
1178
+ import { readFileSync } from "fs";
1179
+ import { homedir } from "os";
1180
+ import { join } from "path";
1181
+ var ACTIVE_SESSION_MARKER_PATH = join(
1182
+ homedir(),
1183
+ ".config",
1184
+ "vercel-plugin",
1185
+ "active-session.json"
1186
+ );
1187
+ var SEMVERISH_RE = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/;
1188
+ function isRecord(value) {
1189
+ return typeof value === "object" && value !== null;
1190
+ }
1191
+ function readVercelPluginActiveSessionMarker(opts = {}) {
1192
+ const filePath = opts.filePath ?? ACTIVE_SESSION_MARKER_PATH;
1193
+ const now = opts.now?.() ?? Date.now();
1194
+ try {
1195
+ const marker = JSON.parse(readFileSync(filePath, "utf-8"));
1196
+ if (!isRecord(marker)) {
1197
+ return null;
1198
+ }
1199
+ if (marker.schema !== 1 || marker.active !== true) {
1200
+ return null;
1201
+ }
1202
+ if (typeof marker.expiresAt !== "number" || marker.expiresAt <= now) {
1203
+ return null;
1204
+ }
1205
+ if (typeof marker.pluginVersion !== "string" || !SEMVERISH_RE.test(marker.pluginVersion)) {
1206
+ return null;
1207
+ }
1208
+ return {
1209
+ pluginVersion: marker.pluginVersion
1210
+ };
1211
+ } catch {
1212
+ return null;
1213
+ }
1214
+ }
1215
+
1601
1216
  // src/util/telemetry/check-status.ts
1602
1217
  function checkTelemetryStatus({ config: config2 }) {
1603
1218
  if (config2.telemetry) {
@@ -1694,6 +1309,7 @@ function hasProxyConfig() {
1694
1309
  }
1695
1310
  (0, import_epipebomb.default)();
1696
1311
  var client;
1312
+ var resolvedCommandForUpdate;
1697
1313
  var handleRejection = async (err) => {
1698
1314
  if (err) {
1699
1315
  if (err instanceof Error) {
@@ -1875,10 +1491,10 @@ var main = async () => {
1875
1491
  isDebug: process.env.VERCEL_TELEMETRY_DEBUG === "1",
1876
1492
  config: config2.telemetry,
1877
1493
  cliDevice: isTelemetryFlushCommand ? void 0 : {
1878
- filePath: join(VERCEL_DIR, "telemetry-device.json")
1494
+ filePath: join2(VERCEL_DIR, "telemetry-device.json")
1879
1495
  },
1880
1496
  cliSession: isTelemetryFlushCommand ? void 0 : {
1881
- filePath: join(VERCEL_DIR, "telemetry-session.json")
1497
+ filePath: join2(VERCEL_DIR, "telemetry-session.json")
1882
1498
  }
1883
1499
  });
1884
1500
  checkTelemetryStatus({
@@ -1897,6 +1513,11 @@ var main = async () => {
1897
1513
  const { isAgent, agent: detectedAgent } = await determineAgent();
1898
1514
  telemetry.trackInvocationId(telemetryEventStore.currentInvocationId);
1899
1515
  telemetry.trackDeviceId(telemetryEventStore.currentDeviceId);
1516
+ const vercelPluginMarker = readVercelPluginActiveSessionMarker();
1517
+ if (vercelPluginMarker) {
1518
+ telemetry.trackVercelPluginActiveSession();
1519
+ telemetry.trackVercelPluginVersion(vercelPluginMarker.pluginVersion);
1520
+ }
1900
1521
  telemetry.trackAgenticUse(detectedAgent?.name);
1901
1522
  telemetry.trackCPUs();
1902
1523
  telemetry.trackPlatform();
@@ -2034,7 +1655,7 @@ var main = async () => {
2034
1655
  let subcommand = void 0;
2035
1656
  let userSuppliedSubCommand = "";
2036
1657
  if (targetOrSubcommand) {
2037
- const targetPath = join(cwd, targetOrSubcommand);
1658
+ const targetPath = join2(cwd, targetOrSubcommand);
2038
1659
  const targetPathExists = existsSync2(targetPath);
2039
1660
  const subcommandExists = GLOBAL_COMMANDS.has(targetOrSubcommand) || commands.has(targetOrSubcommand);
2040
1661
  if (targetPathExists && subcommandExists && !parsedArgs.flags["--cwd"] && !process.env.NOW_BUILDER) {
@@ -2555,6 +2176,7 @@ var main = async () => {
2555
2176
  if (!telemetryEventStore.hasUserId && !client.authConfig.userId) {
2556
2177
  earlyGetUserPromise = getUser(client).catch(() => void 0);
2557
2178
  }
2179
+ resolvedCommandForUpdate = targetCommand;
2558
2180
  exitCode = await rootSpan.child("vc.cli.command", { command: subcommand || "deploy" }).trace(() => func(client));
2559
2181
  }
2560
2182
  } catch (err) {
@@ -2610,7 +2232,7 @@ var main = async () => {
2610
2232
  rootSpan.stop();
2611
2233
  if (client.traceDiagnosticsPath) {
2612
2234
  try {
2613
- await mkdir(join(client.traceDiagnosticsPath, ".."), { recursive: true });
2235
+ await mkdir(join2(client.traceDiagnosticsPath, ".."), { recursive: true });
2614
2236
  await writeFile(
2615
2237
  client.traceDiagnosticsPath,
2616
2238
  JSON.stringify(traceReporter.events)
@@ -2629,6 +2251,21 @@ main().then(async (exitCode) => {
2629
2251
  });
2630
2252
  if (latest) {
2631
2253
  const changelog = `https://github.com/vercel/vercel/releases/tag/vercel%40${latest}`;
2254
+ const originalExitCode = typeof exitCode === "number" ? exitCode : 0;
2255
+ if (await canAutoUpdate(
2256
+ client,
2257
+ originalExitCode,
2258
+ resolvedCommandForUpdate
2259
+ )) {
2260
+ const upgradeExitCode = await executeUpgrade();
2261
+ process.exitCode = originalExitCode;
2262
+ if (upgradeExitCode !== 0) {
2263
+ output_manager_default.log(
2264
+ `Automatic update failed. Continuing with original exit code ${originalExitCode}.`
2265
+ );
2266
+ }
2267
+ return;
2268
+ }
2632
2269
  if (isTTY) {
2633
2270
  const errorMsg = exitCode && exitCode !== 2 ? import_chalk.default.magenta(
2634
2271
  ` The latest update ${import_chalk.default.italic(
@@ -2653,6 +2290,13 @@ Update available for Vercel CLI (${import_chalk.default.gray(
2653
2290
  );
2654
2291
  if (shouldUpgrade) {
2655
2292
  const upgradeExitCode = await executeUpgrade();
2293
+ if (upgradeExitCode === 0 && !hasAutoUpdatePreference(client.config)) {
2294
+ const enableAutoUpdates = await client.input.confirm(
2295
+ "Enable automatic CLI updates for future releases?",
2296
+ false
2297
+ );
2298
+ setAutoUpdate(client, enableAutoUpdates);
2299
+ }
2656
2300
  process.exitCode = upgradeExitCode;
2657
2301
  return;
2658
2302
  }
package/dist/version.mjs CHANGED
@@ -1 +1 @@
1
- export const version = "54.1.0";
1
+ export const version = "54.2.0";