@public-ui/kolibri-cli 4.2.1 → 4.3.0-rc.0
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.
|
@@ -19,8 +19,10 @@ const MIN_VERSION_OF_PUBLIC_UI = '1.4.2';
|
|
|
19
19
|
*/
|
|
20
20
|
function displayProgressBar(current, total, title = '') {
|
|
21
21
|
const barLength = 30;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
// Clamp to 100 % so the bar stays valid even if the counter overshoots `total`
|
|
23
|
+
// (e.g. when tasks are revisited during iteration). Prevents `String.repeat(-1)`.
|
|
24
|
+
const percentage = total === 0 ? 0 : Math.min(100, (current / total) * 100);
|
|
25
|
+
const filledLength = total === 0 ? 0 : Math.min(barLength, Math.round((barLength * current) / total));
|
|
24
26
|
const emptyLength = barLength - filledLength;
|
|
25
27
|
const bar = chalk_1.default.green('█'.repeat(filledLength)) + chalk_1.default.gray('░'.repeat(emptyLength));
|
|
26
28
|
const percentStr = percentage.toFixed(0).padStart(3, ' ');
|
|
@@ -140,10 +142,18 @@ class TaskRunner {
|
|
|
140
142
|
taskDependencies.forEach((dependentTask) => {
|
|
141
143
|
this.dependentTaskRun(dependentTask, dependentTask.getTaskDependencies());
|
|
142
144
|
});
|
|
143
|
-
|
|
145
|
+
// A dependency that is excluded for the current version range ends up as `'skipped'`.
|
|
146
|
+
// Such dependencies must not block an otherwise applicable dependent task from running.
|
|
147
|
+
if (taskDependencies.length === 0 || taskDependencies.every((dependentTask) => ['done', 'skipped'].includes(dependentTask.getStatus()))) {
|
|
144
148
|
displayProgressBar(this.completedTasks, this.tasks.size, task.getTitle());
|
|
149
|
+
// Only count a task once and only if it is actually part of the progress total:
|
|
150
|
+
// tasks revisited by `Map.forEach`, or dependencies excluded from `this.tasks`,
|
|
151
|
+
// would otherwise push `completedTasks` past `tasks.size`.
|
|
152
|
+
const wasPending = task.getStatus() === 'pending';
|
|
145
153
|
this.runTask(task);
|
|
146
|
-
this.
|
|
154
|
+
if (wasPending && this.tasks.has(task.getIdentifier())) {
|
|
155
|
+
this.completedTasks++;
|
|
156
|
+
}
|
|
147
157
|
}
|
|
148
158
|
}
|
|
149
159
|
run() {
|
|
@@ -32,7 +32,10 @@ class GitIgnoreAddRuleTask extends abstract_task_1.AbstractTask {
|
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
34
|
const fileContent = fs_1.default.readFileSync(gitignorePath, 'utf8');
|
|
35
|
-
if (!fileContent
|
|
35
|
+
if (!fileContent
|
|
36
|
+
.split(/\r?\n/)
|
|
37
|
+
.map((l) => l.trimEnd())
|
|
38
|
+
.includes(lineToAdd)) {
|
|
36
39
|
fs_1.default.appendFileSync(gitignorePath, '\n' + lineToAdd);
|
|
37
40
|
}
|
|
38
41
|
}
|
|
@@ -6,7 +6,7 @@ const NpmRcAddRuleTask_1 = require("./common/NpmRcAddRuleTask");
|
|
|
6
6
|
const TsConfigReconfigureTask_1 = require("./common/TsConfigReconfigureTask");
|
|
7
7
|
const VsCodeSettingsReconfigureTask_1 = require("./common/VsCodeSettingsReconfigureTask");
|
|
8
8
|
exports.commonTasks = [];
|
|
9
|
-
exports.commonTasks.push(GitIgnoreAddRuleTask_1.GitIgnoreAddRuleTask.getInstance('.kolibri.
|
|
9
|
+
exports.commonTasks.push(GitIgnoreAddRuleTask_1.GitIgnoreAddRuleTask.getInstance('.kolibri.config.json', '*'));
|
|
10
10
|
exports.commonTasks.push(NpmRcAddRuleTask_1.NpmRcAddRuleTask.getInstance('save-exact=true', '*'));
|
|
11
11
|
exports.commonTasks.push(VsCodeSettingsReconfigureTask_1.VsCodeSettingsReconfigureTask.getInstance('html.customData', ['./node_modules/@public-ui/components/vscode-custom-data.json'], '*'));
|
|
12
12
|
// unused
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/kolibri-cli",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0-rc.0",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"homepage": "https://public-ui.github.io",
|
|
6
6
|
"repository": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
31
31
|
"semver": "7.8.1",
|
|
32
32
|
"typed-bem": "1.0.2",
|
|
33
|
-
"@public-ui/components": "4.
|
|
33
|
+
"@public-ui/components": "4.3.0-rc.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@eslint/js": "9.39.4",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"eslint": "9.39.4",
|
|
43
43
|
"eslint-plugin-html": "8.1.4",
|
|
44
44
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
45
|
-
"knip": "6.
|
|
45
|
+
"knip": "6.15.0",
|
|
46
46
|
"mocha": "11.7.6",
|
|
47
47
|
"nodemon": "3.1.14",
|
|
48
48
|
"ts-node": "10.9.2",
|
|
49
49
|
"typescript": "5.9.3",
|
|
50
|
-
"@public-ui/components": "4.
|
|
50
|
+
"@public-ui/components": "4.3.0-rc.0"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=22"
|