From 613152998d1e3067f85dd8451826313444b77518 Mon Sep 17 00:00:00 2001 From: Jason Aden Date: Tue, 13 Mar 2018 18:40:11 -0700 Subject: [PATCH] chore(compat): adjust compatibility imports so ESM resolution will work --- compat/AsyncSubject.ts | 2 +- compat/InnerSubscriber.ts | 2 +- compat/Operator.ts | 2 +- compat/OuterSubscriber.ts | 2 +- compat/Rx.ts | 4 +- compat/Scheduler.ts | 2 +- compat/SubjectSubscription.ts | 2 +- compat/Subscriber.ts | 2 +- compat/add/observable/dom/ajax.ts | 2 +- compat/add/observable/fromPromise.ts | 6 +- compat/add/observable/never.ts | 3 +- compat/operators/combineLatest.ts | 4 +- compat/symbol/iterator.ts | 2 +- compat/symbol/observable.ts | 2 +- compat/symbol/rxSubscriber.ts | 2 +- src/internal-compatibility/index.ts | 222 ++++++++++++++------------- tsconfig.json | 7 +- 17 files changed, 141 insertions(+), 127 deletions(-) diff --git a/compat/AsyncSubject.ts b/compat/AsyncSubject.ts index 16413b0048..656ff9380c 100644 --- a/compat/AsyncSubject.ts +++ b/compat/AsyncSubject.ts @@ -1 +1 @@ -export {AsyncSubject} from 'rxjs/internal/AsyncSubject'; +export {AsyncSubject} from 'rxjs'; diff --git a/compat/InnerSubscriber.ts b/compat/InnerSubscriber.ts index 167d60f2ed..c37cb18933 100644 --- a/compat/InnerSubscriber.ts +++ b/compat/InnerSubscriber.ts @@ -1 +1 @@ -export {InnerSubscriber} from 'rxjs/internal/InnerSubscriber'; +export {InnerSubscriber} from 'rxjs/internal-compatibility'; diff --git a/compat/Operator.ts b/compat/Operator.ts index 462381152b..e8c7e3f976 100644 --- a/compat/Operator.ts +++ b/compat/Operator.ts @@ -1 +1 @@ -export {Operator} from 'rxjs/internal/Operator'; +export {Operator} from 'rxjs'; diff --git a/compat/OuterSubscriber.ts b/compat/OuterSubscriber.ts index a2be341392..40bb3564ae 100644 --- a/compat/OuterSubscriber.ts +++ b/compat/OuterSubscriber.ts @@ -1 +1 @@ -export {OuterSubscriber} from 'rxjs/internal/OuterSubscriber'; +export {OuterSubscriber} from 'rxjs/internal-compatibility'; diff --git a/compat/Rx.ts b/compat/Rx.ts index 6ab3b0a807..867e18f454 100644 --- a/compat/Rx.ts +++ b/compat/Rx.ts @@ -162,9 +162,7 @@ export { AjaxRequest, AjaxResponse, AjaxError, AjaxTimeoutError } from 'rxjs/aja import { asapScheduler, asyncScheduler, queueScheduler, animationFrameScheduler, SchedulerLike } from 'rxjs'; -import { rxSubscriber } from 'rxjs/internal/symbol/rxSubscriber'; -import { iterator } from 'rxjs/internal/symbol/iterator'; -import { observable } from 'rxjs/internal/symbol/observable'; +import { iterator, observable, rxSubscriber } from 'rxjs/internal-compatibility'; import * as _operators from 'rxjs/operators'; diff --git a/compat/Scheduler.ts b/compat/Scheduler.ts index 3fa8068b2c..80bce9b83f 100644 --- a/compat/Scheduler.ts +++ b/compat/Scheduler.ts @@ -1 +1 @@ -export {Scheduler} from 'rxjs/internal/Scheduler'; +export {Scheduler} from 'rxjs/internal-compatibility'; diff --git a/compat/SubjectSubscription.ts b/compat/SubjectSubscription.ts index 1897a0945c..00766b6957 100644 --- a/compat/SubjectSubscription.ts +++ b/compat/SubjectSubscription.ts @@ -1 +1 @@ -export {SubjectSubscription} from 'rxjs/internal/SubjectSubscription'; +export {SubjectSubscription} from 'rxjs/internal-compatibility'; diff --git a/compat/Subscriber.ts b/compat/Subscriber.ts index 48e2fae6fe..c48f65160c 100644 --- a/compat/Subscriber.ts +++ b/compat/Subscriber.ts @@ -1 +1 @@ -export {Subscriber} from 'rxjs/internal/Subscriber'; +export {Subscriber} from 'rxjs/internal-compatibility'; diff --git a/compat/add/observable/dom/ajax.ts b/compat/add/observable/dom/ajax.ts index 15f4114fc9..e7f4ef6f6a 100644 --- a/compat/add/observable/dom/ajax.ts +++ b/compat/add/observable/dom/ajax.ts @@ -1,6 +1,6 @@ import { Observable } from 'rxjs'; import { ajax as staticAjax } from 'rxjs/ajax'; -import { AjaxCreationMethod } from 'rxjs/internal/observable/dom/AjaxObservable'; +import { AjaxCreationMethod } from 'rxjs/internal-compatibility'; Observable.ajax = staticAjax; diff --git a/compat/add/observable/fromPromise.ts b/compat/add/observable/fromPromise.ts index 2b705dd379..2ce2b0bab5 100644 --- a/compat/add/observable/fromPromise.ts +++ b/compat/add/observable/fromPromise.ts @@ -1,7 +1,7 @@ -import { Observable } from 'rxjs'; -import { fromPromise as staticFromPromise } from 'rxjs/internal/observable/fromPromise'; +import { Observable, from } from 'rxjs'; +import { fromPromise as staticFromPromise } from 'rxjs/internal-compatibility'; -(Observable as any).fromPromise = staticFromPromise; +(Observable as any).fromPromise = from; declare module 'rxjs/internal/Observable' { namespace Observable { diff --git a/compat/add/observable/never.ts b/compat/add/observable/never.ts index 3b32889941..6021aa279d 100644 --- a/compat/add/observable/never.ts +++ b/compat/add/observable/never.ts @@ -1,5 +1,4 @@ -import { Observable, interval } from 'rxjs'; -import { NEVER } from 'rxjs/internal/observable/never'; +import { Observable, interval, NEVER } from 'rxjs'; export function staticNever() { return NEVER; diff --git a/compat/operators/combineLatest.ts b/compat/operators/combineLatest.ts index 198fcf09f2..023f201d11 100644 --- a/compat/operators/combineLatest.ts +++ b/compat/operators/combineLatest.ts @@ -1,8 +1,6 @@ -import { isArray } from 'rxjs/internal/util/isArray'; -import { subscribeToResult } from 'rxjs/internal/util/subscribeToResult'; +import { isArray, CombineLatestOperator } from 'rxjs/internal-compatibility'; import { Observable, ObservableInput, Operator, OperatorFunction, from } from 'rxjs'; -import { CombineLatestOperator } from 'rxjs/internal/observable/combineLatest'; const none = {}; diff --git a/compat/symbol/iterator.ts b/compat/symbol/iterator.ts index d13717b3ea..37c5253b18 100644 --- a/compat/symbol/iterator.ts +++ b/compat/symbol/iterator.ts @@ -1 +1 @@ -export * from 'rxjs/internal/symbol/iterator'; +export {iterator} from 'rxjs/internal-compatibility'; diff --git a/compat/symbol/observable.ts b/compat/symbol/observable.ts index 1797979dc1..b3aeae9f8a 100644 --- a/compat/symbol/observable.ts +++ b/compat/symbol/observable.ts @@ -1 +1 @@ -export * from 'rxjs/internal/symbol/observable'; +export {observable} from 'rxjs/internal-compatibility'; diff --git a/compat/symbol/rxSubscriber.ts b/compat/symbol/rxSubscriber.ts index 98a66a01dd..0ea3230780 100644 --- a/compat/symbol/rxSubscriber.ts +++ b/compat/symbol/rxSubscriber.ts @@ -1 +1 @@ -export * from 'rxjs/internal/symbol/rxSubscriber'; +export {rxSubscriber} from 'rxjs/internal-compatibility'; diff --git a/src/internal-compatibility/index.ts b/src/internal-compatibility/index.ts index 69a0950376..2b9ac59a38 100644 --- a/src/internal-compatibility/index.ts +++ b/src/internal-compatibility/index.ts @@ -1,105 +1,119 @@ -export {audit} from '../internal/patching/operator/audit'; -export {auditTime} from '../internal/patching/operator/auditTime'; -export {buffer} from '../internal/patching/operator/buffer'; -export {bufferCount} from '../internal/patching/operator/bufferCount'; -export {bufferTime} from '../internal/patching/operator/bufferTime'; -export {bufferToggle} from '../internal/patching/operator/bufferToggle'; -export {bufferWhen} from '../internal/patching/operator/bufferWhen'; -export {_catch} from '../internal/patching/operator/catch'; -export {combineAll} from '../internal/patching/operator/combineAll'; -export {combineLatest} from '../internal/patching/operator/combineLatest'; -export {concat} from '../internal/patching/operator/concat'; -export {concatAll} from '../internal/patching/operator/concatAll'; -export {concatMap} from '../internal/patching/operator/concatMap'; -export {concatMapTo} from '../internal/patching/operator/concatMapTo'; -export {count} from '../internal/patching/operator/count'; -export {debounce} from '../internal/patching/operator/debounce'; -export {debounceTime} from '../internal/patching/operator/debounceTime'; -export {defaultIfEmpty} from '../internal/patching/operator/defaultIfEmpty'; -export {delay} from '../internal/patching/operator/delay'; -export {delayWhen} from '../internal/patching/operator/delayWhen'; -export {dematerialize} from '../internal/patching/operator/dematerialize'; -export {distinct} from '../internal/patching/operator/distinct'; -export {distinctUntilChanged} from '../internal/patching/operator/distinctUntilChanged'; -export {distinctUntilKeyChanged} from '../internal/patching/operator/distinctUntilKeyChanged'; -export {_do} from '../internal/patching/operator/do'; -export {elementAt} from '../internal/patching/operator/elementAt'; -export {every} from '../internal/patching/operator/every'; -export {exhaust} from '../internal/patching/operator/exhaust'; -export {exhaustMap} from '../internal/patching/operator/exhaustMap'; -export {expand} from '../internal/patching/operator/expand'; -export {filter} from '../internal/patching/operator/filter'; -export {_finally} from '../internal/patching/operator/finally'; -export {find} from '../internal/patching/operator/find'; -export {findIndex} from '../internal/patching/operator/findIndex'; -export {first} from '../internal/patching/operator/first'; -export {groupBy} from '../internal/patching/operator/groupBy'; -export {ignoreElements} from '../internal/patching/operator/ignoreElements'; -export {isEmpty} from '../internal/patching/operator/isEmpty'; -export {last} from '../internal/patching/operator/last'; -export {letProto} from '../internal/patching/operator/let'; -export {map} from '../internal/patching/operator/map'; -export {mapTo} from '../internal/patching/operator/mapTo'; -export {materialize} from '../internal/patching/operator/materialize'; -export {max} from '../internal/patching/operator/max'; -export {merge} from '../internal/patching/operator/merge'; -export {mergeAll} from '../internal/patching/operator/mergeAll'; -export {mergeMap} from '../internal/patching/operator/mergeMap'; -export {mergeMapTo} from '../internal/patching/operator/mergeMapTo'; -export {mergeScan} from '../internal/patching/operator/mergeScan'; -export {min} from '../internal/patching/operator/min'; -export {multicast} from '../internal/patching/operator/multicast'; -export {observeOn} from '../internal/patching/operator/observeOn'; -export {onErrorResumeNext} from '../internal/patching/operator/onErrorResumeNext'; -export {pairwise} from '../internal/patching/operator/pairwise'; -export {partition} from '../internal/patching/operator/partition'; -export {pluck} from '../internal/patching/operator/pluck'; -export {publish} from '../internal/patching/operator/publish'; -export {publishBehavior} from '../internal/patching/operator/publishBehavior'; -export {publishLast} from '../internal/patching/operator/publishLast'; -export {publishReplay} from '../internal/patching/operator/publishReplay'; -export {race} from '../internal/patching/operator/race'; -export {reduce} from '../internal/patching/operator/reduce'; -export {repeat} from '../internal/patching/operator/repeat'; -export {repeatWhen} from '../internal/patching/operator/repeatWhen'; -export {retry} from '../internal/patching/operator/retry'; -export {retryWhen} from '../internal/patching/operator/retryWhen'; -export {sample} from '../internal/patching/operator/sample'; -export {sampleTime} from '../internal/patching/operator/sampleTime'; -export {scan} from '../internal/patching/operator/scan'; -export {sequenceEqual} from '../internal/patching/operator/sequenceEqual'; -export {share} from '../internal/patching/operator/share'; -export {shareReplay} from '../internal/patching/operator/shareReplay'; -export {single} from '../internal/patching/operator/single'; -export {skip} from '../internal/patching/operator/skip'; -export {skipLast} from '../internal/patching/operator/skipLast'; -export {skipUntil} from '../internal/patching/operator/skipUntil'; -export {skipWhile} from '../internal/patching/operator/skipWhile'; -export {startWith} from '../internal/patching/operator/startWith'; -export {subscribeOn} from '../internal/patching/operator/subscribeOn'; -export {_switch} from '../internal/patching/operator/switch'; -export {switchMap} from '../internal/patching/operator/switchMap'; -export {switchMapTo} from '../internal/patching/operator/switchMapTo'; -export {take} from '../internal/patching/operator/take'; -export {takeLast} from '../internal/patching/operator/takeLast'; -export {takeUntil} from '../internal/patching/operator/takeUntil'; -export {takeWhile} from '../internal/patching/operator/takeWhile'; -export {throttle} from '../internal/patching/operator/throttle'; -export {throttleTime} from '../internal/patching/operator/throttleTime'; -export {timeInterval} from '../internal/patching/operator/timeInterval'; -export {timeout} from '../internal/patching/operator/timeout'; -export {timeoutWith} from '../internal/patching/operator/timeoutWith'; -export {timestamp} from '../internal/patching/operator/timestamp'; -export {toArray} from '../internal/patching/operator/toArray'; -export {toPromise} from '../internal/patching/operator/toPromise'; -export {window} from '../internal/patching/operator/window'; -export {windowCount} from '../internal/patching/operator/windowCount'; -export {windowTime} from '../internal/patching/operator/windowTime'; -export {windowToggle} from '../internal/patching/operator/windowToggle'; -export {windowWhen} from '../internal/patching/operator/windowWhen'; -export {withLatestFrom} from '../internal/patching/operator/withLatestFrom'; -export {zipProto} from '../internal/patching/operator/zip'; -export {zipAll} from '../internal/patching/operator/zipAll'; +export { audit } from '../internal/patching/operator/audit'; +export { auditTime } from '../internal/patching/operator/auditTime'; +export { buffer } from '../internal/patching/operator/buffer'; +export { bufferCount } from '../internal/patching/operator/bufferCount'; +export { bufferTime } from '../internal/patching/operator/bufferTime'; +export { bufferToggle } from '../internal/patching/operator/bufferToggle'; +export { bufferWhen } from '../internal/patching/operator/bufferWhen'; +export { _catch } from '../internal/patching/operator/catch'; +export { combineAll } from '../internal/patching/operator/combineAll'; +export { combineLatest } from '../internal/patching/operator/combineLatest'; +export { concat } from '../internal/patching/operator/concat'; +export { concatAll } from '../internal/patching/operator/concatAll'; +export { concatMap } from '../internal/patching/operator/concatMap'; +export { concatMapTo } from '../internal/patching/operator/concatMapTo'; +export { count } from '../internal/patching/operator/count'; +export { debounce } from '../internal/patching/operator/debounce'; +export { debounceTime } from '../internal/patching/operator/debounceTime'; +export { defaultIfEmpty } from '../internal/patching/operator/defaultIfEmpty'; +export { delay } from '../internal/patching/operator/delay'; +export { delayWhen } from '../internal/patching/operator/delayWhen'; +export { dematerialize } from '../internal/patching/operator/dematerialize'; +export { distinct } from '../internal/patching/operator/distinct'; +export { distinctUntilChanged } from '../internal/patching/operator/distinctUntilChanged'; +export { distinctUntilKeyChanged } from '../internal/patching/operator/distinctUntilKeyChanged'; +export { _do } from '../internal/patching/operator/do'; +export { elementAt } from '../internal/patching/operator/elementAt'; +export { every } from '../internal/patching/operator/every'; +export { exhaust } from '../internal/patching/operator/exhaust'; +export { exhaustMap } from '../internal/patching/operator/exhaustMap'; +export { expand } from '../internal/patching/operator/expand'; +export { filter } from '../internal/patching/operator/filter'; +export { _finally } from '../internal/patching/operator/finally'; +export { find } from '../internal/patching/operator/find'; +export { findIndex } from '../internal/patching/operator/findIndex'; +export { first } from '../internal/patching/operator/first'; +export { groupBy } from '../internal/patching/operator/groupBy'; +export { ignoreElements } from '../internal/patching/operator/ignoreElements'; +export { isEmpty } from '../internal/patching/operator/isEmpty'; +export { last } from '../internal/patching/operator/last'; +export { letProto } from '../internal/patching/operator/let'; +export { map } from '../internal/patching/operator/map'; +export { mapTo } from '../internal/patching/operator/mapTo'; +export { materialize } from '../internal/patching/operator/materialize'; +export { max } from '../internal/patching/operator/max'; +export { merge } from '../internal/patching/operator/merge'; +export { mergeAll } from '../internal/patching/operator/mergeAll'; +export { mergeMap } from '../internal/patching/operator/mergeMap'; +export { mergeMapTo } from '../internal/patching/operator/mergeMapTo'; +export { mergeScan } from '../internal/patching/operator/mergeScan'; +export { min } from '../internal/patching/operator/min'; +export { multicast } from '../internal/patching/operator/multicast'; +export { observeOn } from '../internal/patching/operator/observeOn'; +export { onErrorResumeNext } from '../internal/patching/operator/onErrorResumeNext'; +export { pairwise } from '../internal/patching/operator/pairwise'; +export { partition } from '../internal/patching/operator/partition'; +export { pluck } from '../internal/patching/operator/pluck'; +export { publish } from '../internal/patching/operator/publish'; +export { publishBehavior } from '../internal/patching/operator/publishBehavior'; +export { publishLast } from '../internal/patching/operator/publishLast'; +export { publishReplay } from '../internal/patching/operator/publishReplay'; +export { race } from '../internal/patching/operator/race'; +export { reduce } from '../internal/patching/operator/reduce'; +export { repeat } from '../internal/patching/operator/repeat'; +export { repeatWhen } from '../internal/patching/operator/repeatWhen'; +export { retry } from '../internal/patching/operator/retry'; +export { retryWhen } from '../internal/patching/operator/retryWhen'; +export { sample } from '../internal/patching/operator/sample'; +export { sampleTime } from '../internal/patching/operator/sampleTime'; +export { scan } from '../internal/patching/operator/scan'; +export { sequenceEqual } from '../internal/patching/operator/sequenceEqual'; +export { share } from '../internal/patching/operator/share'; +export { shareReplay } from '../internal/patching/operator/shareReplay'; +export { single } from '../internal/patching/operator/single'; +export { skip } from '../internal/patching/operator/skip'; +export { skipLast } from '../internal/patching/operator/skipLast'; +export { skipUntil } from '../internal/patching/operator/skipUntil'; +export { skipWhile } from '../internal/patching/operator/skipWhile'; +export { startWith } from '../internal/patching/operator/startWith'; +export { subscribeOn } from '../internal/patching/operator/subscribeOn'; +export { _switch } from '../internal/patching/operator/switch'; +export { switchMap } from '../internal/patching/operator/switchMap'; +export { switchMapTo } from '../internal/patching/operator/switchMapTo'; +export { take } from '../internal/patching/operator/take'; +export { takeLast } from '../internal/patching/operator/takeLast'; +export { takeUntil } from '../internal/patching/operator/takeUntil'; +export { takeWhile } from '../internal/patching/operator/takeWhile'; +export { throttle } from '../internal/patching/operator/throttle'; +export { throttleTime } from '../internal/patching/operator/throttleTime'; +export { timeInterval } from '../internal/patching/operator/timeInterval'; +export { timeout } from '../internal/patching/operator/timeout'; +export { timeoutWith } from '../internal/patching/operator/timeoutWith'; +export { timestamp } from '../internal/patching/operator/timestamp'; +export { toArray } from '../internal/patching/operator/toArray'; +export { toPromise } from '../internal/patching/operator/toPromise'; +export { window } from '../internal/patching/operator/window'; +export { windowCount } from '../internal/patching/operator/windowCount'; +export { windowTime } from '../internal/patching/operator/windowTime'; +export { windowToggle } from '../internal/patching/operator/windowToggle'; +export { windowWhen } from '../internal/patching/operator/windowWhen'; +export { withLatestFrom } from '../internal/patching/operator/withLatestFrom'; +export { zipProto } from '../internal/patching/operator/zip'; +export { zipAll } from '../internal/patching/operator/zipAll'; -export {isArray} from '../internal/util/isArray'; -export {subscribeToResult} from '../internal/util/subscribeToResult'; \ No newline at end of file +export { InnerSubscriber } from '../internal/InnerSubscriber'; +export { OuterSubscriber } from '../internal/OuterSubscriber'; +export { Scheduler } from '../internal/Scheduler'; +export { SubjectSubscription } from '../internal/SubjectSubscription'; +export { Subscriber } from '../internal/Subscriber'; + +export { fromPromise } from '../internal/observable/fromPromise'; +export { AjaxCreationMethod } from '../internal/observable/dom/AjaxObservable'; +export { CombineLatestOperator } from '../internal/observable/combineLatest'; + +export { rxSubscriber } from '../internal/symbol/rxSubscriber'; +export { iterator } from '../internal/symbol/iterator'; +export { observable } from '../internal/symbol/observable'; + +export { isArray } from '../internal/util/isArray'; +export { subscribeToResult } from '../internal/util/subscribeToResult'; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 4e6ae2df60..24a6ab0c34 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,8 +6,13 @@ "rxjs": ["./src/index"], "rxjs/*": ["./src/*"], "rxjs/internal-compatibility": ["./src/internal-compatibility/index"], + "rxjs/ajax": ["./src/ajax/index"], + "rxjs/operators": ["./src/operators/index"], + "rxjs/testing": ["./src/testing/index"], + "rxjs/websocket": ["./src/websocket/index"], "rxjs-compat": ["./compat/index"], "rxjs-compat/*": ["./compat/*"] } - } + }, + "exclude": ["./dist", "./dist-compat"] } \ No newline at end of file