@astro-minimax/cli 0.7.5 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,10 +20,10 @@ yarn dlx @astro-minimax/cli my-blog
20
20
  ```
21
21
  my-blog/
22
22
  ├── astro.config.ts # Astro + minimax integration config
23
- ├── package.json # Dependencies (core, viz, tailwind, etc.)
23
+ ├── package.json # Dependencies (core, tailwind, etc.)
24
24
  ├── tsconfig.json # TypeScript configuration
25
25
  ├── public/
26
- │ └── favicon.svg
26
+ │ └── favicon.ico
27
27
  └── src/
28
28
  ├── config.ts # SITE configuration object
29
29
  ├── constants.ts # Social links and share links
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astro-minimax/cli",
3
- "version": "0.7.5",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "description": "CLI tool for astro-minimax blog — create blogs, manage content, and process data with AI.",
6
6
  "author": "Souloss",
@@ -1,7 +1,6 @@
1
1
  import { defineConfig, envField } from "astro/config";
2
2
  import tailwindcss from "@tailwindcss/vite";
3
3
  import minimax from "@astro-minimax/core";
4
- import minimaxViz from "@astro-minimax/viz";
5
4
  import sitemap from "@astrojs/sitemap";
6
5
  import mdx from "@astrojs/mdx";
7
6
  import preact from "@astrojs/preact";
@@ -31,6 +30,7 @@ import { SITE } from "./src/config";
31
30
  import { SOCIALS, SHARE_LINKS } from "./src/constants";
32
31
  import { FRIENDS } from "./src/data/friends";
33
32
 
33
+ // Shiki transformers require type casting since they use a different type system
34
34
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
35
  const asTransformer = (t: any) => t;
36
36
 
@@ -59,9 +59,11 @@ export default defineConfig({
59
59
  shareLinks: SHARE_LINKS,
60
60
  friends: FRIENDS,
61
61
  blogPath: "src/data/blog",
62
+ viz: { mermaid: true, markmap: true },
63
+ }),
64
+ preact({
65
+ compat: true,
62
66
  }),
63
- minimaxViz({ mermaid: true, markmap: true }),
64
- preact({ compat: true }),
65
67
  sitemap({
66
68
  filter: page => SITE.showArchives || !page.endsWith("/archives"),
67
69
  }),
@@ -97,10 +99,13 @@ export default defineConfig({
97
99
  },
98
100
  },
99
101
  vite: {
100
- plugins: [tailwindcss() as never],
102
+ plugins: [
103
+ tailwindcss() as never,
104
+ ],
101
105
  server: {
102
106
  fs: {
103
- strict: false,
107
+ strict: true,
108
+ allow: ["./src", "./.astro"],
104
109
  },
105
110
  proxy: {
106
111
  "/api": {
@@ -108,18 +113,35 @@ export default defineConfig({
108
113
  changeOrigin: true,
109
114
  },
110
115
  },
116
+ warmup: {
117
+ clientFiles: [
118
+ "./src/components/**/*.astro",
119
+ "./src/layouts/**/*.astro",
120
+ ],
121
+ },
111
122
  },
112
123
  resolve: {
113
124
  alias: {
114
- "@/": new URL("./src/", import.meta.url).pathname,
125
+ "@/" : new URL("./src/", import.meta.url).pathname,
115
126
  "react": "preact/compat",
116
127
  "react-dom": "preact/compat",
117
128
  "react/jsx-runtime": "preact/jsx-runtime",
118
129
  },
119
130
  dedupe: ["preact", "preact/hooks", "preact/compat", "preact/debug", "preact/devtools", "react", "react-dom"],
120
131
  },
132
+ // Pre-bundle dependencies to speed up development and ensure consistency.
133
+ //
134
+ // WHY: By explicitly including these packages in optimizeDeps, Vite pre-bundles
135
+ // them on startup. This prevents lazy-loading race conditions where modules
136
+ // might load from different copies during dev. Particularly important for
137
+ // @ai-sdk/react which uses hooks that must resolve consistently.
138
+ //
139
+ // NOTE: Local workspace packages (@astro-minimax/*) are excluded from optimization
140
+ // because they're linked via workspace protocol and should be loaded fresh on changes.
141
+ // Excluding them also ensures JSX transformation uses Preact's jsx-runtime correctly.
121
142
  optimizeDeps: {
122
- exclude: ["@resvg/resvg-js"],
143
+ noDiscovery: true,
144
+ exclude: ["@resvg/resvg-js", "@astro-minimax/ai", "@astro-minimax/core"],
123
145
  include: [
124
146
  "preact",
125
147
  "preact/hooks",
@@ -130,9 +152,9 @@ export default defineConfig({
130
152
  "preact/jsx-dev-runtime",
131
153
  "@ai-sdk/react",
132
154
  "ai",
133
- "@astro-minimax/ai",
134
- "@astro-minimax/core",
135
- "@astro-minimax/viz",
155
+ "mermaid",
156
+ "markmap-lib",
157
+ "katex",
136
158
  ],
137
159
  },
138
160
  ssr: {
@@ -140,7 +162,6 @@ export default defineConfig({
140
162
  noExternal: [
141
163
  "@astro-minimax/ai",
142
164
  "@astro-minimax/core",
143
- "@astro-minimax/viz",
144
165
  "@ai-sdk/react",
145
166
  "ai",
146
167
  ],
@@ -7,8 +7,11 @@ import voiceProfile from '../../datas/voice-profile.json';
7
7
  import factRegistry from '../../datas/fact-registry.json';
8
8
 
9
9
  // Optional: TF-IDF vector index for enhanced search reranking
10
+ // The vector index is created by `astro-minimax ai process` command
11
+ // Using dynamic import in try/catch since the file may not exist yet
10
12
  let vectorIndex: unknown = null;
11
- try { vectorIndex = (await import('../../src/data/vectors/index.json')).default; } catch { /* not available */ }
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
+ try { vectorIndex = (await import('../../src/data/vectors/index.json' as any)).default; } catch { /* not available */ }
12
15
 
13
16
  interface FunctionEnv extends ChatHandlerEnv {
14
17
  CACHE_KV?: KVNamespace;
@@ -24,5 +27,6 @@ export const onRequest: PagesFunction<FunctionEnv> = async (context) => {
24
27
  return handleChatRequest({
25
28
  env: context.env,
26
29
  request: context.request,
30
+ waitUntil: context.waitUntil,
27
31
  });
28
32
  };
@@ -6,7 +6,7 @@
6
6
  "dev": "concurrently -n \"astro,ai\" -c \"blue,green\" \"astro dev\" \"pnpm exec astro-ai-dev\"",
7
7
  "dev:astro": "astro dev",
8
8
  "dev:ai": "pnpm exec astro-ai-dev",
9
- "build": "astro check && astro build && pagefind --site dist && cp -r dist/pagefind public/",
9
+ "build": "astro check && astro build && pagefind --site dist",
10
10
  "preview": "wrangler pages dev dist",
11
11
  "preview:astro": "astro preview",
12
12
  "lint": "eslint .",
@@ -28,38 +28,37 @@
28
28
  "dependencies": {
29
29
  "@ai-sdk/openai-compatible": "^2.0.35",
30
30
  "@ai-sdk/react": "^3.0.118",
31
- "@astro-minimax/ai": "^0.7.5",
32
- "@astro-minimax/core": "^0.7.5",
33
- "@astro-minimax/notify": "^0.7.5",
34
- "@astro-minimax/viz": "^0.7.5",
31
+ "@astro-minimax/ai": "^0.8.0",
32
+ "@astro-minimax/core": "^0.8.0",
33
+ "@astro-minimax/notify": "^0.8.0",
35
34
  "@astrojs/mdx": "^5.0.0",
36
35
  "@astrojs/preact": "^5.0.0",
37
36
  "@astrojs/rss": "^4.0.17",
38
37
  "@astrojs/sitemap": "^3.7.1",
39
38
  "@fontsource/ibm-plex-mono": "^5.2.7",
40
- "@resvg/resvg-js": "^2.6.0",
39
+ "@resvg/resvg-js": "^2.6.2",
41
40
  "@shikijs/rehype": "^4.0.2",
42
- "@tailwindcss/typography": "^0.5.19",
43
41
  "@tailwindcss/vite": "^4.2.1",
44
42
  "ai": "^6.0.116",
45
43
  "astro": "^6.0.0",
46
44
  "dayjs": "^1.11.19",
47
45
  "lodash.kebabcase": "^4.1.1",
46
+ "markmap-lib": "^0.18.11",
48
47
  "mermaid": "^11.12.3",
49
48
  "preact": "^10.29.0",
49
+ "qrcode": "^1.5.4",
50
50
  "rehype-katex": "^7.0.1",
51
51
  "remark-emoji": "^5.0.2",
52
52
  "remark-github-alerts": "^0.1.1",
53
- "remark-markmap": "^1.1.5",
54
53
  "remark-math": "^6.0.0",
55
- "satori": "^0.18.0",
54
+ "satori": "^0.25.0",
56
55
  "sharp": "^0.34.5",
57
56
  "slugify": "^1.6.6",
58
57
  "tailwindcss": "^4.2.1"
59
58
  },
60
59
  "devDependencies": {
61
- "@astro-minimax/cli": "^0.7.5",
62
- "@astrojs/check": "^0.9.6",
60
+ "@astro-minimax/cli": "^0.8.0",
61
+ "@astrojs/check": "^0.9.7",
63
62
  "@cloudflare/workers-types": "^4.20260313.1",
64
63
  "@pagefind/default-ui": "^1.4.0",
65
64
  "@shikijs/transformers": "^4.0.2",
Binary file
@@ -23,12 +23,12 @@ export const SITE: SiteConfig = {
23
23
  series: true,
24
24
  archives: true,
25
25
  search: true,
26
- darkMode: true,
27
26
  friends: false,
28
27
  projects: false,
29
- ai: false,
30
28
  },
31
29
 
30
+ darkMode: true,
31
+
32
32
  nav: {
33
33
  items: [
34
34
  { key: "home", enabled: true },
@@ -109,15 +109,7 @@ export const SITE: SiteConfig = {
109
109
  apiEndpoint: "/api/chat",
110
110
  },
111
111
 
112
- get lightAndDarkMode() {
113
- return this.features?.darkMode;
114
- },
115
-
116
112
  get showArchives() {
117
113
  return this.features?.archives ?? true;
118
114
  },
119
-
120
- get aiEnabled() {
121
- return (this.features?.ai ?? false) && (this.ai?.enabled ?? false);
122
- },
123
- };
115
+ };
@@ -4,6 +4,7 @@ description: "展示 GitHub 风格的提示框功能,支持多种类型"
4
4
  pubDatetime: 2024-01-06T00:00:00.000Z
5
5
  tags:
6
6
  - 教程
7
+ category: 教程/功能
7
8
  ---
8
9
 
9
10
  ## 什么是 GitHub Alerts?
@@ -5,6 +5,7 @@ pubDatetime: 2024-01-05T00:00:00.000Z
5
5
  tags:
6
6
  - 教程
7
7
  - 代码
8
+ category: 教程/功能
8
9
  ---
9
10
 
10
11
  ## 基础代码块
@@ -4,6 +4,7 @@ description: "这是我的第一篇博客文章,由 astro-minimax 主题驱动
4
4
  pubDatetime: 2026-01-01T00:00:00.000Z
5
5
  tags:
6
6
  - 入门
7
+ category: 教程/入门
7
8
  ---
8
9
 
9
10
  ## 欢迎来到我的博客
@@ -5,6 +5,7 @@ pubDatetime: 2024-01-03T00:00:00.000Z
5
5
  tags:
6
6
  - 教程
7
7
  - Markmap
8
+ category: 教程/工具
8
9
  ---
9
10
 
10
11
  ## 什么是 Markmap?
@@ -5,6 +5,7 @@ pubDatetime: 2024-01-04T00:00:00.000Z
5
5
  tags:
6
6
  - 教程
7
7
  - 数学
8
+ category: 教程/功能
8
9
  ---
9
10
 
10
11
  ## 行内公式
@@ -5,6 +5,7 @@ pubDatetime: 2024-01-02T00:00:00.000Z
5
5
  tags:
6
6
  - 教程
7
7
  - Mermaid
8
+ category: 教程/工具
8
9
  ---
9
10
 
10
11
  ## 流程图
@@ -6,6 +6,9 @@
6
6
  "baseUrl": ".",
7
7
  "paths": {
8
8
  "@/*": ["./src/*"]
9
- }
9
+ },
10
+ "jsx": "react-jsx",
11
+ "jsxImportSource": "preact",
12
+ "types": ["@cloudflare/workers-types"]
10
13
  }
11
14
  }