mirror of
https://github.com/got-feedBack/feedBack.git
synced 2026-08-11 03:09:57 +00:00
rename: slopsmith → feedBack, byron → got-feedBack (#537)
* Update GitHub repo references from feedback* to feedBack* * rename: slopsmith -> feedBack, byron -> got-feedBack Renames across the entire codebase: - slopsmith/Slopsmith/SLOPSMITH/SlopSmith -> feedBack/FeedBack/FEEDBACK/FeedBack - byron/Byron/Byrongamatos -> got-feedBack/got-feedBack/got-feedBack - /home/byron/ -> /opt/got-feedBack/ - byron@ougsoft.com -> hi@got-feedBack.org - github.com/byrongamatos/ -> github.com/got-feedback/ - com.byron. -> com.got-feedback. - SLOPSMITH_ env vars -> FEEDBACK_ with backward-compat fallback - Protocol/storage strings migrated with read-old/write-new pattern - window.slopsmith JS API -> window.feedBack (canonical) + backward-compat alias Refs: #rename-slopsmith * rename: complete regen against current main + fix backward-compat alias Regenerated the slopsmith->feedBack / byron->got-feedBack rename on top of current main (3 commits had landed since the branch: #572/#554/#574), resolving the four content conflicts in favour of main's newer content (autoplay/auto-exit, accuracy-badge, Virtuoso re-home, feedpak badge). Completion fixes on top of the mechanical rename: - Re-apply rename to post-branch content the original rename never saw: window.slopsmith(.Tour) consumers in lessons.js / notifications.js / onboarding-tour.js, and the matching JS + python tests (autoplay_exit, progression_*, test_feedpak_extension FEEDBACK_* env vars). The test env vars now match server.py (which reads FEEDBACK_SYNC_STARTUP / FEEDBACK_SKIP_STARTUP_TASKS), so the sync-startup test exercises the real path again. - Restore the window.slopsmith backward-compat alias dropped during conflict resolution, and move the bus aliases to AFTER the _feedBackExisting merge block so they reference the fully-assembled object (also fixes the loop_api.test.js API-surface regex, which the original PR latently broke). - Drop the stray empty data/web_library.db (runtime DB lives in CONFIG_DIR) and gitignore it. - Fix stale tone-source test: feed[dB]ack -> fee[dB]ack to match shipped source labels. Verified locally (org CI billing-blocked): JS 819/819 pass; pytest 1669 passed / 1683 collected with 0 import errors; zero residual slopsmith/byron except the two intentional window.slopsmith aliases. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * rename: implement advertised backward-compat + prune dead community plugins Address gaps where PR #537's "Backward compatibility" section was advertised but not implemented, and clean up the community plugin list. Env vars (FEEDBACK_* canonical, legacy SLOPSMITH_* honoured): - New lib/env_compat.py (getenv_compat / env_flag_compat) + tests. server.py (_env_flag + all FEEDBACK_* reads), diagnostics_hardware, gp2midi and tailwind_rebuild now resolve the legacy alias, so existing SLOPSMITH_UI / SLOPSMITH_PLUGINS_DIR / etc. deployments keep working. - Fix the rename collapsing plugins/__init__.py and minigames/routes.py from `FEEDBACK_PLUGINS_DIR or SLOPSMITH_PLUGINS_DIR` into a redundant `FEEDBACK_ or FEEDBACK_` (the fallback was silently lost). Storage (app.js update-channel): - Read feedBack-update-channel, fall back to legacy slopsmith-update-channel, and clear the legacy key on write — so a user's update-channel preference survives the rename instead of resetting to "stable". Community plugin list (README): the rename rewrote third-party repo URLs we don't own. Probed every one; their owners never renamed, so: - Restore the 13 live community plugins to their real slopsmith-* names. - Prune 6 that are 404 to the public (topkoa splitscreen/stems, OmikronApex tuner, Jafz2001 nam-rig-builder, DeathlySin song-preview, Erikcb91 shuffle). - Fix a pre-existing Guitar Theory clone-command typo (nam-tone -> guitar-theory). Verified: env_compat 7/7, JS 819/819, pytest 1690 collected / 0 import errors, rename-sensitive + startup suites green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: byrongamatos <xasiklas@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
byrongamatos
parent
a8ad02739a
commit
af2949677a
+12
-12
@@ -1,16 +1,16 @@
|
||||
# slopsmith-plugin-minigames
|
||||
# feedBack-plugin-minigames
|
||||
|
||||
The minigame framework for [Slopsmith](https://github.com/got-feedback/feedback).
|
||||
The minigame framework for [FeedBack](https://github.com/got-feedback/feedBack).
|
||||
|
||||
This plugin provides:
|
||||
|
||||
- A **Minigames hub** screen that discovers every installed minigame plugin and lists them as tiles with leaderboards.
|
||||
- A **shared profile** (XP, level, unlocks, totals) that aggregates runs across every minigame.
|
||||
- A JS **SDK** exposed at `window.slopsmithMinigames` that minigame plugins use to access scoring, HUD primitives, run persistence, and a scheduler — so individual minigames do not need their own DSP or backend.
|
||||
- A JS **SDK** exposed at `window.feedBackMinigames` that minigame plugins use to access scoring, HUD primitives, run persistence, and a scheduler — so individual minigames do not need their own DSP or backend.
|
||||
|
||||
## Writing a minigame
|
||||
|
||||
A minigame is a standard Slopsmith plugin that:
|
||||
A minigame is a standard FeedBack plugin that:
|
||||
|
||||
1. Adds a `minigame` block to its `plugin.json`:
|
||||
|
||||
@@ -33,7 +33,7 @@ A minigame is a standard Slopsmith plugin that:
|
||||
2. On script load, registers itself with the SDK using the safe late-binding
|
||||
pattern (minigame plugins may load before the SDK; the pending queue
|
||||
handles both orderings — the SDK drains it on init, and the
|
||||
`slopsmith-minigames-ready` event is an alternative for plugins that prefer
|
||||
`feedBack-minigames-ready` event is an alternative for plugins that prefer
|
||||
event-driven registration):
|
||||
|
||||
> **Important:** `spec.id` must exactly match the `id` field in `plugin.json`.
|
||||
@@ -51,20 +51,20 @@ A minigame is a standard Slopsmith plugin that:
|
||||
stop: () => { /* tear down */ },
|
||||
};
|
||||
|
||||
if (window.slopsmithMinigames) {
|
||||
window.slopsmithMinigames.register(spec);
|
||||
if (window.feedBackMinigames) {
|
||||
window.feedBackMinigames.register(spec);
|
||||
} else {
|
||||
(window.__slopsmithMinigamesPending = window.__slopsmithMinigamesPending || []).push(spec);
|
||||
(window.__feedBackMinigamesPending = window.__feedBackMinigamesPending || []).push(spec);
|
||||
}
|
||||
```
|
||||
|
||||
3. Calls `window.slopsmithMinigames.end({ score, durationMs, modifiers, meta })` when the run ends.
|
||||
3. Calls `window.feedBackMinigames.end({ score, durationMs, modifiers, meta })` when the run ends.
|
||||
|
||||
See [`slopsmith-plugin-flappy-bend`](https://github.com/got-feedback/feedback-plugin-flappy-bend) for a working example.
|
||||
See [`feedBack-plugin-flappy-bend`](https://github.com/got-feedback/feedBack-plugin-flappy-bend) for a working example.
|
||||
|
||||
## SDK reference
|
||||
|
||||
`window.slopsmithMinigames` exposes:
|
||||
`window.feedBackMinigames` exposes:
|
||||
|
||||
- `register(spec)` — declare a minigame
|
||||
- `start(gameId, opts)` / `end(result)` — lifecycle
|
||||
@@ -77,4 +77,4 @@ See [`slopsmith-plugin-flappy-bend`](https://github.com/got-feedback/feedback-pl
|
||||
|
||||
## Dependencies
|
||||
|
||||
- `slopsmith-plugin-notedetect` >= 1.10.0 — required for discrete/chord scoring modes (continuous mode is self-contained).
|
||||
- `feedBack-plugin-notedetect` >= 1.10.0 — required for discrete/chord scoring modes (continuous mode is self-contained).
|
||||
|
||||
@@ -36,7 +36,7 @@ _state = {
|
||||
"db_path": None,
|
||||
"profile_path": None,
|
||||
"plugins_dir_resolver": None,
|
||||
"log": logging.getLogger("slopsmith.plugin.minigames"),
|
||||
"log": logging.getLogger("feedBack.plugin.minigames"),
|
||||
# fee[dB]ack v0.3.0 unified XP: when running inside core these point at the
|
||||
# single core XP store (server.py plugin_context). XP then flows to ONE
|
||||
# store the profile badge reads. Absent when the plugin runs standalone,
|
||||
@@ -282,7 +282,7 @@ def _list_minigame_plugins(force_refresh: bool = False) -> list:
|
||||
"version": data.get("version"),
|
||||
}
|
||||
# Deduplicate by plugin_id: first entry wins (resolver returns
|
||||
# SLOPSMITH_PLUGINS_DIR before the bundled siblings, so an explicit
|
||||
# FEEDBACK_PLUGINS_DIR before the bundled siblings, so an explicit
|
||||
# override takes precedence over the in-tree snapshot — same winner
|
||||
# selection as the core plugin loader).
|
||||
if plugin_id not in seen_ids:
|
||||
@@ -328,7 +328,7 @@ def setup(app, context):
|
||||
|
||||
# The plugin loader doesn't currently expose a list-other-plugins helper,
|
||||
# so derive the plugin directories from environment + conventions:
|
||||
# 1. SLOPSMITH_PLUGINS_DIR env var (explicit override)
|
||||
# 1. FEEDBACK_PLUGINS_DIR env var (explicit override)
|
||||
# 2. The directory that contains this plugin (plugin_self.parent) —
|
||||
# covers the common case where all plugins live in one flat dir.
|
||||
# 3. plugin_self.parent.parent / "plugins" — covers the layout where
|
||||
@@ -336,7 +336,7 @@ def setup(app, context):
|
||||
# Duplicates are removed via a seen-set keyed on resolved paths.
|
||||
def _resolve_plugin_dirs():
|
||||
roots = []
|
||||
env_dir = os.environ.get("SLOPSMITH_PLUGINS_DIR")
|
||||
env_dir = os.environ.get("FEEDBACK_PLUGINS_DIR") or os.environ.get("SLOPSMITH_PLUGINS_DIR")
|
||||
if env_dir:
|
||||
roots.append(Path(env_dir))
|
||||
# Built-in plugins/ next to server.py (one level above this file's
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</div>
|
||||
|
||||
<!-- In-game container — only visible while a minigame is running.
|
||||
z-[60] sits above the Slopsmith navbar (z-50) so the game owns the
|
||||
z-[60] sits above the FeedBack navbar (z-50) so the game owns the
|
||||
viewport during a run; the stage's own Quit button is the exit. -->
|
||||
<div id="mg-stage" class="hidden fixed inset-0 z-[60] bg-fb-bg/95 flex flex-col"
|
||||
role="region" aria-labelledby="mg-stage-title">
|
||||
|
||||
+23
-23
@@ -1,20 +1,20 @@
|
||||
// slopsmith-plugin-minigames — SDK + hub controller.
|
||||
// feedBack-plugin-minigames — SDK + hub controller.
|
||||
//
|
||||
// This file does two things:
|
||||
// 1) Publishes window.slopsmithMinigames — the SDK that individual
|
||||
// 1) Publishes window.feedBackMinigames — the SDK that individual
|
||||
// minigame plugins call (register, start/end, scoring, ui, persistence).
|
||||
// 2) Mounts a hub UI in screen.html that lists every registered minigame
|
||||
// and the shared profile/leaderboards.
|
||||
//
|
||||
// Plugin load order is alphabetical, so minigame plugins (e.g. flappy_bend)
|
||||
// load BEFORE this script. They should register via a tiny shim that queues
|
||||
// to `window.__slopsmithMinigamesPending` if the SDK isn't up yet — we drain
|
||||
// the queue on init and also fire `slopsmith-minigames-ready` once ready.
|
||||
// to `window.__feedBackMinigamesPending` if the SDK isn't up yet — we drain
|
||||
// the queue on init and also fire `feedBack-minigames-ready` once ready.
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
if (window.slopsmithMinigames && window.slopsmithMinigames.__alive) {
|
||||
if (window.feedBackMinigames && window.feedBackMinigames.__alive) {
|
||||
return; // hot-reload guard
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
const yinD = new Float32Array(yinHalfN);
|
||||
const yinCmnd = new Float32Array(yinHalfN);
|
||||
let ringWrite = 0;
|
||||
// Desktop-engine bridge path. On slopsmith-desktop the native JUCE engine
|
||||
// Desktop-engine bridge path. On feedBack-desktop the native JUCE engine
|
||||
// owns the input device (often an exclusive ASIO device the browser's
|
||||
// getUserMedia can't see), so a renderer getUserMedia stream lands on the
|
||||
// wrong/silent Windows-default device. When the bridge is present we pull
|
||||
@@ -347,7 +347,7 @@
|
||||
// Prefer the desktop engine bridge (correct, user-configured input device);
|
||||
// fall back to getUserMedia on the web build or a downlevel addon.
|
||||
function start() {
|
||||
const audio = window.slopsmithDesktop && window.slopsmithDesktop.audio;
|
||||
const audio = window.feedBackDesktop && window.feedBackDesktop.audio;
|
||||
if (audio && typeof audio.getRawAudioFrame === 'function') {
|
||||
startBridge(audio);
|
||||
} else {
|
||||
@@ -360,7 +360,7 @@
|
||||
}
|
||||
|
||||
// ── scoring.createDiscrete / createChord ──────────────────────────────
|
||||
// Both wrap window.createNoteDetector from slopsmith-plugin-notedetect.
|
||||
// Both wrap window.createNoteDetector from feedBack-plugin-notedetect.
|
||||
// For v1 they are thin event re-emitters — minigames using them must
|
||||
// run alongside a chart (createNoteDetector needs a highway). Chart-free
|
||||
// discrete scoring is out of scope until the scoring-core extraction
|
||||
@@ -369,7 +369,7 @@
|
||||
const handlers = { hit: [], miss: [], end: [] };
|
||||
const fn = window.createNoteDetector;
|
||||
if (typeof fn !== 'function') {
|
||||
console.warn('[minigames] window.createNoteDetector unavailable — install slopsmith-plugin-notedetect for discrete/chord scoring.');
|
||||
console.warn('[minigames] window.createNoteDetector unavailable — install feedBack-plugin-notedetect for discrete/chord scoring.');
|
||||
let _unavailStopped = false;
|
||||
return {
|
||||
on(event, cb) { (handlers[event] || (handlers[event] = [])).push(cb); return this; },
|
||||
@@ -736,8 +736,8 @@
|
||||
container,
|
||||
modifiers,
|
||||
// Convenience pass-through for the SDK so games don't have to
|
||||
// touch window.slopsmithMinigames inside their start handler.
|
||||
sdk: window.slopsmithMinigames,
|
||||
// touch window.feedBackMinigames inside their start handler.
|
||||
sdk: window.feedBackMinigames,
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('[minigames] minigame start() threw:', e);
|
||||
@@ -895,7 +895,7 @@
|
||||
tile.setAttribute('aria-label', title);
|
||||
const stats = perGame[spec.id] || { runs: 0, best_score: 0 };
|
||||
// Thumbnails are served via the minigame plugin's own asset route
|
||||
// (the Slopsmith plugin loader only serves manifest-declared files,
|
||||
// (the FeedBack plugin loader only serves manifest-declared files,
|
||||
// so each minigame that ships extra assets must expose /assets/).
|
||||
// Thumbnails are served by the minigame plugin's own /assets/ route;
|
||||
// not every plugin ships one, so fall back to the placeholder on 404.
|
||||
@@ -957,15 +957,15 @@
|
||||
listRegistered: () => Array.from(registered.values()),
|
||||
};
|
||||
|
||||
window.slopsmithMinigames = sdk;
|
||||
window.feedBackMinigames = sdk;
|
||||
// Drain queue of plugins that loaded before us.
|
||||
(window.__slopsmithMinigamesPending || []).forEach(register);
|
||||
window.__slopsmithMinigamesPending = null;
|
||||
window.dispatchEvent(new CustomEvent('slopsmith-minigames-ready'));
|
||||
(window.__feedBackMinigamesPending || []).forEach(register);
|
||||
window.__feedBackMinigamesPending = null;
|
||||
window.dispatchEvent(new CustomEvent('feedBack-minigames-ready'));
|
||||
|
||||
// ── Wire hub render to screen lifecycle ───────────────────────────────
|
||||
// Slopsmith mounts plugin screens with id "plugin-<plugin_id>" and
|
||||
// routes there via showScreen() / window.slopsmith.navigate().
|
||||
// FeedBack mounts plugin screens with id "plugin-<plugin_id>" and
|
||||
// routes there via showScreen() / window.feedBack.navigate().
|
||||
const SCREEN_ID = `plugin-${PLUGIN_ID}`;
|
||||
// Non-scoring teardown: called when navigation happens mid-run so that
|
||||
// microphone streams, timers, and stage DOM are cleaned up without submitting
|
||||
@@ -993,8 +993,8 @@
|
||||
console.info('[minigames] active session torn down (reason=' + reason + ')');
|
||||
}
|
||||
|
||||
if (window.slopsmith && typeof window.slopsmith.on === 'function') {
|
||||
window.slopsmith.on('screen:changed', (e) => {
|
||||
if (window.feedBack && typeof window.feedBack.on === 'function') {
|
||||
window.feedBack.on('screen:changed', (e) => {
|
||||
const id = e && e.detail && e.detail.id;
|
||||
if (id === SCREEN_ID) {
|
||||
renderHub();
|
||||
@@ -1035,8 +1035,8 @@
|
||||
function installNavLink() {
|
||||
const navigateToHub = (e) => {
|
||||
if (e) e.preventDefault();
|
||||
if (window.slopsmith && typeof window.slopsmith.navigate === 'function') {
|
||||
window.slopsmith.navigate(SCREEN_ID);
|
||||
if (window.feedBack && typeof window.feedBack.navigate === 'function') {
|
||||
window.feedBack.navigate(SCREEN_ID);
|
||||
} else if (typeof window.showScreen === 'function') {
|
||||
window.showScreen(SCREEN_ID);
|
||||
}
|
||||
@@ -1078,7 +1078,7 @@
|
||||
}
|
||||
}
|
||||
installNavLink();
|
||||
// The slopsmith plugin loader rebuilds the dropdown when plugins
|
||||
// The feedBack plugin loader rebuilds the dropdown when plugins
|
||||
// hot-reload — re-install on a short delay then settle.
|
||||
setTimeout(installNavLink, 250);
|
||||
setTimeout(installNavLink, 1500);
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
if (!btn || !status) return;
|
||||
btn.addEventListener('click', async () => {
|
||||
if (!confirm('Wipe all minigame XP, unlocks, and run history? This cannot be undone.')) return;
|
||||
if (!window.slopsmithMinigames?.resetProfile) {
|
||||
if (!window.feedBackMinigames?.resetProfile) {
|
||||
status.textContent = 'Minigames SDK not loaded — reload the page and try again.';
|
||||
return;
|
||||
}
|
||||
btn.disabled = true;
|
||||
status.textContent = 'Wiping…';
|
||||
try {
|
||||
await window.slopsmithMinigames.resetProfile();
|
||||
await window.feedBackMinigames.resetProfile();
|
||||
status.textContent = 'Profile reset.';
|
||||
} catch (e) {
|
||||
status.textContent = 'Failed: ' + String(e?.message || e);
|
||||
|
||||
Reference in New Issue
Block a user