@storybook/codemod 0.0.0-pr-28920-sha-f4db6c03 → 0.0.0-pr-28882-sha-2310d8df
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.
@@ -3,16 +3,17 @@
|
|
3
3
|
*
|
4
4
|
* For example:
|
5
5
|
*
|
6
|
-
*
|
7
|
-
* label="The Button" />);
|
6
|
+
* input { Button } from './Button';
|
7
|
+
* storiesOf('Button', module).add('story', () => <Button label="The Button" />);
|
8
8
|
*
|
9
9
|
* Becomes:
|
10
10
|
*
|
11
|
-
*
|
12
|
-
*
|
11
|
+
* input { Button } from './Button';
|
12
|
+
* storiesOf('Button', module)
|
13
|
+
* .addParameters({ component: Button })
|
14
|
+
* .add('story', () => <Button label="The Button" />);
|
13
15
|
*
|
14
16
|
* Heuristics:
|
15
|
-
*
|
16
17
|
* - The storiesOf "kind" name must be Button
|
17
18
|
* - Button must be imported in the file
|
18
19
|
*/
|
@@ -1,24 +1,24 @@
|
|
1
1
|
/**
|
2
2
|
* Hoist CSF .story annotations
|
3
3
|
*
|
4
|
-
*
|
4
|
+
* For example:
|
5
5
|
*
|
6
|
-
* ```
|
6
|
+
* ```
|
7
7
|
* export const Basic = () => <Button />
|
8
8
|
* Basic.story = {
|
9
9
|
* name: 'foo',
|
10
|
-
* parameters: {
|
11
|
-
* decorators = [
|
10
|
+
* parameters: { ... },
|
11
|
+
* decorators = [ ... ],
|
12
12
|
* };
|
13
13
|
* ```
|
14
14
|
*
|
15
15
|
* Becomes:
|
16
16
|
*
|
17
17
|
* ```
|
18
|
-
* export const Basic = () => <Button
|
18
|
+
* export const Basic = () => <Button />
|
19
19
|
* Basic.storyName = 'foo';
|
20
|
-
* Basic.parameters = {};
|
21
|
-
* Basic.decorators = [];
|
20
|
+
* Basic.parameters = { ... };
|
21
|
+
* Basic.decorators = [ ... ];
|
22
22
|
* ```
|
23
23
|
*/
|
24
24
|
declare function transformer(file: any, api: any): any;
|
@@ -1,22 +1,26 @@
|
|
1
1
|
/**
|
2
|
-
* Takes the deprecated addon-info API, addWithInfo, and
|
2
|
+
* Takes the deprecated addon-info API, addWithInfo, and
|
3
|
+
* converts to the new withInfo API.
|
3
4
|
*
|
4
|
-
*
|
5
|
+
* Example of deprecated addWithInfo API:
|
5
6
|
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
9
|
-
*
|
10
|
-
*
|
7
|
+
* storiesOf('Button')
|
8
|
+
* .addWithInfo(
|
9
|
+
* 'story name',
|
10
|
+
* 'Story description.',
|
11
|
+
* () => (
|
12
|
+
* <Button label="The Button" />
|
13
|
+
* )
|
14
|
+
* )
|
11
15
|
*
|
12
16
|
* Converts to the new withInfo API:
|
13
17
|
*
|
14
|
-
*
|
15
|
-
*
|
16
|
-
*
|
17
|
-
*
|
18
|
-
*
|
19
|
-
*
|
18
|
+
* storiesOf('Button')
|
19
|
+
* .add('story name', withInfo(
|
20
|
+
* 'Story description.'
|
21
|
+
* )(() => (
|
22
|
+
* <Button label="The Button" />
|
23
|
+
* )))
|
20
24
|
*/
|
21
25
|
declare function transformer(file: any, api: any): any;
|
22
26
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/codemod",
|
3
|
-
"version": "0.0.0-pr-
|
3
|
+
"version": "0.0.0-pr-28882-sha-2310d8df",
|
4
4
|
"description": "A collection of codemod scripts written with JSCodeshift",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -57,7 +57,7 @@
|
|
57
57
|
"@babel/core": "^7.24.4",
|
58
58
|
"@babel/preset-env": "^7.24.4",
|
59
59
|
"@babel/types": "^7.24.0",
|
60
|
-
"@storybook/core": "0.0.0-pr-
|
60
|
+
"@storybook/core": "0.0.0-pr-28882-sha-2310d8df",
|
61
61
|
"@storybook/csf": "^0.1.11",
|
62
62
|
"@types/cross-spawn": "^6.0.2",
|
63
63
|
"cross-spawn": "^7.0.3",
|