{"action":"created","issue":{"url":"https://api.github.com/repos/shama/grunt-openport/issues/1","labels_url":"https://api.github.com/repos/shama/grunt-openport/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/shama/grunt-openport/issues/1/comments","events_url":"https://api.github.com/repos/shama/grunt-openport/issues/1/events","html_url":"https://github.com/shama/grunt-openport/pull/1","id":119857471,"number":1,"title":"Register tasks async and save Promise openportPromise into grunt.option","user":{"login":"talee","id":6241941,"avatar_url":"https://avatars.githubusercontent.com/u/6241941?v=3","gravatar_id":"","url":"https://api.github.com/users/talee","html_url":"https://github.com/talee","followers_url":"https://api.github.com/users/talee/followers","following_url":"https://api.github.com/users/talee/following{/other_user}","gists_url":"https://api.github.com/users/talee/gists{/gist_id}","starred_url":"https://api.github.com/users/talee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talee/subscriptions","organizations_url":"https://api.github.com/users/talee/orgs","repos_url":"https://api.github.com/users/talee/repos","events_url":"https://api.github.com/users/talee/events{/privacy}","received_events_url":"https://api.github.com/users/talee/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-02T03:09:30Z","updated_at":"2015-12-02T03:18:51Z","closed_at":"2015-12-02T03:18:51Z","pull_request":{"url":"https://api.github.com/repos/shama/grunt-openport/pulls/1","html_url":"https://github.com/shama/grunt-openport/pull/1","diff_url":"https://github.com/shama/grunt-openport/pull/1.diff","patch_url":"https://github.com/shama/grunt-openport/pull/1.patch"},"body":"to allow initConfig to be executed after the Promise resolves. This is\r\nneeded by grunt libraries like load-grunt-config where the config is\r\nloaded before the openport tasks completes. Using openport's specific\r\ntask overrides is insufficient as sometimes tasks use the port to do\r\ninternal configuration.\r\n\r\nAn example of this in use in a clean Gruntfile.js:\r\n\r\n    module.exports = function(grunt) {\r\n      require('jit-grunt')(grunt);\r\n      require('time-grunt')(grunt);\r\n      grunt.loadNpmTasks('grunt-openport');\r\n      grunt.task.run('openport:port:10000');\r\n      grunt.option('openportPromise').then(() => {\r\n        require('load-grunt-config')(grunt, {\r\n          jitGrunt: true\r\n        });\r\n      });\r\n    };\r\n\r\nLet me know if you any other ideas on achieving something this.\r\n\r\nUse this link to ignore whitespace: https://github.com/talee/grunt-openport/commit/27248d870a6f5b0cc87953abaff1ae8da96be32a?w=1"},"comment":{"url":"https://api.github.com/repos/shama/grunt-openport/issues/comments/161167171","html_url":"https://github.com/shama/grunt-openport/pull/1#issuecomment-161167171","issue_url":"https://api.github.com/repos/shama/grunt-openport/issues/1","id":161167171,"user":{"login":"shama","id":99604,"avatar_url":"https://avatars.githubusercontent.com/u/99604?v=3","gravatar_id":"","url":"https://api.github.com/users/shama","html_url":"https://github.com/shama","followers_url":"https://api.github.com/users/shama/followers","following_url":"https://api.github.com/users/shama/following{/other_user}","gists_url":"https://api.github.com/users/shama/gists{/gist_id}","starred_url":"https://api.github.com/users/shama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shama/subscriptions","organizations_url":"https://api.github.com/users/shama/orgs","repos_url":"https://api.github.com/users/shama/repos","events_url":"https://api.github.com/users/shama/events{/privacy}","received_events_url":"https://api.github.com/users/shama/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T03:18:51Z","updated_at":"2015-12-02T03:18:51Z","body":"Interesting idea but it deviates from the Grunt API which is the primary reason someone would use this Grunt task.\r\n\r\nSomething like this would be better suited as it's own library and maybe even just using an [existing openport](https://www.npmjs.com/search?q=openport) library with promises.\r\n\r\nOr another idea is to write a more generic library that converts a Grunt task to use promises and then each task wouldn't need to deviate from the Grunt API and support two different APIs. The user can just choose what they prefer.\r\n\r\nThanks anyways!"}}