Skip to content
Myr

root.ts

This file

Path

packages/config/test/root.ts

45 lines · 1.4 KiB · TypeScript

Last changed by

Merge build/comments-packages-rest into mainoscabrielbefore adoption38cd503

History of this file

Take it

The walk stopped after 200 commits: lines older than 678c8b8 point at it.

Close W7: cross-compile the release again, guard pi's edits, and keep the swarm out of this checkoutoscabrielbefore adoption842f042

lines 1–2why, one step back
1import { Effect, FileSystem, Option, Path, Stream } from "effect";
2import { ChildProcess, ChildProcessSpawner } from "effect/process";

Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8

lines 3–6why, one step back
3
4export const repoRoot = Effect.map(Path.Path, (path) =>5 path.resolve("..", "..")6);

Close W7: cross-compile the release again, guard pi's edits, and keep the swarm out of this checkoutoscabrielbefore adoption842f042

line 7why, one step back
7

Merge build/comments-packages-rest into mainoscabrielbefore adoption38cd503

line 8why, one step back
8/** A tracked file deleted but not yet staged is still listed: `textOf` reads it as none. */

Close W7: cross-compile the release again, guard pi's edits, and keep the swarm out of this checkoutoscabrielbefore adoption842f042

lines 9–32why, one step back
9export const committable = Effect.gen(function* () {
10 const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;11 const cwd = yield* repoRoot;1213 const handle = yield* spawner.spawn(14 ChildProcess.make(15 "git",16 ["ls-files", "--cached", "--others", "--exclude-standard"],17 { cwd }18 )19 );2021 const [listed, code] = yield* Effect.all(22 [Stream.mkString(Stream.decodeText(handle.stdout)), handle.exitCode],23 { concurrency: "unbounded" }24 );2526 if (code !== 0) {27 return yield* Effect.die(`git ls-files exited with ${code}`);28 }2930 return listed.split("\n").filter((line) => line.length > 0);31}).pipe(Effect.scoped);32

Merge build/comments-packages-rest into mainoscabrielbefore adoption38cd503

line 33why, one step back
33/** One read at a time, a whole-repo scan outlasts a test's timeout under verify's parallel run. */

Keep W10 group A's merged gate green under a full test runoscabrielbefore adoptionbd3598e

lines 34–35why, one step back
34export const readsAtOnce = { concurrency: 32 } as const;
35

Close W7: cross-compile the release again, guard pi's edits, and keep the swarm out of this checkoutoscabrielbefore adoption842f042

lines 36–45why, one step back
36export const textOf = (file: string) =>
37 Effect.gen(function* () {38 const fs = yield* FileSystem.FileSystem;39 const path = yield* Path.Path;40 const at = path.join(yield* repoRoot, file);4142 return (yield* fs.exists(at))43 ? Option.some(yield* fs.readFileString(at))44 : Option.none<string>();45 });