
Nord Web Components
The component package found from packages/components
is built with Stencil.js, a compiler and toolchain for building web components. The component source code is written in TypeScript + JSX (TSX), with stylesheets written in CSS.
The following are the most commonly used commands during development:
npm start
- Compile components, start watching for changes, start local development server.npm run build
- Builds the project.npm test
- Run all tests once.npm test [component-name]
- Run tests for specific component once.npm test --watch
- Run all tests and watch for changes.npm test --watch [component-name]
- Run tests for a specific component and watch for changes.npm test -u
- Updates all failing screenshot snapshots. I sure hope you know what you’re doing. ;-)
The local development server started by npm start
serves a file located at /packages/components/src/index.html
. Any local changes or new components are available on this page, so this can be used as a testing ground when developing.
To create a new component
- Add directory for component under
src/components/[component-name]
. - Add
[component-name].tsx
. - Add
[component-name].css
. - Add
[component-name].e2e.ts
. - Add
readme.md
.
License
See license in LICENSE.md
Copyright
Copyright © 2021 Nordhealth Ltd