{"action":"created","comment":{"url":"https://api.github.com/repos/cocos-creator/engine/pulls/comments/68183080","id":68183080,"diff_hunk":"@@ -0,0 +1,147 @@\n+[\n+  {\n+    \"name\": \"Core\",\n+    \"locked\": true,\n+    \"includes\": []\n+  },\n+  {\n+    \"name\": \"Canvas\",\n+    \"locked\": true,\n+    \"includes\": [","path":"module.json","position":10,"original_position":10,"commit_id":"a772bdf730747c40b02876d03ee4ab18ab736e2e","original_commit_id":"a772bdf730747c40b02876d03ee4ab18ab736e2e","user":{"login":"jareguo","id":1503156,"avatar_url":"https://avatars.githubusercontent.com/u/1503156?v=3","gravatar_id":"","url":"https://api.github.com/users/jareguo","html_url":"https://github.com/jareguo","followers_url":"https://api.github.com/users/jareguo/followers","following_url":"https://api.github.com/users/jareguo/following{/other_user}","gists_url":"https://api.github.com/users/jareguo/gists{/gist_id}","starred_url":"https://api.github.com/users/jareguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jareguo/subscriptions","organizations_url":"https://api.github.com/users/jareguo/orgs","repos_url":"https://api.github.com/users/jareguo/repos","events_url":"https://api.github.com/users/jareguo/events{/privacy}","received_events_url":"https://api.github.com/users/jareguo/received_events","type":"User","site_admin":false},"body":"和 browserify 文档一样叫 entries 吧？表明这是入口，includes 感觉只有一个文件的样子。","created_at":"2016-06-23T06:48:51Z","updated_at":"2016-06-23T06:48:51Z","html_url":"https://github.com/cocos-creator/engine/pull/822#discussion_r68183080","pull_request_url":"https://api.github.com/repos/cocos-creator/engine/pulls/822","_links":{"self":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/comments/68183080"},"html":{"href":"https://github.com/cocos-creator/engine/pull/822#discussion_r68183080"},"pull_request":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/822"}}},"pull_request":{"url":"https://api.github.com/repos/cocos-creator/engine/pulls/822","id":74902055,"html_url":"https://github.com/cocos-creator/engine/pull/822","diff_url":"https://github.com/cocos-creator/engine/pull/822.diff","patch_url":"https://github.com/cocos-creator/engine/pull/822.patch","issue_url":"https://api.github.com/repos/cocos-creator/engine/issues/822","number":822,"state":"open","locked":false,"title":"模块化GULP任务，以及定义引擎模块入口","user":{"login":"VisualSJ","id":7113508,"avatar_url":"https://avatars.githubusercontent.com/u/7113508?v=3","gravatar_id":"","url":"https://api.github.com/users/VisualSJ","html_url":"https://github.com/VisualSJ","followers_url":"https://api.github.com/users/VisualSJ/followers","following_url":"https://api.github.com/users/VisualSJ/following{/other_user}","gists_url":"https://api.github.com/users/VisualSJ/gists{/gist_id}","starred_url":"https://api.github.com/users/VisualSJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VisualSJ/subscriptions","organizations_url":"https://api.github.com/users/VisualSJ/orgs","repos_url":"https://api.github.com/users/VisualSJ/repos","events_url":"https://api.github.com/users/VisualSJ/events{/privacy}","received_events_url":"https://api.github.com/users/VisualSJ/received_events","type":"User","site_admin":false},"body":"## gulp \r\n\r\n之前的结构是任务分散注册，越写越多后，造成了之前的代码非常晦涩，而且经常找不到任务注册在哪，有哪些任务，任务具体内容也需要一层一层的跟踪才能知道。\r\n\r\n现在进行了一些优化：\r\n\r\n- 将任务分成各个模块，模块内不注册 gulp 任务，只是定义任务内容\r\n- 去除全局变量，全局变量在 nodejs 里几乎是个蛋疼的存在，搞到后面很可能都不知道哪里引用错误了\r\n- 去除部分过度代码封装，在一个任务内，应该让后来的维护者一眼能看出任务的内容\r\n- 所有任务都在 gulpfile.js 里面注册，并且没有具体的任务内容，一眼就能看到任务列表以及依赖\r\n\r\n模块化的的初衷是复用这些 task 任务，在构建过程中，可以直接调用这些方法来生成需要的文件，而不用像之前一样开启一个进程，不管是维护还是新增功能都更简单清晰。\r\n\r\n## engine\r\n\r\n因为需要模块化裁剪引擎，而引擎内包含模块化和未模块化的文件，所以增加了两个文件：\r\n\r\n- module.json 这个文件内定义的是按 component 划分的模块列表，以及包含的模块文件\r\n- modular-cocos2d-cut.js 这个文件是用于组合裁剪后的未模块化的文件。在正常打包任务中，会排除这个文件，只在构建的时候，根据模块重新组合这个文件，并排除 modular-cocos2d.js 这个文件。\r\n\r\ngulp 命令都运行了一遍，测试中没有错误信息。编辑器预览也木有问题。构建因为代码被我改了，暂时没有测试。之后修改优化后再上传\r\n\r\n@jareguo @jwu @nantas \r\n\r\n因为改动比较多，我这里测试木有发现问题，麻烦大家有空的时候 review 一下，顺带看看 gulp 出来的东西有没有问题。\r\n\r\nhttps://github.com/cocos-creator/fireball/issues/3236","created_at":"2016-06-23T06:28:54Z","updated_at":"2016-06-23T06:48:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8188d8d993022903a9fc2c342f117fc2787e52a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cocos-creator/engine/pulls/822/commits","review_comments_url":"https://api.github.com/repos/cocos-creator/engine/pulls/822/comments","review_comment_url":"https://api.github.com/repos/cocos-creator/engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cocos-creator/engine/issues/822/comments","statuses_url":"https://api.github.com/repos/cocos-creator/engine/statuses/a772bdf730747c40b02876d03ee4ab18ab736e2e","head":{"label":"VisualSJ:master_modular","ref":"master_modular","sha":"a772bdf730747c40b02876d03ee4ab18ab736e2e","user":{"login":"VisualSJ","id":7113508,"avatar_url":"https://avatars.githubusercontent.com/u/7113508?v=3","gravatar_id":"","url":"https://api.github.com/users/VisualSJ","html_url":"https://github.com/VisualSJ","followers_url":"https://api.github.com/users/VisualSJ/followers","following_url":"https://api.github.com/users/VisualSJ/following{/other_user}","gists_url":"https://api.github.com/users/VisualSJ/gists{/gist_id}","starred_url":"https://api.github.com/users/VisualSJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VisualSJ/subscriptions","organizations_url":"https://api.github.com/users/VisualSJ/orgs","repos_url":"https://api.github.com/users/VisualSJ/repos","events_url":"https://api.github.com/users/VisualSJ/events{/privacy}","received_events_url":"https://api.github.com/users/VisualSJ/received_events","type":"User","site_admin":false},"repo":{"id":54621717,"name":"engine-1","full_name":"VisualSJ/engine-1","owner":{"login":"VisualSJ","id":7113508,"avatar_url":"https://avatars.githubusercontent.com/u/7113508?v=3","gravatar_id":"","url":"https://api.github.com/users/VisualSJ","html_url":"https://github.com/VisualSJ","followers_url":"https://api.github.com/users/VisualSJ/followers","following_url":"https://api.github.com/users/VisualSJ/following{/other_user}","gists_url":"https://api.github.com/users/VisualSJ/gists{/gist_id}","starred_url":"https://api.github.com/users/VisualSJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VisualSJ/subscriptions","organizations_url":"https://api.github.com/users/VisualSJ/orgs","repos_url":"https://api.github.com/users/VisualSJ/repos","events_url":"https://api.github.com/users/VisualSJ/events{/privacy}","received_events_url":"https://api.github.com/users/VisualSJ/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/VisualSJ/engine-1","description":"The engine for Cocos Creator","fork":true,"url":"https://api.github.com/repos/VisualSJ/engine-1","forks_url":"https://api.github.com/repos/VisualSJ/engine-1/forks","keys_url":"https://api.github.com/repos/VisualSJ/engine-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VisualSJ/engine-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VisualSJ/engine-1/teams","hooks_url":"https://api.github.com/repos/VisualSJ/engine-1/hooks","issue_events_url":"https://api.github.com/repos/VisualSJ/engine-1/issues/events{/number}","events_url":"https://api.github.com/repos/VisualSJ/engine-1/events","assignees_url":"https://api.github.com/repos/VisualSJ/engine-1/assignees{/user}","branches_url":"https://api.github.com/repos/VisualSJ/engine-1/branches{/branch}","tags_url":"https://api.github.com/repos/VisualSJ/engine-1/tags","blobs_url":"https://api.github.com/repos/VisualSJ/engine-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VisualSJ/engine-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VisualSJ/engine-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/VisualSJ/engine-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VisualSJ/engine-1/statuses/{sha}","languages_url":"https://api.github.com/repos/VisualSJ/engine-1/languages","stargazers_url":"https://api.github.com/repos/VisualSJ/engine-1/stargazers","contributors_url":"https://api.github.com/repos/VisualSJ/engine-1/contributors","subscribers_url":"https://api.github.com/repos/VisualSJ/engine-1/subscribers","subscription_url":"https://api.github.com/repos/VisualSJ/engine-1/subscription","commits_url":"https://api.github.com/repos/VisualSJ/engine-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/VisualSJ/engine-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/VisualSJ/engine-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/VisualSJ/engine-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/VisualSJ/engine-1/contents/{+path}","compare_url":"https://api.github.com/repos/VisualSJ/engine-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VisualSJ/engine-1/merges","archive_url":"https://api.github.com/repos/VisualSJ/engine-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VisualSJ/engine-1/downloads","issues_url":"https://api.github.com/repos/VisualSJ/engine-1/issues{/number}","pulls_url":"https://api.github.com/repos/VisualSJ/engine-1/pulls{/number}","milestones_url":"https://api.github.com/repos/VisualSJ/engine-1/milestones{/number}","notifications_url":"https://api.github.com/repos/VisualSJ/engine-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VisualSJ/engine-1/labels{/name}","releases_url":"https://api.github.com/repos/VisualSJ/engine-1/releases{/id}","deployments_url":"https://api.github.com/repos/VisualSJ/engine-1/deployments","created_at":"2016-03-24T07:03:57Z","updated_at":"2016-03-24T07:04:01Z","pushed_at":"2016-06-23T06:08:11Z","git_url":"git://github.com/VisualSJ/engine-1.git","ssh_url":"git@github.com:VisualSJ/engine-1.git","clone_url":"https://github.com/VisualSJ/engine-1.git","svn_url":"https://github.com/VisualSJ/engine-1","homepage":"http://www.cocos2d-x.org/creator","size":24210,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cocos-creator:master","ref":"master","sha":"5ec40dfc9288c6f2309579b7c3dead406be3f663","user":{"login":"cocos-creator","id":6937061,"avatar_url":"https://avatars.githubusercontent.com/u/6937061?v=3","gravatar_id":"","url":"https://api.github.com/users/cocos-creator","html_url":"https://github.com/cocos-creator","followers_url":"https://api.github.com/users/cocos-creator/followers","following_url":"https://api.github.com/users/cocos-creator/following{/other_user}","gists_url":"https://api.github.com/users/cocos-creator/gists{/gist_id}","starred_url":"https://api.github.com/users/cocos-creator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocos-creator/subscriptions","organizations_url":"https://api.github.com/users/cocos-creator/orgs","repos_url":"https://api.github.com/users/cocos-creator/repos","events_url":"https://api.github.com/users/cocos-creator/events{/privacy}","received_events_url":"https://api.github.com/users/cocos-creator/received_events","type":"Organization","site_admin":false},"repo":{"id":47440536,"name":"engine","full_name":"cocos-creator/engine","owner":{"login":"cocos-creator","id":6937061,"avatar_url":"https://avatars.githubusercontent.com/u/6937061?v=3","gravatar_id":"","url":"https://api.github.com/users/cocos-creator","html_url":"https://github.com/cocos-creator","followers_url":"https://api.github.com/users/cocos-creator/followers","following_url":"https://api.github.com/users/cocos-creator/following{/other_user}","gists_url":"https://api.github.com/users/cocos-creator/gists{/gist_id}","starred_url":"https://api.github.com/users/cocos-creator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocos-creator/subscriptions","organizations_url":"https://api.github.com/users/cocos-creator/orgs","repos_url":"https://api.github.com/users/cocos-creator/repos","events_url":"https://api.github.com/users/cocos-creator/events{/privacy}","received_events_url":"https://api.github.com/users/cocos-creator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cocos-creator/engine","description":"The engine for Cocos Creator","fork":false,"url":"https://api.github.com/repos/cocos-creator/engine","forks_url":"https://api.github.com/repos/cocos-creator/engine/forks","keys_url":"https://api.github.com/repos/cocos-creator/engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cocos-creator/engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cocos-creator/engine/teams","hooks_url":"https://api.github.com/repos/cocos-creator/engine/hooks","issue_events_url":"https://api.github.com/repos/cocos-creator/engine/issues/events{/number}","events_url":"https://api.github.com/repos/cocos-creator/engine/events","assignees_url":"https://api.github.com/repos/cocos-creator/engine/assignees{/user}","branches_url":"https://api.github.com/repos/cocos-creator/engine/branches{/branch}","tags_url":"https://api.github.com/repos/cocos-creator/engine/tags","blobs_url":"https://api.github.com/repos/cocos-creator/engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cocos-creator/engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cocos-creator/engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/cocos-creator/engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cocos-creator/engine/statuses/{sha}","languages_url":"https://api.github.com/repos/cocos-creator/engine/languages","stargazers_url":"https://api.github.com/repos/cocos-creator/engine/stargazers","contributors_url":"https://api.github.com/repos/cocos-creator/engine/contributors","subscribers_url":"https://api.github.com/repos/cocos-creator/engine/subscribers","subscription_url":"https://api.github.com/repos/cocos-creator/engine/subscription","commits_url":"https://api.github.com/repos/cocos-creator/engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/cocos-creator/engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/cocos-creator/engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/cocos-creator/engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/cocos-creator/engine/contents/{+path}","compare_url":"https://api.github.com/repos/cocos-creator/engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cocos-creator/engine/merges","archive_url":"https://api.github.com/repos/cocos-creator/engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cocos-creator/engine/downloads","issues_url":"https://api.github.com/repos/cocos-creator/engine/issues{/number}","pulls_url":"https://api.github.com/repos/cocos-creator/engine/pulls{/number}","milestones_url":"https://api.github.com/repos/cocos-creator/engine/milestones{/number}","notifications_url":"https://api.github.com/repos/cocos-creator/engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cocos-creator/engine/labels{/name}","releases_url":"https://api.github.com/repos/cocos-creator/engine/releases{/id}","deployments_url":"https://api.github.com/repos/cocos-creator/engine/deployments","created_at":"2015-12-05T03:28:59Z","updated_at":"2016-06-21T12:53:55Z","pushed_at":"2016-06-23T06:28:54Z","git_url":"git://github.com/cocos-creator/engine.git","ssh_url":"git@github.com:cocos-creator/engine.git","clone_url":"https://github.com/cocos-creator/engine.git","svn_url":"https://github.com/cocos-creator/engine","homepage":"http://www.cocos2d-x.org/creator","size":24908,"stargazers_count":80,"watchers_count":80,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":9,"forks":38,"open_issues":9,"watchers":80,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/822"},"html":{"href":"https://github.com/cocos-creator/engine/pull/822"},"issue":{"href":"https://api.github.com/repos/cocos-creator/engine/issues/822"},"comments":{"href":"https://api.github.com/repos/cocos-creator/engine/issues/822/comments"},"review_comments":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/822/comments"},"review_comment":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/822/commits"},"statuses":{"href":"https://api.github.com/repos/cocos-creator/engine/statuses/a772bdf730747c40b02876d03ee4ab18ab736e2e"}}}}
{"actor":{"display_login":"jareguo"}}