@cbnventures/nova 0.34.1 → 0.36.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/bin/nova.mjs +17 -0
- package/build/package.json +3 -2
- package/build/scaffold-versions.json +16 -6
- package/build/src/cli/generate/github/workflows-blueprint-validate.d.ts +2 -2
- package/build/src/cli/generate/github/workflows-blueprint-validate.d.ts.map +1 -1
- package/build/src/cli/generate/github/workflows-blueprint-validate.js +116 -3
- package/build/src/cli/generate/github/workflows-blueprint-validate.js.map +1 -1
- package/build/src/cli/generate/github/workflows-blueprint.d.ts +11 -5
- package/build/src/cli/generate/github/workflows-blueprint.d.ts.map +1 -1
- package/build/src/cli/generate/github/workflows-blueprint.js +411 -35
- package/build/src/cli/generate/github/workflows-blueprint.js.map +1 -1
- package/build/src/cli/generate/must-haves/agent-conventions.d.ts.map +1 -1
- package/build/src/cli/generate/must-haves/agent-conventions.js +3 -0
- package/build/src/cli/generate/must-haves/agent-conventions.js.map +1 -1
- package/build/src/cli/generate/must-haves/dotenv.d.ts.map +1 -1
- package/build/src/cli/generate/must-haves/dotenv.js +1 -0
- package/build/src/cli/generate/must-haves/dotenv.js.map +1 -1
- package/build/src/cli/scaffold/app/vite.js +1 -1
- package/build/src/cli/scaffold/app/vite.js.map +1 -1
- package/build/src/cli/utility/changelog.d.ts.map +1 -1
- package/build/src/cli/utility/changelog.js +119 -67
- package/build/src/cli/utility/changelog.js.map +1 -1
- package/build/src/cli/utility/configure.d.ts.map +1 -1
- package/build/src/cli/utility/configure.js +126 -1
- package/build/src/cli/utility/configure.js.map +1 -1
- package/build/src/lib/corepack.d.ts +2 -2
- package/build/src/lib/corepack.d.ts.map +1 -1
- package/build/src/lib/corepack.js +16 -6
- package/build/src/lib/corepack.js.map +1 -1
- package/build/src/lib/docker-packaging.d.ts.map +1 -1
- package/build/src/lib/docker-packaging.js +5 -4
- package/build/src/lib/docker-packaging.js.map +1 -1
- package/build/src/lib/dotenv.d.ts.map +1 -1
- package/build/src/lib/dotenv.js +17 -8
- package/build/src/lib/dotenv.js.map +1 -1
- package/build/src/lib/env-managed-set.d.ts.map +1 -1
- package/build/src/lib/env-managed-set.js +55 -11
- package/build/src/lib/env-managed-set.js.map +1 -1
- package/build/src/lib/env-namespace.d.ts.map +1 -1
- package/build/src/lib/env-namespace.js +1 -0
- package/build/src/lib/env-namespace.js.map +1 -1
- package/build/src/lib/env-profiles.d.ts +3 -0
- package/build/src/lib/env-profiles.d.ts.map +1 -0
- package/build/src/lib/env-profiles.js +70 -0
- package/build/src/lib/env-profiles.js.map +1 -0
- package/build/src/lib/env-status.d.ts.map +1 -1
- package/build/src/lib/env-status.js +23 -2
- package/build/src/lib/env-status.js.map +1 -1
- package/build/src/lib/item.d.ts.map +1 -1
- package/build/src/lib/item.js +20 -3
- package/build/src/lib/item.js.map +1 -1
- package/build/src/lib/nova-config.d.ts.map +1 -1
- package/build/src/lib/nova-config.js +31 -0
- package/build/src/lib/nova-config.js.map +1 -1
- package/build/src/lib/regex.d.ts +7 -0
- package/build/src/lib/regex.d.ts.map +1 -1
- package/build/src/lib/regex.js +7 -0
- package/build/src/lib/regex.js.map +1 -1
- package/build/src/lib/run-scripts.d.ts.map +1 -1
- package/build/src/lib/run-scripts.js +24 -0
- package/build/src/lib/run-scripts.js.map +1 -1
- package/build/src/lib/scaffold.d.ts.map +1 -1
- package/build/src/lib/scaffold.js +7 -0
- package/build/src/lib/scaffold.js.map +1 -1
- package/build/src/lib/workflow-templates.js +4 -4
- package/build/src/lib/workflow-templates.js.map +1 -1
- package/build/src/types/cli/generate/github/workflows-blueprint-validate.d.ts +42 -4
- package/build/src/types/cli/generate/github/workflows-blueprint.d.ts +193 -17
- package/build/src/types/cli/utility/changelog.d.ts +49 -6
- package/build/src/types/cli/utility/configure.d.ts +52 -0
- package/build/src/types/lib/corepack.d.ts +13 -0
- package/build/src/types/lib/docker-packaging.d.ts +1 -0
- package/build/src/types/lib/dotenv.d.ts +10 -3
- package/build/src/types/lib/env-managed-set.d.ts +15 -0
- package/build/src/types/lib/env-namespace.d.ts +5 -0
- package/build/src/types/lib/env-profiles.d.ts +67 -0
- package/build/src/types/lib/env-status.d.ts +9 -0
- package/build/src/types/lib/item.d.ts +20 -3
- package/build/src/types/lib/nova-config.d.ts +14 -0
- package/build/src/types/lib/run-scripts.d.ts +16 -0
- package/build/src/types/lib/scaffold.d.ts +8 -0
- package/build/src/types/shared.d.ts +47 -0
- package/build/src/types/tests/cli/generate/github/workflows-blueprint-publish-parity.test.d.ts +20 -0
- package/build/src/types/tests/cli/generate/github/workflows-blueprint-validate.test.d.ts +22 -0
- package/build/src/types/tests/cli/generate/github/workflows-blueprint.test.d.ts +16 -0
- package/build/src/types/tests/cli/generate/must-haves/agent-conventions.test.d.ts +40 -0
- package/build/src/types/tests/cli/scaffold/app/android.test.d.ts +2 -0
- package/build/src/types/tests/cli/utility/changelog.test.d.ts +48 -45
- package/build/src/types/tests/cli/utility/configure.test.d.ts +1 -0
- package/build/src/types/tests/cli/utility/run-scripts.test.d.ts +29 -0
- package/build/src/types/tests/lib/env-profiles.test.d.ts +20 -0
- package/build/src/types/tests/scaffold-output-contract.test.d.ts +27 -0
- package/build/templates/generators/must-haves/agent-conventions/AGENTS.md +8 -5
- package/build/templates/generators/must-haves/agent-conventions/CLAUDE.md +8 -5
- package/build/templates/generators/must-haves/agent-conventions/conventions/csharp.md +6 -6
- package/build/templates/generators/must-haves/agent-conventions/conventions/go.md +241 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/nova.md +155 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/python.md +7 -7
- package/build/templates/generators/must-haves/agent-conventions/conventions/rust.md +227 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/swift.md +9 -9
- package/build/templates/generators/must-haves/agent-conventions/conventions/typescript.md +145 -23
- package/build/templates/generators/must-haves/agent-conventions/conventions/universal.md +112 -103
- package/build/templates/generators/must-haves/ignore-files/gitignore +1 -0
- package/build/templates/scaffold/app/android/package.json +1 -1
- package/build/templates/scaffold/app/apple/Sources/App.swift +15 -2
- package/build/templates/scaffold/app/apple/Sources/ContentView.swift +6 -6
- package/build/templates/scaffold/app/apple/Sources/Localizable.xcstrings +75 -0
- package/build/templates/scaffold/app/apple/Tests/AppTests.swift +14 -2
- package/build/templates/scaffold/app/apple/package.json +1 -1
- package/build/templates/scaffold/app/astro/package.json +1 -1
- package/build/templates/scaffold/app/astro/src/i18n/en.json +48 -0
- package/build/templates/scaffold/app/astro/src/pages/index.astro +31 -30
- package/build/templates/scaffold/app/discord-bot/package.json +1 -1
- package/build/templates/scaffold/app/express/package.json +1 -1
- package/build/templates/scaffold/app/nextjs/package.json +1 -1
- package/build/templates/scaffold/app/nextjs/src/app/[lang]/dictionaries/en.json +31 -0
- package/build/templates/scaffold/app/nextjs/src/app/[lang]/dictionaries.ts +33 -0
- package/build/templates/scaffold/app/nextjs/src/app/[lang]/layout.tsx +92 -0
- package/build/templates/scaffold/app/nextjs/src/app/{page.tsx → [lang]/page.tsx} +54 -34
- package/build/templates/scaffold/app/nextjs/src/i18n/config.ts +42 -0
- package/build/templates/scaffold/app/nextjs/src/proxy.ts +56 -0
- package/build/templates/scaffold/app/nextjs/src/types/app/[lang]/dictionaries.d.ts +21 -0
- package/build/templates/scaffold/app/nextjs/src/types/app/[lang]/layout.d.ts +63 -0
- package/build/templates/scaffold/app/nextjs/src/types/app/[lang]/page.d.ts +22 -0
- package/build/templates/scaffold/app/nextjs/src/types/i18n/config.d.ts +22 -0
- package/build/templates/scaffold/app/nextjs/src/types/proxy.d.ts +30 -0
- package/build/templates/scaffold/app/vite/package.json +2 -2
- package/build/templates/scaffold/app/vite/vite.config.mts +3 -0
- package/build/templates/scaffold/docs/docusaurus/package.json +2 -2
- package/build/templates/scaffold/docs/docusaurus/src/pages/index.tsx +81 -20
- package/build/templates/scaffold/docs/docusaurus/vitest.config.mts +9 -0
- package/build/templates/scaffold/package/github-action/package.json +1 -1
- package/build/templates/scaffold/package/homebridge/package.json +1 -1
- package/build/templates/scaffold/package/pfsense/package.json +1 -1
- package/build/templates/scaffold/package/pfsense/port/files/usr/local/pkg/[__WORKSPACE_NAME__].inc +10 -0
- package/build/templates/scaffold/package/pfsense-root/.github/workflows/pfsense-[__WORKSPACE_NAME__].yml +62 -0
- package/build/templates/scaffold-options/app/android-launchpad/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/ui/main/MainScreen.kt +40 -34
- package/build/templates/scaffold-options/app/android-native/.gitattributes +2 -0
- package/build/templates/scaffold-options/app/android-native/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/MainActivity.kt +16 -2
- package/build/templates/scaffold-options/app/android-native/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/NavigationKeys.kt +7 -1
- package/build/templates/scaffold-options/app/android-native/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/data/DataRepository.kt +28 -4
- package/build/templates/scaffold-options/app/android-native/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/theme/Color.kt +40 -6
- package/build/templates/scaffold-options/app/android-native/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/theme/Theme.kt +22 -1
- package/build/templates/scaffold-options/app/android-native/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/theme/Type.kt +8 -2
- package/build/templates/scaffold-options/app/android-native/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/ui/main/MainScreenViewModel.kt +42 -6
- package/build/templates/scaffold-options/app/android-native/app/src/main/res/values/strings.xml +27 -0
- package/build/templates/scaffold-options/app/android-native/app/src/test/java/[__ANDROID_PACKAGE_PATH__]/ui/main/MainScreenViewModelTest.kt +31 -4
- package/build/templates/scaffold-options/app/astro/cloudflare/astro.config.mjs +7 -0
- package/build/templates/scaffold-options/app/astro/cloudflare/public/.assetsignore +15 -0
- package/build/templates/scaffold-options/app/astro/node/astro.config.mjs +7 -0
- package/build/templates/scaffold-options/app/astro/static/astro.config.mjs +7 -0
- package/build/templates/scaffold-options/docker-image/common/dockerignore +2 -0
- package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/package.json +1 -1
- package/build/templates/scaffold-options/tool/serverless/vercel-functions/package.json +1 -1
- package/package.json +3 -2
- package/build/templates/scaffold/app/nextjs/src/app/layout.tsx +0 -46
- package/build/templates/scaffold/app/nextjs/src/types/app/layout.d.ts +0 -25
- package/build/templates/scaffold/app/nextjs/src/types/app/page.d.ts +0 -8
|
@@ -1,99 +1,119 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { notFound } from 'next/navigation';
|
|
2
|
+
|
|
3
|
+
import { hasLocale } from '../../i18n/config';
|
|
4
|
+
import { getDictionary } from './dictionaries';
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
App_Lang_Page_Home_Dictionary,
|
|
8
|
+
App_Lang_Page_Home_Params,
|
|
9
|
+
App_Lang_Page_Home_Props,
|
|
10
|
+
App_Lang_Page_Home_Returns,
|
|
11
|
+
} from '../../types/app/[lang]/page.d.ts';
|
|
2
12
|
|
|
3
13
|
/**
|
|
4
14
|
* Page - Home.
|
|
5
15
|
*
|
|
6
|
-
* Renders the generated application landing page
|
|
7
|
-
*
|
|
16
|
+
* Renders the generated application landing page from the active locale's
|
|
17
|
+
* server-side dictionary.
|
|
18
|
+
*
|
|
19
|
+
* @param {App_Lang_Page_Home_Props} props - Props.
|
|
8
20
|
*
|
|
9
|
-
* @returns {
|
|
21
|
+
* @returns {App_Lang_Page_Home_Returns}
|
|
10
22
|
*
|
|
11
23
|
* @since 0.0.0
|
|
12
24
|
*/
|
|
13
|
-
function Home():
|
|
25
|
+
async function Home(props: App_Lang_Page_Home_Props): App_Lang_Page_Home_Returns {
|
|
26
|
+
const params: App_Lang_Page_Home_Params = await props['params'];
|
|
27
|
+
|
|
28
|
+
if (hasLocale(params['lang']) === false) {
|
|
29
|
+
notFound();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const dictionary: App_Lang_Page_Home_Dictionary = await getDictionary(params['lang']);
|
|
33
|
+
|
|
14
34
|
return (
|
|
15
35
|
<main className="nova-launchpad" data-nova-framework="nextjs">
|
|
16
36
|
<div className="nova-launchpad__shell">
|
|
17
37
|
<header className="nova-launchpad__header">
|
|
18
38
|
<div className="nova-launchpad__brand">
|
|
19
39
|
<svg className="nova-launchpad__mark" aria-hidden="true" viewBox="0 0 1024 1024"><use href="/nova-socials.svg#nova" /></svg>
|
|
20
|
-
<span>
|
|
40
|
+
<span>{dictionary['brandNova']}</span>
|
|
21
41
|
<span className="nova-launchpad__cross">×</span>
|
|
22
|
-
<span>
|
|
42
|
+
<span>{dictionary['brandFramework']}</span>
|
|
23
43
|
</div>
|
|
24
44
|
<a className="nova-launchpad__docs-link" href="https://nova.cbnventures.io/docs/quickstart/" target="_blank" rel="noreferrer">
|
|
25
|
-
|
|
45
|
+
{dictionary['readNovaDocs']}
|
|
26
46
|
</a>
|
|
27
47
|
</header>
|
|
28
48
|
<div className="nova-launchpad__body">
|
|
29
49
|
<section>
|
|
30
50
|
<h1 className="nova-launchpad__title">
|
|
31
|
-
<span>
|
|
32
|
-
<span className="nova-launchpad__title-accent">
|
|
51
|
+
<span>{dictionary['title']}</span>
|
|
52
|
+
<span className="nova-launchpad__title-accent">{dictionary['titleAccent']}</span>
|
|
33
53
|
</h1>
|
|
34
54
|
<p className="nova-launchpad__lede">
|
|
35
|
-
|
|
55
|
+
{dictionary['description']}
|
|
36
56
|
</p>
|
|
37
57
|
<div className="nova-launchpad__actions">
|
|
38
58
|
<a className="nova-launchpad__primary-link" href="https://nextjs.org/docs" target="_blank" rel="noreferrer">
|
|
39
|
-
|
|
59
|
+
{dictionary['exploreDocs']}
|
|
40
60
|
</a>
|
|
41
61
|
<span className="nova-launchpad__edit-hint">
|
|
42
|
-
|
|
62
|
+
{dictionary['editHint']}
|
|
43
63
|
{' '}
|
|
44
|
-
<code>src/app/page.tsx</code>
|
|
64
|
+
<code>src/app/[lang]/page.tsx</code>
|
|
45
65
|
</span>
|
|
46
66
|
</div>
|
|
47
67
|
</section>
|
|
48
|
-
<aside className="nova-launchpad__sequence" aria-label=
|
|
49
|
-
<p className="nova-launchpad__sequence-label">
|
|
68
|
+
<aside className="nova-launchpad__sequence" aria-label={dictionary['launchSequence']}>
|
|
69
|
+
<p className="nova-launchpad__sequence-label">{dictionary['launchSequence']}</p>
|
|
50
70
|
<ol className="nova-launchpad__steps">
|
|
51
71
|
<li className="nova-launchpad__step">
|
|
52
|
-
<span className="nova-launchpad__step-number">
|
|
72
|
+
<span className="nova-launchpad__step-number">{dictionary['stepOneNumber']}</span>
|
|
53
73
|
<div>
|
|
54
|
-
<strong>
|
|
55
|
-
<p>
|
|
74
|
+
<strong>{dictionary['stepOneTitle']}</strong>
|
|
75
|
+
<p>{dictionary['stepOneDescription']}</p>
|
|
56
76
|
</div>
|
|
57
77
|
</li>
|
|
58
78
|
<li className="nova-launchpad__step">
|
|
59
|
-
<span className="nova-launchpad__step-number">
|
|
79
|
+
<span className="nova-launchpad__step-number">{dictionary['stepTwoNumber']}</span>
|
|
60
80
|
<div>
|
|
61
|
-
<strong>
|
|
62
|
-
<p>
|
|
81
|
+
<strong>{dictionary['stepTwoTitle']}</strong>
|
|
82
|
+
<p>{dictionary['stepTwoDescription']}</p>
|
|
63
83
|
</div>
|
|
64
84
|
</li>
|
|
65
85
|
<li className="nova-launchpad__step">
|
|
66
|
-
<span className="nova-launchpad__step-number">
|
|
86
|
+
<span className="nova-launchpad__step-number">{dictionary['stepThreeNumber']}</span>
|
|
67
87
|
<div>
|
|
68
|
-
<strong>
|
|
69
|
-
<p>
|
|
88
|
+
<strong>{dictionary['stepThreeTitle']}</strong>
|
|
89
|
+
<p>{dictionary['stepThreeDescription']}</p>
|
|
70
90
|
</div>
|
|
71
91
|
</li>
|
|
72
92
|
</ol>
|
|
73
93
|
</aside>
|
|
74
94
|
</div>
|
|
75
95
|
<footer className="nova-launchpad__footer">
|
|
76
|
-
<span>
|
|
77
|
-
<nav className="nova-launchpad__socials" aria-label=
|
|
78
|
-
<a className="nova-launchpad__social-link" href="https://www.facebook.com/cbnventures" target="_blank" rel="noreferrer" aria-label=
|
|
96
|
+
<span>{dictionary['footerCredit']}</span>
|
|
97
|
+
<nav className="nova-launchpad__socials" aria-label={dictionary['socialLabel']}>
|
|
98
|
+
<a className="nova-launchpad__social-link" href="https://www.facebook.com/cbnventures" target="_blank" rel="noreferrer" aria-label={dictionary['facebook']}>
|
|
79
99
|
<svg className="nova-launchpad__social-icon" aria-hidden="true"><use href="/nova-socials.svg#facebook" /></svg>
|
|
80
100
|
</a>
|
|
81
|
-
<a className="nova-launchpad__social-link" href="https://x.com/cbnventures" target="_blank" rel="noreferrer" aria-label=
|
|
101
|
+
<a className="nova-launchpad__social-link" href="https://x.com/cbnventures" target="_blank" rel="noreferrer" aria-label={dictionary['x']}>
|
|
82
102
|
<svg className="nova-launchpad__social-icon" aria-hidden="true"><use href="/nova-socials.svg#x" /></svg>
|
|
83
103
|
</a>
|
|
84
|
-
<a className="nova-launchpad__social-link" href="https://www.youtube.com/@cbnventures" target="_blank" rel="noreferrer" aria-label=
|
|
104
|
+
<a className="nova-launchpad__social-link" href="https://www.youtube.com/@cbnventures" target="_blank" rel="noreferrer" aria-label={dictionary['youtube']}>
|
|
85
105
|
<svg className="nova-launchpad__social-icon" aria-hidden="true"><use href="/nova-socials.svg#youtube" /></svg>
|
|
86
106
|
</a>
|
|
87
|
-
<a className="nova-launchpad__social-link" href="https://www.instagram.com/cbnventures/" target="_blank" rel="noreferrer" aria-label=
|
|
107
|
+
<a className="nova-launchpad__social-link" href="https://www.instagram.com/cbnventures/" target="_blank" rel="noreferrer" aria-label={dictionary['instagram']}>
|
|
88
108
|
<svg className="nova-launchpad__social-icon" aria-hidden="true"><use href="/nova-socials.svg#instagram" /></svg>
|
|
89
109
|
</a>
|
|
90
|
-
<a className="nova-launchpad__social-link" href="https://github.com/cbnventures" target="_blank" rel="noreferrer" aria-label=
|
|
110
|
+
<a className="nova-launchpad__social-link" href="https://github.com/cbnventures" target="_blank" rel="noreferrer" aria-label={dictionary['github']}>
|
|
91
111
|
<svg className="nova-launchpad__social-icon" aria-hidden="true"><use href="/nova-socials.svg#github" /></svg>
|
|
92
112
|
</a>
|
|
93
|
-
<a className="nova-launchpad__social-link" href="https://play.google.com/store/apps/dev?id=6419450160526226105" target="_blank" rel="noreferrer" aria-label=
|
|
113
|
+
<a className="nova-launchpad__social-link" href="https://play.google.com/store/apps/dev?id=6419450160526226105" target="_blank" rel="noreferrer" aria-label={dictionary['googlePlay']}>
|
|
94
114
|
<svg className="nova-launchpad__social-icon" aria-hidden="true"><use href="/nova-socials.svg#google-play" /></svg>
|
|
95
115
|
</a>
|
|
96
|
-
<a className="nova-launchpad__social-link" href="https://www.linkedin.com/company/cbnventures/" target="_blank" rel="noreferrer" aria-label=
|
|
116
|
+
<a className="nova-launchpad__social-link" href="https://www.linkedin.com/company/cbnventures/" target="_blank" rel="noreferrer" aria-label={dictionary['linkedin']}>
|
|
97
117
|
<svg className="nova-launchpad__social-icon" aria-hidden="true"><use href="/nova-socials.svg#linkedin" /></svg>
|
|
98
118
|
</a>
|
|
99
119
|
</nav>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
I18n_Config_DefaultLocale,
|
|
3
|
+
I18n_Config_HasLocale_Locale,
|
|
4
|
+
I18n_Config_HasLocale_TypeGuard,
|
|
5
|
+
I18n_Config_Locales,
|
|
6
|
+
} from '../types/i18n/config.d.ts';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Config - Default Locale.
|
|
10
|
+
*
|
|
11
|
+
* Keeps English available before consumers add translated dictionaries.
|
|
12
|
+
* Acts as the destination for requests without a supported locale prefix.
|
|
13
|
+
*
|
|
14
|
+
* @since 0.0.0
|
|
15
|
+
*/
|
|
16
|
+
export const defaultLocale: I18n_Config_DefaultLocale = 'en';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Config - Locales.
|
|
20
|
+
*
|
|
21
|
+
* Defines the locale routes generated by the application.
|
|
22
|
+
* Consumers extend this list alongside their server-side dictionaries.
|
|
23
|
+
*
|
|
24
|
+
* @since 0.0.0
|
|
25
|
+
*/
|
|
26
|
+
export const locales: I18n_Config_Locales = ['en'];
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Config - Has Locale.
|
|
30
|
+
*
|
|
31
|
+
* Narrows an incoming route segment to a supported application locale.
|
|
32
|
+
* Keeps route validation synchronized with the configured locale list.
|
|
33
|
+
*
|
|
34
|
+
* @param {I18n_Config_HasLocale_Locale} locale - Locale.
|
|
35
|
+
*
|
|
36
|
+
* @returns {I18n_Config_HasLocale_TypeGuard}
|
|
37
|
+
*
|
|
38
|
+
* @since 0.0.0
|
|
39
|
+
*/
|
|
40
|
+
export function hasLocale(locale: I18n_Config_HasLocale_Locale): locale is I18n_Config_HasLocale_TypeGuard {
|
|
41
|
+
return locales.some((supportedLocale) => supportedLocale === locale);
|
|
42
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
defaultLocale,
|
|
5
|
+
locales,
|
|
6
|
+
} from './i18n/config';
|
|
7
|
+
|
|
8
|
+
import type {
|
|
9
|
+
Proxy_Config,
|
|
10
|
+
Proxy_LocalizeRequest_Pathname,
|
|
11
|
+
Proxy_LocalizeRequest_PathnameHasLocale,
|
|
12
|
+
Proxy_LocalizeRequest_Request,
|
|
13
|
+
Proxy_LocalizeRequest_Returns,
|
|
14
|
+
Proxy_LocalizeRequest_Url,
|
|
15
|
+
} from './types/proxy.d.ts';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Proxy - Config.
|
|
19
|
+
*
|
|
20
|
+
* Runs locale routing for application pages while leaving framework internals
|
|
21
|
+
* and static files untouched.
|
|
22
|
+
*
|
|
23
|
+
* @since 0.0.0
|
|
24
|
+
*/
|
|
25
|
+
export const config: Proxy_Config = {
|
|
26
|
+
matcher: ['/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt|.*\\..*).*)'],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Proxy - Localize Request.
|
|
31
|
+
*
|
|
32
|
+
* Keeps an existing supported locale route or redirects to the English route.
|
|
33
|
+
* Consumers can add browser-language negotiation when they add more locales.
|
|
34
|
+
*
|
|
35
|
+
* @param {Proxy_LocalizeRequest_Request} request - Request.
|
|
36
|
+
*
|
|
37
|
+
* @returns {Proxy_LocalizeRequest_Returns}
|
|
38
|
+
*
|
|
39
|
+
* @since 0.0.0
|
|
40
|
+
*/
|
|
41
|
+
function localizeRequest(request: Proxy_LocalizeRequest_Request): Proxy_LocalizeRequest_Returns {
|
|
42
|
+
const pathname: Proxy_LocalizeRequest_Pathname = request.nextUrl.pathname;
|
|
43
|
+
const pathnameHasLocale: Proxy_LocalizeRequest_PathnameHasLocale = locales.some((locale) => pathname === `/${locale}` || pathname.startsWith(`/${locale}/`));
|
|
44
|
+
|
|
45
|
+
if (pathnameHasLocale === true) {
|
|
46
|
+
return NextResponse.next();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const url: Proxy_LocalizeRequest_Url = request.nextUrl.clone();
|
|
50
|
+
|
|
51
|
+
url.pathname = `/${defaultLocale}${pathname}`;
|
|
52
|
+
|
|
53
|
+
return NextResponse.redirect(url);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export default localizeRequest;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dictionaries.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.0.0
|
|
5
|
+
*/
|
|
6
|
+
export type App_Lang_Dictionaries_Dictionaries_Dictionary = Record<string, string>;
|
|
7
|
+
|
|
8
|
+
export type App_Lang_Dictionaries_Dictionaries_Loader_Returns = Promise<App_Lang_Dictionaries_Dictionaries_Dictionary>;
|
|
9
|
+
|
|
10
|
+
export type App_Lang_Dictionaries_Dictionaries_Loader = () => App_Lang_Dictionaries_Dictionaries_Loader_Returns;
|
|
11
|
+
|
|
12
|
+
export type App_Lang_Dictionaries_Dictionaries = Record<'en', App_Lang_Dictionaries_Dictionaries_Loader>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Dictionaries.
|
|
16
|
+
*
|
|
17
|
+
* @since 0.0.0
|
|
18
|
+
*/
|
|
19
|
+
export type App_Lang_Dictionaries_GetDictionary_Locale = keyof App_Lang_Dictionaries_Dictionaries;
|
|
20
|
+
|
|
21
|
+
export type App_Lang_Dictionaries_GetDictionary_Returns = Promise<App_Lang_Dictionaries_Dictionaries_Dictionary>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Metadata } from 'next';
|
|
2
|
+
import type {
|
|
3
|
+
ReactElement,
|
|
4
|
+
ReactNode,
|
|
5
|
+
} from 'react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Layout.
|
|
9
|
+
*
|
|
10
|
+
* @since 0.0.0
|
|
11
|
+
*/
|
|
12
|
+
export type App_Lang_Layout_GenerateMetadata_Props_Params_Lang = string;
|
|
13
|
+
|
|
14
|
+
export type App_Lang_Layout_GenerateMetadata_Props_Params = {
|
|
15
|
+
lang: App_Lang_Layout_GenerateMetadata_Props_Params_Lang;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type App_Lang_Layout_GenerateMetadata_Props = {
|
|
19
|
+
params: Promise<App_Lang_Layout_GenerateMetadata_Props_Params>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type App_Lang_Layout_GenerateMetadata_Returns = Promise<Metadata>;
|
|
23
|
+
|
|
24
|
+
export type App_Lang_Layout_GenerateMetadata_Params = App_Lang_Layout_GenerateMetadata_Props_Params;
|
|
25
|
+
|
|
26
|
+
export type App_Lang_Layout_GenerateMetadata_Dictionary = Record<string, string>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Layout.
|
|
30
|
+
*
|
|
31
|
+
* @since 0.0.0
|
|
32
|
+
*/
|
|
33
|
+
export type App_Lang_Layout_GenerateStaticParams_Returns = App_Lang_Layout_GenerateStaticParams_StaticParams;
|
|
34
|
+
|
|
35
|
+
export type App_Lang_Layout_GenerateStaticParams_StaticParam_Lang = 'en';
|
|
36
|
+
|
|
37
|
+
export type App_Lang_Layout_GenerateStaticParams_StaticParam = {
|
|
38
|
+
lang: App_Lang_Layout_GenerateStaticParams_StaticParam_Lang;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type App_Lang_Layout_GenerateStaticParams_StaticParams = App_Lang_Layout_GenerateStaticParams_StaticParam[];
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Layout.
|
|
45
|
+
*
|
|
46
|
+
* @since 0.0.0
|
|
47
|
+
*/
|
|
48
|
+
export type App_Lang_Layout_RootLayout_Props_Children = ReactNode;
|
|
49
|
+
|
|
50
|
+
export type App_Lang_Layout_RootLayout_Props_Params_Lang = string;
|
|
51
|
+
|
|
52
|
+
export type App_Lang_Layout_RootLayout_Props_Params = {
|
|
53
|
+
lang: App_Lang_Layout_RootLayout_Props_Params_Lang;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type App_Lang_Layout_RootLayout_Props = {
|
|
57
|
+
children: App_Lang_Layout_RootLayout_Props_Children;
|
|
58
|
+
params: Promise<App_Lang_Layout_RootLayout_Props_Params>;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type App_Lang_Layout_RootLayout_Returns = Promise<ReactElement>;
|
|
62
|
+
|
|
63
|
+
export type App_Lang_Layout_RootLayout_Params = App_Lang_Layout_RootLayout_Props_Params;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Page.
|
|
5
|
+
*
|
|
6
|
+
* @since 0.0.0
|
|
7
|
+
*/
|
|
8
|
+
export type App_Lang_Page_Home_Props_Params_Lang = string;
|
|
9
|
+
|
|
10
|
+
export type App_Lang_Page_Home_Props_Params = {
|
|
11
|
+
lang: App_Lang_Page_Home_Props_Params_Lang;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type App_Lang_Page_Home_Props = {
|
|
15
|
+
params: Promise<App_Lang_Page_Home_Props_Params>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type App_Lang_Page_Home_Returns = Promise<ReactElement>;
|
|
19
|
+
|
|
20
|
+
export type App_Lang_Page_Home_Params = App_Lang_Page_Home_Props_Params;
|
|
21
|
+
|
|
22
|
+
export type App_Lang_Page_Home_Dictionary = Record<string, string>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.0.0
|
|
5
|
+
*/
|
|
6
|
+
export type I18n_Config_DefaultLocale = 'en';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Config.
|
|
10
|
+
*
|
|
11
|
+
* @since 0.0.0
|
|
12
|
+
*/
|
|
13
|
+
export type I18n_Config_HasLocale_Locale = string;
|
|
14
|
+
|
|
15
|
+
export type I18n_Config_HasLocale_TypeGuard = I18n_Config_DefaultLocale;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Config.
|
|
19
|
+
*
|
|
20
|
+
* @since 0.0.0
|
|
21
|
+
*/
|
|
22
|
+
export type I18n_Config_Locales = readonly I18n_Config_DefaultLocale[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NextRequest,
|
|
3
|
+
NextResponse,
|
|
4
|
+
} from 'next/server';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Proxy - Config.
|
|
8
|
+
*
|
|
9
|
+
* @since 0.0.0
|
|
10
|
+
*/
|
|
11
|
+
export type Proxy_Config_Matcher = string[];
|
|
12
|
+
|
|
13
|
+
export type Proxy_Config = {
|
|
14
|
+
matcher: Proxy_Config_Matcher;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Proxy - Localize Request.
|
|
19
|
+
*
|
|
20
|
+
* @since 0.0.0
|
|
21
|
+
*/
|
|
22
|
+
export type Proxy_LocalizeRequest_Request = NextRequest;
|
|
23
|
+
|
|
24
|
+
export type Proxy_LocalizeRequest_Returns = NextResponse;
|
|
25
|
+
|
|
26
|
+
export type Proxy_LocalizeRequest_Pathname = string;
|
|
27
|
+
|
|
28
|
+
export type Proxy_LocalizeRequest_PathnameHasLocale = boolean;
|
|
29
|
+
|
|
30
|
+
export type Proxy_LocalizeRequest_Url = NextRequest['nextUrl'];
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"build:types": "nova utility type-check --project tsconfig.json",
|
|
17
17
|
"build:app": "vite build",
|
|
18
18
|
"clean": "nova utility run-scripts --parallel \"clean:*\"",
|
|
19
|
-
"clean:build": "shx rm -rf ./
|
|
19
|
+
"clean:build": "shx rm -rf ./build"
|
|
20
20
|
},
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": "[__SCAFFOLD_VERSION_NODE_ENGINE__]"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@cbnventures/nova": "0.
|
|
25
|
+
"@cbnventures/nova": "0.36.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "[__SCAFFOLD_VERSION_TYPES_NODE_22__]",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"node": "[__SCAFFOLD_VERSION_NODE_ENGINE__]"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@cbnventures/docusaurus-preset-nova": "0.
|
|
31
|
-
"@cbnventures/nova": "0.
|
|
30
|
+
"@cbnventures/docusaurus-preset-nova": "0.36.0",
|
|
31
|
+
"@cbnventures/nova": "0.36.0",
|
|
32
32
|
"@docusaurus/core": "[__SCAFFOLD_VERSION_DOCUSAURUS__]",
|
|
33
33
|
"react": "[__SCAFFOLD_VERSION_REACT__]",
|
|
34
34
|
"react-dom": "[__SCAFFOLD_VERSION_REACT_DOM__]"
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
Hero,
|
|
5
5
|
Stats,
|
|
6
6
|
} from '@cbnventures/docusaurus-preset-nova/blocks';
|
|
7
|
+
import { translate } from '@docusaurus/Translate';
|
|
7
8
|
import Layout from '@theme/Layout';
|
|
8
9
|
|
|
9
10
|
import type {
|
|
@@ -35,66 +36,126 @@ function Home(): Pages_Index_Home_Returns {
|
|
|
35
36
|
return (
|
|
36
37
|
<Layout>
|
|
37
38
|
<Hero
|
|
38
|
-
eyebrow=
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
eyebrow={translate({
|
|
40
|
+
id: 'homepage.hero.eyebrow',
|
|
41
|
+
message: 'Nova × Docusaurus',
|
|
42
|
+
})}
|
|
43
|
+
heading={translate({
|
|
44
|
+
id: 'homepage.hero.heading',
|
|
45
|
+
message: 'Docusaurus starts here.',
|
|
46
|
+
})}
|
|
47
|
+
tagline={translate({
|
|
48
|
+
id: 'homepage.hero.tagline',
|
|
49
|
+
message: 'A documentation workspace with a cohesive Nova preset, strict checks, local search, and room to grow.',
|
|
50
|
+
})}
|
|
51
|
+
ctaLabel={translate({
|
|
52
|
+
id: 'homepage.hero.ctaLabel',
|
|
53
|
+
message: 'Read the introduction',
|
|
54
|
+
})}
|
|
42
55
|
ctaLink="/docs/intro"
|
|
43
|
-
secondaryCtaLabel=
|
|
56
|
+
secondaryCtaLabel={translate({
|
|
57
|
+
id: 'homepage.hero.secondaryCtaLabel',
|
|
58
|
+
message: 'Read Nova Docs',
|
|
59
|
+
})}
|
|
44
60
|
secondaryCtaLink="https://nova.cbnventures.io/docs/quickstart/"
|
|
45
61
|
/>
|
|
46
62
|
<main id="components">
|
|
47
63
|
<Stats
|
|
48
|
-
heading=
|
|
49
|
-
|
|
64
|
+
heading={translate({
|
|
65
|
+
id: 'homepage.stats.heading',
|
|
66
|
+
message: 'Ready from the first build',
|
|
67
|
+
})}
|
|
68
|
+
description={translate({
|
|
69
|
+
id: 'homepage.stats.description',
|
|
70
|
+
message: 'The generated workspace demonstrates the preset instead of leaving its most useful surfaces empty.',
|
|
71
|
+
})}
|
|
50
72
|
surface="alt"
|
|
51
73
|
items={[
|
|
52
74
|
{
|
|
53
75
|
value: '6',
|
|
54
|
-
label:
|
|
76
|
+
label: translate({
|
|
77
|
+
id: 'homepage.stats.visualPresets',
|
|
78
|
+
message: 'Visual presets',
|
|
79
|
+
}),
|
|
55
80
|
color: 'primary',
|
|
56
81
|
},
|
|
57
82
|
{
|
|
58
83
|
value: '1',
|
|
59
|
-
label:
|
|
84
|
+
label: translate({
|
|
85
|
+
id: 'homepage.stats.localSearchIndex',
|
|
86
|
+
message: 'Local search index',
|
|
87
|
+
}),
|
|
60
88
|
color: 'accent',
|
|
61
89
|
},
|
|
62
90
|
{
|
|
63
91
|
value: '0',
|
|
64
|
-
label:
|
|
92
|
+
label: translate({
|
|
93
|
+
id: 'homepage.stats.swizzlesRequired',
|
|
94
|
+
message: 'Swizzles required',
|
|
95
|
+
}),
|
|
65
96
|
color: 'primary',
|
|
66
97
|
},
|
|
67
98
|
{
|
|
68
99
|
value: '100%',
|
|
69
|
-
label:
|
|
100
|
+
label: translate({
|
|
101
|
+
id: 'homepage.stats.typescriptConfigured',
|
|
102
|
+
message: 'TypeScript configured',
|
|
103
|
+
}),
|
|
70
104
|
color: 'accent',
|
|
71
105
|
},
|
|
72
106
|
]}
|
|
73
107
|
/>
|
|
74
108
|
<Features
|
|
75
|
-
heading=
|
|
109
|
+
heading={translate({
|
|
110
|
+
id: 'homepage.features.heading',
|
|
111
|
+
message: 'A complete documentation starting point',
|
|
112
|
+
})}
|
|
76
113
|
items={[
|
|
77
114
|
{
|
|
78
115
|
icon: 'lucide:pencil',
|
|
79
|
-
title:
|
|
80
|
-
|
|
116
|
+
title: translate({
|
|
117
|
+
id: 'homepage.features.write.title',
|
|
118
|
+
message: 'Write',
|
|
119
|
+
}),
|
|
120
|
+
description: translate({
|
|
121
|
+
id: 'homepage.features.write.description',
|
|
122
|
+
message: 'Start with the sample guides and grow the sidebar around the way your readers think.',
|
|
123
|
+
}),
|
|
81
124
|
},
|
|
82
125
|
{
|
|
83
126
|
icon: 'lucide:compass',
|
|
84
|
-
title:
|
|
85
|
-
|
|
127
|
+
title: translate({
|
|
128
|
+
id: 'homepage.features.navigate.title',
|
|
129
|
+
message: 'Navigate',
|
|
130
|
+
}),
|
|
131
|
+
description: translate({
|
|
132
|
+
id: 'homepage.features.navigate.description',
|
|
133
|
+
message: 'Use the populated navbar, footer, search, and sidebar as a real information architecture.',
|
|
134
|
+
}),
|
|
86
135
|
},
|
|
87
136
|
{
|
|
88
137
|
icon: 'lucide:rocket',
|
|
89
|
-
title:
|
|
90
|
-
|
|
138
|
+
title: translate({
|
|
139
|
+
id: 'homepage.features.publish.title',
|
|
140
|
+
message: 'Publish',
|
|
141
|
+
}),
|
|
142
|
+
description: translate({
|
|
143
|
+
id: 'homepage.features.publish.description',
|
|
144
|
+
message: 'Build the same optimized and searchable documentation site Nova validates locally and in automation.',
|
|
145
|
+
}),
|
|
91
146
|
},
|
|
92
147
|
]}
|
|
93
148
|
/>
|
|
94
149
|
{(blogEnabled === true) && (
|
|
95
150
|
<BlogPreview
|
|
96
|
-
heading=
|
|
97
|
-
|
|
151
|
+
heading={translate({
|
|
152
|
+
id: 'homepage.blog.heading',
|
|
153
|
+
message: 'From the starter blog',
|
|
154
|
+
})}
|
|
155
|
+
description={translate({
|
|
156
|
+
id: 'homepage.blog.description',
|
|
157
|
+
message: 'The most recent posts appear automatically when the docs-and-blog content model is selected.',
|
|
158
|
+
})}
|
|
98
159
|
auto={true}
|
|
99
160
|
limit={3}
|
|
100
161
|
sort="newest"
|
|
@@ -9,6 +9,15 @@ import { defineConfig } from 'vitest/config';
|
|
|
9
9
|
* @since 0.20.0
|
|
10
10
|
*/
|
|
11
11
|
const currentFilePath = fileURLToPath(import.meta.url);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Vitest Configuration - Root directory.
|
|
15
|
+
*
|
|
16
|
+
* Stores this module-level value in one named location.
|
|
17
|
+
* Related code reuses it instead of duplicating the definition.
|
|
18
|
+
*
|
|
19
|
+
* @since UNRELEASED
|
|
20
|
+
*/
|
|
12
21
|
const rootDirectory = dirname(currentFilePath);
|
|
13
22
|
|
|
14
23
|
export default defineConfig({
|