-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: ass more codemods * feat(codemodes/config-provider): support `tokensClassNames` * chore: refactor + add panel/modal header codmods --------- Co-authored-by: Inomdzhon Mirdzhamolov <i.mirdzhamolov@vk.team>
- Loading branch information
1 parent
88658fa
commit ff5ec67
Showing
41 changed files
with
579 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/codemods/src/transforms/__testfixtures__/card-scroll/basic.input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { CardScroll } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
|
||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<CardScroll withSpaces>{cards}</CardScroll> | ||
<CardScroll withSpaces={false}>{cards}</CardScroll> | ||
<CardScroll withSpaces={withSpaces}>{cards}</CardScroll> | ||
</React.Fragment> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/codemods/src/transforms/__testfixtures__/gallery/basic.input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Gallery } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
|
||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<Gallery isDraggable>{slides}</Gallery> | ||
<Gallery isDraggable={false}>{slides}</Gallery> | ||
</React.Fragment> | ||
); | ||
}; |
12 changes: 12 additions & 0 deletions
12
packages/codemods/src/transforms/__testfixtures__/image-base/basic.input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Image, ImageBase, Avatar as VKUIAvatar } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
|
||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<Image src="image.svg" withBorder></Image> | ||
<ImageBase withBorder={false} src="image.svg"></ImageBase> | ||
<VKUIAvatar withBorder={true} /> | ||
</React.Fragment> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/codemods/src/transforms/__testfixtures__/panel-header/basic.input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { PanelHeader } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
|
||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<PanelHeader visor>PanelHeader</PanelHeader> | ||
<PanelHeader visor={false}>PanelHeader</PanelHeader> | ||
<PanelHeader separator>PanelHeader</PanelHeader> | ||
<PanelHeader separator={false}>PanelHeader</PanelHeader> | ||
</React.Fragment> | ||
); | ||
}; |
12 changes: 12 additions & 0 deletions
12
packages/codemods/src/transforms/__testfixtures__/placeholder/basic.input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Placeholder } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
|
||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<Placeholder withPadding>Placeholder</Placeholder> | ||
<Placeholder withPadding={true}>Placeholder</Placeholder> | ||
<Placeholder withPadding={false}>Placeholder</Placeholder> | ||
</React.Fragment> | ||
); | ||
}; |
11 changes: 11 additions & 0 deletions
11
packages/codemods/src/transforms/__testfixtures__/popout-wrapper/basic.input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { PopoutWrapper } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
|
||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<PopoutWrapper hasMask /> | ||
<PopoutWrapper hasMask={false} /> | ||
</React.Fragment> | ||
); | ||
}; |
12 changes: 12 additions & 0 deletions
12
packages/codemods/src/transforms/__testfixtures__/select/basic.input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { ChipsSelect, CustomSelect, Select as VKUISelect } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
|
||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<VKUISelect fixDropdownWidth options={options} /> | ||
<CustomSelect fixDropdownWidth={false} options={options} /> | ||
<ChipsSelect fixDropdownWidth={true} options={options} /> | ||
</React.Fragment> | ||
); | ||
}; |
11 changes: 11 additions & 0 deletions
11
packages/codemods/src/transforms/__testfixtures__/tabbar/basic.input.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Tabbar } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
|
||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<Tabbar shadow /> | ||
<Tabbar shadow={false} /> | ||
</React.Fragment> | ||
); | ||
}; |
16 changes: 16 additions & 0 deletions
16
packages/codemods/src/transforms/__tests__/__snapshots__/card-scroll.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`card-scroll transforms correctly 1`] = ` | ||
"import { CardScroll } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<CardScroll>{cards}</CardScroll> | ||
<CardScroll noSpaces>{cards}</CardScroll> | ||
<CardScroll withSpaces={withSpaces}>{cards}</CardScroll> | ||
</React.Fragment> | ||
); | ||
};" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/codemods/src/transforms/__tests__/__snapshots__/gallery.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`gallery transforms correctly 1`] = ` | ||
"import { Gallery } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<Gallery>{slides}</Gallery> | ||
<Gallery dragDisabled>{slides}</Gallery> | ||
</React.Fragment> | ||
); | ||
};" | ||
`; |
16 changes: 16 additions & 0 deletions
16
packages/codemods/src/transforms/__tests__/__snapshots__/image-base.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`image-base transforms correctly 1`] = ` | ||
"import { Image, ImageBase, Avatar as VKUIAvatar } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<Image src="image.svg"></Image> | ||
<ImageBase noBorder src="image.svg"></ImageBase> | ||
<VKUIAvatar /> | ||
</React.Fragment> | ||
); | ||
};" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/codemods/src/transforms/__tests__/__snapshots__/panel-header.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`panel-header transforms correctly 1`] = ` | ||
"import { PanelHeader } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<PanelHeader>PanelHeader</PanelHeader> | ||
<PanelHeader float>PanelHeader</PanelHeader> | ||
<PanelHeader>PanelHeader</PanelHeader> | ||
<PanelHeader delimiter="none">PanelHeader</PanelHeader> | ||
</React.Fragment> | ||
); | ||
};" | ||
`; |
16 changes: 16 additions & 0 deletions
16
packages/codemods/src/transforms/__tests__/__snapshots__/placeholder.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`placeholder transforms correctly 1`] = ` | ||
"import { Placeholder } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<Placeholder>Placeholder</Placeholder> | ||
<Placeholder>Placeholder</Placeholder> | ||
<Placeholder noPadding>Placeholder</Placeholder> | ||
</React.Fragment> | ||
); | ||
};" | ||
`; |
15 changes: 15 additions & 0 deletions
15
packages/codemods/src/transforms/__tests__/__snapshots__/popout-wrapper.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`popout-wrapper transforms correctly 1`] = ` | ||
"import { PopoutWrapper } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<PopoutWrapper /> | ||
<PopoutWrapper noBackground /> | ||
</React.Fragment> | ||
); | ||
};" | ||
`; |
16 changes: 16 additions & 0 deletions
16
packages/codemods/src/transforms/__tests__/__snapshots__/select.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`select transforms correctly 1`] = ` | ||
"import { ChipsSelect, CustomSelect, Select as VKUISelect } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<VKUISelect options={options} /> | ||
<CustomSelect dropdownAutoWidth options={options} /> | ||
<ChipsSelect options={options} /> | ||
</React.Fragment> | ||
); | ||
};" | ||
`; |
15 changes: 15 additions & 0 deletions
15
packages/codemods/src/transforms/__tests__/__snapshots__/tabbar.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`tabbar transforms correctly 1`] = ` | ||
"import { Tabbar } from '@vkontakte/vkui'; | ||
import React from 'react'; | ||
const App = () => { | ||
return ( | ||
<React.Fragment> | ||
<Tabbar /> | ||
<Tabbar plain /> | ||
</React.Fragment> | ||
); | ||
};" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
jest.autoMockOff(); | ||
|
||
import { defineSnapshotTestFromFixture } from '../../testHelpers/testHelper'; | ||
|
||
const name = 'card-scroll'; | ||
const fixtures = ['basic'] as const; | ||
|
||
describe(name, () => { | ||
fixtures.forEach((test) => | ||
defineSnapshotTestFromFixture(__dirname, name, global.TRANSFORM_OPTIONS, `${name}/${test}`), | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
jest.autoMockOff(); | ||
|
||
import { defineSnapshotTestFromFixture } from '../../testHelpers/testHelper'; | ||
|
||
const name = 'gallery'; | ||
const fixtures = ['basic'] as const; | ||
|
||
describe(name, () => { | ||
fixtures.forEach((test) => | ||
defineSnapshotTestFromFixture(__dirname, name, global.TRANSFORM_OPTIONS, `${name}/${test}`), | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
jest.autoMockOff(); | ||
|
||
import { defineSnapshotTestFromFixture } from '../../testHelpers/testHelper'; | ||
|
||
const name = 'image-base'; | ||
const fixtures = ['basic'] as const; | ||
|
||
describe(name, () => { | ||
fixtures.forEach((test) => | ||
defineSnapshotTestFromFixture(__dirname, name, global.TRANSFORM_OPTIONS, `${name}/${test}`), | ||
); | ||
}); |
12 changes: 12 additions & 0 deletions
12
packages/codemods/src/transforms/__tests__/panel-header.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
jest.autoMockOff(); | ||
|
||
import { defineSnapshotTestFromFixture } from '../../testHelpers/testHelper'; | ||
|
||
const name = 'panel-header'; | ||
const fixtures = ['basic'] as const; | ||
|
||
describe(name, () => { | ||
fixtures.forEach((test) => | ||
defineSnapshotTestFromFixture(__dirname, name, global.TRANSFORM_OPTIONS, `${name}/${test}`), | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
jest.autoMockOff(); | ||
|
||
import { defineSnapshotTestFromFixture } from '../../testHelpers/testHelper'; | ||
|
||
const name = 'placeholder'; | ||
const fixtures = ['basic'] as const; | ||
|
||
describe(name, () => { | ||
fixtures.forEach((test) => | ||
defineSnapshotTestFromFixture(__dirname, name, global.TRANSFORM_OPTIONS, `${name}/${test}`), | ||
); | ||
}); |
12 changes: 12 additions & 0 deletions
12
packages/codemods/src/transforms/__tests__/popout-wrapper.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
jest.autoMockOff(); | ||
|
||
import { defineSnapshotTestFromFixture } from '../../testHelpers/testHelper'; | ||
|
||
const name = 'popout-wrapper'; | ||
const fixtures = ['basic'] as const; | ||
|
||
describe(name, () => { | ||
fixtures.forEach((test) => | ||
defineSnapshotTestFromFixture(__dirname, name, global.TRANSFORM_OPTIONS, `${name}/${test}`), | ||
); | ||
}); |
Oops, something went wrong.