$ yarn install💡 Note, if you are going to add new dependencies, you should add the names these dependencies to
vite.config.tsinbuild.rollupOptions.external. This is done to avoid creating re bundles on the libraries externals such asreact,bootstrap,styled-componentetc.
View example in vite.config.ts
export default defineConfig({
...,
build: {
...,
rollupOptions: {
external: [
'react',
'react-dom',
'styled-components',
],
...
}
}
}Config pre-commit
$ yarn prepareLocal machine
Run for publish
$ npm publishRuns the app in development mode. Open http://localhost:6006 to view it in the browser.
$ yarn storybookCreates a storybook-static directory in root of project.
$ yarn storybook:buildThis deployed app in purge.sh. Important that when try deploy app, Purge will request the next credentials.
- Email:
rexif49573@pahed.com - Password:
rexif4******hed.com
Open https://ld-ui.surge.sh/ to view it in the browser
$ yarn storybook:deploy$ yarn testCreates a coverage directory in root of project.
$ yarn coverageCreates a dist directory with a production build of your app.
$ yarn build💡 This only applies if Storybook is not going to be used
If you want remove Storybook, these are all dependencies that should remove
$ yarn remove @storybook/addon-actions @storybook/addon-essentials @storybook/addon-interactions @storybook/addon-links @storybook/builder-vite @storybook/testing-library babel-loader @storybook/react @babel/coreRemove scripts of package.json
storybookstorybook:buildstorybook:deploy
Remove folder .storybook
This helps us visually identify what task each file is going to do and allows us to perform more efficient searches when developing, this help us the development experience
Use PascalCase for all components
-
ModalBody.tsxfor create components-
ModalBody.test.tsxfor create components with test -
ModalBody.stories.tsxfor create components with storybook -
ModalBody.modules.cssor*.modules.scssfor use css modules, click here for more info -
ModalBody.style.tsxfor create css in js withstyled-components
-
-
useFetch.tsfor create custom hooks -
withSearch.tsfor create HOC -
measures.util.tsfor create utilities filesmap-values.util.ts
-
users.service.tsfor create utilities files
├── README.md
├── package.json
├── src
│ ├── components
│ │ ├── index.ts
│ │ └── input
│ │ ├── Input.stories.tsx
│ │ ├── Input.styles.ts
│ │ ├── Input.test.tsx
│ │ ├── Input.tsx
│ │ └── index.ts
│ ├── hooks
│ │ ├── index.ts
│ ├── main.tsx
│ ├── styles
│ │ ├── bootstrap-custom.scss
│ │ ├── index.ts
│ │ └── variables.ts
│ ├── utils
│ │ ├── index.ts
│ │ └── measures.util.ts
│ └── vite-env.d.ts
├── tsconfig.json
├── tsconfig.node.json
├── vite.config.tsUsed tools