Skip to content

Commit 31cfab5

Browse files
authored
Merge pull request #19 from Scille/update-readme
Update the Readme for the lib-megashark
2 parents 2d8de5d + 5dd052d commit 31cfab5

File tree

1 file changed

+99
-1
lines changed

1 file changed

+99
-1
lines changed

README.md

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,99 @@
1-
Generic UI library based on Ionic
1+
# Generic UI library based on Ionic
2+
3+
The megashark-lib is a UI component library. It is used to centralize all the elements that will be reused throughout the various Parsec projects (images, typography, UI components, global translation).
4+
5+
## 🏁 Installation
6+
7+
### Clone the local directory
8+
9+
You will need to clone the library directory locally using git.
10+
11+
```
12+
git clone [email protected]:Scille/megashark-lib.git
13+
```
14+
15+
### Install the library using npm.
16+
17+
```
18+
npm install
19+
```
20+
21+
## 📁 Folder names
22+
23+
**src** (local app): folder used to test the application locally. It includes a component display page.
24+
25+
**lib**: includes all the library components that you want to have in common in the library.
26+
27+
## Use the library in your project
28+
29+
> In **your project** and precisely in the `package.json` file:
30+
31+
In order to create the link between the project and the megashark-lib, you should add the link.
32+
33+
`git`+ `https://github/...`
34+
35+
> Example:
36+
37+
```
38+
"megashark-lib": "git+https://github.com/Company/megashark-lib.git",
39+
```
40+
41+
## Modify a megashark-lib component and see the result
42+
43+
> In **megashark-lib**:
44+
45+
```
46+
npm run web:open
47+
```
48+
49+
## Make modifications in **megashark-lib** and update a local project using the library at the same time
50+
51+
This allows you to see changes made to the library and see them displayed in real time in the project using this library. Please follow all the commands in the order below.
52+
53+
### 1️⃣ Build the project and install it globally
54+
55+
> In **megashark-lib**
56+
57+
```
58+
npm run build:local
59+
```
60+
61+
The command includes (not to be written in the terminal) :
62+
63+
`npm link`: to create a link to another project from a local environment.
64+
`vite build --watch`: to rebuild automatically as soon as there is a modification.
65+
66+
### 2️⃣ Link the libraries from your project
67+
68+
> In **your project**
69+
70+
```
71+
npm run megashark:local:start
72+
```
73+
74+
The command includes (not to be written in the terminal):
75+
`npm link megashark-lib`: allows you to link the megashark-lib library (installed from the machine to github)
76+
77+
### 3️⃣ Start development
78+
79+
> In **your project**
80+
81+
```
82+
# For web project
83+
npm run web:open
84+
85+
# For electron project
86+
npm run electron:open
87+
```
88+
89+
### 4️⃣ Reset installation to state (with remote project)
90+
91+
⚠️ Required to keep the project with the remote link.
92+
93+
> In **your project**
94+
95+
```
96+
npm run megashark:local:stop
97+
```
98+
99+
→ All modifications made in real time in **megashark-lib** are instantly visible without reload / rebuild!

0 commit comments

Comments
 (0)