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).
You will need to clone the library directory locally using git.
git clone git@github.com:Scille/megashark-lib.gitnpm clean-installsrc (local app): folder used to test the application locally. It includes a component display page.
lib: includes all the library components that you want to have in common in the library.
In your project's
package.jsonfile:
Link megashark-lib to your project by adding the link to the repository:
Example:
"megashark-lib": "git+https://github.com/Company/megashark-lib.git",In megashark-lib:
npm run web:openThis 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.
In megashark-lib
npm run build:localThe command includes (not to be written in the terminal):
npm link: to create a link to another project from a local environment.
vite build --watch: to rebuild automatically as soon as there is a modification.
In your project
npm run megashark:local:startThe command includes (not to be written in the terminal):
npm link megashark-lib: allows you to link the megashark-lib library (installed from the machine to github)
In your project
# For web project
npm run web:open
# For electron project
npm run electron:openIn your project
npm run megashark:local:stop→ All modifications made in real time in megashark-lib are instantly visible without reload/rebuild!