{"action":"created","issue":{"url":"https://api.github.com/repos/kadamwhite/p5-cli/issues/13","labels_url":"https://api.github.com/repos/kadamwhite/p5-cli/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/kadamwhite/p5-cli/issues/13/comments","events_url":"https://api.github.com/repos/kadamwhite/p5-cli/issues/13/events","html_url":"https://github.com/kadamwhite/p5-cli/issues/13","id":82794484,"number":13,"title":"Separate cli from lib / p5?","user":{"login":"cowboy","id":54051,"avatar_url":"https://avatars.githubusercontent.com/u/54051?v=3","gravatar_id":"","url":"https://api.github.com/users/cowboy","html_url":"https://github.com/cowboy","followers_url":"https://api.github.com/users/cowboy/followers","following_url":"https://api.github.com/users/cowboy/following{/other_user}","gists_url":"https://api.github.com/users/cowboy/gists{/gist_id}","starred_url":"https://api.github.com/users/cowboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cowboy/subscriptions","organizations_url":"https://api.github.com/users/cowboy/orgs","repos_url":"https://api.github.com/users/cowboy/repos","events_url":"https://api.github.com/users/cowboy/events{/privacy}","received_events_url":"https://api.github.com/users/cowboy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kadamwhite/p5-cli/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-30T11:57:51Z","updated_at":"2015-06-01T00:32:24Z","closed_at":null,"body":"Right now, the cli includes `p5@0.4.5`, but what happens when `p5@0.5.0` comes out? Sure, you can publish a new version of `p5-cli` that incorporates the new `p5` changes, but what if some of those changes break backwards compatibility?\r\n\r\nUsers will either have to:\r\n\r\n* un-install and re-install different versions of this tool to be able to work with projects that are dependent on different versions of p5\r\n* not upgrade to the latest version of this tool\r\n* upgrade older p5 projects to use them with the latest version of this tool\r\n\r\nIf the cli tool no longer contained p5, it could use the p5 the user has installed locally. Although maybe this is just a command-line flag that allows the user to specify an alternate `p5.js` file (crisis averted?)\r\n\r\nAlso, if the code that does all the serving was broken out into a separate lib that this tool references or consumed, someone could use it that lib programmatically in their node app or build process. Maybe the core code could just be an express middleware that the lib consumes!\r\n\r\nAnyways, see @tkellen's https://github.com/tkellen/js-liftoff for examples on how separate lib from cli, if you're interested!"},"comment":{"url":"https://api.github.com/repos/kadamwhite/p5-cli/issues/comments/107268590","html_url":"https://github.com/kadamwhite/p5-cli/issues/13#issuecomment-107268590","issue_url":"https://api.github.com/repos/kadamwhite/p5-cli/issues/13","id":107268590,"user":{"login":"tkellen","id":1004324,"avatar_url":"https://avatars.githubusercontent.com/u/1004324?v=3","gravatar_id":"","url":"https://api.github.com/users/tkellen","html_url":"https://github.com/tkellen","followers_url":"https://api.github.com/users/tkellen/followers","following_url":"https://api.github.com/users/tkellen/following{/other_user}","gists_url":"https://api.github.com/users/tkellen/gists{/gist_id}","starred_url":"https://api.github.com/users/tkellen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkellen/subscriptions","organizations_url":"https://api.github.com/users/tkellen/orgs","repos_url":"https://api.github.com/users/tkellen/repos","events_url":"https://api.github.com/users/tkellen/events{/privacy}","received_events_url":"https://api.github.com/users/tkellen/received_events","type":"User","site_admin":false},"created_at":"2015-06-01T00:32:24Z","updated_at":"2015-06-01T00:32:24Z","body":"@kadamwhite \r\n\r\nHave you considered a setup step like `p5 init`? It would ask for a project name and create a `package.json` with a p5 devDep and a sketch file with some minimal functioning thing in it using the name.\r\n\r\nIf you ran `p5 sketch` immediately after, you could detect if p5 was installed and prompt the user to run `npm install` if no local dep was found (or `npm init` if no package.json was found).\r\n\r\nI think this minimal amount of ceremony would be worthwhile for someone new to programming--especially if they picked up p5 after setting it down for 6 months only to find the thing they built didn't work because of a global versioning difference.\r\n\r\nI'd be happy to provide some examples code for how Liftoff might make some of this easier, if you want. No worries if not, though. I  think it's great how you're trying to lower the barrier of entry for this project!"}}