fix: export and type the custom server extension class - #5732
fix: export and type the custom server extension class#5732OskarEichler wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 3e67866 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 8 included reviews per hour; 2 remain after this review. WalkthroughThe change adds a package export for Merge Risk: ⚪ Minimal · up to The PR restores the documented custom server extension path and aligns its TypeScript declaration with the existing runtime constructor behavior. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 3 files. (2 skipped: 2 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
lib/Server.jsESLint failed to execute (timeout). package.jsonESLint skipped: the matched ESLint configuration already failed (timeout). scripts/finalize-cjs-build.mjsESLint skipped: the matched ESLint configuration already failed (timeout).
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. Comment |
There was a problem hiding this comment.
That would be a minor, but honestly, I’m not sure it’s necessary. What’s your use case?
|
The use case targeted here is a TypeScript/ESM consumer providing webSocketServer.type as a custom class that extends the documented BaseServer. Today that requires a deep import of an unexported CommonJS file, and the public type models the extension as a zero-argument factory instead of a constructor. The export and type change make the documented extension point usable without a private-path import. |
Fixes
Compatibility
Restores the documented extension path blocked by the v6 export map. No runtime/engine/dependency removal. The declaration now accepts the class actually instantiated at runtime; invalid callable factories may require correction to constructible classes.
Verification
Unchanged v6 export map reproduces ERR_PACKAGE_PATH_NOT_EXPORTED. Real ESM and CommonJS subclasses construct successfully; CommonJS default interop is retained. Strict NodeNext TypeScript consumer accepts a custom subclass in webSocketServer configuration. Build and full lint/types/spelling/formatting pass.
Audit scope
This is a focused, independently based change from a broader source review at f804962. The combined frozen-source run executed 1,002 tests: 951 passed, 43 failed, one cancelled, seven skipped. Failures were traced to the separately proposed overlay DOM snapshots, reconnect-disabled test expectation and IPv6 host-test assumptions; it is not represented as a green full suite. Relevant focused results are listed above. No checked-in tests/specs/snapshots were added or modified. Hosted CI and the full OS/Node matrix remain pending.
Summary by CodeRabbit
BaseServerclass as a public package entry point.