1.0.71 • Published 9 months ago

@wattmore/components-library v1.0.71

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

Wattmore Component Library

What is this?

The @WATTMORE/components-library is a custom node package library of our react components. This is a code repo where we can put any generalized javascript component / function that we might want to share across our applications.

What technologies does it use?

This is first and foremost a react component library. So that being said, most components are either react components or straight up javasript. The components can be wriiten JUST for that, however, this also integrates a component framework for viewing, modifying and testing this components called Storybook.

Storybook

Storybook is a powerful and immensely popular opensource ui development tool for developing components and UI features.

See Storybook docs and this article on why we should use it

Basically, it gives us really intelligent and automatic tooling for free, while our package just bundles with only the minified react components. Story book gives us:

  • Auto documentation solely based on the existing code (and any comments we manually add)
  • Automatic testing for things like accessibility and interactions
  • Easy interaction and unit testing framework
  • Theme and device type testing
  • UI for viewing components, live tweaking of configurations and powerful search tools (more free documentation)
  • component organization through categorization and grouping
  • implementation code snippets
  • ...more

Usage

Installation

Once you have cloned down the gitlab repository

  • Run yarn install

  • If this is the first time you are adding to a new project, update your package json with "@wattmore/components-library": "^1.0.1", Or run

      yarn install @wattmore/components-library

    NOTE: Set the version number to the most recent version number (see package.json within components-library) OR you may set the version to `` to always get the most recent (be careful of this though because it limits our ability to push breaking changes)*

  • Import the CSS file into your top level index.jsx

    import '@wattmore/components-library/lib/components.css'

Done!

Local Development

To develop locally you can either develop solely in our package (using storybook) OR you can link this library to your repository. I highly recommend doing both as they are both easy and have their uses.

Running storybook

This is as easy as running yarn storybook This starts up your storybook server and opens a tab in your browser to our localhost port for this application localhost:6006.

Seeing changes in Application

In order to use the components in your application as you development here you have to link your components-library and your repository.

  1. Make sure @wattmore/components-library is installed on your repo. It can be particularly easy to just set version to "@wattmore/components-library": "*", just to get started.
  2. Next, navigate in your terminal to the components-library repository and from within the repo run:
cd ~/sites/components-library
yarn link
  1. Now, navigate to the repository you are using the shared components in (e.g. Dashboard) and run:
cd ~/sites/Wattmore/operate/apps/platform
yarn link "@wattmore/components-library

Now you should be linked up!

  1. The final step is that you need to tell the component library to watch file changes and update. So in a seperate terminal tab from your app server, run
cd ~/sites/components-library
yarn dev

Deployment

Deployment is easy, however, for now its a manual process until we can get wattmore to create an NPM account and until we can get to integrating it with some CI to auto bump version and publish when merging to main.

  1. Bump package version (found in package.json).
  2. Merge branch into main.
  3. Run yarn build to get rollup to build our javascript (only grabs components and minifies)
  4. yarn publish (if you don't have permissions with current config ping Brett)
  5. Bump package version in your applications if necessary.
1.0.62

9 months ago

1.0.61

9 months ago

1.0.60

9 months ago

1.0.65

9 months ago

1.0.64

9 months ago

1.0.63

9 months ago

1.0.69

9 months ago

1.0.68

9 months ago

1.0.67

9 months ago

1.0.71

9 months ago

1.0.70

9 months ago

1.0.59

9 months ago

1.0.58

9 months ago

1.0.57

9 months ago

1.0.56

9 months ago

1.0.49

10 months ago

1.0.51

10 months ago

1.0.50

10 months ago

1.0.55

9 months ago

1.0.54

9 months ago

1.0.53

10 months ago

1.0.52

10 months ago

1.0.48

10 months ago

1.0.47

10 months ago

1.0.43

10 months ago

1.0.42

10 months ago

1.0.41

10 months ago

1.0.46

10 months ago

1.0.45

10 months ago

1.0.40

11 months ago

1.0.39

11 months ago

1.0.19

11 months ago

1.0.2

12 months ago

1.0.18

11 months ago

1.0.1

12 months ago

1.0.17

11 months ago

1.0.38

11 months ago

1.0.16

11 months ago

1.0.9

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.5

12 months ago

1.0.3

12 months ago

1.0.22

11 months ago

1.0.21

11 months ago

1.0.20

11 months ago

1.0.26

11 months ago

1.0.25

11 months ago

1.0.24

11 months ago

1.0.23

11 months ago

1.0.29

11 months ago

1.0.28

11 months ago

1.0.27

11 months ago

1.0.33

11 months ago

1.0.11

12 months ago

1.0.32

11 months ago

1.0.10

12 months ago

1.0.31

11 months ago

1.0.30

11 months ago

1.0.37

11 months ago

1.0.15

11 months ago

1.0.36

11 months ago

1.0.14

11 months ago

1.0.35

11 months ago

1.0.13

11 months ago

1.0.34

11 months ago

1.0.12

12 months ago

1.0.0

1 year ago