bit-docs / bit-docs-tag-demo

@demo tag for bit-docs
https://www.npmjs.com/package/bit-docs-tag-demo
MIT License
1 stars 0 forks source link

Make demos self-encapsulated #11

Open leoj3n opened 7 years ago

leoj3n commented 7 years ago

If you have a demo like:

https://github.com/canjs/canjs/blob/master/demos/can-stache-bindings/event-args.html

It is using whatever steal is in the root node_modules (two levels up).

I think it would be better if demos with dependencies had their own node_modules and package.json, with locked-down versions.

Kind of like how you can add dependencies to the html hook that bit-docs-generate-html will automatically install (using enpeem under the hood):

https://github.com/canjs/bit-docs-html-canjs/blob/master/make-example.js#L17-L19

So, probably bit-docs-tag-demo could detect an package.json and run enpeem on it.

It would be good to have the versions of the dependencies the demo relies on locked down, to avoid inadvertently breaking demos when upgrading top-level dependencies.

leoj3n commented 7 years ago

/cc @justinbmeyer we touched on this at next I think