@atlaskit/codemod-cli 0.25.1 → 0.26.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/main.js +1 -1
  3. package/dist/cjs/presets/index.js +2 -1
  4. package/dist/cjs/presets/migrate-to-new-buttons/codemods/next-migrate-link-button-to-link.js +19 -2
  5. package/dist/cjs/presets/migrate-to-new-buttons/codemods/next-migrate-to-new-button-variants.js +32 -9
  6. package/dist/cjs/presets/migrate-to-new-buttons/utils/constants.js +12 -5
  7. package/dist/cjs/presets/migrate-to-new-buttons/utils/generate-new-button-element.js +13 -1
  8. package/dist/cjs/presets/remove-dark-theme-vr-options/codemods/remove-gemini-dark-options-transformer.js +41 -0
  9. package/dist/cjs/presets/remove-dark-theme-vr-options/remove-dark-theme-vr-options.js +44 -0
  10. package/dist/es2019/presets/index.js +2 -1
  11. package/dist/es2019/presets/migrate-to-new-buttons/codemods/next-migrate-link-button-to-link.js +17 -3
  12. package/dist/es2019/presets/migrate-to-new-buttons/codemods/next-migrate-to-new-button-variants.js +28 -10
  13. package/dist/es2019/presets/migrate-to-new-buttons/utils/constants.js +11 -4
  14. package/dist/es2019/presets/migrate-to-new-buttons/utils/generate-new-button-element.js +12 -0
  15. package/dist/es2019/presets/remove-dark-theme-vr-options/codemods/remove-gemini-dark-options-transformer.js +31 -0
  16. package/dist/es2019/presets/remove-dark-theme-vr-options/remove-dark-theme-vr-options.js +18 -0
  17. package/dist/esm/main.js +1 -1
  18. package/dist/esm/presets/index.js +2 -1
  19. package/dist/esm/presets/migrate-to-new-buttons/codemods/next-migrate-link-button-to-link.js +19 -3
  20. package/dist/esm/presets/migrate-to-new-buttons/codemods/next-migrate-to-new-button-variants.js +32 -10
  21. package/dist/esm/presets/migrate-to-new-buttons/utils/constants.js +11 -4
  22. package/dist/esm/presets/migrate-to-new-buttons/utils/generate-new-button-element.js +12 -0
  23. package/dist/esm/presets/remove-dark-theme-vr-options/codemods/remove-gemini-dark-options-transformer.js +35 -0
  24. package/dist/esm/presets/remove-dark-theme-vr-options/remove-dark-theme-vr-options.js +37 -0
  25. package/dist/types/presets/index.d.ts +1 -0
  26. package/dist/types/presets/migrate-to-new-buttons/utils/constants.d.ts +10 -3
  27. package/dist/types/presets/migrate-to-new-buttons/utils/generate-new-button-element.d.ts +2 -1
  28. package/dist/types/presets/remove-dark-theme-vr-options/codemods/remove-gemini-dark-options-transformer.d.ts +3 -0
  29. package/dist/types/presets/remove-dark-theme-vr-options/remove-dark-theme-vr-options.d.ts +2 -0
  30. package/dist/types-ts4.5/presets/index.d.ts +1 -0
  31. package/dist/types-ts4.5/presets/migrate-to-new-buttons/utils/constants.d.ts +10 -3
  32. package/dist/types-ts4.5/presets/migrate-to-new-buttons/utils/generate-new-button-element.d.ts +2 -1
  33. package/dist/types-ts4.5/presets/remove-dark-theme-vr-options/codemods/remove-gemini-dark-options-transformer.d.ts +3 -0
  34. package/dist/types-ts4.5/presets/remove-dark-theme-vr-options/remove-dark-theme-vr-options.d.ts +2 -0
  35. package/package.json +3 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/codemod-cli
2
2
 
3
+ ## 0.26.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#135958](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135958)
8
+ [`61059e42a3aa2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/61059e42a3aa2) -
9
+ Added a new preset and codemod for removing dark options from Gemini VR tests.
10
+
11
+ ## 0.25.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [#123131](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/123131)
16
+ [`862fb8cdd4b71`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/862fb8cdd4b71) -
17
+ Codemod includes new migration pathways for legacy button
18
+
3
19
  ## 0.25.1
4
20
 
5
21
  ### Patch Changes
package/dist/cjs/main.js CHANGED
@@ -305,7 +305,7 @@ function _main() {
305
305
  case 4:
306
306
  _yield$parseArgs = _context5.sent;
307
307
  packages = _yield$parseArgs.packages;
308
- _process$env$_PACKAGE = "0.25.1", _PACKAGE_VERSION_ = _process$env$_PACKAGE === void 0 ? '0.0.0-dev' : _process$env$_PACKAGE;
308
+ _process$env$_PACKAGE = "0.26.0", _PACKAGE_VERSION_ = _process$env$_PACKAGE === void 0 ? '0.0.0-dev' : _process$env$_PACKAGE;
309
309
  logger.log(_chalk.default.bgBlue(_chalk.default.black("\uD83D\uDCDA Atlassian-Frontend codemod library @ ".concat(_PACKAGE_VERSION_, " \uD83D\uDCDA"))));
310
310
  if (packages && packages.length > 0) {
311
311
  logger.log(_chalk.default.gray("Searching for codemods for newer versions of the following packages: ".concat(packages.map(function (pkg) {
@@ -10,12 +10,13 @@ require("./styled-to-emotion/styled-to-emotion");
10
10
  require("./theme-remove-deprecated-mixins/theme-remove-deprecated-mixins");
11
11
  require("./migrate-to-new-buttons/migrate-to-new-buttons");
12
12
  require("./upgrade-pragmatic-drag-and-drop-to-stable/upgrade-pragmatic-drag-and-drop-to-stable");
13
+ require("./remove-dark-theme-vr-options/remove-dark-theme-vr-options");
13
14
  /**
14
15
  * Manually import presets to make sure typescript includes them
15
16
  * in the final bundle.
16
17
  */
17
18
 
18
- var presets = ['styled-to-emotion', 'theme-remove-deprecated-mixins', 'migrate-to-new-buttons', 'upgrade-pragmatic-drag-and-drop-to-stable'].map(function (preset) {
19
+ var presets = ['styled-to-emotion', 'theme-remove-deprecated-mixins', 'migrate-to-new-buttons', 'upgrade-pragmatic-drag-and-drop-to-stable', 'remove-dark-theme-vr-options'].map(function (preset) {
19
20
  return _path.default.join(__dirname, preset, "".concat(preset, ".@(ts|js|tsx)"));
20
21
  });
21
22
  var _default = exports.default = presets;
@@ -6,10 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _utils = require("@hypermod/utils");
9
+ var _codemodUtils = require("@atlaskit/codemod-utils");
9
10
  var _constants = require("../utils/constants");
10
- var _moveIconValueFromLinkButtonToLinkChildren = _interopRequireDefault(require("../utils/move-icon-value-from-link-button-to-link-children"));
11
11
  var _findAttributeWithValue = require("../utils/find-attribute-with-value");
12
12
  var _generateLinkElement = require("../utils/generate-link-element");
13
+ var _moveIconValueFromLinkButtonToLinkChildren = _interopRequireDefault(require("../utils/move-icon-value-from-link-button-to-link-children"));
14
+ /* eslint-disable @repo/internal/fs/filename-pattern-match */
15
+
13
16
  function transformer(file, api) {
14
17
  var j = api.jscodeshift;
15
18
  var source = j(file.source);
@@ -47,10 +50,24 @@ function transformer(file, api) {
47
50
  }).forEach(function (path) {
48
51
  var hasSpacingNone = (0, _findAttributeWithValue.findJSXAttributeWithValue)(path.value.openingElement, 'spacing', 'none');
49
52
  if (!hasSpacingNone) {
53
+ var oldAppearanceValue;
50
54
  j(path).find(j.JSXAttribute).filter(function (path) {
51
55
  var _path$node$value;
52
- return path.node.name.name === 'appearance' && ((_path$node$value = path.node.value) === null || _path$node$value === void 0 ? void 0 : _path$node$value.type) === 'StringLiteral' && (path.node.value.value === 'subtle-link' || path.node.value.value === 'link');
56
+ if (path.node.name.name === 'appearance' && ((_path$node$value = path.node.value) === null || _path$node$value === void 0 ? void 0 : _path$node$value.type) === 'StringLiteral' && (path.node.value.value === 'subtle-link' || path.node.value.value === 'link')) {
57
+ oldAppearanceValue = path.node.value.value;
58
+ return true;
59
+ }
60
+ return false;
53
61
  }).replaceWith(j.jsxAttribute(j.jsxIdentifier('appearance'), j.stringLiteral('subtle')));
62
+ if (oldAppearanceValue) {
63
+ var _path$value$openingEl;
64
+ var attribute = (_path$value$openingEl = path.value.openingElement.attributes) === null || _path$value$openingEl === void 0 ? void 0 : _path$value$openingEl.find(function (node) {
65
+ return node.type === 'JSXAttribute' && node.name.name === 'appearance';
66
+ });
67
+ if (attribute) {
68
+ (0, _codemodUtils.addCommentBefore)(j, j(attribute), oldAppearanceValue === 'link' ? _constants.migrateButtonToSubtleLinkButton : _constants.migrateSubtleButtonToSubtleLinkButton, 'line');
69
+ }
70
+ }
54
71
  }
55
72
  if (hasSpacingNone) {
56
73
  var attributes = path.node.openingElement.attributes;
@@ -6,21 +6,23 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
- var _codemodUtils = require("@atlaskit/codemod-utils");
10
9
  var _utils = require("@hypermod/utils");
10
+ var _codemodUtils = require("@atlaskit/codemod-utils");
11
+ var _addCommentForCustomThemeButtons = require("../utils/add-comment-for-custom-theme-buttons");
12
+ var _addCommentForOverlayProp = require("../utils/add-comment-for-overlay-prop");
11
13
  var _constants = require("../utils/constants");
14
+ var _findAttributeWithValue = require("../utils/find-attribute-with-value");
15
+ var _generateLinkElement = require("../utils/generate-link-element");
16
+ var _generateNewButtonElement = require("../utils/generate-new-button-element");
12
17
  var _getDefaultImports = _interopRequireDefault(require("../utils/get-default-imports"));
13
18
  var _getSpecifierNames = _interopRequireDefault(require("../utils/get-specifier-names"));
14
- var _generateNewButtonElement = require("../utils/generate-new-button-element");
15
- var _generateLinkElement = require("../utils/generate-link-element");
16
19
  var _hasUnsupportedProps = require("../utils/has-unsupported-props");
17
20
  var _ifVariantAlreadyImported = require("../utils/if-variant-already-imported");
18
- var _renameDefaultButtonToLegacyButton = require("../utils/rename-default-button-to-legacy-button");
19
- var _migrateFitContainerIconButton = require("../utils/migrate-fit-container-icon-button");
20
21
  var _importTypesFromNewEntryPoint = require("../utils/import-types-from-new-entry-point");
21
- var _addCommentForCustomThemeButtons = require("../utils/add-comment-for-custom-theme-buttons");
22
- var _addCommentForOverlayProp = require("../utils/add-comment-for-overlay-prop");
23
- var _findAttributeWithValue = require("../utils/find-attribute-with-value");
22
+ var _migrateFitContainerIconButton = require("../utils/migrate-fit-container-icon-button");
23
+ var _renameDefaultButtonToLegacyButton = require("../utils/rename-default-button-to-legacy-button");
24
+ /* eslint-disable @repo/internal/fs/filename-pattern-match */
25
+
24
26
  var transformer = function transformer(file, api) {
25
27
  var j = api.jscodeshift;
26
28
  var fileSource = j(file.source);
@@ -111,8 +113,22 @@ var transformer = function transformer(file, api) {
111
113
  j(element).replaceWith((0, _generateNewButtonElement.generateNewElement)(_constants.NEW_BUTTON_VARIANTS.icon, element.value, j));
112
114
  }
113
115
  if (isLinkButton && !isLoadingButton) {
116
+ var _element$node$attribu;
114
117
  hasVariant.linkButton = true;
115
118
  j(element).replaceWith((0, _generateNewButtonElement.generateNewElement)(_constants.NEW_BUTTON_VARIANTS.link, element.value, j));
119
+ var attribute = (_element$node$attribu = element.node.attributes) === null || _element$node$attribu === void 0 ? void 0 : _element$node$attribu.find(function (node) {
120
+ return node.type === 'JSXAttribute' && node.name.name === 'appearance';
121
+ });
122
+ if (attribute) {
123
+ var _linkAppearanceAttrib;
124
+ if ((linkAppearanceAttribute === null || linkAppearanceAttribute === void 0 ? void 0 : linkAppearanceAttribute.type) === 'JSXAttribute' && ((_linkAppearanceAttrib = linkAppearanceAttribute.value) === null || _linkAppearanceAttrib === void 0 ? void 0 : _linkAppearanceAttrib.type) === 'StringLiteral') {
125
+ if (linkAppearanceAttribute.value.value === 'link') {
126
+ (0, _codemodUtils.addCommentBefore)(j, j(attribute), _constants.migrateButtonToSubtleLinkButton, 'line');
127
+ } else if (linkAppearanceAttribute.value.value === 'subtle-link') {
128
+ (0, _codemodUtils.addCommentBefore)(j, j(attribute), _constants.migrateSubtleButtonToSubtleLinkButton, 'line');
129
+ }
130
+ }
131
+ }
116
132
  }
117
133
  if (isLink && !isLoadingButton) {
118
134
  hasVariant.link = true;
@@ -166,7 +182,14 @@ var transformer = function transformer(file, api) {
166
182
  }), 'block');
167
183
  }
168
184
  } else if (!hasHref && linkAppearanceAttribute) {
169
- (0, _codemodUtils.addCommentBefore)(j, j(linkAppearanceAttribute), _constants.linkButtonMissingHrefComment, 'line');
185
+ var _element$node$attribu2;
186
+ (0, _generateNewButtonElement.modifyButtonAttributes)(element.node, j, hasSpacingNone);
187
+ var _attribute = (_element$node$attribu2 = element.node.attributes) === null || _element$node$attribu2 === void 0 ? void 0 : _element$node$attribu2.find(function (node) {
188
+ return node.type === 'JSXAttribute' && node.name.name === 'appearance';
189
+ });
190
+ if (_attribute) {
191
+ (0, _codemodUtils.addCommentBefore)(j, j(_attribute), hasSpacingNone ? _constants.noSpacinglinkButtonMissingHrefComment : _constants.linkButtonMissingHrefComment, 'line');
192
+ }
170
193
  }
171
194
  });
172
195
 
@@ -3,12 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.unsupportedProps = exports.overlayPropComment = exports.migrateFitContainerButtonToIconButtonComment = exports.migrateFitContainerButtonToDefaultButtonComment = exports.loadingButtonComment = exports.linkButtonMissingHrefComment = exports.entryPointsMapping = exports.customThemeButtonComment = exports.buttonPropsNoLongerSupportedComment = exports.UNSAFE_SIZE_PROPS_MAP = exports.PRINT_SETTINGS = exports.OLD_BUTTON_VARIANTS = exports.OLD_BUTTON_ENTRY_POINT = exports.NEW_BUTTON_VARIANTS = exports.NEW_BUTTON_ENTRY_POINT = exports.BUTTON_TYPES = void 0;
6
+ exports.unsupportedProps = exports.overlayPropComment = exports.noSpacinglinkButtonMissingHrefComment = exports.migrateSubtleButtonToSubtleLinkButton = exports.migrateFitContainerButtonToIconButtonComment = exports.migrateFitContainerButtonToDefaultButtonComment = exports.migrateButtonToSubtleLinkButton = exports.loadingButtonComment = exports.linkButtonMissingHrefComment = exports.entryPointsMapping = exports.customThemeButtonComment = exports.buttonPropsNoLongerSupportedComment = exports.UNSAFE_SIZE_PROPS_MAP = exports.PRINT_SETTINGS = exports.OLD_BUTTON_VARIANTS = exports.OLD_BUTTON_ENTRY_POINT = exports.NEW_BUTTON_VARIANTS = exports.NEW_BUTTON_ENTRY_POINT = exports.BUTTON_TYPES = void 0;
7
7
  var PRINT_SETTINGS = exports.PRINT_SETTINGS = {
8
8
  quote: 'single'
9
9
  };
10
10
 
11
- /** NEW button **/
11
+ /**
12
+ * NEW button *
13
+ */
12
14
  var NEW_BUTTON_ENTRY_POINT = exports.NEW_BUTTON_ENTRY_POINT = '@atlaskit/button/new';
13
15
  var NEW_BUTTON_VARIANTS = exports.NEW_BUTTON_VARIANTS = {
14
16
  default: 'Button',
@@ -17,7 +19,9 @@ var NEW_BUTTON_VARIANTS = exports.NEW_BUTTON_VARIANTS = {
17
19
  linkIcon: 'LinkIconButton'
18
20
  };
19
21
 
20
- /** OLD button **/
22
+ /**
23
+ * OLD button *
24
+ */
21
25
  var OLD_BUTTON_ENTRY_POINT = exports.OLD_BUTTON_ENTRY_POINT = '@atlaskit/button';
22
26
  var OLD_BUTTON_VARIANTS = exports.OLD_BUTTON_VARIANTS = {
23
27
  loading: 'LoadingButton'
@@ -35,7 +39,8 @@ var UNSAFE_SIZE_PROPS_MAP = exports.UNSAFE_SIZE_PROPS_MAP = {
35
39
  UNSAFE_iconBefore_size: 'iconBefore'
36
40
  };
37
41
  var unsupportedProps = exports.unsupportedProps = ['component', 'css', 'style'];
38
- var linkButtonMissingHrefComment = exports.linkButtonMissingHrefComment = "\"link\" and \"subtle-link\" appearances are only available in LinkButton, please either provide a href prop then migrate to LinkButton, or remove the appearance from the default button.";
42
+ var linkButtonMissingHrefComment = exports.linkButtonMissingHrefComment = "\"link\" and \"subtle-link\" appearances are not available in the new Button, appearance should be \"subtle\" or \"default\".";
43
+ var noSpacinglinkButtonMissingHrefComment = exports.noSpacinglinkButtonMissingHrefComment = "\"link\" and \"subtle-link\" appearances are not available in the new Button, appearance should be \"subtle\" or \"default\", or provide a href prop then migrate to Link.";
39
44
  var buttonPropsNoLongerSupportedComment = exports.buttonPropsNoLongerSupportedComment = "Buttons with \"component\", \"css\" or \"style\" prop can't be automatically migrated with codemods. Please migrate it manually.";
40
45
  var migrateFitContainerButtonToDefaultButtonComment = exports.migrateFitContainerButtonToDefaultButtonComment = "Migrated to a default button with text which is from the icon label.";
41
46
  var migrateFitContainerButtonToIconButtonComment = exports.migrateFitContainerButtonToIconButtonComment = "\"shouldFitContainer\" is not available in icon buttons, please consider using a default button with text.";
@@ -45,4 +50,6 @@ var loadingButtonComment = exports.loadingButtonComment = function loadingButton
45
50
  var hasLinkAppearance = _ref.hasLinkAppearance,
46
51
  hasHref = _ref.hasHref;
47
52
  return "This should be migrated to a new Button with a `isLoading` prop. ".concat(hasLinkAppearance ? "\"link\" and \"subtle-link\" appearances are not available for new loading buttons.\"" : '').concat(hasHref ? "The `href` attribute it not compatible with new loading buttons, because links should not need loading states." : '', " Please reconsider the design or change the appearance of the button.");
48
- };
53
+ };
54
+ var migrateButtonToSubtleLinkButton = exports.migrateButtonToSubtleLinkButton = "\"link\" and \"subtle-link\" appearances are not available in the new Button. Appearance should be migrated to \"subtle\" or \"default\" for Link Button, or use Link with \"default\" appearance.";
55
+ var migrateSubtleButtonToSubtleLinkButton = exports.migrateSubtleButtonToSubtleLinkButton = "\"link\" and \"subtle-link\" appearances are not available in the new Button. Appearance should be migrated to \"subtle\" or \"default\" for Link Button, or use Link with \"subtle\" appearance.";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.handleIconAttributes = exports.getIconElement = exports.getIconAttributes = exports.generateNewElement = void 0;
6
+ exports.modifyButtonAttributes = exports.handleIconAttributes = exports.getIconElement = exports.getIconAttributes = exports.generateNewElement = void 0;
7
7
  var _constants = require("../utils/constants");
8
8
  var getIconAttributes = exports.getIconAttributes = function getIconAttributes(attributes) {
9
9
  var iconAttr = attributes === null || attributes === void 0 ? void 0 : attributes.filter(function (attribute) {
@@ -145,4 +145,16 @@ var generateNewElement = exports.generateNewElement = function generateNewElemen
145
145
  closingElement: isIconOrLinkIcon ? null : j.jsxClosingElement(j.jsxIdentifier(variant)),
146
146
  children: element.children
147
147
  });
148
+ };
149
+ var modifyButtonAttributes = exports.modifyButtonAttributes = function modifyButtonAttributes(element, j, hasSpacingNone) {
150
+ j(element).find(j.JSXAttribute).filter(function (path) {
151
+ var _path$node$value2;
152
+ return path.node.name.name === 'appearance' && ((_path$node$value2 = path.node.value) === null || _path$node$value2 === void 0 ? void 0 : _path$node$value2.type) === 'StringLiteral' && (path.node.value.value === 'link' || path.node.value.value === 'subtle-link');
153
+ }).replaceWith(j.jsxAttribute(j.jsxIdentifier('appearance'), j.stringLiteral('subtle')));
154
+ if (hasSpacingNone) {
155
+ j(element).find(j.JSXAttribute).filter(function (path) {
156
+ var _path$node$value3;
157
+ return path.node.name.name === 'spacing' && ((_path$node$value3 = path.node.value) === null || _path$node$value3 === void 0 ? void 0 : _path$node$value3.type) === 'StringLiteral' && path.node.value.value === 'none';
158
+ }).remove();
159
+ }
148
160
  };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _utils = require("@hypermod/utils");
8
+ var PRINT_SETTINGS = {
9
+ quote: 'single'
10
+ };
11
+ function transformer(file, api) {
12
+ var j = api.jscodeshift;
13
+ var source = j(file.source);
14
+
15
+ // check if import from @af/visual-regression
16
+ var imports = (0, _utils.getImportDeclaration)(j, source, '@af/visual-regression');
17
+ if (!imports.length) {
18
+ return file.source;
19
+ }
20
+
21
+ // find ObjectProperty that has a "environment" property
22
+ // and then a "colorScheme" property inside the "environment" property
23
+ // and value is "dark" inside the "colorScheme" property
24
+ source.find(j.ObjectExpression).filter(function (path) {
25
+ var environmentProperty = path.node.properties.find(function (prop) {
26
+ return prop.type === 'ObjectProperty' && prop.key.type === 'Identifier' && prop.key.name === 'environment';
27
+ });
28
+ if (!environmentProperty) {
29
+ return false;
30
+ }
31
+ var colorSchemeProperty = environmentProperty.type === 'ObjectProperty' && environmentProperty.value.type === 'ObjectExpression' && environmentProperty.value.properties.find(function (path) {
32
+ return path.type === 'ObjectProperty' && path.key.type === 'Identifier' && path.key.name === 'colorScheme';
33
+ });
34
+ if (!colorSchemeProperty) {
35
+ return false;
36
+ }
37
+ return colorSchemeProperty.type === 'ObjectProperty' && colorSchemeProperty.value.type === 'StringLiteral' && colorSchemeProperty.value.value === 'dark';
38
+ }).remove();
39
+ return source.toSource(PRINT_SETTINGS);
40
+ }
41
+ var _default = exports.default = transformer;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = transformer;
8
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
+ var _removeGeminiDarkOptionsTransformer = _interopRequireDefault(require("./codemods/remove-gemini-dark-options-transformer"));
12
+ 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; }
13
+ 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) { (0, _defineProperty2.default)(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; }
14
+ function transformer(_x, _x2) {
15
+ return _transformer.apply(this, arguments);
16
+ }
17
+ function _transformer() {
18
+ _transformer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(file, api) {
19
+ var transformers, src;
20
+ return _regenerator.default.wrap(function _callee$(_context) {
21
+ while (1) switch (_context.prev = _context.next) {
22
+ case 0:
23
+ transformers = [_removeGeminiDarkOptionsTransformer.default];
24
+ src = file.source;
25
+ transformers.forEach(function (transformer) {
26
+ if (typeof src === 'undefined') {
27
+ return;
28
+ }
29
+ var nextSrc = transformer(_objectSpread(_objectSpread({}, file), {}, {
30
+ source: src
31
+ }), api);
32
+ if (nextSrc) {
33
+ src = nextSrc;
34
+ }
35
+ });
36
+ return _context.abrupt("return", src);
37
+ case 4:
38
+ case "end":
39
+ return _context.stop();
40
+ }
41
+ }, _callee);
42
+ }));
43
+ return _transformer.apply(this, arguments);
44
+ }
@@ -8,5 +8,6 @@ import './styled-to-emotion/styled-to-emotion';
8
8
  import './theme-remove-deprecated-mixins/theme-remove-deprecated-mixins';
9
9
  import './migrate-to-new-buttons/migrate-to-new-buttons';
10
10
  import './upgrade-pragmatic-drag-and-drop-to-stable/upgrade-pragmatic-drag-and-drop-to-stable';
11
- const presets = ['styled-to-emotion', 'theme-remove-deprecated-mixins', 'migrate-to-new-buttons', 'upgrade-pragmatic-drag-and-drop-to-stable'].map(preset => path.join(__dirname, preset, `${preset}.@(ts|js|tsx)`));
11
+ import './remove-dark-theme-vr-options/remove-dark-theme-vr-options';
12
+ const presets = ['styled-to-emotion', 'theme-remove-deprecated-mixins', 'migrate-to-new-buttons', 'upgrade-pragmatic-drag-and-drop-to-stable', 'remove-dark-theme-vr-options'].map(preset => path.join(__dirname, preset, `${preset}.@(ts|js|tsx)`));
12
13
  export default presets;
@@ -1,8 +1,10 @@
1
+ /* eslint-disable @repo/internal/fs/filename-pattern-match */
1
2
  import { getImportDeclaration } from '@hypermod/utils';
2
- import { PRINT_SETTINGS, NEW_BUTTON_ENTRY_POINT, NEW_BUTTON_VARIANTS } from '../utils/constants';
3
- import moveIconValueFromLinkButtonPropsToLinkChildren from '../utils/move-icon-value-from-link-button-to-link-children';
3
+ import { addCommentBefore } from '@atlaskit/codemod-utils';
4
+ import { migrateButtonToSubtleLinkButton, migrateSubtleButtonToSubtleLinkButton, NEW_BUTTON_ENTRY_POINT, NEW_BUTTON_VARIANTS, PRINT_SETTINGS } from '../utils/constants';
4
5
  import { findJSXAttributeWithValue } from '../utils/find-attribute-with-value';
5
6
  import { modifyLinkAttributes } from '../utils/generate-link-element';
7
+ import moveIconValueFromLinkButtonPropsToLinkChildren from '../utils/move-icon-value-from-link-button-to-link-children';
6
8
  function transformer(file, api) {
7
9
  const j = api.jscodeshift;
8
10
  const source = j(file.source);
@@ -36,10 +38,22 @@ function transformer(file, api) {
36
38
  allLinkButtons.filter(path => findJSXAttributeWithValue(path.value.openingElement, 'appearance', 'link') || findJSXAttributeWithValue(path.value.openingElement, 'appearance', 'subtle-link')).forEach(path => {
37
39
  const hasSpacingNone = findJSXAttributeWithValue(path.value.openingElement, 'spacing', 'none');
38
40
  if (!hasSpacingNone) {
41
+ let oldAppearanceValue;
39
42
  j(path).find(j.JSXAttribute).filter(path => {
40
43
  var _path$node$value;
41
- return path.node.name.name === 'appearance' && ((_path$node$value = path.node.value) === null || _path$node$value === void 0 ? void 0 : _path$node$value.type) === 'StringLiteral' && (path.node.value.value === 'subtle-link' || path.node.value.value === 'link');
44
+ if (path.node.name.name === 'appearance' && ((_path$node$value = path.node.value) === null || _path$node$value === void 0 ? void 0 : _path$node$value.type) === 'StringLiteral' && (path.node.value.value === 'subtle-link' || path.node.value.value === 'link')) {
45
+ oldAppearanceValue = path.node.value.value;
46
+ return true;
47
+ }
48
+ return false;
42
49
  }).replaceWith(j.jsxAttribute(j.jsxIdentifier('appearance'), j.stringLiteral('subtle')));
50
+ if (oldAppearanceValue) {
51
+ var _path$value$openingEl;
52
+ const attribute = (_path$value$openingEl = path.value.openingElement.attributes) === null || _path$value$openingEl === void 0 ? void 0 : _path$value$openingEl.find(node => node.type === 'JSXAttribute' && node.name.name === 'appearance');
53
+ if (attribute) {
54
+ addCommentBefore(j, j(attribute), oldAppearanceValue === 'link' ? migrateButtonToSubtleLinkButton : migrateSubtleButtonToSubtleLinkButton, 'line');
55
+ }
56
+ }
43
57
  }
44
58
  if (hasSpacingNone) {
45
59
  const {
@@ -1,18 +1,19 @@
1
- import { addCommentBefore } from '@atlaskit/codemod-utils';
1
+ /* eslint-disable @repo/internal/fs/filename-pattern-match */
2
2
  import { getDefaultImportSpecifierName } from '@hypermod/utils';
3
- import { PRINT_SETTINGS, OLD_BUTTON_VARIANTS, NEW_BUTTON_VARIANTS, entryPointsMapping, OLD_BUTTON_ENTRY_POINT, NEW_BUTTON_ENTRY_POINT, linkButtonMissingHrefComment, buttonPropsNoLongerSupportedComment, unsupportedProps, loadingButtonComment } from '../utils/constants';
3
+ import { addCommentBefore } from '@atlaskit/codemod-utils';
4
+ import { addCommentForCustomThemeButtons } from '../utils/add-comment-for-custom-theme-buttons';
5
+ import { addCommentForOverlayProp } from '../utils/add-comment-for-overlay-prop';
6
+ import { buttonPropsNoLongerSupportedComment, entryPointsMapping, linkButtonMissingHrefComment, loadingButtonComment, migrateButtonToSubtleLinkButton, migrateSubtleButtonToSubtleLinkButton, NEW_BUTTON_ENTRY_POINT, NEW_BUTTON_VARIANTS, noSpacinglinkButtonMissingHrefComment, OLD_BUTTON_ENTRY_POINT, OLD_BUTTON_VARIANTS, PRINT_SETTINGS, unsupportedProps } from '../utils/constants';
7
+ import { findJSXAttributeWithValue } from '../utils/find-attribute-with-value';
8
+ import { generateLinkComponent } from '../utils/generate-link-element';
9
+ import { generateNewElement, handleIconAttributes, modifyButtonAttributes } from '../utils/generate-new-button-element';
4
10
  import getDefaultImports from '../utils/get-default-imports';
5
11
  import getSpecifierNames from '../utils/get-specifier-names';
6
- import { generateNewElement, handleIconAttributes } from '../utils/generate-new-button-element';
7
- import { generateLinkComponent } from '../utils/generate-link-element';
8
12
  import { ifHasUnsupportedProps } from '../utils/has-unsupported-props';
9
13
  import { checkIfVariantAlreadyImported } from '../utils/if-variant-already-imported';
10
- import { renameDefaultButtonToLegacyButtonImport } from '../utils/rename-default-button-to-legacy-button';
11
- import { migrateFitContainerIconButton } from '../utils/migrate-fit-container-icon-button';
12
14
  import { importTypesFromNewEntryPoint } from '../utils/import-types-from-new-entry-point';
13
- import { addCommentForCustomThemeButtons } from '../utils/add-comment-for-custom-theme-buttons';
14
- import { addCommentForOverlayProp } from '../utils/add-comment-for-overlay-prop';
15
- import { findJSXAttributeWithValue } from '../utils/find-attribute-with-value';
15
+ import { migrateFitContainerIconButton } from '../utils/migrate-fit-container-icon-button';
16
+ import { renameDefaultButtonToLegacyButtonImport } from '../utils/rename-default-button-to-legacy-button';
16
17
  const transformer = (file, api) => {
17
18
  const j = api.jscodeshift;
18
19
  const fileSource = j(file.source);
@@ -97,8 +98,20 @@ const transformer = (file, api) => {
97
98
  j(element).replaceWith(generateNewElement(NEW_BUTTON_VARIANTS.icon, element.value, j));
98
99
  }
99
100
  if (isLinkButton && !isLoadingButton) {
101
+ var _element$node$attribu;
100
102
  hasVariant.linkButton = true;
101
103
  j(element).replaceWith(generateNewElement(NEW_BUTTON_VARIANTS.link, element.value, j));
104
+ const attribute = (_element$node$attribu = element.node.attributes) === null || _element$node$attribu === void 0 ? void 0 : _element$node$attribu.find(node => node.type === 'JSXAttribute' && node.name.name === 'appearance');
105
+ if (attribute) {
106
+ var _linkAppearanceAttrib;
107
+ if ((linkAppearanceAttribute === null || linkAppearanceAttribute === void 0 ? void 0 : linkAppearanceAttribute.type) === 'JSXAttribute' && ((_linkAppearanceAttrib = linkAppearanceAttribute.value) === null || _linkAppearanceAttrib === void 0 ? void 0 : _linkAppearanceAttrib.type) === 'StringLiteral') {
108
+ if (linkAppearanceAttribute.value.value === 'link') {
109
+ addCommentBefore(j, j(attribute), migrateButtonToSubtleLinkButton, 'line');
110
+ } else if (linkAppearanceAttribute.value.value === 'subtle-link') {
111
+ addCommentBefore(j, j(attribute), migrateSubtleButtonToSubtleLinkButton, 'line');
112
+ }
113
+ }
114
+ }
102
115
  }
103
116
  if (isLink && !isLoadingButton) {
104
117
  hasVariant.link = true;
@@ -148,7 +161,12 @@ const transformer = (file, api) => {
148
161
  }), 'block');
149
162
  }
150
163
  } else if (!hasHref && linkAppearanceAttribute) {
151
- addCommentBefore(j, j(linkAppearanceAttribute), linkButtonMissingHrefComment, 'line');
164
+ var _element$node$attribu2;
165
+ modifyButtonAttributes(element.node, j, hasSpacingNone);
166
+ const attribute = (_element$node$attribu2 = element.node.attributes) === null || _element$node$attribu2 === void 0 ? void 0 : _element$node$attribu2.find(node => node.type === 'JSXAttribute' && node.name.name === 'appearance');
167
+ if (attribute) {
168
+ addCommentBefore(j, j(attribute), hasSpacingNone ? noSpacinglinkButtonMissingHrefComment : linkButtonMissingHrefComment, 'line');
169
+ }
152
170
  }
153
171
  });
154
172
 
@@ -2,7 +2,9 @@ export const PRINT_SETTINGS = {
2
2
  quote: 'single'
3
3
  };
4
4
 
5
- /** NEW button **/
5
+ /**
6
+ * NEW button *
7
+ */
6
8
  export const NEW_BUTTON_ENTRY_POINT = '@atlaskit/button/new';
7
9
  export const NEW_BUTTON_VARIANTS = {
8
10
  default: 'Button',
@@ -11,7 +13,9 @@ export const NEW_BUTTON_VARIANTS = {
11
13
  linkIcon: 'LinkIconButton'
12
14
  };
13
15
 
14
- /** OLD button **/
16
+ /**
17
+ * OLD button *
18
+ */
15
19
  export const OLD_BUTTON_ENTRY_POINT = '@atlaskit/button';
16
20
  export const OLD_BUTTON_VARIANTS = {
17
21
  loading: 'LoadingButton'
@@ -29,7 +33,8 @@ export const UNSAFE_SIZE_PROPS_MAP = {
29
33
  UNSAFE_iconBefore_size: 'iconBefore'
30
34
  };
31
35
  export const unsupportedProps = ['component', 'css', 'style'];
32
- export const linkButtonMissingHrefComment = `"link" and "subtle-link" appearances are only available in LinkButton, please either provide a href prop then migrate to LinkButton, or remove the appearance from the default button.`;
36
+ export const linkButtonMissingHrefComment = `"link" and "subtle-link" appearances are not available in the new Button, appearance should be "subtle" or "default".`;
37
+ export const noSpacinglinkButtonMissingHrefComment = `"link" and "subtle-link" appearances are not available in the new Button, appearance should be "subtle" or "default", or provide a href prop then migrate to Link.`;
33
38
  export const buttonPropsNoLongerSupportedComment = `Buttons with "component", "css" or "style" prop can't be automatically migrated with codemods. Please migrate it manually.`;
34
39
  export const migrateFitContainerButtonToDefaultButtonComment = `Migrated to a default button with text which is from the icon label.`;
35
40
  export const migrateFitContainerButtonToIconButtonComment = `"shouldFitContainer" is not available in icon buttons, please consider using a default button with text.`;
@@ -40,4 +45,6 @@ export const loadingButtonComment = ({
40
45
  hasHref
41
46
  }) => {
42
47
  return `This should be migrated to a new Button with a \`isLoading\` prop. ${hasLinkAppearance ? `"link" and "subtle-link" appearances are not available for new loading buttons."` : ''}${hasHref ? `The \`href\` attribute it not compatible with new loading buttons, because links should not need loading states.` : ''} Please reconsider the design or change the appearance of the button.`;
43
- };
48
+ };
49
+ export const migrateButtonToSubtleLinkButton = `"link" and "subtle-link" appearances are not available in the new Button. Appearance should be migrated to "subtle" or "default" for Link Button, or use Link with "default" appearance.`;
50
+ export const migrateSubtleButtonToSubtleLinkButton = `"link" and "subtle-link" appearances are not available in the new Button. Appearance should be migrated to "subtle" or "default" for Link Button, or use Link with "subtle" appearance.`;
@@ -128,4 +128,16 @@ export const generateNewElement = (variant, element, j) => {
128
128
  closingElement: isIconOrLinkIcon ? null : j.jsxClosingElement(j.jsxIdentifier(variant)),
129
129
  children: element.children
130
130
  });
131
+ };
132
+ export const modifyButtonAttributes = (element, j, hasSpacingNone) => {
133
+ j(element).find(j.JSXAttribute).filter(path => {
134
+ var _path$node$value2;
135
+ return path.node.name.name === 'appearance' && ((_path$node$value2 = path.node.value) === null || _path$node$value2 === void 0 ? void 0 : _path$node$value2.type) === 'StringLiteral' && (path.node.value.value === 'link' || path.node.value.value === 'subtle-link');
136
+ }).replaceWith(j.jsxAttribute(j.jsxIdentifier('appearance'), j.stringLiteral('subtle')));
137
+ if (hasSpacingNone) {
138
+ j(element).find(j.JSXAttribute).filter(path => {
139
+ var _path$node$value3;
140
+ return path.node.name.name === 'spacing' && ((_path$node$value3 = path.node.value) === null || _path$node$value3 === void 0 ? void 0 : _path$node$value3.type) === 'StringLiteral' && path.node.value.value === 'none';
141
+ }).remove();
142
+ }
131
143
  };
@@ -0,0 +1,31 @@
1
+ import { getImportDeclaration } from '@hypermod/utils';
2
+ const PRINT_SETTINGS = {
3
+ quote: 'single'
4
+ };
5
+ function transformer(file, api) {
6
+ const j = api.jscodeshift;
7
+ const source = j(file.source);
8
+
9
+ // check if import from @af/visual-regression
10
+ const imports = getImportDeclaration(j, source, '@af/visual-regression');
11
+ if (!imports.length) {
12
+ return file.source;
13
+ }
14
+
15
+ // find ObjectProperty that has a "environment" property
16
+ // and then a "colorScheme" property inside the "environment" property
17
+ // and value is "dark" inside the "colorScheme" property
18
+ source.find(j.ObjectExpression).filter(path => {
19
+ const environmentProperty = path.node.properties.find(prop => prop.type === 'ObjectProperty' && prop.key.type === 'Identifier' && prop.key.name === 'environment');
20
+ if (!environmentProperty) {
21
+ return false;
22
+ }
23
+ const colorSchemeProperty = environmentProperty.type === 'ObjectProperty' && environmentProperty.value.type === 'ObjectExpression' && environmentProperty.value.properties.find(path => path.type === 'ObjectProperty' && path.key.type === 'Identifier' && path.key.name === 'colorScheme');
24
+ if (!colorSchemeProperty) {
25
+ return false;
26
+ }
27
+ return colorSchemeProperty.type === 'ObjectProperty' && colorSchemeProperty.value.type === 'StringLiteral' && colorSchemeProperty.value.value === 'dark';
28
+ }).remove();
29
+ return source.toSource(PRINT_SETTINGS);
30
+ }
31
+ export default transformer;
@@ -0,0 +1,18 @@
1
+ import removeGeminiDarkOptionTransformer from './codemods/remove-gemini-dark-options-transformer';
2
+ export default async function transformer(file, api) {
3
+ const transformers = [removeGeminiDarkOptionTransformer];
4
+ let src = file.source;
5
+ transformers.forEach(transformer => {
6
+ if (typeof src === 'undefined') {
7
+ return;
8
+ }
9
+ const nextSrc = transformer({
10
+ ...file,
11
+ source: src
12
+ }, api);
13
+ if (nextSrc) {
14
+ src = nextSrc;
15
+ }
16
+ });
17
+ return src;
18
+ }
package/dist/esm/main.js CHANGED
@@ -298,7 +298,7 @@ function _main() {
298
298
  case 4:
299
299
  _yield$parseArgs = _context5.sent;
300
300
  packages = _yield$parseArgs.packages;
301
- _process$env$_PACKAGE = "0.25.1", _PACKAGE_VERSION_ = _process$env$_PACKAGE === void 0 ? '0.0.0-dev' : _process$env$_PACKAGE;
301
+ _process$env$_PACKAGE = "0.26.0", _PACKAGE_VERSION_ = _process$env$_PACKAGE === void 0 ? '0.0.0-dev' : _process$env$_PACKAGE;
302
302
  logger.log(chalk.bgBlue(chalk.black("\uD83D\uDCDA Atlassian-Frontend codemod library @ ".concat(_PACKAGE_VERSION_, " \uD83D\uDCDA"))));
303
303
  if (packages && packages.length > 0) {
304
304
  logger.log(chalk.gray("Searching for codemods for newer versions of the following packages: ".concat(packages.map(function (pkg) {
@@ -8,7 +8,8 @@ import './styled-to-emotion/styled-to-emotion';
8
8
  import './theme-remove-deprecated-mixins/theme-remove-deprecated-mixins';
9
9
  import './migrate-to-new-buttons/migrate-to-new-buttons';
10
10
  import './upgrade-pragmatic-drag-and-drop-to-stable/upgrade-pragmatic-drag-and-drop-to-stable';
11
- var presets = ['styled-to-emotion', 'theme-remove-deprecated-mixins', 'migrate-to-new-buttons', 'upgrade-pragmatic-drag-and-drop-to-stable'].map(function (preset) {
11
+ import './remove-dark-theme-vr-options/remove-dark-theme-vr-options';
12
+ var presets = ['styled-to-emotion', 'theme-remove-deprecated-mixins', 'migrate-to-new-buttons', 'upgrade-pragmatic-drag-and-drop-to-stable', 'remove-dark-theme-vr-options'].map(function (preset) {
12
13
  return path.join(__dirname, preset, "".concat(preset, ".@(ts|js|tsx)"));
13
14
  });
14
15
  export default presets;
@@ -1,8 +1,10 @@
1
+ /* eslint-disable @repo/internal/fs/filename-pattern-match */
1
2
  import { getImportDeclaration } from '@hypermod/utils';
2
- import { PRINT_SETTINGS, NEW_BUTTON_ENTRY_POINT, NEW_BUTTON_VARIANTS } from '../utils/constants';
3
- import moveIconValueFromLinkButtonPropsToLinkChildren from '../utils/move-icon-value-from-link-button-to-link-children';
3
+ import { addCommentBefore } from '@atlaskit/codemod-utils';
4
+ import { migrateButtonToSubtleLinkButton, migrateSubtleButtonToSubtleLinkButton, NEW_BUTTON_ENTRY_POINT, NEW_BUTTON_VARIANTS, PRINT_SETTINGS } from '../utils/constants';
4
5
  import { findJSXAttributeWithValue } from '../utils/find-attribute-with-value';
5
6
  import { modifyLinkAttributes } from '../utils/generate-link-element';
7
+ import moveIconValueFromLinkButtonPropsToLinkChildren from '../utils/move-icon-value-from-link-button-to-link-children';
6
8
  function transformer(file, api) {
7
9
  var j = api.jscodeshift;
8
10
  var source = j(file.source);
@@ -40,10 +42,24 @@ function transformer(file, api) {
40
42
  }).forEach(function (path) {
41
43
  var hasSpacingNone = findJSXAttributeWithValue(path.value.openingElement, 'spacing', 'none');
42
44
  if (!hasSpacingNone) {
45
+ var oldAppearanceValue;
43
46
  j(path).find(j.JSXAttribute).filter(function (path) {
44
47
  var _path$node$value;
45
- return path.node.name.name === 'appearance' && ((_path$node$value = path.node.value) === null || _path$node$value === void 0 ? void 0 : _path$node$value.type) === 'StringLiteral' && (path.node.value.value === 'subtle-link' || path.node.value.value === 'link');
48
+ if (path.node.name.name === 'appearance' && ((_path$node$value = path.node.value) === null || _path$node$value === void 0 ? void 0 : _path$node$value.type) === 'StringLiteral' && (path.node.value.value === 'subtle-link' || path.node.value.value === 'link')) {
49
+ oldAppearanceValue = path.node.value.value;
50
+ return true;
51
+ }
52
+ return false;
46
53
  }).replaceWith(j.jsxAttribute(j.jsxIdentifier('appearance'), j.stringLiteral('subtle')));
54
+ if (oldAppearanceValue) {
55
+ var _path$value$openingEl;
56
+ var attribute = (_path$value$openingEl = path.value.openingElement.attributes) === null || _path$value$openingEl === void 0 ? void 0 : _path$value$openingEl.find(function (node) {
57
+ return node.type === 'JSXAttribute' && node.name.name === 'appearance';
58
+ });
59
+ if (attribute) {
60
+ addCommentBefore(j, j(attribute), oldAppearanceValue === 'link' ? migrateButtonToSubtleLinkButton : migrateSubtleButtonToSubtleLinkButton, 'line');
61
+ }
62
+ }
47
63
  }
48
64
  if (hasSpacingNone) {
49
65
  var attributes = path.node.openingElement.attributes;
@@ -1,19 +1,20 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import { addCommentBefore } from '@atlaskit/codemod-utils';
2
+ /* eslint-disable @repo/internal/fs/filename-pattern-match */
3
3
  import { getDefaultImportSpecifierName } from '@hypermod/utils';
4
- import { PRINT_SETTINGS, OLD_BUTTON_VARIANTS, NEW_BUTTON_VARIANTS, entryPointsMapping, OLD_BUTTON_ENTRY_POINT, NEW_BUTTON_ENTRY_POINT, linkButtonMissingHrefComment, buttonPropsNoLongerSupportedComment, unsupportedProps, loadingButtonComment } from '../utils/constants';
4
+ import { addCommentBefore } from '@atlaskit/codemod-utils';
5
+ import { addCommentForCustomThemeButtons } from '../utils/add-comment-for-custom-theme-buttons';
6
+ import { addCommentForOverlayProp } from '../utils/add-comment-for-overlay-prop';
7
+ import { buttonPropsNoLongerSupportedComment, entryPointsMapping, linkButtonMissingHrefComment, loadingButtonComment, migrateButtonToSubtleLinkButton, migrateSubtleButtonToSubtleLinkButton, NEW_BUTTON_ENTRY_POINT, NEW_BUTTON_VARIANTS, noSpacinglinkButtonMissingHrefComment, OLD_BUTTON_ENTRY_POINT, OLD_BUTTON_VARIANTS, PRINT_SETTINGS, unsupportedProps } from '../utils/constants';
8
+ import { findJSXAttributeWithValue } from '../utils/find-attribute-with-value';
9
+ import { generateLinkComponent } from '../utils/generate-link-element';
10
+ import { generateNewElement, handleIconAttributes, modifyButtonAttributes } from '../utils/generate-new-button-element';
5
11
  import getDefaultImports from '../utils/get-default-imports';
6
12
  import getSpecifierNames from '../utils/get-specifier-names';
7
- import { generateNewElement, handleIconAttributes } from '../utils/generate-new-button-element';
8
- import { generateLinkComponent } from '../utils/generate-link-element';
9
13
  import { ifHasUnsupportedProps } from '../utils/has-unsupported-props';
10
14
  import { checkIfVariantAlreadyImported } from '../utils/if-variant-already-imported';
11
- import { renameDefaultButtonToLegacyButtonImport } from '../utils/rename-default-button-to-legacy-button';
12
- import { migrateFitContainerIconButton } from '../utils/migrate-fit-container-icon-button';
13
15
  import { importTypesFromNewEntryPoint } from '../utils/import-types-from-new-entry-point';
14
- import { addCommentForCustomThemeButtons } from '../utils/add-comment-for-custom-theme-buttons';
15
- import { addCommentForOverlayProp } from '../utils/add-comment-for-overlay-prop';
16
- import { findJSXAttributeWithValue } from '../utils/find-attribute-with-value';
16
+ import { migrateFitContainerIconButton } from '../utils/migrate-fit-container-icon-button';
17
+ import { renameDefaultButtonToLegacyButtonImport } from '../utils/rename-default-button-to-legacy-button';
17
18
  var transformer = function transformer(file, api) {
18
19
  var j = api.jscodeshift;
19
20
  var fileSource = j(file.source);
@@ -104,8 +105,22 @@ var transformer = function transformer(file, api) {
104
105
  j(element).replaceWith(generateNewElement(NEW_BUTTON_VARIANTS.icon, element.value, j));
105
106
  }
106
107
  if (isLinkButton && !isLoadingButton) {
108
+ var _element$node$attribu;
107
109
  hasVariant.linkButton = true;
108
110
  j(element).replaceWith(generateNewElement(NEW_BUTTON_VARIANTS.link, element.value, j));
111
+ var attribute = (_element$node$attribu = element.node.attributes) === null || _element$node$attribu === void 0 ? void 0 : _element$node$attribu.find(function (node) {
112
+ return node.type === 'JSXAttribute' && node.name.name === 'appearance';
113
+ });
114
+ if (attribute) {
115
+ var _linkAppearanceAttrib;
116
+ if ((linkAppearanceAttribute === null || linkAppearanceAttribute === void 0 ? void 0 : linkAppearanceAttribute.type) === 'JSXAttribute' && ((_linkAppearanceAttrib = linkAppearanceAttribute.value) === null || _linkAppearanceAttrib === void 0 ? void 0 : _linkAppearanceAttrib.type) === 'StringLiteral') {
117
+ if (linkAppearanceAttribute.value.value === 'link') {
118
+ addCommentBefore(j, j(attribute), migrateButtonToSubtleLinkButton, 'line');
119
+ } else if (linkAppearanceAttribute.value.value === 'subtle-link') {
120
+ addCommentBefore(j, j(attribute), migrateSubtleButtonToSubtleLinkButton, 'line');
121
+ }
122
+ }
123
+ }
109
124
  }
110
125
  if (isLink && !isLoadingButton) {
111
126
  hasVariant.link = true;
@@ -159,7 +174,14 @@ var transformer = function transformer(file, api) {
159
174
  }), 'block');
160
175
  }
161
176
  } else if (!hasHref && linkAppearanceAttribute) {
162
- addCommentBefore(j, j(linkAppearanceAttribute), linkButtonMissingHrefComment, 'line');
177
+ var _element$node$attribu2;
178
+ modifyButtonAttributes(element.node, j, hasSpacingNone);
179
+ var _attribute = (_element$node$attribu2 = element.node.attributes) === null || _element$node$attribu2 === void 0 ? void 0 : _element$node$attribu2.find(function (node) {
180
+ return node.type === 'JSXAttribute' && node.name.name === 'appearance';
181
+ });
182
+ if (_attribute) {
183
+ addCommentBefore(j, j(_attribute), hasSpacingNone ? noSpacinglinkButtonMissingHrefComment : linkButtonMissingHrefComment, 'line');
184
+ }
163
185
  }
164
186
  });
165
187
 
@@ -2,7 +2,9 @@ export var PRINT_SETTINGS = {
2
2
  quote: 'single'
3
3
  };
4
4
 
5
- /** NEW button **/
5
+ /**
6
+ * NEW button *
7
+ */
6
8
  export var NEW_BUTTON_ENTRY_POINT = '@atlaskit/button/new';
7
9
  export var NEW_BUTTON_VARIANTS = {
8
10
  default: 'Button',
@@ -11,7 +13,9 @@ export var NEW_BUTTON_VARIANTS = {
11
13
  linkIcon: 'LinkIconButton'
12
14
  };
13
15
 
14
- /** OLD button **/
16
+ /**
17
+ * OLD button *
18
+ */
15
19
  export var OLD_BUTTON_ENTRY_POINT = '@atlaskit/button';
16
20
  export var OLD_BUTTON_VARIANTS = {
17
21
  loading: 'LoadingButton'
@@ -29,7 +33,8 @@ export var UNSAFE_SIZE_PROPS_MAP = {
29
33
  UNSAFE_iconBefore_size: 'iconBefore'
30
34
  };
31
35
  export var unsupportedProps = ['component', 'css', 'style'];
32
- export var linkButtonMissingHrefComment = "\"link\" and \"subtle-link\" appearances are only available in LinkButton, please either provide a href prop then migrate to LinkButton, or remove the appearance from the default button.";
36
+ export var linkButtonMissingHrefComment = "\"link\" and \"subtle-link\" appearances are not available in the new Button, appearance should be \"subtle\" or \"default\".";
37
+ export var noSpacinglinkButtonMissingHrefComment = "\"link\" and \"subtle-link\" appearances are not available in the new Button, appearance should be \"subtle\" or \"default\", or provide a href prop then migrate to Link.";
33
38
  export var buttonPropsNoLongerSupportedComment = "Buttons with \"component\", \"css\" or \"style\" prop can't be automatically migrated with codemods. Please migrate it manually.";
34
39
  export var migrateFitContainerButtonToDefaultButtonComment = "Migrated to a default button with text which is from the icon label.";
35
40
  export var migrateFitContainerButtonToIconButtonComment = "\"shouldFitContainer\" is not available in icon buttons, please consider using a default button with text.";
@@ -39,4 +44,6 @@ export var loadingButtonComment = function loadingButtonComment(_ref) {
39
44
  var hasLinkAppearance = _ref.hasLinkAppearance,
40
45
  hasHref = _ref.hasHref;
41
46
  return "This should be migrated to a new Button with a `isLoading` prop. ".concat(hasLinkAppearance ? "\"link\" and \"subtle-link\" appearances are not available for new loading buttons.\"" : '').concat(hasHref ? "The `href` attribute it not compatible with new loading buttons, because links should not need loading states." : '', " Please reconsider the design or change the appearance of the button.");
42
- };
47
+ };
48
+ export var migrateButtonToSubtleLinkButton = "\"link\" and \"subtle-link\" appearances are not available in the new Button. Appearance should be migrated to \"subtle\" or \"default\" for Link Button, or use Link with \"default\" appearance.";
49
+ export var migrateSubtleButtonToSubtleLinkButton = "\"link\" and \"subtle-link\" appearances are not available in the new Button. Appearance should be migrated to \"subtle\" or \"default\" for Link Button, or use Link with \"subtle\" appearance.";
@@ -139,4 +139,16 @@ export var generateNewElement = function generateNewElement(variant, element, j)
139
139
  closingElement: isIconOrLinkIcon ? null : j.jsxClosingElement(j.jsxIdentifier(variant)),
140
140
  children: element.children
141
141
  });
142
+ };
143
+ export var modifyButtonAttributes = function modifyButtonAttributes(element, j, hasSpacingNone) {
144
+ j(element).find(j.JSXAttribute).filter(function (path) {
145
+ var _path$node$value2;
146
+ return path.node.name.name === 'appearance' && ((_path$node$value2 = path.node.value) === null || _path$node$value2 === void 0 ? void 0 : _path$node$value2.type) === 'StringLiteral' && (path.node.value.value === 'link' || path.node.value.value === 'subtle-link');
147
+ }).replaceWith(j.jsxAttribute(j.jsxIdentifier('appearance'), j.stringLiteral('subtle')));
148
+ if (hasSpacingNone) {
149
+ j(element).find(j.JSXAttribute).filter(function (path) {
150
+ var _path$node$value3;
151
+ return path.node.name.name === 'spacing' && ((_path$node$value3 = path.node.value) === null || _path$node$value3 === void 0 ? void 0 : _path$node$value3.type) === 'StringLiteral' && path.node.value.value === 'none';
152
+ }).remove();
153
+ }
142
154
  };
@@ -0,0 +1,35 @@
1
+ import { getImportDeclaration } from '@hypermod/utils';
2
+ var PRINT_SETTINGS = {
3
+ quote: 'single'
4
+ };
5
+ function transformer(file, api) {
6
+ var j = api.jscodeshift;
7
+ var source = j(file.source);
8
+
9
+ // check if import from @af/visual-regression
10
+ var imports = getImportDeclaration(j, source, '@af/visual-regression');
11
+ if (!imports.length) {
12
+ return file.source;
13
+ }
14
+
15
+ // find ObjectProperty that has a "environment" property
16
+ // and then a "colorScheme" property inside the "environment" property
17
+ // and value is "dark" inside the "colorScheme" property
18
+ source.find(j.ObjectExpression).filter(function (path) {
19
+ var environmentProperty = path.node.properties.find(function (prop) {
20
+ return prop.type === 'ObjectProperty' && prop.key.type === 'Identifier' && prop.key.name === 'environment';
21
+ });
22
+ if (!environmentProperty) {
23
+ return false;
24
+ }
25
+ var colorSchemeProperty = environmentProperty.type === 'ObjectProperty' && environmentProperty.value.type === 'ObjectExpression' && environmentProperty.value.properties.find(function (path) {
26
+ return path.type === 'ObjectProperty' && path.key.type === 'Identifier' && path.key.name === 'colorScheme';
27
+ });
28
+ if (!colorSchemeProperty) {
29
+ return false;
30
+ }
31
+ return colorSchemeProperty.type === 'ObjectProperty' && colorSchemeProperty.value.type === 'StringLiteral' && colorSchemeProperty.value.value === 'dark';
32
+ }).remove();
33
+ return source.toSource(PRINT_SETTINGS);
34
+ }
35
+ export default transformer;
@@ -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 removeGeminiDarkOptionTransformer from './codemods/remove-gemini-dark-options-transformer';
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 = [removeGeminiDarkOptionTransformer];
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
+ }
@@ -6,5 +6,6 @@ import './styled-to-emotion/styled-to-emotion';
6
6
  import './theme-remove-deprecated-mixins/theme-remove-deprecated-mixins';
7
7
  import './migrate-to-new-buttons/migrate-to-new-buttons';
8
8
  import './upgrade-pragmatic-drag-and-drop-to-stable/upgrade-pragmatic-drag-and-drop-to-stable';
9
+ import './remove-dark-theme-vr-options/remove-dark-theme-vr-options';
9
10
  declare const presets: string[];
10
11
  export default presets;
@@ -1,12 +1,16 @@
1
1
  export declare const PRINT_SETTINGS: {
2
2
  quote: "single";
3
3
  };
4
- /** NEW button **/
4
+ /**
5
+ * NEW button *
6
+ */
5
7
  export declare const NEW_BUTTON_ENTRY_POINT = "@atlaskit/button/new";
6
8
  export declare const NEW_BUTTON_VARIANTS: {
7
9
  [key: string]: string;
8
10
  };
9
- /** OLD button **/
11
+ /**
12
+ * OLD button *
13
+ */
10
14
  export declare const OLD_BUTTON_ENTRY_POINT = "@atlaskit/button";
11
15
  export declare const OLD_BUTTON_VARIANTS: {
12
16
  [key: string]: string;
@@ -17,7 +21,8 @@ export declare const entryPointsMapping: {
17
21
  export declare const BUTTON_TYPES: string[];
18
22
  export declare const UNSAFE_SIZE_PROPS_MAP: Record<string, string>;
19
23
  export declare const unsupportedProps: string[];
20
- export declare const linkButtonMissingHrefComment = "\"link\" and \"subtle-link\" appearances are only available in LinkButton, please either provide a href prop then migrate to LinkButton, or remove the appearance from the default button.";
24
+ export declare const linkButtonMissingHrefComment = "\"link\" and \"subtle-link\" appearances are not available in the new Button, appearance should be \"subtle\" or \"default\".";
25
+ export declare const noSpacinglinkButtonMissingHrefComment = "\"link\" and \"subtle-link\" appearances are not available in the new Button, appearance should be \"subtle\" or \"default\", or provide a href prop then migrate to Link.";
21
26
  export declare const buttonPropsNoLongerSupportedComment = "Buttons with \"component\", \"css\" or \"style\" prop can't be automatically migrated with codemods. Please migrate it manually.";
22
27
  export declare const migrateFitContainerButtonToDefaultButtonComment = "Migrated to a default button with text which is from the icon label.";
23
28
  export declare const migrateFitContainerButtonToIconButtonComment = "\"shouldFitContainer\" is not available in icon buttons, please consider using a default button with text.";
@@ -27,3 +32,5 @@ export declare const loadingButtonComment: ({ hasLinkAppearance, hasHref, }: {
27
32
  hasLinkAppearance: boolean;
28
33
  hasHref: boolean;
29
34
  }) => string;
35
+ export declare const migrateButtonToSubtleLinkButton = "\"link\" and \"subtle-link\" appearances are not available in the new Button. Appearance should be migrated to \"subtle\" or \"default\" for Link Button, or use Link with \"default\" appearance.";
36
+ export declare const migrateSubtleButtonToSubtleLinkButton = "\"link\" and \"subtle-link\" appearances are not available in the new Button. Appearance should be migrated to \"subtle\" or \"default\" for Link Button, or use Link with \"subtle\" appearance.";
@@ -1,4 +1,4 @@
1
- import { type API, type JSXElement, type JSXAttribute, type JSXSpreadAttribute } from 'jscodeshift';
1
+ import { type API, type JSXAttribute, type JSXElement, type JSXSpreadAttribute } from 'jscodeshift';
2
2
  import { NEW_BUTTON_VARIANTS } from '../utils/constants';
3
3
  export declare const getIconAttributes: (attributes: (JSXAttribute | JSXSpreadAttribute)[]) => JSXAttribute[] | null;
4
4
  export declare const getIconElement: (iconAttr: JSXAttribute) => JSXElement | null;
@@ -17,3 +17,4 @@ export declare const getIconElement: (iconAttr: JSXAttribute) => JSXElement | nu
17
17
  */
18
18
  export declare const handleIconAttributes: (element: JSXElement, j: API['jscodeshift'], iconRenamed?: boolean) => void;
19
19
  export declare const generateNewElement: (variant: (typeof NEW_BUTTON_VARIANTS)[keyof typeof NEW_BUTTON_VARIANTS], element: JSXElement, j: API['jscodeshift']) => JSXElement;
20
+ export declare const modifyButtonAttributes: (element: JSXElement, j: API['jscodeshift'], hasSpacingNone: boolean) => void;
@@ -0,0 +1,3 @@
1
+ import { type API, type FileInfo } from 'jscodeshift';
2
+ declare function transformer(file: FileInfo, api: API): string;
3
+ export default transformer;
@@ -0,0 +1,2 @@
1
+ import type { API, FileInfo } from 'jscodeshift';
2
+ export default function transformer(file: FileInfo, api: API): Promise<string>;
@@ -6,5 +6,6 @@ import './styled-to-emotion/styled-to-emotion';
6
6
  import './theme-remove-deprecated-mixins/theme-remove-deprecated-mixins';
7
7
  import './migrate-to-new-buttons/migrate-to-new-buttons';
8
8
  import './upgrade-pragmatic-drag-and-drop-to-stable/upgrade-pragmatic-drag-and-drop-to-stable';
9
+ import './remove-dark-theme-vr-options/remove-dark-theme-vr-options';
9
10
  declare const presets: string[];
10
11
  export default presets;
@@ -1,12 +1,16 @@
1
1
  export declare const PRINT_SETTINGS: {
2
2
  quote: "single";
3
3
  };
4
- /** NEW button **/
4
+ /**
5
+ * NEW button *
6
+ */
5
7
  export declare const NEW_BUTTON_ENTRY_POINT = "@atlaskit/button/new";
6
8
  export declare const NEW_BUTTON_VARIANTS: {
7
9
  [key: string]: string;
8
10
  };
9
- /** OLD button **/
11
+ /**
12
+ * OLD button *
13
+ */
10
14
  export declare const OLD_BUTTON_ENTRY_POINT = "@atlaskit/button";
11
15
  export declare const OLD_BUTTON_VARIANTS: {
12
16
  [key: string]: string;
@@ -17,7 +21,8 @@ export declare const entryPointsMapping: {
17
21
  export declare const BUTTON_TYPES: string[];
18
22
  export declare const UNSAFE_SIZE_PROPS_MAP: Record<string, string>;
19
23
  export declare const unsupportedProps: string[];
20
- export declare const linkButtonMissingHrefComment = "\"link\" and \"subtle-link\" appearances are only available in LinkButton, please either provide a href prop then migrate to LinkButton, or remove the appearance from the default button.";
24
+ export declare const linkButtonMissingHrefComment = "\"link\" and \"subtle-link\" appearances are not available in the new Button, appearance should be \"subtle\" or \"default\".";
25
+ export declare const noSpacinglinkButtonMissingHrefComment = "\"link\" and \"subtle-link\" appearances are not available in the new Button, appearance should be \"subtle\" or \"default\", or provide a href prop then migrate to Link.";
21
26
  export declare const buttonPropsNoLongerSupportedComment = "Buttons with \"component\", \"css\" or \"style\" prop can't be automatically migrated with codemods. Please migrate it manually.";
22
27
  export declare const migrateFitContainerButtonToDefaultButtonComment = "Migrated to a default button with text which is from the icon label.";
23
28
  export declare const migrateFitContainerButtonToIconButtonComment = "\"shouldFitContainer\" is not available in icon buttons, please consider using a default button with text.";
@@ -27,3 +32,5 @@ export declare const loadingButtonComment: ({ hasLinkAppearance, hasHref, }: {
27
32
  hasLinkAppearance: boolean;
28
33
  hasHref: boolean;
29
34
  }) => string;
35
+ export declare const migrateButtonToSubtleLinkButton = "\"link\" and \"subtle-link\" appearances are not available in the new Button. Appearance should be migrated to \"subtle\" or \"default\" for Link Button, or use Link with \"default\" appearance.";
36
+ export declare const migrateSubtleButtonToSubtleLinkButton = "\"link\" and \"subtle-link\" appearances are not available in the new Button. Appearance should be migrated to \"subtle\" or \"default\" for Link Button, or use Link with \"subtle\" appearance.";
@@ -1,4 +1,4 @@
1
- import { type API, type JSXElement, type JSXAttribute, type JSXSpreadAttribute } from 'jscodeshift';
1
+ import { type API, type JSXAttribute, type JSXElement, type JSXSpreadAttribute } from 'jscodeshift';
2
2
  import { NEW_BUTTON_VARIANTS } from '../utils/constants';
3
3
  export declare const getIconAttributes: (attributes: (JSXAttribute | JSXSpreadAttribute)[]) => JSXAttribute[] | null;
4
4
  export declare const getIconElement: (iconAttr: JSXAttribute) => JSXElement | null;
@@ -17,3 +17,4 @@ export declare const getIconElement: (iconAttr: JSXAttribute) => JSXElement | nu
17
17
  */
18
18
  export declare const handleIconAttributes: (element: JSXElement, j: API['jscodeshift'], iconRenamed?: boolean) => void;
19
19
  export declare const generateNewElement: (variant: (typeof NEW_BUTTON_VARIANTS)[keyof typeof NEW_BUTTON_VARIANTS], element: JSXElement, j: API['jscodeshift']) => JSXElement;
20
+ export declare const modifyButtonAttributes: (element: JSXElement, j: API['jscodeshift'], hasSpacingNone: boolean) => void;
@@ -0,0 +1,3 @@
1
+ import { type API, type FileInfo } from 'jscodeshift';
2
+ declare function transformer(file: FileInfo, api: API): string;
3
+ export default transformer;
@@ -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.25.1",
3
+ "version": "0.26.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/"
@@ -30,8 +30,7 @@
30
30
  "./utils": "./src/utils.ts"
31
31
  },
32
32
  "atlassian": {
33
- "team": "Design System Team",
34
- "releaseModel": "continuous"
33
+ "team": "Design System Team"
35
34
  },
36
35
  "scripts": {
37
36
  "prestart": "cd ../../ && yarn build @atlaskit/codemod-utils tokens",
@@ -40,7 +39,7 @@
40
39
  "bin": "./bin/codemod-cli.js",
41
40
  "dependencies": {
42
41
  "@atlaskit/codemod-utils": "^4.2.0",
43
- "@atlaskit/tokens": "^1.54.0",
42
+ "@atlaskit/tokens": "^1.59.0",
44
43
  "@babel/runtime": "^7.0.0",
45
44
  "@codeshift/utils": "^0.2.4",
46
45
  "@hypermod/utils": "^0.4.2",