Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

refactor: TypeScript config improvements and code quality fixes#63

Merged
roottool merged 6 commits intomainfrom
experiment/rollup-bundler
Mar 3, 2026
Merged

refactor: TypeScript config improvements and code quality fixes#63
roottool merged 6 commits intomainfrom
experiment/rollup-bundler

Conversation

@roottool
Copy link
Copy Markdown
Owner

@roottool roottool commented Mar 3, 2026

Description

Tooling and TypeScript configuration improvements identified during bundler experiments on this branch.
No changes to runtime behavior or public API.

Type of Change

  • Refactoring (non-breaking change improving code structure)
  • Tooling / CI (changes to build tools, CI configuration)

Boundary Checklist

  • This is a non-implementation change (Documentation, Tooling, or CI only)
  • No interpretation — Keys treated as opaque strings, no structural inference
  • No silent behavior — No merging, overwriting, or implicit resolution
  • Boundary respected — No validation, coercion, or business logic

📘 AGENTS.md

Security & API Stability

  • No security impact (forbidden keys, prototype safety unaffected)
  • No changes to public API (parse, ParseResult, ParseIssue, IssueCode)
  • No breaking changes; or justified with version bump rationale
  • Compatible with current v0.x versioning policy

Changes

TypeScript Config

  • isolatedDeclarations: true enabled — prep for Oxc-based .d.ts generation
  • isolatedDeclarations: false override added to tsconfig.examples.json (examples don't emit .d.ts)
  • removeComments removed — redundant since minifiers handle it; JSDoc now preserved in .d.ts

Package Config

  • sideEffects: false added for reliable tree-shaking

Code Quality

  • FORBIDDEN_KEYS: changed to ReadonlySet<string> — stronger immutability, prevents .add()/.delete()/.clear() at the type level
  • src/index.ts: removed internal JSDoc comment that leaked into .d.ts as a meaningless note to consumers
  • src/index.ts: moved import to top per convention; simplified re-export from from "..." form

Testing

  • bun run check:type:source passes
  • bun run test passes
  • bun run build passes

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

roottool and others added 6 commits March 3, 2026 22:09
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add explicit `: ReadonlySet<string>` annotation (required by isolatedDeclarations)
- Upgrade from Set<string> to ReadonlySet<string> to prevent accidental mutation
- Remove redundant `<string>` generic and `as const satisfies readonly string[]`

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The removeComments option was redundant — minifiers (terser, esbuild, oxc)
strip comments from JS output regardless of this flag.
Removing it lets bundlers preserve JSDoc in generated .d.ts files,
improving IDE hover experience for library consumers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The comment was an internal note pointing to AGENTS.md without a link,
which leaked into dist/index.d.ts and was meaningless to library consumers.
The parse() function already carries a proper @see link to AGENTS.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move `import type { ParseResult }` to the top of the file per convention.
Simplify `export type { ParseResult } from "..."` to `export type { ParseResult }`
since the import already declares the source.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@roottool roottool self-assigned this Mar 3, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ec01447) to head (174a7ef).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #63   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           23        23           
  Branches         5         5           
=========================================
  Hits            23        23           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@roottool roottool merged commit 8061d8b into main Mar 3, 2026
13 checks passed
@roottool roottool deleted the experiment/rollup-bundler branch March 3, 2026 14:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant