From b162b1282a1e9d137e962124ef6cb51f83dd0092 Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Sun, 6 Aug 2017 22:29:36 -0500 Subject: [PATCH 01/31] Added info to composer.json. --- composer.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6bd8af47..932e2568 100644 --- a/composer.json +++ b/composer.json @@ -2,6 +2,7 @@ "name": "fourkitchens/emulsify", "description": "Project template for Drupal 8 themes", "type": "drupal-theme", + "homepage": "http://emulsify.info", "license": "MIT", "authors": [ { @@ -17,7 +18,7 @@ "role": "" }, { - "name": "Ben Teegarden", + "name": "Chris Martin", "role": "" }, { @@ -28,6 +29,10 @@ "repositories": [], "require": {}, "require-dev": {}, + "suggest": { + "drupal/components": "Required for components to work in Drupal.", + "drupal-pattern-lab/unified-twig-extensions": "Use our fork. Details here: " + }, "minimum-stability": "dev", "prefer-stable": true, "scripts": { From bbaead11f694f80ca47894a6c6b7a1fcdd2b7b2d Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Sun, 6 Aug 2017 22:55:51 -0500 Subject: [PATCH 02/31] Experimenting with requirements. --- composer.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 932e2568..6cec04c7 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,9 @@ } ], "repositories": [], - "require": {}, + "require": { + "drupal/components": "^1.0", + }, "require-dev": {}, "suggest": { "drupal/components": "Required for components to work in Drupal.", From baf52e4a2aa4289b3e5eceaeffd65cc5056decac Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Sun, 6 Aug 2017 22:59:39 -0500 Subject: [PATCH 03/31] Comma error. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6cec04c7..5d1c7e40 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ ], "repositories": [], "require": { - "drupal/components": "^1.0", + "drupal/components": "^1.0" }, "require-dev": {}, "suggest": { From b530754ac331efea74c2d20827ab8c7af77c2273 Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Sun, 6 Aug 2017 23:09:29 -0500 Subject: [PATCH 04/31] Attempting unified-twig-extensions requirement. --- composer.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 5d1c7e40..d26a6bb1 100644 --- a/composer.json +++ b/composer.json @@ -26,9 +26,15 @@ "role": "" } ], - "repositories": [], + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/evanmwillhite/unified-twig-extensions" + } + ], "require": { - "drupal/components": "^1.0" + "drupal/components": "^1.0", + "drupal-pattern-lab/unified-twig-extensions": "dev-develop" }, "require-dev": {}, "suggest": { From 501a9e8ef2ed1fa25f33f6fdf0d76a943a69566c Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Sun, 6 Aug 2017 23:16:37 -0500 Subject: [PATCH 05/31] Updated unified-twig-extensions repo. --- composer.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index d26a6bb1..825a3937 100644 --- a/composer.json +++ b/composer.json @@ -26,20 +26,20 @@ "role": "" } ], - "repositories": [ - { + "repositories": { + "unified-twig-extensions": { "type": "vcs", "url": "https://github.com/evanmwillhite/unified-twig-extensions" } - ], + }, "require": { - "drupal/components": "^1.0", - "drupal-pattern-lab/unified-twig-extensions": "dev-develop" + "drupal/components": "^1.0", + "drupal-pattern-lab/unified-twig-extensions": "dev-develop" }, "require-dev": {}, "suggest": { - "drupal/components": "Required for components to work in Drupal.", - "drupal-pattern-lab/unified-twig-extensions": "Use our fork. Details here: " + "drupal/components": "Required for components to work in Drupal.", + "drupal-pattern-lab/unified-twig-extensions": "Use our fork. Details here: " }, "minimum-stability": "dev", "prefer-stable": true, @@ -49,5 +49,5 @@ "post-install-cmd": [], "post-update-cmd": [] }, - "extra": {} + "extra": [] } From cc0de9416b58409678e0ce09e7a95223ccea2f66 Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Sun, 6 Aug 2017 23:20:04 -0500 Subject: [PATCH 06/31] Removed fork repo since it doesn't work here. --- composer.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 825a3937..e5deecf4 100644 --- a/composer.json +++ b/composer.json @@ -26,12 +26,7 @@ "role": "" } ], - "repositories": { - "unified-twig-extensions": { - "type": "vcs", - "url": "https://github.com/evanmwillhite/unified-twig-extensions" - } - }, + "repositories": {}, "require": { "drupal/components": "^1.0", "drupal-pattern-lab/unified-twig-extensions": "dev-develop" From b10bf8a14782a77a9730d18f513c79951d555b25 Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Sun, 6 Aug 2017 23:28:09 -0500 Subject: [PATCH 07/31] Testing post-install/update cmd. --- composer.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index e5deecf4..1702c056 100644 --- a/composer.json +++ b/composer.json @@ -41,8 +41,12 @@ "scripts": { "pre-install-cmd": [], "pre-update-cmd": [], - "post-install-cmd": [], - "post-update-cmd": [] + "post-install-cmd": { + "drush emulsify" + }, + "post-update-cmd": { + "drush emulsify" + } }, "extra": [] } From cef4d4098a7cfb7bdce163b8d948c0559ba202eb Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Sun, 6 Aug 2017 23:29:13 -0500 Subject: [PATCH 08/31] bracket fix. --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 1702c056..d8214f3d 100644 --- a/composer.json +++ b/composer.json @@ -41,12 +41,12 @@ "scripts": { "pre-install-cmd": [], "pre-update-cmd": [], - "post-install-cmd": { + "post-install-cmd": [ "drush emulsify" - }, - "post-update-cmd": { + ], + "post-update-cmd": [ "drush emulsify" - } + ] }, "extra": [] } From d8be175f56ace4d531870a193f5441840f491172 Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Mon, 7 Aug 2017 09:21:16 -0500 Subject: [PATCH 09/31] Updated authors and removed suggestions since they're requirements. --- composer.json | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index d8214f3d..4950abde 100644 --- a/composer.json +++ b/composer.json @@ -5,24 +5,24 @@ "homepage": "http://emulsify.info", "license": "MIT", "authors": [ - { - "name": "Evan Willhite", - "role": "" - }, { "name": "Brian Lewis", + "email": "", "role": "" }, { - "name": "Luke Herrington", + "name": "Chris Martin", + "email": "", "role": "" }, { - "name": "Chris Martin", + "name": "Evan Willhite", + "email": "", "role": "" }, { "name": "Randy Oest", + "email": "", "role": "" } ], @@ -32,10 +32,6 @@ "drupal-pattern-lab/unified-twig-extensions": "dev-develop" }, "require-dev": {}, - "suggest": { - "drupal/components": "Required for components to work in Drupal.", - "drupal-pattern-lab/unified-twig-extensions": "Use our fork. Details here: " - }, "minimum-stability": "dev", "prefer-stable": true, "scripts": { From 17c91e693297466657902afe9f4cc57467fd9cae Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Mon, 7 Aug 2017 09:25:35 -0500 Subject: [PATCH 10/31] Added emails and removed role from composer.json authors. --- composer.json | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 4950abde..c1eb2e1c 100644 --- a/composer.json +++ b/composer.json @@ -7,23 +7,19 @@ "authors": [ { "name": "Brian Lewis", - "email": "", - "role": "" + "email": "brian@fourkitchens.com" }, { "name": "Chris Martin", - "email": "", - "role": "" + "email": "chris.martin@fourkitchens.com" }, { "name": "Evan Willhite", - "email": "", - "role": "" + "email": "evan@fourkitchens.com" }, { "name": "Randy Oest", - "email": "", - "role": "" + "email": "randy@fourkitchens.com" } ], "repositories": {}, From 902abcd67aae2bf7376844965e38b410dbd46177 Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Wed, 9 Aug 2017 09:58:46 -0500 Subject: [PATCH 11/31] Remove pattern-lab from the files to copy to fix #118 --- emulsify.drush.inc | 1 - 1 file changed, 1 deletion(-) diff --git a/emulsify.drush.inc b/emulsify.drush.inc index e1cab245..e4785f11 100644 --- a/emulsify.drush.inc +++ b/emulsify.drush.inc @@ -166,7 +166,6 @@ function _emulsify_get_files_to_copy() { // Slim files and directories declaration. $slim_array = array( 'components', - 'pattern-lab', '.editorconfig', '.gitignore', '.stylelintrc', From 35918059e8fc36859c4397b41a9e2fcfec43f26e Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Wed, 9 Aug 2017 10:00:41 -0500 Subject: [PATCH 12/31] #112 Move components out of slim and breakpoints.yml and libraries.yml into slim --- emulsify.drush.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/emulsify.drush.inc b/emulsify.drush.inc index e4785f11..876129f6 100644 --- a/emulsify.drush.inc +++ b/emulsify.drush.inc @@ -130,9 +130,10 @@ function _emulsify_get_alterations($human_readable_name, $machine_name) { function _emulsify_get_files_to_alter() { // Slim files and directories declaration. $slim_array = array( - 'components', 'emulsify.info.yml', 'emulsify.theme', + 'emulsify.breakpoints.yml', + 'emulsify.libraries.yml', ); // If we would like to have a bare copy we use is slim option. if (drush_get_option('slim') === TRUE) { @@ -140,9 +141,8 @@ function _emulsify_get_files_to_alter() { } else { return array_merge($slim_array, array( + 'components', 'templates', - 'emulsify.breakpoints.yml', - 'emulsify.libraries.yml', 'README.md', )); } @@ -165,12 +165,13 @@ function _emulsify_get_files_to_alter() { function _emulsify_get_files_to_copy() { // Slim files and directories declaration. $slim_array = array( - 'components', '.editorconfig', '.gitignore', '.stylelintrc', 'emulsify.info.yml', 'emulsify.theme', + 'emulsify.breakpoints.yml', + 'emulsify.libraries.yml', 'gulpfile.js', 'package.json', 'yarn.lock', @@ -181,11 +182,10 @@ function _emulsify_get_files_to_copy() { } else { return array_merge($slim_array, array( + 'components', 'fonts', 'images', 'templates', - 'emulsify.breakpoints.yml', - 'emulsify.libraries.yml', 'README.md', 'screenshot.png', )); From fb76d9ec05eb9c4655831129b9334f6e83b92dcd Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Wed, 9 Aug 2017 10:23:17 -0500 Subject: [PATCH 13/31] #117: Add better error handling around the theme path not being writeable --- emulsify.drush.inc | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/emulsify.drush.inc b/emulsify.drush.inc index 876129f6..ca5e333a 100644 --- a/emulsify.drush.inc +++ b/emulsify.drush.inc @@ -95,7 +95,11 @@ function drush_emulsify_create($human_readable_name, $machine_name, $description // Phase 1: Copy files. $files_to_copy = _emulsify_get_files_to_copy(); - _emulsify_copy_files($files_to_copy, $theme_path); + $files_to_copy_status = _emulsify_copy_files($files_to_copy, $theme_path); + + if ($files_to_copy_status !== TRUE) { + return FALSE; + } // Phase 2: Alter files. $alterations = _emulsify_get_alterations($human_readable_name, $machine_name); @@ -255,11 +259,25 @@ function _emulsify_copy_files($files = array(), $destination_path = '') { if (empty($files) || empty($destination_path)) { return FALSE; } - file_prepare_directory($destination_path, FILE_CREATE_DIRECTORY); - foreach ($files as $files_to_copy) { - drush_copy_dir(__DIR__ . DIRECTORY_SEPARATOR . $files_to_copy, $destination_path . DIRECTORY_SEPARATOR . $files_to_copy); + $writeable = file_prepare_directory($destination_path, FILE_CREATE_DIRECTORY); + if ($writeable === TRUE) { + foreach ($files as $files_to_copy) { + drush_copy_dir(__DIR__ . DIRECTORY_SEPARATOR . $files_to_copy, $destination_path . DIRECTORY_SEPARATOR . $files_to_copy); + } + return TRUE; + } + else { + // Notify user of the path write error. + $message = 'There was an error writting to "!path". This is normally due to permissions on one of the base directories or "!path" directory not allowing the web server to write data. You can use the "chmod" command to implement either a temporary or permanent fix for this.'; + + $message = dt($message, array( + '!path' => $destination_path, + )); + + drush_print($message); + + return FALSE; } - return TRUE; } /** From babe3298c2fc847a140d4b6adac0a612e790e67a Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Wed, 16 Aug 2017 22:16:25 -0500 Subject: [PATCH 14/31] Added twig functions to composer.json. --- composer.json | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index c1eb2e1c..622f17bc 100644 --- a/composer.json +++ b/composer.json @@ -22,23 +22,29 @@ "email": "randy@fourkitchens.com" } ], - "repositories": {}, + "repositories": { + "bem-twig-extension": { + "type": "vcs", + "url": "https://github.com/drupal-pattern-lab/bem-twig-extension" + }, + "add-attributes-twig-extension": { + "type": "vcs", + "url": "https://github.com/drupal-pattern-lab/add-attributes-twig-extension" + }, + "drupal": { + "type": "composer", + "url": "https://packages.drupal.org/8" + } + }, "require": { "drupal/components": "^1.0", - "drupal-pattern-lab/unified-twig-extensions": "dev-develop" + "drupal-pattern-lab/add-attributes-twig-extension": "^1.0", + "drupal-pattern-lab/bem-twig-extension": "^1.0", + "drupal-pattern-lab/unified-twig-extensions": "^0.1" }, "require-dev": {}, "minimum-stability": "dev", "prefer-stable": true, - "scripts": { - "pre-install-cmd": [], - "pre-update-cmd": [], - "post-install-cmd": [ - "drush emulsify" - ], - "post-update-cmd": [ - "drush emulsify" - ] - }, + "scripts": {}, "extra": [] } From 32b2056840f89468186460d45e86e932be012835 Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Wed, 16 Aug 2017 22:20:39 -0500 Subject: [PATCH 15/31] Updated the package.json postinstall to copy the bem and add_attributes functions that were installed via composer. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7bb1529b..8e616ca6 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "scripts": { "start": "gulp clean && gulp compile && gulp theme", - "postinstall": "rm -rf pattern-lab && composer create-project -n pattern-lab/edition-twig-standard pattern-lab && rm -rf pattern-lab/source && ln -s ../components pattern-lab/source && git clone https://github.com/drupal-pattern-lab/bem-twig-extension.git && cp bem-twig-extension/bem.function.php components/_twig-components/functions && rm -rf bem-twig-extension/" + "postinstall": "rm -rf pattern-lab && composer create-project -n pattern-lab/edition-twig-standard pattern-lab && rm -rf pattern-lab/source && ln -s ../components pattern-lab/source && cp vendor/drupal-pattern-lab/add-attributes-twig-extension/add_attributes.function.php components/_twig-components/functions && cp vendor/drupal-pattern-lab/bem-twig-extension/bem.function.php components/_twig-components/functions" }, "precommit.silent": true } From 570a1c9369795773099a00d7217b55ad70810cb8 Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Wed, 16 Aug 2017 22:21:52 -0500 Subject: [PATCH 16/31] Removed bem.function.php from git repo. --- .../functions/bem.function.php | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 components/_twig-components/functions/bem.function.php diff --git a/components/_twig-components/functions/bem.function.php b/components/_twig-components/functions/bem.function.php deleted file mode 100644 index 02dd6781..00000000 --- a/components/_twig-components/functions/bem.function.php +++ /dev/null @@ -1,42 +0,0 @@ -addClass($classString); - return $context['attributes']; - } - else { - $classesSafe = ' class="' . $classString . '"'; - return $classesSafe; - } - -}, array('needs_context' => true, 'needs_environment' => true, 'is_safe' => array('html'))); From b70e9f618aae87ce61f1eae4f885527f276e0672 Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Wed, 16 Aug 2017 22:35:22 -0500 Subject: [PATCH 17/31] Updated yarn.lock and gitignored vendor and twig functions. --- .gitignore | 5 + yarn.lock | 311 ++++++++++++++++++++++------------------------------- 2 files changed, 131 insertions(+), 185 deletions(-) diff --git a/.gitignore b/.gitignore index 32acb455..7c747e68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,14 @@ # Ignore compiled files. dist +vendor # Pattern Lab (ignored initially) pattern-lab +# Twig helper functions +**/add_attributes.function.php +**/bem.function.php + # NPM node_modules npm-debug.log diff --git a/yarn.lock b/yarn.lock index a2cc283c..5fab8b59 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,9 +19,9 @@ normalize-path "^2.0.1" through2 "^2.0.3" -"@types/node@^7.0.31": - version "7.0.39" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.39.tgz#8aced4196387038113f6f9aa4014ab4c51edab3c" +"@types/node@^8.0.19": + version "8.0.23" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.23.tgz#c746697004782346594a0d755c34425bbf3014d2" abbrev@1: version "1.1.0" @@ -48,7 +48,7 @@ acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" -acorn@^5.0.1, acorn@^5.0.3: +acorn@^5.0.3, acorn@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.1.tgz#53fe161111f912ab999ee887a90a0bc52822fd75" @@ -121,11 +121,11 @@ ansi-styles@^3.1.0: color-convert "^1.9.0" anymatch@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" + version "1.3.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" dependencies: - arrify "^1.0.0" micromatch "^2.1.5" + normalize-path "^2.0.0" aproba@^1.0.3: version "1.1.2" @@ -282,12 +282,12 @@ aws4@^1.2.1: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" babel-code-frame@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: - chalk "^1.1.0" + chalk "^1.1.3" esutils "^2.0.2" - js-tokens "^3.0.0" + js-tokens "^3.0.2" backo2@1.0.2: version "1.0.2" @@ -374,8 +374,8 @@ bin-wrapper@^3.0.0: os-filter-obj "^1.0.0" binary-extensions@^1.0.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.9.0.tgz#66506c16ce6f4d6928a5b3cd6a33ca41e941e37b" + version "1.10.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.10.0.tgz#9aeb9a6c5e88638aad171e167f5900abe24835d0" binary@^0.3.0: version "0.3.0" @@ -491,11 +491,11 @@ browser-sync@^2.11.0: yargs "6.4.0" browserslist@^2.1.5: - version "2.2.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.2.2.tgz#e9b4618b8a01c193f9786beea09f6fd10dbe31c3" + version "2.3.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.3.3.tgz#2b0cabc4d28489f682598605858a0782f14b154c" dependencies: - caniuse-lite "^1.0.30000704" - electron-to-chromium "^1.3.16" + caniuse-lite "^1.0.30000715" + electron-to-chromium "^1.3.18" bs-recipes@1.3.4: version "1.3.4" @@ -559,18 +559,14 @@ camelcase@^4.0.0, camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" -caniuse-lite@^1.0.30000697, caniuse-lite@^1.0.30000704: - version "1.0.30000704" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000704.tgz#adb6ea01134515663682db93abab291d4c02946b" +caniuse-lite@^1.0.30000697, caniuse-lite@^1.0.30000715: + version "1.0.30000715" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000715.tgz#c327f5e6d907ebcec62cde598c3bf0dd793fb9a0" capture-stack-trace@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" -caseless@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" - caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -600,7 +596,7 @@ chalk@^0.5.0: strip-ansi "^0.3.0" supports-color "^0.2.0" -chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: +chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -610,9 +606,9 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.0.1.tgz#dbec49436d2ae15f536114e76d14656cdbc0f44d" +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.1.0.tgz#ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e" dependencies: ansi-styles "^3.1.0" escape-string-regexp "^1.0.5" @@ -794,15 +790,7 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.0.tgz#53f7d43c51c5e43f81c8fdd03321c631be68d611" - dependencies: - inherits "~2.0.1" - readable-stream "~2.0.0" - typedarray "~0.0.5" - -concat-stream@^1.4.6, concat-stream@^1.4.7, concat-stream@^1.6.0: +concat-stream@1.6.0, concat-stream@^1.4.6, concat-stream@^1.4.7, concat-stream@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" dependencies: @@ -864,7 +852,7 @@ cookie@0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" -core-util-is@~1.0.0: +core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -1003,10 +991,6 @@ debug-fabulous@0.1.X: memoizee "^0.4.5" object-assign "4.1.0" -debug@0.7.4: - version "0.7.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-0.7.4.tgz#06e1ea8082c2cb14e39806e22e2f6f757f92af39" - debug@2.2.0, debug@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" @@ -1025,12 +1009,6 @@ debug@2.3.3: dependencies: ms "0.7.2" -debug@2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" - dependencies: - ms "0.7.2" - debug@2.6.4: version "2.6.4" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.4.tgz#7586a9b3c39741c0282ae33445c4e8ac74734fe0" @@ -1168,9 +1146,9 @@ delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" -depd@1.1.0, depd@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.0.tgz#e1bd82c6aab6ced965b97b88b17ed3e528ca18c3" +depd@1.1.1, depd@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" deprecated@^0.0.1: version "0.0.1" @@ -1261,10 +1239,10 @@ duplexer3@^0.1.4: resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" duplexify@^3.2.0, duplexify@^3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.0.tgz#1aa773002e1578457e9d9d4a50b0ccaaebcbd604" + version "3.5.1" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.1.tgz#4e1516be68838bc90a49994f0b39a6e5960befcd" dependencies: - end-of-stream "1.0.0" + end-of-stream "^1.0.0" inherits "^2.0.1" readable-stream "^2.0.0" stream-shift "^1.0.0" @@ -1305,17 +1283,17 @@ ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" -electron-to-chromium@^1.3.16: - version "1.3.16" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.16.tgz#d0e026735754770901ae301a21664cba45d92f7d" +electron-to-chromium@^1.3.18: + version "1.3.18" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.18.tgz#3dcc99da3e6b665f6abbc71c28ad51a2cd731a9c" emitter-steward@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/emitter-steward/-/emitter-steward-1.0.0.tgz#f3411ade9758a7565df848b2da0cbbd1b46cbd64" emulsify-gulp@fourkitchens/emulsify-gulp: - version "1.1.0" - resolved "https://codeload.github.com/fourkitchens/emulsify-gulp/tar.gz/4e0923d734dcdd28ac63f739ee044d6cb23ab7e7" + version "1.1.1" + resolved "https://codeload.github.com/fourkitchens/emulsify-gulp/tar.gz/93f1b975bf4ddc886b17ae5d899ff0c13dc3f714" dependencies: breakpoint-sass "^2.7.0" browser-sync "^2.11.0" @@ -1359,11 +1337,11 @@ encodeurl@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20" -end-of-stream@1.0.0, end-of-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.0.0.tgz#d4596e702734a93e40e9af864319eabd99ff2f0e" +end-of-stream@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.0.tgz#7a90d833efda6cfa6eac0f4949dbb0fad3a63206" dependencies: - once "~1.3.0" + once "^1.4.0" end-of-stream@~0.1.5: version "0.1.5" @@ -1421,8 +1399,8 @@ error-ex@^1.2.0: is-arrayish "^0.2.1" es5-ext@^0.10.13, es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14, es5-ext@~0.10.2: - version "0.10.24" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.24.tgz#a55877c9924bc0c8d9bd3c2cbe17495ac1709b14" + version "0.10.27" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.27.tgz#bf926b058c62b1cb5de1a887930673b6aa6d9a66" dependencies: es6-iterator "2" es6-symbol "~3.1" @@ -1543,8 +1521,8 @@ eslint@^2.7.0: user-home "^2.0.0" eslint@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.3.0.tgz#fcd7c96376bbf34c85ee67ed0012a299642b108f" + version "4.4.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.4.1.tgz#99cd7eafcffca2ff99a5c8f5f2a474d6364b4bd3" dependencies: ajv "^5.2.0" babel-code-frame "^6.22.0" @@ -1554,7 +1532,7 @@ eslint@^4.3.0: debug "^2.6.8" doctrine "^2.0.0" eslint-scope "^3.7.1" - espree "^3.4.3" + espree "^3.5.0" esquery "^1.0.0" estraverse "^4.2.0" esutils "^2.0.2" @@ -1566,7 +1544,7 @@ eslint@^4.3.0: imurmurhash "^0.1.4" inquirer "^3.0.6" is-resolvable "^1.0.0" - js-yaml "^3.8.4" + js-yaml "^3.9.1" json-stable-stringify "^1.0.1" levn "^0.3.0" lodash "^4.17.4" @@ -1583,11 +1561,11 @@ eslint@^4.3.0: table "^4.0.1" text-table "~0.2.0" -espree@^3.1.6, espree@^3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" +espree@^3.1.6, espree@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.0.tgz#98358625bdd055861ea27e2867ea729faf463d8d" dependencies: - acorn "^5.0.1" + acorn "^5.1.1" acorn-jsx "^3.0.0" esprima@^2.6.0: @@ -1736,18 +1714,18 @@ extglob@^0.3.1: dependencies: is-extglob "^1.0.0" -extract-zip@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.5.0.tgz#92ccf6d81ef70a9fa4c1747114ccef6d8688a6c4" +extract-zip@~1.6.5: + version "1.6.5" + resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.6.5.tgz#99a06735b6ea20ea9b705d779acffcc87cff0440" dependencies: - concat-stream "1.5.0" - debug "0.7.4" + concat-stream "1.6.0" + debug "2.2.0" mkdirp "0.5.0" yauzl "2.4.1" -extsprintf@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" +extsprintf@1.3.0, extsprintf@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" eyes@0.1.x: version "0.1.8" @@ -2640,15 +2618,6 @@ har-schema@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" -har-validator@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" - dependencies: - chalk "^1.1.1" - commander "^2.9.0" - is-my-json-valid "^2.12.4" - pinkie-promise "^2.0.0" - har-validator@~4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" @@ -2749,10 +2718,10 @@ http-errors@~1.5.0: statuses ">= 1.3.1 < 2" http-errors@~1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.1.tgz#5f8b8ed98aca545656bf572997387f904a722257" + version "1.6.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" dependencies: - depd "1.1.0" + depd "1.1.1" inherits "2.0.3" setprototypeof "1.0.3" statuses ">= 1.3.1 < 2" @@ -3038,7 +3007,7 @@ is-jpg@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-jpg/-/is-jpg-1.0.0.tgz#2959c17e73430db38264da75b90dd54f2d86da1c" -is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4: +is-my-json-valid@^2.10.0: version "2.16.0" resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" dependencies: @@ -3241,13 +3210,13 @@ js-base64@^2.1.8, js-base64@^2.1.9: version "2.1.9" resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.1.9.tgz#f0e80ae039a4bd654b5f281fc93f04a914a7fcce" -js-tokens@^3.0.0: +js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@^3.4.3, js-yaml@^3.4.6, js-yaml@^3.5.1, js-yaml@^3.5.4, js-yaml@^3.6.1, js-yaml@^3.8.4: - version "3.9.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.0.tgz#4ffbbf25c2ac963b8299dc74da7e3740de1c18ce" +js-yaml@^3.4.3, js-yaml@^3.4.6, js-yaml@^3.5.1, js-yaml@^3.5.4, js-yaml@^3.6.1, js-yaml@^3.8.4, js-yaml@^3.9.1: + version "3.9.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0" dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -3264,8 +3233,8 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" jschardet@^1.4.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.5.0.tgz#a61f310306a5a71188e1b1acd08add3cfbb08b1e" + version "1.5.1" + resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.5.1.tgz#c519f629f86b3a5bedba58a88d311309eec097f9" json-schema-traverse@^0.3.0: version "0.3.1" @@ -3310,13 +3279,13 @@ jsonpointer@^4.0.0: resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" jsprim@^1.2.2: - version "1.4.0" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" dependencies: assert-plus "1.0.0" - extsprintf "1.0.2" + extsprintf "1.3.0" json-schema "0.2.3" - verror "1.3.6" + verror "1.10.0" jwa@^1.1.4: version "1.1.5" @@ -4011,12 +3980,12 @@ mkpath@^0.1.0: resolved "https://registry.yarnpkg.com/mkpath/-/mkpath-0.1.0.tgz#7554a6f8d871834cc97b5462b122c4c124d6de91" mocha@^3.4.1: - version "3.4.2" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.4.2.tgz#d0ef4d332126dbf18d0d640c9b382dd48be97594" + version "3.5.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.5.0.tgz#1328567d2717f997030f8006234bce9b8cd72465" dependencies: browser-stdout "1.3.0" commander "2.9.0" - debug "2.6.0" + debug "2.6.8" diff "3.2.0" escape-string-regexp "1.0.5" glob "7.1.1" @@ -4085,10 +4054,10 @@ next-tick@1: resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" ngrok@^2.2.2: - version "2.2.15" - resolved "https://registry.yarnpkg.com/ngrok/-/ngrok-2.2.15.tgz#8cd575d3d91678a269f90523320bfec1da1cd0d3" + version "2.2.17" + resolved "https://registry.yarnpkg.com/ngrok/-/ngrok-2.2.17.tgz#173747e1d433f362145217a5764500e089806a2d" dependencies: - "@types/node" "^7.0.31" + "@types/node" "^8.0.19" async "^2.3.0" decompress-zip "^0.3.0" lock "^0.1.2" @@ -4205,7 +4174,7 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-path@^2.0.1, normalize-path@^2.1.1: +normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" dependencies: @@ -4307,12 +4276,18 @@ on-finished@~2.3.0: dependencies: ee-first "1.1.1" -once@^1.3.0, once@^1.3.3, once@~1.3.0: +once@^1.3.0, once@~1.3.0: version "1.3.3" resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" dependencies: wrappy "1" +once@^1.3.3, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" @@ -4432,8 +4407,8 @@ p-map@^1.1.1: resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.1.1.tgz#05f5e4ae97a068371bc2a5cc86bfbdbc19c4ae7a" p-pipe@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-pipe/-/p-pipe-1.1.0.tgz#2e9dc7cc57ce67d2ce2db348ca03f28731854075" + version "1.2.0" + resolved "https://registry.yarnpkg.com/p-pipe/-/p-pipe-1.2.0.tgz#4b1a11399a11520a67790ee5a0c1d5881d6befe9" package-json@^4.0.0: version "4.0.1" @@ -4556,16 +4531,16 @@ performance-now@^0.2.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" phantomjs-prebuilt@^2.1.14: - version "2.1.14" - resolved "https://registry.yarnpkg.com/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.14.tgz#d53d311fcfb7d1d08ddb24014558f1188c516da0" + version "2.1.15" + resolved "https://registry.yarnpkg.com/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.15.tgz#20f86e82d3349c505917527745b7a411e08b3903" dependencies: es6-promise "~4.0.3" - extract-zip "~1.5.0" + extract-zip "~1.6.5" fs-extra "~1.0.0" hasha "~2.2.0" kew "~0.7.0" progress "~1.1.8" - request "~2.79.0" + request "~2.81.0" request-progress "~2.0.1" which "~1.2.10" @@ -4662,12 +4637,12 @@ postcss@^5.2.16: supports-color "^3.2.3" postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.3, postcss@^6.0.6: - version "6.0.8" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.8.tgz#89067a9ce8b11f8a84cbc5117efc30419a0857b3" + version "6.0.9" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.9.tgz#54819766784a51c65b1ec4d54c2f93765438c35a" dependencies: - chalk "^2.0.1" + chalk "^2.1.0" source-map "^0.5.6" - supports-color "^4.2.0" + supports-color "^4.2.1" pre-commit@^1.2.2: version "1.2.2" @@ -4759,10 +4734,6 @@ qs@6.2.1: version "6.4.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" -qs@~6.3.0: - version "6.3.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" - query-string@^4.1.0: version "4.3.4" resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb" @@ -4857,17 +4828,6 @@ readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable string_decoder "~1.0.3" util-deprecate "~1.0.1" -readable-stream@~2.0.0: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - readdirp@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" @@ -4919,8 +4879,8 @@ registry-url@^3.0.3: rc "^1.0.1" remove-trailing-separator@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz#69b062d978727ad14dc6b56ba4ab772fd8d70511" + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" repeat-element@^1.1.2: version "1.1.2" @@ -4950,7 +4910,7 @@ request-progress@~2.0.1: dependencies: throttleit "^1.0.0" -request@2, request@2.81.0, request@^2.55.0, request@^2.72.0, request@^2.74.0, request@^2.79.0, request@^2.81.0: +request@2, request@2.81.0, request@^2.55.0, request@^2.72.0, request@^2.74.0, request@^2.79.0, request@^2.81.0, request@~2.81.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" dependencies: @@ -4977,31 +4937,6 @@ request@2, request@2.81.0, request@^2.55.0, request@^2.72.0, request@^2.74.0, re tunnel-agent "^0.6.0" uuid "^3.0.0" -request@~2.79.0: - version "2.79.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - caseless "~0.11.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~2.1.1" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - oauth-sign "~0.8.1" - qs "~6.3.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - uuid "^3.0.0" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -5045,8 +4980,8 @@ resolve-url@~0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" resolve@^1.1.6, resolve@^1.1.7: - version "1.3.3" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" + version "1.4.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86" dependencies: path-parse "^1.0.5" @@ -5688,7 +5623,7 @@ supports-color@^3.2.3: dependencies: has-flag "^1.0.0" -supports-color@^4.0.0, supports-color@^4.2.0: +supports-color@^4.0.0, supports-color@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.2.1.tgz#65a4bb2631e90e02420dba5554c375a4754bb836" dependencies: @@ -5943,7 +5878,7 @@ tryit@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" -tunnel-agent@^0.4.0, tunnel-agent@~0.4.1: +tunnel-agent@^0.4.0: version "0.4.3" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" @@ -5963,7 +5898,7 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -typedarray@^0.0.6, typedarray@~0.0.5: +typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -5972,8 +5907,8 @@ ua-parser-js@0.7.12: resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.12.tgz#04c81a99bdd5dc52263ea29d24c6bf8d4818a4bb" uglify-js@^3.0.5: - version "3.0.26" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.0.26.tgz#ba279ca597b13fe6c62c2d87dd5188e57a7a3233" + version "3.0.27" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.0.27.tgz#a97db8c8ba6b9dba4e2f88d86aa9548fa6320034" dependencies: commander "~2.11.0" source-map "~0.5.1" @@ -6113,11 +6048,13 @@ validate-npm-package-license@^3.0.1: spdx-correct "~1.0.0" spdx-expression-parse "~1.0.0" -verror@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c" +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" dependencies: - extsprintf "1.0.2" + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" vinyl-assign@^1.0.1: version "1.2.1" @@ -6243,7 +6180,13 @@ which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" -which@1, which@1.2.x, which@^1.2.12, which@^1.2.9, which@~1.2.10: +which@1, which@^1.2.12, which@^1.2.9: + version "1.3.0" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" + dependencies: + isexe "^2.0.0" + +which@1.2.x, which@~1.2.10: version "1.2.14" resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" dependencies: @@ -6337,17 +6280,15 @@ xdg-basedir@^3.0.0: resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" xml2js@^0.4.17: - version "0.4.17" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.17.tgz#17be93eaae3f3b779359c795b419705a8817e868" + version "0.4.18" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.18.tgz#a117ec8153aeeb22f9541bfbe8805e35dae7b969" dependencies: sax ">=0.6.0" - xmlbuilder "^4.1.0" + xmlbuilder "~9.0.1" -xmlbuilder@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-4.2.1.tgz#aa58a3041a066f90eaa16c2f5389ff19f3f461a5" - dependencies: - lodash "^4.0.0" +xmlbuilder@~9.0.1: + version "9.0.4" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.4.tgz#519cb4ca686d005a8420d3496f3f0caeecca580f" xmldom@0.1.27: version "0.1.27" From f4dcb203119ba62e89934acb2fe65cdf4a00fa31 Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Thu, 17 Aug 2017 02:14:52 -0500 Subject: [PATCH 18/31] Polish the drush script --- emulsify.drush.inc | 375 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 321 insertions(+), 54 deletions(-) diff --git a/emulsify.drush.inc b/emulsify.drush.inc index ca5e333a..dc059099 100644 --- a/emulsify.drush.inc +++ b/emulsify.drush.inc @@ -17,14 +17,14 @@ function emulsify_drush_command() { 'human_readable_name' => 'The name of your theme.', ), 'options' => array( - 'machine_name' => 'The machine-readable name of your theme. This will be auto-generated from the human-readable name if ommited.', + 'machine-name' => 'The machine-readable name of your theme. This will be auto-generated from the human_readable_name if ommited.', 'description' => 'The description of your theme', 'path' => 'The destination of your theme. Defaults to "themes/custom".', 'slim' => 'Only copy base files', ), 'examples' => array( - 'drush emulsify "theme"' => 'Creates an Emulsify theme called "theme", using the default options.', - 'drush emulsify "theme" --machine_name=theme' => 'Creates a Emulsify theme called "theme" with a specific machine name.', + 'drush emulsify "My Awesome Theme"' => 'Creates an Emulsify theme called "My Awesome Theme", using the default options.', + 'drush emulsify "My Awesome Theme" --machine-name=mat' => 'Creates a Emulsify theme called "My Awesome Theme" with the specific machine name "mat".', ), ); @@ -48,7 +48,7 @@ function drush_emulsify($human_readable_name = NULL) { // If no $human_readable_name provided, abort. if (!$human_readable_name) { - drush_print(dt('Theme name missing. See help using drush emulsify --help.')); + drush_print(dt('Theme name missing. See help using \'drush help emulsify\'.')); return; } @@ -58,7 +58,7 @@ function drush_emulsify($human_readable_name = NULL) { } // Determine the machine name. - $machine_name = drush_get_option('machine_name'); + $machine_name = drush_get_option('machine-name'); if (!$machine_name) { $machine_name = $human_readable_name; } @@ -80,37 +80,81 @@ function drush_emulsify($human_readable_name = NULL) { $theme_path = drush_trim_path($path); } - drush_emulsify_create($human_readable_name, $machine_name, $description, $theme_path); + // Create your new theme. + $status = drush_emulsify_create($human_readable_name, $machine_name, $description, $theme_path); + + // Notify the user of failure. + if ($status === FALSE) { + drush_set_error("EMULSIFY", "Your theme was not successfully created."); + } } /** * Create frontend theme. + * + * @param string $human_readable_name + * A string that will be used to represent the human readable name. + * @param string $machine_name + * A string that will be used to name directories, files, and will be replaced + * in templates. + * @param string $description + * A string that will be used as the theme description in the .info file. + * @param string $theme_path + * A string that will be translated into a base path for your new theme. + * + * @return boolean + * A boolean representing the success or failure of the function. */ -function drush_emulsify_create($human_readable_name, $machine_name, $description, $theme_path) { - $theme_path = drush_normalize_path(drush_get_context('DRUSH_DRUPAL_ROOT') . '/' . $theme_path . '/' . $machine_name); +function drush_emulsify_create(string $human_readable_name, string $machine_name, string $description, string $theme_path) { + $theme_path = drush_normalize_path(drush_get_context('DRUSH_DRUPAL_ROOT') . DIRECTORY_SEPARATOR . $theme_path . DIRECTORY_SEPARATOR . $machine_name); + + // Phase: Validate theme path is writeable. + $theme_path_status = _emulsify_validate_path($theme_path); + if ($theme_path_status !== TRUE) { + return _emulsify_notify_fail('', 'Failed on Phase: Validate theme path is writeable.'); + } + + // Phase: Verify there are not existing contents in the destination directory. + $theme_path_empty_status = _emulsify_validate_path_is_empty($theme_path); + if ($theme_path_empty_status !== TRUE) { + return _emulsify_notify_fail('', 'Failed on Phase: Verify there are not existing contents in the destination directory. Please either delete the contents or pick a different path by changing the machine name or using the \'--path\' option. Use \'drush help emulsify\' for more information.'); + } + + // Phase: Make directories. + $directories_to_make = _emulsify_get_directories_to_make(); + $directories_to_make_status = _emulsify_make_directories($directories_to_make, $theme_path); - if (!is_dir(dirname($theme_path))) { - drush_die(dt('The directory "!directory" was not found.', array('!directory' => dirname($theme_path)))); + if ($directories_to_make_status !== TRUE) { + return _emulsify_notify_fail('', 'Failed on Phase: Make directories.'); } - // Phase 1: Copy files. + // Phase: Copy files. $files_to_copy = _emulsify_get_files_to_copy(); $files_to_copy_status = _emulsify_copy_files($files_to_copy, $theme_path); if ($files_to_copy_status !== TRUE) { - return FALSE; + return _emulsify_notify_fail('', 'Failed on Phase: Copy files.'); } - // Phase 2: Alter files. - $alterations = _emulsify_get_alterations($human_readable_name, $machine_name); + // Phase: Alter files. + $alterations = _emulsify_get_alterations($human_readable_name, $machine_name, $description); $files_to_alter = _emulsify_get_files_to_alter(); - _emulsify_alter_files($theme_path, $files_to_alter, $alterations); + $files_to_alter_status = _emulsify_alter_files($theme_path, $files_to_alter, $alterations); - // Phase 3: Rename files. + if ($files_to_alter_status !== TRUE) { + return _emulsify_notify_fail('', 'Failed on Phase: Alter files.'); + } + + // Phase: Rename files. $files_to_rename = _emulsify_get_files_to_rename(); - _emulsify_rename_files($theme_path, $machine_name, $files_to_rename); + $files_to_rename_status = _emulsify_rename_files($theme_path, $machine_name, $files_to_rename); + + if ($files_to_rename_status !== TRUE) { + return _emulsify_notify_fail('', 'Failed on Phase: Rename files.'); + } - _emulsify_notify($human_readable_name, $theme_path); + // Phase 7: Return success message to the user. + _emulsify_notify_success($human_readable_name, $theme_path); } /** @@ -119,21 +163,36 @@ function drush_emulsify_create($human_readable_name, $machine_name, $description * This function supports both directories and individual files. Alterations * happen in sequential order so you can replace something that was previously * replaced. + * + * @param string $human_readable_name + * A string representing the human readable name. + * @param string $machine_name + * A string representing the machine name. + * @param string $description + * A string representing the desired description. + * + * @return array + * An array with a key representing the string to be replaced and value + * representing the string to replace it with. */ -function _emulsify_get_alterations($human_readable_name, $machine_name) { +function _emulsify_get_alterations(string $human_readable_name, string $machine_name, string $description) { return array( 'Emulsify' => $human_readable_name, 'emulsify' => $machine_name, + 'Theme that uses Pattern Lab v2' => $description, 'hidden: true' => '', ); } /** - * Returns an array of files to make string replacements. + * Returns an array of files and directories to make string replacements within. + * + * @return array + * A array representing files and directories to be altered. */ function _emulsify_get_files_to_alter() { // Slim files and directories declaration. - $slim_array = array( + $default_array = array( 'emulsify.info.yml', 'emulsify.theme', 'emulsify.breakpoints.yml', @@ -141,10 +200,10 @@ function _emulsify_get_files_to_alter() { ); // If we would like to have a bare copy we use is slim option. if (drush_get_option('slim') === TRUE) { - return $slim_array; + return $default_array; } else { - return array_merge($slim_array, array( + return array_merge($default_array, array( 'components', 'templates', 'README.md', @@ -152,6 +211,31 @@ function _emulsify_get_files_to_alter() { } } +/** + * Get directories to make. + * + * @return array + * An array of directories to make. + */ +function _emulsify_get_directories_to_make() { + // If we would like to have a bare copy we use is slim option. + if (drush_get_option('slim') === TRUE) { + return array( + 'components/_patterns', + 'components/_patterns/00-base', + 'components/_patterns/00-base/global', + 'components/_patterns/01-atoms', + 'components/_patterns/02-molecules', + 'components/_patterns/03-organisms', + 'components/_patterns/04-templates', + 'components/_patterns/05-pages', + ); + } + else { + return array(); + } +} + /** * Gets files to copy. * @@ -165,10 +249,13 @@ function _emulsify_get_files_to_alter() { * composer.json * LICENSE.txt * emulsify.drush.inc + * + * @return array + * An array of files to copy. */ function _emulsify_get_files_to_copy() { // Slim files and directories declaration. - $slim_array = array( + $default_array = array( '.editorconfig', '.gitignore', '.stylelintrc', @@ -182,10 +269,18 @@ function _emulsify_get_files_to_copy() { ); // If we would like to have a bare copy we use is slim option. if (drush_get_option('slim') === TRUE) { - return $slim_array; + return array_merge($default_array, array( + 'components/_data', + 'components/_macros', + 'components/_meta', + 'components/_twig-components', + 'components/css', + 'components/images', + 'components/_patterns/00-base/global/01-colors', + )); } else { - return array_merge($slim_array, array( + return array_merge($default_array, array( 'components', 'fonts', 'images', @@ -198,19 +293,22 @@ function _emulsify_get_files_to_copy() { /** * Get files to rename. + * + * @return array + * An array of files to rename. */ function _emulsify_get_files_to_rename() { // Slim files and directories declaration. - $slim_array = array( + $default_array = array( 'emulsify.info.yml', 'emulsify.theme', ); // If we would like to have a bare copy we use is slim option. if (drush_get_option('slim') === TRUE) { - return $slim_array; + return $default_array; } else { - return array_merge($slim_array, array( + return array_merge($default_array, array( 'emulsify.breakpoints.yml', 'emulsify.libraries.yml', )); @@ -219,8 +317,22 @@ function _emulsify_get_files_to_rename() { /** * Alter strings within files. + * + * @param string $theme_path + * A string representing the destination theme path. + * @param array $files_to_alter + * An array representing the files that will be altered. + * @param array $alterations + * An array of alteration that will be processed in sequential order on all + * files, this means that you can replace previous replacements. + * @param boolean $absolute + * A boolean representing if the files to alter are represented as relative + * or absolute paths. + * + * @return boolean + * A boolean representing the success or failure of the function. */ -function _emulsify_alter_files($theme_path, $files_to_alter = array(), $alterations = array(), $absolute = FALSE) { +function _emulsify_alter_files(string $theme_path, array $files_to_alter = array(), array $alterations = array(), bool $absolute = FALSE) { if (empty($files_to_alter) || empty($alterations)) { return TRUE; } @@ -236,12 +348,59 @@ function _emulsify_alter_files($theme_path, $files_to_alter = array(), $alterati if ($file_type === 'dir') { $files = file_scan_directory($file_path, '/\.*/'); - _emulsify_alter_files($theme_path, array_keys($files), $alterations, TRUE); + $alter_status = _emulsify_alter_files($theme_path, array_keys($files), $alterations, TRUE); + if ($alter_status === FALSE) { + return FALSE; + } } elseif ($file_type === 'file') { - _emulsify_file_str_replace($file_path, array_keys($alterations), $alterations); + $string_replace_status = _emulsify_file_str_replace($file_path, array_keys($alterations), $alterations); + if ($string_replace_status === FALSE) { + return FALSE; + } } } + + // If we make it here return success. + return TRUE; +} + +/** + * Make directories. + * + * @param array $directories + * An array of directories (strings) to make. + * @param string $destination_path + * A string representing the destination path. + * + * @return boolean + * A boolean representing the success or failure of the function. + */ +function _emulsify_make_directories(array $directories = array(), string $destination_path = '') { + + // Check for invalid settings and return an error. + if (!is_array($directories) || !is_string($destination_path) || empty($destination_path)) { + _emulsify_notify_fail('', "Invalid parameter passed to _emulsify_make_directories()."); + return FALSE; + } + + // The $directories parameter can be empty and valid, return success. + if (empty($directories)) { + return TRUE; + } + + // Copy desired files. + foreach ($directories as $directory_to_make) { + $directory_path = drush_normalize_path($destination_path . DIRECTORY_SEPARATOR . $directory_to_make); + + // Check if path is or can be writeable and exists, if not, return FALSE. + if (!_emulsify_validate_path($directory_path)) { + return FALSE; + } + } + + // If there were not issues return success. + return TRUE; } /** @@ -252,59 +411,163 @@ function _emulsify_alter_files($theme_path, $files_to_alter = array(), $alterati * @param string $destination_path * A string representing the destination path. * - * @return bool - * A boolean representing the success or failure of the command. + * @return boolean + * A boolean representing the success or failure of the function. */ -function _emulsify_copy_files($files = array(), $destination_path = '') { - if (empty($files) || empty($destination_path)) { - return FALSE; +function _emulsify_copy_files(array $files = array(), string $destination_path = '') { + + // Check for invalid settings and return an error. + if (!is_array($files) || !is_string($destination_path) || empty($destination_path)) { + return _emulsify_notify_fail('', "Invalid parameter passed to _emulsify_copy_files()."); } - $writeable = file_prepare_directory($destination_path, FILE_CREATE_DIRECTORY); - if ($writeable === TRUE) { - foreach ($files as $files_to_copy) { - drush_copy_dir(__DIR__ . DIRECTORY_SEPARATOR . $files_to_copy, $destination_path . DIRECTORY_SEPARATOR . $files_to_copy); - } + + // The $files parameter can be empty and valid, return success. + if (empty($files)) { return TRUE; } - else { - // Notify user of the path write error. - $message = 'There was an error writting to "!path". This is normally due to permissions on one of the base directories or "!path" directory not allowing the web server to write data. You can use the "chmod" command to implement either a temporary or permanent fix for this.'; - - $message = dt($message, array( - '!path' => $destination_path, - )); - drush_print($message); + // Copy desired files. + foreach ($files as $files_to_copy) { + $status = drush_copy_dir(__DIR__ . DIRECTORY_SEPARATOR . $files_to_copy, $destination_path . DIRECTORY_SEPARATOR . $files_to_copy); - return FALSE; + // Check if copy succeeded, if not, return FALSE. + if (!$status) { + return FALSE; + } } + + // Return success. + return TRUE; } /** * Rename files. + * + * @param string $theme_path + * A string representing the destination theme path. + * @param string $machine_name + * A string that will be used in file names. + * @param array $files_to_rename + * An array that represents the files to be processed. The array is expected + * to be provided as an indexed array of relative files paths. + * + * @return boolean + * A boolean representing success or failure of the rename. */ -function _emulsify_rename_files($theme_path, $machine_name, $files_to_rename = array()) { +function _emulsify_rename_files(string $theme_path, string $machine_name, array $files_to_rename = array()) { foreach ($files_to_rename as $file_to_rename_path) { $file_original_path = $theme_path . DIRECTORY_SEPARATOR . $file_to_rename_path; $file_new_path = $theme_path . DIRECTORY_SEPARATOR . str_replace('emulsify', $machine_name, $file_to_rename_path); drush_op('rename', drush_normalize_path($file_original_path), drush_normalize_path($file_new_path)); } + return TRUE; } /** * Replace strings in a file. + * + * @param string $file_path + * A string representing the original file path to have replacements + * performed on. + * @param array $find + * An array representing the search for values in the replacement process. + * @param array $replace + * An array that will replace the $find strings. + * + * @return boolean + * A boolean representing success or failure of the replacement. */ -function _emulsify_file_str_replace($file_path, $find, $replace) { +function _emulsify_file_str_replace(string $file_path, array $find, array $replace) { $file_path = drush_normalize_path($file_path); $file_contents = file_get_contents($file_path); $file_contents = str_replace($find, $replace, $file_contents); file_put_contents($file_path, $file_contents); + return TRUE; +} + +/** + * Validate that a path is writeable, creating the directory if necessary. + * + * @param string $path + * A string representing the path to verify exists and is writeable. + * + * @return boolean + * A boolean representing success or failure. + */ +function _emulsify_validate_path(string $path) { + // Check for succees, if not, log the error and return FALSE. + $return = file_prepare_directory($path, FILE_CREATE_DIRECTORY); + + if ($return === FALSE) { + _emulsify_notify_fail($path); + } + + return $return; +} + +/** + * Validate that a path is empty. + * + * @param string $path + * A string representing the path to verify is empty. + * + * @return boolean + * A boolean representing if the path is empty or not. + */ +function _emulsify_validate_path_is_empty(string $path) { + + if (!is_readable($path)) { + return FALSE; + } + + return (count(scandir($path)) === 2); +} + +/** + * Notifies the user of failure. + * + * @param string $path + * An optional string representing the path that failed. This function can + * be used to just send a message to the user without path replacements. + * @param string $message + * An optional string to replace the default message. + * + * @return boolean + * Always return false in the case we use this function as a return value. + */ +function _emulsify_notify_fail(string $path = '', string $message = '') { + + // Set a default message for the most common error. + if (empty($message)) { + // Notify user of the path write error. + $message = 'There was an error writting to "!path". This is normally due to permissions on one of the base directories or "!path" directory not allowing the web server to write data. You can use the "chmod" command to implement either a temporary or permanent fix for this.'; + } + + // Set the path if one was passed. + if (!empty($path) && is_string($path)) { + $message = dt($message, array( + '!path' => $path, + )); + } + + drush_print($message); + + // We return false here to represent failure. + return FALSE; } /** * Notifies the user of success. + * + * @param string $human_readable_name + * A string that will be returned to the user as their theme name. + * @param string $theme_path + * A string that will show where to find their new theme. + * + * @return boolean + * Always TRUE in the case we want to use this function as a return value. */ -function _emulsify_notify($human_readable_name, $theme_path) { +function _emulsify_notify_success(string $human_readable_name, string $theme_path) { // Notify user of the newly created theme. $message = 'Successfully created the Emulsify theme "!name" created in: !path, you can now run \'yarn\' or \'yarn install\' or \'npm install\' to install the node modules.'; @@ -312,5 +575,9 @@ function _emulsify_notify($human_readable_name, $theme_path) { '!name' => $human_readable_name, '!path' => $theme_path, )); + drush_print($message); + + // We return true here to represent success. + return TRUE; } From 6de99f4c6af16a0e89fe1cb6181ff7f9d94cab4a Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Thu, 17 Aug 2017 08:46:17 -0500 Subject: [PATCH 19/31] Moved post-install scripts to their own script files. --- package.json | 2 +- scripts/pattern_lab.sh | 14 ++++++++++++++ scripts/twig_functions.sh | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100755 scripts/pattern_lab.sh create mode 100755 scripts/twig_functions.sh diff --git a/package.json b/package.json index 8e616ca6..f95a9264 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "scripts": { "start": "gulp clean && gulp compile && gulp theme", - "postinstall": "rm -rf pattern-lab && composer create-project -n pattern-lab/edition-twig-standard pattern-lab && rm -rf pattern-lab/source && ln -s ../components pattern-lab/source && cp vendor/drupal-pattern-lab/add-attributes-twig-extension/add_attributes.function.php components/_twig-components/functions && cp vendor/drupal-pattern-lab/bem-twig-extension/bem.function.php components/_twig-components/functions" + "postinstall": "./scripts/pattern_lab.sh && ./scripts/twig_functions.sh" }, "precommit.silent": true } diff --git a/scripts/pattern_lab.sh b/scripts/pattern_lab.sh new file mode 100755 index 00000000..507fb046 --- /dev/null +++ b/scripts/pattern_lab.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Install Pattern Lab + +# Remove existing PL directory +rm -rf pattern-lab + +# Install PL +composer create-project -n pattern-lab/edition-twig-standard pattern-lab + +# Delete the default source directory +rm -rf pattern-lab/source + +# Symlink our components directory to the source location we just deleted +ln -s ../components pattern-lab/source diff --git a/scripts/twig_functions.sh b/scripts/twig_functions.sh new file mode 100755 index 00000000..dd6043e2 --- /dev/null +++ b/scripts/twig_functions.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Link contrib twig functions into the components directory + +# First we need to find out whether this is inside a Drupal install or standalone Emulsify +if [ -d ../../../../vendor ] +then + # Drupal install + VENDORDIR=../../../../vendor +elif [ -d vendor ] +then + # Standalone + VENDORDIR=vendor +else + # No vendor directory found + echo "Vendor directory not found. Please run composer install." +fi + +# If we found a vendor directory, copy the twig functions into place +if [ $VENDORDIR ] +then + # list of twig functions to copy, starting from the vendor directory + twig_functions=( + "drupal-pattern-lab/add-attributes-twig-extension/add_attributes.function.php" + "drupal-pattern-lab/bem-twig-extension/bem.function.php" + ) + + # Create symlinks for all contrib twig functions + for i in "${twig_functions[@]}" + do + cp $VENDORDIR/$i ./components/_twig-components/functions/. + done +fi From 333cdd2d9ab47a31405c90fe68e809c9d8f6d0cc Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Thu, 17 Aug 2017 09:51:03 -0500 Subject: [PATCH 20/31] Removed git repos now that everything's on Packagist. --- composer.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/composer.json b/composer.json index 622f17bc..1c1c5156 100644 --- a/composer.json +++ b/composer.json @@ -23,14 +23,6 @@ } ], "repositories": { - "bem-twig-extension": { - "type": "vcs", - "url": "https://github.com/drupal-pattern-lab/bem-twig-extension" - }, - "add-attributes-twig-extension": { - "type": "vcs", - "url": "https://github.com/drupal-pattern-lab/add-attributes-twig-extension" - }, "drupal": { "type": "composer", "url": "https://packages.drupal.org/8" From 84aeb4865e06f90b6df1d64025dbd22112a31d33 Mon Sep 17 00:00:00 2001 From: Evan Willhite Date: Thu, 17 Aug 2017 12:51:06 -0500 Subject: [PATCH 21/31] accommodate manual drupal installs --- scripts/twig_functions.sh | 4 ++++ yarn.lock | 20 +++++++------------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/scripts/twig_functions.sh b/scripts/twig_functions.sh index dd6043e2..24b9910b 100755 --- a/scripts/twig_functions.sh +++ b/scripts/twig_functions.sh @@ -10,6 +10,10 @@ elif [ -d vendor ] then # Standalone VENDORDIR=vendor +elif [ -d ../../../vendor ] +then + # Composer-less Drupal + VENDORDIR=../../../vendor else # No vendor directory found echo "Vendor directory not found. Please run composer install." diff --git a/yarn.lock b/yarn.lock index 5fab8b59..89d93e44 100644 --- a/yarn.lock +++ b/yarn.lock @@ -20,8 +20,8 @@ through2 "^2.0.3" "@types/node@^8.0.19": - version "8.0.23" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.23.tgz#c746697004782346594a0d755c34425bbf3014d2" + version "8.0.24" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.24.tgz#06c580084d9add1fb40c1510ef0b448961246fb1" abbrev@1: version "1.1.0" @@ -2870,8 +2870,8 @@ inquirer@^0.12.0: through "^2.3.6" inquirer@^3.0.6: - version "3.2.1" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.2.1.tgz#06ceb0f540f45ca548c17d6840959878265fa175" + version "3.2.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.2.2.tgz#c2aaede1507cc54d826818737742d621bef2e823" dependencies: ansi-escapes "^2.0.0" chalk "^2.0.0" @@ -5196,8 +5196,8 @@ shelljs@^0.6.0: resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.6.1.tgz#ec6211bed1920442088fe0f70b2837232ed2c8a8" shellwords@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.0.tgz#66afd47b6a12932d9071cbfd98a52e785cd0ba14" + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" sigmund@~1.0.0: version "1.0.1" @@ -6180,13 +6180,7 @@ which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" -which@1, which@^1.2.12, which@^1.2.9: - version "1.3.0" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" - dependencies: - isexe "^2.0.0" - -which@1.2.x, which@~1.2.10: +which@1, which@1.2.x, which@^1.2.12, which@^1.2.9, which@~1.2.10: version "1.2.14" resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" dependencies: From 3684356718544d022d170df52c7d0e1f9736b267 Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Thu, 17 Aug 2017 13:46:14 -0500 Subject: [PATCH 22/31] Updated installation instructions in readme. --- README.md | 55 ++++++++++++++++++++++++++++++++------- scripts/twig_functions.sh | 2 +- 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b126adc8..e5c495fc 100644 --- a/README.md +++ b/README.md @@ -11,19 +11,54 @@ Component-driven prototyping tool using [Pattern Lab v2](http://patternlab.io/) 3. [Composer](https://getcomposer.org/) 4. Optional: [Yarn](https://github.com/yarnpkg/yarn) -## Quickstart - - 1. `npm install` or `yarn install` - -#### (Drupal-specific installation) - - 1. Download and enable [Components](https://www.drupal.org/project/components) module - 2. Download and enable this fork of the [Unified Twig Extensions](https://github.com/evanmwillhite/unified-twig-extensions/tree/develop) module - 2. Enable Emulsify theme +## Quickstart (Emulsify Standalone) + + 1. `composer create-project fourkitchens/emulsify --stability dev --no-interaction emulsify` + 2. `cd emulsify` + 3. `npm install` or `yarn install` + +## Drupal-specific installation + +### In a Composer-based Drupal install (recommended) + + 1. `composer require fourkitchens/emulsify` + 2. `cd web/themes/contrib/emulsify/` + 3. `npm install` or `yarn install` + 4. Optional (but recommeded): Create "child" theme `drush emulsify "Theme Name"` (more details below) + 5. Enable the theme in Drupal + +### In a non-Composer Drupal install (e.g. tarball dowanload from drupal.org) + + 1. `cd themes/custom` (You may need to create this directory) + 2. `composer create-project fourkitchens/emulsify --stability dev --no-interaction emulsify` + 3. `cd emulsify` + 4. `npm install` or `yarn install` + 5. Optional (but recommeded): Create "child" theme `drush emulsify "Theme Name"` (more details below) + 6. Enable the theme in Drupal + +### If you can not use Composer at all (not recommended) + + 1. `cd themes/custom` (You may need to create this directory) + 2. `git clone git@github.com:fourkitchens/emulsify.git` + 3. `cd emulsify` + 4. get the [bem.function.php](https://github.com/drupal-pattern-lab/bem-twig-extension) and [add_attributes.function.php](https://github.com/drupal-pattern-lab/add-attributes-twig-extension) files from their respective repos and place them in `emulsify/components/_twig-components/functions/` so that your directory structure looks like this: + ``` + emulsify/ + components/ + _twig-components/ + functions/ + add_attributes.function.php + bem.function.php + ``` + 5. `npm install` or `yarn install` (And ignore the "Vendor directory not found. Please run composer install." message since you're managing the bem and add_attributes funtions manually.) + 6. Download and enable the [Components](https://www.drupal.org/project/components) module + 7. Download and enable the [Unified Twig Extensions](https://github.com/drupal-pattern-lab/unified-twig-extensions) module + 8. Optional (but recommeded): Create "child" theme `drush emulsify "Theme Name"` (more details below) + 9. Enable the theme in Drupal ## Starting Pattern Lab and watch task - Start up watches and local server after compiling (runs all gulp required tasks): +The `start` command spins up a local server, compiles everything (runs all required gulp tasks), and watches for changes. 1. `npm start` or `yarn start` diff --git a/scripts/twig_functions.sh b/scripts/twig_functions.sh index 24b9910b..4b9c38ca 100755 --- a/scripts/twig_functions.sh +++ b/scripts/twig_functions.sh @@ -22,7 +22,7 @@ fi # If we found a vendor directory, copy the twig functions into place if [ $VENDORDIR ] then - # list of twig functions to copy, starting from the vendor directory + # Array of twig functions to copy, starting from the vendor directory twig_functions=( "drupal-pattern-lab/add-attributes-twig-extension/add_attributes.function.php" "drupal-pattern-lab/bem-twig-extension/bem.function.php" From 7a440eaf7aee186c8957831cf67c4e9305d64e97 Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Thu, 17 Aug 2017 13:51:27 -0500 Subject: [PATCH 23/31] Fixed typos in readme. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e5c495fc..ec89fa7d 100644 --- a/README.md +++ b/README.md @@ -24,16 +24,16 @@ Component-driven prototyping tool using [Pattern Lab v2](http://patternlab.io/) 1. `composer require fourkitchens/emulsify` 2. `cd web/themes/contrib/emulsify/` 3. `npm install` or `yarn install` - 4. Optional (but recommeded): Create "child" theme `drush emulsify "Theme Name"` (more details below) + 4. Optional (but recommended): Create "child" theme `drush emulsify "Theme Name"` (more details below) 5. Enable the theme in Drupal -### In a non-Composer Drupal install (e.g. tarball dowanload from drupal.org) +### In a non-Composer Drupal install (e.g. tarball download from drupal.org) 1. `cd themes/custom` (You may need to create this directory) 2. `composer create-project fourkitchens/emulsify --stability dev --no-interaction emulsify` 3. `cd emulsify` 4. `npm install` or `yarn install` - 5. Optional (but recommeded): Create "child" theme `drush emulsify "Theme Name"` (more details below) + 5. Optional (but recommended): Create "child" theme `drush emulsify "Theme Name"` (more details below) 6. Enable the theme in Drupal ### If you can not use Composer at all (not recommended) @@ -50,10 +50,10 @@ Component-driven prototyping tool using [Pattern Lab v2](http://patternlab.io/) add_attributes.function.php bem.function.php ``` - 5. `npm install` or `yarn install` (And ignore the "Vendor directory not found. Please run composer install." message since you're managing the bem and add_attributes funtions manually.) + 5. `npm install` or `yarn install` (And ignore the "Vendor directory not found. Please run composer install." message since you're managing the bem and add_attributes functions manually.) 6. Download and enable the [Components](https://www.drupal.org/project/components) module 7. Download and enable the [Unified Twig Extensions](https://github.com/drupal-pattern-lab/unified-twig-extensions) module - 8. Optional (but recommeded): Create "child" theme `drush emulsify "Theme Name"` (more details below) + 8. Optional (but recommended): Create "child" theme `drush emulsify "Theme Name"` (more details below) 9. Enable the theme in Drupal ## Starting Pattern Lab and watch task From 54229beb4e3f4e034d7ddce0cd735cf5fc35589a Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Thu, 17 Aug 2017 14:12:54 -0500 Subject: [PATCH 24/31] Moved 'other' installation instructions to wiki. --- README.md | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/README.md b/README.md index ec89fa7d..665d20ee 100644 --- a/README.md +++ b/README.md @@ -27,34 +27,7 @@ Component-driven prototyping tool using [Pattern Lab v2](http://patternlab.io/) 4. Optional (but recommended): Create "child" theme `drush emulsify "Theme Name"` (more details below) 5. Enable the theme in Drupal -### In a non-Composer Drupal install (e.g. tarball download from drupal.org) - - 1. `cd themes/custom` (You may need to create this directory) - 2. `composer create-project fourkitchens/emulsify --stability dev --no-interaction emulsify` - 3. `cd emulsify` - 4. `npm install` or `yarn install` - 5. Optional (but recommended): Create "child" theme `drush emulsify "Theme Name"` (more details below) - 6. Enable the theme in Drupal - -### If you can not use Composer at all (not recommended) - - 1. `cd themes/custom` (You may need to create this directory) - 2. `git clone git@github.com:fourkitchens/emulsify.git` - 3. `cd emulsify` - 4. get the [bem.function.php](https://github.com/drupal-pattern-lab/bem-twig-extension) and [add_attributes.function.php](https://github.com/drupal-pattern-lab/add-attributes-twig-extension) files from their respective repos and place them in `emulsify/components/_twig-components/functions/` so that your directory structure looks like this: - ``` - emulsify/ - components/ - _twig-components/ - functions/ - add_attributes.function.php - bem.function.php - ``` - 5. `npm install` or `yarn install` (And ignore the "Vendor directory not found. Please run composer install." message since you're managing the bem and add_attributes functions manually.) - 6. Download and enable the [Components](https://www.drupal.org/project/components) module - 7. Download and enable the [Unified Twig Extensions](https://github.com/drupal-pattern-lab/unified-twig-extensions) module - 8. Optional (but recommended): Create "child" theme `drush emulsify "Theme Name"` (more details below) - 9. Enable the theme in Drupal +If you're not using a Composer-based Drupal install (e.g. tarball download from drupal.org) installation [instructions can be found on the Wiki](https://github.com/fourkitchens/emulsify/wiki/Installation). ## Starting Pattern Lab and watch task From 7c7e1a054d57c035336413b67d38d0312da2dbec Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Thu, 17 Aug 2017 14:45:07 -0500 Subject: [PATCH 25/31] Updated readme with drush help command. --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 665d20ee..fb493ea3 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Component-driven prototyping tool using [Pattern Lab v2](http://patternlab.io/) 1. `composer require fourkitchens/emulsify` 2. `cd web/themes/contrib/emulsify/` 3. `npm install` or `yarn install` - 4. Optional (but recommended): Create "child" theme `drush emulsify "Theme Name"` (more details below) + 4. Optional (but recommended): Create "child" theme `drush emulsify "Theme Name"` (run `drush help emulsify` for available options) 5. Enable the theme in Drupal If you're not using a Composer-based Drupal install (e.g. tarball download from drupal.org) installation [instructions can be found on the Wiki](https://github.com/fourkitchens/emulsify/wiki/Installation). @@ -46,8 +46,7 @@ The `start` command spins up a local server, compiles everything (runs all requi Stock Components with Drupal support built-in (https://github.com/fourkitchens/emulsify#emulsifys-built-in-components-with-drupal-support) Performance Testing Support for testing via Google PageSpeed Insights and WebPageTest.org (https://github.com/fourkitchens/emulsify/wiki/Gulp-Config#performance-testing) Automated Github Deployment Deploy your Pattern Lab instance as a Github page (https://github.com/fourkitchens/emulsify/wiki/Gulp-Config#deployment) - - +

Emulsify's Built in Components with Drupal support

Forms, tables, video, accordion, cards, breadcrumbs, tabs, pager, status messages, grid From 24cd466e2f9fcd8f25328318a86e828342244276 Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Thu, 17 Aug 2017 15:16:40 -0500 Subject: [PATCH 26/31] Added step to enable the components and unified_twig_ext modules. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fb493ea3..cb22c50f 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,8 @@ Component-driven prototyping tool using [Pattern Lab v2](http://patternlab.io/) 2. `cd web/themes/contrib/emulsify/` 3. `npm install` or `yarn install` 4. Optional (but recommended): Create "child" theme `drush emulsify "Theme Name"` (run `drush help emulsify` for available options) - 5. Enable the theme in Drupal + 5. Enable the components and unified twig extensions modules `drush en -y components unified_twig_ext` + 6. Enable the theme in Drupal If you're not using a Composer-based Drupal install (e.g. tarball download from drupal.org) installation [instructions can be found on the Wiki](https://github.com/fourkitchens/emulsify/wiki/Installation). From ca759f3c88db04822685eaac50550d2c163032be Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Thu, 17 Aug 2017 16:22:49 -0500 Subject: [PATCH 27/31] Added scripts to the files to copy array. --- emulsify.drush.inc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/emulsify.drush.inc b/emulsify.drush.inc index dc059099..b129808d 100644 --- a/emulsify.drush.inc +++ b/emulsify.drush.inc @@ -14,7 +14,7 @@ function emulsify_drush_command() { $items['emulsify'] = array( 'description' => 'Create an Emulsify-based theme.', 'arguments' => array( - 'human_readable_name' => 'The name of your theme.', + 'human_readable_name' => 'The name of your theme.', ), 'options' => array( 'machine-name' => 'The machine-readable name of your theme. This will be auto-generated from the human_readable_name if ommited.', @@ -52,11 +52,6 @@ function drush_emulsify($human_readable_name = NULL) { return; } - // Determine the theme name. - if (!isset($human_readable_name)) { - $human_readable_name = drush_get_option('human_readable_name'); - } - // Determine the machine name. $machine_name = drush_get_option('machine-name'); if (!$machine_name) { @@ -265,6 +260,7 @@ function _emulsify_get_files_to_copy() { 'emulsify.libraries.yml', 'gulpfile.js', 'package.json', + 'scripts', 'yarn.lock', ); // If we would like to have a bare copy we use is slim option. From e19debe388cf385400481fb25cb0736c0e3b42ea Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Thu, 17 Aug 2017 17:05:26 -0500 Subject: [PATCH 28/31] Change double quotes to single quotes --- emulsify.drush.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emulsify.drush.inc b/emulsify.drush.inc index b129808d..d6f26987 100644 --- a/emulsify.drush.inc +++ b/emulsify.drush.inc @@ -80,7 +80,7 @@ function drush_emulsify($human_readable_name = NULL) { // Notify the user of failure. if ($status === FALSE) { - drush_set_error("EMULSIFY", "Your theme was not successfully created."); + drush_set_error('EMULSIFY', 'Your theme was not successfully created.'); } } From 782a9a90a5eeb0983fb6c54744a448c96f65a761 Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Fri, 18 Aug 2017 11:31:55 -0500 Subject: [PATCH 29/31] Remove scalar type hints to support PHP5.6 --- emulsify.drush.inc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/emulsify.drush.inc b/emulsify.drush.inc index d6f26987..5d885e8d 100644 --- a/emulsify.drush.inc +++ b/emulsify.drush.inc @@ -100,7 +100,7 @@ function drush_emulsify($human_readable_name = NULL) { * @return boolean * A boolean representing the success or failure of the function. */ -function drush_emulsify_create(string $human_readable_name, string $machine_name, string $description, string $theme_path) { +function drush_emulsify_create($human_readable_name, $machine_name, $description, $theme_path) { $theme_path = drush_normalize_path(drush_get_context('DRUSH_DRUPAL_ROOT') . DIRECTORY_SEPARATOR . $theme_path . DIRECTORY_SEPARATOR . $machine_name); // Phase: Validate theme path is writeable. @@ -170,7 +170,7 @@ function drush_emulsify_create(string $human_readable_name, string $machine_name * An array with a key representing the string to be replaced and value * representing the string to replace it with. */ -function _emulsify_get_alterations(string $human_readable_name, string $machine_name, string $description) { +function _emulsify_get_alterations($human_readable_name, $machine_name, $description) { return array( 'Emulsify' => $human_readable_name, 'emulsify' => $machine_name, @@ -328,7 +328,7 @@ function _emulsify_get_files_to_rename() { * @return boolean * A boolean representing the success or failure of the function. */ -function _emulsify_alter_files(string $theme_path, array $files_to_alter = array(), array $alterations = array(), bool $absolute = FALSE) { +function _emulsify_alter_files($theme_path, array $files_to_alter = array(), array $alterations = array(), $absolute = FALSE) { if (empty($files_to_alter) || empty($alterations)) { return TRUE; } @@ -372,7 +372,7 @@ function _emulsify_alter_files(string $theme_path, array $files_to_alter = array * @return boolean * A boolean representing the success or failure of the function. */ -function _emulsify_make_directories(array $directories = array(), string $destination_path = '') { +function _emulsify_make_directories(array $directories = array(), $destination_path = '') { // Check for invalid settings and return an error. if (!is_array($directories) || !is_string($destination_path) || empty($destination_path)) { @@ -410,7 +410,7 @@ function _emulsify_make_directories(array $directories = array(), string $destin * @return boolean * A boolean representing the success or failure of the function. */ -function _emulsify_copy_files(array $files = array(), string $destination_path = '') { +function _emulsify_copy_files(array $files = array(), $destination_path = '') { // Check for invalid settings and return an error. if (!is_array($files) || !is_string($destination_path) || empty($destination_path)) { @@ -450,7 +450,7 @@ function _emulsify_copy_files(array $files = array(), string $destination_path = * @return boolean * A boolean representing success or failure of the rename. */ -function _emulsify_rename_files(string $theme_path, string $machine_name, array $files_to_rename = array()) { +function _emulsify_rename_files($theme_path, $machine_name, array $files_to_rename = array()) { foreach ($files_to_rename as $file_to_rename_path) { $file_original_path = $theme_path . DIRECTORY_SEPARATOR . $file_to_rename_path; $file_new_path = $theme_path . DIRECTORY_SEPARATOR . str_replace('emulsify', $machine_name, $file_to_rename_path); @@ -473,7 +473,7 @@ function _emulsify_rename_files(string $theme_path, string $machine_name, array * @return boolean * A boolean representing success or failure of the replacement. */ -function _emulsify_file_str_replace(string $file_path, array $find, array $replace) { +function _emulsify_file_str_replace($file_path, array $find, array $replace) { $file_path = drush_normalize_path($file_path); $file_contents = file_get_contents($file_path); $file_contents = str_replace($find, $replace, $file_contents); @@ -490,7 +490,7 @@ function _emulsify_file_str_replace(string $file_path, array $find, array $repla * @return boolean * A boolean representing success or failure. */ -function _emulsify_validate_path(string $path) { +function _emulsify_validate_path($path) { // Check for succees, if not, log the error and return FALSE. $return = file_prepare_directory($path, FILE_CREATE_DIRECTORY); @@ -510,7 +510,7 @@ function _emulsify_validate_path(string $path) { * @return boolean * A boolean representing if the path is empty or not. */ -function _emulsify_validate_path_is_empty(string $path) { +function _emulsify_validate_path_is_empty($path) { if (!is_readable($path)) { return FALSE; @@ -531,7 +531,7 @@ function _emulsify_validate_path_is_empty(string $path) { * @return boolean * Always return false in the case we use this function as a return value. */ -function _emulsify_notify_fail(string $path = '', string $message = '') { +function _emulsify_notify_fail($path = '', $message = '') { // Set a default message for the most common error. if (empty($message)) { @@ -563,7 +563,7 @@ function _emulsify_notify_fail(string $path = '', string $message = '') { * @return boolean * Always TRUE in the case we want to use this function as a return value. */ -function _emulsify_notify_success(string $human_readable_name, string $theme_path) { +function _emulsify_notify_success($human_readable_name, $theme_path) { // Notify user of the newly created theme. $message = 'Successfully created the Emulsify theme "!name" created in: !path, you can now run \'yarn\' or \'yarn install\' or \'npm install\' to install the node modules.'; From bbf63cf55d108410c1d935d8d2de804ed06f6e46 Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Fri, 18 Aug 2017 13:20:27 -0500 Subject: [PATCH 30/31] Fix breakpoints rename, add more files and directories to slim --- emulsify.drush.inc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/emulsify.drush.inc b/emulsify.drush.inc index 5d885e8d..95eaa5dd 100644 --- a/emulsify.drush.inc +++ b/emulsify.drush.inc @@ -224,6 +224,11 @@ function _emulsify_get_directories_to_make() { 'components/_patterns/03-organisms', 'components/_patterns/04-templates', 'components/_patterns/05-pages', + 'fonts', + 'images', + 'images/icons', + 'images/icons/src', + 'templates', ); } else { @@ -272,7 +277,9 @@ function _emulsify_get_files_to_copy() { 'components/_twig-components', 'components/css', 'components/images', + 'components/_patterns/style.scss', 'components/_patterns/00-base/global/01-colors', + 'components/_patterns/00-base/global/global.js', )); } else { @@ -298,16 +305,15 @@ function _emulsify_get_files_to_rename() { $default_array = array( 'emulsify.info.yml', 'emulsify.theme', + 'emulsify.breakpoints.yml', + 'emulsify.libraries.yml', ); // If we would like to have a bare copy we use is slim option. if (drush_get_option('slim') === TRUE) { - return $default_array; + return array_merge($default_array, array()); } else { - return array_merge($default_array, array( - 'emulsify.breakpoints.yml', - 'emulsify.libraries.yml', - )); + return array_merge($default_array, array()); } } From cd90c60cf0a727177ea0e2917a0e4fa7e7485504 Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Fri, 18 Aug 2017 13:22:39 -0500 Subject: [PATCH 31/31] Fix bug where if someone composer installed within emulsify yarn would fail --- scripts/twig_functions.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/twig_functions.sh b/scripts/twig_functions.sh index 4b9c38ca..ba357403 100755 --- a/scripts/twig_functions.sh +++ b/scripts/twig_functions.sh @@ -2,15 +2,15 @@ # Link contrib twig functions into the components directory # First we need to find out whether this is inside a Drupal install or standalone Emulsify -if [ -d ../../../../vendor ] +if [ -f ../../../../vendor/drupal-pattern-lab/bem-twig-extension/bem.function.php ] then # Drupal install VENDORDIR=../../../../vendor -elif [ -d vendor ] +elif [ -f vendor/drupal-pattern-lab/bem-twig-extension/bem.function.php ] then # Standalone VENDORDIR=vendor -elif [ -d ../../../vendor ] +elif [ -f ../../../vendor/drupal-pattern-lab/bem-twig-extension/bem.function.php ] then # Composer-less Drupal VENDORDIR=../../../vendor