create-sonicjs 2.3.4 → 2.3.6

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sonicjs",
3
- "version": "2.3.4",
3
+ "version": "2.3.6",
4
4
  "description": "Create a new SonicJS application with zero configuration",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -418,7 +418,7 @@ async function copyTemplate(templateName, targetDir, options) {
418
418
 
419
419
  // Add @sonicjs-cms/core dependency
420
420
  packageJson.dependencies = {
421
- '@sonicjs-cms/core': '^2.3.4',
421
+ '@sonicjs-cms/core': '^2.3.6',
422
422
  ...packageJson.dependencies
423
423
  }
424
424
 
@@ -451,7 +451,7 @@ async function copyTemplate(templateName, targetDir, options) {
451
451
  async function createAdminSeedScript(targetDir, { email, password }) {
452
452
  const seedScriptContent = `import { createDb, users } from '@sonicjs-cms/core'
453
453
  import { eq } from 'drizzle-orm'
454
- import bcrypt from 'bcryptjs'
454
+ import * as crypto from 'crypto'
455
455
  import { getPlatformProxy } from 'wrangler'
456
456
 
457
457
  /**
@@ -498,20 +498,26 @@ async function seed() {
498
498
  return
499
499
  }
500
500
 
501
- // Hash password using bcrypt
502
- const passwordHash = await bcrypt.hash('${password}', 10)
501
+ // Hash password using SHA-256 (same as SonicJS auth system)
502
+ const data = '${password}' + 'salt-change-in-production'
503
+ const passwordHash = crypto.createHash('sha256').update(data).digest('hex')
504
+ const now = Date.now()
505
+ const odid = \`admin-\${now}-\${Math.random().toString(36).substr(2, 9)}\`
503
506
 
504
507
  // Create admin user
505
508
  await db
506
509
  .insert(users)
507
510
  .values({
511
+ id: odid,
508
512
  email: '${email}',
509
513
  username: '${email.split('@')[0]}',
510
- password: passwordHash,
514
+ firstName: 'Admin',
515
+ lastName: 'User',
516
+ passwordHash: passwordHash,
511
517
  role: 'admin',
512
- isActive: 1,
513
- createdAt: new Date().toISOString(),
514
- updatedAt: new Date().toISOString()
518
+ isActive: true,
519
+ createdAt: now,
520
+ updatedAt: now
515
521
  })
516
522
  .run()
517
523
 
@@ -24,6 +24,7 @@
24
24
  "drizzle-kit": "^0.30.3",
25
25
  "drizzle-orm": "^0.44.7",
26
26
  "hono": "^4.10.4",
27
+ "tsx": "^4.20.3",
27
28
  "typescript": "^5.9.3",
28
29
  "vitest": "^4.0.5",
29
30
  "wrangler": "^3.110.4",