This project is a multip package monorepo handled by Lerna
This document describes how to set up your development environment to build and test blaze-elements.
It also explains the basic mechanics of using git
, node
, npm
, yarn
.
See the contribution guidelines if you'd like to contribute to Blaze-elements.
Before you can build and test, you must install and configure the following products on your development machine:
-
Git and/or the GitHub app (for Mac or Windows); GitHub's Guide to Installing Git is a good source of information.
-
Node.js, (version
>=5.4.1 <6
) which is used to run a development web server, run tests, and generate distributable files. We also use Node's Package Manager,npm
(version>=3.5.3 <4.0
), which comes with Node. Depending on your system, you can install Node either from source or as a pre-packaged bundle. -
yarn which is Fast, reliable, and secure dependency management, so it's our prefered way for installing packages instead of slow
npm
. You can install it vianpm install -g yarn
or follow this guidelines
Fork and clone the Blaze-elements repository:
- Login to your GitHub account or create one by following the instructions given here.
- Fork the main Blaze-elements repository.
- Clone your fork of the Blaze-elements repository and define an
upstream
remote pointing back to the Blaze-elements repository that you forked in the first place.
# Clone your GitHub repository:
git clone git@github.com:<github username>/blaze-elements.git
# Go to the blaze directory:
cd blaze-elements
# Add the main Blaze repository as an upstream remote to your repository:
git remote add upstream https://github.com/wc-catalogue/blaze-elements.git
Next, install the JavaScript modules needed to build and test Blaze-elements:
# Install Blaze-elements project dependencies (package.json)
yarn
# from project root
yarn start
open http://localhost:8080
cd packages/<elemenet-directory>
yarn start
open http://localhost:8080
# Create empty folder for desired package
mkdir packages/somepackagename
# Run config generation task
yarn toolbelt:generate:configs
NOTE: templates are stored under toolbelt/templates
To run tests:
# from project root
yarn test # Run all blaze-elements tests
yarn test:watch # Run all blaze-elements tests in watch mode ( good for development ) - will run FF,Chrome,Chrome Canary
yarn test:watch:firefox # Run all blaze-elements tests in watch mode ( good for development ) - will run only FF
For particular package:
cd packages/button
yarn test # Run tests only for bl-button
yarn test:watch # Run tests only for bl-button in watch mode ( good for development ) - will run FF,Chrome,Chrome Canary
yarn test:watch:firefox # Run tests only for bl-button in watch mode ( good for development ) - will run only FF
All the tests are executed on our Continuous Integration infrastructure and a PR could only be merged once the tests pass.
- Travis CI fails if you submit code with Typescript or TSLint errors or any of the test suites described above fails.
Blaze-elements uses typescript-formatter to format the source code. If the source code is not properly formatted, the CI will fail and the PR can not be merged.
You can automatically format your code by running:
$ yarn ts:format
and fix autofixable tslint errors by running:
$ yarn ts:lint:fix
You can check that your code is properly formatted and adheres to coding style by running:
$ yarn ts:lint
To build whole Blaze-elements suit run:
yarn build
To build just particular Blaze-elements package run:
cd packages/button
yarn build
- Results are put in the dist folder.
NOTE: This section is for collaborators only. Contributors without repo write access can ignore this section.
To release blaze-elements, you should perform the following steps:
@TODO