There is a demo included which uses Webpack Dev Server to compile the component code on the fly and render an HTML page with various examples of editors. This demo page is also a good environment for doing development.
Starting the Demo Server
- Make sure you're on a recent version of node.js. There is an
.nvmrcfile in the project root, allowing you to type
nvm useif you have nvm installed. That will reference the version of node that this library was authored with.
- Open http://localhost:8080/
How the Demo Works
To see what the demo is doing in order to get example usage of the component, open
- React and React-DOM are loaded as scripts from a CDN, so the webpack build does not need to compile them constantly.
- Babel Standalone is used so that we can use JSX within the demo HTML page and not have to include a separate build process just for the demo page.
Follow the instructions in the Demo section at the top.
Building for Deployment
npm run build
Before committing new code, you need to run
npm run build which will update the ES5 code in
/lib as well as the packaged script file in
This library uses the following frameworks for unit testing:
To run the unit tests:
To run test coverage with HTML output:
npm run coverage-report && open coverage/index.html
Linting is done with ESLint. It uses the same lint configuration as the SDK.
To run the lint:
npm run lint
This will also be done at the completion of running the unit tests.