homeontour-ui
v0.1.32
Published
CLI for adding HomeOnTour UI components to your project
Downloads
75
Maintainers
Readme
HomeOnTour UI CLI
Add components from HomeOnTour UI to your project via CLI.
Usage
Initialize your project
npx homeontour-ui@latest initThis will:
- Install required dependencies
- Create the
lib/utils.tsfile - Set up the components directory
Add components
npx homeontour-ui@latest add logo-svgAdd multiple components:
npx homeontour-ui@latest add logo-svg dev-mode-barInteractive selection:
npx homeontour-ui@latest addNote: We recommend using
npxinstead ofpnpm dlxbecause pnpm aggressively caches@latestand may not fetch the newest version. If you prefer pnpm, use:pnpm dlx --force homeontour-ui@latest add ...
Generate new components (for registry development)
When working on the registry itself, use the generate command:
# In the registry project directory
pnpm generate my-componentThis creates:
src/components/registry/my-component/index.tsxsrc/components/registry/my-component/metadata.ts(with usage blocks)src/components/registry/my-component/default.example.tsx- Automatically updates
metadata-registry.ts
Options
npx homeontour-ui@latest add logo-svg --yes
npx homeontour-ui@latest add logo-svg --overwriteHow it works
The CLI:
- Fetches component code from the registry API
- Installs required npm dependencies
- Installs shadcn/ui dependencies (if needed)
- Saves components to
components/homeontour-ui/
Development
From Root Directory (Recommended)
Build the CLI:
pnpm build:cliTest locally:
pnpm test:cli add logo-svg
pnpm test:cli initFrom CLI Directory
cd cli
pnpm install
pnpm build
node dist/index.js add logo-svgPublishing
From Root Directory (Recommended)
# For bug fixes (0.1.2 → 0.1.3)
pnpm publish:cli:patch
# For new features (0.1.2 → 0.2.0)
pnpm publish:cli:minor
# For breaking changes (0.1.2 → 1.0.0)
pnpm publish:cli:majorPublishing Workflow
- Ensure you're logged in to npm:
npm login - Make your changes to files in
cli/src/ - Build and test:
pnpm build:cli pnpm test:cli add logo-svg - Publish with version bump:
The script will automatically check if you're logged in before publishing.pnpm publish:cli:patch - Verify it's published:
npm view homeontour-ui version
Version Types
- Patch - Bug fixes, documentation updates (0.0.X)
- Minor - New features, new components (0.X.0)
- Major - Breaking changes (X.0.0)
What Happens During Publish
- Version is bumped in
package.json - CLI is automatically built (
prepublishOnlyhook) - Package is uploaded to npm
- Git tag is created
From CLI Directory (Alternative)
cd cli
pnpm publish:patch # or publish:minor, publish:majorTroubleshooting
Authentication Error
If you see npm notice Access token expired or revoked:
npm login
# Follow the browser authentication flow
# Then try publishing againCheck Authentication
npm whoami
# Should display your npm usernameLicense
MIT
