From bdfa9fe1522b10d7b1f36c58e8b3a8bb9ad61bf7 Mon Sep 17 00:00:00 2001 From: Yufan Sheng Date: Sun, 11 Aug 2024 11:41:28 +0800 Subject: [PATCH] chore: bump the astro, fix the deprecated collection API. --- package-lock.json | 58 +++++++++++++++++++++++-------------------- package.json | 8 +++--- src/helpers/schema.ts | 8 +++--- 3 files changed, 39 insertions(+), 35 deletions(-) diff --git a/package-lock.json b/package-lock.json index b8ba19e..fa742f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,8 +12,8 @@ "@astrojs/mdx": "^3.1.3", "@astrojs/rss": "^4.0.7", "@zeabur/astro-adapter": "^1.0.6", - "astro": "^4.13.1", - "drizzle-orm": "^0.32.2", + "astro": "^4.13.3", + "drizzle-orm": "^0.33.0", "fuse.js": "^7.0.0", "lodash": "^4.17.21", "luxon": "^3.5.0", @@ -28,7 +28,7 @@ "@napi-rs/canvas": "^0.1.53", "@types/lodash": "^4.17.7", "@types/luxon": "^3.4.2", - "@types/node": "^22.1.0", + "@types/node": "^22.2.0", "@types/pg": "^8.11.6", "@types/qrcode-svg": "^1.1.5", "@types/unist": "^3.0.2", @@ -2504,9 +2504,9 @@ } }, "node_modules/@types/node": { - "version": "22.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", - "integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==", + "version": "22.2.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.2.0.tgz", + "integrity": "sha512-bm6EG6/pCpkxDf/0gDNDdtDILMOHgaQBVOJGdwsqClnxA3xL6jtMv76rLBc006RVMWbmaf0xbmom4Z/5o2nRkQ==", "devOptional": true, "license": "MIT", "dependencies": { @@ -2913,12 +2913,12 @@ } }, "node_modules/astro": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/astro/-/astro-4.13.1.tgz", - "integrity": "sha512-VnMjAc+ykFsIVjgbu9Mt/EA1fMIcPMXbU89h3ATwGOzSIKDsQH72bDgfJkWiwk6u0OE90GeP5EPhAT28Twf9oA==", + "version": "4.13.3", + "resolved": "https://registry.npmjs.org/astro/-/astro-4.13.3.tgz", + "integrity": "sha512-MyhmM0v5sphiVwxAm5jjKxWeuPZijWPJ8Ajdign9QzEmLWSH8vUYIJWx/dWRQ6vF1I0jXrksoj3wtw5nzXt9nw==", "license": "MIT", "dependencies": { - "@astrojs/compiler": "^2.10.0", + "@astrojs/compiler": "^2.10.1", "@astrojs/internal-helpers": "0.4.1", "@astrojs/markdown-remark": "5.2.0", "@astrojs/telemetry": "3.1.0", @@ -2967,7 +2967,7 @@ "prompts": "^2.4.2", "rehype": "^13.0.1", "semver": "^7.6.3", - "shiki": "^1.12.0", + "shiki": "^1.12.1", "string-width": "^7.2.0", "strip-ansi": "^7.1.0", "tsconfck": "^3.1.1", @@ -3294,9 +3294,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001650", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001650.tgz", - "integrity": "sha512-fgEc7hP/LB7iicdXHUI9VsBsMZmUmlVJeQP2qqQW+3lkqVhbmjEU8zp+h5stWeilX+G7uXuIUIIlWlDw9jdt8g==", + "version": "1.0.30001651", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz", + "integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==", "funding": [ { "type": "opencollective", @@ -3854,9 +3854,9 @@ "license": "MIT" }, "node_modules/drizzle-orm": { - "version": "0.32.2", - "resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.32.2.tgz", - "integrity": "sha512-3fXKzPzrgZIcnWCSLiERKN5Opf9Iagrag75snfFlKeKSYB1nlgPBshzW3Zn6dQymkyiib+xc4nIz0t8U+Xdpuw==", + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.33.0.tgz", + "integrity": "sha512-SHy72R2Rdkz0LEq0PSG/IdvnT3nGiWuRk+2tXZQ90GVq/XQhpCzu/EFT3V2rox+w8MlkBQxifF8pCStNYnERfA==", "license": "Apache-2.0", "peerDependencies": { "@aws-sdk/client-rds-data": ">=3", @@ -3990,9 +3990,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.5.tgz", - "integrity": "sha512-QR7/A7ZkMS8tZuoftC/jfqNkZLQO779SSW3YuZHP4eXpj3EffGLFcB/Xu9AAZQzLccTiCV+EmUo3ha4mQ9wnlA==", + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.6.tgz", + "integrity": "sha512-jwXWsM5RPf6j9dPYzaorcBSUg6AiqocPEyMpkchkvntaH9HGfOOMZwxMJjDY/XEs3T5dM7uyH1VhRMkqUU9qVw==", "license": "ISC" }, "node_modules/emmet": { @@ -4339,9 +4339,9 @@ } }, "node_modules/foreground-child": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", - "integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", "dev": true, "license": "ISC", "dependencies": { @@ -8906,13 +8906,13 @@ } }, "node_modules/vite": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.5.tgz", - "integrity": "sha512-MdjglKR6AQXQb9JGiS7Rc2wC6uMjcm7Go/NHNO63EwiJXfuk9PgqiP/n5IDJCziMkfw9n4Ubp7lttNwz+8ZVKA==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.0.tgz", + "integrity": "sha512-5xokfMX0PIiwCMCMb9ZJcMyh5wbBun0zUzKib+L65vAZ8GY9ePZMXxFrHbr/Kyll2+LSCY7xtERPpxkBDKngwg==", "license": "MIT", "dependencies": { "esbuild": "^0.21.3", - "postcss": "^8.4.39", + "postcss": "^8.4.40", "rollup": "^4.13.0" }, "bin": { @@ -8932,6 +8932,7 @@ "less": "*", "lightningcss": "^1.21.0", "sass": "*", + "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" @@ -8949,6 +8950,9 @@ "sass": { "optional": true }, + "sass-embedded": { + "optional": true + }, "stylus": { "optional": true }, diff --git a/package.json b/package.json index 0883b74..6593cb4 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,8 @@ "@astrojs/mdx": "^3.1.3", "@astrojs/rss": "^4.0.7", "@zeabur/astro-adapter": "^1.0.6", - "astro": "^4.13.1", - "drizzle-orm": "^0.32.2", + "astro": "^4.13.3", + "drizzle-orm": "^0.33.0", "fuse.js": "^7.0.0", "lodash": "^4.17.21", "luxon": "^3.5.0", @@ -61,7 +61,7 @@ "@napi-rs/canvas": "^0.1.53", "@types/lodash": "^4.17.7", "@types/luxon": "^3.4.2", - "@types/node": "^22.1.0", + "@types/node": "^22.2.0", "@types/pg": "^8.11.6", "@types/qrcode-svg": "^1.1.5", "@types/unist": "^3.0.2", @@ -81,6 +81,6 @@ }, "packageManager": "npm@10.8.2", "engines": { - "node": "22.5.1" + "node": "22.6.0" } } diff --git a/src/helpers/schema.ts b/src/helpers/schema.ts index 355e942..5101a18 100644 --- a/src/helpers/schema.ts +++ b/src/helpers/schema.ts @@ -1,6 +1,6 @@ import { defaultCover } from '@/content/config.ts'; 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. const categoriesCollection = await getCollection('categories'); @@ -34,7 +34,7 @@ export const pages: Page[] = pagesCollection slug: page.slug, permalink: `/${page.slug}`, render: async () => { - const entry = await getEntryBySlug('pages', page.slug); + const entry = await getEntry('pages', page.slug); return entry.render(); }, ...page.data, @@ -45,11 +45,11 @@ export const posts: Post[] = postsCollection slug: post.slug, permalink: `/posts/${post.slug}`, render: async () => { - const entry = await getEntryBySlug('posts', post.slug); + const entry = await getEntry('posts', post.slug); return entry.render(); }, raw: async () => { - const entry = await getEntryBySlug('posts', post.slug); + const entry = await getEntry('posts', post.slug); return entry.body; }, ...post.data,