{"action":"created","issue":{"url":"https://api.github.com/repos/beberlei/composer-monorepo-plugin/issues/25","repository_url":"https://api.github.com/repos/beberlei/composer-monorepo-plugin","labels_url":"https://api.github.com/repos/beberlei/composer-monorepo-plugin/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/beberlei/composer-monorepo-plugin/issues/25/comments","events_url":"https://api.github.com/repos/beberlei/composer-monorepo-plugin/issues/25/events","html_url":"https://github.com/beberlei/composer-monorepo-plugin/issues/25","id":137767246,"number":25,"title":"External dependencies in fiddler.json","user":{"login":"DHager","id":505957,"avatar_url":"https://avatars.githubusercontent.com/u/505957?v=3","gravatar_id":"","url":"https://api.github.com/users/DHager","html_url":"https://github.com/DHager","followers_url":"https://api.github.com/users/DHager/followers","following_url":"https://api.github.com/users/DHager/following{/other_user}","gists_url":"https://api.github.com/users/DHager/gists{/gist_id}","starred_url":"https://api.github.com/users/DHager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DHager/subscriptions","organizations_url":"https://api.github.com/users/DHager/orgs","repos_url":"https://api.github.com/users/DHager/repos","events_url":"https://api.github.com/users/DHager/events{/privacy}","received_events_url":"https://api.github.com/users/DHager/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-02T04:10:51Z","updated_at":"2016-03-02T12:51:56Z","closed_at":null,"body":"Currently you have to list all external dependencies together in the shared `composer.json`, however this does not make it clear what the needs are for any individual module (subfolder), and may cause the inclusion of unnecessary dependencies when only certain modules are desired. \r\n\r\n### Phase 1: Configuration\r\n\r\n- All composer-dependencies (and their versions) will *continue* to be listed in `composer.json`. \r\n- Each module's `fiddler.json` file shall support two new sections, `require` and `require-dev`. These sections contain an *array* of strings, where each string is the name of a composer-dependency that it relies upon.\r\n- Every `require` dependency in a `fiddler.json` must have a direct corresponding entry in the `require` section of `composer.json`.\r\n- Every `require-dev` dependency in a `fiddler.json` must have a corresponding entry in the `require-dev` *or* `require` sections of `composer.json`.\r\n- Every `require` or `require-dev` entry in `composer.json` that does not have *any* corresponding entry somewhere in at least one `fiddler.json` file should cause a warning message, since it may indicate an unnecessary or unclear dependency.\r\n\r\nThe benefit of this feature is that it documents how/why certain dependencies are necessary, by associating them with the particular modules that use them.\r\n\r\n### Phase 2: Affect on runtime behavior\r\n\r\nThis second part involves more tinkering with composer-internals and may not be feasible, but I'm writing it out as a \"cool to have\".\r\n\r\n- Each module's `vendor/autoload.php` file shall only try to load assets that are referenced (directly or transitively) via its `deps`, `require`, or `require-dev` sections. \r\n- This behavior should extend to `composer archive` with issue #18 , and affect what assets are present in the `vendor` folder."},"comment":{"url":"https://api.github.com/repos/beberlei/composer-monorepo-plugin/issues/comments/191228094","html_url":"https://github.com/beberlei/composer-monorepo-plugin/issues/25#issuecomment-191228094","issue_url":"https://api.github.com/repos/beberlei/composer-monorepo-plugin/issues/25","id":191228094,"user":{"login":"beberlei","id":26936,"avatar_url":"https://avatars.githubusercontent.com/u/26936?v=3","gravatar_id":"","url":"https://api.github.com/users/beberlei","html_url":"https://github.com/beberlei","followers_url":"https://api.github.com/users/beberlei/followers","following_url":"https://api.github.com/users/beberlei/following{/other_user}","gists_url":"https://api.github.com/users/beberlei/gists{/gist_id}","starred_url":"https://api.github.com/users/beberlei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beberlei/subscriptions","organizations_url":"https://api.github.com/users/beberlei/orgs","repos_url":"https://api.github.com/users/beberlei/repos","events_url":"https://api.github.com/users/beberlei/events{/privacy}","received_events_url":"https://api.github.com/users/beberlei/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T12:51:56Z","updated_at":"2016-03-02T12:51:56Z","body":"@DHager I don't understand exactly what you need for this issue, Phase 1+2 is already done exactly this way, the keys are called `deps` and `deps-dev` (rename better?) and the autoloader is adjusted to include only the dependencies that are listed in fiddler.json.\r\n\r\nWe could indeed warn about unused dependencies from composer.json, but that is more a nice to have."}}