Added a base class to cli commands.

This commit is contained in:
David Diaz 2020-11-19 21:15:19 -06:00
parent df41d4fa0b
commit 5029a09b41
14 changed files with 251 additions and 340 deletions

View File

@ -5,7 +5,6 @@ useTabs: false
trailingComma: none trailingComma: none
bracketSpacing: true bracketSpacing: true
jsxBracketSameLine: true jsxBracketSameLine: true
parser: babylon semi: false
semi: true
requirePragma: false requirePragma: false
proseWrap: always proseWrap: always

30
bin/cli/__mocks__/base.js Normal file
View File

@ -0,0 +1,30 @@
const Beau = require('../../../src/beau')
const original = require.requireActual('../base')
const config = {
environment: {
params: {
name: 'David'
}
},
endpoint: 'https://example.org',
version: 1,
'GET /anything': {
alias: 'alias',
payload: {
name: '$env.params.name'
}
},
'GET /status/418': {
alias: 'teapot'
}
}
class Base extends original {
loadConfig(configFile, params = []) {
return new Beau(config, {})
}
}
module.exports = Base

View File

@ -1,41 +0,0 @@
const Beau = require('../../../src/beau');
const original = require.requireActual('../utils');
const utils = {};
const config = {
environment: {
params: {
name: 'David'
}
},
endpoint: 'https://example.org',
version: 1,
'GET /anything': {
alias: 'alias',
payload: {
name: '$env.params.name'
}
},
'GET /status/418': {
alias: 'teapot'
}
};
utils.loadConfig = function() {
return new Beau(config, {});
};
utils.openConfigFile = function(filename) {
if (filename === 'beau.yml') {
return config;
}
if (filename === 'invalid-conf.yml') {
return { plugins: [{ hello: 1, world: 2 }] };
}
};
utils.baseFlags = original.baseFlags;
module.exports = utils;

View File

@ -1,74 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`utils loadConfig should load load the config onto Beau 1`] = `
Config {
"COOKIEJAR": false,
"DEFAULTS": Object {},
"ENDPOINT": "https://example.org/",
"ENVIRONMENT": Object {
"_": Object {},
},
"HOSTS": Array [],
"PLUGINS": Plugins {
"autoload": Array [
"std",
],
"context": Object {
"createReadStream": [Function],
},
"registry": Object {
"dynamicValues": Array [
Object {
"fn": [Function],
"name": "createReadStream",
},
],
"postRequestModifiers": Array [],
"preRequestModifiers": Array [],
},
},
"REQUESTS": Array [
Object {
"ALIAS": "anything",
"COOKIEJAR": false,
"ENDPOINT": "https://example.org/",
"PAYLOAD": Object {
"name": "$env.params.name",
},
"REQUEST": "GET /anything",
},
],
"VERSION": 1,
"configKeys": Array [
"VERSION",
"ENDPOINT",
"PLUGINS",
"DEFAULTS",
"ENVIRONMENT",
"HOSTS",
"COOKIEJAR",
],
}
`;
exports[`utils loadConfig should load params onto the environment 1`] = `
Object {
"_": Object {
"BYE": "MARS",
"HELLO": "WORLD",
},
}
`;
exports[`utils openConfigFile should read and parse the given configuration file. 1`] = `
Object {
"GET /anything": Object {
"alias": "anything",
"payload": Object {
"name": "$env.params.name",
},
},
"endpoint": "https://example.org/",
"version": 1,
}
`;

View File

@ -2,7 +2,7 @@ const ListCommand = require('../commands/list');
jest.mock('../../../src/shared'); jest.mock('../../../src/shared');
jest.mock('../utils'); jest.mock('../base');
describe('List Command', () => { describe('List Command', () => {
let result; let result;

View File

@ -3,7 +3,7 @@ const requestPromiseNativeMock = require('request-promise-native');
jest.mock('../../../src/shared'); jest.mock('../../../src/shared');
jest.mock('../utils'); jest.mock('../base');
describe('Request Command', () => { describe('Request Command', () => {
let result; let result;

View File

@ -1,32 +0,0 @@
const utils = require('../utils.js');
jest.mock('../../../src/shared');
jest.mock('fs');
describe('utils', () => {
describe('openConfigFile', () => {
it('should read and parse the given configuration file.', () => {
expect(utils.openConfigFile('beau.yml')).toMatchSnapshot();
});
it('should throw if given not given a file', () => {
expect(() => utils.openConfigFile('not-a-file.yml')).toThrow();
});
});
describe('loadConfig', () => {
it('should load load the config onto Beau', () => {
let beau = utils.loadConfig('beau.yml');
expect(beau.config).toMatchSnapshot();
});
it('should load params onto the environment', () => {
let beau = utils.loadConfig('beau.yml', [
'HELLO=WORLD',
'BYE=MARS'
]);
expect(beau.config.ENVIRONMENT).toMatchSnapshot();
});
});
});

61
bin/cli/base.js Normal file
View File

@ -0,0 +1,61 @@
const { Command, flags } = require('@oclif/command')
const yaml = require('js-yaml')
const fs = require('fs')
const path = require('path')
const dotenv = require('dotenv')
const Beau = require('../../src/beau')
class Base extends Command {
openConfigFile(configFile) {
if (!fs.existsSync(configFile)) {
throw new Error(`The config file, ${configFile} was not found.`)
}
let config
yaml.safeLoadAll(fs.readFileSync(configFile, 'utf-8'), (doc) => {
if (typeof config === 'undefined') {
config = doc
} else {
if (typeof config.hosts === 'undefined') {
config.hosts = []
}
config.hosts.push(doc)
}
})
return config
}
loadConfig(configFile, params = []) {
const config = this.openConfigFile(configFile)
const env = dotenv.config().parsed || {}
params = dotenv.parse(params.join('\n'))
const envParams = { _: Object.assign(env, params) }
const configFileDir = path.dirname(
path.resolve(process.cwd(), configFile)
)
process.chdir(configFileDir)
return new Beau(config, envParams)
}
}
Base.flags = {
config: flags.string({
char: 'c',
description: 'The configuration file to be used.',
default: 'beau.yml'
}),
verbose: flags.boolean({
char: 'V',
description: `Show all additional information available for a command.`
}),
'no-format': flags.boolean({
description: `Disables color formatting for usage on external tools.`
})
}
module.exports = Base

View File

@ -1,26 +1,22 @@
const clc = require('cli-color'); const clc = require('cli-color')
const { Line } = require('clui'); const { Line } = require('clui')
const { flags, Command } = require('@oclif/command'); const Base = require('../base')
const { baseFlags, loadConfig } = require('../utils');
class ListCommand extends Command { class ListCommand extends Base {
async run() { async run() {
const { flags } = this.parse(ListCommand); const { flags } = this.parse(ListCommand)
const Beau = loadConfig(flags.config); const Beau = this.loadConfig(flags.config)
if (flags['no-format']) { if (flags['no-format']) {
return Beau.requests.list.forEach( return Beau.requests.list.forEach(
({ VERB, ALIAS, ENDPOINT, PATH }) => ({ VERB, ALIAS, ENDPOINT, PATH }) =>
this.log( this.log(
VERB + `${VERB}\t${ALIAS}\t${ENDPOINT.replace(
`\t` + /\/$/,
ALIAS + ''
`\t` + )}/${PATH.replace(/^\//, '')}`
ENDPOINT.replace(/\/$/, '') +
`/` +
PATH.replace(/^\//, '')
) )
); )
} }
new Line() new Line()
@ -28,7 +24,7 @@ class ListCommand extends Command {
.column('HTTP Verb', 20, [clc.cyan]) .column('HTTP Verb', 20, [clc.cyan])
.column('Alias', 30, [clc.cyan]) .column('Alias', 30, [clc.cyan])
.column('Endpoint', 20, [clc.cyan]) .column('Endpoint', 20, [clc.cyan])
.output(); .output()
Beau.requests.list.forEach(({ VERB, ALIAS, ENDPOINT, PATH }) => Beau.requests.list.forEach(({ VERB, ALIAS, ENDPOINT, PATH }) =>
new Line() new Line()
@ -39,13 +35,13 @@ class ListCommand extends Command {
ENDPOINT.replace(/\/$/, '') + '/' + PATH.replace(/^\//, '') ENDPOINT.replace(/\/$/, '') + '/' + PATH.replace(/^\//, '')
) )
.output() .output()
); )
new Line().output(); new Line().output()
} }
} }
ListCommand.description = `Lists all available requests in the config file.`; ListCommand.description = `Lists all available requests in the config file.`
ListCommand.flags = { ...baseFlags }; ListCommand.flags = { ...Base.flags }
module.exports = ListCommand; module.exports = ListCommand

View File

@ -1,10 +1,10 @@
const clc = require('cli-color'); const clc = require('cli-color');
const jsome = require('jsome'); const jsome = require('jsome');
const { Line, Spinner } = require('clui'); const { Line, Spinner } = require('clui');
const { flags, Command } = require('@oclif/command'); const { flags } = require('@oclif/command');
const { baseFlags, loadConfig } = require('../utils'); const Base = require('../base');
class RequestCommand extends Command { class RequestCommand extends Base {
prettyOutput(res, verbose = false) { prettyOutput(res, verbose = false) {
let { status, body } = res.response; let { status, body } = res.response;
@ -44,7 +44,7 @@ class RequestCommand extends Command {
args args
} = this.parse(RequestCommand); } = this.parse(RequestCommand);
const Beau = loadConfig(config, params); const Beau = this.loadConfig(config, params);
const spinnerSprite = ['⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷']; const spinnerSprite = ['⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷'];
this.spinner = new Spinner('', spinnerSprite); this.spinner = new Spinner('', spinnerSprite);
@ -91,7 +91,7 @@ class RequestCommand extends Command {
RequestCommand.description = `Executes a request by name.`; RequestCommand.description = `Executes a request by name.`;
RequestCommand.flags = { RequestCommand.flags = {
...baseFlags, ...Base.flags,
param: flags.string({ param: flags.string({
char: 'P', char: 'P',
multiple: true, multiple: true,

View File

@ -1,62 +0,0 @@
const yaml = require('js-yaml');
const fs = require('fs');
const path = require('path');
const dotenv = require('dotenv');
const Beau = require('../../src/beau');
const { flags } = require('@oclif/command');
const openConfigFile = configFile => {
if (!fs.existsSync(configFile)) {
throw new Error(`The config file, ${configFile} was not found.`);
}
let config;
yaml.safeLoadAll(fs.readFileSync(configFile, 'utf-8'), doc => {
if (typeof config === 'undefined') {
config = doc;
} else {
if (typeof config.hosts === 'undefined') {
config.hosts = [];
}
config.hosts.push(doc);
}
});
return config;
};
const loadConfig = (configFile, params = []) => {
const config = openConfigFile(configFile);
const env = dotenv.config().parsed || {};
params = dotenv.parse(params.join('\n'));
const envParams = { _: Object.assign(env, params) };
const configFileDir = path.dirname(path.resolve(process.cwd(), configFile));
process.chdir(configFileDir);
return new Beau(config, envParams);
};
const baseFlags = {
config: flags.string({
char: 'c',
description: 'The configuration file to be used.',
default: 'beau.yml'
}),
verbose: flags.boolean({
char: 'V',
description: `Show all additional information available for a command.`
}),
'no-format': flags.boolean({
description: `Disables color formatting for usage on external tools.`
})
};
module.exports = {
openConfigFile,
loadConfig,
baseFlags
};

227
package-lock.json generated
View File

@ -259,14 +259,30 @@
"p-each-series": "^1.0.0", "p-each-series": "^1.0.0",
"realpath-native": "^1.1.0", "realpath-native": "^1.1.0",
"rimraf": "^2.5.4", "rimraf": "^2.5.4",
"slash": "^2.0.0" "slash": "^2.0.0",
"strip-ansi": "^5.0.0"
}, },
"dependencies": { "dependencies": {
"ansi-regex": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"dev": true
},
"graceful-fs": { "graceful-fs": {
"version": "4.2.2", "version": "4.2.2",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz",
"integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==", "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==",
"dev": true "dev": true
},
"strip-ansi": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": {
"ansi-regex": "^4.1.0"
}
} }
} }
}, },
@ -431,43 +447,42 @@
} }
}, },
"@oclif/command": { "@oclif/command": {
"version": "1.7.0", "version": "1.8.0",
"resolved": "https://registry.npmjs.org/@oclif/command/-/command-1.7.0.tgz", "resolved": "https://registry.npmjs.org/@oclif/command/-/command-1.8.0.tgz",
"integrity": "sha512-TkknFtWcZI8te0E8sW+ohiblExrLx73rIcV4KdIzDX01u+oTZWZaap51F6TSGFnR/Gey0WctaDvJhZlt4xgKdA==", "integrity": "sha512-5vwpq6kbvwkQwKqAoOU3L72GZ3Ta8RRrewKj9OJRolx28KLJJ8Dg9Rf7obRwt5jQA9bkYd8gqzMTrI7H3xLfaw==",
"requires": { "requires": {
"@oclif/config": "^1.15.1", "@oclif/config": "^1.15.1",
"@oclif/errors": "^1.3.3", "@oclif/errors": "^1.3.3",
"@oclif/parser": "^3.8.3", "@oclif/parser": "^3.8.3",
"@oclif/plugin-help": "^3", "@oclif/plugin-help": "^3",
"debug": "^4.1.1", "debug": "^4.1.1",
"semver": "^5.6.0" "semver": "^7.3.2"
}, },
"dependencies": { "dependencies": {
"@oclif/errors": { "@oclif/errors": {
"version": "1.3.3", "version": "1.3.4",
"resolved": "https://registry.npmjs.org/@oclif/errors/-/errors-1.3.3.tgz", "resolved": "https://registry.npmjs.org/@oclif/errors/-/errors-1.3.4.tgz",
"integrity": "sha512-EJR6AIOEkt/NnARNIVAskPDVtdhtO5TTNXmhDrGqMoWVsr0R6DkkLrMyq95BmHvlVWM1nduoq4fQPuCyuF2jaA==", "integrity": "sha512-pJKXyEqwdfRTUdM8n5FIHiQQHg5ETM0Wlso8bF9GodczO40mF5Z3HufnYWJE7z8sGKxOeJCdbAVZbS8Y+d5GCw==",
"requires": { "requires": {
"clean-stack": "^3.0.0", "clean-stack": "^3.0.0",
"fs-extra": "^9.0.1", "fs-extra": "^8.1",
"indent-string": "^4.0.0", "indent-string": "^4.0.0",
"strip-ansi": "^6.0.0", "strip-ansi": "^6.0.0",
"wrap-ansi": "^7.0.0" "wrap-ansi": "^7.0.0"
} }
}, },
"ansi-styles": { "ansi-styles": {
"version": "4.2.1", "version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"requires": { "requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1" "color-convert": "^2.0.1"
} }
}, },
"clean-stack": { "clean-stack": {
"version": "3.0.0", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.0.tgz", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.1.tgz",
"integrity": "sha512-RHxtgFvXsRQ+1AM7dlozLDY7ssmvUUh0XEnfnyhYgJTO6beNZHBogiaCwGM9Q3rFrUkYxOtsZRC0zAturg5bjg==", "integrity": "sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg==",
"requires": { "requires": {
"escape-string-regexp": "4.0.0" "escape-string-regexp": "4.0.0"
} }
@ -486,11 +501,11 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
}, },
"debug": { "debug": {
"version": "4.1.1", "version": "4.3.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"requires": { "requires": {
"ms": "^2.1.1" "ms": "2.1.2"
} }
}, },
"emoji-regex": { "emoji-regex": {
@ -504,14 +519,13 @@
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="
}, },
"fs-extra": { "fs-extra": {
"version": "9.0.1", "version": "8.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
"integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
"requires": { "requires": {
"at-least-node": "^1.0.0",
"graceful-fs": "^4.2.0", "graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1", "jsonfile": "^4.0.0",
"universalify": "^1.0.0" "universalify": "^0.1.0"
} }
}, },
"graceful-fs": { "graceful-fs": {
@ -529,20 +543,16 @@
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
}, },
"jsonfile": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz",
"integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==",
"requires": {
"graceful-fs": "^4.1.6",
"universalify": "^1.0.0"
}
},
"ms": { "ms": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
}, },
"semver": {
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ=="
},
"string-width": { "string-width": {
"version": "4.2.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
@ -553,11 +563,6 @@
"strip-ansi": "^6.0.0" "strip-ansi": "^6.0.0"
} }
}, },
"universalify": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz",
"integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug=="
},
"wrap-ansi": { "wrap-ansi": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
@ -726,6 +731,7 @@
"clean-stack": "^1.3.0", "clean-stack": "^1.3.0",
"fs-extra": "^7.0.0", "fs-extra": "^7.0.0",
"indent-string": "^3.2.0", "indent-string": "^3.2.0",
"strip-ansi": "^5.0.0",
"wrap-ansi": "^4.0.0" "wrap-ansi": "^4.0.0"
}, },
"dependencies": { "dependencies": {
@ -758,6 +764,21 @@
} }
} }
}, },
"strip-ansi": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"requires": {
"ansi-regex": "^4.1.0"
},
"dependencies": {
"ansi-regex": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg=="
}
}
},
"wrap-ansi": { "wrap-ansi": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-4.0.0.tgz", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-4.0.0.tgz",
@ -1189,13 +1210,12 @@
} }
}, },
"ajv": { "ajv": {
"version": "6.11.0", "version": "7.0.0-beta.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.11.0.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.0.0-beta.6.tgz",
"integrity": "sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA==", "integrity": "sha512-9aDR4p4ReYBS1XxrYONdWuFVRweLjJTv8RaNkBEpJm09jkVcVYhtaul5IL7Y/x1RJ9UakETm0oBze4VHIjq4nA==",
"requires": { "requires": {
"fast-deep-equal": "^3.1.1", "fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.5.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2" "uri-js": "^4.2.2"
} }
}, },
@ -1943,9 +1963,16 @@
"dev": true, "dev": true,
"requires": { "requires": {
"string-width": "^3.1.0", "string-width": "^3.1.0",
"strip-ansi": "^5.2.0",
"wrap-ansi": "^5.1.0" "wrap-ansi": "^5.1.0"
}, },
"dependencies": { "dependencies": {
"ansi-regex": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"dev": true
},
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
@ -1959,7 +1986,17 @@
"dev": true, "dev": true,
"requires": { "requires": {
"emoji-regex": "^7.0.1", "emoji-regex": "^7.0.1",
"is-fullwidth-code-point": "^2.0.0" "is-fullwidth-code-point": "^2.0.0",
"strip-ansi": "^5.1.0"
}
},
"strip-ansi": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": {
"ansi-regex": "^4.1.0"
} }
}, },
"wrap-ansi": { "wrap-ansi": {
@ -1969,7 +2006,8 @@
"dev": true, "dev": true,
"requires": { "requires": {
"ansi-styles": "^3.2.0", "ansi-styles": "^3.2.0",
"string-width": "^3.0.0" "string-width": "^3.0.0",
"strip-ansi": "^5.0.0"
} }
} }
} }
@ -2893,9 +2931,9 @@
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
}, },
"fast-deep-equal": { "fast-deep-equal": {
"version": "3.1.1", "version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==" "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
}, },
"fast-glob": { "fast-glob": {
"version": "3.2.2", "version": "3.2.2",
@ -3842,6 +3880,24 @@
"requires": { "requires": {
"ajv": "^6.5.5", "ajv": "^6.5.5",
"har-schema": "^2.0.0" "har-schema": "^2.0.0"
},
"dependencies": {
"ajv": {
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
}
} }
}, },
"hard-rejection": { "hard-rejection": {
@ -3917,11 +3973,6 @@
"integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==",
"dev": true "dev": true
}, },
"hoek": {
"version": "6.1.3",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.3.tgz",
"integrity": "sha512-YXXAAhmF9zpQbC7LEcREFtXfGq5K1fmd+4PHkBq8NUqmzW3G+Dq10bI/i0KucLRwss3YYFQ0fSfoxBZYiGUqtQ=="
},
"hosted-git-info": { "hosted-git-info": {
"version": "2.8.5", "version": "2.8.5",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz",
@ -4637,21 +4688,6 @@
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true "dev": true
}, },
"isemail": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz",
"integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==",
"requires": {
"punycode": "2.x.x"
},
"dependencies": {
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
}
}
},
"isexe": { "isexe": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
@ -5544,16 +5580,6 @@
} }
} }
}, },
"joi": {
"version": "14.3.1",
"resolved": "https://registry.npmjs.org/joi/-/joi-14.3.1.tgz",
"integrity": "sha512-LQDdM+pkOrpAn4Lp+neNIFV3axv1Vna3j38bisbQhETPMANYRbFJFUyOZcOClYvM/hppMhGWuKSFEK9vjrB+bQ==",
"requires": {
"hoek": "6.x.x",
"isemail": "3.x.x",
"topo": "3.x.x"
}
},
"js-tokens": { "js-tokens": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@ -5746,9 +5772,9 @@
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
}, },
"json-schema-traverse": { "json-schema-traverse": {
"version": "0.4.1", "version": "0.5.0",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.5.0.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" "integrity": "sha512-x+TRJIQFskrNnFKE2Viz9FCSjK1vIh+H/uaBiOYszh/IcZmAFneQ35H4osWDJp1NPXccuV2I0RMXmi2ZS6Kqcg=="
}, },
"json-stringify-safe": { "json-stringify-safe": {
"version": "5.0.1", "version": "5.0.1",
@ -8137,7 +8163,8 @@
"semver": { "semver": {
"version": "5.7.1", "version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true
}, },
"semver-diff": { "semver-diff": {
"version": "3.1.1", "version": "3.1.1",
@ -8783,14 +8810,6 @@
"repeat-string": "^1.6.1" "repeat-string": "^1.6.1"
} }
}, },
"topo": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/topo/-/topo-3.0.3.tgz",
"integrity": "sha512-IgpPtvD4kjrJ7CRA3ov2FhWQADwv+Tdqbsf1ZnPUSAtCJ9e1Z44MmoSGDXGk4IppoZA7jd/QRkNddlLJWlUZsQ==",
"requires": {
"hoek": "6.x.x"
}
},
"tough-cookie": { "tough-cookie": {
"version": "2.5.0", "version": "2.5.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
@ -9028,9 +9047,9 @@
} }
}, },
"uri-js": { "uri-js": {
"version": "4.2.2", "version": "4.4.0",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz",
"integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==",
"requires": { "requires": {
"punycode": "^2.1.0" "punycode": "^2.1.0"
} }
@ -9291,6 +9310,12 @@
"yargs-parser": "^13.1.1" "yargs-parser": "^13.1.1"
}, },
"dependencies": { "dependencies": {
"ansi-regex": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"dev": true
},
"get-caller-file": { "get-caller-file": {
"version": "2.0.5", "version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
@ -9316,7 +9341,17 @@
"dev": true, "dev": true,
"requires": { "requires": {
"emoji-regex": "^7.0.1", "emoji-regex": "^7.0.1",
"is-fullwidth-code-point": "^2.0.0" "is-fullwidth-code-point": "^2.0.0",
"strip-ansi": "^5.1.0"
}
},
"strip-ansi": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": {
"ansi-regex": "^4.1.0"
} }
}, },
"y18n": { "y18n": {

View File

@ -15,10 +15,11 @@
"/bin" "/bin"
], ],
"dependencies": { "dependencies": {
"@oclif/plugin-help": "3.1.0", "@oclif/command": "1.8.0",
"@oclif/command": "1.7.0",
"@oclif/config": "1.16.0", "@oclif/config": "1.16.0",
"@oclif/plugin-help": "3.1.0",
"@oclif/plugin-warn-if-update-available": "1.7.0", "@oclif/plugin-warn-if-update-available": "1.7.0",
"ajv": "7.0.0-beta.6",
"beau-std": "0.9.4", "beau-std": "0.9.4",
"cli-color": "2.0.0", "cli-color": "2.0.0",
"clui": "0.3.6", "clui": "0.3.6",
@ -26,7 +27,6 @@
"dotenv": "8.2.0", "dotenv": "8.2.0",
"globby": "11.0.1", "globby": "11.0.1",
"is-plain-object": "4.1.0", "is-plain-object": "4.1.0",
"joi": "14.3.1",
"js-yaml": "3.14.0", "js-yaml": "3.14.0",
"jsome": "2.5.0", "jsome": "2.5.0",
"request": "2.88.2", "request": "2.88.2",
@ -36,9 +36,8 @@
"repository": "git@github.com:Seich/Beau.git", "repository": "git@github.com:Seich/Beau.git",
"devDependencies": { "devDependencies": {
"jest": "24.9.0", "jest": "24.9.0",
"strip-ansi": "5.2.0",
"jest-watch-typeahead": "0.6.0",
"strip-ansi": "6.0.0", "strip-ansi": "6.0.0",
"jest-watch-typeahead": "0.6.0",
"np": "6.3.2" "np": "6.3.2"
}, },
"oclif": { "oclif": {