From 5925062d9de83c833c84898d7849a496f3d70505 Mon Sep 17 00:00:00 2001 From: Yufan Sheng Date: Wed, 31 Jul 2024 00:17:56 +0800 Subject: [PATCH] chore: bump the astro to 4.12.3 and fix the action api usage. --- package-lock.json | 108 +++++++++++++++---------------- package.json | 2 +- src/assets/scripts/yufan.me.js | 10 +-- src/components/comment/artalk.ts | 2 +- 4 files changed, 61 insertions(+), 61 deletions(-) diff --git a/package-lock.json b/package-lock.json index 75e3f52..28c190d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@astrojs/mdx": "^3.1.3", "@astrojs/rss": "^4.0.7", "@zeabur/astro-adapter": "^1.0.6", - "astro": "^4.12.2", + "astro": "^4.12.3", "drizzle-orm": "^0.32.1", "fuse.js": "^7.0.0", "lodash": "^4.17.21", @@ -85,9 +85,9 @@ } }, "node_modules/@astrojs/compiler": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.9.2.tgz", - "integrity": "sha512-Vpu0Ffsj8SoV+N0DFHlxxOMKHwSC9059Xy/OlG1t6uFYSoJXxkBC2WyF6igO7x10V+8uJrhOxaXr3nA90kJXow==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.10.0.tgz", + "integrity": "sha512-V8ym+4kYCKmMeSdfDvm/SrlmUlKLkKzfWV3cKyiStEKW/D+YsXaQiBZcSCtuKXq8aQhsDw9HtCTZilhEMBX+BA==", "license": "MIT" }, "node_modules/@astrojs/internal-helpers": { @@ -246,30 +246,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.0.tgz", - "integrity": "sha512-P4fwKI2mjEb3ZU5cnMJzvRsRKGBUcs8jvxIoRmr6ufAY9Xk2Bz7JubRTTivkw55c7WQJfTECeqYVa+HZ0FzREg==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.2.tgz", + "integrity": "sha512-bYcppcpKBvX4znYaPEeFau03bp89ShqNMLs+rmdptMw+heSZh9+z84d2YG+K7cYLbWwzdjtDoW/uqZmPjulClQ==", "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.24.9", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.9.tgz", - "integrity": "sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.2.tgz", + "integrity": "sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==", "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.24.9", - "@babel/helper-compilation-targets": "^7.24.8", - "@babel/helper-module-transforms": "^7.24.9", - "@babel/helpers": "^7.24.8", - "@babel/parser": "^7.24.8", - "@babel/template": "^7.24.7", - "@babel/traverse": "^7.24.8", - "@babel/types": "^7.24.9", + "@babel/generator": "^7.25.0", + "@babel/helper-compilation-targets": "^7.25.2", + "@babel/helper-module-transforms": "^7.25.2", + "@babel/helpers": "^7.25.0", + "@babel/parser": "^7.25.0", + "@babel/template": "^7.25.0", + "@babel/traverse": "^7.25.2", + "@babel/types": "^7.25.2", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -321,12 +321,12 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.8.tgz", - "integrity": "sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz", + "integrity": "sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==", "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.24.8", + "@babel/compat-data": "^7.25.2", "@babel/helper-validator-option": "^7.24.8", "browserslist": "^4.23.1", "lru-cache": "^5.1.1", @@ -359,15 +359,15 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.0.tgz", - "integrity": "sha512-bIkOa2ZJYn7FHnepzr5iX9Kmz8FjIz4UKzJ9zhX3dnYuVW0xul9RuR3skBfoLu+FPTQw90EHW9rJsSZhyLQ3fQ==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz", + "integrity": "sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==", "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.24.7", "@babel/helper-simple-access": "^7.24.7", "@babel/helper-validator-identifier": "^7.24.7", - "@babel/traverse": "^7.25.0" + "@babel/traverse": "^7.25.2" }, "engines": { "node": ">=6.9.0" @@ -481,16 +481,16 @@ } }, "node_modules/@babel/plugin-transform-react-jsx": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.24.7.tgz", - "integrity": "sha512-+Dj06GDZEFRYvclU6k4bme55GKBEWUmByM/eoKuqg4zTNQHiApWRhQph5fxQB2wAEFvRzL1tOEj1RJ19wJrhoA==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.25.2.tgz", + "integrity": "sha512-KQsqEAVBpU82NM/B/N9j9WOdphom1SZH3R+2V7INrQUH+V9EBFwZsEJl8eBIVeQE62FxJCc70jzEZwqU7RcVqA==", "license": "MIT", "dependencies": { "@babel/helper-annotate-as-pure": "^7.24.7", "@babel/helper-module-imports": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-plugin-utils": "^7.24.8", "@babel/plugin-syntax-jsx": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/types": "^7.25.2" }, "engines": { "node": ">=6.9.0" @@ -514,16 +514,16 @@ } }, "node_modules/@babel/traverse": { - "version": "7.25.1", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.1.tgz", - "integrity": "sha512-LrHHoWq08ZpmmFqBAzN+hUdWwy5zt7FGa/hVwMcOqW6OVtwqaoD5utfuGYU87JYxdZgLUvktAsn37j/sYR9siA==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.2.tgz", + "integrity": "sha512-s4/r+a7xTnny2O6FcZzqgT6nE4/GHEdcqj4qAeglbUOh0TeglEfmNJFAd/OLoVtGd6ZhAO8GCVvCNUO5t/VJVQ==", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.24.7", "@babel/generator": "^7.25.0", "@babel/parser": "^7.25.0", "@babel/template": "^7.25.0", - "@babel/types": "^7.25.0", + "@babel/types": "^7.25.2", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -532,9 +532,9 @@ } }, "node_modules/@babel/types": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.0.tgz", - "integrity": "sha512-LcnxQSsd9aXOIgmmSpvZ/1yo46ra2ESYyqLcryaBZOghxy5qqOBjvCWP5JfkI8yl9rlxRgdLTTMCQQRcN2hdCg==", + "version": "7.25.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", + "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.24.8", @@ -2917,12 +2917,12 @@ } }, "node_modules/astro": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/astro/-/astro-4.12.2.tgz", - "integrity": "sha512-l6OmqlL+FiuSi9x6F+EGZitteOznq1JffOil7st7cdqeMCTEIym4oagI1a6zp6QekliKWEEZWdplGhgh1k1f7Q==", + "version": "4.12.3", + "resolved": "https://registry.npmjs.org/astro/-/astro-4.12.3.tgz", + "integrity": "sha512-rFcRktbZk8CsHufLOB51gYAia3RTuOyaBD8iZXRHP7Oqo6QviquNaa/5U6RoUqyF5KS8vyq/ldJ5jfboJzxuuw==", "license": "MIT", "dependencies": { - "@astrojs/compiler": "^2.9.0", + "@astrojs/compiler": "^2.9.2", "@astrojs/internal-helpers": "0.4.1", "@astrojs/markdown-remark": "5.2.0", "@astrojs/telemetry": "3.1.0", @@ -2971,8 +2971,8 @@ "preferred-pm": "^4.0.0", "prompts": "^2.4.2", "rehype": "^13.0.1", - "semver": "^7.6.2", - "shiki": "^1.10.3", + "semver": "^7.6.3", + "shiki": "^1.11.0", "string-width": "^7.2.0", "strip-ansi": "^7.1.0", "tsconfck": "^3.1.1", @@ -3331,9 +3331,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001643", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz", - "integrity": "sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==", + "version": "1.0.30001644", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001644.tgz", + "integrity": "sha512-YGvlOZB4QhZuiis+ETS0VXR+MExbFf4fZYYeMTEE0aTQd/RdIjkTyZjLrbYVKnHzppDvnOhritRVv+i7Go6mHw==", "funding": [ { "type": "opencollective", @@ -4044,9 +4044,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.2.tgz", - "integrity": "sha512-kc4r3U3V3WLaaZqThjYz/Y6z8tJe+7K0bbjUVo3i+LWIypVdMx5nXCkwRe6SWbY6ILqLdc1rKcKmr3HoH7wjSQ==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.3.tgz", + "integrity": "sha512-QNdYSS5i8D9axWp/6XIezRObRHqaav/ur9z1VzCDUCH1XIFOr9WQk5xmgunhsTpjjgDy3oLxO/WMOVZlpUQrlA==", "license": "ISC" }, "node_modules/emmet": { @@ -5655,12 +5655,12 @@ } }, "node_modules/magic-string": { - "version": "0.30.10", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", - "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "version": "0.30.11", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", + "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==", "license": "MIT", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" + "@jridgewell/sourcemap-codec": "^1.5.0" } }, "node_modules/make-dir": { diff --git a/package.json b/package.json index 72c5b09..73a9ed2 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@astrojs/mdx": "^3.1.3", "@astrojs/rss": "^4.0.7", "@zeabur/astro-adapter": "^1.0.6", - "astro": "^4.12.2", + "astro": "^4.12.3", "drizzle-orm": "^0.32.1", "fuse.js": "^7.0.0", "lodash": "^4.17.21", diff --git a/src/assets/scripts/yufan.me.js b/src/assets/scripts/yufan.me.js index f3b36a9..837790d 100644 --- a/src/assets/scripts/yufan.me.js +++ b/src/assets/scripts/yufan.me.js @@ -151,7 +151,7 @@ if (typeof comments !== 'undefined' && comments !== null) { const email = event.target.value; if (email !== '' && email.includes('@')) { // Replace the avatar after typing the email. - actions.avatar.safe({ email }).then(({ data, error }) => { + actions.avatar({ email }).then(({ data, error }) => { if (error) { return handleActionError(error); } @@ -167,7 +167,7 @@ if (typeof comments !== 'undefined' && comments !== null) { // Loading more comments from server. if (event.target === comments.querySelector('#comments-next-button')) { const { size, offset, key } = event.target.dataset; - const { data, error } = await actions.comments.safe({ offset: Number(offset), page_key: key }); + const { data, error } = await actions.comments({ offset: Number(offset), page_key: key }); if (error) { return handleActionError(error); } @@ -223,7 +223,7 @@ if (typeof comments !== 'undefined' && comments !== null) { } request.rid = request.rid === undefined ? 0 : Number(request.rid); - const { data, error } = await actions.comment.safe(request); + const { data, error } = await actions.comment(request); if (error) { return handleActionError(error); @@ -279,7 +279,7 @@ const likeButton = document.querySelector('button.post-like'); const increaseLikes = (count, permalink) => { count.textContent = Number.parseInt(count.textContent) + 1; - actions.like.safe({ action: 'increase', key: permalink }).then(({ data, error }) => { + actions.like({ action: 'increase', key: permalink }).then(({ data, error }) => { if (error) { return handleActionError(error); } @@ -295,7 +295,7 @@ const decreaseLikes = (count, permalink) => { return; } count.textContent = Number.parseInt(count.textContent) - 1; - actions.like.safe({ action: 'decrease', key: permalink, token }).then(({ data, error }) => { + actions.like({ action: 'decrease', key: permalink, token }).then(({ data, error }) => { if (error) { return handleActionError(error); } diff --git a/src/components/comment/artalk.ts b/src/components/comment/artalk.ts index 8fe709f..fe44fb6 100644 --- a/src/components/comment/artalk.ts +++ b/src/components/comment/artalk.ts @@ -4,7 +4,7 @@ import options from '@/options'; import { ARTALK_HOST } from 'astro:env/server'; import _ from 'lodash'; import { marked } from 'marked'; -import * as querystring from 'node:querystring'; +import querystring from 'node:querystring'; import { ELEMENT_NODE, transform, walk } from 'ultrahtml'; import sanitize from 'ultrahtml/transformers/sanitize';