@atlaskit/codemod-cli 0.10.3 → 0.10.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 +12 -0
- package/README.md +2 -2
- package/dist/cjs/main.js +1 -1
- package/dist/cjs/presets/css-to-design-tokens/css-to-design-tokens.js +12 -12
- package/dist/cjs/presets/theme-to-design-tokens/utils/tokens.js +8 -10
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/presets/css-to-design-tokens/css-to-design-tokens.js +2 -4
- package/dist/es2019/presets/theme-to-design-tokens/utils/tokens.js +3 -6
- package/dist/es2019/version.json +1 -1
- package/dist/esm/main.js +1 -1
- package/dist/esm/presets/css-to-design-tokens/css-to-design-tokens.js +10 -11
- package/dist/esm/presets/theme-to-design-tokens/utils/tokens.js +7 -9
- package/dist/esm/version.json +1 -1
- package/package.json +2 -9
- package/report.api.md +23 -5
- package/tmp/api-report-tmp.d.ts +66 -0
- package/dist/types-ts4.0/cli.d.ts +0 -1
- package/dist/types-ts4.0/filepath.d.ts +0 -2
- package/dist/types-ts4.0/index.d.ts +0 -4
- package/dist/types-ts4.0/main.d.ts +0 -19
- package/dist/types-ts4.0/presets/css-to-design-tokens/css-to-design-tokens.d.ts +0 -2
- package/dist/types-ts4.0/presets/css-to-design-tokens/utils/legacy-colors.d.ts +0 -3
- package/dist/types-ts4.0/presets/css-to-design-tokens/utils/meta.d.ts +0 -1
- package/dist/types-ts4.0/presets/index.d.ts +0 -9
- package/dist/types-ts4.0/presets/styled-to-emotion/styled-to-emotion.d.ts +0 -6
- package/dist/types-ts4.0/presets/theme-to-design-tokens/theme-to-design-tokens.d.ts +0 -2
- package/dist/types-ts4.0/presets/theme-to-design-tokens/utils/ast-meta.d.ts +0 -3
- package/dist/types-ts4.0/presets/theme-to-design-tokens/utils/ast.d.ts +0 -3
- package/dist/types-ts4.0/presets/theme-to-design-tokens/utils/color.d.ts +0 -4
- package/dist/types-ts4.0/presets/theme-to-design-tokens/utils/fuzzy-search.d.ts +0 -5
- package/dist/types-ts4.0/presets/theme-to-design-tokens/utils/legacy-colors.d.ts +0 -3
- package/dist/types-ts4.0/presets/theme-to-design-tokens/utils/named-colors.d.ts +0 -1
- package/dist/types-ts4.0/presets/theme-to-design-tokens/utils/tokens.d.ts +0 -2
- package/dist/types-ts4.0/sinceRef.d.ts +0 -5
- package/dist/types-ts4.0/transforms.d.ts +0 -10
- package/dist/types-ts4.0/types.d.ts +0 -59
- package/dist/types-ts4.0/utils.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/codemod-cli
|
|
2
2
|
|
|
3
|
+
## 0.10.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7a958dda205`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7a958dda205) - Updates tokens codemods to only suggest active tokens
|
|
8
|
+
|
|
9
|
+
## 0.10.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 0.10.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Codemod CLI
|
|
2
2
|
|
|
3
|
-
Detailed docs and example usage can be found [here](../../../repo-docs/content/cloud/framework/atlassian-frontend/codemods/
|
|
3
|
+
Detailed docs and example usage can be found [here](../../../repo-docs/content/cloud/framework/atlassian-frontend/codemods/atlassian-codemods.md)
|
|
4
4
|
|
|
5
5
|
## Testing locally
|
|
6
6
|
|
|
@@ -10,4 +10,4 @@ When wanting to run the CLI before it has been published you can run the start c
|
|
|
10
10
|
yarn start [commands]
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
For a list of commands run it with `-h` or look at the [documentation](../../../repo-docs/content/cloud/framework/atlassian-frontend/codemods/
|
|
13
|
+
For a list of commands run it with `-h` or look at the [documentation](../../../repo-docs/content/cloud/framework/atlassian-frontend/codemods/atlassian-codemods.md).
|
package/dist/cjs/main.js
CHANGED
|
@@ -387,7 +387,7 @@ function _main() {
|
|
|
387
387
|
case 4:
|
|
388
388
|
_yield$parseArgs = _context5.sent;
|
|
389
389
|
packages = _yield$parseArgs.packages;
|
|
390
|
-
_process$env$_PACKAGE = "0.10.
|
|
390
|
+
_process$env$_PACKAGE = "0.10.5", _PACKAGE_VERSION_ = _process$env$_PACKAGE === void 0 ? '0.0.0-dev' : _process$env$_PACKAGE;
|
|
391
391
|
logger.log(_chalk.default.bgBlue(_chalk.default.black("\uD83D\uDCDA Atlassian-Frontend codemod library @ ".concat(_PACKAGE_VERSION_, " \uD83D\uDCDA"))));
|
|
392
392
|
|
|
393
393
|
if (packages && packages.length > 0) {
|
|
@@ -19,9 +19,9 @@ var _postcss = _interopRequireDefault(require("postcss"));
|
|
|
19
19
|
|
|
20
20
|
var _postcssLess = _interopRequireDefault(require("postcss-less"));
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _tokensRaw = require("@atlaskit/tokens/tokens-raw");
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _tokenNames = _interopRequireDefault(require("@atlaskit/tokens/token-names"));
|
|
25
25
|
|
|
26
26
|
var _fuzzySearch = _interopRequireDefault(require("../theme-to-design-tokens/utils/fuzzy-search"));
|
|
27
27
|
|
|
@@ -30,14 +30,14 @@ var _legacyColors = require("./utils/legacy-colors");
|
|
|
30
30
|
var _meta = require("./utils/meta");
|
|
31
31
|
|
|
32
32
|
// @ts-ignore
|
|
33
|
-
var tokens =
|
|
34
|
-
return
|
|
33
|
+
var tokens = _tokensRaw.light.filter(function (t) {
|
|
34
|
+
return t.attributes.state === 'active';
|
|
35
|
+
}).map(function (t) {
|
|
36
|
+
return t.name.replace(/\.\[default\]/g, '');
|
|
35
37
|
}).filter(function (t) {
|
|
36
|
-
return !
|
|
37
|
-
var path = _ref.path;
|
|
38
|
-
return t === path.replace(/\.[default]\g/, '');
|
|
39
|
-
});
|
|
38
|
+
return !t.includes('UNSAFE') && !t.includes('interaction');
|
|
40
39
|
});
|
|
40
|
+
|
|
41
41
|
var search = (0, _fuzzySearch.default)(tokens, false);
|
|
42
42
|
|
|
43
43
|
function isRule(node) {
|
|
@@ -90,10 +90,10 @@ function getDeclarationMeta(decl) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function isDesignToken(tokenName) {
|
|
93
|
-
return Boolean(Object.entries(_tokenNames.default).find(function (
|
|
94
|
-
var
|
|
95
|
-
_ =
|
|
96
|
-
value =
|
|
93
|
+
return Boolean(Object.entries(_tokenNames.default).find(function (_ref) {
|
|
94
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
95
|
+
_ = _ref2[0],
|
|
96
|
+
value = _ref2[1];
|
|
97
97
|
|
|
98
98
|
return tokenName === value;
|
|
99
99
|
}));
|
|
@@ -9,20 +9,18 @@ exports.tokens = exports.getUniqueWordsFromTokens = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _tokensRaw = require("@atlaskit/tokens/tokens-raw");
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return
|
|
14
|
+
var tokens = _tokensRaw.light.filter(function (t) {
|
|
15
|
+
return t.attributes.state === 'active';
|
|
16
|
+
}).map(function (t) {
|
|
17
|
+
return t.name.replace(/\.\[default\]/g, '');
|
|
18
18
|
}).filter(function (t) {
|
|
19
|
-
return !
|
|
20
|
-
var path = _ref.path;
|
|
21
|
-
return t === path.replace(/\.[default]\g/, '');
|
|
22
|
-
});
|
|
19
|
+
return !t.includes('UNSAFE') && !t.includes('interaction');
|
|
23
20
|
});
|
|
21
|
+
|
|
24
22
|
exports.tokens = tokens;
|
|
25
|
-
var getUniqueWordsFromTokens =
|
|
23
|
+
var getUniqueWordsFromTokens = tokens.reduce(function (accum, val) {
|
|
26
24
|
return [].concat((0, _toConsumableArray2.default)(accum), (0, _toConsumableArray2.default)(val.split('.')));
|
|
27
25
|
}, []).reduce(function (accum, val) {
|
|
28
26
|
return [].concat((0, _toConsumableArray2.default)(accum), (0, _toConsumableArray2.default)(val.split(/(?=[A-Z])/g).map(function (e) {
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import postcss from 'postcss'; // @ts-ignore
|
|
2
2
|
|
|
3
3
|
import lessSyntax from 'postcss-less';
|
|
4
|
+
import { light as rawTokens } from '@atlaskit/tokens/tokens-raw';
|
|
4
5
|
import designTokens from '@atlaskit/tokens/token-names';
|
|
5
|
-
import renameMapping from '@atlaskit/tokens/rename-mapping';
|
|
6
6
|
import Search from '../theme-to-design-tokens/utils/fuzzy-search';
|
|
7
7
|
import { knownVariables, knownColors, knownRawColors } from './utils/legacy-colors';
|
|
8
8
|
import { cleanMeta } from './utils/meta';
|
|
9
|
-
const tokens =
|
|
10
|
-
path
|
|
11
|
-
}) => t === path.replace(/\.[default]\g/, '')));
|
|
9
|
+
const tokens = rawTokens.filter(t => t.attributes.state === 'active').map(t => t.name.replace(/\.\[default\]/g, '')).filter(t => !t.includes('UNSAFE') && !t.includes('interaction'));
|
|
12
10
|
const search = Search(tokens, false);
|
|
13
11
|
|
|
14
12
|
function isRule(node) {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export const
|
|
4
|
-
path
|
|
5
|
-
}) => t === path.replace(/\.[default]\g/, '')));
|
|
6
|
-
export const getUniqueWordsFromTokens = Object.keys(designTokens).reduce((accum, val) => [...accum, ...val.split('.')], []).reduce((accum, val) => [...accum, ...val.split(/(?=[A-Z])/g).map(e => e.toLowerCase())], []).reduce((accum, val) => {
|
|
1
|
+
import { light as rawTokens } from '@atlaskit/tokens/tokens-raw';
|
|
2
|
+
export const tokens = rawTokens.filter(t => t.attributes.state === 'active').map(t => t.name.replace(/\.\[default\]/g, '')).filter(t => !t.includes('UNSAFE') && !t.includes('interaction'));
|
|
3
|
+
export const getUniqueWordsFromTokens = tokens.reduce((accum, val) => [...accum, ...val.split('.')], []).reduce((accum, val) => [...accum, ...val.split(/(?=[A-Z])/g).map(e => e.toLowerCase())], []).reduce((accum, val) => {
|
|
7
4
|
if (!accum.includes(val)) {
|
|
8
5
|
accum.push(val);
|
|
9
6
|
}
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/main.js
CHANGED
|
@@ -365,7 +365,7 @@ function _main() {
|
|
|
365
365
|
case 4:
|
|
366
366
|
_yield$parseArgs = _context5.sent;
|
|
367
367
|
packages = _yield$parseArgs.packages;
|
|
368
|
-
_process$env$_PACKAGE = "0.10.
|
|
368
|
+
_process$env$_PACKAGE = "0.10.5", _PACKAGE_VERSION_ = _process$env$_PACKAGE === void 0 ? '0.0.0-dev' : _process$env$_PACKAGE;
|
|
369
369
|
logger.log(chalk.bgBlue(chalk.black("\uD83D\uDCDA Atlassian-Frontend codemod library @ ".concat(_PACKAGE_VERSION_, " \uD83D\uDCDA"))));
|
|
370
370
|
|
|
371
371
|
if (packages && packages.length > 0) {
|
|
@@ -5,18 +5,17 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
5
5
|
import postcss from 'postcss'; // @ts-ignore
|
|
6
6
|
|
|
7
7
|
import lessSyntax from 'postcss-less';
|
|
8
|
+
import { light as rawTokens } from '@atlaskit/tokens/tokens-raw';
|
|
8
9
|
import designTokens from '@atlaskit/tokens/token-names';
|
|
9
|
-
import renameMapping from '@atlaskit/tokens/rename-mapping';
|
|
10
10
|
import Search from '../theme-to-design-tokens/utils/fuzzy-search';
|
|
11
11
|
import { knownVariables, knownColors, knownRawColors } from './utils/legacy-colors';
|
|
12
12
|
import { cleanMeta } from './utils/meta';
|
|
13
|
-
var tokens =
|
|
14
|
-
return
|
|
13
|
+
var tokens = rawTokens.filter(function (t) {
|
|
14
|
+
return t.attributes.state === 'active';
|
|
15
|
+
}).map(function (t) {
|
|
16
|
+
return t.name.replace(/\.\[default\]/g, '');
|
|
15
17
|
}).filter(function (t) {
|
|
16
|
-
return !
|
|
17
|
-
var path = _ref.path;
|
|
18
|
-
return t === path.replace(/\.[default]\g/, '');
|
|
19
|
-
});
|
|
18
|
+
return !t.includes('UNSAFE') && !t.includes('interaction');
|
|
20
19
|
});
|
|
21
20
|
var search = Search(tokens, false);
|
|
22
21
|
|
|
@@ -70,10 +69,10 @@ function getDeclarationMeta(decl) {
|
|
|
70
69
|
}
|
|
71
70
|
|
|
72
71
|
function isDesignToken(tokenName) {
|
|
73
|
-
return Boolean(Object.entries(designTokens).find(function (
|
|
74
|
-
var
|
|
75
|
-
_ =
|
|
76
|
-
value =
|
|
72
|
+
return Boolean(Object.entries(designTokens).find(function (_ref) {
|
|
73
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
74
|
+
_ = _ref2[0],
|
|
75
|
+
value = _ref2[1];
|
|
77
76
|
|
|
78
77
|
return tokenName === value;
|
|
79
78
|
}));
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { light as rawTokens } from '@atlaskit/tokens/tokens-raw';
|
|
3
|
+
export var tokens = rawTokens.filter(function (t) {
|
|
4
|
+
return t.attributes.state === 'active';
|
|
5
|
+
}).map(function (t) {
|
|
6
|
+
return t.name.replace(/\.\[default\]/g, '');
|
|
6
7
|
}).filter(function (t) {
|
|
7
|
-
return !
|
|
8
|
-
var path = _ref.path;
|
|
9
|
-
return t === path.replace(/\.[default]\g/, '');
|
|
10
|
-
});
|
|
8
|
+
return !t.includes('UNSAFE') && !t.includes('interaction');
|
|
11
9
|
});
|
|
12
|
-
export var getUniqueWordsFromTokens =
|
|
10
|
+
export var getUniqueWordsFromTokens = tokens.reduce(function (accum, val) {
|
|
13
11
|
return [].concat(_toConsumableArray(accum), _toConsumableArray(val.split('.')));
|
|
14
12
|
}, []).reduce(function (accum, val) {
|
|
15
13
|
return [].concat(_toConsumableArray(accum), _toConsumableArray(val.split(/(?=[A-Z])/g).map(function (e) {
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/codemod-cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.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/"
|
|
@@ -10,13 +10,6 @@
|
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "index.js",
|
|
12
12
|
"types": "dist/types/index.d.ts",
|
|
13
|
-
"typesVersions": {
|
|
14
|
-
">=4.0 <4.5": {
|
|
15
|
-
"*": [
|
|
16
|
-
"dist/types-ts4.0/*"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
13
|
"atlaskit:src": "src/index.ts",
|
|
21
14
|
"atlassian": {
|
|
22
15
|
"team": "Design System Team",
|
|
@@ -31,7 +24,7 @@
|
|
|
31
24
|
"codemod-cli": "./bin/codemod-cli.js"
|
|
32
25
|
},
|
|
33
26
|
"dependencies": {
|
|
34
|
-
"@atlaskit/tokens": "^0.
|
|
27
|
+
"@atlaskit/tokens": "^0.11.0",
|
|
35
28
|
"@babel/runtime": "^7.0.0",
|
|
36
29
|
"@types/jscodeshift": "^0.11.0",
|
|
37
30
|
"chalk": "^4.1.2",
|
package/report.api.md
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
<!-- API Report Version: 2.3 -->
|
|
2
|
+
|
|
1
3
|
## API Report File for "@atlaskit/codemod-cli"
|
|
2
4
|
|
|
3
|
-
> Do not edit this file.
|
|
5
|
+
> Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
|
|
6
|
+
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
|
+
|
|
8
|
+
### Table of contents
|
|
9
|
+
|
|
10
|
+
- [Main Entry Types](#main-entry-types)
|
|
11
|
+
- [Peer Dependencies](#peer-dependencies)
|
|
4
12
|
|
|
5
|
-
|
|
6
|
-
Generated API Report version: 2.0
|
|
7
|
-
-->
|
|
13
|
+
### Main Entry Types
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
<!--SECTION START: Main Entry Types-->
|
|
10
16
|
|
|
11
17
|
```ts
|
|
12
18
|
// @public (undocumented)
|
|
@@ -69,3 +75,15 @@ export class ValidationError extends Error {}
|
|
|
69
75
|
|
|
70
76
|
// (No @packageDocumentation comment for this package)
|
|
71
77
|
```
|
|
78
|
+
|
|
79
|
+
<!--SECTION END: Main Entry Types-->
|
|
80
|
+
|
|
81
|
+
### Peer Dependencies
|
|
82
|
+
|
|
83
|
+
<!--SECTION START: Peer Dependencies-->
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
<!--SECTION END: Peer Dependencies-->
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/codemod-cli"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
// @public (undocumented)
|
|
8
|
+
type CliFlags = {
|
|
9
|
+
transform?: string;
|
|
10
|
+
preset?: string;
|
|
11
|
+
packages?: string;
|
|
12
|
+
parser: 'babel' | 'babylon' | 'flow' | 'ts' | 'tsx';
|
|
13
|
+
extensions: string;
|
|
14
|
+
ignorePattern: string;
|
|
15
|
+
sinceRef?: string;
|
|
16
|
+
failOnError?: boolean;
|
|
17
|
+
filterPaths?: boolean;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// @public
|
|
21
|
+
type Default<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
22
|
+
|
|
23
|
+
// @public (undocumented)
|
|
24
|
+
const defaultFlags: {
|
|
25
|
+
parser: "babel";
|
|
26
|
+
extensions: string;
|
|
27
|
+
ignorePattern: string;
|
|
28
|
+
logger: Console;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// @public (undocumented)
|
|
32
|
+
type Flags_2 = CliFlags & {
|
|
33
|
+
logger: {
|
|
34
|
+
log: (...args: any) => void;
|
|
35
|
+
warn: (...args: any) => void;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export { Flags_2 as Flags }
|
|
39
|
+
|
|
40
|
+
// @public (undocumented)
|
|
41
|
+
function main(input: string[], userFlags: UserFlags): Promise<{
|
|
42
|
+
transforms: {
|
|
43
|
+
module: string;
|
|
44
|
+
root: string;
|
|
45
|
+
dir: string;
|
|
46
|
+
base: string;
|
|
47
|
+
ext: string;
|
|
48
|
+
name: string;
|
|
49
|
+
}[];
|
|
50
|
+
}>;
|
|
51
|
+
export default main;
|
|
52
|
+
|
|
53
|
+
// @public (undocumented)
|
|
54
|
+
export class NoTransformsExistError extends Error {
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// @public (undocumented)
|
|
58
|
+
export type UserFlags = Default<Flags_2, keyof typeof defaultFlags>;
|
|
59
|
+
|
|
60
|
+
// @public (undocumented)
|
|
61
|
+
export class ValidationError extends Error {
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// (No @packageDocumentation comment for this package)
|
|
65
|
+
|
|
66
|
+
```
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function run(): Promise<void>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Flags, Default } from './types';
|
|
2
|
-
declare const defaultFlags: {
|
|
3
|
-
parser: "babel";
|
|
4
|
-
extensions: string;
|
|
5
|
-
ignorePattern: string;
|
|
6
|
-
logger: Console;
|
|
7
|
-
};
|
|
8
|
-
export declare type UserFlags = Default<Flags, keyof typeof defaultFlags>;
|
|
9
|
-
export default function main(input: string[], userFlags: UserFlags): Promise<{
|
|
10
|
-
transforms: {
|
|
11
|
-
module: string;
|
|
12
|
-
root: string;
|
|
13
|
-
dir: string;
|
|
14
|
-
base: string;
|
|
15
|
-
ext: string;
|
|
16
|
-
name: string;
|
|
17
|
-
}[];
|
|
18
|
-
}>;
|
|
19
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function cleanMeta(meta: string[]): string[];
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Manually import presets to make sure typescript includes them
|
|
3
|
-
* in the final bundle
|
|
4
|
-
*/
|
|
5
|
-
import './styled-to-emotion/styled-to-emotion';
|
|
6
|
-
import './theme-to-design-tokens/theme-to-design-tokens';
|
|
7
|
-
import './css-to-design-tokens/css-to-design-tokens';
|
|
8
|
-
declare const presets: string[];
|
|
9
|
-
export default presets;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FileInfo, API, Options } from 'jscodeshift';
|
|
2
|
-
/**
|
|
3
|
-
* Converts all imports of `styled-components` to `@emotion/styled`
|
|
4
|
-
*/
|
|
5
|
-
export default function transformer(fileInfo: FileInfo, { jscodeshift: j }: API, options: Options): string;
|
|
6
|
-
export declare const parser = "tsx";
|
|
@@ -1,4 +0,0 @@
|
|
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const namedColors: string[];
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import path, { ParsedPath } from 'path';
|
|
3
|
-
import { ParsedPkg } from './types';
|
|
4
|
-
export declare const hasTransform: (transformPath: string) => boolean;
|
|
5
|
-
/** Retrieves transforms for `packages` if provided, otherwise all transforms including presets */
|
|
6
|
-
export declare const getTransforms: (packages?: ParsedPkg[] | undefined) => ParsedPath[];
|
|
7
|
-
export declare const parseTransformPath: (transformPath: string) => path.ParsedPath;
|
|
8
|
-
export declare const getTransformPath: ({ dir, base }: ParsedPath) => string;
|
|
9
|
-
export declare const getTransformModule: (transform: ParsedPath) => string;
|
|
10
|
-
export declare const getTransformVersion: (transform: ParsedPath) => string;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { FileInfo, API, Options } from 'jscodeshift';
|
|
2
|
-
export declare type Transform = (fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) => string;
|
|
3
|
-
export declare type CliFlags = {
|
|
4
|
-
/**
|
|
5
|
-
* The transform to run
|
|
6
|
-
*/
|
|
7
|
-
transform?: string;
|
|
8
|
-
/**
|
|
9
|
-
* select which transform to run
|
|
10
|
-
*/
|
|
11
|
-
preset?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Comma separated list of packages to run transforms for, @scope/package[@version]. If version is supplied, will only run transforms above that version
|
|
14
|
-
*/
|
|
15
|
-
packages?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Parser to use for parsing the source files
|
|
18
|
-
*/
|
|
19
|
-
parser: 'babel' | 'babylon' | 'flow' | 'ts' | 'tsx';
|
|
20
|
-
/**
|
|
21
|
-
* Transform files with these file extensions (comma separated list)
|
|
22
|
-
*/
|
|
23
|
-
extensions: string;
|
|
24
|
-
/**
|
|
25
|
-
* Ignore files that match a provided glob expression
|
|
26
|
-
*/
|
|
27
|
-
ignorePattern: string;
|
|
28
|
-
/**
|
|
29
|
-
* Determines changed packages since the specified git ref and runs all codemods for them. The ref can be any valid git ref, e.g. a commit hash, HEAD etc.
|
|
30
|
-
*/
|
|
31
|
-
sinceRef?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Return a 1 exit code when errors were found during execution of codemods
|
|
34
|
-
*/
|
|
35
|
-
failOnError?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Filters source paths to package directories that declare a dependency on the package being upgraded
|
|
38
|
-
*/
|
|
39
|
-
filterPaths?: boolean;
|
|
40
|
-
};
|
|
41
|
-
export declare type Flags = CliFlags & {
|
|
42
|
-
logger: {
|
|
43
|
-
log: (...args: any) => void;
|
|
44
|
-
warn: (...args: any) => void;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
export declare type ParsedPkg = {
|
|
48
|
-
name: string;
|
|
49
|
-
version: string | null;
|
|
50
|
-
};
|
|
51
|
-
/** Converts required args to optional if they have a default
|
|
52
|
-
* Example: export type UserFlags = Default<Flags, keyof typeof defaultFlags>;
|
|
53
|
-
*/
|
|
54
|
-
export declare type Default<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
55
|
-
export declare type ValidateShape<T, Shape> = T extends Shape ? Exclude<keyof T, keyof Shape> extends never ? T : never : never;
|
|
56
|
-
export declare class ValidationError extends Error {
|
|
57
|
-
}
|
|
58
|
-
export declare class NoTransformsExistError extends Error {
|
|
59
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const fixLineEnding: (source: string, lineEnding: string) => string;
|