-
Notifications
You must be signed in to change notification settings - Fork 8
Transpile to ES6 #843
Transpile to ES6 #843
Conversation
|
run ci |
|
❤️ |
00e08ef to
3925c26
Compare
|
❤️ |
queue.ts
Outdated
|
|
||
| public constructor(private items: T[] = []) { | ||
| public constructor(private items?: T[]) { | ||
| items = items === undefined ? [] : items; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you this here?
| const pathToIstanbul = path.join(__dirname, "..", "node_modules", "istanbul", "lib", "cli.js"); | ||
| const pathToMocha = path.join(__dirname, "..", "node_modules", "mocha", "bin", "_mocha"); | ||
|
|
||
| const istanbulArgs = [ pathToIstanbul, "cover", pathToMocha ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the extra spaces after [ and before ]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel more comfortable this way 😃
test-scripts/istanbul.js
Outdated
|
|
||
| const args = nodeArgs.concat(istanbulArgs); | ||
|
|
||
| const nodeProcess = childProcess.spawn("node", args, { stdio: "inherit"}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add one more space after "inherit" please.
test-scripts/istanbul.js
Outdated
| const childProcess = require("child_process"); | ||
| const path = require("path"); | ||
| const pathToIstanbul = path.join(__dirname, "..", "node_modules", "istanbul", "lib", "cli.js"); | ||
| const pathToMocha = path.join(__dirname, "..", "node_modules", "mocha", "bin", "_mocha"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you extract the path to node_modules?
test-scripts/mocha.js
Outdated
|
|
||
| const args = nodeArgs.concat(pathToMocha); | ||
|
|
||
| const nodeProcess = childProcess.spawn("node", args, { stdio: "inherit"}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add one more space after "inherit" please.
Also this file does the same as test-scripts/istanbul.js. The only difference is args. I think it will be good to extract the common logic.
3925c26 to
3dbaee6
Compare
|
❤️ |
1 similar comment
|
❤️ |
7cc5373 to
4dc56d7
Compare
|
❤️ |
4dc56d7 to
3360bdc
Compare
|
❤️ |
1 similar comment
|
❤️ |
6637f22 to
7a50b1c
Compare
|
❤️ |
Add support for ES6 transpilation. Change dependency injection in order to match the `class` and `constructor` keywords. Update istanbul to latest version as its previous versions do not support ES6. Remove bluebird.d.ts as it conflicts with Promises from TypeScript's ES6 d.ts. Remove bluebird as dependency - we will use native Promises from now on. Add support for Node.js 4 and 5 - both versions have limited support for ES6 features, so in order to support them we have to: - pass --harmony flag to Node.js - do not use some features like default values of method arguments. - do not use spread operator - it's implementation in Node.js 4 is limited only to arrays. Even this implementation has issues. So use `.apply` instead of using spread operator. Remove all other usages of spread operator (for objects). Add tests scripts for istanbul and mocha, as they both will need the `--harmony` flag as well, so we cannot execute them directly with Node.js 4 and 5. Instead we'll execute a custom script, that will start a new node process. Fix running hooks We should be able resolve functions with $injector - this is required for hooks execution and generating help content. Get back the old unit tests that were testing this functionality. Move node-args to scripts dir
7a50b1c to
28d5fe1
Compare
|
❤️ |
Add support for ES6 transpilation. Change dependency injection in order to match the
classandconstructorkeywords.Update istanbul to latest version as its previous versions do not support ES6.
Remove bluebird.d.ts as it conflicts with Promises from TypeScript's ES6 d.ts.
Remove bluebird as dependency - we will use native Promises from now on.
Add support for Node.js 4 and 5 - both versions have limited support for ES6 features, so in order to support them we have to:
.applyinstead of using spread operator. Remove all other usages of spread operator (for objects).Add tests scripts for istanbul and mocha, as they both will need the
--harmonyflag as well, so we cannot execute them directly with Node.js 4 and 5. Instead we'll execute a custom script, that will start a new node process.