@commercetools-frontend/codemod 23.2.0 → 23.2.2
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/bin/mc-codemod.js +2 -0
- package/build/package.json +2 -2
- package/build/src/cli.js +15 -17
- package/package.json +3 -3
package/bin/mc-codemod.js
CHANGED
package/build/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/codemod",
|
|
3
|
-
"version": "23.2.
|
|
3
|
+
"version": "23.2.2",
|
|
4
4
|
"description": "Codemod transformations for Custom Applications",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/core": "^7.22.17",
|
|
28
28
|
"@babel/preset-env": "^7.22.15",
|
|
29
|
-
"
|
|
29
|
+
"commander": "^13.1.0",
|
|
30
30
|
"glob": "8.1.0",
|
|
31
31
|
"jscodeshift": "0.15.2",
|
|
32
32
|
"prettier": "2.8.8"
|
package/build/src/cli.js
CHANGED
|
@@ -5,12 +5,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.run = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const
|
|
8
|
+
const commander_1 = require("commander");
|
|
9
9
|
const glob_1 = __importDefault(require("glob"));
|
|
10
10
|
// @ts-ignore internal module
|
|
11
11
|
const Runner_1 = __importDefault(require("jscodeshift/src/Runner"));
|
|
12
12
|
const package_json_1 = __importDefault(require("../package.json"));
|
|
13
|
-
|
|
13
|
+
commander_1.program
|
|
14
|
+
.name('mc-codemod')
|
|
15
|
+
.description('Codemods for updating Merchant Center customizations.')
|
|
16
|
+
.version(package_json_1.default.version)
|
|
17
|
+
.option('--dry-run', `(optional) Executes the command but does not send any mutation request.`, false);
|
|
14
18
|
const transforms = [
|
|
15
19
|
{
|
|
16
20
|
name: 'remove-deprecated-modal-level-props',
|
|
@@ -66,24 +70,18 @@ const executeCodemod = async (transform, globPattern, globalOptions) => {
|
|
|
66
70
|
}
|
|
67
71
|
};
|
|
68
72
|
const run = () => {
|
|
69
|
-
cli.option('--dry-run', `(optional) Executes the command but does not send any mutation request.`, { default: false });
|
|
70
|
-
// Default command
|
|
71
|
-
cli
|
|
72
|
-
.command('')
|
|
73
|
-
.usage('\n\n Codemods for updating Custom Applications.')
|
|
74
|
-
.action(() => {
|
|
75
|
-
cli.outputHelp();
|
|
76
|
-
});
|
|
77
73
|
// Transform commands
|
|
78
74
|
transforms.forEach((transform) => {
|
|
79
|
-
|
|
80
|
-
.command(
|
|
81
|
-
.
|
|
82
|
-
.
|
|
75
|
+
commander_1.program
|
|
76
|
+
.command(transform.name)
|
|
77
|
+
.argument('<glob-pattern>')
|
|
78
|
+
.description(transform.description)
|
|
79
|
+
.action((globPattern) => {
|
|
80
|
+
const globalOptions = commander_1.program.opts();
|
|
81
|
+
executeCodemod(transform.name, globPattern, globalOptions);
|
|
82
|
+
});
|
|
83
83
|
});
|
|
84
|
-
|
|
85
|
-
cli.version(package_json_1.default.version);
|
|
86
|
-
cli.parse();
|
|
84
|
+
commander_1.program.parse();
|
|
87
85
|
};
|
|
88
86
|
exports.run = run;
|
|
89
87
|
exports.default = exports.run;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/codemod",
|
|
3
|
-
"version": "23.2.
|
|
3
|
+
"version": "23.2.2",
|
|
4
4
|
"description": "Codemod transformations for Custom Applications",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/core": "^7.22.17",
|
|
35
35
|
"@babel/preset-env": "^7.22.15",
|
|
36
|
-
"
|
|
36
|
+
"commander": "^13.1.0",
|
|
37
37
|
"glob": "8.1.0",
|
|
38
38
|
"jscodeshift": "0.15.2",
|
|
39
39
|
"prettier": "2.8.8"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/prettier": "2.7.3",
|
|
47
47
|
"rimraf": "5.0.7",
|
|
48
48
|
"typescript": "5.0.4",
|
|
49
|
-
"@commercetools-frontend/application-components": "23.2.
|
|
49
|
+
"@commercetools-frontend/application-components": "23.2.2"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": "18.x || 20.x || >=22.0.0"
|