create-sonicjs 2.12.1 → 2.14.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +12 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sonicjs",
3
- "version": "2.12.1",
3
+ "version": "2.14.0",
4
4
  "description": "Create a new SonicJS application with zero configuration",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -415,7 +415,7 @@ async function copyTemplate(templateName, targetDir, options) {
415
415
 
416
416
  // Add @sonicjs-cms/core dependency
417
417
  packageJson.dependencies = {
418
- '@sonicjs-cms/core': '^2.12.1',
418
+ '@sonicjs-cms/core': '^2.14.0',
419
419
  ...packageJson.dependencies
420
420
  }
421
421
 
@@ -434,6 +434,17 @@ async function copyTemplate(templateName, targetDir, options) {
434
434
  if (fs.existsSync(examplePath)) {
435
435
  await fs.remove(examplePath)
436
436
  }
437
+
438
+ // Also remove the blog post import and registration from index.ts
439
+ const indexPath = path.join(targetDir, 'src/index.ts')
440
+ if (fs.existsSync(indexPath)) {
441
+ let indexContent = await fs.readFile(indexPath, 'utf-8')
442
+ // Remove the import line
443
+ indexContent = indexContent.replace(/^import blogPostsCollection from ['"]\.\/collections\/blog-posts\.collection['"];?\n/m, '')
444
+ // Remove the registration entry from registerCollections array
445
+ indexContent = indexContent.replace(/\s*blogPostsCollection,?\n/, '\n')
446
+ await fs.writeFile(indexPath, indexContent, 'utf-8')
447
+ }
437
448
  }
438
449
 
439
450
  // Create admin seed script with provided credentials (only if creating admin user)