How to install a component

Prerequisites

  • Node.js 18+
  • Access to the registry — basic auth (dev / dev) or Zitadel SSO depending on environment

1. Install the CLI

npm install -g git+ssh://git@aja07.vas-server.cz:tools/czg-ui-registry.git

The CLI lives inside the registry repo itself. Production distribution is via private git over SSH — public npm is not used.

2. Login

npx czg-ui login
# use the Zitadel SSO flow on production

3. Browse and install components

npx czg-ui list
npx czg-ui add base button slider

The CLI resolves dependencies recursively — installing one top-level component pulls in base, overlay, etc. automatically.

4. Manual post-install steps

After every component the CLI prints postInstall instructions — typically @import the component SCSS into app.scss and import the JS module into app.js. Skipping these steps means the component code is in the project but never executes.

5. Lock file

A czg-ui.lock.json file is created at the project root, recording which versions of which components are installed. Commit it to git so every developer / CI gets the same snapshot.

Updating components

npx czg-ui outdated         # shows components with newer versions available
npx czg-ui diff button      # diff between local and remote latest
npx czg-ui update button --force

Updates are never automatic — the project stays on its installed version until update is run explicitly. Without --force the CLI refuses to overwrite local edits, protecting any project-specific tweaks.

Removing a component

npx czg-ui remove button

Deletes the component files and the lock entry. SCSS / JS imports added during postInstall must be removed manually.

Další kategorie