@ontrails/commander 1.0.0-beta.15 → 1.0.0-beta.17

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 CHANGED
@@ -1,5 +1,65 @@
1
1
  # @ontrails/commander
2
2
 
3
+ ## 1.0.0-beta.17
4
+
5
+ ### Patch Changes
6
+
7
+ - 61497c5: Add v1-minimum public API examples for shipped surface entrypoints.
8
+ - Updated dependencies [3dc8254]
9
+ - Updated dependencies [61497c5]
10
+ - @ontrails/core@1.0.0-beta.17
11
+ - @ontrails/cli@1.0.0-beta.17
12
+
13
+ ## 1.0.0-beta.16
14
+
15
+ ### Minor Changes
16
+
17
+ - e991a5b: Add generic enum value aliases for CLI flags and migrate Warden command aliases onto the shared alias model.
18
+ - 25f3c5c: Add the dedicated `@ontrails/commander` adapter package and move the Commander runtime out of the `@ontrails/cli/commander` subpath. Extend the repo-local package-source guardrails to cover adapter package source as the Commander runtime moves under `adapters/`.
19
+
20
+ ### Patch Changes
21
+
22
+ - 20d7a5c: Enforce the shared safe error projection policy for public error bodies, diagnostics, serialized payloads, and CLI stderr.
23
+ - df9a7d0: Add project-aware public export-map governance for @ontrails workspace docs,
24
+ imports, root barrels, and bin-only package surfaces.
25
+ - Updated dependencies [73622ae]
26
+ - Updated dependencies [e991a5b]
27
+ - Updated dependencies [25f3c5c]
28
+ - Updated dependencies [6300f70]
29
+ - Updated dependencies [d172013]
30
+ - Updated dependencies [c3fc5c3]
31
+ - Updated dependencies [20d7a5c]
32
+ - Updated dependencies [be5fb46]
33
+ - Updated dependencies [e898cc4]
34
+ - Updated dependencies [3395234]
35
+ - Updated dependencies [bcdc484]
36
+ - Updated dependencies [ed171d5]
37
+ - Updated dependencies [49c2e7d]
38
+ - Updated dependencies [331e3a9]
39
+ - Updated dependencies [4399fdb]
40
+ - Updated dependencies [4b8d13b]
41
+ - Updated dependencies [fbd42fc]
42
+ - Updated dependencies [63d1aef]
43
+ - Updated dependencies [112b9f2]
44
+ - Updated dependencies [893025e]
45
+ - Updated dependencies [ed888e2]
46
+ - Updated dependencies [2e05e27]
47
+ - Updated dependencies [c8caa5e]
48
+ - Updated dependencies [f4b90c9]
49
+ - Updated dependencies [eec5e9d]
50
+ - Updated dependencies [4e75129]
51
+ - Updated dependencies [47505fe]
52
+ - Updated dependencies [ebd4434]
53
+ - Updated dependencies [863d473]
54
+ - Updated dependencies [344f2f7]
55
+ - Updated dependencies [26f9ffd]
56
+ - Updated dependencies [66056ac]
57
+ - Updated dependencies [0bad534]
58
+ - Updated dependencies [10eae9a]
59
+ - Updated dependencies [22c6c06]
60
+ - @ontrails/core@1.0.0-beta.16
61
+ - @ontrails/cli@1.0.0-beta.16
62
+
3
63
  ## 1.0.0-beta.15
4
64
 
5
65
  Initial package placeholder.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ontrails/commander",
3
- "version": "1.0.0-beta.15",
3
+ "version": "1.0.0-beta.17",
4
4
  "files": [
5
5
  "src/**/*.ts",
6
6
  "!src/**/__tests__/**",
@@ -22,8 +22,8 @@
22
22
  "clean": "rm -rf dist *.tsbuildinfo"
23
23
  },
24
24
  "dependencies": {
25
- "@ontrails/cli": "^1.0.0-beta.15",
26
- "@ontrails/core": "^1.0.0-beta.15",
25
+ "@ontrails/cli": "^1.0.0-beta.16",
26
+ "@ontrails/core": "^1.0.0-beta.16",
27
27
  "commander": "^14.0.3"
28
28
  },
29
29
  "peerDependencies": {
package/src/surface.ts CHANGED
@@ -68,6 +68,14 @@ const deriveCommanderOptions = (
68
68
  * @remarks This is a host materialization boundary. Derivation failures are
69
69
  * thrown for the caller's CLI bootstrap code after `deriveCliCommands` has
70
70
  * already represented the framework error as a Result.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * import { createProgram } from '@ontrails/commander';
75
+ *
76
+ * const program = createProgram(graph, { name: 'demo' });
77
+ * program.parse();
78
+ * ```
71
79
  */
72
80
  export const createProgram = (
73
81
  graph: Topo,
@@ -108,6 +116,13 @@ export const createProgram = (
108
116
  * Returns the process exit code without calling `process.exit()`, so callers
109
117
  * can run cleanup before terminating. The CLI `surface()` entry point
110
118
  * delegates here and lets the process exit naturally.
119
+ *
120
+ * @example
121
+ * ```ts
122
+ * import { surface } from '@ontrails/commander';
123
+ *
124
+ * const { exitCode } = await surface(graph, { name: 'demo' });
125
+ * ```
111
126
  */
112
127
  export const surface = async (
113
128
  graph: Topo,
@@ -438,6 +438,20 @@ const applyCliCommand = (
438
438
  state.executable = true;
439
439
  };
440
440
 
441
+ /**
442
+ * Convert framework-agnostic CLI commands into a Commander program.
443
+ *
444
+ * @example
445
+ * ```ts
446
+ * import { deriveCliCommands } from '@ontrails/cli';
447
+ * import { toCommander } from '@ontrails/commander';
448
+ *
449
+ * const commands = deriveCliCommands(graph);
450
+ * if (commands.isErr()) throw commands.error;
451
+ *
452
+ * const program = toCommander(commands.value, { name: 'demo' });
453
+ * ```
454
+ */
441
455
  export const toCommander = (
442
456
  commands: CliCommand[],
443
457
  options?: ToCommanderOptions