d2l-htmleditor
An HTML editor that integrates with Brightspace. Coming soon!
Installation
To install from NPM:
npm install @brightspace-ui/htmleditor
Usage
<script type="module">
import '@brightspace-ui/htmleditor/htmleditor.js';
</script>
<d2l-htmleditor html="..."></d2l-htmleditor>
Developing, Testing and Contributing
After cloning the repo, run npm install
to install dependencies, npm run build
to extract the supported tinyMCE languages.
Running the demos
To start an es-dev-server that hosts the demo page and tests:
npm start
Linting
# eslint and lit-analyzer
npm run lint
# eslint only
npm run lint:eslint
# lit-analyzer only
npm run lint:lit
Testing
# lint, unit test and visual-diff test
npm test
# lint only
npm run lint
# unit tests only
npm run test:headless
# debug or run a subset of local unit tests
# then navigate to `http://localhost:9876/debug.html`
npm run test:headless:watch
Visual Diff Testing
This repo uses the @brightspace-ui/visual-diff utility to compare current snapshots against a set of golden snapshots stored in source control.
# run visual-diff tests
npm run test:diff
# subset of visual-diff tests:
npm run test:diff -- -g some-pattern
# update visual-diff goldens
npm run test:diff:golden
Golden snapshots in source control must be updated by Travis CI. To trigger an update, press the "Regenerate Goldens" button in the pull request visual-difference
test run.
Versioning, Releasing & Deploying
All version changes should obey semantic versioning rules.
Include either [increment major]
, [increment minor]
or [increment patch]
in your merge commit message to automatically increment the package.json
version, create a tag, and trigger a deployment to NPM.