mainstack-design-system 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +26 -82
  2. package/package.json +4 -2
package/README.md CHANGED
@@ -8,37 +8,47 @@ This is a component library for the Mainstack Design System. It is built with Re
8
8
 
9
9
  To view the design system documentation, visit this [link](https://mainstack-design-system.vercel.app/).
10
10
 
11
- ## Husky
11
+ # Usage
12
12
 
13
- Husky is a git hook manager that allows you to run scripts on git hooks. It is installed as a dev dependency in the project.
13
+ ## Components
14
14
 
15
- ## Conventional Commits
15
+ Components can be used by importing from the `src/components` directory. For example:
16
16
 
17
- Conventional Commits is a specification for adding human and machine readable meaning to commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of. This convention dovetails with [SemVer](https://semver.org), by describing the features, fixes, and breaking changes made in commit messages.
18
- [more info](https://www.conventionalcommits.org/en/v1.0.0/)
17
+ `import { Button } from 'mainstack-design-system/src/components/Buttons';`
18
+
19
+ ## Icons
19
20
 
20
- ## Commitlint
21
+ Icons are imported from the `src/icons` directory. For example:
21
22
 
22
- Commitlint is a tool that checks if your commit messages meet the conventional commit format. It is installed as a dev dependency in the project.
23
+ `import { ArrowRight } from 'mainstack-design-system/src/icons';`
23
24
 
24
- # Vite
25
+ ## Colors
25
26
 
26
- Vite is a build tool that serves your code via native ES Module imports during development. It offers instant server start up and fast hot module replacement for rapid feedback. It also bundles your code with Rollup for production.
27
+ Colors are imported from the `mainstack-design-system/src/components/styleGuide` directory. For example:
27
28
 
28
- ## Getting Started
29
+ ```
30
+ import Colors from "mainstack-design-system/components/styleGuide/Colors";
31
+
32
+ <Text color={Colors.black300}>Hello World</Text>
33
+ ```
34
+
35
+ Conventional Commits is a specification for adding human and machine readable meaning to commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of. This convention dovetails with [SemVer](https://semver.org), by describing the features, fixes, and breaking changes made in commit messages.
36
+ [more info](https://www.conventionalcommits.org/en/v1.0.0/)
37
+
38
+ ## Contributing
29
39
 
30
40
  Installing the application (as a developer) is simple in the following steps:
31
41
 
32
42
  - Access and Clone this repository
33
43
 
34
44
  ```git
35
- git clone git clone https://github.com/The-Mainstack/[repo-name].git && cd [repo-name]
45
+ git clone git clone https://github.com/The-Mainstack/mainstack-design-system.git && cd [repo-name]
36
46
  ```
37
47
 
38
48
  - Make your forked repo the remote upstream (at origin)
39
49
 
40
50
  ```
41
- git remote add origin https://github.com/The-Mainstack/[repo-name].git
51
+ git remote add origin https://github.com/The-Mainstack/mainstack-design-system.git
42
52
  ```
43
53
 
44
54
  - Navigate into the cloned directory and install dependencies with Yarn
@@ -60,80 +70,14 @@ cp .env.sample .env
60
70
  yarn run dev
61
71
  ```
62
72
 
63
- ## Quick Developer Guide
64
-
65
- > It is important to note that we are using best practicees in this project and all rules set down must be followed
66
-
67
- - Linting and prettifying rules are already set in the project and they can be accessed in `.prettierrc` and `.eslintrc.json` files respectively
68
-
69
- - Make sure there are no linting errors before making your push and PRs
70
-
71
- > Theses linting errors will be displayed in your files and the console accordingly
72
-
73
- - All react files must be suffixed with `.tsx` extension for effective import/export flow
74
-
75
- > Bonus: setup format:on save so as to effectively apply the prettier rules
76
-
77
- - Build the app for production to the `build` folder.
78
-
79
- ```yarn
80
- yarn run build
81
- ```
82
-
83
- ## Contributing.
84
-
85
- - Before contributing, ensure you create a branch for a particular feature you'd want to work on, so we wouldn't be having issues of merge conflict
86
- - You can create a branch this way &mdash; always create a branch off staging;
87
-
88
- ```git
89
- git checkout staging
90
- git checkout -b [branch-name]
91
- ```
92
-
93
- - Make your changes, add them and make your commits
73
+ To run storybook, run the following command:
94
74
 
95
- ```git
96
- git commit -m "your message"
97
75
  ```
98
-
99
- Write good commit messages as this is important to know the essence of your commit
100
-
101
- - When you're done with your fixes push to that current branch
102
-
103
- ```git
104
- git push origin [name-of-branch]
76
+ yarn storybook
105
77
  ```
106
78
 
107
- - The command above pushes your your commits to the current branch you're in.
108
- - Then make your Pull Request to the `develop` branch
109
-
110
- ## Commit Structure
111
-
112
- - type: subject e.g body, footer
113
-
114
- The title consists of the type of the message and subject.
115
- The type is contained within the title and can be one of these types:
116
-
117
- - feat: a new feature
118
-
119
- - fix: a bug fix
120
-
121
- - docs: changes to documentation
122
-
123
- - style: formatting, missing semi colons, etc; no code change
124
-
125
- - refactor: refactoring production code
126
-
127
- - test: adding tests, refactoring test; no production code change
128
-
129
- An example of a good commit message
79
+ To Publish to NPM, run the following command:
130
80
 
131
81
  ```
132
- feat: Made login check for email and password
82
+ npm publish --access public
133
83
  ```
134
-
135
- ## notes
136
-
137
- - to use env variables in vite, you need to prefix them with `import.meta.env.`. For example, `process.env.REACT_APP_BASE_URL` becomes `import.meta.env.REACT_APP_BASE_URL`.
138
-
139
- > Happy Hacking !!!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mainstack-design-system",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -9,7 +9,9 @@
9
9
  "format": "prettier src -c --write && pretty-quick --staged",
10
10
  "lint": "eslint src --ext .js,.jsx,.ts,.tsx --quiet --fix",
11
11
  "ts-error": "tsc",
12
- "postinstall": "husky install",
12
+ "install:husky": "[ ! -d \"/node_modules/husky/\" ] || husky install",
13
+ "postinstall": "yarn install:husky",
14
+ "prepare": "yarn install:husky",
13
15
  "scriptname": "cmd",
14
16
  "storybook": "storybook dev -p 6006",
15
17
  "build-storybook": "storybook build"