@atlaskit/codemod-utils 4.2.3 → 4.2.5

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 CHANGED
@@ -1,70 +1,112 @@
1
1
  # @atlaskit/codemod-utils
2
2
 
3
+ ## 4.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#127093](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/127093)
8
+ [`1378ea7a99ce1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1378ea7a99ce1) -
9
+ Upgrades `jscodeshift` to handle generics properly.
10
+
11
+ ## 4.2.4
12
+
13
+ ### Patch Changes
14
+
15
+ - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
16
+ [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
17
+ Upgrade Typescript from `4.9.5` to `5.4.2`
18
+
3
19
  ## 4.2.3
4
20
 
5
21
  ### Patch Changes
6
22
 
7
- - [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing unused dependencies and dev dependencies
23
+ - [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443)
24
+ [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing
25
+ unused dependencies and dev dependencies
8
26
 
9
27
  ## 4.2.2
10
28
 
11
29
  ### Patch Changes
12
30
 
13
- - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
31
+ - [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)
32
+ [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure
33
+ legacy types are published for TS 4.5-4.8
14
34
 
15
35
  ## 4.2.1
16
36
 
17
37
  ### Patch Changes
18
38
 
19
- - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
39
+ - [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)
40
+ [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade
41
+ Typescript from `4.5.5` to `4.9.5`
20
42
 
21
43
  ## 4.2.0
22
44
 
23
45
  ### Minor Changes
24
46
 
25
- - [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
47
+ - [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)
48
+ [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip
49
+ minor dependency bump
26
50
 
27
51
  ## 4.1.3
28
52
 
29
53
  ### Patch Changes
30
54
 
31
- - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
55
+ - [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874)
56
+ [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade
57
+ Typescript from `4.3.5` to `4.5.5`
32
58
 
33
59
  ## 4.1.2
34
60
 
35
61
  ### Patch Changes
36
62
 
37
- - [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
63
+ - [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492)
64
+ [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade
65
+ Typescript from `4.2.4` to `4.3.5`.
38
66
 
39
67
  ## 4.1.1
40
68
 
41
69
  ### Patch Changes
42
70
 
43
- - [`edc6fef0c8f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/edc6fef0c8f) - Fix printf format specifier matching within `matchesStringWithFormatSpecifier` for fuzzy matching interpolated placeholder values
71
+ - [#23836](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/23836)
72
+ [`edc6fef0c8f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/edc6fef0c8f) - Fix
73
+ printf format specifier matching within `matchesStringWithFormatSpecifier` for fuzzy matching
74
+ interpolated placeholder values
44
75
 
45
76
  ## 4.1.0
46
77
 
47
78
  ### Minor Changes
48
79
 
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
80
+ - [#21570](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/21570)
81
+ [`e4624adcb2f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e4624adcb2f) -
82
+ ED-14608: Update codemod-utils to support type import entry point changes in
83
+ changeImportEntryPoint, remove adf-utils from repo stricter lint exclusion lists
50
84
 
51
85
  ## 4.0.2
52
86
 
53
87
  ### Patch Changes
54
88
 
55
- - [`9358d42eeaa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9358d42eeaa) - NO-ISSUE: fixed codemod utils tryCreateImport() and addToImport() causing multiple insert in certain scenarios
89
+ - [#21152](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/21152)
90
+ [`9358d42eeaa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9358d42eeaa) -
91
+ NO-ISSUE: fixed codemod utils tryCreateImport() and addToImport() causing multiple insert in
92
+ certain scenarios
56
93
 
57
94
  ## 4.0.1
58
95
 
59
96
  ### Patch Changes
60
97
 
61
- - [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
98
+ - [#20650](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20650)
99
+ [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade
100
+ to TypeScript 4.2.4
62
101
 
63
102
  ## 4.0.0
64
103
 
65
104
  ### Major Changes
66
105
 
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
106
+ - [#20033](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20033)
107
+ [`b29ce16dad8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b29ce16dad8) -
108
+ [ED-14606] Move bitbucket schema, confluence schema, jira schema, and default schema from
109
+ @atlaskit/adf-schema to their own entry points. These new entry points are as follows
68
110
 
69
111
  @atlaskit/adf-schema/schema-bitbucket for:
70
112
 
@@ -96,47 +138,70 @@
96
138
  - getSchemaBasedOnStage
97
139
  - defaultSchemaConfig
98
140
 
99
- This change also includes codemods in @atlaskit/adf-schema to update these entry points. It also introduces a new util function "changeImportEntryPoint" to @atlaskit/codemod-utils to handle this scenario.
141
+ This change also includes codemods in @atlaskit/adf-schema to update these entry points. It also
142
+ introduces a new util function "changeImportEntryPoint" to @atlaskit/codemod-utils to handle this
143
+ scenario.
100
144
 
101
145
  ## 3.4.0
102
146
 
103
147
  ### Minor Changes
104
148
 
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.
149
+ - [#14319](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/14319)
150
+ [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - Adds new
151
+ util `hasImportDeclarationFromAnyPackageEntrypoint`. It works just like `hasImportDeclaration`,
152
+ but instead of searching for an import declaration that has strict equality with a supplied import
153
+ path (e.g. `@atlaskit/theme`), it looks for an import declaration that _starts with_ the supplied
154
+ import path. With that same example, it will match both `@atlaskit/theme` and
155
+ `@atlaskit/theme/typography` — making it easy to choose to run a codemod on a usage regardless of
156
+ the way in which it was imported.
106
157
 
107
158
  ## 3.3.0
108
159
 
109
160
  ### Minor Changes
110
161
 
111
- - [`9729143f07b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9729143f07b) - Add support functions `getDynamicImportName`, `isCallExpressionCalleeImportType`, `isCallExpressionArgumentStringLiteralType`, `isCallExpressionArgumentValueMatches` and `addDynamicImport`.
162
+ - [#13864](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/13864)
163
+ [`9729143f07b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9729143f07b) - Add
164
+ support functions `getDynamicImportName`, `isCallExpressionCalleeImportType`,
165
+ `isCallExpressionArgumentStringLiteralType`, `isCallExpressionArgumentValueMatches` and
166
+ `addDynamicImport`.
112
167
 
113
168
  ## 3.2.2
114
169
 
115
170
  ### Patch Changes
116
171
 
117
- - [`dc04275805a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dc04275805a) - Update types of API addCommentBefore
172
+ - [#12837](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12837)
173
+ [`dc04275805a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dc04275805a) - Update
174
+ types of API addCommentBefore
118
175
 
119
176
  ## 3.2.1
120
177
 
121
178
  ### Patch Changes
122
179
 
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
180
+ - [#11911](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/11911)
181
+ [`d0ef46dee01`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d0ef46dee01) - Removes
182
+ ts-node / cjs bundle switcher from main entrypoint of codemod-utils and updated codemod-cli
183
+ scripts to support
124
184
 
125
185
  ## 3.2.0
126
186
 
127
187
  ### Minor Changes
128
188
 
129
- - [`43412f2b0b1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/43412f2b0b1) - Added few helper functions
189
+ - [#10569](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10569)
190
+ [`43412f2b0b1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/43412f2b0b1) - Added
191
+ few helper functions
130
192
 
131
193
  ### Patch Changes
132
194
 
133
- - [`200ebeada19`](https://bitbucket.org/atlassian/atlassian-frontend/commits/200ebeada19) - Updated codemods to handle edge cases
195
+ - [`200ebeada19`](https://bitbucket.org/atlassian/atlassian-frontend/commits/200ebeada19) - Updated
196
+ codemods to handle edge cases
134
197
 
135
198
  ## 3.1.0
136
199
 
137
200
  ### Minor Changes
138
201
 
139
- - [`2ec9e608acc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ec9e608acc) - Update `addCommentBefore` helper method to:
202
+ - [#10787](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10787)
203
+ [`2ec9e608acc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ec9e608acc) - Update
204
+ `addCommentBefore` helper method to:
140
205
 
141
206
  - Make the message prefix optional.
142
207
  - _The default remains as `TODO: (from codemod)` for backwards compatibility_
@@ -147,41 +212,57 @@
147
212
 
148
213
  ### Major Changes
149
214
 
150
- - [`284a374eed8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/284a374eed8) - Removed `createSkipTest` & `createSkipTestTransformer` transformer from the API. This is a **breaking change**!
215
+ - [#10179](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10179)
216
+ [`284a374eed8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/284a374eed8) - Removed
217
+ `createSkipTest` & `createSkipTestTransformer` transformer from the API. This is a **breaking
218
+ change**!
151
219
 
152
- If you rely on this transformer, you can now depend on it via a new package `@af/skip-inconsistent-tests`.
220
+ If you rely on this transformer, you can now depend on it via a new package
221
+ `@af/skip-inconsistent-tests`.
153
222
 
154
223
  ## 2.2.1
155
224
 
156
225
  ### Patch Changes
157
226
 
158
- - [`1300c88e2cc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1300c88e2cc) - Add shouldApplyTransform to createTransformer so there is a check before transforms are run.
159
- - [`1b6bf93be84`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1b6bf93be84) - Migrate helper functions into codemod-utils
227
+ - [#9756](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9756)
228
+ [`1300c88e2cc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1300c88e2cc) - Add
229
+ shouldApplyTransform to createTransformer so there is a check before transforms are run.
230
+ - [`1b6bf93be84`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1b6bf93be84) - Migrate
231
+ helper functions into codemod-utils
160
232
 
161
233
  ## 2.2.0
162
234
 
163
235
  ### Minor Changes
164
236
 
165
- - [`2474e09dc7f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2474e09dc7f) - Add new method to create a custom Transformer for skip test
237
+ - [#9940](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9940)
238
+ [`2474e09dc7f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2474e09dc7f) - Add new
239
+ method to create a custom Transformer for skip test
166
240
 
167
241
  ## 2.1.2
168
242
 
169
243
  ### Patch Changes
170
244
 
171
- - [`d72b572dfc2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d72b572dfc2) - bumped jscodeshift@^0.11.0
172
- - [`d72b572dfc2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d72b572dfc2) - bumped @types/jscodeshift@^0.11.0
245
+ - [#9832](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9832)
246
+ [`d72b572dfc2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d72b572dfc2) - bumped
247
+ jscodeshift@^0.11.0
248
+ - [`d72b572dfc2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d72b572dfc2) - bumped
249
+ @types/jscodeshift@^0.11.0
173
250
 
174
251
  ## 2.1.1
175
252
 
176
253
  ### Patch Changes
177
254
 
178
- - [`5be80507d82`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5be80507d82) - Fixed a defect in move component to entry point codemod
255
+ - [#8981](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/8981)
256
+ [`5be80507d82`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5be80507d82) - Fixed a
257
+ defect in move component to entry point codemod
179
258
 
180
259
  ## 2.1.0
181
260
 
182
261
  ### Minor Changes
183
262
 
184
- - [`7e295f4d9da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7e295f4d9da) - Added more lower level helpers for writing codemod:
263
+ - [#8169](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/8169)
264
+ [`7e295f4d9da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7e295f4d9da) - Added
265
+ more lower level helpers for writing codemod:
185
266
 
186
267
  - getDefaultSpecifier
187
268
  - getNamedSpecifier
@@ -198,10 +279,14 @@
198
279
 
199
280
  ### Patch Changes
200
281
 
201
- - [`ecc5b95e65`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ecc5b95e65) - ED-11440: Add skipTest to codemod-utils
282
+ - [#7012](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/7012)
283
+ [`ecc5b95e65`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ecc5b95e65) - ED-11440:
284
+ Add skipTest to codemod-utils
202
285
 
203
286
  ## 2.0.0
204
287
 
205
288
  ### Major Changes
206
289
 
207
- - [`f1e5c2be81`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f1e5c2be81) - ED-11335: Initialise codemod-utils package
290
+ - [#6722](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/6722)
291
+ [`f1e5c2be81`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f1e5c2be81) - ED-11335:
292
+ Initialise codemod-utils package
package/LICENSE.md CHANGED
@@ -1,13 +1,11 @@
1
1
  Copyright 2020 Atlassian Pty Ltd
2
2
 
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
4
+ compliance with the License. You may obtain a copy of the License at
6
5
 
7
6
  http://www.apache.org/licenses/LICENSE-2.0
8
7
 
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
8
+ Unless required by applicable law or agreed to in writing, software distributed under the License is
9
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
10
+ implied. See the License for the specific language governing permissions and limitations under the
11
+ License.
@@ -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 ? void 0 : _element$node$opening.push(j.jsxAttribute(j.jsxIdentifier(childProp), j.jsxExpressionContainer(property.value)));
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, _path$node$source;
123
+ var _path$node;
124
124
  return (// @ts-ignore
125
- path === null || path === void 0 ? void 0 : (_path$node = path.node) === null || _path$node === void 0 ? void 0 : (_path$node$source = _path$node.source) === null || _path$node$source === void 0 ? void 0 : _path$node$source.value.toString().startsWith(packageName)
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$value$callee, _path$value$callee$ca, _path$value2, _path$value2$callee, _path$value2$callee$c, _path$value2$callee$c2, _path$value3, _path$value3$callee, _path$value3$callee$c, _path$value3$callee$c2;
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 ? void 0 : (_path$value$callee = _path$value.callee) === null || _path$value$callee === void 0 ? void 0 : (_path$value$callee$ca = _path$value$callee.callee) === null || _path$value$callee$ca === void 0 ? void 0 : _path$value$callee$ca.type) === 'MemberExpression' &&
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 ? void 0 : (_path$value2$callee = _path$value2.callee) === null || _path$value2$callee === void 0 ? void 0 : (_path$value2$callee$c = _path$value2$callee.callee) === null || _path$value2$callee$c === void 0 ? void 0 : (_path$value2$callee$c2 = _path$value2$callee$c.object) === null || _path$value2$callee$c2 === void 0 ? void 0 : _path$value2$callee$c2.name) &&
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 ? void 0 : (_path$value3$callee = _path$value3.callee) === null || _path$value3$callee === void 0 ? void 0 : (_path$value3$callee$c = _path$value3$callee.callee) === null || _path$value3$callee$c === void 0 ? void 0 : (_path$value3$callee$c2 = _path$value3$callee$c.property) === null || _path$value3$callee$c2 === void 0 ? void 0 : _path$value3$callee$c2.name)
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;
@@ -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 ? void 0 : _element$node$opening.push(j.jsxAttribute(j.jsxIdentifier(childProp), j.jsxExpressionContainer(property.value)));
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, _path$node$source;
112
+ var _path$node;
113
113
  return (// @ts-ignore
114
- path === null || path === void 0 ? void 0 : (_path$node = path.node) === null || _path$node === void 0 ? void 0 : (_path$node$source = _path$node.source) === null || _path$node$source === void 0 ? void 0 : _path$node$source.value.toString().startsWith(packageName)
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$value$callee, _path$value$callee$ca, _path$value2, _path$value2$callee, _path$value2$callee$c, _path$value2$callee$c2, _path$value3, _path$value3$callee, _path$value3$callee$c, _path$value3$callee$c2;
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 ? void 0 : (_path$value$callee = _path$value.callee) === null || _path$value$callee === void 0 ? void 0 : (_path$value$callee$ca = _path$value$callee.callee) === null || _path$value$callee$ca === void 0 ? void 0 : _path$value$callee$ca.type) === 'MemberExpression' &&
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 ? void 0 : (_path$value2$callee = _path$value2.callee) === null || _path$value2$callee === void 0 ? void 0 : (_path$value2$callee$c = _path$value2$callee.callee) === null || _path$value2$callee$c === void 0 ? void 0 : (_path$value2$callee$c2 = _path$value2$callee$c.object) === null || _path$value2$callee$c2 === void 0 ? void 0 : _path$value2$callee$c2.name) &&
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 ? void 0 : (_path$value3$callee = _path$value3.callee) === null || _path$value3$callee === void 0 ? void 0 : (_path$value3$callee$c = _path$value3$callee.callee) === null || _path$value3$callee$c === void 0 ? void 0 : (_path$value3$callee$c2 = _path$value3$callee$c.property) === null || _path$value3$callee$c2 === void 0 ? void 0 : _path$value3$callee$c2.name)
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) {
@@ -1,5 +1,4 @@
1
- import core, { API, ASTPath, FileInfo, Options } from 'jscodeshift';
2
- import { Collection } from 'jscodeshift/src/Collection';
1
+ import type { API, ASTPath, Collection, default as core, FileInfo, Options } from 'jscodeshift';
3
2
  declare 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;
4
3
  declare const createRenameFuncFor: (component: string, from: string, to: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
5
4
  declare const createConvertFuncFor: (component: string, from: string, to: string, predicate?: ((value: any) => boolean) | undefined) => (j: core.JSCodeshift, source: Collection<Node>) => void;
@@ -1,5 +1,4 @@
1
- import core, { ASTPath, CallExpression, ImportDeclaration, ImportDefaultSpecifier, ImportSpecifier, JSXAttribute, JSXElement, Program, VariableDeclaration, VariableDeclarator } from 'jscodeshift';
2
- import { Collection } from 'jscodeshift/src/Collection';
1
+ import type { ASTPath, CallExpression, Collection, default as core, ImportDeclaration, ImportDefaultSpecifier, ImportSpecifier, JSXAttribute, JSXElement, Program, VariableDeclaration, VariableDeclarator } from 'jscodeshift';
3
2
  declare function getNamedSpecifier(j: core.JSCodeshift, source: Collection<Node>, specifier: string, importName: string): string | null;
4
3
  declare const getDynamicImportName: (j: core.JSCodeshift, source: Collection<any>, importPath: string) => string | null;
5
4
  declare const addDynamicImport: (j: core.JSCodeshift, target: Collection<VariableDeclaration>, name: string, packageEndpoint: string) => void;
@@ -1,5 +1,4 @@
1
- import core, { API, ASTPath, FileInfo, Options } from 'jscodeshift';
2
- import { Collection } from 'jscodeshift/src/Collection';
1
+ import type { API, ASTPath, Collection, default as core, FileInfo, Options } from 'jscodeshift';
3
2
  declare 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;
4
3
  declare const createRenameFuncFor: (component: string, from: string, to: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
5
4
  declare const createConvertFuncFor: (component: string, from: string, to: string, predicate?: ((value: any) => boolean) | undefined) => (j: core.JSCodeshift, source: Collection<Node>) => void;
@@ -1,5 +1,4 @@
1
- import core, { ASTPath, CallExpression, ImportDeclaration, ImportDefaultSpecifier, ImportSpecifier, JSXAttribute, JSXElement, Program, VariableDeclaration, VariableDeclarator } from 'jscodeshift';
2
- import { Collection } from 'jscodeshift/src/Collection';
1
+ import type { ASTPath, CallExpression, Collection, default as core, ImportDeclaration, ImportDefaultSpecifier, ImportSpecifier, JSXAttribute, JSXElement, Program, VariableDeclaration, VariableDeclarator } from 'jscodeshift';
3
2
  declare function getNamedSpecifier(j: core.JSCodeshift, source: Collection<Node>, specifier: string, importName: string): string | null;
4
3
  declare const getDynamicImportName: (j: core.JSCodeshift, source: Collection<any>, importPath: string) => string | null;
5
4
  declare const addDynamicImport: (j: core.JSCodeshift, target: Collection<VariableDeclaration>, name: string, packageEndpoint: string) => void;
package/package.json CHANGED
@@ -1,70 +1,66 @@
1
1
  {
2
- "name": "@atlaskit/codemod-utils",
3
- "version": "4.2.3",
4
- "author": "Atlassian Pty Ltd",
5
- "license": "Apache-2.0",
6
- "description": " jscodeshift-compatible codemod utilities",
7
- "publishConfig": {
8
- "registry": "https://registry.npmjs.org/"
9
- },
10
- "atlassian": {
11
- "team": "UIP: Frontend Delivery",
12
- "inPublicMirror": false,
13
- "releaseModel": "continuous"
14
- },
15
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
16
- "main": "dist/cjs/index.js",
17
- "module": "dist/esm/index.js",
18
- "module:es2019": "dist/es2019/index.js",
19
- "types": "dist/types/index.d.ts",
20
- "typesVersions": {
21
- ">=4.5 <4.9": {
22
- "*": [
23
- "dist/types-ts4.5/*",
24
- "dist/types-ts4.5/index.d.ts"
25
- ]
26
- }
27
- },
28
- "sideEffects": false,
29
- "atlaskit:src": "src/index.ts",
30
- "af:exports": {
31
- ".": "./src/index.ts"
32
- },
33
- "dependencies": {
34
- "@babel/runtime": "^7.0.0"
35
- },
36
- "devDependencies": {
37
- "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
38
- "@types/jscodeshift": "^0.11.0",
39
- "jscodeshift": "^0.13.0",
40
- "typescript": "~4.9.5"
41
- },
42
- "techstack": {
43
- "@atlassian/frontend": {
44
- "import-structure": [
45
- "atlassian-conventions"
46
- ],
47
- "circular-dependencies": [
48
- "file-and-folder-level"
49
- ]
50
- },
51
- "@repo/internal": {
52
- "analytics": [
53
- "analytics-next"
54
- ],
55
- "design-tokens": [
56
- "color"
57
- ],
58
- "theming": [
59
- "react-context"
60
- ],
61
- "ui-components": [
62
- "lite-mode"
63
- ],
64
- "deprecation": [
65
- "no-deprecated-imports"
66
- ]
67
- }
68
- },
69
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
2
+ "name": "@atlaskit/codemod-utils",
3
+ "version": "4.2.5",
4
+ "author": "Atlassian Pty Ltd",
5
+ "license": "Apache-2.0",
6
+ "description": " jscodeshift-compatible codemod utilities",
7
+ "publishConfig": {
8
+ "registry": "https://registry.npmjs.org/"
9
+ },
10
+ "atlassian": {
11
+ "team": "Build Infra"
12
+ },
13
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
14
+ "main": "dist/cjs/index.js",
15
+ "module": "dist/esm/index.js",
16
+ "module:es2019": "dist/es2019/index.js",
17
+ "types": "dist/types/index.d.ts",
18
+ "typesVersions": {
19
+ ">=4.5 <4.9": {
20
+ "*": [
21
+ "dist/types-ts4.5/*",
22
+ "dist/types-ts4.5/index.d.ts"
23
+ ]
24
+ }
25
+ },
26
+ "sideEffects": false,
27
+ "atlaskit:src": "src/index.ts",
28
+ "af:exports": {
29
+ ".": "./src/index.ts"
30
+ },
31
+ "dependencies": {
32
+ "@babel/runtime": "^7.0.0"
33
+ },
34
+ "devDependencies": {
35
+ "@types/jscodeshift": "^0.11.0",
36
+ "jscodeshift": "^0.16.1",
37
+ "typescript": "~5.4.2"
38
+ },
39
+ "techstack": {
40
+ "@atlassian/frontend": {
41
+ "import-structure": [
42
+ "atlassian-conventions"
43
+ ],
44
+ "circular-dependencies": [
45
+ "file-and-folder-level"
46
+ ]
47
+ },
48
+ "@repo/internal": {
49
+ "analytics": [
50
+ "analytics-next"
51
+ ],
52
+ "design-tokens": [
53
+ "color"
54
+ ],
55
+ "theming": [
56
+ "react-context"
57
+ ],
58
+ "ui-components": [
59
+ "lite-mode"
60
+ ],
61
+ "deprecation": [
62
+ "no-deprecated-imports"
63
+ ]
64
+ }
65
+ }
70
66
  }
package/report.api.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  ## API Report File for "@atlaskit/codemod-utils"
4
4
 
5
- > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
5
+ > Do not edit this file. This report is auto-generated using
6
+ > [API Extractor](https://api-extractor.com/).
6
7
  > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
8
 
8
9
  ### Table of contents
@@ -33,233 +34,227 @@ import { VariableDeclarator } from 'jscodeshift';
33
34
 
34
35
  // @public (undocumented)
35
36
  export function addCommentBefore(
36
- j: core.JSCodeshift,
37
- target:
38
- | Collection<CallExpression>
39
- | Collection<ImportDeclaration>
40
- | Collection<JSXAttribute>
41
- | Collection<JSXElement>
42
- | Collection<Program>
43
- | Collection<VariableDeclarator>,
44
- message: string,
45
- commentType?: 'block' | 'line',
46
- messagePrefix?: string,
37
+ j: core.JSCodeshift,
38
+ target:
39
+ | Collection<CallExpression>
40
+ | Collection<ImportDeclaration>
41
+ | Collection<JSXAttribute>
42
+ | Collection<JSXElement>
43
+ | Collection<Program>
44
+ | Collection<VariableDeclarator>,
45
+ message: string,
46
+ commentType?: 'block' | 'line',
47
+ messagePrefix?: string,
47
48
  ): void;
48
49
 
49
50
  // @public (undocumented)
50
51
  export const addCommentToStartOfFile: ({
51
- j,
52
- base,
53
- message,
52
+ j,
53
+ base,
54
+ message,
54
55
  }: {
55
- j: core.JSCodeshift;
56
- base: Collection<Node>;
57
- message: string;
56
+ j: core.JSCodeshift;
57
+ base: Collection<Node>;
58
+ message: string;
58
59
  }) => void;
59
60
 
60
61
  // @public (undocumented)
61
62
  export const addDynamicImport: (
62
- j: core.JSCodeshift,
63
- target: Collection<VariableDeclaration>,
64
- name: string,
65
- packageEndpoint: string,
63
+ j: core.JSCodeshift,
64
+ target: Collection<VariableDeclaration>,
65
+ name: string,
66
+ packageEndpoint: string,
66
67
  ) => void;
67
68
 
68
69
  // @public (undocumented)
69
70
  export function addToImport(
70
- j: core.JSCodeshift,
71
- base: Collection<any>,
72
- importSpecifier: ImportDefaultSpecifier | ImportSpecifier,
73
- packageName: string,
71
+ j: core.JSCodeshift,
72
+ base: Collection<any>,
73
+ importSpecifier: ImportDefaultSpecifier | ImportSpecifier,
74
+ packageName: string,
74
75
  ): void;
75
76
 
76
77
  // @public (undocumented)
77
78
  export const callExpressionArgMatchesString: (
78
- arg: CallExpression['arguments'][number],
79
- str: string,
79
+ arg: CallExpression['arguments'][number],
80
+ str: string,
80
81
  ) => boolean;
81
82
 
82
83
  // @public (undocumented)
83
84
  export const changeImportEntryPoint: (
84
- oldPackageName: string,
85
- importToConvert: string,
86
- newPackageName: string,
87
- shouldBeTypeImport?: boolean,
85
+ oldPackageName: string,
86
+ importToConvert: string,
87
+ newPackageName: string,
88
+ shouldBeTypeImport?: boolean,
88
89
  ) => (j: core.JSCodeshift, root: Collection<Node>) => void;
89
90
 
90
91
  // @public (undocumented)
91
92
  export const createConvertFuncFor: (
92
- component: string,
93
- from: string,
94
- to: string,
95
- predicate?: ((value: any) => boolean) | undefined,
93
+ component: string,
94
+ from: string,
95
+ to: string,
96
+ predicate?: ((value: any) => boolean) | undefined,
96
97
  ) => (j: core.JSCodeshift, source: Collection<Node>) => void;
97
98
 
98
99
  // @public (undocumented)
99
100
  export const createRemoveFuncAddCommentFor: (
100
- component: string,
101
- prop: string,
102
- comment?: string,
101
+ component: string,
102
+ prop: string,
103
+ comment?: string,
103
104
  ) => (j: core.JSCodeshift, source: Collection<Node>) => void;
104
105
 
105
106
  // @public (undocumented)
106
107
  export const createRemoveFuncFor: (
107
- component: string,
108
- importName: string,
109
- prop: string,
110
- predicate?: (j: core.JSCodeshift, element: ASTPath<any>) => boolean,
111
- comment?: string,
108
+ component: string,
109
+ importName: string,
110
+ prop: string,
111
+ predicate?: (j: core.JSCodeshift, element: ASTPath<any>) => boolean,
112
+ comment?: string,
112
113
  ) => (j: core.JSCodeshift, source: Collection<Node>) => void;
113
114
 
114
115
  // @public (undocumented)
115
116
  export const createRenameFuncFor: (
116
- component: string,
117
- from: string,
118
- to: string,
117
+ component: string,
118
+ from: string,
119
+ to: string,
119
120
  ) => (j: core.JSCodeshift, source: Collection<Node>) => void;
120
121
 
121
122
  // @public (undocumented)
122
123
  export const createRenameImportFor: (
123
- component: string,
124
- from: string,
125
- to: string,
124
+ component: string,
125
+ from: string,
126
+ to: string,
126
127
  ) => (j: core.JSCodeshift, source: Collection<Node>) => void;
127
128
 
128
129
  // @public (undocumented)
129
130
  export const createRenameJSXFunc: (
130
- packagePath: string,
131
- from: string,
132
- to: string,
133
- fallback?: string | undefined,
131
+ packagePath: string,
132
+ from: string,
133
+ to: string,
134
+ fallback?: string | undefined,
134
135
  ) => (j: core.JSCodeshift, source: any) => void;
135
136
 
136
137
  // @public (undocumented)
137
138
  export const createTransformer: (
138
- migrates: ((j: core.JSCodeshift, source: Collection<Node>) => void)[],
139
- shouldApplyTransform?:
140
- | ((j: core.JSCodeshift, source: Collection<Node>) => boolean)
141
- | undefined,
139
+ migrates: ((j: core.JSCodeshift, source: Collection<Node>) => void)[],
140
+ shouldApplyTransform?: ((j: core.JSCodeshift, source: Collection<Node>) => boolean) | undefined,
142
141
  ) => (fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) => string;
143
142
 
144
143
  // @public (undocumented)
145
144
  export const doesIdentifierExist: (
146
- j: core.JSCodeshift,
147
- base: Collection<any>,
148
- name: string,
145
+ j: core.JSCodeshift,
146
+ base: Collection<any>,
147
+ name: string,
149
148
  ) => boolean;
150
149
 
151
150
  // @public (undocumented)
152
151
  export const elevateComponentToNewEntryPoint: (
153
- pkg: string,
154
- toPkg: string,
155
- innerElementName: string,
152
+ pkg: string,
153
+ toPkg: string,
154
+ innerElementName: string,
156
155
  ) => (j: core.JSCodeshift, root: any) => void;
157
156
 
158
157
  // @public (undocumented)
159
158
  export const flattenCertainChildPropsAsProp: (
160
- component: string,
161
- propName: string,
162
- childProps: string[],
159
+ component: string,
160
+ propName: string,
161
+ childProps: string[],
163
162
  ) => (j: core.JSCodeshift, source: Collection<Node>) => void;
164
163
 
165
164
  // @public (undocumented)
166
165
  export const getDefaultSpecifier: (
167
- j: core.JSCodeshift,
168
- source: Collection<Node>,
169
- specifier: string,
166
+ j: core.JSCodeshift,
167
+ source: Collection<Node>,
168
+ specifier: string,
170
169
  ) => null | string;
171
170
 
172
171
  // @public (undocumented)
173
172
  export const getDynamicImportName: (
174
- j: core.JSCodeshift,
175
- source: Collection<any>,
176
- importPath: string,
173
+ j: core.JSCodeshift,
174
+ source: Collection<any>,
175
+ importPath: string,
177
176
  ) => null | string;
178
177
 
179
178
  // @public (undocumented)
180
179
  export const getJSXAttributesByName: (
181
- j: core.JSCodeshift,
182
- element: ASTPath<any>,
183
- attributeName: string,
180
+ j: core.JSCodeshift,
181
+ element: ASTPath<any>,
182
+ attributeName: string,
184
183
  ) => Collection<JSXAttribute>;
185
184
 
186
185
  // @public (undocumented)
187
186
  export function getNamedSpecifier(
188
- j: core.JSCodeshift,
189
- source: Collection<Node>,
190
- specifier: string,
191
- importName: string,
187
+ j: core.JSCodeshift,
188
+ source: Collection<Node>,
189
+ specifier: string,
190
+ importName: string,
192
191
  ): null | string;
193
192
 
194
193
  // @public (undocumented)
195
194
  export function getSafeImportName({
196
- j,
197
- base,
198
- currentDefaultSpecifierName,
199
- desiredName,
200
- fallbackName,
195
+ j,
196
+ base,
197
+ currentDefaultSpecifierName,
198
+ desiredName,
199
+ fallbackName,
201
200
  }: {
202
- j: core.JSCodeshift;
203
- base: Collection<any>;
204
- currentDefaultSpecifierName: null | string;
205
- desiredName: string;
206
- fallbackName: string;
201
+ j: core.JSCodeshift;
202
+ base: Collection<any>;
203
+ currentDefaultSpecifierName: null | string;
204
+ desiredName: string;
205
+ fallbackName: string;
207
206
  }): string;
208
207
 
209
208
  // @public (undocumented)
210
209
  export const hasImportDeclaration: (
211
- j: core.JSCodeshift,
212
- source: Collection<Node>,
213
- importPath: string,
210
+ j: core.JSCodeshift,
211
+ source: Collection<Node>,
212
+ importPath: string,
214
213
  ) => boolean;
215
214
 
216
215
  // @public (undocumented)
217
216
  export const hasImportDeclarationFromAnyPackageEntrypoint: (
218
- j: core.JSCodeshift,
219
- source: Collection<Node>,
220
- packageName: string,
217
+ j: core.JSCodeshift,
218
+ source: Collection<Node>,
219
+ packageName: string,
221
220
  ) => boolean;
222
221
 
223
222
  // @public (undocumented)
224
223
  export const hasJSXAttributesByName: (
225
- j: core.JSCodeshift,
226
- element: ASTPath<any>,
227
- attributeName: string,
224
+ j: core.JSCodeshift,
225
+ element: ASTPath<any>,
226
+ attributeName: string,
228
227
  ) => boolean;
229
228
 
230
229
  // @public (undocumented)
231
- export function removeImport(
232
- j: core.JSCodeshift,
233
- base: Collection<any>,
234
- packageName: string,
235
- ): void;
230
+ export function removeImport(j: core.JSCodeshift, base: Collection<any>, packageName: string): void;
236
231
 
237
232
  // @public (undocumented)
238
233
  export const renameNamedImportWithAliasName: (
239
- component: string,
240
- from: string,
241
- to: string,
234
+ component: string,
235
+ from: string,
236
+ to: string,
242
237
  ) => (j: core.JSCodeshift, source: Collection<Node>) => void;
243
238
 
244
239
  // @public (undocumented)
245
240
  export const replaceImportStatementFor: (
246
- pkg: string,
247
- convertMap: any,
241
+ pkg: string,
242
+ convertMap: any,
248
243
  ) => (j: core.JSCodeshift, root: Collection<Node>) => void;
249
244
 
250
245
  // @public (undocumented)
251
246
  export const testMethodVariantEach: (
252
- path: ASTPath<CallExpression>,
253
- testMethods: Set<string>,
247
+ path: ASTPath<CallExpression>,
248
+ testMethods: Set<string>,
254
249
  ) => boolean;
255
250
 
256
251
  // @public (undocumented)
257
252
  export function tryCreateImport(
258
- j: core.JSCodeshift,
259
- base: Collection<any>,
260
- relativeToPackage: string,
261
- packageName: string,
262
- shouldBeTypeImport?: boolean,
253
+ j: core.JSCodeshift,
254
+ base: Collection<any>,
255
+ relativeToPackage: string,
256
+ packageName: string,
257
+ shouldBeTypeImport?: boolean,
263
258
  ): void;
264
259
 
265
260
  // (No @packageDocumentation comment for this package)
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/codemod-utils",
3
- "version": "4.2.3",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/codemod-utils",
3
- "version": "4.2.3",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/codemod-utils",
3
- "version": "4.2.3",
4
- "sideEffects": false
5
- }
@@ -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
- ```