Skip to content

chore: Add @launchdarkly/eventsource-node package scaffold - #2002

Open
joker23 wants to merge 2 commits into
mainfrom
skz/sdk-2924/migrate-node-eventsource-package-scaffold
Open

joker23 wants to merge 2 commits into
mainfrom
skz/sdk-2924/migrate-node-eventsource-package-scaffold

Conversation

@joker23

@joker23 joker23 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

First layer of the eventsource migration stack. Adds the @launchdarkly/eventsource-node package scaffold: package identity (package.json, tsconfigs, tsup, jest, typedoc, docs), the dependency-free retryDelay and capacity modules with their unit tests, and the public option/event types, which derive from the @launchdarkly/js-sdk-common platform contract. src/index.ts is a scaffold that exports only the types; the EventSource implementation and its export arrive in the next layer. Also wires the package into the root workspaces and tsconfig references, and adds a build-test CI workflow with a TODO for contract tests (completed later in the stack).


Note

Overview
Introduces @launchdarkly/eventsource-node as the first layer of in-repo EventSource work: package metadata, build/test tooling (tsup, Jest, TypeDoc), license/README/changelog, and monorepo wiring (Yarn workspace, root tsconfig project reference, dedicated eventsource-node.yml CI via shared ./actions/ci).

The public surface is intentionally minimal: src/index.ts exports only types aligned with @launchdarkly/js-sdk-common (init options, event payloads, Node TLS/proxy options); the EventSource client is deferred to a follow-up layer. This PR does land two ported helpers—retryDelay (backoff, jitter, reset interval) and capacity (buffer growth with a fixed 8192 minimum instead of reading Buffer.poolSize)—each with unit tests; Jest is pinned to maxWorkers: 1 to avoid port collisions from test helpers. Contract tests in CI are left as a TODO.

Reviewed by Cursor Bugbot for commit 6cb3662. Bugbot is set up for automated code reviews on this repo. Configure here.

@joker23
joker23 added this pull request to stack #2004 September 10, 2026 17:46
@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 26360 bytes
Compressed size limit: 29000
Uncompressed size: 129188 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 32563 bytes
Compressed size limit: 34000
Uncompressed size: 116654 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25568 bytes
Compressed size limit: 44000
Uncompressed size: 166115 bytes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

cert?: string | string[] | Buffer | Buffer[];
ca?: string | string[] | Buffer | Buffer[];
ciphers?: string;
rejectUnauthorized?: boolean;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

NOTE: I decided to take the rejectUnauthorized option out of top level option. This should be fine from an API standpoint as I will update the call sites.

@joker23
joker23 marked this pull request as ready for review September 10, 2026 19:19
@joker23
joker23 requested a review from a team as a code owner September 10, 2026 19:19

@devin-ai-integration devin-ai-integration 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.

🔍 Devin Review: 2 flags

Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

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