@atlaskit/codemod-cli 0.14.0 → 0.15.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 (71) hide show
  1. package/CHANGELOG.md +66 -53
  2. package/dist/cjs/main.js +3 -3
  3. package/dist/cjs/presets/css-to-design-tokens/css-to-design-tokens.js +52 -133
  4. package/dist/cjs/presets/css-to-design-tokens/lib/colors.js +49 -0
  5. package/dist/cjs/presets/css-to-design-tokens/lib/declaration.js +29 -0
  6. package/dist/cjs/presets/css-to-design-tokens/{utils → lib}/legacy-colors.js +13 -17
  7. package/dist/cjs/presets/css-to-design-tokens/lib/logger.js +18 -0
  8. package/dist/cjs/presets/css-to-design-tokens/lib/meta.js +157 -0
  9. package/dist/cjs/presets/css-to-design-tokens/lib/tokens.js +47 -0
  10. package/dist/cjs/presets/css-to-design-tokens/lib/value.js +80 -0
  11. package/dist/cjs/presets/index.js +1 -2
  12. package/dist/cjs/presets/styled-to-emotion/styled-to-emotion.js +1 -2
  13. package/dist/cjs/presets/theme-remove-deprecated-mixins/utils/replacements.js +2 -3
  14. package/dist/cjs/presets/theme-to-design-tokens/theme-to-design-tokens.js +2 -2
  15. package/dist/cjs/presets/theme-to-design-tokens/utils/color.js +4 -8
  16. package/dist/cjs/presets/theme-to-design-tokens/utils/css-utils.js +2 -2
  17. package/dist/cjs/presets/theme-to-design-tokens/utils/fuzzy-search.js +1 -2
  18. package/dist/cjs/presets/theme-to-design-tokens/utils/legacy-colors.js +4 -7
  19. package/dist/cjs/presets/theme-to-design-tokens/utils/named-colors.js +1 -2
  20. package/dist/cjs/presets/theme-to-design-tokens/utils/string-utils.js +1 -2
  21. package/dist/cjs/presets/theme-to-design-tokens/utils/tokens.js +3 -5
  22. package/dist/cjs/sinceRef.js +1 -2
  23. package/dist/cjs/transforms.js +6 -12
  24. package/dist/cjs/types.js +3 -5
  25. package/dist/cjs/utils.js +2 -3
  26. package/dist/es2019/presets/css-to-design-tokens/css-to-design-tokens.js +52 -116
  27. package/dist/es2019/presets/css-to-design-tokens/lib/colors.js +34 -0
  28. package/dist/es2019/presets/css-to-design-tokens/lib/declaration.js +17 -0
  29. package/dist/es2019/presets/css-to-design-tokens/{utils → lib}/legacy-colors.js +9 -10
  30. package/dist/es2019/presets/css-to-design-tokens/lib/logger.js +11 -0
  31. package/dist/es2019/presets/css-to-design-tokens/lib/meta.js +133 -0
  32. package/dist/es2019/presets/css-to-design-tokens/lib/tokens.js +24 -0
  33. package/dist/es2019/presets/css-to-design-tokens/lib/value.js +68 -0
  34. package/dist/es2019/presets/theme-to-design-tokens/utils/css-utils.js +2 -2
  35. package/dist/esm/main.js +3 -3
  36. package/dist/esm/presets/css-to-design-tokens/css-to-design-tokens.js +52 -132
  37. package/dist/esm/presets/css-to-design-tokens/lib/colors.js +38 -0
  38. package/dist/esm/presets/css-to-design-tokens/lib/declaration.js +19 -0
  39. package/dist/esm/presets/css-to-design-tokens/{utils → lib}/legacy-colors.js +9 -10
  40. package/dist/esm/presets/css-to-design-tokens/lib/logger.js +11 -0
  41. package/dist/esm/presets/css-to-design-tokens/lib/meta.js +146 -0
  42. package/dist/esm/presets/css-to-design-tokens/lib/tokens.js +40 -0
  43. package/dist/esm/presets/css-to-design-tokens/lib/value.js +73 -0
  44. package/dist/esm/presets/theme-to-design-tokens/theme-to-design-tokens.js +2 -2
  45. package/dist/esm/presets/theme-to-design-tokens/utils/css-utils.js +2 -2
  46. package/dist/types/main.d.ts +0 -1
  47. package/dist/types/presets/css-to-design-tokens/css-to-design-tokens.d.ts +0 -1
  48. package/dist/types/presets/css-to-design-tokens/lib/colors.d.ts +6 -0
  49. package/dist/types/presets/css-to-design-tokens/lib/declaration.d.ts +5 -0
  50. package/dist/types/presets/css-to-design-tokens/{utils → lib}/legacy-colors.d.ts +1 -1
  51. package/dist/types/presets/css-to-design-tokens/lib/logger.d.ts +4 -0
  52. package/dist/types/presets/css-to-design-tokens/lib/meta.d.ts +6 -0
  53. package/dist/types/presets/css-to-design-tokens/lib/tokens.d.ts +7 -0
  54. package/dist/types/presets/css-to-design-tokens/lib/value.d.ts +6 -0
  55. package/dist/types-ts4.5/main.d.ts +0 -1
  56. package/dist/types-ts4.5/presets/css-to-design-tokens/css-to-design-tokens.d.ts +0 -1
  57. package/dist/types-ts4.5/presets/css-to-design-tokens/lib/colors.d.ts +6 -0
  58. package/dist/types-ts4.5/presets/css-to-design-tokens/lib/declaration.d.ts +5 -0
  59. package/dist/types-ts4.5/presets/css-to-design-tokens/{utils → lib}/legacy-colors.d.ts +1 -1
  60. package/dist/types-ts4.5/presets/css-to-design-tokens/lib/logger.d.ts +4 -0
  61. package/dist/types-ts4.5/presets/css-to-design-tokens/lib/meta.d.ts +6 -0
  62. package/dist/types-ts4.5/presets/css-to-design-tokens/lib/tokens.d.ts +7 -0
  63. package/dist/types-ts4.5/presets/css-to-design-tokens/lib/value.d.ts +6 -0
  64. package/package.json +2 -2
  65. package/report.api.md +0 -2
  66. package/tmp/api-report-tmp.d.ts +0 -2
  67. package/dist/cjs/presets/css-to-design-tokens/utils/meta.js +0 -53
  68. package/dist/es2019/presets/css-to-design-tokens/utils/meta.js +0 -33
  69. package/dist/esm/presets/css-to-design-tokens/utils/meta.js +0 -46
  70. package/dist/types/presets/css-to-design-tokens/utils/meta.d.ts +0 -1
  71. package/dist/types-ts4.5/presets/css-to-design-tokens/utils/meta.d.ts +0 -1
@@ -1,46 +0,0 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import designTokens from '@atlaskit/tokens/token-names';
3
- var getUniqueWordsFromTokens = Object.keys(designTokens).reduce(function (accum, val) {
4
- return [].concat(_toConsumableArray(accum), _toConsumableArray(val.split('.')));
5
- }, []).reduce(function (accum, val) {
6
- return [].concat(_toConsumableArray(accum), _toConsumableArray(val.split(/(?=[A-Z])/g).map(function (e) {
7
- return e.toLowerCase();
8
- })));
9
- }, []).reduce(function (accum, val) {
10
- if (!accum.includes(val)) {
11
- accum.push(val);
12
- }
13
- return accum;
14
- }, []);
15
- function filterDuplciateFoundations(meta) {
16
- var foundations = ['text', 'background', 'shadow', 'border'];
17
- var hasFoundation = false;
18
- return meta.filter(function (val) {
19
- if (!hasFoundation && foundations.includes(val)) {
20
- hasFoundation = true;
21
- return true;
22
- }
23
- if (hasFoundation && foundations.includes(val)) {
24
- return false;
25
- }
26
- return true;
27
- });
28
- }
29
- export function cleanMeta(meta) {
30
- var cleanMeta = meta.reduce(function (accum, val) {
31
- return [].concat(_toConsumableArray(accum), _toConsumableArray(typeof val === 'string' ? val.split(/(?=[A-Z])/g).map(function (e) {
32
- return e.toLowerCase();
33
- }) : []));
34
- }, []).reduce(function (accum, val) {
35
- accum.push(val.replace(/:/g, '').replace(/,/g, '').replace('grey', 'neutral').replace('texts', 'text').replace('red', 'danger').replace('error', 'danger').replace('invalid', 'danger').replace('removed', 'danger').replace('removal', 'danger').replace('remove', 'danger').replace('focus', 'focused').replace('valid', 'success').replace('successful', 'success').replace('risk', 'warning').replace('caution', 'warning').replace('warn', 'warning').replace('primary', 'bold').replace('info', 'bold').replace('secondary', 'subtle').replace('hyperlink', 'link').replace('anchor', 'link').replace('active', 'pressed').replace('hover', 'hovered').replace('dragged', 'overlay').replace('dragging', 'overlay').replace('drag', 'overlay').replace('background-color', 'background').replace('color', 'text').replace('icons', 'icon').replace('arrow', 'icon').replace('glyph', 'icon').replace('stroke', 'border').replace('border-left', 'border').replace('border-right', 'border').replace('border-top', 'border').replace('border-bottom', 'border').replace('box-shadow', 'shadow'));
36
- return accum;
37
- }, []).filter(function (val) {
38
- return getUniqueWordsFromTokens.includes(val);
39
- }).reduce(function (accum, val) {
40
- if (!accum.includes(val)) {
41
- accum.push(val);
42
- }
43
- return accum;
44
- }, []);
45
- return filterDuplciateFoundations(cleanMeta);
46
- }
@@ -1 +0,0 @@
1
- export declare function cleanMeta(meta: string[]): string[];
@@ -1 +0,0 @@
1
- export declare function cleanMeta(meta: string[]): string[];