{"action":"closed","issue":{"url":"https://api.github.com/repos/serverless/serverless/issues/428","labels_url":"https://api.github.com/repos/serverless/serverless/issues/428/labels{/name}","comments_url":"https://api.github.com/repos/serverless/serverless/issues/428/comments","events_url":"https://api.github.com/repos/serverless/serverless/issues/428/events","html_url":"https://github.com/serverless/serverless/issues/428","id":123925118,"number":428,"title":"Centralize dependency management","user":{"login":"joostfarla","id":851863,"avatar_url":"https://avatars.githubusercontent.com/u/851863?v=3","gravatar_id":"","url":"https://api.github.com/users/joostfarla","html_url":"https://github.com/joostfarla","followers_url":"https://api.github.com/users/joostfarla/followers","following_url":"https://api.github.com/users/joostfarla/following{/other_user}","gists_url":"https://api.github.com/users/joostfarla/gists{/gist_id}","starred_url":"https://api.github.com/users/joostfarla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joostfarla/subscriptions","organizations_url":"https://api.github.com/users/joostfarla/orgs","repos_url":"https://api.github.com/users/joostfarla/repos","events_url":"https://api.github.com/users/joostfarla/events{/privacy}","received_events_url":"https://api.github.com/users/joostfarla/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-12-26T11:09:52Z","updated_at":"2016-01-06T19:12:09Z","closed_at":"2016-01-06T19:12:09Z","body":"Each module has its own `package.json` and `node_modules` directory now. In many cases, you would also want a `package.json` in the `plugins` dir and in the root of the project or `back` dir.\r\n\r\nThis approach is very uncommon and introduces the following issues:\r\n\r\n- When doing a fresh checkout of a project (especially when working in teams), it's not easy to install all dependencies of all modules, plugins and sometimes also global dependencies. Obviously, there could be written a command for this, but I don't think this solves the problem of maintainability. This will also become an issue when you want to update all your dependencies to new (minor) versions.\r\n\r\n- When creating plugins, you want to be able to do stuff with or based on the Node modules (globally) installed in the project. By spreading all these module roots across the project, modules and plugins won't be able to find each others dependencies. Example issue: https://github.com/serverless/serverless-optimizer-plugin/pull/1/files#r48463508\r\n\r\n- Lots of dependencies are needed in multiple modules. This results in a lot of duplication in the working directory while developing. Also a lot of the same steps have to be repeated for each module to install, update or configure dependencies.\r\n\r\nExample use case: Let's say I want to build a RESTful API. It would make a lot of sense to create a module for each *resource*, containing all CRUD operations for that resource. A lot of dependencies, like DB access, error handling, logging etc are needed across all resources/modules.\r\n\r\nI'm feeling the decentralized approach adds extra unnecessary complexity and confusion. My proposal would be to centralize the dependency management, having a single `package.json` and `node_modules` in the root of the project."}}