1.1.5 • Published 4 years ago

aac-components v1.1.5

Weekly downloads
10
License
ISC
Repository
github
Last release
4 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

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago