parcel-rails 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8052944344f412e400421821df09aadca7d469212da4dd93329ffb9d8bfa7725
4
- data.tar.gz: 9862c6d818764bf80eb299484bbe879d4a06796be1cc092d23d4224ec86abab2
3
+ metadata.gz: c55ec8dc8d941724fda5f7e6d3c42d155609eb9f5693fd4e208fa545cf140bd2
4
+ data.tar.gz: 95c6abba5875da279a3297ddc71268179a2caeeb4f8c16659ff2ccaf16f295e2
5
5
  SHA512:
6
- metadata.gz: 1a0e030e6db49cdbc29a0ef564bfdfd947bc28d183049dce2c33be2eb50ac2baa8641058709b93b188e1ecf76063a2cfba4bd6f0fba3fa3078c9f830231aeb12
7
- data.tar.gz: 1b4a456876a4ab39d03ac63883dd492714efe3133f85245eae249b146b216991bb84ec578d75c62051fb75b40a65753ac8031b844da5916248ba89250be781cd
6
+ metadata.gz: 1d9a30c4bbdfeb7d54a273ee7653d11b8d90474e89e2d8101e9e3950c62159512eaf6c788281dadccf10e2c80c0f33810fc6ca7fb0b519b45dbb09b1a7c6646c
7
+ data.tar.gz: ba5b04cdbcfeedd983518efab3eecd153f1bcbb74ed9634fc0808fef10ded2be7205aaf10f012f2695f00357ca4dd7b94154e1311932923f9c085720b5d9e212
@@ -1,3 +1,7 @@
1
+ AllCops:
2
+ Exclude:
3
+ - 'examples/**/*'
4
+
1
5
  Metrics/LineLength:
2
6
  Exclude:
3
7
  - 'parcel-rails.gemspec'
@@ -1,5 +1,9 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
+ - 2.4.2
4
5
  - 2.5.0
5
6
  before_install: gem install bundler -v 1.16.1
7
+ install:
8
+ - bundle install
9
+ - yarn install
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parcel-rails (0.9.0)
4
+ parcel-rails (0.9.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # parcel-rails
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/parcel-rails.svg)](https://badge.fury.io/rb/parcel-rails)
4
+ [![Maintainability](https://api.codeclimate.com/v1/badges/4b0a3f36a6b1970a88e5/maintainability)](https://codeclimate.com/github/michaldarda/parcel-rails/maintainability)
5
+ [![Build Status](https://travis-ci.org/michaldarda/parcel-rails.svg?branch=master)](https://travis-ci.org/michaldarda/parcel-rails)
6
+
3
7
  Gem integrates [parcel](https://parceljs.org/) JS module bundler into your Rails application. It is inspired by gems such as
4
8
  [breakfast](https://github.com/devlocker/breakfast) or [webpacker](https://github.com/rails/webpacker).
5
9
 
@@ -11,9 +15,7 @@ Add this line to your application's Gemfile:
11
15
  gem 'parcel-rails'
12
16
  ```
13
17
 
14
- ## Usage
15
-
16
- Run
18
+ Then run
17
19
 
18
20
  $ bin/rails g parcel
19
21
 
@@ -28,12 +30,17 @@ web: bin/rails s
28
30
  parcel: bin/rails parcel:serve
29
31
  ```
30
32
 
33
+ Then run `foreman start`
34
+
31
35
  ### Production
32
36
 
33
- Gem hooks up to the assets:precompile and assets:clobber, so no special setup is required.
37
+ Gem hooks up to the `assets:precompile` and `assets:clobber`, so no special setup is required.
34
38
 
39
+ You can start parcel's compilation process manually by running
35
40
 
36
- ### Including in view
41
+ rake parcel:compile
42
+
43
+ ### Including in views
37
44
 
38
45
  Use Rails generic helpers to include assets in your views
39
46
 
@@ -47,6 +54,10 @@ After running generator, configuration can be found in config/initializers/parce
47
54
  config.parcel.entry_points = %w(app/javascript/application.js)
48
55
  config.parcel.destination = 'public/parcels'
49
56
 
57
+ #### Warning
58
+
59
+ Currently only single entry point is supported, it is limitation coming from Parcel itself and not the gem.
60
+
50
61
  ## Development
51
62
 
52
63
  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.
@@ -63,5 +74,5 @@ The gem is available as open source under the terms of the [MIT License](https:/
63
74
 
64
75
  ## Code of Conduct
65
76
 
66
- Everyone interacting in the Parcel::Rails project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/parcel-rails/blob/master/CODE_OF_CONDUCT.md).
77
+ Everyone interacting in the *parcel-rails* project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/parcel-rails/blob/master/CODE_OF_CONDUCT.md).
67
78
 
@@ -22,7 +22,7 @@ module Parcel
22
22
  end
23
23
 
24
24
  config.parcel = ActiveSupport::OrderedOptions.new
25
- config.parcel.entry_points = %w(app/javascript/application.js)
25
+ config.parcel.entry_points = %w[app/javascript/application.js]
26
26
  config.parcel.destination = 'public/parcels'
27
27
  end
28
28
  end
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class ParcelGenerator < Rails::Generators::Base
2
- desc "Generate parce-rails initializer"
4
+ desc 'Generate parce-rails initializer'
3
5
 
4
6
  def create_initializer_file
5
- initializer "parcel.rb" do
7
+ initializer 'parcel.rb' do
6
8
  %{Rails.application.config.parcel do |parcel|
7
9
  parcel.entry_points = %w(app/javascript/application.js)
8
10
  parcel.destination = 'public/parcels'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Parcel
2
4
  module Rails
3
5
  class Runner
@@ -2,17 +2,17 @@
2
2
 
3
3
  namespace :parcel do
4
4
  desc 'Compiles assets using parcel bundler'
5
- task :compile do
5
+ task compile: :environment do
6
6
  Parcel::Rails::Runner.from_config.compile
7
7
  end
8
8
 
9
9
  desc 'Compiles assets using parcel bundler'
10
- task :serve do
10
+ task serve: :environment do
11
11
  Parcel::Rails::Runner.from_config.serve
12
12
  end
13
13
 
14
14
  desc 'Removes compiled assets'
15
- task :clobber do
15
+ task clobber: :environment do
16
16
  command = "rm -rf #{::Rails.application.config.parcel.destination}"
17
17
  logger = Logger.new(STDOUT)
18
18
  logger.info(command)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Parcel
4
4
  module Rails
5
- VERSION = '0.9.1'
5
+ VERSION = '0.9.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parcel-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Darda
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-02-18 00:00:00.000000000 Z
12
+ date: 2018-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -85,9 +85,7 @@ description: Rails integration of parceljs bundler
85
85
  email:
86
86
  - michaldarda@gmail.com
87
87
  - imoryc@gmail.com
88
- executables:
89
- - parcel-build
90
- - parcel-server
88
+ executables: []
91
89
  extensions: []
92
90
  extra_rdoc_files: []
93
91
  files:
@@ -183,8 +181,6 @@ files:
183
181
  - examples/railsapp/test/test_helper.rb
184
182
  - examples/railsapp/tmp/.keep
185
183
  - examples/railsapp/vendor/.keep
186
- - exe/parcel-build
187
- - exe/parcel-server
188
184
  - lib/parcel-rails.rb
189
185
  - lib/parcel/rails/parcel_generator.rb
190
186
  - lib/parcel/rails/runner.rb
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
4
- ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
5
-
6
- require "parcel-rails"
7
- Parcel::Rails::Runner.from_command_line(ARGV).build
8
-
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
4
- ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
5
-
6
- require "parcel-rails"
7
- require "parcel-rails/runner"
8
- Parcel::Rails::Runner.serve(ARGV)