2.1.0 โ€ข Published 23 days ago

@public-ui/kolibri-cli v2.1.0

Weekly downloads
-
License
EUPL-1.2
Repository
github
Last release
23 days ago

KoliBri - CLI-Tools

Motivation

The KoliBri CLI-Tools are a collection of tools to support the development with KoliBri components.

Installation

You can install the KoliBri CLI-Tools with npm, pnpm or yarn.

npm i -g @public-ui/kolibri-cli
pnpm i -g @public-ui/kolibri-cli
yarn add -g @public-ui/kolibri-cli

Usage

The KoliBri CLI is intended to be executed in your project root directory. Use the kolibri command to start the CLI.

kolibri --help
,--. ,--.         ,--. ,--. ,-----.           ,--.
|  .'   /  ,---.  |  | `--' |  |) /_  ,--.--. `--'
|  .   '  | .-. | |  | ,--. |  .-.  \ |  .--' ,--.
|  |\   \ | '-' | |  | |  | |  '--' / |  |    |  |
`--' `--ยด  `---ยด  `--' `--' `------ยด  `--'    `--'
๐Ÿšน The accessible HTML-Standard | ๐Ÿ‘‰ https://public-ui.github.io

Usage: kolibri [options] [command]

CLI for executing some helpful commands for KoliBri projects.

Options:
  -V, --version               output the version number
  -h, --help                  display help for command

Commands:
  migrate [options] <string>  This command migrates KoliBri code to the current version.
  help [command]              display help for command

Migrate

With the migrate command you can migrate your project to the latest version of KoliBri.

Actually the following migration tasks from version 1 to version 2 are available:

  • Component renaming โœ“
  • Component removal (no one yet)
  • Property renaming โœ“
  • Property removal โœ“
  • Slots renaming (content) โœ“
  • Slots removal (footer, header) โœ“
  • Logic refactoring (no one yet)
  • Expert-Slot refactoring
    • Move innerText to property โœ“
    • Property type change (remove _label={false}) โœ“
    • Set _label="" to activate the expert slot (#5396) โœ“
  • .vscode/settings.json add IntelliSense for HTML โœ“
  • .gitignore exclude .kolibri.migrate.json โœ“
  • .tsconfig add @public-ui/components to types array โœ“
  • Format modified files (prettier@^3) โœ“
  • Copy and integrate new assets โœ“
  • Handles _icon-align with a refactoring tasks (#5397) โฐ
  • Detection of _iconOnly in TSX is not stable (#5404) โฐ
  • Handle the remove @public-ui/core package (#???) โฐ

How does it work?

  1. The migration command will check your project for clear git history and the installed version of KoliBri. Now it loads all available migration tasks.
  2. Tasks in the correct version range will be executed one by one. Otherwise they will be skipped.
  3. After that the package.json will be updated with the new version of KoliBri and execute the npm install command.
  4. If there are any pending tasks, the migration command will be executed again. Otherwise the migration is finished.
  5. Now you can check the result and commit the changes.

Note: You can reset the migration with git reset --hard HEAD~1 or by discarding the affected files.

Help

kolibri migrate --help

Execute

kolibri migrate <path>

Options

OptionDescriptionTypeDefault
--formatTry to format the modified files with prettierbooleantrue
--overwrite-current-versionMigrate from this current version instead of the installed versionversioncurrent installed version
--overwrite-target-versionMigrate to this target version instead of the version of the CLIversionversion of the CLI
--ignore-greater-versionAllows execution with greater versionsbooleanfalse
--ignore-uncommitted-changesAllows execution with uncommitted changesbooleanfalse
--remove-modePrefix property name or delete propertydelete | prefixprefix

Configuration

You can configure the migration with the .kolibri.config.json file in your project root folder. This file will be created automatically after the first migration.

Troubleshooting: If you have problems with migration, you can exclude some tasks with the configuration by setting the false flag (see kol-select).

{
	"migrate": {
		"tasks": {
			".gitignore-add-rule-.kolibri.migrate.json": true,
			".npmrc-add-rule-save-exact=true": true,
			"vscode-settings-reconfigure-html.customData": true,
			"kol-abbr-rename-property-_align-to-_tooltip-align": true,
			"kol-abbr-rename-property-_title-to-_label": true,
			"kol-accordion-rename-property-_heading-to-_label": true,
			"kol-alert-rename-property-_heading-to-_label": true,
			"kol-badge-rename-property-_icon-only-to-_hide-label": true,
			"kol-badge-remove-property-_hide-label": true,
			"kol-badge-remove-property-_icon-only": true,
			"kol-badge-rename-property-_icon-to-_icons": true,
			"kol-breadcrumb-rename-property-_aria-label-to-_label": true,
			"kol-button-link-remove-property-_aria-current": true,
			"kol-button-link-remove-property-_aria-label": true,
			"kol-button-link-rename-property-_icon-only-to-_hide-label": true,
			"kol-button-link-rename-property-_icon-to-_icons": true,
			"kol-button-remove-property-_aria-current": true,
			"kol-button-remove-property-_aria-label": true,
			"kol-button-remove-property-_icon-align": true,
			"kol-button-rename-property-_icon-only-to-_hide-label": true,
			"kol-button-rename-property-_icon-to-_icons": true,
			"kol-card-rename-property-_heading-to-_label": true,
			"kol-card-rename-property-_headline-to-_label": true,
			"kol-details-rename-property-_summary-to-_label": true,
			"kol-icon-remove-property-_part": true,
			"kol-icon-rename-property-_aria-label-to-_label": true,
			"kol-icon-rename-property-_icon-to-_icons": true,
			"kol-input-checkbox-rename-property-_icon-to-_icons": true,
			"kol-checkbox-rename-property-_type-to-_variant": true,
			"kol-color-rename-property-_icon-to-_icons": true,
			"kol-color-rename-property-_list-to-_suggestions": true,
			"kol-input-date-rename-property-_icon-to-_icons": true,
			"kol-date-rename-property-_list-to-_suggestions": true,
			"kol-input-email-rename-property-_icon-to-_icons": true,
			"kol-input-email-rename-property-_list-to-_suggestions": true,
			"kol-input-email-remove-property-_size": true,
			"kol-input-file-rename-property-_icon-to-_icons": true,
			"kol-input-number-rename-property-_icon-to-_icons": true,
			"kol-input-number-rename-property-_list-to-_suggestions": true,
			"kol-input-number-remove-property-_type": true,
			"kol-input-password-rename-property-_icon-to-_icons": true,
			"kol-input-password-remove-property-_size": true,
			"kol-input-radio-rename-property-_list-to-_options": true,
			"kol-input-range-rename-property-_icon-to-_icons": true,
			"kol-input-range-rename-property-_list-to-_suggestions": true,
			"kol-input-rename-property-_icon-to-_icons": true,
			"kol-input-text-rename-property-_icon-to-_icons": true,
			"kol-input-text-rename-property-_list-to-_suggestions": true,
			"kol-input-text-remove-property-_size": true,
			"kol-link-button-remove-property-_aria-controls": true,
			"kol-link-button-remove-property-_aria-expanded": true,
			"kol-link-button-remove-property-_aria-label": true,
			"kol-link-button-remove-property-_aria-selected": true,
			"kol-link-button-remove-property-_disabled": true,
			"kol-link-button-rename-property-_aria-current-to-_listen-aria-current": true,
			"kol-link-button-rename-property-_icon-only-to-_hide-label": true,
			"kol-link-button-rename-property-_icon-to-_icons": true,
			"kol-link-group-rename-property-_heading-to-_label": true,
			"kol-link-group-remove-property-_heading": true,
			"kol-link-group-remove-property-_ordered": true,
			"kol-link-group-rename-property-_aria-label-to-_label": true,
			"kol-link-remove-property-_aria-controls": true,
			"kol-link-remove-property-_aria-expanded": true,
			"kol-link-remove-property-_aria-label": true,
			"kol-link-remove-property-_aria-selected": true,
			"kol-link-remove-property-_disabled": true,
			"kol-link-remove-property-_icon-align": true,
			"kol-link-remove-property-_selector": true,
			"kol-link-remove-property-_stealth": true,
			"kol-link-remove-property-_use-case": true,
			"kol-link-rename-property-_aria-current-to-_listen-aria-current": true,
			"kol-link-rename-property-_icon-only-to-_hide-label": true,
			"kol-link-rename-property-_icon-to-_icons": true,
			"kol-logo-rename-property-_abbr-to-_org": true,
			"kol-modal-rename-property-_aria-label-to-_label": true,
			"kol-nav-remove-property-_variant": true,
			"kol-nav-rename-property-_aria-label-to-_label": true,
			"kol-nav-rename-property-_compact-to-_hide-label": true,
			"kol-pagination-rename-property-_count-to-_total": true,
			"kol-pagination-rename-property-_total-to-_max": true,
			"kol-progress-rename-property-_type-to-_variant": true,
			"kol-quote-rename-property-_caption-to-_label": true,
			"kol-select-rename-property-_height-to-_rows": true,
			"kol-select-rename-property-_icon-to-_icons": true,
			"kol-select-rename-property-_list-to-_options": true,
			"kol-select-remove-property-_size": true,
			"kol-skip-nav-rename-property-_aria-label-to-_label": true,
			"kol-span-rename-property-_icon-only-to-_hide-label": true,
			"kol-span-rename-property-_icon-to-_icons": true,
			"kol-split-button-remove-property-_aria-label": true,
			"kol-split-button-remove-property-_access-key": true,
			"kol-split-button-remove-property-_show-dropdown": true,
			"kol-split-button-remove-property-_show": true,
			"kol-symbol-rename-property-_aria-label-to-_label": true,
			"kol-table-rename-property-_caption-to-_label": true,
			"kol-tabs-rename-property-_aria-label-to-_label": true,
			"kol-tabs-rename-property-_icon-to-_icons": true,
			"kol-tabs-rename-property-_tab-align-to-_align": true,
			"kol-tabs-rename-property-_icon-only-to-_hide-label": true,
			"kol-toast-remove-property-_show-duration": true,
			"kol-toast-rename-property-_heading-to-_label": true,
			"kol-version-rename-property-_version-to-_label": true,
			"kol-heading-move-innerText-to-property-_label": true,
			"kol-input-checkbox-move-innerText-to-property-_label": true,
			"kol-input-color-move-innerText-to-property-_label": true,
			"kol-input-date-move-innerText-to-property-_label": true,
			"kol-input-email-move-innerText-to-property-_label": true,
			"kol-input-file-move-innerText-to-property-_label": true,
			"kol-input-number-move-innerText-to-property-_label": true,
			"kol-input-password-move-innerText-to-property-_label": true,
			"kol-input-radio-move-innerText-to-property-_label": true,
			"kol-input-range-move-innerText-to-property-_label": true,
			"kol-input-text-move-innerText-to-property-_label": true,
			"kol-link-move-innerText-to-property-_label": true,
			"kol-select-move-innerText-to-property-_label": true,
			"kol-textarea-move-innerText-to-property-_label": true,
			"kol-accordion-mark-removed-slot-header": true,
			"kol-card-mark-removed-slot-footer": true,
			"kol-card-mark-removed-slot-header": true,
			"kol-accordion-rename-slot-content-to-": true,
			"kol-card-rename-slot-content-to-": true,
			"refactor-property-label-replace-false": true,
			"kol-card-remove-property-_has-footer": true,
			"kol-link-group-remove-property-_level": true,
			"remove--cpy-cli,rimraf": true,
			"add--cpy-cli,rimraf": true,
			"package.json-reconfigure-scripts.prepare": true,
			"remove-public/assets/codicons": true,
			"exec-npx cpy \"node_modules/@public-ui/components/assets/**/*\" \"undefined/assets\" --dot": true,
			"kol-button-link-remove-property-_access-key": true,
			"kol-button-remove-property-_access-key": true,
			"kol-nav-remove-property-_has-compact-button": true
		}
	}
}

Troubleshooting

If the migration failed, you can reset the migration with git reset --hard HEAD~1.

Use the configuration (.kolibri.config.json) to exclude some tasks.

If your project is already on a newer version of KoliBri, but you want to repeat the migration from a previous version, you can use this --overwrite-current-version option. It overwrites the offset version from which the migration originally starts, instead of using the installed version.

If there are multiple obsolete properties that have been migrated to just one new property, the new property may appear multiple times in the tag. You can then decide which variant to use and remove all other variants accordingly.

Maybe it can help to prepare your code in the tricky places for migration.

Please give us feedback, if you have problems with the migration: GitHub Issues

Dry run

You have always the possibility of a dry run. Because before the migration will be executed, you need a clean git history of you project.

After the migration you can check the result with git status and git diff.

Is anything wrong, you can reset the migration with git reset --hard HEAD~1 or by discarding the affected files.

2.1.0

23 days ago

1.7.21

25 days ago

2.0.15

25 days ago

2.0.14

1 month ago

1.7.20

1 month ago

2.0.13

1 month ago

1.7.19

2 months ago

2.0.12-rc.0

2 months ago

2.0.12

2 months ago

1.7.19-rc.0

2 months ago

1.7.18

2 months ago

2.0.11

2 months ago

1.7.17

2 months ago

1.7.16

2 months ago

2.0.10

2 months ago

2.0.9

2 months ago

1.7.15

2 months ago

2.0.8

3 months ago

1.7.14

3 months ago

2.0.7

3 months ago

1.7.13

3 months ago

1.7.12

3 months ago

2.0.6

3 months ago

2.0.5

3 months ago

1.7.11

3 months ago

2.0.4

4 months ago

1.7.10

4 months ago

2.0.4-rc.0

4 months ago

1.7.10-rc.0

4 months ago

2.0.3

5 months ago

1.7.9

5 months ago

2.0.2

5 months ago

1.7.8

5 months ago

2.0.1

5 months ago

1.7.7

5 months ago

2.0.0-rc.13

6 months ago

2.0.0

6 months ago

2.0.0-rc.12

6 months ago

1.7.6

6 months ago

2.0.0-rc.11

6 months ago

1.7.6-rc.2

6 months ago

2.0.0-rc.10

6 months ago

1.7.6-rc.1

6 months ago

1.7.6-rc.0

6 months ago

2.0.0-rc.9

6 months ago

1.7.5

7 months ago

2.0.0-rc.8

7 months ago

2.0.0-rc.7

7 months ago

2.0.0-rc.6

7 months ago

1.7.4

7 months ago

2.0.0-rc.5

7 months ago

2.0.0-rc.4

7 months ago

2.0.0-rc.3

7 months ago

2.0.0-rc.2

7 months ago

2.0.0-rc.1

7 months ago

1.7.3

7 months ago

2.0.0-rc.0

7 months ago

1.7.2

7 months ago

1.7.2-rc.0

7 months ago

1.7.1

8 months ago

1.7.0

8 months ago

1.7.0-rc.17

8 months ago

1.7.0-rc.16

8 months ago

1.7.0-rc.15

8 months ago

1.7.0-rc.14

8 months ago

1.7.0-rc.13

8 months ago

1.7.0-rc.12

8 months ago

1.7.0-rc.11

8 months ago

1.7.0-rc.10

8 months ago

1.7.0-rc.9

8 months ago

1.7.0-rc.7

8 months ago

1.7.0-rc.6

8 months ago

1.7.0-rc.5

8 months ago

1.7.0-rc.4

9 months ago

1.7.0-rc.3

9 months ago

1.7.0-rc.2

9 months ago

1.7.0-rc.1

9 months ago

1.7.0-rc.0

9 months ago