Skip to content

Commit

Permalink
MDL-66109 js: Upgrade Node dependencies
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andrewnicols committed May 11, 2020
1 parent 9b7e6e9 commit 5b4debd
Show file tree
Hide file tree
Showing 4 changed files with 4,409 additions and 2,788 deletions.
4 changes: 2 additions & 2 deletions .gherkin-lintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"no-multiple-empty-lines": "on",
"no-partially-commented-tag-lines": "on",
"no-trailing-spaces": "on",
"no-unamed-features": "on",
"no-unamed-scenarios": "on",
"no-unnamed-features": "on",
"no-unnamed-scenarios": "on",
"no-scenario-outlines-without-examples": "on"
}
33 changes: 20 additions & 13 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ module.exports = function(grunt) {
const watchmanClient = new watchman.Client();
const fs = require('fs');
const ComponentList = require(path.resolve('GruntfileComponents.js'));
const sass = require('node-sass');

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

// Grab the gherkin-lint linter and required scaffolding.
const linter = require('gherkin-lint/src/linter.js');
const featureFinder = require('gherkin-lint/src/feature-finder.js');
const configParser = require('gherkin-lint/src/config-parser.js');
const formatter = require('gherkin-lint/src/formatters/stylish.js');
const linter = require('gherkin-lint/dist/linter.js');
const featureFinder = require('gherkin-lint/dist/feature-finder.js');
const configParser = require('gherkin-lint/dist/config-parser.js');
const formatter = require('gherkin-lint/dist/formatters/stylish.js');

// Run the linter.
const results = linter.lint(
return linter.lint(
featureFinder.getFeatureFiles(grunt.file.expand(options.files)),
configParser.getConfiguration(configParser.defaultConfigFileName)
);

// Print the results out uncondtionally.
formatter.printResults(results);

// Report on the results.
// The done function takes a bool whereby a falsey statement causes the task to fail.
done(results.every(result => result.errors.length === 0));
)
.then(results => {
// Print the results out uncondtionally.
formatter.printResults(results);

return results;
})
.then(results => {
// Report on the results.
// The done function takes a bool whereby a falsey statement causes the task to fail.
return results.every(result => result.errors.length === 0);
})
.then(done); // eslint-disable-line promise/no-callback-in-promise
};

tasks.startup = function() {
Expand Down
Loading

0 comments on commit 5b4debd

Please sign in to comment.