@vltpkg/cli-sdk 1.0.0-rc.2 → 1.0.0-rc.23

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 (174) hide show
  1. package/package.json +66 -83
  2. package/dist/esm/commands/build.d.ts +0 -25
  3. package/dist/esm/commands/build.d.ts.map +0 -1
  4. package/dist/esm/commands/build.js +0 -102
  5. package/dist/esm/commands/build.js.map +0 -1
  6. package/dist/esm/commands/cache.d.ts +0 -65
  7. package/dist/esm/commands/cache.d.ts.map +0 -1
  8. package/dist/esm/commands/cache.js +0 -257
  9. package/dist/esm/commands/cache.js.map +0 -1
  10. package/dist/esm/commands/ci.d.ts +0 -11
  11. package/dist/esm/commands/ci.d.ts.map +0 -1
  12. package/dist/esm/commands/ci.js +0 -32
  13. package/dist/esm/commands/ci.js.map +0 -1
  14. package/dist/esm/commands/config.d.ts +0 -6
  15. package/dist/esm/commands/config.d.ts.map +0 -1
  16. package/dist/esm/commands/config.js +0 -424
  17. package/dist/esm/commands/config.js.map +0 -1
  18. package/dist/esm/commands/docs.d.ts +0 -18
  19. package/dist/esm/commands/docs.d.ts.map +0 -1
  20. package/dist/esm/commands/docs.js +0 -154
  21. package/dist/esm/commands/docs.js.map +0 -1
  22. package/dist/esm/commands/exec-cache.d.ts +0 -49
  23. package/dist/esm/commands/exec-cache.d.ts.map +0 -1
  24. package/dist/esm/commands/exec-cache.js +0 -146
  25. package/dist/esm/commands/exec-cache.js.map +0 -1
  26. package/dist/esm/commands/exec-local.d.ts +0 -6
  27. package/dist/esm/commands/exec-local.d.ts.map +0 -1
  28. package/dist/esm/commands/exec-local.js +0 -24
  29. package/dist/esm/commands/exec-local.js.map +0 -1
  30. package/dist/esm/commands/exec.d.ts +0 -9
  31. package/dist/esm/commands/exec.d.ts.map +0 -1
  32. package/dist/esm/commands/exec.js +0 -87
  33. package/dist/esm/commands/exec.js.map +0 -1
  34. package/dist/esm/commands/help.d.ts +0 -4
  35. package/dist/esm/commands/help.d.ts.map +0 -1
  36. package/dist/esm/commands/help.js +0 -39
  37. package/dist/esm/commands/help.js.map +0 -1
  38. package/dist/esm/commands/init.d.ts +0 -8
  39. package/dist/esm/commands/init.d.ts.map +0 -1
  40. package/dist/esm/commands/init.js +0 -111
  41. package/dist/esm/commands/init.js.map +0 -1
  42. package/dist/esm/commands/install/reporter.d.ts +0 -11
  43. package/dist/esm/commands/install/reporter.d.ts.map +0 -1
  44. package/dist/esm/commands/install/reporter.js +0 -94
  45. package/dist/esm/commands/install/reporter.js.map +0 -1
  46. package/dist/esm/commands/install.d.ts +0 -28
  47. package/dist/esm/commands/install.d.ts.map +0 -1
  48. package/dist/esm/commands/install.js +0 -45
  49. package/dist/esm/commands/install.js.map +0 -1
  50. package/dist/esm/commands/list.d.ts +0 -15
  51. package/dist/esm/commands/list.d.ts.map +0 -1
  52. package/dist/esm/commands/list.js +0 -199
  53. package/dist/esm/commands/list.js.map +0 -1
  54. package/dist/esm/commands/login.d.ts +0 -4
  55. package/dist/esm/commands/login.d.ts.map +0 -1
  56. package/dist/esm/commands/login.js +0 -13
  57. package/dist/esm/commands/login.js.map +0 -1
  58. package/dist/esm/commands/logout.d.ts +0 -4
  59. package/dist/esm/commands/logout.d.ts.map +0 -1
  60. package/dist/esm/commands/logout.js +0 -13
  61. package/dist/esm/commands/logout.js.map +0 -1
  62. package/dist/esm/commands/pack.d.ts +0 -32
  63. package/dist/esm/commands/pack.d.ts.map +0 -1
  64. package/dist/esm/commands/pack.js +0 -147
  65. package/dist/esm/commands/pack.js.map +0 -1
  66. package/dist/esm/commands/pkg.d.ts +0 -7
  67. package/dist/esm/commands/pkg.d.ts.map +0 -1
  68. package/dist/esm/commands/pkg.js +0 -206
  69. package/dist/esm/commands/pkg.js.map +0 -1
  70. package/dist/esm/commands/publish.d.ts +0 -22
  71. package/dist/esm/commands/publish.d.ts.map +0 -1
  72. package/dist/esm/commands/publish.js +0 -245
  73. package/dist/esm/commands/publish.js.map +0 -1
  74. package/dist/esm/commands/query.d.ts +0 -16
  75. package/dist/esm/commands/query.d.ts.map +0 -1
  76. package/dist/esm/commands/query.js +0 -214
  77. package/dist/esm/commands/query.js.map +0 -1
  78. package/dist/esm/commands/run-exec.d.ts +0 -6
  79. package/dist/esm/commands/run-exec.d.ts.map +0 -1
  80. package/dist/esm/commands/run-exec.js +0 -14
  81. package/dist/esm/commands/run-exec.js.map +0 -1
  82. package/dist/esm/commands/run.d.ts +0 -6
  83. package/dist/esm/commands/run.d.ts.map +0 -1
  84. package/dist/esm/commands/run.js +0 -36
  85. package/dist/esm/commands/run.js.map +0 -1
  86. package/dist/esm/commands/serve.d.ts +0 -14
  87. package/dist/esm/commands/serve.d.ts.map +0 -1
  88. package/dist/esm/commands/serve.js +0 -103
  89. package/dist/esm/commands/serve.js.map +0 -1
  90. package/dist/esm/commands/token.d.ts +0 -4
  91. package/dist/esm/commands/token.d.ts.map +0 -1
  92. package/dist/esm/commands/token.js +0 -30
  93. package/dist/esm/commands/token.js.map +0 -1
  94. package/dist/esm/commands/uninstall.d.ts +0 -16
  95. package/dist/esm/commands/uninstall.d.ts.map +0 -1
  96. package/dist/esm/commands/uninstall.js +0 -26
  97. package/dist/esm/commands/uninstall.js.map +0 -1
  98. package/dist/esm/commands/update.d.ts +0 -14
  99. package/dist/esm/commands/update.d.ts.map +0 -1
  100. package/dist/esm/commands/update.js +0 -41
  101. package/dist/esm/commands/update.js.map +0 -1
  102. package/dist/esm/commands/version.d.ts +0 -26
  103. package/dist/esm/commands/version.d.ts.map +0 -1
  104. package/dist/esm/commands/version.js +0 -226
  105. package/dist/esm/commands/version.js.map +0 -1
  106. package/dist/esm/commands/whoami.d.ts +0 -13
  107. package/dist/esm/commands/whoami.d.ts.map +0 -1
  108. package/dist/esm/commands/whoami.js +0 -19
  109. package/dist/esm/commands/whoami.js.map +0 -1
  110. package/dist/esm/config/definition.d.ts +0 -404
  111. package/dist/esm/config/definition.d.ts.map +0 -1
  112. package/dist/esm/config/definition.js +0 -657
  113. package/dist/esm/config/definition.js.map +0 -1
  114. package/dist/esm/config/index.d.ts +0 -219
  115. package/dist/esm/config/index.d.ts.map +0 -1
  116. package/dist/esm/config/index.js +0 -454
  117. package/dist/esm/config/index.js.map +0 -1
  118. package/dist/esm/config/merge.d.ts +0 -4
  119. package/dist/esm/config/merge.d.ts.map +0 -1
  120. package/dist/esm/config/merge.js +0 -28
  121. package/dist/esm/config/merge.js.map +0 -1
  122. package/dist/esm/config/usage.d.ts +0 -19
  123. package/dist/esm/config/usage.d.ts.map +0 -1
  124. package/dist/esm/config/usage.js +0 -40
  125. package/dist/esm/config/usage.js.map +0 -1
  126. package/dist/esm/custom-help.d.ts +0 -9
  127. package/dist/esm/custom-help.d.ts.map +0 -1
  128. package/dist/esm/custom-help.js +0 -400
  129. package/dist/esm/custom-help.js.map +0 -1
  130. package/dist/esm/exec-command.d.ts +0 -53
  131. package/dist/esm/exec-command.d.ts.map +0 -1
  132. package/dist/esm/exec-command.js +0 -308
  133. package/dist/esm/exec-command.js.map +0 -1
  134. package/dist/esm/index.d.ts +0 -4
  135. package/dist/esm/index.d.ts.map +0 -1
  136. package/dist/esm/index.js +0 -73
  137. package/dist/esm/index.js.map +0 -1
  138. package/dist/esm/load-command.d.ts +0 -16
  139. package/dist/esm/load-command.d.ts.map +0 -1
  140. package/dist/esm/load-command.js +0 -21
  141. package/dist/esm/load-command.js.map +0 -1
  142. package/dist/esm/output.d.ts +0 -21
  143. package/dist/esm/output.d.ts.map +0 -1
  144. package/dist/esm/output.js +0 -126
  145. package/dist/esm/output.js.map +0 -1
  146. package/dist/esm/pack-tarball.d.ts +0 -22
  147. package/dist/esm/pack-tarball.d.ts.map +0 -1
  148. package/dist/esm/pack-tarball.js +0 -249
  149. package/dist/esm/pack-tarball.js.map +0 -1
  150. package/dist/esm/package.json +0 -3
  151. package/dist/esm/parse-add-remove-args.d.ts +0 -22
  152. package/dist/esm/parse-add-remove-args.d.ts.map +0 -1
  153. package/dist/esm/parse-add-remove-args.js +0 -71
  154. package/dist/esm/parse-add-remove-args.js.map +0 -1
  155. package/dist/esm/print-err.d.ts +0 -14
  156. package/dist/esm/print-err.d.ts.map +0 -1
  157. package/dist/esm/print-err.js +0 -178
  158. package/dist/esm/print-err.js.map +0 -1
  159. package/dist/esm/query-host-contexts.d.ts +0 -16
  160. package/dist/esm/query-host-contexts.d.ts.map +0 -1
  161. package/dist/esm/query-host-contexts.js +0 -135
  162. package/dist/esm/query-host-contexts.js.map +0 -1
  163. package/dist/esm/read-password.d.ts +0 -8
  164. package/dist/esm/read-password.d.ts.map +0 -1
  165. package/dist/esm/read-password.js +0 -33
  166. package/dist/esm/read-password.js.map +0 -1
  167. package/dist/esm/start-gui.d.ts +0 -10
  168. package/dist/esm/start-gui.d.ts.map +0 -1
  169. package/dist/esm/start-gui.js +0 -60
  170. package/dist/esm/start-gui.js.map +0 -1
  171. package/dist/esm/view.d.ts +0 -30
  172. package/dist/esm/view.d.ts.map +0 -1
  173. package/dist/esm/view.js +0 -31
  174. package/dist/esm/view.js.map +0 -1
@@ -1,94 +0,0 @@
1
- import { emitter } from '@vltpkg/output';
2
- import { Box, render, Text } from 'ink';
3
- import Spinner from 'ink-spinner';
4
- import { createElement as $, Fragment, useEffect, useState, } from 'react';
5
- import { ViewClass } from "../../view.js";
6
- import { asError } from '@vltpkg/types';
7
- const labels = {
8
- build: 'resolving dependencies',
9
- actual: '',
10
- reify: 'extracting files',
11
- };
12
- const GraphStep = ({ text, step }) => {
13
- if (step.state === 'waiting') {
14
- return $(Text, { color: 'gray' }, text);
15
- }
16
- if (step.state === 'in_progress') {
17
- return $(Text, { color: 'yellow' }, text + ' ', $(Spinner, { type: 'dots' }));
18
- }
19
- return $(Text, { color: 'green' }, text, ' ✓');
20
- };
21
- const App = ({ trailer }) => {
22
- const [requests, setRequests] = useState(0);
23
- const [cacheHit, setCacheHit] = useState(0);
24
- const [steps, setSteps] = useState({
25
- build: {
26
- state: 'waiting',
27
- },
28
- actual: {
29
- state: 'waiting',
30
- },
31
- reify: {
32
- state: 'waiting',
33
- },
34
- });
35
- useEffect(() => {
36
- const updateRequests = ({ state }) => {
37
- if (state === 'start') {
38
- setRequests(p => p + 1);
39
- }
40
- else if (state === 'cache' || state === 'stale') {
41
- setCacheHit(p => p + 1);
42
- }
43
- };
44
- emitter.on('request', updateRequests);
45
- return () => emitter.off('request', updateRequests);
46
- }, []);
47
- useEffect(() => {
48
- const update = ({ step, state }) => {
49
- setSteps(p => ({
50
- ...p,
51
- [step]: {
52
- ...p[step],
53
- state: state === 'start' ? 'in_progress' : 'completed',
54
- },
55
- }));
56
- };
57
- emitter.on('graphStep', update);
58
- return () => emitter.off('graphStep', update);
59
- }, []);
60
- return $(Fragment, null, $(Box, null, ...['build', 'actual', 'reify'].map((step, idx, list) => {
61
- const separator = idx === list.length - 1 ? '' : ' > ';
62
- const label = labels[step];
63
- if (!label)
64
- return null;
65
- return $(Text, { key: step }, $(GraphStep, { text: label, step: steps[step] }), $(Text, { color: 'gray' }, separator));
66
- })), cacheHit > 0 ?
67
- $(Text, null, `${cacheHit} cache hit${cacheHit > 1 ? 's' : ''}`)
68
- : null, requests > 0 ?
69
- $(Text, null, `${requests} request${requests > 1 ? 's' : ''}`)
70
- : null, trailer ? $(Text, null, trailer) : null);
71
- };
72
- export class InstallReporter extends ViewClass {
73
- #instance = null;
74
- start() {
75
- this.#instance = render($(App));
76
- }
77
- async done(_result, { time }) {
78
- let out = `Done in ${time}ms`;
79
- // prints a very complete message explaining users the next steps
80
- // in case there are packages to be built
81
- if (_result.buildQueue?.length) {
82
- out += `\n\n📦 ${_result.buildQueue.length} packages have install scripts defined & were not fully built\n`;
83
- out += '🔎 Run `vlt query :scripts` to list them\n';
84
- out +=
85
- '🔨 Run `vlt build` to run all required scripts to build installed packages.\n';
86
- }
87
- this.#instance?.rerender($(App, { trailer: out }));
88
- return undefined;
89
- }
90
- error(err) {
91
- this.#instance?.unmount(asError(err));
92
- }
93
- }
94
- //# sourceMappingURL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,QAAQ,WAAW,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAChE,CAAC,CAAC,IAAI,EACN,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CACxC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,SAAS,GAAoB,IAAI,CAAA;IAEjC,KAAK;QACH,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IACjC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAsB,EAAE,EAAE,IAAI,EAAoB;QAC3D,IAAI,GAAG,GAAG,WAAW,IAAI,IAAI,CAAA;QAE7B,iEAAiE;QACjE,yCAAyC;QACzC,IAAI,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;YAC/B,GAAG,IAAI,UAAU,OAAO,CAAC,UAAU,CAAC,MAAM,iEAAiE,CAAA;YAC3G,GAAG,IAAI,4CAA4C,CAAA;YACnD,GAAG;gBACD,+EAA+E,CAAA;QACnF,CAAC;QACD,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;QAClD,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,GAAY;QAChB,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IACvC,CAAC;CACF","sourcesContent":["import { emitter } from '@vltpkg/output'\nimport type { Events } from '@vltpkg/output'\nimport { Box, render, Text } from 'ink'\nimport type { Instance } from 'ink'\nimport Spinner from 'ink-spinner'\nimport {\n createElement as $,\n Fragment,\n useEffect,\n useState,\n} from 'react'\nimport { ViewClass } from '../../view.ts'\nimport { asError } from '@vltpkg/types'\nimport type { InstallResult } from '../install.ts'\n\ntype Step = {\n state: 'waiting' | 'in_progress' | 'completed'\n}\n\nconst labels: Record<Events['graphStep']['step'], string> = {\n build: 'resolving dependencies',\n actual: '',\n reify: 'extracting files',\n}\n\nconst GraphStep = ({ text, step }: { text: string; step: Step }) => {\n if (step.state === 'waiting') {\n return $(Text, { color: 'gray' }, text)\n }\n if (step.state === 'in_progress') {\n return $(\n Text,\n { color: 'yellow' },\n text + ' ',\n $(Spinner, { type: 'dots' }),\n )\n }\n return $(Text, { color: 'green' }, text, ' ✓')\n}\n\nconst App = ({ trailer }: { trailer?: string }) => {\n const [requests, setRequests] = useState(0)\n const [cacheHit, setCacheHit] = useState(0)\n\n const [steps, setSteps] = useState<\n Record<Events['graphStep']['step'], Step>\n >({\n build: {\n state: 'waiting',\n },\n actual: {\n state: 'waiting',\n },\n reify: {\n state: 'waiting',\n },\n })\n\n useEffect(() => {\n const updateRequests = ({ state }: Events['request']) => {\n if (state === 'start') {\n setRequests(p => p + 1)\n } else if (state === 'cache' || state === 'stale') {\n setCacheHit(p => p + 1)\n }\n }\n emitter.on('request', updateRequests)\n return () => emitter.off('request', updateRequests)\n }, [])\n\n useEffect(() => {\n const update = ({ step, state }: Events['graphStep']) => {\n setSteps(p => ({\n ...p,\n [step]: {\n ...p[step],\n state: state === 'start' ? 'in_progress' : 'completed',\n },\n }))\n }\n emitter.on('graphStep', update)\n return () => emitter.off('graphStep', update)\n }, [])\n\n return $(\n Fragment,\n null,\n $(\n Box,\n null,\n ...(['build', 'actual', 'reify'] as const).map(\n (step, idx, list) => {\n const separator = idx === list.length - 1 ? '' : ' > '\n const label = labels[step]\n if (!label) return null\n return $(\n Text,\n { key: step },\n $(GraphStep, { text: label, step: steps[step] }),\n $(Text, { color: 'gray' }, separator),\n )\n },\n ),\n ),\n cacheHit > 0 ?\n $(Text, null, `${cacheHit} cache hit${cacheHit > 1 ? 's' : ''}`)\n : null,\n requests > 0 ?\n $(Text, null, `${requests} request${requests > 1 ? 's' : ''}`)\n : null,\n trailer ? $(Text, null, trailer) : null,\n )\n}\n\nexport class InstallReporter extends ViewClass {\n #instance: Instance | null = null\n\n start() {\n this.#instance = render($(App))\n }\n\n async done(_result: InstallResult, { time }: { time: number }) {\n let out = `Done in ${time}ms`\n\n // prints a very complete message explaining users the next steps\n // in case there are packages to be built\n if (_result.buildQueue?.length) {\n out += `\\n\\n📦 ${_result.buildQueue.length} packages have install scripts defined & were not fully built\\n`\n out += '🔎 Run `vlt query :scripts` to list them\\n'\n out +=\n '🔨 Run `vlt build` to run all required scripts to build installed packages.\\n'\n }\n this.#instance?.rerender($(App, { trailer: out }))\n return undefined\n }\n\n error(err: unknown) {\n this.#instance?.unmount(asError(err))\n }\n}\n"]}
@@ -1,28 +0,0 @@
1
- import { InstallReporter } from './install/reporter.ts';
2
- import type { DepID } from '@vltpkg/dep-id';
3
- import type { Graph } from '@vltpkg/graph';
4
- import type { CommandFn, CommandUsage } from '../index.ts';
5
- /**
6
- * The resulting object of an install operation. To be used by the view impl.
7
- */
8
- export type InstallResult = {
9
- /**
10
- * A queue of package IDs that need to be built after the install is complete.
11
- */
12
- buildQueue?: DepID[];
13
- /**
14
- * The resulting graph structure at the end of an install.
15
- */
16
- graph: Graph;
17
- };
18
- export declare const usage: CommandUsage;
19
- export declare const views: {
20
- readonly json: (i: InstallResult) => {
21
- graph: import("@vltpkg/graph").LockfileData;
22
- buildQueue?: DepID[] | undefined;
23
- message?: string | undefined;
24
- };
25
- readonly human: typeof InstallReporter;
26
- };
27
- export declare const command: CommandFn<InstallResult>;
28
- //# sourceMappingURL=install.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/commands/install.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG1D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,EAAE,CAAA;IACpB;;OAEG;IACH,KAAK,EAAE,KAAK,CAAA;CACb,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,YAMhB,CAAA;AAEJ,eAAO,MAAM,KAAK;;;;;;;CAWuB,CAAA;AAEzC,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,aAAa,CAyB5C,CAAA"}
@@ -1,45 +0,0 @@
1
- import { commandUsage } from "../config/usage.js";
2
- import { install } from '@vltpkg/graph';
3
- import { parseAddArgs } from "../parse-add-remove-args.js";
4
- import { InstallReporter } from "./install/reporter.js";
5
- export const usage = () => commandUsage({
6
- command: 'install',
7
- usage: '[packages ...]',
8
- description: `Install the specified packages, updating package.json and
9
- vlt-lock.json appropriately.`,
10
- });
11
- export const views = {
12
- json: i => ({
13
- ...(i.buildQueue?.length ?
14
- {
15
- buildQueue: i.buildQueue,
16
- message: `${i.buildQueue.length} packages that will need to be built, run "vlt build" to complete the install.`,
17
- }
18
- : null),
19
- graph: i.graph.toJSON(),
20
- }),
21
- human: InstallReporter,
22
- };
23
- export const command = async (conf) => {
24
- // TODO: we should probably throw an error if the user
25
- // tries to install using either view=mermaid or view=gui
26
- const monorepo = conf.options.monorepo;
27
- const { add } = parseAddArgs(conf, monorepo);
28
- const frozenLockfile = conf.options['frozen-lockfile'];
29
- const expectLockfile = conf.options['expect-lockfile'];
30
- const lockfileOnly = conf.options['lockfile-only'];
31
- /* c8 ignore start */
32
- const allowScripts = conf.get('allow-scripts') ?
33
- String(conf.get('allow-scripts'))
34
- : ':not(*)';
35
- /* c8 ignore stop */
36
- const { buildQueue, graph } = await install({
37
- ...conf.options,
38
- frozenLockfile,
39
- expectLockfile,
40
- allowScripts,
41
- lockfileOnly,
42
- }, add);
43
- return { buildQueue, graph };
44
- };
45
- //# sourceMappingURL=install.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAoBvD,MAAM,CAAC,MAAM,KAAK,GAAiB,GAAG,EAAE,CACtC,YAAY,CAAC;IACX,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE;+CAC8B;CAC5C,CAAC,CAAA;AAEJ,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACV,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YACxB;gBACE,UAAU,EAAE,CAAC,CAAC,UAAU;gBACxB,OAAO,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,MAAM,gFAAgF;aAChH;YACH,CAAC,CAAC,IAAI,CAAC;QACP,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;KACxB,CAAC;IACF,KAAK,EAAE,eAAe;CACiB,CAAA;AAEzC,MAAM,CAAC,MAAM,OAAO,GAA6B,KAAK,EAAC,IAAI,EAAC,EAAE;IAC5D,sDAAsD;IACtD,yDAAyD;IACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAA;IACtC,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC5C,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;IACtD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;IACtD,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;IAClD,qBAAqB;IACrB,MAAM,YAAY,GAChB,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QACnC,CAAC,CAAC,SAAS,CAAA;IACb,oBAAoB;IACpB,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,MAAM,OAAO,CACzC;QACE,GAAG,IAAI,CAAC,OAAO;QACf,cAAc;QACd,cAAc;QACd,YAAY;QACZ,YAAY;KACb,EACD,GAAG,CACJ,CAAA;IACD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA;AAC9B,CAAC,CAAA","sourcesContent":["import { commandUsage } from '../config/usage.ts'\nimport { install } from '@vltpkg/graph'\nimport { parseAddArgs } from '../parse-add-remove-args.ts'\nimport { InstallReporter } from './install/reporter.ts'\nimport type { DepID } from '@vltpkg/dep-id'\nimport type { Graph } from '@vltpkg/graph'\nimport type { CommandFn, CommandUsage } from '../index.ts'\nimport type { Views } from '../view.ts'\n\n/**\n * The resulting object of an install operation. To be used by the view impl.\n */\nexport type InstallResult = {\n /**\n * A queue of package IDs that need to be built after the install is complete.\n */\n buildQueue?: DepID[]\n /**\n * The resulting graph structure at the end of an install.\n */\n graph: Graph\n}\n\nexport const usage: CommandUsage = () =>\n commandUsage({\n command: 'install',\n usage: '[packages ...]',\n description: `Install the specified packages, updating package.json and\n vlt-lock.json appropriately.`,\n })\n\nexport const views = {\n json: i => ({\n ...(i.buildQueue?.length ?\n {\n buildQueue: i.buildQueue,\n message: `${i.buildQueue.length} packages that will need to be built, run \"vlt build\" to complete the install.`,\n }\n : null),\n graph: i.graph.toJSON(),\n }),\n human: InstallReporter,\n} as const satisfies Views<InstallResult>\n\nexport const command: CommandFn<InstallResult> = async conf => {\n // TODO: we should probably throw an error if the user\n // tries to install using either view=mermaid or view=gui\n const monorepo = conf.options.monorepo\n const { add } = parseAddArgs(conf, monorepo)\n const frozenLockfile = conf.options['frozen-lockfile']\n const expectLockfile = conf.options['expect-lockfile']\n const lockfileOnly = conf.options['lockfile-only']\n /* c8 ignore start */\n const allowScripts =\n conf.get('allow-scripts') ?\n String(conf.get('allow-scripts'))\n : ':not(*)'\n /* c8 ignore stop */\n const { buildQueue, graph } = await install(\n {\n ...conf.options,\n frozenLockfile,\n expectLockfile,\n allowScripts,\n lockfileOnly,\n },\n add,\n )\n return { buildQueue, graph }\n}\n"]}
@@ -1,15 +0,0 @@
1
- import { humanReadableOutput, jsonOutput, mermaidOutput } from '@vltpkg/graph';
2
- import type { HumanReadableOutputGraph, JSONOutputGraph, MermaidOutputGraph } from '@vltpkg/graph';
3
- import type { CommandFn, CommandUsage } from '../index.ts';
4
- export declare const usage: CommandUsage;
5
- export type ListResult = JSONOutputGraph & MermaidOutputGraph & HumanReadableOutputGraph & {
6
- queryString: string;
7
- };
8
- export declare const views: {
9
- readonly json: typeof jsonOutput;
10
- readonly mermaid: typeof mermaidOutput;
11
- readonly human: typeof humanReadableOutput;
12
- readonly gui: ({ queryString }: ListResult, _: import("../view.ts").ViewOptions, conf: import("../config/index.ts").ParsedConfig) => Promise<void>;
13
- };
14
- export declare const command: CommandFn<ListResult>;
15
- //# sourceMappingURL=list.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,mBAAmB,EACnB,UAAU,EACV,aAAa,EAEd,MAAM,eAAe,CAAA;AAQtB,OAAO,KAAK,EACV,wBAAwB,EACxB,eAAe,EACf,kBAAkB,EAGnB,MAAM,eAAe,CAAA;AAGtB,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG1D,eAAO,MAAM,KAAK,EAAE,YAyDhB,CAAA;AAEJ,MAAM,MAAM,UAAU,GAAG,eAAe,GACtC,kBAAkB,GAClB,wBAAwB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpD,eAAO,MAAM,KAAK;;;;;CAUoB,CAAA;AAEtC,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,UAAU,CA+JzC,CAAA"}
@@ -1,199 +0,0 @@
1
- import { actual, asNode, humanReadableOutput, jsonOutput, mermaidOutput, GraphModifier, } from '@vltpkg/graph';
2
- import LZString from 'lz-string';
3
- import { Query } from '@vltpkg/query';
4
- import { SecurityArchive } from '@vltpkg/security-archive';
5
- import { error } from '@vltpkg/error-cause';
6
- import { commandUsage } from "../config/usage.js";
7
- import { startGUI } from "../start-gui.js";
8
- import { createHostContextsMap } from "../query-host-contexts.js";
9
- export const usage = () => commandUsage({
10
- command: 'ls',
11
- usage: [
12
- '',
13
- '[package-names...] [--view=human | json | mermaid | gui]',
14
- '[--scope=<query>] [--target=<query>] [--view=human | json | mermaid | gui]',
15
- ],
16
- description: `List installed dependencies matching given package names or query selectors.
17
-
18
- Package names provided as positional arguments will be used to filter
19
- the results to show only dependencies with those names.
20
-
21
- The --scope and --target options accepts DSS query selectors to filter
22
- packages. Using --scope, you can specify which packages to treat as the
23
- top-level items in the output graph. The --target option allows you to
24
- filter what dependencies to include in the output. Using both options
25
- allows you to render subgraphs of the dependency graph.
26
-
27
- Defaults to listing direct dependencies of a project and any configured
28
- workspace.`,
29
- examples: {
30
- '': {
31
- description: 'List direct dependencies of the current project / workspace',
32
- },
33
- 'foo bar baz': {
34
- description: `List all dependencies named 'foo', 'bar', or 'baz'`,
35
- },
36
- '--scope=":root > #dependency-name"': {
37
- description: 'Defines a direct dependency as the output top-level scope',
38
- },
39
- '--target="*"': {
40
- description: 'List all dependencies using a query selector',
41
- },
42
- '--target=":workspace > *:peer"': {
43
- description: 'List all peer dependencies of all workspaces',
44
- },
45
- },
46
- options: {
47
- scope: {
48
- value: '<query>',
49
- description: 'Query selector to select top-level packages using the DSS query language syntax.',
50
- },
51
- target: {
52
- value: '<query>',
53
- description: 'Query selector to filter packages using the DSS query language syntax.',
54
- },
55
- view: {
56
- value: '[human | json | mermaid | gui]',
57
- description: 'Output format. Defaults to human-readable or json if no tty.',
58
- },
59
- },
60
- });
61
- export const views = {
62
- json: jsonOutput,
63
- mermaid: mermaidOutput,
64
- human: humanReadableOutput,
65
- gui: async ({ queryString }, _, conf) => {
66
- await startGUI(conf, `/explore/${LZString.compressToEncodedURIComponent(queryString)}/overview`);
67
- },
68
- };
69
- export const command = async (conf) => {
70
- const modifiers = GraphModifier.maybeLoad(conf.options);
71
- const monorepo = conf.options.monorepo;
72
- const mainManifest = conf.options.packageJson.maybeRead(conf.options.projectRoot);
73
- let graph;
74
- let securityArchive;
75
- // optionally load the cwd graph if we found a package.json file
76
- if (mainManifest) {
77
- graph = actual.load({
78
- ...conf.options,
79
- mainManifest,
80
- modifiers,
81
- monorepo,
82
- loadManifests: true,
83
- });
84
- securityArchive = await SecurityArchive.start({
85
- nodes: [...graph.nodes.values()],
86
- });
87
- }
88
- // Validate positional arguments - only allow package names, not direct queries
89
- for (const arg of conf.positionals) {
90
- if (!/^[@\w-]/.test(arg)) {
91
- throw error(`Direct queries are not supported as positional arguments. Use package names only.`, {
92
- code: 'EUSAGE',
93
- cause: `Argument '${arg}' appears to be a query syntax. Only package names are allowed as positional arguments.`,
94
- });
95
- }
96
- }
97
- // retrieve default values and set up host contexts
98
- const positionalQueryString = conf.positionals
99
- .map(k => `#${k.replace(/\//, '\\/')}`)
100
- .join(', ');
101
- const targetQueryString = conf.get('target');
102
- const scopeQueryString = conf.get('scope');
103
- const queryString = targetQueryString || positionalQueryString;
104
- const projectQueryString = ':workspace, :project > *';
105
- const selectImporters = [];
106
- const hostContexts = await createHostContextsMap(conf);
107
- const importers = new Set();
108
- const scopeIDs = [];
109
- // handle --scope option to add scope nodes as importers
110
- let scopeNodes;
111
- if (scopeQueryString) {
112
- // run scope query to get all matching nodes
113
- /* c8 ignore start */
114
- const edges = graph?.edges ?? new Set();
115
- const nodes = graph?.nodes ?
116
- new Set(graph.nodes.values())
117
- : new Set();
118
- const importers = graph?.importers ?? new Set();
119
- /* c8 ignore stop */
120
- const scopeQuery = new Query({
121
- nodes,
122
- edges,
123
- importers,
124
- securityArchive,
125
- hostContexts,
126
- });
127
- const { nodes: resultNodes } = await scopeQuery.search(scopeQueryString, {
128
- signal: new AbortController().signal,
129
- });
130
- scopeNodes = resultNodes;
131
- }
132
- if (scopeQueryString && scopeNodes) {
133
- // Add all scope nodes to importers Set (treat them as top-level items)
134
- for (const queryNode of scopeNodes) {
135
- importers.add(asNode(queryNode));
136
- }
137
- }
138
- else if ('workspace' in conf.values) {
139
- // if in a workspace environment, select only the specified
140
- // workspaces as top-level items
141
- if (monorepo && graph) {
142
- for (const workspace of monorepo.filter(conf.values)) {
143
- const w = graph.nodes.get(workspace.id);
144
- if (w) {
145
- importers.add(w);
146
- selectImporters.push(`[name="${w.name}"]`);
147
- selectImporters.push(`[name="${w.name}"] > *`);
148
- scopeIDs.push(workspace.id);
149
- }
150
- }
151
- }
152
- }
153
- // build a default query string to use in the target search
154
- const selectImportersQueryString = selectImporters.join(', ');
155
- const defaultProjectQueryString = (graph &&
156
- selectImporters.length &&
157
- selectImporters.length < graph.importers.size) ?
158
- selectImportersQueryString
159
- : projectQueryString;
160
- const defaultLocalScopeQueryString = ':host(local) :root > *';
161
- // retrieve the selected nodes and edges
162
- /* c8 ignore start */
163
- const edges_ = graph?.edges ?? new Set();
164
- const nodes_ = graph?.nodes ?
165
- new Set(graph.nodes.values())
166
- : new Set();
167
- const importers_ = importers.size === 0 && graph ?
168
- new Set([graph.mainImporter])
169
- : importers;
170
- /* c8 ignore stop */
171
- const q = new Query({
172
- nodes: nodes_,
173
- edges: edges_,
174
- importers: importers_,
175
- securityArchive,
176
- hostContexts,
177
- });
178
- const query = queryString ||
179
- /* c8 ignore next */
180
- (graph ? defaultProjectQueryString : defaultLocalScopeQueryString);
181
- const { edges, nodes, importers: queryResultImporters, } = await q.search(query, {
182
- signal: new AbortController().signal,
183
- scopeIDs: scopeIDs.length > 0 ? scopeIDs : undefined,
184
- });
185
- return {
186
- importers: importers.size === 0 ?
187
- new Set(queryResultImporters)
188
- : importers,
189
- edges,
190
- nodes,
191
- highlightSelection: !!(targetQueryString || positionalQueryString),
192
- queryString: queryString ||
193
- (graph ?
194
- /* c8 ignore next 2 */
195
- defaultProjectQueryString
196
- : defaultLocalScopeQueryString),
197
- };
198
- };
199
- //# sourceMappingURL=list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,MAAM,EACN,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,aAAa,GACd,MAAM,eAAe,CAAA;AACtB,OAAO,QAAQ,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAajE,MAAM,CAAC,MAAM,KAAK,GAAiB,GAAG,EAAE,CACtC,YAAY,CAAC;IACX,OAAO,EAAE,IAAI;IACb,KAAK,EAAE;QACL,EAAE;QACF,0DAA0D;QAC1D,4EAA4E;KAC7E;IACD,WAAW,EAAE;;;;;;;;;;;;iBAYA;IACb,QAAQ,EAAE;QACR,EAAE,EAAE;YACF,WAAW,EACT,6DAA6D;SAChE;QACD,aAAa,EAAE;YACb,WAAW,EAAE,oDAAoD;SAClE;QACD,oCAAoC,EAAE;YACpC,WAAW,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4B,CAAC,CAAA;IACpE,MAAM,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EAAE,oBAAoB,GAChC,GAAG,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE;QACxB,MAAM,EAAE,IAAI,eAAe,EAAE,CAAC,MAAM;QACpC,QAAQ,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;KACrD,CAAC,CAAA;IAEF,OAAO;QACL,SAAS,EACP,SAAS,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;YACpB,IAAI,GAAG,CAAC,oBAAoB,CAAC;YAC/B,CAAC,CAAC,SAAS;QACb,KAAK;QACL,KAAK;QACL,kBAAkB,EAAE,CAAC,CAAC,CACpB,iBAAiB,IAAI,qBAAqB,CAC3C;QACD,WAAW,EACT,WAAW;YACX,CAAC,KAAK,CAAC,CAAC;gBACN,sBAAsB;gBACtB,yBAAyB;gBAC3B,CAAC,CAAC,4BAA4B,CAAC;KAClC,CAAA;AACH,CAAC,CAAA","sourcesContent":["import {\n actual,\n asNode,\n humanReadableOutput,\n jsonOutput,\n mermaidOutput,\n GraphModifier,\n} from '@vltpkg/graph'\nimport LZString from 'lz-string'\nimport { Query } from '@vltpkg/query'\nimport { SecurityArchive } from '@vltpkg/security-archive'\nimport { error } from '@vltpkg/error-cause'\nimport { commandUsage } from '../config/usage.ts'\nimport { startGUI } from '../start-gui.ts'\nimport { createHostContextsMap } from '../query-host-contexts.ts'\nimport type {\n HumanReadableOutputGraph,\n JSONOutputGraph,\n MermaidOutputGraph,\n Node,\n Graph,\n} from '@vltpkg/graph'\nimport type { DepID } from '@vltpkg/dep-id'\nimport type { NodeLike } from '@vltpkg/types'\nimport type { CommandFn, CommandUsage } from '../index.ts'\nimport type { Views } from '../view.ts'\n\nexport const usage: CommandUsage = () =>\n commandUsage({\n command: 'ls',\n usage: [\n '',\n '[package-names...] [--view=human | json | mermaid | gui]',\n '[--scope=<query>] [--target=<query>] [--view=human | json | mermaid | gui]',\n ],\n description: `List installed dependencies matching given package names or query selectors.\n\n Package names provided as positional arguments will be used to filter\n the results to show only dependencies with those names.\n\n The --scope and --target options accepts DSS query selectors to filter\n packages. Using --scope, you can specify which packages to treat as the\n top-level items in the output graph. The --target option allows you to\n filter what dependencies to include in the output. Using both options\n allows you to render subgraphs of the dependency graph.\n\n Defaults to listing direct dependencies of a project and any configured\n workspace.`,\n examples: {\n '': {\n description:\n 'List direct dependencies of the current project / workspace',\n },\n 'foo bar baz': {\n description: `List all dependencies named 'foo', 'bar', or 'baz'`,\n },\n '--scope=\":root > #dependency-name\"': {\n description:\n 'Defines a direct dependency as the output top-level scope',\n },\n '--target=\"*\"': {\n description: 'List all dependencies using a query selector',\n },\n '--target=\":workspace > *:peer\"': {\n description: 'List all peer dependencies of all workspaces',\n },\n },\n options: {\n scope: {\n value: '<query>',\n description:\n 'Query selector to select top-level packages using the DSS query language syntax.',\n },\n target: {\n value: '<query>',\n description:\n 'Query selector to filter packages using the DSS query language syntax.',\n },\n view: {\n value: '[human | json | mermaid | gui]',\n description:\n 'Output format. Defaults to human-readable or json if no tty.',\n },\n },\n })\n\nexport type ListResult = JSONOutputGraph &\n MermaidOutputGraph &\n HumanReadableOutputGraph & { queryString: string }\n\nexport const views = {\n json: jsonOutput,\n mermaid: mermaidOutput,\n human: humanReadableOutput,\n gui: async ({ queryString }, _, conf) => {\n await startGUI(\n conf,\n `/explore/${LZString.compressToEncodedURIComponent(queryString)}/overview`,\n )\n },\n} as const satisfies Views<ListResult>\n\nexport const command: CommandFn<ListResult> = async conf => {\n const modifiers = GraphModifier.maybeLoad(conf.options)\n const monorepo = conf.options.monorepo\n const mainManifest = conf.options.packageJson.maybeRead(\n conf.options.projectRoot,\n )\n let graph: Graph | undefined\n let securityArchive: SecurityArchive | undefined\n\n // optionally load the cwd graph if we found a package.json file\n if (mainManifest) {\n graph = actual.load({\n ...conf.options,\n mainManifest,\n modifiers,\n monorepo,\n loadManifests: true,\n })\n securityArchive = await SecurityArchive.start({\n nodes: [...graph.nodes.values()],\n })\n }\n\n // Validate positional arguments - only allow package names, not direct queries\n for (const arg of conf.positionals) {\n if (!/^[@\\w-]/.test(arg)) {\n throw error(\n `Direct queries are not supported as positional arguments. Use package names only.`,\n {\n code: 'EUSAGE',\n cause: `Argument '${arg}' appears to be a query syntax. Only package names are allowed as positional arguments.`,\n },\n )\n }\n }\n\n // retrieve default values and set up host contexts\n const positionalQueryString = conf.positionals\n .map(k => `#${k.replace(/\\//, '\\\\/')}`)\n .join(', ')\n const targetQueryString = conf.get('target')\n const scopeQueryString = conf.get('scope')\n const queryString = targetQueryString || positionalQueryString\n const projectQueryString = ':workspace, :project > *'\n const selectImporters: string[] = []\n const hostContexts = await createHostContextsMap(conf)\n const importers = new Set<Node>()\n const scopeIDs: DepID[] = []\n\n // handle --scope option to add scope nodes as importers\n let scopeNodes\n if (scopeQueryString) {\n // run scope query to get all matching nodes\n /* c8 ignore start */\n const edges = graph?.edges ?? new Set()\n const nodes =\n graph?.nodes ?\n new Set<NodeLike>(graph.nodes.values())\n : new Set<NodeLike>()\n const importers = graph?.importers ?? new Set()\n /* c8 ignore stop */\n const scopeQuery = new Query({\n nodes,\n edges,\n importers,\n securityArchive,\n hostContexts,\n })\n const { nodes: resultNodes } = await scopeQuery.search(\n scopeQueryString,\n {\n signal: new AbortController().signal,\n },\n )\n scopeNodes = resultNodes\n }\n\n if (scopeQueryString && scopeNodes) {\n // Add all scope nodes to importers Set (treat them as top-level items)\n for (const queryNode of scopeNodes) {\n importers.add(asNode(queryNode))\n }\n } else if ('workspace' in conf.values) {\n // if in a workspace environment, select only the specified\n // workspaces as top-level items\n if (monorepo && graph) {\n for (const workspace of monorepo.filter(conf.values)) {\n const w: Node | undefined = graph.nodes.get(workspace.id)\n if (w) {\n importers.add(w)\n selectImporters.push(`[name=\"${w.name}\"]`)\n selectImporters.push(`[name=\"${w.name}\"] > *`)\n scopeIDs.push(workspace.id)\n }\n }\n }\n }\n\n // build a default query string to use in the target search\n const selectImportersQueryString = selectImporters.join(', ')\n const defaultProjectQueryString =\n (\n graph &&\n selectImporters.length &&\n selectImporters.length < graph.importers.size\n ) ?\n selectImportersQueryString\n : projectQueryString\n const defaultLocalScopeQueryString = ':host(local) :root > *'\n\n // retrieve the selected nodes and edges\n /* c8 ignore start */\n const edges_ = graph?.edges ?? new Set()\n const nodes_ =\n graph?.nodes ?\n new Set<NodeLike>(graph.nodes.values())\n : new Set<NodeLike>()\n const importers_ =\n importers.size === 0 && graph ?\n new Set([graph.mainImporter])\n : importers\n /* c8 ignore stop */\n const q = new Query({\n nodes: nodes_,\n edges: edges_,\n importers: importers_,\n securityArchive,\n hostContexts,\n })\n const query =\n queryString ||\n /* c8 ignore next */\n (graph ? defaultProjectQueryString : defaultLocalScopeQueryString)\n const {\n edges,\n nodes,\n importers: queryResultImporters,\n } = await q.search(query, {\n signal: new AbortController().signal,\n scopeIDs: scopeIDs.length > 0 ? scopeIDs : undefined,\n })\n\n return {\n importers:\n importers.size === 0 ?\n new Set(queryResultImporters)\n : importers,\n edges,\n nodes,\n highlightSelection: !!(\n targetQueryString || positionalQueryString\n ),\n queryString:\n queryString ||\n (graph ?\n /* c8 ignore next 2 */\n defaultProjectQueryString\n : defaultLocalScopeQueryString),\n }\n}\n"]}
@@ -1,4 +0,0 @@
1
- import type { CommandFn, CommandUsage } from '../index.ts';
2
- export declare const usage: CommandUsage;
3
- export declare const command: CommandFn<void>;
4
- //# sourceMappingURL=login.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/commands/login.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1D,eAAO,MAAM,KAAK,EAAE,YAMhB,CAAA;AAEJ,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,IAAI,CAGnC,CAAA"}
@@ -1,13 +0,0 @@
1
- import { RegistryClient } from '@vltpkg/registry-client';
2
- import { commandUsage } from "../config/usage.js";
3
- export const usage = () => commandUsage({
4
- command: 'login',
5
- usage: [''],
6
- description: `Authenticate against a registry, and store the token in
7
- the appropriate config file for later use.`,
8
- });
9
- export const command = async (conf) => {
10
- const rc = new RegistryClient(conf.options);
11
- await rc.login(conf.options.registry);
12
- };
13
- //# sourceMappingURL=login.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGjD,MAAM,CAAC,MAAM,KAAK,GAAiB,GAAG,EAAE,CACtC,YAAY,CAAC;IACX,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,WAAW,EAAE;6DAC4C;CAC1D,CAAC,CAAA;AAEJ,MAAM,CAAC,MAAM,OAAO,GAAoB,KAAK,EAAC,IAAI,EAAC,EAAE;IACnD,MAAM,EAAE,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;AACvC,CAAC,CAAA","sourcesContent":["import { RegistryClient } from '@vltpkg/registry-client'\nimport { commandUsage } from '../config/usage.ts'\nimport type { CommandFn, CommandUsage } from '../index.ts'\n\nexport const usage: CommandUsage = () =>\n commandUsage({\n command: 'login',\n usage: [''],\n description: `Authenticate against a registry, and store the token in\n the appropriate config file for later use.`,\n })\n\nexport const command: CommandFn<void> = async conf => {\n const rc = new RegistryClient(conf.options)\n await rc.login(conf.options.registry)\n}\n"]}
@@ -1,4 +0,0 @@
1
- import type { CommandFn, CommandUsage } from '../index.ts';
2
- export declare const usage: CommandUsage;
3
- export declare const command: CommandFn<void>;
4
- //# sourceMappingURL=logout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../src/commands/logout.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1D,eAAO,MAAM,KAAK,EAAE,YAMhB,CAAA;AAEJ,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,IAAI,CAGnC,CAAA"}
@@ -1,13 +0,0 @@
1
- import { RegistryClient } from '@vltpkg/registry-client';
2
- import { commandUsage } from "../config/usage.js";
3
- export const usage = () => commandUsage({
4
- command: 'logout',
5
- usage: [''],
6
- description: `Log out of the default registry, deleting the token from
7
- the local keychain, as well as destroying it on the server.`,
8
- });
9
- export const command = async (conf) => {
10
- const rc = new RegistryClient(conf.options);
11
- await rc.logout(conf.options.registry);
12
- };
13
- //# sourceMappingURL=logout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../src/commands/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGjD,MAAM,CAAC,MAAM,KAAK,GAAiB,GAAG,EAAE,CACtC,YAAY,CAAC;IACX,OAAO,EAAE,QAAQ;IACjB,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,WAAW,EAAE;8EAC6D;CAC3E,CAAC,CAAA;AAEJ,MAAM,CAAC,MAAM,OAAO,GAAoB,KAAK,EAAC,IAAI,EAAC,EAAE;IACnD,MAAM,EAAE,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;AACxC,CAAC,CAAA","sourcesContent":["import { RegistryClient } from '@vltpkg/registry-client'\nimport { commandUsage } from '../config/usage.ts'\nimport type { CommandFn, CommandUsage } from '../index.ts'\n\nexport const usage: CommandUsage = () =>\n commandUsage({\n command: 'logout',\n usage: [''],\n description: `Log out of the default registry, deleting the token from\n the local keychain, as well as destroying it on the server.`,\n })\n\nexport const command: CommandFn<void> = async conf => {\n const rc = new RegistryClient(conf.options)\n await rc.logout(conf.options.registry)\n}\n"]}
@@ -1,32 +0,0 @@
1
- import type { CommandFn, CommandUsage } from '../index.ts';
2
- import type { LoadedConfig } from '../config/index.ts';
3
- export declare const usage: CommandUsage;
4
- export type CommandResultSingle = {
5
- id: string;
6
- name: string;
7
- version: string;
8
- filename: string;
9
- files: string[];
10
- size: number;
11
- unpackedSize: number;
12
- shasum?: string;
13
- integrity?: string;
14
- };
15
- export type CommandResult = CommandResultSingle | CommandResultSingle[];
16
- export declare const views: {
17
- readonly human: (results: CommandResult) => string;
18
- readonly json: (r: CommandResult) => CommandResult;
19
- };
20
- export declare const command: CommandFn<CommandResult>;
21
- export declare const commandSingle: (location: string, conf: LoadedConfig) => Promise<{
22
- id: string;
23
- name: string;
24
- version: string;
25
- filename: string;
26
- files: string[];
27
- size: number;
28
- unpackedSize: number;
29
- shasum: string | undefined;
30
- integrity: string | undefined;
31
- }>;
32
- //# sourceMappingURL=pack.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../../../src/commands/pack.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAItD,eAAO,MAAM,KAAK,EAAE,YAchB,CAAA;AAEJ,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,aAAa,GACrB,mBAAmB,GACnB,mBAAmB,EAAE,CAAA;AAEzB,eAAO,MAAM,KAAK;;;CAoBuB,CAAA;AAEzC,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC,aAAa,CAiE5C,CAAA;AAED,eAAO,MAAM,aAAa,aACd,MAAM,QACV,YAAY;;;;;;;;;;EA0DnB,CAAA"}