2.4.0 • Published 3 years ago
@devatpax/web-components v2.4.0
Pax Web Components
Standalone Web Components for Pax, built with Stencil.
Development
Setup
- Checkout the correct Node version: see
.nvmrc
- Using NVM:
nvm use
- Using NVM:
- Install all dependencies:
npm install
Local Development
- Finish setup.
- Start local development:
npm run start
- A browser will open with http://localhost:3333/
- Navigate to the test folder of the component you want to work on, i.e. http://localhost:3333/src/components/badge/test/basic
Notes on developing
- When creating new component tags use the prefix
pax-
. - Follow the recommended coding guidelines from Stencil.
Testing
Visual Regression Testing
- Run docker.
- Start local development:
npm run start
- Open a new terminal tab.
- Take reference screenshots:
npm run test.screenshots.refs
- Do this only once before making any changes
- Take test screenshots:
npm run test.screenshots
- Do this as often as needed during development, but at least once before submitting changes
Publishing
- Finish setup.
- Update version number in
package.json
. - Build web components:
npm run build
- Login to NPM:
npm login
(if not already logged in) - Publish to NPM:
npm publish
Usage
- Install web components as a dependency:
npm install @devatpax/web-components --save
- Put the following tags in the head of your index.html
<link href="https://use.typekit.net/ydt8vux.css" rel="stylesheet">
- Loads web fonts from https://fonts.adobe.com
<link href="node_modules/@devatpax/web-components/dist/pax/pax.css" rel="stylesheet">
<script nomodule src="node_modules/@devatpax/web-components/dist/pax.js"></script>
<script type="module" src="node_modules/@devatpax/web-components/dist/pax/pax.esm.js"></script>
- Then you can use the element anywhere in your template, JSX, html etc