@chimerai/cli 0.2.85 → 0.2.86

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.
@@ -296,11 +296,18 @@ async function createPackageJson(targetDir, projectName, features) {
296
296
  react: '^18.3.1',
297
297
  'react-dom': '^18.3.1',
298
298
  '@prisma/client': '^5.22.0',
299
+ // Auth is core infrastructure — routes, middleware, and API handlers all depend on it
300
+ 'next-auth': '^4.24.10',
301
+ '@auth/prisma-adapter': '^2.11.1',
302
+ 'bcryptjs': '^2.4.3',
303
+ 'next-themes': '^0.4.4',
304
+ 'sonner': '^1.7.0',
299
305
  };
300
306
  const devDependencies = {
301
307
  '@types/node': '^20',
302
308
  '@types/react': '^18',
303
309
  '@types/react-dom': '^18',
310
+ '@types/bcryptjs': '^2.4.6',
304
311
  typescript: '^5',
305
312
  tailwindcss: '^3.4.0',
306
313
  postcss: '^8.5.10',
@@ -308,15 +315,6 @@ async function createPackageJson(targetDir, projectName, features) {
308
315
  prisma: '^5.22.0',
309
316
  tsx: '^4.20.6',
310
317
  };
311
- // Add feature-specific dependencies
312
- if (features.includes('auth')) {
313
- dependencies['next-auth'] = '^4.24.10';
314
- dependencies['@auth/prisma-adapter'] = '^2.11.1';
315
- dependencies['bcryptjs'] = '^2.4.3';
316
- dependencies['next-themes'] = '^0.4.4';
317
- dependencies['sonner'] = '^1.7.0';
318
- devDependencies['@types/bcryptjs'] = '^2.4.6';
319
- }
320
318
  // Note: ChimerAI workspace packages are not yet published to npm
321
319
  // For standalone projects, these features will need manual implementation
322
320
  // or you can use the complete starter kit with 'chimerai init'
@@ -1218,10 +1216,10 @@ async function getServerSessionWithPermissions() {
1218
1216
  }
1219
1217
  }
1220
1218
  async function createSeedScript(targetDir, features, sqlite) {
1221
- const hasAuth = features.includes('auth');
1222
1219
  // Generate seed script with feature-specific configuration
1220
+ // next-auth / bcryptjs are always installed (core infrastructure)
1223
1221
  const seedScript = `import { PrismaClient } from '@prisma/client';
1224
- ${hasAuth ? `import * as bcrypt from 'bcryptjs';` : ``}
1222
+ import * as bcrypt from 'bcryptjs';
1225
1223
  import crypto from 'crypto';
1226
1224
 
1227
1225
  const prisma = new PrismaClient();
@@ -1251,7 +1249,7 @@ function encrypt(text: string): string {
1251
1249
  async function main() {
1252
1250
  console.log('🌱 Seeding database...');
1253
1251
 
1254
- ${hasAuth ? ` // Create default admin user
1252
+ // Create default admin user (next-auth is always a core dependency)
1255
1253
  const hashedPassword = await bcrypt.hash('admin123', 10);
1256
1254
  const admin = await prisma.user.upsert({
1257
1255
  where: { email: 'admin@example.com' },
@@ -1263,8 +1261,7 @@ ${hasAuth ? ` // Create default admin user
1263
1261
  },
1264
1262
  });
1265
1263
 
1266
- console.log('✅ Admin user created: admin@example.com / admin123');` : ` // No auth feature selected — skipping admin user creation
1267
- const admin: { id: string } | null = null;`}
1264
+ console.log('✅ Admin user created: admin@example.com / admin123');
1268
1265
  ${features.includes('rbac')
1269
1266
  ? `
1270
1267
  ${sqlite
@@ -1308,9 +1305,9 @@ ${sqlite
1308
1305
  const adminRole = await prisma.role.findUnique({ where: { name: 'admin' } });
1309
1306
  if (adminRole) {
1310
1307
  await prisma.userRole.upsert({
1311
- where: { userId_roleId: { userId: admin!.id, roleId: adminRole.id } },
1308
+ where: { userId_roleId: { userId: admin.id, roleId: adminRole.id } },
1312
1309
  update: {},
1313
- create: { userId: admin!.id, roleId: adminRole.id },
1310
+ create: { userId: admin.id, roleId: adminRole.id },
1314
1311
  });
1315
1312
  console.log('✅ Admin user assigned admin role');
1316
1313
  }
@@ -1335,7 +1332,7 @@ ${sqlite
1335
1332
  status: 'active',
1336
1333
  isDefault: true,
1337
1334
  priority: 0,
1338
- createdBy: admin?.id ?? null,
1335
+ createdBy: admin.id,
1339
1336
  },
1340
1337
  });
1341
1338
 
@@ -1379,7 +1376,7 @@ ${sqlite
1379
1376
  status: 'active',
1380
1377
  isDefault: false,
1381
1378
  priority: 1,
1382
- createdBy: admin?.id ?? null,
1379
+ createdBy: admin.id,
1383
1380
  },
1384
1381
  });
1385
1382
 
@@ -1428,13 +1425,7 @@ async function createDockerCompose(targetDir) {
1428
1425
  await fs_extra_1.default.writeFile(path_1.default.join(targetDir, 'docker-compose.yml'), (0, index_js_1.generateDockerComposeDev)());
1429
1426
  }
1430
1427
  async function createInstallScripts(targetDir, features, sqlite) {
1431
- const hasAuth = features.includes('auth');
1432
- const loginBlockBat = hasAuth
1433
- ? 'echo Login with:\r\necho Email: admin@example.com\r\necho Password: admin123'
1434
- : 'echo Note: No auth selected - no default login credentials.';
1435
- const loginBlockSh = hasAuth
1436
- ? 'echo "Login with:"\necho " Email: admin@example.com"\necho " Password: admin123"'
1437
- : 'echo "Note: No auth selected - no default login credentials."';
1428
+ // Windows install.bat
1438
1429
  // Windows install.bat
1439
1430
  const installBat = sqlite
1440
1431
  ? `@echo off
@@ -1484,7 +1475,9 @@ echo Next steps:
1484
1475
  echo npm run dev
1485
1476
  echo Open: http://localhost:3001
1486
1477
  echo.
1487
- ${loginBlockBat}
1478
+ echo Login with:
1479
+ echo Email: admin@example.com
1480
+ echo Password: admin123
1488
1481
  echo.
1489
1482
  pause
1490
1483
  `
@@ -1554,7 +1547,9 @@ echo Next steps:
1554
1547
  echo npm run dev
1555
1548
  echo Open: http://localhost:3001
1556
1549
  echo.
1557
- ${loginBlockBat}
1550
+ echo Login with:
1551
+ echo Email: admin@example.com
1552
+ echo Password: admin123
1558
1553
  echo.
1559
1554
  pause
1560
1555
  `;
@@ -1593,7 +1588,9 @@ echo "Next steps:"
1593
1588
  echo " npm run dev"
1594
1589
  echo " Open: http://localhost:3001"
1595
1590
  echo ""
1596
- ${loginBlockSh}
1591
+ echo "Login with:"
1592
+ echo " Email: admin@example.com"
1593
+ echo " Password: admin123"
1597
1594
  echo ""
1598
1595
  `
1599
1596
  : `#!/bin/bash
@@ -1641,7 +1638,9 @@ echo "Next steps:"
1641
1638
  echo " npm run dev"
1642
1639
  echo " Open: http://localhost:3001"
1643
1640
  echo ""
1644
- ${loginBlockSh}
1641
+ echo "Login with:"
1642
+ echo " Email: admin@example.com"
1643
+ echo " Password: admin123"
1645
1644
  echo ""
1646
1645
  `;
1647
1646
  await fs_extra_1.default.writeFile(path_1.default.join(targetDir, 'install.bat'), installBat);
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/templates/config.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,IAAI,MAAM,CAS3C;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CA6BzC;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAgB/C;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAQ9C;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAY3C"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/templates/config.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,IAAI,MAAM,CAS3C;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CA6BzC;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAyD/C;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAQ9C;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAyD3C"}
@@ -46,7 +46,7 @@ function generateTsConfig() {
46
46
  `;
47
47
  }
48
48
  function generateTailwindConfig() {
49
- return `// @chimerai component=TailwindConfig version=1.0
49
+ return `// @chimerai component=TailwindConfig version=1.1
50
50
  /** @type {import('tailwindcss').Config} */
51
51
  module.exports = {
52
52
  darkMode: 'class',
@@ -56,7 +56,48 @@ module.exports = {
56
56
  './app/**/*.{js,ts,jsx,tsx,mdx}',
57
57
  ],
58
58
  theme: {
59
- extend: {},
59
+ extend: {
60
+ colors: {
61
+ background: 'hsl(var(--background))',
62
+ foreground: 'hsl(var(--foreground))',
63
+ primary: {
64
+ DEFAULT: 'hsl(var(--primary))',
65
+ foreground: 'hsl(var(--primary-foreground))',
66
+ },
67
+ secondary: {
68
+ DEFAULT: 'hsl(var(--secondary))',
69
+ foreground: 'hsl(var(--secondary-foreground))',
70
+ },
71
+ muted: {
72
+ DEFAULT: 'hsl(var(--muted))',
73
+ foreground: 'hsl(var(--muted-foreground))',
74
+ },
75
+ accent: {
76
+ DEFAULT: 'hsl(var(--accent))',
77
+ foreground: 'hsl(var(--accent-foreground))',
78
+ },
79
+ destructive: {
80
+ DEFAULT: 'hsl(var(--destructive))',
81
+ foreground: 'hsl(var(--destructive-foreground))',
82
+ },
83
+ border: 'hsl(var(--border))',
84
+ input: 'hsl(var(--input))',
85
+ ring: 'hsl(var(--ring))',
86
+ card: {
87
+ DEFAULT: 'hsl(var(--card))',
88
+ foreground: 'hsl(var(--card-foreground))',
89
+ },
90
+ popover: {
91
+ DEFAULT: 'hsl(var(--popover))',
92
+ foreground: 'hsl(var(--popover-foreground))',
93
+ },
94
+ },
95
+ borderRadius: {
96
+ lg: 'var(--radius)',
97
+ md: 'calc(var(--radius) - 2px)',
98
+ sm: 'calc(var(--radius) - 4px)',
99
+ },
100
+ },
60
101
  },
61
102
  plugins: [],
62
103
  };
@@ -72,12 +113,57 @@ function generatePostcssConfig() {
72
113
  `;
73
114
  }
74
115
  function generateGlobalsCss() {
75
- return `/* @chimerai component=GlobalsCss version=1.3 */
116
+ return `/* @chimerai component=GlobalsCss version=1.4 */
76
117
  @tailwind base;
77
118
  @tailwind components;
78
119
  @tailwind utilities;
79
120
 
80
121
  @layer base {
122
+ :root {
123
+ --background: 0 0% 100%;
124
+ --foreground: 222.2 84% 4.9%;
125
+ --card: 0 0% 100%;
126
+ --card-foreground: 222.2 84% 4.9%;
127
+ --popover: 0 0% 100%;
128
+ --popover-foreground: 222.2 84% 4.9%;
129
+ --primary: 222.2 47.4% 11.2%;
130
+ --primary-foreground: 210 40% 98%;
131
+ --secondary: 210 40% 96.1%;
132
+ --secondary-foreground: 222.2 47.4% 11.2%;
133
+ --muted: 210 40% 96.1%;
134
+ --muted-foreground: 215.4 16.3% 46.9%;
135
+ --accent: 210 40% 96.1%;
136
+ --accent-foreground: 222.2 47.4% 11.2%;
137
+ --destructive: 0 84.2% 60.2%;
138
+ --destructive-foreground: 210 40% 98%;
139
+ --border: 214.3 31.8% 91.4%;
140
+ --input: 214.3 31.8% 91.4%;
141
+ --ring: 222.2 84% 4.9%;
142
+ --radius: 0.5rem;
143
+ }
144
+
145
+ .dark {
146
+ --background: 222.2 84% 4.9%;
147
+ --foreground: 210 40% 98%;
148
+ --card: 222.2 84% 4.9%;
149
+ --card-foreground: 210 40% 98%;
150
+ --popover: 222.2 84% 4.9%;
151
+ --popover-foreground: 210 40% 98%;
152
+ --primary: 210 40% 98%;
153
+ --primary-foreground: 222.2 47.4% 11.2%;
154
+ --secondary: 217.2 32.6% 17.5%;
155
+ --secondary-foreground: 210 40% 98%;
156
+ --muted: 217.2 32.6% 17.5%;
157
+ --muted-foreground: 215 20.2% 65.1%;
158
+ --accent: 217.2 32.6% 17.5%;
159
+ --accent-foreground: 210 40% 98%;
160
+ --destructive: 0 62.8% 30.6%;
161
+ --destructive-foreground: 210 40% 98%;
162
+ --border: 217.2 32.6% 17.5%;
163
+ --input: 217.2 32.6% 17.5%;
164
+ --ring: 212.7 26.8% 83.9%;
165
+ }
166
+
81
167
  body {
82
168
  @apply bg-background text-foreground;
83
169
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chimerai/cli",
3
- "version": "0.2.85",
3
+ "version": "0.2.86",
4
4
  "description": "CLI wizard for ChimerAI starter kit — scaffold auth, RBAC, AI chat, billing and more into any Next.js project",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {