@public-ui/kolibri-cli 4.0.0-alpha.5 → 4.0.0-alpha.7
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.
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.v4Tasks = void 0;
|
|
4
4
|
const id_1 = require("./id");
|
|
5
|
+
const loader_1 = require("./loader");
|
|
5
6
|
const msg_1 = require("./msg");
|
|
6
7
|
const toast_1 = require("./toast");
|
|
7
8
|
const toaster_1 = require("./toaster");
|
|
@@ -10,3 +11,4 @@ exports.v4Tasks.push(...id_1.RemoveIdPropTasks);
|
|
|
10
11
|
exports.v4Tasks.push(...msg_1.RemoveMsgPropsTasks);
|
|
11
12
|
exports.v4Tasks.push(toast_1.RemoveToastVariantTask.getInstance('^4'));
|
|
12
13
|
exports.v4Tasks.push(toaster_1.RemoveToasterGetInstanceOptionsTask.getInstance('^4'));
|
|
14
|
+
exports.v4Tasks.push(loader_1.UpdateLoaderImportPathTask.getInstance('^4'));
|
|
@@ -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.UpdateLoaderImportPathTask = 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
|
+
const LOADER_FILE_EXTENSIONS = ['js', 'jsx', 'ts', 'tsx', 'vue'];
|
|
11
|
+
class UpdateLoaderImportPathTask extends abstract_task_1.AbstractTask {
|
|
12
|
+
constructor(identifier, versionRange, dependentTasks, options) {
|
|
13
|
+
super(identifier, 'Update loader imports to @public-ui/components/loader', LOADER_FILE_EXTENSIONS, versionRange, dependentTasks, options);
|
|
14
|
+
}
|
|
15
|
+
static getInstance(versionRange, dependentTasks = [], options = {}) {
|
|
16
|
+
const identifier = `update-loader-import-path-${versionRange}`;
|
|
17
|
+
if (!this.instances.has(identifier)) {
|
|
18
|
+
this.instances.set(identifier, new UpdateLoaderImportPathTask(identifier, versionRange, dependentTasks, options));
|
|
19
|
+
}
|
|
20
|
+
return this.instances.get(identifier);
|
|
21
|
+
}
|
|
22
|
+
run(baseDir) {
|
|
23
|
+
this.transpileFiles(baseDir);
|
|
24
|
+
}
|
|
25
|
+
transpileFiles(baseDir) {
|
|
26
|
+
(0, reuse_1.filterFilesByExt)(baseDir, LOADER_FILE_EXTENSIONS).forEach((file) => {
|
|
27
|
+
const content = fs_1.default.readFileSync(file, 'utf8');
|
|
28
|
+
const newContent = content.replace(/@public-ui\/components\/dist\/loader/g, '@public-ui/components/loader');
|
|
29
|
+
if (newContent !== content) {
|
|
30
|
+
reuse_1.MODIFIED_FILES.add(file);
|
|
31
|
+
fs_1.default.writeFileSync(file, newContent);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.UpdateLoaderImportPathTask = UpdateLoaderImportPathTask;
|
|
@@ -177,7 +177,10 @@ function setRemoveMode(mode) {
|
|
|
177
177
|
REMOVE_MODE = mode;
|
|
178
178
|
}
|
|
179
179
|
/**
|
|
180
|
-
* Gets the remove mode
|
|
180
|
+
* Gets the current remove mode chosen via the CLI flag `--remove-mode`.
|
|
181
|
+
* - `prefix` (default) renames removed properties to `data-removed-<property>` so that developers can
|
|
182
|
+
* clean them up manually after the migration.
|
|
183
|
+
* - `delete` removes the properties entirely during migration.
|
|
181
184
|
* @returns {RemoveMode} The remove mode
|
|
182
185
|
*/
|
|
183
186
|
function getRemoveMode() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/kolibri-cli",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.7",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"homepage": "https://public-ui.github.io",
|
|
6
6
|
"repository": {
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
"type": "commonjs",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"chalk": "5.6.2",
|
|
25
|
-
"commander": "14.0.
|
|
25
|
+
"commander": "14.0.2",
|
|
26
26
|
"deepmerge": "4.3.1",
|
|
27
27
|
"gradient-string": "3.0.0",
|
|
28
28
|
"loglevel": "1.9.2",
|
|
29
|
-
"prettier": "3.
|
|
29
|
+
"prettier": "3.7.3",
|
|
30
30
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
31
31
|
"semver": "7.7.3",
|
|
32
32
|
"typed-bem": "1.0.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@types/node": "24.
|
|
35
|
+
"@types/node": "24.10.1",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "7.18.0",
|
|
37
37
|
"@typescript-eslint/parser": "7.18.0",
|
|
38
38
|
"cpy-cli": "6.0.0",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"eslint-plugin-json": "3.1.0",
|
|
45
45
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
46
46
|
"eslint-plugin-react": "7.37.5",
|
|
47
|
-
"knip": "5.
|
|
48
|
-
"mocha": "11.7.
|
|
49
|
-
"nodemon": "3.1.
|
|
50
|
-
"rimraf": "6.1.
|
|
47
|
+
"knip": "5.71.0",
|
|
48
|
+
"mocha": "11.7.5",
|
|
49
|
+
"nodemon": "3.1.11",
|
|
50
|
+
"rimraf": "6.1.2",
|
|
51
51
|
"ts-node": "10.9.2",
|
|
52
52
|
"typescript": "5.9.3",
|
|
53
|
-
"@public-ui/components": "4.0.0-alpha.
|
|
53
|
+
"@public-ui/components": "4.0.0-alpha.7"
|
|
54
54
|
},
|
|
55
55
|
"files": [
|
|
56
56
|
"dist"
|
|
@@ -62,10 +62,9 @@
|
|
|
62
62
|
"lint": "pnpm lint:eslint && pnpm lint:tsc",
|
|
63
63
|
"lint:eslint": "eslint src",
|
|
64
64
|
"lint:tsc": "tsc --noemit",
|
|
65
|
-
"pretest": "pnpm build",
|
|
65
|
+
"pretest:unit": "pnpm build",
|
|
66
66
|
"restart": "pnpm reset && pnpm start",
|
|
67
67
|
"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",
|
|
68
|
-
"test": "pnpm test:unit",
|
|
69
68
|
"test:unit": "cross-env TS_NODE_PROJECT=tsconfig.test.json mocha --require ts-node/register test/**/*.ts --no-experimental-strip-types",
|
|
70
69
|
"unused": "knip",
|
|
71
70
|
"watch": "nodemon --ignore package.json src/index.ts migrate --ignore-uncommitted-changes --test-tasks test"
|