Skip to content

Commit

Permalink
Breaking: Upgrade yeoman dependencies to latest (#101)
Browse files Browse the repository at this point in the history
* Breaking: Upgrade yeoman dependencies to latest

Significantly modernizes code and tests.
Significantly improves test coverage.

* Chore: Recreate package-lock.json

* Chore: Run CI with latest NPM version

With the latest yeoman dependencies,  I was seeing errors under Node 12/14, unless NPM 7 was used to install dependencies:

- Uncaught Error: Cannot find module 'rimraf'
- Uncaught Error: Cannot find module 'mkdirp'
  • Loading branch information
bmish committed Jul 22, 2021
1 parent f39f2ca commit d5c7a80
Show file tree
Hide file tree
Showing 9 changed files with 7,717 additions and 18,397 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -35,6 +35,8 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Install latest NPM
run: npm install -g npm@latest
- name: Install dependencies
run: npm ci
- name: Run tests
Expand Down
17 changes: 7 additions & 10 deletions app/index.js
Expand Up @@ -10,7 +10,7 @@
// Requirements
//------------------------------------------------------------------------------

const yeoman = require("yeoman-generator");
const Generator = require("yeoman-generator");

//------------------------------------------------------------------------------
// Helpers
Expand All @@ -25,19 +25,16 @@ const NAMESPACES = {
// Constructor
//------------------------------------------------------------------------------

module.exports = yeoman.Base.extend({
prompting() {
const done = this.async();

this.prompt({
module.exports = class extends Generator {
async prompting() {
const answers = await this.prompt({
type: "list",
name: "outputType",
message: "Do you want to generate a rule or a plugin?",
choices: ["Rule", "Plugin"],
default: "Rule"
}, answers => {
this.composeWith(NAMESPACES[answers.outputType]);
done();
});

this.composeWith(NAMESPACES[answers.outputType]);
}
});
};

0 comments on commit d5c7a80

Please sign in to comment.