@atlaskit/codemod-cli 0.13.3 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +117 -3
- package/dist/cjs/cli.js +70 -75
- package/dist/cjs/filepath.js +65 -29
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/main.js +329 -167
- package/dist/cjs/presets/css-to-design-tokens/css-to-design-tokens.js +86 -34
- package/dist/cjs/presets/css-to-design-tokens/utils/legacy-colors.js +3 -3
- package/dist/cjs/presets/css-to-design-tokens/utils/meta.js +19 -6
- package/dist/cjs/presets/index.js +3 -1
- package/dist/cjs/presets/styled-to-emotion/styled-to-emotion.js +19 -12
- package/dist/cjs/presets/theme-remove-deprecated-mixins/theme-remove-deprecated-mixins.js +51 -36
- package/dist/cjs/presets/theme-remove-deprecated-mixins/utils/replacements.js +25 -25
- package/dist/cjs/presets/theme-to-design-tokens/theme-to-design-tokens.js +378 -114
- package/dist/cjs/presets/theme-to-design-tokens/utils/ast-meta.js +33 -18
- package/dist/cjs/presets/theme-to-design-tokens/utils/ast.js +1 -1
- package/dist/cjs/presets/theme-to-design-tokens/utils/color.js +25 -17
- package/dist/cjs/presets/theme-to-design-tokens/utils/css-utils.js +38 -0
- package/dist/cjs/presets/theme-to-design-tokens/utils/fuzzy-search.js +10 -6
- package/dist/cjs/presets/theme-to-design-tokens/utils/legacy-colors.js +3 -3
- package/dist/cjs/presets/theme-to-design-tokens/utils/named-colors.js +1 -1
- package/dist/cjs/presets/theme-to-design-tokens/utils/string-utils.js +26 -0
- package/dist/cjs/presets/theme-to-design-tokens/utils/tokens.js +16 -2
- package/dist/cjs/sinceRef.js +69 -35
- package/dist/cjs/transforms.js +44 -26
- package/dist/cjs/types.js +27 -3
- package/dist/cjs/utils.js +6 -6
- package/dist/es2019/cli.js +4 -0
- package/dist/es2019/main.js +2 -0
- package/dist/es2019/presets/css-to-design-tokens/css-to-design-tokens.js +19 -8
- package/dist/es2019/presets/theme-to-design-tokens/theme-to-design-tokens.js +191 -32
- package/dist/es2019/presets/theme-to-design-tokens/utils/ast.js +1 -1
- package/dist/es2019/presets/theme-to-design-tokens/utils/color.js +12 -10
- package/dist/es2019/presets/theme-to-design-tokens/utils/css-utils.js +31 -0
- package/dist/es2019/presets/theme-to-design-tokens/utils/string-utils.js +13 -0
- package/dist/es2019/sinceRef.js +1 -0
- package/dist/esm/cli.js +4 -0
- package/dist/esm/main.js +3 -1
- package/dist/esm/presets/css-to-design-tokens/css-to-design-tokens.js +23 -12
- package/dist/esm/presets/theme-to-design-tokens/theme-to-design-tokens.js +346 -100
- package/dist/esm/presets/theme-to-design-tokens/utils/ast.js +1 -1
- package/dist/esm/presets/theme-to-design-tokens/utils/color.js +12 -10
- package/dist/esm/presets/theme-to-design-tokens/utils/css-utils.js +31 -0
- package/dist/esm/presets/theme-to-design-tokens/utils/string-utils.js +17 -0
- package/dist/esm/sinceRef.js +1 -0
- package/dist/types/presets/css-to-design-tokens/css-to-design-tokens.d.ts +2 -1
- package/dist/types/presets/theme-to-design-tokens/theme-to-design-tokens.d.ts +1 -1
- package/dist/types/presets/theme-to-design-tokens/utils/ast.d.ts +1 -1
- package/dist/types/presets/theme-to-design-tokens/utils/color.d.ts +2 -1
- package/dist/types/presets/theme-to-design-tokens/utils/css-utils.d.ts +2 -0
- package/dist/types/presets/theme-to-design-tokens/utils/string-utils.d.ts +3 -0
- package/dist/types-ts4.5/presets/css-to-design-tokens/css-to-design-tokens.d.ts +2 -1
- package/dist/types-ts4.5/presets/theme-to-design-tokens/theme-to-design-tokens.d.ts +1 -1
- package/dist/types-ts4.5/presets/theme-to-design-tokens/utils/ast.d.ts +1 -1
- package/dist/types-ts4.5/presets/theme-to-design-tokens/utils/color.d.ts +2 -1
- package/dist/types-ts4.5/presets/theme-to-design-tokens/utils/css-utils.d.ts +2 -0
- package/dist/types-ts4.5/presets/theme-to-design-tokens/utils/string-utils.d.ts +6 -0
- package/package.json +2 -2
- package/dist/cjs/version.json +0 -4
- package/dist/es2019/version.json +0 -4
- package/dist/esm/version.json +0 -4
|
@@ -4,140 +4,140 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.colorReplacements = void 0;
|
|
7
|
-
|
|
7
|
+
var colorReplacements = {
|
|
8
8
|
background: {
|
|
9
|
-
fullReplacement:
|
|
9
|
+
fullReplacement: "themed({ light: token('elevation.surface', N0), dark: token('elevation.surface', DN30) })",
|
|
10
10
|
staticReplacement: 'N0',
|
|
11
11
|
tokenId: 'elevation.surface',
|
|
12
12
|
importSpecifiers: ['N0', 'DN30']
|
|
13
13
|
},
|
|
14
14
|
backgroundActive: {
|
|
15
|
-
fullReplacement:
|
|
15
|
+
fullReplacement: "themed({ light: token('color.background.selected', B50), dark: token('color.background.selected', B75) })",
|
|
16
16
|
staticReplacement: 'B50',
|
|
17
17
|
tokenId: 'color.background.selected',
|
|
18
18
|
importSpecifiers: ['B50', 'B75']
|
|
19
19
|
},
|
|
20
20
|
backgroundHover: {
|
|
21
|
-
fullReplacement:
|
|
21
|
+
fullReplacement: "themed({ light: token('color.background.neutral.hovered', N30), dark: token('color.background.neutral.hovered', DN70) })",
|
|
22
22
|
staticReplacement: 'N30',
|
|
23
23
|
tokenId: 'color.background.neutral.hovered',
|
|
24
24
|
importSpecifiers: ['N30', 'DN70']
|
|
25
25
|
},
|
|
26
26
|
backgroundOnLayer: {
|
|
27
|
-
fullReplacement:
|
|
27
|
+
fullReplacement: "themed({ light: token('elevation.surface.overlay', N0), dark: token('elevation.surface.overlay', DN50) })",
|
|
28
28
|
staticReplacement: 'N0',
|
|
29
29
|
tokenId: 'elevation.surface.overlay',
|
|
30
30
|
importSpecifiers: ['N0', 'DN50']
|
|
31
31
|
},
|
|
32
32
|
text: {
|
|
33
|
-
fullReplacement:
|
|
33
|
+
fullReplacement: "themed({ light: token('color.text', N900), dark: token('color.text', DN600) })",
|
|
34
34
|
staticReplacement: 'N900',
|
|
35
35
|
tokenId: 'color.text',
|
|
36
36
|
importSpecifiers: ['N900', 'DN600']
|
|
37
37
|
},
|
|
38
38
|
textHover: {
|
|
39
|
-
fullReplacement:
|
|
39
|
+
fullReplacement: "themed({ light: token('color.text', N800), dark: token('color.text', DN600) })",
|
|
40
40
|
staticReplacement: 'N800',
|
|
41
41
|
tokenId: 'color.text',
|
|
42
42
|
importSpecifiers: ['N800', 'DN600']
|
|
43
43
|
},
|
|
44
44
|
textActive: {
|
|
45
|
-
fullReplacement:
|
|
45
|
+
fullReplacement: "themed({ light: token('color.text.selected', B400), dark: token('color.text.selected', B400) })",
|
|
46
46
|
staticReplacement: 'B400',
|
|
47
47
|
tokenId: 'color.text.selected',
|
|
48
48
|
importSpecifiers: ['B400', 'B400']
|
|
49
49
|
},
|
|
50
50
|
subtleText: {
|
|
51
|
-
fullReplacement:
|
|
51
|
+
fullReplacement: "themed({ light: token('color.text.subtlest', N200), dark: token('color.text.subtlest', DN300) })",
|
|
52
52
|
staticReplacement: 'N200',
|
|
53
53
|
tokenId: 'color.text.subtlest',
|
|
54
54
|
importSpecifiers: ['N200', 'DN300']
|
|
55
55
|
},
|
|
56
56
|
placeholderText: {
|
|
57
|
-
fullReplacement:
|
|
57
|
+
fullReplacement: "themed({ light: token('color.text.subtlest', N100), dark: token('color.text.subtlest', DN200) })",
|
|
58
58
|
staticReplacement: 'N100',
|
|
59
59
|
tokenId: 'color.text.subtlest',
|
|
60
60
|
importSpecifiers: ['N100', 'DN200']
|
|
61
61
|
},
|
|
62
62
|
heading: {
|
|
63
|
-
fullReplacement:
|
|
63
|
+
fullReplacement: "themed({ light: token('color.text', N800), dark: token('color.text', DN600) })",
|
|
64
64
|
staticReplacement: 'N800',
|
|
65
65
|
tokenId: 'color.text',
|
|
66
66
|
importSpecifiers: ['N800', 'DN600']
|
|
67
67
|
},
|
|
68
68
|
subtleHeading: {
|
|
69
|
-
fullReplacement:
|
|
69
|
+
fullReplacement: "themed({ light: token('color.text.subtlest', N200), dark: token('color.text.subtlest', DN300) })",
|
|
70
70
|
staticReplacement: 'N200',
|
|
71
71
|
tokenId: 'color.text.subtlest',
|
|
72
72
|
importSpecifiers: ['N200', 'DN300']
|
|
73
73
|
},
|
|
74
74
|
codeBlock: {
|
|
75
|
-
fullReplacement:
|
|
75
|
+
fullReplacement: "themed({ light: N20, dark: DN50 });",
|
|
76
76
|
staticReplacement: 'N20',
|
|
77
77
|
importSpecifiers: ['N20', 'DN50']
|
|
78
78
|
},
|
|
79
79
|
link: {
|
|
80
|
-
fullReplacement:
|
|
80
|
+
fullReplacement: "themed({ light: token('color.link', B400), dark: token('color.link', B100) })",
|
|
81
81
|
staticReplacement: 'B400',
|
|
82
82
|
tokenId: 'color.link',
|
|
83
83
|
importSpecifiers: ['B400', 'B100']
|
|
84
84
|
},
|
|
85
85
|
linkHover: {
|
|
86
|
-
fullReplacement:
|
|
86
|
+
fullReplacement: "themed({ light: token('color.link.pressed', B300), dark: token('color.link.pressed', B200) })",
|
|
87
87
|
staticReplacement: 'B300',
|
|
88
88
|
tokenId: 'color.link.pressed',
|
|
89
89
|
importSpecifiers: ['B300', 'B200']
|
|
90
90
|
},
|
|
91
91
|
linkActive: {
|
|
92
|
-
fullReplacement:
|
|
92
|
+
fullReplacement: "themed({ light: token('color.link.pressed', B500), dark: token('color.link.pressed', B100) })",
|
|
93
93
|
staticReplacement: 'B500',
|
|
94
94
|
tokenId: 'color.link.pressed',
|
|
95
95
|
importSpecifiers: ['B500', 'B100']
|
|
96
96
|
},
|
|
97
97
|
linkOutline: {
|
|
98
|
-
fullReplacement:
|
|
98
|
+
fullReplacement: "themed({ light: token('color.border.focused', B100), dark: token('color.border.focused', B200) })",
|
|
99
99
|
staticReplacement: 'B100',
|
|
100
100
|
tokenId: 'color.border.focused',
|
|
101
101
|
importSpecifiers: ['B100', 'B200']
|
|
102
102
|
},
|
|
103
103
|
primary: {
|
|
104
|
-
fullReplacement:
|
|
104
|
+
fullReplacement: "themed({ light: token('color.background.brand.bold', B400), dark: token('color.background.brand.bold', B100) })",
|
|
105
105
|
staticReplacement: 'B400',
|
|
106
106
|
tokenId: 'color.background.brand.bold',
|
|
107
107
|
importSpecifiers: ['B400', 'B100']
|
|
108
108
|
},
|
|
109
109
|
blue: {
|
|
110
|
-
fullReplacement:
|
|
110
|
+
fullReplacement: "themed({ light: B400, dark: B100, })",
|
|
111
111
|
staticReplacement: 'B400',
|
|
112
112
|
importSpecifiers: ['B400', 'B100']
|
|
113
113
|
},
|
|
114
114
|
teal: {
|
|
115
|
-
fullReplacement:
|
|
115
|
+
fullReplacement: "themed({ light: T300, dark: T200 })",
|
|
116
116
|
staticReplacement: 'T300',
|
|
117
117
|
importSpecifiers: ['T300', 'T200']
|
|
118
118
|
},
|
|
119
119
|
purple: {
|
|
120
|
-
fullReplacement:
|
|
120
|
+
fullReplacement: "themed({ light: P300, dark: P100 })",
|
|
121
121
|
staticReplacement: 'P300',
|
|
122
122
|
importSpecifiers: ['P300', 'P100']
|
|
123
123
|
},
|
|
124
124
|
red: {
|
|
125
|
-
fullReplacement:
|
|
125
|
+
fullReplacement: "R300",
|
|
126
126
|
staticReplacement: 'R300',
|
|
127
127
|
importSpecifiers: ['R300']
|
|
128
128
|
},
|
|
129
129
|
yellow: {
|
|
130
|
-
fullReplacement:
|
|
130
|
+
fullReplacement: "Y300",
|
|
131
131
|
staticReplacement: 'Y300',
|
|
132
132
|
importSpecifiers: ['Y300']
|
|
133
133
|
},
|
|
134
134
|
green: {
|
|
135
|
-
fullReplacement:
|
|
135
|
+
fullReplacement: "G300",
|
|
136
136
|
staticReplacement: 'G300',
|
|
137
137
|
importSpecifiers: ['G300']
|
|
138
138
|
},
|
|
139
139
|
skeleton: {
|
|
140
|
-
fullReplacement:
|
|
140
|
+
fullReplacement: "token('color.skeleton', N20A)",
|
|
141
141
|
staticReplacement: 'N20A',
|
|
142
142
|
tokenId: 'color.skeleton',
|
|
143
143
|
importSpecifiers: ['N20A']
|