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