Skip to content

fix(CI): Undo entirely private props removal from DTS - #3593

Open
RobinTail wants to merge 1 commit into
masterfrom
revisit-fixdts-tool
Open

fix(CI): Undo entirely private props removal from DTS#3593
RobinTail wants to merge 1 commit into
masterfrom
revisit-fixdts-tool

Conversation

@RobinTail

@RobinTail RobinTail commented Aug 3, 2026

Copy link
Copy Markdown
Owner

I'm not sure why, but having #private property in the class declaration seems to be no longer an issue (no errors).
Logs are not retained in #3272

The issue was in issue-952 test: Property '#private' of exported anonymous class type may not be private or protected.

Summary by CodeRabbit

  • Bug Fixes
    • Preserved #private markers in generated declaration files.
    • Continued cleanup of region comments and duplicate blank lines before formatting.

@RobinTail RobinTail added refactoring The better way to achieve the same result CI/CD labels Aug 3, 2026
@dosubot

dosubot Bot commented Aug 3, 2026

Copy link
Copy Markdown

📄 Knowledge review

Dosu skipped reviewing this PR because your organization has used its 200 included credits for the month. Your usage will reset on 2026-09-01. To have Dosu review this PR before then, ask your organization admin to upgrade to a pro account.


Leave Feedback Ask Dosu about express-zod-api Add Dosu to your team

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The DTS formatting pipeline no longer removes #private markers. Rolldown region comments and duplicate blank lines remain subject to cleanup before Prettier formatting.

Changes

DTS formatting

Layer / File(s) Summary
Preserve private markers
tools/fixDts.ts
The formatter no longer strips #private markers. Region-comment and duplicate-newline cleanup remains unchanged.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the change to restore entirely private properties in generated DTS files.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revisit-fixdts-tool

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

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — one-line removal in a build tool plugin that drops a TS6 workaround which is no longer needed:

  • tools/fixDts.ts — removes the .replaceAll(/#private;\s*/g, "") line, restoring #private markers in generated .d.ts files since the underlying issue is resolved.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) (Claude Opus not used — the program covers this model; add its provider key to run your pick) | 𝕏

@coveralls-official

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — revisit-fixdts-tool into master

@RobinTail

Copy link
Copy Markdown
Owner Author

@pullfrog could you figure out the reason why #private caused the issue in issue-952 test as of 2b1e58cf state, but now it does not?

@pullfrog

pullfrog Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Here's the full explanation of why #private caused the issue in issue-952 at the 2b1e58cf state but no longer does.

The #private emission change in TS 6

TypeScript 6.0 changed declaration emit for classes with actual #private fields (private keyword is sufficient to trigger this, it doesn't require actual # fields). Instead of silently omitting private fields from .d.ts files (as TS 5.x did), TS 6 started emitting #private; markers to preserve nominal type identity in declarations. This was an intentional design decision — the TS team closed the request to stop emitting them as "not planned" (#62486).

The bug in TS 6.0.0–6.0.1

The problem was that while TS 6.0.0 emitted #private; markers, consuming a .d.ts file containing them would trigger error TS4094: Property '#private' of exported anonymous class type may not be private or protected. This is the exact error the PR description references.

This hit the issue-952 test, which compiles tags.ts with declaration: true, emitDeclarationOnly: true — effectively consuming the package's own .d.ts files. The generated declarations from rolldown-plugin-dts contained #private; markers (from classes like EndpointsFactory, Routing, etc.), and the downstream tsc compilation rejected them.

The workaround in fixDts.ts

To handle this, the fixDts.ts plugin (introduced in PR #3272) added a regex to strip #private; markers:

.replaceAll(/#private;\s*/g, "") // rm #private markers (TS6 compatibility)

Why it no longer causes an issue

TypeScript 6.0.2 (stable, released March 23, 2026) fixed TS4094 for #private; in declarations. The #private; markers are still emitted (by design), but consuming them no longer produces errors. The commit 2b1e58cf (March 24) bumped the minimum typescript peer dependency from ^6.0.0 to ^6.0.2 precisely to ensure all consumers use the fixed version.

Since the project now requires ^6.0.2+, the #private stripping in fixDts.ts is no longer necessary — which is what PR #3593 does by removing that line.

Task list (5/5 completed)
  • Explore issue-952 test workspace to understand the test
  • Examine fixDts.ts tool and the #private handling
  • Trace the git history: when was #private stripping added and why
  • Identify the exact TypeScript behavior change that resolved the #private issue
  • Report findings via pullfrog_report_progress

Pullfrog  | View workflow run | via Pullfrog | Using DeepSeek Pro (free via Pullfrog for OSS) (Claude Opus not used — the program covers this model; add its provider key to run your pick) | 𝕏

@RobinTail RobinTail changed the title fix(CI): undo entrierely private props removal. fix(CI): Undo entrierely private props removal Aug 3, 2026
@RobinTail RobinTail changed the title fix(CI): Undo entrierely private props removal fix(CI): Undo entirely private props removal from DTS Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD refactoring The better way to achieve the same result

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant