@chimerai/cli 0.2.85 → 0.2.88

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.
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmBH,UAAU,aAAa;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA+CD,wBAAsB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,iBAyH9E"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmBH,UAAU,aAAa;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA+CD,wBAAsB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,iBAuH9E"}
@@ -156,11 +156,9 @@ async function createCommand(projectName, options) {
156
156
  console.log(chalk_1.default.white(` cd ${projectName}`));
157
157
  console.log(chalk_1.default.white(' npm run dev'));
158
158
  console.log(chalk_1.default.gray('\n Server will run on http://localhost:3001\n'));
159
- if (selectedFeatures.includes('auth')) {
160
- console.log(chalk_1.default.yellow('Login with:'));
161
- console.log(chalk_1.default.white(' Email: admin@example.com'));
162
- console.log(chalk_1.default.white(' Password: admin123\n'));
163
- }
159
+ console.log(chalk_1.default.yellow('Login with:'));
160
+ console.log(chalk_1.default.white(' Email: admin@example.com'));
161
+ console.log(chalk_1.default.white(' Password: admin123\n'));
164
162
  }
165
163
  catch (error) {
166
164
  console.log(chalk_1.default.red('\n❌ Installation failed'));
@@ -296,11 +294,18 @@ async function createPackageJson(targetDir, projectName, features) {
296
294
  react: '^18.3.1',
297
295
  'react-dom': '^18.3.1',
298
296
  '@prisma/client': '^5.22.0',
297
+ // Auth is core infrastructure — routes, middleware, and API handlers all depend on it
298
+ 'next-auth': '^4.24.10',
299
+ '@auth/prisma-adapter': '^2.11.1',
300
+ 'bcryptjs': '^2.4.3',
301
+ 'next-themes': '^0.4.4',
302
+ 'sonner': '^1.7.0',
299
303
  };
300
304
  const devDependencies = {
301
305
  '@types/node': '^20',
302
306
  '@types/react': '^18',
303
307
  '@types/react-dom': '^18',
308
+ '@types/bcryptjs': '^2.4.6',
304
309
  typescript: '^5',
305
310
  tailwindcss: '^3.4.0',
306
311
  postcss: '^8.5.10',
@@ -308,15 +313,6 @@ async function createPackageJson(targetDir, projectName, features) {
308
313
  prisma: '^5.22.0',
309
314
  tsx: '^4.20.6',
310
315
  };
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
316
  // Note: ChimerAI workspace packages are not yet published to npm
321
317
  // For standalone projects, these features will need manual implementation
322
318
  // or you can use the complete starter kit with 'chimerai init'
@@ -1218,10 +1214,10 @@ async function getServerSessionWithPermissions() {
1218
1214
  }
1219
1215
  }
1220
1216
  async function createSeedScript(targetDir, features, sqlite) {
1221
- const hasAuth = features.includes('auth');
1222
1217
  // Generate seed script with feature-specific configuration
1218
+ // next-auth / bcryptjs are always installed (core infrastructure)
1223
1219
  const seedScript = `import { PrismaClient } from '@prisma/client';
1224
- ${hasAuth ? `import * as bcrypt from 'bcryptjs';` : ``}
1220
+ import * as bcrypt from 'bcryptjs';
1225
1221
  import crypto from 'crypto';
1226
1222
 
1227
1223
  const prisma = new PrismaClient();
@@ -1251,7 +1247,7 @@ function encrypt(text: string): string {
1251
1247
  async function main() {
1252
1248
  console.log('🌱 Seeding database...');
1253
1249
 
1254
- ${hasAuth ? ` // Create default admin user
1250
+ // Create default admin user (next-auth is always a core dependency)
1255
1251
  const hashedPassword = await bcrypt.hash('admin123', 10);
1256
1252
  const admin = await prisma.user.upsert({
1257
1253
  where: { email: 'admin@example.com' },
@@ -1263,8 +1259,7 @@ ${hasAuth ? ` // Create default admin user
1263
1259
  },
1264
1260
  });
1265
1261
 
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;`}
1262
+ console.log('✅ Admin user created: admin@example.com / admin123');
1268
1263
  ${features.includes('rbac')
1269
1264
  ? `
1270
1265
  ${sqlite
@@ -1308,9 +1303,9 @@ ${sqlite
1308
1303
  const adminRole = await prisma.role.findUnique({ where: { name: 'admin' } });
1309
1304
  if (adminRole) {
1310
1305
  await prisma.userRole.upsert({
1311
- where: { userId_roleId: { userId: admin!.id, roleId: adminRole.id } },
1306
+ where: { userId_roleId: { userId: admin.id, roleId: adminRole.id } },
1312
1307
  update: {},
1313
- create: { userId: admin!.id, roleId: adminRole.id },
1308
+ create: { userId: admin.id, roleId: adminRole.id },
1314
1309
  });
1315
1310
  console.log('✅ Admin user assigned admin role');
1316
1311
  }
@@ -1335,7 +1330,7 @@ ${sqlite
1335
1330
  status: 'active',
1336
1331
  isDefault: true,
1337
1332
  priority: 0,
1338
- createdBy: admin?.id ?? null,
1333
+ createdBy: admin.id,
1339
1334
  },
1340
1335
  });
1341
1336
 
@@ -1379,7 +1374,7 @@ ${sqlite
1379
1374
  status: 'active',
1380
1375
  isDefault: false,
1381
1376
  priority: 1,
1382
- createdBy: admin?.id ?? null,
1377
+ createdBy: admin.id,
1383
1378
  },
1384
1379
  });
1385
1380
 
@@ -1428,13 +1423,6 @@ async function createDockerCompose(targetDir) {
1428
1423
  await fs_extra_1.default.writeFile(path_1.default.join(targetDir, 'docker-compose.yml'), (0, index_js_1.generateDockerComposeDev)());
1429
1424
  }
1430
1425
  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."';
1438
1426
  // Windows install.bat
1439
1427
  const installBat = sqlite
1440
1428
  ? `@echo off
@@ -1484,7 +1472,9 @@ echo Next steps:
1484
1472
  echo npm run dev
1485
1473
  echo Open: http://localhost:3001
1486
1474
  echo.
1487
- ${loginBlockBat}
1475
+ echo Login with:
1476
+ echo Email: admin@example.com
1477
+ echo Password: admin123
1488
1478
  echo.
1489
1479
  pause
1490
1480
  `
@@ -1554,7 +1544,9 @@ echo Next steps:
1554
1544
  echo npm run dev
1555
1545
  echo Open: http://localhost:3001
1556
1546
  echo.
1557
- ${loginBlockBat}
1547
+ echo Login with:
1548
+ echo Email: admin@example.com
1549
+ echo Password: admin123
1558
1550
  echo.
1559
1551
  pause
1560
1552
  `;
@@ -1593,7 +1585,9 @@ echo "Next steps:"
1593
1585
  echo " npm run dev"
1594
1586
  echo " Open: http://localhost:3001"
1595
1587
  echo ""
1596
- ${loginBlockSh}
1588
+ echo "Login with:"
1589
+ echo " Email: admin@example.com"
1590
+ echo " Password: admin123"
1597
1591
  echo ""
1598
1592
  `
1599
1593
  : `#!/bin/bash
@@ -1641,7 +1635,9 @@ echo "Next steps:"
1641
1635
  echo " npm run dev"
1642
1636
  echo " Open: http://localhost:3001"
1643
1637
  echo ""
1644
- ${loginBlockSh}
1638
+ echo "Login with:"
1639
+ echo " Email: admin@example.com"
1640
+ echo " Password: admin123"
1645
1641
  echo ""
1646
1642
  `;
1647
1643
  await fs_extra_1.default.writeFile(path_1.default.join(targetDir, 'install.bat'), installBat);
@@ -1727,13 +1723,13 @@ npm run dev
1727
1723
 
1728
1724
  Open [http://localhost:3001](http://localhost:3001) in your browser.
1729
1725
 
1730
- ${features.includes('auth') ? `### Default Admin Credentials
1726
+ ### Default Admin Credentials
1731
1727
 
1732
1728
  - Email: admin@example.com
1733
1729
  - Password: admin123
1734
1730
 
1735
1731
  ⚠️ Change these in production!
1736
- ` : ``}
1732
+
1737
1733
  ## Available Scripts
1738
1734
 
1739
1735
  - \`pnpm dev\` - Start development server
@@ -1794,7 +1790,8 @@ Commercial License - See LICENSE file
1794
1790
  5. \`pnpm dev\`
1795
1791
 
1796
1792
  ## Default Login
1797
- ${features.includes('auth') ? `- Email: admin@example.com\n- Password: admin123` : `- No auth feature selected`}
1793
+ - Email: admin@example.com
1794
+ - Password: admin123
1798
1795
 
1799
1796
  ## CLI Commands
1800
1797
  - \`chimerai add <component>\` — Add features
@@ -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.88",
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": {