feat: initial commit — RangerHQ Tuner v0.1.0 (Tier 1 MVP)

Chrome MV3 extension, browser-resident sibling to rangerhq-radio
(WP plugin). Plays SomaFM via the chrome.offscreen API + a source-
adapter pattern at src/sources/.

Architecture highlights:
- Audio runs in offscreen document — SW would get killed.
- Source-adapter pattern locks Tier 1 contract (RadioSource interface
  in src/sources/base-source.js). Adding a network = drop a file +
  register one line in src/sources/index.js.
- Vanilla JS, no build step. Pure ES modules.
- No telemetry, no third-party JS. Outbound only to somafm.com.
- Narrow permissions: offscreen + storage + somafm.com host_perms.
  No tabs, no <all_urls>, no webRequest.

22 files, ~30 min build following the saved plan at
~/.ranger-memory/projects/rangerhq-tuner-plan.md.

Tier 2 + Tier 3 (Web Store submission) not started.
This commit is contained in:
2026-06-08 23:31:29 +01:00
commit 38b6b8d3f7
20 changed files with 1001 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
// Message type + target constants. Single source of truth — popup,
// service worker, and offscreen document all import from here so we
// can't drift on string typos.
export const TARGETS = Object.freeze({
SW: 'sw',
OFFSCREEN: 'offscreen',
POPUP: 'popup',
});
export const TYPES = Object.freeze({
PLAY: 'PLAY',
PAUSE: 'PAUSE',
SET_VOLUME: 'SET_VOLUME',
GET_STATE: 'GET_STATE',
STATE_CHANGED: 'STATE_CHANGED',
METADATA_UPDATED: 'METADATA_UPDATED',
ERROR: 'ERROR',
});