- Install Node v6.10.0 or higher.
- Install yarn package manager
https://yarnpkg.com/en/docs/installv1.0.1 or higher. Alternatively, you can replace mostyarncommands withnpmcommands. - Fork the upstream repo
https://github.com/box/box-ui-elements. - Clone your fork locally
git clone git@github.com:[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 git@github.com:box/box-ui-elements.git. - Verify your remotes are properly set up
git remote -v. You should pull updates from the Box repoupstreamand 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 deployand 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 buildto generate resource bundles and JS webpack bundles.yarn run watchto only generate JS webpack bundles on file changes.yarn run deploylaunches a local webpack dev server for testing. Also watches file changes.yarn run prettierto format JS code with prettier.yarn run testlaunches karma tests with PhantomJS.yarn run test --src=PATH/TO/SRC/FILENAMElaunches test only forsrc/PATH/TO/SRC/__tests__/FILENAME-test.jsinstead of all tests. For example,yarn run debug -- --src=components/Button/Buttonlaunches tests forcomponents/Button/__tests__/Button-test.js. This also works for directories, e.g.yarn run test -- --src=components/.yarn run debuglaunches karma tests with PhantomJS for debugging. Open the URL mentioned in the console.yarn run debug --src=path/to/src/FILENAMElaunches debugging forsrc/path/to/src/__tests__/FILENAME-test.jsinstead 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