@rmdes/indiekit-endpoint-funkwhale 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -0
- package/lib/blocks.js +37 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { statsController } from "./lib/controllers/stats.js";
|
|
|
9
9
|
import { nowPlayingController } from "./lib/controllers/now-playing.js";
|
|
10
10
|
import { startSync } from "./lib/sync.js";
|
|
11
11
|
import { waitForReady } from "@rmdes/indiekit-startup-gate";
|
|
12
|
+
import { FUNKWHALE_BLOCKS } from "./lib/blocks.js";
|
|
12
13
|
|
|
13
14
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
15
|
|
|
@@ -63,6 +64,10 @@ export default class FunkwhaleEndpoint {
|
|
|
63
64
|
};
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
get blocks() {
|
|
68
|
+
return FUNKWHALE_BLOCKS;
|
|
69
|
+
}
|
|
70
|
+
|
|
66
71
|
/**
|
|
67
72
|
* Protected routes (require authentication)
|
|
68
73
|
* Admin dashboard only - detailed views are on the public frontend
|
package/lib/blocks.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Funkwhale v2 block declaration (Phase 7c — plugin block ownership).
|
|
3
|
+
*
|
|
4
|
+
* The `funkwhale` block (label "Listening") was a site-config BUILTIN_BLOCKS seed
|
|
5
|
+
* (requiresPlugin null). Declaring it here makes site-config's scanPlugins stamp
|
|
6
|
+
* `sourcePlugin` → `requiresPlugin` ("Funkwhale listening activity endpoint"), so
|
|
7
|
+
* the block is properly plugin-gated (theme ENDPOINT_SLUGS maps it to the
|
|
8
|
+
* `funkwhale` loadout slug). scanPlugins precedence is `built-in < plugin blocks`,
|
|
9
|
+
* so this entry OVERWRITES the builtin seed where the plugin is loaded; the seed
|
|
10
|
+
* itself is removed from site-config in Phase 7d.
|
|
11
|
+
*
|
|
12
|
+
* `source:"api"` is honest: as of 7c the combined "Listening" widget fetches the
|
|
13
|
+
* plugin APIs LIVE client-side (now-playing/listenings + Last.fm now-playing/
|
|
14
|
+
* scrobbles) — now-playing is always current, no rebuild. The widget is COMBINED
|
|
15
|
+
* (Funkwhale + Last.fm); this plugin owns the single "Listening" block (Last.fm is
|
|
16
|
+
* a silent data contributor in v1 — see the future "listening plugin" rename).
|
|
17
|
+
* Bespoke template: the theme owns `components/widgets/funkwhale.njk` +
|
|
18
|
+
* `js/widgets/listening.js`.
|
|
19
|
+
*
|
|
20
|
+
* @module lib/blocks
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** @type {Array<object>} */
|
|
24
|
+
export const FUNKWHALE_BLOCKS = [
|
|
25
|
+
{
|
|
26
|
+
id: "funkwhale",
|
|
27
|
+
version: 1,
|
|
28
|
+
label: "Listening",
|
|
29
|
+
description: "Funkwhale now playing and stats",
|
|
30
|
+
icon: "music",
|
|
31
|
+
category: "social",
|
|
32
|
+
placement: { regions: ["sidebar"], surfaces: ["homepage"] },
|
|
33
|
+
multiple: false,
|
|
34
|
+
data: { source: "api" },
|
|
35
|
+
schema: { type: "object", additionalProperties: false, properties: {} },
|
|
36
|
+
},
|
|
37
|
+
];
|
package/package.json
CHANGED