@chimerai/cli 0.2.82 → 0.2.85

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,iBAuH9E"}
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"}
@@ -156,9 +156,11 @@ 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
- 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'));
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
+ }
162
164
  }
163
165
  catch (error) {
164
166
  console.log(chalk_1.default.red('\nāŒ Installation failed'));
@@ -220,7 +222,7 @@ async function createProject(targetDir, projectName, features, sqlite) {
220
222
  }
221
223
  // 9. Create install scripts
222
224
  spinner.text = 'Creating install scripts...';
223
- await createInstallScripts(targetDir, sqlite);
225
+ await createInstallScripts(targetDir, features, sqlite);
224
226
  // 10. Create README
225
227
  spinner.text = 'Creating documentation...';
226
228
  await createReadme(targetDir, projectName, features);
@@ -301,7 +303,7 @@ async function createPackageJson(targetDir, projectName, features) {
301
303
  '@types/react-dom': '^18',
302
304
  typescript: '^5',
303
305
  tailwindcss: '^3.4.0',
304
- postcss: '^8',
306
+ postcss: '^8.5.10',
305
307
  autoprefixer: '^10',
306
308
  prisma: '^5.22.0',
307
309
  tsx: '^4.20.6',
@@ -361,9 +363,6 @@ async function createPackageJson(targetDir, projectName, features) {
361
363
  dependencies,
362
364
  devDependencies,
363
365
  overrides: {
364
- // Force postcss >= 8.5.10 to fix GHSA-qx2v-qp2m-jg93 (XSS via unescaped </style>)
365
- // next bundles its own postcss which may be older than 8.5.10
366
- postcss: '^8.5.10',
367
366
  // Force uuid@11 to suppress uuid@8 deprecation warning from next-auth@4
368
367
  uuid: '^11',
369
368
  },
@@ -1219,9 +1218,10 @@ async function getServerSessionWithPermissions() {
1219
1218
  }
1220
1219
  }
1221
1220
  async function createSeedScript(targetDir, features, sqlite) {
1221
+ const hasAuth = features.includes('auth');
1222
1222
  // Generate seed script with feature-specific configuration
1223
1223
  const seedScript = `import { PrismaClient } from '@prisma/client';
1224
- import * as bcrypt from 'bcryptjs';
1224
+ ${hasAuth ? `import * as bcrypt from 'bcryptjs';` : ``}
1225
1225
  import crypto from 'crypto';
1226
1226
 
1227
1227
  const prisma = new PrismaClient();
@@ -1251,7 +1251,7 @@ function encrypt(text: string): string {
1251
1251
  async function main() {
1252
1252
  console.log('🌱 Seeding database...');
1253
1253
 
1254
- // Create default admin user
1254
+ ${hasAuth ? ` // Create default admin user
1255
1255
  const hashedPassword = await bcrypt.hash('admin123', 10);
1256
1256
  const admin = await prisma.user.upsert({
1257
1257
  where: { email: 'admin@example.com' },
@@ -1263,7 +1263,8 @@ async function main() {
1263
1263
  },
1264
1264
  });
1265
1265
 
1266
- console.log('āœ… Admin user created: admin@example.com / admin123');
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;`}
1267
1268
  ${features.includes('rbac')
1268
1269
  ? `
1269
1270
  ${sqlite
@@ -1307,9 +1308,9 @@ ${sqlite
1307
1308
  const adminRole = await prisma.role.findUnique({ where: { name: 'admin' } });
1308
1309
  if (adminRole) {
1309
1310
  await prisma.userRole.upsert({
1310
- where: { userId_roleId: { userId: admin.id, roleId: adminRole.id } },
1311
+ where: { userId_roleId: { userId: admin!.id, roleId: adminRole.id } },
1311
1312
  update: {},
1312
- create: { userId: admin.id, roleId: adminRole.id },
1313
+ create: { userId: admin!.id, roleId: adminRole.id },
1313
1314
  });
1314
1315
  console.log('āœ… Admin user assigned admin role');
1315
1316
  }
@@ -1334,7 +1335,7 @@ ${sqlite
1334
1335
  status: 'active',
1335
1336
  isDefault: true,
1336
1337
  priority: 0,
1337
- createdBy: admin.id,
1338
+ createdBy: admin?.id ?? null,
1338
1339
  },
1339
1340
  });
1340
1341
 
@@ -1378,7 +1379,7 @@ ${sqlite
1378
1379
  status: 'active',
1379
1380
  isDefault: false,
1380
1381
  priority: 1,
1381
- createdBy: admin.id,
1382
+ createdBy: admin?.id ?? null,
1382
1383
  },
1383
1384
  });
1384
1385
 
@@ -1426,7 +1427,14 @@ main()
1426
1427
  async function createDockerCompose(targetDir) {
1427
1428
  await fs_extra_1.default.writeFile(path_1.default.join(targetDir, 'docker-compose.yml'), (0, index_js_1.generateDockerComposeDev)());
1428
1429
  }
1429
- async function createInstallScripts(targetDir, sqlite) {
1430
+ 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."';
1430
1438
  // Windows install.bat
1431
1439
  const installBat = sqlite
1432
1440
  ? `@echo off
@@ -1476,9 +1484,7 @@ echo Next steps:
1476
1484
  echo npm run dev
1477
1485
  echo Open: http://localhost:3001
1478
1486
  echo.
1479
- echo Login with:
1480
- echo Email: admin@example.com
1481
- echo Password: admin123
1487
+ ${loginBlockBat}
1482
1488
  echo.
1483
1489
  pause
1484
1490
  `
@@ -1548,9 +1554,7 @@ echo Next steps:
1548
1554
  echo npm run dev
1549
1555
  echo Open: http://localhost:3001
1550
1556
  echo.
1551
- echo Login with:
1552
- echo Email: admin@example.com
1553
- echo Password: admin123
1557
+ ${loginBlockBat}
1554
1558
  echo.
1555
1559
  pause
1556
1560
  `;
@@ -1589,9 +1593,7 @@ echo "Next steps:"
1589
1593
  echo " npm run dev"
1590
1594
  echo " Open: http://localhost:3001"
1591
1595
  echo ""
1592
- echo "Login with:"
1593
- echo " Email: admin@example.com"
1594
- echo " Password: admin123"
1596
+ ${loginBlockSh}
1595
1597
  echo ""
1596
1598
  `
1597
1599
  : `#!/bin/bash
@@ -1639,9 +1641,7 @@ echo "Next steps:"
1639
1641
  echo " npm run dev"
1640
1642
  echo " Open: http://localhost:3001"
1641
1643
  echo ""
1642
- echo "Login with:"
1643
- echo " Email: admin@example.com"
1644
- echo " Password: admin123"
1644
+ ${loginBlockSh}
1645
1645
  echo ""
1646
1646
  `;
1647
1647
  await fs_extra_1.default.writeFile(path_1.default.join(targetDir, 'install.bat'), installBat);
@@ -1727,13 +1727,13 @@ npm run dev
1727
1727
 
1728
1728
  Open [http://localhost:3001](http://localhost:3001) in your browser.
1729
1729
 
1730
- ### Default Admin Credentials
1730
+ ${features.includes('auth') ? `### Default Admin Credentials
1731
1731
 
1732
1732
  - Email: admin@example.com
1733
1733
  - Password: admin123
1734
1734
 
1735
1735
  āš ļø Change these in production!
1736
-
1736
+ ` : ``}
1737
1737
  ## Available Scripts
1738
1738
 
1739
1739
  - \`pnpm dev\` - Start development server
@@ -1794,8 +1794,7 @@ Commercial License - See LICENSE file
1794
1794
  5. \`pnpm dev\`
1795
1795
 
1796
1796
  ## Default Login
1797
- - Email: admin@example.com
1798
- - Password: admin123
1797
+ ${features.includes('auth') ? `- Email: admin@example.com\n- Password: admin123` : `- No auth feature selected`}
1799
1798
 
1800
1799
  ## CLI Commands
1801
1800
  - \`chimerai add <component>\` — Add features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chimerai/cli",
3
- "version": "0.2.82",
3
+ "version": "0.2.85",
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": {