@atlaskit/codemod-cli 0.8.1 → 0.8.5
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 +26 -0
- package/README.md +12 -2
- package/dist/cjs/cli.js +1 -1
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/main.js +6 -4
- package/dist/cjs/presets/index.js +4 -2
- package/dist/cjs/presets/theme-to-design-tokens/theme-to-design-tokens.js +145 -0
- package/dist/cjs/presets/theme-to-design-tokens/types.js +5 -0
- package/dist/cjs/presets/theme-to-design-tokens/utils/ast-meta.js +88 -0
- package/dist/cjs/presets/theme-to-design-tokens/utils/ast.js +19 -0
- package/dist/cjs/presets/theme-to-design-tokens/utils/color.js +59 -0
- package/dist/cjs/presets/theme-to-design-tokens/utils/fuzzy-search.js +348 -0
- package/dist/cjs/presets/theme-to-design-tokens/utils/legacy-colors.js +83 -0
- package/dist/cjs/presets/theme-to-design-tokens/utils/named-colors.js +8 -0
- package/dist/cjs/presets/theme-to-design-tokens/utils/tokens.js +38 -0
- package/dist/cjs/transforms.js +1 -1
- package/dist/cjs/types.js +5 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/cli.js +1 -1
- package/dist/es2019/main.js +3 -1
- package/dist/es2019/presets/index.js +2 -1
- package/dist/es2019/presets/theme-to-design-tokens/theme-to-design-tokens.js +100 -0
- package/dist/es2019/presets/theme-to-design-tokens/types.js +1 -0
- package/dist/es2019/presets/theme-to-design-tokens/utils/ast-meta.js +63 -0
- package/dist/es2019/presets/theme-to-design-tokens/utils/ast.js +10 -0
- package/dist/es2019/presets/theme-to-design-tokens/utils/color.js +35 -0
- package/dist/es2019/presets/theme-to-design-tokens/utils/fuzzy-search.js +336 -0
- package/dist/es2019/presets/theme-to-design-tokens/utils/legacy-colors.js +74 -0
- package/dist/es2019/presets/theme-to-design-tokens/utils/named-colors.js +1 -0
- package/dist/es2019/presets/theme-to-design-tokens/utils/tokens.js +12 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/cli.js +1 -1
- package/dist/esm/main.js +6 -4
- package/dist/esm/presets/index.js +3 -2
- package/dist/esm/presets/theme-to-design-tokens/theme-to-design-tokens.js +130 -0
- package/dist/esm/presets/theme-to-design-tokens/types.js +1 -0
- package/dist/esm/presets/theme-to-design-tokens/utils/ast-meta.js +75 -0
- package/dist/esm/presets/theme-to-design-tokens/utils/ast.js +10 -0
- package/dist/esm/presets/theme-to-design-tokens/utils/color.js +39 -0
- package/dist/esm/presets/theme-to-design-tokens/utils/fuzzy-search.js +340 -0
- package/dist/esm/presets/theme-to-design-tokens/utils/legacy-colors.js +74 -0
- package/dist/esm/presets/theme-to-design-tokens/utils/named-colors.js +1 -0
- package/dist/esm/presets/theme-to-design-tokens/utils/tokens.js +24 -0
- package/dist/esm/types.js +3 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/presets/index.d.ts +1 -0
- package/dist/types/presets/theme-to-design-tokens/theme-to-design-tokens.d.ts +2 -0
- package/dist/types/presets/theme-to-design-tokens/utils/ast-meta.d.ts +3 -0
- package/dist/types/presets/theme-to-design-tokens/utils/ast.d.ts +3 -0
- package/dist/types/presets/theme-to-design-tokens/utils/color.d.ts +4 -0
- package/dist/types/presets/theme-to-design-tokens/utils/fuzzy-search.d.ts +5 -0
- package/dist/types/presets/theme-to-design-tokens/utils/legacy-colors.d.ts +3 -0
- package/dist/types/presets/theme-to-design-tokens/utils/named-colors.d.ts +1 -0
- package/dist/types/presets/theme-to-design-tokens/utils/tokens.d.ts +2 -0
- package/package.json +4 -3
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import designTokens from '@atlaskit/tokens/token-names';
|
|
3
|
+
import renameMapping from '@atlaskit/tokens/rename-mapping';
|
|
4
|
+
export var tokens = Object.keys(designTokens).filter(function (t) {
|
|
5
|
+
return !t.includes('UNSAFE') && !t.includes('interaction');
|
|
6
|
+
}).filter(function (t) {
|
|
7
|
+
return !renameMapping.find(function (_ref) {
|
|
8
|
+
var path = _ref.path;
|
|
9
|
+
return t === path.replace(/\.[default]\g/, '');
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
export var getUniqueWordsFromTokens = Object.keys(designTokens).reduce(function (accum, val) {
|
|
13
|
+
return [].concat(_toConsumableArray(accum), _toConsumableArray(val.split('.')));
|
|
14
|
+
}, []).reduce(function (accum, val) {
|
|
15
|
+
return [].concat(_toConsumableArray(accum), _toConsumableArray(val.split(/(?=[A-Z])/g).map(function (e) {
|
|
16
|
+
return e.toLowerCase();
|
|
17
|
+
})));
|
|
18
|
+
}, []).reduce(function (accum, val) {
|
|
19
|
+
if (!accum.includes(val)) {
|
|
20
|
+
accum.push(val);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return accum;
|
|
24
|
+
}, []);
|
package/dist/esm/types.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
@@ -22,7 +23,7 @@ export var ValidationError = /*#__PURE__*/function (_Error) {
|
|
|
22
23
|
return _super.apply(this, arguments);
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
return ValidationError;
|
|
26
|
+
return _createClass(ValidationError);
|
|
26
27
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
27
28
|
export var NoTransformsExistError = /*#__PURE__*/function (_Error2) {
|
|
28
29
|
_inherits(NoTransformsExistError, _Error2);
|
|
@@ -35,5 +36,5 @@ export var NoTransformsExistError = /*#__PURE__*/function (_Error2) {
|
|
|
35
36
|
return _super2.apply(this, arguments);
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
return NoTransformsExistError;
|
|
39
|
+
return _createClass(NoTransformsExistError);
|
|
39
40
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const isLegacyColor: (value: string) => boolean;
|
|
2
|
+
export declare const isLegacyNamedColor: (value: string) => boolean;
|
|
3
|
+
export declare const includesHardCodedColor: (raw: string) => boolean;
|
|
4
|
+
export declare const isHardCodedColor: (value: string) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const namedColors: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/codemod-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "A cli for distributing codemods for atlassian-frontend components and services",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -17,13 +17,14 @@
|
|
|
17
17
|
"releaseModel": "continuous"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"prestart": "cd ../../ &&
|
|
20
|
+
"prestart": "cd ../../ && yarn build @atlaskit/codemod-utils",
|
|
21
21
|
"start": "./bin/codemod-cli.js"
|
|
22
22
|
},
|
|
23
23
|
"bin": {
|
|
24
24
|
"codemod-cli": "./bin/codemod-cli.js"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
+
"@atlaskit/tokens": "^0.6.0",
|
|
27
28
|
"@babel/runtime": "^7.0.0",
|
|
28
29
|
"@types/chalk": "^2.2.0",
|
|
29
30
|
"@types/jscodeshift": "^0.11.0",
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
"enquirer": "^2.3.4",
|
|
32
33
|
"glob": "^7.1.2",
|
|
33
34
|
"jscodeshift": "^0.13.0",
|
|
34
|
-
"meow": "^
|
|
35
|
+
"meow": "^8.1.1",
|
|
35
36
|
"projector-spawn": "^1.0.1",
|
|
36
37
|
"semver": "^7.3.0",
|
|
37
38
|
"simple-git": "^1.130.0"
|