@nextsparkjs/core 0.1.0-beta.139 → 0.1.0-beta.140

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "generated": "2026-04-09T20:32:08.680Z",
2
+ "generated": "2026-04-13T19:35:39.424Z",
3
3
  "totalClasses": 1078,
4
4
  "classes": [
5
5
  "!text-2xl",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextsparkjs/core",
3
- "version": "0.1.0-beta.139",
3
+ "version": "0.1.0-beta.140",
4
4
  "description": "NextSpark - The complete SaaS framework for Next.js",
5
5
  "license": "MIT",
6
6
  "author": "NextSpark <hello@nextspark.dev>",
@@ -463,7 +463,7 @@
463
463
  "tailwind-merge": "^3.3.1",
464
464
  "uuid": "^13.0.0",
465
465
  "zod": "^4.1.5",
466
- "@nextsparkjs/testing": "0.1.0-beta.139"
466
+ "@nextsparkjs/testing": "0.1.0-beta.140"
467
467
  },
468
468
  "scripts": {
469
469
  "postinstall": "node scripts/postinstall.mjs || true",
@@ -495,23 +495,71 @@ ${(() => {
495
495
 
496
496
  console.log(`[TranslationRegistry] PPR enabled — generating static exports for locale '${defaultLocale}'`)
497
497
 
498
+ // Collect entity translations for the default locale (theme entities)
499
+ const defaultLocaleEntityTranslations = entityTranslations.filter(
500
+ t => t.themeName === config.activeTheme && t.locale === defaultLocale
501
+ )
502
+
503
+ // Collect plugin entity translations for the default locale
504
+ // Only include plugin entities that are NOT already in the theme (plugin = fallback)
505
+ const themeEntityNames = new Set(defaultLocaleEntityTranslations.map(t => t.entityName))
506
+ const defaultLocalePluginEntityTranslations = pluginEntityTranslations.filter(
507
+ t => t.locale === defaultLocale && !themeEntityNames.has(t.entityName)
508
+ )
509
+
510
+ const allEntityTranslations = [...defaultLocaleEntityTranslations, ...defaultLocalePluginEntityTranslations]
511
+
512
+ // Generate import statements for entity translations
513
+ const entityImports = allEntityTranslations.map((t, i) => {
514
+ const varName = `_entity${i}Messages`
515
+ return `import ${varName} from '${t.filePath}'`
516
+ }).join('\n')
517
+
518
+ // Generate the entity messages object entries
519
+ const entityEntries = allEntityTranslations.map((t, i) => {
520
+ const varName = `_entity${i}Messages`
521
+ return ` '${t.entityName}': ${varName}`
522
+ }).join(',\n')
523
+
524
+ const hasEntities = allEntityTranslations.length > 0
525
+ const entityImportsBlock = hasEntities ? `\n// Entity and plugin entity translations (default locale)\n${entityImports}\n` : ''
526
+ const entityMergeBlock = hasEntities
527
+ ? `
528
+ const _entityMessages: Record<string, unknown> = {
529
+ ${entityEntries}
530
+ }
531
+
532
+ export const STATIC_MESSAGES: Record<string, unknown> = _deepMerge(
533
+ _deepMerge(
534
+ _coreMessages as unknown as Record<string, unknown>,
535
+ (_themeMessages as { default?: Record<string, unknown> }).default ?? _themeMessages as unknown as Record<string, unknown>
536
+ ),
537
+ _entityMessages
538
+ )`
539
+ : `
540
+ export const STATIC_MESSAGES: Record<string, unknown> = _deepMerge(
541
+ _coreMessages as unknown as Record<string, unknown>,
542
+ (_themeMessages as { default?: Record<string, unknown> }).default ?? _themeMessages as unknown as Record<string, unknown>
543
+ )`
544
+
545
+ if (hasEntities) {
546
+ console.log(`[TranslationRegistry] PPR static messages include ${allEntityTranslations.length} entity translations`)
547
+ }
548
+
498
549
  return `/**
499
550
  * PPR: Static messages for the default locale (pre-merged at build time)
500
551
  *
501
552
  * Used by the root layout's StaticIntlProvider to render content
502
553
  * in the PPR static shell without accessing cookies/headers.
503
- * Core messages are deep-merged with theme messages.
554
+ * Core messages are deep-merged with theme + entity + plugin messages.
504
555
  */
505
556
  import { deepMergeMessages as _deepMerge } from '@nextsparkjs/core/lib/translations/registry'
506
557
  import _coreMessages from '@nextsparkjs/core/messages/${defaultLocale}/index.js'
507
558
  import _themeMessages from '${defaultThemeTranslation.filePath}'
508
-
559
+ ${entityImportsBlock}
509
560
  export const DEFAULT_LOCALE = '${defaultLocale}' as const
510
561
  export const DEFAULT_THEME_MODE = '${defaultThemeMode}' as const
511
- export const STATIC_MESSAGES: Record<string, unknown> = _deepMerge(
512
- _coreMessages as unknown as Record<string, unknown>,
513
- (_themeMessages as { default?: Record<string, unknown> }).default ?? _themeMessages as unknown as Record<string, unknown>
514
- )`
562
+ ${entityMergeBlock}`
515
563
  })()}
516
564
  `
517
565
  }