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

Remove ShellJS copy and use the NPM version #5912

Merged
merged 2 commits into from
Apr 7, 2015

Conversation

timvandermeij
Copy link
Contributor

There is no need to have a copy of ShellJS in the repository as it is also available on NPM. The NPM version is also much newer. This way we do not have to update this anymore and let NPM do that automatically.

@@ -20,7 +20,7 @@

'use strict';

require('./external/shelljs/make');
require('shelljs/make');
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm wondering if it would be a good idea to enclose this in a try... catch block, e.g. something like this:

try {
  require('shelljs/make');
} catch (ex) {
  console.log('Run "npm install"'); // Probably needs a better message
  return;
}

When I tested the patch the first time, running any of the make commands just threw an error, and it took me a couple of seconds to realise that I needed to run npm install.
For less experienced users, it's not unlikely that they could get stuck on this, so a message telling them what to do seems like a good idea to me.

Edit: A somewhat fun fact is that if the above is implemented, I think that it would actually make PR #5908 obsolete :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Great catch, thanks for noticing this!

There is no need to have a copy of ShellJS in the repository as it is also available on NPM. The NPM version is also much newer. This way we do not have to update this anymore and let NPM do that automatically.
The previous commit implements a check for ShellJS and otherwise prompts the user to run "npm install". New clones of the codebase will need "npm install" for ShellJS and therefore automatically install jshint. Existing clones of the codebase will also need "npm install" again since ShellJS needs to be installed using NPM as it is not in the "external" folder anymore. Since everyone will get this prompt and install everything automatically, we will never reach this code path anymore.

This patch makes mozilla#5908 obsolete and reduces code complexity for the lint target. Thanks to @Snuffleupagus for noticing this!
@timvandermeij
Copy link
Contributor Author

/botio preview

@pdfjsbot
Copy link

pdfjsbot commented Apr 5, 2015

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/2f5c55fff8ff874/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 5, 2015

From: Bot.io (Windows)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.22.172.223:8877/fc11619ae44cdb7/output.txt

@Snuffleupagus
Copy link
Collaborator

This does look perfectly fine to me, and it'd be great to be able to get rid of all this code from the repo!
However before merging this, I want to check with Brendan/Yury on IRC, to make sure that there are not any weird dependencies in edge cases (I'm mostly concerned about the bots).

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Apr 5, 2015

From: Bot.io (Linux)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.21.233.14:8877/c20f1463f1e9d36/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 5, 2015

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.22.172.223:8877/dcb77ac0c4192fe/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 5, 2015

From: Bot.io (Windows)


Failed

Full output at http://107.22.172.223:8877/dcb77ac0c4192fe/output.txt

Total script time: 2.97 mins

  • Font tests: FAILED
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://107.22.172.223:8877/dcb77ac0c4192fe/reftest-analyzer.html#web=eq.log

@pdfjsbot
Copy link

pdfjsbot commented Apr 5, 2015

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/c20f1463f1e9d36/output.txt

Total script time: 22.98 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

Snuffleupagus added a commit that referenced this pull request Apr 7, 2015
Remove ShellJS copy and use the NPM version
@Snuffleupagus Snuffleupagus merged commit 1d6fae2 into mozilla:master Apr 7, 2015
@Snuffleupagus
Copy link
Collaborator

Thank you!

@timvandermeij timvandermeij deleted the shelljs branch April 7, 2015 18:34
@yurydelendik
Copy link
Contributor

@timvandermeij we probably need to fix version number to be exact to avoid changes similar to shelljs/shelljs#207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants