The entire Cerebral codebase has been rewritten to encourage contributions. The code is cleaned up, commented and all code is in a "monorepo". That means you can run tests across projects and general management of the code is simplified a lot.
- Clone the monorepo:
git clone https://github.com/cerebral/cerebral.git
- In root:
The packages are located under
packages folder and there is no need to run
npm install for each package.
Using monorepo for your own apps
If you want to use Cerebral 2 directly from your cloned repo, you can create a symlinks for following
directories into the
node_modules directory of your app:
If your app and the cerebral monorepo are in the same folder you can do from inside your app directory:
$ ln -s ../../cerebral/packages/node_modules/cerebral/ node_modules/ # ...
Just remember to unlink the package before installing it from npm:
$ unlink node_modules/cerebral # ...
Go to the respective
packages/demos/some-demo-folder and run
You can run all tests in all packages from root:
Or you can run tests for specific packages by going to package root and do the same:
Changing the code
When you make a code change you should create a branch first. When the code is changed and backed up by a test you can commit it from the root using:
npm run commit
This will give you a guide to creating a commit message. Then you just push and create a pull request as normal on Github.
- Review and merge PRs into
nextbranch. It is safe to use "Update branch", the commit created by Github will not be part of
- If changes to
repo-cooker, clean Travis NPM cache
- From command line:
$ git checkout next $ git pull $ npm install # make sure any new dependencies are installed $ npm install --no-save repo-cooker # needed to test release, make sure you have latest ￼$ npm run release # and check release notes ￼$ git checkout master $ git pull ￼$ git merge next ￼$ git push