2020-08-10 17:29:12 -04:00
# Boundary UI Monorepo
2020-04-20 16:40:27 -04:00
2020-08-10 17:29:12 -04:00

2020-04-23 14:33:38 -04:00
2020-04-20 16:40:27 -04:00
This monorepo contains multiple projects, including UIs and addons, used by
2020-08-10 17:29:12 -04:00
Boundary.
2020-04-20 16:40:27 -04:00
2020-04-23 12:59:40 -04:00
This top-level repository provides limited common tasks, such as installation
and commit assistance. However, most tasks must be executed from within a
subproject, e.g. running or testing.
2020-07-08 17:03:20 -04:00
2020-04-23 12:59:40 -04:00
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
- [Prerequisites ](#prerequisites )
- [Installation ](#installation )
2020-04-23 14:05:49 -04:00
- [Yarn Commands ](#yarn-commands )
2020-04-23 12:59:40 -04:00
- [Contributing ](#contributing )
- [Branching ](#branching )
- [Building ToC ](#building-toc )
2020-06-24 11:44:21 -04:00
- [Building Core UI for Production ](#building-core-ui-for-production )
2020-06-26 11:49:38 -04:00
- [Building with a Container ](#building-with-a-container )
2020-04-23 12:59:40 -04:00
- [Committing ](#committing )
2020-04-23 14:03:59 -04:00
- [License Checking ](#license-checking )
2020-04-23 12:59:40 -04:00
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2020-04-20 16:40:27 -04:00
## Prerequisites
You will need the following things properly installed on your computer.
* [Git][git]
* [Node.js][node]
* [Yarn][yarn] installed globally
2020-04-24 11:56:52 -04:00
* [Google Chrome][chrome]
* [Firefox][firefox]
2020-04-20 16:40:27 -04:00
[git]: https://git-scm.com/
[node]: https://nodejs.org/
[yarn]: https://classic.yarnpkg.com/lang/en/
2020-04-24 11:56:52 -04:00
[chrome]: https://google.com/chrome/
[firefox]: https://firefox.com/
2020-04-20 16:40:27 -04:00
[yarn-workspaces]: https://classic.yarnpkg.com/en/docs/workspaces/
## Installation
* `git clone <repository-url>` this repository
2020-08-10 17:29:12 -04:00
* `cd boundary-ui`
2020-04-20 16:40:27 -04:00
* `yarn install`
2020-04-23 14:05:49 -04:00
## Yarn Commands
List of available project commands. `yarn run <command-name>`
2020-07-29 17:07:28 -04:00
| Command | Description |
|---------------------|---|
| build | Builds Core UI. |
| test | Runs tests in CI mode. |
| commit | Replaces `git commit` , ensures compliance, audit, lint, and test checks pass before commit is allowed and normalizes commit messages across authors. |
| lint | Runs ember-template-lint on all of the hbs, js, and sass files. |
| compliance:audit | Checks for issues using `yarn audit` with moderate and above criticality.|
| compliance:licenses | Checks that all dependencies have OSS-compatible licenses. |
| doc:toc | Automatically generates a table of contents for the README file. |
2020-04-23 14:05:49 -04:00
2020-04-20 16:40:27 -04:00
## Contributing
### Branching
We follow [A Successful Git Branching Model][nvie-git], otherwise known as
2020-07-29 17:07:28 -04:00
Gitflow. Branches `main` and `develop` are sacred mainlines into which we do
2020-04-20 16:40:27 -04:00
not commit directly. Instead, these branches have special meaning defining what
code may be found within. The `develop` branch contains code _for the next
2020-07-29 17:07:28 -04:00
release_. Code in `main` is _released, tagged, and ready for
2020-04-20 16:40:27 -04:00
production deployment_.
2020-07-29 17:07:28 -04:00
To start contributing:
2020-04-20 16:40:27 -04:00
1. Start a new **topic branch** off `develop` .
2. Commit work.
3. When work is complete, create a PR from the topic branch into `develop` .
4. Code review and automated checks occur. If checks fail or changes are
requested, commit more work. Rinse and repeat until all checks pass and no
changes are requested.
5. A core team member may merge the PR into `develop` . At this point, the code
is unreleased but considered "releasable".
6. **Releasing** : when it's time to release, create a PR from `develop` into
2020-07-29 17:07:28 -04:00
`main` (we skip Gitflow's `release` branch). This is tantamount to
2020-04-20 16:40:27 -04:00
requesting a new release (version) of the product. Ensure the body of the PR
includes well-documented changes slated for release.
7. Code review and automated checks occur.
2020-07-29 17:07:28 -04:00
8. A core team member may merge the PR into `main` to initiate a release.
9. Tag the merge commit in `main` with version number of the release and cut
2020-04-20 16:40:27 -04:00
a release in GitHub.
While Gitflow may seem heavy, most of its process can be automated. Gitflow is
similar to its lighter-weight sibling [GitHub Flow][github-flow]. In essence,
2020-07-29 17:07:28 -04:00
Gitflow differs only by adding an second mainline branch (`main` ) that is
2020-04-20 16:40:27 -04:00
designated as _always containing production code_ . Another happy characteristic
of Gitflow is that it's easy to track the project's release history, since
2020-07-29 17:07:28 -04:00
_every commit to `main` is a release by definition_ . The well-defined nature
2020-04-20 16:40:27 -04:00
of releases assists in cross-team collaboration, ensuring everyone has
confidence about the state of the project.
2020-04-23 12:59:40 -04:00
### Building ToC
To autogenerate a ToC (table of contents) for this README,
2020-04-23 16:58:11 -04:00
run `yarn doc:toc` . Please update the ToC whenever editing the structure
2020-04-23 12:59:40 -04:00
of README.
2020-06-24 11:33:20 -04:00
### Building Core UI for Production
See ui/core/README.md Building for Production for more information on how to
2020-06-24 12:07:29 -04:00
build the Core UI. Be sure to set build-related environment variables as
necessary for your target environment, as described in the Core UI readme.
To quickly produce a production build of Core UI, run from this folder:
```bash
yarn install
2020-07-29 17:07:28 -04:00
yarn build
2020-06-24 12:07:29 -04:00
```
Assets are saved to `ui/core/dist/` .
2020-06-24 11:33:20 -04:00
2020-06-26 11:49:38 -04:00
#### Building with a Container
2020-07-29 17:07:28 -04:00
Optionally, you may build the UI within a container. Execute the following command:
2020-06-26 11:49:38 -04:00
```bash
2020-06-29 18:07:43 -04:00
docker-compose -f docker-compose-embedding.yml run build
2020-06-26 11:49:38 -04:00
```
Assets are saved to `ui/core/dist/` .
2020-04-20 16:40:27 -04:00
### Committing
Instead of the default `git commit` , we prescribe a custom command that ensures
linting and other checks pass before a commit may be completed. It also ensures
that all contributors author consistent commit messages. To get started with a
2020-04-23 16:58:11 -04:00
commit, stage your files as usual. Then run `yarn commit` and follow the
2020-04-20 16:40:27 -04:00
on-screen instructions to author your message.
2020-04-23 14:03:59 -04:00
#### License Checking
The licenses of dependencies are checking against a whitelist before every
commit. This helps catch undesirable licenses sooner (e.g. GPL). If your
commit fails due to an non-whitelisted license, you may add it to the whitelist
in `package.json` _as long as it is not a GPL variant or UNLICENSED_ .
The change will be verified upon PR. GPL variants and UNLICENSED dependencies
will not be accepted.
2020-04-20 16:40:27 -04:00
[nvie-git]: https://nvie.com/posts/a-successful-git-branching-model/
[github-flow]: https://guides.github.com/introduction/flow/