Thanks for helping build nowplaying. The project is in private early development, so interfaces can change, but changes should still be easy to review, test and undo.
- Search existing issues before opening another.
- Use a focused issue for a behavior change or sizable documentation task.
- Keep pull requests small. One provider, output behavior, validation rule or document is usually enough.
- Discuss large architecture changes before writing them.
- Never put real media-server credentials, URLs or activity data in issues, fixtures or screenshots.
Security problems follow SECURITY.md, not public issues.
Requirements:
- Node.js 22 or 24
- npm from the chosen Node.js release
- Git
git clone https://github.com/rowkavdev/nowplaying.git
cd nowplaying
npm install
npm run check
npm test
npm run buildThe package has no runtime dependencies yet. Do not add one when a small platform API or local helper is enough.
| Command | Purpose |
|---|---|
npm run check |
Parse-check source, provider modules and tests |
npm test |
Run all Node tests |
npm run test:coverage |
Run tests with the built-in coverage report |
npm run build |
Create and smoke-test dist/, including a sample SVG |
Run all four before opening a pull request. CI repeats them across supported Node versions and validates the build artifact.
npm test also checks the docs offline (test/docs-links.test.js): relative links and #anchors must resolve, links to this repo's files on github.com must point at files that exist, file paths in code must exist, and every npm run command must be a real script. Links to other websites aren't checked.
Use a short branch name that describes the change, for example:
feat/discord-timestamps
docs/deployment-guide
fix/navidrome-user-match
A pull request should:
- explain what changed and why;
- link its issue when one exists;
- include tests for behavior changes;
- update relevant docs in the same focused change;
- avoid unrelated formatting or refactors;
- keep generated artifacts out of commits unless the release process requires them;
- pass every required check before merge.
Use plain commit subjects in the form area: action, such as providers: add Emby adapter or docs: explain token handling.
The codebase uses ESM and the Node.js standard library.
- Use
constunless reassignment is required. - Prefer small functions with explicit inputs and returned values.
- Inject network and transport dependencies for deterministic tests.
- Validate at module boundaries rather than relying on coercion.
- Keep provider-specific fields inside provider adapters.
- Do not catch an error merely to return idle presence.
- Keep user-facing strings and XML escaped at the output boundary.
- Add comments for constraints and source attribution, not for obvious syntax.
There is no formatter dependency. Match the surrounding two-space indentation, semicolons and double-quoted strings.
Tests use node:test and node:assert/strict.
Behavior changes need tests that cover the important state and at least one failure path. Prefer synthetic payloads close to the provider format over mocks that only return the final normalized object.
Cover:
- required configuration;
- request URL and authentication without exposing token values;
- user/session selection;
- playing and paused behavior where the provider supports both;
- media-type and text mapping;
- position and duration units;
- empty session lists;
- non-success HTTP responses;
- malformed or unsupported payloads.
Cover:
- playing, paused and idle states;
- XML escaping;
- invalid and bounded layout inputs;
- missing optional metadata;
- accessible title and description text;
- privacy settings before adding a field to public output.
Tests and fixtures must not contain copied personal activity or credentials. Use names such as Test User, Example Movie and https://media.example.test.
Read docs/architecture.md and docs/providers.md first.
- create
src/providers/<provider>.js; - implement and validate the provider contract;
- keep HTTP authentication, parsing and units in that module;
- return the shared immutable presence model;
- add contract and provider tests;
- export the factory through its subpath and
src/index.js; - update package exports and provider docs;
- add source and license notices for adapted code.
A provider pull request should not also add output-specific formatting.
An output consumes normalized presence after shared privacy policy. It must not read raw provider payloads or credentials.
Document:
- field length and character constraints;
- artwork and URL behavior;
- playing, paused, idle and error behavior;
- update or cache strategy;
- audience and privacy implications.
Visual changes require inspection of the rendered SVG or UI, not only string assertions. Include before/after evidence in the pull request when layout or color changes.
Documentation must distinguish current behavior from planned work. Examples should be copyable, use placeholders for secrets and match current public exports. Link to source references when describing a provider protocol or adapted implementation.
Use direct language and descriptive headings. Avoid claims such as “secure” or “production-ready” without a specific guarantee and test.
Contributions are accepted under AGPL-3.0.
The Plex adapter contains work adapted from DRPP under the same license. Keep its file-level source, copyright and license notice. Any new copied or adapted code must have a compatible license and a clear source record in the file and NOTICE when appropriate.
Do not paste code from a project until its license and attribution requirements have been checked.
Before requesting review:
- scope is one focused change;
- public behavior and compatibility impact are clear;
- tests cover success and failure behavior;
-
npm run checkpasses; -
npm testpasses; -
npm run test:coveragepasses; -
npm run buildpasses; - docs and package exports are current;
- logs, fixtures and screenshots contain no private data;
- adapted code has license and source notices;
- visual changes were rendered and inspected.