cus-base-ui 0.2.5 → 0.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/ui-cli.ts +11 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cus-base-ui",
3
3
  "private": false,
4
- "version": "0.2.5",
4
+ "version": "0.2.6",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "cus-base-ui": "./dist/ui-cli.cjs"
package/scripts/ui-cli.ts CHANGED
@@ -359,6 +359,17 @@ const main = async () => {
359
359
  error('Usage: npx cus-base-ui add <component-name> [--force]');
360
360
  return;
361
361
  }
362
+
363
+ // Auto-init if not yet initialized
364
+ const cnPath = path.join(cwd, 'src/lib/utils/cn.ts');
365
+ if (!fs.existsSync(cnPath)) {
366
+ log('Project not initialized — running init first...');
367
+ setupViteConfig(cwd);
368
+ setupTsConfig(cwd);
369
+ ensureTailwindCss(cwd);
370
+ installNpmPackages(RUNTIME_PACKAGES, cwd);
371
+ }
372
+
362
373
  for (const name of componentNames) {
363
374
  addComponent(name, registry, cwd, { force: isForce });
364
375
  }