git clone [email protected]:somethingnew-co/ratatouille.git
npm install
npm run start
Running npm run start
will:
Run npm run bootstrap
to install package dependencies.
To build and publish the packages you just need to run:
npm run publish-packages
(You will need to be logged into npm and be part of the stnew organization)
This will run the build script and then publish the packages.
We're using Jest and Enzyme. To run all tests and generate a coverage report simply run:
npm run test
While developing you can also run tests in watch mode by running:
npm run test:watch
We use Hygen to generate starter code for new packages.
Create a new package: npm run new-pkg "{NAME}" [-- <args>]
Additional arguments:
--component
if your package will be a react (typescript) component
--functional
if your component package will be a functional component (not stateful)--styled
if your package will use styled-components
--description="{DESC}"
where {DESC} will be the description for your package in package.json
--name="new package"
will create an npm package called @stnew/new-package
.NewPackage
.
import NewPackage from '@stnew/new-package';
hygen
scripts will generate a .npmrc that prevents package-lock files form being generatednpm install
in a packages/* directory. If you must add a dependencies or devDependecies, use (lerna add
)[https://github.com/lerna/lerna/tree/master/commands/add].package.json
. Don't check in the gitHead
field.