@kokitotsos/react-components
v4.1.0
Published
[![Build Status](https://github.com/kits-ab/react-components/workflows/build/badge.svg?branch=master)](https://github.com/kits-ab/react-components/actions?query=workflow%3Abuild) [![NPM Version](https://badge.fury.io/js/%40kokitotsos%2Freact-components.sv
Downloads
52
Keywords
Readme
KITS Components
This component library includes all of the components that are used to build https://kits.se and other React applications that we create and use at KITS.
To install the library, run npm install --save @kokitotsos/react-components
Checkout https://react-components.kits.se for examples and documentation.
Development
You can use any editor for development (Visual Studio Code, Atom, WebStorm, IntelliJ, Vim, ...) but you should make sure that it supports the following technologies:
- TypeScript – Since the project is written in TypeScript
- EditorConfig – To help the editor use the correct encoding, indentation, ...
- Styled Components – To support styled component that we use for styling our components
- Prettier – To format the code according to our coding conventions
The code is automatically formatted when you commit code. It is also linted before you push the commits to the server.
For debugging purposes you should install React Developer Tools.
Preparations
- Install Node 18 – https://nodejs.org
- Checkout the code and fetch all dependencies
$ git clone [email protected]:kits-ab/react-components.git $ npm install
Available scripts
When you've checked out the code and all dependencies have been fetched you probably want to run npm start
but you can run any of the the following scripts:
npm run build
– Creates a production ready builds indist/
anddist-styleguide/
npm run build:lib
– Creates a production ready build of the library indist/
npm run build:styleguide
– Creates a production ready build of the styleguide indist-styleguide/
npm run clean
– Removes all generated filesnpm run format
– Format the entire codebase using Prettiernpm run icons
– Generate new icon-components fromresources/icons/*.svg
npm lint
– Lints all code with ESLint and Stylelintnpm start
– Starts a local styleguide server with hot reloading enabled on http://localhost:6006 to one or more host projects.
Creating a release
All commits to master must go through a pull request and when all relavant pull requests have been merged you can create a release in GitHub and that will automatically trigger a publish to NPM.
Before you do a release, make sure you've updated the version. The easiest way to do this is to use npm version
. This will update package.json
, create a Git tag and commit all changes. If everything looks as you expect, you can push the changes.
License
Copyright 2022 KITS AB
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.