T-9XXD-intersect-package-exports-and-docs
Status: closed/done · Impact: medium · Complexity: small
Finalize Intersect for extraction — a package.json with exports for
././segments/./fs, a README, a zero-runtime-dep core entry, and a
fully-green corpus (no pending remaining) — so the directory can be lifted into
its own repo.
The implemented package (core, path, registry, fs) and its corpus exist from the prior tasks.
| Location | Role today |
|---|---|
plugin/lib/intersect/index.ts | The implemented path-API entry. |
plugin/lib/intersect/segments/index.ts | The implemented core entry. |
plugin/lib/intersect/fs.ts | The implemented fs entry. |
plugin/lib/intersect/fixtures/ | The corpus, now mostly active. |
Proposed
Section titled “Proposed”plugin/lib/intersect/package.json defines name, an exports map (. → path
API, ./segments → core, ./fs → fs), sideEffects: false, and a files
allowlist; a README documents the three entry points with examples from
D-4FRD-intersect-api; no fixture remains pending; the core/segments entries
declare no runtime dependencies.
Approach
Section titled “Approach”- Add
plugin/lib/intersect/package.jsonwith theexportsmap and metadata; keep the globber reachable only from./fs. - Write
plugin/lib/intersect/README.md— the three entry points, the exact-match/subtree rule, and a short example lifted fromD-4FRD-intersect-apiexamples.md. - Sweep the corpus: assert no
pending: trueremains; the harness runs every case as an activetest. - Add a test that the
././segmentsentries resolve with zero runtime deps and./fsis the only entry that pulls the globber. - Typecheck and run the full suite.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
plugin/lib/intersect/package.json | new | Package manifest with subpath exports. |
plugin/lib/intersect/README.md | new | Entry points + usage. |
plugin/lib/intersect/tests/exports.test.ts | new | Assert entries resolve and the core is dep-free. |
plugin/lib/intersect/fixtures/*.cases.json | modify | Remove residual pending flags. |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1:
plugin/lib/intersect/package.jsonexposes.,./segments, and./fsviaexports. - AC-2: No
*.cases.jsoncase carriespending: true;bun test plugin/lib/intersectis fully green with every case active. - AC-3: A test asserts importing
intersect/intersect/segmentspulls no runtime dependency; onlyintersect/fspulls the globber. - AC-4:
README.mddocuments all three entry points;bunx tsc --noEmitpasses.
Out of scope
Section titled “Out of scope”- Publishing to npm and the actual repo extraction (a follow-up once the corpus is green).
intersection(a,b)and pattern-level negation — deferred perD-4FRD-intersect-api.
Dependencies
Section titled “Dependencies”- Requires the implemented core, path API, registry, and fs layer:
T-UY5H,T-IRYT,T-C4Q0,T-ZAZO.
Discovery context
Section titled “Discovery context”- Closes the milestone: turns the implemented layers into an extractable package.
Depends on
Section titled “Depends on”T-UY5H, T-IRYT, T-C4Q0, T-ZAZO