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

fix(ns-bundle): support for Node.js 9 #321

Merged
merged 1 commit into from
Nov 19, 2017
Merged

Conversation

rosen-vladimirov
Copy link
Contributor

When you have Node.js 9 installed, CLI prints a warning that support for this version is not verified. Our webpack plugin tries to get the version, but it receives the warning and decides the version is incorrect. So all scripts fail.
In order to resolve the issue, get all data send to the stdout of the spawned tns --version process and parse it.


childProcess.on("close", code => {
if (code) {
reject({
code,
message: `child process exited with code ${code}`,
});
} else {
const versionRegex = /^(?:\d+\.){2}\d+.*?$/m;
const matches = stdoutData.toString().match(versionRegex);
Copy link
Contributor

Choose a reason for hiding this comment

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

We have a dependency to 'semver'. We can use it instead if the regex.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea here is to get the version from the string. Output of tns --version is:

Support for Node.js 9.0.0 is not verified. This CLI might not install or run properly.

3.3.0

So the regex should find the 3.3.0 version from it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense 👍

Copy link
Contributor

@sis0k0 sis0k0 left a comment

Choose a reason for hiding this comment

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

Can you make the title follow these https://gist.github.com/stephenparish/9941e89d80e2bc58a153 coding convetions? Something like `fix(ns-bundle): support for NodeJS 9"

@rosen-vladimirov rosen-vladimirov changed the title Fix running webpack scripts with Node.js 9 fix(ns-bundle): support for Node.js 9 Nov 13, 2017
@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/fix-nodejs9-support branch from 8c9b70b to 3116e5d Compare November 13, 2017 09:06
@rosen-vladimirov
Copy link
Contributor Author

@sis0k0 I've updated the PR title and the commit message

When you have Node.js 9 installed, CLI prints a warning that support for this version is not verified. Our webpack plugin tries to get the version, but it receives the warning and decides the version is incorrect. So all scripts fail.
In order to resolve the issue, get all data send to the stdout of the spawned `tns --version` process and parse it.
@sis0k0 sis0k0 force-pushed the vladimirov/fix-nodejs9-support branch from 3116e5d to 17d52d2 Compare November 19, 2017 13:27
@sis0k0 sis0k0 merged commit b4800c8 into master Nov 19, 2017
@sis0k0 sis0k0 deleted the vladimirov/fix-nodejs9-support branch November 19, 2017 19:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants