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

Build: remove shelljs-nodecli (fixes #9533) #9588

Merged
merged 1 commit into from Nov 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 16 additions & 9 deletions Makefile.js
Expand Up @@ -20,7 +20,6 @@ const lodash = require("lodash"),
fs = require("fs"),
glob = require("glob"),
markdownlint = require("markdownlint"),
nodeCLI = require("shelljs-nodecli"),
os = require("os"),
path = require("path"),
semver = require("semver"),
Expand Down Expand Up @@ -468,6 +467,15 @@ function getFormatterResults() {
}, { formatterResults: {} });
}

/**
* Gets a path to an executable in node_modules/.bin
* @param {string} command The executable name
* @returns {string} The executable path
*/
function getBinFile(command) {
return path.join("node_modules", ".bin", command);
}

//------------------------------------------------------------------------------
// Tasks
//------------------------------------------------------------------------------
Expand Down Expand Up @@ -560,21 +568,20 @@ target.test = function() {
let errors = 0,
lastReturn;

// exec(ISTANBUL + " cover " + MOCHA + "-- -c " + TEST_FILES);
lastReturn = nodeCLI.exec("istanbul", "cover", MOCHA, `-- -R progress -t ${MOCHA_TIMEOUT}`, "-c", TEST_FILES);
lastReturn = exec(`${getBinFile("istanbul")} cover ${MOCHA} -- -R progress -t ${MOCHA_TIMEOUT} -c ${TEST_FILES}`);
if (lastReturn.code !== 0) {
errors++;
}

// exec(ISTANBUL + "check-coverage --statement 99 --branch 98 --function 99 --lines 99");
lastReturn = nodeCLI.exec("istanbul", "check-coverage", "--statement 99 --branch 98 --function 99 --lines 99");
lastReturn = exec(`${getBinFile("istanbul")} check-coverage --statement 99 --branch 98 --function 99 --lines 99`);

if (lastReturn.code !== 0) {
errors++;
}

target.browserify();

lastReturn = nodeCLI.exec("karma", "start karma.conf.js");
lastReturn = exec(`${getBinFile("karma")} start karma.conf.js`);
if (lastReturn.code !== 0) {
errors++;
}
Expand All @@ -588,7 +595,7 @@ target.test = function() {

target.docs = function() {
echo("Generating documentation");
nodeCLI.exec("jsdoc", "-d jsdoc lib");
exec(`${getBinFile("jsdoc")} -d jsdoc lib`);
echo("Documentation has been output to /jsdoc");
};

Expand Down Expand Up @@ -799,10 +806,10 @@ target.browserify = function() {
generateRulesIndex(TEMP_DIR);

// 5. browserify the temp directory
nodeCLI.exec("browserify", "-x espree", `${TEMP_DIR}linter.js`, "-o", `${BUILD_DIR}eslint.js`, "-s eslint", "--global-transform [ babelify --presets [ es2015 ] ]");
exec(`${getBinFile("browserify")} -x espree ${TEMP_DIR}linter.js -o ${BUILD_DIR}eslint.js -s eslint --global-transform [ babelify --presets [ es2015 ] ]`);

// 6. Browserify espree
nodeCLI.exec("browserify", "-r espree", "-o", `${TEMP_DIR}espree.js`);
exec(`${getBinFile("browserify")} -r espree -o ${TEMP_DIR}espree.js`);

// 7. Concatenate Babel polyfill, Espree, and ESLint files together
cat("./node_modules/babel-polyfill/dist/polyfill.js", `${TEMP_DIR}espree.js`, `${BUILD_DIR}eslint.js`).to(`${BUILD_DIR}eslint.js`);
Expand Down
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -84,11 +84,11 @@
"coveralls": "^2.13.1",
"dateformat": "^2.0.0",
"ejs": "^2.5.6",
"eslint-rule-composer": "^0.1.0",
"eslint-plugin-eslint-plugin": "^1.2.0",
"eslint-plugin-node": "^5.1.0",
"eslint-plugin-rulesdir": "^0.1.0",
"eslint-release": "^0.10.1",
"eslint-rule-composer": "^0.1.0",
"eslump": "1.6.0",
"esprima": "^4.0.0",
"esprima-fb": "^15001.1001.0-dev-harmony-fb",
Expand All @@ -108,7 +108,6 @@
"phantomjs-prebuilt": "^2.1.14",
"proxyquire": "^1.8.0",
"shelljs": "^0.7.7",
"shelljs-nodecli": "~0.1.1",
"sinon": "^3.2.1",
"temp": "^0.8.3",
"through": "^2.3.8"
Expand Down