@h-ai/cli 0.1.0-alpha.19 → 0.1.0-alpha.21

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.
Files changed (219) hide show
  1. package/README.md +10 -7
  2. package/dist/{chunk-GSMXGUYF.js → chunk-5IGMJVV5.js} +56 -38
  3. package/dist/chunk-5IGMJVV5.js.map +1 -0
  4. package/dist/{chunk-BPO34NRL.js → chunk-CFCXOKGV.js} +27 -5
  5. package/dist/chunk-CFCXOKGV.js.map +1 -0
  6. package/dist/cli-config-templates-5J5VKWWD.js +5 -0
  7. package/dist/{cli-config-templates-JCS7T3NU.js.map → cli-config-templates-5J5VKWWD.js.map} +1 -1
  8. package/dist/cli-skill-templates-JMSV2SVW.js +5 -0
  9. package/dist/{cli-skill-templates-IMYZPQRG.js.map → cli-skill-templates-JMSV2SVW.js.map} +1 -1
  10. package/dist/index.js +627 -107
  11. package/dist/index.js.map +1 -1
  12. package/dist/{src-N4NPS7AG.js → src-QNEJJ3BV.js} +261 -103
  13. package/dist/src-QNEJJ3BV.js.map +1 -0
  14. package/package.json +3 -2
  15. package/templates/README.md +40 -29
  16. package/templates/apps/admin/messages/en-US.json +5 -0
  17. package/templates/apps/admin/messages/zh-CN.json +5 -0
  18. package/templates/apps/admin/src/routes/+layout.svelte.hbs +5 -5
  19. package/templates/apps/admin/src/routes/+page.svelte.hbs +32 -12
  20. package/templates/apps/admin/src/routes/admin/+layout.svelte.hbs +37 -20
  21. package/templates/apps/admin/src/routes/admin/+page.svelte.hbs +33 -24
  22. package/templates/apps/admin/src/routes/admin/settings/+page.svelte.hbs +16 -13
  23. package/templates/apps/api/apps/{{projectName}}-contract/README.md.hbs +16 -0
  24. package/templates/apps/api/apps/{{projectName}}-contract/package.json.hbs +38 -0
  25. package/templates/apps/api/apps/{{projectName}}-contract/src/app-contract.ts.hbs +27 -0
  26. package/templates/apps/api/apps/{{projectName}}-contract/src/app-schemas.ts.hbs +33 -0
  27. package/templates/apps/api/apps/{{projectName}}-contract/src/index.ts.hbs +3 -0
  28. package/templates/apps/api/apps/{{projectName}}-contract/src/{{projectName}}-contract.ts.hbs +12 -0
  29. package/templates/apps/api/apps/{{projectName}}-contract/tests/contract.test.ts.hbs +18 -0
  30. package/templates/apps/api/apps/{{projectName}}-contract/tsconfig.json.hbs +12 -0
  31. package/templates/apps/api/apps/{{projectName}}-contract/tsup.config.ts.hbs +11 -0
  32. package/templates/apps/api/apps/{{projectName}}-contract/vitest.config.ts.hbs +9 -0
  33. package/templates/apps/api/apps/{{projectName}}-service/README.md.hbs +17 -0
  34. package/templates/apps/api/apps/{{projectName}}-service/config/_core.yml.hbs +19 -0
  35. package/templates/apps/api/apps/{{projectName}}-service/config/_serv.yml.hbs +26 -0
  36. package/templates/apps/api/apps/{{projectName}}-service/package.json.hbs +55 -0
  37. package/templates/apps/api/apps/{{projectName}}-service/src/app.ts.hbs +98 -0
  38. package/templates/apps/api/apps/{{projectName}}-service/src/index.ts.hbs +21 -0
  39. package/templates/apps/api/apps/{{projectName}}-service/src/lib/server/init.ts.hbs +184 -0
  40. package/templates/apps/api/apps/{{projectName}}-service/src/server/procedures/app-procedures.ts.hbs +49 -0
  41. package/templates/apps/api/apps/{{projectName}}-service/src/server/procedures/index.ts.hbs +18 -0
  42. package/templates/apps/api/apps/{{projectName}}-service/tests/service.test.ts.hbs +168 -0
  43. package/templates/apps/api/apps/{{projectName}}-service/tsconfig.json.hbs +16 -0
  44. package/templates/apps/api/apps/{{projectName}}-service/tsup.config.ts.hbs +11 -0
  45. package/templates/apps/api/apps/{{projectName}}-service/vitest.config.ts.hbs +9 -0
  46. package/templates/apps/api/e2e/api-service.spec.ts.hbs +18 -0
  47. package/templates/apps/api/eslint.config.js +32 -0
  48. package/templates/apps/api/package.json.hbs +29 -0
  49. package/templates/apps/api/playwright.config.ts.hbs +58 -0
  50. package/templates/apps/api/pnpm-workspace.yaml.hbs +14 -0
  51. package/templates/apps/api/tsconfig.base.json +15 -0
  52. package/templates/apps/fullstack/apps/{{projectName}}-app/.env.example.hbs +10 -0
  53. package/templates/apps/fullstack/apps/{{projectName}}-app/README.md.hbs +24 -7
  54. package/templates/apps/fullstack/apps/{{projectName}}-app/capacitor.config.ts.hbs +18 -0
  55. package/templates/apps/fullstack/apps/{{projectName}}-app/eslint.config.js.hbs +1 -1
  56. package/templates/apps/fullstack/apps/{{projectName}}-app/index.html.hbs +16 -0
  57. package/templates/apps/fullstack/apps/{{projectName}}-app/messages/en-US.json.hbs +6 -0
  58. package/templates/apps/fullstack/apps/{{projectName}}-app/messages/zh-CN.json.hbs +6 -0
  59. package/templates/apps/fullstack/apps/{{projectName}}-app/package.json.hbs +51 -29
  60. package/templates/apps/fullstack/apps/{{projectName}}-app/src/App.svelte.hbs +186 -0
  61. package/templates/apps/fullstack/apps/{{projectName}}-app/src/app.css.hbs +2 -0
  62. package/templates/apps/fullstack/apps/{{projectName}}-app/src/app.d.ts.hbs +0 -1
  63. package/templates/apps/fullstack/apps/{{projectName}}-app/src/lib/capacitor.ts.hbs +18 -0
  64. package/templates/apps/fullstack/apps/{{projectName}}-app/src/main.ts.hbs +14 -0
  65. package/templates/apps/fullstack/apps/{{projectName}}-app/svelte.config.js.hbs +1 -5
  66. package/templates/apps/fullstack/apps/{{projectName}}-app/tsconfig.json.hbs +10 -4
  67. package/templates/apps/fullstack/apps/{{projectName}}-app/vite.config.ts.hbs +4 -3
  68. package/templates/apps/fullstack/apps/{{projectName}}-desktop/.env.example.hbs +6 -0
  69. package/templates/apps/fullstack/apps/{{projectName}}-desktop/README.md.hbs +20 -6
  70. package/templates/apps/fullstack/apps/{{projectName}}-desktop/eslint.config.js.hbs +1 -1
  71. package/templates/apps/fullstack/apps/{{projectName}}-desktop/index.html.hbs +15 -0
  72. package/templates/apps/fullstack/apps/{{projectName}}-desktop/package.json.hbs +33 -30
  73. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src/App.svelte.hbs +152 -0
  74. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src/app.d.ts.hbs +1 -2
  75. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src/main.ts.hbs +13 -0
  76. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src-tauri/Cargo.toml.hbs +22 -0
  77. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src-tauri/build.rs.hbs +6 -0
  78. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src-tauri/capabilities/default.json.hbs +12 -0
  79. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src-tauri/icons/128x128.png +0 -0
  80. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src-tauri/icons/128x128@2x.png +0 -0
  81. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src-tauri/icons/32x32.png +0 -0
  82. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src-tauri/icons/icon.icns +0 -0
  83. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src-tauri/icons/icon.ico +0 -0
  84. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src-tauri/src/lib.rs.hbs +16 -0
  85. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src-tauri/src/main.rs.hbs +8 -0
  86. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src-tauri/tauri.conf.json.hbs +41 -0
  87. package/templates/apps/fullstack/apps/{{projectName}}-desktop/svelte.config.js.hbs +2 -8
  88. package/templates/apps/fullstack/apps/{{projectName}}-desktop/tsconfig.json.hbs +9 -4
  89. package/templates/apps/fullstack/apps/{{projectName}}-desktop/vite.config.ts.hbs +44 -21
  90. package/templates/apps/fullstack/apps/{{projectName}}-web/README.md.hbs +15 -6
  91. package/templates/apps/fullstack/apps/{{projectName}}-web/eslint.config.js.hbs +1 -1
  92. package/templates/apps/fullstack/apps/{{projectName}}-web/index.html.hbs +15 -0
  93. package/templates/apps/fullstack/apps/{{projectName}}-web/package.json.hbs +25 -27
  94. package/templates/apps/fullstack/apps/{{projectName}}-web/src/App.svelte.hbs +153 -0
  95. package/templates/apps/fullstack/apps/{{projectName}}-web/src/app.d.ts.hbs +0 -1
  96. package/templates/apps/fullstack/apps/{{projectName}}-web/src/main.ts.hbs +14 -0
  97. package/templates/apps/fullstack/apps/{{projectName}}-web/svelte.config.js.hbs +1 -5
  98. package/templates/apps/fullstack/apps/{{projectName}}-web/tsconfig.json.hbs +10 -4
  99. package/templates/apps/fullstack/apps/{{projectName}}-web/vite.config.ts.hbs +3 -2
  100. package/templates/apps/fullstack/e2e/fullstack.spec.ts.hbs +2 -1
  101. package/templates/apps/fullstack/eslint.config.js +0 -1
  102. package/templates/apps/fullstack/package.json.hbs +18 -17
  103. package/templates/apps/fullstack/packages/{{projectName}}-contract/package.json.hbs +3 -3
  104. package/templates/apps/fullstack/packages/{{projectName}}-serv/README.md.hbs +5 -2
  105. package/templates/apps/fullstack/packages/{{projectName}}-serv/config/_core.yml.hbs +14 -0
  106. package/templates/apps/fullstack/packages/{{projectName}}-serv/config/_serv.yml.hbs +13 -0
  107. package/templates/apps/fullstack/packages/{{projectName}}-serv/package.json.hbs +2 -2
  108. package/templates/apps/fullstack/packages/{{projectName}}-serv/src/{server-app.ts.hbs → app-server.ts.hbs} +23 -3
  109. package/templates/apps/fullstack/packages/{{projectName}}-serv/src/index.ts.hbs +4 -1
  110. package/templates/apps/fullstack/packages/{{projectName}}-serv/tests/{server-app.test.ts.hbs → app-server.test.ts.hbs} +1 -1
  111. package/templates/apps/fullstack/packages/{{projectName}}-shared/package.json.hbs +9 -8
  112. package/templates/apps/fullstack/packages/{{projectName}}-shared/src/index.ts.hbs +1 -1
  113. package/templates/apps/fullstack/packages/{{projectName}}-shared/src/lib/api/api-client.ts.hbs +5 -1
  114. package/templates/apps/fullstack/packages/{{projectName}}-shared/src/lib/components/ThemeSwitcher.svelte.hbs +1 -1
  115. package/templates/apps/fullstack/packages/{{projectName}}-shared/tsconfig.json.hbs +1 -1
  116. package/templates/apps/fullstack/playwright.config.ts.hbs +41 -4
  117. package/templates/apps/fullstack/pnpm-workspace.yaml.hbs +15 -0
  118. package/templates/apps/h5/messages/en-US.json +3 -0
  119. package/templates/apps/h5/messages/zh-CN.json +3 -0
  120. package/templates/apps/h5/src/routes/+layout.svelte.hbs +30 -29
  121. package/templates/apps/h5/src/routes/+page.svelte.hbs +17 -6
  122. package/templates/apps/h5/src/routes/discover/+page.svelte.hbs +17 -6
  123. package/templates/apps/h5/src/routes/profile/+page.svelte.hbs +17 -6
  124. package/templates/apps/mobile-app/.env.hbs +3 -0
  125. package/templates/apps/{android-app → mobile-app}/capacitor.config.ts.hbs +2 -2
  126. package/templates/apps/mobile-app/index.html.hbs +13 -0
  127. package/templates/apps/mobile-app/messages/en-US.json +36 -0
  128. package/templates/apps/mobile-app/messages/zh-CN.json +36 -0
  129. package/templates/apps/mobile-app/src/App.svelte.hbs +162 -0
  130. package/templates/apps/mobile-app/src/lib/api.ts.hbs +54 -0
  131. package/templates/apps/{android-app → mobile-app}/src/lib/capacitor.ts +6 -7
  132. package/templates/apps/mobile-app/src/main.ts.hbs +11 -0
  133. package/templates/apps/website/src/routes/+layout.svelte.hbs +35 -26
  134. package/templates/apps/website/src/routes/+page.svelte.hbs +28 -10
  135. package/templates/apps/website/src/routes/about/+page.svelte.hbs +11 -6
  136. package/templates/apps/website/src/routes/contact/+page.svelte.hbs +37 -34
  137. package/templates/apps/website/src/routes/services/+page.svelte.hbs +27 -40
  138. package/templates/base/.gitignore.hbs +16 -0
  139. package/templates/base/{eslint.config.js → eslint.config.js.hbs} +4 -1
  140. package/templates/base/package.json.hbs +55 -31
  141. package/templates/base/playwright.config.ts +30 -3
  142. package/templates/base/pnpm-workspace.yaml.hbs +14 -0
  143. package/templates/base/src/app.d.ts.hbs +3 -0
  144. package/templates/base/src/app.html.hbs +7 -0
  145. package/templates/base/src/hooks.server.ts.hbs +17 -7
  146. package/templates/base/src/lib/server/init.ts.hbs +20 -12
  147. package/templates/base/static/favicon.png +0 -0
  148. package/templates/base/svelte.config.js.hbs +43 -3
  149. package/templates/base/tests/scaffold.test.ts.hbs +16 -1
  150. package/templates/base/tsconfig.json.hbs +50 -0
  151. package/templates/base/vite.config.ts.hbs +13 -3
  152. package/templates/features/iam/routes-admin/(auth)/+layout.svelte.hbs +5 -5
  153. package/templates/features/iam/routes-admin/(auth)/auth/login/+page.svelte.hbs +34 -32
  154. package/templates/features/iam/routes-admin/(auth)/auth/register/+page.svelte.hbs +46 -48
  155. package/templates/features/iam/routes-h5/auth/login/+page.svelte.hbs +35 -31
  156. package/templates/features/iam/routes-h5/auth/register/+page.svelte.hbs +41 -38
  157. package/templates/skills/AGENTS.md +60 -17
  158. package/templates/skills/CLAUDE.md +18 -6
  159. package/templates/skills/bridges/admin/AGENTS.md +66 -0
  160. package/templates/skills/bridges/admin/CLAUDE.md +19 -0
  161. package/templates/skills/bridges/admin/copilot-instructions.md +46 -0
  162. package/templates/skills/bridges/api/AGENTS.md +65 -0
  163. package/templates/skills/bridges/api/CLAUDE.md +19 -0
  164. package/templates/skills/bridges/api/copilot-instructions.md +46 -0
  165. package/templates/skills/bridges/fullstack/AGENTS.md +84 -0
  166. package/templates/skills/bridges/fullstack/CLAUDE.md +19 -0
  167. package/templates/skills/bridges/fullstack/copilot-instructions.md +54 -0
  168. package/templates/skills/bridges/h5/AGENTS.md +65 -0
  169. package/templates/skills/bridges/h5/CLAUDE.md +19 -0
  170. package/templates/skills/bridges/h5/copilot-instructions.md +44 -0
  171. package/templates/skills/bridges/mobile-app/AGENTS.md +77 -0
  172. package/templates/skills/bridges/mobile-app/CLAUDE.md +19 -0
  173. package/templates/skills/bridges/mobile-app/copilot-instructions.md +45 -0
  174. package/templates/skills/bridges/website/AGENTS.md +65 -0
  175. package/templates/skills/bridges/website/CLAUDE.md +19 -0
  176. package/templates/skills/bridges/website/copilot-instructions.md +44 -0
  177. package/templates/skills/copilot-instructions.md +29 -50
  178. package/templates/skills/hai-ai/SKILL.md +115 -648
  179. package/templates/skills/hai-ai/reference.md +197 -0
  180. package/templates/skills/hai-api-client/SKILL.md +3 -1
  181. package/templates/skills/hai-app-create/SKILL.md +2 -1
  182. package/templates/skills/hai-app-review/SKILL.md +2 -2
  183. package/templates/skills/hai-app-tests/SKILL.md +28 -3
  184. package/templates/skills/hai-capacitor/SKILL.md +14 -22
  185. package/templates/skills/hai-deploy/SKILL.md +12 -9
  186. package/templates/skills/hai-kit/SKILL.md +5 -3
  187. package/templates/skills/hai-serv/SKILL.md +2 -0
  188. package/templates/skills/hai-ui/SKILL.md +25 -11
  189. package/templates/skills/opencode.json +1 -6
  190. package/dist/chunk-BPO34NRL.js.map +0 -1
  191. package/dist/chunk-GSMXGUYF.js.map +0 -1
  192. package/dist/cli-config-templates-JCS7T3NU.js +0 -5
  193. package/dist/cli-skill-templates-IMYZPQRG.js +0 -5
  194. package/dist/src-N4NPS7AG.js.map +0 -1
  195. package/templates/apps/android-app/.env.hbs +0 -3
  196. package/templates/apps/android-app/messages/en-US.json +0 -24
  197. package/templates/apps/android-app/messages/zh-CN.json +0 -24
  198. package/templates/apps/android-app/src/lib/api.ts.hbs +0 -31
  199. package/templates/apps/android-app/src/routes/+layout.svelte.hbs +0 -42
  200. package/templates/apps/android-app/src/routes/+layout.ts +0 -7
  201. package/templates/apps/android-app/src/routes/+page.svelte.hbs +0 -27
  202. package/templates/apps/api/src/routes/+layout.svelte +0 -14
  203. package/templates/apps/api/src/routes/+page.svelte +0 -11
  204. package/templates/apps/api/src/routes/api/v1/health/+server.ts +0 -14
  205. package/templates/apps/api/src/routes/api/v1/items/+server.ts +0 -37
  206. package/templates/apps/api/src/routes/api/v1/items/[id]/+server.ts +0 -30
  207. package/templates/apps/api/tests/health.test.ts.hbs +0 -26
  208. package/templates/apps/fullstack/apps/{{projectName}}-app/src/app.html.hbs +0 -14
  209. package/templates/apps/fullstack/apps/{{projectName}}-app/src/routes/+layout.svelte.hbs +0 -18
  210. package/templates/apps/fullstack/apps/{{projectName}}-app/src/routes/+page.svelte.hbs +0 -162
  211. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src/app.html.hbs +0 -14
  212. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src/routes/+layout.svelte.hbs +0 -18
  213. package/templates/apps/fullstack/apps/{{projectName}}-desktop/src/routes/+page.svelte.hbs +0 -162
  214. package/templates/apps/fullstack/apps/{{projectName}}-web/src/app.html.hbs +0 -14
  215. package/templates/apps/fullstack/apps/{{projectName}}-web/src/routes/+layout.svelte.hbs +0 -18
  216. package/templates/apps/fullstack/apps/{{projectName}}-web/src/routes/+page.svelte.hbs +0 -162
  217. package/templates/apps/fullstack/pnpm-workspace.yaml +0 -7
  218. package/templates/base/tsconfig.json +0 -20
  219. /package/templates/apps/fullstack/packages/{{projectName}}-shared/src/lib/stores/{theme.svelte.ts.hbs → theme-store.svelte.ts.hbs} +0 -0
@@ -1,10 +1,25 @@
1
1
  {{!-- 服务页面 --}}
2
- <script lang="ts">
2
+ <script lang='ts'>
3
3
  /**
4
4
  * 服务页面
5
5
  */
6
6
  {{#if hasI18n}}
7
7
  import * as m from '$lib/paraglide/messages'
8
+ {{/if}}
9
+ import { Card, PageHeader } from '@h-ai/ui'
10
+
11
+ {{#if hasI18n}}
12
+ const services = $derived([
13
+ { title: m.page_services_item1(), desc: m.page_services_desc(), icon: 'icon-[tabler--message-circle]' },
14
+ { title: m.page_services_item2(), desc: m.page_services_desc(), icon: 'icon-[tabler--code]' },
15
+ { title: m.page_services_item1(), desc: m.page_services_desc(), icon: 'icon-[tabler--server-cog]' },
16
+ ])
17
+ {{else}}
18
+ const services = [
19
+ { title: '咨询服务', desc: '提供专业的技术咨询与解决方案。', icon: 'icon-[tabler--message-circle]' },
20
+ { title: '定制开发', desc: '根据需求定制开发高质量应用。', icon: 'icon-[tabler--code]' },
21
+ { title: '运维支持', desc: '提供全方位的系统运维与技术支持。', icon: 'icon-[tabler--server-cog]' },
22
+ ]
8
23
  {{/if}}
9
24
  </script>
10
25
 
@@ -16,48 +31,20 @@
16
31
  {{/if}}
17
32
  </svelte:head>
18
33
 
19
- <section class="py-16 px-4 max-w-4xl mx-auto">
34
+ <section class='py-16 px-4 max-w-4xl mx-auto'>
20
35
  {{#if hasI18n}}
21
- <h1 class="text-3xl font-bold mb-8">{m.page_services_title()}</h1>
22
- <p class="text-lg text-gray-600 mb-12">{m.page_services_desc()}</p>
36
+ <PageHeader title={m.page_services_title()} description={m.page_services_desc()} />
23
37
  {{else}}
24
- <h1 class="text-3xl font-bold mb-8">我们的服务</h1>
25
- <p class="text-lg text-gray-600 mb-12">我们提供以下专业服务。</p>
38
+ <PageHeader title='我们的服务' description='我们提供以下专业服务。' />
26
39
  {{/if}}
27
40
 
28
- <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
29
- <div class="card bg-base-100 shadow">
30
- <div class="card-body">
31
- {{#if hasI18n}}
32
- <h2 class="card-title">{m.page_services_item1()}</h2>
33
- <p>{m.page_services_desc()}</p>
34
- {{else}}
35
- <h2 class="card-title">咨询服务</h2>
36
- <p>提供专业的技术咨询与解决方案。</p>
37
- {{/if}}
38
- </div>
39
- </div>
40
- <div class="card bg-base-100 shadow">
41
- <div class="card-body">
42
- {{#if hasI18n}}
43
- <h2 class="card-title">{m.page_services_item2()}</h2>
44
- <p>{m.page_services_desc()}</p>
45
- {{else}}
46
- <h2 class="card-title">定制开发</h2>
47
- <p>根据需求定制开发高质量应用。</p>
48
- {{/if}}
49
- </div>
50
- </div>
51
- <div class="card bg-base-100 shadow">
52
- <div class="card-body">
53
- {{#if hasI18n}}
54
- <h2 class="card-title">{m.page_services_item1()}</h2>
55
- <p>{m.page_services_desc()}</p>
56
- {{else}}
57
- <h2 class="card-title">运维支持</h2>
58
- <p>提供全方位的系统运维与技术支持。</p>
59
- {{/if}}
60
- </div>
61
- </div>
41
+ <div class='grid grid-cols-1 md:grid-cols-3 gap-6'>
42
+ {#each services as service (service.title)}
43
+ <Card shadow='sm' class='bg-base-100'>
44
+ <span class='{service.icon} size-8 text-primary'></span>
45
+ <h2 class='mt-3 text-lg font-semibold'>{service.title}</h2>
46
+ <p class='mt-1 text-sm text-base-content/60'>{service.desc}</p>
47
+ </Card>
48
+ {/each}
62
49
  </div>
63
50
  </section>
@@ -0,0 +1,16 @@
1
+ node_modules
2
+ {{#unless isSvelteOnlyApp}}
3
+ .svelte-kit
4
+ {{/unless}}
5
+ build
6
+ dist
7
+ android
8
+ ios
9
+ .env
10
+ .env.*
11
+ !.env.example
12
+ *.log
13
+ .DS_Store
14
+ test-results/
15
+ playwright-report/
16
+ data/
@@ -9,8 +9,11 @@ import antfu from '@antfu/eslint-config'
9
9
  export default antfu({
10
10
  formatters: true,
11
11
  ignores: [
12
+ {{#unless isSvelteOnlyApp}}
12
13
  '**/.svelte-kit/**',
14
+ {{/unless}}
13
15
  '**/build/**',
16
+ '**/dist/**',
14
17
  '**/*.d.ts',
15
18
  '**/project.inlang/**',
16
19
  '**/paraglide/**',
@@ -29,4 +32,4 @@ export default antfu({
29
32
  'no-console': 'error',
30
33
  'ts/no-explicit-any': 'error',
31
34
  },
32
- })
35
+ })
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "{{projectName}}",
3
- "version": "0.1.0-alpha.19",
3
+ "version": "0.1.0-alpha.21",
4
4
  "private": true,
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 'android-app'}}Android app built with hai Agent Framework{{/if_eq}}",
6
- "keywords": ["hai", "sveltekit", "svelte5", "{{appType}}"],
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
+ "keywords": ["hai", {{#unless isSvelteOnlyApp}}"sveltekit", {{/unless}}"svelte5", "{{appType}}"],
7
7
  "license": "Apache-2.0",
8
8
  "type": "module",
9
9
  "scripts": {
@@ -11,49 +11,72 @@
11
11
  "paraglide:compile": "paraglide-js compile --project ./project.inlang --outdir ./src/lib/paraglide",
12
12
  {{/if}}
13
13
  "dev": "vite dev",
14
- "build": "vite build",
14
+ "build": "{{#if hasI18n}}pnpm paraglide:compile && {{/if}}vite build",
15
15
  "preview": "vite preview",
16
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
17
- "typecheck": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
16
+ "check": "{{#if hasI18n}}pnpm paraglide:compile && {{/if}}{{#if isSvelteOnlyApp}}svelte-check --tsconfig ./tsconfig.json{{else}}svelte-kit sync && svelte-check --tsconfig ./tsconfig.json{{/if}}",
17
+ "typecheck": "{{#if hasI18n}}pnpm paraglide:compile && {{/if}}{{#if isSvelteOnlyApp}}svelte-check --tsconfig ./tsconfig.json{{else}}svelte-kit sync && svelte-check --tsconfig ./tsconfig.json{{/if}}",
18
18
  "lint": "eslint .",
19
- "test": "vitest run",
19
+ "test": "{{#if hasI18n}}pnpm paraglide:compile && {{/if}}vitest run",
20
20
  "test:watch": "vitest",
21
21
  "test:e2e": "playwright test",
22
- "clean": "rimraf .svelte-kit build .turbo"
22
+ "clean": "{{#if isSvelteOnlyApp}}rimraf dist build android ios .turbo src/lib/paraglide{{else}}rimraf .svelte-kit build .turbo{{/if}}"{{#if isCapacitorApp}},
23
+ "cap:add:android": "cap add android",
24
+ "cap:add:ios": "cap add ios",
25
+ "cap:sync": "pnpm build && cap sync",
26
+ "cap:sync:android": "pnpm build && cap sync android",
27
+ "cap:sync:ios": "pnpm build && cap sync ios",
28
+ "cap:android": "cap open android",
29
+ "cap:ios": "cap open ios",
30
+ "cap:run:android": "cap run android",
31
+ "cap:run:ios": "cap run ios",
32
+ "cap:build:android:debug": "pnpm build && cap sync android && cd android && gradlew.bat assembleDebug",
33
+ "cap:build:android:release": "pnpm build && cap sync android && cap build android --androidreleasetype APK",
34
+ "cap:build:ios": "pnpm build && cap sync ios && cap build ios"{{/if}}
23
35
  },
24
36
  "dependencies": {
25
- "@h-ai/core": "^0.1.0-alpha.19",
26
- "@h-ai/kit": "^0.1.0-alpha.19"{{#if hasUi}},
27
- "@h-ai/ui": "^0.1.0-alpha.19"{{/if}}{{#if features.db}},
28
- "@h-ai/reldb": "^0.1.0-alpha.19"{{/if}}{{#if features.cache}},
29
- "@h-ai/cache": "^0.1.0-alpha.19"{{/if}}{{#if features.iam}},
30
- "@h-ai/iam": "^0.1.0-alpha.19"{{/if}}{{#if features.crypto}},
31
- "@h-ai/crypto": "^0.1.0-alpha.19"{{/if}}{{#if features.storage}},
32
- "@h-ai/storage": "^0.1.0-alpha.19"{{/if}}{{#if features.ai}},
33
- "@h-ai/ai": "^0.1.0-alpha.19"{{/if}}{{#if features.audit}},
34
- "@h-ai/audit": "^0.1.0-alpha.19"{{/if}}{{#if features.reach}},
35
- "@h-ai/reach": "^0.1.0-alpha.19"{{/if}}{{#if features.payment}},
36
- "@h-ai/payment": "^0.1.0-alpha.19"{{/if}}{{#if features.vecdb}},
37
- "@h-ai/vecdb": "^0.1.0-alpha.19"{{/if}}{{#if features.datapipe}},
38
- "@h-ai/datapipe": "^0.1.0-alpha.19"{{/if}}{{#if features.scheduler}},
39
- "@h-ai/scheduler": "^0.1.0-alpha.19"{{/if}}{{#if features.deploy}},
40
- "@h-ai/deploy": "^0.1.0-alpha.19"{{/if}}{{#if features.api-client}},
41
- "@h-ai/api-client": "^0.1.0-alpha.19"{{/if}}{{#if features.capacitor}},
42
- "@h-ai/capacitor": "^0.1.0-alpha.19"{{/if}}{{#if isCapacitorApp}}{{#unless features.api-client}},
43
- "@h-ai/api-client": "^0.1.0-alpha.19"{{/unless}}{{#unless features.capacitor}},
44
- "@h-ai/capacitor": "^0.1.0-alpha.19"{{/unless}}{{/if}},
37
+ {{#if isSvelteOnlyApp}}
38
+ "@h-ai/api-client": "{{haiPackageSpecifier}}",
39
+ "@h-ai/capacitor": "{{haiPackageSpecifier}}",
40
+ "@h-ai/ui": "{{haiPackageSpecifier}}"
41
+ {{else}}
42
+ "@h-ai/core": "{{haiPackageSpecifier}}",
43
+ "@h-ai/kit": "{{haiPackageSpecifier}}"{{#if hasUi}},
44
+ "@h-ai/ui": "{{haiPackageSpecifier}}"{{/if}}{{#if features.db}},
45
+ "@h-ai/reldb": "{{haiPackageSpecifier}}"{{/if}}{{#if features.cache}},
46
+ "@h-ai/cache": "{{haiPackageSpecifier}}"{{/if}}{{#if features.iam}},
47
+ "@h-ai/iam": "{{haiPackageSpecifier}}"{{/if}}{{#if features.crypto}},
48
+ "@h-ai/crypto": "{{haiPackageSpecifier}}"{{/if}}{{#if features.storage}},
49
+ "@h-ai/storage": "{{haiPackageSpecifier}}"{{/if}}{{#if features.ai}},
50
+ "@h-ai/ai": "{{haiPackageSpecifier}}"{{/if}}{{#if features.audit}},
51
+ "@h-ai/audit": "{{haiPackageSpecifier}}"{{/if}}{{#if features.reach}},
52
+ "@h-ai/reach": "{{haiPackageSpecifier}}"{{/if}}{{#if features.payment}},
53
+ "@h-ai/payment": "{{haiPackageSpecifier}}"{{/if}}{{#if features.vecdb}},
54
+ "@h-ai/vecdb": "{{haiPackageSpecifier}}"{{/if}}{{#if features.datapipe}},
55
+ "@h-ai/datapipe": "{{haiPackageSpecifier}}"{{/if}}{{#if features.scheduler}},
56
+ "@h-ai/scheduler": "{{haiPackageSpecifier}}"{{/if}}{{#if features.deploy}},
57
+ "@h-ai/deploy": "{{haiPackageSpecifier}}"{{/if}}{{#if features.api-client}},
58
+ "@h-ai/api-client": "{{haiPackageSpecifier}}"{{/if}}{{#if features.capacitor}},
59
+ "@h-ai/capacitor": "{{haiPackageSpecifier}}"{{/if}}{{#if isCapacitorApp}}{{#unless features.api-client}},
60
+ "@h-ai/api-client": "{{haiPackageSpecifier}}"{{/unless}}{{#unless features.capacitor}},
61
+ "@h-ai/capacitor": "{{haiPackageSpecifier}}"{{/unless}}{{/if}},
45
62
  "zod": "^4.4.3"
63
+ {{/if}}
46
64
  },
47
65
  "devDependencies": {
48
66
  "@antfu/eslint-config": "^9.0.0",
49
67
  "@playwright/test": "^1.60.0",
50
68
  {{#if isCapacitorApp}}
51
- "@aparajita/capacitor-secure-storage": "^8.0.0",
69
+ "@aparajita/capacitor-secure-storage": "^8.0.0",
70
+ "@capacitor/app": "^8.0.1",
71
+ "@capacitor/camera": "^8.0.1",
52
72
  "@capacitor/cli": "^8.3.4",
53
73
  "@capacitor/core": "^8.3.4",
54
74
  "@capacitor/android": "^8.3.4",
75
+ "@capacitor/device": "^8.0.1",
76
+ "@capacitor/ios": "^8.3.4",
55
77
  "@capacitor/preferences": "^8.0.1",
56
- "@sveltejs/adapter-static": "^3.0.10",
78
+ "@capacitor/push-notifications": "^8.0.1",
79
+ "@capacitor/status-bar": "^8.0.1",
57
80
  {{else}}
58
81
  {{#if_eq appType 'api'}}
59
82
  "@sveltejs/adapter-node": "^5.5.4",
@@ -61,13 +84,14 @@
61
84
  "@sveltejs/adapter-auto": "^7.0.1",
62
85
  {{/if_eq}}
63
86
  {{/if}}
87
+ {{#unless isSvelteOnlyApp}}
64
88
  "@sveltejs/kit": "^2.61.1",
89
+ {{/unless}}
65
90
  "@sveltejs/vite-plugin-svelte": "^7.1.2",
66
91
  "@types/node": "^25.9.1",
67
92
  "eslint": "^10.4.0",
68
93
  "eslint-plugin-format": "^2.0.1",
69
94
  "eslint-plugin-svelte": "^3.17.1",
70
- "pino-pretty": "^13.1.3",
71
95
  "rimraf": "^6.1.3",
72
96
  "svelte": "^5.55.9",
73
97
  "svelte-check": "^4.4.8",
@@ -1,7 +1,34 @@
1
1
  import process from 'node:process'
2
2
  import { defineConfig } from '@playwright/test'
3
3
 
4
- const baseURL = process.env.BASE_URL || 'http://localhost:4173'
4
+ const DEFAULT_BASE_URL = 'http://localhost:4173'
5
+ const baseURL = process.env.BASE_URL || DEFAULT_BASE_URL
6
+ const previewHost = resolveHostFromBaseUrl(baseURL, 'localhost')
7
+ const previewPort = resolvePortFromBaseUrl(baseURL, '4173')
8
+
9
+ function resolveHostFromBaseUrl(urlString: string, fallbackHost: string): string {
10
+ try {
11
+ const url = new URL(urlString)
12
+ return url.hostname || fallbackHost
13
+ }
14
+ catch {
15
+ return fallbackHost
16
+ }
17
+ }
18
+
19
+ function resolvePortFromBaseUrl(urlString: string, fallbackPort: string): string {
20
+ try {
21
+ const url = new URL(urlString)
22
+ if (url.port) {
23
+ return url.port
24
+ }
25
+
26
+ return url.protocol === 'https:' ? '443' : '80'
27
+ }
28
+ catch {
29
+ return fallbackPort
30
+ }
31
+ }
5
32
 
6
33
  /**
7
34
  * Playwright E2E 测试配置
@@ -23,8 +50,8 @@ export default defineConfig({
23
50
  },
24
51
 
25
52
  webServer: {
26
- command: 'pnpm build && pnpm preview --port 4173 --strictPort',
27
- env: { HAI_E2E: '1' },
53
+ command: `pnpm build && pnpm preview --host ${previewHost} --port ${previewPort} --strictPort`,
54
+ env: { HAI_E2E: '1', BASE_URL: baseURL },
28
55
  url: baseURL,
29
56
  reuseExistingServer: false,
30
57
  timeout: 180_000,
@@ -0,0 +1,14 @@
1
+ {{! @skipIfEmpty }}
2
+ {{#if useCatalogProtocol}}
3
+ shellEmulator: true
4
+
5
+ trustPolicy: no-downgrade
6
+
7
+ packages:
8
+ - .
9
+
10
+ catalog:
11
+ {{#each haiCatalogPackages}}
12
+ '{{@key}}': {{this}}
13
+ {{/each}}
14
+ {{/if}}
@@ -1,3 +1,5 @@
1
+ {{! @skipIfEmpty }}
2
+ {{#unless isSvelteOnlyApp}}
1
3
  /// <reference types="@sveltejs/kit" />
2
4
  {{#if hasUi}}
3
5
  import '@h-ai/ui/auto-import'
@@ -18,3 +20,4 @@ declare global {
18
20
  }
19
21
 
20
22
  export {}
23
+ {{/unless}}
@@ -1,6 +1,12 @@
1
+ {{! @skipIfEmpty }}
2
+ {{#unless isSvelteOnlyApp}}
1
3
  <!doctype html>
2
4
  {{#if hasI18n}}
5
+ {{#if isCapacitorApp}}
6
+ <html lang="{{defaultLocale}}">
7
+ {{else}}
3
8
  <html lang="%lang%">
9
+ {{/if}}
4
10
  {{else}}
5
11
  <html lang="{{defaultLocale}}">
6
12
  {{/if}}
@@ -20,3 +26,4 @@
20
26
  <div style="display: contents">%sveltekit.body%</div>
21
27
  </body>
22
28
  </html>
29
+ {{/unless}}
@@ -5,18 +5,18 @@
5
5
  */
6
6
 
7
7
  import type { Handle } from '@sveltejs/kit'
8
+ {{#if hasI18n}}
9
+ import { paraglideMiddleware } from '$lib/paraglide/server.js'
10
+ {{/if}}
8
11
  import { initApp } from '$lib/server/init.js'
9
12
  import { core } from '@h-ai/core'
10
- import { kit } from '@h-ai/kit'
11
- {{#if features.iam}}
12
- import { iam } from '@h-ai/iam'
13
- {{/if}}
14
13
  {{#if features.crypto}}
15
14
  import { crypto } from '@h-ai/crypto'
16
15
  {{/if}}
17
- {{#if hasI18n}}
18
- import { paraglideMiddleware } from '$lib/paraglide/server.js'
16
+ {{#if features.iam}}
17
+ import { iam } from '@h-ai/iam'
19
18
  {{/if}}
19
+ import { kit } from '@h-ai/kit'
20
20
 
21
21
  {{#if features.crypto}}
22
22
  // 初始化加密模块(同步)
@@ -85,7 +85,17 @@ const haiHandle = kit.createHandle({
85
85
  auth: {
86
86
  verifyToken: async (token) => {
87
87
  const result = await iam.auth.verifyToken(token)
88
- return result.success ? result.data : null
88
+ if (!result.success)
89
+ return null
90
+ const session = result.data
91
+ // 映射为 kit 的 SessionData 形态(携带守卫所需的核心字段)
92
+ return {
93
+ userId: session.userId,
94
+ username: session.username,
95
+ roles: session.roles,
96
+ permissions: session.permissions,
97
+ data: session.data,
98
+ }
89
99
  },
90
100
  operations: iam.auth,
91
101
  loginUrl: '/auth/login',
@@ -27,31 +27,39 @@
27
27
  {{/if}}
28
28
  */
29
29
 
30
- {{#if features.cache}}
31
- import { cache, CacheConfigSchema } from '@h-ai/cache'
32
- {{/if}}
33
- import { core } from '@h-ai/core'
34
- {{#if features.db}}
35
- import { reldb, ReldbConfigSchema } from '@h-ai/reldb'
30
+ {{#if features.ai}}
31
+ import type { AIConfigInput } from '@h-ai/ai'
36
32
  {{/if}}
37
33
  {{#if features.iam}}
38
34
  import type { IamConfigSettingsInput } from '@h-ai/iam'
39
- import { iam } from '@h-ai/iam'
35
+ {{/if}}
36
+ {{#if features.reach}}
37
+ import type { ReachConfigInput } from '@h-ai/reach'
40
38
  {{/if}}
41
39
  {{#if features.storage}}
42
40
  import type { StorageConfigInput } from '@h-ai/storage'
43
- import { storage, StorageConfigSchema } from '@h-ai/storage'
44
41
  {{/if}}
45
42
  {{#if features.ai}}
46
- import type { AIConfigInput } from '@h-ai/ai'
47
43
  import { ai } from '@h-ai/ai'
48
44
  {{/if}}
45
+ {{#if features.audit}}
46
+ import { audit } from '@h-ai/audit'
47
+ {{/if}}
48
+ {{#if features.cache}}
49
+ import { cache, CacheConfigSchema } from '@h-ai/cache'
50
+ {{/if}}
51
+ import { core } from '@h-ai/core'
52
+ {{#if features.iam}}
53
+ import { iam } from '@h-ai/iam'
54
+ {{/if}}
49
55
  {{#if features.reach}}
50
- import type { ReachConfigInput } from '@h-ai/reach'
51
56
  import { reach } from '@h-ai/reach'
52
57
  {{/if}}
53
- {{#if features.audit}}
54
- import { audit } from '@h-ai/audit'
58
+ {{#if features.db}}
59
+ import { reldb, ReldbConfigSchema } from '@h-ai/reldb'
60
+ {{/if}}
61
+ {{#if features.storage}}
62
+ import { storage, StorageConfigSchema } from '@h-ai/storage'
55
63
  {{/if}}
56
64
 
57
65
  {{#if features.db}}
@@ -1,10 +1,13 @@
1
1
  /**
2
2
  * Svelte 配置
3
3
  */
4
+ {{#unless isSvelteOnlyApp}}
4
5
  import process from 'node:process'
6
+ {{/unless}}
5
7
  {{#if hasUi}}
6
8
  import { autoImportHaiUi } from '@h-ai/ui/auto-import'
7
9
  {{/if}}
10
+ {{#unless isSvelteOnlyApp}}
8
11
  {{#if isCapacitorApp}}
9
12
  import adapter from '@sveltejs/adapter-static'
10
13
  {{else}}
@@ -14,8 +17,46 @@ import adapter from '@sveltejs/adapter-node'
14
17
  import adapter from '@sveltejs/adapter-auto'
15
18
  {{/if_eq}}
16
19
  {{/if}}
20
+ {{/unless}}
17
21
  import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
18
22
 
23
+ {{#if isSvelteOnlyApp}}
24
+ /** @type {import('@sveltejs/vite-plugin-svelte').SvelteConfig} */
25
+ const config = {
26
+ preprocess: [{{#if hasUi}}autoImportHaiUi(), {{/if}}vitePreprocess()],
27
+ compilerOptions: {
28
+ runes: true,
29
+ },
30
+ }
31
+ {{else}}
32
+ const DEFAULT_E2E_ORIGINS = ['http://localhost:4173', 'http://127.0.0.1:4173']
33
+
34
+ function resolveTrustedOrigins() {
35
+ if (process.env.HAI_E2E !== '1')
36
+ return []
37
+
38
+ const rawBaseUrl = process.env.BASE_URL ?? DEFAULT_E2E_ORIGINS[0]
39
+
40
+ try {
41
+ const url = new URL(rawBaseUrl)
42
+ const origins = new Set([url.origin])
43
+
44
+ if (url.hostname === 'localhost') {
45
+ url.hostname = '127.0.0.1'
46
+ origins.add(url.origin)
47
+ }
48
+ else if (url.hostname === '127.0.0.1') {
49
+ url.hostname = 'localhost'
50
+ origins.add(url.origin)
51
+ }
52
+
53
+ return [...origins]
54
+ }
55
+ catch {
56
+ return DEFAULT_E2E_ORIGINS
57
+ }
58
+ }
59
+
19
60
  /** @type {import('@sveltejs/kit').Config} */
20
61
  const config = {
21
62
  preprocess: [{{#if hasUi}}autoImportHaiUi(), {{/if}}vitePreprocess()],
@@ -33,9 +74,7 @@ const config = {
33
74
  adapter: adapter(),
34
75
  {{/if}}
35
76
  csrf: {
36
- trustedOrigins: process.env.HAI_E2E === '1'
37
- ? ['http://localhost:4173', 'http://127.0.0.1:4173']
38
- : [],
77
+ trustedOrigins: resolveTrustedOrigins(),
39
78
  },
40
79
  alias: {
41
80
  $components: './src/lib/components',
@@ -44,5 +83,6 @@ const config = {
44
83
  },
45
84
  },
46
85
  }
86
+ {{/if}}
47
87
 
48
88
  export default config
@@ -20,8 +20,23 @@ describe('generated scaffold', () => {
20
20
  expect(pkg.scripts['test:e2e']).toBeDefined()
21
21
  })
22
22
 
23
+ {{#if isSvelteOnlyApp}}
24
+ it('renders the Vite app shell entry', async () => {
25
+ const indexHtml = await readFile(join(rootDir, 'index.html'), 'utf-8')
26
+ expect(indexHtml).toContain('<div id="app"></div>')
27
+ })
28
+ {{else}}
23
29
  it('renders the app shell locale marker', async () => {
24
30
  const appHtml = await readFile(join(rootDir, 'src/app.html'), 'utf-8')
25
- expect(appHtml).toContain('lang="{{#if hasI18n}}%lang%{{else}}{{defaultLocale}}{{/if}}"')
31
+ expect(appHtml).toContain('lang="{{#if hasI18n}}{{#if isCapacitorApp}}{{defaultLocale}}{{else}}%lang%{{/if}}{{else}}{{defaultLocale}}{{/if}}"')
32
+ })
33
+ {{/if}}
34
+ {{#unless isCapacitorApp}}
35
+
36
+ it('ships an application config loaded at startup', async () => {
37
+ const coreConfig = await readFile(join(rootDir, 'config/_core.yml'), 'utf-8')
38
+ expect(coreConfig).toContain('name: {{projectName}}')
39
+ expect(coreConfig).toContain('defaultLocale: {{defaultLocale}}')
26
40
  })
41
+ {{/unless}}
27
42
  })
@@ -0,0 +1,50 @@
1
+ {{#if isSvelteOnlyApp}}
2
+ {
3
+ "$schema": "https://json.schemastore.org/tsconfig",
4
+ "compilerOptions": {
5
+ "target": "ES2022",
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "moduleDetection": "force",
8
+ "module": "ESNext",
9
+ "moduleResolution": "bundler",
10
+ "resolveJsonModule": true,
11
+ "types": ["svelte", "vite/client", "node", "vitest/globals"],
12
+ "allowJs": true,
13
+ "checkJs": false,
14
+ "strict": true,
15
+ "noEmit": true,
16
+ "isolatedModules": true,
17
+ "verbatimModuleSyntax": true,
18
+ "skipLibCheck": true
19
+ },
20
+ "include": [
21
+ "src/**/*.ts",
22
+ "src/**/*.svelte",
23
+ "tests/**/*.ts",
24
+ "vite.config.ts",
25
+ "svelte.config.js"
26
+ ],
27
+ "exclude": ["node_modules", "dist", "build", "android", "ios"]
28
+ }
29
+ {{else}}
30
+ {
31
+ "extends": "./.svelte-kit/tsconfig.json",
32
+ "compilerOptions": {
33
+ "moduleResolution": "bundler",
34
+ "allowImportingTsExtensions": true,
35
+ "allowJs": true,
36
+ "checkJs": false,
37
+ "strict": true,
38
+ "verbatimModuleSyntax": true,
39
+ "skipLibCheck": true
40
+ },
41
+ "include": [
42
+ "src/**/*",
43
+ "src/**/*.svelte"
44
+ ],
45
+ "exclude": [
46
+ "node_modules",
47
+ ".svelte-kit"
48
+ ]
49
+ }
50
+ {{/if}}
@@ -3,13 +3,17 @@
3
3
  */
4
4
  import path from 'node:path'
5
5
  import process from 'node:process'
6
+ {{#if hasI18n}}
7
+ import { paraglideVitePlugin } from '@inlang/paraglide-js'
8
+ {{/if}}
9
+ {{#if isSvelteOnlyApp}}
10
+ import { svelte } from '@sveltejs/vite-plugin-svelte'
11
+ {{else}}
6
12
  import { sveltekit } from '@sveltejs/kit/vite'
13
+ {{/if}}
7
14
  {{#if hasUi}}
8
15
  import tailwindcss from '@tailwindcss/vite'
9
16
  {{/if}}
10
- {{#if hasI18n}}
11
- import { paraglideVitePlugin } from '@inlang/paraglide-js'
12
- {{/if}}
13
17
  import { defineConfig, loadEnv } from 'vite'
14
18
 
15
19
  export default defineConfig(({ mode }) => {
@@ -18,7 +22,11 @@ export default defineConfig(({ mode }) => {
18
22
 
19
23
  return {
20
24
  plugins: [
25
+ {{#if isSvelteOnlyApp}}
26
+ svelte(),
27
+ {{else}}
21
28
  sveltekit(),
29
+ {{/if}}
22
30
  {{#if hasUi}}
23
31
  tailwindcss(),
24
32
  {{/if}}
@@ -35,9 +43,11 @@ export default defineConfig(({ mode }) => {
35
43
  exclude: ['bits-ui'],
36
44
  },
37
45
  {{/if}}
46
+ {{#unless isSvelteOnlyApp}}
38
47
  ssr: {
39
48
  noExternal: [/@h-ai\//],
40
49
  },
50
+ {{/unless}}
41
51
  server: {
42
52
  fs: {
43
53
  allow: [path.resolve(process.cwd())],