You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c0c2443
Browse filesBrowse the repository at this point in the historyBrowse files
prototype(effect): address review of the vertical slice
Keep today's 401 body on the wire, render CLI failures as one stderr line
with exit 1 and a bare --version, run the real SCHEMA_MIGRATIONS through
Migrator.fromRecord, seed in layer construction, keep SqlError in the
channel, hardcode the page title, and write the gotchas into the README.
Co-Authored-By: Claude Fable 5 <[email protected]>
Copy file name to clipboardExpand all lines: packages/effect-slice/README.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,3 +11,12 @@ port PRs copy the patterns, not the files.
11
11
-`src/cli.ts` — `whoami` on `effect/unstable/cli`, calling the derived `HttpApiClient`.
12
12
-`src/slice.test.ts` — the copyable test patterns.
13
13
-`scripts/` — esbuild bundle + the packed-CLI e2e core (real server, real Postgres, bundled CLI).
14
+
15
+
## Gotchas the port must carry (details on #55)
16
+
17
+
-**esbuild**: `@effect/platform-node`'s `NodeServices` pulls in CJS `undici`, which `require()`s node builtins. ESM output needs the `createRequire` banner in `scripts/build-cli.mjs`. `FetchHttpClient` does not avoid it.
18
+
-**Migrator**: use `Migrator.make({})` from `effect/unstable/sql`, not `PgMigrator.layer` (it wants `ChildProcessSpawner`/`FileSystem`/`Path` for `pg_dump`). Ids are one global integer sequence across packages; duplicates fail. All pending steps run in one transaction under `LOCK TABLE … ACCESS EXCLUSIVE`; the ledger is `migration_id integer`, not today's TEXT ids. Today's multi-statement DDL strings run unchanged through `sql.unsafe`.
19
+
-**CLI**: Effect's defaults are agent-hostile — failures log to stdout with a stack, `--version` prints `name vX`, and `--wizard`/`--completions`/`--log-level` come free. `src/cli.ts` shows the three overrides: `CliError.UserError` for every actionable failure, `CliOutput.layer` with a one-line `formatError`/bare `formatVersion`, `CliConfig.layer({ builtIns: [Help, Version] })`.
20
+
-**401 body**: keep `{ ok: false, error }` — a `Schema.TaggedError` puts `_tag` on the wire. The middleware error is a plain `Schema.Struct` with `HttpApiSchema.status(401)`.
21
+
-**Errors**: keep `SqlError` in the channel and catch it where the policy lives (best-effort visit); `SchemaError` on a row decode is a bug → `Effect.die`.
22
+
-**One consumer → module.**`Patches` is a service here to show the shape; per the port map a capability with one consumer stays a module until a second appears.
0 commit comments