@public-ui/kolibri-cli 1.7.0-rc.3 → 1.7.0-rc.5
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 +3 -1
- package/dist/migrate/index.js +2 -2
- package/dist/migrate/runner/task-runner.js +6 -0
- package/dist/migrate/runner/tasks/common/GenericRenamePropertyTask.js +8 -10
- package/dist/migrate/runner/tasks/common/LabelExpertSlot.js +30 -8
- package/dist/migrate/runner/tasks/common/RemovePropertyNameTask.js +6 -5
- package/dist/migrate/runner/tasks/common/RenamePropertyNameTask.js +1 -4
- package/dist/migrate/runner/tasks/v1/index.js +16 -3
- package/dist/migrate/runner/tasks/v1/link-group.js +3 -2
- package/dist/migrate/shares/reuse.js +17 -5
- package/dist/types.js +2 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -87,7 +87,7 @@ kolibri migrate <path>
|
|
|
87
87
|
| Option | Description | Type | Default |
|
|
88
88
|
| ------------------------------ | ----------------------------------------- | :------------------: | :------: |
|
|
89
89
|
| `--ignore-uncommitted-changes` | Allows execution with uncommitted changes | boolean | false |
|
|
90
|
-
| `--remove-mode` | Prefix property name or delete property | `delete`
|
|
90
|
+
| `--remove-mode` | Prefix property name or delete property | `delete` \| `prefix` | `prefix` |
|
|
91
91
|
|
|
92
92
|
#### Configuration
|
|
93
93
|
|
|
@@ -153,6 +153,8 @@ If the migration failed, you can reset the migration with `git reset --hard HEAD
|
|
|
153
153
|
|
|
154
154
|
Use the configuration (`.kolibri.config.json`) to exclude some tasks.
|
|
155
155
|
|
|
156
|
+
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.
|
|
157
|
+
|
|
156
158
|
Maybe it can help to prepare your code in the tricky places for migration.
|
|
157
159
|
|
|
158
160
|
Please give us feedback, if you have problems with the migration: [GitHub Issues](https://github.com/public-ui/kolibri/issues/new?assignees=&labels=useful+hint&projects=&template=7_feedback.md&title=%F0%9F%92%A1+CLI%3A+)
|
package/dist/migrate/index.js
CHANGED
|
@@ -78,7 +78,7 @@ Source folder to migrate: ${baseDir}
|
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
80
80
|
console.log(`
|
|
81
|
-
|
|
81
|
+
Status of all executed Tasks:`);
|
|
82
82
|
const status = runner.getStatus(true);
|
|
83
83
|
fs_1.default.writeFileSync(configFile, JSON.stringify(status.config, null, 2));
|
|
84
84
|
console.log(`
|
|
@@ -96,7 +96,7 @@ Is anything wrong, you can reset the migration with "git reset --hard HEAD~1" or
|
|
|
96
96
|
}
|
|
97
97
|
const status = runner.getStatus();
|
|
98
98
|
console.log(`
|
|
99
|
-
|
|
99
|
+
Execute ${status.total} registered tasks...`);
|
|
100
100
|
runLoop();
|
|
101
101
|
});
|
|
102
102
|
});
|
|
@@ -64,6 +64,9 @@ class TaskRunner {
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
+
registerTask(task) {
|
|
68
|
+
this.registerTasks([task]);
|
|
69
|
+
}
|
|
67
70
|
runTask(task) {
|
|
68
71
|
var _a;
|
|
69
72
|
if (((_a = this.config.migrate) === null || _a === void 0 ? void 0 : _a.tasks[task.getIdentifier()]) === false) {
|
|
@@ -76,6 +79,9 @@ class TaskRunner {
|
|
|
76
79
|
includePrerelease: true,
|
|
77
80
|
})) {
|
|
78
81
|
// task.setStatus('running'); only of the task is async
|
|
82
|
+
if (!this.tasks.has(task.getIdentifier())) {
|
|
83
|
+
this.registerTask(task);
|
|
84
|
+
}
|
|
79
85
|
task.run(this.baseDir);
|
|
80
86
|
task.setStatus('done');
|
|
81
87
|
}
|
|
@@ -8,25 +8,23 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
8
8
|
const types_1 = require("../../../../types");
|
|
9
9
|
const reuse_1 = require("../../../shares/reuse");
|
|
10
10
|
const abstract_task_1 = require("../../abstract-task");
|
|
11
|
-
const
|
|
12
|
-
const DATA_REMOVED_REGEXP = /DataRemoved_/g; // not /DataRemoved-_/g
|
|
11
|
+
const DATA_REMOVED_REGEXP = /DataRemoved_/gi; // not /DataRemoved-_/g
|
|
13
12
|
const DATA_REMOVEDS_REGEXP = /(data-removed-){2,}/g;
|
|
14
13
|
class GenericRenamePropertyTask extends abstract_task_1.AbstractTask {
|
|
15
14
|
constructor(identifier, description, tag, oldProperty, newProperty, versionRange, dependentTasks = [], options = {}) {
|
|
16
|
-
super(identifier, description,
|
|
15
|
+
super(identifier, description, types_1.MARKUP_EXTENSIONS, versionRange, dependentTasks, options);
|
|
16
|
+
this.newProperty = newProperty;
|
|
17
17
|
if (!reuse_1.isTagKebabCaseRegExp.test(tag)) {
|
|
18
|
-
(0, reuse_1.logAndCreateError)(`Tag "${tag}" is not in kebab case.`);
|
|
18
|
+
throw (0, reuse_1.logAndCreateError)(`Tag "${tag}" is not in kebab case.`);
|
|
19
19
|
}
|
|
20
20
|
if (!reuse_1.isPropertyKebabCaseRegExp.test(oldProperty)) {
|
|
21
|
-
(0, reuse_1.logAndCreateError)(`Old property "${oldProperty}" is not in kebab case.`);
|
|
21
|
+
throw (0, reuse_1.logAndCreateError)(`Old property "${oldProperty}" is not in kebab case.`);
|
|
22
22
|
}
|
|
23
23
|
if (!reuse_1.isPropertyKebabCaseRegExp.test(newProperty)) {
|
|
24
24
|
throw (0, reuse_1.logAndCreateError)(`New property "${newProperty}" is not in kebab case.`);
|
|
25
25
|
}
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this.newPropertyInCamelCase = (0, reuse_1.kebabToCapitalCase)(newProperty);
|
|
29
|
-
this.componentRegExp = new RegExp(`(<${(0, reuse_1.kebabToCapitalCase)(tag)}[^>]+)${this.oldPropertyInCamelCase}([ >=])`, 'g');
|
|
26
|
+
this.newPropertyInCamelCase = (0, reuse_1.kebabToCamelCase)(newProperty);
|
|
27
|
+
this.componentRegExp = new RegExp(`(<${(0, reuse_1.kebabToCapitalCase)(tag)}[^>]+)${(0, reuse_1.kebabToCapitalCase)(oldProperty)}([ >=])`, 'g');
|
|
30
28
|
this.customElementRegExp = new RegExp(`(<${tag}[^>]+)${oldProperty}([ >=])`, 'g');
|
|
31
29
|
}
|
|
32
30
|
run(baseDir) {
|
|
@@ -48,7 +46,7 @@ class GenericRenamePropertyTask extends abstract_task_1.AbstractTask {
|
|
|
48
46
|
});
|
|
49
47
|
}
|
|
50
48
|
transpileCustomElementFileRename(baseDir) {
|
|
51
|
-
(0, reuse_1.filterFilesByExt)(baseDir, types_1.
|
|
49
|
+
(0, reuse_1.filterFilesByExt)(baseDir, types_1.CUSTOM_ELEMENT_FILE_EXTENSIONS).forEach((file) => {
|
|
52
50
|
const content = fs_1.default.readFileSync(file, 'utf8');
|
|
53
51
|
const newContent = content
|
|
54
52
|
// Replacements
|
|
@@ -8,10 +8,29 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
8
8
|
const types_1 = require("../../../../types");
|
|
9
9
|
const reuse_1 = require("../../../shares/reuse");
|
|
10
10
|
const abstract_task_1 = require("../../abstract-task");
|
|
11
|
+
const removeLineBreaksAndSpaces = (match) => {
|
|
12
|
+
return match.replace(/\r?\n/g, ' ').replace(/>\s+/g, '>').replace(/\s+</g, '<');
|
|
13
|
+
};
|
|
11
14
|
class LabelExpertSlot extends abstract_task_1.AbstractTask {
|
|
12
|
-
|
|
15
|
+
constructor(identifier, tag, property, versionRange, dependentTasks, options) {
|
|
16
|
+
super(identifier, `Move innerText of "${tag}" component to property "${property}"`, types_1.MARKUP_EXTENSIONS, versionRange, dependentTasks, options);
|
|
17
|
+
this.property = property;
|
|
18
|
+
if (!reuse_1.isTagKebabCaseRegExp.test(tag)) {
|
|
19
|
+
throw (0, reuse_1.logAndCreateError)(`Tag "${tag}" is not in kebab case.`);
|
|
20
|
+
}
|
|
21
|
+
if (!reuse_1.isPropertyKebabCaseRegExp.test(property)) {
|
|
22
|
+
throw (0, reuse_1.logAndCreateError)(`Property "${property}" is not in kebab case.`);
|
|
23
|
+
}
|
|
24
|
+
const tagCapitalCase = (0, reuse_1.kebabToCapitalCase)(tag);
|
|
25
|
+
this.propertyInCamelCase = (0, reuse_1.kebabToCamelCase)(property);
|
|
26
|
+
// https://regex101.com/r/WkEKxu/1
|
|
27
|
+
this.componentRegExp = new RegExp(`(<${tagCapitalCase}[^>]*)>([^<]+(\\n\\s*)*)(<\\/${tagCapitalCase}>)`, 'g');
|
|
28
|
+
this.customElementRegExp = new RegExp(`(<${tag}[^>]*)>([^<]+(\\n\\s*)*)(<\\/${tag}>)`, 'g');
|
|
29
|
+
}
|
|
30
|
+
static getInstance(tag, property, versionRange, dependentTasks = [], options = {}) {
|
|
31
|
+
const identifier = `${tag}-move-innerText-to-property-${property}`;
|
|
13
32
|
if (!this.instances.has(identifier)) {
|
|
14
|
-
this.instances.set(identifier, new LabelExpertSlot(identifier,
|
|
33
|
+
this.instances.set(identifier, new LabelExpertSlot(identifier, tag, property, versionRange, dependentTasks, options));
|
|
15
34
|
}
|
|
16
35
|
return this.instances.get(identifier);
|
|
17
36
|
}
|
|
@@ -22,9 +41,10 @@ class LabelExpertSlot extends abstract_task_1.AbstractTask {
|
|
|
22
41
|
transpileComponentFileDelete(baseDir) {
|
|
23
42
|
(0, reuse_1.filterFilesByExt)(baseDir, types_1.COMPONENT_FILE_EXTENSIONS).forEach((file) => {
|
|
24
43
|
const content = fs_1.default.readFileSync(file, 'utf8');
|
|
25
|
-
const newContent = content
|
|
26
|
-
|
|
27
|
-
|
|
44
|
+
const newContent = content
|
|
45
|
+
// Replacements
|
|
46
|
+
.replace(this.componentRegExp, removeLineBreaksAndSpaces)
|
|
47
|
+
.replace(this.componentRegExp, `$1 ${this.propertyInCamelCase}="$2">$4`);
|
|
28
48
|
if (content !== newContent) {
|
|
29
49
|
reuse_1.MODIFIED_FILES.add(file);
|
|
30
50
|
fs_1.default.writeFileSync(file, newContent);
|
|
@@ -34,11 +54,13 @@ class LabelExpertSlot extends abstract_task_1.AbstractTask {
|
|
|
34
54
|
transpileCustomElementFileDelete(baseDir) {
|
|
35
55
|
(0, reuse_1.filterFilesByExt)(baseDir, types_1.COMPONENT_FILE_EXTENSIONS).forEach((file) => {
|
|
36
56
|
const content = fs_1.default.readFileSync(file, 'utf8');
|
|
37
|
-
const newContent = content
|
|
38
|
-
|
|
57
|
+
const newContent = content
|
|
58
|
+
// Replacements
|
|
59
|
+
.replace(this.customElementRegExp, removeLineBreaksAndSpaces)
|
|
60
|
+
.replace(this.customElementRegExp, `$1 ${this.property}="$2">$4`);
|
|
39
61
|
if (content !== newContent) {
|
|
40
62
|
reuse_1.MODIFIED_FILES.add(file);
|
|
41
|
-
|
|
63
|
+
// fs.writeFileSync(file, newContent);
|
|
42
64
|
}
|
|
43
65
|
});
|
|
44
66
|
}
|
|
@@ -18,10 +18,11 @@ class RemovePropertyNameTask extends GenericRenamePropertyTask_1.GenericRenamePr
|
|
|
18
18
|
if (!reuse_1.isPropertyKebabCaseRegExp.test(property)) {
|
|
19
19
|
throw (0, reuse_1.logAndCreateError)(`Property "${property}" is not in kebab case.`);
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
21
|
+
const tagCapitalCase = (0, reuse_1.kebabToCapitalCase)(tag);
|
|
22
|
+
const propertyInCamelCase = (0, reuse_1.kebabToCamelCase)(property);
|
|
23
|
+
this.componentRegExpBoolean = new RegExp(`(<${tagCapitalCase}[^>]+)${propertyInCamelCase}([ >])`, 'g');
|
|
24
|
+
this.componentRegExpCurlyBrackets = new RegExp(`(<${tagCapitalCase}[^>]+)${propertyInCamelCase}(=\\{[^\\}]+\\})`, 'g');
|
|
25
|
+
this.componentRegExpQuotationMarks = new RegExp(`(<${tagCapitalCase}[^>]+)${propertyInCamelCase}(="[^"]+")`, 'g');
|
|
25
26
|
this.customElementRegExpBoolean = new RegExp(`(<${tag}[^>]+)${property}([ >])`, 'g');
|
|
26
27
|
this.customElementRegExpCurlyBrackets = new RegExp(`(<${tag}[^>]+)${property}(=\\{[^\\}]+\\})`, 'g');
|
|
27
28
|
this.customElementRegExpQuotationMarks = new RegExp(`(<${tag}[^>]+)${property}(="[^"]+")`, 'g');
|
|
@@ -59,7 +60,7 @@ class RemovePropertyNameTask extends GenericRenamePropertyTask_1.GenericRenamePr
|
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
62
|
transpileCustomElementFileDelete(baseDir) {
|
|
62
|
-
(0, reuse_1.filterFilesByExt)(baseDir, types_1.
|
|
63
|
+
(0, reuse_1.filterFilesByExt)(baseDir, types_1.CUSTOM_ELEMENT_FILE_EXTENSIONS).forEach((file) => {
|
|
63
64
|
const content = fs_1.default.readFileSync(file, 'utf8');
|
|
64
65
|
const newContent = content
|
|
65
66
|
// Replacements
|
|
@@ -3,14 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RenamePropertyNameTask = void 0;
|
|
4
4
|
const GenericRenamePropertyTask_1 = require("./GenericRenamePropertyTask");
|
|
5
5
|
class RenamePropertyNameTask extends GenericRenamePropertyTask_1.GenericRenamePropertyTask {
|
|
6
|
-
constructor(identifier, tag, oldProperty, newProperty, versionRange, dependentTasks = [], options = {}) {
|
|
7
|
-
super(identifier, `Rename property "${oldProperty}" to "${newProperty}" of "${tag}" component`, tag, oldProperty, newProperty, versionRange, dependentTasks, options);
|
|
8
|
-
}
|
|
9
6
|
static getInstance(tag, oldProperty, newProperty, versionRange, dependentTasks = [], options = {}) {
|
|
10
7
|
var _a;
|
|
11
8
|
const identifier = `${tag}-rename-property-${oldProperty}-to-${newProperty}`;
|
|
12
9
|
if (!this.instances.has(identifier)) {
|
|
13
|
-
(_a = this.instances) === null || _a === void 0 ? void 0 : _a.set(identifier, new RenamePropertyNameTask(identifier, tag, oldProperty, newProperty, versionRange, dependentTasks, options));
|
|
10
|
+
(_a = this.instances) === null || _a === void 0 ? void 0 : _a.set(identifier, new RenamePropertyNameTask(identifier, `Rename property "${oldProperty}" to "${newProperty}" of "${tag}" component`, tag, oldProperty, newProperty, versionRange, dependentTasks, options));
|
|
14
11
|
}
|
|
15
12
|
return this.instances.get(identifier);
|
|
16
13
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.v1Tasks = void 0;
|
|
4
|
-
const types_1 = require("../../../../types");
|
|
5
4
|
const LabelExpertSlot_1 = require("../common/LabelExpertSlot");
|
|
6
5
|
const abbr_1 = require("./abbr");
|
|
7
6
|
const accordion_1 = require("./accordion");
|
|
@@ -83,10 +82,11 @@ exports.v1Tasks.push(link_1.LinkRemovePropertySelector);
|
|
|
83
82
|
exports.v1Tasks.push(link_1.LinkRemovePropertyStealth);
|
|
84
83
|
exports.v1Tasks.push(link_1.LinkRemovePropertyUseCase);
|
|
85
84
|
exports.v1Tasks.push(logo_1.LogoRenamePropertyAbbrToOrg);
|
|
86
|
-
exports.v1Tasks.push(modal_1.ModalRenamePropertyAriaLabelToLabel);
|
|
87
85
|
exports.v1Tasks.push(link_group_1.LinkGroupRenamePropertyAriaLabelToLabel);
|
|
86
|
+
exports.v1Tasks.push(link_group_1.LinkGroupRenamePropertyHeadingToLabel);
|
|
88
87
|
exports.v1Tasks.push(link_group_1.LinkGroupRemovePropertyHeading);
|
|
89
88
|
exports.v1Tasks.push(link_group_1.LinkGroupRemovePropertyOrdered);
|
|
89
|
+
exports.v1Tasks.push(modal_1.ModalRenamePropertyAriaLabelToLabel);
|
|
90
90
|
exports.v1Tasks.push(nav_1.NavRenamePropertyAriaLabelToLabel);
|
|
91
91
|
exports.v1Tasks.push(nav_1.NavRenamePropertyCompactToHideLabel);
|
|
92
92
|
exports.v1Tasks.push(nav_1.NavRemovePropertyHasCompactButton);
|
|
@@ -105,4 +105,17 @@ exports.v1Tasks.push(tabs_1.TabsRenamePropertyAriaLabelToLabel);
|
|
|
105
105
|
exports.v1Tasks.push(tabs_1.TabsRenamePropertyTabAlignToAlign);
|
|
106
106
|
exports.v1Tasks.push(toast_1.ToastRenamePropertyHeadingToLabel);
|
|
107
107
|
exports.v1Tasks.push(version_1.VersionRenamePropertyVersionToLabel);
|
|
108
|
-
exports.v1Tasks.push(LabelExpertSlot_1.LabelExpertSlot.getInstance('
|
|
108
|
+
exports.v1Tasks.push(LabelExpertSlot_1.LabelExpertSlot.getInstance('kol-heading', '_label', '^1'));
|
|
109
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-checkbox', '_label', '^1'));
|
|
110
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-color', '_label', '^1'));
|
|
111
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-date', '_label', '^1'));
|
|
112
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-email', '_label', '^1'));
|
|
113
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-file', '_label', '^1'));
|
|
114
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-number', '_label', '^1'));
|
|
115
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-password', '_label', '^1'));
|
|
116
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-radio', '_label', '^1'));
|
|
117
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-range', '_label', '^1'));
|
|
118
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-text', '_label', '^1'));
|
|
119
|
+
exports.v1Tasks.push(LabelExpertSlot_1.LabelExpertSlot.getInstance('kol-link', '_label', '^1'));
|
|
120
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-select', '_label', '^1'));
|
|
121
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-textarea', '_label', '^1'));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LinkGroupRemovePropertyOrdered = exports.LinkGroupRemovePropertyHeading = exports.LinkGroupRenamePropertyAriaLabelToLabel = void 0;
|
|
3
|
+
exports.LinkGroupRemovePropertyOrdered = exports.LinkGroupRemovePropertyHeading = exports.LinkGroupRenamePropertyHeadingToLabel = exports.LinkGroupRenamePropertyAriaLabelToLabel = void 0;
|
|
4
4
|
const RemovePropertyNameTask_1 = require("../common/RemovePropertyNameTask");
|
|
5
5
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
6
6
|
exports.LinkGroupRenamePropertyAriaLabelToLabel = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-link-group', '_aria-label', '_label', '^1');
|
|
7
|
-
exports.
|
|
7
|
+
exports.LinkGroupRenamePropertyHeadingToLabel = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-link-group', '_heading', '_label', '^1');
|
|
8
|
+
exports.LinkGroupRemovePropertyHeading = RemovePropertyNameTask_1.RemovePropertyNameTask.getInstance('kol-link-group', '_heading', '^1', [exports.LinkGroupRenamePropertyHeadingToLabel]);
|
|
8
9
|
exports.LinkGroupRemovePropertyOrdered = RemovePropertyNameTask_1.RemovePropertyNameTask.getInstance('kol-link-group', '_ordered', '^1');
|
|
@@ -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.getVersionOfPublicUiKoliBriCli = exports.getVersionOfPublicUiComponents = exports.getContentOfProjectPkgJson = exports.getRemoveMode = exports.setRemoveMode = exports.MODIFIED_FILES = exports.kebabToCapitalCase = exports.isPropertyKebabCaseRegExp = exports.isTagKebabCaseRegExp = exports.getPackageManagerInstallCommand = exports.filterFilesByExt = exports.logAndCreateError = void 0;
|
|
6
|
+
exports.getVersionOfPublicUiKoliBriCli = exports.getVersionOfPublicUiComponents = exports.getContentOfProjectPkgJson = exports.getRemoveMode = exports.setRemoveMode = exports.MODIFIED_FILES = exports.kebabToCamelCase = exports.kebabToCapitalCase = exports.isPropertyKebabCaseRegExp = exports.isTagKebabCaseRegExp = exports.getPackageManagerInstallCommand = exports.filterFilesByExt = exports.logAndCreateError = void 0;
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
@@ -101,16 +101,28 @@ exports.isTagKebabCaseRegExp = /^kol-[a-z]+(-[a-z]+)*$/;
|
|
|
101
101
|
exports.isPropertyKebabCaseRegExp = /^(data-removed-)?_[a-z]+(-[a-z]+)*$/;
|
|
102
102
|
/**
|
|
103
103
|
* Converts a kebab case string to a capital case string.
|
|
104
|
-
* @param {string}
|
|
104
|
+
* @param {string} str The kebab case string
|
|
105
105
|
* @returns {string} The capital case string
|
|
106
106
|
*/
|
|
107
|
-
function kebabToCapitalCase(
|
|
108
|
-
return
|
|
107
|
+
function kebabToCapitalCase(str) {
|
|
108
|
+
return str
|
|
109
109
|
.split('-') // Split on hyphen
|
|
110
110
|
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()) // Capitalize each word
|
|
111
111
|
.join(''); // Join without space
|
|
112
112
|
}
|
|
113
113
|
exports.kebabToCapitalCase = kebabToCapitalCase;
|
|
114
|
+
/**
|
|
115
|
+
* Converts a kebab case string to a camel case string.
|
|
116
|
+
* @param {string} str The kebab case string
|
|
117
|
+
* @returns {string} The camel case string
|
|
118
|
+
*/
|
|
119
|
+
function kebabToCamelCase(str) {
|
|
120
|
+
return str
|
|
121
|
+
.split('-') // Split on hyphen
|
|
122
|
+
.map((word, index) => (index === 0 ? word : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())) // Capitalize each word
|
|
123
|
+
.join(''); // Join without space
|
|
124
|
+
}
|
|
125
|
+
exports.kebabToCamelCase = kebabToCamelCase;
|
|
114
126
|
exports.MODIFIED_FILES = new Set();
|
|
115
127
|
let REMOVE_MODE = 'prefix';
|
|
116
128
|
/**
|
|
@@ -140,7 +152,7 @@ const getContentOfProjectPkgJson = () => {
|
|
|
140
152
|
exports.getContentOfProjectPkgJson = getContentOfProjectPkgJson;
|
|
141
153
|
const getVersionOfPublicUiComponents = () => {
|
|
142
154
|
try {
|
|
143
|
-
return readPackageJson(path_1.default.resolve(process.cwd(), '
|
|
155
|
+
return readPackageJson(path_1.default.resolve(process.cwd(), 'node_modules/@public-ui/components')).version;
|
|
144
156
|
}
|
|
145
157
|
catch (err) {
|
|
146
158
|
throw logAndCreateError('Could not get version of installed "@public-ui/components" package!', 'Check that you are in the root directory of your project and that the package "@public-ui/components" is installed.');
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CUSTOM_ELEMENT_FILE_EXTENSIONS = exports.COMPONENT_FILE_EXTENSIONS = exports.FILE_EXTENSIONS = void 0;
|
|
3
|
+
exports.MARKUP_EXTENSIONS = exports.CUSTOM_ELEMENT_FILE_EXTENSIONS = exports.COMPONENT_FILE_EXTENSIONS = exports.FILE_EXTENSIONS = void 0;
|
|
4
4
|
exports.FILE_EXTENSIONS = ['html', 'js', 'json', 'jsx', 'ts', 'tsx', 'vue'];
|
|
5
5
|
exports.COMPONENT_FILE_EXTENSIONS = ['jsx', 'tsx', 'vue'];
|
|
6
6
|
exports.CUSTOM_ELEMENT_FILE_EXTENSIONS = ['html', 'jsx', 'tsx', 'vue'];
|
|
7
|
+
exports.MARKUP_EXTENSIONS = exports.COMPONENT_FILE_EXTENSIONS.concat(exports.CUSTOM_ELEMENT_FILE_EXTENSIONS);
|
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.5",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"homepage": "https://public-ui.github.io",
|
|
6
6
|
"repository": "https://github.com/public-ui/kolibri",
|
|
@@ -38,23 +38,23 @@
|
|
|
38
38
|
"semver": "7.5.4"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@public-ui/components": "1.
|
|
41
|
+
"@public-ui/components": "1.6.2",
|
|
42
42
|
"@types/gradient-string": "1.1.2",
|
|
43
|
-
"@types/node": "20.
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
45
|
-
"@typescript-eslint/parser": "6.
|
|
46
|
-
"depcheck": "1.4.
|
|
43
|
+
"@types/node": "20.6.0",
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "6.7.0",
|
|
45
|
+
"@typescript-eslint/parser": "6.7.0",
|
|
46
|
+
"depcheck": "1.4.6",
|
|
47
47
|
"eslint-config-prettier": "9.0.0",
|
|
48
48
|
"eslint-plugin-html": "7.1.0",
|
|
49
|
-
"eslint-plugin-jsdoc": "46.
|
|
49
|
+
"eslint-plugin-jsdoc": "46.6.0",
|
|
50
50
|
"eslint-plugin-json": "3.1.0",
|
|
51
51
|
"eslint-plugin-jsx-a11y": "6.7.1",
|
|
52
52
|
"eslint-plugin-no-loops": "0.3.0",
|
|
53
53
|
"eslint-plugin-react": "7.33.2",
|
|
54
|
-
"knip": "2.
|
|
54
|
+
"knip": "2.23.0",
|
|
55
55
|
"mocha": "10.2.0",
|
|
56
56
|
"nodemon": "3.0.1",
|
|
57
|
-
"npm-check-updates": "16.13.
|
|
57
|
+
"npm-check-updates": "16.13.3",
|
|
58
58
|
"ts-node": "10.9.1",
|
|
59
59
|
"typescript": "5.2.2"
|
|
60
60
|
},
|