Skip to content

Commit 473473e

Browse files
committed
🔨 Rename test utility
1 parent 6dcd169 commit 473473e

File tree

8 files changed

+24
-13
lines changed

8 files changed

+24
-13
lines changed

.changeset/config.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$schema": "https://unpkg.com/@changesets/config@1.0.1/schema.json",
3-
"changelog": "@changesets/cli/changelog",
4-
"commit": false,
5-
"access": "public",
6-
"baseBranch": "master"
2+
"$schema": "https://unpkg.com/@changesets/config@1.0.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"access": "public",
6+
"baseBranch": "main"
77
}

.changeset/three-islands-rhyme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@codeshift/cli': patch
3+
'@codeshift/utils': patch
4+
---
5+
6+
Minor internal tweaks

.changeset/young-plums-fail.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@codeshift/test-utils': patch
3+
---
4+
5+
Renames runTransform to applyTransform

community/@atlaskit__avatar/18.0.0/__tests__/transform.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
jest.autoMockOff();
22

3-
import { runTransform } from '@codeshift/test-utils';
3+
import { applyTransform } from '@codeshift/test-utils';
44
import * as transformer from '../transform';
55

66
const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
77

88
describe('Update Avatar props', () => {
99
it('should wrap avatar in a tooltip if name is defined', () => {
10-
const result = runTransform(
10+
const result = applyTransform(
1111
transformer,
1212
`
1313
import Avatar from '@atlaskit/avatar';

packages/cli/src/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ Options
2828
--help, 😱
2929
3030
Examples
31-
# Run all transforms for "@atlaskit/button" greater than version 3.0.0 and @atlaskit/range greater than 4.0.0
32-
$ npx @codeshift/cli --packages @atlaskit/button@3.0.0,@atlaskit/range@4.0.0 /project/src
31+
# Run all transforms for "@mylib/button" greater than version 3.0.0 and @mylib/range greater than 4.0.0
32+
$ npx @codeshift/cli --packages @mylib/button@3.0.0,@mylib/range@4.0.0 /project/src
3333
3434
# Run the "my-custom-transform" transform of the "button" package
3535
$ npx @codeshift/cli -t my-custom-transform /project/src

packages/test-utils/src/run-transform.ts renamed to packages/test-utils/src/apply-transform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface Options {
66
parser?: Parser;
77
}
88

9-
export default function runTransform(
9+
export default function applyTransform(
1010
transform: any,
1111
input: string,
1212
options: Options = {

packages/test-utils/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default as runTransform } from './run-transform';
1+
export { default as applyTransform } from './apply-transform';

packages/utils/src/module-imports.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ export function hasImportDeclaration(
1313
export function getImportDeclaration(
1414
j: core.JSCodeshift,
1515
source: ReturnType<typeof j>,
16-
specifier: string,
16+
importPath: string,
1717
) {
1818
return source
1919
.find(j.ImportDeclaration)
20-
.filter(path => path.node.source.value === specifier);
20+
.filter(path => path.node.source.value === importPath);
2121
}
2222

2323
export function getDefaultImportSpecifier(

0 commit comments

Comments
 (0)