@storybook/codemod 5.2.2 → 5.2.6
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/README.md
CHANGED
@@ -208,7 +208,7 @@ This converts all of your CSF Component Stories into MDX syntax, which integrate
|
|
208
208
|
> NOTE: The output of this transformation may require manual editing after running the transformation. MDX is finnicky about the top-level statements it allows. For example, [variables should be defined with exports](https://mdxjs.com/getting-started/#defining-variables-with-exports), meaning `const foo = 5;` should be rewritten as `export const foo = 5;`. We don't do this transformation automatically, since you may prefer to refactor your stories.
|
209
209
|
|
210
210
|
```sh
|
211
|
-
./node_modules/.bin/jscodeshift -t ./node_modules/@storybook/codemod/dist/transforms/csf-to-
|
211
|
+
./node_modules/.bin/jscodeshift -t ./node_modules/@storybook/codemod/dist/transforms/csf-to-mdx.js . --ignore-pattern "node_modules|dist"
|
212
212
|
```
|
213
213
|
|
214
214
|
For example:
|
@@ -18,7 +18,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
18
18
|
// import recast from 'recast';
|
19
19
|
|
20
20
|
/**
|
21
|
-
* Convert a
|
21
|
+
* Convert a component's MDX file into module story format
|
22
22
|
*/
|
23
23
|
function transformer(file, api) {
|
24
24
|
const j = api.jscodeshift;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/codemod",
|
3
|
-
"version": "5.2.
|
3
|
+
"version": "5.2.6",
|
4
4
|
"description": "A collection of codemod scripts written with JSCodeshift",
|
5
5
|
"keywords": [
|
6
6
|
"storybook"
|
@@ -17,7 +17,9 @@
|
|
17
17
|
"license": "MIT",
|
18
18
|
"files": [
|
19
19
|
"dist/**/*",
|
20
|
-
"README.md"
|
20
|
+
"README.md",
|
21
|
+
"*.js",
|
22
|
+
"*.d.ts"
|
21
23
|
],
|
22
24
|
"main": "dist/index.js",
|
23
25
|
"jsnext:main": "src/index.js",
|
@@ -26,13 +28,13 @@
|
|
26
28
|
},
|
27
29
|
"dependencies": {
|
28
30
|
"@mdx-js/mdx": "^1.0.0",
|
29
|
-
"@storybook/node-logger": "5.2.
|
30
|
-
"@storybook/router": "5.2.
|
31
|
+
"@storybook/node-logger": "5.2.6",
|
32
|
+
"@storybook/router": "5.2.6",
|
31
33
|
"core-js": "^3.0.1",
|
32
34
|
"cross-spawn": "^6.0.5",
|
33
35
|
"globby": "^10.0.1",
|
34
36
|
"jscodeshift": "^0.6.3",
|
35
|
-
"lodash": "^4.17.
|
37
|
+
"lodash": "^4.17.15",
|
36
38
|
"prettier": "^1.16.4",
|
37
39
|
"recast": "^0.16.1",
|
38
40
|
"regenerator-runtime": "^0.12.1"
|
@@ -40,5 +42,5 @@
|
|
40
42
|
"publishConfig": {
|
41
43
|
"access": "public"
|
42
44
|
},
|
43
|
-
"gitHead": "
|
45
|
+
"gitHead": "ec8ef5c144e73ce8f762df03da0ac6c2375c223b"
|
44
46
|
}
|