@public-ui/kolibri-cli 1.7.0-rc.0 → 1.7.0-rc.1
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 +8 -6
- package/dist/index.js +2 -2
- package/dist/migrate/index.js +2 -1
- package/dist/migrate/runner/task-runner.js +0 -6
- package/dist/migrate/runner/tasks/v1/index.js +27 -0
- package/dist/migrate/runner/types.js +1 -2
- package/dist/migrate/shares/reuse.js +1 -19
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -41,12 +41,13 @@ Actually the following migrations are available:
|
|
|
41
41
|
|
|
42
42
|
#### How does it work?
|
|
43
43
|
|
|
44
|
-
1. The migration command will check your project for clear `git history` and the `installed version` of `KoliBri`. Now it load all available migration tasks
|
|
45
|
-
2. If the task in the correct version range, it will be executed. Otherwise it will be skipped.
|
|
44
|
+
1. The migration command will check your project for clear `git history` and the `installed version` of `KoliBri`. Now it load all available migration tasks.
|
|
45
|
+
2. If the task in the correct version range, it will be executed them one by one. Otherwise it will be skipped.
|
|
46
46
|
3. After that the `package.json` will be updated with the new version of `KoliBri` and execute the `npm install` command.
|
|
47
47
|
4. Are there any pending tasks, the migration command will be executed again. Otherwise the migration is finished.
|
|
48
|
+
5. Now you can check the result and commit the changes.
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
> **Note:** You can reset the migration with `git reset --hard HEAD~1`.
|
|
50
51
|
|
|
51
52
|
#### Help
|
|
52
53
|
|
|
@@ -62,9 +63,10 @@ kolibri migrate <path>
|
|
|
62
63
|
|
|
63
64
|
#### Options
|
|
64
65
|
|
|
65
|
-
| Option
|
|
66
|
-
|
|
|
67
|
-
| `--
|
|
66
|
+
| Option | Description | Type | Default |
|
|
67
|
+
| ------------------------------ | ------------------------------------------ | :--------------------: | :--------: |
|
|
68
|
+
| `--ignore-uncommitted-changes` | Allows execution with uncommitted changes | boolean | false |
|
|
69
|
+
| `--remove-mode` | Remove properties by comment out or delete | `delete` \| `prefixed` | `prefixed` |
|
|
68
70
|
|
|
69
71
|
#### Configuration
|
|
70
72
|
|
package/dist/index.js
CHANGED
|
@@ -13,13 +13,13 @@ const Banner = gradient_string_1.default.atlas.multiline(`
|
|
|
13
13
|
| . ' | .-. | | | ,--. | .-. \\ | .--' ,--.
|
|
14
14
|
| |\\ \\ | '-' | | | | | | '--' / | | | |
|
|
15
15
|
\`--' \`--´ \`---´ \`--' \`--' \`------´ \`--' \`--'
|
|
16
|
-
🚹 The accessible HTML-Standard | 👉 https://public-ui.github.io | 1.7.0-rc.
|
|
16
|
+
🚹 The accessible HTML-Standard | 👉 https://public-ui.github.io | 1.7.0-rc.1
|
|
17
17
|
`, {
|
|
18
18
|
interpolation: 'hsv',
|
|
19
19
|
});
|
|
20
20
|
console.log(Banner);
|
|
21
21
|
const program = new commander_1.Command();
|
|
22
|
-
program.name('kolibri').description('CLI for executing some helpful commands for KoliBri projects.').version('1.7.0-rc.
|
|
22
|
+
program.name('kolibri').description('CLI for executing some helpful commands for KoliBri projects.').version('1.7.0-rc.1');
|
|
23
23
|
// Add commands
|
|
24
24
|
(0, migrate_1.default)(program);
|
|
25
25
|
program.parse();
|
package/dist/migrate/index.js
CHANGED
|
@@ -20,6 +20,7 @@ function default_1(program) {
|
|
|
20
20
|
.command('migrate')
|
|
21
21
|
.description('This command migrates KoliBri code to the current version.')
|
|
22
22
|
.argument('<string>', 'Source code folder to migrate')
|
|
23
|
+
.option('--ignore-uncommitted-changes', 'Allows execution with uncommitted changes', false)
|
|
23
24
|
.addOption(new commander_1.Option('--remove-mode <mode>', 'Remove with comment out or delete').choices(['comment', 'delete']).default('comment'))
|
|
24
25
|
.option('--test-tasks', 'Run additional test tasks', false)
|
|
25
26
|
.action((baseDir, options) => {
|
|
@@ -28,7 +29,7 @@ function default_1(program) {
|
|
|
28
29
|
console.error(`exec error: ${err.message}`);
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
|
-
if (stdout) {
|
|
32
|
+
if (!options.ignoreUncommittedChanges && stdout) {
|
|
32
33
|
throw new Error('There are uncommitted changes');
|
|
33
34
|
}
|
|
34
35
|
(0, reuse_1.setRemoveMode)(options.removeMode);
|
|
@@ -65,9 +65,6 @@ class TaskRunner {
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
registerTask(task) {
|
|
69
|
-
this.registerTasks([task]);
|
|
70
|
-
}
|
|
71
68
|
runTask(task) {
|
|
72
69
|
var _a;
|
|
73
70
|
if (((_a = this.config.migrate) === null || _a === void 0 ? void 0 : _a.tasks[task.getIdentifier()]) === false) {
|
|
@@ -112,9 +109,6 @@ class TaskRunner {
|
|
|
112
109
|
});
|
|
113
110
|
return version;
|
|
114
111
|
}
|
|
115
|
-
hasPendingTasks() {
|
|
116
|
-
return this.openRun || semver_1.default.lt(this.getPendingMinVersion(), this.cliVersion);
|
|
117
|
-
}
|
|
118
112
|
getStatus(outline = false) {
|
|
119
113
|
let done = 0;
|
|
120
114
|
let pending = 0;
|
|
@@ -18,7 +18,11 @@ const input_number_1 = require("./input-number");
|
|
|
18
18
|
const input_radio_1 = require("./input-radio");
|
|
19
19
|
const input_range_1 = require("./input-range");
|
|
20
20
|
const input_text_1 = require("./input-text");
|
|
21
|
+
const link_1 = require("./link");
|
|
22
|
+
const link_button_1 = require("./link-button");
|
|
21
23
|
const link_group_1 = require("./link-group");
|
|
24
|
+
const logo_1 = require("./logo");
|
|
25
|
+
const modal_1 = require("./modal");
|
|
22
26
|
const nav_1 = require("./nav");
|
|
23
27
|
const pagination_1 = require("./pagination");
|
|
24
28
|
const progress_1 = require("./progress");
|
|
@@ -43,6 +47,7 @@ exports.v1Tasks.push(button_link_1.ButtonLinkRemovePropertyAriaLabel);
|
|
|
43
47
|
exports.v1Tasks.push(button_link_1.ButtonLinkRenamePropertyIconOnlyToHideLabel);
|
|
44
48
|
exports.v1Tasks.push(button_1.ButtonRemovePropertyAriaCurrent);
|
|
45
49
|
exports.v1Tasks.push(button_1.ButtonRemovePropertyAriaLabel);
|
|
50
|
+
exports.v1Tasks.push(button_1.ButtonRemovePropertyIconAlign);
|
|
46
51
|
exports.v1Tasks.push(button_1.ButtonRenamePropertyIconOnlyToHideLabel);
|
|
47
52
|
exports.v1Tasks.push(card_1.CardRenamePropertyHeadingToLabel);
|
|
48
53
|
exports.v1Tasks.push(card_1.CardRenamePropertyHeadlineToLabel);
|
|
@@ -57,11 +62,33 @@ exports.v1Tasks.push(input_number_1.InputNumberRenamePropertyListToSuggestions);
|
|
|
57
62
|
exports.v1Tasks.push(input_radio_1.InputRadioRenamePropertyListToSuggestions);
|
|
58
63
|
exports.v1Tasks.push(input_range_1.InputRangeRenamePropertyListToSuggestions);
|
|
59
64
|
exports.v1Tasks.push(input_text_1.InputTextRenamePropertyListToSuggestions);
|
|
65
|
+
exports.v1Tasks.push(link_button_1.LinkButtonRemovePropertyAriaControl);
|
|
66
|
+
exports.v1Tasks.push(link_button_1.LinkButtonRenamePropertyAriaCurrentToListenAriaCurrent);
|
|
67
|
+
exports.v1Tasks.push(link_button_1.LinkButtonRemovePropertyAriaExpanded);
|
|
68
|
+
exports.v1Tasks.push(link_button_1.LinkButtonRemovePropertyAriaLabel);
|
|
69
|
+
exports.v1Tasks.push(link_button_1.LinkButtonRemovePropertyAriaSelected);
|
|
70
|
+
exports.v1Tasks.push(link_button_1.LinkButtonRemovePropertyDisabled);
|
|
71
|
+
exports.v1Tasks.push(link_button_1.LinkButtonRenamePropertyIconOnlyToHideLabel);
|
|
72
|
+
exports.v1Tasks.push(link_1.LinkRemovePropertyAriaControl);
|
|
73
|
+
exports.v1Tasks.push(link_1.LinkRenamePropertyAriaCurrentToListenAriaCurrent);
|
|
74
|
+
exports.v1Tasks.push(link_1.LinkRemovePropertyAriaExpanded);
|
|
75
|
+
exports.v1Tasks.push(link_1.LinkRemovePropertyAriaLabel);
|
|
76
|
+
exports.v1Tasks.push(link_1.LinkRemovePropertyAriaSelected);
|
|
77
|
+
exports.v1Tasks.push(link_1.LinkRemovePropertyDisabled);
|
|
78
|
+
exports.v1Tasks.push(link_1.LinkRemovePropertyIconAlign);
|
|
79
|
+
exports.v1Tasks.push(link_1.LinkRenamePropertyIconOnlyToHideLabel);
|
|
80
|
+
exports.v1Tasks.push(link_1.LinkRemovePropertySelector);
|
|
81
|
+
exports.v1Tasks.push(link_1.LinkRemovePropertyStealth);
|
|
82
|
+
exports.v1Tasks.push(link_1.LinkRemovePropertyUseCase);
|
|
83
|
+
exports.v1Tasks.push(logo_1.LogoRenamePropertyAbbrToOrg);
|
|
84
|
+
exports.v1Tasks.push(modal_1.ModalRenamePropertyAriaLabelToLabel);
|
|
60
85
|
exports.v1Tasks.push(link_group_1.LinkGroupRenamePropertyAriaLabelToLabel);
|
|
86
|
+
exports.v1Tasks.push(link_group_1.LinkGroupRemovePropertyHeading);
|
|
61
87
|
exports.v1Tasks.push(link_group_1.LinkGroupRemovePropertyOrdered);
|
|
62
88
|
exports.v1Tasks.push(nav_1.NavRenamePropertyAriaLabelToLabel);
|
|
63
89
|
exports.v1Tasks.push(nav_1.NavRenamePropertyCompactToHideLabel);
|
|
64
90
|
exports.v1Tasks.push(nav_1.NavRemovePropertyHasCompactButton);
|
|
91
|
+
exports.v1Tasks.push(nav_1.NavRemovePropertyVariant);
|
|
65
92
|
exports.v1Tasks.push(nav_1.NavRenamePropertyCompactToHideLabel);
|
|
66
93
|
exports.v1Tasks.push(pagination_1.PaginationRenamePropertyCountToTotal);
|
|
67
94
|
exports.v1Tasks.push(progress_1.ProgressRenamePropertyTypeToVariant);
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getRemoveMode = exports.setRemoveMode = exports.MODIFIED_FILES = exports.kebabToCapitalCase = exports.isPropertyKebabCaseRegExp = exports.isTagKebabCaseRegExp = exports.getPackageManagerInstallCommand = exports.readPackageJson = exports.readPackageString = exports.
|
|
6
|
+
exports.getRemoveMode = exports.setRemoveMode = exports.MODIFIED_FILES = exports.kebabToCapitalCase = exports.isPropertyKebabCaseRegExp = exports.isTagKebabCaseRegExp = exports.getPackageManagerInstallCommand = exports.readPackageJson = exports.readPackageString = exports.filterFilesByExt = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
/**
|
|
@@ -28,24 +28,6 @@ function filterFilesByExt(dir, ext) {
|
|
|
28
28
|
return files;
|
|
29
29
|
}
|
|
30
30
|
exports.filterFilesByExt = filterFilesByExt;
|
|
31
|
-
/**
|
|
32
|
-
* This function is used to get the versions of @public-ui in the package.json.
|
|
33
|
-
* @param {Record<string, unknown>} packageJson The package.json as object
|
|
34
|
-
* @returns {Map<string, string>} The versions of @public-ui packages
|
|
35
|
-
*/
|
|
36
|
-
function getPublicUiVersions(packageJson) {
|
|
37
|
-
var _a, _b;
|
|
38
|
-
const publicUiVersions = new Map();
|
|
39
|
-
const dependencies = (_a = packageJson.dependencies) !== null && _a !== void 0 ? _a : {};
|
|
40
|
-
const devDependencies = (_b = packageJson.devDependencies) !== null && _b !== void 0 ? _b : {};
|
|
41
|
-
for (const [name, version] of Object.entries(Object.assign(Object.assign({}, dependencies), devDependencies))) {
|
|
42
|
-
if (name.startsWith('@public-ui/')) {
|
|
43
|
-
publicUiVersions.set(name, version);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return publicUiVersions;
|
|
47
|
-
}
|
|
48
|
-
exports.getPublicUiVersions = getPublicUiVersions;
|
|
49
31
|
/**
|
|
50
32
|
* This function is used to get the version of the package.json as string.
|
|
51
33
|
* @param {string} offsetPath The offset path to the package.json
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/kolibri-cli",
|
|
3
|
-
"version": "1.7.0-rc.
|
|
3
|
+
"version": "1.7.0-rc.1",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"homepage": "https://public-ui.github.io",
|
|
6
6
|
"repository": "https://github.com/public-ui/kolibri",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"description": "CLI for executing some helpful commands for KoliBri projects.",
|
|
19
19
|
"scripts": {
|
|
20
20
|
"reset": "pnpm i @public-ui/components@1.1.7",
|
|
21
|
-
"depcheck": "depcheck --ignore-bin-package --skip-missing",
|
|
21
|
+
"depcheck": "depcheck --ignores=\"chalk,loglevel,@public-ui/components\" --ignore-bin-package --skip-missing",
|
|
22
22
|
"format": "prettier -c src",
|
|
23
23
|
"lint": "eslint src && tsc --noEmit",
|
|
24
24
|
"prepack": "tsc",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"semver": "7.5.4"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@public-ui/components": "1.7
|
|
40
|
+
"@public-ui/components": "1.1.7",
|
|
41
41
|
"@types/gradient-string": "1.1.2",
|
|
42
42
|
"@types/node": "20.5.9",
|
|
43
43
|
"@typescript-eslint/eslint-plugin": "6.5.0",
|