Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Conversation

@rosen-vladimirov
Copy link
Collaborator

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.

@rosen-vladimirov
Copy link
Collaborator Author

run ci

@justcodebuilduser
Copy link

❤️

@justcodebuilduser
Copy link

❤️

queue.ts Outdated

public constructor(private items: T[] = []) {
public constructor(private items?: T[]) {
items = items === undefined ? [] : items;
Copy link
Contributor

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 ];
Copy link
Contributor

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 ]?

Copy link
Collaborator Author

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 😃


const args = nodeArgs.concat(istanbulArgs);

const nodeProcess = childProcess.spawn("node", args, { stdio: "inherit"});
Copy link
Contributor

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.

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");
Copy link
Contributor

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?


const args = nodeArgs.concat(pathToMocha);

const nodeProcess = childProcess.spawn("node", args, { stdio: "inherit"});
Copy link
Contributor

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.

@justcodebuilduser
Copy link

❤️

1 similar comment
@justcodebuilduser
Copy link

❤️

@justcodebuilduser
Copy link

❤️

@justcodebuilduser
Copy link

❤️

1 similar comment
@justcodebuilduser
Copy link

❤️

@justcodebuilduser
Copy link

❤️

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
@justcodebuilduser
Copy link

❤️

@rosen-vladimirov rosen-vladimirov merged commit 3c03cc3 into master Dec 8, 2016
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/es6 branch December 8, 2016 09:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants