@jam-comments/astro 2.0.2 → 2.2.0
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.d.ts +1 -0
- package/package.json +10 -6
- package/src/env.d.ts +1 -0
- package/src/index.astro +13 -4
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jam-comments/astro",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"author": "Alex MacArthur <alex@macarthur.me> (https://macarthur.me)",
|
|
5
5
|
"license": "GPL-2.0",
|
|
6
6
|
"description": "Easily add performant, SEO-friendly comments to your Astro blog with JamComments.",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"repository": "github:alexmacarthur/jam-comments-javascript",
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "echo 'No build step here...'",
|
|
13
|
-
"format": "prettier --write src"
|
|
13
|
+
"format": "prettier --write src",
|
|
14
|
+
"check": "astro check"
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
16
17
|
"src",
|
|
@@ -28,12 +29,15 @@
|
|
|
28
29
|
"access": "public"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@
|
|
32
|
-
"
|
|
33
|
-
"
|
|
32
|
+
"@astrojs/check": "^0.6.0",
|
|
33
|
+
"@jam-comments/server-utilities": "^4.2.0",
|
|
34
|
+
"astro": "^4.7.1",
|
|
35
|
+
"node-fetch": "^3.3.2",
|
|
36
|
+
"typescript": "^5.4.5"
|
|
34
37
|
},
|
|
35
38
|
"gitHead": "2b1cefb90c89a2f70099213881b09216f20e3dc2",
|
|
36
39
|
"devDependencies": {
|
|
37
|
-
"prettier": "^3.
|
|
40
|
+
"prettier": "^3.2.5",
|
|
41
|
+
"prettier-plugin-astro": "^0.13.0"
|
|
38
42
|
}
|
|
39
43
|
}
|
package/src/env.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="astro/client" />
|
package/src/index.astro
CHANGED
|
@@ -10,8 +10,9 @@ const fetchMarkup = markupFetcher("astro", nodeFetch as any);
|
|
|
10
10
|
|
|
11
11
|
const fetchCommentData = async ({
|
|
12
12
|
tz = undefined,
|
|
13
|
-
path = undefined,
|
|
14
|
-
|
|
13
|
+
path = undefined,
|
|
14
|
+
schema = undefined,
|
|
15
|
+
domain = import.meta.env.JAM_COMMENTS_DOMAIN as string,
|
|
15
16
|
apiKey = import.meta.env.JAM_COMMENTS_API_KEY as string,
|
|
16
17
|
baseUrl = import.meta.env.JAM_COMMENTS_BASE_URL as string,
|
|
17
18
|
environment = import.meta.env.JAM_COMMENTS_ENVIRONMENT as string,
|
|
@@ -19,6 +20,7 @@ const fetchCommentData = async ({
|
|
|
19
20
|
try {
|
|
20
21
|
return await fetchMarkup({
|
|
21
22
|
path,
|
|
23
|
+
schema,
|
|
22
24
|
domain,
|
|
23
25
|
apiKey,
|
|
24
26
|
baseUrl,
|
|
@@ -31,8 +33,15 @@ const fetchCommentData = async ({
|
|
|
31
33
|
}
|
|
32
34
|
};
|
|
33
35
|
|
|
34
|
-
const { path, domain, baseUrl, environment, tz } = Astro.props;
|
|
35
|
-
const markup = await fetchCommentData({
|
|
36
|
+
const { path, domain, baseUrl, environment, tz, schema } = Astro.props as Props;
|
|
37
|
+
const markup = await fetchCommentData({
|
|
38
|
+
path,
|
|
39
|
+
schema,
|
|
40
|
+
domain,
|
|
41
|
+
baseUrl,
|
|
42
|
+
environment,
|
|
43
|
+
tz,
|
|
44
|
+
});
|
|
36
45
|
---
|
|
37
46
|
|
|
38
47
|
<div set:html={markup} />
|