Skip to content

Commit

Permalink
chore(*): switch from optimist to yargs and update mocha
Browse files Browse the repository at this point in the history
Optimist and mocha depended upon a version of
minimist that had a security vulnerability.
  • Loading branch information
petebacondarwin committed Mar 5, 2021
1 parent e64198f commit 02b664b
Show file tree
Hide file tree
Showing 3 changed files with 446 additions and 132 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,19 @@
"di": "0.0.1",
"fast-deep-equal": "^3.1.3",
"objectdiff": "^1.1.0",
"optimist": "~0.6.1",
"validate.js": "^0.12.0",
"winston": "^2.1.1"
"winston": "^2.1.1",
"yargs": "^16.2.0"
},
"devDependencies": {
"@types/chai": "^4.1.3",
"@types/mocha": "^5.2.1",
"@types/node": "^10.3.1",
"@types/yargs": "^16.0.0",
"chai": "^4.1.2",
"chai-spies": "^1.0.0",
"dgeni-packages": "^0.28.4",
"mocha": "^5.2.0",
"mocha": "^8.3.0",
"ts-node": "^6.1.0",
"tslint": "^5.10.0",
"typescript": "^3.2.2"
Expand Down
12 changes: 9 additions & 3 deletions src/gen-docs.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
#!/usr/bin/env node
import {Dgeni} from './Dgeni';
import * as yargs from 'yargs';

const path = require('canonical-path');
const myArgs = require('optimist')
const myArgs = yargs.option('l', {
alias: 'log',
describe: 'Output log messages for this level and above',
type: 'string',
choices: ['error', 'warn', 'info', 'http','verbose', 'debug', 'silly']
})
.usage('Usage: $0 path/to/mainPackage [path/to/other/packages ...] [--log level]')
.demand(1)
.demandCommand(1)
.argv;


// Extract the paths to the packages from the command line arguments
const packagePaths = myArgs._;
const packagePaths = myArgs._ as string[];

// Require each of these packages and then create a new dgeni using them
const packages = packagePaths.map((packagePath) => {
Expand Down
Loading

0 comments on commit 02b664b

Please sign in to comment.