{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback-next/issues/1263","repository_url":"https://api.github.com/repos/strongloop/loopback-next","labels_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1263/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1263/comments","events_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1263/events","html_url":"https://github.com/strongloop/loopback-next/pull/1263","id":314873229,"number":1263,"title":"feat(build): add an option to copy non ts files to outDir","user":{"login":"virkt25","id":3311536,"avatar_url":"https://avatars1.githubusercontent.com/u/3311536?v=4","gravatar_id":"","url":"https://api.github.com/users/virkt25","html_url":"https://github.com/virkt25","followers_url":"https://api.github.com/users/virkt25/followers","following_url":"https://api.github.com/users/virkt25/following{/other_user}","gists_url":"https://api.github.com/users/virkt25/gists{/gist_id}","starred_url":"https://api.github.com/users/virkt25/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/virkt25/subscriptions","organizations_url":"https://api.github.com/users/virkt25/orgs","repos_url":"https://api.github.com/users/virkt25/repos","events_url":"https://api.github.com/users/virkt25/events{/privacy}","received_events_url":"https://api.github.com/users/virkt25/received_events","type":"User","site_admin":false},"labels":[{"id":570635292,"url":"https://api.github.com/repos/strongloop/loopback-next/labels/review","name":"review","color":"eeeeee","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-17T01:33:32Z","updated_at":"2018-04-17T15:13:50Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/strongloop/loopback-next/pulls/1263","html_url":"https://github.com/strongloop/loopback-next/pull/1263","diff_url":"https://github.com/strongloop/loopback-next/pull/1263.diff","patch_url":"https://github.com/strongloop/loopback-next/pull/1263.patch"},"body":"Copies non-.ts files (json, images, text, etc.) to the outDir (dist) so file paths can remain relative. Does so for the `include` directories listed in `tsconfig.json`.\r\n\r\nCreated from the Boot Spike. PR #1261 \r\n\r\n**TODO**\r\n- [ ] Document flag usage once implementation has been agreed to.\r\n\r\n\r\n## Checklist\r\n\r\n- [ ] `npm test` passes on your machine\r\n- [ ] New tests added or existing tests modified to cover all changes\r\n- [ ] Code conforms with the [style guide](http://loopback.io/doc/en/contrib/style-guide.html)\r\n- [ ] API Documentation in code was updated\r\n- [ ] Documentation in [/docs/site](../tree/master/docs/site) was updated\r\n- [ ] Affected artifact templates in `packages/cli` were updated\r\n- [ ] Affected example projects in `examples/*` were updated\r\n"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback-next/issues/comments/382029780","html_url":"https://github.com/strongloop/loopback-next/pull/1263#issuecomment-382029780","issue_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1263","id":382029780,"user":{"login":"virkt25","id":3311536,"avatar_url":"https://avatars1.githubusercontent.com/u/3311536?v=4","gravatar_id":"","url":"https://api.github.com/users/virkt25","html_url":"https://github.com/virkt25","followers_url":"https://api.github.com/users/virkt25/followers","following_url":"https://api.github.com/users/virkt25/following{/other_user}","gists_url":"https://api.github.com/users/virkt25/gists{/gist_id}","starred_url":"https://api.github.com/users/virkt25/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/virkt25/subscriptions","organizations_url":"https://api.github.com/users/virkt25/orgs","repos_url":"https://api.github.com/users/virkt25/repos","events_url":"https://api.github.com/users/virkt25/events{/privacy}","received_events_url":"https://api.github.com/users/virkt25/received_events","type":"User","site_admin":false},"created_at":"2018-04-17T15:13:50Z","updated_at":"2018-04-17T15:13:50Z","author_association":"CONTRIBUTOR","body":"Thanks for the detailed response and alternatives @bajtos ! \r\n\r\n> I think we should honor this philosophy and do not add file-copying feature to our lb-tsc wrapper.\r\n\r\nI agree with their philosophy (do one thing well) but I also think the intention of our wrapper was for us to be able to enhance `tsc` as well. \r\n\r\nWhile I like the idea of using the `copyfiles` package as a stand alone script ... it adds another dependency for a user project which I think we should avoid. And the same goes for adding another script called `lb-copy-resources` which could abstract this ... because now a user needs to know what that script is for. Not to mention that we would have to assume the original folder is the `src` folder in this case.\r\n\r\nWhat if `--copy-resources` accepted an optional glob pattern to limit the types of files that were copied? If it's not present then all files should be copied. I can see the argument for not wanting to copy over unnecessary files but for deployment I think someone may want to only have the `dist` folder pushed to the server using CI in which case it's probably best to copy all files. \r\n\r\nI think the more seamless experience we can provide in as few commands as possible the better. It took me a while to realize my App wasn't working because the Booter wasn't finding any `json` files because they weren't in the dist folder ... since we hide the `dist` folder and I was like the json filve is very clearly there in the folder. So I would like to avoid the same situation for a user who might remove the script / flag because they don't understand what it does. Because the Booter won't fail ... the app will for not having a binding and the user would've expected it to be created by the Booter. (My reason for initially not even having a flag to enable `copy-resources`). \r\n\r\nMaybe we should have a disable flag instead? And one for options. Enabled by default? Or a warning if it's disabled and `boot` is installed. Otherwise declarative support can become very frustrating (for artifacts that should be booted but don't get booted since they aren't in the `dist` folder). \r\n\r\nAnd is it reasonable for users to know what artifact globs they should have? (Even if provided by default ... I think it becomes too easy for a user to make a mistake and break their app). And what can a user have in a `src` folder that is something that shouldn't be moved to the `dist` folder?"}}
{"actor":{"display_login":"virkt25"}}