kaiserin-storybook
v0.5.25-stage
Published
# Table of Contents
Downloads
10
Maintainers
Readme
Kaiserin Storybook
Table of Contents
- Kaiser
- Overview
- Technologies
- Getting Started Storybook
- Getting Started with library
- Naming Conventions
- Git Conventions
- Commits Conventions
Overview
Kaiserin storybook
is a project based on the Kaiserin design that has been implemented as a library component.
Technologies
- language: Typescript
- framework: React
- lintins: ESlint
- module bundler: Vite
- storybook: Storybook
Folder Structuring
in this project we follow the folder structuring based on component categories
note: for more information about component categories please visit full-documentation
.
└── src/
├── components/
| ├── index.ts
│ ├── Input/
│ │ └── Button/
│ │ ├── story/
│ │ │ ├── button.stories.tsx
│ │ │ └── template.tsx
│ │ ├── prototype/
│ │ │ └── buttonProto.ts
│ │ ├── button.tsx
│ │ └── style.ts
│ └── Surface/
│ └── app-bar/
│ ├── story/
│ │ ├── AppBar.stories.tsx
│ │ └── template
│ ├── prototype/
│ │ └── appBarProto.ts
│ ├── AppBar.tsx
│ └── AppBar.module.css
└── utils/
├── assets/
│ └── icons
├── configs
├── helpers
└── static-data
Getting Started Storybook
you can start storybook of the library project in two ways: running simple, running with Docker
Development
yarn dev | npm run dev
Production
Build and Run with Docker
docker-compose -f docker-compose.yml up [-d] [--build] [--foce-recreate]
Getting Started library
you can see the npm address of the component from this link
install the library
to install the library in your project you can use following commands:
npm:
npm i @dvh-kaiser/kaiserin-storybook
yarn:
yarn add @dvh-kaiser/kaiserin-storybook
Usage
for using this library inside your projects you can import the components from the root directory of the project example:
import { Button } from "@dvh-kaiser/kaiserin-storybook";
function ExampleButton() {
return (
<div>
<Button label="Submit" backgroundColor="blue" />
</div>
);
}
Naming Convetions:
- all folders follow the kebab-case convention for naming.
- all files follow the camelCase convention for naming.
- all variables and functions follow the camelCase convention for naming.
Git Conventions:
for working with the git we should follow the workflow based on this convention, at firts make your branch based on the latest version of the develop branch with following naming conenvtions for the branch name:
[type of task]/[branch title with kebab case letters]
for type of task we have:
- feature: for add new feature task
- refactor: if your task is to refactoring some of the codes
- fix: if your task is debugging some features
for example
feature/add-button-component
after finishing your task make pull request to the develop
branch
Commits Conventions:
for the commits we should follow the convention that it covers id of your task related to this commit in the tasks board, times that you worked on this commit, and phase of this commit. pattern:
[`[type of your task]`][ `'closes'` | `'refs'` ]#[your task id]@[times that you've spent on this commit]<br/>
[your message description]
for type of tasks we have:
- [DOC]: for adding feature or refactoring in the documentations
- [FEAT]: for adding new feature to the project
- [REF]: refactor some of codes
- [TEST]: for adding tests
- [DEB]: for debugging
for 'closes'
and 'refs'
:
if you have done you task and you want to move it into done sections, use 'closes'
, and if there is still works to be done use 'refs'
for the task id:
you should enter id of your taks in the tasks board that is related to this commit
for the time:
you should enter times that you have spent on this task based on hour(h), minutes(m)
Example:
step one: use git commit without
-m
git commit
step two: add your commit description like the pattern for this task of documentation we have added a commit like this
[DOC]:closes#124@20m add commit conventions to the readme file
step three: save the file and exit in this view we can find what is the topic that we are working on, phase of this commit, related task in the task board and how many time resources we have spent on it