@datability/8ui 0.1.5 → 0.1.6
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/README.md +11 -164
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,173 +6,20 @@
|
|
|
6
6
|
<h1>Datability UI</h1>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**Datability UI** contains foundational React UI component base libraries.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Nuk Supagorn 😎 said :
|
|
14
|
-
|
|
15
|
-
- It would be very helpful if we could make the `frontend components` we use more flexible. It becomes a `npm package` that can be downloaded from the same place
|
|
16
|
-
|
|
17
|
-
- Because if corrections occur, they will be able Can be `edited in one spot`
|
|
18
|
-
|
|
19
|
-
<br>
|
|
20
|
-
|
|
21
|
-
## About the project
|
|
22
|
-
|
|
23
|
-
Building and publishing frontend components to `Node Package Manager(NPM)` easy to share and reuse code useful in projects , this article will guide you through the steps of building and `publishing` NPM package.
|
|
24
|
-
|
|
25
|
-
<br>
|
|
26
|
-
|
|
27
|
-
## Prerequisites
|
|
28
|
-
|
|
29
|
-
- [NPM account](https://www.npmjs.com)
|
|
30
|
-
- Docker
|
|
31
|
-
- NodeJS
|
|
32
|
-
- GitHub for clone , push and others
|
|
33
|
-
- Basic understanding of JavaScript / TypeScript
|
|
34
|
-
|
|
35
|
-
<br>
|
|
36
|
-
|
|
37
|
-
## Project structure
|
|
38
|
-
|
|
39
|
-
```sh
|
|
40
|
-
.
|
|
41
|
-
├── dist # compiled folder for `publish` to npm
|
|
42
|
-
├── node_modules # package to use in project
|
|
43
|
-
├── public # keep index.html for react start
|
|
44
|
-
├── src # important folder
|
|
45
|
-
│ ├── components # components folder for usage
|
|
46
|
-
│ │ ├── Button # example `Button` component
|
|
47
|
-
│ │ │ ├── index.scss # - style css
|
|
48
|
-
│ │ │ ├── index.tsx # - button usage
|
|
49
|
-
│ │ ├── DatePicker # example `DatePicker` component
|
|
50
|
-
│ │ │ ├── index.scss # - style css
|
|
51
|
-
│ │ │ ├── index.tsx # - button usage
|
|
52
|
-
│ │ ├── ... # other components will append here
|
|
53
|
-
│ │ ├── index.ts # file to import all components and export
|
|
54
|
-
│ ├── App.tsx # calling component to display
|
|
55
|
-
│ └── index.tsx # calling component to display
|
|
56
|
-
├── docker-compose.yml # docker compose file to start project
|
|
57
|
-
├── package.json # package.json to script command
|
|
58
|
-
├── tsconfig.json # tsconfig.json to setting script command
|
|
59
|
-
└──
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
<br>
|
|
63
|
-
|
|
64
|
-
## 📢 Getting started - `Building & Publishing` NPM Package
|
|
65
|
-
|
|
66
|
-
1.) Clone the repo
|
|
67
|
-
|
|
68
|
-
```sh
|
|
69
|
-
git clone git@github.com:datability-th/npm-components-fe.git
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
2.) Open 2 terminals
|
|
73
|
-
|
|
74
|
-
- 2.1 ) Terminal 1 : keep running `npm run start`
|
|
75
|
-
|
|
76
|
-
```sh
|
|
77
|
-
$ docker compose up
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
- 2.2 ) Terminal 2 : bash in to `npm-fe` container for use npm & script command
|
|
81
|
-
|
|
82
|
-
```sh
|
|
83
|
-
$ sudo docker exec -it npm-fe bash
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
3.) Register new component in
|
|
87
|
-
|
|
88
|
-
```sh
|
|
89
|
-
├── src # important folder
|
|
90
|
-
│ ├── components # components folder for usage
|
|
91
|
-
│ │ ├── Button # example `Button` component
|
|
92
|
-
│ │ │ ├── index.scss # - style css
|
|
93
|
-
│ │ │ ├── index.tsx # - button usage
|
|
94
|
-
│ │ ├── DatePicker # example `DatePicker` component
|
|
95
|
-
│ │ │ ├── index.scss # - style css
|
|
96
|
-
│ │ │ ├── index.tsx # - button usage
|
|
97
|
-
│ │ ├── 📌 # <= Declare here & register in `index.ts` below
|
|
98
|
-
│ │ ├── index.ts # file to import all components and export
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
4.) Use command to create compiled folder `dist` to publish to `NPM`
|
|
102
|
-
|
|
103
|
-
```sh
|
|
104
|
-
npm run build
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
5.) Before publish to `NPM` you need to login in command
|
|
108
|
-
|
|
109
|
-
- Login into Gmail : databilitynpm@gmail.com , `Password ask (Top & P'Nuk) 📢`
|
|
110
|
-
- Promp command below `npm login` . . . it will return url to replace digit code
|
|
111
|
-
- Open Gmail copy _digit code_ and replace in website
|
|
112
|
-
- And press enter , command will say ( Logged in ✔ )
|
|
113
|
-
|
|
114
|
-
```sh
|
|
115
|
-
npm login
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
6.) Use command to publish `NPM` package
|
|
119
|
-
|
|
120
|
-
```sh
|
|
121
|
-
npm publish --access public
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
7.) Let check in
|
|
125
|
-
https://www.npmjs.com/settings/databilitynpm/packages
|
|
126
|
-
|
|
127
|
-
<br>
|
|
128
|
-
|
|
129
|
-
## ⚙ Getting started - `Using` NPM Package
|
|
130
|
-
|
|
131
|
-
1.) Download `NPM` Package
|
|
132
|
-
|
|
133
|
-
```sh
|
|
134
|
-
npm i npm-components-fe
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
2.) Calling tools from package that we did
|
|
138
|
-
|
|
139
|
-
```sh
|
|
140
|
-
import './App.css';
|
|
141
|
-
import { All, Button, DatePicker } from 'npm-components-fe' // 👈
|
|
142
|
-
|
|
143
|
-
function App() {
|
|
144
|
-
return (
|
|
145
|
-
<div className="App">
|
|
146
|
-
<p>This is the result after calling component from npm </p>
|
|
147
|
-
|
|
148
|
-
<All /> // 👈
|
|
149
|
-
</div>
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export default App;
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
<br>
|
|
157
|
-
|
|
158
|
-
## Contact
|
|
159
|
-
|
|
160
|
-
Top & Nuk at `Datability` 🏠
|
|
161
|
-
|
|
162
|
-
<br>
|
|
163
|
-
|
|
164
|
-
## Acknowledgments
|
|
165
|
-
|
|
166
|
-
Thankyou for all tutorials
|
|
167
|
-
|
|
168
|
-
- [Build & Publish React component as NPM package using Typescript compiler](https://blog.anoopjadhav.in/part-1-build-publish-react-component-as-npm-package-using-typescript-compiler)
|
|
11
|
+
<div align="center">
|
|
169
12
|
|
|
170
|
-
|
|
13
|
+
[](https://www.npmjs.com/package/@datability/8ui)
|
|
14
|
+
[](https://www.npmjs.com/package/@datability/8ui)
|
|
15
|
+
[](https://www.npmjs.com/package/@datability/8ui)
|
|
171
16
|
|
|
172
|
-
|
|
17
|
+
</div>
|
|
173
18
|
|
|
174
|
-
|
|
19
|
+
# Documentation
|
|
20
|
+
...
|
|
175
21
|
|
|
176
|
-
|
|
22
|
+
# Examples
|
|
23
|
+
...
|
|
177
24
|
|
|
178
|
-
|
|
25
|
+
<br>
|