Skip to content

Commit

Permalink
Add typesVersions entry for consistent Signature import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreeman committed Apr 8, 2022
1 parent 2c03aae commit f1c905c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
9 changes: 8 additions & 1 deletion packages/@glimmer/component/package.json
Expand Up @@ -85,6 +85,13 @@
"qunit-dom": "^0.7.1",
"typescript": "~3.5.3"
},
"typesVersions": {
"*": {
"-private/*": [
"dist/types/addon/-private/*"
]
}
},
"engines": {
"node": "6.* || 8.* || >= 10.*"
},
Expand All @@ -93,4 +100,4 @@
"defaultBlueprint": "install-glimmer-component",
"main": "ember-addon-main.js"
}
}
}
5 changes: 1 addition & 4 deletions test/types/component-test.ts
Expand Up @@ -12,10 +12,7 @@ import Component from '@glimmer/component';
// matches the actual import location to which this type would be emitted. Since
// this is an internal-only type whose presence consumers should not rely on and
// which they should not use in any way, this is "safe" from a public API POV.
import {
EmptyObject,
ExpandSignature,
} from '@glimmer/component/dist/types/addon/-private/component';
import { EmptyObject, ExpandSignature } from '@glimmer/component/-private/component';

declare let basicComponent: Component;
expectTypeOf(basicComponent).toHaveProperty('args');
Expand Down
4 changes: 4 additions & 0 deletions test/types/tsconfig.json
Expand Up @@ -31,6 +31,10 @@
"noEmit": true,

"paths": {
"@glimmer/component/-private/*": [
// This must match the `typesVersions` entry in `@glimmer/component`'s package.json
"../../dist/@glimmer/component/dist/types/addon/-private/*"
],
"@glimmer/*": ["../../dist/@glimmer/*"]
}
}
Expand Down

0 comments on commit f1c905c

Please sign in to comment.