|
|
1 maand geleden | |
|---|---|---|
| .. | ||
| src | 1 maand geleden | |
| .babelrc | 1 maand geleden | |
| README.md | 1 maand geleden | |
| components.json | 1 maand geleden | |
| jest.config.ts | 1 maand geleden | |
| package.json | 1 maand geleden | |
| project.json | 1 maand geleden | |
| tsconfig.json | 1 maand geleden | |
| tsconfig.lib.json | 1 maand geleden | |
| tsconfig.spec.json | 1 maand geleden | |
| tsconfig.storybook.json | 1 maand geleden | |
Based on Tailwind and Shadcn. Still WIP with the Design System, so refer to official docs for now:
Run yarn nx test ui to execute the unit tests via Jest.
Run yarn nx serve ui to run the Storybook development server on http://localhost:4400
NOTE: This project is a WIP
We will be following the standards encapsulated within the nx workflows established within the monorepo and everything will follow the same pattern of development governed by nx generators.
Run the following generator to create your new component
yarn nx generate @nx/react-component <Component> --project ui
# example. yarn nx generate @nx/react-component Button --project ui
This will automatically generate a scaffold of the following:
./src/lib/button/
button.tsxbutton.module.scssbutton.stories.tsxbutton.spec.tsxPerform the same step to creating a component for the component in question, continuing with the theme we'll use Button as an example.
Find all current definitions within the project that would require to be replaced, take the consolidated version of the existing component and place the current SCSS and TSX within the generated file equivalents from the previous step. (NOTE: Ensure to keep the new SCSS module styles import, replacing the old one that may have been copied over)
Remove any bem.tsx imports
Replace the BEM components used with standard jsx tags.
Add the className's from the SCSS module styles object based on the same BEM structure previously found. (NOTE: Ensure that conditionals/modifiers are handled correctly)
Add the component stories to the generated button.stories.tsx file.
Add the component tests to the generated button.spec.tsx file.
Find and replace all usages within the codebase with your new Button component 😎.