0.1.3 • Published 5 years ago
@fsfe/react-library-base v0.1.3
react-library-base
This is a common demo repository of UI elements for React and NextJS apps
yarn add @renassimo/react-library-base
Demo
Run and find elements in local server
- Clone this repo
- Install project by running
yarncommand - Run
yarn storybookto look at component instances on http://localhost:6006/
WorkFlow
- All components should be created in src/lib directory
- Create tests on src/__tests__ directory only
- Each component should be exported from
index.jsfile in src/lib - Each component's demo should be added to storybook (src/stories)
Publishing package
You should do it by promotion button on semaphore.
It's possible on the master branch only.
You can publish with updating to new patch (ex. 1.2.0 -> 1.2.1),
minor (ex. 1.3.1 -> 1.4.0) or major (ex. 1.3.1 -> 2.0.0) versions.
Each promotion will create a new tag in github repo and update version in package.json file:
DANGER ZONE!!!
- If any problems acquired just update version manually in
package.json, runyarn distand thenyarn publish distcommands. - DO NOT run
npm logoutcommand - it will kill current npm token, you should get new one - To remove the version of package run command like
npm unpublish -f @renassimo/react-library-base@1.1.6- that will remove version1.1.6if it has not too many downloads. - To deprecate the version of package run command like
npm deprecate @renassimo/react-library-base@0.1.2 'Deprecated message'- that will deprecate version0.1.2.
Install
If you use NPM:
npm install --save @fsfe/react-library-baseOr if you use yarn:
yarn add @fsfe/react-library-baseInstall from local
If you use NPM:
npm install --save ../react-library-base/distOr if you use yarn:
yarn add ../react-library-base/distWhere ../react-library-base/dist - is the path to local react-library-base repository's dist directory.
Run yarn dist before installing the local package to have actual version.
Setting up in the project (If this package is private)
- Create
.npmrcfile in the root of directory - Add:
//registry.npmjs.org/:_authToken=- Add read only auth token after
=
Using component in the project
- Just import as in example bellow:
impport { Logo } from '@fsfe/react-library-base';- Use it like the ordinary component