mirror of
https://github.com/10h30/astroplate.git
synced 2026-07-11 10:46:07 +09:00
chore(deps):upgrade to Astro 6 beta and added config for cloudflare
This commit is contained in:
@@ -35,6 +35,5 @@ export default defineConfig({
|
|||||||
markdown: {
|
markdown: {
|
||||||
remarkPlugins: [remarkToc, [remarkCollapse, { test: "Table of contents" }]],
|
remarkPlugins: [remarkToc, [remarkCollapse, { test: "Table of contents" }]],
|
||||||
shikiConfig: { theme: "one-dark-pro", wrap: true },
|
shikiConfig: { theme: "one-dark-pro", wrap: true },
|
||||||
extendDefaultPlugins: true,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
+14
-11
@@ -1,31 +1,33 @@
|
|||||||
{
|
{
|
||||||
"name": "astroplate",
|
"name": "astroplate",
|
||||||
"version": "5.12.1",
|
"version": "6.0.0",
|
||||||
"description": "Astro and Tailwindcss boilerplate",
|
"description": "Astro and Tailwindcss boilerplate",
|
||||||
"author": "zeon.studio",
|
"author": "zeon.studio",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"packageManager": "yarn@1.22.22",
|
"packageManager": "yarn@1.22.22",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "concurrently \"node scripts/themeGenerator.js --watch\" \"yarn generate-json && astro dev\"",
|
"dev": "concurrently \"node scripts/themeGenerator.js --watch\" \"node scripts/jsonGenerator.js && astro dev\"",
|
||||||
"build": "node scripts/themeGenerator.js && yarn generate-json && astro build",
|
"build": "node scripts/themeGenerator.js && node scripts/jsonGenerator.js && astro build",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"check": "astro check",
|
"check": "astro check",
|
||||||
"format": "prettier -w ./src",
|
"format": "prettier -w ./src",
|
||||||
"generate-json": "node scripts/jsonGenerator.js",
|
"generate-json": "node scripts/jsonGenerator.js",
|
||||||
"remove-darkmode": "node scripts/removeDarkmode.js && yarn format"
|
"remove-darkmode": "node scripts/removeDarkmode.js && yarn format",
|
||||||
|
"deploy:cf-workers": "npm run build && wrangler deploy",
|
||||||
|
"preview:cf-workers": "npm run build && wrangler dev"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/check": "0.9.6",
|
"@astrojs/check": "0.9.7-beta.1",
|
||||||
"@astrojs/mdx": "4.3.13",
|
"@astrojs/mdx": "5.0.0-beta.9",
|
||||||
"@astrojs/react": "4.4.2",
|
"@astrojs/react": "5.0.0-beta.3",
|
||||||
"@astrojs/sitemap": "3.7.0",
|
"@astrojs/sitemap": "3.7.0",
|
||||||
"@digi4care/astro-google-tagmanager": "^1.6.0",
|
"@digi4care/astro-google-tagmanager": "^1.6.0",
|
||||||
"@justinribeiro/lite-youtube": "^1.9.0",
|
"@justinribeiro/lite-youtube": "^1.9.0",
|
||||||
"astro": "5.17.3",
|
"astro": "6.0.0-beta.17",
|
||||||
"astro-auto-import": "^0.5.1",
|
"astro-auto-import": "^0.5.1",
|
||||||
"astro-font": "^1.1.0",
|
"astro-font": "^1.1.0",
|
||||||
"astro-swiper": "^2.1.0",
|
"astro-swiper": "^2.1.1",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"disqus-react": "^1.1.7",
|
"disqus-react": "^1.1.7",
|
||||||
"github-slugger": "^2.0.0",
|
"github-slugger": "^2.0.0",
|
||||||
@@ -44,7 +46,7 @@
|
|||||||
"@tailwindcss/forms": "^0.5.11",
|
"@tailwindcss/forms": "^0.5.11",
|
||||||
"@tailwindcss/typography": "^0.5.19",
|
"@tailwindcss/typography": "^0.5.19",
|
||||||
"@tailwindcss/vite": "^4.2.1",
|
"@tailwindcss/vite": "^4.2.1",
|
||||||
"@types/node": "25.3.0",
|
"@types/node": "25.3.3",
|
||||||
"@types/react": "19.2.14",
|
"@types/react": "19.2.14",
|
||||||
"@types/react-dom": "19.2.3",
|
"@types/react-dom": "19.2.3",
|
||||||
"concurrently": "^9.2.1",
|
"concurrently": "^9.2.1",
|
||||||
@@ -54,6 +56,7 @@
|
|||||||
"prettier-plugin-tailwindcss": "^0.7.2",
|
"prettier-plugin-tailwindcss": "^0.7.2",
|
||||||
"tailwind-bootstrap-grid": "^7.0.0",
|
"tailwind-bootstrap-grid": "^7.0.0",
|
||||||
"tailwindcss": "^4.2.1",
|
"tailwindcss": "^4.2.1",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3",
|
||||||
|
"wrangler": "^4.69.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<p align=center>
|
<p align=center>
|
||||||
<a href="https://github.com/withastro/astro/releases/tag/astro%405.15.9">
|
<a href="https://github.com/withastro/astro/releases/tag/astro%406.0.0-beta.17">
|
||||||
<img src="https://img.shields.io/static/v1?label=ASTRO&message=5.15&color=000&logo=astro" alt="Astro Version 5.15"/>
|
<img src="https://img.shields.io/static/v1?label=ASTRO&message=6.0%20beta&color=000&logo=astro" alt="Astro Version 6.0 beta"/>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="https://github.com/zeon-studio/astroplate/blob/main/LICENSE">
|
<a href="https://github.com/zeon-studio/astroplate/blob/main/LICENSE">
|
||||||
@@ -64,13 +64,14 @@
|
|||||||
- astro/react
|
- astro/react
|
||||||
- astro/sitemap
|
- astro/sitemap
|
||||||
- astro/tailwind
|
- astro/tailwind
|
||||||
|
- Cloudflare Workers (optional deployment)
|
||||||
|
|
||||||
## 🚀 Getting Started
|
## 🚀 Getting Started
|
||||||
|
|
||||||
### 📦 Dependencies
|
### 📦 Dependencies
|
||||||
|
|
||||||
- astro v5.15+
|
- astro v6.0.0-beta+
|
||||||
- node v20.10+
|
- node v22.12.0+ (see `.nvmrc`)
|
||||||
- yarn v1.22+
|
- yarn v1.22+
|
||||||
- tailwind v4+
|
- tailwind v4+
|
||||||
|
|
||||||
@@ -92,6 +93,18 @@ yarn run dev
|
|||||||
yarn run build
|
yarn run build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 👉 Preview on Cloudflare Workers
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn run preview:cf-workers
|
||||||
|
```
|
||||||
|
|
||||||
|
### 👉 Deploy to Cloudflare Workers
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn run deploy:cf-workers
|
||||||
|
```
|
||||||
|
|
||||||
### 👉 Build and Run With Docker
|
### 👉 Build and Run With Docker
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
import { glob } from "astro/loaders";
|
import { glob } from "astro/loaders";
|
||||||
import { defineCollection, z } from "astro:content";
|
import { defineCollection } from "astro:content";
|
||||||
|
import { z } from "astro/zod";
|
||||||
|
|
||||||
const commonFields = {
|
const commonFields = {
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
description: z.string(),
|
description: z.string(),
|
||||||
meta_title: z.string().optional(),
|
meta_title: z.string().optional(),
|
||||||
date: z.date().optional(),
|
// z.coerce.date() handles both Date objects and ISO string dates from frontmatter (Zod 4)
|
||||||
|
date: z.coerce.date().optional(),
|
||||||
image: z.string().optional(),
|
image: z.string().optional(),
|
||||||
draft: z.boolean(),
|
draft: z.boolean(),
|
||||||
};
|
};
|
||||||
@@ -17,11 +19,12 @@ const blogCollection = defineCollection({
|
|||||||
title: z.string(),
|
title: z.string(),
|
||||||
meta_title: z.string().optional(),
|
meta_title: z.string().optional(),
|
||||||
description: z.string().optional(),
|
description: z.string().optional(),
|
||||||
date: z.date().optional(),
|
date: z.coerce.date().optional(),
|
||||||
image: z.string().optional(),
|
image: z.string().optional(),
|
||||||
author: z.string().default("Admin"),
|
author: z.string().default("Admin"),
|
||||||
categories: z.array(z.string()).default(["others"]),
|
// Use factory functions for mutable array defaults (Zod 4 best practice)
|
||||||
tags: z.array(z.string()).default(["others"]),
|
categories: z.array(z.string()).default(() => ["others"]),
|
||||||
|
tags: z.array(z.string()).default(() => ["others"]),
|
||||||
draft: z.boolean().optional(),
|
draft: z.boolean().optional(),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user