Skip to content

CoorpAcademy/components

Repository files navigation

Coorpacademy Components

Build Status Coverage Status GitPitch lerna

Static demos

If you want to see what theses packages have to look there: 😉

Packages

How to

Start:

source scripts/setup.sh
yarn
yarn prepare # or 'npm run prepare'

You might need to source scripts/setup.sh to notably to load the fontawesome token in the FONTAWESOME_NPM_AUTH_TOKEN env variable.

Publish:

See detailed doc

Add a new dependency:

Go to the target package, and add the dependency using

yarn add myPackage

install dependencies for a specific package:

lerna add dependency-name --scope=package-name

run a specific test file:

lerna run --scope @coorpacademy/components test:unit -- test/file/path
# lerna accept globs for packages, ex "@coorpacademy/redux-*"

You'll need -W (aka --ignore-workspace-root-check) to install to package root.

Unit Tests with eslint and ava:

You can either invoke it at the monorepo top level, or in specific packages

npm test
# or if you just run lint
npm run lint
# or tests
npm run test:unit

Developing apps using HMR and components

For recap, HMR stands for Hot Module replacement

[@coorpacademy-components]> npm run build:es -- --watch
[@coorpacademy-app-player]> npm start

Troubleshooting

dependencies

Lerna is used to plug and publish all the packages in this repo. You may have to reset all node_modules : use lerna clean before performing npm i again.

publishing

Be sure your packages are public, or you'll end up with errors on CI like.

Extracting tar content of undefined failed, the file appears to be corrupt: "Unexpected end of data"

set your public access:

> npm access public @coorpacademy/progression-engine

For others publishing issues see dedicated section in Publish doc

flow

If you have any problem during an npm run build command related to flow: `

  • Kill flow processes
    pkill -f flow
  • Check if the problem is related to a new installed dependency. In this case, exclude the dependency on the .flowconfig file.