@effected/cli 0.19.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/Cancelled.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Runtime, Schema } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/Cancelled.ts
|
|
4
4
|
/**
|
|
5
5
|
* A person backed out of an interactive prompt: they pressed escape, or the
|
|
6
6
|
* prompt was interrupted.
|
|
@@ -40,5 +40,4 @@ var Cancelled = class extends Schema.TaggedError()("Cancelled", { reason: Schema
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
//#endregion
|
|
44
43
|
export { Cancelled };
|
package/CliAudience.js
CHANGED
|
@@ -7,7 +7,7 @@ import { Effect, Option, Stdio } from "effect";
|
|
|
7
7
|
import { Audience, TerminalEnv } from "@effected/env";
|
|
8
8
|
import { CliConfig, CliError, Command, Flag, GlobalFlag } from "effect/cli";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/CliAudience.ts
|
|
11
11
|
const KINDS = [
|
|
12
12
|
"human",
|
|
13
13
|
"agent",
|
|
@@ -174,5 +174,4 @@ var CliAudience = class CliAudience {
|
|
|
174
174
|
static run = (command, config) => Stdio.Stdio.use(({ args }) => Effect.flatMap(args, (argv) => CliAudience.runWith(command, config)(argv)));
|
|
175
175
|
};
|
|
176
176
|
|
|
177
|
-
//#endregion
|
|
178
177
|
export { CliAudience };
|
package/CliColor.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Effect, Layer } from "effect";
|
|
|
2
2
|
import { TerminalEnv } from "@effected/env";
|
|
3
3
|
import { CliOutput } from "effect/cli";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/CliColor.ts
|
|
6
6
|
/**
|
|
7
7
|
* Whether a CLI's output should carry ANSI colour, decided once and shared by
|
|
8
8
|
* everything that renders — help text, error output, and any rendered result.
|
|
@@ -56,5 +56,4 @@ var CliColor = class CliColor {
|
|
|
56
56
|
})));
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
//#endregion
|
|
60
59
|
export { CliColor };
|
package/CliEnv.js
CHANGED
|
@@ -5,7 +5,7 @@ import { CliPrompt } from "./CliPrompt.js";
|
|
|
5
5
|
import { ConfigProvider, Layer, Option } from "effect";
|
|
6
6
|
import { Audience, CurrentRuntimeEnv, TerminalEnv } from "@effected/env";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/CliEnv.ts
|
|
9
9
|
/**
|
|
10
10
|
* The environment services a CLI reads, built once and in the right order.
|
|
11
11
|
*
|
|
@@ -85,5 +85,4 @@ var CliEnv = class {
|
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
//#endregion
|
|
89
88
|
export { CliEnv };
|
package/CliExit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isExitCode } from "./internal/isExitCode.js";
|
|
2
2
|
import { Context, Effect, Layer, MutableRef } from "effect";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/CliExit.ts
|
|
5
5
|
/**
|
|
6
6
|
* The exit code a successful run wants, for commands whose findings are a
|
|
7
7
|
* result rather than a failure (a linter that found problems, say).
|
|
@@ -61,5 +61,4 @@ var CliExit = class CliExit extends Context.Service()("@effected/cli/CliExit") {
|
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
//#endregion
|
|
65
64
|
export { CliExit };
|
package/CliFailure.js
CHANGED
|
@@ -7,7 +7,7 @@ import { NotInteractive } from "./NotInteractive.js";
|
|
|
7
7
|
import { Status } from "./Status.js";
|
|
8
8
|
import { Cause, Context, SchemaIssue } from "effect";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/CliFailure.ts
|
|
11
11
|
/**
|
|
12
12
|
* The protocol an error class implements to say how a failure is shown: a method under this key that returns the
|
|
13
13
|
* document.
|
|
@@ -298,5 +298,4 @@ var CliFailure = class {
|
|
|
298
298
|
};
|
|
299
299
|
};
|
|
300
300
|
|
|
301
|
-
//#endregion
|
|
302
301
|
export { CliDoc, CliFailure };
|
package/CliInteractive.js
CHANGED
|
@@ -2,7 +2,7 @@ import { canPrompt } from "./internal/canPrompt.js";
|
|
|
2
2
|
import { Context, Effect, Layer } from "effect";
|
|
3
3
|
import { Audience, TerminalEnv } from "@effected/env";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/CliInteractive.ts
|
|
6
6
|
/**
|
|
7
7
|
* Whether this run may prompt a person: a human audience, with a terminal on
|
|
8
8
|
* both standard input and standard output, and a `TERM` that is not `dumb`.
|
|
@@ -67,5 +67,4 @@ var CliInteractive = class CliInteractive extends Context.Reference("@effected/c
|
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
//#endregion
|
|
71
70
|
export { CliInteractive };
|
package/CliLinks.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Config, Context, Effect, FileSystem, Layer, Option, Path } from "effect
|
|
|
5
5
|
import { CurrentRuntimeEnv } from "@effected/env";
|
|
6
6
|
import { Walker } from "@effected/walker";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/CliLinks.ts
|
|
9
9
|
const MODES = [
|
|
10
10
|
"auto",
|
|
11
11
|
"vscode",
|
|
@@ -150,5 +150,4 @@ const ambientLinksLayer = (options = {}) => Layer.effect(CliLinks, Effect.gen(fu
|
|
|
150
150
|
});
|
|
151
151
|
}));
|
|
152
152
|
|
|
153
|
-
//#endregion
|
|
154
153
|
export { CliLinks, ambientLinksLayer };
|
package/CliLog.js
CHANGED
|
@@ -10,7 +10,7 @@ import { Cause, Config, Console, Context, Effect, Layer, LogLevel, Logger, Optio
|
|
|
10
10
|
import { Audience, CurrentRuntimeEnv, TerminalEnv } from "@effected/env";
|
|
11
11
|
import { CommandNeutralizer } from "@effected/github-commands";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// src/CliLog.ts
|
|
14
14
|
/** The most spaces a numeric `indent` writes. */
|
|
15
15
|
const MAX_INDENT = 64;
|
|
16
16
|
/** An indent as written before the glyph: spaces for a number, a string with nothing in it that is not text. */
|
|
@@ -342,5 +342,4 @@ const envBuildLogLayer = (options, audienceEnvVar) => Layer.unwrap(Effect.gen(fu
|
|
|
342
342
|
})]);
|
|
343
343
|
}));
|
|
344
344
|
|
|
345
|
-
//#endregion
|
|
346
345
|
export { CliLog, envBuildLogLayer, platformLogLayer };
|
package/CliLogger.js
CHANGED
|
@@ -3,7 +3,7 @@ import { TrustedLine, sanitizeParts, underActionsIn } from "./internal/logSafety
|
|
|
3
3
|
import { Console, LogLevel, Logger, References } from "effect";
|
|
4
4
|
import { CommandNeutralizer } from "@effected/github-commands";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/CliLogger.ts
|
|
7
7
|
const defaultRender = (message) => Array.isArray(message) ? message.map(String).join(" ") : String(message);
|
|
8
8
|
/**
|
|
9
9
|
* A `Logger` that renders CLI output rather than service logs: no timestamp, level or fiber id, with every level
|
|
@@ -88,5 +88,4 @@ const makeCliLogger = (options = {}, underActions = underActionsIn) => {
|
|
|
88
88
|
});
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
//#endregion
|
|
92
91
|
export { CliLogger, makeCliLogger };
|
package/CliMessage.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Console, Effect } from "effect";
|
|
|
6
6
|
import { Audience } from "@effected/env";
|
|
7
7
|
import { CommandNeutralizer } from "@effected/github-commands";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/CliMessage.ts
|
|
10
10
|
/**
|
|
11
11
|
* One-line status messages: a glyph and some text, themed for a person and plain for an agent.
|
|
12
12
|
*
|
|
@@ -76,5 +76,4 @@ var CliMessage = class CliMessage {
|
|
|
76
76
|
static failure = (text) => CliMessage.status(Status.core, "failure", text);
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
//#endregion
|
|
80
79
|
export { CliMessage };
|
package/CliPrompt.js
CHANGED
|
@@ -5,7 +5,7 @@ import { answerWithoutPerson } from "./internal/fallbackAnswer.js";
|
|
|
5
5
|
import { Context, Effect, Layer, Queue, Terminal } from "effect";
|
|
6
6
|
import { CliConfig, GlobalFlag, Prompt } from "effect/cli";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/CliPrompt.ts
|
|
9
9
|
/**
|
|
10
10
|
* Prompts that know whether there is a person to ask.
|
|
11
11
|
*
|
|
@@ -99,5 +99,4 @@ var CliPrompt = class {
|
|
|
99
99
|
}));
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
//#endregion
|
|
103
102
|
export { CliPrompt };
|
package/CliRuntime.js
CHANGED
|
@@ -15,7 +15,7 @@ import { Cause, Effect, Layer, Logger, MutableRef, Runtime } from "effect";
|
|
|
15
15
|
import { CliError } from "effect/cli";
|
|
16
16
|
import { CommandNeutralizer } from "@effected/github-commands";
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
// src/CliRuntime.ts
|
|
19
19
|
const isShowHelp = (u) => CliError.isCliError(u) && u._tag === "ShowHelp";
|
|
20
20
|
/** A `UserError` `Command.runWith` already printed: it sets the mark to `false` after rendering. */
|
|
21
21
|
const isRenderedUserError = (u) => CliError.isCliError(u) && u._tag === "UserError" && Runtime.getErrorReported(u) === false;
|
|
@@ -220,5 +220,4 @@ var CliRuntime = class CliRuntime {
|
|
|
220
220
|
}
|
|
221
221
|
};
|
|
222
222
|
|
|
223
|
-
//#endregion
|
|
224
223
|
export { CliRuntime };
|
package/CliTest.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, FileSystem, Path, Stream } from "effect";
|
|
2
2
|
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/CliTest.ts
|
|
5
5
|
const text = (stream) => Stream.mkString(Stream.decodeText(stream));
|
|
6
6
|
/**
|
|
7
7
|
* Spawn a built CLI bin hermetically and read its exit code and streams as data.
|
|
@@ -91,5 +91,4 @@ var CliTest = class {
|
|
|
91
91
|
}));
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
//#endregion
|
|
95
94
|
export { CliTest };
|
package/CliTheme.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Config, Context, Effect, Layer, Option } from "effect";
|
|
|
5
5
|
import { TerminalEnv } from "@effected/env";
|
|
6
6
|
import { Prompt } from "effect/cli";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/CliTheme.ts
|
|
9
9
|
/**
|
|
10
10
|
* A stream theme at `color`, over a style resolution and a glyph set: the one way a {@link StreamTheme} is built.
|
|
11
11
|
*
|
|
@@ -139,5 +139,4 @@ var CliTheme = class CliTheme extends Context.Service()("@effected/cli/CliTheme"
|
|
|
139
139
|
}));
|
|
140
140
|
};
|
|
141
141
|
|
|
142
|
-
//#endregion
|
|
143
142
|
export { CliTheme, streamThemeAt };
|
package/ConfigIssueRenderer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { formatIssue } from "./internal/format.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/ConfigIssueRenderer.ts
|
|
4
4
|
/**
|
|
5
5
|
* Turns a `@effected/config-file` `ConfigValidationError` into one line per rejected value.
|
|
6
6
|
*
|
|
@@ -54,5 +54,4 @@ var ConfigIssueRenderer = class {
|
|
|
54
54
|
static render = (error) => formatIssue(error?.issue);
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
//#endregion
|
|
58
57
|
export { ConfigIssueRenderer };
|
package/Doc.js
CHANGED
|
@@ -3,7 +3,7 @@ import { totalOf, visibleCountersOf } from "./internal/counts.js";
|
|
|
3
3
|
import { Render } from "./Render.js";
|
|
4
4
|
import { Console, Effect } from "effect";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/Doc.ts
|
|
7
7
|
const isList = (input) => Array.isArray(input);
|
|
8
8
|
const freeze = (value) => Object.freeze(value);
|
|
9
9
|
const frozenArray = (items) => Object.freeze([...items]);
|
|
@@ -540,5 +540,4 @@ var Doc = class {
|
|
|
540
540
|
});
|
|
541
541
|
};
|
|
542
542
|
|
|
543
|
-
//#endregion
|
|
544
543
|
export { Doc };
|
package/Fmt.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { displayWidth, graphemes, stripAnsi } from "./internal/displayWidth.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/Fmt.ts
|
|
4
4
|
const CONTROL = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F]/g;
|
|
5
5
|
/**
|
|
6
6
|
* Text made safe to lay out and print: complete ANSI and OSC sequences removed, every remaining control character
|
|
@@ -129,5 +129,4 @@ var Fmt = class {
|
|
|
129
129
|
static plural = (n, singular, plural) => `${n} ${n === 1 ? singular : plural ?? `${singular}s`}`;
|
|
130
130
|
};
|
|
131
131
|
|
|
132
|
-
//#endregion
|
|
133
132
|
export { Fmt, sanitize };
|
package/GithubAnnotation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkflowCommand } from "@effected/github-commands";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/GithubAnnotation.ts
|
|
4
4
|
/**
|
|
5
5
|
* GitHub Actions annotations, as workflow commands.
|
|
6
6
|
*
|
|
@@ -36,5 +36,4 @@ var GithubAnnotation = class {
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
//#endregion
|
|
40
39
|
export { GithubAnnotation };
|
package/Glyphs.js
CHANGED
package/NotInteractive.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Runtime, Schema } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/NotInteractive.ts
|
|
4
4
|
/**
|
|
5
5
|
* A command needed to prompt, but there is no terminal to prompt on.
|
|
6
6
|
*
|
|
@@ -38,5 +38,4 @@ var NotInteractive = class extends Schema.TaggedError()("NotInteractive", {}) {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
//#endregion
|
|
42
41
|
export { NotInteractive };
|
package/Render.js
CHANGED
|
@@ -12,7 +12,7 @@ import { Effect } from "effect";
|
|
|
12
12
|
import { Audience, TerminalEnv } from "@effected/env";
|
|
13
13
|
import { CommandNeutralizer } from "@effected/github-commands";
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
// src/Render.ts
|
|
16
16
|
/** A renderer's text, with workflow commands neutralized when the context says the runner is reading it. */
|
|
17
17
|
const guarded = (text, ctx) => ctx.neutralizeWorkflowCommands === true ? CommandNeutralizer.text(text) : text;
|
|
18
18
|
/**
|
|
@@ -252,5 +252,4 @@ var Render = class {
|
|
|
252
252
|
static githubLog = (doc, ctx) => renderGithubLog(doc, ctx);
|
|
253
253
|
};
|
|
254
254
|
|
|
255
|
-
//#endregion
|
|
256
255
|
export { Render };
|
package/SchemaIssueRenderer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { formatIssue } from "./internal/format.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/SchemaIssueRenderer.ts
|
|
4
4
|
/**
|
|
5
5
|
* Turns a `SchemaIssue` tree into lines a user can act on.
|
|
6
6
|
*
|
|
@@ -44,5 +44,4 @@ var SchemaIssueRenderer = class {
|
|
|
44
44
|
static render = (issue) => formatIssue(issue);
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
//#endregion
|
|
48
47
|
export { SchemaIssueRenderer };
|
package/Status.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { sanitize } from "./Fmt.js";
|
|
2
2
|
import { Array, Option } from "effect";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/Status.ts
|
|
5
5
|
/**
|
|
6
6
|
* An open vocabulary of statuses.
|
|
7
7
|
*
|
|
@@ -162,5 +162,4 @@ var Status = class Status {
|
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
164
|
|
|
165
|
-
//#endregion
|
|
166
165
|
export { Status };
|
package/TestTerminal.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Layer, Option, Queue, Terminal } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/TestTerminal.ts
|
|
4
4
|
/**
|
|
5
5
|
* A scripted `Terminal` for testing prompts and anything that reads the terminal.
|
|
6
6
|
*
|
|
@@ -76,5 +76,4 @@ var TestTerminal = class {
|
|
|
76
76
|
});
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
//#endregion
|
|
80
79
|
export { TestTerminal };
|
package/Token.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/Token.ts
|
|
2
2
|
/** The default style of every token. Deeply frozen: the record is shared. */
|
|
3
3
|
const DEFAULTS = Object.freeze({
|
|
4
4
|
success: Object.freeze({ fg: "green" }),
|
|
@@ -65,5 +65,4 @@ var Token = class {
|
|
|
65
65
|
static style = (style) => style;
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
//#endregion
|
|
69
68
|
export { Token };
|
package/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Array as Array$1, Cause, Context, Effect, FileSystem, Layer, LogLevel,
|
|
|
2
2
|
import { Audience, AudienceKind, ColorLevel, CurrentRuntimeEnv, RuntimeEnv, TerminalEnv } from "@effected/env";
|
|
3
3
|
import { CliError, CliOutput, Command, Flag, Param, Prompt } from "effect/cli";
|
|
4
4
|
import { ConfigValidationError } from "@effected/config-file";
|
|
5
|
-
//#region src/Cancelled.d.ts
|
|
6
5
|
declare const Cancelled_base: Schema.Class<Cancelled, Schema.TaggedStruct<"Cancelled", {
|
|
7
6
|
readonly reason: Schema.Literals<readonly ["escape", "interrupt"]>;
|
|
8
7
|
}>, import("effect/Cause").YieldableError>;
|
|
@@ -40,8 +39,6 @@ export declare class Cancelled extends Cancelled_base {
|
|
|
40
39
|
*/
|
|
41
40
|
get [Runtime.errorExitCode](): number;
|
|
42
41
|
}
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region src/CliAudience.d.ts
|
|
45
42
|
/**
|
|
46
43
|
* The four parsed audience flags a root command carries once {@link CliAudience.flags} is shared onto it.
|
|
47
44
|
*
|
|
@@ -185,8 +182,6 @@ export declare class CliAudience {
|
|
|
185
182
|
readonly renderErrors?: boolean | undefined;
|
|
186
183
|
}) => Effect.Effect<void, Exclude<E | CliError.UserError, Terminal.QuitError> | CliError.CliError, Exclude<R, Audience> | Audience | Command.Environment>;
|
|
187
184
|
}
|
|
188
|
-
//#endregion
|
|
189
|
-
//#region src/CliColor.d.ts
|
|
190
185
|
/**
|
|
191
186
|
* Whether a CLI's output should carry ANSI colour, decided once and shared by
|
|
192
187
|
* everything that renders — help text, error output, and any rendered result.
|
|
@@ -236,8 +231,6 @@ export declare class CliColor {
|
|
|
236
231
|
*/
|
|
237
232
|
static readonly formatterLayer: (overrides?: Partial<CliOutput.Formatter>) => Layer.Layer<never, never, Stdio.Stdio>;
|
|
238
233
|
}
|
|
239
|
-
//#endregion
|
|
240
|
-
//#region src/Glyphs.d.ts
|
|
241
234
|
/**
|
|
242
235
|
* The symbols a theme draws with.
|
|
243
236
|
*
|
|
@@ -315,8 +308,6 @@ export declare class Glyphs {
|
|
|
315
308
|
/** ASCII-only symbols. */
|
|
316
309
|
static readonly ascii: GlyphSet;
|
|
317
310
|
}
|
|
318
|
-
//#endregion
|
|
319
|
-
//#region src/Token.d.ts
|
|
320
311
|
/**
|
|
321
312
|
* A named terminal colour: the eight ANSI colours and their bright variants.
|
|
322
313
|
*
|
|
@@ -401,8 +392,6 @@ export declare class Token {
|
|
|
401
392
|
*/
|
|
402
393
|
static readonly style: (style: Style) => Style;
|
|
403
394
|
}
|
|
404
|
-
//#endregion
|
|
405
|
-
//#region src/Status.d.ts
|
|
406
395
|
/**
|
|
407
396
|
* How one status looks: a Unicode glyph, an ASCII fallback, a token and a rank.
|
|
408
397
|
*
|
|
@@ -525,8 +514,6 @@ export declare class Status<Names extends string> {
|
|
|
525
514
|
*/
|
|
526
515
|
worstOption(names: ReadonlyArray<Names>): Option.Option<Names>;
|
|
527
516
|
}
|
|
528
|
-
//#endregion
|
|
529
|
-
//#region src/CliTheme.d.ts
|
|
530
517
|
/**
|
|
531
518
|
* The shape of the {@link CliTheme} service: a colour level, a glyph set and the functions that use them.
|
|
532
519
|
*
|
|
@@ -663,8 +650,6 @@ export declare class CliTheme extends CliTheme_base {
|
|
|
663
650
|
*/
|
|
664
651
|
static readonly promptTheme: Layer.Layer<never, never, CliTheme>;
|
|
665
652
|
}
|
|
666
|
-
//#endregion
|
|
667
|
-
//#region src/Doc.d.ts
|
|
668
653
|
/**
|
|
669
654
|
* A status as a document stores it: its name and its resolved definition.
|
|
670
655
|
*
|
|
@@ -1432,8 +1417,6 @@ export declare class Doc {
|
|
|
1432
1417
|
*/
|
|
1433
1418
|
static readonly print: (doc: Document, options?: DocPrintOptions) => Effect.Effect<void, never, CliTheme | TerminalEnv | Audience | CliLinks>;
|
|
1434
1419
|
}
|
|
1435
|
-
//#endregion
|
|
1436
|
-
//#region src/CliLinks.d.ts
|
|
1437
1420
|
/**
|
|
1438
1421
|
* Whether file links open in an editor.
|
|
1439
1422
|
*
|
|
@@ -1534,8 +1517,6 @@ export declare class CliLinks extends CliLinks_base {
|
|
|
1534
1517
|
*/
|
|
1535
1518
|
static readonly linker: (options: CliLinksLinkerOptions) => (target: LinkTarget, label: string) => string;
|
|
1536
1519
|
}
|
|
1537
|
-
//#endregion
|
|
1538
|
-
//#region src/CliLogger.d.ts
|
|
1539
1520
|
/**
|
|
1540
1521
|
* How a log record is turned into a line.
|
|
1541
1522
|
*
|
|
@@ -1636,8 +1617,6 @@ export declare class CliLogger {
|
|
|
1636
1617
|
*/
|
|
1637
1618
|
static readonly layer: (options?: CliLoggerOptions) => Layer.Layer<never>;
|
|
1638
1619
|
}
|
|
1639
|
-
//#endregion
|
|
1640
|
-
//#region src/CliLog.d.ts
|
|
1641
1620
|
/**
|
|
1642
1621
|
* Options for `CliLog.status`.
|
|
1643
1622
|
*
|
|
@@ -1997,8 +1976,6 @@ export declare class CliLog {
|
|
|
1997
1976
|
*/
|
|
1998
1977
|
static readonly component: (name: string) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
1999
1978
|
}
|
|
2000
|
-
//#endregion
|
|
2001
|
-
//#region src/CliEnv.d.ts
|
|
2002
1979
|
/**
|
|
2003
1980
|
* Options for {@link CliEnv.layer} and for `CliRuntime.main`'s `env` option.
|
|
2004
1981
|
*
|
|
@@ -2175,8 +2152,6 @@ export declare class CliEnv {
|
|
|
2175
2152
|
*/
|
|
2176
2153
|
static readonly layerTest: (options?: CliEnvTestOptions) => Layer.Layer<CliEnvTestServices>;
|
|
2177
2154
|
}
|
|
2178
|
-
//#endregion
|
|
2179
|
-
//#region src/CliExit.d.ts
|
|
2180
2155
|
/**
|
|
2181
2156
|
* The shape behind {@link CliExit}.
|
|
2182
2157
|
*
|
|
@@ -2241,8 +2216,6 @@ export declare class CliExit extends CliExit_base {
|
|
|
2241
2216
|
*/
|
|
2242
2217
|
static readonly set: (code: number) => Effect.Effect<void, never, CliExit>;
|
|
2243
2218
|
}
|
|
2244
|
-
//#endregion
|
|
2245
|
-
//#region src/CliFailure.d.ts
|
|
2246
2219
|
/**
|
|
2247
2220
|
* The protocol an error class implements to say how a failure is shown: a method under this key that returns the
|
|
2248
2221
|
* document.
|
|
@@ -2346,8 +2319,6 @@ export declare class CliFailure {
|
|
|
2346
2319
|
*/
|
|
2347
2320
|
static readonly toDoc: (cause: Cause.Cause<unknown>, options?: CliFailureOptions) => Document;
|
|
2348
2321
|
}
|
|
2349
|
-
//#endregion
|
|
2350
|
-
//#region src/CliInteractive.d.ts
|
|
2351
2322
|
declare const CliInteractive_base: Context.Reference<boolean>;
|
|
2352
2323
|
/**
|
|
2353
2324
|
* Whether this run may prompt a person: a human audience, with a terminal on
|
|
@@ -2405,8 +2376,6 @@ export declare class CliInteractive extends CliInteractive_base {
|
|
|
2405
2376
|
*/
|
|
2406
2377
|
static readonly unless: (condition: boolean) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
2407
2378
|
}
|
|
2408
|
-
//#endregion
|
|
2409
|
-
//#region src/CliMessage.d.ts
|
|
2410
2379
|
/**
|
|
2411
2380
|
* Options for {@link CliMessage.status}.
|
|
2412
2381
|
*
|
|
@@ -2475,8 +2444,6 @@ export declare class CliMessage {
|
|
|
2475
2444
|
*/
|
|
2476
2445
|
static readonly failure: (text: string) => Effect.Effect<void, never, CliTheme | Audience>;
|
|
2477
2446
|
}
|
|
2478
|
-
//#endregion
|
|
2479
|
-
//#region src/CliPrompt.d.ts
|
|
2480
2447
|
/**
|
|
2481
2448
|
* Which missing parameter a fallback stands in for, so a non-interactive run can fail with core's own error.
|
|
2482
2449
|
*
|
|
@@ -2563,8 +2530,6 @@ export declare class CliPrompt {
|
|
|
2563
2530
|
*/
|
|
2564
2531
|
static readonly gateWizard: Layer.Layer<never>;
|
|
2565
2532
|
}
|
|
2566
|
-
//#endregion
|
|
2567
|
-
//#region src/CliRuntime.d.ts
|
|
2568
2533
|
/**
|
|
2569
2534
|
* What `render` is told about a failure beyond the squashed error.
|
|
2570
2535
|
*
|
|
@@ -2943,8 +2908,6 @@ export declare class CliRuntime {
|
|
|
2943
2908
|
static reported<E extends Error>(error: E, exitCode?: number): E;
|
|
2944
2909
|
static reported(error: unknown, exitCode?: number): Error;
|
|
2945
2910
|
}
|
|
2946
|
-
//#endregion
|
|
2947
|
-
//#region src/ConfigIssueRenderer.d.ts
|
|
2948
2911
|
/**
|
|
2949
2912
|
* Turns a `@effected/config-file` `ConfigValidationError` into one line per rejected value.
|
|
2950
2913
|
*
|
|
@@ -2997,8 +2960,6 @@ export declare class ConfigIssueRenderer {
|
|
|
2997
2960
|
*/
|
|
2998
2961
|
static readonly render: (error: ConfigValidationError) => ReadonlyArray<string>;
|
|
2999
2962
|
}
|
|
3000
|
-
//#endregion
|
|
3001
|
-
//#region src/Fmt.d.ts
|
|
3002
2963
|
/**
|
|
3003
2964
|
* Options for {@link Fmt.truncate}.
|
|
3004
2965
|
*
|
|
@@ -3097,8 +3058,6 @@ export declare class Fmt {
|
|
|
3097
3058
|
*/
|
|
3098
3059
|
static readonly plural: (n: number, singular: string, plural?: string) => string;
|
|
3099
3060
|
}
|
|
3100
|
-
//#endregion
|
|
3101
|
-
//#region src/GithubAnnotation.d.ts
|
|
3102
3061
|
/**
|
|
3103
3062
|
* The severity of a GitHub annotation.
|
|
3104
3063
|
*
|
|
@@ -3151,8 +3110,6 @@ export declare class GithubAnnotation {
|
|
|
3151
3110
|
*/
|
|
3152
3111
|
static readonly format: (annotation: GithubAnnotationProperties, message: string) => string;
|
|
3153
3112
|
}
|
|
3154
|
-
//#endregion
|
|
3155
|
-
//#region src/NotInteractive.d.ts
|
|
3156
3113
|
declare const NotInteractive_base: Schema.Class<NotInteractive, Schema.TaggedStruct<"NotInteractive", {}>, import("effect/Cause").YieldableError>;
|
|
3157
3114
|
/**
|
|
3158
3115
|
* A command needed to prompt, but there is no terminal to prompt on.
|
|
@@ -3186,8 +3143,6 @@ export declare class NotInteractive extends NotInteractive_base {
|
|
|
3186
3143
|
*/
|
|
3187
3144
|
get [Runtime.errorExitCode](): number;
|
|
3188
3145
|
}
|
|
3189
|
-
//#endregion
|
|
3190
|
-
//#region src/Render.d.ts
|
|
3191
3146
|
/**
|
|
3192
3147
|
* Everything a renderer needs to know about where its output is going.
|
|
3193
3148
|
*
|
|
@@ -3491,8 +3446,6 @@ export declare class Render {
|
|
|
3491
3446
|
*/
|
|
3492
3447
|
static readonly githubLog: (doc: Document, ctx: RenderContext) => string;
|
|
3493
3448
|
}
|
|
3494
|
-
//#endregion
|
|
3495
|
-
//#region src/SchemaIssueRenderer.d.ts
|
|
3496
3449
|
/**
|
|
3497
3450
|
* Turns a `SchemaIssue` tree into lines a user can act on.
|
|
3498
3451
|
*
|
|
@@ -3535,6 +3488,5 @@ export declare class SchemaIssueRenderer {
|
|
|
3535
3488
|
*/
|
|
3536
3489
|
static readonly render: (issue: unknown) => ReadonlyArray<string>;
|
|
3537
3490
|
}
|
|
3538
|
-
//#endregion
|
|
3539
3491
|
export type { AnnotationLevel, AnnotationOptions, AudienceFlagInput, Block, BlockOf, CliAudienceFlagsOptions, CliDocSource, CliEnvOptions, CliEnvServices, CliEnvTestOptions, CliEnvTestServices, CliExitShape, CliFailureOptions, CliLinksLinkerOptions, CliLinksOptions, CliLinksShape, CliLogFile, CliLogFileOptions, CliLogOptions, CliLogStatusOptions, CliLoggerOptions, CliMessageOptions, CliPromptFallbackOptions, CliPromptTarget, CliThemeOptions, CliThemeShape, CliThemeTestOptions, Column, CoreStatusName, Counter, CountsOptions, CountsRow, CountsTableOptions, DocPrintOptions, Document, EditorLinks, FailureDetails, GithubAnnotationProperties, GlyphSelectOptions, GlyphSet, Inline, InlineInput, InlineOf, LinkOptions, LinkTarget, ListOptions, MainOptions, NamedColor, OverflowOptions, PercentOptions, RenderContext, RenderContextOfOptions, RenderContextOptions, ReportFailuresOptions, RequiresAudienceFlags, StatusDef, StatusRef, StreamTheme, Style, TableOptions, TokenName, TreeInput, TreeNode, TruncateOptions };
|
|
3540
3492
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Runtime } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/internal/ExitRequested.ts
|
|
4
4
|
/**
|
|
5
5
|
* The failure `CliRuntime.main` raises when a successful program recorded a
|
|
6
6
|
* non-zero exit code through `CliExit`. Private: nothing outside this package
|
|
@@ -18,5 +18,4 @@ var ExitRequested = class extends Error {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
//#endregion
|
|
22
21
|
export { ExitRequested };
|
package/internal/HelpRouting.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Console, Effect } from "effect";
|
|
2
2
|
import { CliOutput } from "effect/cli";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/internal/HelpRouting.ts
|
|
5
5
|
const OTHER_METHODS = Object.keys({
|
|
6
6
|
assert: true,
|
|
7
7
|
clear: true,
|
|
@@ -86,5 +86,4 @@ const routeHelpOnUsageError = (program) => Effect.gen(function* () {
|
|
|
86
86
|
return yield* program.pipe(Effect.provideService(CliOutput.Formatter, recording), Effect.provideService(Console.Console, routing), Effect.ensuring(Effect.sync(release)));
|
|
87
87
|
});
|
|
88
88
|
|
|
89
|
-
//#endregion
|
|
90
89
|
export { routeHelpOnUsageError };
|
package/internal/ansi.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/ansi.ts
|
|
2
2
|
/** Foreground SGR parameter for each named colour: 30 to 37, then 90 to 97. */
|
|
3
3
|
const NAMED = {
|
|
4
4
|
black: 30,
|
|
@@ -226,5 +226,4 @@ const paintStyle = (style, level, text) => {
|
|
|
226
226
|
/** The raw opening SGR sequence of a style at a level, `""` at `none` or for a style that paints nothing. */
|
|
227
227
|
const openSequence = (style, level) => level === "none" ? "" : wraps(style, level).toReversed().map((wrap) => wrap.open).join("");
|
|
228
228
|
|
|
229
|
-
//#endregion
|
|
230
229
|
export { nearest256, openSequence, paintStyle, parseHex };
|
package/internal/autoFormat.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Option } from "effect";
|
|
2
2
|
import { CurrentRuntimeEnv } from "@effected/env";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/internal/autoFormat.ts
|
|
5
5
|
/**
|
|
6
6
|
* Whether the environment says the program runs under GitHub Actions, whose runner reads workflow commands out of
|
|
7
7
|
* the log.
|
|
@@ -30,5 +30,4 @@ const autoFormat = (audience) => Effect.gen(function* () {
|
|
|
30
30
|
return (yield* underGithubActions) ? "githubLog" : "plain";
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
//#endregion
|
|
34
33
|
export { autoFormat, underGithubActions };
|