@effected/cli 0.18.0 → 0.20.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/Cancelled.js +1 -2
- package/CliAudience.js +1 -2
- package/CliColor.js +1 -2
- package/CliEnv.js +1 -2
- package/CliExit.js +1 -2
- package/CliFailure.js +1 -2
- package/CliInteractive.js +1 -2
- package/CliLinks.js +1 -2
- package/CliLog.js +1 -2
- package/CliLogger.js +1 -2
- package/CliMessage.js +1 -2
- package/CliPrompt.js +1 -2
- package/CliRuntime.js +1 -2
- package/CliTest.js +1 -2
- package/CliTheme.js +1 -2
- package/ConfigIssueRenderer.js +1 -2
- package/Doc.js +1 -2
- package/Fmt.js +1 -2
- package/GithubAnnotation.js +1 -2
- package/Glyphs.js +1 -2
- package/NotInteractive.js +1 -2
- package/Render.js +1 -2
- package/SchemaIssueRenderer.js +1 -2
- package/Status.js +1 -2
- package/TestTerminal.js +1 -2
- package/Token.js +1 -2
- package/index.d.ts +0 -48
- package/internal/ExitRequested.js +1 -2
- package/internal/HelpRouting.js +1 -2
- package/internal/ansi.js +1 -2
- package/internal/autoFormat.js +1 -2
- package/internal/canPrompt.js +1 -2
- package/internal/counts.js +1 -2
- package/internal/diagnostics.js +1 -2
- package/internal/displayWidth.js +1 -2
- package/internal/failureTarget.js +1 -2
- package/internal/fallbackAnswer.js +1 -2
- package/internal/fileSink.js +1 -2
- package/internal/format.js +1 -2
- package/internal/isExitCode.js +1 -2
- package/internal/layout.js +1 -2
- package/internal/linkScheme.js +1 -2
- package/internal/linkTarget.js +1 -2
- package/internal/logSafety.js +1 -2
- package/internal/renderAnsi.js +1 -2
- package/internal/renderDoc.js +1 -2
- package/internal/renderGithubLog.js +1 -2
- package/internal/renderMarkdown.js +1 -2
- package/internal/renderPlain.js +1 -2
- package/internal/scanAudience.js +1 -2
- package/internal/splitFrame.js +1 -2
- package/internal/wizardGate.js +1 -2
- package/package.json +6 -6
- package/testing.d.ts +0 -4
- package/ui/CliUi.js +2 -3
- package/ui/CliUiLive.js +1 -2
- package/ui/Confirm.js +1 -2
- package/ui/DocView.js +1 -2
- package/ui/KeyHelp.js +1 -2
- package/ui/KeyTable.js +1 -2
- package/ui/MultiSelect.js +1 -2
- package/ui/Select.js +1 -2
- package/ui/Tabs.js +1 -2
- package/ui/TextInput.js +1 -2
- package/ui/Toggle.js +1 -2
- package/ui/UiKey.js +1 -2
- package/ui/UiProvider.js +1 -2
- package/ui/UiStreams.js +1 -2
- package/ui/UiTheme.js +1 -2
- package/ui/Viewport.js +1 -2
- package/ui/internal/ErrorBoundary.js +1 -2
- package/ui/internal/Holder.js +1 -2
- package/ui/internal/ScreenContext.js +1 -2
- package/ui/internal/UiProviders.js +1 -2
- package/ui/internal/ink.js +1 -2
- package/ui/internal/inkChalk.js +1 -2
- package/ui/internal/inkConsole.js +1 -2
- package/ui/internal/lazyView.js +1 -2
- package/ui/internal/lineText.js +1 -2
- package/ui/internal/mountPermit.js +1 -2
- package/ui/internal/processStreams.js +1 -2
- package/ui/internal/renderOptions.js +1 -2
- package/ui/testing/CliUiTest.js +1 -2
- package/ui/testing/fakeStreams.js +1 -2
- package/ui/testing/terminalModel.js +1 -2
- package/ui-testing-serializer.d.ts +0 -2
- package/ui-testing-serializer.js +1 -2
- package/ui-testing.d.ts +0 -2
- package/ui.d.ts +0 -32
package/internal/canPrompt.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Config, Effect, Option } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/internal/canPrompt.ts
|
|
4
4
|
/**
|
|
5
5
|
* Whether the terminal facts let a run prompt: a terminal on standard input and on standard output, and a `TERM` that
|
|
6
6
|
* is not `dumb`. A dumb terminal is a terminal, but it cannot move the cursor or take synchronized output, which every
|
|
@@ -11,5 +11,4 @@ import { Config, Effect, Option } from "effect";
|
|
|
11
11
|
*/
|
|
12
12
|
const canPrompt = (terminal) => terminal.stdinIsTerminal && terminal.stdout.isTerminal ? Effect.map(Config.option(Config.String("TERM")).pipe(Effect.orElseSucceed(() => Option.none())), (term) => !(Option.isSome(term) && term.value === "dumb")) : Effect.succeed(false);
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
export { canPrompt };
|
package/internal/counts.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fmt } from "../Fmt.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/internal/counts.ts
|
|
4
4
|
/**
|
|
5
5
|
* The label a counter shows for a count: its one label, or `one` when the count is exactly 1 and `other` otherwise.
|
|
6
6
|
* The count is the counter's own `n`, except in a share headline (`1/3 repos`), which reads by the denominator, the
|
|
@@ -80,5 +80,4 @@ const countsTableOf = (block) => {
|
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
//#endregion
|
|
84
83
|
export { columnLabel, counterLabel, countsTableOf, totalOf, visibleCountersOf };
|
package/internal/diagnostics.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, LogLevel, Logger, References } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/internal/diagnostics.ts
|
|
4
4
|
/**
|
|
5
5
|
* The diagnostics threshold reference behind `CliLog.Level`. Lives here so the stderr sink and the file sink share
|
|
6
6
|
* one definition without `CliLog` importing itself.
|
|
@@ -28,5 +28,4 @@ const passes = (record, installed) => {
|
|
|
28
28
|
*/
|
|
29
29
|
const formatNdjson = (record) => Logger.formatJson.log(record);
|
|
30
30
|
|
|
31
|
-
//#endregion
|
|
32
31
|
export { Level, formatNdjson, passes };
|
package/internal/displayWidth.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/displayWidth.ts
|
|
2
2
|
const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
3
3
|
const ANSI = /\u001B\][^\u0007\u001B]*(?:\u0007|\u001B\\)|\u001B\[[0-?]*[ -/]*[@-~]/g;
|
|
4
4
|
const EMOJI = /^\p{RGI_Emoji}$/v;
|
|
@@ -31,5 +31,4 @@ const displayWidth = (input) => {
|
|
|
31
31
|
*/
|
|
32
32
|
const graphemes = (input) => Array.from(segmenter.segment(input), (s) => s.segment);
|
|
33
33
|
|
|
34
|
-
//#endregion
|
|
35
34
|
export { displayWidth, graphemes, stripAnsi };
|
|
@@ -9,7 +9,7 @@ import { Config, Context, Effect, MutableRef, Option } from "effect";
|
|
|
9
9
|
import { Audience, TerminalEnv } from "@effected/env";
|
|
10
10
|
import { CommandNeutralizer } from "@effected/github-commands";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// src/internal/failureTarget.ts
|
|
13
13
|
/**
|
|
14
14
|
* A cell `CliRuntime.main` provides outside failure reporting and fills from inside it.
|
|
15
15
|
*
|
|
@@ -191,5 +191,4 @@ const readSpans = (explicit, envVar) => Effect.gen(function* () {
|
|
|
191
191
|
};
|
|
192
192
|
});
|
|
193
193
|
|
|
194
|
-
//#endregion
|
|
195
194
|
export { FailureTargetCell, currentTarget, fallbackTarget, guardConsumerLines, linesOf, plainFailureLines, readSpans, refreshFailureTarget };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { CliError, Prompt } from "effect/cli";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/internal/fallbackAnswer.ts
|
|
5
5
|
/**
|
|
6
6
|
* What a fallback hands core when the run is not interactive: `otherwise`, answered, when given (`undefined` counts
|
|
7
7
|
* as not given); otherwise core's own missing-parameter error, so the parse fails exactly as it would with no
|
|
@@ -14,5 +14,4 @@ const answerWithoutPerson = (target) => {
|
|
|
14
14
|
return Effect.fail("flag" in target ? new CliError.MissingOption({ option: target.flag }) : new CliError.MissingArgument({ argument: target.argument }));
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
export { answerWithoutPerson };
|
package/internal/fileSink.js
CHANGED
|
@@ -3,7 +3,7 @@ import { formatNdjson, passes } from "./diagnostics.js";
|
|
|
3
3
|
import { Cause, Console, Effect, Exit, Fiber, FileSystem, Logger, Path, Queue } from "effect";
|
|
4
4
|
import { CommandNeutralizer } from "@effected/github-commands";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/internal/fileSink.ts
|
|
7
7
|
/** How long closing the scope waits for queued lines to reach the file before giving up on a hung filesystem. */
|
|
8
8
|
const CLOSE_TIMEOUT = "2 seconds";
|
|
9
9
|
/**
|
|
@@ -58,5 +58,4 @@ const makeFileSink = (path, installed, underActions) => Effect.gen(function* ()
|
|
|
58
58
|
});
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
//#endregion
|
|
62
61
|
export { makeFileSink };
|
package/internal/format.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaIssue } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/internal/format.ts
|
|
4
4
|
/**
|
|
5
5
|
* Core's structured formatter, with one phrasing override.
|
|
6
6
|
*
|
|
@@ -101,5 +101,4 @@ const issueTreeChildren = (entries) => {
|
|
|
101
101
|
return [...leaves(root), ...[...root.children].map(([name, child]) => named(name, child))];
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
//#endregion
|
|
105
104
|
export { formatIssue, issueEntries, issueTreeChildren };
|
package/internal/isExitCode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/isExitCode.ts
|
|
2
2
|
/**
|
|
3
3
|
* Whether `code` is an exit status a POSIX process can carry: an integer in
|
|
4
4
|
* `0..255`. `NaN`, fractions and out-of-range values all fail — a relational
|
|
@@ -8,5 +8,4 @@
|
|
|
8
8
|
*/
|
|
9
9
|
const isExitCode = (code) => Number.isInteger(code) && code >= 0 && code <= 255;
|
|
10
10
|
|
|
11
|
-
//#endregion
|
|
12
11
|
export { isExitCode };
|
package/internal/layout.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { displayWidth, graphemes } from "./displayWidth.js";
|
|
2
2
|
import { sanitize } from "../Fmt.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/internal/layout.ts
|
|
5
5
|
const pathSeparator = (ctx) => ctx.audience === "agent" ? ctx.glyphs.pathSeparator.agent : ` ${ctx.glyphs.pathSeparator.human} `;
|
|
6
6
|
/** A link target is sanitized like content, and loses its line breaks, which no URL or path holds. */
|
|
7
7
|
const safeTargetText = (text) => sanitize(text).replace(/[\r\n]/g, "");
|
|
@@ -246,5 +246,4 @@ const wrapSpans = (spans, width, options) => {
|
|
|
246
246
|
return lines.map(spansFromCells);
|
|
247
247
|
};
|
|
248
248
|
|
|
249
|
-
//#endregion
|
|
250
249
|
export { flatten, paintSpans, truncateSpans, widthOf, wrapSpans };
|
package/internal/linkScheme.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sanitize } from "../Fmt.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/internal/linkScheme.ts
|
|
4
4
|
/** The URL schemes a link may have, besides a relative URL. */
|
|
5
5
|
const ALLOWED = /* @__PURE__ */ new Set([
|
|
6
6
|
"http",
|
|
@@ -26,5 +26,4 @@ const isAllowedLinkUrl = (url) => {
|
|
|
26
26
|
return scheme === null || ALLOWED.has(scheme[1]);
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
//#endregion
|
|
30
29
|
export { isAllowedLinkUrl };
|
package/internal/linkTarget.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/linkTarget.ts
|
|
2
2
|
const LONE_SURROGATE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g;
|
|
3
3
|
/**
|
|
4
4
|
* A Windows drive path (`C:\x`, `C:/x`): absolute whatever the `Path` flavour, so never resolved against a directory.
|
|
@@ -46,5 +46,4 @@ const fileUrlPath = (absolute) => {
|
|
|
46
46
|
*/
|
|
47
47
|
const encodeForOsc8 = (url) => url.replace(LONE_SURROGATE, "�").replace(/[^\x20-\x7e]/gu, (char) => encodeURIComponent(char));
|
|
48
48
|
|
|
49
|
-
//#endregion
|
|
50
49
|
export { DRIVE, UNC, encodeForOsc8, encodePath, fileUrlPath };
|
package/internal/logSafety.js
CHANGED
|
@@ -2,7 +2,7 @@ import { sanitize } from "../Fmt.js";
|
|
|
2
2
|
import { Context, Option } from "effect";
|
|
3
3
|
import { CurrentRuntimeEnv } from "@effected/env";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/internal/logSafety.ts
|
|
6
6
|
/**
|
|
7
7
|
* Marks a log line the kit has already rendered, so the logger does not strip the escapes the kit painted into it.
|
|
8
8
|
*
|
|
@@ -42,5 +42,4 @@ const sanitizeParts = (message) => {
|
|
|
42
42
|
*/
|
|
43
43
|
const neutralizeJson = (line) => line.replaceAll("##[", "#\\u0023[");
|
|
44
44
|
|
|
45
|
-
//#endregion
|
|
46
45
|
export { TrustedLine, neutralizeJson, sanitizeParts, underActionsIn };
|
package/internal/renderAnsi.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { flatten, paintSpans } from "./layout.js";
|
|
2
2
|
import { renderDoc, showsSuffix, targetText } from "./renderDoc.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/internal/renderAnsi.ts
|
|
5
5
|
/**
|
|
6
6
|
* Inline content as styled spans: code painted `accent` with no backticks, and links kept on their spans so that
|
|
7
7
|
* painting wraps them through `ctx.link`.
|
|
@@ -48,5 +48,4 @@ const ansi = {
|
|
|
48
48
|
*/
|
|
49
49
|
const renderAnsi = (doc, ctx) => renderDoc(doc, ctx, ansi);
|
|
50
50
|
|
|
51
|
-
//#endregion
|
|
52
51
|
export { renderAnsi };
|
package/internal/renderDoc.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Fmt, sanitize } from "../Fmt.js";
|
|
|
2
2
|
import { counterLabel, countsTableOf, totalOf, visibleCountersOf } from "./counts.js";
|
|
3
3
|
import { truncateSpans, widthOf, wrapSpans } from "./layout.js";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/internal/renderDoc.ts
|
|
6
6
|
const span = (text, token) => token === void 0 ? { text } : {
|
|
7
7
|
text,
|
|
8
8
|
token
|
|
@@ -319,5 +319,4 @@ const renderDocLines = (doc, ctx, flavour) => {
|
|
|
319
319
|
*/
|
|
320
320
|
const renderDoc = (doc, ctx, flavour) => renderDocLines(doc, ctx, flavour).join("\n");
|
|
321
321
|
|
|
322
|
-
//#endregion
|
|
323
322
|
export { capOf, isAnnotation, renderDoc, renderDocLines, showsSuffix, targetText, textLines, trimLine };
|
|
@@ -2,7 +2,7 @@ import { sanitize } from "../Fmt.js";
|
|
|
2
2
|
import { plainInline, renderPlainLines } from "./renderPlain.js";
|
|
3
3
|
import { CommandNeutralizer, WorkflowCommand } from "@effected/github-commands";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/internal/renderGithubLog.ts
|
|
6
6
|
/** Plain lines, neutralized; a block that draws nothing, such as an empty table, gives no line at all. */
|
|
7
7
|
const plainLines = (blocks, ctx) => renderPlainLines(blocks, ctx).flatMap((line) => CommandNeutralizer.lines(line));
|
|
8
8
|
/**
|
|
@@ -54,5 +54,4 @@ const blockLines = (block, ctx) => {
|
|
|
54
54
|
*/
|
|
55
55
|
const renderGithubLog = (doc, ctx) => doc.flatMap((block) => blockLines(block, ctx)).join("\n");
|
|
56
56
|
|
|
57
|
-
//#endregion
|
|
58
57
|
export { renderGithubLog };
|
|
@@ -5,7 +5,7 @@ import { DRIVE, encodePath, fileUrlPath } from "./linkTarget.js";
|
|
|
5
5
|
import { flatten } from "./layout.js";
|
|
6
6
|
import { capOf, isAnnotation, showsSuffix, targetText, textLines } from "./renderDoc.js";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/internal/renderMarkdown.ts
|
|
9
9
|
/** Marks a line break inside flowing text until the paragraph is split into lines. Sanitized text never holds NUL. */
|
|
10
10
|
const BREAK = "\0";
|
|
11
11
|
/**
|
|
@@ -364,5 +364,4 @@ const blockMd = (walk, block, depth, compact = false) => {
|
|
|
364
364
|
*/
|
|
365
365
|
const renderMarkdown = (doc, ctx) => joinBlocks(doc.map((block) => blockMd({ ctx }, block, 0))).join("\n");
|
|
366
366
|
|
|
367
|
-
//#endregion
|
|
368
367
|
export { renderMarkdown };
|
package/internal/renderPlain.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { flatten } from "./layout.js";
|
|
2
2
|
import { renderDocLines, showsSuffix, targetText } from "./renderDoc.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/internal/renderPlain.ts
|
|
5
5
|
/**
|
|
6
6
|
* Inline content as spans of plain text: code in backticks, and a link as its label followed by its target in
|
|
7
7
|
* parentheses unless the label already is the target. Tokens and links are dropped, as plain text has neither.
|
|
@@ -46,5 +46,4 @@ const renderPlainLines = (doc, ctx) => renderDocLines(doc, {
|
|
|
46
46
|
*/
|
|
47
47
|
const renderPlain = (doc, ctx) => renderPlainLines(doc, ctx).join("\n");
|
|
48
48
|
|
|
49
|
-
//#endregion
|
|
50
49
|
export { plainInline, renderPlain, renderPlainLines };
|
package/internal/scanAudience.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/scanAudience.ts
|
|
2
2
|
/**
|
|
3
3
|
* The one counting rule, shared by the resolver that runs on parsed flags and by {@link scanAudience}, so the two
|
|
4
4
|
* cannot drift: every `--audience` value counts, and a boolean counts only when it is true (`--agent=false` and
|
|
@@ -102,5 +102,4 @@ const scanAudience = (argv) => {
|
|
|
102
102
|
});
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
-
//#endregion
|
|
106
105
|
export { scanAudience, tallyAudience };
|
package/internal/splitFrame.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/splitFrame.ts
|
|
2
2
|
/** What JavaScript's `.` does not match outside dotAll mode: the four line terminators. */
|
|
3
3
|
const isTerminator = (ch) => ch === "\n" || ch === "\r" || ch === "\u2028" || ch === "\u2029";
|
|
4
4
|
/** One UTF-16 unit of JavaScript's `\s`; every character `\s` matches is in the BMP. */
|
|
@@ -52,5 +52,4 @@ const splitFrame = (raw) => {
|
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
//#endregion
|
|
56
55
|
export { splitFrame };
|
package/internal/wizardGate.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/internal/wizardGate.ts
|
|
4
4
|
/**
|
|
5
5
|
* The exact `CliConfig` object `CliPrompt.gateWizard` produced when it removed `--wizard`, or `undefined` when it
|
|
6
6
|
* removed nothing.
|
|
@@ -14,5 +14,4 @@ import { Context } from "effect";
|
|
|
14
14
|
*/
|
|
15
15
|
var WizardDropped = class extends Context.Reference("@effected/cli/WizardDropped", { defaultValue: () => void 0 }) {};
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
export { WizardDropped };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effected/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The presentation boundary of an effect/cli program: audience-aware output, a document IR and renderers, editor links, failure reports and logging, plus opt-in Ink screens, widgets and a live view",
|
|
6
6
|
"keywords": [
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
"./package.json": "./package.json"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@effected/github-commands": "^0.
|
|
60
|
+
"@effected/github-commands": "^0.6.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@effected/config-file": "^0.
|
|
64
|
-
"@effected/env": "^0.
|
|
65
|
-
"@effected/glob": "^0.
|
|
66
|
-
"@effected/walker": "^0.
|
|
63
|
+
"@effected/config-file": "^0.18.0",
|
|
64
|
+
"@effected/env": "^0.5.0",
|
|
65
|
+
"@effected/glob": "^0.14.0",
|
|
66
|
+
"@effected/walker": "^0.19.0",
|
|
67
67
|
"@types/react": "^19.3.0",
|
|
68
68
|
"effect": "^4.0.0",
|
|
69
69
|
"ink": "^8.0.0",
|
package/testing.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Effect, FileSystem, Layer, Path, PlatformError, Scope, Terminal } from "effect";
|
|
2
2
|
import { ChildProcessSpawner } from "effect/process";
|
|
3
|
-
//#region src/CliTest.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* A hermetic temp directory minted by {@link CliTest.sandbox}, removed when its
|
|
6
5
|
* scope closes.
|
|
@@ -105,8 +104,6 @@ export declare class CliTest {
|
|
|
105
104
|
*/
|
|
106
105
|
static readonly run: (bin: string, args: ReadonlyArray<string>, options: RunOptions) => Effect.Effect<RunResult, PlatformError.PlatformError, ChildProcessSpawner.ChildProcessSpawner>;
|
|
107
106
|
}
|
|
108
|
-
//#endregion
|
|
109
|
-
//#region src/TestTerminal.d.ts
|
|
110
107
|
/**
|
|
111
108
|
* One key press for {@link TestTerminal}.
|
|
112
109
|
*
|
|
@@ -175,6 +172,5 @@ export declare class TestTerminal {
|
|
|
175
172
|
readonly rows?: number | undefined;
|
|
176
173
|
}) => Effect.Effect<TestTerminalHandle>;
|
|
177
174
|
}
|
|
178
|
-
//#endregion
|
|
179
175
|
export type { KeyInput, RunOptions, RunResult, Sandbox, TestTerminalHandle };
|
|
180
176
|
//# sourceMappingURL=testing.d.ts.map
|
package/ui/CliUi.js
CHANGED
|
@@ -18,7 +18,7 @@ import { Cause, Deferred, Effect, Exit, Option, Semaphore } from "effect";
|
|
|
18
18
|
import { Audience } from "@effected/env";
|
|
19
19
|
import { Prompt } from "effect/cli";
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
// src/ui/CliUi.ts
|
|
22
22
|
/**
|
|
23
23
|
* stdout's theme as the audience sees it: colourless for an agent (as `Render.context` makes it), so a screen's
|
|
24
24
|
* `useTheme`, `Styled` and the widgets' colour-none markers never carry an escape for one. `Audience` is read only when
|
|
@@ -159,7 +159,7 @@ var CliUi = class CliUi {
|
|
|
159
159
|
const crashed = crash.current;
|
|
160
160
|
const interrupted = Exit.isFailure(exit) && Cause.hasInterruptsOnly(exit.cause);
|
|
161
161
|
if (crashed === void 0 || interrupted) return yield* exit;
|
|
162
|
-
const dies = Exit.isFailure(exit) ? exit.cause.reasons.filter(Cause.isDieReason) : [];
|
|
162
|
+
const dies = Exit.isFailure(exit) ? exit.cause.reasons.filter((reason) => Cause.isDieReason(reason) && !(reason.defect instanceof Cancelled)) : [];
|
|
163
163
|
if (dies.some((reason) => reason.defect === crashed.defect)) return yield* exit;
|
|
164
164
|
return yield* Effect.failCause(Cause.fromReasons([Cause.makeDieReason(crashed.defect), ...dies]));
|
|
165
165
|
});
|
|
@@ -429,5 +429,4 @@ var CliUi = class CliUi {
|
|
|
429
429
|
});
|
|
430
430
|
};
|
|
431
431
|
|
|
432
|
-
//#endregion
|
|
433
432
|
export { CliUi };
|
package/ui/CliUiLive.js
CHANGED
|
@@ -17,7 +17,7 @@ import { Cause, Clock, Duration, Effect, Exit, Fiber, Option, PubSub, Pull, Queu
|
|
|
17
17
|
import { Audience, TerminalEnv } from "@effected/env";
|
|
18
18
|
import { CommandNeutralizer } from "@effected/github-commands";
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
// src/ui/CliUiLive.ts
|
|
21
21
|
/**
|
|
22
22
|
* The live tree's height clamp: at most the terminal's rows less one, re-read on every render and when the terminal
|
|
23
23
|
* resizes, so a tall frame never takes Ink's clear-terminal path, which wipes the scrollback. No width: Ink sizes the root itself.
|
|
@@ -436,5 +436,4 @@ const live = (options) => Effect.gen(function* () {
|
|
|
436
436
|
};
|
|
437
437
|
});
|
|
438
438
|
|
|
439
|
-
//#endregion
|
|
440
439
|
export { live };
|
package/ui/Confirm.js
CHANGED
|
@@ -8,7 +8,7 @@ import { KeyHelp } from "./KeyHelp.js";
|
|
|
8
8
|
import { Toggle } from "./Toggle.js";
|
|
9
9
|
import { Viewport } from "./Viewport.js";
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// src/ui/Confirm.ts
|
|
12
12
|
const assertUniqueKeys = (toggles) => {
|
|
13
13
|
const seen = /* @__PURE__ */ new Set();
|
|
14
14
|
for (const toggle of toggles) {
|
|
@@ -241,5 +241,4 @@ var Confirm = class Confirm {
|
|
|
241
241
|
};
|
|
242
242
|
};
|
|
243
243
|
|
|
244
|
-
//#endregion
|
|
245
244
|
export { Confirm };
|
package/ui/DocView.js
CHANGED
|
@@ -3,7 +3,7 @@ import { fromReact, inkModules } from "./internal/ink.js";
|
|
|
3
3
|
import { screenContext } from "./internal/ScreenContext.js";
|
|
4
4
|
import { useTerminalSize } from "./UiTheme.js";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/ui/DocView.ts
|
|
7
7
|
const OUTSIDE = "@effected/cli/ui: DocView was drawn with no ctx outside a screen, a live view or a UiProvider, so it has no theme";
|
|
8
8
|
/** The context a `DocView` builds from its tree's theme: the theme's own paint, so token overrides hold. */
|
|
9
9
|
const contextOf = (theme, width, neutralize) => ({
|
|
@@ -70,5 +70,4 @@ const docView = fromReact((react) => {
|
|
|
70
70
|
*/
|
|
71
71
|
const DocView = (props) => inkModules().react.createElement(docView(), props);
|
|
72
72
|
|
|
73
|
-
//#endregion
|
|
74
73
|
export { DocView };
|
package/ui/KeyHelp.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Styled, useGlyphs, useTerminalSize } from "./UiTheme.js";
|
|
|
4
4
|
import { KeyTable } from "./KeyTable.js";
|
|
5
5
|
import { lineText } from "./internal/lineText.js";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/ui/KeyHelp.ts
|
|
8
8
|
/** The fewest cells worth giving the widget's own keys when the line is cut; below it they are left out. */
|
|
9
9
|
const MIN_OWN = 4;
|
|
10
10
|
/**
|
|
@@ -58,5 +58,4 @@ const KeyHelp = (props) => {
|
|
|
58
58
|
return inkModules().react.createElement(Styled, { token: "muted" }, line);
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
//#endregion
|
|
62
61
|
export { KeyHelp };
|
package/ui/KeyTable.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useScreenGuard } from "./internal/ScreenContext.js";
|
|
|
4
4
|
import { UiKey } from "./UiKey.js";
|
|
5
5
|
import { Option } from "effect";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/ui/KeyTable.ts
|
|
8
8
|
/** Arrows under a Unicode glyph set; everything else, and everything under ASCII, as words. */
|
|
9
9
|
const ARROWS = {
|
|
10
10
|
up: "↑",
|
|
@@ -195,5 +195,4 @@ const useKeys = (table, dispatch, options = {}) => {
|
|
|
195
195
|
}), { isActive: options.isActive ?? true });
|
|
196
196
|
};
|
|
197
197
|
|
|
198
|
-
//#endregion
|
|
199
198
|
export { KeyTable, useKeys };
|
package/ui/MultiSelect.js
CHANGED
|
@@ -7,7 +7,7 @@ import { lineText } from "./internal/lineText.js";
|
|
|
7
7
|
import { KeyHelp } from "./KeyHelp.js";
|
|
8
8
|
import { Viewport } from "./Viewport.js";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/ui/MultiSelect.ts
|
|
11
11
|
/** Every item with its section's index, numbered across sections in order. */
|
|
12
12
|
const flatten = (sections) => sections.flatMap((section, index) => section.items.map((item) => ({
|
|
13
13
|
section: index,
|
|
@@ -256,5 +256,4 @@ var MultiSelect = class MultiSelect {
|
|
|
256
256
|
};
|
|
257
257
|
};
|
|
258
258
|
|
|
259
|
-
//#endregion
|
|
260
259
|
export { MultiSelect };
|
package/ui/Select.js
CHANGED
|
@@ -8,7 +8,7 @@ import { KeyHelp } from "./KeyHelp.js";
|
|
|
8
8
|
import { Viewport } from "./Viewport.js";
|
|
9
9
|
import { Option } from "effect";
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// src/ui/Select.ts
|
|
12
12
|
const enabled = (choices, index) => index >= 0 && index < choices.length && choices[index]?.disabled !== true;
|
|
13
13
|
/** The nearest enabled index from `from` in `direction`, or `undefined`. */
|
|
14
14
|
const nearest = (choices, from, direction) => {
|
|
@@ -226,5 +226,4 @@ var Select = class Select {
|
|
|
226
226
|
};
|
|
227
227
|
};
|
|
228
228
|
|
|
229
|
-
//#endregion
|
|
230
229
|
export { Select };
|
package/ui/Tabs.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Styled, useGlyphs, useTerminalSize, useTheme } from "./UiTheme.js";
|
|
|
4
4
|
import { KeyTable, useKeys } from "./KeyTable.js";
|
|
5
5
|
import { lineText } from "./internal/lineText.js";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/ui/Tabs.ts
|
|
8
8
|
const step = (index, count, action) => {
|
|
9
9
|
if (count <= 0) return index;
|
|
10
10
|
if (action === "prev") return (index - 1 + count) % count;
|
|
@@ -198,5 +198,4 @@ var Tabs = class {
|
|
|
198
198
|
};
|
|
199
199
|
};
|
|
200
200
|
|
|
201
|
-
//#endregion
|
|
202
201
|
export { Tabs };
|
package/ui/TextInput.js
CHANGED
|
@@ -7,7 +7,7 @@ import { KeyTable } from "./KeyTable.js";
|
|
|
7
7
|
import { lineText } from "./internal/lineText.js";
|
|
8
8
|
import { KeyHelp } from "./KeyHelp.js";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/ui/TextInput.ts
|
|
11
11
|
const init = (options = {}) => {
|
|
12
12
|
const value = options.initial ?? "";
|
|
13
13
|
return {
|
|
@@ -286,5 +286,4 @@ var TextInput = class TextInput {
|
|
|
286
286
|
});
|
|
287
287
|
};
|
|
288
288
|
|
|
289
|
-
//#endregion
|
|
290
289
|
export { TextInput };
|
package/ui/Toggle.js
CHANGED
|
@@ -3,7 +3,7 @@ import { inkModules } from "./internal/ink.js";
|
|
|
3
3
|
import { Styled, useGlyphs, useTerminalSize } from "./UiTheme.js";
|
|
4
4
|
import { lineText } from "./internal/lineText.js";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/ui/Toggle.ts
|
|
7
7
|
/**
|
|
8
8
|
* An on/off row: a check glyph and a label.
|
|
9
9
|
*
|
|
@@ -28,5 +28,4 @@ var Toggle = class {
|
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
//#endregion
|
|
32
31
|
export { Toggle };
|
package/ui/UiKey.js
CHANGED
package/ui/UiProvider.js
CHANGED
|
@@ -2,7 +2,7 @@ import { inkModules } from "./internal/ink.js";
|
|
|
2
2
|
import { screenContext } from "./internal/ScreenContext.js";
|
|
3
3
|
import { uiProviders } from "./internal/UiProviders.js";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/ui/UiProvider.ts
|
|
6
6
|
/**
|
|
7
7
|
* Provide the kit's context to an Ink tree the kit did not mount, so `useTheme`, `useGlyphs`, `Styled` and
|
|
8
8
|
* `useTerminalSize` work in it.
|
|
@@ -56,5 +56,4 @@ const UiProvider = (props) => {
|
|
|
56
56
|
return uiProviders(value, props.children);
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
//#endregion
|
|
60
59
|
export { UiProvider };
|
package/ui/UiStreams.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { processStreams } from "./internal/processStreams.js";
|
|
2
2
|
import { Context } from "effect";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/ui/UiStreams.ts
|
|
5
5
|
/**
|
|
6
6
|
* The streams a screen mounts on, the process's own standard streams by default.
|
|
7
7
|
*
|
|
@@ -14,5 +14,4 @@ import { Context } from "effect";
|
|
|
14
14
|
*/
|
|
15
15
|
var UiStreams = class extends Context.Reference("@effected/cli/ui/UiStreams", { defaultValue: () => processStreams() }) {};
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
export { UiStreams };
|
package/ui/UiTheme.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { inkModules } from "./internal/ink.js";
|
|
2
2
|
import { screenContext } from "./internal/ScreenContext.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/ui/UiTheme.ts
|
|
5
5
|
const OUTSIDE = "@effected/cli/ui: a theme hook was used outside a screen mounted by CliUi.run or a UiProvider";
|
|
6
6
|
const useScreen = () => {
|
|
7
7
|
const screen = inkModules().react.useContext(screenContext());
|
|
@@ -144,5 +144,4 @@ const useTerminalSize = () => {
|
|
|
144
144
|
};
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
-
//#endregion
|
|
148
147
|
export { Styled, inkProps, useGlyphs, useTerminalSize, useTheme };
|
package/ui/Viewport.js
CHANGED
|
@@ -2,7 +2,7 @@ import { inkModules } from "./internal/ink.js";
|
|
|
2
2
|
import { useTerminalSize } from "./UiTheme.js";
|
|
3
3
|
import { KeyTable } from "./KeyTable.js";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/ui/Viewport.ts
|
|
6
6
|
/**
|
|
7
7
|
* Throws on a repeated item key. Checked before React sees the rows: React reports a duplicate key on
|
|
8
8
|
* `console.error`, which under a screen's unpatched console lands on the real stderr, over the frame.
|
|
@@ -200,5 +200,4 @@ var Viewport = class {
|
|
|
200
200
|
};
|
|
201
201
|
};
|
|
202
202
|
|
|
203
|
-
//#endregion
|
|
204
203
|
export { Viewport };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fromReact } from "./ink.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/ui/internal/ErrorBoundary.ts
|
|
4
4
|
/**
|
|
5
5
|
* The screen's error boundary: catches a render error anywhere in the screen, renders nothing, and reports it.
|
|
6
6
|
*
|
|
@@ -26,5 +26,4 @@ const errorBoundary = fromReact((react) => class ScreenErrorBoundary extends rea
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
//#endregion
|
|
30
29
|
export { errorBoundary };
|
package/ui/internal/Holder.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fromReact } from "./ink.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/ui/internal/Holder.ts
|
|
4
4
|
/**
|
|
5
5
|
* A component that shows one element and lets its owner swap it in place.
|
|
6
6
|
*
|
|
@@ -70,5 +70,4 @@ const holderSlot = () => {
|
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
//#endregion
|
|
74
73
|
export { holder, holderSlot };
|