Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Glint usage docs #103

Merged
merged 2 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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 <repository-url>`
* `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/).
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------------------------------------------------------------------------

Expand Down