@carbon/upgrade 11.16.0 → 11.17.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.
- package/README.md +6 -0
- package/cli.js +15 -9
- package/package.json +3 -3
- package/transforms/__testfixtures__/icons-react-size-prop-rename.output.js +6 -6
- package/transforms/__testfixtures__/icons-react-size-prop-with-prop.input.js +0 -3
- package/transforms/__testfixtures__/icons-react-size-prop-with-prop.output.js +2 -5
- package/transforms/__testfixtures__/size-prop-update.output.js +20 -20
- package/transforms/__testfixtures__/small-to-size-prop.output.js +2 -3
package/README.md
CHANGED
|
@@ -67,6 +67,12 @@ the
|
|
|
67
67
|
Each is tested against a series of test fixtures to ensure transforms are
|
|
68
68
|
predictable and consistently provide the intended output.
|
|
69
69
|
|
|
70
|
+
#### Output formatting
|
|
71
|
+
|
|
72
|
+
The output of a codemod may not match your codebase's formatting style. It is
|
|
73
|
+
recommended to always run the result of a codemod through an autoformatter like
|
|
74
|
+
[Prettier](https://prettier.io/).
|
|
75
|
+
|
|
70
76
|
## 🙌 Contributing
|
|
71
77
|
|
|
72
78
|
If you have ideas on how we could make your migration experience easier, please
|
package/cli.js
CHANGED
|
@@ -39091,9 +39091,9 @@ var require_path = __commonJS({
|
|
|
39091
39091
|
var IS_WINDOWS_PLATFORM = os.platform() === "win32";
|
|
39092
39092
|
var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
|
39093
39093
|
var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
|
|
39094
|
-
var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([(){}]|^!|[!+@](?=\())/g;
|
|
39094
|
+
var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
39095
39095
|
var DOS_DEVICE_PATH_RE = /^\\\\([.?])/;
|
|
39096
|
-
var WINDOWS_BACKSLASHES_RE = /\\(?![!()+@{}])/g;
|
|
39096
|
+
var WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g;
|
|
39097
39097
|
function unixify(filepath) {
|
|
39098
39098
|
return filepath.replace(/\\/g, "/");
|
|
39099
39099
|
}
|
|
@@ -41910,7 +41910,11 @@ var require_micromatch = __commonJS({
|
|
|
41910
41910
|
var braces = require_braces();
|
|
41911
41911
|
var picomatch = require_picomatch2();
|
|
41912
41912
|
var utils = require_utils5();
|
|
41913
|
-
var isEmptyString = (
|
|
41913
|
+
var isEmptyString = (v) => v === "" || v === "./";
|
|
41914
|
+
var hasBraces = (v) => {
|
|
41915
|
+
const index = v.indexOf("{");
|
|
41916
|
+
return index > -1 && v.indexOf("}", index) > -1;
|
|
41917
|
+
};
|
|
41914
41918
|
var micromatch = (list, patterns, options) => {
|
|
41915
41919
|
patterns = [].concat(patterns);
|
|
41916
41920
|
list = [].concat(list);
|
|
@@ -42045,7 +42049,7 @@ var require_micromatch = __commonJS({
|
|
|
42045
42049
|
};
|
|
42046
42050
|
micromatch.braces = (pattern, options) => {
|
|
42047
42051
|
if (typeof pattern !== "string") throw new TypeError("Expected a string");
|
|
42048
|
-
if (options && options.nobrace === true ||
|
|
42052
|
+
if (options && options.nobrace === true || !hasBraces(pattern)) {
|
|
42049
42053
|
return [pattern];
|
|
42050
42054
|
}
|
|
42051
42055
|
return braces(pattern, options);
|
|
@@ -42054,6 +42058,7 @@ var require_micromatch = __commonJS({
|
|
|
42054
42058
|
if (typeof pattern !== "string") throw new TypeError("Expected a string");
|
|
42055
42059
|
return micromatch.braces(pattern, { ...options, expand: true });
|
|
42056
42060
|
};
|
|
42061
|
+
micromatch.hasBraces = hasBraces;
|
|
42057
42062
|
module2.exports = micromatch;
|
|
42058
42063
|
}
|
|
42059
42064
|
});
|
|
@@ -42170,7 +42175,7 @@ var require_pattern = __commonJS({
|
|
|
42170
42175
|
}
|
|
42171
42176
|
exports2.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
42172
42177
|
function expandBraceExpansion(pattern) {
|
|
42173
|
-
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true });
|
|
42178
|
+
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
|
42174
42179
|
patterns.sort((a, b) => a.length - b.length);
|
|
42175
42180
|
return patterns.filter((pattern2) => pattern2 !== "");
|
|
42176
42181
|
}
|
|
@@ -44228,6 +44233,7 @@ var require_settings4 = __commonJS({
|
|
|
44228
44233
|
if (this.stats) {
|
|
44229
44234
|
this.objectMode = true;
|
|
44230
44235
|
}
|
|
44236
|
+
this.ignore = [].concat(this.ignore);
|
|
44231
44237
|
}
|
|
44232
44238
|
_getValue(option, value) {
|
|
44233
44239
|
return option === void 0 ? value : option;
|
|
@@ -48618,9 +48624,9 @@ var require_build5 = __commonJS({
|
|
|
48618
48624
|
}
|
|
48619
48625
|
});
|
|
48620
48626
|
|
|
48621
|
-
// ../../node_modules/yargs
|
|
48627
|
+
// ../../node_modules/yargs-parser/build/index.cjs
|
|
48622
48628
|
var require_build6 = __commonJS({
|
|
48623
|
-
"../../node_modules/yargs
|
|
48629
|
+
"../../node_modules/yargs-parser/build/index.cjs"(exports2, module2) {
|
|
48624
48630
|
"use strict";
|
|
48625
48631
|
var util = require("util");
|
|
48626
48632
|
var path3 = require("path");
|
|
@@ -52535,7 +52541,7 @@ var upgrades = [
|
|
|
52535
52541
|
var package_default = {
|
|
52536
52542
|
name: "@carbon/upgrade",
|
|
52537
52543
|
description: "A tool for upgrading Carbon versions",
|
|
52538
|
-
version: "11.
|
|
52544
|
+
version: "11.17.0",
|
|
52539
52545
|
license: "Apache-2.0",
|
|
52540
52546
|
bin: {
|
|
52541
52547
|
"carbon-upgrade": "./bin/carbon-upgrade.js"
|
|
@@ -52593,7 +52599,7 @@ var package_default = {
|
|
|
52593
52599
|
},
|
|
52594
52600
|
dependencies: {
|
|
52595
52601
|
"@ibm/telemetry-js": "^1.5.0",
|
|
52596
|
-
jscodeshift: "^0.
|
|
52602
|
+
jscodeshift: "^17.0.0"
|
|
52597
52603
|
}
|
|
52598
52604
|
};
|
|
52599
52605
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/upgrade",
|
|
3
3
|
"description": "A tool for upgrading Carbon versions",
|
|
4
|
-
"version": "11.
|
|
4
|
+
"version": "11.17.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": {
|
|
7
7
|
"carbon-upgrade": "./bin/carbon-upgrade.js"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@ibm/telemetry-js": "^1.5.0",
|
|
62
|
-
"jscodeshift": "^0.
|
|
62
|
+
"jscodeshift": "^17.0.0"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "d706ffca254bad174fdfc88c05f620ba547cc369"
|
|
65
65
|
}
|
|
@@ -10,23 +10,23 @@ import { Search } from 'test';
|
|
|
10
10
|
|
|
11
11
|
function RendersIconDirectly() {
|
|
12
12
|
return (
|
|
13
|
-
<div>
|
|
13
|
+
(<div>
|
|
14
14
|
<Add size={32} />
|
|
15
15
|
<Bee size={24} />
|
|
16
16
|
<Caret size={20} />
|
|
17
17
|
<DownArrow />
|
|
18
|
-
</div>
|
|
18
|
+
</div>)
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
function RendersIconWithProps(props) {
|
|
23
23
|
return (
|
|
24
|
-
<div>
|
|
24
|
+
(<div>
|
|
25
25
|
<Add size={32} aria-label="test" {...props} />
|
|
26
26
|
<Bee size={24} aria-label="test" {...props} />
|
|
27
27
|
<Caret size={20} aria-label="test" {...props} />
|
|
28
28
|
<DownArrow aria-label="test" {...props} />
|
|
29
|
-
</div>
|
|
29
|
+
</div>)
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -36,9 +36,9 @@ function AliasedIcon() {
|
|
|
36
36
|
|
|
37
37
|
function ExistingScope() {
|
|
38
38
|
return (
|
|
39
|
-
<div>
|
|
39
|
+
(<div>
|
|
40
40
|
<Search />
|
|
41
41
|
<SearchIcon size={24} />
|
|
42
|
-
</div>
|
|
42
|
+
</div>)
|
|
43
43
|
);
|
|
44
44
|
}
|
|
@@ -2,14 +2,11 @@ import { Add16, Bee24, Chevron24 as chevron } from '@carbon/icons-react';
|
|
|
2
2
|
|
|
3
3
|
const mapped = {
|
|
4
4
|
default: Add16,
|
|
5
|
-
// prettier-ignore
|
|
6
5
|
size: Bee24,
|
|
7
|
-
// prettier-ignore
|
|
8
6
|
lowercase: chevron,
|
|
9
7
|
};
|
|
10
8
|
|
|
11
9
|
function RenderIconProp() {
|
|
12
|
-
// prettier-ignore
|
|
13
10
|
return (
|
|
14
11
|
<div>
|
|
15
12
|
<DefaultSize renderIcon={Add16} />
|
|
@@ -2,9 +2,7 @@ import { Add, Bee, Chevron as chevron } from '@carbon/icons-react';
|
|
|
2
2
|
|
|
3
3
|
const mapped = {
|
|
4
4
|
default: Add,
|
|
5
|
-
// prettier-ignore
|
|
6
5
|
size: props => <Bee size={24} {...props} />,
|
|
7
|
-
// prettier-ignore
|
|
8
6
|
lowercase: props => React.createElement(chevron, {
|
|
9
7
|
size: 24,
|
|
10
8
|
...props
|
|
@@ -12,11 +10,10 @@ const mapped = {
|
|
|
12
10
|
};
|
|
13
11
|
|
|
14
12
|
function RenderIconProp() {
|
|
15
|
-
// prettier-ignore
|
|
16
13
|
return (
|
|
17
|
-
<div>
|
|
14
|
+
(<div>
|
|
18
15
|
<DefaultSize renderIcon={Add} />
|
|
19
16
|
<Size renderIcon={props => <Bee size={24} {...props} />} />
|
|
20
|
-
</div>
|
|
17
|
+
</div>)
|
|
21
18
|
);
|
|
22
19
|
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
function Accordion() {
|
|
2
2
|
return (
|
|
3
|
-
<div>
|
|
3
|
+
(<div>
|
|
4
4
|
<Accordion className="test" size="lg" />
|
|
5
5
|
<Accordion className="test" size="lg">
|
|
6
6
|
<AccordionItem>Test</AccordionItem>
|
|
7
7
|
</Accordion>
|
|
8
|
-
</div>
|
|
8
|
+
</div>)
|
|
9
9
|
);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
function Button() {
|
|
13
13
|
return (
|
|
14
|
-
<div>
|
|
14
|
+
(<div>
|
|
15
15
|
<Button className="test" size="sm" />
|
|
16
16
|
<Button className="test" size="md"></Button>
|
|
17
17
|
<Button className="test" size="lg"></Button>
|
|
18
18
|
<Button className="test" size="xl"></Button>
|
|
19
19
|
<Button className="test" size="2xl"></Button>
|
|
20
|
-
</div>
|
|
20
|
+
</div>)
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -27,11 +27,11 @@ function ComboBox() {
|
|
|
27
27
|
|
|
28
28
|
function ContentSwitcher() {
|
|
29
29
|
return (
|
|
30
|
-
<ContentSwitcher className="test" size="lg">
|
|
30
|
+
(<ContentSwitcher className="test" size="lg">
|
|
31
31
|
<Switch name="one" text="First section" />
|
|
32
32
|
<Switch name="two" text="Second section" />
|
|
33
33
|
<Switch name="three" text="Third section" />
|
|
34
|
-
</ContentSwitcher>
|
|
34
|
+
</ContentSwitcher>)
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -41,31 +41,31 @@ function Dropdown() {
|
|
|
41
41
|
|
|
42
42
|
function DataTable() {
|
|
43
43
|
return (
|
|
44
|
-
<div>
|
|
44
|
+
(<div>
|
|
45
45
|
<Table className="test" size="xs"></Table>
|
|
46
46
|
<Table className="test" size="sm"></Table>
|
|
47
47
|
<Table className="test" size="xl"></Table>
|
|
48
48
|
<DataTable className="test" size="xs"></DataTable>
|
|
49
49
|
<DataTable className="test" size="sm"></DataTable>
|
|
50
50
|
<DataTable className="test" size="xl"></DataTable>
|
|
51
|
-
</div>
|
|
51
|
+
</div>)
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
function DatePicker() {
|
|
56
56
|
return (
|
|
57
|
-
<DatePicker datePickerType="single">
|
|
57
|
+
(<DatePicker datePickerType="single">
|
|
58
58
|
<DatePickerInput
|
|
59
59
|
size="lg"
|
|
60
60
|
id="datepicker"
|
|
61
61
|
labelText="Datepicker Test"></DatePickerInput>
|
|
62
|
-
</DatePicker>
|
|
62
|
+
</DatePicker>)
|
|
63
63
|
);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
function FileUploader() {
|
|
67
67
|
return (
|
|
68
|
-
<div>
|
|
68
|
+
(<div>
|
|
69
69
|
<FileUploader size="sm"></FileUploader>
|
|
70
70
|
<FileUploader size="md"></FileUploader>
|
|
71
71
|
<FileUploader size="lg"></FileUploader>
|
|
@@ -78,7 +78,7 @@ function FileUploader() {
|
|
|
78
78
|
<FileUploaderDropContainer size="sm"></FileUploaderDropContainer>
|
|
79
79
|
<FileUploaderDropContainer size="md"></FileUploaderDropContainer>
|
|
80
80
|
<FileUploaderDropContainer size="lg"></FileUploaderDropContainer>
|
|
81
|
-
</div>
|
|
81
|
+
</div>)
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -88,7 +88,7 @@ function Link() {
|
|
|
88
88
|
|
|
89
89
|
function MultiSelect() {
|
|
90
90
|
return (
|
|
91
|
-
<div>
|
|
91
|
+
(<div>
|
|
92
92
|
<MultiSelect
|
|
93
93
|
size="lg"
|
|
94
94
|
items={items}
|
|
@@ -99,7 +99,7 @@ function MultiSelect() {
|
|
|
99
99
|
items={items}
|
|
100
100
|
itemToString={(item) => (item ? item.text : '')}
|
|
101
101
|
/>
|
|
102
|
-
</div>
|
|
102
|
+
</div>)
|
|
103
103
|
);
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -113,28 +113,28 @@ function OverflowMenu() {
|
|
|
113
113
|
|
|
114
114
|
function Search() {
|
|
115
115
|
return (
|
|
116
|
-
<div>
|
|
116
|
+
(<div>
|
|
117
117
|
<Search className="test" size="md" />
|
|
118
118
|
<Search className="test" size="lg" />
|
|
119
|
-
</div>
|
|
119
|
+
</div>)
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
function Select() {
|
|
124
124
|
return (
|
|
125
|
-
<div>
|
|
125
|
+
(<div>
|
|
126
126
|
<Select className="test" size="md" />
|
|
127
127
|
<Select className="test" size="lg" />
|
|
128
|
-
</div>
|
|
128
|
+
</div>)
|
|
129
129
|
);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
function TextInput() {
|
|
133
133
|
return (
|
|
134
|
-
<div>
|
|
134
|
+
(<div>
|
|
135
135
|
<TextInput size="md" id="textinput1" labelText="lg -> md"></TextInput>
|
|
136
136
|
<TextInput size="lg" id="textinput1" labelText="xl -> lg"></TextInput>
|
|
137
|
-
</div>
|
|
137
|
+
</div>)
|
|
138
138
|
);
|
|
139
139
|
}
|
|
140
140
|
|