Repository navigation
feat(effect)!: ship @kitz/effect — collapse monorepo to one package on pnpm + Vite+ + TS7 - #284
Merged
Merged
Conversation
added 14 commits
June 19, 2026 16:11
Collapse the workspace from 48 packages to the 6-package closure required to build, type-check, and test @kitz/fs: assert, core, fs, json, platform, test. Everything else is removed and is recoverable from git history. Also prune now-dead root tooling that only served the deleted packages: the oxlint custom-rules plugin wiring + its configs (.oxlintrc.api-model-style.json, .oxlintrc.custom-strict.json), the cli-docs generators, and release/cli/oxlint-rules scripts + CI jobs. Verified green on bun: check:types, build:packages, test:packages. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Cut @kitz/fs's @kitz/core and @kitz/json dependencies by relocating the tiny surface it used: - type-level Str operators -> path-analyzer/codec-string/str-types.ts - Ts.Err.StaticError -> path/static-error.ts - Fn.curry / Fn.flipCurried -> direct curried arrows in ensureAbsolute.ts - Lang.neverCase -> effect's Function.absurd in filesystem.ts - Json.Object -> local JsonObject in json-types.ts effect moves from a regular dependency to a peerDependency (single-instance requirement for a published Effect library), kept as a devDependency for local builds/tests. tinyglobby remains the only other runtime dep. Verified green on bun: check:types (all 6), build:packages, fs test (30/30). Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
…+ Path
Adopt the effect-plus packaging model. The package now presents two top-level
namespaces, named to match (and supersede) effect's own modules:
import { FileSystem, Path } from '@kitz/effect'
- FileSystem: higher-level filesystem operations (the former Fs namespace,
minus path)
- Path: the typed path ADT, promoted from Fs.Path to a top-level namespace
Root barrel split accordingly (_.ts exports FileSystem + Path; __.ts no longer
re-exports the path module). Directory renamed packages/fs -> packages/effect.
effect's own FileSystem/Path stay reachable via `import ... from 'effect'`; v1
does not re-export effect yet (ships only the kitz enhancements).
Test touched (mechanical, for review): fromString.test-d.ts uses Path instead
of Fs.Path to follow the renamed surface — no assertion change.
Known follow-up (publish-readiness): JSDoc @example blocks still say Fs.* and
exports still point at ./src (repoint to ./build before publish).
Verified green on bun: check:types (all 6), build:packages, @kitz/effect test (30/30).
Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Replace the @kitz/test (bun:test) wrapper with Vitest 4.1.4 + @effect/vitest 4.0.0-beta.84 (effect-v4 compatible), running on Node: - vitest.config.ts + vitest.setup.ts (addEqualityTesters for Effect-data equality) - Test.effect/live/property/describe -> it.effect/it.live/it.prop/describe; table-builders expanded to explicit cases 1:1 (assertions preserved) - fromString.test-d.ts: Assert.exact.of -> expectTypeOf - package.json: drop @kitz/test + @kitz/assert devDeps; test -> `vitest run` Removed dead code: _.test-matchers.ts (imported by nothing) + its custom matchers. Fixed a latent issue: tsconfig.build.json now excludes *.test-d.ts (was compiled into build/, shipping a devDep import). KNOWN ISSUE surfaced (documented in fromString.test-d.ts, owner decision needed): the `_plainString` type assertion was silently false under the old bare-type-alias form -- `fromString<string>` (class union) and `Path` (Schema.Type) diverge. Left UNVERIFIED with a documented TODO rather than faked green; the other 11 type assertions remain enforced. Verified: vitest 30/30 (Node), check:types green. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
The Vitest migration removed @kitz/effect's last @kitz/* devDeps (@kitz/test, @kitz/assert), orphaning the entire dev closure. Delete test, assert, core, platform, json -- nothing depends on them anymore. @kitz/effect is now the only workspace package, depending solely on effect (peer) + tinyglobby. Also drop the now-dead check:platform / platform:verify root scripts. Verified green on bun: check:types, build:packages, vitest 30/30. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Replace the bun-based toolchain with the target SOTA stack: - Package manager: bun -> pnpm 11 (pnpm-workspace.yaml + pnpm-lock.yaml; remove bun.lock, bunfig.toml). Dev/CI runtime is now Node (>=22.12). - Build + typecheck: tsgo (native-preview) -> official TypeScript 7.0.1-rc (tsc), file-by-file emit (no bundler). Drop bun-isms from tsconfig.base (types node+bun -> node, remove customConditions bun). - Test + lint + format: Vite+ (vp) — vp test (Vitest + @effect/vitest), vp lint (oxlint), vp format (oxfmt). effect/@effect/vitest pinned to 4.0.0-beta.85; vitest to 4.1.9 (matches vite-plus bundle). - CI (.github): pnpm-based setup action + pr.yml routed through pnpm/vp. - pre-commit hook: runs the explicit check scripts. Notable findings handled: - GVS DISABLED: pnpm 11 global-virtual-store breaks @effect/vitest's ESM resolution of @vitest/runner (GVS on => 0 tests load; off => 30/30). Documented in pnpm-workspace.yaml to revisit. Was requested; blocked by a real GVS+ESM limitation. - @effect/language-service dropped for now (no TS7-RC support yet; revisit). - vp's combined check + vp fmt do not auto-discover .oxfmtrc.json (vp 0.2.1); format scripts pass --config explicitly to keep the house style (single-quote/no-semi), and the hook uses explicit scripts. Cleanup: remove the obsolete bun tooling layer (tools/*: fleet, run-lint, run-format, run-package-tests, run-workspace-coverage, pre-commit.ts, test-preload) now superseded by vp; delete the dead release.config.ts (imported the nuked @kitz/release) and the unrelated articles/ tutorial series. Source fixes surfaced by vp's stricter lint: drop 3 unused type imports, mark an interface-mandated unused param as _options, write the segment regex NUL via a Unicode escape with a scoped no-control-regex disable. Verified green: pnpm build, check:types (TS7), check:lint, format:check, test (30/30), check:package (publint + attw all green). Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Make @kitz/effect publishable and align docs with the new architecture. Package (packages/effect/package.json): - version 0.0.0-kitz-release -> 0.1.0 (first real release) - exports now point at build/ (.js + .d.ts) instead of ./src/*.ts — ship compiled output, not TypeScript source; files -> ["build"] only - add publishConfig.access=public (scoped package), keywords, author, homepage, bugs, repository.directory - README.md: install (effect peer + v4-beta), the consumer-supplies-a- FileSystem-layer contract, the FileSystem/Path supersede-Effect naming + aliasing, subpath exports, and the glob node-only caveat Verified: build emits all 8 export targets; publint + attw green (node10/node16/bundler) across all subpaths; pnpm pack ships only build/ + package.json + README.md. Docs aligned to pnpm + Vite+ + TS7 toolchain: - .claude/CLAUDE.md: replace bun:test/"no vitest" guidance with the Vitest/@effect/vitest + vp + tsc workflow; add a history note - CONTRIBUTING.md: pnpm/vp/tsc build-system + commit-hook sections - .claude/rules/effect-reference.md: beta.31 -> beta.85 - delete .claude/rules/circular-devdep-workaround.md(.refs) — inapplicable (single package, no cross-package cycles; referenced deleted turbo/vitest) JSDoc @example modernization (~50 refs, 8 files): @kitz/fs/@wollybeard/kit -> @kitz/effect; Fs.* -> FileSystem.* / Fs.Path.* -> Path.*; deduped copy-paste import lines; one Effect-vs-kitz FileSystem name collision resolved via alias. Source lint fixes already covered under the toolchain commit. Verified green: build, check:types (TS7), check:lint, format:check, test (30/30), check:package. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Replace tinyglobby with a glob that walks the injected FileSystem service: - glob now matches via picomatch over a recursive readDirectory+stat walk, so it honors whatever platform layer is provided — including the in-memory layer. Previously tinyglobby read node:fs directly, bypassing the injected layer (the in-memory FS had no effect on results) and locking glob to Node. - Signature reflects reality: requirements channel gains FileSystem.FileSystem, error channel is PlatformError. globSync is removed — a synchronous variant is incompatible with the async FileSystem service (use the in-memory layer for fast, disk-free tests instead). - GlobOptions is now self-defined (cwd/onlyFiles/onlyDirectories/absolute/dot/ ignore) rather than extending tinyglobby's options. - dep: drop tinyglobby, add picomatch (pure matcher, zero fs). The package's only runtime dep is now picomatch (effect stays peer). Fix (memory): FileSystem.Memory.layer's readDirectory now lists implicit intermediate directories (the first segment of nested keys), matching real-filesystem semantics. Previously it returned only direct entries, so a walker never descended into implied dirs — which would have made the new layer-aware glob find nothing under nested paths in the in-memory layer. Verified behaviorally against Memory.layer (throwaway probe): relative + absolute results, onlyFiles/onlyDirectories, dot, and ignore all correct. Green: build, check:types (TS7), check:lint, format, test (30/30), check:package. Follow-up (not authored here, per test-ownership): add committed glob tests using FileSystem.Memory.layer — glob and the memory layer are both currently untested. Recommended cases: **/*.ts (rel+abs), onlyDirectories, dot, ignore, mixed files+dirs, empty result, and a NotFound cwd. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Follow vite-plus's documented testing convention instead of fighting it, which also fixes the pnpm GVS blocker cleanly: - Test API imported from `vite-plus/test` (vite-plus re-exports vitest), NOT from `vitest` or `@effect/vitest`. Because resolution goes through `vite-plus` (a declared dep) rather than an orphaned `@vitest/runner`, the global virtual store resolves it — so `enableGlobalVirtualStore: true` is back ON. - Tests run via `vp test` (Vitest bundled by vite-plus, currently 4.1.9). We do not install `vitest` ourselves — vite-plus owns it. Coverage uses the opt-in `@vitest/coverage-v8` provider pinned to the bundled vitest version. - Config moved to `packages/effect/vite.config.ts` `test` block (vite-plus discourages `vitest.config.ts`). `vitest.setup.ts` now registers the Effect `Equal`-aware equality tester via `expect` from `vite-plus/test`. Supersedes the previous approach (a private `@kitz/vitest` wrapper + vitest 5 beta run directly): vite-plus 0.2.1 hard-prefers its bundled vitest 4.1.9 (resolver paths `[vitePlusDir, cwd]`), so driving vitest 5 through `vp` is not possible without forcing overrides — not worth fighting. `vite-plus/test` is the official equivalent of that wrapper, maintained upstream. Removed @kitz/vitest, @effect/vitest, the vitest/vitest-5 catalog entries, and the direct `vitest run` scripts. Tooling note removed: the earlier @effect/vitest GVS-disable workaround no longer applies. Verified green (GVS on): check:types (TS7), check:lint, format:check, vp test (30/30), check:package, check:cov (v8 coverage report). Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
…vitest Private workspace package providing the Effect-native testing ergonomics on top of Vite+'s bundled vitest, the kitz-owned equivalent of @effect/vitest: - it.effect — run an Effect as a test, with a virtual TestClock + captured TestConsole and a Scope provided - it.live — same, with the live environment - it.scoped — emphasizes scoped-resource acquisition - it.prop — property test whose body returns an Effect (fast-check via effect/testing/FastCheck) - addEqualityTesters — Effect `Equal`-aware structural equality for `expect` - re-exports the full vite-plus/test surface (describe/expect/vi/…); the enhanced `it` is composed as a NEW object (vite-plus's `it` is not mutated) Crucially it imports the runner ONLY from `vite-plus/test`, so there is a single vitest copy and it resolves under pnpm GVS. This is why we cannot use @effect/vitest itself: that package pulls its own vitest + @vitest/runner, creating a second instance that clashes with the one `vp test` runs (and breaks GVS via an undeclared @vitest/runner). @kitz/effect now imports its test API from @kitz/vitest. Verified end-to-end (throwaway probes, since tests are user-owned): it.effect drives TestClock, it.live/it.scoped/it.prop all run, equality tester works. Green (GVS on): check:types (both packages), check:lint, format:check, vp test (30/30), build, check:package, check:cov. Follow-up (not authored here): the suite still uses only plain describe/it; add committed it.effect/it.prop tests to exercise @kitz/vitest directly. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Provide a Layer to a group of Effect tests, matching @effect/vitest's `layer`:
- `layer(MyLayer)('group', (it) => { it.effect(...) })` builds the layer ONCE
(memoized via Effect ManagedRuntime), shares it across every test in the group,
and disposes it in afterAll. The layer is merged with the TestClock/TestConsole
env; each test also gets a Scope.
- The bound `it` exposes effect/scoped/prop (no `.live` — the layer is the env).
- Exposed both standalone (`layer`) and as `it.layer`. Supports named and
anonymous suites.
Verified (throwaway probe): a Layer.sync service is injected and built exactly
once across two tests (expect(builds).toBe(1)) and disposed after.
Also fix the stale effect-reference rule: `ServiceMap` was removed in
effect@4.0.0-beta.85; the service constructor is now `Context.Service`
(`class Foo extends Context.Service<Foo, Shape>()('Foo') {}`). The rule
previously prescribed `ServiceMap.Service`, which no longer resolves. Added a
note to always re-verify against the installed version.
Green: check:types (both packages), check:lint, format:check, vp test (30/30),
build, check:package.
Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
…uirement) CI was red across every job at the shared `./.github/actions/setup` step: pnpm 11.8.0 requires Node >=22.13, but the setup action pinned Node 22.12.0, so `pnpm store path` (setup-node's pnpm cache step) failed and cascaded to all jobs. - .github/actions/setup: node-version 22.12.0 -> 24 (current LTS, >=22.13) - root engines.node: >=22.12.0 -> >=22.13.0 (the true pnpm floor) @kitz/effect declares no engines (correct — the published package has no such dev/pnpm floor; it runs on any Effect-supported Node). Verified locally: `pnpm install --frozen-lockfile` clean, format:check clean. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
The publint CI job runs in a fresh checkout and validated package shape without building first; @kitz/effect's exports point at ./build/* (compiled output), so publint failed with "pkg.exports['.'].types is ./build/_.d.ts but the file does not exist" (×8). Locally it passed only because a prior build had populated build/. Make `check:package` self-sufficient: `pnpm build && pnpm -r check:package`, so it builds first whether run in CI or locally (no CI-only ordering knowledge). Verified from a cold checkout (build/ removed): publint + attw all green (node10/node16/bundler). Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
…stem Consolidate all toolchain config into one root vite.config.mts and modernize the TypeScript setup to the layered "heartbeat" pattern (minus @effect/language- service, which stays dropped). Unified config (vite.config.mts): - lint → oxlint config (was .oxlintrc.json — deleted) - fmt → oxfmt config (was .oxfmtrc.json + .prettierignore — deleted; fmt is now auto-discovered, so the `--config` workaround is gone) - test → vitest include + setup (was per-package packages/effect/vite.config.ts) - run.tasks → build / check:types / check:lint / check:format / test / check:cov / check:package / check / fix — invoked via `vp run <task>` - staged → format+lint staged files (used by the pre-commit hook) tsconfig (layered project-references, TS 7): - templates: base (strictest, ES2024 libs, nodenext, verbatimModuleSyntax, isolatedModules, erasableSyntaxOnly), stage.development / stage.production, topology.solution / topology.imported / topology.unimported - root tsconfig.json (solution) + tsconfig.development.json (typecheck graph) + tsconfig.production.json (emit graph) - per-package dev + production configs for @kitz/effect and @kitz/vitest - ADAPTATION vs heartbeat: the emit topology emits BOTH .js and .d.ts (composite + declaration, NOT emitDeclarationOnly) — kitz has no bundler; tsc is the sole emitter for the published package - `tsc -b tsconfig.development.json` = typecheck all; `tsc -b tsconfig.production.json` = emit build/. Deleted the old flat tsconfig.base.json (→ template.base) and packages/effect/tsconfig.build.json. Scripts → tasks: per-package package.json scripts removed; root scripts reduced to prepare + install:ci. Everything runs through `vp run` (tasks defined in vite.config.mts). pre-commit hook → `vp staged`. CI (pr.yml) → `pnpm exec vp run <task>`. .gitignore: drop dead entries (turbo, dprint, VitePress, Serena, .release, shan-managed/.codex/skills). GVS: stays DISABLED. pnpm 11 GVS breaks `vp run`/`vp check` config loading (vite-plus-core can't resolve its rolldown native binding from the symlinked store: "Cannot find native binding"; verified GVS on => vp run fails, off => all tasks pass). Since the toolchain runs through `vp run`, GVS must stay off. Verified (GVS off, frozen install): vp run check:format / build / check:types / check:lint / test (30/30) / check:package — all green. Follow-up: .claude skills (creating-packages, etc.) still reference the old bun/tsgo/tsconfig.base layout and need a refresh pass. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Owner
Author
|
Superseded by a cleaner two-PR split (the single 2000-file mixed delete/add diff was unreviewable):
Same end state, reviewable in two halves. Merge #285 then #286. |
added 14 commits
June 21, 2026 23:55
…ts it Move the project agent instructions out of .claude/claude.md into a portable root AGENTS.md (read by all agent tools). .claude/claude.md is now a thin Claude Code loader that imports AGENTS.md + CONTRIBUTING.md. While moving, correct stale facts carried in the guide: - commands use 'vp run <task>' (root package.json has no build/check scripts; vite.config.mts run.tasks is the single entrypoint) - drop the '.oxfmtrc.json' reference (lint/fmt config lives in vite.config.mts) - engines floor is Node >=22.13 (not 22.12) - test config is the root vite.config.mts; setup is packages/effect/vitest.setup.ts - drop the dead @issue.md import Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
vp lint / vp format / vp test are first-class Vite+ commands; wrapping them as run.tasks (check:lint, check:format, test, check:cov) added nothing. Remove those four and invoke the commands directly (CI + docs updated). Kept tasks all do something a bare vp command can't: - build, check:types -> wrap tsc with a specific tsconfig - check:package -> publint + attw with cwd + dependsOn: build - check, fix -> compose multiple steps Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Every file under docs/ documented code that no longer exists after the reset to a single @kitz/effect package: release-CLI plans/rationales, fleet/conf/pin/yaml /github-package designs, fuzzy/release-ui superpowers specs, the deleted oxlint-rules guide, and a schema-parsing contract scoped to packages/release. Git history retains them if ever needed. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
vp staged routed **/*.json to 'vp format', so a staged .claude/settings.json
was handed to oxfmt -- which errors ("Expected at least one target file") when
every input is excluded by fmt.ignorePatterns (.claude/**, docs/**). That broke
any commit whose only formattable staged file lives under an ignored root.
Replace the static command arrays with a stagedTask() helper that filters out
the ignored roots and emits no command when nothing remains, so the hook no-ops
instead of failing.
- remove .claude/hooks/{format,lint,check-types}.sh + their settings.json
wiring: all three referenced dead tooling (turbo, dprint, .oxlintrc.json) and
fired on every Edit/Write/Stop, silently failing. Canonical enforcement is the
pre-commit 'vp staged' hook plus CI.
- remove stale .claude/mission-effect-v4.md, quality-blitz/, and the
release-pr-batch-2026-03-18 review artifacts (all old-monorepo era).
Defensive: .tsbuild holds tsc build-info caches (already gitignored via *.tsbuildinfo and excluded from compilation). Add it to the fmt + lint ignorePatterns alongside build/ and coverage/ so no future glob or tool change pulls generated cache files into formatting or linting.
…search - remove .claude/settings.local.json and gitignore it: it is Claude Code's per-machine permission cache, and committing it (the old 'worktree permission sharing' rationale) is what filled it with stale, illegitimate entries. Each checkout regenerates its own; the misleading .gitignore comment is gone. - remove .claude/research/* (kitz-vision, tooling-ecosystem, codegen-typesafety, traitor-archaeology, traitor-v2-design): pre-pivot strategy (tsgo/40-package/ TRAITOR vision), superseded by the single @kitz/effect direction. In git history. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Replace the removed hooks (which referenced dead turbo/dprint/.oxlintrc.json) with working vp equivalents: - PostToolUse(Edit|Write): format.sh auto-formats via 'vp format' (best-effort, never blocks); lint.sh runs 'vp lint' and surfaces failures to the agent via exit 2. Both skip fmt/lint-ignored roots (.claude, docs, build, .tsbuild, ...). - Stop: check-types.sh runs 'vp run check:types' once, only if the session edited TypeScript, surfacing failures via exit 2. Verified all paths: clean pass, ignored-skip, lint-error -> exit 2 with report, typecheck trigger. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Curated exemplar-README list (dataloader, q, RxJava, nickel, immutable-js, ...) with teaching-technique analysis, framed as input for the removed @kitz/release README design. Its general README-writing value does not belong in this package repo and is preserved in git history; folding it into the external readme skill is a separate step (that skill is not present in this environment).
…sh) + ship src
Implements the develop-in-.ts / publish-.js model via pnpm publishConfig:
- exports -> ./src/*.ts so the monorepo and agents resolve real source (live types)
- publishConfig.exports -> ./build/*.{js,d.ts}; pnpm swaps these in at publish
- files: [build, src] ships both; declarationMap + sourceMap make the shipped
src navigable from the published .d.ts/.js
- prepack runs 'tsc -b tsconfig.production.json' so build/ exists before pack/publish
Verified: publint 'All good!' (it packs, so it lints the published shape); attw
--pack green on all 4 entry points (node10/node16/bundler); tarball ships build/+src/.
Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
A native PreToolUse(Bash) hook denies any npm/npx invocation. npm ignores publishConfig.exports (npm/cli#7586), so 'npm publish' would ship the dev .ts exports instead of the built .js; blocking npm makes that class of error impossible. The matcher anchors npm/npx at a command-word boundary, so pnpm, 'pnpm exec', and node_modules paths are unaffected. Implemented natively in settings.json (alongside the format/lint/check-types hooks) rather than via hookify, to keep one hook mechanism in one place. Verified: npm/npx/sudo-npm/node_modules-bin-npm/'&& npm publish' -> blocked; pnpm/pnpm-exec/pnpm-pack/git/node -> allowed. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
…source)
The root README was the stale old-monorepo doc ('A TypeScript standard library',
Arr.is/Obj.is/...). The accurate, npm-published README lives at
packages/effect/README.md. Replace the root file with a symlink so there is one
source: GitHub renders the symlink target on the repo landing page, and npm
ships the real packages/effect/README.md.
vp create package (registered in vite.config.mts create.templates) scaffolds a new @kitz/<concept> package via a Bingo template at packages/generator-package. It emits the current shape: live-types exports (src .ts in dev / build .js at publish), the effect peer dep, the layered tsconfig set (solution + development + production), and the namespace barrel. vp create auto-formats the output. Non-interactive invocation (used by the creating-packages skill): pnpm exec vp create package -- --name <name> --directory <name> --offline --skip-requests then wire the package into the root solution tsconfigs and pnpm install. Verified: generates the correct shape, builds (js + d.ts + maps), lints clean, frozen-lockfile consistent.
…entions - creating-packages: drive 'vp create package' (the new Bingo generator) instead of the broken create-package.ts (which scaffolded @kitz/core deps, tsgo, turbo, tsconfig.base -- all removed). Document the generate -> wire -> install -> check flow. Remove the dead script. - creating-modules: rewrite for the current namespace convention (root _.ts re-export + a live-types exports entry, no # imports), framed as the 'extend @kitz/effect namespaces' path. Points to @kitz/effect as the example. - creating-rules: refresh stale package examples (core/cli -> effect/vitest). Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
added 19 commits
June 24, 2026 19:00
With operations gone, strip the remaining compile-time machinery so the path domain is just the typed ADT plus a runtime analyzer. - Delete inputs.ts (the compile-time input system: Guard<>, normalize<>, FromAnalysis<>, GetValidationError<>, the Input/Guard namespaces) and static-error.ts (only inputs used it). - Delete analyzer.types.ts (type-level string parser: Analyze<>, IsFile<>, ...); analyze() now returns the runtime Analysis instead of a computed Analyze<input>. - Simplify states/depth.ts guards to (path: Path) => boolean — drop the Input generics, the PathWith*<T> narrowing types, and the normalize dependency. - Clean barrels: drop the operations + inputs exports from path/__.ts, the analyzer.types re-exports from the analyzer barrels, and fix stale namespace docs that referenced removed operations. Behavior-preserving: smoke-verified decode/roundtrip and isRoot/isTop/isSub. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Remove the CodecStatics interface + Statics.Codec combinator (core.ts is now just `back`), S.asClass, and the RelFile/Segment class wrappers — every codec is a plain `export const X = codec`. Drop Segment's unused Up/Here/Name/isParent statics. Rewire the two internal users: states.ts Rel.is -> S.is(Rel); constants.ts .fromString -> S.decodeSync. The FileName.extension Option cascade (AbsFile/RelFile) is fixed in the follow-up. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Use S.OptionFromNullOr so extension is a decoded Option<string> but encodes as
`string | null`. (Plain S.Option serializes to a tagged {_tag,value} struct,
which would force serialized-Option handling in every path encode getter — added
complexity for no gain in the wire form.)
- AbsFile/RelFile decode getters return the encoded fileName struct (extension
string | null) instead of FileName.make, which produced a decoded Option that
doesn't fit the encoded slot.
- AbsFile/RelFile name getters use Option.getOrElse on the decoded Option.
- FileName.String getters operate in the encoded string | null domain.
Smoke-verified: file paths with/without extension decode, encode, .name, and
roundtrip correctly.
Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
- Union models (Abs/Dir/File/Rel/Segment): drop the `const schema` intermediate and annotate the export directly (matches Path.ts). - RelFile.back: use the shared `back` helper instead of re-inlining the loop. - Drop stale JSDoc that referenced the removed Statics.Codec combinator and `.fromString` statics; examples use `S.decodeSync(X)` now. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
The codecs hand-rolled path formatting (encode) and back-folding (decode). That logic now lives in the analyzer; the codecs are thin Schema wiring. - analyze() returns folded `segments` (leading `..` steps) instead of separate back/path, and drops the dead pathType/isPathRelative/original fields. - format() builds the path string (the inverse of analyze) — one function replacing the four bespoke per-codec encode getters. - AbsFile/AbsDir/RelFile/RelDir: encode = format(...); decode = analyze + the codec's own kind/absoluteness check + a trivial map. No more separator/prefix string-building or `[...Up, ...path]` folding in the codecs. - FileName.String decode reads analysis.segments; drop the now-dead stringSeparator. Behavior-preserving: roundtrip smoke green for abs/rel x file/dir, dotfiles, no-extension, and leading `..`; `back` derivation intact. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Path segments were a `Name | Up | Here` union with `back` derived at read
time by scanning for leading `Up` nodes. This conflated two concepts in one
array — parent traversal and named components.
Replace with an unfolded representation:
- `Segment` is a refined name string (non-empty, no `/` or NUL, not `.`/`..`).
- `back` is an explicit non-negative-integer field on relative paths.
The analyzer now returns an unfolded `Analysis` (`{ back, segments }`) and
`format()` rebuilds the `../` prefix from `back`. Drops `models/segment/`
(Here/Name/Up/Segment) for a single `models/segment.ts`, and removes the
`File.ts` TS7056 codec annotation — the smaller data model shrinks the
inferred type below the overflow threshold, so the workaround is unneeded.
Also surfaces the analyzer as a public `Path.Analyzer` namespace.
Note: `states.isTop`/`isSub` now count name depth only and ignore `..`
prefixes (e.g. `../x/` is top-level), which is the correct definition now
that `back` is tracked separately.
Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
The Path/Abs/Rel/Dir union codecs carried explicit `S.Codec<...>` annotations that existed only to dodge TS7056 (inferred type too large to serialize in declaration emit). The earlier Segment-ADT unfold shrank the member types below that threshold, so the compiler now names the inferred `Union` type on its own. Production build with declaration emit stays green. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Add a `schema/` extension module (mirroring `string/`) that re-exports `effect/Schema` and adds `NaturalInt` — a non-negative-integer schema effect does not ship — surfaced as `@kitz/effect/Schema` and on the `Schema` namespace. This replaces the path `Back` schema, which was exactly a hand-rolled NaturalInt. Extract the duplicated path `name` getters into pure statics co-located with the type that owns the data: - `FileName.render(self)` — the filename string (stem + extension) - `Segment.basename(segments)` — the trailing name; `Segment` becomes an `asClass`-backed class so it can carry the static AbsFile/AbsDir/RelFile/RelDir `name` getters now delegate to these instead of duplicating the logic four ways. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
`absDirRoot`/`relDirCurrent`/`relDirParent` were thunks that re-decoded on every call. They are immutable path values, so decode once at module load and reuse. No import cycle (only the barrel imports constants); verified runtime-safe. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
…, point-free decodes
The path analyzer now owns failure representation: analyzeFile/analyzeDir build the
`SchemaIssue.InvalidValue` directly and return `Result<_, SchemaIssue.Issue>`, removing
the `PathError` schema-error and the `toIssue` adapter (core.ts deleted). The codec
decode getters no longer branch on the result.
`format` and `analyzeFile`/`analyzeDir` are curried data-last so each specializes
progressively: `format({ isPathAbsolute, back, fileName? })(segments)`,
`analyzeDir({ absolute })(input)`.
The four codec decodes are point-free via `flow(analyzeX(opts), Result.map(reshape),
Effect.fromResult)`. The `_tag` reshape keeps `as const` because flow's inference erases
the contextual type that the pointful form propagated (FileName.ts keeps it for the same
reason — its Match combinator interposes inference).
Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
…dance Convert every path model to the canonical effect dance — value `TaggedClass` (`X__`) wrapped by a `String.pipe(decodeTo(...))` codec, wrapped by `S.asClass` (`X_`), exported as `const X = X_` / `type X = typeof X_.Type`: - FileName is now a `string ⇄ value` codec; the path codecs carry `fileName` as a string and FileName owns the stem/extension split. analyzer hands back the filename string (`AnalysisFile.fileName: string`); `analyzeFileName` splits it; `format` appends it. - Extension: `asClass` with `.make` for free (effect's schema constructor, which validates); the `Extensions` constants are removed. - AbsDir/AbsFile/RelDir/RelFile: `asClass`-wrapped codecs. Dirs keep `.name` (`Segment.basename`); files have none (it only re-ran the codec). - Abs/Rel/Dir/File/Path unions: `asClass` with each variant as a `static readonly` member (e.g. `Path.AbsFile`). Known issue, left for follow-up per direction: the `asClass` dance enlarges the inferred types past the declaration-emit limit — `tsc -b` reports 12 TS7056 on the file-bearing unions/codecs. Runtime and lint are green; declaration emit must be resolved before publish. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Collapse the near-duplicate analyzeFile/analyzeDir into a single core curried
validator `analyzeAs(kind)` — `kind` drives both the parse hint and the error
message (no separate message param). The public analyzers are now point-free
const assignments:
- analyzeFile = analyzeAs('file')
- analyzeDir = analyzeAs('dir')
- analyzeFileName = flow(analyzeFile({ absolute: false }), Result.flatMap(...))
`splitExtension` owns the stem/extension split. The bare-filename rejection
uses a constant issue because the check fires on analyzeFile's success, where
the raw input is already consumed.
Internal to the analyzer; the 12 declaration-emit TS7056 (documented in the
prior commit) are unchanged.
Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
…er TS7056 The asClass dance left the _ wrapper classes un-exported, so declaration emit could not name them and inlined the full schema surface (every Pipeable overload) into each consumer's .d.ts. Nested across path models this overflowed the ~1,000,000-char serialization cap (TS7056), breaking declaration emit. Export the _ classes so emit writes named references (fileName: typeof import(...).FileName_); keep them out of the public surface via explicit barrel re-exports. Adds a CONTRIBUTING note. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
…ile/dir vocab)
analyzeAs takes anchoring as 'absolute' | 'relative' instead of a { absolute: boolean } kwarg — self-documenting at call sites, no boolean trap, open to more states than a binary.
AnalyzerOptions.hint is unified to 'file' | 'dir' (was 'file' | 'directory') to match Analysis._tag / the kind param. analyzeAs now passes { hint: kind } directly, dropping the kind === 'dir' ? 'directory' : 'file' translation that the vocabulary mismatch forced.
Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
added 2 commits
June 30, 2026 01:44
./FileSystem pointed at src/__.ts and build/__.js, which no longer exist — the filesystem domain isn't in this ship (src exports only Path/Schema/String). A stale local build/__.js masked it locally; a fresh CI build fails publint. Remove the export plus the now-inaccurate filesystem description/keywords. @kitz/effect currently ships no test files, so set passWithNoTests so vitest doesn't exit 1 on an empty suite. Session-Id: f5cb4718-d3ad-4282-a90b-8e277488e695
This was referenced Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Kitz had ~48 packages but shipped nothing — the in-repo
@kitz/releaseCLI never published anything. This collapses the repo to a single shippable package,@kitz/effect, and resets the toolchain to the target SOTA stack so we can start shipping.@kitz/effectfollows the effect-plus model: kitz enhancements exposed under Effect's own domain terms (FileSystem,Path), witheffectas a peer dependency.What changed
Scope: 48 packages → 1. Everything outside
@kitz/effect's closure is removed (recoverable from git history), incl. the@kitz/releaseCLI.@kitz/fs→@kitz/effect; the singleFsnamespace split into top-levelFileSystem+Path(supersede Effect's same-named modules)@kitz/effectruntime deps cut toeffect(peer) +picomatch. The@kitz/core/@kitz/jsonsurface it used was inlined with Effect-native prims (Function.dual/absurd) + small local typesvp) for test/lint/format; official TypeScript 7.0.1-rc (tsc) for build + typecheck, file-by-file (no bundler)vite-plus/test; added private@kitz/vitestproviding Effect-native helpers (it.effect/it.live/it.scoped/it.prop/it.layer+Equal-awareexpect) layered on Vite+'s bundled vitestFileSystem.readDirectorywalker) — now honors the injectedFileSystemlayer instead of bypassing it viatinyglobby/node:fsbuild/(compiled.js+.d.ts), real version0.1.0,publishConfig.access: public, README, keywords/engines/etc.publint+attwgreenNotable engineering decisions (and why)
vite-plus/test(resolves throughvite-plus, a declared dep) rather than@effect/vitest(which drags an undeclared@vitest/runner+ a second vitest copy → breaks GVS and clashes withvp test).@kitz/vitestis the kitz-owned equivalent of@effect/vitest, built only on vitest's public API so it stays single-copy + GVS-safe.it.layerbuilds the layer once viaManagedRuntime(verified: built once, shared across tests, disposed inafterAll).FileSystem.Memory.layer'sreadDirectorynow lists implicit intermediate directories (matching real-FS semantics) — required for the layer-aware glob walker to descend nested paths.Verification
Green under GVS on:
pnpm check:types(both packages, TS7) ·pnpm check:lint·pnpm format:check·pnpm test(30/30 viavp test) ·pnpm build·pnpm check:package(publint + attw, node10/16/bundler) ·pnpm check:cov(94.97%).Deliberately deferred (follow-ups, not blockers)
pnpm publish @kitz/effectis the only remaining step; left to a follow-up by request.@kitz/vitesthelpers + glob/memory — these are currently verified via throwaway probes only (tests are owned/curated separately). The suite still uses plaindescribe/it._plainStringtype assertion infromString.test-d.tsis documented asUNVERIFIED—fromString<string>(class union) vsPath(Schema.Type) diverge; needs an ADT-type-alignment decision.@effect/language-servicedropped pending TS7-RC support.Note
This is a pre-1.0, unpublished repo, so the 48→1 collapse breaks no published consumers. Toolchain choices (vitest 4.1.9 via Vite+, effect v4 beta) follow the idiomatic Vite+ path rather than fighting it.