Contributing
Prerequisites
- Package manager: PNPM
Description
The project is a mono-repo in 3 parts:
- ui-lib: Contains the library files - It's the part published on Gitlab Package Registry and installed by users
- ui-docs: It's the documentation - Made with Vitepress
- ui-playground: It's a Nuxt application to develop and test the library
Setup project
Dependencies installation
make install
Serve applications
Docs
make serve-docs
Will be available on http://localhost:6006
Nuxt App
make serve-app
Will be available on http://localhost:3000
Serve App & Docs
make serve-all
Writing component
Create components files
Use our CLI to generate for your component these files:
- Unit test in
packages/ui-lib/tests/specs/components
- Vue component in
packages/ui-lib/components
- Documentation in
packages/ui-docs/docs/components
INFO
You should add your component to the good place in packakges/docs/docs/.vitepress/configs/components.ts
make create-component-files name=Zv${YourComponentNameInPascalCase}
Add comments to your component
Add more information about your props, events and slots with the available tags.
With vue-docgen-cli, we generate a markdown file with all information
How it's works? Follow this documentation https://vue-styleguidist.github.io/docs/Documenting.html#code-comments
Generate components documentation files
make ui-generate-components-docs
This command generates files for each component his documentation in packages/docs/docs/.vitepress/generated-docs
This file contains all props, events and slots of the components. You just have to include it in the main component documentation file
Publish new documentation version
Gitlab CI pipeline will release a new version when changes have been made in:
packages/lib
packages/docs
Publish a new library version
When you finish your development on your own branch
- Make an MR to
main
- You should scope your MR to one task - In case you should do multiple tasks, you should not squash your commits.
- If you want squash commits, the MR title should be about one thing
INFO
With conventional-changelog-conventionalcommits
each commit message will be used to generate the changelog files, so be clear and scope your commit to one workspace (root, lib, docs or app)
Generated Changelog:
- When the MR is merged, go to
main
branch and run this command
make release
INFO
With conventional-changelog-conventionalcommits
and semver
, lerna
will upgrade the version according to your commit message type:
- fix, chore, refactor, etc... --> new minor version (1.0.0 --> 1.0.1)
- feat --> new minor version (1.0.0 --> 1.1.0)
- If you add "BREAKING CHANGES: ***" in the footer commit --> new major version (1.0.0 --> 2.0.0)
- The Gitlab CI pipeline will automatically publish the new version when a new tag is pushed