@roudanio/awesome-comment 0.10.5 → 0.10.7

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.
@@ -149,7 +149,7 @@ function yt(e) {
149
149
  postId: d,
150
150
  ancestorId: Number(i),
151
151
  status: Number(e.status),
152
- createdAt: Ne(t)
152
+ createdAt: Ne(t || l.createdAt || "")
153
153
  };
154
154
  }
155
155
  const pe = "awesome-comment-comments", Ie = localStorage.getItem(pe), V = Ie ? JSON.parse(Ie) : {}, J = Te("store", () => {
@@ -440,7 +440,7 @@ const he = Te("auth", () => {
440
440
  },
441
441
  emits: ["close", "update"],
442
442
  setup(e, { emit: s }) {
443
- const t = e, n = s, i = he(), d = J(), { t: u } = U(), l = N("ApiBaseUrl"), o = N("Auth0Domain"), r = N("siteId"), a = N("TurnstileSiteKey"), c = N("AutoFocus"), k = "0.10.5", g = $(), _ = $(), p = $(!1), S = $(t.content || ""), b = $(""), h = $(!1), x = $(""), y = $(""), w = Y(() => !i.isAuthenticated);
443
+ const t = e, n = s, i = he(), d = J(), { t: u } = U(), l = N("ApiBaseUrl"), o = N("Auth0Domain"), r = N("siteId"), a = N("TurnstileSiteKey"), c = N("AutoFocus"), k = "0.10.7", g = $(), _ = $(), p = $(!1), S = $(t.content || ""), b = $(""), h = $(!1), x = $(""), y = $(""), w = Y(() => !i.isAuthenticated);
444
444
  let C = null;
445
445
  function F() {
446
446
  if (typeof window > "u") return Promise.reject(new Error("Turnstile 仅支持浏览器环境"));
@@ -687,7 +687,7 @@ const he = Te("auth", () => {
687
687
  },
688
688
  body: JSON.stringify({
689
689
  like: a,
690
- postId: t.comment.postId,
690
+ postId: t.comment.postId || i.postId,
691
691
  siteId: l
692
692
  })
693
693
  })).json();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roudanio/awesome-comment",
3
- "version": "0.10.5",
3
+ "version": "0.10.7",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@auth0/auth0-vue": "^2.5.0",
@@ -15,16 +15,20 @@
15
15
  "@roudanio/awesome-auth": "0.1.5"
16
16
  },
17
17
  "devDependencies": {
18
+ "@pinia/testing": "^1.0.3",
18
19
  "@types/lodash-es": "^4.17.12",
19
20
  "@types/node": "^24.10.9",
20
21
  "@vitejs/plugin-vue": "^6.0.3",
22
+ "@vue/test-utils": "^2.4.6",
21
23
  "autoprefixer": "^10.4.23",
22
24
  "daisyui": "^4.12.24",
25
+ "jsdom": "^28.1.0",
23
26
  "postcss": "^8.5.6",
24
27
  "pug": "^3.0.3",
25
28
  "tailwindcss": "^3.4.19",
26
29
  "typescript": "^5.9.3",
27
30
  "vite": "^7.3.1",
31
+ "vitest": "^4.0.18",
28
32
  "vue-tsc": "^3.2.2"
29
33
  },
30
34
  "author": {
@@ -42,6 +46,7 @@
42
46
  "dev": "vite",
43
47
  "build": "vue-tsc && vite build",
44
48
  "build:esm": "vue-tsc && vite build -c vite.config.esm.ts",
45
- "build:esm:unpkg": "vue-tsc && vite build -c vite.config.esm.unpkg.ts"
49
+ "build:esm:unpkg": "vue-tsc && vite build -c vite.config.esm.unpkg.ts",
50
+ "test": "vitest run"
46
51
  }
47
52
  }
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from 'vitest/config';
2
+ import vue from '@vitejs/plugin-vue';
3
+
4
+ export default defineConfig({
5
+ plugins: [vue()],
6
+ define: {
7
+ __IS_PROD__: false,
8
+ __VERSION__: JSON.stringify('test'),
9
+ },
10
+ test: {
11
+ globals: true,
12
+ environment: 'jsdom',
13
+ include: ['src/**/__tests__/*.test.ts'],
14
+ },
15
+ });