Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ script:
- npm run build_cover

after_script:
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
- cat ./coverage/coverage-remapped.lcov | ./node_modules/coveralls/bin/coveralls.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Travis doesn't seem to be running the check now... this line is suspect.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm looking those part now. On my forked branch this works, failed here, continuing investigation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it seems that remap-istanbul isn't writing a coverage-remapped.lcov file at all.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ The build and test structure is fairly primitive at the moment. There are variou
- build_test: builds ES6, then CommonJS, then runs the tests with `jasmine`
- build_perf: builds ES6, CommonJS, then global, then runs the performance tests with `protractor`
- build_docs: generates API documentation from `dist/es6` to `dist/docs`
- build_cover: runs `istanbul` code coverage against test cases
- test: runs tests with `jasmine`, must have built prior to running.

### Example
Expand All @@ -65,6 +66,7 @@ npm run build_all
## Performance Tests

Run `npm run build_perf` or `npm run perf` to run the performance tests with `protractor`.
Run `npm run perf_micro` to run micro performance test benchmarking operator.

## Adding documentation
RxNext uses [ESDoc](https://esdoc.org/) to generate API documentation. Refer to ESDoc's documentation for syntax. Run `npm run build_docs` to generate.
22 changes: 22 additions & 0 deletions lib/stage_sourcemap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var fs = require('fs-extra');
var glob = require('glob');
var jsonfile = require('jsonfile');
var transfer = require('multi-stage-sourcemap').transfer;

glob('dist/es6/**/*.js.map', null, function (er, files) {
files.forEach(function (file) {
var source = jsonfile.readFileSync(file);
var destFile = file.replace('es6', 'cjs');
var dest = jsonfile.readFileSync(destFile);

var transferred = transfer({ fromSourceMap: JSON.stringify(dest),
toSourceMap: JSON.stringify(source) });

fs.unlink(destFile);
jsonfile.writeFile(destFile, transferred, function (err) {
if (err) {
console.log(err);
}
});
});
});
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
"scripts": {
"build_all": "npm run build_es6 && npm run build_amd && npm run build_cjs && npm run build_global",
"build_amd": "rm -rf dist/amd && tsc typings/es6-shim/es6-shim.d.ts src/Rx.ts -m amd --outDir dist/amd --sourcemap --target ES5",
"build_cjs": "rm -rf dist/cjs && babel dist/es6 --out-dir dist/cjs --modules common --sourceMaps --loose all && node lib/copy_dts.js",
"build_es6": "rm -rf dist/es6 && tsc src/Rx.ts src/Rx.KitchenSink.ts --outDir dist/es6 --target ES6 -d",
"build_cjs": "rm -rf dist/cjs && babel dist/es6 --out-dir dist/cjs --modules common --source-maps --loose all && node lib/copy_dts.js",
"build_es6": "rm -rf dist/es6 && tsc src/Rx.ts src/Rx.KitchenSink.ts --outDir dist/es6 --sourceMap --target ES6 -d",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found cjs / es6 modules didn't have sourcemap until now..

"build_closure": "java -jar ./node_modules/google-closure-compiler/compiler.jar ./dist/global/Rx.js --create_source_map ./dist/global/Rx.min.js.map --js_output_file ./dist/global/Rx.min.js",
"build_global": "rm -rf dist/global && mkdir \"dist/global\" && browserify src/Rx.global.js --outfile dist/global/Rx.js && npm run build_closure",
"build_perf": "npm run build_es6 && npm run build_cjs && npm run build_global && webdriver-manager update && npm run perf",
"build_test": "rm -rf dist/ && npm run lint && npm run build_es6 && npm run build_cjs && jasmine",
"build_cover": "rm -rf dist/ && npm run lint && npm run build_es6 && npm run build_cjs && istanbul cover jasmine",
"build_cover": "rm -rf dist/ && npm run lint && npm run build_es6 && npm run build_cjs && npm run cover",
"build_docs": "./docgen.sh",
"lint_perf": "eslint perf/ --fix",
"lint_spec": "eslint spec/**/*.js --fix",
"lint_src": "tslint -c .tslintrc src/**/*.ts",
"lint": "npm run lint_src && npm run lint_spec && npm run lint_perf",
"cover": "istanbul cover jasmine",
"cover": "istanbul cover -x \"*-spec.js index.js *-helper.js\" jasmine && npm run cover_remapping",
"cover_remapping": "node lib/stage_sourcemap.js && remap-istanbul -i coverage/coverage.json -o coverage/coverage-remapped.json && remap-istanbul -i coverage/coverage.json -o coverage/coverage-remapped.lcov -t lcovonly && remap-istanbul -i coverage/coverage.json -o coverage/coverage-remapped -t html",
"test": "jasmine",
"watch": "watch \"echo triggering build && npm run build_test && echo build completed\" src -d -u -w=15",
"perf": "protractor protractor.conf.js",
Expand Down Expand Up @@ -82,10 +83,13 @@
"istanbul": "0.3.22",
"jasmine": "2.3.2",
"jasmine-core": "2.3.4",
"jsonfile": "2.2.2",
"lodash": "3.5.0",
"multi-stage-sourcemap": "0.2.1",
"platform": "1.3.0",
"promise": "7.0.3",
"protractor": "2.2.0",
"remap-istanbul": "0.3.1",
"rx": "latest",
"tslint": "2.5.0",
"typescript": "1.8.0-dev.20151017",
Expand Down
2 changes: 1 addition & 1 deletion src/testing/HotObservable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Subject from '../Subject';
import Subscriber from './Subscriber';
import Subscriber from '../Subscriber';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo correction - curious how tsc build was passed while module import path resolving fails.

import Subscription from '../Subscription';
import Scheduler from '../Scheduler';
import TestMessage from './TestMessage';
Expand Down