chore: bump the astro, fix the deprecated collection API.

This commit is contained in:
Yufan Sheng 2024-08-11 11:41:28 +08:00
parent 86d04ebcb1
commit bdfa9fe152
Signed by: syhily
GPG Key ID: DEB186763C308C31
3 changed files with 39 additions and 35 deletions

58
package-lock.json generated
View File

@ -12,8 +12,8 @@
"@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.13.1", "astro": "^4.13.3",
"drizzle-orm": "^0.32.2", "drizzle-orm": "^0.33.0",
"fuse.js": "^7.0.0", "fuse.js": "^7.0.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"luxon": "^3.5.0", "luxon": "^3.5.0",
@ -28,7 +28,7 @@
"@napi-rs/canvas": "^0.1.53", "@napi-rs/canvas": "^0.1.53",
"@types/lodash": "^4.17.7", "@types/lodash": "^4.17.7",
"@types/luxon": "^3.4.2", "@types/luxon": "^3.4.2",
"@types/node": "^22.1.0", "@types/node": "^22.2.0",
"@types/pg": "^8.11.6", "@types/pg": "^8.11.6",
"@types/qrcode-svg": "^1.1.5", "@types/qrcode-svg": "^1.1.5",
"@types/unist": "^3.0.2", "@types/unist": "^3.0.2",
@ -2504,9 +2504,9 @@
} }
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "22.1.0", "version": "22.2.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.2.0.tgz",
"integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==", "integrity": "sha512-bm6EG6/pCpkxDf/0gDNDdtDILMOHgaQBVOJGdwsqClnxA3xL6jtMv76rLBc006RVMWbmaf0xbmom4Z/5o2nRkQ==",
"devOptional": true, "devOptional": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@ -2913,12 +2913,12 @@
} }
}, },
"node_modules/astro": { "node_modules/astro": {
"version": "4.13.1", "version": "4.13.3",
"resolved": "https://registry.npmjs.org/astro/-/astro-4.13.1.tgz", "resolved": "https://registry.npmjs.org/astro/-/astro-4.13.3.tgz",
"integrity": "sha512-VnMjAc+ykFsIVjgbu9Mt/EA1fMIcPMXbU89h3ATwGOzSIKDsQH72bDgfJkWiwk6u0OE90GeP5EPhAT28Twf9oA==", "integrity": "sha512-MyhmM0v5sphiVwxAm5jjKxWeuPZijWPJ8Ajdign9QzEmLWSH8vUYIJWx/dWRQ6vF1I0jXrksoj3wtw5nzXt9nw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@astrojs/compiler": "^2.10.0", "@astrojs/compiler": "^2.10.1",
"@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",
@ -2967,7 +2967,7 @@
"prompts": "^2.4.2", "prompts": "^2.4.2",
"rehype": "^13.0.1", "rehype": "^13.0.1",
"semver": "^7.6.3", "semver": "^7.6.3",
"shiki": "^1.12.0", "shiki": "^1.12.1",
"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",
@ -3294,9 +3294,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001650", "version": "1.0.30001651",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001650.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz",
"integrity": "sha512-fgEc7hP/LB7iicdXHUI9VsBsMZmUmlVJeQP2qqQW+3lkqVhbmjEU8zp+h5stWeilX+G7uXuIUIIlWlDw9jdt8g==", "integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==",
"funding": [ "funding": [
{ {
"type": "opencollective", "type": "opencollective",
@ -3854,9 +3854,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/drizzle-orm": { "node_modules/drizzle-orm": {
"version": "0.32.2", "version": "0.33.0",
"resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.32.2.tgz", "resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.33.0.tgz",
"integrity": "sha512-3fXKzPzrgZIcnWCSLiERKN5Opf9Iagrag75snfFlKeKSYB1nlgPBshzW3Zn6dQymkyiib+xc4nIz0t8U+Xdpuw==", "integrity": "sha512-SHy72R2Rdkz0LEq0PSG/IdvnT3nGiWuRk+2tXZQ90GVq/XQhpCzu/EFT3V2rox+w8MlkBQxifF8pCStNYnERfA==",
"license": "Apache-2.0", "license": "Apache-2.0",
"peerDependencies": { "peerDependencies": {
"@aws-sdk/client-rds-data": ">=3", "@aws-sdk/client-rds-data": ">=3",
@ -3990,9 +3990,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.5.5", "version": "1.5.6",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.5.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.6.tgz",
"integrity": "sha512-QR7/A7ZkMS8tZuoftC/jfqNkZLQO779SSW3YuZHP4eXpj3EffGLFcB/Xu9AAZQzLccTiCV+EmUo3ha4mQ9wnlA==", "integrity": "sha512-jwXWsM5RPf6j9dPYzaorcBSUg6AiqocPEyMpkchkvntaH9HGfOOMZwxMJjDY/XEs3T5dM7uyH1VhRMkqUU9qVw==",
"license": "ISC" "license": "ISC"
}, },
"node_modules/emmet": { "node_modules/emmet": {
@ -4339,9 +4339,9 @@
} }
}, },
"node_modules/foreground-child": { "node_modules/foreground-child": {
"version": "3.2.1", "version": "3.3.0",
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz",
"integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==", "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==",
"dev": true, "dev": true,
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
@ -8906,13 +8906,13 @@
} }
}, },
"node_modules/vite": { "node_modules/vite": {
"version": "5.3.5", "version": "5.4.0",
"resolved": "https://registry.npmjs.org/vite/-/vite-5.3.5.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.0.tgz",
"integrity": "sha512-MdjglKR6AQXQb9JGiS7Rc2wC6uMjcm7Go/NHNO63EwiJXfuk9PgqiP/n5IDJCziMkfw9n4Ubp7lttNwz+8ZVKA==", "integrity": "sha512-5xokfMX0PIiwCMCMb9ZJcMyh5wbBun0zUzKib+L65vAZ8GY9ePZMXxFrHbr/Kyll2+LSCY7xtERPpxkBDKngwg==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"esbuild": "^0.21.3", "esbuild": "^0.21.3",
"postcss": "^8.4.39", "postcss": "^8.4.40",
"rollup": "^4.13.0" "rollup": "^4.13.0"
}, },
"bin": { "bin": {
@ -8932,6 +8932,7 @@
"less": "*", "less": "*",
"lightningcss": "^1.21.0", "lightningcss": "^1.21.0",
"sass": "*", "sass": "*",
"sass-embedded": "*",
"stylus": "*", "stylus": "*",
"sugarss": "*", "sugarss": "*",
"terser": "^5.4.0" "terser": "^5.4.0"
@ -8949,6 +8950,9 @@
"sass": { "sass": {
"optional": true "optional": true
}, },
"sass-embedded": {
"optional": true
},
"stylus": { "stylus": {
"optional": true "optional": true
}, },

View File

@ -45,8 +45,8 @@
"@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.13.1", "astro": "^4.13.3",
"drizzle-orm": "^0.32.2", "drizzle-orm": "^0.33.0",
"fuse.js": "^7.0.0", "fuse.js": "^7.0.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"luxon": "^3.5.0", "luxon": "^3.5.0",
@ -61,7 +61,7 @@
"@napi-rs/canvas": "^0.1.53", "@napi-rs/canvas": "^0.1.53",
"@types/lodash": "^4.17.7", "@types/lodash": "^4.17.7",
"@types/luxon": "^3.4.2", "@types/luxon": "^3.4.2",
"@types/node": "^22.1.0", "@types/node": "^22.2.0",
"@types/pg": "^8.11.6", "@types/pg": "^8.11.6",
"@types/qrcode-svg": "^1.1.5", "@types/qrcode-svg": "^1.1.5",
"@types/unist": "^3.0.2", "@types/unist": "^3.0.2",
@ -81,6 +81,6 @@
}, },
"packageManager": "npm@10.8.2", "packageManager": "npm@10.8.2",
"engines": { "engines": {
"node": "22.5.1" "node": "22.6.0"
} }
} }

View File

@ -1,6 +1,6 @@
import { defaultCover } from '@/content/config.ts'; import { defaultCover } from '@/content/config.ts';
import options from '@/options'; import options from '@/options';
import { getCollection, getEntryBySlug, type Render } from 'astro:content'; import { getCollection, getEntry, type Render } from 'astro:content';
// Import the collections from the astro content. // Import the collections from the astro content.
const categoriesCollection = await getCollection('categories'); const categoriesCollection = await getCollection('categories');
@ -34,7 +34,7 @@ export const pages: Page[] = pagesCollection
slug: page.slug, slug: page.slug,
permalink: `/${page.slug}`, permalink: `/${page.slug}`,
render: async () => { render: async () => {
const entry = await getEntryBySlug('pages', page.slug); const entry = await getEntry('pages', page.slug);
return entry.render(); return entry.render();
}, },
...page.data, ...page.data,
@ -45,11 +45,11 @@ export const posts: Post[] = postsCollection
slug: post.slug, slug: post.slug,
permalink: `/posts/${post.slug}`, permalink: `/posts/${post.slug}`,
render: async () => { render: async () => {
const entry = await getEntryBySlug('posts', post.slug); const entry = await getEntry('posts', post.slug);
return entry.render(); return entry.render();
}, },
raw: async () => { raw: async () => {
const entry = await getEntryBySlug('posts', post.slug); const entry = await getEntry('posts', post.slug);
return entry.body; return entry.body;
}, },
...post.data, ...post.data,