@kjanat/dreamcli 2.4.1 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,26 +39,88 @@ interface PackageJsonData {
39
39
  * dependency explicit.
40
40
  */
41
41
  type PackageJsonAdapter = Pick<RuntimeAdapter, 'readFile' | 'cwd'>;
42
+ /** Options for {@link discoverManifest}. */
43
+ interface ManifestDiscoveryOptions {
44
+ /**
45
+ * Explicit directory or file path to walk up from. Defaults to
46
+ * `adapter.cwd` when omitted. Pass an absolute path inside your own package
47
+ * (e.g. `fileURLToPath(import.meta.url)`) for installable CLIs whose version
48
+ * should reflect the CLI's own package, not the consumer's working directory.
49
+ *
50
+ * This low-level helper takes a resolved path **string** only. The builder
51
+ * sugar `CLIBuilder.manifest({ from })` exposes the same anchor under the name
52
+ * `from` and additionally accepts a `file:` URL string or `URL` instance,
53
+ * normalizing it to a path first.
54
+ */
55
+ readonly startDir?: string;
56
+ /**
57
+ * Candidate manifest filenames, in per-directory priority order
58
+ * (e.g. `['deno.json', 'jsr.json']`). At each directory the first existing
59
+ * file that carries CLI metadata wins, so the nearest manifest directory
60
+ * always takes precedence over file order. A file that parses but holds no
61
+ * recognised metadata (e.g. a config-only `deno.json` with just
62
+ * `tasks`/`imports`) is skipped, so a sibling `jsr.json` — or a manifest
63
+ * higher up — can still be found. Defaults to `['package.json']`.
64
+ *
65
+ * An empty list is a deliberate no-op: with no candidates to probe, the
66
+ * walk-up reads nothing and resolves to `null` (consistent with the
67
+ * "returns `null` when no manifest is found" contract).
68
+ */
69
+ readonly files?: readonly string[];
70
+ }
71
+ /**
72
+ * Discover the nearest manifest (`package.json`, `deno.json`, `jsr.json`, …)
73
+ * by walking up from `startDir` (or `adapter.cwd` when omitted).
74
+ *
75
+ * Convenience helper behind `CLIBuilder.manifest()`. Most apps should let the
76
+ * CLI runtime discover metadata automatically; call this directly when testing
77
+ * metadata inference or embedding the behavior in custom tooling.
78
+ *
79
+ * Candidate files are parsed as JSON with a JSONC fallback — `package.json`,
80
+ * `deno.json`, `jsr.json`, and `deno.jsonc` all qualify, including files that
81
+ * carry `//` / block comments or trailing commas (common in `deno.json`). A
82
+ * file that fails both parses is skipped, so discovery keeps probing.
83
+ *
84
+ * Returns the parsed metadata on success, `null` when no manifest is found
85
+ * (not an error). Malformed JSON, non-object roots, and config-only manifests
86
+ * that carry no recognised metadata (e.g. a `deno.json` with only `tasks` /
87
+ * `imports`) are all skipped, so discovery keeps probing the remaining
88
+ * candidate files and parent directories — the feature is a convenience, not a
89
+ * hard requirement.
90
+ *
91
+ * @param adapter - Adapter providing `readFile` + `cwd`.
92
+ * @param options - Optional anchor (`startDir`) and candidate filenames (`files`).
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * import { discoverManifest } from '@kjanat/dreamcli';
97
+ *
98
+ * const meta = await discoverManifest(adapter, { files: ['deno.json', 'jsr.json'] });
99
+ * if (meta !== null) {
100
+ * console.log(meta.version); // '1.2.3'
101
+ * }
102
+ * ```
103
+ */
104
+ declare function discoverManifest(adapter: PackageJsonAdapter, options?: ManifestDiscoveryOptions): Promise<PackageJsonData | null>;
42
105
  /**
43
106
  * Discover the nearest `package.json` by walking up from `startDir` (or
44
107
  * `adapter.cwd` when omitted).
45
108
  *
46
- * Convenience helper behind `CLIBuilder.packageJson()`. Most apps should let
47
- * the CLI runtime discover package metadata automatically; call this directly
48
- * when testing metadata inference or embedding the behavior in custom tooling.
109
+ * @deprecated Use {@link discoverManifest} with `{ files: ['package.json'] }`
110
+ * (the default), which also supports `deno.json` / `jsr.json`.
49
111
  *
50
- * Returns the parsed metadata on success, `null` when no `package.json`
51
- * is found (not an error). Malformed JSON and non-object roots also
52
- * return `null` — the feature is a convenience, not a hard requirement.
112
+ * Behavior note (changed by the manifest generalization): a parseable but
113
+ * metadata-less `package.json` — `{}`, or one carrying only non-metadata fields
114
+ * such as `dependencies` / `scripts` / `type` — is no longer treated as a
115
+ * discovery hit. Previously such a file halted the walk-up and resolved to `{}`;
116
+ * now it is skipped and the walk-up CONTINUES to parent directories. In a
117
+ * monorepo this means a metadata-less leaf `package.json` no longer shadows an
118
+ * ancestor manifest, so an ancestor's `version` can surface where the old
119
+ * behavior returned `{}`. Pass pre-loaded `data` (or use {@link discoverManifest}
120
+ * with an explicit `startDir`) when you need to pin discovery to one directory.
53
121
  *
54
122
  * @param adapter - Adapter providing `readFile` + `cwd`.
55
123
  * @param startDir - Optional explicit directory or file path to walk up from.
56
- * Pass an absolute path inside your own package (e.g.
57
- * `fileURLToPath(import.meta.url)`) when authoring an installable CLI whose
58
- * version should reflect the CLI's own package, not the consumer's working
59
- * directory. Defaults to `adapter.cwd` when `undefined`. A file path is
60
- * probed as a directory first (yielding nothing) before the walk-up reaches
61
- * its real parent directory, so passing `import.meta.url` resolves correctly.
62
124
  *
63
125
  * @example
64
126
  * ```ts
@@ -91,23 +153,34 @@ declare function discoverPackageJson(adapter: PackageJsonAdapter, startDir?: str
91
153
  */
92
154
  declare function packageRepositoryUrl(pkg: PackageJsonData): string | undefined;
93
155
  /**
94
- * Infer the CLI binary name from package.json data.
156
+ * Infer the CLI binary name from manifest data.
95
157
  *
96
158
  * Resolution order:
97
159
  * 1. First key of `bin` object (e.g. `{"mycli": "./dist/cli.js"}` → `"mycli"`)
98
- * 2. Package `name` with scope stripped (e.g. `"@scope/mycli"` → `"mycli"`)
160
+ * 2. Package `name`, scope stripped by default (e.g. `"@scope/mycli"` → `"mycli"`);
161
+ * pass `{ stripScope: false }` to keep the full scoped name
99
162
  * 3. `undefined` if neither exists
100
163
  *
164
+ * Note: `bin` keys are never scoped, so `stripScope` only affects the `name`
165
+ * fallback (relevant for `deno.json` / `jsr.json`, which have no `bin` field).
166
+ *
167
+ * @param pkg - Parsed manifest metadata.
168
+ * @param options - `stripScope` (default `true`): strip a leading `@scope/`
169
+ * from the `name` fallback.
170
+ *
101
171
  * @example
102
172
  * ```ts
103
173
  * import { inferCliName } from '@kjanat/dreamcli';
104
174
  *
105
- * inferCliName({ bin: { mycli: './dist/cli.js' } }); // 'mycli'
106
- * inferCliName({ name: '@scope/mycli' }); // 'mycli'
107
- * inferCliName({ name: 'mycli' }); // 'mycli'
108
- * inferCliName({}); // undefined
175
+ * inferCliName({ bin: { mycli: './dist/cli.js' } }); // 'mycli'
176
+ * inferCliName({ name: '@scope/mycli' }); // 'mycli'
177
+ * inferCliName({ name: '@scope/mycli' }, { stripScope: false }); // '@scope/mycli'
178
+ * inferCliName({ name: 'mycli' }); // 'mycli'
179
+ * inferCliName({}); // undefined
109
180
  * ```
110
181
  */
111
- declare function inferCliName(pkg: PackageJsonData): string | undefined;
182
+ declare function inferCliName(pkg: PackageJsonData, options?: {
183
+ readonly stripScope?: boolean;
184
+ }): string | undefined;
112
185
  //#endregion
113
- export { type PackageJsonAdapter, type PackageJsonData, type PackageRepository, discoverPackageJson, inferCliName, packageRepositoryUrl };
186
+ export { type ManifestDiscoveryOptions, type PackageJsonAdapter, type PackageJsonData, type PackageRepository, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl };
@@ -1 +1,3 @@
1
- import{stripTrailing as e}from"../../strings.mjs";function t(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function n(e){let t=e.lastIndexOf(`/`),n=e.lastIndexOf(`\\`),r=Math.max(t,n),i=n>t?`\\`:`/`;if(r<0)return;if(r===0)return e.length>1?i:void 0;let a=e.slice(0,r);if(a.length===2&&a[1]===`:`){let t=`${a}${i}`;return t===e?void 0:t}return a}function r(e,t){let n=e.includes(`\\`)?`\\`:`/`;return e.endsWith(n)?`${e}${t}`:`${e}${n}${t}`}async function i(e,t){let i=t??e.cwd;for(;i!==void 0;){let t=null;try{t=await e.readFile(r(i,`package.json`))}catch{}if(t!==null){let e=a(t);if(e!==null)return e}i=n(i)}return null}function a(e){try{let n=JSON.parse(e);if(!t(n))return null;let r=typeof n.name==`string`?n.name:void 0,i=typeof n.version==`string`?n.version:void 0,a=typeof n.description==`string`?n.description:void 0,c=o(n.bin),l=typeof n.homepage==`string`?n.homepage:void 0,u=s(n.repository);return{...r===void 0?{}:{name:r},...i===void 0?{}:{version:i},...a===void 0?{}:{description:a},...c===void 0?{}:{bin:c},...l===void 0?{}:{homepage:l},...u===void 0?{}:{repository:u}}}catch{return null}}function o(e){if(typeof e==`string`)return e;if(!t(e))return;let n={};for(let[t,r]of Object.entries(e)){if(typeof r!=`string`)return;n[t]=r}return n}function s(e){if(typeof e==`string`)return e;if(!t(e))return;let n=typeof e.type==`string`?e.type:void 0,r=typeof e.url==`string`?e.url:void 0,i=typeof e.directory==`string`?e.directory:void 0;if(!(n===void 0&&r===void 0&&i===void 0))return{...n===void 0?{}:{type:n},...r===void 0?{}:{url:r},...i===void 0?{}:{directory:i}}}const c={github:`https://github.com`,gitlab:`https://gitlab.com`,bitbucket:`https://bitbucket.org`};function l(e){return e.endsWith(`.git`)?e.slice(0,-4):e}function u(t){let n=typeof t.repository==`string`?t.repository:t.repository?.url;if(n===void 0)return;let r=n.trim();if(r.length===0)return;let i=/^(github|gitlab|bitbucket):([^/]+\/[^/]+)$/.exec(r);if(i!==null&&i[1]!==void 0&&i[2]!==void 0){let e=c[i[1]];if(e!==void 0)return`${e}/${l(i[2])}`}if(/^[\w.-]+\/[\w.-]+$/.test(r))return`https://github.com/${l(r)}`;r.startsWith(`git+`)&&(r=r.slice(4));let a=/^git@([^:/]+):(.+)$/.exec(r);if(a!==null&&a[1]!==void 0&&a[2]!==void 0)return`https://${a[1]}/${l(e(a[2],[47]))}`;if(/^(?:https?|git|ssh):\/\//.test(r))try{let t=new URL(r),n=l(e(t.pathname,[47]));return`https://${t.hostname}${n}`}catch{return}}function d(e){if(typeof e.bin==`object`){let t=Object.keys(e.bin);if(t.length>0&&t[0]!==void 0)return t[0]}if(e.name!==void 0){let t=e.name.indexOf(`/`);return t>=0?e.name.slice(t+1):e.name}}export{i as discoverPackageJson,d as inferCliName,u as packageRepositoryUrl};
1
+ import{stripTrailing as e}from"../../strings.mjs";function t(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function n(e){let t=e.lastIndexOf(`/`),n=e.lastIndexOf(`\\`),r=Math.max(t,n),i=n>t?`\\`:`/`;if(r<0)return;if(r===0)return e.length>1?i:void 0;let a=e.slice(0,r);if(a.length===2&&a[1]===`:`){let t=`${a}${i}`;return t===e?void 0:t}return a}function r(e,t){let n=e.includes(`\\`)?`\\`:`/`;return e.endsWith(n)?`${e}${t}`:`${e}${n}${t}`}const i=[`package.json`];function a(e){return e.name!==void 0||e.version!==void 0||e.description!==void 0||e.bin!==void 0||e.homepage!==void 0||e.repository!==void 0}async function o(e,t={}){let o=t.files??i,s=t.startDir??e.cwd;for(;s!==void 0;){for(let t of o){let n=null;try{n=await e.readFile(r(s,t))}catch{}if(n!==null){let e=u(n);if(e!==null&&a(e))return e}}s=n(s)}return null}async function s(e,t){return o(e,t===void 0?{}:{startDir:t})}function c(e){return e===` `||e===` `||e===`
2
+ `||e===`\r`}function l(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;i+=1){let a=e[i]??``;if(n){t+=a,r?r=!1:a===`\\`?r=!0:a===`"`&&(n=!1);continue}if(a===`"`){n=!0,t+=a;continue}if(a===`/`&&e[i+1]===`/`){for(i+=2;i<e.length&&e[i]!==`
3
+ `;)i+=1;--i;continue}if(a===`/`&&e[i+1]===`*`){for(i+=2;i<e.length&&!(e[i]===`*`&&e[i+1]===`/`);)i+=1;i+=1;continue}t+=a}let i=``;n=!1,r=!1;for(let e=0;e<t.length;e+=1){let a=t[e]??``;if(n){i+=a,r?r=!1:a===`\\`?r=!0:a===`"`&&(n=!1);continue}if(a===`"`){n=!0,i+=a;continue}if(a===`,`){let n=e+1;for(;n<t.length&&c(t[n]??``);)n+=1;let r=t[n];if(r===`}`||r===`]`)continue}i+=a}return i}function u(e){let n;try{n=JSON.parse(e)}catch{try{n=JSON.parse(l(e))}catch{return null}}try{if(!t(n))return null;let e=typeof n.name==`string`?n.name:void 0,r=typeof n.version==`string`?n.version:void 0,i=typeof n.description==`string`?n.description:void 0,a=d(n.bin),o=typeof n.homepage==`string`?n.homepage:void 0,s=f(n.repository);return{...e===void 0?{}:{name:e},...r===void 0?{}:{version:r},...i===void 0?{}:{description:i},...a===void 0?{}:{bin:a},...o===void 0?{}:{homepage:o},...s===void 0?{}:{repository:s}}}catch{return null}}function d(e){if(typeof e==`string`)return e;if(!t(e))return;let n={};for(let[t,r]of Object.entries(e)){if(typeof r!=`string`)return;n[t]=r}return n}function f(e){if(typeof e==`string`)return e;if(!t(e))return;let n=typeof e.type==`string`?e.type:void 0,r=typeof e.url==`string`?e.url:void 0,i=typeof e.directory==`string`?e.directory:void 0;if(!(n===void 0&&r===void 0&&i===void 0))return{...n===void 0?{}:{type:n},...r===void 0?{}:{url:r},...i===void 0?{}:{directory:i}}}const p={github:`https://github.com`,gitlab:`https://gitlab.com`,bitbucket:`https://bitbucket.org`};function m(e){return e.endsWith(`.git`)?e.slice(0,-4):e}function h(t){let n=typeof t.repository==`string`?t.repository:t.repository?.url;if(n===void 0)return;let r=n.trim();if(r.length===0)return;let i=/^(github|gitlab|bitbucket):([^/]+\/[^/]+)$/.exec(r);if(i!==null&&i[1]!==void 0&&i[2]!==void 0){let e=p[i[1]];if(e!==void 0)return`${e}/${m(i[2])}`}if(/^[\w.-]+\/[\w.-]+$/.test(r))return`https://github.com/${m(r)}`;r.startsWith(`git+`)&&(r=r.slice(4));let a=/^git@([^:/]+):(.+)$/.exec(r);if(a!==null&&a[1]!==void 0&&a[2]!==void 0)return`https://${a[1]}/${m(e(a[2],[47]))}`;if(/^(?:https?|git|ssh):\/\//.test(r))try{let t=new URL(r),n=m(e(t.pathname,[47]));return`https://${t.hostname}${n}`}catch{return}}function g(e,t={}){if(typeof e.bin==`object`){let t=Object.keys(e.bin);if(t.length>0&&t[0]!==void 0)return t[0]}if(e.name!==void 0){if(t.stripScope===!1)return e.name;let n=e.name.indexOf(`/`);return n>=0?e.name.slice(n+1):e.name}}export{o as discoverManifest,s as discoverPackageJson,g as inferCliName,h as packageRepositoryUrl};
package/dist/index.d.mts CHANGED
@@ -16,7 +16,7 @@ import { osc8, visibleWidth } from "./core/help/ansi.mjs";
16
16
  import { HelpOptions, formatHelp } from "./core/help/index.mjs";
17
17
  import { RunResult } from "./core/schema/run.mjs";
18
18
  import { ActionHandler, ActionParams, AnyCommandBuilder, CommandArgEntry, CommandBuilder, CommandConfig, CommandExample, CommandMeta, CommandSchema, DeriveHandler, DeriveParams, InteractiveParams, InteractiveResolver, InteractiveResult, Out, command, group } from "./core/schema/command.mjs";
19
- import { PackageJsonAdapter, PackageJsonData, PackageRepository, discoverPackageJson, inferCliName, packageRepositoryUrl } from "./core/config/package-json.mjs";
19
+ import { ManifestDiscoveryOptions, PackageJsonAdapter, PackageJsonData, PackageRepository, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl } from "./core/config/package-json.mjs";
20
20
  import { HelpLinks } from "./core/cli/help-links.mjs";
21
21
  import { CompletionOptions } from "./core/completion/shells/shared.mjs";
22
22
  import { generateBashCompletion } from "./core/completion/shells/bash.mjs";
@@ -25,6 +25,6 @@ import { generatePowerShellCompletion } from "./core/completion/shells/powershel
25
25
  import { generateZshCompletion } from "./core/completion/shells/zsh.mjs";
26
26
  import { SHELLS, Shell, generateCompletion } from "./core/completion/index.mjs";
27
27
  import { ConfigAdapter, ConfigDiscoveryOptions, ConfigDiscoveryResult, ConfigFound, ConfigNotFound, FormatLoader, buildConfigSearchPaths, configFormat, discoverConfig } from "./core/config/index.mjs";
28
- import { CLIBuilder, CLIOptions, CLIRunOptions, CLISchema, ConfigSettings, PackageJsonSettings, cli } from "./core/cli/index.mjs";
28
+ import { CLIBuilder, CLIOptions, CLIRunOptions, CLISchema, ConfigSettings, InferNameOption, ManifestPresetSettings, ManifestSettings, PackageJsonSettings, ResolvedManifestSettings, cli } from "./core/cli/index.mjs";
29
29
  import { JsonSchemaOptions, definitionMetaSchema, generateInputSchema, generateSchema } from "./core/json-schema/index.mjs";
30
- export { type ActionHandler, type ActionParams, type ActivityEvent, type AnyCommandBuilder, ArgBuilder, type ArgConfig, type ArgFactory, type ArgKind, type ArgParseFn, type ArgPresence, type ArgSchema, type BeforeParseParams, CLIBuilder, CLIError, type CLIErrorJSON, type CLIErrorOptions, type CLIOptions, type CLIPlugin, type CLIPluginHooks, type CLIRunOptions, type CLISchema, type CommandArgEntry, CommandBuilder, type CommandConfig, type CommandExample, type CommandMeta, type CommandSchema, type CompletionOptions, type ConfigAdapter, type ConfigDiscoveryOptions, type ConfigDiscoveryResult, type ConfigFound, type ConfigNotFound, type ConfigSettings, type ConfirmPromptConfig, type DeprecationWarning, type DeriveHandler, type DeriveParams, type ErrorCode, type Fallback, FlagBuilder, type FlagConfig, type FlagFactory, type FlagKind, type FlagParseFn, type FlagPresence, type FlagSchema, type FormatLoader, type HelpLinks, type HelpOptions, type InferArg, type InferArgs, type InferFlag, type InferFlags, type InputPromptConfig, type InteractiveParams, type InteractiveResolver, type InteractiveResult, type JsonSchemaOptions, type Middleware, type MiddlewareHandler, type MiddlewareParams, type MultiselectPromptConfig, type Out, type OutputOptions, type PackageJsonAdapter, type PackageJsonData, type PackageJsonSettings, type PackageRepository, ParseError, type ParseErrorCode, type ParseErrorOptions, type ParseResult, type PluginCommandContext, type ProgressHandle, type ProgressOptions, type PromptConfig, type PromptConfigBase, type PromptEngine, type PromptKind, type PromptResult, type ReadFn, type ResolveOptions, type ResolveResult, type ResolvedArgValue, type ResolvedCommandParams, type ResolvedMultiselectPromptConfig, type ResolvedPromptConfig, type ResolvedSelectPromptConfig, type ResolvedValue, type RunResult, SHELLS, type SelectChoice, type SelectPromptConfig, type Shell, type SpinnerHandle, type SpinnerOptions, type TableColumn, type TableFormat, type TableOptions, type TableStream, type Token, ValidationError, type ValidationErrorCode, type ValidationErrorOptions, type Verbosity, type WithArgPresence, type WithPresence, type WithVariadic, type WriteFn, arg, buildConfigSearchPaths, cli, command, configFormat, createArgSchema, createOutput, createSchema, createTerminalPrompter, definitionMetaSchema, discoverConfig, discoverPackageJson, flag, formatHelp, generateBashCompletion, generateCompletion, generateFishCompletion, generateInputSchema, generatePowerShellCompletion, generateSchema, generateZshCompletion, group, inferCliName, isCLIError, isParseError, isValidationError, middleware, osc8, packageRepositoryUrl, parse, plugin, resolve, resolvePromptConfig, tokenize, visibleWidth };
30
+ export { type ActionHandler, type ActionParams, type ActivityEvent, type AnyCommandBuilder, ArgBuilder, type ArgConfig, type ArgFactory, type ArgKind, type ArgParseFn, type ArgPresence, type ArgSchema, type BeforeParseParams, CLIBuilder, CLIError, type CLIErrorJSON, type CLIErrorOptions, type CLIOptions, type CLIPlugin, type CLIPluginHooks, type CLIRunOptions, type CLISchema, type CommandArgEntry, CommandBuilder, type CommandConfig, type CommandExample, type CommandMeta, type CommandSchema, type CompletionOptions, type ConfigAdapter, type ConfigDiscoveryOptions, type ConfigDiscoveryResult, type ConfigFound, type ConfigNotFound, type ConfigSettings, type ConfirmPromptConfig, type DeprecationWarning, type DeriveHandler, type DeriveParams, type ErrorCode, type Fallback, FlagBuilder, type FlagConfig, type FlagFactory, type FlagKind, type FlagParseFn, type FlagPresence, type FlagSchema, type FormatLoader, type HelpLinks, type HelpOptions, type InferArg, type InferArgs, type InferFlag, type InferFlags, type InferNameOption, type InputPromptConfig, type InteractiveParams, type InteractiveResolver, type InteractiveResult, type JsonSchemaOptions, type ManifestDiscoveryOptions, type ManifestPresetSettings, type ManifestSettings, type Middleware, type MiddlewareHandler, type MiddlewareParams, type MultiselectPromptConfig, type Out, type OutputOptions, type PackageJsonAdapter, type PackageJsonData, type PackageJsonSettings, type PackageRepository, ParseError, type ParseErrorCode, type ParseErrorOptions, type ParseResult, type PluginCommandContext, type ProgressHandle, type ProgressOptions, type PromptConfig, type PromptConfigBase, type PromptEngine, type PromptKind, type PromptResult, type ReadFn, type ResolveOptions, type ResolveResult, type ResolvedArgValue, type ResolvedCommandParams, type ResolvedManifestSettings, type ResolvedMultiselectPromptConfig, type ResolvedPromptConfig, type ResolvedSelectPromptConfig, type ResolvedValue, type RunResult, SHELLS, type SelectChoice, type SelectPromptConfig, type Shell, type SpinnerHandle, type SpinnerOptions, type TableColumn, type TableFormat, type TableOptions, type TableStream, type Token, ValidationError, type ValidationErrorCode, type ValidationErrorOptions, type Verbosity, type WithArgPresence, type WithPresence, type WithVariadic, type WriteFn, arg, buildConfigSearchPaths, cli, command, configFormat, createArgSchema, createOutput, createSchema, createTerminalPrompter, definitionMetaSchema, discoverConfig, discoverManifest, discoverPackageJson, flag, formatHelp, generateBashCompletion, generateCompletion, generateFishCompletion, generateInputSchema, generatePowerShellCompletion, generateSchema, generateZshCompletion, group, inferCliName, isCLIError, isParseError, isValidationError, middleware, osc8, packageRepositoryUrl, parse, plugin, resolve, resolvePromptConfig, tokenize, visibleWidth };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{FlagBuilder as e,createSchema as t,flag as n}from"./core/schema/flag.mjs";import{generateBashCompletion as r}from"./core/completion/shells/bash.mjs";import{generateFishCompletion as i}from"./core/completion/shells/fish.mjs";import{generatePowerShellCompletion as a}from"./core/completion/shells/powershell.mjs";import{CLIError as o,ParseError as s,ValidationError as c,isCLIError as l,isParseError as u,isValidationError as d}from"./core/errors/index.mjs";import{generateZshCompletion as f}from"./core/completion/shells/zsh.mjs";import{SHELLS as p,generateCompletion as m}from"./core/completion/index.mjs";import{osc8 as h,visibleWidth as g}from"./core/help/ansi.mjs";import{formatHelp as _}from"./core/help/index.mjs";import{createOutput as v}from"./core/output/index.mjs";import{parse as y,tokenize as b}from"./core/parse/index.mjs";import{createTerminalPrompter as x,resolvePromptConfig as S}from"./core/prompt/index.mjs";import{resolve as C}from"./core/resolve/index.mjs";import{ArgBuilder as w,arg as T,createArgSchema as E}from"./core/schema/arg.mjs";import{CommandBuilder as D,command as O,group as k}from"./core/schema/command.mjs";import{discoverPackageJson as A,inferCliName as j,packageRepositoryUrl as M}from"./core/config/package-json.mjs";import{plugin as N}from"./core/cli/plugin.mjs";import{buildConfigSearchPaths as P,configFormat as F,discoverConfig as I}from"./core/config/index.mjs";import{CLIBuilder as L,cli as R}from"./core/cli/index.mjs";import{definitionMetaSchema as z,generateInputSchema as B,generateSchema as V}from"./core/json-schema/index.mjs";import{middleware as H}from"./core/schema/middleware.mjs";export{w as ArgBuilder,L as CLIBuilder,o as CLIError,D as CommandBuilder,e as FlagBuilder,s as ParseError,p as SHELLS,c as ValidationError,T as arg,P as buildConfigSearchPaths,R as cli,O as command,F as configFormat,E as createArgSchema,v as createOutput,t as createSchema,x as createTerminalPrompter,z as definitionMetaSchema,I as discoverConfig,A as discoverPackageJson,n as flag,_ as formatHelp,r as generateBashCompletion,m as generateCompletion,i as generateFishCompletion,B as generateInputSchema,a as generatePowerShellCompletion,V as generateSchema,f as generateZshCompletion,k as group,j as inferCliName,l as isCLIError,u as isParseError,d as isValidationError,H as middleware,h as osc8,M as packageRepositoryUrl,y as parse,N as plugin,C as resolve,S as resolvePromptConfig,b as tokenize,g as visibleWidth};
1
+ import{FlagBuilder as e,createSchema as t,flag as n}from"./core/schema/flag.mjs";import{generateBashCompletion as r}from"./core/completion/shells/bash.mjs";import{generateFishCompletion as i}from"./core/completion/shells/fish.mjs";import{generatePowerShellCompletion as a}from"./core/completion/shells/powershell.mjs";import{CLIError as o,ParseError as s,ValidationError as c,isCLIError as l,isParseError as u,isValidationError as d}from"./core/errors/index.mjs";import{generateZshCompletion as f}from"./core/completion/shells/zsh.mjs";import{SHELLS as p,generateCompletion as m}from"./core/completion/index.mjs";import{osc8 as h,visibleWidth as g}from"./core/help/ansi.mjs";import{formatHelp as _}from"./core/help/index.mjs";import{createOutput as v}from"./core/output/index.mjs";import{parse as y,tokenize as b}from"./core/parse/index.mjs";import{createTerminalPrompter as x,resolvePromptConfig as S}from"./core/prompt/index.mjs";import{resolve as C}from"./core/resolve/index.mjs";import{ArgBuilder as w,arg as T,createArgSchema as E}from"./core/schema/arg.mjs";import{CommandBuilder as D,command as O,group as k}from"./core/schema/command.mjs";import{discoverManifest as A,discoverPackageJson as j,inferCliName as M,packageRepositoryUrl as N}from"./core/config/package-json.mjs";import{plugin as P}from"./core/cli/plugin.mjs";import{buildConfigSearchPaths as F,configFormat as I,discoverConfig as L}from"./core/config/index.mjs";import{CLIBuilder as R,cli as z}from"./core/cli/index.mjs";import{definitionMetaSchema as B,generateInputSchema as V,generateSchema as H}from"./core/json-schema/index.mjs";import{middleware as U}from"./core/schema/middleware.mjs";export{w as ArgBuilder,R as CLIBuilder,o as CLIError,D as CommandBuilder,e as FlagBuilder,s as ParseError,p as SHELLS,c as ValidationError,T as arg,F as buildConfigSearchPaths,z as cli,O as command,I as configFormat,E as createArgSchema,v as createOutput,t as createSchema,x as createTerminalPrompter,B as definitionMetaSchema,L as discoverConfig,A as discoverManifest,j as discoverPackageJson,n as flag,_ as formatHelp,r as generateBashCompletion,m as generateCompletion,i as generateFishCompletion,V as generateInputSchema,a as generatePowerShellCompletion,H as generateSchema,f as generateZshCompletion,k as group,M as inferCliName,l as isCLIError,u as isParseError,d as isValidationError,U as middleware,h as osc8,N as packageRepositoryUrl,y as parse,P as plugin,C as resolve,S as resolvePromptConfig,b as tokenize,g as visibleWidth};
package/dist/version.mjs CHANGED
@@ -1 +1 @@
1
- const e=`2.4.1`,t=`a683cd2`;export{t as DREAMCLI_REVISION,e as DREAMCLI_VERSION};
1
+ const e=`2.5.0`,t=`6d9491b`;export{t as DREAMCLI_REVISION,e as DREAMCLI_VERSION};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kjanat/dreamcli",
3
- "version": "2.4.1",
3
+ "version": "2.5.0",
4
4
  "description": "Schema-first, fully typed TypeScript CLI framework",
5
5
  "keywords": [
6
6
  "dreamcli",