{"action":"created","comment":{"url":"https://api.github.com/repos/fourkitchens/emulsify/pulls/comments/193085182","pull_request_review_id":125985275,"id":193085182,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzA4NTE4Mg==","diff_hunk":"@@ -5,5 +5,20 @@\n  */\n \n $function = new Twig_SimpleFunction('attach_library', function ($string) {\n-  return $string;\n-});\n+  // Get Library Name from string.\n+  $libraryName = substr($string, strpos($string, \"/\") + 1);\n+\n+  // Search dist root directory for library.\n+  $files = glob('dist/*/' . $libraryName . '/' . $libraryName . '*.js');","path":"components/_twig-components/functions/pl_attach-library.function.php","position":10,"original_position":10,"commit_id":"fa632a326017912c7475295f7a600a969d8cb646","original_commit_id":"fa632a326017912c7475295f7a600a969d8cb646","user":{"login":"ccjjmartin","id":12279982,"node_id":"MDQ6VXNlcjEyMjc5OTgy","avatar_url":"https://avatars3.githubusercontent.com/u/12279982?v=4","gravatar_id":"","url":"https://api.github.com/users/ccjjmartin","html_url":"https://github.com/ccjjmartin","followers_url":"https://api.github.com/users/ccjjmartin/followers","following_url":"https://api.github.com/users/ccjjmartin/following{/other_user}","gists_url":"https://api.github.com/users/ccjjmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/ccjjmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccjjmartin/subscriptions","organizations_url":"https://api.github.com/users/ccjjmartin/orgs","repos_url":"https://api.github.com/users/ccjjmartin/repos","events_url":"https://api.github.com/users/ccjjmartin/events{/privacy}","received_events_url":"https://api.github.com/users/ccjjmartin/received_events","type":"User","site_admin":false},"body":"Do we care about the situations where $libraryName is different from the file name?","created_at":"2018-06-05T14:07:22Z","updated_at":"2018-06-05T14:13:04Z","html_url":"https://github.com/fourkitchens/emulsify/pull/245#discussion_r193085182","pull_request_url":"https://api.github.com/repos/fourkitchens/emulsify/pulls/245","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/fourkitchens/emulsify/pulls/comments/193085182"},"html":{"href":"https://github.com/fourkitchens/emulsify/pull/245#discussion_r193085182"},"pull_request":{"href":"https://api.github.com/repos/fourkitchens/emulsify/pulls/245"}}},"pull_request":{"url":"https://api.github.com/repos/fourkitchens/emulsify/pulls/245","id":192128996,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMTI4OTk2","html_url":"https://github.com/fourkitchens/emulsify/pull/245","diff_url":"https://github.com/fourkitchens/emulsify/pull/245.diff","patch_url":"https://github.com/fourkitchens/emulsify/pull/245.patch","issue_url":"https://api.github.com/repos/fourkitchens/emulsify/issues/245","number":245,"state":"open","locked":false,"title":"65: Attach Library used in Pattern Lab","user":{"login":"evanmwillhite","id":18293479,"node_id":"MDQ6VXNlcjE4MjkzNDc5","avatar_url":"https://avatars1.githubusercontent.com/u/18293479?v=4","gravatar_id":"","url":"https://api.github.com/users/evanmwillhite","html_url":"https://github.com/evanmwillhite","followers_url":"https://api.github.com/users/evanmwillhite/followers","following_url":"https://api.github.com/users/evanmwillhite/following{/other_user}","gists_url":"https://api.github.com/users/evanmwillhite/gists{/gist_id}","starred_url":"https://api.github.com/users/evanmwillhite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evanmwillhite/subscriptions","organizations_url":"https://api.github.com/users/evanmwillhite/orgs","repos_url":"https://api.github.com/users/evanmwillhite/repos","events_url":"https://api.github.com/users/evanmwillhite/events{/privacy}","received_events_url":"https://api.github.com/users/evanmwillhite/received_events","type":"User","site_admin":false},"body":"This adds support for Pattern Lab to use attach_library instead of using a global JavaScript file. It adds the scripts inline into the component via the existing Twig function. This will allow us to remove the styleguide-scripts gulp task - see https://github.com/fourkitchens/emulsify-gulp/issues/65. Here's the companion PR for this task in Emulsify Gulp: https://github.com/fourkitchens/emulsify-gulp/pull/77\r\n\r\n**Adds, Changes**:\r\n- Changes `attach_library` function from a passthrough to a useful function for Pattern Lab, accepting the library name using the same syntax as Drupal and searching for the correct file in the `dist` directory by that name.\r\n- Changes relevant component files to use that attach_library function (and removes from Drupal tpl)\r\n- Removes styleguide-scripts file reference from PL footer\r\n- Random: Adds minified SVG file from https://github.com/fourkitchens/emulsify-gulp/pull/76.\r\n\r\n**To test:**\r\n- [ ] Checkout this branch in your Emulsify instance and use the `65-remove-styleguide-scripts` branch in Emulsify Gulp\r\n- [ ] Run `yarn start` and ensure no errors\r\n- [ ] View any existing components using JS ([accordion](http://localhost:3000/pattern-lab/public/?p=viewall-molecules-accordion-item), [menu](http://localhost:3000/pattern-lab/public/?p=molecules-main-menu)) and ensure they still work\r\n- [ ] View the menu component in a local Drupal instance using Emulsify and verify it is still loading correctly.\r\n\r\n**Questions**\r\n- Is there a better way to handle [this](https://github.com/fourkitchens/emulsify/blob/35f3ec71ddc4609cf05387b5b4f2d4bb49af1028/components/_twig-components/functions/pl_attach-library.function.php#L10-L13) for recursive searches?\r\n","created_at":"2018-06-01T20:01:04Z","updated_at":"2018-06-05T14:13:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bc7b96174989dc752ee0cd4868627d2380474446","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":758194993,"node_id":"MDU6TGFiZWw3NTgxOTQ5OTM=","url":"https://api.github.com/repos/fourkitchens/emulsify/labels/Priority:%20Low","name":"Priority: Low","color":"c2e0c6","default":false},{"id":758198315,"node_id":"MDU6TGFiZWw3NTgxOTgzMTU=","url":"https://api.github.com/repos/fourkitchens/emulsify/labels/Status:%20Review%20Needed","name":"Status: Review Needed","color":"EAE435","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/fourkitchens/emulsify/pulls/245/commits","review_comments_url":"https://api.github.com/repos/fourkitchens/emulsify/pulls/245/comments","review_comment_url":"https://api.github.com/repos/fourkitchens/emulsify/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fourkitchens/emulsify/issues/245/comments","statuses_url":"https://api.github.com/repos/fourkitchens/emulsify/statuses/fa632a326017912c7475295f7a600a969d8cb646","head":{"label":"fourkitchens:65-attach-library","ref":"65-attach-library","sha":"fa632a326017912c7475295f7a600a969d8cb646","user":{"login":"fourkitchens","id":348885,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0ODg4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/348885?v=4","gravatar_id":"","url":"https://api.github.com/users/fourkitchens","html_url":"https://github.com/fourkitchens","followers_url":"https://api.github.com/users/fourkitchens/followers","following_url":"https://api.github.com/users/fourkitchens/following{/other_user}","gists_url":"https://api.github.com/users/fourkitchens/gists{/gist_id}","starred_url":"https://api.github.com/users/fourkitchens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fourkitchens/subscriptions","organizations_url":"https://api.github.com/users/fourkitchens/orgs","repos_url":"https://api.github.com/users/fourkitchens/repos","events_url":"https://api.github.com/users/fourkitchens/events{/privacy}","received_events_url":"https://api.github.com/users/fourkitchens/received_events","type":"Organization","site_admin":false},"repo":{"id":65416944,"node_id":"MDEwOlJlcG9zaXRvcnk2NTQxNjk0NA==","name":"emulsify","full_name":"fourkitchens/emulsify","owner":{"login":"fourkitchens","id":348885,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0ODg4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/348885?v=4","gravatar_id":"","url":"https://api.github.com/users/fourkitchens","html_url":"https://github.com/fourkitchens","followers_url":"https://api.github.com/users/fourkitchens/followers","following_url":"https://api.github.com/users/fourkitchens/following{/other_user}","gists_url":"https://api.github.com/users/fourkitchens/gists{/gist_id}","starred_url":"https://api.github.com/users/fourkitchens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fourkitchens/subscriptions","organizations_url":"https://api.github.com/users/fourkitchens/orgs","repos_url":"https://api.github.com/users/fourkitchens/repos","events_url":"https://api.github.com/users/fourkitchens/events{/privacy}","received_events_url":"https://api.github.com/users/fourkitchens/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fourkitchens/emulsify","description":"Emulsify: Pattern Lab + Drupal 8","fork":false,"url":"https://api.github.com/repos/fourkitchens/emulsify","forks_url":"https://api.github.com/repos/fourkitchens/emulsify/forks","keys_url":"https://api.github.com/repos/fourkitchens/emulsify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fourkitchens/emulsify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fourkitchens/emulsify/teams","hooks_url":"https://api.github.com/repos/fourkitchens/emulsify/hooks","issue_events_url":"https://api.github.com/repos/fourkitchens/emulsify/issues/events{/number}","events_url":"https://api.github.com/repos/fourkitchens/emulsify/events","assignees_url":"https://api.github.com/repos/fourkitchens/emulsify/assignees{/user}","branches_url":"https://api.github.com/repos/fourkitchens/emulsify/branches{/branch}","tags_url":"https://api.github.com/repos/fourkitchens/emulsify/tags","blobs_url":"https://api.github.com/repos/fourkitchens/emulsify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fourkitchens/emulsify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fourkitchens/emulsify/git/refs{/sha}","trees_url":"https://api.github.com/repos/fourkitchens/emulsify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fourkitchens/emulsify/statuses/{sha}","languages_url":"https://api.github.com/repos/fourkitchens/emulsify/languages","stargazers_url":"https://api.github.com/repos/fourkitchens/emulsify/stargazers","contributors_url":"https://api.github.com/repos/fourkitchens/emulsify/contributors","subscribers_url":"https://api.github.com/repos/fourkitchens/emulsify/subscribers","subscription_url":"https://api.github.com/repos/fourkitchens/emulsify/subscription","commits_url":"https://api.github.com/repos/fourkitchens/emulsify/commits{/sha}","git_commits_url":"https://api.github.com/repos/fourkitchens/emulsify/git/commits{/sha}","comments_url":"https://api.github.com/repos/fourkitchens/emulsify/comments{/number}","issue_comment_url":"https://api.github.com/repos/fourkitchens/emulsify/issues/comments{/number}","contents_url":"https://api.github.com/repos/fourkitchens/emulsify/contents/{+path}","compare_url":"https://api.github.com/repos/fourkitchens/emulsify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fourkitchens/emulsify/merges","archive_url":"https://api.github.com/repos/fourkitchens/emulsify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fourkitchens/emulsify/downloads","issues_url":"https://api.github.com/repos/fourkitchens/emulsify/issues{/number}","pulls_url":"https://api.github.com/repos/fourkitchens/emulsify/pulls{/number}","milestones_url":"https://api.github.com/repos/fourkitchens/emulsify/milestones{/number}","notifications_url":"https://api.github.com/repos/fourkitchens/emulsify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fourkitchens/emulsify/labels{/name}","releases_url":"https://api.github.com/repos/fourkitchens/emulsify/releases{/id}","deployments_url":"https://api.github.com/repos/fourkitchens/emulsify/deployments","created_at":"2016-08-10T21:14:26Z","updated_at":"2018-06-01T20:33:06Z","pushed_at":"2018-06-04T21:35:22Z","git_url":"git://github.com/fourkitchens/emulsify.git","ssh_url":"git@github.com:fourkitchens/emulsify.git","clone_url":"https://github.com/fourkitchens/emulsify.git","svn_url":"https://github.com/fourkitchens/emulsify","homepage":"http://emulsify.info/","size":3534,"stargazers_count":107,"watchers_count":107,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":49,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":49,"open_issues":31,"watchers":107,"default_branch":"develop"}},"base":{"label":"fourkitchens:develop","ref":"develop","sha":"30d76f2fba26a77017089a9df30d1bca97693bb6","user":{"login":"fourkitchens","id":348885,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0ODg4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/348885?v=4","gravatar_id":"","url":"https://api.github.com/users/fourkitchens","html_url":"https://github.com/fourkitchens","followers_url":"https://api.github.com/users/fourkitchens/followers","following_url":"https://api.github.com/users/fourkitchens/following{/other_user}","gists_url":"https://api.github.com/users/fourkitchens/gists{/gist_id}","starred_url":"https://api.github.com/users/fourkitchens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fourkitchens/subscriptions","organizations_url":"https://api.github.com/users/fourkitchens/orgs","repos_url":"https://api.github.com/users/fourkitchens/repos","events_url":"https://api.github.com/users/fourkitchens/events{/privacy}","received_events_url":"https://api.github.com/users/fourkitchens/received_events","type":"Organization","site_admin":false},"repo":{"id":65416944,"node_id":"MDEwOlJlcG9zaXRvcnk2NTQxNjk0NA==","name":"emulsify","full_name":"fourkitchens/emulsify","owner":{"login":"fourkitchens","id":348885,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0ODg4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/348885?v=4","gravatar_id":"","url":"https://api.github.com/users/fourkitchens","html_url":"https://github.com/fourkitchens","followers_url":"https://api.github.com/users/fourkitchens/followers","following_url":"https://api.github.com/users/fourkitchens/following{/other_user}","gists_url":"https://api.github.com/users/fourkitchens/gists{/gist_id}","starred_url":"https://api.github.com/users/fourkitchens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fourkitchens/subscriptions","organizations_url":"https://api.github.com/users/fourkitchens/orgs","repos_url":"https://api.github.com/users/fourkitchens/repos","events_url":"https://api.github.com/users/fourkitchens/events{/privacy}","received_events_url":"https://api.github.com/users/fourkitchens/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fourkitchens/emulsify","description":"Emulsify: Pattern Lab + Drupal 8","fork":false,"url":"https://api.github.com/repos/fourkitchens/emulsify","forks_url":"https://api.github.com/repos/fourkitchens/emulsify/forks","keys_url":"https://api.github.com/repos/fourkitchens/emulsify/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fourkitchens/emulsify/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fourkitchens/emulsify/teams","hooks_url":"https://api.github.com/repos/fourkitchens/emulsify/hooks","issue_events_url":"https://api.github.com/repos/fourkitchens/emulsify/issues/events{/number}","events_url":"https://api.github.com/repos/fourkitchens/emulsify/events","assignees_url":"https://api.github.com/repos/fourkitchens/emulsify/assignees{/user}","branches_url":"https://api.github.com/repos/fourkitchens/emulsify/branches{/branch}","tags_url":"https://api.github.com/repos/fourkitchens/emulsify/tags","blobs_url":"https://api.github.com/repos/fourkitchens/emulsify/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fourkitchens/emulsify/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fourkitchens/emulsify/git/refs{/sha}","trees_url":"https://api.github.com/repos/fourkitchens/emulsify/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fourkitchens/emulsify/statuses/{sha}","languages_url":"https://api.github.com/repos/fourkitchens/emulsify/languages","stargazers_url":"https://api.github.com/repos/fourkitchens/emulsify/stargazers","contributors_url":"https://api.github.com/repos/fourkitchens/emulsify/contributors","subscribers_url":"https://api.github.com/repos/fourkitchens/emulsify/subscribers","subscription_url":"https://api.github.com/repos/fourkitchens/emulsify/subscription","commits_url":"https://api.github.com/repos/fourkitchens/emulsify/commits{/sha}","git_commits_url":"https://api.github.com/repos/fourkitchens/emulsify/git/commits{/sha}","comments_url":"https://api.github.com/repos/fourkitchens/emulsify/comments{/number}","issue_comment_url":"https://api.github.com/repos/fourkitchens/emulsify/issues/comments{/number}","contents_url":"https://api.github.com/repos/fourkitchens/emulsify/contents/{+path}","compare_url":"https://api.github.com/repos/fourkitchens/emulsify/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fourkitchens/emulsify/merges","archive_url":"https://api.github.com/repos/fourkitchens/emulsify/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fourkitchens/emulsify/downloads","issues_url":"https://api.github.com/repos/fourkitchens/emulsify/issues{/number}","pulls_url":"https://api.github.com/repos/fourkitchens/emulsify/pulls{/number}","milestones_url":"https://api.github.com/repos/fourkitchens/emulsify/milestones{/number}","notifications_url":"https://api.github.com/repos/fourkitchens/emulsify/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fourkitchens/emulsify/labels{/name}","releases_url":"https://api.github.com/repos/fourkitchens/emulsify/releases{/id}","deployments_url":"https://api.github.com/repos/fourkitchens/emulsify/deployments","created_at":"2016-08-10T21:14:26Z","updated_at":"2018-06-01T20:33:06Z","pushed_at":"2018-06-04T21:35:22Z","git_url":"git://github.com/fourkitchens/emulsify.git","ssh_url":"git@github.com:fourkitchens/emulsify.git","clone_url":"https://github.com/fourkitchens/emulsify.git","svn_url":"https://github.com/fourkitchens/emulsify","homepage":"http://emulsify.info/","size":3534,"stargazers_count":107,"watchers_count":107,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":49,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":49,"open_issues":31,"watchers":107,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/fourkitchens/emulsify/pulls/245"},"html":{"href":"https://github.com/fourkitchens/emulsify/pull/245"},"issue":{"href":"https://api.github.com/repos/fourkitchens/emulsify/issues/245"},"comments":{"href":"https://api.github.com/repos/fourkitchens/emulsify/issues/245/comments"},"review_comments":{"href":"https://api.github.com/repos/fourkitchens/emulsify/pulls/245/comments"},"review_comment":{"href":"https://api.github.com/repos/fourkitchens/emulsify/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fourkitchens/emulsify/pulls/245/commits"},"statuses":{"href":"https://api.github.com/repos/fourkitchens/emulsify/statuses/fa632a326017912c7475295f7a600a969d8cb646"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"ccjjmartin"}}