- Install latest LTS version of Node
https://nodejs.org/en/download
. - Install yarn package manager
https://yarnpkg.com/en/docs/install
. Alternatively, you can replace anyyarn
command withnpm
. - Fork the upstream repo
https://github.com/box/box-annotations
. - Clone your fork locally
git clone [email protected]:[YOUR GITHUB USERNAME]/box-annotations.git
. - Navigate to the cloned folder
cd box-annotations
- Add the upstream repo to your remotes
git remote add upstream [email protected]:box/box-annotations.git
. - Verify your remotes are properly set up
git remote -v
. You should pull updates from the Box repoupstream
and push changes to your forkorigin
. - Install dependencies
yarn install
- Test your first build!
yarn build
- To test only local annotation changes, see instantiating a custom instance of Box Annotations.
- To link and test your local code changes along with your local Preview changes, run
yarn link
in this repository andyarn link box-annotations
wherever Box Content Preview is cloned locally. - To automatically rsync files after a Webpack build, add a scripts/rsync.json file with a
location
field. This file should look like:
{
"location": "YOUR_DESIRED_RSYNC_LOCATION_HERE"
}
Install the following plugins in your preferred editor
- Editor Config (standardizes basic editor configuration)
- ESLint (Javascript linting)
- Prettier & Prettier - ESLint (Automatic Javascript formatting following ESLint config)
- Stylelint (CSS linting)
yarn build
to generate resource bundles and JS webpack bundles.yarn start
to only generate JS webpack bundles on file changes.yarn test
launches Jest.yarn test:watch
launches Jest for debugging.
For more script commands see package.json
. Test coverage reports are available under reports/coverage.