@voltro/cli 0.52.0 → 0.54.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/CHANGELOG.md +424 -0
- package/THIRD-PARTY-NOTICES.md +8311 -3318
- package/dist/{agentsMd-0l980yhL.js → agentsMd-BaLC10Na.js} +110 -82
- package/dist/agentsMd-DCY1RSs8.js +2 -0
- package/dist/apiBuild-CeUN55uk.js +2 -0
- package/dist/{apiBuild-CSFI8QGq.js → apiBuild-DTWp0S_q.js} +11 -5
- package/dist/bin.js +1 -1
- package/dist/build-D4ygSbnV.js +843 -0
- package/dist/{checkCommand-COmqc2cB.js → checkCommand-Dg1G7Gwd.js} +6 -6
- package/dist/{checkCommand-2SbqzukH.js → checkCommand-L7DTlpIF.js} +1 -1
- package/dist/{cloudCmd-QUXh-b5w.js → cloudCmd-DzKcSYuy.js} +1 -1
- package/dist/{codegen-VF479Cnb.js → codegen-DSLM8Su9.js} +1 -1
- package/dist/codegen-DjgxEOnD.js +2 -0
- package/dist/codegenCommand-CG_Vx4lc.js +41 -0
- package/dist/{codemodRunner-r7J9lIa7.js → codemodRunner-Cd4xkC6u.js} +109 -11
- package/dist/{commands-Cc_nV8WI.js → commands-6Kzi92Np.js} +96 -73
- package/dist/{dashboardCommand-C-gKvwqh.js → dashboardCommand-Cq1PWvI1.js} +5 -5
- package/dist/{dataCommand-BgpBHnlB.js → dataCommand-DYzW8vkv.js} +3 -3
- package/dist/{dbCommand-sHedr-NJ.js → dbCommand-B4NWZtGL.js} +278 -237
- package/dist/dbCommand-CSFWs9ev.js +2 -0
- package/dist/{dev-CRHoCEiy.js → dev-CmuvUKRq.js} +2903 -2306
- package/dist/{dev--A3nsxA3.js → dev-cKUiZZsB.js} +1 -1
- package/dist/{doctorCommand-DtfJ3FA6.js → doctorCommand-DCiFVMtZ.js} +101 -69
- package/dist/doctorCommand-J3qu4E0Y.js +2 -0
- package/dist/{dormancyCommand-Drn7o0No.js → dormancyCommand-w1TrmgYP.js} +1 -1
- package/dist/{embeddingsCommand-Z-jO1fWN.js → embeddingsCommand-CMgPyRTr.js} +1 -1
- package/dist/{envCommand-D4gCrrTZ.js → envCommand-Cyynmcfa.js} +8 -8
- package/dist/{evolveCommand-CMROeKeA.js → evolveCommand-BwvQ8dVH.js} +2 -2
- package/dist/fileConventions-l-RIXbx8.js +36 -0
- package/dist/{fileTaxonomy-DvDUV9wq.js → fileTaxonomy-CbyMQYx_.js} +42 -42
- package/dist/fontPipeline-LxIHa1vo.js +2 -0
- package/dist/fontPipeline-Tsh8kZfA.js +152 -0
- package/dist/{frameworkTableAssembly-w-XnLa3q.js → frameworkTableAssembly-D7LJuALW.js} +5 -5
- package/dist/frameworkTableAssembly-IPD1pUnZ.js +2 -0
- package/dist/imagePipeline-B_GVJgm6.js +2 -0
- package/dist/imagePipeline-CBZmjT4i.js +127 -0
- package/dist/index.js +2 -2
- package/dist/{infoCommand-DXM868o_.js → infoCommand-DlYlUPqs.js} +1 -1
- package/dist/{inspect-CtL_xTbu.js → inspect-Bd8-9wsi.js} +1 -1
- package/dist/inspect-CuoDInfZ.js +2 -0
- package/dist/{inspectGateHint-BjnFubmH.js → inspectGateHint-4LxkNtrz.js} +1 -1
- package/dist/manifestBuild-C4-J1-m_.js +2 -0
- package/dist/{manifestBuild-CuU1VrSm.js → manifestBuild-Cqgsx2bM.js} +1 -1
- package/dist/{metaCommands-C6RFmF1r.js → metaCommands-x7RCi2AF.js} +9 -3
- package/dist/{migrate-D0F-eTlK.js → migrate-BK_Bbx-_.js} +2 -2
- package/dist/mobileCommand-D9O6iq3D.js +428 -0
- package/dist/mobileCommand-DAum7tsG.js +2 -0
- package/dist/{pageConvention-CzUiSbtU.js → pageConvention-CMpfDN6r.js} +1 -1
- package/dist/{privacyCommand-DGdopOI6.js → privacyCommand-BCa2OoZG.js} +1 -1
- package/dist/{probeCommand-C9gazU0H.js → probeCommand-_C0YU207.js} +83 -24
- package/dist/{projectScaffold-EzlErR4E.js → projectScaffold-CJfP-xbT.js} +1 -1
- package/dist/{projectScaffold-B4dmTlwT.js → projectScaffold-CSN0OzBV.js} +2 -2
- package/dist/renderModeScan-43yQ2opo.js +147 -0
- package/dist/{renderProfile-Ck32Fzxr.js → renderProfile-DvrhVJHa.js} +2 -2
- package/dist/{runtimeTrace-BPQyCmC5.js → runtimeTrace-CGWx1Q6l.js} +1 -1
- package/dist/{sdkgen-Se88ifTd.js → sdkgen-CDGHQUFj.js} +1 -1
- package/dist/serveCommand-BiPe8BJm.js +2 -0
- package/dist/{serveCommand-DkP3OT0W.js → serveCommand-Bje09q1v.js} +889 -825
- package/dist/serveEntry.js +1 -1
- package/dist/start-B0bnJgxI.js +3 -0
- package/dist/{start-jw89Xbqy.js → start-Clz-1BHB.js} +633 -455
- package/dist/startEntry.js +1 -1
- package/dist/{staticCommand-BwNEDlSU.js → staticCommand-ey0kYmOT.js} +1 -1
- package/dist/{subcommandNames-DpYs3DXr.js → subcommandNames-CDzfEtKV.js} +3 -3
- package/dist/{templates-BR-fb4SP.js → templates-BTWZkJJT.js} +41 -9
- package/dist/{test-f3amja6a.js → test-D_kW4KMj.js} +1 -1
- package/dist/updateCommand-CIoVDKnj.js +2 -0
- package/dist/{updateCommand-BMk2e4ky.js → updateCommand-CRJlAOaM.js} +139 -115
- package/dist/{webDev-BgWL9gKV.js → webDev-DSI9SOhs.js} +1598 -1028
- package/dist/webDev-DlvZO30c.js +2 -0
- package/dist/{webhooksCommand-CoIO3jbj.js → webhooksCommand-BvzXNHji.js} +1 -1
- package/dist/workspaceDeps-RKEkX92S.js +45 -0
- package/package.json +60 -19
- package/templates/AGENTS.core.md +2 -0
- package/templates/AGENTS.md +8 -4
- package/templates/agent-docs/_index.md +6 -4
- package/templates/agent-docs/_manifest.json +21 -5
- package/templates/agent-docs/ai.md +6 -6
- package/templates/agent-docs/authentication.md +73 -1
- package/templates/agent-docs/cli.md +6 -3
- package/templates/agent-docs/configuration.md +17 -0
- package/templates/agent-docs/data.md +522 -29
- package/templates/agent-docs/database/advancedqueries.md +8 -8
- package/templates/agent-docs/database/columntypes.md +2 -2
- package/templates/agent-docs/database/migrations.md +1 -1
- package/templates/agent-docs/database/querying.md +1 -1
- package/templates/agent-docs/database/schema.md +1 -1
- package/templates/agent-docs/database/seedsdialects.md +65 -3
- package/templates/agent-docs/database/transactions.md +3 -3
- package/templates/agent-docs/deployment.md +8 -0
- package/templates/agent-docs/internationalization.md +4 -2
- package/templates/agent-docs/introduction.md +32 -1
- package/templates/agent-docs/local-first-mobile.md +226 -30
- package/templates/agent-docs/observability.md +5 -1
- package/templates/agent-docs/plugins/atlassian.md +2 -2
- package/templates/agent-docs/plugins/audit.md +2 -2
- package/templates/agent-docs/plugins/auth.md +1 -1
- package/templates/agent-docs/plugins/billing.md +1 -1
- package/templates/agent-docs/plugins/cdc-out.md +8 -3
- package/templates/agent-docs/plugins/comments.md +164 -0
- package/templates/agent-docs/plugins/notifications.md +47 -4
- package/templates/agent-docs/plugins/presence.md +45 -3
- package/templates/agent-docs/plugins/prometheus.md +3 -1
- package/templates/agent-docs/plugins/queue.md +172 -0
- package/templates/agent-docs/plugins.md +17 -13
- package/templates/agent-docs/reference.md +35 -4
- package/templates/agent-docs/routing.md +585 -7
- package/templates/agent-docs/scheduling.md +1 -1
- package/templates/agent-docs/schema-driven-ui.md +226 -4
- package/templates/agent-docs/security.md +3 -3
- package/templates/agent-docs/templates/appshells.md +36 -4
- package/templates/agent-docs/whats-new.md +134 -66
- package/templates/apps/api-ai/package.json +6 -6
- package/templates/apps/api-auth/package.json +8 -8
- package/templates/apps/api-backend/package.json +7 -7
- package/templates/apps/api-backend-deactivation/package.json +7 -7
- package/templates/apps/api-backend-mail/package.json +8 -8
- package/templates/apps/api-backend-mariadb/package.json +9 -9
- package/templates/apps/api-backend-sqlite/package.json +8 -8
- package/templates/apps/api-backend-storage/package.json +8 -8
- package/templates/apps/api-cms/package.json +9 -9
- package/templates/apps/api-collab/README.md +3 -3
- package/templates/apps/api-collab/app.config.ts +1 -1
- package/templates/apps/api-collab/database/schema.ts +12 -8
- package/templates/apps/api-collab/mutations/documents.create.mutation.server.ts +1 -1
- package/templates/apps/api-collab/mutations/documents.setBody.mutation.server.ts +1 -1
- package/templates/apps/api-collab/mutations/documents.setBody.mutation.ts +1 -1
- package/templates/apps/api-collab/package.json +8 -8
- package/templates/apps/api-collab/template.json +1 -1
- package/templates/apps/api-collab/tests/documents.setBody.test.ts +10 -2
- package/templates/apps/api-data-advanced/package.json +8 -8
- package/templates/apps/api-durable/package.json +8 -8
- package/templates/apps/api-feature-flags/package.json +9 -9
- package/templates/apps/api-governance/package.json +8 -8
- package/templates/apps/api-kv/package.json +8 -8
- package/templates/apps/api-moderation/package.json +8 -8
- package/templates/apps/api-observability/package.json +8 -8
- package/templates/apps/api-ratelimit/package.json +8 -8
- package/templates/apps/api-rbac/package.json +8 -8
- package/templates/apps/api-rest/package.json +7 -7
- package/templates/apps/api-row-history/package.json +8 -8
- package/templates/apps/api-saas/package.json +11 -10
- package/templates/apps/api-saas-starter/package.json +10 -10
- package/templates/apps/api-search/package.json +8 -8
- package/templates/apps/api-status/package.json +8 -8
- package/templates/apps/api-webhooks/package.json +9 -9
- package/templates/apps/changelog/app.config.ts +26 -2
- package/templates/apps/changelog/content/releases/{0.1.0.mdx → v0-1-0.mdx} +0 -1
- package/templates/apps/changelog/content/releases/{0.2.0.mdx → v0-2-0.mdx} +0 -1
- package/templates/apps/changelog/package.json +9 -8
- package/templates/apps/changelog/src/collections/releases.collection.ts +48 -0
- package/templates/apps/changelog/src/globals.d.ts +1 -1
- package/templates/apps/changelog/src/locales/de.ts +1 -1
- package/templates/apps/changelog/src/locales/en.ts +1 -1
- package/templates/apps/changelog/src/pages/[locale]/[slug]/page.tsx +7 -4
- package/templates/apps/changelog/src/pages/[locale]/mirrors.test.tsx +13 -41
- package/templates/apps/changelog/src/pages/[slug]/page.test.tsx +26 -51
- package/templates/apps/changelog/src/pages/[slug]/page.tsx +21 -19
- package/templates/apps/changelog/src/pages/page.test.tsx +14 -37
- package/templates/apps/changelog/src/pages/page.tsx +18 -12
- package/templates/apps/edge-functions/package.json +2 -2
- package/templates/apps/frontend-admin/package.json +8 -8
- package/templates/apps/frontend-app/package.json +9 -9
- package/templates/apps/frontend-auth/package.json +8 -8
- package/templates/apps/frontend-blank/package.json +7 -7
- package/templates/apps/frontend-cms/package.json +9 -9
- package/templates/apps/frontend-collab/README.md +43 -24
- package/templates/apps/frontend-collab/app.config.ts +3 -3
- package/templates/apps/frontend-collab/package.json +14 -10
- package/templates/apps/frontend-collab/src/locales/de.ts +1 -2
- package/templates/apps/frontend-collab/src/locales/en.ts +1 -2
- package/templates/apps/frontend-collab/src/pages/page.test.tsx +72 -76
- package/templates/apps/frontend-collab/src/pages/page.tsx +45 -22
- package/templates/apps/frontend-collab/template.json +2 -2
- package/templates/apps/frontend-contact/package.json +7 -7
- package/templates/apps/frontend-dashboard/package.json +7 -7
- package/templates/apps/frontend-docs/content/docs/de/guides/first-page.md +4 -0
- package/templates/apps/frontend-docs/content/docs/de/intro/getting-started.md +4 -0
- package/templates/apps/frontend-docs/content/docs/en/guides/first-page.md +4 -0
- package/templates/apps/frontend-docs/content/docs/en/intro/getting-started.md +4 -0
- package/templates/apps/frontend-docs/package.json +9 -6
- package/templates/apps/frontend-docs/src/collections/docs.collection.ts +21 -0
- package/templates/apps/frontend-docs/src/locales/de.ts +0 -5
- package/templates/apps/frontend-docs/src/locales/en.ts +0 -5
- package/templates/apps/frontend-docs/src/pages/[locale]/docs/[...slug]/page.tsx +17 -9
- package/templates/apps/frontend-docs/src/pages/[locale]/mirrors.test.tsx +10 -5
- package/templates/apps/frontend-docs/src/pages/[locale]/page.tsx +8 -0
- package/templates/apps/frontend-docs/src/pages/docs/[...slug]/page.test.tsx +53 -15
- package/templates/apps/frontend-docs/src/pages/docs/[...slug]/page.tsx +27 -33
- package/templates/apps/frontend-docs/src/pages/page.test.tsx +17 -3
- package/templates/apps/frontend-docs/src/pages/page.tsx +16 -12
- package/templates/apps/frontend-i18n/package.json +6 -6
- package/templates/apps/frontend-landing/README.md +48 -0
- package/templates/apps/frontend-landing/app.config.ts +28 -0
- package/templates/apps/frontend-landing/package.json +7 -6
- package/templates/apps/frontend-landing/src/assets/hero.jpg +0 -0
- package/templates/apps/frontend-landing/src/fonts/Geist-Variable.woff2 +0 -0
- package/templates/apps/frontend-landing/src/fonts/LICENSE-Geist.txt +92 -0
- package/templates/apps/frontend-landing/src/globals.css +15 -0
- package/templates/apps/frontend-landing/src/globals.d.ts +17 -0
- package/templates/apps/frontend-landing/src/locales/de.ts +3 -2
- package/templates/apps/frontend-landing/src/locales/en.ts +5 -2
- package/templates/apps/frontend-landing/src/pages/page.test.tsx +79 -0
- package/templates/apps/frontend-landing/src/pages/page.tsx +26 -3
- package/templates/apps/frontend-landing/template.json +2 -2
- package/templates/apps/frontend-portal/package.json +8 -8
- package/templates/apps/frontend-saas/package.json +8 -8
- package/templates/apps/frontend-spa/package.json +7 -7
- package/templates/apps/frontend-ssr/package.json +7 -7
- package/templates/apps/frontend-ssr-api/package.json +8 -8
- package/templates/apps/frontend-static-blog/content/posts/cms-to-ssg.md +12 -0
- package/templates/apps/frontend-static-blog/content/posts/hello-static.md +12 -0
- package/templates/apps/frontend-static-blog/content/posts/islands-not-hydration.md +14 -0
- package/templates/apps/frontend-static-blog/package.json +9 -6
- package/templates/apps/frontend-static-blog/src/collections/posts.collection.ts +27 -0
- package/templates/apps/frontend-static-blog/src/pages/[locale]/blog/[slug]/page.tsx +7 -4
- package/templates/apps/frontend-static-blog/src/pages/[locale]/mirrors.test.tsx +7 -1
- package/templates/apps/frontend-static-blog/src/pages/blog/[slug]/page.test.tsx +19 -9
- package/templates/apps/frontend-static-blog/src/pages/blog/[slug]/page.tsx +19 -21
- package/templates/apps/frontend-static-blog/src/pages/page.test.tsx +18 -5
- package/templates/apps/frontend-static-blog/src/pages/page.tsx +21 -14
- package/templates/apps/frontend-status/package.json +8 -8
- package/templates/apps/mobile-app/package.json +12 -11
- package/templates/apps/mobile-app/src/lib/deeplinks.ts +29 -17
- package/templates/apps/mobile-app/tests/deeplinks.test.ts +16 -0
- package/dist/agentsMd-SDDSkyl4.js +0 -2
- package/dist/apiBuild-BYBpL7Pz.js +0 -2
- package/dist/build-CPgcMQug.js +0 -793
- package/dist/codegen-CctkDO-1.js +0 -2
- package/dist/codegenCommand-DCdG2JN-.js +0 -137
- package/dist/dbCommand-DNb6yeOG.js +0 -2
- package/dist/doctorCommand-CqoWA2p5.js +0 -2
- package/dist/fileConventions-DOqD3lPS.js +0 -34
- package/dist/frameworkTableAssembly-C6ETawPR.js +0 -2
- package/dist/inspect-CuGDYES0.js +0 -2
- package/dist/manifestBuild-CPjhvM62.js +0 -2
- package/dist/renderModeScan-CcH2X1_D.js +0 -120
- package/dist/serveCommand-DLc-BznW.js +0 -2
- package/dist/start-DfL3fOiN.js +0 -3
- package/dist/updateCommand-5gFVfK5q.js +0 -2
- package/dist/webDev-CZbTsDcH.js +0 -2
- package/templates/apps/changelog/scripts/generate-rss.mjs +0 -38
- package/templates/apps/changelog/src/lib/releases.ts +0 -21
- package/templates/apps/frontend-static-blog/src/content/posts.ts +0 -64
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
// @vitest-environment jsdom
|
|
2
2
|
//
|
|
3
3
|
// `/docs/[...slug]` catch-all — its `getStaticPaths` export (enumerates the
|
|
4
|
-
// pre-rendered doc slugs
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
4
|
+
// pre-rendered doc slugs from the `docs` CONTENT COLLECTION), the loader
|
|
5
|
+
// (locale-tree selection + fallback), the per-doc meta, and the page render
|
|
6
|
+
// for a matched vs. unknown slug. The collection reads this app's REAL
|
|
7
|
+
// content/docs/{en,de}/**/*.md files — no fixture copies to drift.
|
|
8
8
|
|
|
9
9
|
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
|
|
10
10
|
import { act, createElement, type ReactNode } from 'react'
|
|
11
11
|
import { createRoot, type Root } from 'react-dom/client'
|
|
12
|
+
import { dirname, join } from 'node:path'
|
|
13
|
+
import { fileURLToPath } from 'node:url'
|
|
14
|
+
import { setContentRoot, type ContentEntry } from '@voltro/content'
|
|
15
|
+
import type { Doc } from '../../../collections/docs.collection'
|
|
12
16
|
import en from '../../../locales/en'
|
|
13
17
|
import de from '../../../locales/de'
|
|
14
18
|
|
|
19
|
+
// The server half of the collection reads files under the app root.
|
|
20
|
+
setContentRoot(join(dirname(fileURLToPath(import.meta.url)), '..', '..', '..', '..'))
|
|
21
|
+
|
|
15
22
|
const params = vi.fn<() => Record<string, string>>()
|
|
16
|
-
vi.
|
|
23
|
+
const loaderData = vi.fn<() => ContentEntry<Doc> | null>()
|
|
24
|
+
vi.mock('@voltro/web', () => ({
|
|
25
|
+
useParams: () => params(),
|
|
26
|
+
useLoaderData: () => loaderData(),
|
|
27
|
+
}))
|
|
17
28
|
|
|
18
29
|
const catalogs: Record<string, Record<string, string>> = { en, de }
|
|
19
30
|
let currentLocale = 'en'
|
|
@@ -37,7 +48,7 @@ vi.mock('@voltro/i18n', () => ({
|
|
|
37
48
|
fill(catalogs[currentLocale]?.[id] ?? id, values),
|
|
38
49
|
}))
|
|
39
50
|
|
|
40
|
-
const { default: DocPage, getStaticPaths, meta, renderMode, interactive } = await import('./page')
|
|
51
|
+
const { default: DocPage, getStaticPaths, loader, meta, renderMode, interactive } = await import('./page')
|
|
41
52
|
|
|
42
53
|
;(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true
|
|
43
54
|
|
|
@@ -53,7 +64,10 @@ const render = (node: ReactNode): void => {
|
|
|
53
64
|
})
|
|
54
65
|
}
|
|
55
66
|
|
|
56
|
-
beforeEach(() =>
|
|
67
|
+
beforeEach(() => {
|
|
68
|
+
params.mockReset()
|
|
69
|
+
loaderData.mockReset()
|
|
70
|
+
})
|
|
57
71
|
|
|
58
72
|
afterEach(() => {
|
|
59
73
|
currentLocale = 'en'
|
|
@@ -70,36 +84,59 @@ describe('docs [...slug] — config + getStaticPaths', () => {
|
|
|
70
84
|
|
|
71
85
|
test('enumerates every doc slug as a single `/`-joined string', async () => {
|
|
72
86
|
const paths = await getStaticPaths()
|
|
87
|
+
// getCollection sorts by slug.
|
|
73
88
|
expect(paths.map((p) => p.params.slug)).toEqual([
|
|
74
|
-
'intro/getting-started',
|
|
75
89
|
'guides/first-page',
|
|
90
|
+
'intro/getting-started',
|
|
76
91
|
])
|
|
77
92
|
})
|
|
78
93
|
})
|
|
79
94
|
|
|
95
|
+
describe('docs [...slug] — loader (collection + locale trees)', () => {
|
|
96
|
+
test('loads the default-locale entry with rendered html', async () => {
|
|
97
|
+
const doc = await loader({ params: { slug: 'guides/first-page' } })
|
|
98
|
+
expect(doc?.data.title).toBe('Your first page')
|
|
99
|
+
expect(doc?.html).toContain('<code>*.tsx</code>')
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
test('loads the German tree when a locale is passed', async () => {
|
|
103
|
+
const doc = await loader({ params: { slug: 'guides/first-page' }, locale: 'de' })
|
|
104
|
+
expect(doc?.data.title).toBe('Deine erste Seite')
|
|
105
|
+
expect(doc?.html).toContain('Lege eine')
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
test('returns null for an unknown slug', async () => {
|
|
109
|
+
expect(await loader({ params: { slug: 'does/not-exist' } })).toBeNull()
|
|
110
|
+
})
|
|
111
|
+
})
|
|
112
|
+
|
|
80
113
|
describe('docs [...slug] — localized meta', () => {
|
|
81
|
-
test('reads the per-doc title from the
|
|
82
|
-
|
|
83
|
-
|
|
114
|
+
test('reads the per-doc title from the entry frontmatter, per locale', async () => {
|
|
115
|
+
const enDoc = await loader({ params: { slug: 'guides/first-page' } })
|
|
116
|
+
const deDoc = await loader({ params: { slug: 'guides/first-page' }, locale: 'de' })
|
|
117
|
+
expect(meta({ locale: 'en', loaderData: enDoc }).title).toBe('Your first page')
|
|
118
|
+
expect(meta({ locale: 'de', loaderData: deDoc }).title).toBe('Deine erste Seite')
|
|
84
119
|
})
|
|
85
120
|
|
|
86
121
|
test('falls back to the not-found title for an unknown slug', () => {
|
|
87
|
-
expect(meta({ locale: 'en',
|
|
122
|
+
expect(meta({ locale: 'en', loaderData: null }).title).toBe('Not found')
|
|
88
123
|
})
|
|
89
124
|
})
|
|
90
125
|
|
|
91
|
-
describe('docs [...slug] —
|
|
92
|
-
test('renders the matched doc title + body (English) for a known slug', () => {
|
|
126
|
+
describe('docs [...slug] — render', () => {
|
|
127
|
+
test('renders the matched doc title + body (English) for a known slug', async () => {
|
|
93
128
|
currentLocale = 'en'
|
|
94
129
|
params.mockReturnValue({ slug: 'guides/first-page' })
|
|
130
|
+
loaderData.mockReturnValue(await loader({ params: { slug: 'guides/first-page' } }))
|
|
95
131
|
render(createElement(DocPage))
|
|
96
132
|
expect(container.querySelector('h1')?.textContent).toBe('Your first page')
|
|
97
133
|
expect(container.textContent).toContain('Drop a')
|
|
98
134
|
})
|
|
99
135
|
|
|
100
|
-
test('renders the matched doc title + body (German) for a known slug', () => {
|
|
136
|
+
test('renders the matched doc title + body (German) for a known slug', async () => {
|
|
101
137
|
currentLocale = 'de'
|
|
102
138
|
params.mockReturnValue({ slug: 'guides/first-page' })
|
|
139
|
+
loaderData.mockReturnValue(await loader({ params: { slug: 'guides/first-page' }, locale: 'de' }))
|
|
103
140
|
render(createElement(DocPage))
|
|
104
141
|
expect(container.querySelector('h1')?.textContent).toBe('Deine erste Seite')
|
|
105
142
|
expect(container.textContent).toContain('Lege eine')
|
|
@@ -108,6 +145,7 @@ describe('docs [...slug] — localized render', () => {
|
|
|
108
145
|
test('renders the localized not-found fallback for an unknown slug', () => {
|
|
109
146
|
currentLocale = 'en'
|
|
110
147
|
params.mockReturnValue({ slug: 'does/not-exist' })
|
|
148
|
+
loaderData.mockReturnValue(null)
|
|
111
149
|
render(createElement(DocPage))
|
|
112
150
|
expect(container.querySelector('h1')?.textContent).toBe('Not found')
|
|
113
151
|
expect(container.textContent).toContain('does/not-exist')
|
|
@@ -2,55 +2,50 @@
|
|
|
2
2
|
// `/docs/<path>` URL (and its `/de/docs/<path>` mirror). `getStaticPaths`
|
|
3
3
|
// enumerates the doc tree at build time so every page is pre-rendered.
|
|
4
4
|
//
|
|
5
|
-
// Bilingual
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// [locale] mirror
|
|
9
|
-
//
|
|
5
|
+
// Bilingual via the `docs` CONTENT COLLECTION (content/docs/{en,de}/**):
|
|
6
|
+
// the SLUG is stable across locales — only the /de URL prefix and the
|
|
7
|
+
// locale tree differ. This bare route reads the DEFAULT locale's tree; the
|
|
8
|
+
// [locale] mirror re-exports the component and loads the requested tree
|
|
9
|
+
// (with fallback to English for untranslated entries).
|
|
10
10
|
|
|
11
11
|
import type { ReactNode } from 'react'
|
|
12
12
|
import type { PageMeta } from '@voltro/web'
|
|
13
|
-
import { useParams } from '@voltro/web'
|
|
14
|
-
import { T
|
|
15
|
-
import {
|
|
13
|
+
import { useLoaderData, useParams } from '@voltro/web'
|
|
14
|
+
import { T } from '@voltro/i18n'
|
|
15
|
+
import { getCollection, getEntry, type ContentEntry } from '@voltro/content'
|
|
16
|
+
import { docs, type Doc } from '../../../collections/docs.collection'
|
|
17
|
+
import { getCatalog } from '../../../lib/locale'
|
|
16
18
|
|
|
17
19
|
export const renderMode = 'static' as const
|
|
18
20
|
export const interactive = 'none' as const
|
|
19
21
|
|
|
20
|
-
interface DocEntry {
|
|
21
|
-
readonly slug: string
|
|
22
|
-
readonly titleKey: keyof Messages
|
|
23
|
-
readonly bodyKey: keyof Messages
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// The doc tree — slugs stay identical across locales; the per-locale prose
|
|
27
|
-
// lives in the catalogs. Replace with a loader over a markdown folder / CMS
|
|
28
|
-
// / database query; the shape stays the same.
|
|
29
|
-
export const DOCS: ReadonlyArray<DocEntry> = [
|
|
30
|
-
{ slug: 'intro/getting-started', titleKey: 'docs.getting-started.title', bodyKey: 'docs.getting-started.body' },
|
|
31
|
-
{ slug: 'guides/first-page', titleKey: 'docs.first-page.title', bodyKey: 'docs.first-page.body' },
|
|
32
|
-
]
|
|
33
|
-
|
|
34
22
|
// getStaticPaths returns `{ params: { slug: '<path>' } }` entries — the
|
|
35
23
|
// framework substitutes each into `/docs/[...slug]` to enumerate the URLs
|
|
36
24
|
// to pre-render. The captured slug is the raw `/`-joined path (NOT a string
|
|
37
25
|
// array) so a single deep slug like 'intro/getting-started' renders one file.
|
|
38
26
|
export const getStaticPaths = async (): Promise<Array<{ params: { slug: string } }>> =>
|
|
39
|
-
|
|
27
|
+
(await getCollection(docs.name)).map((d) => ({ params: { slug: d.slug } }))
|
|
28
|
+
|
|
29
|
+
// Loads THIS doc's entry at build time — frontmatter decoded against the
|
|
30
|
+
// collection schema, body rendered to HTML (code fences highlighted
|
|
31
|
+
// server-side). The [locale] mirror passes the URL locale instead.
|
|
32
|
+
export const loader = async ({ params, locale }: {
|
|
33
|
+
readonly params: { readonly slug: string }
|
|
34
|
+
readonly locale?: string
|
|
35
|
+
}): Promise<ContentEntry<Doc> | null> =>
|
|
36
|
+
await getEntry<Doc>(docs.name, params.slug, locale !== undefined ? { locale } : {})
|
|
40
37
|
|
|
41
|
-
// Per-locale, per-doc <title
|
|
42
|
-
// (both threaded in at SSG time) so each variant's head is localised.
|
|
38
|
+
// Per-locale, per-doc <title> from the entry's frontmatter.
|
|
43
39
|
export const meta = ({
|
|
44
40
|
locale,
|
|
45
|
-
|
|
41
|
+
loaderData,
|
|
46
42
|
}: {
|
|
47
43
|
locale: string
|
|
48
|
-
|
|
44
|
+
loaderData: ContentEntry<Doc> | null
|
|
49
45
|
}): PageMeta => {
|
|
50
46
|
const c = getCatalog(locale)
|
|
51
|
-
const doc = DOCS.find((d) => d.slug === params.slug)
|
|
52
47
|
return {
|
|
53
|
-
title:
|
|
48
|
+
title: loaderData?.data.title ?? c['docs.notFound.title'],
|
|
54
49
|
description: c['meta.docs.description'],
|
|
55
50
|
}
|
|
56
51
|
}
|
|
@@ -59,8 +54,7 @@ const code = (chunks: ReactNode): ReactNode => <code>{chunks}</code>
|
|
|
59
54
|
|
|
60
55
|
export default function DocPage(): ReactNode {
|
|
61
56
|
const { slug } = useParams<{ slug: string }>()
|
|
62
|
-
const
|
|
63
|
-
const doc = DOCS.find((d) => d.slug === slug)
|
|
57
|
+
const doc = useLoaderData<ContentEntry<Doc> | null>()
|
|
64
58
|
if (!doc) {
|
|
65
59
|
return (
|
|
66
60
|
<article>
|
|
@@ -75,8 +69,8 @@ export default function DocPage(): ReactNode {
|
|
|
75
69
|
}
|
|
76
70
|
return (
|
|
77
71
|
<article>
|
|
78
|
-
<h1>{
|
|
79
|
-
<
|
|
72
|
+
<h1>{doc.data.title}</h1>
|
|
73
|
+
<div dangerouslySetInnerHTML={{ __html: doc.html ?? '' }} />
|
|
80
74
|
</article>
|
|
81
75
|
)
|
|
82
76
|
}
|
|
@@ -10,15 +10,25 @@
|
|
|
10
10
|
import { afterEach, describe, expect, test, vi } from 'vitest'
|
|
11
11
|
import { act, createElement, type ReactNode } from 'react'
|
|
12
12
|
import { createRoot, type Root } from 'react-dom/client'
|
|
13
|
+
import { dirname, join } from 'node:path'
|
|
14
|
+
import { fileURLToPath } from 'node:url'
|
|
15
|
+
import { setContentRoot } from '@voltro/content'
|
|
13
16
|
import en from '../locales/en'
|
|
14
17
|
import de from '../locales/de'
|
|
15
18
|
|
|
19
|
+
// The link list comes from the docs CONTENT COLLECTION — real files.
|
|
20
|
+
setContentRoot(join(dirname(fileURLToPath(import.meta.url)), '..', '..'))
|
|
21
|
+
|
|
16
22
|
const catalogs: Record<string, Record<string, string>> = { en, de }
|
|
17
23
|
let currentLocale = 'en'
|
|
18
24
|
|
|
19
25
|
const fill = (msg: string, values?: Record<string, unknown>): string =>
|
|
20
26
|
values ? msg.replace(/\{(\w+)\}/g, (_, k: string) => String(values[k] ?? `{${k}}`)) : msg
|
|
21
27
|
|
|
28
|
+
vi.mock('@voltro/web', () => ({
|
|
29
|
+
useLoaderData: () => entriesByLocale[currentLocale] ?? entriesByLocale['en'],
|
|
30
|
+
}))
|
|
31
|
+
|
|
22
32
|
vi.mock('@voltro/i18n', () => ({
|
|
23
33
|
// The locale catalogs call these at module top-level; identity mirrors the
|
|
24
34
|
// real (compile-time-only) implementations so importing them doesn't throw.
|
|
@@ -32,7 +42,11 @@ vi.mock('@voltro/i18n', () => ({
|
|
|
32
42
|
fill(catalogs[currentLocale]?.[id] ?? id, values),
|
|
33
43
|
}))
|
|
34
44
|
|
|
35
|
-
const { default: Index, meta, renderMode, interactive } = await import('./page')
|
|
45
|
+
const { default: Index, meta, renderMode, interactive, loader } = await import('./page')
|
|
46
|
+
const entriesByLocale: Record<string, Awaited<ReturnType<typeof loader>>> = {
|
|
47
|
+
en: await loader(),
|
|
48
|
+
de: await loader({ locale: 'de' }),
|
|
49
|
+
}
|
|
36
50
|
|
|
37
51
|
;(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true
|
|
38
52
|
|
|
@@ -75,7 +89,7 @@ describe('index — localized render', () => {
|
|
|
75
89
|
test('links to both doc pages with bare (en) URLs and English titles', () => {
|
|
76
90
|
currentLocale = 'en'
|
|
77
91
|
render(createElement(Index))
|
|
78
|
-
expect(hrefs()).toEqual(['/docs/
|
|
92
|
+
expect(hrefs()).toEqual(['/docs/guides/first-page', '/docs/intro/getting-started'])
|
|
79
93
|
expect(container.textContent).toContain('Getting started')
|
|
80
94
|
expect(container.textContent).toContain('Your first page')
|
|
81
95
|
})
|
|
@@ -83,7 +97,7 @@ describe('index — localized render', () => {
|
|
|
83
97
|
test('prefixes the doc links with /de and shows German titles for locale de', () => {
|
|
84
98
|
currentLocale = 'de'
|
|
85
99
|
render(createElement(Index))
|
|
86
|
-
expect(hrefs()).toEqual(['/de/docs/
|
|
100
|
+
expect(hrefs()).toEqual(['/de/docs/guides/first-page', '/de/docs/intro/getting-started'])
|
|
87
101
|
expect(container.textContent).toContain('Erste Schritte')
|
|
88
102
|
expect(container.textContent).toContain('Deine erste Seite')
|
|
89
103
|
})
|
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
// themselves live under `src/pages/docs/[...slug].tsx`.
|
|
3
3
|
//
|
|
4
4
|
// Bilingual (Strategy B): mounted at `/` (default locale) and mirrored at
|
|
5
|
-
// `/de` by src/pages/[locale]/index.tsx. The
|
|
6
|
-
//
|
|
5
|
+
// `/de` by src/pages/[locale]/index.tsx. The link list comes from the `docs`
|
|
6
|
+
// CONTENT COLLECTION — titles are the entries' frontmatter, per locale tree
|
|
7
|
+
// (the /de mirror passes its locale into the loader), so a new .md file
|
|
8
|
+
// appears here without touching this page.
|
|
7
9
|
|
|
8
10
|
import type { ReactNode } from 'react'
|
|
9
11
|
import type { PageMeta } from '@voltro/web'
|
|
12
|
+
import { useLoaderData } from '@voltro/web'
|
|
13
|
+
import { getCollection, type ContentEntry } from '@voltro/content'
|
|
10
14
|
import { T, useLocale } from '@voltro/i18n'
|
|
15
|
+
import { docs, type Doc } from '../collections/docs.collection'
|
|
11
16
|
import { getCatalog, withLocalePrefix } from '../lib/locale'
|
|
12
17
|
|
|
13
18
|
export const renderMode = 'static' as const
|
|
@@ -21,7 +26,11 @@ export const meta = ({ locale }: { locale: string }): PageMeta => {
|
|
|
21
26
|
}
|
|
22
27
|
}
|
|
23
28
|
|
|
29
|
+
export const loader = async ({ locale }: { readonly locale?: string } = {}): Promise<ReadonlyArray<ContentEntry<Doc>>> =>
|
|
30
|
+
await getCollection<Doc>(docs.name, locale !== undefined ? { locale } : {})
|
|
31
|
+
|
|
24
32
|
export default function Index(): ReactNode {
|
|
33
|
+
const entries = useLoaderData<ReadonlyArray<ContentEntry<Doc>>>()
|
|
25
34
|
const locale = useLocale()
|
|
26
35
|
return (
|
|
27
36
|
<main>
|
|
@@ -29,16 +38,11 @@ export default function Index(): ReactNode {
|
|
|
29
38
|
<T id="home.title" values={{ project: '{{capProjectName}}' }} />
|
|
30
39
|
</h1>
|
|
31
40
|
<ul>
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
</
|
|
36
|
-
|
|
37
|
-
<li>
|
|
38
|
-
<a href={withLocalePrefix('/docs/guides/first-page', locale)}>
|
|
39
|
-
<T id="docs.first-page.title" />
|
|
40
|
-
</a>
|
|
41
|
-
</li>
|
|
41
|
+
{entries.map((doc) => (
|
|
42
|
+
<li key={doc.slug}>
|
|
43
|
+
<a href={withLocalePrefix(`/docs/${doc.slug}`, locale)}>{doc.data.title}</a>
|
|
44
|
+
</li>
|
|
45
|
+
))}
|
|
42
46
|
</ul>
|
|
43
47
|
</main>
|
|
44
48
|
)
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
"test": "voltro test"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@voltro/cli": "0.
|
|
16
|
-
"@voltro/client": "0.
|
|
17
|
-
"@voltro/env": "0.
|
|
18
|
-
"@voltro/i18n": "0.
|
|
19
|
-
"@voltro/web": "0.
|
|
15
|
+
"@voltro/cli": "0.54.0",
|
|
16
|
+
"@voltro/client": "0.54.0",
|
|
17
|
+
"@voltro/env": "0.54.0",
|
|
18
|
+
"@voltro/i18n": "0.54.0",
|
|
19
|
+
"@voltro/web": "0.54.0",
|
|
20
20
|
"react": "^19.0.0",
|
|
21
21
|
"react-dom": "^19.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@voltro/devtools": "0.
|
|
24
|
+
"@voltro/devtools": "0.54.0",
|
|
25
25
|
"@types/react": "^19.0.0",
|
|
26
26
|
"@types/react-dom": "^19.0.0",
|
|
27
27
|
"jsdom": "^30.0.0",
|
|
@@ -15,3 +15,51 @@ pnpm --filter @{{projectName}}/{{appName}} dev
|
|
|
15
15
|
When you need a contact form / sign-up flow, switch
|
|
16
16
|
`interactive: 'islands'` on the page and mark the interactive
|
|
17
17
|
component with the `*.island.tsx` suffix so only that bundle ships.
|
|
18
|
+
|
|
19
|
+
## The hero image — `?image` + `<Image>`
|
|
20
|
+
|
|
21
|
+
`src/assets/hero.jpg` is imported with the **`?image` suffix**, which is the
|
|
22
|
+
explicit opt-in to the build-time pipeline: the import resolves to an optimized
|
|
23
|
+
**asset object** instead of vite's plain hashed URL, and `<Image src={hero}>`
|
|
24
|
+
renders it as a `<picture>` with one `<source>` per modern format.
|
|
25
|
+
|
|
26
|
+
- **`voltro build`** encodes AVIF + WebP + a jpeg fallback at every ladder width
|
|
27
|
+
up to the intrinsic 1200px into `dist/assets/` under content hashes, through a
|
|
28
|
+
persistent cache (`.framework/image-cache/`) — a rebuild re-encodes nothing.
|
|
29
|
+
- **`voltro dev`** transforms on demand from `/_voltro/image/<assetId>`.
|
|
30
|
+
- **`voltro start`** serves build artifacts only; there is deliberately no
|
|
31
|
+
production transform endpoint.
|
|
32
|
+
|
|
33
|
+
`width`, `height` and the blur placeholder are **not props** — they are read off
|
|
34
|
+
the asset, which is what reserves the box (CLS ≈ 0) without hand-written
|
|
35
|
+
numbers. `priority` marks it the LCP image (eager + high fetch priority).
|
|
36
|
+
|
|
37
|
+
Encoding runs on [sharp](https://sharp.pixelplumbing.com), an optional
|
|
38
|
+
dependency of `@voltro/cli` — nothing to install. If your installer omits
|
|
39
|
+
optional dependencies the pipeline serves the original with one loud warning
|
|
40
|
+
naming the fix; `voltro doctor` tells "not installed" from "binary missing".
|
|
41
|
+
|
|
42
|
+
A **dynamic** `src` (a URL from a loader or CMS frontmatter) cannot be seen at
|
|
43
|
+
build time — use the loader seam instead: `<Image src={url} loader={cdn} />`.
|
|
44
|
+
|
|
45
|
+
## The font — self-hosted, no CDN
|
|
46
|
+
|
|
47
|
+
`app.config.ts` declares one family under `fonts:`, pointing at the woff2
|
|
48
|
+
committed in `src/fonts/`. The build content-hashes it and serves it from **your
|
|
49
|
+
origin**, emits `@font-face`, computes a **size-adjusted fallback face** from the
|
|
50
|
+
file's real metrics so the swap moves no text, and puts a `<link rel="preload">`
|
|
51
|
+
in the one shell every render mode serves. `subsets: ['latin']` ships only the
|
|
52
|
+
range the page's characters need.
|
|
53
|
+
|
|
54
|
+
Nothing talks to Google Fonts (or any font host) at runtime — the visitor's IP
|
|
55
|
+
never reaches a font CDN, because no request leaves your domain.
|
|
56
|
+
|
|
57
|
+
Reference the family from CSS via the `--font-geist` variable the shell defines
|
|
58
|
+
(`src/globals.css` points the kit's `--font-sans` at it), or from TSX via
|
|
59
|
+
`localFont('Geist')` — a pure name mapper, so the slug rule stays the
|
|
60
|
+
pipeline's.
|
|
61
|
+
|
|
62
|
+
**Swapping in your own face:** drop the `woff2` **and its licence file** into
|
|
63
|
+
`src/fonts/`, then change `family` + `path` in `app.config.ts`. The framework
|
|
64
|
+
ships no font downloader on purpose — licence terms differ per family. The
|
|
65
|
+
bundled Geist is SIL OFL 1.1 (see `src/fonts/LICENSE-Geist.txt`).
|
|
@@ -21,5 +21,33 @@ export default {
|
|
|
21
21
|
// drives the [locale] mirror routing + the language switcher.
|
|
22
22
|
locales: ['en', 'de'] as const,
|
|
23
23
|
defaultLocale: 'en' as const,
|
|
24
|
+
// Self-hosted local font. The file is committed next to this config
|
|
25
|
+
// (src/fonts/) WITH its licence — Geist is SIL OFL 1.1 (Vercel /
|
|
26
|
+
// basement.studio), see src/fonts/LICENSE-Geist.txt. The framework ships no
|
|
27
|
+
// font DOWNLOADER on purpose (licence terms differ per family), so swapping
|
|
28
|
+
// in your own brand face is: drop the woff2 + its licence here, change
|
|
29
|
+
// `family` + `path`.
|
|
30
|
+
//
|
|
31
|
+
// What `voltro build` / `voltro dev` do with this: content-hash the file and
|
|
32
|
+
// serve it from YOUR origin (no font-CDN request ever leaves the browser —
|
|
33
|
+
// the GDPR answer), emit `@font-face` with `font-display`, compute a
|
|
34
|
+
// SIZE-ADJUSTED `'Geist Fallback'` face from the file's real metrics so the
|
|
35
|
+
// swap moves no text (CLS ≈ 0), and put a `<link rel="preload">` in the one
|
|
36
|
+
// generated shell every render mode serves.
|
|
37
|
+
//
|
|
38
|
+
// ONE variable face covers the whole 100–900 range, so the page makes a
|
|
39
|
+
// single font request. `subsets: ['latin']` (U+0000–00FF) covers both
|
|
40
|
+
// shipped locales — German umlauts and ß live inside that range.
|
|
41
|
+
//
|
|
42
|
+
// src/globals.css points the kit's `--font-sans` at the `--font-geist`
|
|
43
|
+
// variable the shell defines; src/pages/page.tsx reads the same variable
|
|
44
|
+
// from TSX via `localFont('Geist')`.
|
|
45
|
+
fonts: [{
|
|
46
|
+
family: 'Geist',
|
|
47
|
+
src: [{ path: 'src/fonts/Geist-Variable.woff2', weight: '100 900' }],
|
|
48
|
+
display: 'swap' as const,
|
|
49
|
+
subsets: ['latin'] as ReadonlyArray<'latin' | 'latin-ext'>,
|
|
50
|
+
fallback: 'Arial' as const,
|
|
51
|
+
}],
|
|
24
52
|
env,
|
|
25
53
|
}
|
|
@@ -12,16 +12,17 @@
|
|
|
12
12
|
"typecheck": "tsc --noEmit"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@voltro/cli": "0.
|
|
16
|
-
"@voltro/client": "0.
|
|
17
|
-
"@voltro/env": "0.
|
|
18
|
-
"@voltro/i18n": "0.
|
|
19
|
-
"@voltro/
|
|
15
|
+
"@voltro/cli": "0.54.0",
|
|
16
|
+
"@voltro/client": "0.54.0",
|
|
17
|
+
"@voltro/env": "0.54.0",
|
|
18
|
+
"@voltro/i18n": "0.54.0",
|
|
19
|
+
"@voltro/ui-shadcn": "0.54.0",
|
|
20
|
+
"@voltro/web": "0.54.0",
|
|
20
21
|
"react": "^19.0.0",
|
|
21
22
|
"react-dom": "^19.0.0"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
|
-
"@voltro/devtools": "0.
|
|
25
|
+
"@voltro/devtools": "0.54.0",
|
|
25
26
|
"@types/react": "^19.0.0",
|
|
26
27
|
"@types/react-dom": "^19.0.0",
|
|
27
28
|
"jsdom": "^30.0.0",
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
Copyright (c) 2023 Vercel, in collaboration with basement.studio
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
-----------------------------------------------------------
|
|
8
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
9
|
+
-----------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
PREAMBLE
|
|
12
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
13
|
+
development of collaborative font projects, to support the font creation
|
|
14
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
15
|
+
open framework in which fonts may be shared and improved in partnership
|
|
16
|
+
with others.
|
|
17
|
+
|
|
18
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
19
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
20
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
21
|
+
redistributed and/or sold with any software provided that any reserved
|
|
22
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
23
|
+
however, cannot be released under any other type of license. The
|
|
24
|
+
requirement for fonts to remain under this license does not apply
|
|
25
|
+
to any document created using the fonts or their derivatives.
|
|
26
|
+
|
|
27
|
+
DEFINITIONS
|
|
28
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
29
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
30
|
+
include source files, build scripts and documentation.
|
|
31
|
+
|
|
32
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
33
|
+
copyright statement(s).
|
|
34
|
+
|
|
35
|
+
"Original Version" refers to the collection of Font Software components as
|
|
36
|
+
distributed by the Copyright Holder(s).
|
|
37
|
+
|
|
38
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
39
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
40
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
41
|
+
new environment.
|
|
42
|
+
|
|
43
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
44
|
+
writer or other person who contributed to the Font Software.
|
|
45
|
+
|
|
46
|
+
PERMISSION AND CONDITIONS
|
|
47
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
48
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
49
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
50
|
+
Software, subject to the following conditions:
|
|
51
|
+
|
|
52
|
+
1) Neither the Font Software nor any of its individual components,
|
|
53
|
+
in Original or Modified Versions, may be sold by itself.
|
|
54
|
+
|
|
55
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
56
|
+
redistributed and/or sold with any software, provided that each copy
|
|
57
|
+
contains the above copyright notice and this license. These can be
|
|
58
|
+
included either as stand-alone text files, human-readable headers or
|
|
59
|
+
in the appropriate machine-readable metadata fields within text or
|
|
60
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
61
|
+
|
|
62
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
63
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
64
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
65
|
+
presented to the users.
|
|
66
|
+
|
|
67
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
68
|
+
Software shall not be used to promote, endorse or advertise any
|
|
69
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
70
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
71
|
+
permission.
|
|
72
|
+
|
|
73
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
74
|
+
must be distributed entirely under this license, and must not be
|
|
75
|
+
distributed under any other license. The requirement for fonts to
|
|
76
|
+
remain under this license does not apply to any document created
|
|
77
|
+
using the Font Software.
|
|
78
|
+
|
|
79
|
+
TERMINATION
|
|
80
|
+
This license becomes null and void if any of the above conditions are
|
|
81
|
+
not met.
|
|
82
|
+
|
|
83
|
+
DISCLAIMER
|
|
84
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
85
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
86
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
87
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
88
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
89
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
90
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
91
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
92
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -11,8 +11,23 @@
|
|
|
11
11
|
* vite-plugin auto-detect stops firing. */
|
|
12
12
|
@source "./**/*.{tsx,ts,jsx,js}";
|
|
13
13
|
|
|
14
|
+
/* Point the kit's `--font-sans` at the family the framework's font pipeline
|
|
15
|
+
* self-hosts. `--font-geist` is defined by the generated shell (the
|
|
16
|
+
* `<style data-voltro-fonts>` block) from the `fonts:` declaration in
|
|
17
|
+
* app.config.ts, and expands to `'Geist', 'Geist Fallback', Arial,
|
|
18
|
+
* sans-serif` — the second entry being the size-adjusted metric fallback the
|
|
19
|
+
* pipeline computes, which is what keeps the swap from moving any text.
|
|
20
|
+
*
|
|
21
|
+
* Without this line the declaration would still self-host the file, but no
|
|
22
|
+
* rule would reference the family: the page would ship a font it never uses. */
|
|
23
|
+
:root {
|
|
24
|
+
--font-sans: var(--font-geist);
|
|
25
|
+
}
|
|
26
|
+
|
|
14
27
|
html, body { min-height: 100vh; }
|
|
15
28
|
|
|
29
|
+
body { font-family: var(--font-sans); }
|
|
30
|
+
|
|
16
31
|
/* Gradient title — use on hero <h1> via `className="gradient-title"`. */
|
|
17
32
|
.gradient-title {
|
|
18
33
|
background: linear-gradient(180deg, var(--foreground) 0%, oklch(0.7 0.18 290) 100%);
|
|
@@ -4,3 +4,20 @@
|
|
|
4
4
|
// rejects a bare `import './globals.css'` unless the asset module is
|
|
5
5
|
// declared. Vite resolves it at build time; the declaration is type-only.
|
|
6
6
|
declare module '*.css'
|
|
7
|
+
|
|
8
|
+
// `declare module '*?image'`: the build-time image pipeline. The `?image`
|
|
9
|
+
// suffix on an image import is an explicit opt-in — it turns the import into
|
|
10
|
+
// this optimized-asset OBJECT (srcSet variants + intrinsic size + a blur data
|
|
11
|
+
// URI) instead of vite's plain hashed-URL string, so a bare image import keeps
|
|
12
|
+
// its usual semantics. `<Image src={asset}>` consumes exactly this shape.
|
|
13
|
+
declare module '*?image' {
|
|
14
|
+
const asset: {
|
|
15
|
+
readonly src: string
|
|
16
|
+
readonly width: number
|
|
17
|
+
readonly height: number
|
|
18
|
+
readonly blurDataURL: string
|
|
19
|
+
readonly srcSet: string
|
|
20
|
+
readonly sources: ReadonlyArray<{ readonly type: string; readonly srcSet: string }>
|
|
21
|
+
}
|
|
22
|
+
export default asset
|
|
23
|
+
}
|
|
@@ -8,8 +8,9 @@ export default defineLocale<typeof en>()({
|
|
|
8
8
|
'nav.home': 'Start',
|
|
9
9
|
'nav.language': 'Sprache',
|
|
10
10
|
|
|
11
|
-
'hero.tagline':
|
|
12
|
-
'hero.cta':
|
|
11
|
+
'hero.tagline': 'Ersetze diesen Hero-Text durch dein Nutzenversprechen.',
|
|
12
|
+
'hero.cta': 'Mehr erfahren →',
|
|
13
|
+
'hero.imageAlt': 'Abstrakte Verlaufsgrafik',
|
|
13
14
|
|
|
14
15
|
'features.heading': 'Funktionen',
|
|
15
16
|
'features.reactive': '<strong>Reaktive Subscriptions.</strong> Server-Status streamt per WebSocket zu den Clients.',
|