@vkontakte/vkui-codemods 1.0.0 → 1.0.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/dist/codemod-helpers.js
CHANGED
|
@@ -115,7 +115,7 @@ var removeProps = function (j, api, source, componentName, propsNames, createRep
|
|
|
115
115
|
if (attr.type === 'JSXSpreadAttribute') {
|
|
116
116
|
needToShowReport = true;
|
|
117
117
|
}
|
|
118
|
-
return
|
|
118
|
+
return true;
|
|
119
119
|
});
|
|
120
120
|
path.node.openingElement.attributes = newAttributes;
|
|
121
121
|
});
|
|
@@ -17,7 +17,8 @@ function transformer(file, api, options) {
|
|
|
17
17
|
.filter(function (path) { return path.node.source.value === alias; })
|
|
18
18
|
.find(j.ImportSpecifier)
|
|
19
19
|
.forEach(function (path) {
|
|
20
|
-
if (
|
|
20
|
+
if (typeof path.value.imported.name === 'string' &&
|
|
21
|
+
['withInsets', 'useInsets', 'PromoBanner', 'getPlatformClassName'].includes(path.value.imported.name)) {
|
|
21
22
|
(0, report_1.report)(api, ": import of ".concat(chalk_1.default.white.bgBlue(path.value.imported.name), " are forbidden."));
|
|
22
23
|
}
|
|
23
24
|
});
|
|
@@ -30,7 +30,9 @@ function transformer(file, api, options) {
|
|
|
30
30
|
.filter(function (path) { return path.node.source.value === alias; })
|
|
31
31
|
.find(j.ImportSpecifier, { imported: { name: 'Slider' } });
|
|
32
32
|
componentImport.forEach(function (path) {
|
|
33
|
-
if (path.node.local &&
|
|
33
|
+
if (path.node.local &&
|
|
34
|
+
path.node.local.name !== path.node.imported.name &&
|
|
35
|
+
typeof path.node.local.name === 'string') {
|
|
34
36
|
localImportName = path.node.local.name;
|
|
35
37
|
needRename = false;
|
|
36
38
|
}
|
|
@@ -28,7 +28,9 @@ function transformer(file, api, options) {
|
|
|
28
28
|
return source.toSource();
|
|
29
29
|
}
|
|
30
30
|
componentImport.forEach(function (path) {
|
|
31
|
-
if (path.node.local &&
|
|
31
|
+
if (path.node.local &&
|
|
32
|
+
path.node.local.name !== path.node.imported.name &&
|
|
33
|
+
typeof path.node.local.name === 'string') {
|
|
32
34
|
localImportName = path.node.local.name;
|
|
33
35
|
needRename = false;
|
|
34
36
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/vkui-codemods",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Codemods for automatic VKUI major version upgrade",
|
|
5
5
|
"repository": "https://github.com/VKCOM/VKUI",
|
|
6
|
-
"homepage": "https://
|
|
6
|
+
"homepage": "https://vkui.io/",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"bin": "./dist/index.js",
|
|
9
9
|
"files": [
|
|
@@ -15,22 +15,21 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"chalk": "^4.1.2",
|
|
18
|
-
"commander": "^
|
|
18
|
+
"commander": "^14.0.0",
|
|
19
19
|
"cross-spawn": "^7.0.5",
|
|
20
|
-
"jscodeshift": "^17.
|
|
20
|
+
"jscodeshift": "^17.3.0",
|
|
21
21
|
"prompts": "^2.4.2",
|
|
22
|
-
"typescript": "^5.
|
|
22
|
+
"typescript": "^5.9.2"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@swc/core": "^1.
|
|
26
|
-
"@swc/jest": "^0.2.
|
|
25
|
+
"@swc/core": "^1.13.3",
|
|
26
|
+
"@swc/jest": "^0.2.39",
|
|
27
27
|
"@types/cross-spawn": "^6.0.6",
|
|
28
|
-
"@types/jest": "^
|
|
29
|
-
"@types/jscodeshift": "^
|
|
30
|
-
"@types/node": "^
|
|
28
|
+
"@types/jest": "^30.0.0",
|
|
29
|
+
"@types/jscodeshift": "^17.3.0",
|
|
30
|
+
"@types/node": "^24.1.0",
|
|
31
31
|
"@types/prompts": "^2.4.9",
|
|
32
|
-
"jest": "^
|
|
33
|
-
"ts-node": "^10.9.2"
|
|
32
|
+
"jest": "^30.0.5"
|
|
34
33
|
},
|
|
35
34
|
"scripts": {
|
|
36
35
|
"prepack": "yarn run build",
|