@atlaskit/codemod-utils 4.2.2 → 4.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,64 +1,76 @@
1
1
  # @atlaskit/codemod-utils
2
2
 
3
+ ## 4.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116) [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) - Upgrade Typescript from `4.9.5` to `5.4.2`
8
+
9
+ ## 4.2.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443) [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing unused dependencies and dev dependencies
14
+
3
15
  ## 4.2.2
4
16
 
5
17
  ### Patch Changes
6
18
 
7
- - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
19
+ - [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793) [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
8
20
 
9
21
  ## 4.2.1
10
22
 
11
23
  ### Patch Changes
12
24
 
13
- - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
25
+ - [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649) [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
14
26
 
15
27
  ## 4.2.0
16
28
 
17
29
  ### Minor Changes
18
30
 
19
- - [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
31
+ - [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258) [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
20
32
 
21
33
  ## 4.1.3
22
34
 
23
35
  ### Patch Changes
24
36
 
25
- - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
37
+ - [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874) [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
26
38
 
27
39
  ## 4.1.2
28
40
 
29
41
  ### Patch Changes
30
42
 
31
- - [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
43
+ - [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492) [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
32
44
 
33
45
  ## 4.1.1
34
46
 
35
47
  ### Patch Changes
36
48
 
37
- - [`edc6fef0c8f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/edc6fef0c8f) - Fix printf format specifier matching within `matchesStringWithFormatSpecifier` for fuzzy matching interpolated placeholder values
49
+ - [#23836](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/23836) [`edc6fef0c8f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/edc6fef0c8f) - Fix printf format specifier matching within `matchesStringWithFormatSpecifier` for fuzzy matching interpolated placeholder values
38
50
 
39
51
  ## 4.1.0
40
52
 
41
53
  ### Minor Changes
42
54
 
43
- - [`e4624adcb2f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e4624adcb2f) - ED-14608: Update codemod-utils to support type import entry point changes in changeImportEntryPoint, remove adf-utils from repo stricter lint exclusion lists
55
+ - [#21570](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/21570) [`e4624adcb2f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e4624adcb2f) - ED-14608: Update codemod-utils to support type import entry point changes in changeImportEntryPoint, remove adf-utils from repo stricter lint exclusion lists
44
56
 
45
57
  ## 4.0.2
46
58
 
47
59
  ### Patch Changes
48
60
 
49
- - [`9358d42eeaa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9358d42eeaa) - NO-ISSUE: fixed codemod utils tryCreateImport() and addToImport() causing multiple insert in certain scenarios
61
+ - [#21152](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/21152) [`9358d42eeaa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9358d42eeaa) - NO-ISSUE: fixed codemod utils tryCreateImport() and addToImport() causing multiple insert in certain scenarios
50
62
 
51
63
  ## 4.0.1
52
64
 
53
65
  ### Patch Changes
54
66
 
55
- - [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
67
+ - [#20650](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20650) [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
56
68
 
57
69
  ## 4.0.0
58
70
 
59
71
  ### Major Changes
60
72
 
61
- - [`b29ce16dad8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b29ce16dad8) - [ED-14606] Move bitbucket schema, confluence schema, jira schema, and default schema from @atlaskit/adf-schema to their own entry points. These new entry points are as follows
73
+ - [#20033](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20033) [`b29ce16dad8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b29ce16dad8) - [ED-14606] Move bitbucket schema, confluence schema, jira schema, and default schema from @atlaskit/adf-schema to their own entry points. These new entry points are as follows
62
74
 
63
75
  @atlaskit/adf-schema/schema-bitbucket for:
64
76
 
@@ -96,31 +108,31 @@
96
108
 
97
109
  ### Minor Changes
98
110
 
99
- - [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - Adds new util `hasImportDeclarationFromAnyPackageEntrypoint`. It works just like `hasImportDeclaration`, but instead of searching for an import declaration that has strict equality with a supplied import path (e.g. `@atlaskit/theme`), it looks for an import declaration that _starts with_ the supplied import path. With that same example, it will match both `@atlaskit/theme` and `@atlaskit/theme/typography` — making it easy to choose to run a codemod on a usage regardless of the way in which it was imported.
111
+ - [#14319](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/14319) [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - Adds new util `hasImportDeclarationFromAnyPackageEntrypoint`. It works just like `hasImportDeclaration`, but instead of searching for an import declaration that has strict equality with a supplied import path (e.g. `@atlaskit/theme`), it looks for an import declaration that _starts with_ the supplied import path. With that same example, it will match both `@atlaskit/theme` and `@atlaskit/theme/typography` — making it easy to choose to run a codemod on a usage regardless of the way in which it was imported.
100
112
 
101
113
  ## 3.3.0
102
114
 
103
115
  ### Minor Changes
104
116
 
105
- - [`9729143f07b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9729143f07b) - Add support functions `getDynamicImportName`, `isCallExpressionCalleeImportType`, `isCallExpressionArgumentStringLiteralType`, `isCallExpressionArgumentValueMatches` and `addDynamicImport`.
117
+ - [#13864](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/13864) [`9729143f07b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9729143f07b) - Add support functions `getDynamicImportName`, `isCallExpressionCalleeImportType`, `isCallExpressionArgumentStringLiteralType`, `isCallExpressionArgumentValueMatches` and `addDynamicImport`.
106
118
 
107
119
  ## 3.2.2
108
120
 
109
121
  ### Patch Changes
110
122
 
111
- - [`dc04275805a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dc04275805a) - Update types of API addCommentBefore
123
+ - [#12837](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12837) [`dc04275805a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dc04275805a) - Update types of API addCommentBefore
112
124
 
113
125
  ## 3.2.1
114
126
 
115
127
  ### Patch Changes
116
128
 
117
- - [`d0ef46dee01`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d0ef46dee01) - Removes ts-node / cjs bundle switcher from main entrypoint of codemod-utils and updated codemod-cli scripts to support
129
+ - [#11911](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/11911) [`d0ef46dee01`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d0ef46dee01) - Removes ts-node / cjs bundle switcher from main entrypoint of codemod-utils and updated codemod-cli scripts to support
118
130
 
119
131
  ## 3.2.0
120
132
 
121
133
  ### Minor Changes
122
134
 
123
- - [`43412f2b0b1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/43412f2b0b1) - Added few helper functions
135
+ - [#10569](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10569) [`43412f2b0b1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/43412f2b0b1) - Added few helper functions
124
136
 
125
137
  ### Patch Changes
126
138
 
@@ -130,7 +142,7 @@
130
142
 
131
143
  ### Minor Changes
132
144
 
133
- - [`2ec9e608acc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ec9e608acc) - Update `addCommentBefore` helper method to:
145
+ - [#10787](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10787) [`2ec9e608acc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ec9e608acc) - Update `addCommentBefore` helper method to:
134
146
 
135
147
  - Make the message prefix optional.
136
148
  - _The default remains as `TODO: (from codemod)` for backwards compatibility_
@@ -141,7 +153,7 @@
141
153
 
142
154
  ### Major Changes
143
155
 
144
- - [`284a374eed8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/284a374eed8) - Removed `createSkipTest` & `createSkipTestTransformer` transformer from the API. This is a **breaking change**!
156
+ - [#10179](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10179) [`284a374eed8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/284a374eed8) - Removed `createSkipTest` & `createSkipTestTransformer` transformer from the API. This is a **breaking change**!
145
157
 
146
158
  If you rely on this transformer, you can now depend on it via a new package `@af/skip-inconsistent-tests`.
147
159
 
@@ -149,33 +161,33 @@
149
161
 
150
162
  ### Patch Changes
151
163
 
152
- - [`1300c88e2cc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1300c88e2cc) - Add shouldApplyTransform to createTransformer so there is a check before transforms are run.
164
+ - [#9756](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9756) [`1300c88e2cc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1300c88e2cc) - Add shouldApplyTransform to createTransformer so there is a check before transforms are run.
153
165
  - [`1b6bf93be84`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1b6bf93be84) - Migrate helper functions into codemod-utils
154
166
 
155
167
  ## 2.2.0
156
168
 
157
169
  ### Minor Changes
158
170
 
159
- - [`2474e09dc7f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2474e09dc7f) - Add new method to create a custom Transformer for skip test
171
+ - [#9940](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9940) [`2474e09dc7f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2474e09dc7f) - Add new method to create a custom Transformer for skip test
160
172
 
161
173
  ## 2.1.2
162
174
 
163
175
  ### Patch Changes
164
176
 
165
- - [`d72b572dfc2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d72b572dfc2) - bumped jscodeshift@^0.11.0
177
+ - [#9832](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9832) [`d72b572dfc2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d72b572dfc2) - bumped jscodeshift@^0.11.0
166
178
  - [`d72b572dfc2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d72b572dfc2) - bumped @types/jscodeshift@^0.11.0
167
179
 
168
180
  ## 2.1.1
169
181
 
170
182
  ### Patch Changes
171
183
 
172
- - [`5be80507d82`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5be80507d82) - Fixed a defect in move component to entry point codemod
184
+ - [#8981](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/8981) [`5be80507d82`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5be80507d82) - Fixed a defect in move component to entry point codemod
173
185
 
174
186
  ## 2.1.0
175
187
 
176
188
  ### Minor Changes
177
189
 
178
- - [`7e295f4d9da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7e295f4d9da) - Added more lower level helpers for writing codemod:
190
+ - [#8169](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/8169) [`7e295f4d9da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7e295f4d9da) - Added more lower level helpers for writing codemod:
179
191
 
180
192
  - getDefaultSpecifier
181
193
  - getNamedSpecifier
@@ -192,10 +204,10 @@
192
204
 
193
205
  ### Patch Changes
194
206
 
195
- - [`ecc5b95e65`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ecc5b95e65) - ED-11440: Add skipTest to codemod-utils
207
+ - [#7012](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/7012) [`ecc5b95e65`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ecc5b95e65) - ED-11440: Add skipTest to codemod-utils
196
208
 
197
209
  ## 2.0.0
198
210
 
199
211
  ### Major Changes
200
212
 
201
- - [`f1e5c2be81`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f1e5c2be81) - ED-11335: Initialise codemod-utils package
213
+ - [#6722](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/6722) [`f1e5c2be81`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f1e5c2be81) - ED-11335: Initialise codemod-utils package
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/codemod-utils",
3
- "version": "4.2.2",
3
+ "version": "4.2.4",
4
4
  "author": "Atlassian Pty Ltd",
5
5
  "license": "Apache-2.0",
6
6
  "description": " jscodeshift-compatible codemod utilities",
@@ -12,7 +12,7 @@
12
12
  "inPublicMirror": false,
13
13
  "releaseModel": "continuous"
14
14
  },
15
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
15
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
16
16
  "main": "dist/cjs/index.js",
17
17
  "module": "dist/esm/index.js",
18
18
  "module:es2019": "dist/es2019/index.js",
@@ -34,11 +34,10 @@
34
34
  "@babel/runtime": "^7.0.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@atlaskit/docs": "*",
38
37
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
39
38
  "@types/jscodeshift": "^0.11.0",
40
39
  "jscodeshift": "^0.13.0",
41
- "typescript": "~4.9.5"
40
+ "typescript": "~5.4.2"
42
41
  },
43
42
  "techstack": {
44
43
  "@atlassian/frontend": {
@@ -68,4 +67,4 @@
68
67
  }
69
68
  },
70
69
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
71
- }
70
+ }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/codemod-utils",
3
- "version": "4.2.2",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/codemod-utils",
3
- "version": "4.2.2",
4
- "sideEffects": false
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@atlaskit/codemod-utils",
3
- "version": "4.2.2",
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
- ```