Scaffold tsconfig.json and directory structure for the mongodb extension #134

Closed
opened 2026-08-31 22:02:55 +00:00 by david · 1 comment
Owner

Summary

Add tsconfig.json and the directory skeleton (src/, src/tools/, plus a README.md stub) to extensions/mongodb/ so subsequent steps have a place to put modules, tools, and their co-located tests.

Background

Builds on the package created in "Initialize the extensions/mongodb package (package.json, deps, bun.lock)" — do that first (same milestone). The extension is loaded by pi through a bundler/jiti-style loader, so tsconfig.json must use module settings compatible with that loading path. Copy the pattern from the sibling extensions: extensions/postgres/tsconfig.json and extensions/victorialogs/tsconfig.json already solve exactly this problem for the same repo, so mirror one of them rather than inventing settings from scratch.

The docs/ directory already exists at extensions/mongodb/docs/ (contains DESIGN.md and the implementation plan) — do not touch it. Do NOT create index.ts or any src/*.ts implementation files in this step; later milestones add them.

Implementation Details

  1. Create extensions/mongodb/tsconfig.json by adapting extensions/postgres/tsconfig.json (or victorialogs') — module resolution and module format appropriate for jiti/bundler loading (e.g. module: "esnext" or bundler-appropriate values), strict TypeScript on, matching the sibling configs' conventions.
  2. Create the directories extensions/mongodb/src/ and extensions/mongodb/src/tools/. They will be populated by later steps; note git does not track empty directories, so the files added in later steps are what actually materialize them — creating the dirs now is about the documented layout.
  3. Create extensions/mongodb/README.md as a one-line stub identifying the extension (a full README comes in a later milestone).

Acceptance Criteria

  • extensions/mongodb/tsconfig.json exists with module settings mirroring extensions/postgres/ / extensions/victorialogs/ (bundler/jiti-compatible).
  • tsc --noEmit runs clean against the empty project (or with the placeholder files) from extensions/mongodb/.
  • extensions/mongodb/src/ and extensions/mongodb/src/tools/ exist.
  • extensions/mongodb/README.md stub exists.

Test Plan

cd extensions/mongodb
bunx tsc --noEmit   # exits 0 (empty project type-checks)
ls -d src src/tools
cat README.md       # stub present

If bunx tsc is unavailable in the package yet, verify the config compiles once @types/bun is installed (from the previous step) and diff the config against the postgres sibling.

## Summary Add `tsconfig.json` and the directory skeleton (`src/`, `src/tools/`, plus a `README.md` stub) to `extensions/mongodb/` so subsequent steps have a place to put modules, tools, and their co-located tests. ## Background Builds on the package created in "Initialize the extensions/mongodb package (package.json, deps, bun.lock)" — do that first (same milestone). The extension is loaded by pi through a bundler/jiti-style loader, so `tsconfig.json` must use module settings compatible with that loading path. Copy the pattern from the sibling extensions: `extensions/postgres/tsconfig.json` and `extensions/victorialogs/tsconfig.json` already solve exactly this problem for the same repo, so mirror one of them rather than inventing settings from scratch. The `docs/` directory already exists at `extensions/mongodb/docs/` (contains DESIGN.md and the implementation plan) — do not touch it. Do NOT create `index.ts` or any `src/*.ts` implementation files in this step; later milestones add them. ## Implementation Details 1. Create `extensions/mongodb/tsconfig.json` by adapting `extensions/postgres/tsconfig.json` (or victorialogs') — module resolution and module format appropriate for jiti/bundler loading (e.g. `module: "esnext"` or bundler-appropriate values), strict TypeScript on, matching the sibling configs' conventions. 2. Create the directories `extensions/mongodb/src/` and `extensions/mongodb/src/tools/`. They will be populated by later steps; note git does not track empty directories, so the files added in later steps are what actually materialize them — creating the dirs now is about the documented layout. 3. Create `extensions/mongodb/README.md` as a one-line stub identifying the extension (a full README comes in a later milestone). ## Acceptance Criteria - [ ] `extensions/mongodb/tsconfig.json` exists with module settings mirroring `extensions/postgres/` / `extensions/victorialogs/` (bundler/jiti-compatible). - [ ] `tsc --noEmit` runs clean against the empty project (or with the placeholder files) from `extensions/mongodb/`. - [ ] `extensions/mongodb/src/` and `extensions/mongodb/src/tools/` exist. - [ ] `extensions/mongodb/README.md` stub exists. ## Test Plan ```bash cd extensions/mongodb bunx tsc --noEmit # exits 0 (empty project type-checks) ls -d src src/tools cat README.md # stub present ``` If `bunx tsc` is unavailable in the package yet, verify the config compiles once `@types/bun` is installed (from the previous step) and diff the config against the postgres sibling.
Author
Owner

Closing — all acceptance criteria verified as met:

  • extensions/mongodb/tsconfig.json exists (created in d8a29cc) and is byte-identical to extensions/victorialogs/tsconfig.json (module: esnext, moduleResolution: bundler, strict: true) — bundler/jiti-compatible as required. Note extensions/postgres/ has no tsconfig (older flat layout), so victorialogs was the correct sibling to mirror.
  • bunx tsc --noEmit from extensions/mongodb/ exits 0 (verified against the full implementation, not just the empty project).
  • src/ and src/tools/ exist (with .gitkeep files from the scaffold commit, plus code added by later steps).
  • README.md exists — since expanded into a full README by #145, as this issue anticipated.

The scaffold artifacts were folded into the package-init commit (d8a29cc, "133: Initialize the extensions/mongodb package") rather than a dedicated commit, but all deliverables are present and verified.

Closing — all acceptance criteria verified as met: - `extensions/mongodb/tsconfig.json` exists (created in `d8a29cc`) and is byte-identical to `extensions/victorialogs/tsconfig.json` (`module: esnext`, `moduleResolution: bundler`, `strict: true`) — bundler/jiti-compatible as required. Note `extensions/postgres/` has no tsconfig (older flat layout), so victorialogs was the correct sibling to mirror. - `bunx tsc --noEmit` from `extensions/mongodb/` exits 0 (verified against the full implementation, not just the empty project). - `src/` and `src/tools/` exist (with `.gitkeep` files from the scaffold commit, plus code added by later steps). - `README.md` exists — since expanded into a full README by #145, as this issue anticipated. The scaffold artifacts were folded into the package-init commit (`d8a29cc`, "133: Initialize the extensions/mongodb package") rather than a dedicated commit, but all deliverables are present and verified.
david closed this issue 2026-09-18 06:47:00 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
david/pi-extensions-and-skills#134
No description provided.