@nextsparkjs/core 0.1.0-beta.57 → 0.1.0-beta.58

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-01-20T14:49:04.021Z",
2
+ "generated": "2026-01-20T16:36:54.178Z",
3
3
  "totalClasses": 1047,
4
4
  "classes": [
5
5
  "!text-2xl",
@@ -1,12 +1,15 @@
1
1
  /* =============================================
2
2
  GLOBAL STYLES - Import from Active Theme
3
3
 
4
- Este archivo importa los estilos del theme activo.
5
- NO editar directamente - todos los estilos están en:
4
+ This file imports styles from the active theme.
5
+ DO NOT edit directly - all styles are in:
6
6
  contents/themes/{theme}/styles/globals.css
7
7
 
8
- Para personalizar colores, tipografía y tokens, edita
9
- el archivo globals.css de tu theme activo.
8
+ This import is AUTO-SYNCED by the registry build process
9
+ to match NEXT_PUBLIC_ACTIVE_THEME from your .env file.
10
+
11
+ To customize colors, typography and tokens, edit
12
+ the globals.css file in your active theme.
10
13
  ============================================= */
11
14
 
12
- @import "../contents/themes/default/styles/globals.css";
15
+ @import "../contents/themes/starter/styles/globals.css";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextsparkjs/core",
3
- "version": "0.1.0-beta.57",
3
+ "version": "0.1.0-beta.58",
4
4
  "description": "NextSpark - The complete SaaS framework for Next.js",
5
5
  "license": "MIT",
6
6
  "author": "NextSpark <hello@nextspark.dev>",
@@ -83,6 +83,7 @@ import {
83
83
  cleanupOrphanedTemplates
84
84
  } from './registry/post-build/index.mjs'
85
85
  import { watchContents } from './registry/watch.mjs'
86
+ import { syncAppGlobalsCss } from './theme.mjs'
86
87
 
87
88
  // ==================== Registry File Generation ====================
88
89
 
@@ -159,6 +160,12 @@ export async function buildRegistries(projectRoot = null) {
159
160
  const startTime = Date.now()
160
161
 
161
162
  try {
163
+ // Sync app/globals.css to import from active theme
164
+ // This ensures the import path matches NEXT_PUBLIC_ACTIVE_THEME
165
+ if (CONFIG.activeTheme) {
166
+ syncAppGlobalsCss(CONFIG, CONFIG.activeTheme)
167
+ }
168
+
162
169
  // Initialize parent-child discovery FIRST (needed for dynamic parseChildEntity)
163
170
  log('→ Initializing dynamic parent-child discovery...', 'info')
164
171
  await discoverParentChildRelations(CONFIG)
@@ -42,7 +42,7 @@ function getActiveTheme() {
42
42
  * @param {string} activeTheme - Active theme name
43
43
  * @returns {boolean} - True if file was updated, false if already correct
44
44
  */
45
- function syncAppGlobalsCss(config, activeTheme) {
45
+ export function syncAppGlobalsCss(config, activeTheme) {
46
46
  const appGlobalsCssPath = path.join(config.projectRoot, 'app', 'globals.css')
47
47
 
48
48
  // Calculate the correct relative path from app/ to theme globals.css
@@ -423,21 +423,25 @@ async function watchTheme() {
423
423
  }
424
424
  }
425
425
 
426
- // Main execution
427
- const watchMode = process.argv.includes('--watch') || process.argv.includes('-w')
426
+ // Main execution - only run when invoked directly, not when imported
427
+ const isMainScript = process.argv[1] && import.meta.url.endsWith(process.argv[1].split('/').pop())
428
428
 
429
- console.log('🎨 Starting theme build process...')
429
+ if (isMainScript) {
430
+ const watchMode = process.argv.includes('--watch') || process.argv.includes('-w')
430
431
 
431
- try {
432
- await buildTheme()
433
- console.log('✅ Theme build process completed successfully!')
432
+ console.log('🎨 Starting theme build process...')
434
433
 
435
- if (watchMode) {
436
- console.log()
437
- console.log('👀 Starting watch mode...')
438
- await watchTheme()
434
+ try {
435
+ await buildTheme()
436
+ console.log(' Theme build process completed successfully!')
437
+
438
+ if (watchMode) {
439
+ console.log()
440
+ console.log('👀 Starting watch mode...')
441
+ await watchTheme()
442
+ }
443
+ } catch (error) {
444
+ console.error('❌ Theme build process failed:', error)
445
+ process.exit(1)
439
446
  }
440
- } catch (error) {
441
- console.error('❌ Theme build process failed:', error)
442
- process.exit(1)
443
447
  }
@@ -1,12 +1,15 @@
1
1
  /* =============================================
2
2
  GLOBAL STYLES - Import from Active Theme
3
3
 
4
- Este archivo importa los estilos del theme activo.
5
- NO editar directamente - todos los estilos están en:
4
+ This file imports styles from the active theme.
5
+ DO NOT edit directly - all styles are in:
6
6
  contents/themes/{theme}/styles/globals.css
7
7
 
8
- Para personalizar colores, tipografía y tokens, edita
9
- el archivo globals.css de tu theme activo.
8
+ This import is AUTO-SYNCED by the registry build process
9
+ to match NEXT_PUBLIC_ACTIVE_THEME from your .env file.
10
+
11
+ To customize colors, typography and tokens, edit
12
+ the globals.css file in your active theme.
10
13
  ============================================= */
11
14
 
12
- @import "../contents/themes/default/styles/globals.css";
15
+ @import "../contents/themes/starter/styles/globals.css";