@bikdotai/bik-component-library 0.0.0
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.
- package/LICENSE +21 -0
- package/README.md +100 -0
- package/package.json +131 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Boilertown
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<h1 align="center">♨️ React UI Boilerplate</h1>
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<p>
|
|
5
|
+
A React boilerplate with opinionated setup to help you quickly create your own React UI library.
|
|
6
|
+
</p>
|
|
7
|
+
<img src="https://img.shields.io/github/license/boilertown/react-ui-boilerplate?style=flat-square" alt="MIT license" >
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
## The Setup
|
|
11
|
+
|
|
12
|
+
- [React v18][react-url]
|
|
13
|
+
- [TypeScript][typescript-url]
|
|
14
|
+
- UI development with [Storybook][storybook-url]
|
|
15
|
+
- Unit test with [Testing-library][testing-library-url]
|
|
16
|
+
- Linting with [Eslint][eslint-url] and code formatting with [Prettier][prettier-url]
|
|
17
|
+
- Conventional commit messages with [Commitlint][commitlint-url]
|
|
18
|
+
- Build the library with [Rollup][rollup-url]
|
|
19
|
+
- Automated release with [changesets][changesets-url]
|
|
20
|
+
|
|
21
|
+
## Get Started
|
|
22
|
+
|
|
23
|
+
- Use [Boilertown](https://github.com/boilertown/create-boilertown) CLI.
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
# npm
|
|
27
|
+
npm create boilertown -- -b react-ui-boilerplate
|
|
28
|
+
|
|
29
|
+
# yarn
|
|
30
|
+
yarn create boilertown -b react-ui-boilerplate
|
|
31
|
+
|
|
32
|
+
# pnpm
|
|
33
|
+
pnpm create boilertown -b react-ui-boilerplate
|
|
34
|
+
|
|
35
|
+
# bun
|
|
36
|
+
bun create boilertown/react-ui-boilerplate [library-name]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- Click the green "Use this template" button to generate a new repository with the same structure and files.
|
|
40
|
+
|
|
41
|
+
<img src="https://docs.github.com/assets/cb-36544/images/help/repository/use-this-template-button.png" alt="Use this template button" width="500">
|
|
42
|
+
|
|
43
|
+
[Ref: Github Docs](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template)
|
|
44
|
+
|
|
45
|
+
## Development
|
|
46
|
+
|
|
47
|
+
- Build the library:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
pnpm build
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
- Run storybook:
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
pnpm storybook
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
- Unit test component with:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
pnpm test
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- Create changeset:
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
pnpm changeset
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Release & Publish package
|
|
72
|
+
|
|
73
|
+
This boilerplate uses [changesets][changesets-url] to automatically generate `CHANGELOG`, create releases and publish to NPM registry via GitHub Actions. You can see action details at [release.yml](/.github/workflows//release.yml).
|
|
74
|
+
|
|
75
|
+
To automating publish your library, follow these steps:
|
|
76
|
+
|
|
77
|
+
- Create a `NPM_TOKEN`. [See this article for more details](https://docs.npmjs.com/creating-and-viewing-access-tokens). Make sure the type of access token is **Automation**.
|
|
78
|
+
|
|
79
|
+
- [Follow this instruction](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) to add the created token to your GitHub Actions secrets. Name of the secret is `NPM_TOKEN`.
|
|
80
|
+
|
|
81
|
+
- Install [changeset bot](https://github.com/apps/changeset-bot).
|
|
82
|
+
|
|
83
|
+
- [Adding changeset and commit](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md#i-am-in-a-single-package-repository).
|
|
84
|
+
|
|
85
|
+
**P/S**: Remember to check the `Allow GitHub Actions to create and approve pull requests` in your repo Settings > Actions > General & scroll to Workflow permissions.
|
|
86
|
+
|
|
87
|
+
## Contributing
|
|
88
|
+
|
|
89
|
+
**react-ui-boilerplate** ❤️ your contributions. If you have any ideas, suggestions, fixes, feel free to contribute.
|
|
90
|
+
|
|
91
|
+
[boilertown-url]: https://github.com/boilertown
|
|
92
|
+
[react-url]: https://beta.reactjs.org
|
|
93
|
+
[typescript-url]: https://www.typescriptlang.org
|
|
94
|
+
[storybook-url]: https://storybook.js.org
|
|
95
|
+
[eslint-url]: https://eslint.org
|
|
96
|
+
[commitlint-url]: https://github.com/conventional-changelog/commitlint
|
|
97
|
+
[prettier-url]: https://prettier.io
|
|
98
|
+
[testing-library-url]: https://testing-library.com
|
|
99
|
+
[rollup-url]: https://rollupjs.org
|
|
100
|
+
[changesets-url]: https://github.com/changesets/changesets
|
package/package.json
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bikdotai/bik-component-library",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Bik Component Library",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://gitlab.com/bikayi-org/bikayi-server/bik-component-library"
|
|
8
|
+
},
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"exports": {
|
|
11
|
+
"import": "./dist/esm/index.js",
|
|
12
|
+
"require": "./dist/cjs/index.js"
|
|
13
|
+
},
|
|
14
|
+
"main": "dist/cjs/index.js",
|
|
15
|
+
"module": "dist/esm/index.js",
|
|
16
|
+
"types": "dist/esm/index.d.ts",
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "NODE_ENV=production rollup -c && npm pack && mv bik-component-library-0.0.0.tgz ../bikayi-web-ui/merchantAdminReact/",
|
|
22
|
+
"build:storybook": "build-storybook",
|
|
23
|
+
"lint": "eslint . --ext .ts,.tsx,.js,.jsx",
|
|
24
|
+
"prepare": "husky install",
|
|
25
|
+
"storybook": "start-storybook -p 6006 --quiet",
|
|
26
|
+
"test": "NODE_ENV=test jest",
|
|
27
|
+
"test:coverage": "NODE_ENV=test jest --coverage",
|
|
28
|
+
"test:watch": "NODE_ENV=test jest --watch",
|
|
29
|
+
"changeset": "changeset",
|
|
30
|
+
"release": "changeset publish"
|
|
31
|
+
},
|
|
32
|
+
"lint-staged": {
|
|
33
|
+
"*.{js,jsx,ts,tsx}": [
|
|
34
|
+
"eslint --fix",
|
|
35
|
+
"prettier --write"
|
|
36
|
+
],
|
|
37
|
+
"*.{md,mdx,yml,json}": [
|
|
38
|
+
"prettier --write"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"browserslist": [
|
|
42
|
+
"> 1%",
|
|
43
|
+
"not dead",
|
|
44
|
+
"not edge <= 18",
|
|
45
|
+
"not ie 11",
|
|
46
|
+
"not op_mini all"
|
|
47
|
+
],
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@babel/runtime": "^7.20.7"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@babel/core": "^7.20.12",
|
|
53
|
+
"@babel/plugin-transform-runtime": "^7.19.6",
|
|
54
|
+
"@babel/preset-env": "^7.20.2",
|
|
55
|
+
"@babel/preset-react": "^7.18.6",
|
|
56
|
+
"@changesets/cli": "^2.26.0",
|
|
57
|
+
"@commitlint/cli": "^17.4.1",
|
|
58
|
+
"@commitlint/config-conventional": "^17.4.0",
|
|
59
|
+
"@emotion/babel-plugin": "^11.10.5",
|
|
60
|
+
"@emotion/react": "^11.10.5",
|
|
61
|
+
"@emotion/styled": "^11.10.5",
|
|
62
|
+
"@mdx-js/react": "^1.6.22",
|
|
63
|
+
"@rollup/plugin-babel": "^6.0.3",
|
|
64
|
+
"@rollup/plugin-commonjs": "^24.0.0",
|
|
65
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
66
|
+
"@rollup/plugin-terser": "^0.3.0",
|
|
67
|
+
"@storybook/addon-a11y": "^6.5.15",
|
|
68
|
+
"@storybook/addon-actions": "^6.5.15",
|
|
69
|
+
"@storybook/addon-essentials": "^6.5.15",
|
|
70
|
+
"@storybook/addon-interactions": "^6.5.15",
|
|
71
|
+
"@storybook/addon-links": "^6.5.15",
|
|
72
|
+
"@storybook/builder-webpack5": "^6.5.15",
|
|
73
|
+
"@storybook/manager-webpack5": "^6.5.15",
|
|
74
|
+
"@storybook/react": "^6.5.15",
|
|
75
|
+
"@storybook/testing-library": "^0.0.13",
|
|
76
|
+
"@svgr/rollup": "^7.0.0",
|
|
77
|
+
"@svgr/webpack": "^7.0.0",
|
|
78
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
79
|
+
"@testing-library/react": "^13.4.0",
|
|
80
|
+
"@testing-library/user-event": "^14.4.3",
|
|
81
|
+
"@trivago/prettier-plugin-sort-imports": "^4.0.0",
|
|
82
|
+
"@types/jest": "^29.2.5",
|
|
83
|
+
"@types/node": "^18.11.18",
|
|
84
|
+
"@types/react": "^18.0.26",
|
|
85
|
+
"@types/react-dom": "^18.0.10",
|
|
86
|
+
"@types/styled-components": "^5.1.26",
|
|
87
|
+
"@types/testing-library__jest-dom": "^5.14.5",
|
|
88
|
+
"@typescript-eslint/eslint-plugin": "^5.48.1",
|
|
89
|
+
"@typescript-eslint/parser": "^5.48.1",
|
|
90
|
+
"@zerollup/ts-transform-paths": "^1.7.18",
|
|
91
|
+
"babel-loader": "^9.1.2",
|
|
92
|
+
"eslint": "8.31.0",
|
|
93
|
+
"eslint-config-prettier": "^8.6.0",
|
|
94
|
+
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
95
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
96
|
+
"eslint-plugin-react": "^7.32.0",
|
|
97
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
98
|
+
"eslint-plugin-testing-library": "^5.9.1",
|
|
99
|
+
"husky": "^8.0.3",
|
|
100
|
+
"jest": "^29.3.1",
|
|
101
|
+
"jest-environment-jsdom": "^29.3.1",
|
|
102
|
+
"jest-transform-stub": "^2.0.0",
|
|
103
|
+
"lint-staged": "^13.1.0",
|
|
104
|
+
"prettier": "^2.8.2",
|
|
105
|
+
"react": "^18.2.0",
|
|
106
|
+
"react-dom": "^18.2.0",
|
|
107
|
+
"rollup": "^2.79.1",
|
|
108
|
+
"rollup-plugin-copy": "^3.4.0",
|
|
109
|
+
"rollup-plugin-delete": "^2.0.0",
|
|
110
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
111
|
+
"rollup-plugin-typescript2": "^0.34.1",
|
|
112
|
+
"styled-components": "^5.3.3",
|
|
113
|
+
"ts-jest": "^29.0.4",
|
|
114
|
+
"tslib": "^2.4.1",
|
|
115
|
+
"ttypescript": "^1.5.15",
|
|
116
|
+
"typescript": "^4.9.4",
|
|
117
|
+
"typescript-transform-paths": "^3.4.6",
|
|
118
|
+
"webpack": "^5.75.0",
|
|
119
|
+
"webpack-cli": "^5.0.1"
|
|
120
|
+
},
|
|
121
|
+
"peerDependencies": {
|
|
122
|
+
"@emotion/react": "^11.0.0",
|
|
123
|
+
"@emotion/styled": "^11.0.0",
|
|
124
|
+
"react": "^16.8.0 || ^17 || ^18",
|
|
125
|
+
"react-dom": "^16.8.0 || ^17 || ^18",
|
|
126
|
+
"styled-components": "^5.3.3"
|
|
127
|
+
},
|
|
128
|
+
"engines": {
|
|
129
|
+
"node": ">=16"
|
|
130
|
+
}
|
|
131
|
+
}
|