- Install Node v6.10.0 or higher.
- Install yarn package manager
https://yarnpkg.com/en/docs/install
v1.0.1 or higher. Alternatively, you can replace mostyarn
commands withnpm
commands. - Fork the upstream repo
https://github.com/box/box-ui-elements
. - Clone your fork locally
git clone [email protected]:[YOUR GITHUB USERNAME]/box-ui-elements.git
. - Navigate to the cloned folder
cd box-ui-elements
- Add the upstream repo to your remotes
git remote add upstream [email protected]:box/box-ui-elements.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 run build
- To test the Box UI Elements lauch a local webpack dev server via
yarn run deploy
and navigate tohttp://localhost:8080/
. Sample test files are located inside the test folder.
Install the following plugins in your preferred editor
- Editor Config (standardizes basic editor configuration)
- ESLint (Javascript linting)
- Stylelint (CSS linting)
- Prettier (Javscript formatting)
- Sass (Stylesheets)
- Babel (Transpiler)
yarn run build
to generate resource bundles and JS webpack bundles.yarn run watch
to only generate JS webpack bundles on file changes.yarn run deploy
launches a local webpack dev server for testing. Also watches file changes.yarn run prettier
to format JS code with prettier.yarn run test
launches karma tests with PhantomJS.yarn run test --src=PATH/TO/SRC/FILENAME
launches test only forsrc/PATH/TO/SRC/__tests__/FILENAME-test.js
instead of all tests. For example,yarn run debug -- --src=components/Button/Button
launches tests forcomponents/Button/__tests__/Button-test.js
. This also works for directories, e.g.yarn run test -- --src=components/
.yarn run debug
launches karma tests with PhantomJS for debugging. Open the URL mentioned in the console.yarn run debug --src=path/to/src/FILENAME
launches debugging forsrc/path/to/src/__tests__/FILENAME-test.js
instead of all tests. Open the URL mentioned in the console.
For more script commands see package.json
. Test coverage reports are available under reports/coverage.
- .babelrc - https://babeljs.io/docs/usage/babelrc/
- .conventional-changelog-lintrc - https://github.com/marionebl/conventional-changelog-lint
- .editorconfig - http://editorconfig.org/
- .eslintignore - http://eslint.org/docs/user-guide/configuring#ignoring-files-and-directories
- .eslintrc - http://eslint.org/docs/user-guide/configuring
- .gitignore - https://git-scm.com/docs/gitignore
- .stylelintrc - https://stylelint.io/user-guide/configuration/
- .travis.yml - https://docs.travis-ci.com/user/customizing-the-build
- browserslist - https://github.com/ai/browserslist
- postcss.config.js - https://github.com/postcss/postcss-loader