tapdeck 0.2.0 — in-house native Sonos engine, rename, and dependency diet#6
Merged
Conversation
Port the proven subset of sonos-http-api/sonos-discovery into the project as a
zero-dependency, native (dgram + fetch + hand-rolled XML) engine under lib/sonos/,
and call it directly from process_sonos_command.js (no HTTP server, no port 5005).
- lib/sonos/{xml,soap,discovery,player,system,index}.js + services/spotify.js
- SSDP discovery, GetZoneGroupState topology -> group-coordinator resolution
(handles stereo-pair Invisible members), SOAP transport, Spotify now-playing,
favorites/playlists, command passthrough
- Spotify-only for music services; favorites/playlists/transport work for any
service already configured in the Sonos app
- Drop deps: sonos-http-api, node-fetch, concurrently (+ their overrides);
keep nan override for the nfc-pcsc native build
- Migrate tests from fetch-mock to engine-mock; add xml/soap/spotify/system
unit tests with fixtures captured from the live system
Removes the entire EOL request/lodash/aws-sdk chain -> npm audit now 0 vulns.
- name -> tapdeck, version -> 0.2.0, refreshed description + README - remove nan override (pcsclite's own ^2.14.0 already resolves to nan 2.27, which builds on Node 24 — override was redundant) - remove unused babel-plugin-transform-amd-to-commonjs devDependency
…uard - remove husky devDep, prepare hook, .husky/ (IDE handles autoformat); simplify format script to 'prettier --write .' - replace the hacky preinstall node-version check with engines>=24 + .npmrc engine-strict=true (now viable since sonos-http-api/request, which declared npm ^2.0.0, is gone)
- remove @babel/core, @babel/preset-env, babel-jest + babel.config.json
- jest.config: transform:{} (no transpile; native ESM via package type:module)
- test script: NODE_OPTIONS=--experimental-vm-modules jest
- migrate mocking to jest.unstable_mockModule + dynamic import in the two
engine/command tests and sonos_nfc test
- sonos_nfc.test: drop unused nfc-pcsc import (suite no longer needs the
native module) and inline the nfccard-tool mock; remove __mocks__/
- devDeps now just jest + prettier
When a music card (spotify/favorite/playlist) is scanned and the speaker is basically muted (volume < 5), raise it to min_volume (configurable, default 10) so the tap never plays silently. command:/room: are unaffected.
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.
Replaces the unmaintained
sonos-http-apidependency with a small, zero-dependency native Sonos engine built into the project, and rebrands the (now-detached) fork as tapdeck0.2.0. The app talks to Sonos directly over the LAN (UPnP/SOAP) — no API server, no port 5005, no cloud, no credentials.Headline wins
npm audit: 9 → 0 — deletingsonos-http-apiremoves the entire EOLrequest/request-promise/lodash 3.x/aws-sdkchain.dgram+ nativefetch+ hand-rolled XML). Runtime deps are now onlynfc-pcsc+nfccard-tool.jest+prettier— Babel, husky, jest-fetch-mock, and assorted overrides/plugins all gone.New engine —
lib/sonos/discovery.jsSSDP discovery ·system.jstopology → group-coordinator resolution (handles stereo-pairInvisiblemembers) + Spotify service lookup + favorites/playlists ·player.jstransport/rendering SOAP ·services/spotify.jsURI/DIDL + now-playing ·soap.js/xml.jsenvelope + parsing.Behavior
spotify:tags; favorites/playlists/transport/command:work for any service already set up in the Sonos app;room:switches rooms.min_volume(default 10) so a tap never plays silently.Project / tooling
codybrom/tapdeck.engines+.npmrcengine-strict(replaced the hacky preinstall guard).jest --experimental-vm-modules,unstable_mockModule) — no Babel. Removing an unusednfc-pcscimport means the full suite runs without the native module.Verification
npm audit0.playFavorite(Spotify) → PLAYING all confirmed.tapdeck, reader re-attaches, engine rediscovers Sonos.