Add comprehensive TypeScript type tests using tsd#2
Merged
Conversation
…management - Add comprehensive SSE message formatting with multiline support - Implement streaming support for async generators and Node.js streams - Add connection lifecycle management with keepAlive and close handlers - Support message replay functionality with Last-Event-ID header - Include configurable heartbeat mechanism for connection health - Add route-level SSE configuration with fallback to regular handlers - Provide TypeScript definitions for full type safety - Include comprehensive test coverage for all features - Add working examples demonstrating plugin capabilities
- Align reply.sse.send() and reply.sse.stream() method signatures with agreed design - Update API documentation and examples to reflect final implementation - Ensure compatibility with Fastify's request/reply lifecycle patterns - Standardize method interfaces based on community discussion outcomes
- Remove trailing whitespace and add missing newlines for linting compliance - Update Windows test command to explicitly list test files instead of using glob patterns - Ensure all files meet Standard.js formatting requirements
The README was incorrectly showing reply.sse() which would cause runtime errors. Updated all examples to use the correct reply.sse.send() API that matches the actual implementation. This fixes critical documentation errors that would prevent users from successfully using the plugin.
- Replace standard dependency with eslint and neostandard - Update lint scripts to use eslint instead of standard - Add eslint.config.js with neostandard configuration - Maintains same code style rules through neostandard preset
- Install tsd for TypeScript definition testing - Add comprehensive type test file covering plugin options, SSE messages, reply interface, and route options - Update type definitions to import FastifyPluginAsync and extend RouteShorthandOptions - Add npm script for running type tests 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Resolved conflicts: - package.json: Combined type test dependencies with main branch - types/index.d.ts: Kept RouteShorthandOptions interface and FastifyPluginAsync import - index.js: Used non-async writeToStream method from main branch All tests and type checks pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tsdlibraryChanges
tsdand TypeScript for type testing infrastructurenpm run test:typesscript for running type testsTest plan
npm run test:typesnpm testnpm run lint🤖 Generated with Claude Code