Skip to content

Commit

Permalink
fix: correct internal module paths to be systemjs compatible (#3412)
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMinar authored and benlesh committed Mar 8, 2018
1 parent 027d7a6 commit 35abc9d
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 18 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ install:
script:
- if [ "$FULL_VALIDATE" == "true" ] && [ -n "DANGER_GITHUB_API_TOKEN" ]; then echo {} > ./.babelrc && npx danger; fi
- npm test
- npm run test:systemjs

after_success:
- if [ "$FULL_VALIDATE" == "true" ]; then npm run test:cover && npx nyc report --reporter=text-lcov | npx coveralls; fi
Expand Down
21 changes: 21 additions & 0 deletions integration/systemjs/systemjs-compatibility-spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var System = require('systemjs');
var path = require('path');

System.config({
map: { 'rxjs': path.join(__dirname, '..', '..', 'dist', 'cjs', '/') },
packages: { 'rxjs': {main: 'index.js', defaultExtension: 'js' }}
});

Promise.all([
System.import('rxjs'),
System.import('rxjs/ajax'),
System.import('rxjs/operators'),
System.import('rxjs/testing'),
System.import('rxjs/websocket'),
]).then(
function () { console.log('Successfully tested all entry-points with SystemJS!'); },
function () {
console.error('\n\nFailed to load an entry-points via SystemJS: \n\n', error.message);
process.exit(-1);
}
);
12 changes: 12 additions & 0 deletions integration/systemjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "classic",
"target": "es2015",
"outDir": "../../dist/integration/",
"rootDir": "."
},
"exclude": [
"node_modules"
]
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"test": "cross-env TS_NODE_FAST=true mocha --compilers ts:ts-node/register --opts spec/support/coverage.opts \"spec/**/*-spec.ts\"",
"test:cover": "cross-env TS_NODE_FAST=true nyc npm test",
"test:circular": "dependency-cruise --validate .dependency-cruiser.json -x \"^node_modules\" src",
"test:systemjs": "node integration/systemjs/systemjs-compatibility-spec.js",
"tests2png": "mkdirp tmp/docs/img && cross-env TS_NODE_FAST=true mocha --compilers ts:ts-node/register --opts spec/support/tests2png.opts \"spec/**/*-spec.ts\"",
"watch": "watch \"echo triggering build && npm run test && echo build completed\" src -d -u -w=15"
},
Expand Down Expand Up @@ -223,6 +224,7 @@
"sinon-chai": "2.14.0",
"source-map-support": "0.5.3",
"symbol-observable": "1.0.1",
"systemjs": "^0.21.0",
"ts-node": "4.1.0",
"tslib": "1.5.0",
"tslint": "5.9.1",
Expand Down
7 changes: 0 additions & 7 deletions spec/systemjs-compatibility-spec.ts

This file was deleted.

6 changes: 3 additions & 3 deletions src/internal/observable/dom/AjaxObservable.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { root } from '../..//util/root';
import { tryCatch } from '../..//util/tryCatch';
import { errorObject } from '../..//util/errorObject';
import { root } from '../../util/root';
import { tryCatch } from '../../util/tryCatch';
import { errorObject } from '../../util/errorObject';
import { Observable } from '../../Observable';
import { Subscriber } from '../../Subscriber';
import { TeardownLogic } from '../../types';
Expand Down
4 changes: 2 additions & 2 deletions src/internal/observable/dom/WebSocketSubject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { Subscription } from '../../Subscription';
import { Operator } from '../../Operator';
import { ReplaySubject } from '../../ReplaySubject';
import { Observer, NextObserver } from '../../types';
import { tryCatch } from '../..//util/tryCatch';
import { errorObject } from '../..//util/errorObject';
import { tryCatch } from '../../util/tryCatch';
import { errorObject } from '../../util/errorObject';

export interface WebSocketSubjectConfig {
url: string;
Expand Down
2 changes: 1 addition & 1 deletion src/internal/operators/first.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Observable } from '../Observable';
import { Operator } from '../Operator';
import { Subscriber } from '../Subscriber';
import { EmptyError } from '..//util/EmptyError';
import { EmptyError } from '../util/EmptyError';
import { MonoTypeOperatorFunction } from '../../internal/types';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/internal/operators/last.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Observable } from '../Observable';
import { Operator } from '../Operator';
import { Subscriber } from '../Subscriber';
import { EmptyError } from '..//util/EmptyError';
import { EmptyError } from '../util/EmptyError';
import { MonoTypeOperatorFunction } from '../../internal/types';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/internal/patching/operator/bufferTime.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SchedulerLike } from '../../types';
import { async } from '../../scheduler/async';
import { Observable } from '../../Observable';
import { isScheduler } from '../..//util/isScheduler';
import { isScheduler } from '../../util/isScheduler';
import { bufferTime as higherOrder } from '../../operators/bufferTime';

/* tslint:disable:max-line-length */
Expand Down
2 changes: 1 addition & 1 deletion src/internal/patching/operator/combineLatest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Observable } from '../../Observable';
import { ObservableInput } from '../../types';
import { CombineLatestOperator } from '../../observable/combineLatest';
import { of } from '../../observable/of';
import { isArray } from '../..//util/isArray';
import { isArray } from '../../util/isArray';

/* tslint:disable:max-line-length */
export function combineLatest<T, R>(this: Observable<T>, project: (v1: T) => R): Observable<R>;
Expand Down
4 changes: 2 additions & 2 deletions src/internal/patching/operator/windowTime.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { SchedulerLike } from '../../types';
import { async } from '../../scheduler/async';
import { Observable } from '../../Observable';
import { isNumeric } from '../..//util/isNumeric';
import { isScheduler } from '../..//util/isScheduler';
import { isNumeric } from '../../util/isNumeric';
import { isScheduler } from '../../util/isScheduler';
import { windowTime as higherOrder } from '../../operators/windowTime';

/**
Expand Down

0 comments on commit 35abc9d

Please sign in to comment.