@chrisburnell/eleventy-cache-webmentions 2.1.10 → 2.1.11
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"cachedAt":
|
|
1
|
+
{"cachedAt":1757351055738,"type":"json","metadata":{}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const sanitizeHTML = require("sanitize-html");
|
|
2
2
|
const { AssetCache } = require("@11ty/eleventy-fetch");
|
|
3
|
-
const
|
|
3
|
+
const { styleText } = require("node:util");
|
|
4
4
|
|
|
5
5
|
const defaults = {
|
|
6
6
|
refresh: false,
|
|
@@ -24,9 +24,11 @@ const absoluteURL = (url, domain) => {
|
|
|
24
24
|
return new URL(url, domain).toString();
|
|
25
25
|
} catch (e) {
|
|
26
26
|
console.error(
|
|
27
|
-
`Trying to convert ${
|
|
27
|
+
`Trying to convert ${styleText(
|
|
28
|
+
"bold",
|
|
28
29
|
url,
|
|
29
|
-
)} to be an absolute url with base ${
|
|
30
|
+
)} to be an absolute url with base ${styleText(
|
|
31
|
+
"bold",
|
|
30
32
|
domain,
|
|
31
33
|
)} and failed.`,
|
|
32
34
|
);
|
|
@@ -193,9 +195,10 @@ const performFetch = async (options, webmentions, url) => {
|
|
|
193
195
|
|
|
194
196
|
if (!options.key in feed) {
|
|
195
197
|
console.log(
|
|
196
|
-
`${
|
|
198
|
+
`${styleText("grey", `[${hostname(options.domain)}]`)} ${
|
|
197
199
|
options.key
|
|
198
|
-
} was not found as a key in the response from ${
|
|
200
|
+
} was not found as a key in the response from ${styleText(
|
|
201
|
+
"bold",
|
|
199
202
|
hostname(options.feed),
|
|
200
203
|
)}!`,
|
|
201
204
|
);
|
|
@@ -226,9 +229,11 @@ const performFetch = async (options, webmentions, url) => {
|
|
|
226
229
|
})
|
|
227
230
|
.catch((error) => {
|
|
228
231
|
console.warn(
|
|
229
|
-
`${
|
|
232
|
+
`${styleText(
|
|
233
|
+
"grey",
|
|
230
234
|
`[${hostname(options.domain)}]`,
|
|
231
|
-
)} Something went wrong with your Webmention request to ${
|
|
235
|
+
)} Something went wrong with your Webmention request to ${styleText(
|
|
236
|
+
"bold",
|
|
232
237
|
hostname(options.feed),
|
|
233
238
|
)}!`,
|
|
234
239
|
);
|
|
@@ -353,9 +358,14 @@ const fetchWebmentions = async (options) => {
|
|
|
353
358
|
// Add a console message with the number of fetched and processed Webmentions, if any
|
|
354
359
|
if (webmentionsCachedLength < webmentions.length) {
|
|
355
360
|
console.log(
|
|
356
|
-
`${
|
|
357
|
-
|
|
358
|
-
|
|
361
|
+
`${styleText(
|
|
362
|
+
"grey",
|
|
363
|
+
`[${hostname(options.domain)}]`,
|
|
364
|
+
)} ${styleText(
|
|
365
|
+
"bold",
|
|
366
|
+
String(webmentions.length - webmentionsCachedLength),
|
|
367
|
+
)} new Webmentions fetched into cache in ${styleText(
|
|
368
|
+
"bold",
|
|
359
369
|
(performance[0] + performance[1] / 1e9).toFixed(3) +
|
|
360
370
|
" seconds",
|
|
361
371
|
)}.`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrisburnell/eleventy-cache-webmentions",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.11",
|
|
4
4
|
"description": "Cache webmentions using eleventy-fetch and make them available to use in collections, layouts, pages, etc. in Eleventy.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@11ty/eleventy-fetch": "^5.1.0",
|
|
58
|
-
"chalk": "4.1.2",
|
|
59
58
|
"sanitize-html": "^2.17.0"
|
|
60
59
|
},
|
|
61
60
|
"devDependencies": {
|