diff --git a/.gitignore b/.gitignore index 6b0733f..f5d5f9d 100755 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,6 @@ package-lock.json # ignore .astro directory .astro + +# ide +.idea/ diff --git a/package.json b/package.json index be37766..a5b9853 100755 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "name": "astroplate", - "version": "5.2.0", + "version": "5.3.0", "description": "Astro and Tailwindcss boilerplate", "author": "zeon.studio", "license": "MIT", + "type": "module", "packageManager": "yarn@1.22.22", "scripts": { "dev": "yarn generate-json && astro dev", @@ -16,11 +17,11 @@ }, "dependencies": { "@astrojs/check": "0.9.4", - "@astrojs/mdx": "4.0.8", - "@astrojs/react": "4.2.0", + "@astrojs/mdx": "4.2.1", + "@astrojs/react": "4.2.1", "@astrojs/rss": "4.0.11", - "@astrojs/sitemap": "3.2.1", - "astro": "5.3.0", + "@astrojs/sitemap": "3.3.0", + "astro": "5.5.4", "astro-auto-import": "^0.4.4", "astro-font": "^1.0.0", "date-fns": "^4.1.0", @@ -41,7 +42,6 @@ "@tailwindcss/forms": "^0.5.10", "@tailwindcss/typography": "^0.5.16", "@tailwindcss/vite": "^4.0.6", - "@types/marked": "^6.0.0", "@types/node": "22.13.4", "@types/react": "19.0.9", "@types/react-dom": "19.0.3", diff --git a/readme.md b/readme.md index 0bbcaec..a9e78f2 100755 --- a/readme.md +++ b/readme.md @@ -10,8 +10,8 @@
-
-
+
+
@@ -66,27 +66,27 @@
### 📦 Dependencies
-- astro v5.1+
+- astro v5.5+
- node v20.10+
-- npm v10.2+
-- tailwind v3.4+
+- yarn v1.22+
+- tailwind v4+
### 👉 Install Dependencies
```bash
-npm install
+yarn install
```
### 👉 Development Command
```bash
-npm run dev
+yarn run dev
```
### 👉 Build Command
```bash
-npm run build
+yarn run build
```
### 👉 Build and Run With Docker
diff --git a/scripts/jsonGenerator.js b/scripts/jsonGenerator.js
index 8aee1ac..28bc69b 100644
--- a/scripts/jsonGenerator.js
+++ b/scripts/jsonGenerator.js
@@ -1,6 +1,6 @@
-const fs = require("fs");
-const path = require("path");
-const matter = require("gray-matter");
+import fs from "node:fs";
+import path from "node:path";
+import matter from "gray-matter";
const CONTENT_DEPTH = 2;
const JSON_FOLDER = "./.json";
@@ -41,10 +41,7 @@ const getData = (folder, groupDepth) => {
}
});
- const publishedPages = getPaths.filter(
- (page) => !page.frontmatter?.draft && page,
- );
- return publishedPages;
+ return getPaths.filter((page) => !page.frontmatter?.draft && page);
};
try {
@@ -60,7 +57,8 @@ try {
);
// merger json files for search
- const posts = require(`../${JSON_FOLDER}/posts.json`);
+ const postsPath = new URL(`../${JSON_FOLDER}/posts.json`, import.meta.url);
+ const posts = JSON.parse(fs.readFileSync(postsPath, "utf8"));
const search = [...posts];
fs.writeFileSync(`${JSON_FOLDER}/search.json`, JSON.stringify(search));
} catch (err) {