@h-ai/cli 0.1.0-alpha.16 → 0.1.0-alpha.19
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/dist/{chunk-LANIDJC7.js → chunk-BPO34NRL.js} +3 -3
- package/dist/chunk-BPO34NRL.js.map +1 -0
- package/dist/{chunk-YV7WPUI6.js → chunk-GSMXGUYF.js} +6 -2
- package/dist/chunk-GSMXGUYF.js.map +1 -0
- package/dist/cli-config-templates-JCS7T3NU.js +5 -0
- package/dist/cli-config-templates-JCS7T3NU.js.map +1 -0
- package/dist/cli-skill-templates-IMYZPQRG.js +5 -0
- package/dist/cli-skill-templates-IMYZPQRG.js.map +1 -0
- package/dist/index.js +391 -58
- package/dist/index.js.map +1 -1
- package/dist/{src-RZ4DPYNJ.js → src-N4NPS7AG.js} +1239 -493
- package/dist/src-N4NPS7AG.js.map +1 -0
- package/package.json +8 -7
- package/templates/README.md +10 -3
- package/templates/apps/android-app/src/lib/api.ts.hbs +1 -1
- package/templates/apps/api/tests/health.test.ts.hbs +26 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/README.md.hbs +21 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/eslint.config.js.hbs +23 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/messages/en-US.json.hbs +34 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/messages/zh-CN.json.hbs +34 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/package.json.hbs +50 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/project.inlang/settings.json.hbs +17 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/src/app.css.hbs +18 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/src/app.d.ts.hbs +9 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/src/app.html.hbs +14 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/src/routes/+layout.svelte.hbs +18 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/src/routes/+page.svelte.hbs +162 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/svelte.config.js.hbs +20 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/tests/api.test.ts.hbs +28 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/tsconfig.json.hbs +17 -0
- package/templates/apps/fullstack/apps/{{projectName}}-app/vite.config.ts.hbs +29 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/README.md.hbs +21 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/eslint.config.js.hbs +23 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/messages/en-US.json.hbs +34 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/messages/zh-CN.json.hbs +34 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/package.json.hbs +50 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/project.inlang/settings.json.hbs +17 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/src/app.css.hbs +18 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/src/app.d.ts.hbs +9 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/src/app.html.hbs +14 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/src/routes/+layout.svelte.hbs +18 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/src/routes/+page.svelte.hbs +162 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/svelte.config.js.hbs +20 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/tests/api.test.ts.hbs +28 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/tsconfig.json.hbs +17 -0
- package/templates/apps/fullstack/apps/{{projectName}}-desktop/vite.config.ts.hbs +29 -0
- package/templates/apps/fullstack/apps/{{projectName}}-miniapp/README.md.hbs +13 -0
- package/templates/apps/fullstack/apps/{{projectName}}-miniapp/messages/en-US.json.hbs +12 -0
- package/templates/apps/fullstack/apps/{{projectName}}-miniapp/messages/zh-CN.json.hbs +12 -0
- package/templates/apps/fullstack/apps/{{projectName}}-miniapp/project.inlang/settings.json.hbs +17 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/README.md.hbs +21 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/eslint.config.js.hbs +23 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/messages/en-US.json.hbs +34 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/messages/zh-CN.json.hbs +34 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/package.json.hbs +50 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/project.inlang/settings.json.hbs +17 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/src/app.css.hbs +18 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/src/app.d.ts.hbs +9 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/src/app.html.hbs +14 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/src/routes/+layout.svelte.hbs +18 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/src/routes/+page.svelte.hbs +162 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/svelte.config.js.hbs +20 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/tests/api.test.ts.hbs +28 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/tsconfig.json.hbs +17 -0
- package/templates/apps/fullstack/apps/{{projectName}}-web/vite.config.ts.hbs +29 -0
- package/templates/apps/fullstack/e2e/fullstack.spec.ts.hbs +30 -0
- package/templates/apps/fullstack/eslint.config.js +44 -0
- package/templates/apps/fullstack/package.json.hbs +42 -0
- package/templates/apps/fullstack/packages/{{projectName}}-contract/README.md.hbs +15 -0
- package/templates/apps/fullstack/packages/{{projectName}}-contract/package.json.hbs +27 -0
- package/templates/apps/fullstack/packages/{{projectName}}-contract/src/app-contract.ts.hbs +21 -0
- package/templates/apps/fullstack/packages/{{projectName}}-contract/src/app-routes.ts.hbs +27 -0
- package/templates/apps/fullstack/packages/{{projectName}}-contract/src/app-schemas.ts.hbs +34 -0
- package/templates/apps/fullstack/packages/{{projectName}}-contract/src/index.ts.hbs +4 -0
- package/templates/apps/fullstack/packages/{{projectName}}-contract/src/{{projectName}}-contract.ts.hbs +9 -0
- package/templates/apps/fullstack/packages/{{projectName}}-contract/tests/contract.test.ts.hbs +48 -0
- package/templates/apps/fullstack/packages/{{projectName}}-contract/tsconfig.json.hbs +9 -0
- package/templates/apps/fullstack/packages/{{projectName}}-contract/tsup.config.ts.hbs +9 -0
- package/templates/apps/fullstack/packages/{{projectName}}-serv/README.md.hbs +14 -0
- package/templates/apps/fullstack/packages/{{projectName}}-serv/package.json.hbs +29 -0
- package/templates/apps/fullstack/packages/{{projectName}}-serv/src/index.ts.hbs +15 -0
- package/templates/apps/fullstack/packages/{{projectName}}-serv/src/server/procedures/app-procedures.ts.hbs +38 -0
- package/templates/apps/fullstack/packages/{{projectName}}-serv/src/server/procedures/index.ts.hbs +13 -0
- package/templates/apps/fullstack/packages/{{projectName}}-serv/src/server-app.ts.hbs +42 -0
- package/templates/apps/fullstack/packages/{{projectName}}-serv/tests/server-app.test.ts.hbs +49 -0
- package/templates/apps/fullstack/packages/{{projectName}}-serv/tsconfig.json.hbs +10 -0
- package/templates/apps/fullstack/packages/{{projectName}}-serv/tsup.config.ts.hbs +9 -0
- package/templates/apps/fullstack/packages/{{projectName}}-shared/.gitignore.hbs +3 -0
- package/templates/apps/fullstack/packages/{{projectName}}-shared/README.md.hbs +39 -0
- package/templates/apps/fullstack/packages/{{projectName}}-shared/messages/en-US.json.hbs +24 -0
- package/templates/apps/fullstack/packages/{{projectName}}-shared/messages/zh-CN.json.hbs +24 -0
- package/templates/apps/fullstack/packages/{{projectName}}-shared/package.json.hbs +44 -0
- package/templates/apps/fullstack/packages/{{projectName}}-shared/project.inlang/settings.json.hbs +11 -0
- package/templates/apps/fullstack/packages/{{projectName}}-shared/src/index.ts.hbs +8 -0
- package/templates/apps/fullstack/packages/{{projectName}}-shared/src/lib/api/api-client.ts.hbs +49 -0
- package/templates/apps/fullstack/packages/{{projectName}}-shared/src/lib/components/AppShell.svelte.hbs +60 -0
- package/templates/apps/fullstack/packages/{{projectName}}-shared/src/lib/components/LanguageSwitcher.svelte.hbs +27 -0
- package/templates/apps/fullstack/packages/{{projectName}}-shared/src/lib/components/ThemeSwitcher.svelte.hbs +18 -0
- package/templates/apps/fullstack/packages/{{projectName}}-shared/src/lib/stores/theme.svelte.ts.hbs +55 -0
- package/templates/apps/fullstack/packages/{{projectName}}-shared/tsconfig.json.hbs +17 -0
- package/templates/apps/fullstack/playwright.config.ts.hbs +34 -0
- package/templates/apps/fullstack/pnpm-workspace.yaml +7 -0
- package/templates/apps/fullstack/tsconfig.base.json +15 -0
- package/templates/base/e2e/app.spec.ts.hbs +7 -0
- package/templates/base/eslint.config.js +6 -0
- package/templates/base/package.json.hbs +46 -39
- package/templates/base/src/app.css.hbs +1 -0
- package/templates/base/src/lib/server/init.ts.hbs +3 -3
- package/templates/base/tests/scaffold.test.ts.hbs +27 -0
- package/templates/features/payment/routes/api/v1/payment/create/+server.ts +15 -7
- package/templates/features/payment/routes/api/v1/payment/notify/[provider]/+server.ts +1 -2
- package/templates/skills/hai-ai/SKILL.md +2 -0
- package/templates/skills/hai-api-client/SKILL.md +4 -0
- package/templates/skills/hai-audit/SKILL.md +7 -2
- package/templates/skills/hai-cache/SKILL.md +2 -0
- package/templates/skills/hai-capacitor/SKILL.md +11 -9
- package/templates/skills/hai-core/SKILL.md +4 -1
- package/templates/skills/hai-crypto/SKILL.md +42 -8
- package/templates/skills/hai-iam/SKILL.md +2 -0
- package/templates/skills/hai-kit/SKILL.md +9 -2
- package/templates/skills/hai-payment/SKILL.md +5 -0
- package/templates/skills/hai-reach/SKILL.md +3 -1
- package/templates/skills/hai-reldb/SKILL.md +2 -0
- package/templates/skills/hai-scheduler/SKILL.md +2 -0
- package/templates/skills/hai-serv/SKILL.md +14 -9
- package/templates/skills/hai-storage/SKILL.md +10 -1
- package/templates/skills/hai-vecdb/SKILL.md +8 -1
- package/dist/chunk-LANIDJC7.js.map +0 -1
- package/dist/chunk-YV7WPUI6.js.map +0 -1
- package/dist/config-templates-S5RI2MC6.js +0 -5
- package/dist/config-templates-S5RI2MC6.js.map +0 -1
- package/dist/skill-templates-N5DU5FNX.js +0 -5
- package/dist/skill-templates-N5DU5FNX.js.map +0 -1
- package/dist/src-RZ4DPYNJ.js.map +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.desktop}}
|
|
3
|
+
import antfu from '@antfu/eslint-config'
|
|
4
|
+
|
|
5
|
+
export default antfu({
|
|
6
|
+
formatters: true,
|
|
7
|
+
ignores: ['**/.svelte-kit/**', '**/build/**', '**/dist/**', '**/*.d.ts', '**/project.inlang/**', '**/src/lib/paraglide/**'],
|
|
8
|
+
svelte: true,
|
|
9
|
+
}, {
|
|
10
|
+
files: ['**/*.ts', '**/*.svelte'],
|
|
11
|
+
rules: {
|
|
12
|
+
'no-console': 'error',
|
|
13
|
+
'ts/no-explicit-any': 'error',
|
|
14
|
+
},
|
|
15
|
+
}, {
|
|
16
|
+
files: ['**/*.svelte'],
|
|
17
|
+
rules: {
|
|
18
|
+
'svelte/html-quotes': 'off',
|
|
19
|
+
'svelte/indent': 'off',
|
|
20
|
+
'perfectionist/sort-imports': 'off',
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
{{/if}}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.desktop}}
|
|
3
|
+
{
|
|
4
|
+
"$schema": "https://inlang.com/schema/inlang-message-format",
|
|
5
|
+
"page_title": "{name} · Desktop",
|
|
6
|
+
"platform_name": "Desktop",
|
|
7
|
+
"hero_badge": "Desktop workspace",
|
|
8
|
+
"hero_title": "{name} Desktop Command Center",
|
|
9
|
+
"hero_subtitle": "A wide-screen desktop starter that can later integrate Tauri while reusing shared shell, theme, locale and API client capabilities.",
|
|
10
|
+
"hero_primary_action": "View service status",
|
|
11
|
+
"hero_secondary_action": "Customize the starter",
|
|
12
|
+
"preview_title": "Desktop productivity UI",
|
|
13
|
+
"preview_body": "Ready for command centers, tool workspaces and native-enhanced apps",
|
|
14
|
+
"preview_metric_shared": "Shared UI/API capabilities",
|
|
15
|
+
"preview_metric_local": "Desktop-owned messages",
|
|
16
|
+
"preview_metric_theme": "Configurable themes",
|
|
17
|
+
"status_title": "Service connectivity",
|
|
18
|
+
"status_description": "The desktop page calls the backend service to verify API contract, service and shared client wiring.",
|
|
19
|
+
"status_online": "{name} is connected",
|
|
20
|
+
"status_version": "Service version",
|
|
21
|
+
"status_started": "Started at: {time}",
|
|
22
|
+
"status_frontends": "Service frontends: {list}",
|
|
23
|
+
"status_frontends_count": "{count} frontend targets",
|
|
24
|
+
"custom_shared_title": "Shared owns common capabilities",
|
|
25
|
+
"custom_shared_body": "Common shell, theme, locale switching and API client live in packages/{{projectName}}-shared and are reused by Desktop.",
|
|
26
|
+
"custom_local_title": "Desktop owns desktop copy",
|
|
27
|
+
"custom_local_body": "Desktop-specific menus, states and feature descriptions live in apps/{{projectName}}-desktop/messages.",
|
|
28
|
+
"flow_title": "Collaboration boundary",
|
|
29
|
+
"flow_contract": "Contract locks API contracts",
|
|
30
|
+
"flow_service": "Service provides runtime capabilities",
|
|
31
|
+
"flow_shared": "Shared reuses cross-platform UI/API",
|
|
32
|
+
"flow_frontend": "Desktop composes the product experience"
|
|
33
|
+
}
|
|
34
|
+
{{/if}}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.desktop}}
|
|
3
|
+
{
|
|
4
|
+
"$schema": "https://inlang.com/schema/inlang-message-format",
|
|
5
|
+
"page_title": "{name} · Desktop",
|
|
6
|
+
"platform_name": "Desktop",
|
|
7
|
+
"hero_badge": "桌面端工作台",
|
|
8
|
+
"hero_title": "{name} Desktop 控制中心",
|
|
9
|
+
"hero_subtitle": "面向桌面端的大屏工作台样板,可后续接入 Tauri,同时复用 shared 的 Shell、主题、语言与 API 客户端。",
|
|
10
|
+
"hero_primary_action": "查看服务状态",
|
|
11
|
+
"hero_secondary_action": "了解如何自定义",
|
|
12
|
+
"preview_title": "桌面端生产力界面",
|
|
13
|
+
"preview_body": "适合控制中心、工具台与本地增强应用",
|
|
14
|
+
"preview_metric_shared": "共享 UI/API 能力",
|
|
15
|
+
"preview_metric_local": "Desktop 自有 messages",
|
|
16
|
+
"preview_metric_theme": "主题可配置",
|
|
17
|
+
"status_title": "服务联通状态",
|
|
18
|
+
"status_description": "桌面端页面会调用后端服务,确认 API contract、service 与 shared client 链路正常。",
|
|
19
|
+
"status_online": "{name} 已连接",
|
|
20
|
+
"status_version": "服务版本",
|
|
21
|
+
"status_started": "启动时间:{time}",
|
|
22
|
+
"status_frontends": "服务声明的前端:{list}",
|
|
23
|
+
"status_frontends_count": "{count} 个前端目标",
|
|
24
|
+
"custom_shared_title": "共享层放通用能力",
|
|
25
|
+
"custom_shared_body": "通用 Shell、主题、语言切换和 API client 放在 packages/{{projectName}}-shared,桌面端直接复用。",
|
|
26
|
+
"custom_local_title": "Desktop 层放桌面文案",
|
|
27
|
+
"custom_local_body": "桌面端特有菜单、状态与功能说明写在 apps/{{projectName}}-desktop/messages。",
|
|
28
|
+
"flow_title": "协同边界",
|
|
29
|
+
"flow_contract": "Contract 固化接口契约",
|
|
30
|
+
"flow_service": "Service 提供运行时能力",
|
|
31
|
+
"flow_shared": "Shared 复用跨端基础 UI/API",
|
|
32
|
+
"flow_frontend": "Desktop 组合桌面产品体验"
|
|
33
|
+
}
|
|
34
|
+
{{/if}}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.desktop}}
|
|
3
|
+
{
|
|
4
|
+
"name": "{{projectName}}-desktop",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"private": true,
|
|
8
|
+
"scripts": {
|
|
9
|
+
"paraglide:compile": "paraglide-js compile --project ./project.inlang --outdir ./src/lib/paraglide",
|
|
10
|
+
"paraglide:watch": "paraglide-js compile --project ./project.inlang --outdir ./src/lib/paraglide --watch",
|
|
11
|
+
"dev": "vite dev --host 127.0.0.1 --port {{fullstack.ports.desktop}}",
|
|
12
|
+
"build": "vite build",
|
|
13
|
+
"preview": "vite preview --host 127.0.0.1 --port {{fullstack.ports.desktop}} --strictPort",
|
|
14
|
+
"typecheck": "pnpm paraglide:compile && svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
15
|
+
"lint": "eslint .",
|
|
16
|
+
"test": "vitest run",
|
|
17
|
+
"test:watch": "vitest",
|
|
18
|
+
"clean": "rimraf .svelte-kit build .turbo src/lib/paraglide"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@h-ai/api-client": "{{fullstack.versions.apiClient}}",
|
|
22
|
+
"@h-ai/ui": "{{fullstack.versions.ui}}",
|
|
23
|
+
"{{fullstack.contractPackageName}}": "workspace:*",
|
|
24
|
+
"{{fullstack.sharedPackageName}}": "workspace:*"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@antfu/eslint-config": "{{fullstack.versions.antfuEslintConfig}}",
|
|
28
|
+
"@iconify-json/tabler": "{{fullstack.versions.iconifyJsonTabler}}",
|
|
29
|
+
"@iconify/tailwind4": "{{fullstack.versions.iconifyTailwind}}",
|
|
30
|
+
"@inlang/paraglide-js": "{{fullstack.versions.inlangParaglide}}",
|
|
31
|
+
"@inlang/plugin-message-format": "{{fullstack.versions.inlangMessageFormat}}",
|
|
32
|
+
"@sveltejs/adapter-auto": "{{fullstack.versions.adapterAuto}}",
|
|
33
|
+
"@sveltejs/kit": "{{fullstack.versions.svelteKit}}",
|
|
34
|
+
"@sveltejs/vite-plugin-svelte": "{{fullstack.versions.sveltePlugin}}",
|
|
35
|
+
"@tailwindcss/vite": "{{fullstack.versions.tailwindcssVite}}",
|
|
36
|
+
"bits-ui": "{{fullstack.versions.bitsUi}}",
|
|
37
|
+
"daisyui": "{{fullstack.versions.daisyui}}",
|
|
38
|
+
"eslint": "{{fullstack.versions.eslint}}",
|
|
39
|
+
"eslint-plugin-format": "{{fullstack.versions.eslintPluginFormat}}",
|
|
40
|
+
"eslint-plugin-svelte": "{{fullstack.versions.eslintPluginSvelte}}",
|
|
41
|
+
"svelte": "{{fullstack.versions.svelte}}",
|
|
42
|
+
"svelte-check": "{{fullstack.versions.svelteCheck}}",
|
|
43
|
+
"svelte-eslint-parser": "{{fullstack.versions.svelteEslintParser}}",
|
|
44
|
+
"tailwindcss": "{{fullstack.versions.tailwindcss}}",
|
|
45
|
+
"typescript": "{{fullstack.versions.typescript}}",
|
|
46
|
+
"vite": "{{fullstack.versions.vite}}",
|
|
47
|
+
"vitest": "{{fullstack.versions.vitest}}"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
{{/if}}
|
package/templates/apps/fullstack/apps/{{projectName}}-desktop/project.inlang/settings.json.hbs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.desktop}}
|
|
3
|
+
{
|
|
4
|
+
"$schema": "https://inlang.com/schema/project-settings",
|
|
5
|
+
"baseLocale": "{{fullstack.i18n.baseLocale}}",
|
|
6
|
+
"locales": [
|
|
7
|
+
{{#each fullstack.i18n.locales}}"{{this}}"{{#unless @last}},{{/unless}}
|
|
8
|
+
{{/each}}
|
|
9
|
+
],
|
|
10
|
+
"modules": [
|
|
11
|
+
"https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@latest/dist/index.js"
|
|
12
|
+
],
|
|
13
|
+
"plugin.inlang.messageFormat": {
|
|
14
|
+
"pathPattern": "./messages/{locale}.json"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
{{/if}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.desktop}}
|
|
3
|
+
@import 'tailwindcss';
|
|
4
|
+
@import '@h-ai/ui/styles/global.css';
|
|
5
|
+
@import '@h-ai/ui/styles/theme.css';
|
|
6
|
+
@source "../node_modules/@h-ai/ui/dist/**/*.{svelte,js,ts}";
|
|
7
|
+
@source "../../../node_modules/@h-ai/ui/dist/**/*.{svelte,js,ts}";
|
|
8
|
+
@source "../../../packages/{{fullstack.sharedPackageName}}/src/**/*.{svelte,js,ts}";
|
|
9
|
+
|
|
10
|
+
@plugin "daisyui" {
|
|
11
|
+
themes:
|
|
12
|
+
{{#each fullstack.theme.themes}}{{this}}{{#if_eq this ../fullstack.theme.defaultTheme}} --default{{/if_eq}}{{#unless @last}},
|
|
13
|
+
{{/unless}}{{/each}};
|
|
14
|
+
}
|
|
15
|
+
@plugin "@iconify/tailwind4" {
|
|
16
|
+
prefixes: tabler;
|
|
17
|
+
}
|
|
18
|
+
{{/if}}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.desktop}}
|
|
3
|
+
<!doctype html>
|
|
4
|
+
<html lang="%paraglide.lang%">
|
|
5
|
+
<head>
|
|
6
|
+
<meta charset="utf-8" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
+
%sveltekit.head%
|
|
9
|
+
</head>
|
|
10
|
+
<body data-sveltekit-preload-data="hover">
|
|
11
|
+
<div style="display: contents">%sveltekit.body%</div>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
14
|
+
{{/if}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.desktop}}
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { setLocale } from '$lib/paraglide/runtime.js'
|
|
5
|
+
import { AppShell } from '{{fullstack.sharedPackageName}}'
|
|
6
|
+
import '../app.css'
|
|
7
|
+
|
|
8
|
+
const { children } = $props()
|
|
9
|
+
|
|
10
|
+
function syncLocale(locale: string) {
|
|
11
|
+
setLocale(locale as Parameters<typeof setLocale>[0])
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<AppShell platform="desktop" onLocaleChange={syncLocale}>
|
|
16
|
+
{@render children()}
|
|
17
|
+
</AppShell>
|
|
18
|
+
{{/if}}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.desktop}}
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import type { AppInfo } from '{{fullstack.sharedPackageName}}'
|
|
5
|
+
import * as appM from '$lib/paraglide/messages.js'
|
|
6
|
+
import { Alert, Button, Card, Skeleton } from '@h-ai/ui'
|
|
7
|
+
import { onMount } from 'svelte'
|
|
8
|
+
import { fetchAppInfo, messages as sharedM } from '{{fullstack.sharedPackageName}}'
|
|
9
|
+
|
|
10
|
+
let info = $state<AppInfo | null>(null)
|
|
11
|
+
let loading = $state(true)
|
|
12
|
+
let errorMessage = $state('')
|
|
13
|
+
|
|
14
|
+
async function refreshStatus() {
|
|
15
|
+
loading = true
|
|
16
|
+
errorMessage = ''
|
|
17
|
+
try {
|
|
18
|
+
info = await fetchAppInfo()
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
info = null
|
|
22
|
+
errorMessage = sharedM.home_error()
|
|
23
|
+
}
|
|
24
|
+
finally {
|
|
25
|
+
loading = false
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
onMount(() => {
|
|
30
|
+
void refreshStatus()
|
|
31
|
+
})
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<svelte:head>
|
|
35
|
+
<title>{appM.page_title({ name: sharedM.app_name() })}</title>
|
|
36
|
+
</svelte:head>
|
|
37
|
+
|
|
38
|
+
<section class="space-y-8">
|
|
39
|
+
<div class="grid gap-6 lg:grid-cols-[1.2fr_0.8fr]">
|
|
40
|
+
<section class="relative overflow-hidden rounded-[2rem] border border-base-300/70 bg-gradient-to-br from-primary/15 via-base-100 to-secondary/15 p-6 shadow-2xl shadow-primary/10 lg:p-10">
|
|
41
|
+
<div class="absolute right-8 top-8 hidden size-28 rounded-full bg-primary/20 blur-3xl sm:block"></div>
|
|
42
|
+
<div class="relative z-10 max-w-2xl space-y-6">
|
|
43
|
+
<span class="badge badge-primary badge-lg gap-2">
|
|
44
|
+
<span class="icon-[tabler--rocket] size-4"></span>
|
|
45
|
+
{appM.hero_badge()}
|
|
46
|
+
</span>
|
|
47
|
+
<div class="space-y-4">
|
|
48
|
+
<h1 class="text-4xl font-black tracking-tight text-base-content sm:text-5xl">
|
|
49
|
+
{appM.hero_title({ name: sharedM.app_name() })}
|
|
50
|
+
</h1>
|
|
51
|
+
<p class="max-w-xl text-lg leading-8 text-base-content/70">
|
|
52
|
+
{appM.hero_subtitle()}
|
|
53
|
+
</p>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="flex flex-wrap gap-3">
|
|
56
|
+
<a class="btn btn-primary shadow-lg shadow-primary/20" href="#status">
|
|
57
|
+
<span class="icon-[tabler--activity-heartbeat] size-5"></span>
|
|
58
|
+
{appM.hero_primary_action()}
|
|
59
|
+
</a>
|
|
60
|
+
<a class="btn btn-ghost" href="#customize">
|
|
61
|
+
<span class="icon-[tabler--adjustments] size-5"></span>
|
|
62
|
+
{appM.hero_secondary_action()}
|
|
63
|
+
</a>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</section>
|
|
67
|
+
|
|
68
|
+
<aside class="rounded-[2rem] border border-base-300/70 bg-base-100/80 p-5 shadow-xl backdrop-blur">
|
|
69
|
+
<div class="mockup-window border border-base-300 bg-base-200/70">
|
|
70
|
+
<div class="space-y-4 bg-base-100 p-5">
|
|
71
|
+
<div class="flex items-center justify-between">
|
|
72
|
+
<div>
|
|
73
|
+
<p class="text-sm font-semibold">{appM.preview_title()}</p>
|
|
74
|
+
<p class="text-xs text-base-content/55">{appM.preview_body()}</p>
|
|
75
|
+
</div>
|
|
76
|
+
<span class="badge badge-success badge-outline">{appM.platform_name()}</span>
|
|
77
|
+
</div>
|
|
78
|
+
<div class="grid gap-3 text-sm">
|
|
79
|
+
<div class="rounded-2xl bg-primary/10 p-4">
|
|
80
|
+
<span class="icon-[tabler--components] mb-2 size-6 text-primary"></span>
|
|
81
|
+
<p class="font-semibold">{appM.preview_metric_shared()}</p>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="grid grid-cols-2 gap-3">
|
|
84
|
+
<div class="rounded-2xl bg-secondary/10 p-4">
|
|
85
|
+
<span class="icon-[tabler--language] mb-2 size-6 text-secondary"></span>
|
|
86
|
+
<p class="font-semibold">{appM.preview_metric_local()}</p>
|
|
87
|
+
</div>
|
|
88
|
+
<div class="rounded-2xl bg-accent/10 p-4">
|
|
89
|
+
<span class="icon-[tabler--palette] mb-2 size-6 text-accent"></span>
|
|
90
|
+
<p class="font-semibold">{appM.preview_metric_theme()}</p>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</aside>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div class="grid gap-6 lg:grid-cols-[0.95fr_1.05fr]">
|
|
100
|
+
<div id="status">
|
|
101
|
+
<Card title={appM.status_title()} bordered shadow="md" class="bg-base-100/90 backdrop-blur">
|
|
102
|
+
<p class="mb-5 text-sm text-base-content/65">{appM.status_description()}</p>
|
|
103
|
+
{#if loading}
|
|
104
|
+
<Skeleton variant="title" class="mb-3" />
|
|
105
|
+
<Skeleton count={3} />
|
|
106
|
+
<p class="sr-only" data-testid="service-status">{sharedM.home_loading()}</p>
|
|
107
|
+
{:else if info}
|
|
108
|
+
<Alert variant="success" title={appM.status_online({ name: info.name })}>
|
|
109
|
+
<p data-testid="service-status">{info.name}</p>
|
|
110
|
+
</Alert>
|
|
111
|
+
<dl class="mt-5 grid gap-3 sm:grid-cols-2 text-sm">
|
|
112
|
+
<div class="rounded-box border border-base-300/70 bg-base-200/60 p-4">
|
|
113
|
+
<dt class="text-xs text-base-content/55">{appM.status_version()}</dt>
|
|
114
|
+
<dd class="mt-1 font-semibold">{info.version}</dd>
|
|
115
|
+
</div>
|
|
116
|
+
<div class="rounded-box border border-base-300/70 bg-base-200/60 p-4">
|
|
117
|
+
<dt class="text-xs text-base-content/55">{appM.status_started({ time: info.startedAt })}</dt>
|
|
118
|
+
<dd class="mt-1 font-semibold">{appM.status_frontends_count({ count: String(info.frontends.length) })}</dd>
|
|
119
|
+
</div>
|
|
120
|
+
<div class="rounded-box border border-base-300/70 bg-base-200/60 p-4 sm:col-span-2">
|
|
121
|
+
<dt class="text-xs text-base-content/55">{appM.status_frontends({ list: info.frontends.join(' / ') })}</dt>
|
|
122
|
+
<dd class="mt-1 font-semibold">{sharedM.home_subtitle()}</dd>
|
|
123
|
+
</div>
|
|
124
|
+
</dl>
|
|
125
|
+
{:else}
|
|
126
|
+
<Alert variant="error" title={sharedM.home_error()}>
|
|
127
|
+
<p data-testid="service-status">{errorMessage}</p>
|
|
128
|
+
</Alert>
|
|
129
|
+
{/if}
|
|
130
|
+
|
|
131
|
+
<div class="mt-5">
|
|
132
|
+
<Button type="button" variant="primary" loading={loading} onclick={refreshStatus}>
|
|
133
|
+
{sharedM.home_refresh()}
|
|
134
|
+
</Button>
|
|
135
|
+
</div>
|
|
136
|
+
</Card>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<section id="customize" class="grid gap-4 sm:grid-cols-2">
|
|
140
|
+
<div class="rounded-[1.5rem] border border-base-300/70 bg-base-100/90 p-5 shadow-md">
|
|
141
|
+
<span class="icon-[tabler--package] mb-4 size-7 text-primary"></span>
|
|
142
|
+
<h2 class="text-lg font-bold">{appM.custom_shared_title()}</h2>
|
|
143
|
+
<p class="mt-2 text-sm leading-6 text-base-content/65">{appM.custom_shared_body()}</p>
|
|
144
|
+
</div>
|
|
145
|
+
<div class="rounded-[1.5rem] border border-base-300/70 bg-base-100/90 p-5 shadow-md">
|
|
146
|
+
<span class="icon-[tabler--message-language] mb-4 size-7 text-secondary"></span>
|
|
147
|
+
<h2 class="text-lg font-bold">{appM.custom_local_title()}</h2>
|
|
148
|
+
<p class="mt-2 text-sm leading-6 text-base-content/65">{appM.custom_local_body()}</p>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="rounded-[1.5rem] border border-base-300/70 bg-base-100/90 p-5 shadow-md sm:col-span-2">
|
|
151
|
+
<h2 class="text-lg font-bold">{appM.flow_title()}</h2>
|
|
152
|
+
<ol class="mt-4 grid gap-3 md:grid-cols-4">
|
|
153
|
+
<li class="rounded-box bg-base-200/70 p-4 text-sm">{appM.flow_contract()}</li>
|
|
154
|
+
<li class="rounded-box bg-base-200/70 p-4 text-sm">{appM.flow_service()}</li>
|
|
155
|
+
<li class="rounded-box bg-base-200/70 p-4 text-sm">{appM.flow_shared()}</li>
|
|
156
|
+
<li class="rounded-box bg-base-200/70 p-4 text-sm">{appM.flow_frontend()}</li>
|
|
157
|
+
</ol>
|
|
158
|
+
</div>
|
|
159
|
+
</section>
|
|
160
|
+
</div>
|
|
161
|
+
</section>
|
|
162
|
+
{{/if}}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.desktop}}
|
|
3
|
+
import { autoImportHaiUi } from '@h-ai/ui/auto-import'
|
|
4
|
+
import adapter from '@sveltejs/adapter-auto'
|
|
5
|
+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
|
|
6
|
+
|
|
7
|
+
/** @type {import('@sveltejs/kit').Config} */
|
|
8
|
+
const config = {
|
|
9
|
+
preprocess: [autoImportHaiUi(), vitePreprocess()],
|
|
10
|
+
compilerOptions: {
|
|
11
|
+
// 使用 Svelte 5 Runes,和 @h-ai/ui 组件库保持一致。
|
|
12
|
+
runes: true,
|
|
13
|
+
},
|
|
14
|
+
kit: {
|
|
15
|
+
adapter: adapter(),
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default config
|
|
20
|
+
{{/if}}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.desktop}}
|
|
3
|
+
import { fetchAppInfo } from '{{fullstack.sharedPackageName}}'
|
|
4
|
+
import { describe, expect, it } from 'vitest'
|
|
5
|
+
|
|
6
|
+
describe('fetchAppInfo', () => {
|
|
7
|
+
it('parses shared contract response', async () => {
|
|
8
|
+
const fetchFn: typeof fetch = async () => new Response(
|
|
9
|
+
JSON.stringify({
|
|
10
|
+
success: true,
|
|
11
|
+
data: {
|
|
12
|
+
name: '{{fullstack.servPackageName}}',
|
|
13
|
+
version: '0.1.0',
|
|
14
|
+
startedAt: '2026-01-01T00:00:00.000Z',
|
|
15
|
+
frontends: ['desktop'],
|
|
16
|
+
},
|
|
17
|
+
}),
|
|
18
|
+
{
|
|
19
|
+
headers: { 'content-type': 'application/json' },
|
|
20
|
+
},
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
const info = await fetchAppInfo({ fetchFn, baseUrl: 'http://127.0.0.1:3000' })
|
|
24
|
+
|
|
25
|
+
expect(info.name).toBe('{{fullstack.servPackageName}}')
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
{{/if}}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.desktop}}
|
|
3
|
+
{
|
|
4
|
+
"extends": "./.svelte-kit/tsconfig.json",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"allowImportingTsExtensions": true,
|
|
8
|
+
"allowJs": true,
|
|
9
|
+
"checkJs": false,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"verbatimModuleSyntax": true,
|
|
12
|
+
"skipLibCheck": true
|
|
13
|
+
},
|
|
14
|
+
"include": ["src/**/*", "src/**/*.svelte", "tests/**/*"],
|
|
15
|
+
"exclude": ["node_modules", ".svelte-kit", "build"]
|
|
16
|
+
}
|
|
17
|
+
{{/if}}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.desktop}}
|
|
3
|
+
import { paraglideVitePlugin } from '@inlang/paraglide-js'
|
|
4
|
+
import { sveltekit } from '@sveltejs/kit/vite'
|
|
5
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
6
|
+
import { defineConfig } from 'vitest/config'
|
|
7
|
+
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
plugins: [
|
|
10
|
+
paraglideVitePlugin({
|
|
11
|
+
project: './project.inlang',
|
|
12
|
+
outdir: './src/lib/paraglide',
|
|
13
|
+
strategy: ['cookie', 'baseLocale'],
|
|
14
|
+
}),
|
|
15
|
+
sveltekit(),
|
|
16
|
+
tailwindcss(),
|
|
17
|
+
],
|
|
18
|
+
optimizeDeps: {
|
|
19
|
+
exclude: ['bits-ui'],
|
|
20
|
+
},
|
|
21
|
+
ssr: {
|
|
22
|
+
noExternal: [/@h-ai\//, /{{fullstack.sharedPackageName}}/],
|
|
23
|
+
},
|
|
24
|
+
test: {
|
|
25
|
+
environment: 'node',
|
|
26
|
+
include: ['tests/**/*.test.ts'],
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
{{/if}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.hasMiniapp}}
|
|
3
|
+
# {{projectName}}-miniapp
|
|
4
|
+
|
|
5
|
+
小程序端当前为预留占位,不参与 workspace 构建、单元测试或 E2E,但已预置 inlang 标准目录:
|
|
6
|
+
|
|
7
|
+
- `project.inlang/settings.json`:小程序端 locale 配置
|
|
8
|
+
- `messages/zh-CN.json`、`messages/en-US.json`:小程序端自有文案
|
|
9
|
+
|
|
10
|
+
后续实现时建议复用 `packages/{{fullstack.contractPackageName}}` 中的 Schema 与路径常量,保持接口真相源一致。
|
|
11
|
+
|
|
12
|
+
协同边界:跨端通用文案/组件放 `packages/{{fullstack.sharedPackageName}}`,小程序独有页面文案放本目录 `messages/`。
|
|
13
|
+
{{/if}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.hasMiniapp}}
|
|
3
|
+
{
|
|
4
|
+
"$schema": "https://inlang.com/schema/inlang-message-format",
|
|
5
|
+
"mini_title": "{{projectName}} Mini App",
|
|
6
|
+
"mini_status": "Reserved placeholder",
|
|
7
|
+
"mini_description": "The mini app target does not generate a buildable package yet, but it includes standard inlang project.inlang and messages so a real mini app framework can adopt them later.",
|
|
8
|
+
"mini_shared_contract": "Reuse Schema and route constants from packages/{{fullstack.contractPackageName}}.",
|
|
9
|
+
"mini_own_messages": "Mini-app-only copy lives in apps/{{projectName}}-miniapp/messages.",
|
|
10
|
+
"mini_customize": "Keep locale lists aligned with shared so cross-platform locale switching remains consistent."
|
|
11
|
+
}
|
|
12
|
+
{{/if}}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.hasMiniapp}}
|
|
3
|
+
{
|
|
4
|
+
"$schema": "https://inlang.com/schema/inlang-message-format",
|
|
5
|
+
"mini_title": "{{projectName}} 小程序端",
|
|
6
|
+
"mini_status": "预留占位",
|
|
7
|
+
"mini_description": "小程序端暂不生成可构建 package,但已经按 inlang 标准预置 project.inlang 与 messages,后续接入真实小程序框架时可直接迁移。",
|
|
8
|
+
"mini_shared_contract": "复用 packages/{{fullstack.contractPackageName}} 的 Schema 与路径常量。",
|
|
9
|
+
"mini_own_messages": "小程序独有文案放在 apps/{{projectName}}-miniapp/messages。",
|
|
10
|
+
"mini_customize": "保持 locale 列表与 shared 一致,跨端语言切换才能保持同步。"
|
|
11
|
+
}
|
|
12
|
+
{{/if}}
|
package/templates/apps/fullstack/apps/{{projectName}}-miniapp/project.inlang/settings.json.hbs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.hasMiniapp}}
|
|
3
|
+
{
|
|
4
|
+
"$schema": "https://inlang.com/schema/project-settings",
|
|
5
|
+
"baseLocale": "{{fullstack.i18n.baseLocale}}",
|
|
6
|
+
"locales": [
|
|
7
|
+
{{#each fullstack.i18n.locales}}"{{this}}"{{#unless @last}},{{/unless}}
|
|
8
|
+
{{/each}}
|
|
9
|
+
],
|
|
10
|
+
"modules": [
|
|
11
|
+
"https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@latest/dist/index.js"
|
|
12
|
+
],
|
|
13
|
+
"plugin.inlang.messageFormat": {
|
|
14
|
+
"pathPattern": "./messages/{locale}.json"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
{{/if}}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.web}}
|
|
3
|
+
# {{projectName}}-web
|
|
4
|
+
|
|
5
|
+
Web 前端工程,使用 `@h-ai/api-client` 绑定共享 contract 调用后端 API,并通过 `@h-ai/ui` 组件搭建页面。
|
|
6
|
+
|
|
7
|
+
## i18n 与 shared 协同
|
|
8
|
+
|
|
9
|
+
- 本端页面文案:`messages/{locale}.json` + `project.inlang/settings.json`
|
|
10
|
+
- 共享 Shell/主题/语言/API:`packages/{{fullstack.sharedPackageName}}`
|
|
11
|
+
- 语言切换由 shared 的 `LanguageSwitcher` 触发,并同步本端 `$lib/paraglide/runtime.js`
|
|
12
|
+
|
|
13
|
+
自定义建议:Web 独有文案放在本目录 `messages/`;跨端通用文案或组件放到 shared。
|
|
14
|
+
|
|
15
|
+
## 开发
|
|
16
|
+
|
|
17
|
+
- `pnpm i18n:compile`:在工作区根目录统一编译 shared + 各前端 Paraglide 输出
|
|
18
|
+
- `pnpm --filter {{projectName}}-web dev`,默认端口 4173
|
|
19
|
+
- `pnpm --filter {{projectName}}-web paraglide:compile`:只编译本端 messages
|
|
20
|
+
- `pnpm --filter {{projectName}}-web test`
|
|
21
|
+
{{/if}}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.web}}
|
|
3
|
+
import antfu from '@antfu/eslint-config'
|
|
4
|
+
|
|
5
|
+
export default antfu({
|
|
6
|
+
formatters: true,
|
|
7
|
+
ignores: ['**/.svelte-kit/**', '**/build/**', '**/dist/**', '**/*.d.ts', '**/project.inlang/**', '**/src/lib/paraglide/**'],
|
|
8
|
+
svelte: true,
|
|
9
|
+
}, {
|
|
10
|
+
files: ['**/*.ts', '**/*.svelte'],
|
|
11
|
+
rules: {
|
|
12
|
+
'no-console': 'error',
|
|
13
|
+
'ts/no-explicit-any': 'error',
|
|
14
|
+
},
|
|
15
|
+
}, {
|
|
16
|
+
files: ['**/*.svelte'],
|
|
17
|
+
rules: {
|
|
18
|
+
'svelte/html-quotes': 'off',
|
|
19
|
+
'svelte/indent': 'off',
|
|
20
|
+
'perfectionist/sort-imports': 'off',
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
{{/if}}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{{! @skipIfEmpty }}
|
|
2
|
+
{{#if fullstack.frontends.web}}
|
|
3
|
+
{
|
|
4
|
+
"$schema": "https://inlang.com/schema/inlang-message-format",
|
|
5
|
+
"page_title": "{name} · Web",
|
|
6
|
+
"platform_name": "Web",
|
|
7
|
+
"hero_badge": "Web workspace",
|
|
8
|
+
"hero_title": "{name} Web Console",
|
|
9
|
+
"hero_subtitle": "A browser-first product landing page. Page copy comes from this app's messages, while shared provides the shell, theme, locale switcher and API client.",
|
|
10
|
+
"hero_primary_action": "View service status",
|
|
11
|
+
"hero_secondary_action": "Customize the starter",
|
|
12
|
+
"preview_title": "Responsive web experience",
|
|
13
|
+
"preview_body": "Ready for websites, consoles and admin entry points",
|
|
14
|
+
"preview_metric_shared": "Shared components and API client",
|
|
15
|
+
"preview_metric_local": "Web-owned messages",
|
|
16
|
+
"preview_metric_theme": "Configurable themes",
|
|
17
|
+
"status_title": "Service connectivity",
|
|
18
|
+
"status_description": "This page calls the backend service to verify contract, service, shared and the Web frontend are wired together.",
|
|
19
|
+
"status_online": "{name} is connected",
|
|
20
|
+
"status_version": "Service version",
|
|
21
|
+
"status_started": "Started at: {time}",
|
|
22
|
+
"status_frontends": "Service frontends: {list}",
|
|
23
|
+
"status_frontends_count": "{count} frontend targets",
|
|
24
|
+
"custom_shared_title": "Shared owns common capabilities",
|
|
25
|
+
"custom_shared_body": "Put cross-platform shell, theme, locale switching, API client and shared UI in packages/{{projectName}}-shared.",
|
|
26
|
+
"custom_local_title": "Web owns product copy",
|
|
27
|
+
"custom_local_body": "Write Web-only page copy in apps/{{projectName}}-web/messages and compile it with this app's project.inlang.",
|
|
28
|
+
"flow_title": "Collaboration boundary",
|
|
29
|
+
"flow_contract": "Contract defines API truth",
|
|
30
|
+
"flow_service": "Service implements business endpoints",
|
|
31
|
+
"flow_shared": "Shared provides cross-platform UI/API",
|
|
32
|
+
"flow_frontend": "Web composes pages and local copy"
|
|
33
|
+
}
|
|
34
|
+
{{/if}}
|