@workwell-global/component-library
v1.1.65
Published
A component library for Workwell
Readme
Workwell Component Library
Testing locally
To use the package locally we use yalc.
- Install yalc globally
npm i yalc -g - Publish the package
npm run yalc:publish - Go to the repo you want to import the module to and run
yalc add @workwell-global/component-library. This will add"@workwell-global/component-library": "file:.yalc/@workwell-global/component-library",to yourpackage.json - For first install of the package in external repo, run
npm i - After making changes in the library, use
npm run yalc:pushto build the library and update the version in the store - When you are done with development and want to return your package.json to its previous setting, run
yalc remove @workwell-global/component-libraryfrom the external repo
Using the package
To import a component into the host repo you can use:
import { WLButton } from '@workwell-global/component-library'or for multiple components:
import { WLButton, WLCard } from '@workwell-global/component-library'Publishing / downloading the package
The package is published to and installed from the NPM package repository and can be installed like any other NPM package.
Important: The version number must be updated for publishing to work.
To publish to npm, you need to run:
npm publish --access publicOr if you have a publish script in your package.json, run that instead. The key difference:
yalc publish → local store only (for testing in other local projects)
npm publish → publishes to npmjs.com
Make sure you're logged in first:
npm whoamiif not logged in:
npm loginThen publish:
npm publish --access publicThe --access public flag is required for scoped packages (like @workwell-global/component-library) to be publicly accessible on npm.
