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 +4 -4
- data/.rubocop.yml +4 -0
- data/.travis.yml +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +17 -6
- data/lib/parcel-rails.rb +1 -1
- data/lib/parcel/rails/parcel_generator.rb +4 -2
- data/lib/parcel/rails/runner.rb +2 -0
- data/lib/parcel/rails/tasks.rake +3 -3
- data/lib/parcel/rails/version.rb +1 -1
- metadata +3 -7
- data/exe/parcel-build +0 -8
- data/exe/parcel-server +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c55ec8dc8d941724fda5f7e6d3c42d155609eb9f5693fd4e208fa545cf140bd2
|
4
|
+
data.tar.gz: 95c6abba5875da279a3297ddc71268179a2caeeb4f8c16659ff2ccaf16f295e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d9a30c4bbdfeb7d54a273ee7653d11b8d90474e89e2d8101e9e3950c62159512eaf6c788281dadccf10e2c80c0f33810fc6ca7fb0b519b45dbb09b1a7c6646c
|
7
|
+
data.tar.gz: ba5b04cdbcfeedd983518efab3eecd153f1bcbb74ed9634fc0808fef10ded2be7205aaf10f012f2695f00357ca4dd7b94154e1311932923f9c085720b5d9e212
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# parcel-rails
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/parcel-rails)
|
4
|
+
[](https://codeclimate.com/github/michaldarda/parcel-rails/maintainability)
|
5
|
+
[](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
|
-
|
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
|
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
|
-
|
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
|
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
|
|
data/lib/parcel-rails.rb
CHANGED
@@ -22,7 +22,7 @@ module Parcel
|
|
22
22
|
end
|
23
23
|
|
24
24
|
config.parcel = ActiveSupport::OrderedOptions.new
|
25
|
-
config.parcel.entry_points = %w
|
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
|
4
|
+
desc 'Generate parce-rails initializer'
|
3
5
|
|
4
6
|
def create_initializer_file
|
5
|
-
initializer
|
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'
|
data/lib/parcel/rails/runner.rb
CHANGED
data/lib/parcel/rails/tasks.rake
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
|
3
3
|
namespace :parcel do
|
4
4
|
desc 'Compiles assets using parcel bundler'
|
5
|
-
task :
|
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 :
|
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 :
|
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)
|
data/lib/parcel/rails/version.rb
CHANGED
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.
|
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-
|
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
|
data/exe/parcel-build
DELETED