-
Notifications
You must be signed in to change notification settings - Fork 99
Install ec-typescript as a dependency for addons #623
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,17 +15,17 @@ ember-cli-typescript **requires** ember-cli-babel at version 7.1.0 or above, whi | |
The recommended approach here is to deduplicate existing installations of the dependency, remove and reinstall ember-cli-babel to make sure that all its transitive dependencies are updated to the latest possible, and then to deduplicate *again*. | ||
|
||
If using yarn: | ||
``` | ||
|
||
```sh | ||
npx yarn-deduplicate | ||
yarn remove ember-cli-babel | ||
yarn add --dev ember-cli-babel | ||
npx yarn-deduplicate | ||
``` | ||
|
||
If using npm: | ||
``` | ||
|
||
```sh | ||
npm dedupe | ||
npm uninstall ember-cli-babel | ||
npm install --save-dev ember-cli-babel | ||
|
@@ -34,7 +34,7 @@ npm dedupe | |
|
||
Note: If you are also using ember-decorators—and specifically the babel-transform that gets added with it—you will need update @ember-decorators/babel-transforms as well (anything over 3.1.0 should work): | ||
|
||
``` | ||
```sh | ||
ember install ember-decorators@^3.1.0 @ember-decorators/babel-transforms@^3.1.0 | ||
``` | ||
|
||
|
@@ -44,38 +44,48 @@ Follow the same process of deduplication, reinstallation, and re-deduplication a | |
|
||
## Update ember-cli-typescript | ||
|
||
***Note:* Because ember-cli-typescript is part of the build pipeline, the process for updating it differs slightly between apps and addons!** | ||
|
||
### In apps | ||
|
||
In apps, you can simply `ember install` the dependency like normal: | ||
Now you can simply `ember install` the dependency like normal: | ||
|
||
```sh | ||
ember install ember-cli-typescript@latest | ||
``` | ||
|
||
### In addons | ||
***Note:* To work properly, starting from v2, ember-cli-typescript must be declared as a `dependency`, not a `devDependency` for addons. With `ember install` this migration would be automatically handled for you.** | ||
|
||
To work properly, Ember addons must declare this library as a `dependency`, not a `devDependency`. **This is a *change* from ember-cli-typescript v1.** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as in the README. |
||
If you choose to make the upgrade manually with yarn or npm, here are the steps you need to follow: | ||
|
||
1. Remove ember-cli-typescript from your dependencies. | ||
1. Remove ember-cli-typescript from your `devDependencies`. | ||
|
||
With yarn: | ||
|
||
```sh | ||
yarn remove ember-cli-typescript | ||
yarn remove ember-cli-typescript | ||
``` | ||
|
||
With npm: | ||
|
||
```sh | ||
npm uninstall ember-cli-typescript | ||
``` | ||
|
||
2. Re-install it with `ember install`: | ||
2. Install the latest of ember-cli-typescript as a `dependency`: | ||
|
||
With yarn: | ||
|
||
```sh | ||
yarn add ember-cli-typescript@latest | ||
``` | ||
|
||
With npm: | ||
|
||
```sh | ||
npm install --save ember-cli-typescript@latest | ||
``` | ||
|
||
3. Run `ember generate`: | ||
|
||
```sh | ||
ember install ember-cli-typescript@latest --save | ||
ember generate ember-cli-typescript | ||
``` | ||
|
||
### Account for addon build pipeline changes | ||
|
@@ -104,7 +114,7 @@ Any place where a type annotation overrides a *getter* | |
|
||
This breaks because `element` is a getter on `Component`. This declaration then shadows the getter declaration on the base class and stomps it to `undefined` (effectively `Object.defineProperty(this, 'element', void 0)`. | ||
|
||
Two solutions— | ||
Two solutions: | ||
|
||
1. Annotate locally (slightly more annoying, but less likely to troll you): | ||
|
||
|
@@ -144,6 +154,7 @@ Any place where a type annotation overrides a *getter* | |
```ts | ||
export { FooType } from 'foo'; | ||
``` | ||
|
||
```ts | ||
import { FooType } from 'foo'; | ||
export { FooType }; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.