@vltpkg/cli-js 1.0.0-rc.27 → 1.0.0-rc.29

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 (85) hide show
  1. package/access-6HRR4HXE.js +293 -0
  2. package/{bugs-CS34LDPD.js → bugs-2CAZQ32S.js} +19 -22
  3. package/{build-XHEFAWMN.js → build-OAWTNBMS.js} +10 -13
  4. package/{cache-LII2V5IM.js → cache-JTAFST6T.js} +14 -15
  5. package/cache-unzip-src-unzip.js +606 -575
  6. package/{chunk-D27QPHKI.js → chunk-2V4AQPBR.js} +67 -20
  7. package/{chunk-JQHMLTO5.js → chunk-3MWZTKGK.js} +419 -328
  8. package/{chunk-DJBBJDHI.js → chunk-7RZL7BZI.js} +159 -74
  9. package/chunk-7WHVJ56C.js +73 -0
  10. package/{chunk-LAG2R3YJ.js → chunk-BW6C3YUV.js} +6 -6
  11. package/{chunk-6YTJVEK2.js → chunk-CLDF5XLG.js} +11 -11
  12. package/{chunk-DYL7AFY7.js → chunk-CPM47YUH.js} +5 -3
  13. package/{chunk-QWWYZ3TT.js → chunk-D2MVJDUA.js} +1 -1
  14. package/{chunk-5E5GX4G6.js → chunk-FBTBHRPG.js} +1 -1
  15. package/{chunk-AZLX27EM.js → chunk-FXDRM4ZO.js} +296 -258
  16. package/chunk-G2YT2GWF.js +120 -0
  17. package/{chunk-INXSTZAX.js → chunk-HAGUS4HI.js} +21 -21
  18. package/{chunk-FI5TUER7.js → chunk-HQ4US6G3.js} +681 -687
  19. package/chunk-IEISSXS4.js +711 -0
  20. package/{chunk-TRXTSZFT.js → chunk-IYO5QKUW.js} +1 -1
  21. package/{chunk-DJBVQKBB.js → chunk-K3RN3BGU.js} +5 -5
  22. package/{chunk-P2HZ4ISK.js → chunk-LPLXAVG7.js} +54 -6
  23. package/{chunk-XSUIV5NF.js → chunk-M7HPHM7B.js} +14 -12
  24. package/{chunk-BIUCOMBH.js → chunk-MAIQR5GM.js} +5 -5
  25. package/{chunk-TDTJOKF2.js → chunk-NLFBANVO.js} +8 -1
  26. package/{chunk-XWF3GJKE.js → chunk-Q3DNNTPG.js} +27 -1
  27. package/{chunk-VCSVHRCS.js → chunk-R44FR7BY.js} +1269 -590
  28. package/{chunk-QDGZZ5FZ.js → chunk-TYV4N3S3.js} +6 -692
  29. package/{chunk-LKFTVDWS.js → chunk-VPKJNCKL.js} +26 -13
  30. package/{chunk-VTZZIXYW.js → chunk-VRIS5HAW.js} +3 -3
  31. package/{chunk-S5I2UOBT.js → chunk-WX2DCAG2.js} +7 -7
  32. package/{chunk-YR47M5L7.js → chunk-XYCCQT7N.js} +34 -39
  33. package/{chunk-D7U7KDEM.js → chunk-YCQTLBWF.js} +1 -1
  34. package/{chunk-SR66HWMM.js → chunk-ZINDEKAU.js} +144 -93
  35. package/{ci-EEXNEPKP.js → ci-TOJJVHI4.js} +13 -16
  36. package/cli-package.json +2 -1
  37. package/{config-4ZFJD5AY.js → config-DVAPEE5D.js} +12 -14
  38. package/{config-6MUU2TRJ.js → config-GOV4E2KK.js} +26 -26
  39. package/{create-DEKJKPYX.js → create-NGJD7K4L.js} +24 -26
  40. package/deprecate-WROL4AHK.js +176 -0
  41. package/{devtools-NOLON5YL.js → devtools-TPMVKPB5.js} +80 -77
  42. package/dist-tag-WZXXWXMB.js +204 -0
  43. package/{docs-5EKPZANX.js → docs-YCOZFMZG.js} +19 -22
  44. package/{exec-I4YPE6YW.js → exec-URG5OWLH.js} +24 -26
  45. package/{exec-cache-XEWPABLK.js → exec-cache-KHDOEH2F.js} +21 -23
  46. package/{exec-local-OQXG2VPW.js → exec-local-52TVUL5K.js} +19 -21
  47. package/{help-OG655SE5.js → help-LNSDVBGJ.js} +4 -5
  48. package/{init-LJH2YTBM.js → init-XNMWYATA.js} +10 -8
  49. package/{install-KP2FGWOR.js → install-SKUZERZJ.js} +28 -17
  50. package/{list-ACZ3ZSIZ.js → list-XEDVFUD5.js} +19 -21
  51. package/{login-VFTRKZE2.js → login-52SA2DSI.js} +6 -9
  52. package/{logout-Z4AVG64D.js → logout-5YYHNV5W.js} +6 -9
  53. package/{pack-GPJNX7RP.js → pack-B7QZHMYP.js} +14 -17
  54. package/package.json +1 -1
  55. package/{ping-B2YS4SR3.js → ping-PRGDYDRI.js} +6 -9
  56. package/{pkg-WUYJDFSH.js → pkg-UEIQIVVD.js} +15 -19
  57. package/profile-46FKVQEL.js +129 -0
  58. package/{publish-WTMGC4ET.js → publish-HBYHOSKH.js} +17 -20
  59. package/{query-UCM35VVC.js → query-5A4YLS2C.js} +19 -21
  60. package/registry-client-package.json +1 -1
  61. package/registry-client-src-revalidate.js +1157 -1032
  62. package/{repo-MZCPTQZU.js → repo-I6X66PHD.js} +19 -22
  63. package/{reporter-XRZ37LFK.js → reporter-NUXJTV4G.js} +2 -3
  64. package/{run-CAX4Z2SC.js → run-VEZMUMVH.js} +19 -21
  65. package/{run-exec-SM42FE7W.js → run-exec-6ADY4BKH.js} +19 -21
  66. package/security-archive-src-update-expired.js +8 -7
  67. package/{src-SDJWTPCU.js → src-O32QL33R.js} +20 -22
  68. package/token-YK6L74PA.js +206 -0
  69. package/{uninstall-YYPPXM2O.js → uninstall-UBUZBV7E.js} +14 -17
  70. package/unpublish-ZHJEKT7A.js +224 -0
  71. package/{update-YFUTH33A.js → update-WO4BHJF4.js} +13 -16
  72. package/{version-SK256WED.js → version-RLESYHML.js} +13 -16
  73. package/{view-CBYGJ76J.js → view-UA5HXFXG.js} +16 -17
  74. package/vlr.js +1 -1
  75. package/vlrx.js +1 -1
  76. package/vlt.js +1 -1
  77. package/vlx.js +1 -1
  78. package/vlxl.js +1 -1
  79. package/{whoami-ZT4ZEN2C.js → whoami-7H3FPR2O.js} +6 -9
  80. package/chunk-52LBC3AX.js +0 -75
  81. package/chunk-BGQCUUCA.js +0 -667
  82. package/chunk-E74WGW5C.js +0 -49
  83. package/chunk-JLJKOF75.js +0 -40
  84. package/chunk-YP4YNE5Y.js +0 -68
  85. package/token-YCURCCNR.js +0 -103
@@ -12,7 +12,7 @@ var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  isError,
14
14
  isObject
15
- } from "./chunk-XWF3GJKE.js";
15
+ } from "./chunk-Q3DNNTPG.js";
16
16
 
17
17
  // ../../src/output/src/error.ts
18
18
  var parseError = (err) => {
@@ -11,16 +11,16 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  stderr
14
- } from "./chunk-P2HZ4ISK.js";
14
+ } from "./chunk-LPLXAVG7.js";
15
+ import {
16
+ mermaidOutput
17
+ } from "./chunk-7RZL7BZI.js";
15
18
  import {
16
19
  ViewClass
17
20
  } from "./chunk-RXNA2XCX.js";
18
- import {
19
- mermaidOutput
20
- } from "./chunk-DJBBJDHI.js";
21
21
  import {
22
22
  urlOpen
23
- } from "./chunk-D7U7KDEM.js";
23
+ } from "./chunk-YCQTLBWF.js";
24
24
 
25
25
  // ../../src/cli-sdk/src/mermaid-image-view.ts
26
26
  var MermaidImageView = class extends ViewClass {
@@ -9,27 +9,32 @@ globalThis.setInterval = _vlt_setInterval;
9
9
  globalThis.clearInterval = _vlt_clearInterval;
10
10
  import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
+ import {
13
+ flush,
14
+ trackCommand,
15
+ trackError
16
+ } from "./chunk-G2YT2GWF.js";
12
17
  import {
13
18
  generateDefaultHelp,
14
19
  generateFullHelp
15
- } from "./chunk-TDTJOKF2.js";
20
+ } from "./chunk-NLFBANVO.js";
16
21
  import {
17
22
  isViewClass
18
23
  } from "./chunk-RXNA2XCX.js";
19
24
  import {
20
25
  parseError
21
- } from "./chunk-TRXTSZFT.js";
26
+ } from "./chunk-IYO5QKUW.js";
22
27
  import {
23
28
  isGraphRunError,
24
29
  splitDepID
25
- } from "./chunk-QDGZZ5FZ.js";
30
+ } from "./chunk-TYV4N3S3.js";
26
31
  import {
27
32
  defaultView
28
- } from "./chunk-D27QPHKI.js";
33
+ } from "./chunk-2V4AQPBR.js";
29
34
  import {
30
35
  isErrorWithCause,
31
36
  isObject
32
- } from "./chunk-XWF3GJKE.js";
37
+ } from "./chunk-Q3DNNTPG.js";
33
38
  import {
34
39
  XDG
35
40
  } from "./chunk-XNLSTHDK.js";
@@ -377,6 +382,7 @@ var supportsColor = {
377
382
  };
378
383
 
379
384
  // ../../src/cli-sdk/src/output.ts
385
+ var isCI = () => !!(process.env.CI || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI || process.env.CIRCLECI || process.env.JENKINS_URL || process.env.BUILDKITE || process.env.TRAVIS);
380
386
  var supportsColor2 = (stream) => {
381
387
  const res = createSupportsColor(stream, { sniffFlags: false });
382
388
  if (res === false) return false;
@@ -419,7 +425,9 @@ var startView = (conf, opts, views, { start } = { start: Date.now() }) => {
419
425
  }
420
426
  };
421
427
  };
422
- var outputCommand = async (cliCommand, conf, { start } = { start: Date.now() }) => {
428
+ var outputCommand = async (cliCommand, conf, { start, vltVersion } = {
429
+ start: Date.now()
430
+ }) => {
423
431
  const { usage, views, command } = cliCommand;
424
432
  const stdoutColor = conf.values.color ?? supportsColor2(process.stdout);
425
433
  const stderrColor = conf.values.color ?? supportsColor2(process.stderr);
@@ -441,8 +449,24 @@ var outputCommand = async (cliCommand, conf, { start } = { start: Date.now() })
441
449
  views,
442
450
  { start }
443
451
  );
452
+ const telemetryEnabled = conf.values.telemetry;
453
+ const commandName = conf.command;
444
454
  try {
445
455
  const output = await onDone(await command(conf));
456
+ const duration_ms = Date.now() - start;
457
+ trackCommand(
458
+ {
459
+ command: commandName,
460
+ duration_ms,
461
+ success: true,
462
+ node_version: process.version,
463
+ vlt_version: vltVersion ?? "unknown",
464
+ os: process.platform,
465
+ arch: process.arch,
466
+ ci: isCI()
467
+ },
468
+ telemetryEnabled
469
+ );
446
470
  if (output !== void 0 && conf.values.view !== "silent") {
447
471
  stdout(
448
472
  conf.values.view === "json" ? JSON.stringify(output, null, 2) : formatWithOptions2(
@@ -454,9 +478,33 @@ var outputCommand = async (cliCommand, conf, { start } = { start: Date.now() })
454
478
  )
455
479
  );
456
480
  }
481
+ await flush();
457
482
  } catch (err) {
458
483
  onError?.(err);
459
484
  process.exitCode ||= 1;
485
+ const duration_ms = Date.now() - start;
486
+ trackCommand(
487
+ {
488
+ command: commandName,
489
+ duration_ms,
490
+ success: false,
491
+ node_version: process.version,
492
+ vlt_version: vltVersion ?? "unknown",
493
+ os: process.platform,
494
+ arch: process.arch,
495
+ ci: isCI()
496
+ },
497
+ telemetryEnabled
498
+ );
499
+ const errorCode = err instanceof Error && err.cause && typeof err.cause === "object" && "code" in err.cause && typeof err.cause.code === "string" ? err.cause.code : void 0;
500
+ trackError(
501
+ {
502
+ command: commandName,
503
+ error_code: errorCode
504
+ },
505
+ telemetryEnabled
506
+ );
507
+ await flush();
460
508
  printErr(err, usage, stderr, {
461
509
  ...formatOptions,
462
510
  colors: stderrColor
@@ -11,34 +11,36 @@ import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
12
  import {
13
13
  PackageInfoClient
14
- } from "./chunk-INXSTZAX.js";
14
+ } from "./chunk-HAGUS4HI.js";
15
15
  import {
16
16
  Monorepo,
17
17
  PackageJson,
18
18
  PathScurry
19
- } from "./chunk-YR47M5L7.js";
19
+ } from "./chunk-XYCCQT7N.js";
20
20
  import {
21
- getOptions,
22
21
  resetCaches
23
- } from "./chunk-QDGZZ5FZ.js";
22
+ } from "./chunk-TYV4N3S3.js";
23
+ import {
24
+ getOptions
25
+ } from "./chunk-IEISSXS4.js";
26
+ import {
27
+ find,
28
+ load,
29
+ reload,
30
+ save
31
+ } from "./chunk-HTOTG4TS.js";
24
32
  import {
25
33
  commands,
26
34
  definition,
27
35
  getCommand,
28
36
  isRecordField,
29
37
  recordFields
30
- } from "./chunk-D27QPHKI.js";
38
+ } from "./chunk-2V4AQPBR.js";
31
39
  import {
32
40
  assertRecordStringString,
33
41
  assertRecordStringT,
34
42
  isRecordStringString
35
- } from "./chunk-XWF3GJKE.js";
36
- import {
37
- find,
38
- load,
39
- reload,
40
- save
41
- } from "./chunk-HTOTG4TS.js";
43
+ } from "./chunk-Q3DNNTPG.js";
42
44
  import {
43
45
  error
44
46
  } from "./chunk-WZWDS3W4.js";
@@ -9,17 +9,17 @@ globalThis.setInterval = _vlt_setInterval;
9
9
  globalThis.clearInterval = _vlt_clearInterval;
10
10
  import {createRequire as _vlt_createRequire} from "node:module";
11
11
  var require = _vlt_createRequire(import.meta.filename);
12
- import {
13
- loadPackageJson
14
- } from "./chunk-E74WGW5C.js";
15
12
  import {
16
13
  asDepID,
17
14
  baseDepID,
18
15
  splitDepID
19
- } from "./chunk-QDGZZ5FZ.js";
16
+ } from "./chunk-TYV4N3S3.js";
20
17
  import {
21
18
  L
22
- } from "./chunk-VCSVHRCS.js";
19
+ } from "./chunk-R44FR7BY.js";
20
+ import {
21
+ loadPackageJson
22
+ } from "./chunk-2V4AQPBR.js";
23
23
  import {
24
24
  XDG
25
25
  } from "./chunk-XNLSTHDK.js";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-WGDTG44V.js";
15
15
  import {
16
16
  loadPackageJson
17
- } from "./chunk-E74WGW5C.js";
17
+ } from "./chunk-2V4AQPBR.js";
18
18
 
19
19
  // ../../src/cli-sdk/src/custom-help.ts
20
20
  var { version } = loadPackageJson(
@@ -249,6 +249,13 @@ var allCommands = [
249
249
  desc: "Remove dependencies",
250
250
  showByDefault: false
251
251
  },
252
+ {
253
+ name: "unpublish",
254
+ aliases: [],
255
+ args: "<pkg>[@<version>]",
256
+ desc: "Remove a package from the registry",
257
+ showByDefault: false
258
+ },
252
259
  {
253
260
  name: "update",
254
261
  aliases: ["u"],
@@ -1612,6 +1612,29 @@ var satisfiableRange = (tuples) => {
1612
1612
  return true;
1613
1613
  };
1614
1614
 
1615
+ // ../../src/output/src/index.ts
1616
+ import EventEmitter from "node:events";
1617
+ var OutputEmitter = class {
1618
+ emitter = new EventEmitter();
1619
+ emit(eventName, payload) {
1620
+ this.emitter.emit(eventName, payload);
1621
+ }
1622
+ on(eventName, handler) {
1623
+ this.emitter.on(eventName, handler);
1624
+ }
1625
+ off(eventName, handler) {
1626
+ this.emitter.off(eventName, handler);
1627
+ }
1628
+ };
1629
+ var emitter = new OutputEmitter();
1630
+ var logRequest = (url, state) => {
1631
+ emitter.emit("request", { url, state });
1632
+ };
1633
+ var graphStep = (step) => {
1634
+ emitter.emit("graphStep", { step, state: "start" });
1635
+ return () => emitter.emit("graphStep", { step, state: "stop" });
1636
+ };
1637
+
1615
1638
  export {
1616
1639
  fastSplit,
1617
1640
  versionIncrements,
@@ -1648,5 +1671,8 @@ export {
1648
1671
  longDependencyTypes,
1649
1672
  shortDependencyTypes,
1650
1673
  dependencyTypes,
1651
- parseScope
1674
+ parseScope,
1675
+ emitter,
1676
+ logRequest,
1677
+ graphStep
1652
1678
  };