Skip to content

Commit

Permalink
feat(CLI): Remove missing CLI options schema deprecation
Browse files Browse the repository at this point in the history
Instead signal inconsistency with a warning
  • Loading branch information
medikoo committed Sep 24, 2021
1 parent ffbdfed commit 5b38232
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions lib/cli/commands-schema/resolve-final.js
Expand Up @@ -8,11 +8,11 @@ const serviceCommands = require('./service');
const awsServiceCommands = require('./aws-service');
const serviceOptions = require('./common-options/service');
const awsServiceOptions = require('./common-options/aws-service');
const logDeprecation = require('../../utils/logDeprecation');
const { logWarning } = require('../../classes/Error');

const deprecatedEventPattern = /^deprecated#(.*?)(?:->(.*?))?$/;

module.exports = (loadedPlugins, { providerName, configuration }) => {
module.exports = (loadedPlugins, { providerName }) => {
const commands = new Map(providerName === 'aws' ? awsServiceCommands : serviceCommands);

if (providerName !== 'aws') {
Expand Down Expand Up @@ -112,18 +112,15 @@ module.exports = (loadedPlugins, { providerName, configuration }) => {
for (const loadedPlugin of loadedPlugins) resolveCommands(loadedPlugin, loadedPlugin);

if (missingOptionTypes.size) {
logDeprecation(
'CLI_OPTIONS_SCHEMA',
logWarning(
'CLI options definitions were upgraded with "type" property (which could be one of "string", "boolean", "multiple"). ' +
'Below listed plugins do not predefine type for introduced options:\n' +
` - ${Array.from(
missingOptionTypes,
([plugin, optionNames]) =>
`${plugin.constructor.name} for "${Array.from(optionNames).join('", "')}"`
).join('\n - ')}\n` +
'Please report this issue in plugin issue tracker.\n' +
'Starting with next major release, this will be communicated with a thrown error.',
{ serviceConfig: configuration }
).join('\n - ')}\n\n` +
'Please report this issue in plugin issue tracker.'
);
}

Expand Down

0 comments on commit 5b38232

Please sign in to comment.