Skip to content

Commit

Permalink
fix: VS code will now properly import operators, et al
Browse files Browse the repository at this point in the history
- Adds typesVersions, enforcing TypeScript >= 4.2.
- Adds some superfluous imports 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 28, 2021
1 parent a7c2d29 commit 057aaf5
Show file tree
Hide file tree
Showing 2 changed files with 22 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
16 changes: 16 additions & 0 deletions src/index.ts
@@ -1,3 +1,19 @@
//////////////////////////////////////////////////////////
// Here we need to import 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-submodule-imports
// tslint:disable: no-implicit-dependencies
import './ajax';
import './fetch';
import './operators';
import './testing';
import './webSocket';
// tslint:enable: no-submodule-imports
// tslint:enable: no-implicit-dependencies

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

0 comments on commit 057aaf5

Please sign in to comment.