Skip to content

Commit 0439e99

Browse files
committed
Merge branch 'release/1.5.2' into v1
2 parents 40928d2 + 7b95a95 commit 0439e99

File tree

9 files changed

+1125
-1477
lines changed

9 files changed

+1125
-1477
lines changed

.stylelintrc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "stylelint-config-recommended",
3+
"rules": {
4+
"at-rule-no-unknown": [ true, {
5+
"ignoreAtRules": [
6+
"screen",
7+
"extends",
8+
"responsive",
9+
"tailwind"
10+
]
11+
}],
12+
"block-no-empty": null
13+
}
14+
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# ImageOptimize Changelog
22

3+
## 1.5.2 - 2019.02.07
4+
### Changed
5+
* If you're using Craft 3.1, ImageOptimize will use Craft [environmental variables](https://docs.craftcms.com/v3/config/environments.html#control-panel-settings) for secrets
6+
37
## 1.5.1 - 2018.12.28
48
### Changed
59
* Refactored the Imgix and Thumbor Image Transforms out to external packages

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nystudio107/craft-imageoptimize",
33
"description": "Automatically create & optimize responsive image transforms, using either native Craft transforms or a service like Imgix, with zero template changes.",
44
"type": "craft-plugin",
5-
"version": "1.5.1",
5+
"version": "1.5.2",
66
"keywords": [
77
"craft",
88
"cms",

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484
"purgecss-whitelister": "^2.2.0",
8585
"resolve-url-loader": "^3.0.0",
8686
"sane": "^4.0.1",
87+
"stylelint": "^9.9.0",
88+
"stylelint-config-recommended": "^2.1.0",
8789
"style-loader": "^0.23.0",
8890
"terser-webpack-plugin": "^1.1.0",
8991
"vue-loader": "^15.4.2",

postcss.config.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
module.exports = {
22
plugins: [
3-
require("postcss-import"),
4-
require('postcss-preset-env'),
5-
require('tailwindcss')('./tailwind.config.js')
3+
require('postcss-import')({
4+
plugins: [
5+
require('stylelint')
6+
]
7+
}),
8+
require('tailwindcss')('./tailwind.config.js'),
9+
require('postcss-preset-env')({
10+
autoprefixer: { grid: true },
11+
features: {
12+
'nesting-rules': true
13+
}
14+
})
615
]
716
};

src/ImageOptimize.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ class ImageOptimize extends Plugin
9898
*/
9999
public static $generatePlaceholders = true;
100100

101+
/**
102+
* @var bool
103+
*/
104+
public static $craft31 = false;
105+
101106
// Public Methods
102107
// =========================================================================
103108

@@ -108,6 +113,7 @@ public function init()
108113
{
109114
parent::init();
110115
self::$plugin = $this;
116+
self::$craft31 = version_compare(Craft::$app->getVersion(), '3.1', '>=');
111117
// Handle any console commands
112118
$request = Craft::$app->getRequest();
113119
if ($request->getIsConsoleRequest()) {

src/variables/ImageOptimizeVariable.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,14 @@ public function createImageTransformType($config): ImageTransformInterface
8989
{
9090
return ImageOptimize::$plugin->optimize->createImageTransformType($config);
9191
}
92+
93+
/**
94+
* Return whether we are running Craft 3.1 or later
95+
*
96+
* @return bool
97+
*/
98+
public function craft31(): bool
99+
{
100+
return ImageOptimize::$craft31;
101+
}
92102
}

webpack.dev.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const configureDevServer = () => {
2222
host: settings.devServerConfig.host(),
2323
port: settings.devServerConfig.port(),
2424
https: !!parseInt(settings.devServerConfig.https()),
25+
disableHostCheck: true,
2526
quiet: true,
2627
hot: true,
2728
hotOnly: true,

yarn.lock

Lines changed: 1075 additions & 1473 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)