@cbnventures/nova 0.34.1 → 0.35.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.
Files changed (41) hide show
  1. package/build/package.json +1 -1
  2. package/build/src/types/tests/cli/scaffold/app/android.test.d.ts +2 -0
  3. package/build/src/types/tests/scaffold-output-contract.test.d.ts +27 -0
  4. package/build/templates/scaffold/app/android/package.json +1 -1
  5. package/build/templates/scaffold/app/apple/Sources/ContentView.swift +6 -6
  6. package/build/templates/scaffold/app/apple/Sources/Localizable.xcstrings +75 -0
  7. package/build/templates/scaffold/app/apple/package.json +1 -1
  8. package/build/templates/scaffold/app/astro/package.json +1 -1
  9. package/build/templates/scaffold/app/astro/src/i18n/en.json +48 -0
  10. package/build/templates/scaffold/app/astro/src/pages/index.astro +31 -30
  11. package/build/templates/scaffold/app/discord-bot/package.json +1 -1
  12. package/build/templates/scaffold/app/express/package.json +1 -1
  13. package/build/templates/scaffold/app/nextjs/package.json +1 -1
  14. package/build/templates/scaffold/app/nextjs/src/app/[lang]/dictionaries/en.json +31 -0
  15. package/build/templates/scaffold/app/nextjs/src/app/[lang]/dictionaries.ts +33 -0
  16. package/build/templates/scaffold/app/nextjs/src/app/[lang]/layout.tsx +92 -0
  17. package/build/templates/scaffold/app/nextjs/src/app/{page.tsx → [lang]/page.tsx} +54 -34
  18. package/build/templates/scaffold/app/nextjs/src/i18n/config.ts +42 -0
  19. package/build/templates/scaffold/app/nextjs/src/proxy.ts +56 -0
  20. package/build/templates/scaffold/app/nextjs/src/types/app/[lang]/dictionaries.d.ts +21 -0
  21. package/build/templates/scaffold/app/nextjs/src/types/app/[lang]/layout.d.ts +63 -0
  22. package/build/templates/scaffold/app/nextjs/src/types/app/[lang]/page.d.ts +22 -0
  23. package/build/templates/scaffold/app/nextjs/src/types/i18n/config.d.ts +22 -0
  24. package/build/templates/scaffold/app/nextjs/src/types/proxy.d.ts +30 -0
  25. package/build/templates/scaffold/app/vite/package.json +1 -1
  26. package/build/templates/scaffold/docs/docusaurus/package.json +2 -2
  27. package/build/templates/scaffold/docs/docusaurus/src/pages/index.tsx +81 -20
  28. package/build/templates/scaffold/package/github-action/package.json +1 -1
  29. package/build/templates/scaffold/package/homebridge/package.json +1 -1
  30. package/build/templates/scaffold/package/pfsense/package.json +1 -1
  31. package/build/templates/scaffold-options/app/android-launchpad/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/ui/main/MainScreen.kt +40 -34
  32. package/build/templates/scaffold-options/app/android-native/app/src/main/res/values/strings.xml +27 -0
  33. package/build/templates/scaffold-options/app/astro/cloudflare/astro.config.mjs +7 -0
  34. package/build/templates/scaffold-options/app/astro/node/astro.config.mjs +7 -0
  35. package/build/templates/scaffold-options/app/astro/static/astro.config.mjs +7 -0
  36. package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/package.json +1 -1
  37. package/build/templates/scaffold-options/tool/serverless/vercel-functions/package.json +1 -1
  38. package/package.json +1 -1
  39. package/build/templates/scaffold/app/nextjs/src/app/layout.tsx +0 -46
  40. package/build/templates/scaffold/app/nextjs/src/types/app/layout.d.ts +0 -25
  41. package/build/templates/scaffold/app/nextjs/src/types/app/page.d.ts +0 -8
@@ -1,5 +1,6 @@
1
1
  package [__ANDROID_APPLICATION_ID__].ui.main
2
2
 
3
+ import androidx.annotation.StringRes
3
4
  import androidx.compose.foundation.background
4
5
  import androidx.compose.foundation.border
5
6
  import androidx.compose.foundation.clickable
@@ -33,6 +34,7 @@ import androidx.compose.ui.Modifier
33
34
  import androidx.compose.ui.draw.clip
34
35
  import androidx.compose.ui.platform.LocalUriHandler
35
36
  import androidx.compose.ui.res.painterResource
37
+ import androidx.compose.ui.res.stringResource
36
38
  import androidx.compose.ui.semantics.heading
37
39
  import androidx.compose.ui.semantics.Role
38
40
  import androidx.compose.ui.semantics.semantics
@@ -116,7 +118,7 @@ public fun MainScreen(
116
118
  */
117
119
  @Composable
118
120
  internal fun MainScreen(data: List<String>, modifier: Modifier = Modifier) {
119
- val platformName = data.firstOrNull() ?: "Android"
121
+ val platformName = data.firstOrNull() ?: stringResource(R.string.platform_android)
120
122
  val uriHandler = LocalUriHandler.current
121
123
 
122
124
  Column(
@@ -196,11 +198,11 @@ private fun MainScreenHeader(
196
198
  Image(
197
199
  modifier = Modifier.size(36.dp),
198
200
  painter = painterResource(R.drawable.nova_logo),
199
- contentDescription = "Nova",
201
+ contentDescription = stringResource(R.string.nova_logo_content_description),
200
202
  )
201
203
 
202
204
  Text(
203
- text = "Nova × $platformName",
205
+ text = stringResource(R.string.nova_platform_name, platformName),
204
206
  fontWeight = FontWeight.Bold,
205
207
  style = MaterialTheme.typography.labelLarge,
206
208
  )
@@ -211,7 +213,7 @@ private fun MainScreenHeader(
211
213
  horizontalArrangement = Arrangement.spacedBy(6.dp),
212
214
  verticalAlignment = Alignment.CenterVertically,
213
215
  ) {
214
- Text("Read Nova Docs")
216
+ Text(stringResource(R.string.read_nova_docs))
215
217
 
216
218
  Icon(
217
219
  modifier = Modifier.size(16.dp),
@@ -242,7 +244,7 @@ private fun MainScreenIntroduction(
242
244
  Column(modifier = modifier) {
243
245
  Text(
244
246
  modifier = Modifier.semantics { heading() },
245
- text = "[__WORKSPACE_TITLE__] starts here.",
247
+ text = stringResource(R.string.starter_title),
246
248
  fontSize = 48.sp,
247
249
  fontWeight = FontWeight.Bold,
248
250
  letterSpacing = (-1.8).sp,
@@ -252,7 +254,7 @@ private fun MainScreenIntroduction(
252
254
  Spacer(modifier = Modifier.height(18.dp))
253
255
 
254
256
  Text(
255
- text = "A native Android workspace with strict checks, tests, and a clean path from first screen to release.",
257
+ text = stringResource(R.string.starter_description),
256
258
  color = MaterialTheme.colorScheme.onSurfaceVariant,
257
259
  lineHeight = 24.sp,
258
260
  style = MaterialTheme.typography.bodyLarge,
@@ -265,7 +267,7 @@ private fun MainScreenIntroduction(
265
267
  horizontalArrangement = Arrangement.spacedBy(6.dp),
266
268
  verticalAlignment = Alignment.CenterVertically,
267
269
  ) {
268
- Text("Explore Android docs")
270
+ Text(stringResource(R.string.explore_android_docs))
269
271
 
270
272
  Icon(
271
273
  modifier = Modifier.size(16.dp),
@@ -278,7 +280,7 @@ private fun MainScreenIntroduction(
278
280
  Spacer(modifier = Modifier.height(14.dp))
279
281
 
280
282
  Text(
281
- text = "Start in ui/main/MainScreen.kt",
283
+ text = stringResource(R.string.starter_edit_hint),
282
284
  color = MaterialTheme.colorScheme.onSurfaceVariant,
283
285
  style = MaterialTheme.typography.labelMedium,
284
286
  )
@@ -299,7 +301,7 @@ private fun MainScreenIntroduction(
299
301
  private fun MainScreenFooter(onSocialClick: (String) -> Unit) {
300
302
  Column(verticalArrangement = Arrangement.spacedBy(10.dp)) {
301
303
  Text(
302
- text = "Generated with Nova",
304
+ text = stringResource(R.string.generated_with_nova),
303
305
  color = MaterialTheme.colorScheme.onSurfaceVariant,
304
306
  fontWeight = FontWeight.SemiBold,
305
307
  letterSpacing = 1.1.sp,
@@ -309,43 +311,43 @@ private fun MainScreenFooter(onSocialClick: (String) -> Unit) {
309
311
  Row {
310
312
  MainScreenSocialLink(
311
313
  icon = R.drawable.social_facebook,
312
- label = "Facebook",
314
+ label = R.string.social_facebook,
313
315
  url = "https://www.facebook.com/cbnventures",
314
316
  onSocialClick = onSocialClick,
315
317
  )
316
318
  MainScreenSocialLink(
317
319
  icon = R.drawable.social_x,
318
- label = "X",
320
+ label = R.string.social_x,
319
321
  url = "https://x.com/cbnventures",
320
322
  onSocialClick = onSocialClick,
321
323
  )
322
324
  MainScreenSocialLink(
323
325
  icon = R.drawable.social_youtube,
324
- label = "YouTube",
326
+ label = R.string.social_youtube,
325
327
  url = "https://www.youtube.com/@cbnventures",
326
328
  onSocialClick = onSocialClick,
327
329
  )
328
330
  MainScreenSocialLink(
329
331
  icon = R.drawable.social_instagram,
330
- label = "Instagram",
332
+ label = R.string.social_instagram,
331
333
  url = "https://www.instagram.com/cbnventures/",
332
334
  onSocialClick = onSocialClick,
333
335
  )
334
336
  MainScreenSocialLink(
335
337
  icon = R.drawable.social_github,
336
- label = "GitHub",
338
+ label = R.string.social_github,
337
339
  url = "https://github.com/cbnventures",
338
340
  onSocialClick = onSocialClick,
339
341
  )
340
342
  MainScreenSocialLink(
341
343
  icon = R.drawable.social_google_play,
342
- label = "Google Play",
344
+ label = R.string.social_google_play,
343
345
  url = "https://play.google.com/store/apps/dev?id=6419450160526226105",
344
346
  onSocialClick = onSocialClick,
345
347
  )
346
348
  MainScreenSocialLink(
347
349
  icon = R.drawable.social_linkedin,
348
- label = "LinkedIn",
350
+ label = R.string.social_linkedin,
349
351
  url = "https://www.linkedin.com/company/cbnventures/",
350
352
  onSocialClick = onSocialClick,
351
353
  )
@@ -369,7 +371,7 @@ private fun MainScreenFooter(onSocialClick: (String) -> Unit) {
369
371
  @Composable
370
372
  private fun MainScreenSocialLink(
371
373
  icon: Int,
372
- label: String,
374
+ @StringRes label: Int,
373
375
  url: String,
374
376
  onSocialClick: (String) -> Unit,
375
377
  ) {
@@ -397,7 +399,7 @@ private fun MainScreenSocialLink(
397
399
  Icon(
398
400
  modifier = Modifier.size(18.dp),
399
401
  painter = painterResource(icon),
400
- contentDescription = label,
402
+ contentDescription = stringResource(label),
401
403
  tint = MaterialTheme.colorScheme.onSurfaceVariant,
402
404
  )
403
405
  }
@@ -425,7 +427,7 @@ private fun MainScreenSequence(modifier: Modifier = Modifier) {
425
427
  verticalArrangement = Arrangement.spacedBy(22.dp),
426
428
  ) {
427
429
  Text(
428
- text = "LAUNCH SEQUENCE",
430
+ text = stringResource(R.string.launch_sequence),
429
431
  color = MaterialTheme.colorScheme.onSurfaceVariant,
430
432
  fontWeight = FontWeight.Bold,
431
433
  letterSpacing = 1.2.sp,
@@ -433,21 +435,21 @@ private fun MainScreenSequence(modifier: Modifier = Modifier) {
433
435
  )
434
436
 
435
437
  MainScreenStep(
436
- number = "01",
437
- title = "Shape the experience",
438
- description = "Replace this starter with your first real product experience.",
438
+ number = R.string.launch_step_one_number,
439
+ title = R.string.launch_step_one_title,
440
+ description = R.string.launch_step_one_description,
439
441
  )
440
442
 
441
443
  MainScreenStep(
442
- number = "02",
443
- title = "Keep the contract",
444
- description = "Run the workspace checks while the project takes shape.",
444
+ number = R.string.launch_step_two_number,
445
+ title = R.string.launch_step_two_title,
446
+ description = R.string.launch_step_two_description,
445
447
  )
446
448
 
447
449
  MainScreenStep(
448
- number = "03",
449
- title = "Ship confidently",
450
- description = "Build the same production artifact Nova already validates.",
450
+ number = R.string.launch_step_three_number,
451
+ title = R.string.launch_step_three_title,
452
+ description = R.string.launch_step_three_description,
451
453
  )
452
454
  }
453
455
  }
@@ -465,14 +467,18 @@ private fun MainScreenSequence(modifier: Modifier = Modifier) {
465
467
  * @since UNRELEASED
466
468
  */
467
469
  @Composable
468
- private fun MainScreenStep(number: String, title: String, description: String) {
470
+ private fun MainScreenStep(
471
+ @StringRes number: Int,
472
+ @StringRes title: Int,
473
+ @StringRes description: Int,
474
+ ) {
469
475
  Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
470
476
  Row(verticalAlignment = Alignment.Top) {
471
477
  Text(
472
478
  modifier =
473
479
  Modifier
474
480
  .width(34.dp),
475
- text = number,
481
+ text = stringResource(number),
476
482
  color = MaterialTheme.colorScheme.primary,
477
483
  fontWeight = FontWeight.Bold,
478
484
  style = MaterialTheme.typography.titleMedium,
@@ -482,7 +488,7 @@ private fun MainScreenStep(number: String, title: String, description: String) {
482
488
  modifier =
483
489
  Modifier
484
490
  .weight(1f),
485
- text = title,
491
+ text = stringResource(title),
486
492
  fontWeight = FontWeight.SemiBold,
487
493
  style = MaterialTheme.typography.titleMedium,
488
494
  )
@@ -490,7 +496,7 @@ private fun MainScreenStep(number: String, title: String, description: String) {
490
496
 
491
497
  Text(
492
498
  modifier = Modifier.padding(start = 34.dp),
493
- text = description,
499
+ text = stringResource(description),
494
500
  color = MaterialTheme.colorScheme.onSurfaceVariant,
495
501
  lineHeight = 20.sp,
496
502
  style = MaterialTheme.typography.bodyMedium,
@@ -530,7 +536,7 @@ private fun MainScreenLoading(modifier: Modifier = Modifier) {
530
536
  private fun MainScreenError(message: String?, modifier: Modifier = Modifier) {
531
537
  Box(modifier = modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
532
538
  Text(
533
- text = message ?: "Unable to load the starter experience.",
539
+ text = message ?: stringResource(R.string.starter_error),
534
540
  color = MaterialTheme.colorScheme.error,
535
541
  textAlign = TextAlign.Center,
536
542
  )
@@ -550,7 +556,7 @@ private fun MainScreenPreview() {
550
556
  [__WORKSPACE_IDENTIFIER__]Theme {
551
557
  Surface {
552
558
  MainScreen(
553
- data = listOf("Android"),
559
+ data = emptyList(),
554
560
  modifier = Modifier.padding(20.dp),
555
561
  )
556
562
  }
@@ -1,3 +1,30 @@
1
1
  <resources>
2
2
  <string name="app_name">[__WORKSPACE_TITLE__]</string>
3
+ <string name="explore_android_docs">Explore Android docs</string>
4
+ <string name="generated_with_nova">Generated with Nova</string>
5
+ <string name="launch_sequence">Launch sequence</string>
6
+ <string name="launch_step_one_description">Replace this starter with your first real product experience.</string>
7
+ <string name="launch_step_one_number">01</string>
8
+ <string name="launch_step_one_title">Shape the experience</string>
9
+ <string name="launch_step_three_description">Build the same production artifact Nova already validates.</string>
10
+ <string name="launch_step_three_number">03</string>
11
+ <string name="launch_step_three_title">Ship confidently</string>
12
+ <string name="launch_step_two_description">Run the workspace checks while the project takes shape.</string>
13
+ <string name="launch_step_two_number">02</string>
14
+ <string name="launch_step_two_title">Keep the contract</string>
15
+ <string name="nova_logo_content_description">Nova</string>
16
+ <string name="nova_platform_name">Nova × %1$s</string>
17
+ <string name="platform_android">Android</string>
18
+ <string name="read_nova_docs">Read Nova Docs</string>
19
+ <string name="social_facebook">Facebook</string>
20
+ <string name="social_github">GitHub</string>
21
+ <string name="social_google_play">Google Play</string>
22
+ <string name="social_instagram">Instagram</string>
23
+ <string name="social_linkedin">LinkedIn</string>
24
+ <string name="social_x">X</string>
25
+ <string name="social_youtube">YouTube</string>
26
+ <string name="starter_description">A native Android workspace with strict checks, tests, and a clean path from first screen to release.</string>
27
+ <string name="starter_edit_hint">Start in ui/main/MainScreen.kt</string>
28
+ <string name="starter_error">Unable to load the starter experience.</string>
29
+ <string name="starter_title">[__WORKSPACE_TITLE__] starts here.</string>
3
30
  </resources>
@@ -11,6 +11,13 @@ import { defineConfig } from 'astro/config';
11
11
  */
12
12
  const config = defineConfig({
13
13
  adapter: cloudflare(),
14
+ i18n: {
15
+ defaultLocale: 'en',
16
+ locales: ['en'],
17
+ routing: {
18
+ prefixDefaultLocale: false,
19
+ },
20
+ },
14
21
  outDir: './build',
15
22
  output: 'server',
16
23
  });
@@ -13,6 +13,13 @@ const config = defineConfig({
13
13
  adapter: node({
14
14
  mode: 'standalone',
15
15
  }),
16
+ i18n: {
17
+ defaultLocale: 'en',
18
+ locales: ['en'],
19
+ routing: {
20
+ prefixDefaultLocale: false,
21
+ },
22
+ },
16
23
  outDir: './build',
17
24
  output: 'server',
18
25
  });
@@ -9,6 +9,13 @@ import { defineConfig } from 'astro/config';
9
9
  * @since 0.0.0
10
10
  */
11
11
  const config = defineConfig({
12
+ i18n: {
13
+ defaultLocale: 'en',
14
+ locales: ['en'],
15
+ routing: {
16
+ prefixDefaultLocale: false,
17
+ },
18
+ },
12
19
  outDir: './build',
13
20
  output: 'static',
14
21
  });
@@ -49,7 +49,7 @@
49
49
  "node": "[__SCAFFOLD_VERSION_NODE_ENGINE__]"
50
50
  },
51
51
  "dependencies": {
52
- "@cbnventures/nova": "0.34.1",
52
+ "@cbnventures/nova": "0.35.0",
53
53
  "chalk": "[__SCAFFOLD_VERSION_CHALK__]",
54
54
  "commander": "[__SCAFFOLD_VERSION_COMMANDER__]",
55
55
  "wrangler": "[__SCAFFOLD_VERSION_WRANGLER__]"
@@ -49,7 +49,7 @@
49
49
  "node": "[__SCAFFOLD_VERSION_NODE_ENGINE__]"
50
50
  },
51
51
  "dependencies": {
52
- "@cbnventures/nova": "0.34.1",
52
+ "@cbnventures/nova": "0.35.0",
53
53
  "chalk": "[__SCAFFOLD_VERSION_CHALK__]",
54
54
  "commander": "[__SCAFFOLD_VERSION_COMMANDER__]",
55
55
  "vercel": "[__SCAFFOLD_VERSION_VERCEL__]"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cbnventures/nova",
3
- "version": "0.34.1",
3
+ "version": "0.35.0",
4
4
  "description": "Scripts, templates, and project configuration for the common JavaScript and TypeScript developer",
5
5
  "keywords": [
6
6
  "eslint",
@@ -1,46 +0,0 @@
1
- import '../styles/nova-launchpad.css';
2
- import './globals.css';
3
-
4
- import type {
5
- App_Layout_Metadata,
6
- App_Layout_RootLayout_Props,
7
- App_Layout_RootLayout_Returns,
8
- } from '../types/app/layout.d.ts';
9
-
10
- /**
11
- * Layout - Metadata.
12
- *
13
- * Provides the starter title and description consumed by Next.js.
14
- * Consumers can extend this object as the application identity grows.
15
- *
16
- * @since 0.0.0
17
- */
18
- export const metadata: App_Layout_Metadata = {
19
- title: 'Nova × Next.js',
20
- description: 'A Nova-managed Next.js application',
21
- icons: {
22
- icon: '/favicon.svg',
23
- },
24
- };
25
-
26
- /**
27
- * Layout - Root Layout.
28
- *
29
- * Wraps every generated application route in the shared HTML document.
30
- * This is the root layout required by the Next.js App Router.
31
- *
32
- * @param {App_Layout_RootLayout_Props} props - Props.
33
- *
34
- * @returns {App_Layout_RootLayout_Returns}
35
- *
36
- * @since 0.0.0
37
- */
38
- function RootLayout(props: App_Layout_RootLayout_Props): App_Layout_RootLayout_Returns {
39
- return (
40
- <html lang="en">
41
- <body>{props['children']}</body>
42
- </html>
43
- );
44
- }
45
-
46
- export default RootLayout;
@@ -1,25 +0,0 @@
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_Layout_Metadata = Metadata;
13
-
14
- /**
15
- * Layout.
16
- *
17
- * @since 0.0.0
18
- */
19
- export type App_Layout_RootLayout_Props_Children = ReactNode;
20
-
21
- export type App_Layout_RootLayout_Props = {
22
- children: App_Layout_RootLayout_Props_Children;
23
- };
24
-
25
- export type App_Layout_RootLayout_Returns = ReactElement;
@@ -1,8 +0,0 @@
1
- import type { ReactElement } from 'react';
2
-
3
- /**
4
- * Page.
5
- *
6
- * @since 0.0.0
7
- */
8
- export type App_Page_Home_Returns = ReactElement;