{"action":"closed","number":85,"pull_request":{"url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/pulls/85","id":212374481,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyMzc0NDgx","html_url":"https://github.com/ExLibrisGroup/primo-explore-devenv/pull/85","diff_url":"https://github.com/ExLibrisGroup/primo-explore-devenv/pull/85.diff","patch_url":"https://github.com/ExLibrisGroup/primo-explore-devenv/pull/85.patch","issue_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/issues/85","number":85,"state":"closed","locked":false,"title":"[New Version of PR #62] Correct order of files when concatenating custom Javascript files to custom.js in case custom Html templates are used.","user":{"login":"meinbrodt","id":18439455,"node_id":"MDQ6VXNlcjE4NDM5NDU1","avatar_url":"https://avatars2.githubusercontent.com/u/18439455?v=4","gravatar_id":"","url":"https://api.github.com/users/meinbrodt","html_url":"https://github.com/meinbrodt","followers_url":"https://api.github.com/users/meinbrodt/followers","following_url":"https://api.github.com/users/meinbrodt/following{/other_user}","gists_url":"https://api.github.com/users/meinbrodt/gists{/gist_id}","starred_url":"https://api.github.com/users/meinbrodt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meinbrodt/subscriptions","organizations_url":"https://api.github.com/users/meinbrodt/orgs","repos_url":"https://api.github.com/users/meinbrodt/repos","events_url":"https://api.github.com/users/meinbrodt/events{/privacy}","received_events_url":"https://api.github.com/users/meinbrodt/received_events","type":"User","site_admin":false},"body":"Hi, \r\n\r\nthis is a polished version of the [pull request #62](https://github.com/ExLibrisGroup/primo-explore-devenv/pull/62). The problem it addresses remains (see description below).\r\n\r\n---\r\n\r\n**Preliminary Remarks:**\r\n\r\n- regards the build logic without browserify support. \r\n- might also regard accepted pull request #46 and pending pull request #61 \r\n\r\n**Workflow of custom template creation**\r\n\r\nWhen custome Html templates are defined (either in external npm modules or as part of a template package, the `custom-html-templates` tasks creates the file `customTemplates.js` in the `js` folder of the template package. It has the following contents\r\n\r\nThis file has the following contents:\r\n```\r\napp.run(function($templateCache) {\r\n  $templateCache.put('[ID of custom template]','[HTML of custom template]');\r\n  ...\r\n});\r\n```\r\nSubsequently, this file is concatenated by the `custom-js` task with all other Javascript files present in the `js` directory of the template package to a single Javascript file called `custom.js` which is then saved also in the already mentioned `js`.\r\n\r\n**The problem** \r\n\r\n(1) The `customTemplates.js` contains Javscript code that calls the `run` method on an custom angular module referenced by the variable `app`. \r\n\r\n(2) In order for the Javascript code in the final concatenated `custom.js` file to work properly, the code contained in the `customTemplates.js` file needs to be placed after the code contained in the file that is responsible for instantiating the angular module and assigning it to the variable `app`. Otherwise an error will be thrown.\r\n\r\n(3) Right now the code that instantiates the angular module and assigns it to the variable `app` is defined in a file called `main.js` (At least that is my assumption). Given the fact that the `custom-js` tasks concatenates files in alphabetical order, the Javascript code in the `customTemplates.js` file will be placed before the Javascript code in the `main.js` file, causing an error to be throwing that signals that the variable `app` is not defined. \r\n\r\n**The solutions**\r\n\r\n(1) Put the code that instantiates the custom angular module and binds it to the variable `app` in a file that in alphabetical order comes before the file `customTemplates.js`. It is quite easy to do, however not very intiutive, since the aforementioned behaviour is nowhere clearly documented.\r\n\r\n(2) Provided, that the code which instantiates the custom angular module and binds it to the variable `app` is put in a file called `main.js`, change the order of the files before they are concatenated.\r\n\r\nThis pull request offers an implementation of solution 2 using `gulp-order`.\r\n\r\nBest regards, Matthias\r\n \r\n\r\n","created_at":"2018-08-31T12:55:32Z","updated_at":"2018-12-11T09:58:58Z","closed_at":"2018-12-11T09:58:58Z","merged_at":null,"merge_commit_sha":"0ab433b6be5ccc1029d6250302b8fea815476bc9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/pulls/85/commits","review_comments_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/pulls/85/comments","review_comment_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/issues/85/comments","statuses_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/statuses/efd6a6cf90f0e7002f256bf86391bf260aa29773","head":{"label":"meinbrodt:fix-js-build-order","ref":"fix-js-build-order","sha":"efd6a6cf90f0e7002f256bf86391bf260aa29773","user":{"login":"meinbrodt","id":18439455,"node_id":"MDQ6VXNlcjE4NDM5NDU1","avatar_url":"https://avatars2.githubusercontent.com/u/18439455?v=4","gravatar_id":"","url":"https://api.github.com/users/meinbrodt","html_url":"https://github.com/meinbrodt","followers_url":"https://api.github.com/users/meinbrodt/followers","following_url":"https://api.github.com/users/meinbrodt/following{/other_user}","gists_url":"https://api.github.com/users/meinbrodt/gists{/gist_id}","starred_url":"https://api.github.com/users/meinbrodt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meinbrodt/subscriptions","organizations_url":"https://api.github.com/users/meinbrodt/orgs","repos_url":"https://api.github.com/users/meinbrodt/repos","events_url":"https://api.github.com/users/meinbrodt/events{/privacy}","received_events_url":"https://api.github.com/users/meinbrodt/received_events","type":"User","site_admin":false},"repo":{"id":98189395,"node_id":"MDEwOlJlcG9zaXRvcnk5ODE4OTM5NQ==","name":"primo-explore-devenv","full_name":"meinbrodt/primo-explore-devenv","private":false,"owner":{"login":"meinbrodt","id":18439455,"node_id":"MDQ6VXNlcjE4NDM5NDU1","avatar_url":"https://avatars2.githubusercontent.com/u/18439455?v=4","gravatar_id":"","url":"https://api.github.com/users/meinbrodt","html_url":"https://github.com/meinbrodt","followers_url":"https://api.github.com/users/meinbrodt/followers","following_url":"https://api.github.com/users/meinbrodt/following{/other_user}","gists_url":"https://api.github.com/users/meinbrodt/gists{/gist_id}","starred_url":"https://api.github.com/users/meinbrodt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meinbrodt/subscriptions","organizations_url":"https://api.github.com/users/meinbrodt/orgs","repos_url":"https://api.github.com/users/meinbrodt/repos","events_url":"https://api.github.com/users/meinbrodt/events{/privacy}","received_events_url":"https://api.github.com/users/meinbrodt/received_events","type":"User","site_admin":false},"html_url":"https://github.com/meinbrodt/primo-explore-devenv","description":"A node.js , gulp based development enviornment for Primo's new UI customizations (css,images,html and javascript)","fork":true,"url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv","forks_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/forks","keys_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/teams","hooks_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/hooks","issue_events_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/issues/events{/number}","events_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/events","assignees_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/assignees{/user}","branches_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/branches{/branch}","tags_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/tags","blobs_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/git/refs{/sha}","trees_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/statuses/{sha}","languages_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/languages","stargazers_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/stargazers","contributors_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/contributors","subscribers_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/subscribers","subscription_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/subscription","commits_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/commits{/sha}","git_commits_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/git/commits{/sha}","comments_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/comments{/number}","issue_comment_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/issues/comments{/number}","contents_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/contents/{+path}","compare_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/merges","archive_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/downloads","issues_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/issues{/number}","pulls_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/pulls{/number}","milestones_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/milestones{/number}","notifications_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/labels{/name}","releases_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/releases{/id}","deployments_url":"https://api.github.com/repos/meinbrodt/primo-explore-devenv/deployments","created_at":"2017-07-24T12:42:01Z","updated_at":"2018-11-26T09:39:49Z","pushed_at":"2018-11-26T09:41:39Z","git_url":"git://github.com/meinbrodt/primo-explore-devenv.git","ssh_url":"git@github.com:meinbrodt/primo-explore-devenv.git","clone_url":"https://github.com/meinbrodt/primo-explore-devenv.git","svn_url":"https://github.com/meinbrodt/primo-explore-devenv","homepage":null,"size":502,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ExLibrisGroup:master","ref":"master","sha":"f558ad761515a4f76bd0bcb98236f5c15767aa93","user":{"login":"ExLibrisGroup","id":6702670,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3MDI2NzA=","avatar_url":"https://avatars2.githubusercontent.com/u/6702670?v=4","gravatar_id":"","url":"https://api.github.com/users/ExLibrisGroup","html_url":"https://github.com/ExLibrisGroup","followers_url":"https://api.github.com/users/ExLibrisGroup/followers","following_url":"https://api.github.com/users/ExLibrisGroup/following{/other_user}","gists_url":"https://api.github.com/users/ExLibrisGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/ExLibrisGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExLibrisGroup/subscriptions","organizations_url":"https://api.github.com/users/ExLibrisGroup/orgs","repos_url":"https://api.github.com/users/ExLibrisGroup/repos","events_url":"https://api.github.com/users/ExLibrisGroup/events{/privacy}","received_events_url":"https://api.github.com/users/ExLibrisGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":64392570,"node_id":"MDEwOlJlcG9zaXRvcnk2NDM5MjU3MA==","name":"primo-explore-devenv","full_name":"ExLibrisGroup/primo-explore-devenv","private":false,"owner":{"login":"ExLibrisGroup","id":6702670,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3MDI2NzA=","avatar_url":"https://avatars2.githubusercontent.com/u/6702670?v=4","gravatar_id":"","url":"https://api.github.com/users/ExLibrisGroup","html_url":"https://github.com/ExLibrisGroup","followers_url":"https://api.github.com/users/ExLibrisGroup/followers","following_url":"https://api.github.com/users/ExLibrisGroup/following{/other_user}","gists_url":"https://api.github.com/users/ExLibrisGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/ExLibrisGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExLibrisGroup/subscriptions","organizations_url":"https://api.github.com/users/ExLibrisGroup/orgs","repos_url":"https://api.github.com/users/ExLibrisGroup/repos","events_url":"https://api.github.com/users/ExLibrisGroup/events{/privacy}","received_events_url":"https://api.github.com/users/ExLibrisGroup/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ExLibrisGroup/primo-explore-devenv","description":"A node.js , gulp based development enviornment for Primo's new UI customizations (css,images,html and javascript)","fork":false,"url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv","forks_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/forks","keys_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/teams","hooks_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/hooks","issue_events_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/issues/events{/number}","events_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/events","assignees_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/assignees{/user}","branches_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/branches{/branch}","tags_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/tags","blobs_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/git/refs{/sha}","trees_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/statuses/{sha}","languages_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/languages","stargazers_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/stargazers","contributors_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/contributors","subscribers_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/subscribers","subscription_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/subscription","commits_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/commits{/sha}","git_commits_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/git/commits{/sha}","comments_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/comments{/number}","issue_comment_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/issues/comments{/number}","contents_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/contents/{+path}","compare_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/merges","archive_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/downloads","issues_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/issues{/number}","pulls_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/pulls{/number}","milestones_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/milestones{/number}","notifications_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/labels{/name}","releases_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/releases{/id}","deployments_url":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/deployments","created_at":"2016-07-28T12:09:36Z","updated_at":"2018-12-10T02:09:29Z","pushed_at":"2018-11-29T20:03:38Z","git_url":"git://github.com/ExLibrisGroup/primo-explore-devenv.git","ssh_url":"git@github.com:ExLibrisGroup/primo-explore-devenv.git","clone_url":"https://github.com/ExLibrisGroup/primo-explore-devenv.git","svn_url":"https://github.com/ExLibrisGroup/primo-explore-devenv","homepage":null,"size":31238,"stargazers_count":64,"watchers_count":64,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"archived":false,"open_issues_count":22,"license":null,"forks":48,"open_issues":22,"watchers":64,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/pulls/85"},"html":{"href":"https://github.com/ExLibrisGroup/primo-explore-devenv/pull/85"},"issue":{"href":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/issues/85"},"comments":{"href":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/issues/85/comments"},"review_comments":{"href":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/pulls/85/comments"},"review_comment":{"href":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/pulls/85/commits"},"statuses":{"href":"https://api.github.com/repos/ExLibrisGroup/primo-explore-devenv/statuses/efd6a6cf90f0e7002f256bf86391bf260aa29773"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":true,"rebaseable":true,"mergeable_state":"clean","merged_by":null,"comments":1,"review_comments":2,"maintainer_can_modify":false,"commits":4,"additions":18,"deletions":2,"changed_files":3}}
{"actor":{"display_login":"gilax"}}