From dfcac1e8579261e6d0428e0c137a6133aa7ce4c0 Mon Sep 17 00:00:00 2001 From: Toby Schrapel Date: Tue, 25 Apr 2017 08:54:27 -0500 Subject: [PATCH 1/6] Remove die/var_dump --- app/setup.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/setup.php b/app/setup.php index 6daee40..3c92a04 100644 --- a/app/setup.php +++ b/app/setup.php @@ -116,7 +116,6 @@ add_action('after_setup_theme', function () { return ["{$path}/resources/views", $path]; })->unique()->toArray(); - // die(var_dump($viewPaths)); config([ 'assets.manifest' => "{$paths['dir.stylesheet']}/../dist/assets.json", 'assets.uri' => "{$paths['uri.stylesheet']}/dist", From 62bba1bd232d8728fea72d400160965139863ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Colombaro?= Date: Tue, 2 May 2017 10:21:07 +0200 Subject: [PATCH 2/6] illuminate: make with parameters (#1888) Since Illuminate 5.4, `$container->make` with `$parameters` is `$container->makeWith` : https://github.com/illuminate/container/blob/8fbb101a6081786e830cb89d1a1faa846c2c0442/Container.php#L547-L568 Related: * https://github.com/roots/sage/commit/f242cb50e9033af815ec56c7346d7f9da4b23460 * https://github.com/illuminate/container/commit/1fc0d2451e23d2ea73c10462d74add4767e2b74c --- app/helpers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers.php b/app/helpers.php index 5c11fa5..b56c162 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -21,8 +21,8 @@ function sage($abstract = null, $parameters = [], ContainerContract $container = return $container; } return $container->bound($abstract) - ? $container->make($abstract, $parameters) - : $container->make("sage.{$abstract}", $parameters); + ? $container->makeWith($abstract, $parameters) + : $container->makeWith("sage.{$abstract}", $parameters); } /** From da353de6eeb9da3b51c2be8c409a7c6be788214b Mon Sep 17 00:00:00 2001 From: Russell Fair Date: Wed, 3 May 2017 17:26:51 +0000 Subject: [PATCH 3/6] update inline documentation to reflect correct theme file locations --- resources/functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/functions.php b/resources/functions.php index a92aa27..7c579f5 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -59,12 +59,12 @@ array_map(function ($file) use ($sage_error) { /** * Here's what's happening with these hooks: - * 1. WordPress initially detects theme in themes/sage + * 1. WordPress initially detects theme in themes/sage/resources * 2. Upon activation, we tell WordPress that the theme is actually in themes/sage/resources/views - * 3. When we call get_template_directory() or get_template_directory_uri(), we point it back to themes/sage + * 3. When we call get_template_directory() or get_template_directory_uri(), we point it back to themes/sage/resources * * We do this so that the Template Hierarchy will look in themes/sage/resources/views for core WordPress themes - * But functions.php, style.css, and index.php are all still located in themes/sage + * But functions.php, style.css, and index.php are all still located in themes/sage/resources * * This is not compatible with the WordPress Customizer theme preview prior to theme activation * From 74b485be95aa25a398d1d91f2f99328c422ff043 Mon Sep 17 00:00:00 2001 From: Toby Schrapel Date: Fri, 19 May 2017 16:22:23 -0500 Subject: [PATCH 4/6] Do not redirect for WP-CLI (#1891) --- resources/functions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/functions.php b/resources/functions.php index a92aa27..137a026 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -86,6 +86,9 @@ add_filter('stylesheet_directory_uri', function ($uri) { }); if ($sage_views !== get_option('stylesheet')) { update_option('stylesheet', $sage_views); + if (php_sapi_name() === 'cli') { + return; + } wp_redirect($_SERVER['REQUEST_URI']); exit(); } From c21df9965ff8217c3b4ff90bbe6099206d7b4fbf Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 31 May 2017 13:09:00 -0700 Subject: [PATCH 5/6] Update Autoprefixer and standardize browserlist location (#1899) This updates Autoprefixer to 7.1.1, and also moves the browser target list to package.json, in line with the recommendation made in this article (https://evilmartians.com/chronicles/autoprefixer-7-browserslist-2-released) from the developers of Autoprefixer and Browserslist. --- package.json | 7 +++- resources/assets/build/config.js | 1 - resources/assets/build/webpack.config.js | 2 +- .../assets/build/webpack.config.optimize.js | 2 +- resources/assets/config.json | 5 --- yarn.lock | 36 ++++++++++++++++++- 6 files changed, 43 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 75c16de..8b3d461 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,11 @@ "url": "http://opensource.org/licenses/MIT" } ], + "browserslist": [ + "last 2 versions", + "android 4", + "opera 12" + ], "scripts": { "build": "webpack --progress --config resources/assets/build/webpack.config.js", "build:production": "webpack --progress -p --config resources/assets/build/webpack.config.js", @@ -30,7 +35,7 @@ "node": ">= 6.9.4" }, "devDependencies": { - "autoprefixer": "^6.7.7", + "autoprefixer": "^7.1.1", "browser-sync": "^2.18.8", "browsersync-webpack-plugin": "^0.5.3", "bs-html-injector": "^3.0.3", diff --git a/resources/assets/build/config.js b/resources/assets/build/config.js index 9ef5827..c9a04a1 100644 --- a/resources/assets/build/config.js +++ b/resources/assets/build/config.js @@ -25,7 +25,6 @@ const config = merge({ watcher: !!argv.watch, }, watch: [], - browsers: [], }, userConfig); module.exports = merge(config, { diff --git a/resources/assets/build/webpack.config.js b/resources/assets/build/webpack.config.js index cdd44b2..995d9f6 100644 --- a/resources/assets/build/webpack.config.js +++ b/resources/assets/build/webpack.config.js @@ -141,7 +141,7 @@ let webpackConfig = { output: { path: config.paths.dist }, context: config.paths.assets, postcss: [ - autoprefixer({ browsers: config.browsers }), + autoprefixer(), ], }, }), diff --git a/resources/assets/build/webpack.config.optimize.js b/resources/assets/build/webpack.config.optimize.js index 3b306ab..666c945 100644 --- a/resources/assets/build/webpack.config.optimize.js +++ b/resources/assets/build/webpack.config.optimize.js @@ -13,7 +13,7 @@ module.exports = { cssProcessor: cssnano, cssProcessorOptions: { discardComments: { removeAll: true }, - autoprefixer: { browsers: config.browsers }, + autoprefixer: {}, }, canPrint: true, }), diff --git a/resources/assets/config.json b/resources/assets/config.json index 6beda62..4dfdb17 100644 --- a/resources/assets/config.json +++ b/resources/assets/config.json @@ -14,10 +14,5 @@ "cacheBusting": "[name]_[hash:8]", "watch": [ "{app,resources/views}/**/*.php" - ], - "browsers": [ - "last 2 versions", - "android 4", - "opera 12" ] } diff --git a/yarn.lock b/yarn.lock index b19051b..e35627b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -246,7 +246,7 @@ atob@~1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/atob/-/atob-1.1.3.tgz#95f13629b12c3a51a5d215abdce2aa9f32f80773" -autoprefixer@^6.3.1, autoprefixer@^6.7.7: +autoprefixer@^6.3.1: version "6.7.7" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-6.7.7.tgz#1dbd1c835658e35ce3f9984099db00585c782014" dependencies: @@ -257,6 +257,17 @@ autoprefixer@^6.3.1, autoprefixer@^6.7.7: postcss "^5.2.16" postcss-value-parser "^3.2.3" +autoprefixer@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-7.1.1.tgz#97bc854c7d0b979f8d6489de547a0d17fb307f6d" + dependencies: + browserslist "^2.1.3" + caniuse-lite "^1.0.30000670" + normalize-range "^0.1.2" + num2fraction "^1.2.2" + postcss "^6.0.1" + postcss-value-parser "^3.2.3" + aws-sign2@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" @@ -535,6 +546,13 @@ browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6: caniuse-db "^1.0.30000639" electron-to-chromium "^1.2.7" +browserslist@^2.1.3: + version "2.1.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.1.4.tgz#cc526af4a1312b7d2e05653e56d0c8ab70c0e053" + dependencies: + caniuse-lite "^1.0.30000670" + electron-to-chromium "^1.3.11" + browsersync-webpack-plugin@^0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/browsersync-webpack-plugin/-/browsersync-webpack-plugin-0.5.3.tgz#35bc3b1c5aba8c7d2d7b700e23d511454b8d516e" @@ -684,6 +702,10 @@ caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: version "1.0.30000655" resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000655.tgz#e40b6287adc938848d6708ef83d65b5f54ac1874" +caniuse-lite@^1.0.30000670: + version "1.0.30000676" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000676.tgz#1e962123f48073f0c51c4ea0651dd64d25786498" + 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" @@ -1456,6 +1478,10 @@ electron-to-chromium@^1.2.7: version "1.3.3" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.3.tgz#651eb63fe89f39db70ffc8dbd5d9b66958bc6a0e" +electron-to-chromium@^1.3.11: + version "1.3.13" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.13.tgz#1b3a5eace6e087bb5e257a100b0cbfe81b2891fc" + elliptic@^6.0.0: version "6.4.0" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" @@ -4195,6 +4221,14 @@ postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0 source-map "^0.5.6" supports-color "^3.2.3" +postcss@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.1.tgz#000dbd1f8eef217aa368b9a212c5fc40b2a8f3f2" + dependencies: + chalk "^1.1.3" + source-map "^0.5.6" + supports-color "^3.2.3" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" From c304c3041dcba8ab71d4b2d3d68dc29407d9b7a7 Mon Sep 17 00:00:00 2001 From: Julien Melissas Date: Tue, 6 Jun 2017 16:15:34 -0400 Subject: [PATCH 6/6] Optimize CSS Assets safe = true (#1901) Related: https://github.com/roots/sage/pull/1610#issuecomment-182969178 oh word! --- resources/assets/build/webpack.config.optimize.js | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/assets/build/webpack.config.optimize.js b/resources/assets/build/webpack.config.optimize.js index 666c945..9480cfc 100644 --- a/resources/assets/build/webpack.config.optimize.js +++ b/resources/assets/build/webpack.config.optimize.js @@ -14,6 +14,7 @@ module.exports = { cssProcessorOptions: { discardComments: { removeAll: true }, autoprefixer: {}, + safe: true, }, canPrint: true, }),