feat(tsconfig): app.json, for a workspace that emits no declarations - #8
Conversation
`base.json` with `declaration` and `declarationMap` off. Declaration emit is type-checked even under `noEmit`, so an application pays two `TS4023` lines about a library's internal brand symbols before every mistake it actually made, and gains nothing — it ships no `.d.ts`. A library keeps `base.json`. Claude-Session: https://claude.ai/code/session_01GGixjxi5AQ2cNK62bBymfF
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdded an ChangesApplication TypeScript preset
fast-uri security override
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR adds an application TypeScript preset and validates its structure; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Title checkExplanation The title clearly identifies the addition of the Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🟡 Changes recommended
The new preset promises declarationMap: false, but the added validation only asserts declaration: false, leaving a gap that could allow regressions undetected.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a new TypeScript config preset intended for application-style workspaces (deployments/examples/tests) that do not ship .d.ts, so they can avoid declaration-emit diagnostics while keeping the strict base settings.
Changes:
- Introduces
packages/tsconfig/app.jsonextendingbase.jsonwithdeclaration/declarationMapdisabled. - Exposes and packages
app.jsonviafiles+exportsand documents when to use it. - Extends
scripts/validate.mjsto include the new shipped file and basic structural assertions.
File summaries
| File | Description |
|---|---|
| scripts/validate.mjs | Adds app.json to shipped allow-list and validates key app.json structure. |
| packages/tsconfig/README.md | Documents the new app.json preset and rationale for apps vs libraries. |
| packages/tsconfig/package.json | Publishes app.json via files and subpath exports. |
| packages/tsconfig/app.json | New tsconfig preset disabling declaration outputs while extending the base config. |
| .changeset/tsconfig-app-preset.md | Declares a minor release and describes the new preset behavior. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Review on #8: the check asserted `declaration: false` and left the second flag unguarded — and `declarationMap: true` under `declaration: false` emits nothing either way, so a regression there is silent, which is exactly the shape this file exists to catch. Verified to bite: flipping the flag fails the check naming it. Claude-Session: https://claude.ai/code/session_01GGixjxi5AQ2cNK62bBymfF
`Security Audit` is red on `main`, and on every open PR with it: four advisories landed in the same parser after the last bump — GHSA-5jgf-p345-68v8, GHSA-f65p-4m7j-42xc, GHSA-fph4-wmhf-6fwf and GHSA-jqff-g426-hqxp, all ReDoS or parsing confusion in fast-uri below 3.1.6. The existing entry's floor moves rather than a second one being added: two overlapping ranges for one package is how a floor stops applying without anybody noticing. Same path as before — `@commitlint/cli` > `ajv`, dev tooling only — and 3.1.6 published 2026-08-23, well past `minimumReleaseAge`. Claude-Session: https://claude.ai/code/session_01GGixjxi5AQ2cNK62bBymfF
|
CI is green: Format, Lint, Security Audit and Validate configs all pass.
The floor moves on the existing entry rather than a second one being added — two overlapping ranges for one package is how a floor stops applying without anybody noticing (in |
base.jsonwithdeclarationanddeclarationMapoff, for a workspace that emits no declarations — an application, a deployment, an example, a test workspace.Why it earns a preset. Declaration emit is type-checked even under
noEmit, sodeclaration: truecosts an application the errors it buys a library. Measured on a DI composition root with one unmet dependency:The two lines about a library's internal brand symbols come first; the sentence naming the missing port comes third. With
app.jsonthe actionable diagnostic is the only one. An application that ships no.d.tshas nothing to gain from that check and pays for it on every wiring mistake, internals-first.A library keeps
base.json: there the declaration check is the guarantee that its consumers can build.scripts/validate.mjscovers the new file — thefilesallow-list and one structural assertion (extends./base.json,declaration: false).Downstream of btravstack/btravstack#205.
https://claude.ai/code/session_01GGixjxi5AQ2cNK62bBymfF
Summary by CodeRabbit
New Features
app.jsonTypeScript configuration preset for applications, deployment packages, examples, and test workspaces.Documentation
Security
fast-urisecurity override to address additional parsing and regular-expression denial-of-service advisories.Tests