File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,12 @@ codemod-cli generate fixture <name of codemod> <name of fixture>
5050This sets up two new files in ` transforms/<name of codemod>/__testfixtures__/ ` using the fixture name
5151you provided. These fixtures are used by the testing harness to verify that your codemod is working properly.
5252
53+ Once you have things just how you like them with your new codemod (and your tests are passing :wink : ) you
54+ can update your project's README and your transforms README via:
55+
56+ ```
57+ codemod-cli update-docs
58+ ```
5359
5460Contributing
5561------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -52,6 +52,10 @@ module.exports.handler = function handler(options) {
5252 ### Running tests
5353
5454 * \`yarn test\`
55+
56+ ### Update Documentation
57+
58+ * \`yarn update-docs\`
5559 ` ,
5660 'utf8'
5761 ) ;
@@ -62,6 +66,7 @@ module.exports.handler = function handler(options) {
6266 version : '0.1.0' ,
6367 scripts : {
6468 test : 'codemod-cli test' ,
69+ 'update-docs' : 'codemod-cli update-docs' ,
6570 } ,
6671 bin : './bin/cli.js' ,
6772 keywords : [ 'codemod-cli' ] ,
Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ function updateTransformREADME(transformName) {
3434
3535 let fixtureDir = `transforms/${ transformName } /__testfixtures__` ;
3636
37+ if ( ! fs . existsSync ( fixtureDir ) ) {
38+ // project does not include fixtures (perhaps using different testing
39+ // setup)
40+ return ;
41+ }
42+
3743 fs . readdirSync ( fixtureDir )
3844 . filter ( filename => / \. i n p u t $ / . test ( path . basename ( filename , path . extname ( filename ) ) ) )
3945 . forEach ( filename => {
You can’t perform that action at this time.
0 commit comments