livechat / styleguidist-scrapper

Scrapper script for documentation generated by https://react-styleguidist.js.org/
26 stars 7 forks source link

Example function always return empty array #2

Open lucantini opened 6 years ago

lucantini commented 6 years ago

The example usage always return an empty array for me. Am I supposed to do something different? All of my Components are documented with styleguidist and my local server is running at 6060, just like the example. I then run the script and the examples is always an empty Array.

While styleguidist is running locally I run:

const fs = require('fs');
const scrape = require('styleguidist-scrapper');

scrape('http://localhost:6060').then(examples => {
    fs.writeFile('./examples-metadata.json', JSON.stringify(examples), 'utf8')
});
cornerstone-digital commented 5 years ago

Same for me? any answers to this?

Andarist commented 5 years ago

Could u share a repository with the issue reproduced? Would allow us fixing this much quicker.

lucantini commented 5 years ago

@Andarist Here is it!

I've created a simple repo with a single Button Component that I've documented with styleguidist. To reproduce the behavior run yarn docs to run the styleguidist dev server and then run yarn scrape, on another tab, to execute the script described above and in the documentation.

The example-metadata.json should be filled with the Button Component information, but it comes out as an empty array. Am I missing something here?