@nextsparkjs/core 0.1.0-beta.122 → 0.1.0-beta.124

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-03-12T19:21:53.687Z",
2
+ "generated": "2026-03-12T20:36:04.532Z",
3
3
  "totalClasses": 1073,
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.122",
3
+ "version": "0.1.0-beta.124",
4
4
  "description": "NextSpark - The complete SaaS framework for Next.js",
5
5
  "license": "MIT",
6
6
  "author": "NextSpark <hello@nextspark.dev>",
@@ -454,7 +454,7 @@
454
454
  "tailwind-merge": "^3.3.1",
455
455
  "uuid": "^13.0.0",
456
456
  "zod": "^4.1.5",
457
- "@nextsparkjs/testing": "0.1.0-beta.122"
457
+ "@nextsparkjs/testing": "0.1.0-beta.124"
458
458
  },
459
459
  "scripts": {
460
460
  "postinstall": "node scripts/postinstall.mjs || true",
@@ -17,27 +17,30 @@ const packageRoot = path.join(__dirname, '..', '..'); // scripts/db/ -> core/
17
17
  const isMonorepoMode = fs.existsSync(path.join(projectRoot, 'packages', 'core'));
18
18
  const rootDir = projectRoot; // For backward compatibility with code below
19
19
 
20
- // Read .env from the project root (where user runs the command)
20
+ // Read environment variables: prefer .env file if it exists, fallback to process.env (e.g. Vercel/CI)
21
21
  const envPath = path.join(projectRoot, '.env');
22
- const envContent = fs.readFileSync(envPath, 'utf8');
23
- const envLines = envContent.split('\n');
24
22
 
25
- let DATABASE_URL = null;
26
- let ACTIVE_THEME = null;
23
+ let DATABASE_URL = process.env.DATABASE_URL ?? null;
24
+ let ACTIVE_THEME = process.env.NEXT_PUBLIC_ACTIVE_THEME ?? null;
27
25
 
28
- envLines.forEach(line => {
29
- if (line && !line.startsWith('#')) {
30
- const [key, ...valueParts] = line.split('=');
31
- const value = valueParts.join('=').replace(/^["']|["']$/g, '').trim();
26
+ if (fs.existsSync(envPath)) {
27
+ const envContent = fs.readFileSync(envPath, 'utf8');
28
+ const envLines = envContent.split('\n');
32
29
 
33
- if (key?.trim() === 'DATABASE_URL' && valueParts.length > 0) {
34
- DATABASE_URL = value;
35
- }
36
- if (key?.trim() === 'NEXT_PUBLIC_ACTIVE_THEME' && valueParts.length > 0) {
37
- ACTIVE_THEME = value;
30
+ envLines.forEach(line => {
31
+ if (line && !line.startsWith('#')) {
32
+ const [key, ...valueParts] = line.split('=');
33
+ const value = valueParts.join('=').replace(/^["']|["']$/g, '').trim();
34
+
35
+ if (key?.trim() === 'DATABASE_URL' && valueParts.length > 0) {
36
+ DATABASE_URL = value;
37
+ }
38
+ if (key?.trim() === 'NEXT_PUBLIC_ACTIVE_THEME' && valueParts.length > 0) {
39
+ ACTIVE_THEME = value;
40
+ }
38
41
  }
39
- }
40
- });
42
+ });
43
+ }
41
44
 
42
45
  if (!DATABASE_URL) {
43
46
  console.error("❌ DATABASE_URL not found in environment variables");