UI Components for React.js library based projects
Example package.json configuration
{
"dependencies": {
"plavno-shared-components": "git+ssh://git@github.com:plavno-plavno/plavno-shared-components.git#main"
}
}
After setting up, run
npm install
Importing a shared component into a project component
import { Jumbotron } from 'plavno-shared-components';
Add styles into src/index.tsx file of project
import 'plavno-shared-components/assets/style.css';
If you have a new component, follow these steps to add it to the repository
- Create new branch (for example, "features/component-name") from "main" branch
- Push the new component in the "src/components/shared" folder
- Add a README.md file to the new component folder and describe how it is used, add examples
- Add export for the new component into src/index.ts (for example, "export { default as Jumbotron } from 'components/shared/Jumbotron';")
- Run command "npm run build". You can also perform a local check. Run "npm link"
- Push new branch with the component to repository, for example "git push --set-upstream origin features/component-name"
- Create a "Pull request" for new updates
If you have updated or new configuration files (vite.config, tsconfig, etc.), follow these steps to update them in the repository
- Create new branch (for example, "features/new-configuration") from "main" branch
- Update the README.md file if necessary
- Run command "npm run build". You can also perform a local check. Run "npm link"
- Push updates to the repository, for example "git push --set-upstream origin features/new-configuration"
- Create a "Pull request" for new updates