@kjanat/dreamcli 2.5.0 → 3.0.0-rc.10
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.
- package/CHANGELOG.md +344 -1
- package/README.md +9 -2
- package/dist/core/cli/dispatch.d.mts +6 -5
- package/dist/core/cli/dispatch.mjs +205 -1
- package/dist/core/cli/help-links.d.mts +0 -1
- package/dist/core/cli/help-links.mjs +41 -1
- package/dist/core/cli/index.d.mts +185 -19
- package/dist/core/cli/index.mjs +945 -1
- package/dist/core/cli/planner.d.mts +32 -6
- package/dist/core/cli/planner.mjs +300 -1
- package/dist/core/cli/plugin.d.mts +1 -1
- package/dist/core/cli/plugin.mjs +41 -1
- package/dist/core/cli/propagate.d.mts +1 -1
- package/dist/core/cli/propagate.mjs +57 -1
- package/dist/core/cli/root-help.d.mts +18 -3
- package/dist/core/cli/root-help.mjs +226 -6
- package/dist/core/cli/root-surface.d.mts +30 -4
- package/dist/core/cli/root-surface.mjs +28 -1
- package/dist/core/cli/runtime-preflight.d.mts +30 -3
- package/dist/core/cli/runtime-preflight.mjs +169 -1
- package/dist/core/completion/index.d.mts +32 -2
- package/dist/core/completion/index.mjs +90 -1
- package/dist/core/completion/shells/bash.d.mts +0 -1
- package/dist/core/completion/shells/bash.mjs +308 -3
- package/dist/core/completion/shells/fish.d.mts +0 -1
- package/dist/core/completion/shells/fish.mjs +162 -2
- package/dist/core/completion/shells/powershell.d.mts +0 -1
- package/dist/core/completion/shells/powershell.mjs +358 -2
- package/dist/core/completion/shells/shared.d.mts +23 -2
- package/dist/core/completion/shells/shared.mjs +176 -1
- package/dist/core/completion/shells/zsh.d.mts +0 -1
- package/dist/core/completion/shells/zsh.mjs +251 -2
- package/dist/core/config/index.d.mts +2 -3
- package/dist/core/config/index.mjs +246 -1
- package/dist/core/config/package-json.d.mts +27 -4
- package/dist/core/config/package-json.mjs +386 -3
- package/dist/core/errors/index.d.mts +3 -3
- package/dist/core/errors/index.mjs +87 -1
- package/dist/core/execution/index.d.mts +0 -1
- package/dist/core/execution/index.mjs +201 -1
- package/dist/core/help/ansi.d.mts +11 -5
- package/dist/core/help/ansi.mjs +121 -2
- package/dist/core/help/index.d.mts +65 -2
- package/dist/core/help/index.mjs +341 -7
- package/dist/core/help/theme.d.mts +68 -0
- package/dist/core/help/theme.mjs +46 -0
- package/dist/core/json-schema/index.d.mts +15 -2
- package/dist/core/json-schema/index.mjs +536 -12
- package/dist/core/json-schema/meta-descriptions.generated.d.mts +22 -5
- package/dist/core/json-schema/meta-descriptions.generated.mjs +102 -28
- package/dist/core/output/activity.d.mts +0 -1
- package/dist/core/output/activity.mjs +452 -1
- package/dist/core/output/bind.mjs +56 -1
- package/dist/core/output/contracts.d.mts +4 -5
- package/dist/core/output/contracts.mjs +57 -1
- package/dist/core/output/display-value.mjs +32 -1
- package/dist/core/output/index.d.mts +21 -1
- package/dist/core/output/index.mjs +442 -2
- package/dist/core/output/renderers.d.mts +0 -1
- package/dist/core/output/renderers.mjs +46 -1
- package/dist/core/output/writer.mjs +12 -1
- package/dist/core/parse/index.d.mts +54 -7
- package/dist/core/parse/index.mjs +727 -1
- package/dist/core/prompt/index.d.mts +12 -4
- package/dist/core/prompt/index.mjs +348 -6
- package/dist/core/resolve/args.d.mts +1 -1
- package/dist/core/resolve/args.mjs +105 -1
- package/dist/core/resolve/coerce.d.mts +1 -1
- package/dist/core/resolve/coerce.mjs +336 -1
- package/dist/core/resolve/config.mjs +19 -1
- package/dist/core/resolve/contracts.d.mts +9 -4
- package/dist/core/resolve/errors.d.mts +0 -1
- package/dist/core/resolve/errors.mjs +140 -2
- package/dist/core/resolve/flags.d.mts +7 -2
- package/dist/core/resolve/flags.mjs +251 -1
- package/dist/core/resolve/index.d.mts +2 -2
- package/dist/core/resolve/index.mjs +85 -1
- package/dist/core/resolve/property.d.mts +6 -2
- package/dist/core/resolve/property.mjs +53 -1
- package/dist/core/schema/activity.d.mts +31 -11
- package/dist/core/schema/arg.d.mts +92 -13
- package/dist/core/schema/arg.mjs +463 -1
- package/dist/core/schema/command.d.mts +29 -7
- package/dist/core/schema/command.mjs +726 -1
- package/dist/core/schema/flag.d.mts +577 -21
- package/dist/core/schema/flag.mjs +705 -1
- package/dist/core/schema/index.d.mts +5 -2
- package/dist/core/schema/middleware.d.mts +4 -3
- package/dist/core/schema/middleware.mjs +41 -1
- package/dist/core/schema/number-constraints.d.mts +96 -0
- package/dist/core/schema/number-constraints.mjs +60 -0
- package/dist/core/schema/prompt.d.mts +21 -3
- package/dist/core/schema/run.d.mts +24 -5
- package/dist/core/schema/string-constraints.d.mts +97 -0
- package/dist/core/schema/string-constraints.mjs +69 -0
- package/dist/core/schema/value-parsers.d.mts +78 -0
- package/dist/core/schema/value-parsers.mjs +142 -0
- package/dist/core/schema-dsl/runtime.mjs +271 -2
- package/dist/core/schema-dsl/to-json-schema.d.mts +0 -1
- package/dist/core/schema-dsl/to-json-schema.mjs +74 -1
- package/dist/core/testkit/index.d.mts +9 -36
- package/dist/core/testkit/index.mjs +83 -1
- package/dist/index.d.mts +12 -6
- package/dist/index.mjs +22 -1
- package/dist/runtime/adapter.d.mts +38 -2
- package/dist/runtime/adapter.mjs +87 -1
- package/dist/runtime/auto.d.mts +2 -3
- package/dist/runtime/auto.mjs +45 -1
- package/dist/runtime/deno.d.mts +24 -5
- package/dist/runtime/deno.mjs +262 -2
- package/dist/runtime/detect.mjs +45 -1
- package/dist/runtime/index.d.mts +3 -4
- package/dist/runtime/node.d.mts +8 -2
- package/dist/runtime/node.mjs +220 -2
- package/dist/runtime/paths.mjs +48 -1
- package/dist/runtime.d.mts +4 -4
- package/dist/runtime.mjs +6 -1
- package/dist/strings.mjs +22 -1
- package/dist/testkit.d.mts +1 -0
- package/dist/testkit.mjs +5 -1
- package/dist/version.d.mts +7 -3
- package/dist/version.mjs +7 -1
- package/dreamcli.schema.json +36 -7
- package/examples/basic.ts +5 -1
- package/examples/gh/package.json +2 -7
- package/examples/pwsh-demo/package.json +1 -7
- package/examples/pwsh-demo/src/main.test.ts +1 -4
- package/examples/pwsh-demo/src/main.ts +14 -4
- package/examples/transport-launcher.ts +85 -0
- package/package.json +43 -49
- package/dist/runtime/bun.d.mts +0 -28
- package/dist/runtime/bun.mjs +0 -1
- package/dist/runtime/support.d.mts +0 -42
- package/dist/runtime/support.mjs +0 -1
- package/src/core/cli/dispatch.ts +0 -349
- package/src/core/cli/help-links.ts +0 -82
- package/src/core/cli/index.ts +0 -1413
- package/src/core/cli/planner.ts +0 -487
- package/src/core/cli/plugin.ts +0 -117
- package/src/core/cli/propagate.ts +0 -97
- package/src/core/cli/root-help.ts +0 -252
- package/src/core/cli/root-surface.ts +0 -74
- package/src/core/cli/runtime-preflight.ts +0 -438
- package/src/core/completion/index.ts +0 -88
- package/src/core/completion/shells/bash.ts +0 -459
- package/src/core/completion/shells/fish.ts +0 -259
- package/src/core/completion/shells/powershell.ts +0 -439
- package/src/core/completion/shells/shared.ts +0 -283
- package/src/core/completion/shells/zsh.ts +0 -381
- package/src/core/config/index.ts +0 -417
- package/src/core/config/package-json.ts +0 -560
- package/src/core/errors/index.ts +0 -193
- package/src/core/execution/index.ts +0 -268
- package/src/core/help/ansi.ts +0 -144
- package/src/core/help/index.ts +0 -516
- package/src/core/json-schema/index.ts +0 -891
- package/src/core/json-schema/meta-descriptions.generated.ts +0 -185
- package/src/core/output/activity.ts +0 -575
- package/src/core/output/bind.ts +0 -59
- package/src/core/output/contracts.ts +0 -194
- package/src/core/output/display-value.ts +0 -48
- package/src/core/output/index.ts +0 -704
- package/src/core/output/renderers.ts +0 -125
- package/src/core/output/writer.ts +0 -46
- package/src/core/parse/index.ts +0 -681
- package/src/core/prompt/index.ts +0 -583
- package/src/core/resolve/args.ts +0 -144
- package/src/core/resolve/coerce.ts +0 -432
- package/src/core/resolve/config.ts +0 -26
- package/src/core/resolve/contracts.ts +0 -135
- package/src/core/resolve/errors.ts +0 -227
- package/src/core/resolve/flags.ts +0 -255
- package/src/core/resolve/index.ts +0 -108
- package/src/core/resolve/property.ts +0 -99
- package/src/core/schema/activity.ts +0 -240
- package/src/core/schema/arg.ts +0 -719
- package/src/core/schema/command.ts +0 -1498
- package/src/core/schema/flag.ts +0 -801
- package/src/core/schema/index.ts +0 -91
- package/src/core/schema/middleware.ts +0 -171
- package/src/core/schema/prompt.ts +0 -156
- package/src/core/schema/run.ts +0 -198
- package/src/core/schema-dsl/index.ts +0 -109
- package/src/core/schema-dsl/parse.ts +0 -262
- package/src/core/schema-dsl/runtime.ts +0 -609
- package/src/core/schema-dsl/to-json-schema.ts +0 -102
- package/src/core/testkit/index.ts +0 -123
- package/src/index.ts +0 -179
- package/src/runtime/adapter.ts +0 -303
- package/src/runtime/auto.ts +0 -110
- package/src/runtime/bun.ts +0 -55
- package/src/runtime/deno.ts +0 -369
- package/src/runtime/detect.ts +0 -105
- package/src/runtime/index.ts +0 -21
- package/src/runtime/node-builtins.d.ts +0 -27
- package/src/runtime/node.ts +0 -300
- package/src/runtime/paths.ts +0 -64
- package/src/runtime/support.ts +0 -135
- package/src/runtime.ts +0 -31
- package/src/strings.ts +0 -34
- package/src/testkit.ts +0 -25
- package/src/version.ts +0 -20
|
@@ -1,2 +1,251 @@
|
|
|
1
|
-
import{
|
|
2
|
-
|
|
1
|
+
import { CLIError } from "../../errors/index.mjs";
|
|
2
|
+
import { getFlagAliasNames } from "../../schema/flag.mjs";
|
|
3
|
+
import { flagExpectsValue } from "../../parse/index.mjs";
|
|
4
|
+
import { getVisibleNegatedName, quoteShellArg, resolveRootCompletionSurface, sanitizeShellIdentifier, versionTag, walkCommandTree } from "./shared.mjs";
|
|
5
|
+
//#region src/core/completion/shells/zsh.ts
|
|
6
|
+
/**
|
|
7
|
+
* Generate a zsh completion script for the CLI.
|
|
8
|
+
*
|
|
9
|
+
* Use this when you want a zsh-specific script directly rather than routing
|
|
10
|
+
* through {@link generateCompletion}. The generated script is compatible with
|
|
11
|
+
* zsh's normal `#compdef` / `fpath` loading flow.
|
|
12
|
+
*
|
|
13
|
+
* @param schema - The CLI schema.
|
|
14
|
+
* @param options - Optional generator configuration.
|
|
15
|
+
* @returns A complete zsh completion script.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const script = generateZshCompletion(app.schema);
|
|
20
|
+
* // install with: mycli completions zsh > "${fpath[1]}/_mycli"
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
function generateZshCompletion(schema, options) {
|
|
24
|
+
const funcName = `_${sanitizeShellIdentifier(options?.functionPrefix ?? schema.name)}`;
|
|
25
|
+
const rootSurface = resolveRootCompletionSurface(schema, options?.rootMode);
|
|
26
|
+
const visibleCommands = rootSurface.visibleCommands;
|
|
27
|
+
const nodes = walkCommandTree(visibleCommands);
|
|
28
|
+
const lines = [];
|
|
29
|
+
lines.push(`#compdef ${quoteShellArg(schema.name)}`);
|
|
30
|
+
lines.push(`# Zsh completion for ${schema.name}`);
|
|
31
|
+
lines.push(`# Generated by ${versionTag()}`);
|
|
32
|
+
lines.push("#");
|
|
33
|
+
lines.push(`# Usage: source <(${schema.name} completions zsh)`);
|
|
34
|
+
lines.push("#");
|
|
35
|
+
lines.push("# Install permanently:");
|
|
36
|
+
lines.push(`# ${schema.name} completions zsh > "\${fpath[1]}/_${schema.name}"`);
|
|
37
|
+
lines.push("# # Then restart your shell");
|
|
38
|
+
lines.push("");
|
|
39
|
+
const groupNodes = nodes.filter((n) => n.children.length > 0);
|
|
40
|
+
const leafNodes = nodes.filter((n) => n.children.length === 0);
|
|
41
|
+
for (const node of leafNodes) {
|
|
42
|
+
if (node.path.length < 2) continue;
|
|
43
|
+
emitZshLeafFunction(lines, `${funcName}_${node.path.map(sanitizeShellIdentifier).join("_")}`, node);
|
|
44
|
+
}
|
|
45
|
+
const sortedGroups = [...groupNodes].sort((a, b) => b.path.length - a.path.length);
|
|
46
|
+
for (const node of sortedGroups) emitZshGroupFunction(lines, `${funcName}_${node.path.map(sanitizeShellIdentifier).join("_")}`, funcName, node);
|
|
47
|
+
lines.push(`${funcName}() {`);
|
|
48
|
+
if (visibleCommands.length > 0) {
|
|
49
|
+
lines.push(" local -a subcmds");
|
|
50
|
+
lines.push(" local line state");
|
|
51
|
+
lines.push("");
|
|
52
|
+
const rootFlagSpecs = buildZshFlagSpecsFromFlags({
|
|
53
|
+
...rootSurface.rootFlags,
|
|
54
|
+
...rootSurface.includeDefaultFlags ? rootSurface.defaultFlags : {}
|
|
55
|
+
});
|
|
56
|
+
lines.push(" _arguments -C \\");
|
|
57
|
+
for (const spec of rootFlagSpecs) lines.push(`\t\t${spec} \\`);
|
|
58
|
+
lines.push(" '1: :->subcmd' \\");
|
|
59
|
+
lines.push(" '*::arg:->args'");
|
|
60
|
+
lines.push("");
|
|
61
|
+
lines.push(" case \"$state\" in");
|
|
62
|
+
lines.push(" subcmd)");
|
|
63
|
+
lines.push(" subcmds=(");
|
|
64
|
+
appendZshCommandCandidates(lines, visibleCommands, " ");
|
|
65
|
+
lines.push(" )");
|
|
66
|
+
lines.push(" _describe 'command' subcmds");
|
|
67
|
+
lines.push(" ;;");
|
|
68
|
+
lines.push(" args)");
|
|
69
|
+
lines.push(" case \"$line[1]\" in");
|
|
70
|
+
for (const cmd of visibleCommands) {
|
|
71
|
+
const allNames = [cmd.name, ...cmd.aliases].map(escapeZshCasePatternValue);
|
|
72
|
+
const childCommands = cmd.commands.filter((c) => !c.hidden);
|
|
73
|
+
lines.push(`\t\t\t\t${allNames.join("|")})`);
|
|
74
|
+
if (childCommands.length > 0) {
|
|
75
|
+
const helperName = `${funcName}_${sanitizeShellIdentifier(cmd.name)}`;
|
|
76
|
+
lines.push(`\t\t\t\t\t${helperName}`);
|
|
77
|
+
} else {
|
|
78
|
+
const node = nodes.find((n) => n.path.length === 1 && n.schema.name === cmd.name);
|
|
79
|
+
if (node === void 0) throw new CLIError(`Missing completion node for command '${cmd.name}'`, { code: "UNEXPECTED_ERROR" });
|
|
80
|
+
const flagSpecs = buildZshFlagSpecsFromFlags(node.mergedFlags);
|
|
81
|
+
if (flagSpecs.length > 0) {
|
|
82
|
+
lines.push(" _arguments \\");
|
|
83
|
+
for (let i = 0; i < flagSpecs.length; i++) {
|
|
84
|
+
const trailing = i < flagSpecs.length - 1 ? " \\" : "";
|
|
85
|
+
lines.push(`\t\t\t\t\t\t${flagSpecs[i]}${trailing}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
lines.push(" ;;");
|
|
90
|
+
}
|
|
91
|
+
lines.push(" esac");
|
|
92
|
+
lines.push(" ;;");
|
|
93
|
+
lines.push(" esac");
|
|
94
|
+
} else {
|
|
95
|
+
const globalFlags = buildZshFlagSpecsFromFlags(rootSurface.rootFlags);
|
|
96
|
+
lines.push(" _arguments \\");
|
|
97
|
+
for (let i = 0; i < globalFlags.length; i++) {
|
|
98
|
+
const trailing = i < globalFlags.length - 1 ? " \\" : "";
|
|
99
|
+
lines.push(`\t\t${globalFlags[i]}${trailing}`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
lines.push("}");
|
|
103
|
+
lines.push("");
|
|
104
|
+
lines.push(`compdef ${funcName} ${quoteShellArg(schema.name)}`);
|
|
105
|
+
lines.push("");
|
|
106
|
+
return lines.join("\n");
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Emit a zsh helper function for a group command (has subcommands).
|
|
110
|
+
*
|
|
111
|
+
* Uses `_arguments -C` for its own flags plus subcommand dispatch.
|
|
112
|
+
*
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
function emitZshGroupFunction(lines, helperName, rootFuncName, node) {
|
|
116
|
+
lines.push(`${helperName}() {`);
|
|
117
|
+
lines.push(" local -a subcmds");
|
|
118
|
+
lines.push(" local line state");
|
|
119
|
+
lines.push("");
|
|
120
|
+
const flagSpecs = buildZshFlagSpecsFromFlags(node.mergedFlags);
|
|
121
|
+
lines.push(" _arguments -C \\");
|
|
122
|
+
for (const spec of flagSpecs) lines.push(`\t\t${spec} \\`);
|
|
123
|
+
lines.push(" '1: :->subcmd' \\");
|
|
124
|
+
lines.push(" '*::arg:->args'");
|
|
125
|
+
lines.push("");
|
|
126
|
+
lines.push(" case \"$state\" in");
|
|
127
|
+
lines.push(" subcmd)");
|
|
128
|
+
lines.push(" subcmds=(");
|
|
129
|
+
appendZshCommandCandidates(lines, node.children, " ");
|
|
130
|
+
lines.push(" )");
|
|
131
|
+
lines.push(" _describe 'command' subcmds");
|
|
132
|
+
lines.push(" ;;");
|
|
133
|
+
lines.push(" args)");
|
|
134
|
+
lines.push(" case \"$line[1]\" in");
|
|
135
|
+
for (const child of node.children) {
|
|
136
|
+
const allNames = [child.name, ...child.aliases].map(escapeZshCasePatternValue);
|
|
137
|
+
const childFuncName = `${rootFuncName}_${[...node.path, child.name].map(sanitizeShellIdentifier).join("_")}`;
|
|
138
|
+
lines.push(`\t\t\t\t${allNames.join("|")})`);
|
|
139
|
+
lines.push(`\t\t\t\t\t${childFuncName}`);
|
|
140
|
+
lines.push(" ;;");
|
|
141
|
+
}
|
|
142
|
+
lines.push(" esac");
|
|
143
|
+
lines.push(" ;;");
|
|
144
|
+
lines.push(" esac");
|
|
145
|
+
lines.push("}");
|
|
146
|
+
lines.push("");
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Emit a zsh helper function for a leaf command (no subcommands).
|
|
150
|
+
*
|
|
151
|
+
* Uses plain `_arguments` with the command's own flags plus propagated flags.
|
|
152
|
+
*
|
|
153
|
+
* @internal
|
|
154
|
+
*/
|
|
155
|
+
function emitZshLeafFunction(lines, helperName, node) {
|
|
156
|
+
const flagSpecs = buildZshFlagSpecsFromFlags(node.mergedFlags);
|
|
157
|
+
lines.push(`${helperName}() {`);
|
|
158
|
+
if (flagSpecs.length > 0) {
|
|
159
|
+
lines.push(" _arguments \\");
|
|
160
|
+
for (let i = 0; i < flagSpecs.length; i++) {
|
|
161
|
+
const trailing = i < flagSpecs.length - 1 ? " \\" : "";
|
|
162
|
+
lines.push(`\t\t${flagSpecs[i]}${trailing}`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
lines.push("}");
|
|
166
|
+
lines.push("");
|
|
167
|
+
}
|
|
168
|
+
function appendZshCommandCandidates(lines, commands, indent) {
|
|
169
|
+
for (const command of commands) {
|
|
170
|
+
const description = command.description ?? command.name;
|
|
171
|
+
for (const alias of [command.name, ...command.aliases]) lines.push(`${indent}${quoteShellArg(`${alias}:${description}`)}`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Escape a value for use in a zsh `case` pattern.
|
|
176
|
+
*
|
|
177
|
+
* Escapes glob metacharacters so arbitrary command and alias names match
|
|
178
|
+
* literally rather than being interpreted as shell patterns.
|
|
179
|
+
*
|
|
180
|
+
* @internal
|
|
181
|
+
*/
|
|
182
|
+
function escapeZshCasePatternValue(value) {
|
|
183
|
+
if (/^[a-zA-Z0-9_\-.]+$/.test(value)) return value;
|
|
184
|
+
return value.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/"/g, "\\\"").replace(/`/g, "\\`").replace(/\|/g, "\\|").replace(/\*/g, "\\*").replace(/\?/g, "\\?").replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/\(/g, "\\(").replace(/\)/g, "\\)").replace(/\{/g, "\\{").replace(/\}/g, "\\}").replace(/\+/g, "\\+").replace(/!/g, "\\!").replace(/@/g, "\\@").replace(/#/g, "\\#").replace(/~/g, "\\~").replace(/\s/g, (match) => match === " " ? "\\ " : `\\${match}`);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Escape a description for use inside a zsh `_arguments` flag spec.
|
|
188
|
+
*
|
|
189
|
+
* `]` closes the description segment, so it must be escaped. Backslashes are
|
|
190
|
+
* escaped as well so descriptions with literal escapes remain stable.
|
|
191
|
+
*
|
|
192
|
+
* @internal
|
|
193
|
+
*/
|
|
194
|
+
function escapeZshDescription(value) {
|
|
195
|
+
return value.replace(/\\/g, "\\\\").replace(/\]/g, "\\]");
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Build `_arguments` flag spec strings from a merged flag record.
|
|
199
|
+
*
|
|
200
|
+
* Each flag produces one or more spec strings in zsh `_arguments` format:
|
|
201
|
+
* - `'--name[description]'` for simple flags
|
|
202
|
+
* - `'--name[description]:value:(v1 v2 v3)'` for enum flags
|
|
203
|
+
* - `'(-s --name --alias)'{-s,--name,--alias}'[description]'` for flags with
|
|
204
|
+
* visible aliases
|
|
205
|
+
*
|
|
206
|
+
* A visible negated spelling (`--no-name`) joins the flag's form group — the
|
|
207
|
+
* two spellings are one logical flag, so completing one excludes the other.
|
|
208
|
+
*
|
|
209
|
+
* @internal
|
|
210
|
+
*/
|
|
211
|
+
function buildZshFlagSpecsFromFlags(flags) {
|
|
212
|
+
const specs = [];
|
|
213
|
+
for (const [name, schema] of Object.entries(flags)) {
|
|
214
|
+
const desc = escapeZshDescription(schema.description ?? name);
|
|
215
|
+
const longFlag = `--${name}`;
|
|
216
|
+
const shortFlags = getFlagAliasNames(schema, { kind: "short" }).map((alias) => `-${alias}`);
|
|
217
|
+
const longAliases = getFlagAliasNames(schema, { kind: "long" }).map((alias) => `--${alias}`);
|
|
218
|
+
const negated = getVisibleNegatedName(name, schema);
|
|
219
|
+
const negatedForms = negated !== void 0 ? [`--${negated}`] : [];
|
|
220
|
+
const allForms = [
|
|
221
|
+
...shortFlags,
|
|
222
|
+
longFlag,
|
|
223
|
+
...longAliases,
|
|
224
|
+
...negatedForms
|
|
225
|
+
];
|
|
226
|
+
let valuePart = "";
|
|
227
|
+
if (!flagExpectsValue(schema)) {} else if (schema.kind === "enum" && schema.enumValues !== void 0) valuePart = `:value:(${schema.enumValues.map(escapeZshEnumValue).join(" ")})`;
|
|
228
|
+
else valuePart = ":value:";
|
|
229
|
+
if (allForms.length > 1) {
|
|
230
|
+
const escapedForms = allForms.map(escapeZshCasePatternValue).join(",");
|
|
231
|
+
specs.push(`${quoteShellArg(`(${allForms.join(" ")})`)}{${escapedForms}}${quoteShellArg(`[${desc}]${valuePart}`)}`);
|
|
232
|
+
} else specs.push(quoteShellArg(`${longFlag}[${desc}]${valuePart}`));
|
|
233
|
+
}
|
|
234
|
+
return specs;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Escape a single enum value for use inside a zsh `(v1 v2)` value list.
|
|
238
|
+
*
|
|
239
|
+
* Simple identifier-like values (matching `[a-zA-Z0-9_\-.]`) pass through
|
|
240
|
+
* unescaped. Values containing spaces, quotes, backslashes, or parentheses
|
|
241
|
+
* are escaped with backslash prefixes for each special character, which
|
|
242
|
+
* is the standard mechanism within zsh parenthesized completion lists.
|
|
243
|
+
*
|
|
244
|
+
* @internal
|
|
245
|
+
*/
|
|
246
|
+
function escapeZshEnumValue(value) {
|
|
247
|
+
if (/^[a-zA-Z0-9_\-.]+$/.test(value)) return value;
|
|
248
|
+
return value.replace(/\\/g, "\\\\").replace(/ /g, "\\ ").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
|
|
249
|
+
}
|
|
250
|
+
//#endregion
|
|
251
|
+
export { generateZshCompletion };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RuntimeAdapter } from "../../runtime/adapter.mjs";
|
|
2
|
-
import { ManifestDiscoveryOptions, PackageJsonAdapter, PackageJsonData, PackageRepository, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl } from "./package-json.mjs";
|
|
3
|
-
|
|
2
|
+
import { ManifestDiscoveryOptions, PackageJsonAdapter, PackageJsonData, PackageRepository, PackageRepositoryUrlOptions, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl } from "./package-json.mjs";
|
|
4
3
|
//#region src/core/config/index.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Format loader — parses file content into a config object.
|
|
@@ -158,4 +157,4 @@ declare function discoverConfig(appName: string, adapter: ConfigAdapter, options
|
|
|
158
157
|
*/
|
|
159
158
|
declare function configFormat(extensions: readonly string[], parse: (content: string) => unknown): FormatLoader;
|
|
160
159
|
//#endregion
|
|
161
|
-
export { type ConfigAdapter, type ConfigDiscoveryOptions, type ConfigDiscoveryResult, type ConfigFound, type ConfigNotFound, type FormatLoader, type ManifestDiscoveryOptions, type PackageJsonAdapter, type PackageJsonData, type PackageRepository, buildConfigSearchPaths, configFormat, discoverConfig, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl };
|
|
160
|
+
export { type ConfigAdapter, type ConfigDiscoveryOptions, type ConfigDiscoveryResult, type ConfigFound, type ConfigNotFound, type FormatLoader, type ManifestDiscoveryOptions, type PackageJsonAdapter, type PackageJsonData, type PackageRepository, type PackageRepositoryUrlOptions, buildConfigSearchPaths, configFormat, discoverConfig, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl };
|
|
@@ -1 +1,246 @@
|
|
|
1
|
-
import{CLIError
|
|
1
|
+
import { CLIError } from "../errors/index.mjs";
|
|
2
|
+
import { discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl } from "./package-json.mjs";
|
|
3
|
+
//#region src/core/config/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* Config file discovery and loading.
|
|
6
|
+
*
|
|
7
|
+
* Probes a prioritised list of candidate paths, reads the first match via
|
|
8
|
+
* {@link RuntimeAdapter.readFile}, and parses the content using an
|
|
9
|
+
* extension-based loader (JSON built-in, others additive via {@link FormatLoader}).
|
|
10
|
+
*
|
|
11
|
+
* The module is pure — all I/O flows through the adapter, making it fully
|
|
12
|
+
* testable with {@link createTestAdapter}'s virtual filesystem.
|
|
13
|
+
*
|
|
14
|
+
* @module dreamcli/core/config
|
|
15
|
+
*/
|
|
16
|
+
/** @internal */
|
|
17
|
+
function isPlainObject(value) {
|
|
18
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
19
|
+
const proto = Object.getPrototypeOf(value);
|
|
20
|
+
return proto === Object.prototype || proto === null;
|
|
21
|
+
}
|
|
22
|
+
/** @internal */
|
|
23
|
+
const jsonLoader = {
|
|
24
|
+
extensions: ["json"],
|
|
25
|
+
parse: (content) => {
|
|
26
|
+
const parsed = JSON.parse(content);
|
|
27
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) throw new Error("Config must be a JSON object");
|
|
28
|
+
return parsed;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Join path segments using the separator detected from the base path.
|
|
33
|
+
*
|
|
34
|
+
* Avoids importing `node:path` — the base path is already platform-native
|
|
35
|
+
* (comes from `adapter.cwd` / `adapter.configDir`), so we infer the
|
|
36
|
+
* separator from its content.
|
|
37
|
+
*
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
function joinPath(base, ...segments) {
|
|
41
|
+
const sep = base.includes("\\") ? "\\" : "/";
|
|
42
|
+
return [base, ...segments].join(sep);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Extract the file extension (without leading dot, lowercased).
|
|
46
|
+
* Returns empty string when no extension is present.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
function getExtension(path) {
|
|
51
|
+
const lastDot = path.lastIndexOf(".");
|
|
52
|
+
if (lastDot <= Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"))) return "";
|
|
53
|
+
return path.slice(lastDot + 1).toLowerCase();
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Build the default config search paths for an app.
|
|
57
|
+
*
|
|
58
|
+
* Advanced helper used by DreamCLI's config discovery. Most apps should call
|
|
59
|
+
* `.config()` or {@link discoverConfig} instead of constructing search paths
|
|
60
|
+
* manually. Exported for debugging, custom discovery flows, and help text.
|
|
61
|
+
*
|
|
62
|
+
* Search order (first match wins):
|
|
63
|
+
* 1. `$CWD/.{appName}.json` — dotfile in project root
|
|
64
|
+
* 2. `$CWD/{appName}.config.json` — explicit config in project root
|
|
65
|
+
* 3. `$CONFIG_DIR/{appName}/config.json` — XDG / AppData standard
|
|
66
|
+
* (`$XDG_CONFIG_HOME` / `~/.config` on Unix,
|
|
67
|
+
* `%APPDATA%` / `%USERPROFILE%\\AppData\\Roaming` on Windows)
|
|
68
|
+
*
|
|
69
|
+
* When custom {@link ConfigDiscoveryOptions.loaders | loaders} are registered,
|
|
70
|
+
* each path pattern is repeated per supported extension (JSON always first).
|
|
71
|
+
*
|
|
72
|
+
* @param appName - CLI application name used to derive config filenames.
|
|
73
|
+
* @param cwd - Current working directory (project-root search location).
|
|
74
|
+
* @param configDir - Platform config directory (XDG / AppData).
|
|
75
|
+
* @param loaders - Optional custom {@link FormatLoader}s whose extensions expand the search set.
|
|
76
|
+
* @returns Ordered list of candidate config file paths (first match wins).
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const paths = buildConfigSearchPaths('mycli', '/repo', '/home/me/.config');
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
function buildConfigSearchPaths(appName, cwd, configDir, loaders) {
|
|
84
|
+
const extensions = buildExtensionList(loaders);
|
|
85
|
+
const paths = [];
|
|
86
|
+
for (const ext of extensions) paths.push(joinPath(cwd, `.${appName}.${ext}`));
|
|
87
|
+
for (const ext of extensions) paths.push(joinPath(cwd, `${appName}.config.${ext}`));
|
|
88
|
+
for (const ext of extensions) paths.push(joinPath(configDir, appName, `config.${ext}`));
|
|
89
|
+
return paths;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Collect unique extensions from the built-in JSON loader + any custom loaders.
|
|
93
|
+
* JSON always comes first. Order otherwise matches loader registration order.
|
|
94
|
+
*
|
|
95
|
+
* @param loaders - Optional custom {@link FormatLoader}s to append after JSON.
|
|
96
|
+
* @returns Deduplicated, lowercased extension list (JSON first).
|
|
97
|
+
*
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
function buildExtensionList(loaders) {
|
|
101
|
+
const seen = /* @__PURE__ */ new Set();
|
|
102
|
+
const result = [];
|
|
103
|
+
for (const ext of jsonLoader.extensions) {
|
|
104
|
+
const lower = ext.toLowerCase();
|
|
105
|
+
if (!seen.has(lower)) {
|
|
106
|
+
seen.add(lower);
|
|
107
|
+
result.push(lower);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (loaders !== void 0) for (const loader of loaders) for (const ext of loader.extensions) {
|
|
111
|
+
const lower = ext.toLowerCase();
|
|
112
|
+
if (!seen.has(lower)) {
|
|
113
|
+
seen.add(lower);
|
|
114
|
+
result.push(lower);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Build extension → loader lookup. Later loaders for the same extension
|
|
121
|
+
* override earlier ones (allows user to replace the built-in JSON loader).
|
|
122
|
+
*
|
|
123
|
+
* @param loaders - Optional custom {@link FormatLoader}s (later entries override earlier for same extension).
|
|
124
|
+
* @returns Map from lowercased extension to its {@link FormatLoader}.
|
|
125
|
+
*
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
128
|
+
function buildLoaderMap(loaders) {
|
|
129
|
+
const map = /* @__PURE__ */ new Map();
|
|
130
|
+
for (const ext of jsonLoader.extensions) map.set(ext.toLowerCase(), jsonLoader);
|
|
131
|
+
if (loaders !== void 0) for (const loader of loaders) for (const ext of loader.extensions) map.set(ext.toLowerCase(), loader);
|
|
132
|
+
return map;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Discover and load a config file.
|
|
136
|
+
*
|
|
137
|
+
* Low-level discovery helper behind `CLIBuilder.config()`. Most apps should
|
|
138
|
+
* let the CLI runtime call this automatically; call it directly when testing
|
|
139
|
+
* config behavior or building custom bootstrapping around {@linkcode RuntimeAdapter}.
|
|
140
|
+
*
|
|
141
|
+
* Pure function — all filesystem I/O flows through `adapter.readFile`.
|
|
142
|
+
* Returns a discriminated union: `{ found: true, ... }` when a config
|
|
143
|
+
* file was found and parsed, `{ found: false }` when no file exists.
|
|
144
|
+
*
|
|
145
|
+
* @throws {CLIError} code `CONFIG_NOT_FOUND` — explicit `configPath` doesn't exist
|
|
146
|
+
* @throws {CLIError} code `CONFIG_PARSE_ERROR` — file exists but fails to parse
|
|
147
|
+
* @throws {CLIError} code `CONFIG_UNKNOWN_FORMAT` — no loader for the file extension
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* const result = await discoverConfig('mycli', adapter, {
|
|
152
|
+
* loaders: [
|
|
153
|
+
* configFormat(['yaml', 'yml'], Bun.YAML.parse),
|
|
154
|
+
* configFormat(['toml'], Bun.TOML.parse),
|
|
155
|
+
* ],
|
|
156
|
+
* });
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
async function discoverConfig(appName, adapter, options) {
|
|
160
|
+
const loaderMap = buildLoaderMap(options?.loaders);
|
|
161
|
+
const searchPaths = options?.configPath !== void 0 ? [options.configPath] : options?.searchPaths ?? buildConfigSearchPaths(appName, adapter.cwd, adapter.configDir, options?.loaders);
|
|
162
|
+
for (const candidatePath of searchPaths) {
|
|
163
|
+
const content = await adapter.readFile(candidatePath);
|
|
164
|
+
if (content === null) {
|
|
165
|
+
if (options?.configPath !== void 0) throw new CLIError(`Config file not found: ${candidatePath}`, {
|
|
166
|
+
code: "CONFIG_NOT_FOUND",
|
|
167
|
+
details: { path: candidatePath },
|
|
168
|
+
suggest: "Create the config file or remove the --config flag"
|
|
169
|
+
});
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
const ext = getExtension(candidatePath);
|
|
173
|
+
const loader = loaderMap.get(ext);
|
|
174
|
+
if (loader === void 0) throw new CLIError(`No loader registered for config format: .${ext}`, {
|
|
175
|
+
code: "CONFIG_UNKNOWN_FORMAT",
|
|
176
|
+
details: {
|
|
177
|
+
path: candidatePath,
|
|
178
|
+
extension: ext
|
|
179
|
+
},
|
|
180
|
+
suggest: `Supported formats: ${[...loaderMap.keys()].join(", ")}`
|
|
181
|
+
});
|
|
182
|
+
try {
|
|
183
|
+
const data = loader.parse(content);
|
|
184
|
+
if (!isPlainObject(data)) throw new Error("Config loader must return a plain object");
|
|
185
|
+
return {
|
|
186
|
+
found: true,
|
|
187
|
+
path: candidatePath,
|
|
188
|
+
data,
|
|
189
|
+
format: ext
|
|
190
|
+
};
|
|
191
|
+
} catch (cause) {
|
|
192
|
+
throw new CLIError(`Failed to parse config file: ${candidatePath}`, {
|
|
193
|
+
code: "CONFIG_PARSE_ERROR",
|
|
194
|
+
cause,
|
|
195
|
+
details: {
|
|
196
|
+
path: candidatePath,
|
|
197
|
+
format: ext,
|
|
198
|
+
message: cause instanceof Error ? cause.message : String(cause)
|
|
199
|
+
},
|
|
200
|
+
suggest: "Check the config file for syntax errors"
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return { found: false };
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Create a {@link FormatLoader} from extensions and a parse function.
|
|
208
|
+
*
|
|
209
|
+
* Convenience factory for config loading. It avoids manually constructing the
|
|
210
|
+
* `{ extensions, parse }` object and makes intent clearer at call sites.
|
|
211
|
+
*
|
|
212
|
+
* Later loaders registered for the same extension override earlier ones. Any
|
|
213
|
+
* error thrown by `parse` is wrapped by {@link discoverConfig} as
|
|
214
|
+
* `CONFIG_PARSE_ERROR`.
|
|
215
|
+
*
|
|
216
|
+
* @param extensions - File extensions this loader handles (without dot, e.g. `'yaml'`).
|
|
217
|
+
* @param parse - Parse function: takes file content string and returns a parsed config value.
|
|
218
|
+
* @returns A {@link FormatLoader} ready to pass to {@link ConfigDiscoveryOptions.loaders}.
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* ```ts
|
|
222
|
+
* import { cli, configFormat } from '@kjanat/dreamcli';
|
|
223
|
+
* import { parse as parseYaml } from 'yaml';
|
|
224
|
+
* import { parse as parseTOML } from '@iarna/toml';
|
|
225
|
+
*
|
|
226
|
+
* const yamlPackageLoader = configFormat(['yaml', 'yml'], parseYaml);
|
|
227
|
+
* const tomlPackageLoader = configFormat(['toml'], parseTOML);
|
|
228
|
+
* // Or with Bun's built-in parsers:
|
|
229
|
+
* // const yamlLoader = configFormat(['yaml', 'yml'], Bun.YAML.parse);
|
|
230
|
+
* // const tomlLoader = configFormat(['toml'], Bun.TOML.parse);
|
|
231
|
+
*
|
|
232
|
+
* cli('myapp')
|
|
233
|
+
* .config('myapp')
|
|
234
|
+
* .configLoader(yamlLoader)
|
|
235
|
+
* .configLoader(tomlLoader)
|
|
236
|
+
* .run();
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
function configFormat(extensions, parse) {
|
|
240
|
+
return {
|
|
241
|
+
extensions,
|
|
242
|
+
parse
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
//#endregion
|
|
246
|
+
export { buildConfigSearchPaths, configFormat, discoverConfig, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RuntimeAdapter } from "../../runtime/adapter.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/core/config/package-json.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Object form of the package.json `repository` field
|
|
@@ -133,6 +132,20 @@ declare function discoverManifest(adapter: PackageJsonAdapter, options?: Manifes
|
|
|
133
132
|
* ```
|
|
134
133
|
*/
|
|
135
134
|
declare function discoverPackageJson(adapter: PackageJsonAdapter, startDir?: string): Promise<PackageJsonData | null>;
|
|
135
|
+
/** Options for {@link packageRepositoryUrl}. */
|
|
136
|
+
interface PackageRepositoryUrlOptions {
|
|
137
|
+
/**
|
|
138
|
+
* Throw a `CLIError` (code `INVALID_REPOSITORY`) instead of returning
|
|
139
|
+
* `undefined` when the `repository` field is absent or not a recognisable
|
|
140
|
+
* locator. With `require: true` the return type narrows to `string`, so
|
|
141
|
+
* callers that know their manifest carries a valid repository need no
|
|
142
|
+
* assertion — and a bad manifest fails fast with a real message instead
|
|
143
|
+
* of propagating `undefined`.
|
|
144
|
+
*
|
|
145
|
+
* @defaultValue `false`
|
|
146
|
+
*/
|
|
147
|
+
readonly require?: boolean;
|
|
148
|
+
}
|
|
136
149
|
/**
|
|
137
150
|
* Resolve a package's `repository` field to a browsable `https://` URL.
|
|
138
151
|
*
|
|
@@ -143,15 +156,25 @@ declare function discoverPackageJson(adapter: PackageJsonAdapter, startDir?: str
|
|
|
143
156
|
* - shorthands: `github:u/r`, `gitlab:u/r`, `bitbucket:u/r`, and bare `u/r`
|
|
144
157
|
* (GitHub, per npm convention)
|
|
145
158
|
*
|
|
146
|
-
* Returns `undefined` when the field is absent or unrecognised
|
|
159
|
+
* Returns `undefined` when the field is absent or unrecognised — or, with
|
|
160
|
+
* `{ require: true }`, throws instead and the return type is `string`.
|
|
161
|
+
* (The narrowing cannot key off the input type alone: a present `repository`
|
|
162
|
+
* may still be an empty string, a url-less object, or an unparseable
|
|
163
|
+
* locator, so the `string` promise is backed by the runtime check.)
|
|
147
164
|
*
|
|
148
165
|
* @example
|
|
149
166
|
* ```ts
|
|
150
167
|
* packageRepositoryUrl({ repository: 'git+https://github.com/u/r.git' });
|
|
151
168
|
* // 'https://github.com/u/r'
|
|
169
|
+
*
|
|
170
|
+
* const url: string = packageRepositoryUrl(pkg, { require: true });
|
|
171
|
+
* // throws CLIError when pkg.repository is missing or unrecognised
|
|
152
172
|
* ```
|
|
153
173
|
*/
|
|
154
|
-
declare function packageRepositoryUrl(pkg: PackageJsonData
|
|
174
|
+
declare function packageRepositoryUrl(pkg: PackageJsonData, options: PackageRepositoryUrlOptions & {
|
|
175
|
+
readonly require: true;
|
|
176
|
+
}): string;
|
|
177
|
+
declare function packageRepositoryUrl(pkg: PackageJsonData, options?: PackageRepositoryUrlOptions): string | undefined;
|
|
155
178
|
/**
|
|
156
179
|
* Infer the CLI binary name from manifest data.
|
|
157
180
|
*
|
|
@@ -183,4 +206,4 @@ declare function inferCliName(pkg: PackageJsonData, options?: {
|
|
|
183
206
|
readonly stripScope?: boolean;
|
|
184
207
|
}): string | undefined;
|
|
185
208
|
//#endregion
|
|
186
|
-
export { type ManifestDiscoveryOptions, type PackageJsonAdapter, type PackageJsonData, type PackageRepository, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl };
|
|
209
|
+
export { type ManifestDiscoveryOptions, type PackageJsonAdapter, type PackageJsonData, type PackageRepository, type PackageRepositoryUrlOptions, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl };
|