-
Notifications
You must be signed in to change notification settings - Fork 96
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
fix(ci): upgrade dtslint #338
Conversation
Funnily the errors are coming from external types: Error: Errors in typescript@next for external dependencies: ../../../node_modules/@types/ember-data/index.d.ts(952,52): error TS2344: Type 'any' does not satisfy the constraint 'never'. ../../../node_modules/@types/ember-test-helpers/index.d.ts(62,18): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/ember-testing-helpers/index.d.ts(39,63): error TS2304: Cannot find name 'Node'. ../../../node_modules/@types/ember-testing-helpers/index.d.ts(42,73): error TS2304: Cannot find name 'Node'. ../../../node_modules/@types/ember/index.d.ts(321,30): error TS2304: Cannot find name 'Event'. ../../../node_modules/@types/ember__application/index.d.ts(91,18): error TS2304: Cannot find name 'HTMLElement'. ../../../node_modules/@types/ember__component/-private/view-mixin.d.ts(13,14): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/ember__utils/-private/types.d.ts(13,15): error TS2304: Cannot find name 'FileList'. ../../../node_modules/@types/jquery/JQuery.d.ts(5,29): error TS2304: Cannot find name 'HTMLElement'. ../../../node_modules/@types/jquery/JQuery.d.ts(85,45): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(229,80): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(533,34): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQuery.d.ts(533,64): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQuery.d.ts(546,31): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQuery.d.ts(546,61): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQuery.d.ts(559,30): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQuery.d.ts(559,60): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQuery.d.ts(572,31): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQuery.d.ts(585,30): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQuery.d.ts(598,33): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQuery.d.ts(598,63): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQuery.d.ts(1021,79): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(1021,89): error TS2304: Cannot find name 'DocumentFragment'. ../../../node_modules/@types/jquery/JQuery.d.ts(1934,49): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(2017,59): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(2068,35): error TS2304: Cannot find name 'Text'. ../../../node_modules/@types/jquery/JQuery.d.ts(2068,42): error TS2304: Cannot find name 'Comment'. ../../../node_modules/@types/jquery/JQuery.d.ts(3986,28): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(4101,46): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(4569,38): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(5352,48): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(5568,82): error TS2304: Cannot find name 'Node'. ../../../node_modules/@types/jquery/JQuery.d.ts(5568,97): error TS2304: Cannot find name 'Node'. ../../../node_modules/@types/jquery/JQuery.d.ts(5602,83): error TS2304: Cannot find name 'Node'. ../../../node_modules/@types/jquery/JQuery.d.ts(5602,98): error TS2304: Cannot find name 'Node'. ../../../node_modules/@types/jquery/JQuery.d.ts(5822,83): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(7108,52): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(7180,75): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(8525,55): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(8693,80): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(8693,90): error TS2304: Cannot find name 'DocumentFragment'. ../../../node_modules/@types/jquery/JQuery.d.ts(8868,52): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(9095,35): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(9109,35): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(9295,45): error TS2304: Cannot find name 'Node'. ../../../node_modules/@types/jquery/JQuery.d.ts(9689,70): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(9840,86): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(12478,74): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(12629,77): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(12759,79): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQuery.d.ts(12759,152): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(70,14): error TS2304: Cannot find name 'Window'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(101,23): error TS2304: Cannot find name 'HTMLElement'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(101,37): error TS2304: Cannot find name 'HTMLElement'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(101,102): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(140,23): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(140,33): error TS2304: Cannot find name 'HTMLElement'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(140,83): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(140,93): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(152,16): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(165,16): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(192,17): error TS2304: Cannot find name 'HTMLElement'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(192,48): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(206,17): error TS2304: Cannot find name 'HTMLElement'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(328,32): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(328,42): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(328,53): error TS2304: Cannot find name 'Window'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(341,25): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(341,45): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(342,15): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(414,81): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(414,91): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(414,102): error TS2304: Cannot find name 'Window'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(427,19): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(427,29): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(427,40): error TS2304: Cannot find name 'Window'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(475,19): error TS2304: Cannot find name 'Element'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(475,29): error TS2304: Cannot find name 'Document'. ../../../node_modules/@types/jquery/JQueryStatic.d.ts(475,40): error TS2304error Command failed with exit code 1. |
Okay, managed to remove most errors by adding the This is remaining though: 13:20 $ lerna run --concurrency 1 --stream --no-bail dtslint lerna notice cli v3.4.3 lerna info Executing command in 5 packages: "yarn run dtslint" @ember-decorators/controller: yarn run v1.12.3 @ember-decorators/controller: $ dtslint published-types @ember-decorators/controller: Error: Errors in typescript@next for external dependencies: @ember-decorators/controller: ../../../node_modules/@types/ember-data/index.d.ts(952,52): error TS2344: Type 'any' does not satisfy the constraint 'never'. @ember-decorators/controller: at /Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:158:19 @ember-decorators/controller: at Generator.next () @ember-decorators/controller: at fulfilled (/Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:5:58) @ember-decorators/controller: error Command failed with exit code 1. @ember-decorators/controller: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. @ember-decorators/data: yarn run v1.12.3 @ember-decorators/data: $ dtslint published-types @ember-decorators/data: Error: Errors in typescript@next for external dependencies: @ember-decorators/data: ../../../node_modules/@types/ember-data/index.d.ts(92,26): error TS2344: Type 'ModelRegistry[K]' does not satisfy the constraint 'Model'. @ember-decorators/data: Type 'Book | Person' is not assignable to type 'Model'. @ember-decorators/data: Type 'Book' is not assignable to type 'Model'. @ember-decorators/data: Types of property 'eachRelationship' are incompatible. @ember-decorators/data: Type '(callback: (name: string, details: RelationshipMeta) => void, binding?: any) => any' is not assignable to type '(callback: (name: string, details: RelationshipMeta) => void, binding?: any) => any'. @ember-decorators/data: Types of parameters 'callback' and 'callback' are incompatible. @ember-decorators/data: Types of parameters 'details' and 'details' are incompatible. @ember-decorators/data: Type 'RelationshipMeta' is not assignable to type 'RelationshipMeta'. @ember-decorators/data: Types of property 'key' are incompatible. @ember-decorators/data: Type '"toString" | "reload" | "title" | "get" | "set" | "getProperties" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | ... 48 more ... | "didDefineProperty"' is not assignable to type '"toString" | "reload" | "get" | "set" | "getProperties" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | ... 44 more ... | "didDefineProperty"'. @ember-decorators/data: Type '"title"' is not assignable to type '"toString" | "reload" | "get" | "set" | "getProperties" | "setProperties" | "notifyPropertyChange" | "addObserver" | "removeObserver" | "getWithDefault" | "incrementProperty" | ... 44 more ... | "didDefineProperty"'. @ember-decorators/data: ../../../node_modules/@types/ember-data/index.d.ts(1013,58): error TS2344: Type 'M' does not satisfy the constraint 'Model'. @ember-decorators/data: Type 'ModelRegistry[K]' is not assignable to type 'Model'. @ember-decorators/data: Type 'Book | Person' is not assignable to type 'Model'. @ember-decorators/data: Type 'Book' is not assignable to type 'Model'. @ember-decorators/data: ../../../node_modules/@types/ember-data/index.d.ts(1021,61): error TS2344: Type 'M' does not satisfy the constraint 'Model'. @ember-decorators/data: Type 'ModelRegistry[K]' is not assignable to type 'Model'. @ember-decorators/data: ../../../node_modules/@types/ember-data/index.d.ts(1074,28): error TS2344: Type 'ModelRegistry[K]' does not satisfy the constraint 'Model'. @ember-decorators/data: Type 'Book | Person' is not assignable to type 'Model'. @ember-decorators/data: Type 'Book' is not assignable to type 'Model'. @ember-decorators/data: ../../../node_modules/@types/ember-data/index.d.ts(1877,9): error TS2416: Property 'serializeIntoHash' in type 'RESTSerializer' is not assignable to the same property in base type 'JSONSerializer'. @ember-decorators/data: Type '(hash: {}, typeClass: Model, snapshot: Snapshot, options?: {} | undefined) => any' is not assignable to type '(hash: {}, typeClass: ModelRegistry[K], snapshot: Snapshot, options?: {} | undefined) => any'. @ember-decorators/data: Types of parameters 'typeClass' and 'typeClass' are incompatible. @ember-decorators/data: Type 'ModelRegistry[K]' is not assignable to type 'Model'. @ember-decorators/data: Type 'Book | Person' is not assignable to type 'Model'. @ember-decorators/data: Type 'Book' is not assignable to type 'Model'. @ember-decorators/data: at /Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:158:19 @ember-decorators/data: at Generator.next () @ember-decorators/data: at fulfilled (/Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:5:58) @ember-decorators/data: error Command failed with exit code 1. @ember-decorators/data: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. @ember-decorators/object: yarn run v1.12.3 @ember-decorators/object: $ dtslint published-types @ember-decorators/object: Error: Errors in typescript@next for external dependencies: @ember-decorators/object: ../../../node_modules/@types/ember-data/index.d.ts(952,52): error TS2344: Type 'any' does not satisfy the constraint 'never'. @ember-decorators/object: at /Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:158:19 @ember-decorators/object: at Generator.next () @ember-decorators/object: at fulfilled (/Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:5:58) @ember-decorators/object: error Command failed with exit code 1. @ember-decorators/object: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. @ember-decorators/service: yarn run v1.12.3 @ember-decorators/service: $ dtslint published-types @ember-decorators/service: Error: Errors in typescript@next for external dependencies: @ember-decorators/service: ../../../node_modules/@types/ember-data/index.d.ts(952,52): error TS2344: Type 'any' does not satisfy the constraint 'never'. @ember-decorators/service: at /Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:158:19 @ember-decorators/service: at Generator.next () @ember-decorators/service: at fulfilled (/Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:5:58) @ember-decorators/service: error Command failed with exit code 1. @ember-decorators/service: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. @ember-decorators/component: yarn run v1.12.3 @ember-decorators/component: $ dtslint published-types @ember-decorators/component: Error: Errors in typescript@next for external dependencies: @ember-decorators/component: ../../../node_modules/@types/ember-data/index.d.ts(952,52): error TS2344: Type 'any' does not satisfy the constraint 'never'. @ember-decorators/component: at /Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:158:19 @ember-decorators/component: at Generator.next () @ember-decorators/component: at fulfilled (/Users/janbuschtoens/open-source/ember-decorators/node_modules/dtslint/bin/index.js:5:58) @ember-decorators/component: error Command failed with exit code 1. @ember-decorators/component: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. |
I've tried ember-cli-typescript#324 to no avail. But maybe I did something wrong. |
Adding this to
@jamescdavis thankfully explained why:
To me this means we have to drop support for TypeScript 2.7 here as well. |
I've "fixed" all setups except for the export default interface ModelRegistry {
[key: string]: any;
} So it's an either / or situation, I guess? |
Kicking off multiple concurrenct dtslint instances that all try to install TS fails.
WTF does 8c64d83 pass on CI? I did this locally:
Which gave me:
I need to apply 2606f69 in order for everything to pass. How the hell does it work on CI? 😂 |
@mike-north can you take a look at this too? |
Confirmed out of band that this looks good, thanks a ton for figuring this out @buschtoens! This was huge! |
@@ -1,4 +1,4 @@ | |||
// TypeScript Version: 2.7 | |||
// TypeScript Version: 2.8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was introduced here to break TS 2.7 support for this file?
we should not be dropping TS 2.7 support here, unless the types for this library require types that can only be expressed using TS 2.8+ features. Is this the case? Can an older version of |
It's because ember-decorators/packages/data/published-types/index.d.ts Lines 4 to 5 in 958fdc8
|
@mike-north Part of the conversation happened on Discord.
Very good point indeed. I will try whether a downgrade of the Ember types can fix this incompatibility on Monday. The question is: is this the right trade-off to make, if possible? |
@buschtoens @mike-north |
@jamescdavis I think you're on the right track here. I have to keep reminding myself of how limited ambient type testing is. In an ideal world, we'd be able to run dtslint on these types against an older version of |
@jamescdavis @mike-north So do we keep it at 2.8 or is there a possibility to downgrade again? |
@mike-north @jamescdavis where are we at on this? There are some things blocked on a release of decorators, but I don't want to release unless we're ok with dropping TS 2.7 support |
I'd say drop 2.7 support, since you require types that need 2.8 in their most recent release. This kind of change (excessively bumping minimum supported TS version) bugs me, but the tooling for a better way of handling it doesn't exist. |
I agree on both counts. The safer thing to do here is drop 2.7 because the user is highly likely to need 2.8+ anyways, but it sure would be nice to know for sure. |
I found the cause for the failing
dtslint
step in #336: microsoft/dtslint#1667ac937c: This PR works around the issue by forcing the last compatibledefinitelytyped-header-parser
version via a yarn resolution.This PR upgrades
dtslint
to the latest version to make it compatible with the latest version ofdefinitelytyped-header-parser
. This means, thattypescript@next
is now also validated. We probably want to disable this, since it's throwing errors for me, or we need to fix these errors.