Error On Generate
I followed the repo's README steps, and even collaborated with the README from the cli package, as well as checking the code itself to complete the step of generating the completions, but it seems I'm doing everything correctly, but the generator craps out when running the parse-docgen's generateCompletions function, and it seems that it has issues with trying to open the file it's suppose to spit out.
Of course seeing fs errors always make me worry that it's platform independent as well, as packages like fsevents require OSX (and it never fails to remind me). Anyways...
The RAC CLI is version 0.0.3. I'm using a Xbuntu 16.04 (Ubuntu Vivid Core) While it doesn't pertain to this issue, I'm also using Atom 1.10.2
Here's the error:
`React Doc Gen Finished. Build Tokens fs.js:640 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ (under the 'o' in '.open')
Error: ENOENT: no such file or directory, open '/home/dbrown/Development/barista-core/node_modules/react-autocomplete -cli/react-doc-gen-output.json' at Error (native) at Object.fs.openSync (fs.js:640:18) at Object.fs.readFileSync (fs.js:508:33) at generateCompletions (/home/dbrown/Development/barista-core/node_modules/react-autocomplete-cli/parse-docgen.js :14:33) at /home/dbrown/Development/barista-core/node_modules/react-autocomplete-cli/generate-completions.js:31:3 at ChildProcess.exithandler (child_process.js:213:5) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:191:7) at maybeClose (internal/child_process.js:877:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)`
Alright if anyone still wants this info, I've been looking at his code and seeing what could go wrong. Some things are, he doesn't tell us that our component definitions have to follow the guidelines listed on this page: https://github.com/reactjs/react-docgen , because that's the tool he uses to analyze it. Something else I found is that even though it doesn't tell you anywhere, each .jsx file you use has to have only one component being exported in it... you can't have multiple. And the path name has to include the .jsx in it. Or if its a folder, the only files in it can be js/x files with only one component exported in each one. IF any of this doesn't help, what you can do is go to the node_modules/react-autocomplete-cli/ package, and change the bottom exec statement and change it to
exec(`${docGenPath} ${componentsPath} -o ${tmpOutput}`, {cwd: cwd}, function (error, stdout, stderr) { console.log('React Doc Gen Finished. Build Tokens') console.log("\n\n\n") console.log("ERROR") console.log(error) console.log("\n\n\n") console.log("STDOUT") console.log(stdout) console.log("\n\n\n") console.log("STDERR") console.log(stderr) console.log("\n\n\n") generateCompletions() })
And this will output a more specific error as to what's going wrong. If there is any sort of error happening, it WON'T generate the react-doc-gen-output.js file that you're getting the error from.
Hope this helps!