{"action":"created","issue":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/218","repository_url":"https://api.github.com/repos/facebookincubator/create-react-app","labels_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/218/comments","events_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/218/events","html_url":"https://github.com/facebookincubator/create-react-app/issues/218","id":167650444,"number":218,"title":"Proposal: `run` and `watch` scripts to use different entry points","user":{"login":"lacker","id":106475,"avatar_url":"https://avatars.githubusercontent.com/u/106475?v=3","gravatar_id":"","url":"https://api.github.com/users/lacker","html_url":"https://github.com/lacker","followers_url":"https://api.github.com/users/lacker/followers","following_url":"https://api.github.com/users/lacker/following{/other_user}","gists_url":"https://api.github.com/users/lacker/gists{/gist_id}","starred_url":"https://api.github.com/users/lacker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lacker/subscriptions","organizations_url":"https://api.github.com/users/lacker/orgs","repos_url":"https://api.github.com/users/lacker/repos","events_url":"https://api.github.com/users/lacker/events{/privacy}","received_events_url":"https://api.github.com/users/lacker/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebookincubator/create-react-app/labels/discussion","name":"discussion","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-07-26T16:20:04Z","updated_at":"2016-09-30T17:35:43Z","closed_at":"2016-09-03T19:44:43Z","body":"As I start to build out real apps I find cases where I want to run a one-off script using the same language features as the rest of my app. If the only way to enter my code is via `npm start` then there's no way to do this.\r\n\r\nThe proposed solution is to add two more scripts, `react-scripts run` and `react-scripts watch` that the developer can use to make their own npm script which uses the same babel environment. For example, let's say you had a script `src/populate.js` to populate initial data in a remote backend. You could add to your npm scripts:\r\n\r\n    \"scripts\": {\r\n        \"start\": \"react-scripts start\",\r\n        \"build\": \"react-scripts build\",\r\n        \"eject\": \"react-scripts eject\",\r\n        \"populate\": \"react-scripts run src/populate.js\"\r\n      },\r\n\r\nand then when you ran `npm run populate` it would invoke `src/populate.js` but do all the babel preprocessing to let you use ES6 features. `watch` would work just like `run`, but when any file changed it would restart the process. So `watch` would be used for long-running processes; `run` would be used for one-off scripts. `run` here works similarly to `rails run` if you are familiar with rails.\r\n\r\nWithout this sort of feature, developers are likely to make these one-off scripts using ES5 or using whatever language subset is node-compatible. This would also be a useful hook for people who wanted to build node server functionality, while not forcing it on anyone.\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/comments/250805469","html_url":"https://github.com/facebookincubator/create-react-app/issues/218#issuecomment-250805469","issue_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/218","id":250805469,"user":{"login":"tslater","id":449326,"avatar_url":"https://avatars.githubusercontent.com/u/449326?v=3","gravatar_id":"","url":"https://api.github.com/users/tslater","html_url":"https://github.com/tslater","followers_url":"https://api.github.com/users/tslater/followers","following_url":"https://api.github.com/users/tslater/following{/other_user}","gists_url":"https://api.github.com/users/tslater/gists{/gist_id}","starred_url":"https://api.github.com/users/tslater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tslater/subscriptions","organizations_url":"https://api.github.com/users/tslater/orgs","repos_url":"https://api.github.com/users/tslater/repos","events_url":"https://api.github.com/users/tslater/events{/privacy}","received_events_url":"https://api.github.com/users/tslater/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T17:35:43Z","updated_at":"2016-09-30T17:35:43Z","body":"We're using a mono-repo and link local dependencies within the same repo for fast development. It's sometimes helpful to run watch on dependent module and develop on it while running it as a dependency. I think this would be a nice feature to have."}}
{"actor":{"display_login":"tslater"}}