0.5.44 • Published 5 months ago

@roo-dev/ui-components v0.5.44

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

Getting Started

Install packages

npm install

To start storybook

npm run storybook

Creating a New Component

  • In the ui-components folder, copy either the ExampleAntSwitch or ExampleCustomButton folder and rename it and its files after the new component

    • Component names should match the name in figma
  • Build the component in the index.tsx file in the new folder

    • If using a component from Ant design make sure you also import its props, otherwise you can use the props from Ant as a guide when deciding on props for a custom component
  • Style the component in the NewComponentStyles.tsx file

    • Use styled components: https://styled-components.com/
    • Reference ui-components/index.tsx for colors, gridWidths, and any other constant styles that should only be exported from this file and never coded separately (there should be no hexcodes in style files)
  • Fill in the NewComponentInfo.tsx file with the component's details following the outlined headings in the file and adding any additional info

  • In the stories folder, copy either the ExampleAntSwitch.stories.tsx or ExampleCustomButton.stories.tsx file and rename it after the new component
    • Import your component and build new templates accordingly (generally one for the component and one for the details)
    • Aim to include a version of each possible state for the component
  • Export your finished component in src/index.tsx

Testing Changes in Another Repository

You can use yalc to use your local changes to the @roo-dev/ui-components package in another repo (for instance Roo-React) without needing to publish to NPM. To do this:

  • Install yalc globally with npm i yalc -g.
  • Run npm run build && yalc publish in the root of your local Roo-UI-Components repository (and do this every time you want to make your latest changes available).
  • Run yalc link @roo-dev/ui-components in the root of your local Roo-React repository (only necessary to do this once).
  • To pull the latest published UI components into Roo-React, run yalc update from the root of Roo-React and then restart your dev server to see the changes.
  • If you want to stop using yalc in Roo-React, type yalc retreat --all in the root of Roo-React. And if you want to start using it again, type yalc restore --all.

Publish + Versioning

  • To Publish the new changes, run the Publish to NPM action. However, you need to bump the version up before publishing it on NPM.

Here are some rules for versioning:

  • Major: These could be things such as React upgrade or any major upgrade of the underline technologies.
  • Minor: These could be things such as adding/removing a new/old component.
  • Patch: These could be things such as bug fixes.

For example: If the current version is 0.2.1, after fixing some small bugs. We can go to package.json and change version: "0.2.1" to version: "0.2.2". Then we push it to the main branch and run the Publish to NPM action.

Deploying/Using a New Component

  • When a new branch is merged to master the new component should automatically start deploying to storybook and then (when finished) be available for viewing at http://storybook.roo.vet.s3-website-us-east-1.amazonaws.com
    • You can also manually deploy to storybook via the github action "Deploy Storybook"
  • To use the component in Roo-React you must first
    1. Update the version number in package.json (example: if the version number is currently 0.0.15, update it to 0.0.16)
    2. Deploy the new version to npm via the github action "Publish to NPM"
    3. Open the package.json in Roo-React, search "@roo-dev/ui-components", update the version number to match Roo-UI-Components and run npm install
    4. Import the component you want to use in the relevant Roo-React file (example: import { Toast } from "@roo-dev/ui-components" )
0.5.43

5 months ago

0.5.44

5 months ago

0.5.42

5 months ago

0.5.41

5 months ago

0.5.40

5 months ago

0.5.32

5 months ago

0.5.39

5 months ago

0.5.36

5 months ago

0.5.37

5 months ago

0.5.34

5 months ago

0.5.35

5 months ago

0.5.31

5 months ago

0.5.30

5 months ago

0.5.10

6 months ago

0.5.11

6 months ago

0.5.18

6 months ago

0.5.19

6 months ago

0.5.16

6 months ago

0.5.17

6 months ago

0.5.14

6 months ago

0.5.15

6 months ago

0.5.12

6 months ago

0.5.13

6 months ago

0.1.41

8 months ago

0.1.42

8 months ago

0.1.43

8 months ago

0.1.44

8 months ago

0.0.32

10 months ago

0.1.45

8 months ago

0.1.46

8 months ago

0.1.48

8 months ago

0.2.10

7 months ago

0.1.0

10 months ago

0.3.0

7 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.5.4

7 months ago

0.5.3

7 months ago

0.5.6

6 months ago

0.5.5

7 months ago

0.5.0

7 months ago

0.1.4

8 months ago

0.1.3

9 months ago

0.5.2

7 months ago

0.5.1

7 months ago

0.1.31

9 months ago

0.1.32

9 months ago

0.1.33

9 months ago

0.5.8

6 months ago

0.5.7

6 months ago

0.5.9

6 months ago

0.5.21

6 months ago

0.5.22

6 months ago

0.5.20

6 months ago

0.5.29

5 months ago

0.5.27

5 months ago

0.5.28

5 months ago

0.5.25

5 months ago

0.5.26

5 months ago

0.5.23

6 months ago

0.5.24

5 months ago

0.2.1

8 months ago

0.2.0

8 months ago

0.4.5

7 months ago

0.4.4

7 months ago

0.2.6

8 months ago

0.4.7

7 months ago

0.4.6

7 months ago

0.2.8

8 months ago

0.4.1

7 months ago

0.2.3

8 months ago

0.4.0

7 months ago

0.4.3

7 months ago

0.4.2

7 months ago

0.2.4

8 months ago

0.0.23

1 year ago

0.0.24

12 months ago

0.0.25

12 months ago

0.0.30

12 months ago

0.0.31

11 months ago

0.0.26

12 months ago

0.0.27

12 months ago

0.0.28

12 months ago

0.0.22

1 year ago

0.0.21

1 year ago

0.0.20

1 year ago

0.0.19

1 year ago

0.0.18

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago