jekyll-postcss 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cba7273f4532e27ab92106857418dc0263b353e5bf82de0f6b01ab7a9f0672c3
4
- data.tar.gz: d4f38cf3b58e9d5a5f84425b19795a99c586eb5a7a65e3f17c24edad9bda81af
3
+ metadata.gz: b4610bf3b4f73b8c871bdc5ae6f91ff3f461128b5ce34716486bbcbb77987a1d
4
+ data.tar.gz: d1033851975011342f10ad19c6acfd1b9168aa736cc0071766cb17eeefcd6fe5
5
5
  SHA512:
6
- metadata.gz: 4c33fa3a5cbaa238644fe013dbe4f8c0dc7773c4c77993b193c08f130b00b2fd2917997ab83416e88eb169b9464a621ef1011567c60b7b33a8913f63723d20bc
7
- data.tar.gz: 30238af1504ce3ec730a22bd9dd02a0e01ef2550467d4b4d78a21e10663b9b9f61cc1cc1f528819586cad62a11d999cbae244a08d71115aca1c70808584f50b6
6
+ metadata.gz: 3c9a64927c2b52f7041624b9413745b4f0e4539c2066c85533723d543c580bc946cf7e21426a02b29af2ca048eb821e896398433d0e575b560426099b787ac5f
7
+ data.tar.gz: 31b02f8c9c9b8610daff01bb5bd58622ff7354ea9f688c8d25018678996efdb3a9737dbe4ff67bc011090a7edcca938061a2c1b811319d7a8e0a6a0731f31119
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0
4
+
5
+ - Option to disable the cache #32 by [Tristan Dunn](https://github.com/tristandunn)
6
+ - Show full PostCSS error and stack trace #31 by [Carl Furrow](https://github.com/cfurrow)
7
+
3
8
  ## 0.4.1
4
9
 
5
10
  - Fix a weird issue where the jekyll server never booted up because the converter class got in an infinite loop trying to make a socket connection to the postcss server.
data/README.md CHANGED
@@ -57,6 +57,19 @@ module.exports = {
57
57
  };
58
58
  ```
59
59
 
60
+ ### Caching
61
+
62
+ Caching is enabled by default so PostCSS will only be called when the CSS content has changed. If needed you can disable caching in your Jekyll configuration to force the CSS to be recompiled every time.
63
+
64
+ If you are using the [TailwindCSS JIT](https://tailwindcss.com/docs/just-in-time-mode), you most likely need to disable the caching feature.
65
+
66
+ ```yaml
67
+ # _config.yml
68
+
69
+ postcss:
70
+ cache: false
71
+ ```
72
+
60
73
  ### Deployment
61
74
 
62
75
  When deploying, make sure to set your `JEKYLL_ENV` to something like `production` or `staging`. This is necessary to make sure that jekyll-postcss will not use internal development conveniences when building on your host's servers.
data/bin/postcss CHANGED
@@ -7,11 +7,11 @@ const net = require("net");
7
7
  class PostCSS {
8
8
  static process(data, write) {
9
9
  postcss(config.plugins)
10
- .process(JSON.parse(data).raw_content, { from: "stdin" })
10
+ .process(JSON.parse(data).raw_content, { from: undefined })
11
11
  .then((result) => write(result))
12
12
  .catch((error) => {
13
13
  console.error("PostCSS Error!\n");
14
- console.error(error.toString());
14
+ console.error(error);
15
15
  });
16
16
  }
17
17
 
@@ -12,6 +12,7 @@ module Jekyll
12
12
  def initialize(config = {})
13
13
  super
14
14
 
15
+ @cache_enabled = config.fetch("postcss", {}).fetch("cache", true)
15
16
  @socket = config.fetch("socket") { ::PostCss::Socket.new }
16
17
  @raw_cache = nil
17
18
  @import_raw_cache = {}
@@ -32,7 +33,7 @@ module Jekyll
32
33
  @raw_digest = Digest::MD5.hexdigest content
33
34
  @raw_import_digests = import_digests(content)
34
35
 
35
- if cache_miss.any?
36
+ if cache_disabled? || cache_miss?
36
37
  @raw_cache = @raw_digest.dup
37
38
  @import_raw_cache = @raw_import_digests.dup
38
39
 
@@ -58,10 +59,15 @@ module Jekyll
58
59
  end
59
60
  end
60
61
 
61
- def cache_miss
62
+ def cache_disabled?
63
+ @cache_enabled == false
64
+ end
65
+
66
+ def cache_miss?
62
67
  @raw_import_digests
63
68
  .map { |import, hash| @import_raw_cache[import] != hash }
64
69
  .unshift(@raw_cache != @raw_digest)
70
+ .any?
65
71
  end
66
72
 
67
73
  def reset
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module PostCss
5
- VERSION = "0.4.1"
5
+ VERSION = "0.5.0"
6
6
  end
7
7
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jekyll-postcss",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "repository": "git@github.com:mhanberg/jekyll-postcss.git",
5
5
  "author": "Mitchell Hanberg <mitch@mitchellhanberg.com>",
6
6
  "license": "MIT",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-postcss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mitchell Hanberg
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-26 00:00:00.000000000 Z
11
+ date: 2021-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler