@atlaskit/codemod-utils 4.2.0 → 4.2.1
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 +6 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/utils/index.d.ts +3 -3
- package/package.json +10 -2
- package/report.api.md +3 -3
- package/tmp/api-report-tmp.d.ts +122 -0
package/CHANGELOG.md
CHANGED
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import core, { API, ASTPath, FileInfo, Options } from 'jscodeshift';
|
|
2
2
|
import { Collection } from 'jscodeshift/src/Collection';
|
|
3
|
-
declare const createRemoveFuncFor: (component: string, importName: string, prop: string, predicate?: (j: core.JSCodeshift, element: ASTPath<any>) => boolean, comment?: string
|
|
3
|
+
declare const createRemoveFuncFor: (component: string, importName: string, prop: string, predicate?: (j: core.JSCodeshift, element: ASTPath<any>) => boolean, comment?: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
4
4
|
declare const createRenameFuncFor: (component: string, from: string, to: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
5
5
|
declare const createConvertFuncFor: (component: string, from: string, to: string, predicate?: ((value: any) => boolean) | undefined) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
6
6
|
declare const replaceImportStatementFor: (pkg: string, convertMap: any) => (j: core.JSCodeshift, root: Collection<Node>) => void;
|
|
@@ -9,7 +9,7 @@ declare const createTransformer: (migrates: ((j: core.JSCodeshift, source: Colle
|
|
|
9
9
|
declare const elevateComponentToNewEntryPoint: (pkg: string, toPkg: string, innerElementName: string) => (j: core.JSCodeshift, root: any) => void;
|
|
10
10
|
declare const flattenCertainChildPropsAsProp: (component: string, propName: string, childProps: string[]) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
11
11
|
declare const createRenameJSXFunc: (packagePath: string, from: string, to: string, fallback?: string | undefined) => (j: core.JSCodeshift, source: any) => void;
|
|
12
|
-
declare const createRemoveFuncAddCommentFor: (component: string, prop: string, comment?: string
|
|
12
|
+
declare const createRemoveFuncAddCommentFor: (component: string, prop: string, comment?: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
13
13
|
declare const renameNamedImportWithAliasName: (component: string, from: string, to: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
14
|
-
declare const changeImportEntryPoint: (oldPackageName: string, importToConvert: string, newPackageName: string, shouldBeTypeImport?: boolean
|
|
14
|
+
declare const changeImportEntryPoint: (oldPackageName: string, importToConvert: string, newPackageName: string, shouldBeTypeImport?: boolean) => (j: core.JSCodeshift, root: Collection<Node>) => void;
|
|
15
15
|
export { createRenameFuncFor, createConvertFuncFor, createRenameImportFor, createRemoveFuncFor, replaceImportStatementFor, elevateComponentToNewEntryPoint, createTransformer, renameNamedImportWithAliasName, flattenCertainChildPropsAsProp, createRenameJSXFunc, createRemoveFuncAddCommentFor, changeImportEntryPoint, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/codemod-utils",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"author": "Atlassian Pty Ltd",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": " jscodeshift-compatible codemod utilities",
|
|
@@ -17,6 +17,14 @@
|
|
|
17
17
|
"module": "dist/esm/index.js",
|
|
18
18
|
"module:es2019": "dist/es2019/index.js",
|
|
19
19
|
"types": "dist/types/index.d.ts",
|
|
20
|
+
"typesVersions": {
|
|
21
|
+
">=4.5 <4.9": {
|
|
22
|
+
"*": [
|
|
23
|
+
"dist/types-ts4.5/*",
|
|
24
|
+
"dist/types-ts4.5/index.d.ts"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
20
28
|
"sideEffects": false,
|
|
21
29
|
"atlaskit:src": "src/index.ts",
|
|
22
30
|
"af:exports": {
|
|
@@ -30,7 +38,7 @@
|
|
|
30
38
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
31
39
|
"@types/jscodeshift": "^0.11.0",
|
|
32
40
|
"jscodeshift": "^0.13.0",
|
|
33
|
-
"typescript": "4.
|
|
41
|
+
"typescript": "~4.9.5"
|
|
34
42
|
},
|
|
35
43
|
"techstack": {
|
|
36
44
|
"@atlassian/frontend": {
|
package/report.api.md
CHANGED
|
@@ -84,7 +84,7 @@ export const changeImportEntryPoint: (
|
|
|
84
84
|
oldPackageName: string,
|
|
85
85
|
importToConvert: string,
|
|
86
86
|
newPackageName: string,
|
|
87
|
-
shouldBeTypeImport?: boolean
|
|
87
|
+
shouldBeTypeImport?: boolean,
|
|
88
88
|
) => (j: core.JSCodeshift, root: Collection<Node>) => void;
|
|
89
89
|
|
|
90
90
|
// @public (undocumented)
|
|
@@ -99,7 +99,7 @@ export const createConvertFuncFor: (
|
|
|
99
99
|
export const createRemoveFuncAddCommentFor: (
|
|
100
100
|
component: string,
|
|
101
101
|
prop: string,
|
|
102
|
-
comment?: string
|
|
102
|
+
comment?: string,
|
|
103
103
|
) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
104
104
|
|
|
105
105
|
// @public (undocumented)
|
|
@@ -108,7 +108,7 @@ export const createRemoveFuncFor: (
|
|
|
108
108
|
importName: string,
|
|
109
109
|
prop: string,
|
|
110
110
|
predicate?: (j: core.JSCodeshift, element: ASTPath<any>) => boolean,
|
|
111
|
-
comment?: string
|
|
111
|
+
comment?: string,
|
|
112
112
|
) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
113
113
|
|
|
114
114
|
// @public (undocumented)
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/codemod-utils"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { API } from 'jscodeshift';
|
|
8
|
+
import { ASTPath } from 'jscodeshift';
|
|
9
|
+
import { CallExpression } from 'jscodeshift';
|
|
10
|
+
import { Collection } from 'jscodeshift/src/Collection';
|
|
11
|
+
import core from 'jscodeshift';
|
|
12
|
+
import { FileInfo } from 'jscodeshift';
|
|
13
|
+
import { ImportDeclaration } from 'jscodeshift';
|
|
14
|
+
import { ImportDefaultSpecifier } from 'jscodeshift';
|
|
15
|
+
import { ImportSpecifier } from 'jscodeshift';
|
|
16
|
+
import { JSXAttribute } from 'jscodeshift';
|
|
17
|
+
import { JSXElement } from 'jscodeshift';
|
|
18
|
+
import { Options } from 'jscodeshift';
|
|
19
|
+
import { Program } from 'jscodeshift';
|
|
20
|
+
import { VariableDeclaration } from 'jscodeshift';
|
|
21
|
+
import { VariableDeclarator } from 'jscodeshift';
|
|
22
|
+
|
|
23
|
+
// @public (undocumented)
|
|
24
|
+
export function addCommentBefore(j: core.JSCodeshift, target: Collection<CallExpression> | Collection<ImportDeclaration> | Collection<JSXAttribute> | Collection<JSXElement> | Collection<Program> | Collection<VariableDeclarator>, message: string, commentType?: 'block' | 'line', messagePrefix?: string): void;
|
|
25
|
+
|
|
26
|
+
// @public (undocumented)
|
|
27
|
+
export const addCommentToStartOfFile: ({ j, base, message, }: {
|
|
28
|
+
j: core.JSCodeshift;
|
|
29
|
+
base: Collection<Node>;
|
|
30
|
+
message: string;
|
|
31
|
+
}) => void;
|
|
32
|
+
|
|
33
|
+
// @public (undocumented)
|
|
34
|
+
export const addDynamicImport: (j: core.JSCodeshift, target: Collection<VariableDeclaration>, name: string, packageEndpoint: string) => void;
|
|
35
|
+
|
|
36
|
+
// @public (undocumented)
|
|
37
|
+
export function addToImport(j: core.JSCodeshift, base: Collection<any>, importSpecifier: ImportDefaultSpecifier | ImportSpecifier, packageName: string): void;
|
|
38
|
+
|
|
39
|
+
// @public (undocumented)
|
|
40
|
+
export const callExpressionArgMatchesString: (arg: CallExpression['arguments'][number], str: string) => boolean;
|
|
41
|
+
|
|
42
|
+
// @public (undocumented)
|
|
43
|
+
export const changeImportEntryPoint: (oldPackageName: string, importToConvert: string, newPackageName: string, shouldBeTypeImport?: boolean) => (j: core.JSCodeshift, root: Collection<Node>) => void;
|
|
44
|
+
|
|
45
|
+
// @public (undocumented)
|
|
46
|
+
export const createConvertFuncFor: (component: string, from: string, to: string, predicate?: ((value: any) => boolean) | undefined) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
47
|
+
|
|
48
|
+
// @public (undocumented)
|
|
49
|
+
export const createRemoveFuncAddCommentFor: (component: string, prop: string, comment?: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
50
|
+
|
|
51
|
+
// @public (undocumented)
|
|
52
|
+
export const createRemoveFuncFor: (component: string, importName: string, prop: string, predicate?: (j: core.JSCodeshift, element: ASTPath<any>) => boolean, comment?: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
53
|
+
|
|
54
|
+
// @public (undocumented)
|
|
55
|
+
export const createRenameFuncFor: (component: string, from: string, to: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
56
|
+
|
|
57
|
+
// @public (undocumented)
|
|
58
|
+
export const createRenameImportFor: (component: string, from: string, to: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
59
|
+
|
|
60
|
+
// @public (undocumented)
|
|
61
|
+
export const createRenameJSXFunc: (packagePath: string, from: string, to: string, fallback?: string | undefined) => (j: core.JSCodeshift, source: any) => void;
|
|
62
|
+
|
|
63
|
+
// @public (undocumented)
|
|
64
|
+
export const createTransformer: (migrates: ((j: core.JSCodeshift, source: Collection<Node>) => void)[], shouldApplyTransform?: ((j: core.JSCodeshift, source: Collection<Node>) => boolean) | undefined) => (fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) => string;
|
|
65
|
+
|
|
66
|
+
// @public (undocumented)
|
|
67
|
+
export const doesIdentifierExist: (j: core.JSCodeshift, base: Collection<any>, name: string) => boolean;
|
|
68
|
+
|
|
69
|
+
// @public (undocumented)
|
|
70
|
+
export const elevateComponentToNewEntryPoint: (pkg: string, toPkg: string, innerElementName: string) => (j: core.JSCodeshift, root: any) => void;
|
|
71
|
+
|
|
72
|
+
// @public (undocumented)
|
|
73
|
+
export const flattenCertainChildPropsAsProp: (component: string, propName: string, childProps: string[]) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
74
|
+
|
|
75
|
+
// @public (undocumented)
|
|
76
|
+
export const getDefaultSpecifier: (j: core.JSCodeshift, source: Collection<Node>, specifier: string) => null | string;
|
|
77
|
+
|
|
78
|
+
// @public (undocumented)
|
|
79
|
+
export const getDynamicImportName: (j: core.JSCodeshift, source: Collection<any>, importPath: string) => null | string;
|
|
80
|
+
|
|
81
|
+
// @public (undocumented)
|
|
82
|
+
export const getJSXAttributesByName: (j: core.JSCodeshift, element: ASTPath<any>, attributeName: string) => Collection<JSXAttribute>;
|
|
83
|
+
|
|
84
|
+
// @public (undocumented)
|
|
85
|
+
export function getNamedSpecifier(j: core.JSCodeshift, source: Collection<Node>, specifier: string, importName: string): null | string;
|
|
86
|
+
|
|
87
|
+
// @public (undocumented)
|
|
88
|
+
export function getSafeImportName({ j, base, currentDefaultSpecifierName, desiredName, fallbackName, }: {
|
|
89
|
+
j: core.JSCodeshift;
|
|
90
|
+
base: Collection<any>;
|
|
91
|
+
currentDefaultSpecifierName: null | string;
|
|
92
|
+
desiredName: string;
|
|
93
|
+
fallbackName: string;
|
|
94
|
+
}): string;
|
|
95
|
+
|
|
96
|
+
// @public (undocumented)
|
|
97
|
+
export const hasImportDeclaration: (j: core.JSCodeshift, source: Collection<Node>, importPath: string) => boolean;
|
|
98
|
+
|
|
99
|
+
// @public (undocumented)
|
|
100
|
+
export const hasImportDeclarationFromAnyPackageEntrypoint: (j: core.JSCodeshift, source: Collection<Node>, packageName: string) => boolean;
|
|
101
|
+
|
|
102
|
+
// @public (undocumented)
|
|
103
|
+
export const hasJSXAttributesByName: (j: core.JSCodeshift, element: ASTPath<any>, attributeName: string) => boolean;
|
|
104
|
+
|
|
105
|
+
// @public (undocumented)
|
|
106
|
+
export function removeImport(j: core.JSCodeshift, base: Collection<any>, packageName: string): void;
|
|
107
|
+
|
|
108
|
+
// @public (undocumented)
|
|
109
|
+
export const renameNamedImportWithAliasName: (component: string, from: string, to: string) => (j: core.JSCodeshift, source: Collection<Node>) => void;
|
|
110
|
+
|
|
111
|
+
// @public (undocumented)
|
|
112
|
+
export const replaceImportStatementFor: (pkg: string, convertMap: any) => (j: core.JSCodeshift, root: Collection<Node>) => void;
|
|
113
|
+
|
|
114
|
+
// @public (undocumented)
|
|
115
|
+
export const testMethodVariantEach: (path: ASTPath<CallExpression>, testMethods: Set<string>) => boolean;
|
|
116
|
+
|
|
117
|
+
// @public (undocumented)
|
|
118
|
+
export function tryCreateImport(j: core.JSCodeshift, base: Collection<any>, relativeToPackage: string, packageName: string, shouldBeTypeImport?: boolean): void;
|
|
119
|
+
|
|
120
|
+
// (No @packageDocumentation comment for this package)
|
|
121
|
+
|
|
122
|
+
```
|