@public-ui/kolibri-cli 1.7.0-rc.15 → 1.7.0-rc.17
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/dist/migrate/index.js +16 -9
- package/dist/migrate/runner/task-runner.js +4 -0
- package/dist/migrate/runner/tasks/common/ExecTask.js +30 -0
- package/dist/migrate/runner/tasks/common/HandleDependencyTask.js +56 -0
- package/dist/migrate/runner/tasks/common/JsonTask.js +47 -0
- package/dist/migrate/runner/tasks/common/LabelExpertSlot.js +4 -2
- package/dist/migrate/runner/tasks/common/MergeHtmlTask.js +36 -0
- package/dist/migrate/runner/tasks/common/NpmRcAddRuleTask.js +40 -0
- package/dist/migrate/runner/tasks/common/RemoveTask.js +18 -0
- package/dist/migrate/runner/tasks/common/TsConfigReconfigureTask.js +17 -10
- package/dist/migrate/runner/tasks/index.js +5 -2
- package/dist/migrate/runner/tasks/v1/abbr.js +2 -1
- package/dist/migrate/runner/tasks/v1/assets.js +34 -0
- package/dist/migrate/runner/tasks/v1/button.js +2 -1
- package/dist/migrate/runner/tasks/v1/icon.js +2 -1
- package/dist/migrate/runner/tasks/v1/index.js +29 -10
- package/dist/migrate/runner/tasks/v1/input-checkbox.js +2 -1
- package/dist/migrate/runner/tasks/v1/input-color.js +2 -1
- package/dist/migrate/runner/tasks/v1/input-date.js +2 -1
- package/dist/migrate/runner/tasks/v1/input-email.js +2 -1
- package/dist/migrate/runner/tasks/v1/input-file.js +5 -0
- package/dist/migrate/runner/tasks/v1/input-number.js +2 -1
- package/dist/migrate/runner/tasks/v1/input-password.js +5 -0
- package/dist/migrate/runner/tasks/v1/input-range.js +2 -1
- package/dist/migrate/runner/tasks/v1/input-text.js +2 -1
- package/dist/migrate/runner/tasks/v1/input.js +5 -0
- package/dist/migrate/runner/tasks/v1/nav.js +3 -2
- package/dist/migrate/runner/tasks/v1/pagination.js +4 -1
- package/dist/migrate/runner/tasks/v1/select.js +2 -1
- package/dist/migrate/runner/tasks/v1/span.js +2 -1
- package/dist/migrate/runner/tasks/v1/tabs.js +2 -1
- package/dist/migrate/shares/reuse.js +20 -7
- package/package.json +7 -7
package/dist/migrate/index.js
CHANGED
|
@@ -3,18 +3,20 @@ 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
|
-
const
|
|
6
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
7
7
|
const child_process_1 = require("child_process");
|
|
8
8
|
const commander_1 = require("commander");
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const node_child_process_1 = __importDefault(require("node:child_process"));
|
|
10
11
|
const path_1 = __importDefault(require("path"));
|
|
11
12
|
const semver_1 = __importDefault(require("semver"));
|
|
12
13
|
const task_runner_1 = require("./runner/task-runner");
|
|
14
|
+
const tasks_1 = require("./runner/tasks");
|
|
13
15
|
const test_1 = require("./runner/tasks/test");
|
|
14
16
|
const v1_1 = require("./runner/tasks/v1");
|
|
17
|
+
const assets_1 = require("./runner/tasks/v1/assets");
|
|
15
18
|
const reuse_1 = require("./shares/reuse");
|
|
16
19
|
const types_1 = require("./types");
|
|
17
|
-
const tasks_1 = require("./runner/tasks");
|
|
18
20
|
/**
|
|
19
21
|
* This function is used to register the migrate command.
|
|
20
22
|
* @param {Command} program The program object to register the command
|
|
@@ -61,6 +63,7 @@ Source folder to migrate: ${baseDir}
|
|
|
61
63
|
const runner = new task_runner_1.TaskRunner(baseDir, versionOfPublicUiKoliBriCli, versionOfPublicUiComponents, config);
|
|
62
64
|
runner.registerTasks(tasks_1.commonTasks);
|
|
63
65
|
runner.registerTasks(v1_1.v1Tasks);
|
|
66
|
+
runner.registerTasks((0, assets_1.getAssetTasks)(baseDir));
|
|
64
67
|
if (options.testTasks) {
|
|
65
68
|
runner.registerTasks(test_1.testTasks);
|
|
66
69
|
}
|
|
@@ -77,7 +80,7 @@ Source folder to migrate: ${baseDir}
|
|
|
77
80
|
fs_1.default.writeFileSync(path_1.default.resolve(process.cwd(), 'package.json'), packageJson);
|
|
78
81
|
runner.setProjectVersion(version);
|
|
79
82
|
console.log(`- Update @public-ui/* to version ${version}`);
|
|
80
|
-
(0, child_process_1.exec)((0, reuse_1.
|
|
83
|
+
(0, child_process_1.exec)((0, reuse_1.getPackageManagerCommand)('install'), (err) => {
|
|
81
84
|
if (err) {
|
|
82
85
|
console.error(`exec error: ${err.message}`);
|
|
83
86
|
return;
|
|
@@ -92,7 +95,7 @@ Source folder to migrate: ${baseDir}
|
|
|
92
95
|
fs_1.default.writeFileSync(path_1.default.resolve(process.cwd(), 'package.json'), packageJson);
|
|
93
96
|
runner.setProjectVersion(version);
|
|
94
97
|
console.log(`- Update @public-ui/* to version ${version}`);
|
|
95
|
-
(0, child_process_1.exec)((0, reuse_1.
|
|
98
|
+
(0, child_process_1.exec)((0, reuse_1.getPackageManagerCommand)('install'), (err) => {
|
|
96
99
|
if (err) {
|
|
97
100
|
console.error(`exec error: ${err.message}`);
|
|
98
101
|
return;
|
|
@@ -117,7 +120,7 @@ Modified files: ${reuse_1.MODIFIED_FILES.size}`);
|
|
|
117
120
|
reuse_1.MODIFIED_FILES.forEach((file) => {
|
|
118
121
|
console.log(`- ${file}`);
|
|
119
122
|
});
|
|
120
|
-
if (options.format) {
|
|
123
|
+
if (reuse_1.MODIFIED_FILES.size > 0 && options.format) {
|
|
121
124
|
console.log(`
|
|
122
125
|
We try to format the modified files with prettier...`);
|
|
123
126
|
try {
|
|
@@ -131,14 +134,18 @@ We try to format the modified files with prettier...`);
|
|
|
131
134
|
}
|
|
132
135
|
console.log();
|
|
133
136
|
}
|
|
134
|
-
console.log(`
|
|
135
|
-
|
|
137
|
+
console.log(chalk_1.default.cyan(`
|
|
138
|
+
${chalk_1.default.bold.bgCyan(`The migration is complete.`)} Please check the modified files and commit them if necessary.`));
|
|
139
|
+
console.log(chalk_1.default.magenta(`
|
|
140
|
+
Despite the best possible preparation of migration steps, we will certainly not be able to fully migrate every individual source code in the project. After running the migration tool, please see where you may still need to help yourself and feel free to provide feedback on what we can improve.
|
|
141
|
+
|
|
142
|
+
After all the changes are made, the modified files are formatted using Prettier.
|
|
136
143
|
|
|
137
|
-
When migrating the labels, the text (innerText) is assigned 1 to 1 to the _label property. There could be the following situation, where manual corrections have to be made: _label={\`I am {count} years old.\`} -> _label={\`I am \${count} years old.\`} (add a $)
|
|
144
|
+
When migrating the labels, the text (innerText) is assigned 1 to 1 to the _label property. There could be the following situation, where manual corrections have to be made: ${chalk_1.default.italic.white(`_label={\`I am {count} years old.\`}`)} -> ${chalk_1.default.italic.white(`_label={\`I am \${count} years old.\`}`)} (add a $)
|
|
138
145
|
|
|
139
146
|
Afterwards, it may be that functions or themes have changed or are no longer included in newer major versions. This should be checked finally and corrected manually if necessary.
|
|
140
147
|
|
|
141
|
-
If something is wrong, the migration can be
|
|
148
|
+
If something is wrong, the migration can be reverted with ${chalk_1.default.italic.white(`git reset --hard HEAD~1`)} or by discarding the affected files. For more information, read the troubleshooting section in the README.`));
|
|
142
149
|
}
|
|
143
150
|
const status = runner.getStatus();
|
|
144
151
|
console.log(`
|
|
@@ -53,6 +53,10 @@ class TaskRunner {
|
|
|
53
53
|
}
|
|
54
54
|
registerTasks(tasks) {
|
|
55
55
|
tasks.forEach((task) => {
|
|
56
|
+
const dependentTasks = task.getDependentTasks();
|
|
57
|
+
if (dependentTasks.length > 0) {
|
|
58
|
+
this.registerTasks(dependentTasks);
|
|
59
|
+
}
|
|
56
60
|
if (semver_1.default.gtr(this.projectVersion, task.getVersionRange(), {
|
|
57
61
|
includePrerelease: true,
|
|
58
62
|
})) {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecTask = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const abstract_task_1 = require("../../abstract-task");
|
|
6
|
+
class ExecTask extends abstract_task_1.AbstractTask {
|
|
7
|
+
constructor(identifier, title, command, versionRange, dependentTasks, options) {
|
|
8
|
+
super(identifier, title, [], versionRange, dependentTasks, options);
|
|
9
|
+
this.command = command;
|
|
10
|
+
}
|
|
11
|
+
static getInstance(command, versionRange, dependentTasks = [], options = {}) {
|
|
12
|
+
const identifier = `exec-${command}`;
|
|
13
|
+
const title = `Exec ${command}.`;
|
|
14
|
+
if (!this.instances.has(identifier)) {
|
|
15
|
+
this.instances.set(identifier, new ExecTask(identifier, title, command, versionRange, dependentTasks, options));
|
|
16
|
+
}
|
|
17
|
+
return this.instances.get(identifier);
|
|
18
|
+
}
|
|
19
|
+
run() {
|
|
20
|
+
try {
|
|
21
|
+
(0, child_process_1.execSync)(this.command, {
|
|
22
|
+
encoding: 'utf8',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
console.warn(error);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.ExecTask = ExecTask;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HandleDependencyTask = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const abstract_task_1 = require("../../abstract-task");
|
|
6
|
+
const reuse_1 = require("../../../shares/reuse");
|
|
7
|
+
class HandleDependencyTask extends abstract_task_1.AbstractTask {
|
|
8
|
+
constructor(identifier, title, command, dependencies, // Map<string, string | null>
|
|
9
|
+
devDependencies, // Map<string, string | null>
|
|
10
|
+
versionRange, dependentTasks, options) {
|
|
11
|
+
super(identifier, title, [], versionRange, dependentTasks, options);
|
|
12
|
+
this.command = command;
|
|
13
|
+
this.dependencies = dependencies;
|
|
14
|
+
this.devDependencies = devDependencies;
|
|
15
|
+
}
|
|
16
|
+
static getInstance(command, dependencies, devDependencies, versionRange, dependentTasks = [], options = {}) {
|
|
17
|
+
const identifier = `${command}-${Object.keys(dependencies !== null && dependencies !== void 0 ? dependencies : {}).join(',')}-${Object.keys(devDependencies !== null && devDependencies !== void 0 ? devDependencies : {}).join(',')}`;
|
|
18
|
+
const title = `${command === 'add' ? 'Add' : command === 'install' ? 'Install' : 'Remove'} dependency "${Object.keys(dependencies !== null && dependencies !== void 0 ? dependencies : {}).join(', ')}" and devDependency "${Object.keys(devDependencies !== null && devDependencies !== void 0 ? devDependencies : {}).join(', ')}".`;
|
|
19
|
+
if (!this.instances.has(identifier)) {
|
|
20
|
+
this.instances.set(identifier, new HandleDependencyTask(identifier, title, command, dependencies, devDependencies, versionRange, dependentTasks, options));
|
|
21
|
+
}
|
|
22
|
+
return this.instances.get(identifier);
|
|
23
|
+
}
|
|
24
|
+
run() {
|
|
25
|
+
var _a, _b, _c, _d;
|
|
26
|
+
if (Object.keys((_a = this.dependencies) !== null && _a !== void 0 ? _a : {}).length > 0) {
|
|
27
|
+
let command = `${(0, reuse_1.getPackageManagerCommand)(this.command)}`;
|
|
28
|
+
Object.keys((_b = this.dependencies) !== null && _b !== void 0 ? _b : {}).forEach((dependency) => {
|
|
29
|
+
command += ` ${dependency}@${this.dependencies[dependency]}`;
|
|
30
|
+
});
|
|
31
|
+
try {
|
|
32
|
+
(0, child_process_1.execSync)(command, {
|
|
33
|
+
encoding: 'utf8',
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
console.warn(error);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (Object.keys((_c = this.devDependencies) !== null && _c !== void 0 ? _c : {}).length > 0) {
|
|
41
|
+
let command = `${(0, reuse_1.getPackageManagerCommand)(this.command)} -D`;
|
|
42
|
+
Object.keys((_d = this.devDependencies) !== null && _d !== void 0 ? _d : {}).forEach((dependency) => {
|
|
43
|
+
command += ` ${dependency}`;
|
|
44
|
+
});
|
|
45
|
+
try {
|
|
46
|
+
(0, child_process_1.execSync)(command, {
|
|
47
|
+
encoding: 'utf8',
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
console.warn(error);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.HandleDependencyTask = HandleDependencyTask;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.JsonTask = void 0;
|
|
7
|
+
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const reuse_1 = require("../../../shares/reuse");
|
|
11
|
+
const abstract_task_1 = require("../../abstract-task");
|
|
12
|
+
class JsonTask extends abstract_task_1.AbstractTask {
|
|
13
|
+
constructor(identifier, key, json, versionRange, dependentTasks = [], options = {}) {
|
|
14
|
+
super(identifier, `Reconfigure "${key}" in package.json of your project.`, [], versionRange, dependentTasks, options);
|
|
15
|
+
this.json = json;
|
|
16
|
+
if (typeof key !== 'string') {
|
|
17
|
+
throw (0, reuse_1.logAndCreateError)(`Key of task "${this.identifier}" is not a string.`);
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
JSON.stringify(json);
|
|
21
|
+
}
|
|
22
|
+
catch (_a) {
|
|
23
|
+
throw (0, reuse_1.logAndCreateError)(`Value of task "${this.identifier}" is not able to stringify (JSON).`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
static getInstance(key, json, versionRange, dependentTasks = [], options = {}) {
|
|
27
|
+
const identifier = `package.json-reconfigure-${key}`;
|
|
28
|
+
if (!this.instances.has(identifier)) {
|
|
29
|
+
this.instances.set(identifier, new JsonTask(identifier, key, json, versionRange, dependentTasks, options));
|
|
30
|
+
}
|
|
31
|
+
return this.instances.get(identifier);
|
|
32
|
+
}
|
|
33
|
+
run() {
|
|
34
|
+
const configPath = path_1.default.join(process.cwd(), 'package.json');
|
|
35
|
+
if (fs_1.default.existsSync(configPath)) {
|
|
36
|
+
try {
|
|
37
|
+
const fileContent = (0, deepmerge_1.default)(JSON.parse(fs_1.default.readFileSync(configPath, 'utf8')), this.json);
|
|
38
|
+
fs_1.default.writeFileSync(configPath, JSON.stringify(fileContent, null, 2));
|
|
39
|
+
reuse_1.MODIFIED_FILES.add(configPath);
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
// empty
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.JsonTask = JsonTask;
|
|
@@ -26,8 +26,8 @@ class LabelExpertSlot extends abstract_task_1.AbstractTask {
|
|
|
26
26
|
// https://regex101.com/r/WkEKxu/1
|
|
27
27
|
this.componentRegExp = new RegExp(`(<${tagCapitalCase}[^>]*)>([^<]+(\\n\\s*)*)(<\\/${tagCapitalCase}>)`, 'g');
|
|
28
28
|
this.customElementRegExp = new RegExp(`(<${tag}[^>]*)>([^<]+(\\n\\s*)*)(<\\/${tag}>)`, 'g');
|
|
29
|
-
this.componentRegExp = new RegExp(`(<${tagCapitalCase}[^>]
|
|
30
|
-
this.customElementRegExp = new RegExp(`(<${tag}[^>]
|
|
29
|
+
this.componentRegExp = new RegExp(`(<${tagCapitalCase}[^>]*)>([^<>]+)(<\\/${tagCapitalCase}>)`, 'g');
|
|
30
|
+
this.customElementRegExp = new RegExp(`(<${tag}[^>]*)>([^<>]+)(<\\/${tag}>)`, 'g');
|
|
31
31
|
}
|
|
32
32
|
static getInstance(tag, property, versionRange, dependentTasks = [], options = {}) {
|
|
33
33
|
const identifier = `${tag}-move-innerText-to-property-${property}`;
|
|
@@ -46,6 +46,7 @@ class LabelExpertSlot extends abstract_task_1.AbstractTask {
|
|
|
46
46
|
const newContent = content
|
|
47
47
|
// Replacements
|
|
48
48
|
.replace(this.componentRegExp, removeLineBreaksAndSpaces)
|
|
49
|
+
// @todo: We could add a $ before all { inside the innerText ($2)
|
|
49
50
|
.replace(this.componentRegExp, `$1 ${this.propertyInCamelCase}={\`$2\`}/>`);
|
|
50
51
|
if (content !== newContent) {
|
|
51
52
|
reuse_1.MODIFIED_FILES.add(file);
|
|
@@ -59,6 +60,7 @@ class LabelExpertSlot extends abstract_task_1.AbstractTask {
|
|
|
59
60
|
const newContent = content
|
|
60
61
|
// Replacements
|
|
61
62
|
.replace(this.customElementRegExp, removeLineBreaksAndSpaces)
|
|
63
|
+
// @todo: We could add a $ before all { inside the innerText ($2)
|
|
62
64
|
.replace(this.customElementRegExp, `$1 ${this.property}={\`$2\`}/>`);
|
|
63
65
|
if (content !== newContent) {
|
|
64
66
|
reuse_1.MODIFIED_FILES.add(file);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MergeHtmlTask = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const reuse_1 = require("../../../shares/reuse");
|
|
9
|
+
const abstract_task_1 = require("../../abstract-task");
|
|
10
|
+
class MergeHtmlTask extends abstract_task_1.AbstractTask {
|
|
11
|
+
constructor(identifier, title, path, filename, html, versionRange, dependentTasks, options) {
|
|
12
|
+
super(identifier, title, [], versionRange, dependentTasks, options);
|
|
13
|
+
this.path = path;
|
|
14
|
+
this.filename = filename;
|
|
15
|
+
this.html = html;
|
|
16
|
+
}
|
|
17
|
+
static getInstance(key, path, filename, html, versionRange, dependentTasks = [], options = {}) {
|
|
18
|
+
const identifier = `merge-html-${key}-in-${filename}`;
|
|
19
|
+
const title = `Merge html (${key}) in ${filename}.`;
|
|
20
|
+
if (!this.instances.has(identifier)) {
|
|
21
|
+
this.instances.set(identifier, new MergeHtmlTask(identifier, title, path, filename, html, versionRange, dependentTasks, options));
|
|
22
|
+
}
|
|
23
|
+
return this.instances.get(identifier);
|
|
24
|
+
}
|
|
25
|
+
run() {
|
|
26
|
+
if (fs_1.default.existsSync(this.path)) {
|
|
27
|
+
const content = fs_1.default.readFileSync(this.path, 'utf8');
|
|
28
|
+
if (!content.includes(this.html)) {
|
|
29
|
+
fs_1.default.writeFileSync(this.path, content.replace(/(>)([^<]+<\/head>)/, `$1
|
|
30
|
+
${this.html}$2`));
|
|
31
|
+
reuse_1.MODIFIED_FILES.add(this.path);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.MergeHtmlTask = MergeHtmlTask;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NpmRcAddRuleTask = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const reuse_1 = require("../../../shares/reuse");
|
|
10
|
+
const abstract_task_1 = require("../../abstract-task");
|
|
11
|
+
class NpmRcAddRuleTask extends abstract_task_1.AbstractTask {
|
|
12
|
+
constructor(identifier, rule, versionRange, dependentTasks = [], options = {}) {
|
|
13
|
+
super(identifier, `Add the rule "${rule}" to the .npmrc of your project.`, [], versionRange, dependentTasks, options);
|
|
14
|
+
this.rule = rule;
|
|
15
|
+
if (typeof rule !== 'string') {
|
|
16
|
+
throw (0, reuse_1.logAndCreateError)(`Definition of task "${this.identifier}" is not a string.`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
static getInstance(rule, versionRange, dependentTasks = [], options = {}) {
|
|
20
|
+
const identifier = `.npmrc-add-rule-${rule}`;
|
|
21
|
+
if (!this.instances.has(identifier)) {
|
|
22
|
+
this.instances.set(identifier, new NpmRcAddRuleTask(identifier, rule, versionRange, dependentTasks, options));
|
|
23
|
+
}
|
|
24
|
+
return this.instances.get(identifier);
|
|
25
|
+
}
|
|
26
|
+
run() {
|
|
27
|
+
const npmrcPath = path_1.default.join(process.cwd(), '.npmrc');
|
|
28
|
+
const lineToAdd = this.rule.trim();
|
|
29
|
+
if (!fs_1.default.existsSync(npmrcPath)) {
|
|
30
|
+
fs_1.default.writeFileSync(npmrcPath, lineToAdd + '\n');
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const fileContent = fs_1.default.readFileSync(npmrcPath, 'utf8');
|
|
34
|
+
if (!fileContent.split('\n').includes(lineToAdd)) {
|
|
35
|
+
fs_1.default.appendFileSync(npmrcPath, '\n' + lineToAdd);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.NpmRcAddRuleTask = NpmRcAddRuleTask;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RemoveTask = void 0;
|
|
4
|
+
const ExecTask_1 = require("./ExecTask");
|
|
5
|
+
class RemoveTask extends ExecTask_1.ExecTask {
|
|
6
|
+
constructor(identifier, title, path, versionRange, dependentTasks, options) {
|
|
7
|
+
super(identifier, title, `npx rimraf "${path}"`, versionRange, dependentTasks, options);
|
|
8
|
+
}
|
|
9
|
+
static getInstance(path, versionRange, dependentTasks = [], options = {}) {
|
|
10
|
+
const identifier = `remove-${path}`;
|
|
11
|
+
const title = `Remove ${path}.`;
|
|
12
|
+
if (!this.instances.has(identifier)) {
|
|
13
|
+
this.instances.set(identifier, new RemoveTask(identifier, title, path, versionRange, dependentTasks, options));
|
|
14
|
+
}
|
|
15
|
+
return this.instances.get(identifier);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.RemoveTask = RemoveTask;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.TsConfigReconfigureTask = void 0;
|
|
7
|
+
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
4
10
|
const reuse_1 = require("../../../shares/reuse");
|
|
5
11
|
const abstract_task_1 = require("../../abstract-task");
|
|
6
12
|
class TsConfigReconfigureTask extends abstract_task_1.AbstractTask {
|
|
@@ -29,16 +35,17 @@ class TsConfigReconfigureTask extends abstract_task_1.AbstractTask {
|
|
|
29
35
|
/**
|
|
30
36
|
* The tsconfig.json shows an error, if we add `@public-ui/components` to the `types` property list.
|
|
31
37
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
const configPath = path_1.default.join(process.cwd(), 'tsconfig.json');
|
|
39
|
+
if (fs_1.default.existsSync(configPath)) {
|
|
40
|
+
try {
|
|
41
|
+
const fileContent = (0, deepmerge_1.default)(JSON.parse(fs_1.default.readFileSync(configPath, 'utf8')), this.config);
|
|
42
|
+
fs_1.default.writeFileSync(configPath, JSON.stringify(fileContent, null, 2));
|
|
43
|
+
reuse_1.MODIFIED_FILES.add(configPath);
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
// empty
|
|
47
|
+
}
|
|
48
|
+
}
|
|
42
49
|
}
|
|
43
50
|
}
|
|
44
51
|
exports.TsConfigReconfigureTask = TsConfigReconfigureTask;
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.commonTasks = void 0;
|
|
4
4
|
const GitIgnoreAddRuleTask_1 = require("./common/GitIgnoreAddRuleTask");
|
|
5
|
+
const NpmRcAddRuleTask_1 = require("./common/NpmRcAddRuleTask");
|
|
5
6
|
const TsConfigReconfigureTask_1 = require("./common/TsConfigReconfigureTask");
|
|
6
7
|
const VsCodeSettingsReconfigureTask_1 = require("./common/VsCodeSettingsReconfigureTask");
|
|
7
8
|
exports.commonTasks = [];
|
|
8
9
|
exports.commonTasks.push(GitIgnoreAddRuleTask_1.GitIgnoreAddRuleTask.getInstance('.kolibri.migrate.json', '*'));
|
|
10
|
+
exports.commonTasks.push(NpmRcAddRuleTask_1.NpmRcAddRuleTask.getInstance('save-exact=true', '*'));
|
|
9
11
|
exports.commonTasks.push(VsCodeSettingsReconfigureTask_1.VsCodeSettingsReconfigureTask.getInstance('html.customData', ['./node_modules/@public-ui/components/vscode-custom-data.json'], '*'));
|
|
10
|
-
|
|
12
|
+
// unused
|
|
13
|
+
TsConfigReconfigureTask_1.TsConfigReconfigureTask.getInstance('compilerOptions.types', {
|
|
11
14
|
compilerOptions: {
|
|
12
15
|
types: ['@public-ui/components'],
|
|
13
16
|
},
|
|
14
|
-
}, '*')
|
|
17
|
+
}, '*');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AbbrRenamePropertyTitleToLabel = void 0;
|
|
3
|
+
exports.AbbrRenamePropertyTitleToLabel = exports.AbbrRenamePropertyAlignToTooltipAlign = void 0;
|
|
4
4
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
|
+
exports.AbbrRenamePropertyAlignToTooltipAlign = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-abbr', '_align', '_tooltip-align', '^1');
|
|
5
6
|
exports.AbbrRenamePropertyTitleToLabel = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-abbr', '_title', '_label', '^1');
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAssetTasks = void 0;
|
|
4
|
+
const reuse_1 = require("../../../shares/reuse");
|
|
5
|
+
const ExecTask_1 = require("../common/ExecTask");
|
|
6
|
+
const HandleDependencyTask_1 = require("../common/HandleDependencyTask");
|
|
7
|
+
const JsonTask_1 = require("../common/JsonTask");
|
|
8
|
+
const MergeHtmlTask_1 = require("../common/MergeHtmlTask");
|
|
9
|
+
const RemoveTask_1 = require("../common/RemoveTask");
|
|
10
|
+
const getAssetTasks = (baseDir) => {
|
|
11
|
+
const assetTasks = [];
|
|
12
|
+
const indexHtml = (0, reuse_1.findIndexHtml)(baseDir);
|
|
13
|
+
if (indexHtml) {
|
|
14
|
+
const removeDeps = HandleDependencyTask_1.HandleDependencyTask.getInstance('remove', {}, {
|
|
15
|
+
'cpy-cli': '5.0.0',
|
|
16
|
+
rimraf: '3.0.2',
|
|
17
|
+
}, '^1');
|
|
18
|
+
const installDeps = HandleDependencyTask_1.HandleDependencyTask.getInstance('add', {}, {
|
|
19
|
+
'cpy-cli': '5.0.0',
|
|
20
|
+
rimraf: '3.0.2',
|
|
21
|
+
}, '^1', [removeDeps]);
|
|
22
|
+
const addScript = JsonTask_1.JsonTask.getInstance('scripts.postinstall', {
|
|
23
|
+
scripts: {
|
|
24
|
+
postinstall: `cpy "node_modules/@public-ui/components/assets/**/*" "${indexHtml}/assets" --dot`,
|
|
25
|
+
},
|
|
26
|
+
}, '^1', [installDeps]);
|
|
27
|
+
const htmlTask = MergeHtmlTask_1.MergeHtmlTask.getInstance('codicon', (0, reuse_1.resolveIndexHtmlPath)([indexHtml]), 'index.html', '<link rel="stylesheet" href="assets/codicons/codicon.css" />', '^1', [addScript]);
|
|
28
|
+
const removeTask = RemoveTask_1.RemoveTask.getInstance('public/assets/codicons', '^1', [htmlTask]);
|
|
29
|
+
const execTask = ExecTask_1.ExecTask.getInstance(`npx cpy "node_modules/@public-ui/components/assets/**/*" "${indexHtml}/assets" --dot`, '^1', [removeTask]);
|
|
30
|
+
assetTasks.push(execTask);
|
|
31
|
+
}
|
|
32
|
+
return assetTasks;
|
|
33
|
+
};
|
|
34
|
+
exports.getAssetTasks = getAssetTasks;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ButtonRenamePropertyIconOnlyToHideLabel = exports.ButtonRemovePropertyIconAlign = exports.ButtonRemovePropertyAriaLabel = exports.ButtonRemovePropertyAriaCurrent = void 0;
|
|
3
|
+
exports.ButtonRenamePropertyIconToIcons = exports.ButtonRenamePropertyIconOnlyToHideLabel = exports.ButtonRemovePropertyIconAlign = exports.ButtonRemovePropertyAriaLabel = exports.ButtonRemovePropertyAriaCurrent = void 0;
|
|
4
4
|
const RemovePropertyNameTask_1 = require("../common/RemovePropertyNameTask");
|
|
5
5
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
6
6
|
exports.ButtonRemovePropertyAriaCurrent = RemovePropertyNameTask_1.RemovePropertyNameTask.getInstance('kol-button', '_aria-current', '^1');
|
|
@@ -8,3 +8,4 @@ exports.ButtonRemovePropertyAriaLabel = RemovePropertyNameTask_1.RemovePropertyN
|
|
|
8
8
|
// @todo: handle _icon-align in _icon
|
|
9
9
|
exports.ButtonRemovePropertyIconAlign = RemovePropertyNameTask_1.RemovePropertyNameTask.getInstance('kol-button', '_icon-align', '^1');
|
|
10
10
|
exports.ButtonRenamePropertyIconOnlyToHideLabel = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-button', '_icon-only', '_hide-label', '^1');
|
|
11
|
+
exports.ButtonRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-button', '_icon', '_icons', '^1');
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IconRemovePropertyPart = exports.IconRenamePropertyAriaLabelToLabel = void 0;
|
|
3
|
+
exports.IconRenamePropertyIconToIcons = exports.IconRemovePropertyPart = exports.IconRenamePropertyAriaLabelToLabel = void 0;
|
|
4
4
|
const RemovePropertyNameTask_1 = require("../common/RemovePropertyNameTask");
|
|
5
5
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
6
6
|
exports.IconRenamePropertyAriaLabelToLabel = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-icon', '_aria-label', '_label', '^1');
|
|
7
7
|
exports.IconRemovePropertyPart = RemovePropertyNameTask_1.RemovePropertyNameTask.getInstance('kol-icon', '_part', '^1');
|
|
8
|
+
exports.IconRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-icon', '_icon', '_icons', '^1');
|
|
@@ -14,11 +14,14 @@ const button_link_1 = require("./button-link");
|
|
|
14
14
|
const card_1 = require("./card");
|
|
15
15
|
const details_1 = require("./details");
|
|
16
16
|
const icon_1 = require("./icon");
|
|
17
|
+
const input_1 = require("./input");
|
|
17
18
|
const input_checkbox_1 = require("./input-checkbox");
|
|
18
19
|
const input_color_1 = require("./input-color");
|
|
19
20
|
const input_date_1 = require("./input-date");
|
|
20
21
|
const input_email_1 = require("./input-email");
|
|
22
|
+
const input_file_1 = require("./input-file");
|
|
21
23
|
const input_number_1 = require("./input-number");
|
|
24
|
+
const input_password_1 = require("./input-password");
|
|
22
25
|
const input_radio_1 = require("./input-radio");
|
|
23
26
|
const input_range_1 = require("./input-range");
|
|
24
27
|
const input_text_1 = require("./input-text");
|
|
@@ -40,6 +43,7 @@ const tabs_1 = require("./tabs");
|
|
|
40
43
|
const toast_1 = require("./toast");
|
|
41
44
|
const version_1 = require("./version");
|
|
42
45
|
exports.v1Tasks = [];
|
|
46
|
+
exports.v1Tasks.push(abbr_1.AbbrRenamePropertyAlignToTooltipAlign);
|
|
43
47
|
exports.v1Tasks.push(abbr_1.AbbrRenamePropertyTitleToLabel);
|
|
44
48
|
exports.v1Tasks.push(accordion_1.AccordionRenamePropertyHeadingToLabel);
|
|
45
49
|
exports.v1Tasks.push(badge_1.BadgeRemovePropertyHideLabel);
|
|
@@ -53,59 +57,74 @@ exports.v1Tasks.push(button_1.ButtonRemovePropertyAriaCurrent);
|
|
|
53
57
|
exports.v1Tasks.push(button_1.ButtonRemovePropertyAriaLabel);
|
|
54
58
|
exports.v1Tasks.push(button_1.ButtonRemovePropertyIconAlign);
|
|
55
59
|
exports.v1Tasks.push(button_1.ButtonRenamePropertyIconOnlyToHideLabel);
|
|
60
|
+
exports.v1Tasks.push(button_1.ButtonRenamePropertyIconToIcons);
|
|
56
61
|
exports.v1Tasks.push(card_1.CardRenamePropertyHeadingToLabel);
|
|
57
62
|
exports.v1Tasks.push(card_1.CardRenamePropertyHeadlineToLabel);
|
|
58
63
|
exports.v1Tasks.push(details_1.DetailsRenamePropertySummaryToLabel);
|
|
59
64
|
exports.v1Tasks.push(icon_1.IconRemovePropertyPart);
|
|
60
65
|
exports.v1Tasks.push(icon_1.IconRenamePropertyAriaLabelToLabel);
|
|
66
|
+
exports.v1Tasks.push(icon_1.IconRenamePropertyIconToIcons);
|
|
67
|
+
exports.v1Tasks.push(input_checkbox_1.InputCheckboxRenamePropertyIconToIcons);
|
|
61
68
|
exports.v1Tasks.push(input_checkbox_1.InputCheckboxRenamePropertyTypeToVariant);
|
|
69
|
+
exports.v1Tasks.push(input_color_1.InputColorRenamePropertyIconToIcons);
|
|
62
70
|
exports.v1Tasks.push(input_color_1.InputColorRenamePropertyListToSuggestions);
|
|
71
|
+
exports.v1Tasks.push(input_date_1.InputDateRenamePropertyIconToIcons);
|
|
63
72
|
exports.v1Tasks.push(input_date_1.InputDateRenamePropertyListToSuggestions);
|
|
73
|
+
exports.v1Tasks.push(input_email_1.InputEmailRenamePropertyIconToIcons);
|
|
64
74
|
exports.v1Tasks.push(input_email_1.InputEmailRenamePropertyListToSuggestions);
|
|
75
|
+
exports.v1Tasks.push(input_file_1.InputFileRenamePropertyIconToIcons);
|
|
76
|
+
exports.v1Tasks.push(input_number_1.InputNumberRenamePropertyIconToIcons);
|
|
65
77
|
exports.v1Tasks.push(input_number_1.InputNumberRenamePropertyListToSuggestions);
|
|
78
|
+
exports.v1Tasks.push(input_password_1.InputPasswordRenamePropertyIconToIcons);
|
|
66
79
|
exports.v1Tasks.push(input_radio_1.InputRadioRenamePropertyListToSuggestions);
|
|
80
|
+
exports.v1Tasks.push(input_range_1.InputRangeRenamePropertyIconToIcons);
|
|
67
81
|
exports.v1Tasks.push(input_range_1.InputRangeRenamePropertyListToSuggestions);
|
|
82
|
+
exports.v1Tasks.push(input_1.InputRenamePropertyIconToIcons);
|
|
83
|
+
exports.v1Tasks.push(input_text_1.InputTextRenamePropertyIconToIcons);
|
|
68
84
|
exports.v1Tasks.push(input_text_1.InputTextRenamePropertyListToSuggestions);
|
|
69
85
|
exports.v1Tasks.push(link_button_1.LinkButtonRemovePropertyAriaControl);
|
|
70
|
-
exports.v1Tasks.push(link_button_1.LinkButtonRenamePropertyAriaCurrentToListenAriaCurrent);
|
|
71
86
|
exports.v1Tasks.push(link_button_1.LinkButtonRemovePropertyAriaExpanded);
|
|
72
87
|
exports.v1Tasks.push(link_button_1.LinkButtonRemovePropertyAriaLabel);
|
|
73
88
|
exports.v1Tasks.push(link_button_1.LinkButtonRemovePropertyAriaSelected);
|
|
74
89
|
exports.v1Tasks.push(link_button_1.LinkButtonRemovePropertyDisabled);
|
|
90
|
+
exports.v1Tasks.push(link_button_1.LinkButtonRenamePropertyAriaCurrentToListenAriaCurrent);
|
|
75
91
|
exports.v1Tasks.push(link_button_1.LinkButtonRenamePropertyIconOnlyToHideLabel);
|
|
92
|
+
exports.v1Tasks.push(link_group_1.LinkGroupRemovePropertyHeading);
|
|
93
|
+
exports.v1Tasks.push(link_group_1.LinkGroupRemovePropertyOrdered);
|
|
94
|
+
exports.v1Tasks.push(link_group_1.LinkGroupRenamePropertyAriaLabelToLabel);
|
|
95
|
+
exports.v1Tasks.push(link_group_1.LinkGroupRenamePropertyHeadingToLabel);
|
|
76
96
|
exports.v1Tasks.push(link_1.LinkRemovePropertyAriaControl);
|
|
77
|
-
exports.v1Tasks.push(link_1.LinkRenamePropertyAriaCurrentToListenAriaCurrent);
|
|
78
97
|
exports.v1Tasks.push(link_1.LinkRemovePropertyAriaExpanded);
|
|
79
98
|
exports.v1Tasks.push(link_1.LinkRemovePropertyAriaLabel);
|
|
80
99
|
exports.v1Tasks.push(link_1.LinkRemovePropertyAriaSelected);
|
|
81
100
|
exports.v1Tasks.push(link_1.LinkRemovePropertyDisabled);
|
|
82
101
|
exports.v1Tasks.push(link_1.LinkRemovePropertyIconAlign);
|
|
83
|
-
exports.v1Tasks.push(link_1.LinkRenamePropertyIconOnlyToHideLabel);
|
|
84
102
|
exports.v1Tasks.push(link_1.LinkRemovePropertySelector);
|
|
85
103
|
exports.v1Tasks.push(link_1.LinkRemovePropertyStealth);
|
|
86
104
|
exports.v1Tasks.push(link_1.LinkRemovePropertyUseCase);
|
|
105
|
+
exports.v1Tasks.push(link_1.LinkRenamePropertyAriaCurrentToListenAriaCurrent);
|
|
106
|
+
exports.v1Tasks.push(link_1.LinkRenamePropertyIconOnlyToHideLabel);
|
|
87
107
|
exports.v1Tasks.push(logo_1.LogoRenamePropertyAbbrToOrg);
|
|
88
|
-
exports.v1Tasks.push(link_group_1.LinkGroupRenamePropertyAriaLabelToLabel);
|
|
89
|
-
exports.v1Tasks.push(link_group_1.LinkGroupRenamePropertyHeadingToLabel);
|
|
90
|
-
exports.v1Tasks.push(link_group_1.LinkGroupRemovePropertyHeading);
|
|
91
|
-
exports.v1Tasks.push(link_group_1.LinkGroupRemovePropertyOrdered);
|
|
92
108
|
exports.v1Tasks.push(modal_1.ModalRenamePropertyAriaLabelToLabel);
|
|
93
|
-
|
|
94
|
-
exports.v1Tasks.push(nav_1.NavRenamePropertyCompactToHideLabel);
|
|
95
|
-
exports.v1Tasks.push(nav_1.NavRemovePropertyHasCompactButton);
|
|
109
|
+
// v1Tasks.push(NavRemovePropertyHasCompactButton);
|
|
96
110
|
exports.v1Tasks.push(nav_1.NavRemovePropertyVariant);
|
|
111
|
+
exports.v1Tasks.push(nav_1.NavRenamePropertyAriaLabelToLabel);
|
|
97
112
|
exports.v1Tasks.push(nav_1.NavRenamePropertyCompactToHideLabel);
|
|
98
113
|
exports.v1Tasks.push(pagination_1.PaginationRenamePropertyCountToTotal);
|
|
114
|
+
exports.v1Tasks.push(pagination_1.PaginationRenamePropertyTotalToMax);
|
|
99
115
|
exports.v1Tasks.push(progress_1.ProgressRenamePropertyTypeToVariant);
|
|
100
116
|
exports.v1Tasks.push(quote_1.QuoteRenamePropertyCaptionToLabel);
|
|
101
117
|
exports.v1Tasks.push(select_1.SelectRenamePropertyHeightToRows);
|
|
118
|
+
exports.v1Tasks.push(select_1.SelectRenamePropertyIconToIcons);
|
|
102
119
|
exports.v1Tasks.push(select_1.SelectRenamePropertyListToOptions);
|
|
103
120
|
exports.v1Tasks.push(skip_nav_1.SkipNavButtonRenamePropertyAriaLabelToLabel);
|
|
104
121
|
exports.v1Tasks.push(span_1.SpanRenamePropertyIconOnlyToHideLabel);
|
|
122
|
+
exports.v1Tasks.push(span_1.SpanRenamePropertyIconToIcons);
|
|
105
123
|
exports.v1Tasks.push(split_button_1.SplitButtonRemovePropertyAriaLabel);
|
|
106
124
|
exports.v1Tasks.push(split_button_1.SplitButtonRenamePropertyShowDropdownToShow);
|
|
107
125
|
exports.v1Tasks.push(table_1.TableRenamePropertyCaptionToLabel);
|
|
108
126
|
exports.v1Tasks.push(tabs_1.TabsRenamePropertyAriaLabelToLabel);
|
|
127
|
+
exports.v1Tasks.push(tabs_1.TabsRenamePropertyIconToIcons);
|
|
109
128
|
exports.v1Tasks.push(tabs_1.TabsRenamePropertyTabAlignToAlign);
|
|
110
129
|
exports.v1Tasks.push(toast_1.ToastRemovePropertyNameShowDuration);
|
|
111
130
|
exports.v1Tasks.push(toast_1.ToastRenamePropertyHeadingToLabel);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InputCheckboxRenamePropertyTypeToVariant = void 0;
|
|
3
|
+
exports.InputCheckboxRenamePropertyIconToIcons = exports.InputCheckboxRenamePropertyTypeToVariant = void 0;
|
|
4
4
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
5
|
exports.InputCheckboxRenamePropertyTypeToVariant = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-checkbox', '_type', '_variant', '^1');
|
|
6
|
+
exports.InputCheckboxRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-input-checkbox', '_icon', '_icons', '^1');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InputColorRenamePropertyListToSuggestions = void 0;
|
|
3
|
+
exports.InputColorRenamePropertyIconToIcons = exports.InputColorRenamePropertyListToSuggestions = void 0;
|
|
4
4
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
5
|
exports.InputColorRenamePropertyListToSuggestions = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-color', '_list', '_suggestions', '^1');
|
|
6
|
+
exports.InputColorRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-color', '_icon', '_icons', '^1');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InputDateRenamePropertyListToSuggestions = void 0;
|
|
3
|
+
exports.InputDateRenamePropertyIconToIcons = exports.InputDateRenamePropertyListToSuggestions = void 0;
|
|
4
4
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
5
|
exports.InputDateRenamePropertyListToSuggestions = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-date', '_list', '_suggestions', '^1');
|
|
6
|
+
exports.InputDateRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-input-date', '_icon', '_icons', '^1');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InputEmailRenamePropertyListToSuggestions = void 0;
|
|
3
|
+
exports.InputEmailRenamePropertyIconToIcons = exports.InputEmailRenamePropertyListToSuggestions = void 0;
|
|
4
4
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
5
|
exports.InputEmailRenamePropertyListToSuggestions = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-input-email', '_list', '_suggestions', '^1');
|
|
6
|
+
exports.InputEmailRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-input-email', '_icon', '_icons', '^1');
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InputFileRenamePropertyIconToIcons = void 0;
|
|
4
|
+
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
|
+
exports.InputFileRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-input-file', '_icon', '_icons', '^1');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InputNumberRenamePropertyListToSuggestions = void 0;
|
|
3
|
+
exports.InputNumberRenamePropertyIconToIcons = exports.InputNumberRenamePropertyListToSuggestions = void 0;
|
|
4
4
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
5
|
exports.InputNumberRenamePropertyListToSuggestions = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-input-number', '_list', '_suggestions', '^1');
|
|
6
6
|
// @todo export const InputNumberRemovePropertyType = RemovePropertyNameTask.getInstance('kol-input-number', '_type', '^1');
|
|
7
|
+
exports.InputNumberRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-input-number', '_icon', '_icons', '^1');
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InputPasswordRenamePropertyIconToIcons = void 0;
|
|
4
|
+
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
|
+
exports.InputPasswordRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-input-password', '_icon', '_icons', '^1');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InputRangeRenamePropertyListToSuggestions = void 0;
|
|
3
|
+
exports.InputRangeRenamePropertyIconToIcons = exports.InputRangeRenamePropertyListToSuggestions = void 0;
|
|
4
4
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
5
|
exports.InputRangeRenamePropertyListToSuggestions = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-input-range', '_list', '_suggestions', '^1');
|
|
6
|
+
exports.InputRangeRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-input-range', '_icon', '_icons', '^1');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InputTextRenamePropertyListToSuggestions = void 0;
|
|
3
|
+
exports.InputTextRenamePropertyIconToIcons = exports.InputTextRenamePropertyListToSuggestions = void 0;
|
|
4
4
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
5
|
exports.InputTextRenamePropertyListToSuggestions = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-input-text', '_list', '_suggestions', '^1');
|
|
6
|
+
exports.InputTextRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-input-text', '_icon', '_icons', '^1');
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InputRenamePropertyIconToIcons = void 0;
|
|
4
|
+
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
|
+
exports.InputRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-input', '_icon', '_icons', '^1');
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NavRemovePropertyVariant = exports.
|
|
3
|
+
exports.NavRemovePropertyVariant = exports.NavRenamePropertyCompactToHideLabel = exports.NavRenamePropertyAriaLabelToLabel = void 0;
|
|
4
4
|
const RemovePropertyNameTask_1 = require("../common/RemovePropertyNameTask");
|
|
5
5
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
6
6
|
exports.NavRenamePropertyAriaLabelToLabel = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-nav', '_aria-label', '_label', '^1');
|
|
7
7
|
exports.NavRenamePropertyCompactToHideLabel = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-nav', '_compact', '_hide-label', '^1');
|
|
8
|
-
|
|
8
|
+
// export const NavRemovePropertyHasCompactButton = RemovePropertyNameTask.getInstance('kol-nav', '_has-compact-button', '^1');
|
|
9
|
+
RemovePropertyNameTask_1.RemovePropertyNameTask.getInstance('kol-nav', '_has-compact-button', '^1');
|
|
9
10
|
exports.NavRemovePropertyVariant = RemovePropertyNameTask_1.RemovePropertyNameTask.getInstance('kol-nav', '_variant', '^1');
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PaginationRenamePropertyCountToTotal = void 0;
|
|
3
|
+
exports.PaginationRenamePropertyTotalToMax = exports.PaginationRenamePropertyCountToTotal = void 0;
|
|
4
4
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
5
|
exports.PaginationRenamePropertyCountToTotal = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-pagination', '_count', '_total', '^1');
|
|
6
|
+
exports.PaginationRenamePropertyTotalToMax = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-pagination', '_total', '_max', '^1', [
|
|
7
|
+
exports.PaginationRenamePropertyCountToTotal,
|
|
8
|
+
]);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SelectRenamePropertyListToOptions = exports.SelectRenamePropertyHeightToRows = void 0;
|
|
3
|
+
exports.SelectRenamePropertyIconToIcons = exports.SelectRenamePropertyListToOptions = exports.SelectRenamePropertyHeightToRows = void 0;
|
|
4
4
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
5
|
exports.SelectRenamePropertyHeightToRows = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-select', '_height', '_rows', '^1');
|
|
6
6
|
exports.SelectRenamePropertyListToOptions = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-select', '_list', '_options', '^1');
|
|
7
|
+
exports.SelectRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-select', '_icon', '_icons', '^1');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SpanRenamePropertyIconOnlyToHideLabel = void 0;
|
|
3
|
+
exports.SpanRenamePropertyIconToIcons = exports.SpanRenamePropertyIconOnlyToHideLabel = void 0;
|
|
4
4
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
5
|
exports.SpanRenamePropertyIconOnlyToHideLabel = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-span', '_icon-only', '_hide-label', '^1');
|
|
6
|
+
exports.SpanRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-span', '_icon', '_icons', '^1');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TabsRenamePropertyTabAlignToAlign = exports.TabsRenamePropertyAriaLabelToLabel = void 0;
|
|
3
|
+
exports.TabsRenamePropertyIconToIcons = exports.TabsRenamePropertyTabAlignToAlign = exports.TabsRenamePropertyAriaLabelToLabel = void 0;
|
|
4
4
|
const RenamePropertyNameTask_1 = require("../common/RenamePropertyNameTask");
|
|
5
5
|
exports.TabsRenamePropertyAriaLabelToLabel = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-tabs', '_aria-label', '_label', '^1');
|
|
6
6
|
exports.TabsRenamePropertyTabAlignToAlign = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-tabs', '_tab-align', '_align', '^1');
|
|
7
|
+
exports.TabsRenamePropertyIconToIcons = RenamePropertyNameTask_1.RenamePropertyNameTask.getInstance('kol-tabs', '_icon', '_icons', '^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.kebabToCamelCase = exports.kebabToCapitalCase = exports.isPropertyKebabCaseRegExp = exports.isTagKebabCaseRegExp = exports.isKebabCaseRegExp = exports.
|
|
6
|
+
exports.findIndexHtml = exports.resolveIndexHtmlPath = exports.getVersionOfPublicUiKoliBriCli = exports.getVersionOfPublicUiComponents = exports.getContentOfProjectPkgJson = exports.getRemoveMode = exports.setRemoveMode = exports.MODIFIED_FILES = exports.kebabToCamelCase = exports.kebabToCapitalCase = exports.isPropertyKebabCaseRegExp = exports.isTagKebabCaseRegExp = exports.isKebabCaseRegExp = exports.getPackageManagerCommand = 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"));
|
|
@@ -80,23 +80,24 @@ function readPackageJson(offsetPath) {
|
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* This function is used to get the package manager install command.
|
|
83
|
+
* @param {PackageManagerCommand} command The package manager command
|
|
83
84
|
* @param {string} baseDir The base directory to start searching for the package manager
|
|
84
85
|
* @returns {string} The package manager install command
|
|
85
86
|
*/
|
|
86
|
-
function
|
|
87
|
+
function getPackageManagerCommand(command, baseDir = process.cwd()) {
|
|
87
88
|
if (fs_1.default.existsSync(path_1.default.resolve(baseDir, 'pnpm-lock.yaml')))
|
|
88
|
-
return
|
|
89
|
+
return `pnpm ${command}`;
|
|
89
90
|
if (fs_1.default.existsSync(path_1.default.resolve(baseDir, 'yarn.lock')))
|
|
90
|
-
return
|
|
91
|
+
return `yarn ${command}`;
|
|
91
92
|
if (fs_1.default.existsSync(path_1.default.resolve(baseDir, 'package-lock.json')))
|
|
92
|
-
return
|
|
93
|
+
return `npm ${command}`;
|
|
93
94
|
baseDir = path_1.default.resolve(baseDir, '..');
|
|
94
95
|
if (baseDir === '/') {
|
|
95
96
|
throw logAndCreateError('Package manager could not detected.');
|
|
96
97
|
}
|
|
97
|
-
return
|
|
98
|
+
return getPackageManagerCommand(command, baseDir);
|
|
98
99
|
}
|
|
99
|
-
exports.
|
|
100
|
+
exports.getPackageManagerCommand = getPackageManagerCommand;
|
|
100
101
|
exports.isKebabCaseRegExp = /^((data-removed-)?[a-z]+(-[a-z]+)*)?$/;
|
|
101
102
|
exports.isTagKebabCaseRegExp = /^kol-[a-z]+(-[a-z]+)*$/;
|
|
102
103
|
exports.isPropertyKebabCaseRegExp = /^(data-removed-)?_[a-z]+(-[a-z]+)*$/;
|
|
@@ -169,3 +170,15 @@ const getVersionOfPublicUiKoliBriCli = () => {
|
|
|
169
170
|
}
|
|
170
171
|
};
|
|
171
172
|
exports.getVersionOfPublicUiKoliBriCli = getVersionOfPublicUiKoliBriCli;
|
|
173
|
+
const INDEX_HTML_LOCATIONS = ['./', 'public'];
|
|
174
|
+
const resolvePath = (paths, offset = process.cwd()) => path_1.default.resolve(offset, ...paths);
|
|
175
|
+
const resolveIndexHtmlPath = (paths) => resolvePath([...paths, 'index.html']);
|
|
176
|
+
exports.resolveIndexHtmlPath = resolveIndexHtmlPath;
|
|
177
|
+
const existsIndexHtml = (location) => fs_1.default.existsSync((0, exports.resolveIndexHtmlPath)([location]));
|
|
178
|
+
const findIndexHtml = (baseDir) => {
|
|
179
|
+
if (existsIndexHtml(baseDir)) {
|
|
180
|
+
return baseDir;
|
|
181
|
+
}
|
|
182
|
+
return INDEX_HTML_LOCATIONS.find(existsIndexHtml);
|
|
183
|
+
};
|
|
184
|
+
exports.findIndexHtml = findIndexHtml;
|
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.17",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"homepage": "https://public-ui.github.io",
|
|
6
6
|
"repository": "https://github.com/public-ui/kolibri",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"semver": "7.5.4"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@public-ui/components": "1.7.0-rc.
|
|
30
|
+
"@public-ui/components": "1.7.0-rc.17",
|
|
31
31
|
"@types/gradient-string": "1.1.3",
|
|
32
|
-
"@types/node": "20.
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "6.7.
|
|
34
|
-
"@typescript-eslint/parser": "6.7.
|
|
32
|
+
"@types/node": "20.7.1",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "6.7.3",
|
|
34
|
+
"@typescript-eslint/parser": "6.7.3",
|
|
35
35
|
"cpy-cli": "5.0.0",
|
|
36
36
|
"depcheck": "1.4.6",
|
|
37
37
|
"eslint": "8.50.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"eslint-plugin-jsx-a11y": "6.7.1",
|
|
43
43
|
"eslint-plugin-no-loops": "0.3.0",
|
|
44
44
|
"eslint-plugin-react": "7.33.2",
|
|
45
|
-
"knip": "2.
|
|
45
|
+
"knip": "2.30.0",
|
|
46
46
|
"mocha": "10.2.0",
|
|
47
47
|
"nodemon": "3.0.1",
|
|
48
48
|
"rimraf": "3.0.2",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"depcheck": "depcheck --ignores=\"@public-ui/components,deepmerge,loglevel,mocha\"",
|
|
58
58
|
"format": "prettier -c src",
|
|
59
59
|
"lint": "eslint src && tsc --noEmit",
|
|
60
|
-
"start": "rimraf test && cpy \"../../samples/react/src/components\" test && ts-node src/index.ts migrate --ignore-uncommitted-changes --test-tasks test",
|
|
60
|
+
"start": "rimraf test && cpy \"../../samples/react/src/components\" test/src && cpy \"../../samples/react/public/*.html\" test/ && ts-node src/index.ts migrate --ignore-uncommitted-changes --test-tasks test",
|
|
61
61
|
"restart": "pnpm reset && pnpm start",
|
|
62
62
|
"unused": "knip",
|
|
63
63
|
"watch": "nodemon --ignore package.json src/index.ts migrate --ignore-uncommitted-changes --test-tasks test"
|