Skip to content

Commit eb6ef1b

Browse files
samuelho-devclaude
andcommitted
chore: configure vendored repos/effect subtree (agent reference)
Follows the Effect "git subtree" trick: vendor the Effect v4 source as read-only reference so agents read real source (the published Effect docs are v3 and wrong for the beta this project targets). The subtree itself was added in the preceding commit (git subtree add --prefix=repos/effect from Effect-TS/effect-smol main --squash). This commit wires the supporting config so repos/ stays invisible to humans and tooling: - AGENTS.md: documents repos/effect as read-only reference + the v3→v4 API map and the high-value Schema.ts/SchemaAST.ts files to consult. - .vscode/settings.json: exclude repos/** from auto-imports, search, watch (un-gitignored just this file so the config is shared). - .prettierignore + eslint.config.mjs: ignore repos/** (keeps lint/format fast and off the 31M vendored tree). repos/ is already absent from tsconfig include and the npm `files` allowlist, so it is neither compiled nor published (verified: typecheck/build/test:emit green, npm pack has 0 repos/ entries). Update with: git subtree pull --prefix=repos/effect <effect-smol> main --squash Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2a14f4b commit eb6ef1b

5 files changed

Lines changed: 77 additions & 1 deletion

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ coverage/
1111
*.lcov
1212

1313
# IDE
14-
.vscode/
14+
.vscode/*
15+
# but share the repos/ editor excludes for the vendored subtree (see AGENTS.md)
16+
!.vscode/settings.json
1517
.idea/
1618
*.swp
1719
*.swo

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ coverage/
1313
src/test-output*/
1414
src/__tests__/generated/
1515

16+
# Vendored read-only Effect v4 source (git subtree, agent reference only)
17+
repos/
18+
1619
# Git
1720
.git/
1821

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"//": "repos/ is vendored read-only reference source (git subtree). Keep it out of editor auto-imports, search, and file watching so it never leaks into project code or slows the editor.",
3+
"typescript.preferences.autoImportFileExcludePatterns": ["repos/**"],
4+
"javascript.preferences.autoImportFileExcludePatterns": ["repos/**"],
5+
"search.exclude": {
6+
"repos/**": true
7+
},
8+
"files.watcherExclude": {
9+
"repos/**": true
10+
}
11+
}

AGENTS.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# AGENTS.md
2+
3+
Guidance for coding agents working in this repository. (See `CLAUDE.md` for the
4+
full project reference — commands, architecture, the Effect 3→4 migration notes,
5+
and the v4 API map. This file documents the vendored reference source.)
6+
7+
## Vendored reference source
8+
9+
This project vendors external source under `repos/` as **read-only reference
10+
material** (via `git subtree`, not a submodule — no init needed).
11+
12+
- Use vendored source to learn idiomatic usage; never import from it or edit it.
13+
- Prefer patterns from the vendored source over documentation or web search —
14+
the published Effect docs are for Effect 3 and are **wrong** for the Effect 4
15+
beta this project targets. The vendored source is the source of truth.
16+
- `repos/` is excluded from TypeScript compilation, ESLint, Prettier, and the
17+
npm package (`files` allowlist). Do not add it to any `include`/`files` list.
18+
19+
### `repos/effect/` — Effect v4 source (vendored from `Effect-TS/effect-smol`, branch `main`)
20+
21+
`effect@4.0.0-beta.x` is built from the `effect-smol` monorepo. When writing or
22+
reviewing Effect code, inspect `repos/effect/packages/effect/src` (and
23+
`.../test`) for real v4 API shapes, signatures, and idioms — do not infer them
24+
from memory or v3 docs.
25+
26+
High-value files for this generator:
27+
28+
- `repos/effect/packages/effect/src/Schema.ts``Top`, `Bottom`, `Codec`,
29+
`Struct`, `brand`, `check`, `encodeKeys`, `Enum`, the `is*` filters. This is
30+
the file to consult for any `Schema.*` question. (`Top` is the structural base
31+
every schema must satisfy; `Bottom<...>` is its 15-param shape.)
32+
- `repos/effect/packages/effect/src/SchemaAST.ts` — AST node types (`Objects`,
33+
`PropertySignature`, `resolve`, the `is*` guards). v4 reworked this heavily
34+
from v3.
35+
36+
### Effect 3 → 4 quick map (verified against the vendored source)
37+
38+
- `Schema.Schema<T,E,R>``Schema.Codec<T,E,RD,RE>`; `Schema.Schema.All`
39+
`Schema.Top`; `Schema.Schema.Type<S>``Schema.Schema.Type<S>` (kept);
40+
`Schema.Codec.Encoded/DecodingServices/EncodingServices<S>` for the rest.
41+
- `asSchema``revealCodec`; `.annotations({})``.annotate({})`.
42+
- `Schema.DateFromSelf``Schema.Date`; `Schema.UUID`
43+
`Schema.String.check(Schema.isUUID())`; `Schema.BigIntFromSelf``Schema.BigInt`.
44+
- Filters moved under `.check(Schema.is*)` (e.g. `Schema.int()`
45+
`Schema.check(Schema.isInt())`, `Schema.between(a,b)`
46+
`Schema.check(Schema.isBetween({ minimum, maximum }))`).
47+
- Variadic combinators take arrays: `Schema.Union(a,b)``Schema.Union([a,b])`,
48+
`Schema.Literal(a,b)``Schema.Literals([a,b])`, `Schema.Tuple(...)` → array.
49+
- `Schema.Enums``Schema.Enum`; `Schema.propertySignature(...).pipe(Schema.fromKey(...))`
50+
→ struct-level `Schema.encodeKeys({ tsName: "db_col" })`.
51+
52+
## Updating the vendored source
53+
54+
```bash
55+
git subtree pull --prefix=repos/effect https://github.com/Effect-TS/effect-smol.git main --squash
56+
```
57+
58+
Keep it roughly in sync with the `effect` beta the project pins (`devDependencies.effect`).

eslint.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ export default tseslint.config(
6161
'**/*.d.ts',
6262
'src/test-output*/**',
6363
'src/__tests__/generated/**',
64+
// Vendored read-only Effect v4 source (git subtree, agent reference only)
65+
'repos/**',
6466
],
6567
}
6668
);

0 commit comments

Comments
 (0)