@nextsparkjs/core 0.1.0-beta.178 → 0.1.0-beta.179
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/dist/styles/classes.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextsparkjs/core",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.179",
|
|
4
4
|
"description": "NextSpark - The complete SaaS framework for Next.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "NextSpark <hello@nextspark.dev>",
|
|
@@ -470,7 +470,7 @@
|
|
|
470
470
|
"tailwind-merge": "^3.3.1",
|
|
471
471
|
"uuid": "^13.0.0",
|
|
472
472
|
"zod": "^4.1.5",
|
|
473
|
-
"@nextsparkjs/testing": "0.1.0-beta.
|
|
473
|
+
"@nextsparkjs/testing": "0.1.0-beta.179"
|
|
474
474
|
},
|
|
475
475
|
"scripts": {
|
|
476
476
|
"postinstall": "node scripts/postinstall.mjs || true",
|
|
@@ -442,64 +442,74 @@ async function discoverThemeRoutes(config, results, processedEndpoints) {
|
|
|
442
442
|
|
|
443
443
|
// Process every docs.md / presets.ts under `baseDir`, mapping each route
|
|
444
444
|
// directory to an endpoint via `endpointForDir(routeDir)`.
|
|
445
|
+
//
|
|
446
|
+
// A route directory can carry BOTH a docs.md AND a presets.ts at once —
|
|
447
|
+
// they are two independent artifacts (results.docs vs results.presets),
|
|
448
|
+
// not competing claims on the same slot. `processedEndpoints` gates
|
|
449
|
+
// CROSS-SOURCE priority (theme routes > entity folders > core routes),
|
|
450
|
+
// checked once per directory, before either file is read — never gated
|
|
451
|
+
// per-file, or the first file found for a directory silently blocks the
|
|
452
|
+
// second (this exact bug: the docs.md pass used to mark an endpoint
|
|
453
|
+
// processed before the presets.ts pass for the SAME directory ever ran,
|
|
454
|
+
// so any directory with both files always lost its presets). Mirrors
|
|
455
|
+
// `discoverEntityFolders`'s already-correct pattern below.
|
|
445
456
|
const processTree = async (baseDir, endpointForDir) => {
|
|
446
457
|
if (!existsSync(baseDir)) return
|
|
447
458
|
|
|
448
459
|
const docFiles = await findFilesRecursive(baseDir, 'docs.md')
|
|
449
460
|
const presetFiles = await findFilesRecursive(baseDir, 'presets.ts')
|
|
461
|
+
const routeDirs = new Set([...docFiles.map(dirname), ...presetFiles.map(dirname)])
|
|
450
462
|
|
|
451
|
-
for (const
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
const endpoint = endpointForDir(routeDir)
|
|
455
|
-
if (processedEndpoints.has(endpoint)) continue
|
|
456
|
-
|
|
457
|
-
const content = await readFile(docsPath, 'utf-8')
|
|
458
|
-
const title = extractMarkdownTitle(content)
|
|
459
|
-
const slug = basename(routeDir)
|
|
460
|
-
|
|
461
|
-
results.docs.push({
|
|
462
|
-
slug,
|
|
463
|
-
title,
|
|
464
|
-
endpoint,
|
|
465
|
-
filePath: getStoragePath(docsPath, config),
|
|
466
|
-
source: 'route',
|
|
467
|
-
themeName
|
|
468
|
-
})
|
|
469
|
-
verbose(` Theme route doc discovered: ${endpoint}`)
|
|
463
|
+
for (const routeDir of routeDirs) {
|
|
464
|
+
const endpoint = endpointForDir(routeDir)
|
|
465
|
+
if (processedEndpoints.has(endpoint)) continue
|
|
470
466
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
467
|
+
const slug = basename(routeDir)
|
|
468
|
+
const docsPath = join(routeDir, 'docs.md')
|
|
469
|
+
const presetsPath = join(routeDir, 'presets.ts')
|
|
470
|
+
|
|
471
|
+
if (existsSync(docsPath)) {
|
|
472
|
+
try {
|
|
473
|
+
const content = await readFile(docsPath, 'utf-8')
|
|
474
|
+
const title = extractMarkdownTitle(content)
|
|
475
|
+
|
|
476
|
+
results.docs.push({
|
|
477
|
+
slug,
|
|
478
|
+
title,
|
|
479
|
+
endpoint,
|
|
480
|
+
filePath: getStoragePath(docsPath, config),
|
|
481
|
+
source: 'route',
|
|
482
|
+
themeName
|
|
483
|
+
})
|
|
484
|
+
verbose(` Theme route doc discovered: ${endpoint}`)
|
|
485
|
+
} catch (error) {
|
|
486
|
+
log(` ERROR: Failed to read theme route doc: ${error.message}`, 'error')
|
|
487
|
+
}
|
|
474
488
|
}
|
|
475
|
-
}
|
|
476
489
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
processedEndpoints.add(finalEndpoint)
|
|
501
|
-
} catch (error) {
|
|
502
|
-
log(` ERROR: Failed to parse theme route presets: ${error.message}`, 'error')
|
|
490
|
+
if (existsSync(presetsPath)) {
|
|
491
|
+
try {
|
|
492
|
+
const content = await readFile(presetsPath, 'utf-8')
|
|
493
|
+
const presetConfig = parsePresetFile(content)
|
|
494
|
+
const finalEndpoint = presetConfig?.endpoint || endpoint
|
|
495
|
+
|
|
496
|
+
results.presets.push({
|
|
497
|
+
slug,
|
|
498
|
+
endpoint: finalEndpoint,
|
|
499
|
+
summary: presetConfig?.summary || '',
|
|
500
|
+
presets: presetConfig?.presets || [],
|
|
501
|
+
sourcePath: getStoragePath(presetsPath, config),
|
|
502
|
+
source: 'route',
|
|
503
|
+
themeName
|
|
504
|
+
})
|
|
505
|
+
verbose(` Theme route presets discovered: ${finalEndpoint} (${presetConfig?.presets?.length || 0} presets)`)
|
|
506
|
+
|
|
507
|
+
processedEndpoints.add(finalEndpoint)
|
|
508
|
+
} catch (error) {
|
|
509
|
+
log(` ERROR: Failed to parse theme route presets: ${error.message}`, 'error')
|
|
510
|
+
}
|
|
511
|
+
} else if (existsSync(docsPath)) {
|
|
512
|
+
processedEndpoints.add(endpoint)
|
|
503
513
|
}
|
|
504
514
|
}
|
|
505
515
|
}
|