@effected/cli 0.9.0 → 0.10.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/CliColor.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Config, Effect, Layer, Option, Stdio } from "effect";
2
- import { CliOutput } from "effect/unstable/cli";
2
+ import { CliOutput } from "effect/cli";
3
3
 
4
4
  //#region src/CliColor.ts
5
5
  const noColor = Config.option(Config.String("NO_COLOR"));
package/CliRuntime.js CHANGED
@@ -4,7 +4,7 @@ import { CliLogger } from "./CliLogger.js";
4
4
  import { ExitRequested } from "./internal/ExitRequested.js";
5
5
  import { routeHelpOnUsageError } from "./internal/HelpRouting.js";
6
6
  import { Cause, Effect, MutableRef, Runtime } from "effect";
7
- import { CliError } from "effect/unstable/cli";
7
+ import { CliError } from "effect/cli";
8
8
 
9
9
  //#region src/CliRuntime.ts
10
10
  const isShowHelp = (u) => CliError.isCliError(u) && u._tag === "ShowHelp";
package/CliTest.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Effect, FileSystem, Path, Stream } from "effect";
2
- import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
2
+ import { ChildProcess, ChildProcessSpawner } from "effect/process";
3
3
 
4
4
  //#region src/CliTest.ts
5
5
  const text = (stream) => Stream.mkString(Stream.decodeText(stream));
@@ -47,7 +47,7 @@ var CliTest = class {
47
47
  * @remarks
48
48
  * `stdin` is never left as an inherited open pipe: when omitted or `""`
49
49
  * the child gets an already-ended empty input (`Stream.empty`), so a
50
- * stdin-reading bin exits instead of hanging on `effect/unstable/process`'s
50
+ * stdin-reading bin exits instead of hanging on `effect/process`'s
51
51
  * default `"pipe"` stdio, which stays open until something writes to and
52
52
  * ends it.
53
53
  */
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![Node.js %3E%3D24.11.0](https://img.shields.io/badge/Node.js-%3E%3D24.11.0-5fa04e.svg)](https://nodejs.org/)
6
6
  [![TypeScript 7.0](https://img.shields.io/badge/TypeScript-7.0-3178c6.svg)](https://www.typescriptlang.org/)
7
7
 
8
- The boundary layer of a command-line program built on `effect/unstable/cli`: how output reaches a human, how a failure is reported, and how a schema issue becomes a sentence someone can act on. `CliLogger` renders log records as plain lines and routes diagnostics to stderr, reading the `Console` off the fiber so it needs no platform package and the stream split is actually testable. `CliRuntime.reportFailures` catches inside your program so a failure prints through *your* logger instead of Effect's default one on stdout, then re-fails with the exit code and the no-double-report mark; `CliRuntime.main` assembles a whole program — platform layer, a fresh `CliExit`, failure reporting, and the logger — in the one order that reports every failure well. `CliExit` lets a findings command (a linter that found problems, say) succeed with a non-zero exit code, with finalizers intact on any runtime. `CliColor` decides once, per the no-color.org rule, whether output carries ANSI colour, and hands core's own `CliOutput.Formatter` the same decision. `SchemaIssueRenderer` and `ConfigIssueRenderer` turn issue trees into `unknown key at groups.g.rulesetz`. The `./testing` subpath's `CliTest` spawns a built bin hermetically for a test that wants a real subprocess.
8
+ The boundary layer of a command-line program built on `effect/cli`: how output reaches a human, how a failure is reported, and how a schema issue becomes a sentence someone can act on. `CliLogger` renders log records as plain lines and routes diagnostics to stderr, reading the `Console` off the fiber so it needs no platform package and the stream split is actually testable. `CliRuntime.reportFailures` catches inside your program so a failure prints through *your* logger instead of Effect's default one on stdout, then re-fails with the exit code and the no-double-report mark; `CliRuntime.main` assembles a whole program — platform layer, a fresh `CliExit`, failure reporting, and the logger — in the one order that reports every failure well. `CliExit` lets a findings command (a linter that found problems, say) succeed with a non-zero exit code, with finalizers intact on any runtime. `CliColor` decides once, per the no-color.org rule, whether output carries ANSI colour, and hands core's own `CliOutput.Formatter` the same decision. `SchemaIssueRenderer` and `ConfigIssueRenderer` turn issue trees into `unknown key at groups.g.rulesetz`. The `./testing` subpath's `CliTest` spawns a built bin hermetically for a test that wants a real subprocess.
9
9
 
10
10
  > **Pre-release.** This package is part of the `@effected/*` kit, in pre-`1.0.0`
11
11
  > development against a single pinned Effect v4 prerelease. Packages graduate to
@@ -25,7 +25,7 @@ Everything here shares one property: **you only discover you needed it by shippi
25
25
 
26
26
  Effect's default logger emits `[00:33:56.619] INFO (#2): message`. That is correct for a service being scraped and wrong for a tool someone is watching — it turns a formatted table into noise — and nothing at the call site suggests it. A platform `runMain` then reports an unhandled failure through that *same* default logger, which sits outside the layers your program was provided, so a program that carefully installs a CLI logger still prints its failures in the format that logger exists to replace, on **stdout**, the one stream errors must not use. And a decode failure arrives as a structured tree when what a user needs is a sentence naming the key they got wrong; core does ship formatters for this, but they live on `SchemaIssue` rather than `SchemaError`, are named `makeFormatter*`, and are not referenced by `SchemaError.message` — two engineers searched for two rounds and concluded they did not exist.
27
27
 
28
- This package is **not a CLI framework**. `effect/unstable/cli` owns argument parsing, flags, the command tree and help, and this package must never grow a second one.
28
+ This package is **not a CLI framework**. `effect/cli` owns argument parsing, flags, the command tree and help, and this package must never grow a second one.
29
29
 
30
30
  ## Install
31
31
 
@@ -104,13 +104,13 @@ Print-then-`reported` is for a program run **without** `CliRuntime.main` or `rep
104
104
 
105
105
  A findings command — one whose non-zero exit reports a result rather than a
106
106
  crash — wires `CliRuntime.main`, `CliExit.set` and `CliColor.formatterLayer`
107
- around an ordinary `effect/unstable/cli` command:
107
+ around an ordinary `effect/cli` command:
108
108
 
109
109
  ```ts
110
110
  import { CliColor, CliExit, CliRuntime } from "@effected/cli";
111
111
  import { NodeRuntime, NodeServices } from "@effect/platform-node";
112
112
  import { Console, Effect, Layer } from "effect";
113
- import { Command, Flag } from "effect/unstable/cli";
113
+ import { Command, Flag } from "effect/cli";
114
114
 
115
115
  const findProblems = (strict: boolean): ReadonlyArray<string> =>
116
116
  strict ? ["missing changeset", "unpinned dependency"] : ["missing changeset"];
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Cause, Context, Effect, Layer, LogLevel, Logger, MutableRef, Stdio } from "effect";
2
- import { CliOutput } from "effect/unstable/cli";
2
+ import { CliOutput } from "effect/cli";
3
3
  import { ConfigValidationError } from "@effected/config-file";
4
4
  //#region src/CliColor.d.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { Console, Effect } from "effect";
2
- import { CliOutput } from "effect/unstable/cli";
2
+ import { CliOutput } from "effect/cli";
3
3
 
4
4
  //#region src/internal/HelpRouting.ts
5
5
  const OTHER_METHODS = Object.keys({
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@effected/cli",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "private": false,
5
- "description": "The boundary layer of an effect/unstable/cli program: plain CLI output, failure reporting, and schema-issue rendering",
5
+ "description": "The boundary layer of an effect/cli program: plain CLI output, failure reporting, and schema-issue rendering",
6
6
  "keywords": [
7
7
  "effect",
8
8
  "cli",
@@ -40,8 +40,8 @@
40
40
  "./package.json": "./package.json"
41
41
  },
42
42
  "peerDependencies": {
43
- "@effected/config-file": "^0.12.0",
44
- "effect": "4.0.0-rc.117"
43
+ "@effected/config-file": "^0.13.0",
44
+ "effect": "4.0.0-rc.118"
45
45
  },
46
46
  "peerDependenciesMeta": {
47
47
  "@effected/config-file": {
package/testing.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Effect, FileSystem, Path, PlatformError, Scope } from "effect";
2
- import { ChildProcessSpawner } from "effect/unstable/process";
2
+ import { ChildProcessSpawner } from "effect/process";
3
3
  //#region src/CliTest.d.ts
4
4
  /**
5
5
  * A hermetic temp directory minted by {@link CliTest.sandbox}, removed when its
@@ -83,7 +83,7 @@ export declare class CliTest {
83
83
  * @remarks
84
84
  * `stdin` is never left as an inherited open pipe: when omitted or `""`
85
85
  * the child gets an already-ended empty input (`Stream.empty`), so a
86
- * stdin-reading bin exits instead of hanging on `effect/unstable/process`'s
86
+ * stdin-reading bin exits instead of hanging on `effect/process`'s
87
87
  * default `"pipe"` stdio, which stays open until something writes to and
88
88
  * ends it.
89
89
  */