vowel 0.1.36 → 0.1.38

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/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [0.1.38](https://github.com/samlfair/vowel/compare/v0.1.37...v0.1.38) (2024-10-17)
6
+
7
+ ## [0.1.37](https://github.com/samlfair/vowel/compare/v0.1.36...v0.1.37) (2024-10-17)
8
+
9
+
10
+ ### Features
11
+
12
+ * add 'new' status for webmentions ([12ea209](https://github.com/samlfair/vowel/commit/12ea2098eb24f4bf64c681fa7dc66371592bb08c))
13
+
5
14
  ## [0.1.36](https://github.com/samlfair/vowel/compare/v0.1.35...v0.1.36) (2024-10-17)
6
15
 
7
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vowel",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
4
4
  "homepage": "https://vowel.cc",
5
5
  "author": "Sam Littlefair (https://littlefair.ca)",
6
6
  "repository": {
@@ -33,18 +33,17 @@ export default async function mutateMarkdownAST(ast, cache, webmentions) {
33
33
  ensureSecureImageRequest: true
34
34
  });
35
35
 
36
- console.log("UR:")
37
-
38
36
 
39
37
  if(webmentions && !webmentions.find(webmention => webmention.target === url)) {
40
- console.log("Sending webmention)")
41
- const webmentionStatus = await sendWebmention(response.responseBody)
42
- console.log({webmentionStatus})
43
-
44
38
  webmentions.push({
45
39
  target: url,
46
- status: webmentionStatus
40
+ status: "new"
47
41
  })
42
+ } else if (webmentions) {
43
+ const webmention = webmentions.find(webmention => webmention.target === url)
44
+ if(webmention.status === "new") {
45
+ webmention.status = await sendWebmention(response.responseBody)
46
+ }
48
47
  }
49
48
 
50
49
  const metadata = {
@@ -79,7 +79,7 @@ export default async function mutateMarkdownFrontmatter(frontmatter, cache, webm
79
79
  try {
80
80
  const url = new URL(input);
81
81
  const metadata = await urlMetadata(url.href, {
82
- includeResponseBody: false,
82
+ includeResponseBody: true,
83
83
  ensureSecureImageRequest: true
84
84
  });
85
85
 
@@ -96,15 +96,19 @@ export default async function mutateMarkdownFrontmatter(frontmatter, cache, webm
96
96
  og_image: url['og:image']
97
97
  };
98
98
 
99
- if(webmentions && !webmentions.find(webmention => webmention.target === url)) {
100
- const webmentionStatus = await sendWebmention(response.responseBody)
101
-
99
+ if(webmentions && !webmentions.find(webmention => webmention.target === input)) {
102
100
  webmentions.push({
103
101
  target: input,
104
- status: webmentionStatus
102
+ status: "new"
105
103
  })
104
+ } else if (webmentions) {
105
+ const webmention = webmentions.find(webmention => webmention.target === input)
106
+ if(webmention.status === "new") {
107
+ webmention.status = await sendWebmention(metadata.responseBody)
108
+ }
106
109
  }
107
110
 
111
+
108
112
  cache[input] = selectedMetadata;
109
113
 
110
114
  frontmatter[key] = {
@@ -2,7 +2,6 @@ import fs from 'fs/promises';
2
2
  import { resolveHomeDirPath } from '.';
3
3
 
4
4
  export default async function writeCache(data, homeDir) {
5
- console.log({ data });
6
5
  const cachePath = resolveHomeDirPath('.cache.json', homeDir);
7
6
 
8
7
  try {
@@ -48,6 +48,8 @@ export async function GET() {
48
48
  'Content-Type': 'text/plain'
49
49
  };
50
50
 
51
+ console.log({ publishedData })
52
+
51
53
  const response = new Response(JSON.stringify(publishedData), {
52
54
  headers
53
55
  });
@@ -21,7 +21,5 @@ export async function entries() {
21
21
 
22
22
  pages.push({ path: '404' });
23
23
 
24
- console.log({ pages });
25
-
26
24
  return pages;
27
25
  }