diff --git a/lib/classes/PluginManager.js b/lib/classes/PluginManager.js index 905d8e057a5..da8e9641ee9 100644 --- a/lib/classes/PluginManager.js +++ b/lib/classes/PluginManager.js @@ -352,17 +352,7 @@ class PluginManager { if (pluginInstance.commands) { Object.entries(pluginInstance.commands).forEach(([key, details]) => { const command = this.loadCommand(pluginName, details, key); - // Grab and extract deprecated events - command.lifecycleEvents = (command.lifecycleEvents || []).map((event) => { - if (event.startsWith('deprecated#')) { - // Extract event and optional redirect - const transformedEvent = /^deprecated#(.*?)(?:->(.*?))?$/.exec(event); - this.deprecatedEvents[`${command.key}:${transformedEvent[1]}`] = - transformedEvent[2] || null; - return transformedEvent[1]; - } - return event; - }); + if (!command.lifecycleEvents) command.lifecycleEvents = []; this.commands[key] = mergeCommands( this.commands[key], _.merge({}, command, { diff --git a/lib/cli/commands-schema/aws-service.js b/lib/cli/commands-schema/aws-service.js index bbe204be31a..3ddd19168d4 100644 --- a/lib/cli/commands-schema/aws-service.js +++ b/lib/cli/commands-schema/aws-service.js @@ -35,17 +35,7 @@ commands.set('deploy', { type: 'boolean', }, }, - // TODO: Remove deprecated events with v3 - lifecycleEvents: [ - 'deprecated#cleanup->package:cleanup', - 'deprecated#initialize->package:initialize', - 'deprecated#setupProviderConfiguration->package:setupProviderConfiguration', - 'deprecated#createDeploymentArtifacts->package:createDeploymentArtifacts', - 'deprecated#compileFunctions->package:compileFunctions', - 'deprecated#compileEvents->package:compileEvents', - 'deploy', - 'finalize', - ], + lifecycleEvents: ['deploy', 'finalize'], }); commands.set('deploy function', { diff --git a/lib/cli/commands-schema/resolve-final.js b/lib/cli/commands-schema/resolve-final.js index 4a5c2fe809c..bd712db57ed 100644 --- a/lib/cli/commands-schema/resolve-final.js +++ b/lib/cli/commands-schema/resolve-final.js @@ -11,8 +11,6 @@ const awsServiceOptions = require('./common-options/aws-service'); const { logWarning } = require('../../classes/Error'); const { log } = require('@serverless/utils/log'); -const deprecatedEventPattern = /^deprecated#(.*?)(?:->(.*?))?$/; - module.exports = (loadedPlugins, { providerName }) => { const commands = new Map(providerName === 'aws' ? awsServiceCommands : serviceCommands); @@ -28,9 +26,6 @@ module.exports = (loadedPlugins, { providerName }) => { .map(([name, schema]) => { const lifecycleEventNamePrefix = name.split(' ').join(':'); return (schema.lifecycleEvents || []).map((lifecycleEventBaseName) => { - if (lifecycleEventBaseName.startsWith('deprecated#')) { - lifecycleEventBaseName = lifecycleEventBaseName.match(deprecatedEventPattern)[1]; - } const lifecycleEventName = `${lifecycleEventNamePrefix}:${lifecycleEventBaseName}`; return [ [`before:${lifecycleEventName}`, name],