nuxt-bluesky-comments 0.1.1 → 0.1.3

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/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.0.0"
6
6
  },
7
- "version": "0.1.1",
7
+ "version": "0.1.3",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -11,7 +11,7 @@ const module$1 = defineNuxtModule({
11
11
  defaults: {
12
12
  apiService: "https://public.api.bsky.app"
13
13
  },
14
- async setup(_options, nuxt) {
14
+ async setup(_options) {
15
15
  const resolver = createResolver(import.meta.url);
16
16
  addComponentsDir({
17
17
  path: resolver.resolve("./runtime/components"),
@@ -24,7 +24,6 @@ const module$1 = defineNuxtModule({
24
24
  as: "useBlueskyComments",
25
25
  from: resolver.resolve("./runtime/composables/useBlueskyComments")
26
26
  });
27
- nuxt.options.build.transpile.push("@atproto/api");
28
27
  }
29
28
  });
30
29
 
@@ -1,5 +1,4 @@
1
1
  import * as AtProtoAPI from "@atproto/api";
2
- const { AppBskyFeedDefs } = AtProtoAPI;
3
2
  export function parseBlueskyUrl(url) {
4
3
  const match = url.match(/https?:\/\/bsky\.app\/profile\/([^/]+)\/post\/([^/?#]+)/);
5
4
  if (!match) return null;
@@ -20,7 +19,7 @@ export function processReplies(replies, parentAuthorDid, depth = 0, options = {}
20
19
  const flattenSameAuthorThreads = options.flattenSameAuthorThreads ?? true;
21
20
  const groups = [];
22
21
  for (const reply of replies) {
23
- if (!AppBskyFeedDefs.isThreadViewPost(reply)) continue;
22
+ if (!AtProtoAPI.AppBskyFeedDefs.isThreadViewPost(reply)) continue;
24
23
  const post = reply.post;
25
24
  const author = post.author;
26
25
  const record = post.record;
@@ -1,12 +1,11 @@
1
1
  import { ref, computed } from "vue";
2
2
  import * as AtProtoAPI from "@atproto/api";
3
- const { AtpAgent, AppBskyFeedDefs } = AtProtoAPI;
4
3
  import {
5
4
  parseBlueskyUrl,
6
5
  processReplies,
7
6
  uriToUrl
8
7
  } from "./blueskyComments.logic.js";
9
- const agent = new AtpAgent({
8
+ const agent = new AtProtoAPI.AtpAgent({
10
9
  service: "https://public.api.bsky.app"
11
10
  });
12
11
  export function useBlueskyComments(uriOrUrl, options = {}) {
@@ -52,11 +51,11 @@ export function useBlueskyComments(uriOrUrl, options = {}) {
52
51
  throw new Error(`Failed to fetch post: ${uri}`);
53
52
  }
54
53
  const { data } = response;
55
- if (!AppBskyFeedDefs.isThreadViewPost(data.thread)) {
56
- if (AppBskyFeedDefs.isBlockedPost(data.thread)) {
54
+ if (!AtProtoAPI.AppBskyFeedDefs.isThreadViewPost(data.thread)) {
55
+ if (AtProtoAPI.AppBskyFeedDefs.isBlockedPost(data.thread)) {
57
56
  throw new Error("This post is from a blocked account");
58
57
  }
59
- if (AppBskyFeedDefs.isNotFoundPost(data.thread)) {
58
+ if (AtProtoAPI.AppBskyFeedDefs.isNotFoundPost(data.thread)) {
60
59
  throw new Error(`Post not found: ${uri}`);
61
60
  }
62
61
  throw new Error("Post not found or not accessible");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-bluesky-comments",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Nuxt module to display Bluesky post comments on your website",
5
5
  "keywords": [
6
6
  "atproto",