1.1.5 • Published 6 years ago

aac-components v1.1.5

Weekly downloads
10
License
ISC
Repository
github
Last release
6 years ago

Installation

  • git clone git@github.com:American-Addiction-Centers/component-library.git
  • cd component-library
  • npm install
  • npm run storybook - to pull up story book in your browser
  • npm run build - to compile the actual library

Adding a component

  1. Create a new folder under src/components
  2. Put an index.js in that folder with your new component
  3. Import your component into src/index.js so it gets exported with the library
  4. Add a story for your component under stories/index.stories.js to see it in your local storybook

Usage

  1. npm install aac-components
  2. import {Simple} from 'aac-components'; - replace Simple with whatever component you want to import

Local Development with this Library in OTHER projects

We can use npm link to have a better local workflow when contributing to this library.

Here's a great article exlaining npm link: https://medium.com/@alexishevia/the-magic-behind-npm-link-d94dcb3a81af

Note: running npm install will kill your symlinks created using npm link, so you'll have to do this process again after an install

Symlink aac-component library to your project

  1. cd aac-components && npm link - create symlink from global node modules to local module
  2. cd myproject && npm link aac-components - create symlink from project node module to global node module
  3. verify symlink with within myproject cd node_modules && ls -la *aac-components

Symlink react to aac-component library from your project.

Due to this issue: https://github.com/facebook/react/issues/13991

  1. cd aac-components && npm link ../myproject/node_modules/react - create symlink between aac-components react node module and project react node module
  2. cd node_modules && ls -la *react to verify symlink and grab path to global module
  3. cd <what-ever-path-from-perious-step> ls -la *react to check local npm points to correct project. Path should looks something like /Users/phillipbarera/.nvm/versions/node/v10.16.3/lib/node_modules/react

Now run npm run dev in the aac-component library and npm run dev in your project and changes to the component library should be reflected in your project

Unlink things when done with dev

  • running npm install on your project root will remove the symlink to aac-components
  • cd aac-components/node_modules/react && npm unlink to unlink react from global npm symlinks
  • Check your global symlinks to verify ls -al $(npm root -g)
1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.38

6 years ago

1.0.37

6 years ago

1.0.36

6 years ago

1.0.35

6 years ago

1.0.34

6 years ago

1.0.33

6 years ago

1.0.32

6 years ago

1.0.31

6 years ago

1.0.30

7 years ago

1.0.29

7 years ago

1.0.28

7 years ago

1.0.27

7 years ago

1.0.26

7 years ago

1.0.25

7 years ago

1.0.24

7 years ago

1.0.23

7 years ago

1.0.22

7 years ago

1.0.21

7 years ago

1.0.20

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago