0.8.0-beta • Published 3 years ago
@lawsafrica/web-components v0.8.0-beta
Laws.Africa web component library (beta)
This is a collection of web components for formatting and adding interactivity to Akoma Ntoso documents.
These are web components, so they work in any major framework or with no framework at all.
Components
Content components
Behaviour components
Using these component
There are three methods for using these web components:
Script tag
- Put a script tag similar to this
<script type="module" src="https://cdn.jsdelivr.net/npm/@lawsafrica/web-components@0.7.3-beta/dist/la-web-components/la-web-components.esm.js"></script>in the head of your index.html - Then you can use the element anywhere in your template, JSX, html etc
Node Modules
- Run
npm install @lawsafrica/web-components --save - Put a script tag similar to this
<script type="module" src="node_modules/@laws-africa/web-components/dist/la-web-components/la-web-components.esm.js"></script>in the head of your index.html - Then you can use the element anywhere in your template, JSX, html etc
Development
Clone this repository and run:
npm installNeed help? Check out the Stencil docs.
Using Storybook
Development is easiest using Storybook for testing.
Run these commands in separate terminals:
npm run storybooknpm run stencil-for-storybookTo build Storybook for static use (not yet tested):
npm run build-storybookWithout Storybook
npm run startBuilding for production
To build the component for production, run:
npm run buildRunning tests
To run the unit tests for the components, run:
npm testReleasing a new version
- Update the version number:
npm version --no-git-tag-version <version> - Commit and push to GitHub using a Pull Request onto the master branch
- GitHub will build the package and update the
distdirectory - Tag and release using GitHub off of the
masterbranch - GitHub will release a new version of the built package to GitHub packages
Copyright and license
Copyright 2021 Laws.Africa.
Licensed under GNU LGPLv3.