Skip to content

Commit

Permalink
Merge branch 'master' into blueprint_add_ember-data_modules_types
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreeman committed Jun 15, 2021
2 parents bd607b7 + 5752265 commit bf3d38d
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 1,146 deletions.
11 changes: 5 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<!-- Thanks for submitting a pull request! 🎉 -->
<!--
<!-- Please note that commit messages need to follow the [Conventional Commits](https://www.conventionalcommits.org) format.
Thanks for submitting a pull request! 🎉
For example:
test: fix node tests when run locally with ts-node
Please include a link to a GitHub issue if one exists.
-->
If you don't hear from a maintainer within a few days, please feel free to ping us here or in #e-typescript on Discord!
<!-- Also, please include a link to a github issue if one exists. -->
-->
16 changes: 0 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,6 @@ env:
CI: true

jobs:
commitlint:
name: Lint Commits
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout Code
uses: actions/checkout@v2
# We need the `with` argument here so that force pushes (e.g. from
# Renovate rebasing) work correctly.
# https://github.com/wagoid/commitlint-github-action/tree/d6a383492a776126bbeba8c1d797ead4baedaaae#usage
with:
fetch-depth: 0
- name: Commitlint
uses: wagoid/commitlint-github-action@v2.1.1

test-locked-deps:
name: Test (linux, locked dependencies)
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"-r", "register-ts-node",
"-f", "generates .d.ts files when addon and package names do not match",
"-f", "Acceptance: ember-cli-typescript generator",
"-f", "basic app",
"-t", "1000000",
"ts/tests/**/*.{ts,js}"
],
"internalConsoleOptions": "openOnSessionStart"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ We have a channel (**`#e-typescript`**) on the [Ember Community Discord server](

### 📚 Issues With Ember Type Definitions

If you've found that some of the Ember type information is missing things, or is incorrect in some way, please first ensure you're using the latest version of the [packages this addon installs](https://ember-cli-typescript.com/docs#other-packages-this-addon-installs). Although [StackOverflow](https://stackoverflow.com/questions/tagged/ember.js+typescript) and [Discuss](https://discuss.emberjs.com/search?q=typescript) are not the advised places to report problems, you may find an answer there.
If you've found that some of the Ember type information is missing things, or is incorrect in some way, please first ensure you're using the latest version of the [packages this addon installs](https://docs.ember-cli-typescript.com/installation#other-packages-this-addon-installs). Although [StackOverflow](https://stackoverflow.com/questions/tagged/ember.js+typescript) and [Discuss](https://discuss.emberjs.com/search?q=typescript) are not the advised places to report problems, you may find an answer there.

If you don't find an answer, please [open an enhancement request or bug report in this project](https://github.com/typed-ember/ember-cli-typescript/issues/new/choose).

Expand Down
4 changes: 2 additions & 2 deletions docs/ember-data/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The type returned by the `@attr` decorator is whatever [Transform](https://api.e
So, for example, you might write a class like this:

```typescript
import Model, { attr } from '@ember-data/object';
import Model, { attr } from '@ember-data/model';
import CustomType from '../transforms/custom-transform';

export default class User extends Model {
Expand All @@ -44,7 +44,7 @@ The _safest_ type you can write for an Ember Data model, therefore, leaves every
One way to make this safer is to supply a default value using the `defaultValue` on the options hash for the attribute:

```typescript
import Model, { attr } from '@ember-data/object';
import Model, { attr } from '@ember-data/model';

export default class User extends Model {
@attr()
Expand Down
2 changes: 1 addition & 1 deletion docs/ember/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class MyRoute extends Route {
}
```

This inconsistency will be solved in the future. For now, this workaround gets the job done, and also shows the way to using this information to provide the type of the route's model to other consumers: see [Working with Route Models](routes.md) for details!
This inconsistency will be solved in the future. For now, this workaround gets the job done, and also shows the way to using this information to provide the type of the route's model to other consumers: see [Working with Route Models](../cookbook/working-with-route-models.md) for details!

```typescript
import Route from '@ember/routing/route';
Expand Down
2 changes: 1 addition & 1 deletion docs/ember/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default class CartContentsComponent extends Component {
Here we need to cast the lookup result to `ShoppingCartService` in order to get any type-safety because the lookup return type is `any` \(see caution below\).

{% hint style="danger" %}
This type-cast provides no guarantees that what is returned by the lookup is actually the service you are expecting. Because TypeScript cannot resolve the lookup micro-syntax \(`service:<name>`\) to the service class, a typo would result in returning something other than the specified type. It only gurantees that _if_ the expected serbice is returned that you are using it correctly.
This type-cast provides no guarantees that what is returned by the lookup is actually the service you are expecting. Because TypeScript cannot resolve the lookup micro-syntax \(`service:<name>`\) to the service class, a typo would result in returning something other than the specified type. It only gurantees that _if_ the expected service is returned that you are using it correctly.

There is a merged \(but not yet implemented\) [RFC](https://emberjs.github.io/rfcs/0585-improved-ember-registry-apis.html) which improves this design and makes it straightforward to type-check. Additionally, TypeScript 4.1's introduction of [template types](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#template-literal-types) may allow us to supply types that work with the microsyntax.

Expand Down
15 changes: 2 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
"ci:test:app": "ember test",
"ci:test:node": "mocha --recursive js/tests",
"prepublishOnly": "yarn tsc --noEmit false --project ts",
"postpublish": "rimraf js",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -u"
"postpublish": "rimraf js"
},
"dependencies": {
"ansi-to-html": "^0.6.6",
Expand All @@ -51,8 +50,6 @@
"walk-sync": "^2.2.0"
},
"devDependencies": {
"@commitlint/cli": "11.0.0",
"@commitlint/config-conventional": "11.0.0",
"@ember/optional-features": "2.0.0",
"@glimmer/component": "^1.0.0-beta.3",
"@glimmer/tracking": "^1.0.0-beta.3",
Expand Down Expand Up @@ -82,8 +79,6 @@
"broccoli-plugin": "4.0.3",
"capture-console": "1.0.1",
"co": "4.6.0",
"commitlint-azure-pipelines-cli": "1.0.3",
"conventional-changelog-cli": "2.1.1",
"ember-cli": "3.22.0",
"ember-cli-app-version": "4.0.0",
"ember-cli-babel": "7.23.0",
Expand Down Expand Up @@ -111,8 +106,7 @@
"esprima": "4.0.1",
"fixturify": "2.1.0",
"got": "11.8.0",
"handlebars": "4.7.6",
"husky": "4.3.0",
"handlebars": "4.7.7",
"in-repo-a": "link:tests/dummy/lib/in-repo-a",
"in-repo-b": "link:tests/dummy/lib/in-repo-b",
"loader.js": "4.7.0",
Expand All @@ -139,11 +133,6 @@
"broccoli-watcher"
]
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"prettier": {
"printWidth": 100,
"semi": true,
Expand Down

0 comments on commit bf3d38d

Please sign in to comment.