From f43c72815f9ebe5ee3a8ed11513be0f541c9517d Mon Sep 17 00:00:00 2001 From: Ben Lesh Date: Wed, 28 Apr 2021 20:04:07 -0500 Subject: [PATCH] fix: VS code will now properly import operators, et al (#6276) - 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 https://github.com/microsoft/TypeScript/issues/43034 --- package.json | 7 ++++++- src/index.ts | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 30c3aa0e46..92887aec89 100644 --- a/package.json +++ b/package.json @@ -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": { ".": { diff --git a/src/index.ts b/src/index.ts index 6afbc59fb7..d8bf89e9aa 100644 --- a/src/index.ts +++ b/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 +/// +/// +/// +/// +/// +// tslint:enable: no-reference + /* Observable */ export { Observable } from './internal/Observable'; export { ConnectableObservable } from './internal/observable/ConnectableObservable';