From c601b7caff0da5da7430554d77df1203f161692a Mon Sep 17 00:00:00 2001 From: "Matthew R. Miller" Date: Tue, 12 Jul 2016 10:17:09 -0600 Subject: [PATCH 1/6] Changing copyright to reflect repository ownership change. --- src/ClassyGeeks/Potion/BladeHelpers.php | 2 +- src/ClassyGeeks/Potion/Console/Command/ClearAssetsCommand.php | 2 +- src/ClassyGeeks/Potion/Console/Command/MakeAssetsCommand.php | 2 +- src/ClassyGeeks/Potion/PotionServiceProvider.php | 2 +- src/config/config.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ClassyGeeks/Potion/BladeHelpers.php b/src/ClassyGeeks/Potion/BladeHelpers.php index f6fadfe..81fc49d 100644 --- a/src/ClassyGeeks/Potion/BladeHelpers.php +++ b/src/ClassyGeeks/Potion/BladeHelpers.php @@ -1,6 +1,6 @@ Date: Tue, 27 Jun 2017 15:58:44 -0600 Subject: [PATCH 2/6] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 02deef3..771ebf2 100644 --- a/README.md +++ b/README.md @@ -53,4 +53,8 @@ You will now see to new Potion artisan commands. The configuration is very well - Resource watching command functionality - Support for more filters from Assetic +# License +[MIT License](LICENSE) +# Author +[Matthew R. Miller](https://github.com/mattrmiller) From 33d7f342257eaf195fee3346ff1f2f408e46f61c Mon Sep 17 00:00:00 2001 From: "Matthew R. Miller" Date: Tue, 27 Jun 2017 15:59:43 -0600 Subject: [PATCH 3/6] Update README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 771ebf2..d841c53 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ -laravel-potion -=============== +# laravel-potion + Potion is a pure PHP asset manager for Laravel based off of [Assetic](https://github.com/kriswallsmith/assetic). -###Description +# Description Laravel 5 comes with a great asset manager called Elixir. While there is nothing wrong with Elixir, it requires you to install Node.js, Gulp, and dependent NPM packages on all of your web serves. While there is nothing wrong with this if you have other needs for those technologies, it seemed unnecessary to us to install that stack solely for the sake of handling assets. So we wrote Potion. Potion is a pure PHP solution, based off of [Assetic](https://github.com/kriswallsmith/assetic) that allows you to handle your assets in the same technology stack that your application is written in. When using Potion the you will often see is "resources" and "assets". Think of resources as the raw resources inside of Laravel resources direction. Think of assets as what Potion will generate and will ultimately be served to visitors. -###Laravel Support +# Laravel Support At this time Potion only supports Laravel 5.1 or higher. While Laravel 4 support was easy to implement in code, the time needed to support requests was too much. -###Features +# Features - Fully integrated into Laravels' artisan commands - Asset versioning support - Asset CDN Url support @@ -29,7 +29,7 @@ At this time Potion only supports Laravel 5.1 or higher. While Laravel 4 support - JsCompressorFilter from YUI - ScssphpFilter -###Installation +# Installation 1) Add 'classygeeks/potion' package to your composer.json file: 2) Add the Potion Service provider to your config/app.php file under the predefined "providers" array: @@ -49,7 +49,7 @@ At this time Potion only supports Laravel 5.1 or higher. While Laravel 4 support You will now see to new Potion artisan commands. The configuration is very well documented and should be able to get even the most complex projects going quickly. -###Future Features +# Future Features - Resource watching command functionality - Support for more filters from Assetic From d9285a9d021aca7fbfa6fb8e864228580da2d35c Mon Sep 17 00:00:00 2001 From: "Matthew R. Miller" Date: Wed, 28 Jun 2017 08:04:42 -0600 Subject: [PATCH 4/6] Update README.md --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d841c53..2e0028f 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,16 @@ You will now see to new Potion artisan commands. The configuration is very well - Resource watching command functionality - Support for more filters from Assetic -# License -[MIT License](LICENSE) +# Rules For Contributing +- Please make sure all changed files are run through gofmt +- Submit a PR for review +- Your name will be added below to Contributors # Author [Matthew R. Miller](https://github.com/mattrmiller) + +# Contributors +[Matthew R. Miller](https://github.com/mattrmiller) + +# License +[MIT License](LICENSE) From 6d79ee4ac6d3584a9964c34c3fb701ba29d333ad Mon Sep 17 00:00:00 2001 From: Daniel Lowhorn Date: Thu, 31 Aug 2017 12:11:45 -0500 Subject: [PATCH 5/6] - Updated leafo/scssphp dependency --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0f1c58c..3e0e6e4 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,7 @@ "kriswallsmith/assetic": "1.*", "natxet/CssMin": "3.0.*", "leafo/lessphp": "0.5.*", - "leafo/scssphp": "0.1.*", + "leafo/scssphp": "0.6.*", "ptachoire/cssembed": "1.0.*", "linkorb/jsmin-php": "1.0.*" }, From 5d0031929e8701cdb87750a6771290cc7d86ec07 Mon Sep 17 00:00:00 2001 From: Daniel Lowhorn Date: Wed, 13 Sep 2017 08:41:21 -0500 Subject: [PATCH 6/6] - Extended MakeAssetseCommand with optional "output_append" potion parameter handling - Extended config.php with new potion indicating the usage of the new output_append parameter --- .../Console/Command/MakeAssetsCommand.php | 15 +++++++++--- src/config/config.php | 24 +++++++++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/ClassyGeeks/Potion/Console/Command/MakeAssetsCommand.php b/src/ClassyGeeks/Potion/Console/Command/MakeAssetsCommand.php index 679ec7c..9b0414a 100644 --- a/src/ClassyGeeks/Potion/Console/Command/MakeAssetsCommand.php +++ b/src/ClassyGeeks/Potion/Console/Command/MakeAssetsCommand.php @@ -155,6 +155,9 @@ public function fire() // -- Asset content $asset_content = ''; + // -- Default empty append + $outputAppend = ''; + // -- Resources foreach ($potion['resources'] as $resource) { @@ -191,9 +194,15 @@ public function fire() // -- -- -- File $file_path = $this->config['assets_path'] . DIRECTORY_SEPARATOR . $file_asset->getSourcePath(); + // -- -- -- Possible outputAppend string + $outputAppend = isset($potion['output_append']) ? $potion['output_append'] : ''; + // -- -- -- Echo $this->info("Processing resource file: {$file_path}"); + // -- -- -- Append possible $outputAppend (post-echo so original name is shown when reporting resource) + $file_path .= $outputAppend; + // -- -- -- Make file, or combine if ($potion['output'] !== false) { $asset_content .= $file_asset->dump(); @@ -209,7 +218,7 @@ public function fire() } // -- -- -- -- Add to cache - $cache[$file_asset->getSourcePath()] = $this->versionFile($file_path); + $cache[$file_asset->getSourcePath() . $outputAppend] = $this->versionFile($file_path); } } } @@ -218,7 +227,7 @@ public function fire() if ($potion['output'] !== false) { // -- -- Write to file - $file_path = $this->config['assets_path'] . DIRECTORY_SEPARATOR . $potion['output']; + $file_path = $this->config['assets_path'] . DIRECTORY_SEPARATOR . $potion['output'] . $outputAppend; // -- -- Echo $this->info("Writing asset file: {$file_path}"); @@ -229,7 +238,7 @@ public function fire() } // -- -- Add to cache - $cache[$potion['output']] = $this->versionFile($file_path); + $cache[$potion['output'] . $outputAppend] = $this->versionFile($file_path); } } diff --git a/src/config/config.php b/src/config/config.php index ad78c8f..db7f895 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -45,6 +45,30 @@ 'output' => 'app.css' ], + [ + // Resources, relative paths to 'resource_path' above, can be any valid file or glob pattern + 'resources' => [ + '/css/individual/*.scss' + ], + + // Filters to use, from filters below + 'filters' => [ + 'css_import', + 'css_rewrite', + 'css_min', + ], + + // Output file name, this signifies you are combining all resources together, + // putting false will generate each file with original file names + 'output' => false, + + // + // If specified, this optional string parameter will be concatenated to the end of every asset + // published as part of this potion. This can be used regardless of the value provided for the + // output parameter. + 'output_append' => '.css', + ], + [ // Resources, relative paths to 'resource_path' above, can be any valid file or glob pattern 'resources' => [