@vltpkg/cli-sdk 1.0.0-rc.22 → 1.0.0-rc.24

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 (103) hide show
  1. package/dist/commands/bugs.d.ts +17 -0
  2. package/dist/commands/bugs.js +163 -0
  3. package/dist/commands/build.d.ts +24 -0
  4. package/dist/commands/build.js +101 -0
  5. package/dist/commands/cache.d.ts +64 -0
  6. package/dist/commands/cache.js +256 -0
  7. package/dist/commands/ci.d.ts +10 -0
  8. package/dist/commands/ci.js +40 -0
  9. package/dist/commands/config.d.ts +5 -0
  10. package/dist/commands/config.js +429 -0
  11. package/dist/commands/create.d.ts +8 -0
  12. package/dist/commands/create.js +102 -0
  13. package/dist/commands/docs.d.ts +17 -0
  14. package/dist/commands/docs.js +153 -0
  15. package/dist/commands/exec-cache.d.ts +48 -0
  16. package/dist/commands/exec-cache.js +145 -0
  17. package/dist/commands/exec-local.d.ts +5 -0
  18. package/dist/commands/exec-local.js +46 -0
  19. package/dist/commands/exec.d.ts +8 -0
  20. package/dist/commands/exec.js +161 -0
  21. package/dist/commands/help.d.ts +3 -0
  22. package/dist/commands/help.js +43 -0
  23. package/dist/commands/init.d.ts +7 -0
  24. package/dist/commands/init.js +116 -0
  25. package/dist/commands/install/reporter.d.ts +10 -0
  26. package/dist/commands/install/reporter.js +93 -0
  27. package/dist/commands/install.d.ts +27 -0
  28. package/dist/commands/install.js +80 -0
  29. package/dist/commands/list.d.ts +17 -0
  30. package/dist/commands/list.js +197 -0
  31. package/dist/commands/login.d.ts +3 -0
  32. package/dist/commands/login.js +22 -0
  33. package/dist/commands/logout.d.ts +3 -0
  34. package/dist/commands/logout.js +22 -0
  35. package/dist/commands/pack.d.ts +31 -0
  36. package/dist/commands/pack.js +205 -0
  37. package/dist/commands/ping.d.ts +17 -0
  38. package/dist/commands/ping.js +114 -0
  39. package/dist/commands/pkg.d.ts +6 -0
  40. package/dist/commands/pkg.js +232 -0
  41. package/dist/commands/publish.d.ts +21 -0
  42. package/dist/commands/publish.js +282 -0
  43. package/dist/commands/query.d.ts +18 -0
  44. package/dist/commands/query.js +216 -0
  45. package/dist/commands/repo.d.ts +17 -0
  46. package/dist/commands/repo.js +157 -0
  47. package/dist/commands/run-exec.d.ts +5 -0
  48. package/dist/commands/run-exec.js +40 -0
  49. package/dist/commands/run.d.ts +5 -0
  50. package/dist/commands/run.js +62 -0
  51. package/dist/commands/token.d.ts +3 -0
  52. package/dist/commands/token.js +39 -0
  53. package/dist/commands/uninstall.d.ts +15 -0
  54. package/dist/commands/uninstall.js +39 -0
  55. package/dist/commands/update.d.ts +13 -0
  56. package/dist/commands/update.js +46 -0
  57. package/dist/commands/version.d.ts +25 -0
  58. package/dist/commands/version.js +252 -0
  59. package/dist/commands/view.d.ts +22 -0
  60. package/dist/commands/view.js +334 -0
  61. package/dist/commands/whoami.d.ts +12 -0
  62. package/dist/commands/whoami.js +28 -0
  63. package/dist/config/definition.d.ts +407 -0
  64. package/dist/config/definition.js +684 -0
  65. package/dist/config/index.d.ts +218 -0
  66. package/dist/config/index.js +488 -0
  67. package/dist/config/merge.d.ts +3 -0
  68. package/dist/config/merge.js +27 -0
  69. package/dist/config/usage.d.ts +18 -0
  70. package/dist/config/usage.js +39 -0
  71. package/dist/custom-help.d.ts +8 -0
  72. package/dist/custom-help.js +419 -0
  73. package/dist/exec-command.d.ts +52 -0
  74. package/dist/exec-command.js +313 -0
  75. package/dist/index.d.ts +3 -0
  76. package/dist/index.js +72 -0
  77. package/dist/load-command.d.ts +15 -0
  78. package/dist/load-command.js +20 -0
  79. package/dist/mermaid-image-view.d.ts +18 -0
  80. package/dist/mermaid-image-view.js +36 -0
  81. package/dist/output.d.ts +20 -0
  82. package/dist/output.js +125 -0
  83. package/dist/pack-tarball.d.ts +23 -0
  84. package/dist/pack-tarball.js +256 -0
  85. package/dist/parse-add-remove-args.d.ts +28 -0
  86. package/dist/parse-add-remove-args.js +103 -0
  87. package/dist/print-err.d.ts +13 -0
  88. package/dist/print-err.js +193 -0
  89. package/dist/query-diff-files.d.ts +17 -0
  90. package/dist/query-diff-files.js +63 -0
  91. package/dist/query-host-contexts.d.ts +15 -0
  92. package/dist/query-host-contexts.js +136 -0
  93. package/dist/read-password.d.ts +7 -0
  94. package/dist/read-password.js +32 -0
  95. package/dist/read-project-folders.d.ts +17 -0
  96. package/dist/read-project-folders.js +100 -0
  97. package/dist/reload-config.d.ts +2 -0
  98. package/dist/reload-config.js +11 -0
  99. package/dist/render-mermaid.d.ts +22 -0
  100. package/dist/render-mermaid.js +68 -0
  101. package/dist/view.d.ts +29 -0
  102. package/dist/view.js +30 -0
  103. package/package.json +30 -30
@@ -0,0 +1,3 @@
1
+ type MergeableObject = Record<string, unknown>;
2
+ export declare const merge: <T extends MergeableObject>(base: T, add: T) => T;
3
+ export {};
@@ -0,0 +1,27 @@
1
+ /*
2
+ * deep merge 2 objects
3
+ * scalars are overwritten, objects are folded in together
4
+ * if nothing to be added, then return the base object.
5
+ */
6
+ export const merge = (base, add) => Object.fromEntries(Object.entries(base)
7
+ .map(([k, v]) => [
8
+ k,
9
+ add[k] === undefined ? v
10
+ : Array.isArray(v) && Array.isArray(add[k]) ?
11
+ [
12
+ ...new Set([
13
+ ...v,
14
+ ...add[k],
15
+ ]),
16
+ ]
17
+ : Array.isArray(v) || Array.isArray(add[k]) ? add[k]
18
+ : (!!v &&
19
+ typeof v === 'object' &&
20
+ !!add[k] &&
21
+ typeof add[k] === 'object') ?
22
+ merge(v, add[k])
23
+ : add[k],
24
+ ])
25
+ .concat(
26
+ // already merged together if existing, so just get new additions
27
+ Object.entries(add).filter(([k]) => base[k] === undefined)));
@@ -0,0 +1,18 @@
1
+ import type { CommandUsage } from '../index.ts';
2
+ export type CommandUsageDefinition = {
3
+ command: string;
4
+ usage: string | string[];
5
+ description: string;
6
+ subcommands?: Record<string, {
7
+ usage?: string | string[];
8
+ description: string;
9
+ }>;
10
+ examples?: Record<string, {
11
+ description: string;
12
+ }>;
13
+ options?: Record<string, {
14
+ value?: string;
15
+ description: string;
16
+ }>;
17
+ };
18
+ export declare const commandUsage: ({ command, usage, description, subcommands, examples, options, }: CommandUsageDefinition) => ReturnType<CommandUsage>;
@@ -0,0 +1,39 @@
1
+ import { jack } from 'jackspeak';
2
+ import { commandAliases } from "./definition.js";
3
+ const toArr = (v) => (Array.isArray(v) ? v : [v]);
4
+ const code = (v) => [v, { pre: true }];
5
+ const join = (args, joiner = ' ') => args.filter(Boolean).join(joiner);
6
+ export const commandUsage = ({ command, usage, description, subcommands, examples, options, }) => {
7
+ const vlt = (s) => join([`vlt`, command, s]);
8
+ const joinUsage = (usages) => toArr(usages).map(vlt).filter(Boolean).join('\n');
9
+ const j = jack({ usage: joinUsage(usage) }).description(description);
10
+ const aliases = commandAliases.get(command);
11
+ if (aliases) {
12
+ j.heading('Aliases', 2).description(aliases.join(', '), {
13
+ pre: true,
14
+ });
15
+ }
16
+ if (subcommands) {
17
+ j.heading('Subcommands', 2);
18
+ for (const [k, v] of Object.entries(subcommands)) {
19
+ j.heading(k, 3)
20
+ .description(v.description)
21
+ .description(...code(joinUsage(toArr(v.usage).map(u => join([k, u])))));
22
+ }
23
+ }
24
+ if (examples) {
25
+ j.heading('Examples', 2);
26
+ for (const [k, v] of Object.entries(examples)) {
27
+ j.description(v.description).description(...code(vlt(k)));
28
+ }
29
+ }
30
+ if (options) {
31
+ j.heading('Options', 2);
32
+ for (const [k, v] of Object.entries(options)) {
33
+ j.heading(k, 3)
34
+ .description(v.description)
35
+ .description(...code(join(['--', k, v.value ? '=' : undefined, v.value], '')));
36
+ }
37
+ }
38
+ return j;
39
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Generates the custom default help output for vlt
3
+ */
4
+ export declare const generateDefaultHelp: (colors?: boolean) => string;
5
+ /**
6
+ * Generates the full help output with all commands when --all flag is used
7
+ */
8
+ export declare const generateFullHelp: (colors?: boolean) => string;
@@ -0,0 +1,419 @@
1
+ import { loadPackageJson } from 'package-json-from-dist';
2
+ import chalk from 'chalk';
3
+ const { version } = loadPackageJson(import.meta.filename, process.env.__VLT_INTERNAL_CLI_PACKAGE_JSON);
4
+ // Custom yellow color: #FFE15D
5
+ const customYellow = chalk.hex('#FFE15D');
6
+ const makeStyler = (colors) => {
7
+ if (!colors)
8
+ return (_, s) => s;
9
+ return (style, text) => {
10
+ const styles = Array.isArray(style) ? style : [style];
11
+ let styledText = text;
12
+ for (const s of styles) {
13
+ switch (s) {
14
+ case 'yellow':
15
+ case 'yellowBright':
16
+ styledText = customYellow(styledText);
17
+ break;
18
+ case 'bold':
19
+ styledText = chalk.bold(styledText);
20
+ break;
21
+ case 'dim':
22
+ styledText = chalk.dim(styledText);
23
+ break;
24
+ case 'dark':
25
+ styledText = chalk.gray(styledText);
26
+ break;
27
+ case 'cyan':
28
+ styledText = chalk.cyan(styledText);
29
+ break;
30
+ case 'green':
31
+ styledText = chalk.green(styledText);
32
+ break;
33
+ default:
34
+ // Fallback to chalk's built-in colors
35
+ if (s in chalk &&
36
+ typeof chalk[s] === 'function') {
37
+ styledText = chalk[s](styledText);
38
+ }
39
+ break;
40
+ }
41
+ }
42
+ return styledText;
43
+ };
44
+ };
45
+ // Single source of truth for all commands with metadata
46
+ const allCommands = [
47
+ {
48
+ name: 'bugs',
49
+ aliases: [],
50
+ args: '[<spec>]',
51
+ desc: 'Open the bug tracker for a package',
52
+ showByDefault: false,
53
+ },
54
+ {
55
+ name: 'build',
56
+ aliases: ['b'],
57
+ args: '<selector>',
58
+ desc: 'Build packages with lifecycle scripts',
59
+ showByDefault: true,
60
+ defaultOrder: 4,
61
+ },
62
+ {
63
+ name: 'cache',
64
+ aliases: [],
65
+ args: '[add|ls|info|clean|delete|delete-before|delete-all]',
66
+ desc: 'Manage the package cache',
67
+ showByDefault: false,
68
+ },
69
+ {
70
+ name: 'ci',
71
+ aliases: [],
72
+ args: '',
73
+ desc: 'Clean install (frozen lockfile)',
74
+ showByDefault: false,
75
+ },
76
+ {
77
+ name: 'config',
78
+ aliases: [],
79
+ args: '[get|pick|list|set|delete|edit|location]',
80
+ desc: 'Get or set configuration',
81
+ showByDefault: false,
82
+ },
83
+ {
84
+ name: 'create',
85
+ aliases: [],
86
+ args: '<initializer> [args...]',
87
+ desc: 'Create a new project from a template',
88
+ showByDefault: false,
89
+ },
90
+ {
91
+ name: 'docs',
92
+ aliases: [],
93
+ args: '',
94
+ desc: 'Open the docs of the current project',
95
+ showByDefault: false,
96
+ },
97
+ {
98
+ name: 'exec',
99
+ aliases: ['x'],
100
+ args: '<executable>',
101
+ desc: 'Execute a package bin',
102
+ showByDefault: true,
103
+ defaultOrder: 6,
104
+ },
105
+ {
106
+ name: 'exec-cache',
107
+ aliases: ['xc'],
108
+ args: '[ls|delete|info|install]',
109
+ desc: 'Manage the exec cache',
110
+ showByDefault: false,
111
+ },
112
+ {
113
+ name: 'exec-local',
114
+ aliases: ['xl'],
115
+ args: '<command>',
116
+ desc: 'Execute a local package bin',
117
+ showByDefault: false,
118
+ },
119
+ {
120
+ name: 'help',
121
+ aliases: ['h', '?'],
122
+ args: '[<command>]',
123
+ desc: 'Show help for a command',
124
+ showByDefault: false,
125
+ },
126
+ {
127
+ name: 'init',
128
+ aliases: [],
129
+ args: '',
130
+ desc: 'Initialize a new project',
131
+ showByDefault: true,
132
+ defaultOrder: 1,
133
+ },
134
+ {
135
+ name: 'install',
136
+ aliases: ['i', 'add'],
137
+ args: '[<package>...]',
138
+ desc: 'Install dependencies',
139
+ showByDefault: true,
140
+ defaultOrder: 2,
141
+ },
142
+ {
143
+ name: 'list',
144
+ aliases: ['ls'],
145
+ args: '',
146
+ desc: 'List installed packages',
147
+ showByDefault: false,
148
+ },
149
+ {
150
+ name: 'login',
151
+ aliases: [],
152
+ args: '',
153
+ desc: 'Authenticate with a registry',
154
+ showByDefault: false,
155
+ },
156
+ {
157
+ name: 'logout',
158
+ aliases: [],
159
+ args: '',
160
+ desc: 'Log out from a registry',
161
+ showByDefault: false,
162
+ },
163
+ {
164
+ name: 'pack',
165
+ aliases: [],
166
+ args: '',
167
+ desc: 'Create a tarball from a package',
168
+ showByDefault: false,
169
+ },
170
+ {
171
+ name: 'ping',
172
+ aliases: [],
173
+ args: '[<registry-alias>]',
174
+ desc: 'Ping configured registries',
175
+ showByDefault: false,
176
+ },
177
+ {
178
+ name: 'pkg',
179
+ aliases: ['p'],
180
+ args: '<command>',
181
+ desc: 'Manage package metadata',
182
+ showByDefault: true,
183
+ defaultOrder: 7,
184
+ },
185
+ {
186
+ name: 'publish',
187
+ aliases: ['pub'],
188
+ args: '',
189
+ desc: 'Publish package to registry',
190
+ showByDefault: true,
191
+ defaultOrder: 8,
192
+ },
193
+ {
194
+ name: 'query',
195
+ aliases: ['q'],
196
+ args: '<selector>',
197
+ desc: 'Query for packages in the project',
198
+ showByDefault: true,
199
+ defaultOrder: 3,
200
+ },
201
+ {
202
+ name: 'repo',
203
+ aliases: [],
204
+ args: '[<spec>]',
205
+ desc: 'Open the repository page for a package',
206
+ showByDefault: false,
207
+ },
208
+ {
209
+ name: 'run',
210
+ aliases: ['r'],
211
+ args: '<script>',
212
+ desc: 'Run a script defined in package.json',
213
+ showByDefault: true,
214
+ defaultOrder: 5,
215
+ },
216
+ {
217
+ name: 'run-exec',
218
+ aliases: ['rx'],
219
+ args: '<script>',
220
+ desc: 'Run a script &/or fallback to executing a binary',
221
+ showByDefault: false,
222
+ },
223
+ {
224
+ name: 'token',
225
+ aliases: [],
226
+ args: '[add|rm]',
227
+ desc: 'Manage authentication tokens',
228
+ showByDefault: false,
229
+ },
230
+ {
231
+ name: 'uninstall',
232
+ aliases: ['rm'],
233
+ args: '[<package>...]',
234
+ desc: 'Remove dependencies',
235
+ showByDefault: false,
236
+ },
237
+ {
238
+ name: 'update',
239
+ aliases: ['u'],
240
+ args: '',
241
+ desc: 'Update package versions to latest in-range',
242
+ showByDefault: false,
243
+ },
244
+ {
245
+ name: 'version',
246
+ aliases: [],
247
+ args: '<increment>',
248
+ desc: 'Bump package version',
249
+ showByDefault: false,
250
+ },
251
+ {
252
+ name: 'whoami',
253
+ aliases: [],
254
+ args: '',
255
+ desc: 'Display the current user',
256
+ showByDefault: false,
257
+ },
258
+ ];
259
+ /**
260
+ * Generates the custom default help output for vlt
261
+ */
262
+ export const generateDefaultHelp = (colors = false) => {
263
+ const s = makeStyler(colors);
264
+ // Get default commands and sort by defaultOrder
265
+ const defaultCommands = allCommands
266
+ .filter(cmd => cmd.showByDefault)
267
+ .sort((a, b) => (a.defaultOrder || 0) - (b.defaultOrder || 0));
268
+ // Generate commands with tighter alias spacing but proper table structure
269
+ const commandsSection = defaultCommands
270
+ .map(cmd => {
271
+ // Tighter alias column (5 chars to accommodate space after comma) - only show first alias
272
+ const firstAlias = cmd.aliases.length > 0 ? cmd.aliases[0] : '';
273
+ const aliasColumn = firstAlias ? (firstAlias + ', ').padEnd(5) : ' ';
274
+ // Consistent name column (10 chars)
275
+ const nameColumn = cmd.name.padEnd(10);
276
+ // Consistent args column (14 chars)
277
+ const argsColumn = cmd.args.padEnd(16);
278
+ return ` ${s('dim', aliasColumn)}${s(['yellow', 'bold'], nameColumn)}${s('dim', argsColumn)}${cmd.desc}`;
279
+ })
280
+ .join('\n');
281
+ return `${s(['bold'], '⚡️ vlt')} ${s('dim', '/vōlt/')} next-gen package management ${s('dim', `v${version}`)}
282
+
283
+ ${s('bold', 'USAGE')}
284
+
285
+ ${s('bold', 'vlt')} ${s('dim', '<command>')}
286
+
287
+ ${s('bold', 'COMMON COMMANDS')}
288
+
289
+ ${commandsSection}
290
+
291
+ ${s('bold', 'COMPANION BINS')}
292
+
293
+ ${s('bold', 'vlr')} ${s('dim', 'eq. vlt run')}
294
+ ${s('bold', 'vlx')} ${s('dim', 'eq. vlt exec')}
295
+
296
+ ${s('bold', 'COMMON FLAGS')}
297
+
298
+ ${s('green', '-v, --version')} Log the cli version
299
+ ${s('green', '-a, --all')} List all commands, bins & flags
300
+
301
+ Learn more: https://${s('bold', 'vlt.sh')}
302
+ Get support: https://${s('bold', 'vlt.community')}
303
+
304
+ ${s('dim', `This is not the full usage information, run \`vlt -a\` for more.`)}
305
+ `;
306
+ };
307
+ /**
308
+ * Generates the full help output with all commands when --all flag is used
309
+ */
310
+ export const generateFullHelp = (colors = false) => {
311
+ const s = makeStyler(colors);
312
+ // Use all commands sorted alphabetically
313
+ const commands = [...allCommands].sort((a, b) => a.name.localeCompare(b.name));
314
+ // Define only globally applicable flags (alphabetically sorted by long name)
315
+ const flags = [
316
+ {
317
+ shorts: ['a'],
318
+ long: 'all',
319
+ args: '',
320
+ desc: 'Show all commands, bins, and flags',
321
+ },
322
+ {
323
+ shorts: ['c'],
324
+ long: 'color',
325
+ args: '',
326
+ desc: 'Enable color output',
327
+ },
328
+ {
329
+ shorts: ['h'],
330
+ long: 'help',
331
+ args: '',
332
+ desc: 'Print helpful information',
333
+ },
334
+ {
335
+ shorts: [],
336
+ long: 'no-color',
337
+ args: '',
338
+ desc: 'Disable color output',
339
+ },
340
+ {
341
+ shorts: [],
342
+ long: 'registry',
343
+ args: '<url>',
344
+ desc: 'Override default registry',
345
+ },
346
+ {
347
+ shorts: ['v'],
348
+ long: 'version',
349
+ args: '',
350
+ desc: 'Print the version',
351
+ },
352
+ {
353
+ shorts: ['y'],
354
+ long: 'yes',
355
+ args: '',
356
+ desc: 'Automatically accept prompts',
357
+ },
358
+ ];
359
+ // Generate commands section with letter grouping spacing
360
+ let commandsSection = '';
361
+ let lastFirstLetter = '';
362
+ commands.forEach((cmd, index) => {
363
+ const firstLetter = cmd.name[0]?.toLowerCase() || '';
364
+ // Add extra spacing between different letter groups
365
+ if (firstLetter !== lastFirstLetter && index > 0) {
366
+ commandsSection += '\n';
367
+ }
368
+ // Fixed width columns for proper alignment with space after comma
369
+ const aliasColumn = cmd.aliases.length > 0 ?
370
+ (cmd.aliases.join(', ') + ', ').padEnd(9)
371
+ : ' ';
372
+ const nameColumn = cmd.name.padEnd(12);
373
+ // Truncate args if longer than 16 chars and add ellipsis
374
+ const truncatedArgs = cmd.args.length > 16 ?
375
+ cmd.args.substring(0, 13) + '...'
376
+ : cmd.args;
377
+ const argsColumn = truncatedArgs.padEnd(16);
378
+ commandsSection += `${s('dim', aliasColumn)}${s(['yellow', 'bold'], nameColumn)}${s('dim', argsColumn)}${cmd.desc}`;
379
+ if (index < commands.length - 1) {
380
+ commandsSection += '\n';
381
+ }
382
+ lastFirstLetter = firstLetter;
383
+ });
384
+ // Generate flags section with same structure as commands
385
+ const flagsSection = flags
386
+ .map(f => {
387
+ // Match command structure: alias column, name column, args column, description
388
+ const aliasColumn = f.shorts.length > 0 ?
389
+ ('-' + f.shorts.join(', -') + ', ').padEnd(7)
390
+ : ' ';
391
+ const nameColumn = ('--' + f.long).padEnd(12);
392
+ const argsColumn = (f.args || '').padEnd(17);
393
+ return ` ${s('dim', aliasColumn)}${s('green', nameColumn)}${s('dim', argsColumn)}${f.desc}`;
394
+ })
395
+ .join('\n');
396
+ return `${s(['bold'], '⚡️ vlt')} ${s('dim', '/vōlt/')} ${s('dim', '- next-gen package management')} ${s('dim', `v${version}`)}
397
+
398
+ ${s('bold', 'USAGE')}
399
+
400
+ ${s('bold', 'vlt')} ${s('dim', '<command>')}
401
+
402
+ ${s('bold', 'COMMANDS')}
403
+
404
+ ${commandsSection}
405
+
406
+ ${s('bold', 'COMPANION BINS')}
407
+
408
+ vlr ${s('dim', 'eq. vlt run')}
409
+ vlx ${s('dim', 'eq. vlt exec')}
410
+
411
+ ${s('bold', 'FLAGS')}
412
+
413
+ ${flagsSection}
414
+
415
+ Learn more: https://${s('bold', 'vlt.sh')}
416
+ Get support: https://${s('bold', 'vlt.community')}
417
+
418
+ ${s('dim', `Run \`vlt help <command>\` for detailed information about a specific command.`)}`;
419
+ };
@@ -0,0 +1,52 @@
1
+ /**
2
+ * impl for `vlt run`, `vlt run-exec`, `vlt exec-local`, `vlt exec`
3
+ * @module
4
+ */
5
+ import type { NormalizedManifest } from '@vltpkg/types';
6
+ import type { exec, execFG, ExecOptions, run, runExec, runExecFG, RunExecOptions, runFG, RunFGResult, RunOptions, RunResult } from '@vltpkg/run';
7
+ import type { LoadedConfig } from './config/index.ts';
8
+ export type RunnerBG = typeof exec | typeof run | typeof runExec;
9
+ export type RunnerFG = typeof execFG | typeof runExecFG | typeof runFG;
10
+ export type RunnerOptions = ExecOptions & RunExecOptions & RunOptions;
11
+ export type MultiRunResult = Record<string, RunResult>;
12
+ export type ScriptSet = Record<string, string>;
13
+ export type MultiScriptSet = Record<string, ScriptSet>;
14
+ export type ExecResult = RunFGResult | MultiRunResult | ScriptSet | MultiScriptSet;
15
+ export declare const views: {
16
+ readonly human: (result: ExecResult) => void;
17
+ readonly json: (result: ExecResult) => ExecResult | undefined;
18
+ };
19
+ type ViewValues = 'human' | 'json' | 'inspect' | 'silent';
20
+ export declare class ExecCommand<B extends RunnerBG, F extends RunnerFG> {
21
+ #private;
22
+ bg: B;
23
+ fg: F;
24
+ arg0?: string;
25
+ args: string[];
26
+ env?: NodeJS.ProcessEnv;
27
+ conf: LoadedConfig;
28
+ projectRoot: string;
29
+ view: ViewValues;
30
+ validViewValues: Map<string, ViewValues>;
31
+ constructor(conf: LoadedConfig, bg: B, fg: F);
32
+ hasArg0(): this is this & {
33
+ arg0: string;
34
+ };
35
+ run(): Promise<ExecResult>;
36
+ printResult(path: string, result: RunResult): void;
37
+ interactiveShell(): string;
38
+ defaultArg0(): string | undefined;
39
+ getCwd(): string;
40
+ fgArg(): RunnerOptions | undefined;
41
+ bgArg(this: this & {
42
+ arg0: string;
43
+ }, cwd: string): RunnerOptions;
44
+ noArgsSingle(): ScriptSet;
45
+ noArgsMulti(): MultiScriptSet;
46
+ getTargets(): {
47
+ label: string;
48
+ cwd: string;
49
+ manifest: NormalizedManifest;
50
+ }[];
51
+ }
52
+ export {};