homeontour-ui 0.1.6 → 0.1.7

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/README.md CHANGED
@@ -33,6 +33,21 @@ Interactive selection:
33
33
  pnpm dlx homeontour-ui@latest add
34
34
  ```
35
35
 
36
+ ### Generate new components (for registry development)
37
+
38
+ When working on the registry itself, use the generate command:
39
+
40
+ ```bash
41
+ # In the registry project directory
42
+ pnpm generate my-component
43
+ ```
44
+
45
+ This creates:
46
+ - `src/components/registry/my-component/index.tsx`
47
+ - `src/components/registry/my-component/metadata.ts` (with usage blocks)
48
+ - `src/components/registry/my-component/default.example.tsx`
49
+ - Automatically updates `metadata-registry.ts`
50
+
36
51
  ### Options
37
52
 
38
53
  ```bash
package/dist/index.js CHANGED
@@ -14,10 +14,62 @@ import path from "path";
14
14
  import fetch from "node-fetch";
15
15
  var REGISTRY_URL = "https://ui.homeontour.com/api/registry";
16
16
  function getComponentsDir(cwd) {
17
+ const componentsJsonPath = path.join(cwd, "components.json");
18
+ if (fs.existsSync(componentsJsonPath)) {
19
+ try {
20
+ const config = fs.readJsonSync(componentsJsonPath);
21
+ if (config["homeontour-ui"]?.components) {
22
+ return config["homeontour-ui"].components;
23
+ }
24
+ } catch (error) {
25
+ }
26
+ }
27
+ if (process.env.HOMEONTOUR_UI_COMPONENTS_DIR) {
28
+ return process.env.HOMEONTOUR_UI_COMPONENTS_DIR;
29
+ }
17
30
  const srcDir = path.join(cwd, "src");
18
31
  const baseDir = fs.existsSync(srcDir) ? "src/components" : "components";
19
32
  return path.join(baseDir, "homeontour-ui");
20
33
  }
34
+ async function ensureComponentsJson(cwd, componentsPath) {
35
+ const componentsJsonPath = path.join(cwd, "components.json");
36
+ const relativePath = path.isAbsolute(componentsPath) ? path.relative(cwd, componentsPath) : componentsPath;
37
+ if (fs.existsSync(componentsJsonPath)) {
38
+ try {
39
+ const config = fs.readJsonSync(componentsJsonPath);
40
+ if (!config["homeontour-ui"]) {
41
+ config["homeontour-ui"] = { components: relativePath };
42
+ fs.writeJsonSync(componentsJsonPath, config, { spaces: 2 });
43
+ }
44
+ } catch (error) {
45
+ return;
46
+ }
47
+ } else {
48
+ const spinner = ora("Setting up shadcn/ui...").start();
49
+ try {
50
+ await execa("pnpm", ["dlx", "shadcn@latest", "init", "-y"], {
51
+ cwd
52
+ });
53
+ spinner.succeed("shadcn/ui initialized");
54
+ } catch (error) {
55
+ spinner.warn("Could not run shadcn init automatically");
56
+ console.log(chalk.yellow("\nPlease run manually: pnpm dlx shadcn@latest init"));
57
+ }
58
+ try {
59
+ const config = fs.readJsonSync(componentsJsonPath);
60
+ config["homeontour-ui"] = { components: relativePath };
61
+ fs.writeJsonSync(componentsJsonPath, config, { spaces: 2 });
62
+ } catch (error) {
63
+ const config = {
64
+ $schema: "https://ui.shadcn.com/schema.json",
65
+ "homeontour-ui": {
66
+ components: relativePath
67
+ }
68
+ };
69
+ fs.writeJsonSync(componentsJsonPath, config, { spaces: 2 });
70
+ }
71
+ }
72
+ }
21
73
  var addCommand = new Command().name("add").description("Add a component to your project").argument("[components...]", "The components to add").option("-y, --yes", "Skip confirmation prompt").option("-o, --overwrite", "Overwrite existing files").action(async (components, options) => {
22
74
  try {
23
75
  const cwd = process.cwd();
@@ -56,6 +108,8 @@ var addCommand = new Command().name("add").description("Add a component to your
56
108
  process.exit(1);
57
109
  }
58
110
  }
111
+ const defaultComponentsDir = getComponentsDir(cwd);
112
+ await ensureComponentsJson(cwd, defaultComponentsDir);
59
113
  for (const componentName of components) {
60
114
  await addComponent(componentName, { cwd, ...options });
61
115
  }
@@ -79,7 +133,8 @@ async function addComponent(componentName, options) {
79
133
  throw new Error(`Component "${componentName}" not found in registry`);
80
134
  }
81
135
  const component = await response.json();
82
- const componentDir = path.join(options.cwd, getComponentsDir(options.cwd));
136
+ const componentsDir = getComponentsDir(options.cwd);
137
+ const componentDir = path.isAbsolute(componentsDir) ? componentsDir : path.join(options.cwd, componentsDir);
83
138
  const componentPath = path.join(componentDir, component.files[0].name);
84
139
  if (fs.existsSync(componentPath) && !options.overwrite) {
85
140
  spinner.warn(`${componentName} already exists`);
@@ -280,13 +335,41 @@ export const metadata: ComponentMetadata = {
280
335
  {
281
336
  name: "Default",
282
337
  description: "Default ${componentPascal} component",
283
- code: \`<${componentPascal} />\`,
284
- previewProps: {},
338
+ exampleComponent: "DefaultExample",
285
339
  },
286
340
  ],
341
+ usage: {
342
+ importCode: \`import { ${componentPascal} } from "@/components/homeontour-ui/${componentName}"\`,
343
+ componentCode: \`<${componentPascal} />\`,
344
+ },
287
345
  }
288
346
  `;
289
347
  }
348
+ function generateExampleContent(componentName, componentPascal) {
349
+ return `"use client"
350
+
351
+ import { ${componentPascal} } from "./index"
352
+
353
+ /**
354
+ * Example: Default
355
+ * Default ${componentPascal} component
356
+ */
357
+ export function DefaultExample() {
358
+ return (
359
+ <${componentPascal} />
360
+ )
361
+ }
362
+
363
+ // Code for this example (used in documentation)
364
+ export const code = \`import { ${componentPascal} } from "./index"
365
+
366
+ export function DefaultExample() {
367
+ return (
368
+ <${componentPascal} />
369
+ )
370
+ }\`
371
+ `;
372
+ }
290
373
  async function updateMetadataRegistry(projectRoot, componentName, componentPascal) {
291
374
  const metadataRegistryPath = path3.join(projectRoot, "src/lib/metadata-registry.ts");
292
375
  if (!fs3.existsSync(metadataRegistryPath)) {
@@ -294,7 +377,7 @@ async function updateMetadataRegistry(projectRoot, componentName, componentPasca
294
377
  }
295
378
  let lines = (await fs3.readFile(metadataRegistryPath, "utf-8")).split("\n");
296
379
  const importName = `${toCamelCase(componentName)}Metadata`;
297
- const importStatement = `import { metadata as ${importName} } from "@/components/registry/${componentName}.metadata"`;
380
+ const importStatement = `import { metadata as ${importName} } from "@/components/registry/${componentName}/metadata"`;
298
381
  if (lines.some((line) => line.includes(importStatement))) {
299
382
  throw new Error("Import already exists");
300
383
  }
@@ -341,7 +424,7 @@ var generateCommand = new Command3().name("generate").alias("gen").description("
341
424
  try {
342
425
  const cwd = process.cwd();
343
426
  if (!/^[a-z][a-z0-9-]*$/.test(name)) {
344
- console.error(chalk3.red("Error: Component name must be in kebab-case (e.g., my-component)"));
427
+ console.error(chalk3.red("Error: Component name must be in kebab-case (e.g., my-component) or simple lowercase (e.g., basic)"));
345
428
  process.exit(1);
346
429
  }
347
430
  const spinner = ora3(`Generating ${name} component...`).start();
@@ -352,19 +435,25 @@ var generateCommand = new Command3().name("generate").alias("gen").description("
352
435
  process.exit(1);
353
436
  }
354
437
  const componentPascal = toPascalCase(name);
355
- const componentFile = path3.join(registryDir, `${name}.tsx`);
356
- const metadataFile = path3.join(registryDir, `${name}.metadata.ts`);
357
- if (fs3.existsSync(componentFile) || fs3.existsSync(metadataFile)) {
438
+ const componentDir = path3.join(registryDir, name);
439
+ const componentFile = path3.join(componentDir, "index.tsx");
440
+ const metadataFile = path3.join(componentDir, "metadata.ts");
441
+ const exampleFile = path3.join(componentDir, "default.example.tsx");
442
+ if (fs3.existsSync(componentDir)) {
358
443
  spinner.warn(`${name} already exists`);
359
- console.log(chalk3.yellow(`Component files already exist. Skipping generation.`));
444
+ console.log(chalk3.yellow(`Component directory already exists. Skipping generation.`));
360
445
  process.exit(0);
361
446
  }
447
+ await fs3.ensureDir(componentDir);
362
448
  const componentContent = generateComponentContent(name, componentPascal);
363
449
  await fs3.writeFile(componentFile, componentContent, "utf-8");
364
- spinner.succeed(`Created ${name}.tsx`);
450
+ spinner.succeed(`Created ${name}/index.tsx`);
365
451
  const metadataContent = generateMetadataContent(name, componentPascal);
366
452
  await fs3.writeFile(metadataFile, metadataContent, "utf-8");
367
- spinner.succeed(`Created ${name}.metadata.ts`);
453
+ spinner.succeed(`Created ${name}/metadata.ts`);
454
+ const exampleContent = generateExampleContent(name, componentPascal);
455
+ await fs3.writeFile(exampleFile, exampleContent, "utf-8");
456
+ spinner.succeed(`Created ${name}/default.example.tsx`);
368
457
  spinner.start("Updating metadata registry...");
369
458
  try {
370
459
  await updateMetadataRegistry(cwd, name, componentPascal);
@@ -372,15 +461,16 @@ var generateCommand = new Command3().name("generate").alias("gen").description("
372
461
  } catch (error) {
373
462
  spinner.warn("Could not automatically update metadata registry");
374
463
  console.log(chalk3.yellow("\nPlease manually add the following to src/lib/metadata-registry.ts:"));
375
- console.log(chalk3.cyan(`import { metadata as ${toCamelCase(name)}Metadata } from "@/components/registry/${name}.metadata"`));
464
+ console.log(chalk3.cyan(`import { metadata as ${toCamelCase(name)}Metadata } from "@/components/registry/${name}/metadata"`));
376
465
  console.log(chalk3.cyan(` "${name}": ${toCamelCase(name)}Metadata,`));
377
466
  }
378
467
  console.log();
379
468
  console.log(chalk3.green("\u2713 Component generated successfully!"));
380
469
  console.log();
381
470
  console.log("Next steps:");
382
- console.log(chalk3.cyan(` 1. Edit src/components/registry/${name}.tsx`));
383
- console.log(chalk3.cyan(` 2. Update src/components/registry/${name}.metadata.ts with examples and description`));
471
+ console.log(chalk3.cyan(` 1. Edit src/components/registry/${name}/index.tsx`));
472
+ console.log(chalk3.cyan(` 2. Update src/components/registry/${name}/metadata.ts with examples and description`));
473
+ console.log(chalk3.cyan(` 3. Add more examples in src/components/registry/${name}/*.example.tsx`));
384
474
  console.log();
385
475
  } catch (error) {
386
476
  console.error(chalk3.red("Error:"), error instanceof Error ? error.message : error);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/commands/add.ts","../src/commands/init.ts","../src/commands/generate.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander'\nimport { addCommand } from './commands/add.js'\nimport { initCommand } from './commands/init.js'\nimport { generateCommand } from './commands/generate.js'\n\nconst program = new Command()\n\nprogram\n .name('homeontour-ui')\n .description('Add HomeOnTour UI components to your project')\n .version('0.1.0')\n\nprogram.addCommand(addCommand)\nprogram.addCommand(initCommand)\nprogram.addCommand(generateCommand)\n\nprogram.parse()\n","import { Command } from 'commander'\nimport prompts from 'prompts'\nimport chalk from 'chalk'\nimport ora from 'ora'\nimport { execa } from 'execa'\nimport fs from 'fs-extra'\nimport path from 'path'\nimport fetch from 'node-fetch'\n\nconst REGISTRY_URL = 'https://ui.homeontour.com/api/registry'\n\nfunction getComponentsDir(cwd: string): string {\n const srcDir = path.join(cwd, 'src')\n const baseDir = fs.existsSync(srcDir) ? 'src/components' : 'components'\n return path.join(baseDir, 'homeontour-ui')\n}\n\nexport const addCommand = new Command()\n .name('add')\n .description('Add a component to your project')\n .argument('[components...]', 'The components to add')\n .option('-y, --yes', 'Skip confirmation prompt')\n .option('-o, --overwrite', 'Overwrite existing files')\n .action(async (components: string[], options) => {\n try {\n const cwd = process.cwd()\n \n // Check if we're in a valid project\n const packageJsonPath = path.join(cwd, 'package.json')\n if (!fs.existsSync(packageJsonPath)) {\n console.error(chalk.red('Error: No package.json found. Are you in a project directory?'))\n process.exit(1)\n }\n\n // If no components specified, show interactive selection\n if (!components || components.length === 0) {\n const spinner = ora('Fetching components...').start()\n \n try {\n const response = await fetch(REGISTRY_URL)\n if (!response.ok) {\n throw new Error('Failed to fetch components')\n }\n \n const allComponents = await response.json() as any[]\n spinner.succeed('Fetched available components')\n \n const { selectedComponents } = await prompts({\n type: 'multiselect',\n name: 'selectedComponents',\n message: 'Which components would you like to add?',\n choices: allComponents.map((c: any) => ({\n title: `${c.name} - ${c.description}`,\n value: c.name,\n })),\n min: 1,\n })\n \n if (!selectedComponents || selectedComponents.length === 0) {\n console.log(chalk.yellow('No components selected. Exiting.'))\n process.exit(0)\n }\n \n components = selectedComponents\n } catch (error) {\n spinner.fail('Failed to fetch components')\n console.error(chalk.red('Error: Could not connect to registry. Is the server running?'))\n process.exit(1)\n }\n }\n\n // Add each component\n for (const componentName of components) {\n await addComponent(componentName, { cwd, ...options })\n }\n\n console.log()\n console.log(chalk.green('✓ Done! Components added successfully.'))\n console.log()\n console.log('Import and use them in your project:')\n const componentsDir = getComponentsDir(cwd)\n const importPath = componentsDir.replace(/\\\\/g, '/')\n console.log(chalk.cyan(`import { LogoSvg } from '@/${importPath}/logo-svg'`))\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error)\n process.exit(1)\n }\n })\n\nasync function addComponent(\n componentName: string,\n options: { cwd: string; yes?: boolean; overwrite?: boolean }\n) {\n const spinner = ora(`Adding ${componentName}...`).start()\n\n try {\n // Fetch component from registry\n const response = await fetch(`${REGISTRY_URL}/${componentName}`)\n \n if (!response.ok) {\n throw new Error(`Component \"${componentName}\" not found in registry`)\n }\n \n const component = await response.json() as any\n\n // Check if component already exists\n const componentDir = path.join(options.cwd, getComponentsDir(options.cwd))\n const componentPath = path.join(componentDir, component.files[0].name)\n \n if (fs.existsSync(componentPath) && !options.overwrite) {\n spinner.warn(`${componentName} already exists`)\n \n if (!options.yes) {\n const { overwrite } = await prompts({\n type: 'confirm',\n name: 'overwrite',\n message: `Overwrite existing ${componentName}?`,\n initial: false,\n })\n \n if (!overwrite) {\n return\n }\n } else {\n return\n }\n }\n\n // Install npm dependencies\n if (component.dependencies && component.dependencies.length > 0) {\n spinner.text = `Installing dependencies for ${componentName}...`\n const deps = component.dependencies.map((d: any) => `${d.name}@${d.version}`).join(' ')\n \n try {\n await execa('pnpm', ['add', ...deps.split(' ')], {\n cwd: options.cwd,\n })\n } catch (error) {\n // Try npm as fallback\n try {\n await execa('npm', ['install', ...deps.split(' ')], {\n cwd: options.cwd,\n })\n } catch (npmError) {\n spinner.warn(`Could not install dependencies automatically`)\n console.log(chalk.yellow(`\\nPlease install manually: pnpm add ${deps}`))\n }\n }\n }\n\n // Install shadcn/ui dependencies\n if (component.registryDependencies && component.registryDependencies.length > 0) {\n spinner.text = `Installing shadcn/ui components...`\n const shadcnDeps = component.registryDependencies.join(' ')\n \n try {\n await execa('pnpm', ['dlx', 'shadcn@latest', 'add', ...shadcnDeps.split(' '), '-y'], {\n cwd: options.cwd,\n })\n } catch (error) {\n spinner.warn(`Could not install shadcn/ui components automatically`)\n console.log(chalk.yellow(`\\nPlease install manually: pnpm dlx shadcn@latest add ${shadcnDeps}`))\n }\n }\n\n // Create component files\n spinner.text = `Creating ${componentName} files...`\n await fs.ensureDir(componentDir)\n \n for (const file of component.files) {\n const filePath = path.join(componentDir, file.name)\n await fs.writeFile(filePath, file.content, 'utf-8')\n }\n\n spinner.succeed(`Added ${componentName}`)\n } catch (error) {\n spinner.fail(`Failed to add ${componentName}`)\n throw error\n }\n}\n","import { Command } from 'commander'\nimport prompts from 'prompts'\nimport chalk from 'chalk'\nimport ora from 'ora'\nimport { execa } from 'execa'\nimport fs from 'fs-extra'\nimport path from 'path'\n\nexport const initCommand = new Command()\n .name('init')\n .description('Initialize your project for HomeOnTour UI')\n .option('-y, --yes', 'Skip confirmation prompt')\n .action(async (options) => {\n try {\n const cwd = process.cwd()\n \n console.log()\n console.log(chalk.bold('Initializing HomeOnTour UI...'))\n console.log()\n\n // Check if package.json exists\n const packageJsonPath = path.join(cwd, 'package.json')\n if (!fs.existsSync(packageJsonPath)) {\n console.error(chalk.red('Error: No package.json found. Please run this in a project directory.'))\n process.exit(1)\n }\n\n // Check for required dependencies\n const requiredDeps = [\n 'class-variance-authority',\n 'clsx',\n 'tailwind-merge',\n 'lucide-react',\n ]\n\n const spinner = ora('Checking dependencies...').start()\n \n const packageJson = await fs.readJson(packageJsonPath)\n const installedDeps = {\n ...packageJson.dependencies,\n ...packageJson.devDependencies,\n }\n\n const missingDeps = requiredDeps.filter((dep) => !installedDeps[dep])\n\n if (missingDeps.length > 0) {\n spinner.info('Installing required dependencies...')\n \n try {\n await execa('pnpm', ['add', ...missingDeps], { cwd })\n spinner.succeed('Dependencies installed')\n } catch (error) {\n spinner.fail('Failed to install dependencies')\n console.log(chalk.yellow(`\\nPlease install manually:`))\n console.log(chalk.cyan(`pnpm add ${missingDeps.join(' ')}`))\n }\n } else {\n spinner.succeed('All dependencies are installed')\n }\n\n // Check for utils file\n const utilsPath = path.join(cwd, 'lib', 'utils.ts')\n const srcUtilsPath = path.join(cwd, 'src', 'lib', 'utils.ts')\n const utilsExists = fs.existsSync(utilsPath) || fs.existsSync(srcUtilsPath)\n\n if (!utilsExists) {\n const { createUtils } = await prompts({\n type: 'confirm',\n name: 'createUtils',\n message: 'Create lib/utils.ts with cn helper?',\n initial: true,\n })\n\n if (createUtils) {\n const targetUtilsPath = fs.existsSync(path.join(cwd, 'src')) ? srcUtilsPath : utilsPath\n \n await fs.ensureDir(path.dirname(targetUtilsPath))\n await fs.writeFile(\n targetUtilsPath,\n `import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n`,\n 'utf-8'\n )\n console.log(chalk.green('✓ Created lib/utils.ts'))\n }\n }\n\n // Create components directory\n const componentsDir = path.join(cwd, 'components', 'homeontour-ui')\n await fs.ensureDir(componentsDir)\n console.log(chalk.green('✓ Created components/homeontour-ui directory'))\n\n console.log()\n console.log(chalk.green('✓ Initialization complete!'))\n console.log()\n console.log('You can now add components:')\n console.log(chalk.cyan(' pnpm dlx homeontour-ui@latest add logo-svg'))\n console.log()\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error)\n process.exit(1)\n }\n })\n","import { Command } from 'commander'\nimport chalk from 'chalk'\nimport ora from 'ora'\nimport fs from 'fs-extra'\nimport path from 'path'\n\n// Convert kebab-case to PascalCase\nfunction toPascalCase(str: string): string {\n return str\n .split('-')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join('')\n}\n\n// Convert kebab-case to camelCase\nfunction toCamelCase(str: string): string {\n const pascal = toPascalCase(str)\n return pascal.charAt(0).toLowerCase() + pascal.slice(1)\n}\n\n// Generate component TSX content\nfunction generateComponentContent(componentName: string, componentPascal: string): string {\n return `import * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport interface ${componentPascal}Props extends React.HTMLAttributes<HTMLDivElement> {\n // Add your custom props here\n}\n\nexport const ${componentPascal} = React.forwardRef<HTMLDivElement, ${componentPascal}Props>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"\", className)}\n {...props}\n />\n )\n }\n)\n${componentPascal}.displayName = \"${componentPascal}\"\n\nexport default ${componentPascal}\n`\n}\n\n// Generate metadata content\nfunction generateMetadataContent(componentName: string, componentPascal: string): string {\n return `import { ComponentMetadata } from \"@/lib/component-metadata\"\n\nexport const metadata: ComponentMetadata = {\n name: \"${componentName}\",\n type: \"components:ui\",\n description: \"${componentPascal} component.\",\n category: \"UI Components\",\n registryDependencies: [],\n examples: [\n {\n name: \"Default\",\n description: \"Default ${componentPascal} component\",\n code: \\`<${componentPascal} />\\`,\n previewProps: {},\n },\n ],\n}\n`\n}\n\n// Update metadata registry\nasync function updateMetadataRegistry(\n projectRoot: string,\n componentName: string,\n componentPascal: string\n) {\n const metadataRegistryPath = path.join(projectRoot, 'src/lib/metadata-registry.ts')\n \n if (!fs.existsSync(metadataRegistryPath)) {\n throw new Error('metadata-registry.ts not found')\n }\n\n let lines = (await fs.readFile(metadataRegistryPath, 'utf-8')).split('\\n')\n const importName = `${toCamelCase(componentName)}Metadata`\n const importStatement = `import { metadata as ${importName} } from \"@/components/registry/${componentName}.metadata\"`\n \n // Check if import already exists\n if (lines.some(line => line.includes(importStatement))) {\n throw new Error('Import already exists')\n }\n \n // Find the last import line and insert after it\n let lastImportIndex = -1\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].trim().startsWith('import ') && lines[i].includes('from')) {\n lastImportIndex = i\n }\n }\n \n if (lastImportIndex >= 0) {\n lines.splice(lastImportIndex + 1, 0, importStatement)\n }\n \n // Add to registry object - find the registry object and insert before closing brace\n const registryEntry = ` \"${componentName}\": ${importName},`\n let inRegistryObject = false\n let lastRegistryEntryIndex = -1\n \n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]\n \n if (line.includes('export const metadataRegistry')) {\n inRegistryObject = true\n continue\n }\n \n if (inRegistryObject) {\n // Check if this is a registry entry (contains \": metadata\" or similar)\n if (line.trim().match(/^\"[^\"]+\":\\s+\\w+Metadata,?$/)) {\n lastRegistryEntryIndex = i\n }\n \n // Check if we've reached the closing brace\n if (line.trim() === '}') {\n // Insert before this closing brace\n if (lastRegistryEntryIndex >= 0) {\n lines.splice(lastRegistryEntryIndex + 1, 0, registryEntry)\n } else {\n // No entries found, insert right after opening brace\n // Find the opening brace line\n for (let j = i - 1; j >= 0; j--) {\n if (lines[j].includes('metadataRegistry') && lines[j].includes('{')) {\n lines.splice(j + 1, 0, registryEntry)\n break\n }\n }\n }\n break\n }\n }\n }\n \n await fs.writeFile(metadataRegistryPath, lines.join('\\n'), 'utf-8')\n}\n\nexport const generateCommand = new Command()\n .name('generate')\n .alias('gen')\n .description('Generate boilerplate for a new component')\n .argument('<name>', 'Component name in kebab-case (e.g., my-component)')\n .action(async (name: string) => {\n try {\n const cwd = process.cwd()\n \n // Validate component name (kebab-case)\n if (!/^[a-z][a-z0-9-]*$/.test(name)) {\n console.error(chalk.red('Error: Component name must be in kebab-case (e.g., my-component)'))\n process.exit(1)\n }\n\n const spinner = ora(`Generating ${name} component...`).start()\n\n // Check if we're in the project root (has src/components/registry directory)\n const registryDir = path.join(cwd, 'src/components/registry')\n if (!fs.existsSync(registryDir)) {\n spinner.fail('Error: src/components/registry directory not found')\n console.error(chalk.red('Are you in the correct project directory?'))\n process.exit(1)\n }\n\n const componentPascal = toPascalCase(name)\n const componentFile = path.join(registryDir, `${name}.tsx`)\n const metadataFile = path.join(registryDir, `${name}.metadata.ts`)\n\n // Check if component already exists\n if (fs.existsSync(componentFile) || fs.existsSync(metadataFile)) {\n spinner.warn(`${name} already exists`)\n console.log(chalk.yellow(`Component files already exist. Skipping generation.`))\n process.exit(0)\n }\n\n // Generate component file\n const componentContent = generateComponentContent(name, componentPascal)\n await fs.writeFile(componentFile, componentContent, 'utf-8')\n spinner.succeed(`Created ${name}.tsx`)\n\n // Generate metadata file\n const metadataContent = generateMetadataContent(name, componentPascal)\n await fs.writeFile(metadataFile, metadataContent, 'utf-8')\n spinner.succeed(`Created ${name}.metadata.ts`)\n\n // Update metadata registry\n spinner.start('Updating metadata registry...')\n try {\n await updateMetadataRegistry(cwd, name, componentPascal)\n spinner.succeed('Updated metadata registry')\n } catch (error) {\n spinner.warn('Could not automatically update metadata registry')\n console.log(chalk.yellow('\\nPlease manually add the following to src/lib/metadata-registry.ts:'))\n console.log(chalk.cyan(`import { metadata as ${toCamelCase(name)}Metadata } from \"@/components/registry/${name}.metadata\"`))\n console.log(chalk.cyan(` \"${name}\": ${toCamelCase(name)}Metadata,`))\n }\n\n console.log()\n console.log(chalk.green('✓ Component generated successfully!'))\n console.log()\n console.log('Next steps:')\n console.log(chalk.cyan(` 1. Edit src/components/registry/${name}.tsx`))\n console.log(chalk.cyan(` 2. Update src/components/registry/${name}.metadata.ts with examples and description`))\n console.log()\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error)\n process.exit(1)\n }\n })\n"],"mappings":";;;AAEA,SAAS,WAAAA,gBAAe;;;ACFxB,SAAS,eAAe;AACxB,OAAO,aAAa;AACpB,OAAO,WAAW;AAClB,OAAO,SAAS;AAChB,SAAS,aAAa;AACtB,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,WAAW;AAElB,IAAM,eAAe;AAErB,SAAS,iBAAiB,KAAqB;AAC7C,QAAM,SAAS,KAAK,KAAK,KAAK,KAAK;AACnC,QAAM,UAAU,GAAG,WAAW,MAAM,IAAI,mBAAmB;AAC3D,SAAO,KAAK,KAAK,SAAS,eAAe;AAC3C;AAEO,IAAM,aAAa,IAAI,QAAQ,EACnC,KAAK,KAAK,EACV,YAAY,iCAAiC,EAC7C,SAAS,mBAAmB,uBAAuB,EACnD,OAAO,aAAa,0BAA0B,EAC9C,OAAO,mBAAmB,0BAA0B,EACpD,OAAO,OAAO,YAAsB,YAAY;AAC/C,MAAI;AACF,UAAM,MAAM,QAAQ,IAAI;AAGxB,UAAM,kBAAkB,KAAK,KAAK,KAAK,cAAc;AACrD,QAAI,CAAC,GA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OAAM,KAAK,MAAM,IAAI,MAAM,YAAY,IAAI,CAAC,WAAW,CAAC;AAAA,IACtE;AAEA,YAAQ,IAAI;AACZ,YAAQ,IAAIA,OAAM,MAAM,0CAAqC,CAAC;AAC9D,YAAQ,IAAI;AACZ,YAAQ,IAAI,aAAa;AACzB,YAAQ,IAAIA,OAAM,KAAK,qCAAqC,IAAI,MAAM,CAAC;AACvE,YAAQ,IAAIA,OAAM,KAAK,uCAAuC,IAAI,4CAA4C,CAAC;AAC/G,YAAQ,IAAI;AAAA,EACd,SAAS,OAAO;AACd,YAAQ,MAAMA,OAAM,IAAI,QAAQ,GAAG,iBAAiB,QAAQ,MAAM,UAAU,KAAK;AACjF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;;;AH7MH,IAAM,UAAU,IAAII,SAAQ;AAE5B,QACG,KAAK,eAAe,EACpB,YAAY,8CAA8C,EAC1D,QAAQ,OAAO;AAElB,QAAQ,WAAW,UAAU;AAC7B,QAAQ,WAAW,WAAW;AAC9B,QAAQ,WAAW,eAAe;AAElC,QAAQ,MAAM;","names":["Command","Command","prompts","chalk","ora","execa","fs","path","Command","chalk","ora","fs","path","Command"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/commands/add.ts","../src/commands/init.ts","../src/commands/generate.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander'\nimport { addCommand } from './commands/add.js'\nimport { initCommand } from './commands/init.js'\nimport { generateCommand } from './commands/generate.js'\n\nconst program = new Command()\n\nprogram\n .name('homeontour-ui')\n .description('Add HomeOnTour UI components to your project')\n .version('0.1.0')\n\nprogram.addCommand(addCommand)\nprogram.addCommand(initCommand)\nprogram.addCommand(generateCommand)\n\nprogram.parse()\n","import { Command } from 'commander'\nimport prompts from 'prompts'\nimport chalk from 'chalk'\nimport ora from 'ora'\nimport { execa } from 'execa'\nimport fs from 'fs-extra'\nimport path from 'path'\nimport fetch from 'node-fetch'\n\nconst REGISTRY_URL = 'https://ui.homeontour.com/api/registry'\n\nfunction getComponentsDir(cwd: string): string {\n // 1. Check components.json (shadcn/ui style config)\n const componentsJsonPath = path.join(cwd, 'components.json')\n if (fs.existsSync(componentsJsonPath)) {\n try {\n const config = fs.readJsonSync(componentsJsonPath)\n if (config['homeontour-ui']?.components) {\n return config['homeontour-ui'].components\n }\n } catch (error) {\n // Ignore JSON parse errors\n }\n }\n\n // 2. Check environment variable (for CI/CD or temporary overrides)\n if (process.env.HOMEONTOUR_UI_COMPONENTS_DIR) {\n return process.env.HOMEONTOUR_UI_COMPONENTS_DIR\n }\n\n // 3. Default: auto-detect src directory\n const srcDir = path.join(cwd, 'src')\n const baseDir = fs.existsSync(srcDir) ? 'src/components' : 'components'\n return path.join(baseDir, 'homeontour-ui')\n}\n\nasync function ensureComponentsJson(cwd: string, componentsPath: string): Promise<void> {\n const componentsJsonPath = path.join(cwd, 'components.json')\n \n // Make path relative to project root for storage\n const relativePath = path.isAbsolute(componentsPath)\n ? path.relative(cwd, componentsPath)\n : componentsPath\n \n if (fs.existsSync(componentsJsonPath)) {\n // File exists, check if we need to add homeontour-ui section\n try {\n const config = fs.readJsonSync(componentsJsonPath)\n if (!config['homeontour-ui']) {\n config['homeontour-ui'] = { components: relativePath }\n fs.writeJsonSync(componentsJsonPath, config, { spaces: 2 })\n }\n } catch (error) {\n // If file exists but is invalid JSON, don't overwrite it\n return\n }\n } else {\n // File doesn't exist, run shadcn init first\n const spinner = ora('Setting up shadcn/ui...').start()\n try {\n await execa('pnpm', ['dlx', 'shadcn@latest', 'init', '-y'], {\n cwd,\n })\n spinner.succeed('shadcn/ui initialized')\n } catch (error) {\n spinner.warn('Could not run shadcn init automatically')\n console.log(chalk.yellow('\\nPlease run manually: pnpm dlx shadcn@latest init'))\n }\n \n // Now add homeontour-ui section to the config\n try {\n const config = fs.readJsonSync(componentsJsonPath)\n config['homeontour-ui'] = { components: relativePath }\n fs.writeJsonSync(componentsJsonPath, config, { spaces: 2 })\n } catch (error) {\n // If we can't read the config, create a minimal one\n const config = {\n $schema: 'https://ui.shadcn.com/schema.json',\n 'homeontour-ui': {\n components: relativePath,\n },\n }\n fs.writeJsonSync(componentsJsonPath, config, { spaces: 2 })\n }\n }\n}\n\nexport const addCommand = new Command()\n .name('add')\n .description('Add a component to your project')\n .argument('[components...]', 'The components to add')\n .option('-y, --yes', 'Skip confirmation prompt')\n .option('-o, --overwrite', 'Overwrite existing files')\n .action(async (components: string[], options) => {\n try {\n const cwd = process.cwd()\n \n // Check if we're in a valid project\n const packageJsonPath = path.join(cwd, 'package.json')\n if (!fs.existsSync(packageJsonPath)) {\n console.error(chalk.red('Error: No package.json found. Are you in a project directory?'))\n process.exit(1)\n }\n\n // If no components specified, show interactive selection\n if (!components || components.length === 0) {\n const spinner = ora('Fetching components...').start()\n \n try {\n const response = await fetch(REGISTRY_URL)\n if (!response.ok) {\n throw new Error('Failed to fetch components')\n }\n \n const allComponents = await response.json() as any[]\n spinner.succeed('Fetched available components')\n \n const { selectedComponents } = await prompts({\n type: 'multiselect',\n name: 'selectedComponents',\n message: 'Which components would you like to add?',\n choices: allComponents.map((c: any) => ({\n title: `${c.name} - ${c.description}`,\n value: c.name,\n })),\n min: 1,\n })\n \n if (!selectedComponents || selectedComponents.length === 0) {\n console.log(chalk.yellow('No components selected. Exiting.'))\n process.exit(0)\n }\n \n components = selectedComponents\n } catch (error) {\n spinner.fail('Failed to fetch components')\n console.error(chalk.red('Error: Could not connect to registry. Is the server running?'))\n process.exit(1)\n }\n }\n\n // Ensure components.json exists with homeontour-ui config\n const defaultComponentsDir = getComponentsDir(cwd)\n await ensureComponentsJson(cwd, defaultComponentsDir)\n\n // Add each component\n for (const componentName of components) {\n await addComponent(componentName, { cwd, ...options })\n }\n\n console.log()\n console.log(chalk.green('✓ Done! Components added successfully.'))\n console.log()\n console.log('Import and use them in your project:')\n const componentsDir = getComponentsDir(cwd)\n const importPath = componentsDir.replace(/\\\\/g, '/')\n console.log(chalk.cyan(`import { LogoSvg } from '@/${importPath}/logo-svg'`))\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error)\n process.exit(1)\n }\n })\n\nasync function addComponent(\n componentName: string,\n options: { cwd: string; yes?: boolean; overwrite?: boolean }\n) {\n const spinner = ora(`Adding ${componentName}...`).start()\n\n try {\n // Fetch component from registry\n const response = await fetch(`${REGISTRY_URL}/${componentName}`)\n \n if (!response.ok) {\n throw new Error(`Component \"${componentName}\" not found in registry`)\n }\n \n const component = await response.json() as any\n\n // Check if component already exists\n const componentsDir = getComponentsDir(options.cwd)\n const componentDir = path.isAbsolute(componentsDir) \n ? componentsDir \n : path.join(options.cwd, componentsDir)\n const componentPath = path.join(componentDir, component.files[0].name)\n \n if (fs.existsSync(componentPath) && !options.overwrite) {\n spinner.warn(`${componentName} already exists`)\n \n if (!options.yes) {\n const { overwrite } = await prompts({\n type: 'confirm',\n name: 'overwrite',\n message: `Overwrite existing ${componentName}?`,\n initial: false,\n })\n \n if (!overwrite) {\n return\n }\n } else {\n return\n }\n }\n\n // Install npm dependencies\n if (component.dependencies && component.dependencies.length > 0) {\n spinner.text = `Installing dependencies for ${componentName}...`\n const deps = component.dependencies.map((d: any) => `${d.name}@${d.version}`).join(' ')\n \n try {\n await execa('pnpm', ['add', ...deps.split(' ')], {\n cwd: options.cwd,\n })\n } catch (error) {\n // Try npm as fallback\n try {\n await execa('npm', ['install', ...deps.split(' ')], {\n cwd: options.cwd,\n })\n } catch (npmError) {\n spinner.warn(`Could not install dependencies automatically`)\n console.log(chalk.yellow(`\\nPlease install manually: pnpm add ${deps}`))\n }\n }\n }\n\n // Install shadcn/ui dependencies\n if (component.registryDependencies && component.registryDependencies.length > 0) {\n spinner.text = `Installing shadcn/ui components...`\n const shadcnDeps = component.registryDependencies.join(' ')\n \n try {\n await execa('pnpm', ['dlx', 'shadcn@latest', 'add', ...shadcnDeps.split(' '), '-y'], {\n cwd: options.cwd,\n })\n } catch (error) {\n spinner.warn(`Could not install shadcn/ui components automatically`)\n console.log(chalk.yellow(`\\nPlease install manually: pnpm dlx shadcn@latest add ${shadcnDeps}`))\n }\n }\n\n // Create component files\n spinner.text = `Creating ${componentName} files...`\n await fs.ensureDir(componentDir)\n \n for (const file of component.files) {\n const filePath = path.join(componentDir, file.name)\n await fs.writeFile(filePath, file.content, 'utf-8')\n }\n\n spinner.succeed(`Added ${componentName}`)\n } catch (error) {\n spinner.fail(`Failed to add ${componentName}`)\n throw error\n }\n}\n","import { Command } from 'commander'\nimport prompts from 'prompts'\nimport chalk from 'chalk'\nimport ora from 'ora'\nimport { execa } from 'execa'\nimport fs from 'fs-extra'\nimport path from 'path'\n\nexport const initCommand = new Command()\n .name('init')\n .description('Initialize your project for HomeOnTour UI')\n .option('-y, --yes', 'Skip confirmation prompt')\n .action(async (options) => {\n try {\n const cwd = process.cwd()\n \n console.log()\n console.log(chalk.bold('Initializing HomeOnTour UI...'))\n console.log()\n\n // Check if package.json exists\n const packageJsonPath = path.join(cwd, 'package.json')\n if (!fs.existsSync(packageJsonPath)) {\n console.error(chalk.red('Error: No package.json found. Please run this in a project directory.'))\n process.exit(1)\n }\n\n // Check for required dependencies\n const requiredDeps = [\n 'class-variance-authority',\n 'clsx',\n 'tailwind-merge',\n 'lucide-react',\n ]\n\n const spinner = ora('Checking dependencies...').start()\n \n const packageJson = await fs.readJson(packageJsonPath)\n const installedDeps = {\n ...packageJson.dependencies,\n ...packageJson.devDependencies,\n }\n\n const missingDeps = requiredDeps.filter((dep) => !installedDeps[dep])\n\n if (missingDeps.length > 0) {\n spinner.info('Installing required dependencies...')\n \n try {\n await execa('pnpm', ['add', ...missingDeps], { cwd })\n spinner.succeed('Dependencies installed')\n } catch (error) {\n spinner.fail('Failed to install dependencies')\n console.log(chalk.yellow(`\\nPlease install manually:`))\n console.log(chalk.cyan(`pnpm add ${missingDeps.join(' ')}`))\n }\n } else {\n spinner.succeed('All dependencies are installed')\n }\n\n // Check for utils file\n const utilsPath = path.join(cwd, 'lib', 'utils.ts')\n const srcUtilsPath = path.join(cwd, 'src', 'lib', 'utils.ts')\n const utilsExists = fs.existsSync(utilsPath) || fs.existsSync(srcUtilsPath)\n\n if (!utilsExists) {\n const { createUtils } = await prompts({\n type: 'confirm',\n name: 'createUtils',\n message: 'Create lib/utils.ts with cn helper?',\n initial: true,\n })\n\n if (createUtils) {\n const targetUtilsPath = fs.existsSync(path.join(cwd, 'src')) ? srcUtilsPath : utilsPath\n \n await fs.ensureDir(path.dirname(targetUtilsPath))\n await fs.writeFile(\n targetUtilsPath,\n `import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n`,\n 'utf-8'\n )\n console.log(chalk.green('✓ Created lib/utils.ts'))\n }\n }\n\n // Create components directory\n const componentsDir = path.join(cwd, 'components', 'homeontour-ui')\n await fs.ensureDir(componentsDir)\n console.log(chalk.green('✓ Created components/homeontour-ui directory'))\n\n console.log()\n console.log(chalk.green('✓ Initialization complete!'))\n console.log()\n console.log('You can now add components:')\n console.log(chalk.cyan(' pnpm dlx homeontour-ui@latest add logo-svg'))\n console.log()\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error)\n process.exit(1)\n }\n })\n","import { Command } from 'commander'\nimport chalk from 'chalk'\nimport ora from 'ora'\nimport fs from 'fs-extra'\nimport path from 'path'\n\n// Convert kebab-case to PascalCase\nfunction toPascalCase(str: string): string {\n return str\n .split('-')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join('')\n}\n\n// Convert kebab-case to camelCase\nfunction toCamelCase(str: string): string {\n const pascal = toPascalCase(str)\n return pascal.charAt(0).toLowerCase() + pascal.slice(1)\n}\n\n// Generate component TSX content\nfunction generateComponentContent(componentName: string, componentPascal: string): string {\n return `import * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport interface ${componentPascal}Props extends React.HTMLAttributes<HTMLDivElement> {\n // Add your custom props here\n}\n\nexport const ${componentPascal} = React.forwardRef<HTMLDivElement, ${componentPascal}Props>(\n ({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\"\", className)}\n {...props}\n />\n )\n }\n)\n${componentPascal}.displayName = \"${componentPascal}\"\n\nexport default ${componentPascal}\n`\n}\n\n// Generate metadata content\nfunction generateMetadataContent(componentName: string, componentPascal: string): string {\n return `import { ComponentMetadata } from \"@/lib/component-metadata\"\n\nexport const metadata: ComponentMetadata = {\n name: \"${componentName}\",\n type: \"components:ui\",\n description: \"${componentPascal} component.\",\n category: \"UI Components\",\n registryDependencies: [],\n examples: [\n {\n name: \"Default\",\n description: \"Default ${componentPascal} component\",\n exampleComponent: \"DefaultExample\",\n },\n ],\n usage: {\n importCode: \\`import { ${componentPascal} } from \"@/components/homeontour-ui/${componentName}\"\\`,\n componentCode: \\`<${componentPascal} />\\`,\n },\n}\n`\n}\n\n// Generate example component content\nfunction generateExampleContent(componentName: string, componentPascal: string): string {\n return `\"use client\"\n\nimport { ${componentPascal} } from \"./index\"\n\n/**\n * Example: Default\n * Default ${componentPascal} component\n */\nexport function DefaultExample() {\n return (\n <${componentPascal} />\n )\n}\n\n// Code for this example (used in documentation)\nexport const code = \\`import { ${componentPascal} } from \"./index\"\n\nexport function DefaultExample() {\n return (\n <${componentPascal} />\n )\n}\\`\n`\n}\n\n// Update metadata registry\nasync function updateMetadataRegistry(\n projectRoot: string,\n componentName: string,\n componentPascal: string\n) {\n const metadataRegistryPath = path.join(projectRoot, 'src/lib/metadata-registry.ts')\n \n if (!fs.existsSync(metadataRegistryPath)) {\n throw new Error('metadata-registry.ts not found')\n }\n\n let lines = (await fs.readFile(metadataRegistryPath, 'utf-8')).split('\\n')\n const importName = `${toCamelCase(componentName)}Metadata`\n const importStatement = `import { metadata as ${importName} } from \"@/components/registry/${componentName}/metadata\"`\n \n // Check if import already exists\n if (lines.some(line => line.includes(importStatement))) {\n throw new Error('Import already exists')\n }\n \n // Find the last import line and insert after it\n let lastImportIndex = -1\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].trim().startsWith('import ') && lines[i].includes('from')) {\n lastImportIndex = i\n }\n }\n \n if (lastImportIndex >= 0) {\n lines.splice(lastImportIndex + 1, 0, importStatement)\n }\n \n // Add to registry object - find the registry object and insert before closing brace\n const registryEntry = ` \"${componentName}\": ${importName},`\n let inRegistryObject = false\n let lastRegistryEntryIndex = -1\n \n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]\n \n if (line.includes('export const metadataRegistry')) {\n inRegistryObject = true\n continue\n }\n \n if (inRegistryObject) {\n // Check if this is a registry entry (contains \": metadata\" or similar)\n if (line.trim().match(/^\"[^\"]+\":\\s+\\w+Metadata,?$/)) {\n lastRegistryEntryIndex = i\n }\n \n // Check if we've reached the closing brace\n if (line.trim() === '}') {\n // Insert before this closing brace\n if (lastRegistryEntryIndex >= 0) {\n lines.splice(lastRegistryEntryIndex + 1, 0, registryEntry)\n } else {\n // No entries found, insert right after opening brace\n // Find the opening brace line\n for (let j = i - 1; j >= 0; j--) {\n if (lines[j].includes('metadataRegistry') && lines[j].includes('{')) {\n lines.splice(j + 1, 0, registryEntry)\n break\n }\n }\n }\n break\n }\n }\n }\n \n await fs.writeFile(metadataRegistryPath, lines.join('\\n'), 'utf-8')\n}\n\nexport const generateCommand = new Command()\n .name('generate')\n .alias('gen')\n .description('Generate boilerplate for a new component')\n .argument('<name>', 'Component name in kebab-case (e.g., my-component)')\n .action(async (name: string) => {\n try {\n const cwd = process.cwd()\n \n // Validate component name (kebab-case or simple lowercase)\n if (!/^[a-z][a-z0-9-]*$/.test(name)) {\n console.error(chalk.red('Error: Component name must be in kebab-case (e.g., my-component) or simple lowercase (e.g., basic)'))\n process.exit(1)\n }\n\n const spinner = ora(`Generating ${name} component...`).start()\n\n // Check if we're in the project root (has src/components/registry directory)\n const registryDir = path.join(cwd, 'src/components/registry')\n if (!fs.existsSync(registryDir)) {\n spinner.fail('Error: src/components/registry directory not found')\n console.error(chalk.red('Are you in the correct project directory?'))\n process.exit(1)\n }\n\n const componentPascal = toPascalCase(name)\n const componentDir = path.join(registryDir, name)\n const componentFile = path.join(componentDir, 'index.tsx')\n const metadataFile = path.join(componentDir, 'metadata.ts')\n const exampleFile = path.join(componentDir, 'default.example.tsx')\n\n // Check if component already exists\n if (fs.existsSync(componentDir)) {\n spinner.warn(`${name} already exists`)\n console.log(chalk.yellow(`Component directory already exists. Skipping generation.`))\n process.exit(0)\n }\n\n // Create component directory\n await fs.ensureDir(componentDir)\n\n // Generate component file\n const componentContent = generateComponentContent(name, componentPascal)\n await fs.writeFile(componentFile, componentContent, 'utf-8')\n spinner.succeed(`Created ${name}/index.tsx`)\n\n // Generate metadata file\n const metadataContent = generateMetadataContent(name, componentPascal)\n await fs.writeFile(metadataFile, metadataContent, 'utf-8')\n spinner.succeed(`Created ${name}/metadata.ts`)\n\n // Generate example file\n const exampleContent = generateExampleContent(name, componentPascal)\n await fs.writeFile(exampleFile, exampleContent, 'utf-8')\n spinner.succeed(`Created ${name}/default.example.tsx`)\n\n // Update metadata registry\n spinner.start('Updating metadata registry...')\n try {\n await updateMetadataRegistry(cwd, name, componentPascal)\n spinner.succeed('Updated metadata registry')\n } catch (error) {\n spinner.warn('Could not automatically update metadata registry')\n console.log(chalk.yellow('\\nPlease manually add the following to src/lib/metadata-registry.ts:'))\n console.log(chalk.cyan(`import { metadata as ${toCamelCase(name)}Metadata } from \"@/components/registry/${name}/metadata\"`))\n console.log(chalk.cyan(` \"${name}\": ${toCamelCase(name)}Metadata,`))\n }\n\n console.log()\n console.log(chalk.green('✓ Component generated successfully!'))\n console.log()\n console.log('Next steps:')\n console.log(chalk.cyan(` 1. Edit src/components/registry/${name}/index.tsx`))\n console.log(chalk.cyan(` 2. Update src/components/registry/${name}/metadata.ts with examples and description`))\n console.log(chalk.cyan(` 3. Add more examples in src/components/registry/${name}/*.example.tsx`))\n console.log()\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error)\n process.exit(1)\n }\n })\n"],"mappings":";;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;AACvD,cAAQ,QAAQ,2BAA2B;AAAA,IAC7C,SAAS,OAAO;AACd,cAAQ,KAAK,kDAAkD;AAC/D,cAAQ,IAAIF,OAAM,OAAO,sEAAsE,CAAC;AAChG,cAAQ,IAAIA,OAAM,KAAK,wBAAwB,YAAY,IAAI,CAAC,0CAA0C,IAAI,YAAY,CAAC;AAC3H,cAAQ,IAAIA,OAAM,KAAK,MAAM,IAAI,MAAM,YAAY,IAAI,CAAC,WAAW,CAAC;AAAA,IACtE;AAEA,YAAQ,IAAI;AACZ,YAAQ,IAAIA,OAAM,MAAM,0CAAqC,CAAC;AAC9D,YAAQ,IAAI;AACZ,YAAQ,IAAI,aAAa;AACzB,YAAQ,IAAIA,OAAM,KAAK,qCAAqC,IAAI,YAAY,CAAC;AAC7E,YAAQ,IAAIA,OAAM,KAAK,uCAAuC,IAAI,4CAA4C,CAAC;AAC/G,YAAQ,IAAIA,OAAM,KAAK,qDAAqD,IAAI,gBAAgB,CAAC;AACjG,YAAQ,IAAI;AAAA,EACd,SAAS,OAAO;AACd,YAAQ,MAAMA,OAAM,IAAI,QAAQ,GAAG,iBAAiB,QAAQ,MAAM,UAAU,KAAK;AACjF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;;;AHtPH,IAAM,UAAU,IAAII,SAAQ;AAE5B,QACG,KAAK,eAAe,EACpB,YAAY,8CAA8C,EAC1D,QAAQ,OAAO;AAElB,QAAQ,WAAW,UAAU;AAC7B,QAAQ,WAAW,WAAW;AAC9B,QAAQ,WAAW,eAAe;AAElC,QAAQ,MAAM;","names":["Command","Command","prompts","chalk","ora","execa","fs","path","Command","chalk","ora","fs","path","Command"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeontour-ui",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "CLI for adding HomeOnTour UI components to your project",
5
5
  "type": "module",
6
6
  "bin": {