Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: make shelljs a devDependency instead of a dependency #8608

Merged
merged 1 commit into from May 17, 2017

Conversation

not-an-aardvark
Copy link
Member

@not-an-aardvark not-an-aardvark commented May 16, 2017

What is the purpose of this pull request? (put an "X" next to item)

[x] Other, please explain:

What changes did you make? (Give an overview)

The shelljs module is quite large, and we only use it for a few simple operations that can easily be replaced with standard library functions. This commit makes shelljs a devDependency instead.

Is there anything you'd like reviewers to focus on?

Our tests for npm-util are not very thorough -- they use method stubs and don't verify whether a command was actually executed successfully. We should probably make them sturdier in the future.

Can someone that uses Windows double-check that the npm install command works when using eslint --init and selecting a popular styleguide? I've tested it on macOS, but I want to make sure it works on Windows as well, since I know there are some child_process quirks between platforms.

@not-an-aardvark not-an-aardvark added the chore This change is not user-facing label May 16, 2017
@@ -53,7 +53,7 @@ function installSyncSaveDev(packages) {
if (Array.isArray(packages)) {
packages = packages.join(" ");
}
shell.exec(`npm i --save-dev ${packages}`, { stdio: "inherit" });
childProcess.execSync(`npm i --save-dev ${packages}`, { stdio: "inherit", encoding: "utf8" });
Copy link
Member

@soda0289 soda0289 May 16, 2017

Choose a reason for hiding this comment

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

Have you tested this on windows? Edit: I see you mentioned this the PR, sorry.
I always have trouble using childProcess.exec() on windows with node packages or batch file.

Copy link
Member

Choose a reason for hiding this comment

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

I tested it in Windows (cmd/ps) and Windows 10 Bash both work as expected.

It is childProccess.spawn() that has problems with running batch files but childProcess.exe() runs in a command prompt or shell that allows it to run normally.

Copy link
Member

@mysticatea mysticatea left a comment

Choose a reason for hiding this comment

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

I confirmed that the execSync works on Windows.
If my memory is correct, spawn npm does not works on Windows but exec is OK.

The shelljs module is quite large, and we only use it for a few simple operations that can easily be replaced with standard library functions. This commit makes shelljs a devDevDependency instead.
@eslintbot
Copy link

LGTM

@platinumazure
Copy link
Member

platinumazure commented May 16, 2017

Hoping to test this sometime tonight (US). Don't let me hold this up if we think it's ready for merge, though.

Edit: We've had a few folks test in Windows already, feel free to merge.

@not-an-aardvark not-an-aardvark merged commit d21f528 into master May 17, 2017
@not-an-aardvark not-an-aardvark deleted the remove-shelljs-dependency branch May 17, 2017 05:12
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion chore This change is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants