Skip to content

Commit 35abc9d

Browse files
IgorMinarbenlesh
authored andcommitted
fix: correct internal module paths to be systemjs compatible (#3412)
1 parent 027d7a6 commit 35abc9d

File tree

12 files changed

+47
-18
lines changed

12 files changed

+47
-18
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ install:
3232
script:
3333
- if [ "$FULL_VALIDATE" == "true" ] && [ -n "DANGER_GITHUB_API_TOKEN" ]; then echo {} > ./.babelrc && npx danger; fi
3434
- npm test
35+
- npm run test:systemjs
3536

3637
after_success:
3738
- if [ "$FULL_VALIDATE" == "true" ]; then npm run test:cover && npx nyc report --reporter=text-lcov | npx coveralls; fi
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
var System = require('systemjs');
2+
var path = require('path');
3+
4+
System.config({
5+
map: { 'rxjs': path.join(__dirname, '..', '..', 'dist', 'cjs', '/') },
6+
packages: { 'rxjs': {main: 'index.js', defaultExtension: 'js' }}
7+
});
8+
9+
Promise.all([
10+
System.import('rxjs'),
11+
System.import('rxjs/ajax'),
12+
System.import('rxjs/operators'),
13+
System.import('rxjs/testing'),
14+
System.import('rxjs/websocket'),
15+
]).then(
16+
function () { console.log('Successfully tested all entry-points with SystemJS!'); },
17+
function () {
18+
console.error('\n\nFailed to load an entry-points via SystemJS: \n\n', error.message);
19+
process.exit(-1);
20+
}
21+
);

integration/systemjs/tsconfig.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"moduleResolution": "classic",
5+
"target": "es2015",
6+
"outDir": "../../dist/integration/",
7+
"rootDir": "."
8+
},
9+
"exclude": [
10+
"node_modules"
11+
]
12+
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
"test": "cross-env TS_NODE_FAST=true mocha --compilers ts:ts-node/register --opts spec/support/coverage.opts \"spec/**/*-spec.ts\"",
116116
"test:cover": "cross-env TS_NODE_FAST=true nyc npm test",
117117
"test:circular": "dependency-cruise --validate .dependency-cruiser.json -x \"^node_modules\" src",
118+
"test:systemjs": "node integration/systemjs/systemjs-compatibility-spec.js",
118119
"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\"",
119120
"watch": "watch \"echo triggering build && npm run test && echo build completed\" src -d -u -w=15"
120121
},
@@ -223,6 +224,7 @@
223224
"sinon-chai": "2.14.0",
224225
"source-map-support": "0.5.3",
225226
"symbol-observable": "1.0.1",
227+
"systemjs": "^0.21.0",
226228
"ts-node": "4.1.0",
227229
"tslib": "1.5.0",
228230
"tslint": "5.9.1",

spec/systemjs-compatibility-spec.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/internal/observable/dom/AjaxObservable.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { root } from '../..//util/root';
2-
import { tryCatch } from '../..//util/tryCatch';
3-
import { errorObject } from '../..//util/errorObject';
1+
import { root } from '../../util/root';
2+
import { tryCatch } from '../../util/tryCatch';
3+
import { errorObject } from '../../util/errorObject';
44
import { Observable } from '../../Observable';
55
import { Subscriber } from '../../Subscriber';
66
import { TeardownLogic } from '../../types';

src/internal/observable/dom/WebSocketSubject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { Subscription } from '../../Subscription';
55
import { Operator } from '../../Operator';
66
import { ReplaySubject } from '../../ReplaySubject';
77
import { Observer, NextObserver } from '../../types';
8-
import { tryCatch } from '../..//util/tryCatch';
9-
import { errorObject } from '../..//util/errorObject';
8+
import { tryCatch } from '../../util/tryCatch';
9+
import { errorObject } from '../../util/errorObject';
1010

1111
export interface WebSocketSubjectConfig {
1212
url: string;

src/internal/operators/first.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Observable } from '../Observable';
22
import { Operator } from '../Operator';
33
import { Subscriber } from '../Subscriber';
4-
import { EmptyError } from '..//util/EmptyError';
4+
import { EmptyError } from '../util/EmptyError';
55
import { MonoTypeOperatorFunction } from '../../internal/types';
66

77
/**

src/internal/operators/last.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Observable } from '../Observable';
22
import { Operator } from '../Operator';
33
import { Subscriber } from '../Subscriber';
4-
import { EmptyError } from '..//util/EmptyError';
4+
import { EmptyError } from '../util/EmptyError';
55
import { MonoTypeOperatorFunction } from '../../internal/types';
66

77
/**

src/internal/patching/operator/bufferTime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SchedulerLike } from '../../types';
22
import { async } from '../../scheduler/async';
33
import { Observable } from '../../Observable';
4-
import { isScheduler } from '../..//util/isScheduler';
4+
import { isScheduler } from '../../util/isScheduler';
55
import { bufferTime as higherOrder } from '../../operators/bufferTime';
66

77
/* tslint:disable:max-line-length */

0 commit comments

Comments
 (0)