chore: bump the astro to 4.12.3 and fix the action api usage.

This commit is contained in:
Yufan Sheng 2024-07-31 00:17:56 +08:00
parent 1d885e092d
commit 5925062d9d
Signed by: syhily
GPG Key ID: DEB186763C308C31
4 changed files with 61 additions and 61 deletions

108
package-lock.json generated
View File

@ -12,7 +12,7 @@
"@astrojs/mdx": "^3.1.3", "@astrojs/mdx": "^3.1.3",
"@astrojs/rss": "^4.0.7", "@astrojs/rss": "^4.0.7",
"@zeabur/astro-adapter": "^1.0.6", "@zeabur/astro-adapter": "^1.0.6",
"astro": "^4.12.2", "astro": "^4.12.3",
"drizzle-orm": "^0.32.1", "drizzle-orm": "^0.32.1",
"fuse.js": "^7.0.0", "fuse.js": "^7.0.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
@ -85,9 +85,9 @@
} }
}, },
"node_modules/@astrojs/compiler": { "node_modules/@astrojs/compiler": {
"version": "2.9.2", "version": "2.10.0",
"resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.9.2.tgz", "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.10.0.tgz",
"integrity": "sha512-Vpu0Ffsj8SoV+N0DFHlxxOMKHwSC9059Xy/OlG1t6uFYSoJXxkBC2WyF6igO7x10V+8uJrhOxaXr3nA90kJXow==", "integrity": "sha512-V8ym+4kYCKmMeSdfDvm/SrlmUlKLkKzfWV3cKyiStEKW/D+YsXaQiBZcSCtuKXq8aQhsDw9HtCTZilhEMBX+BA==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@astrojs/internal-helpers": { "node_modules/@astrojs/internal-helpers": {
@ -246,30 +246,30 @@
} }
}, },
"node_modules/@babel/compat-data": { "node_modules/@babel/compat-data": {
"version": "7.25.0", "version": "7.25.2",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.0.tgz", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.2.tgz",
"integrity": "sha512-P4fwKI2mjEb3ZU5cnMJzvRsRKGBUcs8jvxIoRmr6ufAY9Xk2Bz7JubRTTivkw55c7WQJfTECeqYVa+HZ0FzREg==", "integrity": "sha512-bYcppcpKBvX4znYaPEeFau03bp89ShqNMLs+rmdptMw+heSZh9+z84d2YG+K7cYLbWwzdjtDoW/uqZmPjulClQ==",
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/core": { "node_modules/@babel/core": {
"version": "7.24.9", "version": "7.25.2",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.9.tgz", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.2.tgz",
"integrity": "sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg==", "integrity": "sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ampproject/remapping": "^2.2.0", "@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.24.7", "@babel/code-frame": "^7.24.7",
"@babel/generator": "^7.24.9", "@babel/generator": "^7.25.0",
"@babel/helper-compilation-targets": "^7.24.8", "@babel/helper-compilation-targets": "^7.25.2",
"@babel/helper-module-transforms": "^7.24.9", "@babel/helper-module-transforms": "^7.25.2",
"@babel/helpers": "^7.24.8", "@babel/helpers": "^7.25.0",
"@babel/parser": "^7.24.8", "@babel/parser": "^7.25.0",
"@babel/template": "^7.24.7", "@babel/template": "^7.25.0",
"@babel/traverse": "^7.24.8", "@babel/traverse": "^7.25.2",
"@babel/types": "^7.24.9", "@babel/types": "^7.25.2",
"convert-source-map": "^2.0.0", "convert-source-map": "^2.0.0",
"debug": "^4.1.0", "debug": "^4.1.0",
"gensync": "^1.0.0-beta.2", "gensync": "^1.0.0-beta.2",
@ -321,12 +321,12 @@
} }
}, },
"node_modules/@babel/helper-compilation-targets": { "node_modules/@babel/helper-compilation-targets": {
"version": "7.24.8", "version": "7.25.2",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.8.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz",
"integrity": "sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw==", "integrity": "sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@babel/compat-data": "^7.24.8", "@babel/compat-data": "^7.25.2",
"@babel/helper-validator-option": "^7.24.8", "@babel/helper-validator-option": "^7.24.8",
"browserslist": "^4.23.1", "browserslist": "^4.23.1",
"lru-cache": "^5.1.1", "lru-cache": "^5.1.1",
@ -359,15 +359,15 @@
} }
}, },
"node_modules/@babel/helper-module-transforms": { "node_modules/@babel/helper-module-transforms": {
"version": "7.25.0", "version": "7.25.2",
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.0.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz",
"integrity": "sha512-bIkOa2ZJYn7FHnepzr5iX9Kmz8FjIz4UKzJ9zhX3dnYuVW0xul9RuR3skBfoLu+FPTQw90EHW9rJsSZhyLQ3fQ==", "integrity": "sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@babel/helper-module-imports": "^7.24.7", "@babel/helper-module-imports": "^7.24.7",
"@babel/helper-simple-access": "^7.24.7", "@babel/helper-simple-access": "^7.24.7",
"@babel/helper-validator-identifier": "^7.24.7", "@babel/helper-validator-identifier": "^7.24.7",
"@babel/traverse": "^7.25.0" "@babel/traverse": "^7.25.2"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
@ -481,16 +481,16 @@
} }
}, },
"node_modules/@babel/plugin-transform-react-jsx": { "node_modules/@babel/plugin-transform-react-jsx": {
"version": "7.24.7", "version": "7.25.2",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.24.7.tgz", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.25.2.tgz",
"integrity": "sha512-+Dj06GDZEFRYvclU6k4bme55GKBEWUmByM/eoKuqg4zTNQHiApWRhQph5fxQB2wAEFvRzL1tOEj1RJ19wJrhoA==", "integrity": "sha512-KQsqEAVBpU82NM/B/N9j9WOdphom1SZH3R+2V7INrQUH+V9EBFwZsEJl8eBIVeQE62FxJCc70jzEZwqU7RcVqA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@babel/helper-annotate-as-pure": "^7.24.7", "@babel/helper-annotate-as-pure": "^7.24.7",
"@babel/helper-module-imports": "^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/plugin-syntax-jsx": "^7.24.7",
"@babel/types": "^7.24.7" "@babel/types": "^7.25.2"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
@ -514,16 +514,16 @@
} }
}, },
"node_modules/@babel/traverse": { "node_modules/@babel/traverse": {
"version": "7.25.1", "version": "7.25.2",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.1.tgz", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.2.tgz",
"integrity": "sha512-LrHHoWq08ZpmmFqBAzN+hUdWwy5zt7FGa/hVwMcOqW6OVtwqaoD5utfuGYU87JYxdZgLUvktAsn37j/sYR9siA==", "integrity": "sha512-s4/r+a7xTnny2O6FcZzqgT6nE4/GHEdcqj4qAeglbUOh0TeglEfmNJFAd/OLoVtGd6ZhAO8GCVvCNUO5t/VJVQ==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@babel/code-frame": "^7.24.7", "@babel/code-frame": "^7.24.7",
"@babel/generator": "^7.25.0", "@babel/generator": "^7.25.0",
"@babel/parser": "^7.25.0", "@babel/parser": "^7.25.0",
"@babel/template": "^7.25.0", "@babel/template": "^7.25.0",
"@babel/types": "^7.25.0", "@babel/types": "^7.25.2",
"debug": "^4.3.1", "debug": "^4.3.1",
"globals": "^11.1.0" "globals": "^11.1.0"
}, },
@ -532,9 +532,9 @@
} }
}, },
"node_modules/@babel/types": { "node_modules/@babel/types": {
"version": "7.25.0", "version": "7.25.2",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.0.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz",
"integrity": "sha512-LcnxQSsd9aXOIgmmSpvZ/1yo46ra2ESYyqLcryaBZOghxy5qqOBjvCWP5JfkI8yl9rlxRgdLTTMCQQRcN2hdCg==", "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@babel/helper-string-parser": "^7.24.8", "@babel/helper-string-parser": "^7.24.8",
@ -2917,12 +2917,12 @@
} }
}, },
"node_modules/astro": { "node_modules/astro": {
"version": "4.12.2", "version": "4.12.3",
"resolved": "https://registry.npmjs.org/astro/-/astro-4.12.2.tgz", "resolved": "https://registry.npmjs.org/astro/-/astro-4.12.3.tgz",
"integrity": "sha512-l6OmqlL+FiuSi9x6F+EGZitteOznq1JffOil7st7cdqeMCTEIym4oagI1a6zp6QekliKWEEZWdplGhgh1k1f7Q==", "integrity": "sha512-rFcRktbZk8CsHufLOB51gYAia3RTuOyaBD8iZXRHP7Oqo6QviquNaa/5U6RoUqyF5KS8vyq/ldJ5jfboJzxuuw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@astrojs/compiler": "^2.9.0", "@astrojs/compiler": "^2.9.2",
"@astrojs/internal-helpers": "0.4.1", "@astrojs/internal-helpers": "0.4.1",
"@astrojs/markdown-remark": "5.2.0", "@astrojs/markdown-remark": "5.2.0",
"@astrojs/telemetry": "3.1.0", "@astrojs/telemetry": "3.1.0",
@ -2971,8 +2971,8 @@
"preferred-pm": "^4.0.0", "preferred-pm": "^4.0.0",
"prompts": "^2.4.2", "prompts": "^2.4.2",
"rehype": "^13.0.1", "rehype": "^13.0.1",
"semver": "^7.6.2", "semver": "^7.6.3",
"shiki": "^1.10.3", "shiki": "^1.11.0",
"string-width": "^7.2.0", "string-width": "^7.2.0",
"strip-ansi": "^7.1.0", "strip-ansi": "^7.1.0",
"tsconfck": "^3.1.1", "tsconfck": "^3.1.1",
@ -3331,9 +3331,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001643", "version": "1.0.30001644",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001644.tgz",
"integrity": "sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==", "integrity": "sha512-YGvlOZB4QhZuiis+ETS0VXR+MExbFf4fZYYeMTEE0aTQd/RdIjkTyZjLrbYVKnHzppDvnOhritRVv+i7Go6mHw==",
"funding": [ "funding": [
{ {
"type": "opencollective", "type": "opencollective",
@ -4044,9 +4044,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.5.2", "version": "1.5.3",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.2.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.3.tgz",
"integrity": "sha512-kc4r3U3V3WLaaZqThjYz/Y6z8tJe+7K0bbjUVo3i+LWIypVdMx5nXCkwRe6SWbY6ILqLdc1rKcKmr3HoH7wjSQ==", "integrity": "sha512-QNdYSS5i8D9axWp/6XIezRObRHqaav/ur9z1VzCDUCH1XIFOr9WQk5xmgunhsTpjjgDy3oLxO/WMOVZlpUQrlA==",
"license": "ISC" "license": "ISC"
}, },
"node_modules/emmet": { "node_modules/emmet": {
@ -5655,12 +5655,12 @@
} }
}, },
"node_modules/magic-string": { "node_modules/magic-string": {
"version": "0.30.10", "version": "0.30.11",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz",
"integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.15" "@jridgewell/sourcemap-codec": "^1.5.0"
} }
}, },
"node_modules/make-dir": { "node_modules/make-dir": {

View File

@ -44,7 +44,7 @@
"@astrojs/mdx": "^3.1.3", "@astrojs/mdx": "^3.1.3",
"@astrojs/rss": "^4.0.7", "@astrojs/rss": "^4.0.7",
"@zeabur/astro-adapter": "^1.0.6", "@zeabur/astro-adapter": "^1.0.6",
"astro": "^4.12.2", "astro": "^4.12.3",
"drizzle-orm": "^0.32.1", "drizzle-orm": "^0.32.1",
"fuse.js": "^7.0.0", "fuse.js": "^7.0.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",

View File

@ -151,7 +151,7 @@ if (typeof comments !== 'undefined' && comments !== null) {
const email = event.target.value; const email = event.target.value;
if (email !== '' && email.includes('@')) { if (email !== '' && email.includes('@')) {
// Replace the avatar after typing the email. // Replace the avatar after typing the email.
actions.avatar.safe({ email }).then(({ data, error }) => { actions.avatar({ email }).then(({ data, error }) => {
if (error) { if (error) {
return handleActionError(error); return handleActionError(error);
} }
@ -167,7 +167,7 @@ if (typeof comments !== 'undefined' && comments !== null) {
// Loading more comments from server. // Loading more comments from server.
if (event.target === comments.querySelector('#comments-next-button')) { if (event.target === comments.querySelector('#comments-next-button')) {
const { size, offset, key } = event.target.dataset; 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) { if (error) {
return handleActionError(error); return handleActionError(error);
} }
@ -223,7 +223,7 @@ if (typeof comments !== 'undefined' && comments !== null) {
} }
request.rid = request.rid === undefined ? 0 : Number(request.rid); 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) { if (error) {
return handleActionError(error); return handleActionError(error);
@ -279,7 +279,7 @@ const likeButton = document.querySelector('button.post-like');
const increaseLikes = (count, permalink) => { const increaseLikes = (count, permalink) => {
count.textContent = Number.parseInt(count.textContent) + 1; 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) { if (error) {
return handleActionError(error); return handleActionError(error);
} }
@ -295,7 +295,7 @@ const decreaseLikes = (count, permalink) => {
return; return;
} }
count.textContent = Number.parseInt(count.textContent) - 1; 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) { if (error) {
return handleActionError(error); return handleActionError(error);
} }

View File

@ -4,7 +4,7 @@ import options from '@/options';
import { ARTALK_HOST } from 'astro:env/server'; import { ARTALK_HOST } from 'astro:env/server';
import _ from 'lodash'; import _ from 'lodash';
import { marked } from 'marked'; import { marked } from 'marked';
import * as querystring from 'node:querystring'; import querystring from 'node:querystring';
import { ELEMENT_NODE, transform, walk } from 'ultrahtml'; import { ELEMENT_NODE, transform, walk } from 'ultrahtml';
import sanitize from 'ultrahtml/transformers/sanitize'; import sanitize from 'ultrahtml/transformers/sanitize';