Conversation
Rename exports and options for clearer roles after a naming audit; peer review kept disambiguating names (clientName, featureIndex) while applying prefix fixes and pattern/wasm surface improvements.
Conform pass across src: remove dead code, fold single-use helpers, and centralize duplicated logic. - transport: extract shared TransportEventEmitter base so WebSocketTransport and WasmTransport stop copy-pasting the listener registry and on/off/emit - patterns: merge PatternDescriptor into track.ts and drop the one-line descriptor module - protocol: remove unused TypedEmitter alias; read message Id via the typed union in parser; inline identity get* accessors - features: replace the WeakMap index singleton with direct array filters - builders/device: fold single-use guards; route Device.stop through createStopCmd; extract stop-target validation - message-router: order system events via a stable priority sort with the DeviceList-before-ScanningFinished invariant named - scheduler: use the canonical clampNormalized helper Also fixes auto-reconnect re-arming: reconnect now arms only on unexpected transport close, not on every connection.disconnected emit. Explicit disconnect() — including server ping-timeout teardown — no longer re-triggers reconnection.
Contributor
|
Preview published — install with: bun bun add https://pkg.pr.new/@zendrex/buttplug.js@9895811npm npm install https://pkg.pr.new/@zendrex/buttplug.js@9895811Built from 9895811 |
Merged
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.
Addresses #39 as well as documentation, package updates and general code cleanup. This update includes minor breaking changes addressed in the changeset.
Patterns (
@zendrex/buttplug.js/patterns):PatternEngineClient→PatternClientgetPresetInfo→listPresets(module export;PatternEngine.listPresets()unchanged in name)PresetInfo.compatibleOutputTypes→outputTypesPatternEngine.play(device, …)→play(target, …)(parameter rename only)Sensors (
DeviceMessageSender/ custom client implementors):registerSensorSubscription→registerSensorunregisterSensorSubscription→unregisterSensorFeature helpers (deep imports from
./protocol/features):getOutputsByType→outputsByTypegetInputsByType→inputsByTypeWasm transport (
@zendrex/buttplug.js/wasm):WasmTransportOptions.enableWasmLogging→enableLoggingWasmTransportOptions.wasmLogLevel→logLevel