amplify-education / serverless-domain-manager

Serverless plugin for managing custom domains with API Gateways.
MIT License
941 stars 232 forks source link

Remove `serverless` peer dependency #496

Closed nolde closed 2 years ago

nolde commented 2 years ago

Community Note

Bug Report

Error Description The serverless package is listed as a peer dependency on your package.json. My team still uses sls@2, and as sls@3 has now been released and your matching rule is <4, the plugin is locally downloading a copy of version 3. As we have many serverless projects, we usually run it globally, reducing the size of npm downloads within our integration pipelines. Therefore, the peer dependency now impedes our deployments, generating an error.

Command Run sls deploy

Console Output

Serverless: Running "serverless" installed locally (in service node_modules)

 Serverless Error ----------------------------------------

  Cannot run local installation of the Serverless Framework by the outdated global version.
  Please upgrade via:

  npm install -g serverless
  Note: Latest release can run any version of the locally installed Serverless Framework.

  Alternatively run locally installed version directly via:

  npx serverless <command> <options>

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          win32
     Node Version:              14.17.5
     Framework Version:         2.72.3
     Plugin Version:            5.5.4
     SDK Version:               4.3.2
     Components Version:        3.18.2

Versions

Possible Solution I would argue that the peer dependency is not necessary at all, as it is not directly reference in your code, but merely injected through the plugin invocation. It is now also detrimental, as having it in there is hurting people with different setups.

My request is for the peer dependency to be completely removed, allowing developers to define how they want to use serverless.

rddimon commented 2 years ago

Hi @nolde

Thank you for your issue. Feel free to send changes we will review and merge it