@kjanat/dreamcli 3.0.0-rc.9 → 3.0.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.
- package/CHANGELOG.md +246 -1
- package/README.md +30 -13
- package/dist/core/cli/dispatch.mjs +0 -11
- package/dist/core/cli/index.d.mts +133 -9
- package/dist/core/cli/index.mjs +108 -21
- package/dist/core/cli/planner.mjs +7 -1
- package/dist/core/cli/root-help.mjs +5 -0
- package/dist/core/cli/runtime-preflight.d.mts +4 -0
- package/dist/core/cli/runtime-preflight.mjs +5 -3
- package/dist/core/completion/shells/shared.mjs +1 -0
- package/dist/core/config/index.d.mts +43 -12
- package/dist/core/config/index.mjs +55 -16
- package/dist/core/config/package-json.d.mts +1 -0
- package/dist/core/errors/index.d.mts +2 -2
- package/dist/core/execution/index.mjs +6 -2
- package/dist/core/help/ansi.d.mts +11 -5
- package/dist/core/help/ansi.mjs +14 -16
- package/dist/core/help/index.d.mts +22 -0
- package/dist/core/help/index.mjs +75 -25
- package/dist/core/json-schema/index.d.mts +7 -8
- package/dist/core/json-schema/index.mjs +271 -88
- package/dist/core/json-schema/meta-descriptions.generated.d.mts +40 -40
- package/dist/core/output/contracts.d.mts +5 -5
- package/dist/core/output/contracts.mjs +1 -1
- package/dist/core/output/index.d.mts +38 -1
- package/dist/core/output/index.mjs +37 -2
- package/dist/core/parse/index.mjs +9 -6
- package/dist/core/resolve/contracts.d.mts +7 -2
- package/dist/core/resolve/flags.d.mts +3 -1
- package/dist/core/resolve/flags.mjs +29 -12
- package/dist/core/resolve/index.mjs +6 -1
- package/dist/core/resolve/property.d.mts +1 -1
- package/dist/core/resolve/standard.d.mts +24 -0
- package/dist/core/resolve/standard.mjs +114 -0
- package/dist/core/schema/arg.d.mts +37 -2
- package/dist/core/schema/arg.mjs +5 -2
- package/dist/core/schema/command.d.mts +49 -7
- package/dist/core/schema/command.mjs +15 -5
- package/dist/core/schema/flag.d.mts +77 -9
- package/dist/core/schema/flag.mjs +7 -3
- package/dist/core/schema/index.d.mts +3 -2
- package/dist/core/schema/prompt.d.mts +1 -1
- package/dist/core/schema/run.d.mts +7 -0
- package/dist/core/schema/standard.d.mts +100 -0
- package/dist/core/schema/standard.mjs +15 -0
- package/dist/core/testkit/index.d.mts +7 -5
- package/dist/core/testkit/index.mjs +12 -7
- package/dist/index.d.mts +5 -4
- package/dist/index.mjs +4 -4
- package/dist/runtime/adapter.d.mts +33 -0
- package/dist/runtime/adapter.mjs +6 -1
- package/dist/runtime/deno.d.mts +4 -0
- package/dist/runtime/deno.mjs +4 -1
- package/dist/runtime/node.mjs +9 -1
- package/dist/version.mjs +2 -2
- package/dreamcli.schema.json +82 -0
- package/examples/basic.ts +2 -2
- package/examples/flag-types.ts +79 -0
- package/examples/gh/node_modules/typescript/LICENSE +55 -0
- package/examples/gh/node_modules/typescript/NOTICE.txt +436 -0
- package/examples/gh/node_modules/typescript/README.md +49 -0
- package/examples/gh/node_modules/typescript/bin/tsc +2 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.d.ts +529 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.js +1657 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.d.ts +39 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.js +211 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.d.ts +310 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.js +2 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.d.ts +109 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.js +2 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.d.ts +23 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.js +109 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.d.ts +15 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.js +74 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.js +287 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.d.ts +32 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.js +213 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.d.ts +76 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.d.ts +182 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.js +835 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.d.ts +62 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.js +122 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.js +298 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.d.ts +29 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.d.ts +4 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.js +241 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.js +30 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.d.ts +6 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.js +61 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/options.d.ts +32 -0
- package/examples/gh/node_modules/typescript/dist/api/options.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/options.js +11 -0
- package/examples/gh/node_modules/typescript/dist/api/options.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/path.d.ts +110 -0
- package/examples/gh/node_modules/typescript/dist/api/path.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/path.js +508 -0
- package/examples/gh/node_modules/typescript/dist/api/path.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.d.ts +239 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.js +37 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.d.ts +79 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.js +169 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.d.ts +529 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.js +1665 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.d.ts +30 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.js +124 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.d.ts +310 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.js +2 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.d.ts +114 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.js +508 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.d.ts +175 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.js +149 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.d.ts +100 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.d.ts +1161 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.js +4 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.js +7 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.d.ts +19 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.js +596 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.d.ts +16 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.js +104 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.d.ts +520 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.js +3057 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.d.ts +20 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.js +20 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.d.ts +35 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.d.ts +329 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.js +1103 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.js +233 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.d.ts +11 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.js +202 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.d.ts +97 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.js +2230 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.d.ts +17 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.js +67 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.d.ts +14 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.d.ts +50 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.js +978 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.js +47 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.d.ts +129 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.js +132 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.js +130 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.d.ts +28 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.js +30 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.js +30 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.d.ts +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.d.ts +12 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.d.ts +23 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.js +25 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.js +25 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.d.ts +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.d.ts +42 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.js +44 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.js +44 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.d.ts +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.d.ts +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.js +19 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.js +19 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.d.ts +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.d.ts +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.js +8 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.js +8 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.d.ts +36 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.js +38 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.js +38 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.d.ts +44 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.js +46 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.js +46 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.d.ts +50 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.js +52 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.js +52 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.d.ts +16 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.d.ts +13 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.d.ts +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.js +12 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.js +12 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.d.ts +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.d.ts +15 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.js +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.js +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.js +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.js +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.d.ts +71 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.js +73 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.js +73 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.d.ts +389 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.js +391 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.js +391 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.d.ts +30 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.js +32 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.js +32 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.d.ts +76 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.js +78 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.js +78 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.d.ts +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.d.ts +23 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.js +25 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.js.map +1 -0
- package/examples/gh/node_modules/typescript/lib/getExePath.d.ts +2 -0
- package/examples/gh/node_modules/typescript/lib/getExePath.js +70 -0
- package/examples/gh/node_modules/typescript/lib/tsc.js +28 -0
- package/examples/gh/node_modules/typescript/lib/version.cjs +3 -0
- package/examples/gh/node_modules/typescript/lib/version.d.cts +2 -0
- package/examples/gh/node_modules/typescript/package.json +87 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/License.txt +11 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/README.md +54 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/main.d.ts +17 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/main.js +83 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/ril.d.ts +22 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/ril.js +210 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/api.d.ts +14 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/api.js +87 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/cancellation.d.ts +32 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/cancellation.js +132 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/connection.d.ts +367 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/connection.js +1271 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/disposable.d.ts +9 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/disposable.js +16 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/encoding.d.ts +52 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/encoding.js +70 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/events.d.ts +39 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/events.js +135 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/is.d.ts +7 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/is.js +34 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/linkedMap.d.ts +55 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/linkedMap.js +412 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageBuffer.d.ts +18 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageBuffer.js +155 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageReader.d.ts +77 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageReader.js +246 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageWriter.d.ts +60 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageWriter.js +157 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messages.d.ts +369 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messages.js +436 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/ral.d.ts +74 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/ral.js +23 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/semaphore.d.ts +10 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/semaphore.js +74 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +15 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +77 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/main.d.ts +58 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/main.js +289 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/ril.d.ts +12 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/ril.js +163 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/package.json +54 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/typings/thenable.d.ts +5 -0
- package/examples/gh/package.json +11 -5
- package/examples/gh/src/main.ts +10 -4
- package/examples/help-config.ts +43 -0
- package/examples/json-mode.ts +8 -4
- package/examples/middleware.ts +1 -1
- package/examples/output-extras.ts +46 -0
- package/examples/parser-control.ts +40 -0
- package/examples/pwsh-demo/package.json +1 -1
- package/examples/pwsh-demo/src/main.ts +1 -1
- package/examples/standard-schema.ts +45 -0
- package/examples/transport-launcher.ts +10 -10
- package/package.json +25 -31
- package/dist/core/schema-dsl/runtime.d.mts +0 -144
- package/dist/core/schema-dsl/runtime.mjs +0 -271
- package/dist/core/schema-dsl/to-json-schema.d.mts +0 -29
- package/dist/core/schema-dsl/to-json-schema.mjs +0 -74
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,243 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [3.0.0] - 2026-07-21
|
|
11
|
+
|
|
12
|
+
The stable 3.0.0 release. It ships the code of 3.0.0-rc.20 plus the fix and
|
|
13
|
+
documentation below; the complete v3 feature record lives in the rc.1 - rc.20
|
|
14
|
+
sections that follow. Upgrading from 2.x is covered by the new
|
|
15
|
+
[upgrade guide](https://dreamcli.kjanat.dev/guide/upgrading-v3).
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- **`runCommand()` rejected `--quiet`/`-q`** — the testkit gained the root-flag
|
|
20
|
+
layer for `--json` in rc.1, but `--quiet` (added in rc.17) was never taught to
|
|
21
|
+
it, so copying a real `mycli --quiet …` invocation into a test failed with
|
|
22
|
+
`Unknown flag` (exit 2). Both spellings are now detected before the `--`
|
|
23
|
+
separator, set quiet verbosity, and are stripped before parsing; a literal
|
|
24
|
+
post-separator `--quiet` still reaches the command.
|
|
25
|
+
- **Mobile documentation hovers** — the twoslash bottom sheet collapsed to a
|
|
26
|
+
2px sliver (a transformed popper ancestor became the containing block for the
|
|
27
|
+
fixed sheet), its backdrop stayed over the page after dismissal, and closing a
|
|
28
|
+
popup disabled it permanently via an inline `display: none`.
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- **Upgrade guide** — `docs/guide/upgrading-v3.md` documents every 2.5.0 →
|
|
33
|
+
3.0.0 breaking and behavioral change with before/after code.
|
|
34
|
+
- **Five new examples** covering the v3 surface: `flag-types.ts` (url, path
|
|
35
|
+
with `create`, date, duration, bytes, count, keyValue, constraints, array
|
|
36
|
+
separator/unique), `parser-control.ts` (negatable, duplicates, spelling
|
|
37
|
+
parity), `standard-schema.ts` (Standard Schema v1 interop),
|
|
38
|
+
`help-config.ts` (themes, `flagOrder`, routable default, JSON help),
|
|
39
|
+
`output-extras.ts` (`out.color`, hyperlink gating, `setExitCode`).
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- **Examples modernized** — `basic.ts` uses function-form `.example()`,
|
|
44
|
+
`json-mode.ts` and `middleware.ts` use `out.status()` and document
|
|
45
|
+
`--quiet`, `transport-launcher.ts` replaces its hand-rolled port check
|
|
46
|
+
with declarative numeric constraints.
|
|
47
|
+
- **`skills/cli-creation` rewritten for v3** — corrected stale grounding paths
|
|
48
|
+
(`examples/standalone/`, `apps/docs/` no longer exist), rebuilt the pattern
|
|
49
|
+
cookbook around the v3 surface with every snippet type-checked against the
|
|
50
|
+
published types, and modernized the scaffolder templates (function-form
|
|
51
|
+
examples, declarative numeric constraints instead of hand-clamping,
|
|
52
|
+
`out.status()`, a `--quiet` test).
|
|
53
|
+
- **README refreshed** — the flag-types block lists the full v3 family
|
|
54
|
+
(dropping the `flag.custom` URL sample that `flag.url()` superseded), the
|
|
55
|
+
output sample shows `out.status()` / `out.setExitCode()` / `--quiet`, the
|
|
56
|
+
completions sample covers the eager-flag form and fixes a
|
|
57
|
+
`completion`/`completions` typo.
|
|
58
|
+
|
|
59
|
+
## [3.0.0-rc.20] - 2026-07-21
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
62
|
+
|
|
63
|
+
- **ansispeck `^0.4.1`** — bumped from `^0.2.0` (npm dependency and JSR
|
|
64
|
+
import map).
|
|
65
|
+
|
|
66
|
+
## [3.0.0-rc.19] - 2026-07-21
|
|
67
|
+
|
|
68
|
+
### Added
|
|
69
|
+
|
|
70
|
+
- **Expanded config discovery** (#61) — the default search now covers three
|
|
71
|
+
scopes, first match wins, no merging:
|
|
72
|
+
1. **Project**: the base directory (default `cwd`) and every ancestor up
|
|
73
|
+
to the filesystem root, nearest first, each probed for
|
|
74
|
+
`.{appName}.{ext}`, `{appName}.config.{ext}`, and the new
|
|
75
|
+
`.config/{appName}.{ext}` convention.
|
|
76
|
+
2. **User**: XDG / AppData as before, plus
|
|
77
|
+
`~/Library/Application Support/{appName}/config.{ext}` on macOS.
|
|
78
|
+
3. **System**: `/etc/{appName}/config.{ext}` on Linux and macOS.
|
|
79
|
+
- **`baseDir` discovery option** — `discoverConfig()` accepts a base
|
|
80
|
+
directory to anchor the project-scope walk somewhere other than `cwd`.
|
|
81
|
+
- **`RuntimeAdapter.userConfigDirs` / `systemConfigDirs`** — optional
|
|
82
|
+
ordered config roots supplied by the runtime adapters; discovery falls
|
|
83
|
+
back to `[configDir]` / `[]` when a custom adapter omits them.
|
|
84
|
+
|
|
85
|
+
### Changed
|
|
86
|
+
|
|
87
|
+
- **Breaking**: `buildConfigSearchPaths(appName, options)` replaces the
|
|
88
|
+
positional `(appName, cwd, configDir, loaders?)` signature; options carry
|
|
89
|
+
`baseDir`, `userConfigDirs`, `systemConfigDirs`, and `loaders`.
|
|
90
|
+
|
|
91
|
+
## [3.0.0-rc.18] - 2026-07-21
|
|
92
|
+
|
|
93
|
+
### Added
|
|
94
|
+
|
|
95
|
+
- **`flag.path({ type: 'directory', create: true })`** — creates the directory
|
|
96
|
+
(recursively) at resolution time when nothing exists at the path. Only
|
|
97
|
+
available with `type: 'directory'`, enforced at the type level. Creation
|
|
98
|
+
runs through a new `mkdir` seam: `RuntimeAdapter.mkdir`, overridable via
|
|
99
|
+
run options, noop in the test adapter, so `src/core` stays process-free.
|
|
100
|
+
|
|
101
|
+
### Fixed
|
|
102
|
+
|
|
103
|
+
- **`flag.path({ type, mustExist: false })` rejected missing paths** — the
|
|
104
|
+
builder recorded the explicit `mustExist: false`, but resolution errored on
|
|
105
|
+
any missing path whenever path checks were active, making an optional
|
|
106
|
+
to-be-created path (e.g. an `--outdir` that the command itself creates)
|
|
107
|
+
impossible to declare. A missing path now passes when `mustExist` is
|
|
108
|
+
`false`; an existing path is still type-checked.
|
|
109
|
+
|
|
110
|
+
## [3.0.0-rc.17] - 2026-07-20
|
|
111
|
+
|
|
112
|
+
### Added
|
|
113
|
+
|
|
114
|
+
- **`out.status()`** — a success/status line channel that writes to **stderr**
|
|
115
|
+
(stdout stays clean for piping) and is suppressed under quiet verbosity.
|
|
116
|
+
`info` remains stdout-bound; `warn`/`error` remain always-emitted.
|
|
117
|
+
- **Global `--quiet`/`-q` flag** — sets quiet verbosity on every CLI, wired
|
|
118
|
+
like `--json`: detected and stripped at the root before dispatch (command
|
|
119
|
+
schemas never see it), honoring the `--` separator so a literal `-q`
|
|
120
|
+
positional reaches the command unchanged. Listed under root help's
|
|
121
|
+
`Global options:`.
|
|
122
|
+
|
|
123
|
+
### Fixed
|
|
124
|
+
|
|
125
|
+
- **`.run()` misread a post-separator `--json`** — runtime preflight used a
|
|
126
|
+
naive `includes('--json')`, so `mycli cmd -- --json` entered JSON mode via
|
|
127
|
+
the adapter path even though `.execute()` correctly treats it as a
|
|
128
|
+
positional. Preflight now uses the `--`-aware detection.
|
|
129
|
+
|
|
130
|
+
## [3.0.0-rc.16] - 2026-07-20
|
|
131
|
+
|
|
132
|
+
### Added
|
|
133
|
+
|
|
134
|
+
- **`resolveRenderContext(argv, options?)`** — pre-`run()` probe returning the
|
|
135
|
+
output decisions the framework will make for a given argv: `jsonMode`
|
|
136
|
+
(`--`-aware `--json` detection), `isTTY`, the gated `color` palette, and
|
|
137
|
+
`isHyperlinkSupported`. Computed with the same composition `.execute()`/
|
|
138
|
+
`.run()` feed into the output channel, so content styled before `run()` —
|
|
139
|
+
banners, hand-rendered help — matches the channel that will actually render,
|
|
140
|
+
with zero argv re-parsing.
|
|
141
|
+
- **`includesBeforeSeparator` / `stripBeforeSeparator`** exported from the
|
|
142
|
+
package root — the `--`-aware root-flag primitives, for consumers who only
|
|
143
|
+
need correct flag detection.
|
|
144
|
+
|
|
145
|
+
## [3.0.0-rc.15] - 2026-07-20
|
|
146
|
+
|
|
147
|
+
### Added
|
|
148
|
+
|
|
149
|
+
- **Configurable flag order in help** — `.help({ flagOrder })` controls the
|
|
150
|
+
`Flags:` table order: `'alphabetical'` (default, short-aliased flags first
|
|
151
|
+
then alphabetical) or `'declaration'` (the order `.flag()` was called). For
|
|
152
|
+
full control, `.help({ sortFlags: (a, b) => number })` supplies a custom
|
|
153
|
+
comparator over flag names that wins over `flagOrder`. Both are also
|
|
154
|
+
accepted at runtime via `execute`/`run` `help` options.
|
|
155
|
+
|
|
156
|
+
## [3.0.0-rc.14] - 2026-07-20
|
|
157
|
+
|
|
158
|
+
### Added
|
|
159
|
+
|
|
160
|
+
- **Function-form examples** — `.example()` now accepts a
|
|
161
|
+
`(meta) => string` builder alongside the literal string. `meta` carries the
|
|
162
|
+
invoked program `name` (`help.binName`, falling back to the command name) and
|
|
163
|
+
`version`, resolved at render time, so examples reference the real program
|
|
164
|
+
name instead of hardcoding it and stay truthful under symlinks, `inheritName`,
|
|
165
|
+
and `npx x` vs a global install. The thunk resolves in both `--help` text
|
|
166
|
+
(composing with example highlighting) and `--json`/definition-schema output.
|
|
167
|
+
- **`ExampleMeta`** and **`ExampleCommand`** public types for annotating
|
|
168
|
+
function-form example builders.
|
|
169
|
+
|
|
170
|
+
## [3.0.0-rc.13] - 2026-07-20
|
|
171
|
+
|
|
172
|
+
### Changed
|
|
173
|
+
|
|
174
|
+
- **Syntax-highlighted example commands** — the `Examples:` help section now
|
|
175
|
+
highlights each command per token: the leading binary via `usageBin` (bold)
|
|
176
|
+
and flag tokens (`-x`, `--long`) via `flag` (cyan), with values left plain.
|
|
177
|
+
Tokenizing is quote-aware so `--scope './a b'` stays one token, and the
|
|
178
|
+
existing color gate is respected (identity formatters when `NO_COLOR` or
|
|
179
|
+
non-TTY), so `stripAnsi(colored)` still equals the plain rendering.
|
|
180
|
+
|
|
181
|
+
## [3.0.0-rc.12] - 2026-07-20
|
|
182
|
+
|
|
183
|
+
### Added
|
|
184
|
+
|
|
185
|
+
- **`out.isHyperlinkSupported`** — resolved OSC 8 hyperlink gate on the output
|
|
186
|
+
channel. Honors `NO_HYPERLINKS`/`FORCE_HYPERLINKS` and the
|
|
187
|
+
`--no-hyperlinks`/`--hyperlinks` flags, falling back to `isTTY`. Consumers
|
|
188
|
+
rendering their own `out.color.link(...)` output can gate on it to keep OSC 8
|
|
189
|
+
escapes out of piped or opted-out contexts.
|
|
190
|
+
- **Standard Schema v1 validation** — `flag.custom(schema)` and
|
|
191
|
+
`arg.custom(schema)` accept any conforming validator (including callable,
|
|
192
|
+
sync, and async schemas) with inferred output types and no runtime
|
|
193
|
+
dependency. Validation runs after source resolution, so argv, env, config,
|
|
194
|
+
prompt, stdin, and default values behave consistently; array flags and
|
|
195
|
+
variadic args validate each element.
|
|
196
|
+
- **`isMainModule(import.meta)`**: Compatibility helper for consumers whose
|
|
197
|
+
ambient `ImportMeta` interface omits `main`. Projects with normal Node, Bun,
|
|
198
|
+
or Deno runtime typings can keep using the conventional
|
|
199
|
+
`if (import.meta.main)` guard directly.
|
|
200
|
+
|
|
201
|
+
### Changed
|
|
202
|
+
|
|
203
|
+
- **`.manifest({ from: import.meta })` compatibility form**: Anchored manifest
|
|
204
|
+
discovery now also accepts the calling module's complete `import.meta`
|
|
205
|
+
object and extracts its URL internally. The conventional
|
|
206
|
+
`{ from: import.meta.url }` form remains supported and preferred when runtime
|
|
207
|
+
typings expose `url`. Together with `isMainModule(import.meta)`, the new forms
|
|
208
|
+
avoid global `ImportMeta` augmentation, allowing consumers with an empty
|
|
209
|
+
ambient `ImportMeta` interface to pass both TypeScript/Deno checks and JSR
|
|
210
|
+
publish validation.
|
|
211
|
+
|
|
212
|
+
### Removed
|
|
213
|
+
|
|
214
|
+
- **Internal schema DSL** — the private template-literal parser, validator, and
|
|
215
|
+
JSON Schema converter were replaced by direct definition-schema objects,
|
|
216
|
+
removing roughly 1,500 lines without changing the generated schema.
|
|
217
|
+
|
|
218
|
+
### Fixed
|
|
219
|
+
|
|
220
|
+
- **`NO_HYPERLINKS` ignored in the help header** — root-help header hyperlinks
|
|
221
|
+
gated on raw TTY status, so `NO_HYPERLINKS=1` (and `--no-hyperlinks`) still
|
|
222
|
+
emitted OSC 8 links in the header. The gate now consults
|
|
223
|
+
`out.isHyperlinkSupported`, which respects the standard hyperlink overrides.
|
|
224
|
+
|
|
225
|
+
## [3.0.0-rc.11] - 2026-07-15
|
|
226
|
+
|
|
227
|
+
### Fixed
|
|
228
|
+
|
|
229
|
+
- **JSR publish** — the Deno import map pinned `ansispeck` below `0.2.0`,
|
|
230
|
+
so the JSR build resolved an ansispeck whose `createColors` rejected
|
|
231
|
+
`osc8`'s two-argument call and failed type checking. The map now tracks
|
|
232
|
+
`^0.2.0` alongside the npm dependency. (rc.10 published to npm only.)
|
|
233
|
+
|
|
234
|
+
## [3.0.0-rc.10] - 2026-07-15
|
|
235
|
+
|
|
236
|
+
### Changed
|
|
237
|
+
|
|
238
|
+
- **`osc8()` link text is optional** — it now defaults to the link target, so
|
|
239
|
+
`osc8('https://x.dev')` renders as a hyperlink displaying its own URL.
|
|
240
|
+
Terminals without OSC 8 support still show a usable address. Passing an
|
|
241
|
+
explicit label is unchanged.
|
|
242
|
+
- **`osc8()` now delegates to `ansispeck`'s hyperlink constructor** — it emits
|
|
243
|
+
the **ST** (`ESC \`) terminator instead of **BEL** (`\x07`). Both are valid
|
|
244
|
+
OSC 8 terminators supported by modern terminals; the rendered link is
|
|
245
|
+
unchanged. This removes dreamcli's last hand-rolled escape-sequence code.
|
|
246
|
+
|
|
10
247
|
## [3.0.0-rc.9] - 2026-07-11
|
|
11
248
|
|
|
12
249
|
### Added
|
|
@@ -1198,7 +1435,15 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
1198
1435
|
- MIT License.
|
|
1199
1436
|
- Markdownlint configuration.
|
|
1200
1437
|
|
|
1201
|
-
[Unreleased]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.
|
|
1438
|
+
[Unreleased]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.17...HEAD
|
|
1439
|
+
[3.0.0-rc.17]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.16...v3.0.0-rc.17
|
|
1440
|
+
[3.0.0-rc.16]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.15...v3.0.0-rc.16
|
|
1441
|
+
[3.0.0-rc.15]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.14...v3.0.0-rc.15
|
|
1442
|
+
[3.0.0-rc.14]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.13...v3.0.0-rc.14
|
|
1443
|
+
[3.0.0-rc.13]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.12...v3.0.0-rc.13
|
|
1444
|
+
[3.0.0-rc.12]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.11...v3.0.0-rc.12
|
|
1445
|
+
[3.0.0-rc.11]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.10...v3.0.0-rc.11
|
|
1446
|
+
[3.0.0-rc.10]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.9...v3.0.0-rc.10
|
|
1202
1447
|
[3.0.0-rc.9]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.8...v3.0.0-rc.9
|
|
1203
1448
|
[3.0.0-rc.8]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.7...v3.0.0-rc.8
|
|
1204
1449
|
[3.0.0-rc.7]: https://github.com/kjanat/dreamcli/compare/v3.0.0-rc.6...v3.0.0-rc.7
|
package/README.md
CHANGED
|
@@ -92,9 +92,9 @@ cli('greet').default(greet).run();
|
|
|
92
92
|
### Multi-command CLI
|
|
93
93
|
|
|
94
94
|
<picture>
|
|
95
|
-
<source media="(prefers-color-scheme: dark)"
|
|
96
|
-
<source media="(prefers-color-scheme: light)"
|
|
97
|
-
<img alt="DreamCLI migration progress demo" width="700"
|
|
95
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/1ef7f20c-9ffb-4cb6-a6bc-fb562895aa6f">
|
|
96
|
+
<source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/1ee5f38d-cad8-47ec-94b2-c826eabab76b">
|
|
97
|
+
<img alt="DreamCLI migration progress demo" width="700" src="https://github.com/user-attachments/assets/1ee5f38d-cad8-47ec-94b2-c826eabab76b">
|
|
98
98
|
</picture>
|
|
99
99
|
|
|
100
100
|
```ts
|
|
@@ -208,7 +208,7 @@ Third-party plugins and custom glue can extend the other libraries.
|
|
|
208
208
|
| Built-in test harness with output capture | `runCommand()` + capture | No | No | No | No | No |
|
|
209
209
|
| Shell completions from command definitions | Built-in (bash/zsh/fish/powershell) | No | Built-in (bash/zsh) | No | No | No |
|
|
210
210
|
| Structured output primitives | Built-in (`--json`, tables, spinners) | DIY | DIY | DIY | DIY | DIY |
|
|
211
|
-
| Config file support | Built-in (
|
|
211
|
+
| Config file support | Built-in (project/user/system discovery, JSON) | DIY | Built-in (`.config()`) | No | No | No |
|
|
212
212
|
|
|
213
213
|
The closest analog is what tRPC did to API routes — individual pieces existed,
|
|
214
214
|
the insight was wiring them so types flow end-to-end.
|
|
@@ -220,16 +220,24 @@ the insight was wiring them so types flow end-to-end.
|
|
|
220
220
|
```ts
|
|
221
221
|
import { flag } from '@kjanat/dreamcli';
|
|
222
222
|
|
|
223
|
-
flag.string(); // string | undefined
|
|
224
|
-
flag.number(); // number | undefined
|
|
225
|
-
flag.boolean(); // boolean
|
|
223
|
+
flag.string({ nonEmpty: true }); // string | undefined, with constraints
|
|
224
|
+
flag.number({ int: true, min: 1 }); // number | undefined, with constraints
|
|
225
|
+
flag.boolean().negatable(); // boolean; accepts --no-<name>
|
|
226
226
|
flag.enum(['us', 'eu', 'ap']); // "us" | "eu" | "ap" | undefined
|
|
227
|
-
flag.array(flag.string()); // string[] | undefined
|
|
228
|
-
flag.
|
|
227
|
+
flag.array(flag.string()).separator(',').unique(); // string[] | undefined
|
|
228
|
+
flag.url({ protocols: ['https'] }); // URL | undefined
|
|
229
|
+
flag.path({ type: 'directory', create: true }); // string | undefined, mkdir when missing
|
|
230
|
+
flag.date(); // Date | undefined, strict ISO-8601
|
|
231
|
+
flag.duration(); // number (ms) | undefined — '1h30m', '250ms'
|
|
232
|
+
flag.bytes(); // number | undefined — '512mb', '1.5gb'
|
|
233
|
+
flag.count(); // number — -vvv → 3
|
|
234
|
+
flag.keyValue(); // Record<string, string> — repeated KEY=VALUE
|
|
235
|
+
flag.custom(zodSchema); // any Standard Schema v1 validator, inferred output
|
|
229
236
|
```
|
|
230
237
|
|
|
231
238
|
Every flag supports: `.default()`, `.required()`, `.alias()`, `.env()`, `.config()`, `.describe()`,
|
|
232
|
-
`.prompt()`, `.deprecated()`, `.propagate()`.
|
|
239
|
+
`.prompt()`, `.deprecated()`, `.propagate()`, `.duplicates()`, plus constraint chains
|
|
240
|
+
(`.int()`, `.min()`, `.nonEmpty()`, `.pattern()`, …) on their matching kinds.
|
|
233
241
|
|
|
234
242
|
### Resolution chain
|
|
235
243
|
|
|
@@ -342,6 +350,7 @@ const rows = [
|
|
|
342
350
|
|
|
343
351
|
const status = command('status').action(({ out }) => {
|
|
344
352
|
out.log('Human-readable message');
|
|
353
|
+
out.status('Progress note on stderr, silenced by --quiet');
|
|
345
354
|
out.json({ status: 'ok', count: 42 });
|
|
346
355
|
out.table(rows, [
|
|
347
356
|
{ key: 'name', header: 'Name' },
|
|
@@ -357,14 +366,17 @@ const status = command('status').action(({ out }) => {
|
|
|
357
366
|
});
|
|
358
367
|
progress.update(50);
|
|
359
368
|
progress.done('Upload complete');
|
|
369
|
+
|
|
370
|
+
out.setExitCode(1); // report-and-continue failures, no throw needed
|
|
360
371
|
});
|
|
361
372
|
|
|
362
373
|
cli('mycli').default(status).run();
|
|
363
374
|
```
|
|
364
375
|
|
|
365
|
-
- TTY → pretty formatting, spinners animate
|
|
366
|
-
- Piped → minimal stable output, spinners suppressed
|
|
376
|
+
- TTY → pretty formatting, colors (`out.color`), spinners animate
|
|
377
|
+
- Piped → minimal stable output, identity colors, spinners suppressed
|
|
367
378
|
- `--json` → structured JSON to stdout, everything else to stderr
|
|
379
|
+
- `--quiet` → `status`/`info` suppressed, warnings and errors kept
|
|
368
380
|
|
|
369
381
|
### Shell completions
|
|
370
382
|
|
|
@@ -376,7 +388,12 @@ import { cli, command } from '@kjanat/dreamcli';
|
|
|
376
388
|
cli('mycli').command(command('deploy')).completions().run();
|
|
377
389
|
|
|
378
390
|
// mycli completions bash
|
|
379
|
-
// mycli
|
|
391
|
+
// mycli completions zsh
|
|
392
|
+
|
|
393
|
+
// Or as an eager root flag with shell auto-detection:
|
|
394
|
+
cli('mycli').command(command('deploy')).completions({ as: 'flag' }).run();
|
|
395
|
+
|
|
396
|
+
// mycli --completions
|
|
380
397
|
```
|
|
381
398
|
|
|
382
399
|
For programmatic integrations, call the generator directly:
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import { buildFlagLookup, flagExpectsValue } from "../parse/index.mjs";
|
|
2
2
|
//#region src/core/cli/dispatch.ts
|
|
3
3
|
/**
|
|
4
|
-
* Recursive command dispatch for nested command trees.
|
|
5
|
-
*
|
|
6
|
-
* Walks argv segments, matching command names at each level of the tree.
|
|
7
|
-
* Returns a discriminated union describing the dispatch outcome: a matched
|
|
8
|
-
* command with its ancestor path, a group that needs a subcommand, or an
|
|
9
|
-
* unknown command with suggestion candidates.
|
|
10
|
-
*
|
|
11
|
-
* @module dreamcli/core/cli/dispatch
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
4
|
* Recursively walk argv, consuming command name segments from the front.
|
|
16
5
|
*
|
|
17
6
|
* At each level, the first non-flag token is tested as a command name
|
|
@@ -13,6 +13,7 @@ import { CompletionOptions } from "../completion/shells/shared.mjs";
|
|
|
13
13
|
import { Shell } from "../completion/index.mjs";
|
|
14
14
|
import { FormatLoader } from "../config/index.mjs";
|
|
15
15
|
import { formatRootHelp } from "./root-help.mjs";
|
|
16
|
+
import { Colors } from "ansispeck";
|
|
16
17
|
//#region src/core/cli/index.d.ts
|
|
17
18
|
/**
|
|
18
19
|
* Runtime descriptor for the CLI program.
|
|
@@ -153,6 +154,24 @@ interface HelpConfig {
|
|
|
153
154
|
readonly width?: number;
|
|
154
155
|
/** Emit OSC 8 hyperlinks in the header when supported. */
|
|
155
156
|
readonly hyperlinks?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Order of flags in the `Flags:` table.
|
|
159
|
+
*
|
|
160
|
+
* - `'alphabetical'` — short-aliased flags first, then alphabetical by name.
|
|
161
|
+
* - `'declaration'` — the order `.flag()` was called.
|
|
162
|
+
*
|
|
163
|
+
* Ignored when {@link HelpConfig.sortFlags} is set.
|
|
164
|
+
*
|
|
165
|
+
* @defaultValue `'alphabetical'`
|
|
166
|
+
*/
|
|
167
|
+
readonly flagOrder?: 'alphabetical' | 'declaration';
|
|
168
|
+
/**
|
|
169
|
+
* Custom comparator over flag long names for the `Flags:` table. When set,
|
|
170
|
+
* it wins over {@link HelpConfig.flagOrder}.
|
|
171
|
+
*
|
|
172
|
+
* @defaultValue `undefined` (use `flagOrder`)
|
|
173
|
+
*/
|
|
174
|
+
readonly sortFlags?: (a: string, b: string) => number;
|
|
156
175
|
/**
|
|
157
176
|
* Theme overrides for help output, merged over the built-in theme.
|
|
158
177
|
*
|
|
@@ -269,6 +288,82 @@ interface CLIRunOptions extends Omit<RunOptions, 'meta' | 'mergedSchema'> {
|
|
|
269
288
|
*/
|
|
270
289
|
readonly adapter?: RuntimeAdapter;
|
|
271
290
|
}
|
|
291
|
+
/**
|
|
292
|
+
* Inputs for {@linkcode resolveRenderContext}. Pass the host facts (TTY
|
|
293
|
+
* status, environment) and any explicit overrides; the resolver applies the
|
|
294
|
+
* same gating `.execute()`/`.run()` feed into the output channel.
|
|
295
|
+
*/
|
|
296
|
+
interface RenderContextOptions {
|
|
297
|
+
/**
|
|
298
|
+
* Whether stdout is connected to a TTY (e.g. `process.stdout.isTTY`).
|
|
299
|
+
*
|
|
300
|
+
* @defaultValue `false`
|
|
301
|
+
*/
|
|
302
|
+
readonly isTTY?: boolean;
|
|
303
|
+
/**
|
|
304
|
+
* Force JSON mode on regardless of argv.
|
|
305
|
+
*
|
|
306
|
+
* @defaultValue detected from a pre-separator `--json` in `argv`
|
|
307
|
+
*/
|
|
308
|
+
readonly jsonMode?: boolean;
|
|
309
|
+
/**
|
|
310
|
+
* Explicitly enable or disable colors, winning over the auto-gate.
|
|
311
|
+
*
|
|
312
|
+
* @defaultValue auto — `isTTY && !jsonMode` and environment support
|
|
313
|
+
*/
|
|
314
|
+
readonly color?: boolean;
|
|
315
|
+
/**
|
|
316
|
+
* Environment variables consulted for `NO_HYPERLINKS`/`FORCE_HYPERLINKS`
|
|
317
|
+
* (e.g. `process.env`).
|
|
318
|
+
*
|
|
319
|
+
* @defaultValue `{}`
|
|
320
|
+
*/
|
|
321
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* The output decisions the framework will make for a given argv, resolved
|
|
325
|
+
* before `.run()`.
|
|
326
|
+
*/
|
|
327
|
+
interface RenderContext {
|
|
328
|
+
/** Whether a pre-separator `--json` puts the run in JSON mode. */
|
|
329
|
+
readonly jsonMode: boolean;
|
|
330
|
+
/** The TTY status the output channel will carry. */
|
|
331
|
+
readonly isTTY: boolean;
|
|
332
|
+
/**
|
|
333
|
+
* The gated ANSI palette the output channel will expose as `out.color` —
|
|
334
|
+
* identity formatters when color is off; `color.isColorSupported` is the
|
|
335
|
+
* boolean gate.
|
|
336
|
+
*/
|
|
337
|
+
readonly color: Colors;
|
|
338
|
+
/** Whether OSC 8 hyperlinks should be emitted (see `out.isHyperlinkSupported`). */
|
|
339
|
+
readonly isHyperlinkSupported: boolean;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Resolve the render context for content built before `.run()`.
|
|
343
|
+
*
|
|
344
|
+
* Content styled ahead of execution — hand-rendered banners, custom help, or
|
|
345
|
+
* anything else emitted outside an action handler — has no `out` to consult,
|
|
346
|
+
* which pushes consumers into re-deriving the framework's decisions from raw
|
|
347
|
+
* argv (`argv.includes('--json')` misreads a post-`--` literal). This probe
|
|
348
|
+
* runs the same composition `.execute()`/`.run()` feed into the output
|
|
349
|
+
* channel — `--`-aware `--json` detection, the color gate, and the hyperlink
|
|
350
|
+
* override — so pre-run styling matches the channel that will render.
|
|
351
|
+
*
|
|
352
|
+
* @param argv - Raw argv tokens (NOT including the binary/script path,
|
|
353
|
+
* i.e. equivalent to `process.argv.slice(2)`).
|
|
354
|
+
* @param options - Host facts and overrides.
|
|
355
|
+
* @returns The resolved output decisions.
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* ```ts
|
|
359
|
+
* const ctx = resolveRenderContext(process.argv.slice(2), {
|
|
360
|
+
* isTTY: process.stdout.isTTY === true,
|
|
361
|
+
* env: process.env,
|
|
362
|
+
* });
|
|
363
|
+
* const banner = ctx.color.bold('mycli');
|
|
364
|
+
* ```
|
|
365
|
+
*/
|
|
366
|
+
declare function resolveRenderContext(argv: readonly string[], options?: RenderContextOptions): RenderContext;
|
|
272
367
|
/**
|
|
273
368
|
* Options for {@linkcode CLIBuilder.default | .default()}.
|
|
274
369
|
*/
|
|
@@ -402,12 +497,16 @@ declare class CLIBuilder {
|
|
|
402
497
|
/**
|
|
403
498
|
* Enable automatic config file discovery.
|
|
404
499
|
*
|
|
405
|
-
* When enabled, `.run()` probes standard paths before dispatching
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
500
|
+
* When enabled, `.run()` probes standard paths before dispatching,
|
|
501
|
+
* first match wins, no merging:
|
|
502
|
+
* 1. Project scope — for `$CWD` and each ancestor directory up to the
|
|
503
|
+
* filesystem root, nearest first:
|
|
504
|
+
* `.{appName}.json`, `{appName}.config.json`, `.config/{appName}.json`
|
|
505
|
+
* 2. User scope — `{dir}/{appName}/config.json` for each user config
|
|
506
|
+
* root (`$XDG_CONFIG_HOME` / `~/.config` on Unix, plus
|
|
507
|
+
* `~/Library/Application Support` on macOS,
|
|
410
508
|
* `%APPDATA%` / `%USERPROFILE%\\AppData\\Roaming` on Windows)
|
|
509
|
+
* 3. System scope — `/etc/{appName}/config.json` on Linux and macOS
|
|
411
510
|
*
|
|
412
511
|
* The user can override the path via `--config <path>` or `--config=<path>`.
|
|
413
512
|
*
|
|
@@ -514,7 +613,9 @@ declare class CLIBuilder {
|
|
|
514
613
|
* `{ scope: 'keep' }` to keep a leading `@scope/` (stripped by default).
|
|
515
614
|
* - `from`: anchor discovery to a file/URL/path instead of `cwd`. Pass
|
|
516
615
|
* `import.meta.url` for installable CLIs that must report THEIR OWN
|
|
517
|
-
* version.
|
|
616
|
+
* version. If the consumer's ambient `ImportMeta` omits `url`, pass
|
|
617
|
+
* `import.meta` instead. Also accepts string paths, `file:` URL strings,
|
|
618
|
+
* or `URL` instances.
|
|
518
619
|
*
|
|
519
620
|
* @example
|
|
520
621
|
* ```ts
|
|
@@ -729,8 +830,13 @@ type InferNameOption = boolean | {
|
|
|
729
830
|
interface ManifestSettings {
|
|
730
831
|
/** Infer the CLI name from `bin` keys or `name`. @defaultValue `false` */
|
|
731
832
|
readonly inferName?: InferNameOption;
|
|
732
|
-
/**
|
|
733
|
-
|
|
833
|
+
/**
|
|
834
|
+
* Anchor discovery to a file/URL/path instead of `cwd`. Normally, pass
|
|
835
|
+
* `import.meta.url`. Pass `import.meta` whole as a compatibility form when a
|
|
836
|
+
* project `tsconfig.json` `lib` override drops the runtime's ambient
|
|
837
|
+
* `ImportMeta` extras and direct `.url` access does not type-check.
|
|
838
|
+
*/
|
|
839
|
+
readonly from?: string | URL | ImportMeta;
|
|
734
840
|
/**
|
|
735
841
|
* Candidate manifest filenames in priority order — NOT npm's `files` publish
|
|
736
842
|
* globs. Discovery probes each name per directory and takes the first that
|
|
@@ -802,5 +908,23 @@ interface CLIOptions {
|
|
|
802
908
|
declare function cli(name: string, options?: Omit<CLIOptions, 'name'>): CLIBuilder;
|
|
803
909
|
/** Create a new CLI program builder from an options object. */
|
|
804
910
|
declare function cli(options: CLIOptions): CLIBuilder;
|
|
911
|
+
/**
|
|
912
|
+
* Report whether the calling module is the process entrypoint, cross-runtime.
|
|
913
|
+
*
|
|
914
|
+
* Node, Bun, and Deno set `import.meta.main` on the module invoked directly;
|
|
915
|
+
* projects with the runtime's ambient types can read that property directly.
|
|
916
|
+
* This helper is a compatibility form for projects whose `tsconfig.json` `lib`
|
|
917
|
+
* override drops those `ImportMeta` extras: passing `import.meta` whole avoids
|
|
918
|
+
* a direct `.main` access without requiring global augmentation.
|
|
919
|
+
*
|
|
920
|
+
* @param meta - The calling module's `import.meta`.
|
|
921
|
+
* @returns `true` when the module was run as the entrypoint.
|
|
922
|
+
*
|
|
923
|
+
* @example
|
|
924
|
+
* ```ts
|
|
925
|
+
* if (isMainModule(import.meta)) cli('mycli').command(deploy).run();
|
|
926
|
+
* ```
|
|
927
|
+
*/
|
|
928
|
+
declare function isMainModule(meta: ImportMeta): boolean;
|
|
805
929
|
//#endregion
|
|
806
|
-
export { type BeforeParseParams, CLIBuilder, type CLIOptions, type CLIPlugin, type CLIPluginHooks, type CLIRunOptions, type CLISchema, type CompletionsFlagConfig, type ConfigSettings, type DefaultCommandOptions, type HelpConfig, type HelpLinks, type InferNameOption, type ManifestPresetSettings, type ManifestSettings, type PackageJsonSettings, type PluginCommandContext, type ResolvedCommandParams, type ResolvedManifestSettings, cli, formatRootHelp, plugin };
|
|
930
|
+
export { type BeforeParseParams, CLIBuilder, type CLIOptions, type CLIPlugin, type CLIPluginHooks, type CLIRunOptions, type CLISchema, type CompletionsFlagConfig, type ConfigSettings, type DefaultCommandOptions, type HelpConfig, type HelpLinks, type InferNameOption, type ManifestPresetSettings, type ManifestSettings, type PackageJsonSettings, type PluginCommandContext, type RenderContext, type RenderContextOptions, type ResolvedCommandParams, type ResolvedManifestSettings, cli, formatRootHelp, isMainModule, plugin, resolveRenderContext };
|