A [Builder](https://github.com/FormidableLabs/builder) Archetype for Dash components suites
npm install dash-components-archetypeThis is a [Builder][] archetype for [Dash][] component suites. It defines build-
and test configuration, as well as development scripts and a convenient way to
generate a new component suite project with all the necessary boilerplate.
> :mega: Component authors: Subscribe to https://github.com/plotly/dash-components-archetype/issues/40 to be notified of breaking changes :mega:
``sh`
$ npm install -g builder-init
$ builder-init dash-components-archetype
Answer the prompts, then:
`sh`
$ cd [YOUR-COMPONENT-SUITE-NAME]
$ npm install
If your component suite project has a demo/ directory following the sameinit/demo
structure as the directory in this archetype, you can
start up a demo development server:
`sh`
$ npm run demo
$ open http://localhost:9000
This lets you see a demo of the rendered components. You have to maintain the
list of components in demo/Demo.react.js.
To run lint:
`sh`
$ npm test
TODO: ESLint is not reporting problems
https://github.com/plotly/dash-components-archetype/issues/15
The best way to test your components in the real Dash context is by linking into
dash2 and testing them from there.
1. Prepare your component suite module by linking and watching for changes
# Symlink module
$ npm link
# Transpile components to lib/ and watch for changes
$ npm start
2. Link module into dash2 project
# In the dash2/renderer project directory:
$ npm link [YOUR-COMPONENT-SUITE-NAME]
Now you should be able to restart the webpack process (in dash2/renderer:ctrl-c, npm start), after which webpack will automatically pick up new
changes to the component suite.
You can override any npm script in the archetype with your own implementation../node_modules/bin/builder run
To see the list of supported scripts, run . For
more details, see [Builder Archetypes][].
To tag and release a new version of the archetype, follow these instructions.
You might be tempted to add some of these steps to NPM's *version lifecycle
methods, but that would interfere with versioning and publishing of the actual
project depending on the archetype, since [Builder][] merges the project
package.json scripts with the archetype's package.json scripts.
`shversion1. Bump package.json
according to [semver][]
vi package.json
package files5. Publish main and dev package
npm publish && cd dev && npm publish && cd -
`
[Builder]: https://github.com/FormidableLabs/builder
[Builder Archetypes]: https://github.com/FormidableLabs/builder#archetypes
[Dash]: https://plot.ly/dash
[dash-core-components]: https://github.com/plotly/dash-core-components
[semver]: http://semver.org/
You can test component generation with this library with npm link and with the absolute file path option of builder-init.
`
npm install -g builder-init
git clone https://github.com/plotly/dash-components-archetype.git
cd dash-components-archetype
npm link
cd dev
npm link
cd ../..
builder-init /ABSOLUTE/PATH/TO/dash-components-archetype/answer prompts to create new file