bugpack is a JavaScript class and package loader that helps make browser and
node js package loading consistent. It is designed to work both within node
js as well as directly in the browser.
bugpack provides a simple package loading mechanism that depends upon a
pre-generated registry called bugpack-registry.json. These files can be
produced using the bugpack-registry project.
NOTE: This documentation is still being written. If you click on a link and it
doesn't go anywhere, it's likely because that portion of the docs hasn't been
written yet. If there are parts of the docs you'd like us to focus on, feel
free to ask!
Getting Started
Generate bugpack-registry.json file
bugpack-registry.json files are what tell the bugpack system the names of all the available exports
and where they can be found. Registry files should generated and placed at the root of either a node
module (for node js) or a base url (for the web). Registry files use relative paths to point the bugpack
system at files. So once the registry file is generated it should stay at the same relative point as
the files that the registry points to...
Example
I have JS files that have bugpack annotations located at...
/my/path/myfile.js
/my/path/somedir/myotherfile.js
I decide to generate my registry at
/my/path
So that the registry now lives at..
/my/path/bugpack-registry.json
As long as the registry file and the JS files remain relative to one another the system will work.
e.g.
I can move all the contents of /my/path/
to /my/elsewhere/
So the files are now
/my/elsewhere/myfile.js
/my/elsewhere/somedir/myotherfile.js
/my/elsewhere/bugpack-registry.json
The registry file is still in the same relative path to the JS files, so it will work..
However, you could not just move the contents of /my/path/somedir/
to /my/path/someotherdir/
So the files are now
/my/path/myfile.js
/my/path/someotherdir/myotherfile.js
/my/path/bugpack-registry.json
This would prevent the bugpack system from correctly knowing where the myotherfile.js is located.
When these breaking changes are made, you will need to regenerate the bugpack-registry.json file