@nextsparkjs/core 0.1.0-beta.5 → 0.1.0-beta.7
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 +1 -1
- package/package.json +12 -12
- package/scripts/build/docs-registry.mjs +0 -0
- package/scripts/create-theme.mjs +0 -0
- package/scripts/deploy/release-version.mjs +0 -0
- package/scripts/deploy/vercel-deploy.mjs +0 -0
- package/scripts/dev/watch-plugins.mjs +0 -0
- package/scripts/maintenance/update-core.mjs +0 -0
- package/scripts/setup/npm-postinstall.mjs +0 -0
- package/scripts/setup/setup-claude.mjs +0 -0
- package/scripts/validation/check-imports.sh +0 -0
- package/scripts/registry-build.js +0 -81
- package/scripts/registry-watch.js +0 -157
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.7",
|
|
4
4
|
"description": "NextSpark - The complete SaaS framework for Next.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "NextSpark <hello@nextspark.dev>",
|
|
@@ -223,6 +223,16 @@
|
|
|
223
223
|
"README.md",
|
|
224
224
|
"scripts"
|
|
225
225
|
],
|
|
226
|
+
"scripts": {
|
|
227
|
+
"build": "tsup && pnpm build:dts && pnpm build:ui-css",
|
|
228
|
+
"build:js": "tsup",
|
|
229
|
+
"build:dts": "tsc -p tsconfig.dts.json || echo '⚠️ DTS generation completed with some type errors (partial coverage)'",
|
|
230
|
+
"build:ui-css": "node scripts/build/build-ui-css.mjs",
|
|
231
|
+
"dev": "tsup --watch",
|
|
232
|
+
"test": "jest",
|
|
233
|
+
"test:watch": "jest --watch",
|
|
234
|
+
"test:coverage": "jest --coverage"
|
|
235
|
+
},
|
|
226
236
|
"peerDependencies": {
|
|
227
237
|
"next": ">=14.0.0",
|
|
228
238
|
"react": ">=18.0.0",
|
|
@@ -307,15 +317,5 @@
|
|
|
307
317
|
"tailwind-merge": "^3.3.1",
|
|
308
318
|
"uuid": "^13.0.0",
|
|
309
319
|
"zod": "^4.1.5"
|
|
310
|
-
},
|
|
311
|
-
"scripts": {
|
|
312
|
-
"build": "tsup && pnpm build:dts && pnpm build:ui-css",
|
|
313
|
-
"build:js": "tsup",
|
|
314
|
-
"build:dts": "tsc -p tsconfig.dts.json || echo '⚠️ DTS generation completed with some type errors (partial coverage)'",
|
|
315
|
-
"build:ui-css": "node scripts/build/build-ui-css.mjs",
|
|
316
|
-
"dev": "tsup --watch",
|
|
317
|
-
"test": "jest",
|
|
318
|
-
"test:watch": "jest --watch",
|
|
319
|
-
"test:coverage": "jest --coverage"
|
|
320
320
|
}
|
|
321
|
-
}
|
|
321
|
+
}
|
|
File without changes
|
package/scripts/create-theme.mjs
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Registry Build Script
|
|
5
|
-
*
|
|
6
|
-
* Orchestrates the generation of all auto-generated registries.
|
|
7
|
-
* Currently generates:
|
|
8
|
-
* - docs-registry.ts (documentation index)
|
|
9
|
-
*
|
|
10
|
-
* Future: Will integrate other registry generators (theme, plugin, entity, etc.)
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { spawn } from 'child_process';
|
|
14
|
-
import { fileURLToPath } from 'url';
|
|
15
|
-
import { dirname, join } from 'path';
|
|
16
|
-
|
|
17
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
-
const __dirname = dirname(__filename);
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Run a script and wait for completion
|
|
22
|
-
*/
|
|
23
|
-
function runScript(scriptPath, description) {
|
|
24
|
-
return new Promise((resolve, reject) => {
|
|
25
|
-
console.log(`\n▶️ ${description}...`);
|
|
26
|
-
|
|
27
|
-
const child = spawn('node', [scriptPath], {
|
|
28
|
-
stdio: 'inherit',
|
|
29
|
-
env: {
|
|
30
|
-
...process.env,
|
|
31
|
-
NEXTSPARK_PROJECT_ROOT: process.env.NEXTSPARK_PROJECT_ROOT || process.cwd()
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
child.on('error', (error) => {
|
|
36
|
-
console.error(`❌ Failed to run ${description}: ${error.message}`);
|
|
37
|
-
reject(error);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
child.on('close', (code) => {
|
|
41
|
-
if (code === 0) {
|
|
42
|
-
resolve();
|
|
43
|
-
} else {
|
|
44
|
-
reject(new Error(`${description} exited with code ${code}`));
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Main build function
|
|
52
|
-
*/
|
|
53
|
-
async function buildAllRegistries() {
|
|
54
|
-
const startTime = Date.now();
|
|
55
|
-
|
|
56
|
-
console.log('🏗️ Building NextSpark Registries');
|
|
57
|
-
console.log('================================\n');
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
// Build docs registry
|
|
61
|
-
await runScript(
|
|
62
|
-
join(__dirname, 'build/docs-registry.mjs'),
|
|
63
|
-
'Building Documentation Registry'
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
// Future: Add other registry generators here
|
|
67
|
-
// await runScript(join(__dirname, 'build/theme-registry.mjs'), 'Building Theme Registry');
|
|
68
|
-
// await runScript(join(__dirname, 'build/plugin-registry.mjs'), 'Building Plugin Registry');
|
|
69
|
-
// await runScript(join(__dirname, 'build/entity-registry.mjs'), 'Building Entity Registry');
|
|
70
|
-
|
|
71
|
-
const duration = ((Date.now() - startTime) / 1000).toFixed(2);
|
|
72
|
-
console.log(`\n✅ All registries built successfully in ${duration}s`);
|
|
73
|
-
process.exit(0);
|
|
74
|
-
} catch (error) {
|
|
75
|
-
console.error('\n❌ Registry build failed:', error.message);
|
|
76
|
-
process.exit(1);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Run the build
|
|
81
|
-
buildAllRegistries();
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Registry Watch Script
|
|
5
|
-
*
|
|
6
|
-
* Watches for changes in documentation directories and rebuilds registries automatically.
|
|
7
|
-
* Useful during development.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { watch } from 'fs';
|
|
11
|
-
import { spawn } from 'child_process';
|
|
12
|
-
import { fileURLToPath } from 'url';
|
|
13
|
-
import { dirname, join } from 'path';
|
|
14
|
-
import { existsSync } from 'fs';
|
|
15
|
-
|
|
16
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
-
const __dirname = dirname(__filename);
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Detect project root
|
|
21
|
-
*/
|
|
22
|
-
function detectProjectRoot() {
|
|
23
|
-
let dir = process.cwd();
|
|
24
|
-
const maxDepth = 10;
|
|
25
|
-
let depth = 0;
|
|
26
|
-
|
|
27
|
-
while (dir !== '/' && depth < maxDepth) {
|
|
28
|
-
const pkgPath = join(dir, 'package.json');
|
|
29
|
-
if (existsSync(pkgPath)) {
|
|
30
|
-
try {
|
|
31
|
-
const pkg = JSON.parse(require('fs').readFileSync(pkgPath, 'utf8'));
|
|
32
|
-
if (pkg.workspaces || existsSync(join(dir, 'pnpm-workspace.yaml'))) {
|
|
33
|
-
return dir;
|
|
34
|
-
}
|
|
35
|
-
} catch (error) {
|
|
36
|
-
// Continue searching
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
dir = dirname(dir);
|
|
40
|
-
depth++;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Fallback
|
|
44
|
-
return join(__dirname, '../../..');
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const PROJECT_ROOT = process.env.NEXTSPARK_PROJECT_ROOT || detectProjectRoot();
|
|
48
|
-
const ACTIVE_THEME = process.env.NEXT_PUBLIC_ACTIVE_THEME || 'default';
|
|
49
|
-
|
|
50
|
-
// Paths to watch
|
|
51
|
-
const CORE_DOCS = join(PROJECT_ROOT, 'packages/core/docs');
|
|
52
|
-
const THEME_DOCS = join(PROJECT_ROOT, 'contents/themes', ACTIVE_THEME, 'docs');
|
|
53
|
-
const CONTENTS_DIR = join(PROJECT_ROOT, 'contents');
|
|
54
|
-
|
|
55
|
-
let buildTimeout = null;
|
|
56
|
-
let isBuilding = false;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Run the build script
|
|
60
|
-
*/
|
|
61
|
-
function rebuild() {
|
|
62
|
-
if (isBuilding) {
|
|
63
|
-
console.log('⏳ Build already in progress, skipping...');
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
isBuilding = true;
|
|
68
|
-
console.log('\n🔄 Change detected, rebuilding registries...');
|
|
69
|
-
|
|
70
|
-
const child = spawn('node', [join(__dirname, 'registry-build.js')], {
|
|
71
|
-
stdio: 'inherit',
|
|
72
|
-
env: {
|
|
73
|
-
...process.env,
|
|
74
|
-
NEXTSPARK_PROJECT_ROOT: PROJECT_ROOT
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
child.on('close', (code) => {
|
|
79
|
-
isBuilding = false;
|
|
80
|
-
if (code === 0) {
|
|
81
|
-
console.log('👀 Watching for changes... (Press Ctrl+C to stop)');
|
|
82
|
-
} else {
|
|
83
|
-
console.error('❌ Build failed');
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Debounced rebuild
|
|
90
|
-
*/
|
|
91
|
-
function scheduleRebuild() {
|
|
92
|
-
if (buildTimeout) {
|
|
93
|
-
clearTimeout(buildTimeout);
|
|
94
|
-
}
|
|
95
|
-
buildTimeout = setTimeout(rebuild, 500);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Start watching
|
|
100
|
-
*/
|
|
101
|
-
function startWatcher() {
|
|
102
|
-
console.log('👀 NextSpark Registry Watcher');
|
|
103
|
-
console.log('============================\n');
|
|
104
|
-
console.log(`Project root: ${PROJECT_ROOT}`);
|
|
105
|
-
console.log(`Active theme: ${ACTIVE_THEME}\n`);
|
|
106
|
-
console.log('Watching:');
|
|
107
|
-
console.log(` - ${CORE_DOCS}`);
|
|
108
|
-
console.log(` - ${THEME_DOCS}`);
|
|
109
|
-
console.log(` - ${CONTENTS_DIR}/plugins/*/docs\n`);
|
|
110
|
-
|
|
111
|
-
// Initial build
|
|
112
|
-
rebuild();
|
|
113
|
-
|
|
114
|
-
// Watch core docs
|
|
115
|
-
if (existsSync(CORE_DOCS)) {
|
|
116
|
-
watch(CORE_DOCS, { recursive: true }, (eventType, filename) => {
|
|
117
|
-
if (filename && filename.endsWith('.md')) {
|
|
118
|
-
console.log(`📝 ${eventType}: ${filename}`);
|
|
119
|
-
scheduleRebuild();
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// Watch theme docs
|
|
125
|
-
if (existsSync(THEME_DOCS)) {
|
|
126
|
-
watch(THEME_DOCS, { recursive: true }, (eventType, filename) => {
|
|
127
|
-
if (filename && filename.endsWith('.md')) {
|
|
128
|
-
console.log(`📝 ${eventType}: ${filename}`);
|
|
129
|
-
scheduleRebuild();
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Watch plugin docs
|
|
135
|
-
if (existsSync(CONTENTS_DIR)) {
|
|
136
|
-
watch(CONTENTS_DIR, { recursive: true }, (eventType, filename) => {
|
|
137
|
-
if (filename && filename.includes('/plugins/') && filename.includes('/docs/') && filename.endsWith('.md')) {
|
|
138
|
-
console.log(`📝 ${eventType}: ${filename}`);
|
|
139
|
-
scheduleRebuild();
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Handle termination
|
|
146
|
-
process.on('SIGINT', () => {
|
|
147
|
-
console.log('\n\n👋 Stopping watcher...');
|
|
148
|
-
process.exit(0);
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
process.on('SIGTERM', () => {
|
|
152
|
-
console.log('\n\n👋 Stopping watcher...');
|
|
153
|
-
process.exit(0);
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
// Start
|
|
157
|
-
startWatcher();
|