{"action":"created","issue":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/245","repository_url":"https://api.github.com/repos/facebookincubator/create-react-app","labels_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/245/labels{/name}","comments_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/245/comments","events_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/245/events","html_url":"https://github.com/facebookincubator/create-react-app/pull/245","id":167970631,"number":245,"title":"WIP: Add a 'run' script","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/CLA%20Signed","name":"CLA Signed","color":"009900"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-07-27T22:21:29Z","updated_at":"2016-07-30T00:57:21Z","closed_at":"2016-07-30T00:57:21Z","pull_request":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/pulls/245","html_url":"https://github.com/facebookincubator/create-react-app/pull/245","diff_url":"https://github.com/facebookincubator/create-react-app/pull/245.diff","patch_url":"https://github.com/facebookincubator/create-react-app/pull/245.patch"},"body":"This adds a `run` script so that you can invoke a script in the same ES6-and-React-compatible environment you get when you run `npm start`, but in node.\r\n\r\nTo run a script:\r\n* Put your script in `src`, like at `src/foobar.js`\r\n* `react-scripts run foobar.js`\r\n\r\nI wanted to get feedback if this seems like it's headed in the right direction. In particular are these decisions the right behavior:\r\n\r\n* This doesn't compile node_modules.\r\n* This doesn't set NODE_ENV.\r\n* This stores the compiled files in a global temp directory.\r\n* This doesn't automatically polyfill `fetch`.\r\n\r\nThings that I'm pretty sure are *not* the ideal behavior but can be improved later:\r\n* This doesn't cache anything\r\n* No sourcemaps\r\n* No arguments are passed to the script\r\n\r\nIt seems like a lot of the behavior will be similar between \"run a one-off script\" and \"run unit tests\" so perhaps we should have some underlying library that is shared between this and testing like https://github.com/facebookincubator/create-react-app/pull/216 ."},"comment":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/comments/236328278","html_url":"https://github.com/facebookincubator/create-react-app/pull/245#issuecomment-236328278","issue_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/245","id":236328278,"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},"created_at":"2016-07-30T00:57:21Z","updated_at":"2016-07-30T00:57:21Z","body":"There is no real use for running a script that imports a css or image file, at least not with these null stubs. I just thought it is frustrating to have two slightly different ways something can run, and you have files that you can import in one environment but not in others. The real use case for this however is using shared library functions, not shared React components. You might inadvertently be exporting some useful functions in a file you want to require for your script, but it's probably poor style.\r\n\r\nOK so I am convinced the webpack-based way is not the way to go. We should probably just start with something like the simple babel wrapper, see if the lack of handling css and image imports is actually a big problem, and we can always enhance the script runtime later. I will close this one and open a new PR"}}
{"actor":{"display_login":"lacker"}}