@h-ai/cli 0.1.0-alpha.26 → 0.1.0-alpha.28

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@h-ai/cli",
3
3
  "type": "module",
4
- "version": "0.1.0-alpha.26",
4
+ "version": "0.1.0-alpha.28",
5
5
  "description": "Hai Framework CLI for project scaffolding and code generation.",
6
6
  "license": "Apache-2.0",
7
7
  "keywords": [
@@ -34,7 +34,7 @@
34
34
  "ora": "^9.1.0",
35
35
  "prompts": "^2.4.2",
36
36
  "yaml": "^2.7.0",
37
- "@h-ai/core": "0.1.0-alpha.26"
37
+ "@h-ai/core": "0.1.0-alpha.28"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/fs-extra": "^11.0.4",
@@ -1,5 +1,6 @@
1
1
  {{! @skipIfEmpty }}
2
2
  {{#if fullstack.frontends.app}}
3
+ import { haiOptimizeExclude, haiPrebundledDeps } from '@h-ai/ui/vite'
3
4
  import { paraglideVitePlugin } from '@inlang/paraglide-js'
4
5
  import { svelte } from '@sveltejs/vite-plugin-svelte'
5
6
  import tailwindcss from '@tailwindcss/vite'
@@ -16,7 +17,8 @@ export default defineConfig({
16
17
  }),
17
18
  ],
18
19
  optimizeDeps: {
19
- exclude: ['bits-ui'],
20
+ exclude: [...haiOptimizeExclude],
21
+ include: [...haiPrebundledDeps],
20
22
  },
21
23
  envPrefix: ['VITE_', 'PUBLIC_'],
22
24
  ssr: {
@@ -1,6 +1,7 @@
1
1
  {{! @skipIfEmpty }}
2
2
  {{#if fullstack.frontends.desktop}}
3
3
  import process from 'node:process'
4
+ import { haiOptimizeExclude, haiPrebundledDeps } from '@h-ai/ui/vite'
4
5
  import { paraglideVitePlugin } from '@inlang/paraglide-js'
5
6
  import { svelte } from '@sveltejs/vite-plugin-svelte'
6
7
  import tailwindcss from '@tailwindcss/vite'
@@ -40,7 +41,8 @@ export default defineConfig(({ mode }) => {
40
41
  },
41
42
  },
42
43
  optimizeDeps: {
43
- exclude: ['@h-ai/ui', 'bits-ui'],
44
+ exclude: ['@h-ai/ui', ...haiOptimizeExclude],
45
+ include: [...haiPrebundledDeps],
44
46
  },
45
47
  envPrefix: ['VITE_', 'PUBLIC_'],
46
48
  test: {
@@ -1,5 +1,6 @@
1
1
  {{! @skipIfEmpty }}
2
2
  {{#if fullstack.frontends.web}}
3
+ import { haiOptimizeExclude, haiPrebundledDeps } from '@h-ai/ui/vite'
3
4
  import { paraglideVitePlugin } from '@inlang/paraglide-js'
4
5
  import { svelte } from '@sveltejs/vite-plugin-svelte'
5
6
  import tailwindcss from '@tailwindcss/vite'
@@ -16,7 +17,8 @@ export default defineConfig({
16
17
  tailwindcss(),
17
18
  ],
18
19
  optimizeDeps: {
19
- exclude: ['bits-ui'],
20
+ exclude: [...haiOptimizeExclude],
21
+ include: [...haiPrebundledDeps],
20
22
  },
21
23
  envPrefix: ['VITE_', 'PUBLIC_'],
22
24
  ssr: {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "{{projectName}}",
3
- "version": "0.1.0-alpha.26",
3
+ "version": "0.1.0-alpha.28",
4
4
  "private": true,
5
5
  "description": "{{#if_eq appType 'admin'}}Enterprise management system built with hai Agent Framework{{/if_eq}}{{#if_eq appType 'website'}}Enterprise website built with hai Agent Framework{{/if_eq}}{{#if_eq appType 'h5'}}Mobile H5 app built with hai Agent Framework{{/if_eq}}{{#if_eq appType 'api'}}REST API service built with hai Agent Framework{{/if_eq}}{{#if_eq appType 'mobile-app'}}Mobile app built with hai Agent Framework{{/if_eq}}",
6
6
  "keywords": ["hai", {{#unless isSvelteOnlyApp}}"sveltekit", {{/unless}}"svelte5", "{{appType}}"],
@@ -3,6 +3,9 @@
3
3
  */
4
4
  import path from 'node:path'
5
5
  import process from 'node:process'
6
+ {{#if hasUi}}
7
+ import { haiOptimizeExclude, haiPrebundledDeps } from '@h-ai/ui/vite'
8
+ {{/if}}
6
9
  {{#if hasI18n}}
7
10
  import { paraglideVitePlugin } from '@inlang/paraglide-js'
8
11
  {{/if}}
@@ -40,7 +43,11 @@ export default defineConfig(({ mode }) => {
40
43
  ],
41
44
  {{#if hasUi}}
42
45
  optimizeDeps: {
43
- exclude: ['bits-ui'],
46
+ // bits-ui 含 .svelte 源码须 exclude;@internationalized/date 须与 bits-ui 同为原始副本,
47
+ // 避免日期类型 instanceof 失败("Unknown date type")。
48
+ exclude: [...haiOptimizeExclude],
49
+ // 预打包 @h-ai/ui 的重型纯 JS 依赖,避免首次进入业务路由触发依赖再优化与整页刷新
50
+ include: [...haiPrebundledDeps],
44
51
  },
45
52
  {{/if}}
46
53
  {{#unless isSvelteOnlyApp}}