Skip to content

build: keep JSDoc in the published type declarations - #6219

Merged
edusperoni merged 1 commit into
mainfrom
fix/release-declaration-jsdoc
Nov 30, 2026
Merged

edusperoni merged 1 commit into
mainfrom
fix/release-declaration-jsdoc

Conversation

@edusperoni

@edusperoni edusperoni commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

PR Checklist

What is the current behavior?

tsconfig.release.json sets removeComments: true, which applies to the generated .d.ts files as well as the JavaScript. The published declarations therefore carry no JSDoc: API docs are missing on hover, and @deprecated tags written in .ts sources never reach extension and hook authors. Only the hand-written .d.ts files, which are copied as they are, keep theirs.

What is the new behavior?

build.release runs a second, declarations-only compile with comments kept. It overwrites the .d.ts files and leaves the JavaScript alone.

Comparing the npm run pack.release tarballs before and after:

Before After
@deprecated in shipped .d.ts files 26 (hand-written only) 66
Files in the tarball 956 956
Files that differ, other than .d.ts – none
Package size 3.3 MB 3.4 MB
Unpacked size 10.2 MB 10.3 MB

Separately, the TypeScript language service was run on a sample consumer against the compiled output, built with and without the second pass. Without it nothing is flagged; with it Yok, Yok.resolve, ProjectData.projectId and Errors.failWithoutHelp are reported as deprecated.

No automated test is included: the change only affects the release build, which the test suite does not run.

Summary by CodeRabbit

  • Chores
    • Updated the release build process to generate TypeScript declaration files alongside the existing release output. This is an internal build change and does not alter user-facing functionality.

removeComments applies to every output of a compile, so the release build
also stripped JSDoc from the generated declarations, including each
@deprecated tag. Editors showed no deprecation warnings to extension and
hook authors.

Emit the declarations again with comments kept. The JavaScript output is
unchanged.
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The build.release script adds a TypeScript declaration-only compilation with comments preserved. It runs after the existing release compilation and before test dependency generation.

Changes: Release build

Layer / File(s) Summary
Declaration compilation
package.json
build.release runs an additional TypeScript compilation with --emitDeclarationOnly and --removeComments false before generating test dependencies.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: nathanwalker

Merge Risk: Minimal · up to 9e6a1

The release build now keeps JSDoc and @deprecated tags in the published type declarations. The change is small and easy to revert, and no merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "build: keep JSDoc in the published type declarations" matches the main change. The package.json change adds a second release compile with --emitDeclarationOnly and --removeComments false, s…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "build: keep JSDoc in the published type declarations" matches the main change. The package.json change adds a second release compile with --emitDeclarationOnly and --removeComments false, so the published .d.ts files keep JSDoc and @deprecated tags. The title names the purpose and the affected output, and it follows a conventional commit prefix.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the build at dawn,
Declarations hop along.
Comments stay beside each name,
Test dependencies follow the same.
The release script is set to run,
Then I nibble, pleased, in the sun.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1496cebe-e190-4458-9ca0-e5f6c0c36535
Commits

Reviewing files that changed from the base of the PR and between ac18825 and 9e6a1b9.

Files selected for processing: 1

  • package.json

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

@edusperoni
edusperoni merged commit 5f4030a into main Nov 30, 2026
15 checks passed
@edusperoni
edusperoni deleted the fix/release-declaration-jsdoc branch November 30, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant