diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7bb9c31..ea90294 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,25 +1,33 @@ # How To Contribute +This repo is divided into multiple packages using Yarn workspaces: +- `ember-simple-track-helper` is the actual `ember-simple-track-helper` addon +- `test-app` contains `ember-simple-track-helper` test suite + ## Installation -* `git clone ` +* `git clone https://github.com/chriskrycho/ember-simple-track-helper.git` * `cd ember-simple-track-helper` -* `npm install` +* `yarn install` ## Linting -* `npm run lint` -* `npm run lint:fix` +* `yarn lint` +* `yarn lint:fix` ## Running tests -* `ember test` – Runs the test suite on the current Ember version -* `ember test --server` – Runs the test suite in "watch mode" -* `ember try:each` – Runs the test suite against multiple Ember versions +* `cd ember-simple-track-helper && yarn start` – Builds the addon in "watch mode" so changes picked up by test app. +* `cd test-app && ember test` – Runs the test suite on the current Ember version +* `cd test-app && ember test --server` – Runs the test suite in "watch mode" +* `cd test-app && ember try:each` – Runs the test suite against multiple Ember versions + +During development, if you'd like test app to pick up changes in the addon, make sure to run both +`cd ember-simple-track-helper && yarn start` and `cd test-app && ember test --server` in different terminals. -## Running the dummy application +## Running the test application * `ember serve` -* Visit the dummy application at [http://localhost:4200](http://localhost:4200). +* Visit the test application at [http://localhost:4200](http://localhost:4200). For more information on using ember-cli, visit [https://cli.emberjs.com/release/](https://cli.emberjs.com/release/). diff --git a/README.md b/README.md index c74f184..a4064a2 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,30 @@ This project follows the current draft of [the Semantic Versioning for TypeScrip [semver]: https://github.com/chriskrycho/ember-rfcs/blob/semver-for-ts/text/0730-semver-for-ts.md [sm]: https://github.com/chriskrycho/ember-rfcs/blob/semver-for-ts/text/0730-semver-for-ts.md#simple-majors +This project ships [Glint](https://github.com/typed-ember/glint) types, + which allow you when using TypeScript to get strict type checking in your templates. + + Unless you are using [strict mode](http://emberjs.github.io/rfcs/0496-handlebars-strict-mode.html) templates + (via [first class component templates](http://emberjs.github.io/rfcs/0779-first-class-component-templates.html)), + Glint needs a [Template Registry](https://typed-ember.gitbook.io/glint/using-glint/ember/template-registry) + that contains entries for the element modifier provided by this addon. + To add these registry entries automatically to your app, you just need to import `ember-simple-track-helper/template-registry` + from somewhere in your app. When using Glint already, you will likely have a file like + `types/glint.d.ts` where you already import glint types, so just add the import there: + + ```ts + import '@glint/environment-ember-loose'; + import type SimpleTrackHelperRegistry from 'ember-simple-track-helper/template-registry'; + declare module '@glint/environment-ember-loose/registry' { + export default interface Registry extends SimpleTrackHelperRegistry, /* other addon registries */ { + // local entries + } + } + ``` + + > **Note:** Glint itself is still under active development, and as such breaking changes might occur. + > Therefore, Glint support by this addon is also considered experimental, and not covered by our SemVer contract! + Installation ------------------------------------------------------------------------------