create-nextblock 0.2.70 → 0.2.73
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/package.json
CHANGED
package/scripts/sync-template.js
CHANGED
|
@@ -11,7 +11,11 @@ const PROJECT_ROOT = resolve(__dirname, '..');
|
|
|
11
11
|
const SOURCE_DIR = resolve(PROJECT_ROOT, '../nextblock');
|
|
12
12
|
const TARGET_DIR = resolve(PROJECT_ROOT, 'templates/nextblock-template');
|
|
13
13
|
const REPO_ROOT = resolve(PROJECT_ROOT, '..', '..');
|
|
14
|
-
const
|
|
14
|
+
const ROOT_PACKAGE_JSON = resolve(REPO_ROOT, 'package.json');
|
|
15
|
+
const UI_GLOBALS_SOURCE = resolve(
|
|
16
|
+
PROJECT_ROOT,
|
|
17
|
+
'../../libs/ui/src/styles/globals.css',
|
|
18
|
+
);
|
|
15
19
|
const UI_PROXY_MODULES = [
|
|
16
20
|
'avatar',
|
|
17
21
|
'badge',
|
|
@@ -47,7 +51,6 @@ const IGNORED_SEGMENTS = new Set([
|
|
|
47
51
|
'backups',
|
|
48
52
|
]);
|
|
49
53
|
|
|
50
|
-
|
|
51
54
|
async function ensureTemplateSync() {
|
|
52
55
|
const sourceExists = await fs.pathExists(SOURCE_DIR);
|
|
53
56
|
if (!sourceExists) {
|
|
@@ -88,6 +91,9 @@ async function ensureTemplateSync() {
|
|
|
88
91
|
await sanitizeUiImports();
|
|
89
92
|
await ensureUiProxies();
|
|
90
93
|
await removeBackups();
|
|
94
|
+
await ensureUiProxies();
|
|
95
|
+
await removeBackups();
|
|
96
|
+
await syncPackageVersions();
|
|
91
97
|
await removeTemplateProjectJson();
|
|
92
98
|
|
|
93
99
|
console.log(chalk.green('Template sync complete.'));
|
|
@@ -195,7 +201,8 @@ async function ensureClientTranslations() {
|
|
|
195
201
|
.replace(legacyImportRegex, wrapperImportStatement);
|
|
196
202
|
} else if (!content.includes(wrapperImportStatement)) {
|
|
197
203
|
const lines = content.split(/\r?\n/);
|
|
198
|
-
const insertIndex =
|
|
204
|
+
const insertIndex =
|
|
205
|
+
lines.findIndex((line) => line.startsWith('import')) + 1;
|
|
199
206
|
if (insertIndex > 0) {
|
|
200
207
|
lines.splice(insertIndex, 0, wrapperImportStatement);
|
|
201
208
|
content = lines.join('\n');
|
|
@@ -213,7 +220,10 @@ async function ensureClientTranslations() {
|
|
|
213
220
|
}
|
|
214
221
|
|
|
215
222
|
async function sanitizeBlockEditorImports() {
|
|
216
|
-
const blockEditorPath = resolve(
|
|
223
|
+
const blockEditorPath = resolve(
|
|
224
|
+
TARGET_DIR,
|
|
225
|
+
'app/cms/blocks/components/BlockEditorArea.tsx',
|
|
226
|
+
);
|
|
217
227
|
if (!(await fs.pathExists(blockEditorPath))) {
|
|
218
228
|
return;
|
|
219
229
|
}
|
|
@@ -249,7 +259,10 @@ async function sanitizeUiImports() {
|
|
|
249
259
|
|
|
250
260
|
for (const filePath of filesToProcess) {
|
|
251
261
|
const original = await fs.readFile(filePath, 'utf8');
|
|
252
|
-
const replaced = original.replace(
|
|
262
|
+
const replaced = original.replace(
|
|
263
|
+
/@nextblock-cms\/ui\/(?!styles\/)[A-Za-z0-9/_-]+/g,
|
|
264
|
+
'@nextblock-cms/ui',
|
|
265
|
+
);
|
|
253
266
|
|
|
254
267
|
if (replaced !== original) {
|
|
255
268
|
await fs.writeFile(filePath, replaced);
|
|
@@ -296,11 +309,7 @@ async function removeBackups() {
|
|
|
296
309
|
];
|
|
297
310
|
|
|
298
311
|
await Promise.all(
|
|
299
|
-
targets.map((dir) =>
|
|
300
|
-
fs
|
|
301
|
-
.remove(dir)
|
|
302
|
-
.catch(() => undefined),
|
|
303
|
-
),
|
|
312
|
+
targets.map((dir) => fs.remove(dir).catch(() => undefined)),
|
|
304
313
|
);
|
|
305
314
|
}
|
|
306
315
|
|
|
@@ -309,8 +318,93 @@ async function removeTemplateProjectJson() {
|
|
|
309
318
|
await fs.remove(projectJsonPath).catch(() => undefined);
|
|
310
319
|
}
|
|
311
320
|
|
|
321
|
+
async function syncPackageVersions() {
|
|
322
|
+
const targetPackageJsonPath = resolve(TARGET_DIR, 'package.json');
|
|
323
|
+
const sourcePackageJsonPath = resolve(SOURCE_DIR, 'package.json');
|
|
324
|
+
|
|
325
|
+
if (!(await fs.pathExists(targetPackageJsonPath))) return;
|
|
326
|
+
if (!(await fs.pathExists(ROOT_PACKAGE_JSON))) return;
|
|
327
|
+
if (!(await fs.pathExists(sourcePackageJsonPath))) return;
|
|
328
|
+
|
|
329
|
+
const rootPkg = await fs.readJson(ROOT_PACKAGE_JSON);
|
|
330
|
+
const sourcePkg = await fs.readJson(sourcePackageJsonPath);
|
|
331
|
+
const targetPkg = await fs.readJson(targetPackageJsonPath);
|
|
332
|
+
|
|
333
|
+
let modified = false;
|
|
334
|
+
|
|
335
|
+
const getVersion = (pkgName, sourceVersion) => {
|
|
336
|
+
if (rootPkg.dependencies && rootPkg.dependencies[pkgName]) {
|
|
337
|
+
return rootPkg.dependencies[pkgName];
|
|
338
|
+
}
|
|
339
|
+
if (rootPkg.devDependencies && rootPkg.devDependencies[pkgName]) {
|
|
340
|
+
return rootPkg.devDependencies[pkgName];
|
|
341
|
+
}
|
|
342
|
+
return sourceVersion;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
const processSection = (sectionName) => {
|
|
346
|
+
if (!sourcePkg[sectionName]) return;
|
|
347
|
+
targetPkg[sectionName] = targetPkg[sectionName] || {};
|
|
348
|
+
|
|
349
|
+
for (const [pkgName, sourceVersion] of Object.entries(
|
|
350
|
+
sourcePkg[sectionName],
|
|
351
|
+
)) {
|
|
352
|
+
if (sourceVersion.startsWith('workspace:')) {
|
|
353
|
+
targetPkg[sectionName][pkgName] = 'workspace:*';
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
const versionToUse = getVersion(pkgName, sourceVersion);
|
|
357
|
+
if (targetPkg[sectionName][pkgName] !== versionToUse) {
|
|
358
|
+
targetPkg[sectionName][pkgName] = versionToUse;
|
|
359
|
+
modified = true;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
processSection('dependencies');
|
|
365
|
+
processSection('devDependencies');
|
|
366
|
+
|
|
367
|
+
const criticalDevDeps = [
|
|
368
|
+
'tailwindcss',
|
|
369
|
+
'postcss',
|
|
370
|
+
'autoprefixer',
|
|
371
|
+
'typescript',
|
|
372
|
+
'@tailwindcss/postcss',
|
|
373
|
+
];
|
|
374
|
+
|
|
375
|
+
criticalDevDeps.forEach((pkg) => {
|
|
376
|
+
const ver = getVersion(pkg, null);
|
|
377
|
+
if (ver) {
|
|
378
|
+
targetPkg.devDependencies = targetPkg.devDependencies || {};
|
|
379
|
+
if (targetPkg.devDependencies[pkg] !== ver) {
|
|
380
|
+
targetPkg.devDependencies[pkg] = ver;
|
|
381
|
+
modified = true;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
if (modified) {
|
|
387
|
+
console.log(
|
|
388
|
+
chalk.green(
|
|
389
|
+
'Synced all dependencies dynamically with root/source package.json',
|
|
390
|
+
),
|
|
391
|
+
);
|
|
392
|
+
if (targetPkg.dependencies) {
|
|
393
|
+
targetPkg.dependencies = Object.keys(targetPkg.dependencies)
|
|
394
|
+
.sort()
|
|
395
|
+
.reduce((obj, key) => {
|
|
396
|
+
obj[key] = targetPkg.dependencies[key];
|
|
397
|
+
return obj;
|
|
398
|
+
}, {});
|
|
399
|
+
}
|
|
400
|
+
await fs.writeJson(targetPackageJsonPath, targetPkg, { spaces: 2 });
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
312
404
|
ensureTemplateSync().catch((error) => {
|
|
313
|
-
console.error(
|
|
405
|
+
console.error(
|
|
406
|
+
chalk.red(error instanceof Error ? error.message : String(error)),
|
|
407
|
+
);
|
|
314
408
|
process.exit(1);
|
|
315
409
|
});
|
|
316
410
|
|
|
@@ -322,7 +416,11 @@ async function emptyDirWithRetry(dir, retries = 5, delay = 1000) {
|
|
|
322
416
|
} catch (err) {
|
|
323
417
|
if (i === retries - 1) throw err;
|
|
324
418
|
if (err.code === 'EBUSY' || err.code === 'EPERM') {
|
|
325
|
-
console.log(
|
|
419
|
+
console.log(
|
|
420
|
+
chalk.yellow(
|
|
421
|
+
`Locked file encountered. Retrying in ${delay}ms... (${i + 1}/${retries})`,
|
|
422
|
+
),
|
|
423
|
+
);
|
|
326
424
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
327
425
|
} else {
|
|
328
426
|
throw err;
|
|
@@ -1,57 +1,62 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@nextblock-cms/template",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "next dev",
|
|
7
|
-
"build": "next build",
|
|
8
|
-
"start": "next start",
|
|
9
|
-
"lint": "next lint",
|
|
10
|
-
"deploy:supabase": "node tools/deploy-supabase.js"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"@aws-sdk/client-s3": "^3.920.0",
|
|
14
|
-
"@aws-sdk/s3-request-presigner": "^3.
|
|
15
|
-
"@dnd-kit/core": "^6.3.1",
|
|
16
|
-
"@dnd-kit/sortable": "^10.0.0",
|
|
17
|
-
"@dnd-kit/utilities": "^3.2.2",
|
|
18
|
-
"@
|
|
19
|
-
"@
|
|
20
|
-
"@
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"react": "
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"tailwindcss": "^
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@nextblock-cms/template",
|
|
3
|
+
"version": "0.2.50",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "next lint",
|
|
10
|
+
"deploy:supabase": "node tools/deploy-supabase.js"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@aws-sdk/client-s3": "^3.920.0",
|
|
14
|
+
"@aws-sdk/s3-request-presigner": "^3.919.0",
|
|
15
|
+
"@dnd-kit/core": "^6.3.1",
|
|
16
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
17
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
18
|
+
"@nextblock-cms/db": "workspace:*",
|
|
19
|
+
"@nextblock-cms/editor": "workspace:*",
|
|
20
|
+
"@nextblock-cms/sdk": "workspace:*",
|
|
21
|
+
"@nextblock-cms/ui": "workspace:*",
|
|
22
|
+
"@nextblock-cms/utils": "workspace:*",
|
|
23
|
+
"@supabase/ssr": "^0.7.0",
|
|
24
|
+
"@supabase/supabase-js": "^2.77.0",
|
|
25
|
+
"@tiptap/react": "^3.9.0",
|
|
26
|
+
"@vercel/analytics": "^1.6.1",
|
|
27
|
+
"clsx": "^2.1.1",
|
|
28
|
+
"critters": "^0.0.25",
|
|
29
|
+
"date-fns": "^4.1.0",
|
|
30
|
+
"dotenv": "^17.2.3",
|
|
31
|
+
"fast-json-patch": "^3.1.1",
|
|
32
|
+
"html-react-parser": "^5.2.7",
|
|
33
|
+
"js-cookie": "^3.0.5",
|
|
34
|
+
"lodash.debounce": "^4.0.8",
|
|
35
|
+
"lucide-react": "^0.548.0",
|
|
36
|
+
"next": "16.0.10",
|
|
37
|
+
"next-themes": "^0.4.6",
|
|
38
|
+
"nodemailer": "^7.0.10",
|
|
39
|
+
"plaiceholder": "^3.0.0",
|
|
40
|
+
"react": "^19.2.0",
|
|
41
|
+
"react-dom": "^19.2.0",
|
|
42
|
+
"react-hot-toast": "^2.6.0",
|
|
43
|
+
"sharp": "^0.34.2",
|
|
44
|
+
"tailwind-merge": "^3.3.1",
|
|
45
|
+
"tailwindcss-animate": "^1.0.7",
|
|
46
|
+
"uuid": "^10.0.0",
|
|
47
|
+
"zod": "^3.25.76"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/node": "^24.9.1",
|
|
51
|
+
"@types/react": "^19.2.2",
|
|
52
|
+
"@types/react-dom": "^19.2.2",
|
|
53
|
+
"@tailwindcss/postcss": "^4.1.16",
|
|
54
|
+
"autoprefixer": "^10.4.21",
|
|
55
|
+
"eslint": "^9.38.0",
|
|
56
|
+
"eslint-config-next": "^16.0.6",
|
|
57
|
+
"postcss": "^8.5.6",
|
|
58
|
+
"tailwindcss": "^4.1.16",
|
|
59
|
+
"typescript": "^5.9.3",
|
|
60
|
+
"typescript-eslint": "^8.46.2"
|
|
61
|
+
}
|
|
62
|
+
}
|