@atlaskit/codemod-utils 4.2.3 → 4.2.4
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/CHANGELOG.md +31 -25
- package/dist/cjs/utils/index.js +1 -1
- package/dist/cjs/utils/support.js +6 -6
- package/dist/es2019/utils/support.js +0 -1
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/support.js +6 -7
- package/package.json +4 -4
- package/dist/cjs/version.json +0 -5
- package/dist/es2019/version.json +0 -5
- package/dist/esm/version.json +0 -5
- package/tmp/api-report-tmp.d.ts +0 -122
package/CHANGELOG.md
CHANGED
|
@@ -1,70 +1,76 @@
|
|
|
1
1
|
# @atlaskit/codemod-utils
|
|
2
2
|
|
|
3
|
+
## 4.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116) [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) - Upgrade Typescript from `4.9.5` to `5.4.2`
|
|
8
|
+
|
|
3
9
|
## 4.2.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
6
12
|
|
|
7
|
-
- [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing unused dependencies and dev dependencies
|
|
13
|
+
- [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443) [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing unused dependencies and dev dependencies
|
|
8
14
|
|
|
9
15
|
## 4.2.2
|
|
10
16
|
|
|
11
17
|
### Patch Changes
|
|
12
18
|
|
|
13
|
-
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
19
|
+
- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793) [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
14
20
|
|
|
15
21
|
## 4.2.1
|
|
16
22
|
|
|
17
23
|
### Patch Changes
|
|
18
24
|
|
|
19
|
-
- [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
25
|
+
- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649) [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
20
26
|
|
|
21
27
|
## 4.2.0
|
|
22
28
|
|
|
23
29
|
### Minor Changes
|
|
24
30
|
|
|
25
|
-
- [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
31
|
+
- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258) [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
26
32
|
|
|
27
33
|
## 4.1.3
|
|
28
34
|
|
|
29
35
|
### Patch Changes
|
|
30
36
|
|
|
31
|
-
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
37
|
+
- [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874) [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
32
38
|
|
|
33
39
|
## 4.1.2
|
|
34
40
|
|
|
35
41
|
### Patch Changes
|
|
36
42
|
|
|
37
|
-
- [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
43
|
+
- [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492) [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
38
44
|
|
|
39
45
|
## 4.1.1
|
|
40
46
|
|
|
41
47
|
### Patch Changes
|
|
42
48
|
|
|
43
|
-
- [`edc6fef0c8f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/edc6fef0c8f) - Fix printf format specifier matching within `matchesStringWithFormatSpecifier` for fuzzy matching interpolated placeholder values
|
|
49
|
+
- [#23836](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/23836) [`edc6fef0c8f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/edc6fef0c8f) - Fix printf format specifier matching within `matchesStringWithFormatSpecifier` for fuzzy matching interpolated placeholder values
|
|
44
50
|
|
|
45
51
|
## 4.1.0
|
|
46
52
|
|
|
47
53
|
### Minor Changes
|
|
48
54
|
|
|
49
|
-
- [`e4624adcb2f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e4624adcb2f) - ED-14608: Update codemod-utils to support type import entry point changes in changeImportEntryPoint, remove adf-utils from repo stricter lint exclusion lists
|
|
55
|
+
- [#21570](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/21570) [`e4624adcb2f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e4624adcb2f) - ED-14608: Update codemod-utils to support type import entry point changes in changeImportEntryPoint, remove adf-utils from repo stricter lint exclusion lists
|
|
50
56
|
|
|
51
57
|
## 4.0.2
|
|
52
58
|
|
|
53
59
|
### Patch Changes
|
|
54
60
|
|
|
55
|
-
- [`9358d42eeaa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9358d42eeaa) - NO-ISSUE: fixed codemod utils tryCreateImport() and addToImport() causing multiple insert in certain scenarios
|
|
61
|
+
- [#21152](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/21152) [`9358d42eeaa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9358d42eeaa) - NO-ISSUE: fixed codemod utils tryCreateImport() and addToImport() causing multiple insert in certain scenarios
|
|
56
62
|
|
|
57
63
|
## 4.0.1
|
|
58
64
|
|
|
59
65
|
### Patch Changes
|
|
60
66
|
|
|
61
|
-
- [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
|
|
67
|
+
- [#20650](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20650) [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
|
|
62
68
|
|
|
63
69
|
## 4.0.0
|
|
64
70
|
|
|
65
71
|
### Major Changes
|
|
66
72
|
|
|
67
|
-
- [`b29ce16dad8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b29ce16dad8) - [ED-14606] Move bitbucket schema, confluence schema, jira schema, and default schema from @atlaskit/adf-schema to their own entry points. These new entry points are as follows
|
|
73
|
+
- [#20033](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20033) [`b29ce16dad8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b29ce16dad8) - [ED-14606] Move bitbucket schema, confluence schema, jira schema, and default schema from @atlaskit/adf-schema to their own entry points. These new entry points are as follows
|
|
68
74
|
|
|
69
75
|
@atlaskit/adf-schema/schema-bitbucket for:
|
|
70
76
|
|
|
@@ -102,31 +108,31 @@
|
|
|
102
108
|
|
|
103
109
|
### Minor Changes
|
|
104
110
|
|
|
105
|
-
- [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - Adds new util `hasImportDeclarationFromAnyPackageEntrypoint`. It works just like `hasImportDeclaration`, but instead of searching for an import declaration that has strict equality with a supplied import path (e.g. `@atlaskit/theme`), it looks for an import declaration that _starts with_ the supplied import path. With that same example, it will match both `@atlaskit/theme` and `@atlaskit/theme/typography` — making it easy to choose to run a codemod on a usage regardless of the way in which it was imported.
|
|
111
|
+
- [#14319](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/14319) [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - Adds new util `hasImportDeclarationFromAnyPackageEntrypoint`. It works just like `hasImportDeclaration`, but instead of searching for an import declaration that has strict equality with a supplied import path (e.g. `@atlaskit/theme`), it looks for an import declaration that _starts with_ the supplied import path. With that same example, it will match both `@atlaskit/theme` and `@atlaskit/theme/typography` — making it easy to choose to run a codemod on a usage regardless of the way in which it was imported.
|
|
106
112
|
|
|
107
113
|
## 3.3.0
|
|
108
114
|
|
|
109
115
|
### Minor Changes
|
|
110
116
|
|
|
111
|
-
- [`9729143f07b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9729143f07b) - Add support functions `getDynamicImportName`, `isCallExpressionCalleeImportType`, `isCallExpressionArgumentStringLiteralType`, `isCallExpressionArgumentValueMatches` and `addDynamicImport`.
|
|
117
|
+
- [#13864](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/13864) [`9729143f07b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9729143f07b) - Add support functions `getDynamicImportName`, `isCallExpressionCalleeImportType`, `isCallExpressionArgumentStringLiteralType`, `isCallExpressionArgumentValueMatches` and `addDynamicImport`.
|
|
112
118
|
|
|
113
119
|
## 3.2.2
|
|
114
120
|
|
|
115
121
|
### Patch Changes
|
|
116
122
|
|
|
117
|
-
- [`dc04275805a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dc04275805a) - Update types of API addCommentBefore
|
|
123
|
+
- [#12837](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12837) [`dc04275805a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dc04275805a) - Update types of API addCommentBefore
|
|
118
124
|
|
|
119
125
|
## 3.2.1
|
|
120
126
|
|
|
121
127
|
### Patch Changes
|
|
122
128
|
|
|
123
|
-
- [`d0ef46dee01`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d0ef46dee01) - Removes ts-node / cjs bundle switcher from main entrypoint of codemod-utils and updated codemod-cli scripts to support
|
|
129
|
+
- [#11911](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/11911) [`d0ef46dee01`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d0ef46dee01) - Removes ts-node / cjs bundle switcher from main entrypoint of codemod-utils and updated codemod-cli scripts to support
|
|
124
130
|
|
|
125
131
|
## 3.2.0
|
|
126
132
|
|
|
127
133
|
### Minor Changes
|
|
128
134
|
|
|
129
|
-
- [`43412f2b0b1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/43412f2b0b1) - Added few helper functions
|
|
135
|
+
- [#10569](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10569) [`43412f2b0b1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/43412f2b0b1) - Added few helper functions
|
|
130
136
|
|
|
131
137
|
### Patch Changes
|
|
132
138
|
|
|
@@ -136,7 +142,7 @@
|
|
|
136
142
|
|
|
137
143
|
### Minor Changes
|
|
138
144
|
|
|
139
|
-
- [`2ec9e608acc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ec9e608acc) - Update `addCommentBefore` helper method to:
|
|
145
|
+
- [#10787](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10787) [`2ec9e608acc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ec9e608acc) - Update `addCommentBefore` helper method to:
|
|
140
146
|
|
|
141
147
|
- Make the message prefix optional.
|
|
142
148
|
- _The default remains as `TODO: (from codemod)` for backwards compatibility_
|
|
@@ -147,7 +153,7 @@
|
|
|
147
153
|
|
|
148
154
|
### Major Changes
|
|
149
155
|
|
|
150
|
-
- [`284a374eed8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/284a374eed8) - Removed `createSkipTest` & `createSkipTestTransformer` transformer from the API. This is a **breaking change**!
|
|
156
|
+
- [#10179](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10179) [`284a374eed8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/284a374eed8) - Removed `createSkipTest` & `createSkipTestTransformer` transformer from the API. This is a **breaking change**!
|
|
151
157
|
|
|
152
158
|
If you rely on this transformer, you can now depend on it via a new package `@af/skip-inconsistent-tests`.
|
|
153
159
|
|
|
@@ -155,33 +161,33 @@
|
|
|
155
161
|
|
|
156
162
|
### Patch Changes
|
|
157
163
|
|
|
158
|
-
- [`1300c88e2cc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1300c88e2cc) - Add shouldApplyTransform to createTransformer so there is a check before transforms are run.
|
|
164
|
+
- [#9756](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9756) [`1300c88e2cc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1300c88e2cc) - Add shouldApplyTransform to createTransformer so there is a check before transforms are run.
|
|
159
165
|
- [`1b6bf93be84`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1b6bf93be84) - Migrate helper functions into codemod-utils
|
|
160
166
|
|
|
161
167
|
## 2.2.0
|
|
162
168
|
|
|
163
169
|
### Minor Changes
|
|
164
170
|
|
|
165
|
-
- [`2474e09dc7f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2474e09dc7f) - Add new method to create a custom Transformer for skip test
|
|
171
|
+
- [#9940](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9940) [`2474e09dc7f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2474e09dc7f) - Add new method to create a custom Transformer for skip test
|
|
166
172
|
|
|
167
173
|
## 2.1.2
|
|
168
174
|
|
|
169
175
|
### Patch Changes
|
|
170
176
|
|
|
171
|
-
- [`d72b572dfc2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d72b572dfc2) - bumped jscodeshift@^0.11.0
|
|
177
|
+
- [#9832](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9832) [`d72b572dfc2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d72b572dfc2) - bumped jscodeshift@^0.11.0
|
|
172
178
|
- [`d72b572dfc2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d72b572dfc2) - bumped @types/jscodeshift@^0.11.0
|
|
173
179
|
|
|
174
180
|
## 2.1.1
|
|
175
181
|
|
|
176
182
|
### Patch Changes
|
|
177
183
|
|
|
178
|
-
- [`5be80507d82`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5be80507d82) - Fixed a defect in move component to entry point codemod
|
|
184
|
+
- [#8981](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/8981) [`5be80507d82`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5be80507d82) - Fixed a defect in move component to entry point codemod
|
|
179
185
|
|
|
180
186
|
## 2.1.0
|
|
181
187
|
|
|
182
188
|
### Minor Changes
|
|
183
189
|
|
|
184
|
-
- [`7e295f4d9da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7e295f4d9da) - Added more lower level helpers for writing codemod:
|
|
190
|
+
- [#8169](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/8169) [`7e295f4d9da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7e295f4d9da) - Added more lower level helpers for writing codemod:
|
|
185
191
|
|
|
186
192
|
- getDefaultSpecifier
|
|
187
193
|
- getNamedSpecifier
|
|
@@ -198,10 +204,10 @@
|
|
|
198
204
|
|
|
199
205
|
### Patch Changes
|
|
200
206
|
|
|
201
|
-
- [`ecc5b95e65`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ecc5b95e65) - ED-11440: Add skipTest to codemod-utils
|
|
207
|
+
- [#7012](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/7012) [`ecc5b95e65`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ecc5b95e65) - ED-11440: Add skipTest to codemod-utils
|
|
202
208
|
|
|
203
209
|
## 2.0.0
|
|
204
210
|
|
|
205
211
|
### Major Changes
|
|
206
212
|
|
|
207
|
-
- [`f1e5c2be81`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f1e5c2be81) - ED-11335: Initialise codemod-utils package
|
|
213
|
+
- [#6722](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/6722) [`f1e5c2be81`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f1e5c2be81) - ED-11335: Initialise codemod-utils package
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -124,7 +124,7 @@ const flattenCertainChildPropsAsProp = (component, propName, childProps) => (j,
|
|
|
124
124
|
childProps.forEach(childProp => {
|
|
125
125
|
if ((property.type === 'Property' || property.type === 'ObjectProperty') && property.key.type === 'Identifier' && property.key.name === childProp) {
|
|
126
126
|
var _element$node$opening;
|
|
127
|
-
(_element$node$opening = element.node.openingElement.attributes) === null || _element$node$opening === void 0
|
|
127
|
+
(_element$node$opening = element.node.openingElement.attributes) === null || _element$node$opening === void 0 || _element$node$opening.push(j.jsxAttribute(j.jsxIdentifier(childProp), j.jsxExpressionContainer(property.value)));
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
});
|
|
@@ -120,9 +120,9 @@ const hasImportDeclaration = (j, source, importPath) => {
|
|
|
120
120
|
exports.hasImportDeclaration = hasImportDeclaration;
|
|
121
121
|
const hasImportDeclarationFromAnyPackageEntrypoint = (j, source, packageName) => {
|
|
122
122
|
const imports = source.find(j.ImportDeclaration).filter(path => {
|
|
123
|
-
var _path$node
|
|
123
|
+
var _path$node;
|
|
124
124
|
return (// @ts-ignore
|
|
125
|
-
path === null || path === void 0
|
|
125
|
+
path === null || path === void 0 || (_path$node = path.node) === null || _path$node === void 0 || (_path$node = _path$node.source) === null || _path$node === void 0 ? void 0 : _path$node.value.toString().startsWith(packageName)
|
|
126
126
|
);
|
|
127
127
|
});
|
|
128
128
|
return Boolean(imports.length);
|
|
@@ -229,15 +229,15 @@ const callExpressionArgMatchesString = (arg, str) => {
|
|
|
229
229
|
};
|
|
230
230
|
exports.callExpressionArgMatchesString = callExpressionArgMatchesString;
|
|
231
231
|
const testMethodVariantEach = (path, testMethods) => {
|
|
232
|
-
var _path$value, _path$
|
|
232
|
+
var _path$value, _path$value2, _path$value3;
|
|
233
233
|
const variants = new Set(['each']);
|
|
234
234
|
return (
|
|
235
235
|
// @ts-ignore
|
|
236
|
-
((_path$value = path.value) === null || _path$value === void 0
|
|
236
|
+
((_path$value = path.value) === null || _path$value === void 0 || (_path$value = _path$value.callee) === null || _path$value === void 0 || (_path$value = _path$value.callee) === null || _path$value === void 0 ? void 0 : _path$value.type) === 'MemberExpression' &&
|
|
237
237
|
// @ts-ignore
|
|
238
|
-
testMethods.has((_path$value2 = path.value) === null || _path$value2 === void 0
|
|
238
|
+
testMethods.has((_path$value2 = path.value) === null || _path$value2 === void 0 || (_path$value2 = _path$value2.callee) === null || _path$value2 === void 0 || (_path$value2 = _path$value2.callee) === null || _path$value2 === void 0 || (_path$value2 = _path$value2.object) === null || _path$value2 === void 0 ? void 0 : _path$value2.name) &&
|
|
239
239
|
// @ts-ignore
|
|
240
|
-
variants.has((_path$value3 = path.value) === null || _path$value3 === void 0
|
|
240
|
+
variants.has((_path$value3 = path.value) === null || _path$value3 === void 0 || (_path$value3 = _path$value3.callee) === null || _path$value3 === void 0 || (_path$value3 = _path$value3.callee) === null || _path$value3 === void 0 || (_path$value3 = _path$value3.property) === null || _path$value3 === void 0 ? void 0 : _path$value3.name)
|
|
241
241
|
);
|
|
242
242
|
};
|
|
243
243
|
exports.testMethodVariantEach = testMethodVariantEach;
|
|
@@ -110,7 +110,6 @@ const debug = component => (j, source) => {
|
|
|
110
110
|
console.log(element); //eslint-disable-line no-console
|
|
111
111
|
});
|
|
112
112
|
};
|
|
113
|
-
|
|
114
113
|
export function placeholderStringMatches(placeholderStr, resolvedStr) {
|
|
115
114
|
if (placeholderStr === resolvedStr) {
|
|
116
115
|
return true;
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -141,7 +141,7 @@ var flattenCertainChildPropsAsProp = function flattenCertainChildPropsAsProp(com
|
|
|
141
141
|
childProps.forEach(function (childProp) {
|
|
142
142
|
if ((property.type === 'Property' || property.type === 'ObjectProperty') && property.key.type === 'Identifier' && property.key.name === childProp) {
|
|
143
143
|
var _element$node$opening;
|
|
144
|
-
(_element$node$opening = element.node.openingElement.attributes) === null || _element$node$opening === void 0
|
|
144
|
+
(_element$node$opening = element.node.openingElement.attributes) === null || _element$node$opening === void 0 || _element$node$opening.push(j.jsxAttribute(j.jsxIdentifier(childProp), j.jsxExpressionContainer(property.value)));
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
});
|
|
@@ -109,9 +109,9 @@ var hasImportDeclaration = function hasImportDeclaration(j, source, importPath)
|
|
|
109
109
|
};
|
|
110
110
|
var hasImportDeclarationFromAnyPackageEntrypoint = function hasImportDeclarationFromAnyPackageEntrypoint(j, source, packageName) {
|
|
111
111
|
var imports = source.find(j.ImportDeclaration).filter(function (path) {
|
|
112
|
-
var _path$node
|
|
112
|
+
var _path$node;
|
|
113
113
|
return (// @ts-ignore
|
|
114
|
-
path === null || path === void 0
|
|
114
|
+
path === null || path === void 0 || (_path$node = path.node) === null || _path$node === void 0 || (_path$node = _path$node.source) === null || _path$node === void 0 ? void 0 : _path$node.value.toString().startsWith(packageName)
|
|
115
115
|
);
|
|
116
116
|
});
|
|
117
117
|
return Boolean(imports.length);
|
|
@@ -127,7 +127,6 @@ var debug = function debug(component) {
|
|
|
127
127
|
});
|
|
128
128
|
};
|
|
129
129
|
};
|
|
130
|
-
|
|
131
130
|
export function placeholderStringMatches(placeholderStr, resolvedStr) {
|
|
132
131
|
if (placeholderStr === resolvedStr) {
|
|
133
132
|
return true;
|
|
@@ -220,15 +219,15 @@ var callExpressionArgMatchesString = function callExpressionArgMatchesString(arg
|
|
|
220
219
|
}
|
|
221
220
|
};
|
|
222
221
|
var testMethodVariantEach = function testMethodVariantEach(path, testMethods) {
|
|
223
|
-
var _path$value, _path$
|
|
222
|
+
var _path$value, _path$value2, _path$value3;
|
|
224
223
|
var variants = new Set(['each']);
|
|
225
224
|
return (
|
|
226
225
|
// @ts-ignore
|
|
227
|
-
((_path$value = path.value) === null || _path$value === void 0
|
|
226
|
+
((_path$value = path.value) === null || _path$value === void 0 || (_path$value = _path$value.callee) === null || _path$value === void 0 || (_path$value = _path$value.callee) === null || _path$value === void 0 ? void 0 : _path$value.type) === 'MemberExpression' &&
|
|
228
227
|
// @ts-ignore
|
|
229
|
-
testMethods.has((_path$value2 = path.value) === null || _path$value2 === void 0
|
|
228
|
+
testMethods.has((_path$value2 = path.value) === null || _path$value2 === void 0 || (_path$value2 = _path$value2.callee) === null || _path$value2 === void 0 || (_path$value2 = _path$value2.callee) === null || _path$value2 === void 0 || (_path$value2 = _path$value2.object) === null || _path$value2 === void 0 ? void 0 : _path$value2.name) &&
|
|
230
229
|
// @ts-ignore
|
|
231
|
-
variants.has((_path$value3 = path.value) === null || _path$value3 === void 0
|
|
230
|
+
variants.has((_path$value3 = path.value) === null || _path$value3 === void 0 || (_path$value3 = _path$value3.callee) === null || _path$value3 === void 0 || (_path$value3 = _path$value3.callee) === null || _path$value3 === void 0 || (_path$value3 = _path$value3.property) === null || _path$value3 === void 0 ? void 0 : _path$value3.name)
|
|
232
231
|
);
|
|
233
232
|
};
|
|
234
233
|
var hasJSXAttributesByName = function hasJSXAttributesByName(j, element, attributeName) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/codemod-utils",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.4",
|
|
4
4
|
"author": "Atlassian Pty Ltd",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": " jscodeshift-compatible codemod utilities",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"inPublicMirror": false,
|
|
13
13
|
"releaseModel": "continuous"
|
|
14
14
|
},
|
|
15
|
-
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
15
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
16
16
|
"main": "dist/cjs/index.js",
|
|
17
17
|
"module": "dist/esm/index.js",
|
|
18
18
|
"module:es2019": "dist/es2019/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
38
38
|
"@types/jscodeshift": "^0.11.0",
|
|
39
39
|
"jscodeshift": "^0.13.0",
|
|
40
|
-
"typescript": "~4.
|
|
40
|
+
"typescript": "~5.4.2"
|
|
41
41
|
},
|
|
42
42
|
"techstack": {
|
|
43
43
|
"@atlassian/frontend": {
|
|
@@ -67,4 +67,4 @@
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
70
|
-
}
|
|
70
|
+
}
|
package/dist/cjs/version.json
DELETED
package/dist/es2019/version.json
DELETED
package/dist/esm/version.json
DELETED
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/codemod-utils"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
import { API } from 'jscodeshift';
|
|
8
|
-
import { ASTPath } from 'jscodeshift';
|
|
9
|
-
import { CallExpression } from 'jscodeshift';
|
|
10
|
-
import { Collection } from 'jscodeshift/src/Collection';
|
|
11
|
-
import core from 'jscodeshift';
|
|
12
|
-
import { FileInfo } from 'jscodeshift';
|
|
13
|
-
import { ImportDeclaration } from 'jscodeshift';
|
|
14
|
-
import { ImportDefaultSpecifier } from 'jscodeshift';
|
|
15
|
-
import { ImportSpecifier } from 'jscodeshift';
|
|
16
|
-
import { JSXAttribute } from 'jscodeshift';
|
|
17
|
-
import { JSXElement } from 'jscodeshift';
|
|
18
|
-
import { Options } from 'jscodeshift';
|
|
19
|
-
import { Program } from 'jscodeshift';
|
|
20
|
-
import { VariableDeclaration } from 'jscodeshift';
|
|
21
|
-
import { VariableDeclarator } from 'jscodeshift';
|
|
22
|
-
|
|
23
|
-
// @public (undocumented)
|
|
24
|
-
export function addCommentBefore(j: core.JSCodeshift, target: Collection<CallExpression> | Collection<ImportDeclaration> | Collection<JSXAttribute> | Collection<JSXElement> | Collection<Program> | Collection<VariableDeclarator>, message: string, commentType?: 'block' | 'line', messagePrefix?: string): void;
|
|
25
|
-
|
|
26
|
-
// @public (undocumented)
|
|
27
|
-
export const addCommentToStartOfFile: ({ j, base, message, }: {
|
|
28
|
-
j: core.JSCodeshift;
|
|
29
|
-
base: Collection<Node>;
|
|
30
|
-
message: string;
|
|
31
|
-
}) => void;
|
|
32
|
-
|
|
33
|
-
// @public (undocumented)
|
|
34
|
-
export const addDynamicImport: (j: core.JSCodeshift, target: Collection<VariableDeclaration>, name: string, packageEndpoint: string) => void;
|
|
35
|
-
|
|
36
|
-
// @public (undocumented)
|
|
37
|
-
export function addToImport(j: core.JSCodeshift, base: Collection<any>, importSpecifier: ImportDefaultSpecifier | ImportSpecifier, packageName: string): void;
|
|
38
|
-
|
|
39
|
-
// @public (undocumented)
|
|
40
|
-
export const callExpressionArgMatchesString: (arg: CallExpression['arguments'][number], str: string) => boolean;
|
|
41
|
-
|
|
42
|
-
// @public (undocumented)
|
|
43
|
-
export const changeImportEntryPoint: (oldPackageName: string, importToConvert: string, newPackageName: string, shouldBeTypeImport?: boolean) => (j: core.JSCodeshift, root: Collection<Node>) => void;
|
|
44
|
-
|
|
45
|
-
// @public (undocumented)
|
|
46
|
-
export const createConvertFuncFor: (component: string, from: string, to: string, predicate?: ((value: any) => boolean) | undefined) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
47
|
-
|
|
48
|
-
// @public (undocumented)
|
|
49
|
-
export const createRemoveFuncAddCommentFor: (component: string, prop: string, comment?: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
50
|
-
|
|
51
|
-
// @public (undocumented)
|
|
52
|
-
export const createRemoveFuncFor: (component: string, importName: string, prop: string, predicate?: (j: core.JSCodeshift, element: ASTPath<any>) => boolean, comment?: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
53
|
-
|
|
54
|
-
// @public (undocumented)
|
|
55
|
-
export const createRenameFuncFor: (component: string, from: string, to: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
56
|
-
|
|
57
|
-
// @public (undocumented)
|
|
58
|
-
export const createRenameImportFor: (component: string, from: string, to: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
59
|
-
|
|
60
|
-
// @public (undocumented)
|
|
61
|
-
export const createRenameJSXFunc: (packagePath: string, from: string, to: string, fallback?: string | undefined) => (j: core.JSCodeshift, source: any) => void;
|
|
62
|
-
|
|
63
|
-
// @public (undocumented)
|
|
64
|
-
export const createTransformer: (migrates: ((j: core.JSCodeshift, source: Collection<Node>) => void)[], shouldApplyTransform?: ((j: core.JSCodeshift, source: Collection<Node>) => boolean) | undefined) => (fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) => string;
|
|
65
|
-
|
|
66
|
-
// @public (undocumented)
|
|
67
|
-
export const doesIdentifierExist: (j: core.JSCodeshift, base: Collection<any>, name: string) => boolean;
|
|
68
|
-
|
|
69
|
-
// @public (undocumented)
|
|
70
|
-
export const elevateComponentToNewEntryPoint: (pkg: string, toPkg: string, innerElementName: string) => (j: core.JSCodeshift, root: any) => void;
|
|
71
|
-
|
|
72
|
-
// @public (undocumented)
|
|
73
|
-
export const flattenCertainChildPropsAsProp: (component: string, propName: string, childProps: string[]) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
74
|
-
|
|
75
|
-
// @public (undocumented)
|
|
76
|
-
export const getDefaultSpecifier: (j: core.JSCodeshift, source: Collection<Node>, specifier: string) => null | string;
|
|
77
|
-
|
|
78
|
-
// @public (undocumented)
|
|
79
|
-
export const getDynamicImportName: (j: core.JSCodeshift, source: Collection<any>, importPath: string) => null | string;
|
|
80
|
-
|
|
81
|
-
// @public (undocumented)
|
|
82
|
-
export const getJSXAttributesByName: (j: core.JSCodeshift, element: ASTPath<any>, attributeName: string) => Collection<JSXAttribute>;
|
|
83
|
-
|
|
84
|
-
// @public (undocumented)
|
|
85
|
-
export function getNamedSpecifier(j: core.JSCodeshift, source: Collection<Node>, specifier: string, importName: string): null | string;
|
|
86
|
-
|
|
87
|
-
// @public (undocumented)
|
|
88
|
-
export function getSafeImportName({ j, base, currentDefaultSpecifierName, desiredName, fallbackName, }: {
|
|
89
|
-
j: core.JSCodeshift;
|
|
90
|
-
base: Collection<any>;
|
|
91
|
-
currentDefaultSpecifierName: null | string;
|
|
92
|
-
desiredName: string;
|
|
93
|
-
fallbackName: string;
|
|
94
|
-
}): string;
|
|
95
|
-
|
|
96
|
-
// @public (undocumented)
|
|
97
|
-
export const hasImportDeclaration: (j: core.JSCodeshift, source: Collection<Node>, importPath: string) => boolean;
|
|
98
|
-
|
|
99
|
-
// @public (undocumented)
|
|
100
|
-
export const hasImportDeclarationFromAnyPackageEntrypoint: (j: core.JSCodeshift, source: Collection<Node>, packageName: string) => boolean;
|
|
101
|
-
|
|
102
|
-
// @public (undocumented)
|
|
103
|
-
export const hasJSXAttributesByName: (j: core.JSCodeshift, element: ASTPath<any>, attributeName: string) => boolean;
|
|
104
|
-
|
|
105
|
-
// @public (undocumented)
|
|
106
|
-
export function removeImport(j: core.JSCodeshift, base: Collection<any>, packageName: string): void;
|
|
107
|
-
|
|
108
|
-
// @public (undocumented)
|
|
109
|
-
export const renameNamedImportWithAliasName: (component: string, from: string, to: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
110
|
-
|
|
111
|
-
// @public (undocumented)
|
|
112
|
-
export const replaceImportStatementFor: (pkg: string, convertMap: any) => (j: core.JSCodeshift, root: Collection<Node>) => void;
|
|
113
|
-
|
|
114
|
-
// @public (undocumented)
|
|
115
|
-
export const testMethodVariantEach: (path: ASTPath<CallExpression>, testMethods: Set<string>) => boolean;
|
|
116
|
-
|
|
117
|
-
// @public (undocumented)
|
|
118
|
-
export function tryCreateImport(j: core.JSCodeshift, base: Collection<any>, relativeToPackage: string, packageName: string, shouldBeTypeImport?: boolean): void;
|
|
119
|
-
|
|
120
|
-
// (No @packageDocumentation comment for this package)
|
|
121
|
-
|
|
122
|
-
```
|