icore 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{argv.d.ts → argv/parser.d.ts} +3 -1
  3. package/dist/{argv.js → argv/parser.js} +5 -5
  4. package/dist/{commands.d.ts → command/mechanics.d.ts} +79 -6
  5. package/dist/{commands.js → command/mechanics.js} +60 -15
  6. package/dist/{errors.d.ts → errors/icore-error.d.ts} +2 -0
  7. package/dist/{errors.js → errors/icore-error.js} +2 -0
  8. package/dist/index.d.ts +28 -1
  9. package/dist/index.js +61 -16
  10. package/dist/options/parser.d.ts +43 -0
  11. package/dist/{options.js → options/parser.js} +27 -17
  12. package/dist/{options.d.ts → options/schema.d.ts} +16 -23
  13. package/dist/options/schema.js +23 -0
  14. package/dist/output/facade.d.ts +28 -0
  15. package/dist/output/facade.js +32 -0
  16. package/dist/output/node-writer.d.ts +17 -0
  17. package/dist/output/node-writer.js +25 -0
  18. package/dist/output/text-writer.d.ts +29 -0
  19. package/dist/output/text-writer.js +49 -0
  20. package/dist/presentation/facade.d.ts +39 -0
  21. package/dist/presentation/facade.js +47 -0
  22. package/dist/presentation/format-options.d.ts +31 -0
  23. package/dist/presentation/format-options.js +37 -0
  24. package/dist/presentation/renderers/csv.d.ts +18 -0
  25. package/dist/presentation/renderers/csv.js +35 -0
  26. package/dist/presentation/renderers/json.d.ts +13 -0
  27. package/dist/presentation/renderers/json.js +18 -0
  28. package/dist/presentation/renderers/table.d.ts +14 -0
  29. package/dist/presentation/renderers/table.js +29 -0
  30. package/dist/presentation/result-renderer.d.ts +25 -0
  31. package/dist/presentation/result-renderer.js +184 -0
  32. package/dist/presentation/view.d.ts +58 -0
  33. package/dist/presentation/view.js +56 -0
  34. package/dist/terminal/app.d.ts +51 -0
  35. package/dist/terminal/app.js +100 -0
  36. package/examples/cli-argument-syntax.md +218 -0
  37. package/examples/command-resolution.md +174 -0
  38. package/examples/custom-command-flow.md +109 -0
  39. package/examples/option-schemas.md +206 -0
  40. package/examples/output-writers.md +128 -0
  41. package/examples/practical-cli-patterns.md +385 -0
  42. package/examples/presentation-output.md +66 -0
  43. package/examples/presentation-primitives.md +190 -0
  44. package/examples/readme.md +48 -0
  45. package/examples/terminal-app.md +118 -0
  46. package/examples/two-phase-primitives.md +282 -0
  47. package/package.json +9 -3
  48. package/readme.md +281 -290
  49. package/dist/cli.d.ts +0 -14
  50. package/dist/cli.js +0 -31
package/dist/cli.d.ts DELETED
@@ -1,14 +0,0 @@
1
- /**
2
- * The CLI public barrel module exposes the supported command mechanics API.
3
- *
4
- * Allowed here:
5
- * - re-exporting public argv parser contracts;
6
- * - re-exporting public option schema contracts;
7
- * - re-exporting public command registry contracts;
8
- *
9
- * This file must not contain parser, validator, or command runtime logic.
10
- */
11
- export { parseArgv, type ParsedArgv } from './argv';
12
- export { defineCommand, defineCommandRegistry, isCommandName, prepareCommandFromArgs, resolveCommand, resolveCommandFromArgs, runCommand, runPreparedCommand, runCommandFromRegistry, type CommandDefinition, type CommandContext, type CommandInput, type CommandName, type CommandPayload, type CommandRegistry, type CommandResolutionOptions, type CommandResult, type PreparedCommand, type PreparedCommandInput, type ResolvedCommand } from './commands';
13
- export { IcoreError, type IcoreErrorCode, type IcoreErrorDetails } from './errors';
14
- export { mergeOptionsSchema, parseOptions, parseOptionsDetailed, type BooleanOption, type InferOptions, type InferProvidedOptions, type MergeOptionsSchemas, type NumberOption, type OptionDefinition, type OptionsSchema, type ParseOptionsResult, type RawOptionValue, type StringOption } from './options';
package/dist/cli.js DELETED
@@ -1,31 +0,0 @@
1
- "use strict";
2
- /**
3
- * The CLI public barrel module exposes the supported command mechanics API.
4
- *
5
- * Allowed here:
6
- * - re-exporting public argv parser contracts;
7
- * - re-exporting public option schema contracts;
8
- * - re-exporting public command registry contracts;
9
- *
10
- * This file must not contain parser, validator, or command runtime logic.
11
- */
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.parseOptionsDetailed = exports.parseOptions = exports.mergeOptionsSchema = exports.IcoreError = exports.runCommandFromRegistry = exports.runPreparedCommand = exports.runCommand = exports.resolveCommandFromArgs = exports.resolveCommand = exports.prepareCommandFromArgs = exports.isCommandName = exports.defineCommandRegistry = exports.defineCommand = exports.parseArgv = void 0;
14
- var argv_1 = require("./argv");
15
- Object.defineProperty(exports, "parseArgv", { enumerable: true, get: function () { return argv_1.parseArgv; } });
16
- var commands_1 = require("./commands");
17
- Object.defineProperty(exports, "defineCommand", { enumerable: true, get: function () { return commands_1.defineCommand; } });
18
- Object.defineProperty(exports, "defineCommandRegistry", { enumerable: true, get: function () { return commands_1.defineCommandRegistry; } });
19
- Object.defineProperty(exports, "isCommandName", { enumerable: true, get: function () { return commands_1.isCommandName; } });
20
- Object.defineProperty(exports, "prepareCommandFromArgs", { enumerable: true, get: function () { return commands_1.prepareCommandFromArgs; } });
21
- Object.defineProperty(exports, "resolveCommand", { enumerable: true, get: function () { return commands_1.resolveCommand; } });
22
- Object.defineProperty(exports, "resolveCommandFromArgs", { enumerable: true, get: function () { return commands_1.resolveCommandFromArgs; } });
23
- Object.defineProperty(exports, "runCommand", { enumerable: true, get: function () { return commands_1.runCommand; } });
24
- Object.defineProperty(exports, "runPreparedCommand", { enumerable: true, get: function () { return commands_1.runPreparedCommand; } });
25
- Object.defineProperty(exports, "runCommandFromRegistry", { enumerable: true, get: function () { return commands_1.runCommandFromRegistry; } });
26
- var errors_1 = require("./errors");
27
- Object.defineProperty(exports, "IcoreError", { enumerable: true, get: function () { return errors_1.IcoreError; } });
28
- var options_1 = require("./options");
29
- Object.defineProperty(exports, "mergeOptionsSchema", { enumerable: true, get: function () { return options_1.mergeOptionsSchema; } });
30
- Object.defineProperty(exports, "parseOptions", { enumerable: true, get: function () { return options_1.parseOptions; } });
31
- Object.defineProperty(exports, "parseOptionsDetailed", { enumerable: true, get: function () { return options_1.parseOptionsDetailed; } });