Skip to content

Commit 5b4debd

Browse files
committed
MDL-66109 js: Upgrade Node dependencies
This change updates most libraries used in our Grunt build stack and applies necessary changes to Grunt and Gherkin-lint configuration to ensure that they continue to work. The grunt-sass plugin has been updated to support alternative 'implementations' of sass compilers, and the chosen sass compiler must now be specified in the grunt configuration. We continue to use the `node-sass` package for this. Our gherkin-lintrc included two rules which were renamed from 'no-unamed-*' to 'no-unnamed-*'. This change occurred in version 2.0.0 of Gherkin-lint and has no other effect.
1 parent 9b7e6e9 commit 5b4debd

File tree

4 files changed

+4409
-2788
lines changed

4 files changed

+4409
-2788
lines changed

.gherkin-lintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"no-multiple-empty-lines": "on",
1515
"no-partially-commented-tag-lines": "on",
1616
"no-trailing-spaces": "on",
17-
"no-unamed-features": "on",
18-
"no-unamed-scenarios": "on",
17+
"no-unnamed-features": "on",
18+
"no-unnamed-scenarios": "on",
1919
"no-scenario-outlines-without-examples": "on"
2020
}

Gruntfile.js

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ module.exports = function(grunt) {
149149
const watchmanClient = new watchman.Client();
150150
const fs = require('fs');
151151
const ComponentList = require(path.resolve('GruntfileComponents.js'));
152+
const sass = require('node-sass');
152153

153154
// Verify the node version is new enough.
154155
var expected = semver.validRange(grunt.file.readJSON('package.json').engines.node);
@@ -358,6 +359,7 @@ module.exports = function(grunt) {
358359
}
359360
},
360361
options: {
362+
implementation: sass,
361363
includePaths: ["theme/boost/scss/", "theme/classic/scss/"]
362364
}
363365
},
@@ -527,23 +529,28 @@ module.exports = function(grunt) {
527529
const options = grunt.config('gherkinlint.options');
528530

529531
// Grab the gherkin-lint linter and required scaffolding.
530-
const linter = require('gherkin-lint/src/linter.js');
531-
const featureFinder = require('gherkin-lint/src/feature-finder.js');
532-
const configParser = require('gherkin-lint/src/config-parser.js');
533-
const formatter = require('gherkin-lint/src/formatters/stylish.js');
532+
const linter = require('gherkin-lint/dist/linter.js');
533+
const featureFinder = require('gherkin-lint/dist/feature-finder.js');
534+
const configParser = require('gherkin-lint/dist/config-parser.js');
535+
const formatter = require('gherkin-lint/dist/formatters/stylish.js');
534536

535537
// Run the linter.
536-
const results = linter.lint(
538+
return linter.lint(
537539
featureFinder.getFeatureFiles(grunt.file.expand(options.files)),
538540
configParser.getConfiguration(configParser.defaultConfigFileName)
539-
);
540-
541-
// Print the results out uncondtionally.
542-
formatter.printResults(results);
543-
544-
// Report on the results.
545-
// The done function takes a bool whereby a falsey statement causes the task to fail.
546-
done(results.every(result => result.errors.length === 0));
541+
)
542+
.then(results => {
543+
// Print the results out uncondtionally.
544+
formatter.printResults(results);
545+
546+
return results;
547+
})
548+
.then(results => {
549+
// Report on the results.
550+
// The done function takes a bool whereby a falsey statement causes the task to fail.
551+
return results.every(result => result.errors.length === 0);
552+
})
553+
.then(done); // eslint-disable-line promise/no-callback-in-promise
547554
};
548555

549556
tasks.startup = function() {

0 commit comments

Comments
 (0)