diff --git a/.prettierrc b/.prettierrc index e6bb537..743686c 100644 --- a/.prettierrc +++ b/.prettierrc @@ -5,7 +5,6 @@ useTabs: false trailingComma: none bracketSpacing: true jsxBracketSameLine: true -parser: babylon -semi: true +semi: false requirePragma: false proseWrap: always diff --git a/bin/cli/__mocks__/base.js b/bin/cli/__mocks__/base.js new file mode 100644 index 0000000..d054911 --- /dev/null +++ b/bin/cli/__mocks__/base.js @@ -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 diff --git a/bin/cli/__mocks__/utils.js b/bin/cli/__mocks__/utils.js deleted file mode 100644 index 2978ff1..0000000 --- a/bin/cli/__mocks__/utils.js +++ /dev/null @@ -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; diff --git a/bin/cli/__tests__/__snapshots__/utils.spec.js.snap b/bin/cli/__tests__/__snapshots__/utils.spec.js.snap deleted file mode 100644 index 6041913..0000000 --- a/bin/cli/__tests__/__snapshots__/utils.spec.js.snap +++ /dev/null @@ -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, -} -`; diff --git a/bin/cli/__tests__/list.spec.js b/bin/cli/__tests__/list.spec.js index 367aa3a..582fee5 100644 --- a/bin/cli/__tests__/list.spec.js +++ b/bin/cli/__tests__/list.spec.js @@ -2,7 +2,7 @@ const ListCommand = require('../commands/list'); jest.mock('../../../src/shared'); -jest.mock('../utils'); +jest.mock('../base'); describe('List Command', () => { let result; diff --git a/bin/cli/__tests__/request.spec.js b/bin/cli/__tests__/request.spec.js index b09e9a2..85bdda3 100644 --- a/bin/cli/__tests__/request.spec.js +++ b/bin/cli/__tests__/request.spec.js @@ -3,7 +3,7 @@ const requestPromiseNativeMock = require('request-promise-native'); jest.mock('../../../src/shared'); -jest.mock('../utils'); +jest.mock('../base'); describe('Request Command', () => { let result; diff --git a/bin/cli/__tests__/utils.spec.js b/bin/cli/__tests__/utils.spec.js deleted file mode 100644 index 69877c0..0000000 --- a/bin/cli/__tests__/utils.spec.js +++ /dev/null @@ -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(); - }); - }); -}); diff --git a/bin/cli/base.js b/bin/cli/base.js new file mode 100644 index 0000000..1e1dd3f --- /dev/null +++ b/bin/cli/base.js @@ -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 diff --git a/bin/cli/commands/list.js b/bin/cli/commands/list.js index 388df4d..3acbb6b 100644 --- a/bin/cli/commands/list.js +++ b/bin/cli/commands/list.js @@ -1,26 +1,22 @@ -const clc = require('cli-color'); -const { Line } = require('clui'); -const { flags, Command } = require('@oclif/command'); -const { baseFlags, loadConfig } = require('../utils'); +const clc = require('cli-color') +const { Line } = require('clui') +const Base = require('../base') -class ListCommand extends Command { +class ListCommand extends Base { async run() { - const { flags } = this.parse(ListCommand); - const Beau = loadConfig(flags.config); + const { flags } = this.parse(ListCommand) + const Beau = this.loadConfig(flags.config) if (flags['no-format']) { return Beau.requests.list.forEach( ({ VERB, ALIAS, ENDPOINT, PATH }) => this.log( - VERB + - `\t` + - ALIAS + - `\t` + - ENDPOINT.replace(/\/$/, '') + - `/` + - PATH.replace(/^\//, '') + `${VERB}\t${ALIAS}\t${ENDPOINT.replace( + /\/$/, + '' + )}/${PATH.replace(/^\//, '')}` ) - ); + ) } new Line() @@ -28,7 +24,7 @@ class ListCommand extends Command { .column('HTTP Verb', 20, [clc.cyan]) .column('Alias', 30, [clc.cyan]) .column('Endpoint', 20, [clc.cyan]) - .output(); + .output() Beau.requests.list.forEach(({ VERB, ALIAS, ENDPOINT, PATH }) => new Line() @@ -39,13 +35,13 @@ class ListCommand extends Command { ENDPOINT.replace(/\/$/, '') + '/' + PATH.replace(/^\//, '') ) .output() - ); + ) - new Line().output(); + new Line().output() } } -ListCommand.description = `Lists all available requests in the config file.`; -ListCommand.flags = { ...baseFlags }; +ListCommand.description = `Lists all available requests in the config file.` +ListCommand.flags = { ...Base.flags } -module.exports = ListCommand; +module.exports = ListCommand diff --git a/bin/cli/commands/request.js b/bin/cli/commands/request.js index 09fdc56..673f833 100644 --- a/bin/cli/commands/request.js +++ b/bin/cli/commands/request.js @@ -1,10 +1,10 @@ const clc = require('cli-color'); const jsome = require('jsome'); const { Line, Spinner } = require('clui'); -const { flags, Command } = require('@oclif/command'); -const { baseFlags, loadConfig } = require('../utils'); +const { flags } = require('@oclif/command'); +const Base = require('../base'); -class RequestCommand extends Command { +class RequestCommand extends Base { prettyOutput(res, verbose = false) { let { status, body } = res.response; @@ -44,7 +44,7 @@ class RequestCommand extends Command { args } = this.parse(RequestCommand); - const Beau = loadConfig(config, params); + const Beau = this.loadConfig(config, params); const spinnerSprite = ['⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷']; this.spinner = new Spinner('', spinnerSprite); @@ -91,7 +91,7 @@ class RequestCommand extends Command { RequestCommand.description = `Executes a request by name.`; RequestCommand.flags = { - ...baseFlags, + ...Base.flags, param: flags.string({ char: 'P', multiple: true, diff --git a/bin/cli/utils.js b/bin/cli/utils.js deleted file mode 100644 index 695b37c..0000000 --- a/bin/cli/utils.js +++ /dev/null @@ -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 -}; diff --git a/package-lock.json b/package-lock.json index 2f813c1..644691a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -259,14 +259,30 @@ "p-each-series": "^1.0.0", "realpath-native": "^1.1.0", "rimraf": "^2.5.4", - "slash": "^2.0.0" + "slash": "^2.0.0", + "strip-ansi": "^5.0.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==", + "dev": true + }, "graceful-fs": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==", "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": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@oclif/command/-/command-1.7.0.tgz", - "integrity": "sha512-TkknFtWcZI8te0E8sW+ohiblExrLx73rIcV4KdIzDX01u+oTZWZaap51F6TSGFnR/Gey0WctaDvJhZlt4xgKdA==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@oclif/command/-/command-1.8.0.tgz", + "integrity": "sha512-5vwpq6kbvwkQwKqAoOU3L72GZ3Ta8RRrewKj9OJRolx28KLJJ8Dg9Rf7obRwt5jQA9bkYd8gqzMTrI7H3xLfaw==", "requires": { "@oclif/config": "^1.15.1", "@oclif/errors": "^1.3.3", "@oclif/parser": "^3.8.3", "@oclif/plugin-help": "^3", "debug": "^4.1.1", - "semver": "^5.6.0" + "semver": "^7.3.2" }, "dependencies": { "@oclif/errors": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@oclif/errors/-/errors-1.3.3.tgz", - "integrity": "sha512-EJR6AIOEkt/NnARNIVAskPDVtdhtO5TTNXmhDrGqMoWVsr0R6DkkLrMyq95BmHvlVWM1nduoq4fQPuCyuF2jaA==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@oclif/errors/-/errors-1.3.4.tgz", + "integrity": "sha512-pJKXyEqwdfRTUdM8n5FIHiQQHg5ETM0Wlso8bF9GodczO40mF5Z3HufnYWJE7z8sGKxOeJCdbAVZbS8Y+d5GCw==", "requires": { "clean-stack": "^3.0.0", - "fs-extra": "^9.0.1", + "fs-extra": "^8.1", "indent-string": "^4.0.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "requires": { - "@types/color-name": "^1.1.1", "color-convert": "^2.0.1" } }, "clean-stack": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.0.tgz", - "integrity": "sha512-RHxtgFvXsRQ+1AM7dlozLDY7ssmvUUh0XEnfnyhYgJTO6beNZHBogiaCwGM9Q3rFrUkYxOtsZRC0zAturg5bjg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.1.tgz", + "integrity": "sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg==", "requires": { "escape-string-regexp": "4.0.0" } @@ -486,11 +501,11 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" } }, "emoji-regex": { @@ -504,14 +519,13 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" }, "fs-extra": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", - "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "requires": { - "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^1.0.0" + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" } }, "graceful-fs": { @@ -529,20 +543,16 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "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": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "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": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -553,11 +563,6 @@ "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": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -726,6 +731,7 @@ "clean-stack": "^1.3.0", "fs-extra": "^7.0.0", "indent-string": "^3.2.0", + "strip-ansi": "^5.0.0", "wrap-ansi": "^4.0.0" }, "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": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-4.0.0.tgz", @@ -1189,13 +1210,12 @@ } }, "ajv": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.11.0.tgz", - "integrity": "sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.0.0-beta.6.tgz", + "integrity": "sha512-9aDR4p4ReYBS1XxrYONdWuFVRweLjJTv8RaNkBEpJm09jkVcVYhtaul5IL7Y/x1RJ9UakETm0oBze4VHIjq4nA==", "requires": { "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", + "json-schema-traverse": "^0.5.0", "uri-js": "^4.2.2" } }, @@ -1943,9 +1963,16 @@ "dev": true, "requires": { "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", "wrap-ansi": "^5.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==", + "dev": true + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -1959,7 +1986,17 @@ "dev": true, "requires": { "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": { @@ -1969,7 +2006,8 @@ "dev": true, "requires": { "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=" }, "fast-deep-equal": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", - "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "fast-glob": { "version": "3.2.2", @@ -3842,6 +3880,24 @@ "requires": { "ajv": "^6.5.5", "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": { @@ -3917,11 +3973,6 @@ "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", "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": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", @@ -4637,21 +4688,6 @@ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "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": { "version": "2.0.0", "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": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -5746,9 +5772,9 @@ "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" }, "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==" + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.5.0.tgz", + "integrity": "sha512-x+TRJIQFskrNnFKE2Viz9FCSjK1vIh+H/uaBiOYszh/IcZmAFneQ35H4osWDJp1NPXccuV2I0RMXmi2ZS6Kqcg==" }, "json-stringify-safe": { "version": "5.0.1", @@ -8137,7 +8163,8 @@ "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true }, "semver-diff": { "version": "3.1.1", @@ -8783,14 +8810,6 @@ "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": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", @@ -9028,9 +9047,9 @@ } }, "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", "requires": { "punycode": "^2.1.0" } @@ -9291,6 +9310,12 @@ "yargs-parser": "^13.1.1" }, "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": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -9316,7 +9341,17 @@ "dev": true, "requires": { "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": { diff --git a/package.json b/package.json index 83fa670..3a49347 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,11 @@ "/bin" ], "dependencies": { - "@oclif/plugin-help": "3.1.0", - "@oclif/command": "1.7.0", + "@oclif/command": "1.8.0", "@oclif/config": "1.16.0", + "@oclif/plugin-help": "3.1.0", "@oclif/plugin-warn-if-update-available": "1.7.0", + "ajv": "7.0.0-beta.6", "beau-std": "0.9.4", "cli-color": "2.0.0", "clui": "0.3.6", @@ -26,7 +27,6 @@ "dotenv": "8.2.0", "globby": "11.0.1", "is-plain-object": "4.1.0", - "joi": "14.3.1", "js-yaml": "3.14.0", "jsome": "2.5.0", "request": "2.88.2", @@ -36,9 +36,8 @@ "repository": "git@github.com:Seich/Beau.git", "devDependencies": { "jest": "24.9.0", - "strip-ansi": "5.2.0", - "jest-watch-typeahead": "0.6.0", "strip-ansi": "6.0.0", + "jest-watch-typeahead": "0.6.0", "np": "6.3.2" }, "oclif": { diff --git a/src/schema.json b/schema.json similarity index 100% rename from src/schema.json rename to schema.json