Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @logicalparadox here's a quick attempt at getting plugins to be prefetched.
This uses npm-plugin-fetcher which is a quick script I wrote for this - which just pulls downs package.json files with the
chai-plugin
keyword in their package.json (actually, the files it pulls are more than just package.json - they include readme data and other bits, see https://registry.npmjs.org/chai-spies as an example).These are all downloaded into
./out/plugins/
as JSON files. For now to keep this PR simple, I've just refactored the plugins server and added the prefetch command to the makefile. But future PRs could drop the server requirement and make the site a fully static-generated site.If you demo this server you'll notice there is a somewhat limited list of plugins available on the plugins page - this is because not all plugins include the
chai-plugin
keyword. If you're happy with this PR then I can go and make PRs in all of the packages we have manually listed to add those keywords - alternatively as a quick hack for now, we can just add a bunch ofcurl
s to theplugins
make task (or we could do a combination of both).Also, whereas before plugins in our plugins.js needed to say
browser:true
ornode:true
- now they have to include the keywordschai-plugin-browser
(browser:true
) orchai-plugin-browser-only
(browser:true,node:false
). I figured this was a happy compromise with our existing list - although we lose out on informing visitors exactly how to use the files in browser, but I don't see this as much of an issue personally.Oh, and this fixes #34