jekyll-webpack 0.1.0 → 0.2.2

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: b4d5ee9f87bc09e143440db5e030ddfa5f6221c382794d9cfdd730de0c06e73c
4
- data.tar.gz: 49d09a16c8ea7bc74d29421ba12eff73cf9addc9737a5de925d51b661a297203
3
+ metadata.gz: 5e9f0f3c149684bc8a7991b989f33faa3b15be2644fdd797971a4a5b55b41d92
4
+ data.tar.gz: 80e1a6d14f26db3304c2988ef60f2b8015fb9bc8900221ad2336b6bb4ce92dd7
5
5
  SHA512:
6
- metadata.gz: fda55e3d1ef73539d68323e3d4db684f6b165c0bad85f66e094abcf756bfdc48c94a8102fa2ecbf4d3383339e59c7967eb5253c9034505620cfb195fd2e2f485
7
- data.tar.gz: 0fca987d4c97df697f99592ac08442e658c8fe20e12e8d1706dd7d09d711a97a3f4f79580bad1aa72ad27ac6132bcac95fefcbf60260a334919990d6bbb0b444
6
+ metadata.gz: d0d1db97c34caa606f07971bf43253a836010c4c46602efc8b126bc781771f42dc86f1524014f34564e72897e895539a29a53c5857d3455f2adb1d3aa4f75283
7
+ data.tar.gz: 816ee670a833a53097bc893950c9d56c4d022e1769dce9cede555f75eee35da844ec70d7ca8dcaabe1f1b09a84e06805f5a7e191c3f215c71fb935befdf4a336
data/.gitignore CHANGED
@@ -9,6 +9,7 @@
9
9
  /spec/fixtures/.jekyll-cache/
10
10
  /spec/fixtures/_site/
11
11
  /spec/fixtures/node_modules/
12
+ /*.gem
12
13
 
13
14
  # rspec failure tracking
14
15
  .rspec_status
data/Gemfile.lock CHANGED
@@ -1,32 +1,32 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jekyll-webpack (0.1.0)
4
+ jekyll-webpack (0.2.1)
5
5
  jekyll
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.7.0)
10
+ addressable (2.8.0)
11
11
  public_suffix (>= 2.0.2, < 5.0)
12
12
  coderay (1.1.3)
13
13
  colorator (1.1.0)
14
- concurrent-ruby (1.1.6)
15
- diff-lcs (1.3)
16
- em-websocket (0.5.1)
14
+ concurrent-ruby (1.1.9)
15
+ diff-lcs (1.4.4)
16
+ em-websocket (0.5.2)
17
17
  eventmachine (>= 0.12.9)
18
18
  http_parser.rb (~> 0.6.0)
19
19
  eventmachine (1.2.7)
20
- ffi (1.13.0)
21
- formatador (0.2.5)
20
+ ffi (1.15.3)
21
+ formatador (0.3.0)
22
22
  forwardable-extended (2.6.0)
23
- guard (2.16.2)
23
+ guard (2.18.0)
24
24
  formatador (>= 0.2.4)
25
25
  listen (>= 2.7, < 4.0)
26
26
  lumberjack (>= 1.0.12, < 2.0)
27
27
  nenv (~> 0.1)
28
28
  notiffany (~> 0.0)
29
- pry (>= 0.9.12)
29
+ pry (>= 0.13.0)
30
30
  shellany (~> 0.0)
31
31
  thor (>= 0.18.1)
32
32
  guard-compat (1.2.1)
@@ -35,36 +35,36 @@ GEM
35
35
  guard-compat (~> 1.1)
36
36
  rspec (>= 2.99.0, < 4.0)
37
37
  http_parser.rb (0.6.0)
38
- i18n (1.8.3)
38
+ i18n (1.8.10)
39
39
  concurrent-ruby (~> 1.0)
40
- jekyll (4.1.0)
40
+ jekyll (4.2.0)
41
41
  addressable (~> 2.4)
42
42
  colorator (~> 1.0)
43
43
  em-websocket (~> 0.5)
44
44
  i18n (~> 1.0)
45
45
  jekyll-sass-converter (~> 2.0)
46
46
  jekyll-watch (~> 2.0)
47
- kramdown (~> 2.1)
47
+ kramdown (~> 2.3)
48
48
  kramdown-parser-gfm (~> 1.0)
49
49
  liquid (~> 4.0)
50
50
  mercenary (~> 0.4.0)
51
51
  pathutil (~> 0.9)
52
52
  rouge (~> 3.0)
53
53
  safe_yaml (~> 1.0)
54
- terminal-table (~> 1.8)
54
+ terminal-table (~> 2.0)
55
55
  jekyll-sass-converter (2.1.0)
56
56
  sassc (> 2.0.1, < 3.0)
57
57
  jekyll-watch (2.2.1)
58
58
  listen (~> 3.0)
59
- kramdown (2.2.1)
59
+ kramdown (2.3.1)
60
60
  rexml
61
61
  kramdown-parser-gfm (1.1.0)
62
62
  kramdown (~> 2.0)
63
63
  liquid (4.0.3)
64
- listen (3.2.1)
64
+ listen (3.5.1)
65
65
  rb-fsevent (~> 0.10, >= 0.10.3)
66
66
  rb-inotify (~> 0.9, >= 0.9.10)
67
- lumberjack (1.2.5)
67
+ lumberjack (1.2.8)
68
68
  mercenary (0.4.0)
69
69
  method_source (1.0.0)
70
70
  nenv (0.3.0)
@@ -73,36 +73,36 @@ GEM
73
73
  shellany (~> 0.0)
74
74
  pathutil (0.16.2)
75
75
  forwardable-extended (~> 2.6)
76
- pry (0.13.1)
76
+ pry (0.14.1)
77
77
  coderay (~> 1.1)
78
78
  method_source (~> 1.0)
79
- public_suffix (4.0.5)
79
+ public_suffix (4.0.6)
80
80
  rake (12.3.3)
81
- rb-fsevent (0.10.4)
81
+ rb-fsevent (0.11.0)
82
82
  rb-inotify (0.10.1)
83
83
  ffi (~> 1.0)
84
- rexml (3.2.4)
85
- rouge (3.19.0)
86
- rspec (3.9.0)
87
- rspec-core (~> 3.9.0)
88
- rspec-expectations (~> 3.9.0)
89
- rspec-mocks (~> 3.9.0)
90
- rspec-core (3.9.2)
91
- rspec-support (~> 3.9.3)
92
- rspec-expectations (3.9.2)
84
+ rexml (3.2.5)
85
+ rouge (3.26.0)
86
+ rspec (3.10.0)
87
+ rspec-core (~> 3.10.0)
88
+ rspec-expectations (~> 3.10.0)
89
+ rspec-mocks (~> 3.10.0)
90
+ rspec-core (3.10.1)
91
+ rspec-support (~> 3.10.0)
92
+ rspec-expectations (3.10.1)
93
93
  diff-lcs (>= 1.2.0, < 2.0)
94
- rspec-support (~> 3.9.0)
95
- rspec-mocks (3.9.1)
94
+ rspec-support (~> 3.10.0)
95
+ rspec-mocks (3.10.2)
96
96
  diff-lcs (>= 1.2.0, < 2.0)
97
- rspec-support (~> 3.9.0)
98
- rspec-support (3.9.3)
97
+ rspec-support (~> 3.10.0)
98
+ rspec-support (3.10.2)
99
99
  safe_yaml (1.0.5)
100
100
  sassc (2.4.0)
101
101
  ffi (~> 1.9)
102
102
  shellany (0.0.1)
103
- terminal-table (1.8.0)
103
+ terminal-table (2.0.0)
104
104
  unicode-display_width (~> 1.1, >= 1.1.1)
105
- thor (1.0.1)
105
+ thor (1.1.0)
106
106
  unicode-display_width (1.7.0)
107
107
 
108
108
  PLATFORMS
@@ -118,4 +118,4 @@ DEPENDENCIES
118
118
  rspec (~> 3.0)
119
119
 
120
120
  BUNDLED WITH
121
- 2.1.3
121
+ 2.2.3
data/README.md CHANGED
@@ -1,8 +1,13 @@
1
1
  # Jekyll::Webpack
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/jekyll/webpack`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ This plugin will allow you to build your assets with Webpack _after_ Jekyll has compiled your site to the `_site` folder. You will need to have Webpack installed at the root of your project in order for this to work.
4
+
5
+ ## Why?
6
+
7
+ This adds Webpack at a sane point in the build pipeline and will also allow you to parameterize your webpack and other JS config files by prepending them with front matter, before the compilation occurs. You can see a functioning example in the `spec/fixtures` folder:-
8
+
9
+ There is a `_data/tailwind.yml` file in the fixure site that's picked up by adding a frontmatter declaration in `tailwind.config.js`. This Tailwind config is in turn picked up by the outputted webpack config and parsed when webpack runs.
4
10
 
5
- TODO: Delete this and the text above, and describe your gem
6
11
 
7
12
  ## Installation
8
13
 
@@ -20,19 +25,43 @@ Or install it yourself as:
20
25
 
21
26
  $ gem install jekyll-webpack
22
27
 
28
+ And add the following to your site's `_config.yml`
29
+
30
+ ```yml
31
+ plugins:
32
+ - jekyll/webpack
33
+ ```
34
+
35
+ NOTE the `/` - the `-` variant is not available yet.
36
+
37
+ ALSO NOTE - it's probably advisable to place this plugin as the very last one in the build pipe. EG:-
38
+
39
+ ```yml
40
+ plugins:
41
+ - jekyll-otherplug
42
+ ...
43
+ - jekyll/webpack
44
+ ```
45
+
23
46
  ## Usage
24
47
 
25
- TODO: Write usage instructions here
48
+ In your root Jekyll project folder you need to have Webpack installed, so:-
49
+
50
+ `yarn add webpack webpack-cli --dev`
51
+
52
+ And the basic JS entrypoint `mkdir src && touch src/index.js`
53
+
54
+ And you're away! Just run the `jekyll serve` or `jekyll build` commands with whatever env you need.
26
55
 
27
56
  ## Development
28
57
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
58
+ After checking out the repo, run `bin/setup` to install dependencies. Then `cd spec/fixtures && yarn` to install required JS dependencies for specs. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
59
 
31
60
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
61
 
33
62
  ## Contributing
34
63
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jekyll-webpack. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/jekyll-webpack/blob/master/CODE_OF_CONDUCT.md).
64
+ Bug reports and pull requests are welcome on GitHub at https://github.com/tevio/jekyll-webpack. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/tevio/jekyll-webpack/blob/master/CODE_OF_CONDUCT.md).
36
65
 
37
66
 
38
67
  ## License
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
 
9
9
  spec.summary = %q{Compile assets with webpack}
10
10
  spec.description = %q{Once Jekyll has built your sites HTML, run webpack against the compiled _site}
11
- spec.homepage = "http://martian.media"
11
+ spec.homepage = "https://github.com/tevio/jekyll-webpack"
12
12
  spec.license = "MIT"
13
13
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
14
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "jekyll/webpack/version"
4
4
  require "jekyll"
5
+ require "open3"
5
6
 
6
7
  module Jekyll
7
8
  module Webpack
@@ -9,9 +10,16 @@ module Jekyll
9
10
 
10
11
  def self.build(site)
11
12
  site_dest = site.dest
12
- Dir.chdir(site_dest) do
13
- `../node_modules/.bin/webpack`
14
- end
13
+
14
+ stdout, stderr, status = Open3.capture3(
15
+ "../node_modules/.bin/webpack",
16
+ chdir: File.expand_path(site_dest)
17
+ )
18
+
19
+ runtime_error = stdout =~ /ERROR in|SyntaxError/
20
+
21
+ raise Error, stderr if stderr.size > 0
22
+ raise Error, stdout if !runtime_error.nil?
15
23
  end
16
24
  end
17
25
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Webpack
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-webpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Martin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-09 00:00:00.000000000 Z
11
+ date: 2021-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -131,13 +131,13 @@ files:
131
131
  - jekyll-webpack.gemspec
132
132
  - lib/jekyll/webpack.rb
133
133
  - lib/jekyll/webpack/version.rb
134
- homepage: http://martian.media
134
+ homepage: https://github.com/tevio/jekyll-webpack
135
135
  licenses:
136
136
  - MIT
137
137
  metadata:
138
- homepage_uri: http://martian.media
138
+ homepage_uri: https://github.com/tevio/jekyll-webpack
139
139
  source_code_uri: https://github.com/mml/jekyll-webpack
140
- post_install_message:
140
+ post_install_message:
141
141
  rdoc_options: []
142
142
  require_paths:
143
143
  - lib
@@ -152,8 +152,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  requirements: []
155
- rubygems_version: 3.1.2
156
- signing_key:
155
+ rubygems_version: 3.2.3
156
+ signing_key:
157
157
  specification_version: 4
158
158
  summary: Compile assets with webpack
159
159
  test_files: []