@atlaskit/codemod-cli 0.32.2 → 0.33.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.
@@ -0,0 +1,381 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
+ import { getImportDeclaration } from '@hypermod/utils';
3
+ var TAG_ENTRY_POINT = '@atlaskit/tag';
4
+ var TAG_REMOVABLE_ENTRY_POINT = '@atlaskit/tag/removable-tag';
5
+ var TAG_SIMPLE_ENTRY_POINT = '@atlaskit/tag/simple-tag';
6
+ var AVATAR_ENTRY_POINT = '@atlaskit/avatar';
7
+ var PRINT_SETTINGS = {
8
+ quote: 'single'
9
+ };
10
+
11
+ // Color mapping from Light versions to non-light versions
12
+ var COLOR_MAP = {
13
+ limeLight: 'lime',
14
+ orangeLight: 'orange',
15
+ magentaLight: 'magenta',
16
+ greenLight: 'green',
17
+ blueLight: 'blue',
18
+ redLight: 'red',
19
+ purpleLight: 'purple',
20
+ greyLight: 'gray',
21
+ // Note: grey -> gray spelling change
22
+ tealLight: 'teal',
23
+ yellowLight: 'yellow',
24
+ grey: 'gray' // Also handle non-light grey -> gray
25
+ };
26
+
27
+ // Valid target color values that don't need migration
28
+ var VALID_COLORS = new Set(['lime', 'orange', 'magenta', 'green', 'blue', 'red', 'purple', 'gray', 'teal', 'yellow', 'standard']);
29
+ /**
30
+ * Check if a JSX expression is an Avatar component from '@atlaskit/avatar'
31
+ */
32
+ function isAvatarComponent(expression) {
33
+ // Handle <Avatar ... />
34
+ if (expression.type === 'JSXElement') {
35
+ var _openingElement$name;
36
+ var openingElement = expression.openingElement;
37
+ if (((_openingElement$name = openingElement.name) === null || _openingElement$name === void 0 ? void 0 : _openingElement$name.type) === 'JSXIdentifier') {
38
+ return openingElement.name.name === 'Avatar';
39
+ }
40
+ }
41
+ return false;
42
+ }
43
+
44
+ /**
45
+ * Check if elemBefore contains only an Avatar component (directly or via render props)
46
+ */
47
+ function hasOnlyAvatarInElemBefore(attr) {
48
+ var _attr$value;
49
+ if (((_attr$value = attr.value) === null || _attr$value === void 0 ? void 0 : _attr$value.type) === 'JSXExpressionContainer') {
50
+ var expression = attr.value.expression;
51
+
52
+ // Direct Avatar: elemBefore={<Avatar />}
53
+ if (isAvatarComponent(expression)) {
54
+ return {
55
+ isAvatar: true,
56
+ avatarJSX: expression
57
+ };
58
+ }
59
+
60
+ // Render props: elemBefore={(props) => <Avatar {...props} />}
61
+ if ((expression.type === 'ArrowFunctionExpression' || expression.type === 'FunctionExpression') && expression.body) {
62
+ // Check if the function body is an Avatar component
63
+ var body = expression.body;
64
+ if (isAvatarComponent(body)) {
65
+ return {
66
+ isAvatar: true,
67
+ avatarJSX: body
68
+ };
69
+ }
70
+ }
71
+ }
72
+ return {
73
+ isAvatar: false
74
+ };
75
+ }
76
+
77
+ /**
78
+ * Extract string value from a JSX attribute value
79
+ */
80
+ function extractStringValue(attrValue) {
81
+ if (!attrValue) {
82
+ return null;
83
+ }
84
+ if (attrValue.type === 'StringLiteral') {
85
+ return attrValue.value;
86
+ }
87
+ if (attrValue.type === 'JSXExpressionContainer') {
88
+ var expression = attrValue.expression;
89
+ if (expression.type === 'StringLiteral') {
90
+ return expression.value;
91
+ }
92
+ }
93
+ return null;
94
+ }
95
+
96
+ /**
97
+ * Find an attribute by name in the attributes array
98
+ */
99
+ function findAttribute(attributes, attrName) {
100
+ return attributes === null || attributes === void 0 ? void 0 : attributes.find(function (attr) {
101
+ var _attr$name;
102
+ return attr.type === 'JSXAttribute' && ((_attr$name = attr.name) === null || _attr$name === void 0 ? void 0 : _attr$name.type) === 'JSXIdentifier' && attr.name.name === attrName;
103
+ });
104
+ }
105
+
106
+ /**
107
+ * Codemod to migrate Tag components to new Tag/AvatarTag API.
108
+ *
109
+ * This codemod:
110
+ * 1. Identifies all Tag imports from various entry points
111
+ * 2. For tags with elemBefore containing only Avatar:
112
+ * - Migrates to AvatarTag from '@atlaskit/tag'
113
+ * - Renames elemBefore to avatar
114
+ * - Converts avatar to render props function
115
+ * - Removes color prop
116
+ * - Adds isRemovable={false} if original was SimpleTag
117
+ * 3. For other tags:
118
+ * - Migrates to default import from '@atlaskit/tag'
119
+ * - Removes appearance prop
120
+ * - Migrates color values using COLOR_MAP
121
+ * - Adds isRemovable={false} if original was SimpleTag
122
+ * - Adds comment for manual migration if color can't be mapped
123
+ */
124
+ export default function transformer(file, api) {
125
+ var j = api.jscodeshift;
126
+ var source = j(file.source);
127
+
128
+ // Track all Tag identifiers and whether they were SimpleTag
129
+ var tagIdentifiers = new Map();
130
+
131
+ // Find all Tag imports from main entry point
132
+ var mainTagImports = getImportDeclaration(j, source, TAG_ENTRY_POINT);
133
+ mainTagImports.forEach(function (importPath) {
134
+ var _importPath$value$spe;
135
+ (_importPath$value$spe = importPath.value.specifiers) === null || _importPath$value$spe === void 0 || _importPath$value$spe.forEach(function (specifier) {
136
+ var _specifier$imported;
137
+ if (specifier.type === 'ImportDefaultSpecifier') {
138
+ var _specifier$local, _specifier$local2;
139
+ // import Tag from '@atlaskit/tag' -> RemovableTag (default)
140
+ tagIdentifiers.set(((_specifier$local = specifier.local) === null || _specifier$local === void 0 ? void 0 : _specifier$local.name) || 'Tag', {
141
+ localName: ((_specifier$local2 = specifier.local) === null || _specifier$local2 === void 0 ? void 0 : _specifier$local2.name) || 'Tag',
142
+ isSimpleTag: false
143
+ });
144
+ } else if (specifier.type === 'ImportSpecifier' && ((_specifier$imported = specifier.imported) === null || _specifier$imported === void 0 ? void 0 : _specifier$imported.type) === 'Identifier') {
145
+ var _specifier$local3;
146
+ var localName = ((_specifier$local3 = specifier.local) === null || _specifier$local3 === void 0 ? void 0 : _specifier$local3.name) || specifier.imported.name;
147
+ if (specifier.imported.name === 'SimpleTag') {
148
+ // import { SimpleTag } from '@atlaskit/tag'
149
+ tagIdentifiers.set(localName, {
150
+ localName: localName,
151
+ isSimpleTag: true
152
+ });
153
+ } else if (specifier.imported.name === 'RemovableTag') {
154
+ // import { RemovableTag } from '@atlaskit/tag'
155
+ tagIdentifiers.set(localName, {
156
+ localName: localName,
157
+ isSimpleTag: false
158
+ });
159
+ }
160
+ }
161
+ });
162
+ });
163
+
164
+ // Find imports from removable-tag entry point
165
+ var removableTagImports = getImportDeclaration(j, source, TAG_REMOVABLE_ENTRY_POINT);
166
+ removableTagImports.forEach(function (importPath) {
167
+ var _importPath$value$spe2;
168
+ (_importPath$value$spe2 = importPath.value.specifiers) === null || _importPath$value$spe2 === void 0 || _importPath$value$spe2.forEach(function (specifier) {
169
+ if (specifier.type === 'ImportDefaultSpecifier') {
170
+ var _specifier$local4, _specifier$local5;
171
+ // import RemovableTag from '@atlaskit/tag/removable-tag'
172
+ tagIdentifiers.set(((_specifier$local4 = specifier.local) === null || _specifier$local4 === void 0 ? void 0 : _specifier$local4.name) || 'RemovableTag', {
173
+ localName: ((_specifier$local5 = specifier.local) === null || _specifier$local5 === void 0 ? void 0 : _specifier$local5.name) || 'RemovableTag',
174
+ isSimpleTag: false
175
+ });
176
+ }
177
+ });
178
+ });
179
+
180
+ // Find imports from simple-tag entry point
181
+ var simpleTagImports = getImportDeclaration(j, source, TAG_SIMPLE_ENTRY_POINT);
182
+ simpleTagImports.forEach(function (importPath) {
183
+ var _importPath$value$spe3;
184
+ (_importPath$value$spe3 = importPath.value.specifiers) === null || _importPath$value$spe3 === void 0 || _importPath$value$spe3.forEach(function (specifier) {
185
+ if (specifier.type === 'ImportDefaultSpecifier') {
186
+ var _specifier$local6, _specifier$local7;
187
+ // import SimpleTag from '@atlaskit/tag/simple-tag'
188
+ tagIdentifiers.set(((_specifier$local6 = specifier.local) === null || _specifier$local6 === void 0 ? void 0 : _specifier$local6.name) || 'SimpleTag', {
189
+ localName: ((_specifier$local7 = specifier.local) === null || _specifier$local7 === void 0 ? void 0 : _specifier$local7.name) || 'SimpleTag',
190
+ isSimpleTag: true
191
+ });
192
+ }
193
+ });
194
+ });
195
+
196
+ // If no Tag imports found, exit early
197
+ if (tagIdentifiers.size === 0) {
198
+ return file.source;
199
+ }
200
+
201
+ // Check if Avatar is imported
202
+ var avatarImports = getImportDeclaration(j, source, AVATAR_ENTRY_POINT);
203
+ var hasAvatarImport = avatarImports.length > 0;
204
+
205
+ // Track which tags need AvatarTag vs regular Tag
206
+ var tagsToMigrateToAvatarTag = new Set();
207
+ var tagsNeedingManualMigration = new Set();
208
+ var hasRegularTagUsage = false; // Track if any tag remains as regular Tag
209
+
210
+ // Find and process all Tag JSX elements
211
+ source.find(j.JSXElement).forEach(function (path) {
212
+ var _openingElement$name2;
213
+ var openingElement = path.value.openingElement;
214
+ if (((_openingElement$name2 = openingElement.name) === null || _openingElement$name2 === void 0 ? void 0 : _openingElement$name2.type) === 'JSXIdentifier' && tagIdentifiers.has(openingElement.name.name)) {
215
+ var componentName = openingElement.name.name;
216
+ var tagInfo = tagIdentifiers.get(componentName);
217
+ var attributes = openingElement.attributes || [];
218
+
219
+ // Check for elemBefore with Avatar
220
+ var elemBeforeAttr = findAttribute(attributes, 'elemBefore');
221
+ var colorAttr = findAttribute(attributes, 'color');
222
+ var shouldMigrateToAvatarTag = false;
223
+ if (elemBeforeAttr && hasAvatarImport) {
224
+ var _hasOnlyAvatarInElemB = hasOnlyAvatarInElemBefore(elemBeforeAttr),
225
+ isAvatar = _hasOnlyAvatarInElemB.isAvatar,
226
+ avatarJSX = _hasOnlyAvatarInElemB.avatarJSX;
227
+ if (isAvatar && avatarJSX) {
228
+ var _path$value$closingEl, _elemBeforeAttr$name, _elemBeforeAttr$value;
229
+ shouldMigrateToAvatarTag = true;
230
+ tagsToMigrateToAvatarTag.add(componentName);
231
+
232
+ // Rename component to AvatarTag
233
+ openingElement.name.name = 'AvatarTag';
234
+ if (((_path$value$closingEl = path.value.closingElement) === null || _path$value$closingEl === void 0 || (_path$value$closingEl = _path$value$closingEl.name) === null || _path$value$closingEl === void 0 ? void 0 : _path$value$closingEl.type) === 'JSXIdentifier') {
235
+ path.value.closingElement.name.name = 'AvatarTag';
236
+ }
237
+
238
+ // Rename elemBefore to avatar
239
+ if (((_elemBeforeAttr$name = elemBeforeAttr.name) === null || _elemBeforeAttr$name === void 0 ? void 0 : _elemBeforeAttr$name.type) === 'JSXIdentifier') {
240
+ elemBeforeAttr.name.name = 'avatar';
241
+ }
242
+
243
+ // Convert avatar to render props function if not already
244
+ if (((_elemBeforeAttr$value = elemBeforeAttr.value) === null || _elemBeforeAttr$value === void 0 ? void 0 : _elemBeforeAttr$value.type) === 'JSXExpressionContainer') {
245
+ var expression = elemBeforeAttr.value.expression;
246
+
247
+ // If it's a direct Avatar component, convert to render props
248
+ if (isAvatarComponent(expression)) {
249
+ // Create: (avatarProps) => <Avatar {...avatarProps} originalProps... />
250
+ var avatarElement = expression;
251
+ var avatarAttributes = avatarElement.openingElement.attributes || [];
252
+
253
+ // Build new attributes with spread first, then existing props
254
+ var newAttributes = [j.jsxSpreadAttribute(j.identifier('avatarProps'))].concat(_toConsumableArray(avatarAttributes));
255
+ avatarElement.openingElement.attributes = newAttributes;
256
+
257
+ // Wrap in arrow function
258
+ var renderPropsFunc = j.arrowFunctionExpression([j.identifier('avatarProps')], avatarElement);
259
+ elemBeforeAttr.value.expression = renderPropsFunc;
260
+ }
261
+ // If it's already a function, leave it as is
262
+ }
263
+
264
+ // Remove color prop
265
+ openingElement.attributes = (openingElement.attributes || []).filter(function (attr) {
266
+ var _attr$name2;
267
+ if (attr.type === 'JSXAttribute' && ((_attr$name2 = attr.name) === null || _attr$name2 === void 0 ? void 0 : _attr$name2.type) === 'JSXIdentifier') {
268
+ return attr.name.name !== 'color';
269
+ }
270
+ return true;
271
+ });
272
+ }
273
+ }
274
+ if (!shouldMigrateToAvatarTag) {
275
+ var _path$value$closingEl2;
276
+ // Keep as regular Tag, rename to "Tag" if needed
277
+ hasRegularTagUsage = true;
278
+ openingElement.name.name = 'Tag';
279
+ if (((_path$value$closingEl2 = path.value.closingElement) === null || _path$value$closingEl2 === void 0 || (_path$value$closingEl2 = _path$value$closingEl2.name) === null || _path$value$closingEl2 === void 0 ? void 0 : _path$value$closingEl2.type) === 'JSXIdentifier') {
280
+ path.value.closingElement.name.name = 'Tag';
281
+ }
282
+
283
+ // Migrate color if present
284
+ if (colorAttr) {
285
+ var colorValue = extractStringValue(colorAttr.value);
286
+ if (colorValue && COLOR_MAP[colorValue]) {
287
+ var _colorAttr$value, _colorAttr$value2;
288
+ // Update the color value
289
+ if (((_colorAttr$value = colorAttr.value) === null || _colorAttr$value === void 0 ? void 0 : _colorAttr$value.type) === 'StringLiteral') {
290
+ colorAttr.value.value = COLOR_MAP[colorValue];
291
+ } else if (((_colorAttr$value2 = colorAttr.value) === null || _colorAttr$value2 === void 0 ? void 0 : _colorAttr$value2.type) === 'JSXExpressionContainer') {
292
+ var _expression = colorAttr.value.expression;
293
+ if (_expression.type === 'StringLiteral') {
294
+ _expression.value = COLOR_MAP[colorValue];
295
+ }
296
+ }
297
+ } else if (colorValue && !COLOR_MAP[colorValue] && !VALID_COLORS.has(colorValue)) {
298
+ // Color value is unknown/custom - mark for manual migration
299
+ tagsNeedingManualMigration.add(path);
300
+ }
301
+ }
302
+ }
303
+
304
+ // Remove appearance prop (for both AvatarTag and Tag)
305
+ openingElement.attributes = (openingElement.attributes || []).filter(function (attr) {
306
+ var _attr$name3;
307
+ if (attr.type === 'JSXAttribute' && ((_attr$name3 = attr.name) === null || _attr$name3 === void 0 ? void 0 : _attr$name3.type) === 'JSXIdentifier') {
308
+ return attr.name.name !== 'appearance';
309
+ }
310
+ return true;
311
+ });
312
+
313
+ // Add isRemovable={false} if original was SimpleTag and prop doesn't exist
314
+ if (tagInfo.isSimpleTag && !findAttribute(openingElement.attributes || [], 'isRemovable')) {
315
+ openingElement.attributes = openingElement.attributes || [];
316
+ openingElement.attributes.push(j.jsxAttribute(j.jsxIdentifier('isRemovable'), j.jsxExpressionContainer(j.booleanLiteral(false))));
317
+ }
318
+ }
319
+ });
320
+
321
+ // Add comments for manual migration
322
+ tagsNeedingManualMigration.forEach(function (path) {
323
+ var comment = ' TODO: Manual migration needed - color prop value could not be automatically migrated ';
324
+ j(path).forEach(function (p) {
325
+ var node = p.value;
326
+ node.comments = node.comments || [];
327
+ node.comments.push(j.commentBlock(comment));
328
+ });
329
+ });
330
+
331
+ // Update imports
332
+ var needsAvatarTagImport = tagsToMigrateToAvatarTag.size > 0;
333
+ // We need default Tag import if there are any regular tag usages
334
+ var needsDefaultTagImport = hasRegularTagUsage;
335
+
336
+ // Create new imports
337
+ var newImports = [];
338
+ if (needsDefaultTagImport) {
339
+ newImports.push(j.importDeclaration([j.importDefaultSpecifier(j.identifier('Tag'))], j.literal(TAG_ENTRY_POINT)));
340
+ }
341
+ if (needsAvatarTagImport) {
342
+ newImports.push(j.importDeclaration([j.importSpecifier(j.identifier('AvatarTag'))], j.literal(TAG_ENTRY_POINT)));
343
+ }
344
+
345
+ // Remove old Tag imports first
346
+ mainTagImports.forEach(function (importPath) {
347
+ return j(importPath).remove();
348
+ });
349
+ removableTagImports.forEach(function (importPath) {
350
+ return j(importPath).remove();
351
+ });
352
+ simpleTagImports.forEach(function (importPath) {
353
+ return j(importPath).remove();
354
+ });
355
+
356
+ // Insert new imports after Avatar import (if exists) or at the beginning
357
+ if (newImports.length > 0) {
358
+ var program = source.find(j.Program);
359
+ if (program.length > 0) {
360
+ var body = program.at(0).get('body').value;
361
+ if (avatarImports.length > 0) {
362
+ // Find the Avatar import in the body
363
+ var avatarImportNode = avatarImports.at(0).get().value;
364
+ var avatarIndex = body.findIndex(function (node) {
365
+ return node === avatarImportNode;
366
+ });
367
+ if (avatarIndex !== -1) {
368
+ // Insert all new imports right after Avatar import
369
+ body.splice.apply(body, [avatarIndex + 1, 0].concat(newImports));
370
+ } else {
371
+ // Fallback: add at beginning
372
+ body.unshift.apply(body, _toConsumableArray(newImports.reverse()));
373
+ }
374
+ } else {
375
+ // No Avatar import, add at beginning
376
+ body.unshift.apply(body, _toConsumableArray(newImports.reverse()));
377
+ }
378
+ }
379
+ }
380
+ return source.toSource(PRINT_SETTINGS);
381
+ }
@@ -0,0 +1,37 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ import tagToNewTagMigrationTransformer from './codemods/tag-to-newTag-migration';
7
+ export default function transformer(_x, _x2) {
8
+ return _transformer.apply(this, arguments);
9
+ }
10
+ function _transformer() {
11
+ _transformer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(file, api) {
12
+ var transformers, src;
13
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
14
+ while (1) switch (_context.prev = _context.next) {
15
+ case 0:
16
+ transformers = [tagToNewTagMigrationTransformer];
17
+ src = file.source;
18
+ transformers.forEach(function (transformer) {
19
+ if (typeof src === 'undefined') {
20
+ return;
21
+ }
22
+ var nextSrc = transformer(_objectSpread(_objectSpread({}, file), {}, {
23
+ source: src
24
+ }), api);
25
+ if (nextSrc) {
26
+ src = nextSrc;
27
+ }
28
+ });
29
+ return _context.abrupt("return", src);
30
+ case 4:
31
+ case "end":
32
+ return _context.stop();
33
+ }
34
+ }, _callee);
35
+ }));
36
+ return _transformer.apply(this, arguments);
37
+ }
@@ -13,5 +13,6 @@ import './remove-token-fallbacks/remove-token-fallbacks';
13
13
  import './lozenge-appearance-semantic-migration/lozenge-appearance-semantic-migration';
14
14
  import './lozenge-to-tag-migration/lozenge-to-tag-migration';
15
15
  import './badge-appearance-semantic-migration/badge-appearance-semantic-migration';
16
+ import './tag-to-newTag-migration/tag-to-newTag-migration';
16
17
  declare const presets: string[];
17
18
  export default presets;
@@ -0,0 +1,20 @@
1
+ import { type API, type FileInfo } from 'jscodeshift';
2
+ /**
3
+ * Codemod to migrate Tag components to new Tag/AvatarTag API.
4
+ *
5
+ * This codemod:
6
+ * 1. Identifies all Tag imports from various entry points
7
+ * 2. For tags with elemBefore containing only Avatar:
8
+ * - Migrates to AvatarTag from '@atlaskit/tag'
9
+ * - Renames elemBefore to avatar
10
+ * - Converts avatar to render props function
11
+ * - Removes color prop
12
+ * - Adds isRemovable={false} if original was SimpleTag
13
+ * 3. For other tags:
14
+ * - Migrates to default import from '@atlaskit/tag'
15
+ * - Removes appearance prop
16
+ * - Migrates color values using COLOR_MAP
17
+ * - Adds isRemovable={false} if original was SimpleTag
18
+ * - Adds comment for manual migration if color can't be mapped
19
+ */
20
+ export default function transformer(file: FileInfo, api: API): string;
@@ -0,0 +1,2 @@
1
+ import type { API, FileInfo } from 'jscodeshift';
2
+ export default function transformer(file: FileInfo, api: API): Promise<string>;
@@ -13,5 +13,6 @@ import './remove-token-fallbacks/remove-token-fallbacks';
13
13
  import './lozenge-appearance-semantic-migration/lozenge-appearance-semantic-migration';
14
14
  import './lozenge-to-tag-migration/lozenge-to-tag-migration';
15
15
  import './badge-appearance-semantic-migration/badge-appearance-semantic-migration';
16
+ import './tag-to-newTag-migration/tag-to-newTag-migration';
16
17
  declare const presets: string[];
17
18
  export default presets;
@@ -0,0 +1,20 @@
1
+ import { type API, type FileInfo } from 'jscodeshift';
2
+ /**
3
+ * Codemod to migrate Tag components to new Tag/AvatarTag API.
4
+ *
5
+ * This codemod:
6
+ * 1. Identifies all Tag imports from various entry points
7
+ * 2. For tags with elemBefore containing only Avatar:
8
+ * - Migrates to AvatarTag from '@atlaskit/tag'
9
+ * - Renames elemBefore to avatar
10
+ * - Converts avatar to render props function
11
+ * - Removes color prop
12
+ * - Adds isRemovable={false} if original was SimpleTag
13
+ * 3. For other tags:
14
+ * - Migrates to default import from '@atlaskit/tag'
15
+ * - Removes appearance prop
16
+ * - Migrates color values using COLOR_MAP
17
+ * - Adds isRemovable={false} if original was SimpleTag
18
+ * - Adds comment for manual migration if color can't be mapped
19
+ */
20
+ export default function transformer(file: FileInfo, api: API): string;
@@ -0,0 +1,2 @@
1
+ import type { API, FileInfo } from 'jscodeshift';
2
+ export default function transformer(file: FileInfo, api: API): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/codemod-cli",
3
- "version": "0.32.2",
3
+ "version": "0.33.0",
4
4
  "description": "A cli for distributing codemods for atlassian-frontend components and services",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,7 +29,7 @@
29
29
  "bin": "./bin/codemod-cli.js",
30
30
  "dependencies": {
31
31
  "@atlaskit/codemod-utils": "^4.2.0",
32
- "@atlaskit/tokens": "^8.4.0",
32
+ "@atlaskit/tokens": "^8.6.0",
33
33
  "@babel/runtime": "^7.0.0",
34
34
  "@codeshift/utils": "^0.2.4",
35
35
  "@hypermod/utils": "^0.4.2",