Schematics

As part of the Koobiq design system, a set of schematics is provided — CLI tools designed to automate library installation, perform migrations, and update components in Angular projects.


Installs the @koobiq/components library and adds all necessary dependencies.

When to use: When adding the library to a project for the first time.

ng add @koobiq/components

Updates icon prefixes and names required to migrate from version 7.2.x and below to version 8.0.2 and above.

When to use: After upgrading the @koobiq/icons library to version 8.0.2 or later.

ng generate @koobiq/components:new-icons-pack

Updates deprecated CSS selectors (typography and color naming) according to the new design system conventions.

When to use: After upgrading the @koobiq/components library to version 18.6.0 or later.

ng generate @koobiq/components:css-selectors

Moves icons off the deprecated pt-icons font to kbq and renames the deprecated icons.

When to use: while the project still has pt-icons classes (class="pt-icons pt-icons-<name>").

ng generate @koobiq/components:deprecated-icons

Updates size attribute names and values for the Empty state component in both HTML and TypeScript templates.

When to use: After upgrading the @koobiq/components library to version 18.22.0 or later.

ng generate @koobiq/components:empty-state-size-attr

Updates size attribute names and values for the Overlay component in both HTML and TypeScript templates.

When to use: After upgrading the @koobiq/components library to version 18.22.0 or later.

ng generate @koobiq/components:loader-overlay-size-attr

Replaces icon names with new ones.

When to use: after updating the @koobiq/icons library version to 11.0.0 and higher.

ng generate @koobiq/components:icons-replacement

The three icon schematics are not run by ng update; run the ones that match the project yourself, in this order: icons-replacement renames the names the other two produce, so it goes last.

OrderSchematicRun it when the project has
1new-icons-pack@koobiq/icons below 8.0.2: the mc prefix (mc-<name>, kbq-icon="mc-<name>")
2deprecated-iconspt-icons classes (class="pt-icons pt-icons-<name>")
3icons-replacement@koobiq/icons below 11.0.0

Each of them only reports what it finds until it is run with --fix=true, and each logs which icon mapping it uses. Common options:

  • --project — a project name or a folder such as ./libs; without it the whole workspace is migrated. node_modules and dist are always skipped.
  • --custom-data-path (new-icons-pack, icons-replacement) — a JSON file with your own icon mapping, resolved from the workspace root: [{ "replace": "kbq-add-to-list_16", "replaceWith": "kbq-file-plus-o_16" }]. Without it the built-in mapping is used.
ng generate @koobiq/components:new-icons-pack --project ./libs
ng generate @koobiq/components:new-icons-pack --project ./libs --fix=true
  • Make sure Angular CLI is installed:
ng version
  • Run the desired schematic using the ng generate command:
ng generate "@koobiq/components:<schematic-name>"
  • Some schematics support additional options. See the schema.json file inside the corresponding schematic folder.
Suggestions for improvement
If you found a mistake or want to improve the article, create an issue on GitHub.