@rmdes/indiekit-endpoint-blogroll 1.0.23 → 1.0.25
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 +11 -1
- package/lib/blocks.js +49 -0
- package/package.json +2 -1
package/index.js
CHANGED
|
@@ -7,6 +7,8 @@ import { blogsController } from "./lib/controllers/blogs.js";
|
|
|
7
7
|
import { sourcesController } from "./lib/controllers/sources.js";
|
|
8
8
|
import { apiController } from "./lib/controllers/api.js";
|
|
9
9
|
import { startSync, stopSync } from "./lib/sync/scheduler.js";
|
|
10
|
+
import { waitForReady } from "@rmdes/indiekit-startup-gate";
|
|
11
|
+
import { BLOGROLL_BLOCKS } from "./lib/blocks.js";
|
|
10
12
|
|
|
11
13
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
14
|
|
|
@@ -54,6 +56,10 @@ export default class BlogrollEndpoint {
|
|
|
54
56
|
};
|
|
55
57
|
}
|
|
56
58
|
|
|
59
|
+
get blocks() {
|
|
60
|
+
return BLOGROLL_BLOCKS;
|
|
61
|
+
}
|
|
62
|
+
|
|
57
63
|
/**
|
|
58
64
|
* Protected routes (require authentication)
|
|
59
65
|
* Admin dashboard and management
|
|
@@ -142,11 +148,15 @@ export default class BlogrollEndpoint {
|
|
|
142
148
|
|
|
143
149
|
// Start background sync if database is available
|
|
144
150
|
if (Indiekit.config.application.mongodbUrl) {
|
|
145
|
-
|
|
151
|
+
this._stopGate = waitForReady(
|
|
152
|
+
() => startSync(Indiekit, this.options),
|
|
153
|
+
{ label: "Blogroll" },
|
|
154
|
+
);
|
|
146
155
|
}
|
|
147
156
|
}
|
|
148
157
|
|
|
149
158
|
destroy() {
|
|
159
|
+
this._stopGate?.();
|
|
150
160
|
stopSync();
|
|
151
161
|
}
|
|
152
162
|
}
|
package/lib/blocks.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blogroll v2 block declarations (Phase 7b — plugin block ownership).
|
|
3
|
+
*
|
|
4
|
+
* The `blogroll` and `feedland` sidebar widgets were site-config BUILTIN_BLOCKS
|
|
5
|
+
* seeds (requiresPlugin null, gated only by the theme's legacy
|
|
6
|
+
* widgetPluginRequirements render-map). Declaring them here makes site-config's
|
|
7
|
+
* scanPlugins stamp `sourcePlugin` → `requiresPlugin` ("Blogroll endpoint"), so
|
|
8
|
+
* the blocks are properly plugin-gated (theme ENDPOINT_SLUGS maps them to the
|
|
9
|
+
* `blogroll` loadout slug). scanPlugins precedence is `built-in < plugin blocks`,
|
|
10
|
+
* so these entries OVERWRITE the builtin seeds on sites where the plugin is
|
|
11
|
+
* loaded; the seeds themselves are removed from site-config in Phase 7d alongside
|
|
12
|
+
* the legacy-map bridge.
|
|
13
|
+
*
|
|
14
|
+
* Both are owned by this plugin: FeedLand is an alternate blogroll backend served
|
|
15
|
+
* by the same endpoint. Descriptors are byte-faithful to the BUILTIN_BLOCKS
|
|
16
|
+
* entries. Bespoke templates: the theme owns `components/widgets/blogroll.njk` and
|
|
17
|
+
* `components/widgets/feedland.njk` (no generic `render.renderer`);
|
|
18
|
+
* `data.source:"api"` documents the runtime fetch.
|
|
19
|
+
*
|
|
20
|
+
* @module lib/blocks
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** @type {Array<object>} */
|
|
24
|
+
export const BLOGROLL_BLOCKS = [
|
|
25
|
+
{
|
|
26
|
+
id: "blogroll",
|
|
27
|
+
version: 1,
|
|
28
|
+
label: "Blogroll",
|
|
29
|
+
description: "Blog recommendations",
|
|
30
|
+
icon: "list",
|
|
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
|
+
{
|
|
38
|
+
id: "feedland",
|
|
39
|
+
version: 1,
|
|
40
|
+
label: "FeedLand",
|
|
41
|
+
description: "FeedLand blogroll widget",
|
|
42
|
+
icon: "rss",
|
|
43
|
+
category: "social",
|
|
44
|
+
placement: { regions: ["sidebar"], surfaces: ["homepage"] },
|
|
45
|
+
multiple: false,
|
|
46
|
+
data: { source: "api" },
|
|
47
|
+
schema: { type: "object", additionalProperties: false, properties: {} },
|
|
48
|
+
},
|
|
49
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rmdes/indiekit-endpoint-blogroll",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
4
4
|
"description": "Blogroll endpoint for Indiekit. Aggregates blog feeds from OPML, JSON feeds, or manual entry.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"indiekit",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"index.js"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
+
"@rmdes/indiekit-startup-gate": "^1.0.0",
|
|
43
44
|
"@indiekit/error": "^1.0.0-beta.25",
|
|
44
45
|
"@indiekit/frontend": "^1.0.0-beta.25",
|
|
45
46
|
"express": "^5.0.0",
|