@alpacakit/channels 0.1.0-beta.36 → 0.1.0-beta.37
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.
|
@@ -6,6 +6,12 @@ export type CliHelpOptionDescription = {
|
|
|
6
6
|
};
|
|
7
7
|
export declare function findCliHelpSurface(root: CliHelpSurface, commandPath: CliCommandPath): CliHelpSurface | null;
|
|
8
8
|
export declare function findCliHelpSurfaceLocation(root: CliHelpSurface, commandPath: CliCommandPath): CliHelpSurfaceLocation | null;
|
|
9
|
+
/**
|
|
10
|
+
* Rendered help always ends with exactly one newline. Help is written to a
|
|
11
|
+
* terminal, so the terminating newline belongs to the renderer: leaving it out
|
|
12
|
+
* makes every caller append the same one, and each one of them a place to
|
|
13
|
+
* forget it or to append two.
|
|
14
|
+
*/
|
|
9
15
|
export declare function renderCliHelp(surface: CliHelpSurface, context: CliHelpRenderContext): string;
|
|
10
16
|
export declare function listCliHelpSurfaces(root: CliHelpSurface): readonly CliHelpSurfaceLocation[];
|
|
11
17
|
export type CliHelpSurfaceProjection = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-presentation.d.ts","sourceRoot":"","sources":["../src/cli-presentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAE3B,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-presentation.d.ts","sourceRoot":"","sources":["../src/cli-presentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACn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;IACE,QAAQ,CAAC,IAAI,EACT,OAAO,sBAAsB,CAAC,cAAc,GAC5C,OAAO,sBAAsB,CAAC,iBAAiB,GAC/C,OAAO,sBAAsB,CAAC,YAAY,GAC1C,OAAO,sBAAsB,CAAC,gBAAgB,CAAC;CACpD,CACF,GACA,MAAM,CAcR;AAED,wBAAgB,iCAAiC,CAAC,KAAK,EAAE;IACvD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,+BAA+B,CAAC;IACtD,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/C,GAAG,MAAM,CAUT;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,SAAS,cAAc,EAAE,EACnC,cAAc,EAAE,MAAM,GACrB,SAAS,MAAM,EAAE,CAiBnB"}
|
package/dist/cli-presentation.js
CHANGED
|
@@ -40,6 +40,7 @@ const CLI_HELP_LAYOUT = {
|
|
|
40
40
|
resultIndent: " ",
|
|
41
41
|
sectionSeparator: "\n\n",
|
|
42
42
|
};
|
|
43
|
+
const TRAILING_NEWLINES_PATTERN = /\n+$/u;
|
|
43
44
|
export function findCliHelpSurface(root, commandPath) {
|
|
44
45
|
return findCliHelpSurfaceLocation(root, commandPath)?.surface ?? null;
|
|
45
46
|
}
|
|
@@ -56,8 +57,14 @@ export function findCliHelpSurfaceLocation(root, commandPath) {
|
|
|
56
57
|
}
|
|
57
58
|
return { surface: current, path };
|
|
58
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Rendered help always ends with exactly one newline. Help is written to a
|
|
62
|
+
* terminal, so the terminating newline belongs to the renderer: leaving it out
|
|
63
|
+
* makes every caller append the same one, and each one of them a place to
|
|
64
|
+
* forget it or to append two.
|
|
65
|
+
*/
|
|
59
66
|
export function renderCliHelp(surface, context) {
|
|
60
|
-
|
|
67
|
+
const body = joinCliHelpSections([
|
|
61
68
|
createCliHelpSummarySection(surface, context.programName),
|
|
62
69
|
createCliHelpCommandsSection(surface),
|
|
63
70
|
createCliHelpArgumentsSection(surface),
|
|
@@ -67,6 +74,7 @@ export function renderCliHelp(surface, context) {
|
|
|
67
74
|
createCliHelpDocumentationSection(surface),
|
|
68
75
|
createCliHelpNextStepsSection(surface, context.programName),
|
|
69
76
|
]);
|
|
77
|
+
return `${body.replace(TRAILING_NEWLINES_PATTERN, "")}${CLI_HELP_LAYOUT.lineSeparator}`;
|
|
70
78
|
}
|
|
71
79
|
export function listCliHelpSurfaces(root) {
|
|
72
80
|
const locations = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alpacakit/channels",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.37",
|
|
4
4
|
"description": "Neutral multi-channel entry definitions with CLI and MCP binding adapters.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"LICENSE"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@alpacakit/core": "0.1.0-beta.
|
|
32
|
+
"@alpacakit/core": "0.1.0-beta.37"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"zod": "^4.3.6"
|