UNPKG

4.14 kBMarkdownView Raw
1# Ember HK Components
2
3Reusable Ember components
4
5## Assumptions
6
7Usage of these components assumes you are using the [Purple3 CSS framework](https://purple3.herokuapp.com/) and [Malibu](https://hk-malibu.herokuapp.com).
8
9## Usage
10
11### Installation
12
131. Install `ember-cli-eyeglass` if it's not installed already.
14`ember install --save ember-cli-eyeglass`
15
162. Install `@heroku/ember-hk-components`
17`ember install --save @heroku/ember-hk-components`
18
19#### CSS
20
21You'll need to import the scss files that support the actual components into your app. Ensure that you have installed `ember-cli-eyeglass` and that you are
22using `app.scss` for your app's styles.
23
24You can import css for _all_ the components like this:
25
26`@import "ember-hk-components/ember-hk-components";`
27
28If you want to import the css for only a specific component, like `hk-slide-panel`, you can include it like this:
29
30`@import "ember-hk-components/hk-slide-panel";`
31
32### Components
33
34See [ember-hk-components.herokuapp.com](https://ember-hk-components.herokuapp.com) for a complete list of components that are available.
35
36## Development
37
38### Installation
39
40* `git clone https://github.com/heroku/ember-hk-components`
41* `cd ember-hk-components`
42* `yarn install`
43
44### Running
45
46* `ember serve`
47* Visit your app at [http://localhost:4200](http://localhost:4200).
48
49### Running Tests
50
51* `yarn test` (Runs `ember try:each` to test your addon against multiple Ember versions)
52* `ember test`
53* `ember test --server`
54
55### Local Usage in Another Application
56
57The demo app is useful for developing this addon, but it can often be helpful to consume your version of this addon in another application either to more easily develop your changes or to validate that your changes work as you expect. You can use your local version of `ember-hk-components` in another application that consumes it via yarn's [link](https://yarnpkg.com/lang/en/docs/cli/link/) command.
58
59```sh
60// in your ember-hk-components directory
61> yarn link
62
63// in your consuming app directory
64> yarn link @heroku/ember-hk-components
65
66// to put consuming app back on the release version
67> yarn unlink @heroku/ember-hk-components
68```
69
70Now, when you make changes in your copy of `ember-hk-components` those changes will be reflected in the consuming application.
71
72### Releases
73
74#### Notes
75
76This library does its best to follow the principles of [Semantic Versioning](https://semver.org/). Every effort should be made to ensure all non-major versions are released in a backwards compatible way.
77
78#### Changelog
79
80This project's changelog is generated using `lerna-changelog`. You can find instructions on how to setup your local environment for this in [the project's Readme](https://github.com/lerna/lerna-changelog#github-token). Note that the Personal access token you use must be [SSO-enabled](https://help.github.com/en/github/authenticating-to-github/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on) for this to work.
81
82`lerna-changelog` works off a system of labels defined in [this project's package.json](https://github.com/heroku/ember-hk-components/blob/9bdcf240e2294b48cac2e4f99ac5b706b7b17214/package.json#L61-L70). Pull requests will be collated into the changelog based on which label has been applied to them.
83
84#### Making a New Release
85
86Once you are ready to make a new release follow these steps:
87
88* Ensure all merged pull requests are labelled correctly as indicated in the Changelog section
89* Create a new branch
90* Update the version number in `package.json`
91* Run `yarn run changelog --from x.x.x` where `x.x.x` is the _last_ version of this library that was released. This should generate changelog of changes _since_ that last release.
92* Copy the output of that command into Changelog.md
93* Commit your changes and open a PR
94
95Once the PR is approved and merged you can then tag your new version by running `git tag x.x.x` where `x.x.x` is the new version number. Push your tag to GitHub using `git push origin --tags`.
96
97Publish your new version to npm with the command `npm publish` 🎉
98
99_Note that you must have publish access to the @heroku npm organization to successfully publish_