jekyll-postcss 0.4.0 → 0.4.1

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: b814559fcadf25906a68dbb7e40926a72fa75aa92e293e3d39454dd9bcf784cd
4
- data.tar.gz: 779270e4ff58d9b35a4c46dbfbab8be77998edd9c2307208a7654b27ab2841f2
3
+ metadata.gz: cba7273f4532e27ab92106857418dc0263b353e5bf82de0f6b01ab7a9f0672c3
4
+ data.tar.gz: d4f38cf3b58e9d5a5f84425b19795a99c586eb5a7a65e3f17c24edad9bda81af
5
5
  SHA512:
6
- metadata.gz: 65fb6ab42952f39ae49851e0600539fcac18ad4505fb817db67690c518984f73e09672d6dd6a00a2d989c05a054d13c15d2a88a0fc4fa0043fb654d48b3d43c4
7
- data.tar.gz: 72ff0a8ad7f284634faafd8adf4b33baf77532af7ea680ce0e05a89c1107d9e64643934477917d63106dfa0abb42b75f985cb6a6de60acb7fc3ef091384a9571
6
+ metadata.gz: 4c33fa3a5cbaa238644fe013dbe4f8c0dc7773c4c77993b193c08f130b00b2fd2917997ab83416e88eb169b9464a621ef1011567c60b7b33a8913f63723d20bc
7
+ data.tar.gz: 30238af1504ce3ec730a22bd9dd02a0e01ef2550467d4b4d78a21e10663b9b9f61cc1cc1f528819586cad62a11d999cbae244a08d71115aca1c70808584f50b6
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 2.5.3
1
+ ruby 2.7.2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.1
4
+
5
+ - 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.
6
+
3
7
  ## 0.4.0
4
8
 
5
9
  ### Process SCSS/Sass files
@@ -24,7 +28,8 @@ jekyll-postcss has a higher priority, so it will hand off the the postcss output
24
28
 
25
29
  ## 0.3.1
26
30
 
27
- - Only run development server in development
31
+ - Only run development server in development.
32
+ - This was discovered when attempting to deploy to Netlify. You can read more about it here [#8](https://github.com/mhanberg/jekyll-postcss/issues/8), [#15](https://github.com/mhanberg/jekyll-postcss/issues/15), and [here](https://community.netlify.com/t/deploy-is-hanging-postcss-problem/14822).
28
33
 
29
34
  ## 0.3.0
30
35
 
data/README.md CHANGED
@@ -13,6 +13,7 @@ Add this line to your application's Gemfile:
13
13
  ```ruby
14
14
  gem 'jekyll-postcss'
15
15
  ```
16
+
16
17
  And then add this line to your application's `_config.yml`:
17
18
 
18
19
  ```yml
@@ -33,7 +34,7 @@ Add your PostCSS plugins to a `postcss.config.js` file in the root of your repos
33
34
 
34
35
  module.exports = {
35
36
  plugins: [
36
- require("autoprefixer") // example of plugin you might use
37
+ require("autoprefixer"), // example of plugin you might use
37
38
  ...(process.env.JEKYLL_ENV == "production" // example of only using a plugin in production
38
39
  ? [require("cssnano")({ preset: "default" })]
39
40
  : [])
@@ -56,11 +57,34 @@ module.exports = {
56
57
  };
57
58
  ```
58
59
 
59
- ### Notes
60
+ ### Deployment
61
+
62
+ 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.
63
+
64
+ This can be done so by setting your build command like so
65
+
66
+ ```shell
67
+ JEKYLL_ENV=production bundle exec jekyll build
68
+ ```
69
+
70
+ or using your hosts proprietary configuration. Here is an example using Netlify.
71
+
72
+ ```toml
73
+ # netlify.toml
74
+
75
+ [context.production.environment]
76
+ JEKYLL_ENV = "production"
77
+
78
+ [context.branch-deploy.environment]
79
+ JEKYLL_ENV = "staging"
80
+
81
+ [context.deploy-preview.environment]
82
+ JEKYLL_ENV = "staging"
83
+ ```
60
84
 
61
- jekyll-postcss will run a development server when `JEKYLL_ENV` is set to `development`. This is the default value if you don't set it elsewhere. When building your site for production or staging, make sure to set the `JEKYLL_ENV` appropriately, or else your deploy may fail, e.g., `JEKYLL_ENV=production bundle exec jekyll build`.
85
+ ### Front Matter Reminder
62
86
 
63
- Also note that your `.css` files still need to have a [front matter](https://jekyllrb.com/docs/step-by-step/03-front-matter/) for them to be processed by Jekyll.
87
+ Your stylesheets still need to have [front matter](https://jekyllrb.com/docs/step-by-step/03-front-matter/) for them to be processed by Jekyll.
64
88
 
65
89
  ```
66
90
  ---
data/bin/release ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+
3
+ bundle exec rake release
data/bin/spec ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+
3
+ bundle exec rspec "$@"
@@ -49,19 +49,27 @@ module PostCss
49
49
  @env == "development"
50
50
  end
51
51
 
52
+ MAX_ATTEMPTS = 100
53
+
52
54
  def start_dev_server
53
55
  Thread.new do
54
56
  system "#{START_SCRIPT} #{POSTCSS_SCRIPT} --development"
55
57
  end
56
58
 
57
- @postcss = nil
58
- while @postcss.nil?
59
+ attempts = 0
60
+ @postcss =
59
61
  begin
60
- @postcss = TCPSocket.open("localhost", 8124)
61
- rescue StandardError
62
- nil # Suppressing exceptions
62
+ TCPSocket.open("localhost", 8124)
63
+ rescue StandardError => e
64
+ attempts = attempts + 1
65
+
66
+ if attempts < MAX_ATTEMPTS
67
+ sleep 0.1
68
+ retry
69
+ else
70
+ raise "Could not connect to the PostCSS server"
71
+ end
63
72
  end
64
- end
65
73
  end
66
74
  end
67
75
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module PostCss
5
- VERSION = "0.4.0"
5
+ VERSION = "0.4.1"
6
6
  end
7
7
  end
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.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mitchell Hanberg
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-20 00:00:00.000000000 Z
11
+ date: 2021-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -102,7 +102,9 @@ files:
102
102
  - bin/command
103
103
  - bin/console
104
104
  - bin/postcss
105
+ - bin/release
105
106
  - bin/setup
107
+ - bin/spec
106
108
  - jekyll-postcss.gemspec
107
109
  - lib/jekyll-postcss.rb
108
110
  - lib/jekyll-postcss/socket.rb
@@ -131,8 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
133
  - !ruby/object:Gem::Version
132
134
  version: '0'
133
135
  requirements: []
134
- rubyforge_project:
135
- rubygems_version: 2.7.6
136
+ rubygems_version: 3.1.4
136
137
  signing_key:
137
138
  specification_version: 4
138
139
  summary: A PostCSS plugin for Jekyll.