Skip to content

Commit

Permalink
fix: VS code will now properly import operators, et al (#6276)
Browse files Browse the repository at this point in the history
- Adds typesVersions, enforcing TypeScript >= 4.2.
- Adds some superfluous references required for TS and VS Code to find proper import locations for our strange deep import sites.
- Independantly tested by building the package and installing it locally in another project, then testing in VS code.

Fixes #6067
Related microsoft/TypeScript#43034
  • Loading branch information
benlesh committed Apr 29, 2021
1 parent e572d2e commit f43c728
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -5,7 +5,12 @@
"main": "./dist/cjs/index.js",
"module": "./dist/esm5/index.js",
"es2015": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"types": "index.d.ts",
"typesVersions": {
">=4.2": {
"*": ["dist/types/*"]
}
},
"sideEffects": false,
"exports": {
".": {
Expand Down
15 changes: 15 additions & 0 deletions src/index.ts
@@ -1,3 +1,18 @@
//////////////////////////////////////////////////////////
// Here we need to reference our other deep imports
// so VS code will figure out where they are
// see conversation here:
// https://github.com/microsoft/TypeScript/issues/43034
//////////////////////////////////////////////////////////

// tslint:disable: no-reference
/// <reference path="./ajax/index.ts" />
/// <reference path="./fetch/index.ts" />
/// <reference path="./operators/index.ts" />
/// <reference path="./testing/index.ts" />
/// <reference path="./webSocket/index.ts" />
// tslint:enable: no-reference

/* Observable */
export { Observable } from './internal/Observable';
export { ConnectableObservable } from './internal/observable/ConnectableObservable';
Expand Down

0 comments on commit f43c728

Please sign in to comment.