webpacker-remote 0.3.0 → 0.3.1

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: 475ff81ecaa533d711986b6b21c70ef0e3e26b3b9934168bacba2bc27f64025e
4
- data.tar.gz: c0b2f5706cc157d3d082435a38887c870f07e90a8228fca224e5b4d043b4ebd2
3
+ metadata.gz: 330da65c1800e5a6e36b5abddcbf8f3dc09a46cbf41194cbc1edd063b3866a9a
4
+ data.tar.gz: 6f93d74c08123747bc9fe5e983ef2c3e08bb26003f199c843b272d380090e14b
5
5
  SHA512:
6
- metadata.gz: 96e16850f5db27b9e12bba5877b29bab23cf617d409b6da98b37431b3b137af973ee3559f1593070c62cdf130d672bafea72ac24b72034622fbb851b3a287963
7
- data.tar.gz: 2574263c55709fb4890190f57255572be16ba4887729be0c5ee1fcbe3e905092ac935f936d8eb3ff975d8193c0d4f895506dca2f500de02fe5f69b5aef826081
6
+ metadata.gz: dab57de3778d2a5589af327d0323db27dc99b918acb960c3acc3510977abda8d3665c4fd2d04258ca2eed9194d7b44f38a9a12bb020ca9a2350e185468285ca9
7
+ data.tar.gz: 8e9cfaa1cbc4a22cae87cd82d746bc883532127e48327cdde2f92eb3a09d1b111391011477fccede364c993c0fb4fc8a8b7540ea177c7a4a6ff15347dc49292a
@@ -8,12 +8,12 @@ jobs:
8
8
  runs-on: ubuntu-latest
9
9
  strategy:
10
10
  matrix:
11
- ruby: [ '2.7', '3.0', '3.1' ]
12
- webpacker: [ 'webpacker|~> 4.3', 'webpacker|~> 5.4', 'shakapacker|~> 6.2' ]
11
+ ruby: [ '2.7', '3.0', '3.1', '3.2' ]
12
+ webpacker: [ 'webpacker|~> 4.3', 'webpacker|~> 5.4', 'shakapacker|~> 6.5' ]
13
13
  name: Ruby ${{ matrix.ruby }}, Webpacker ${{ matrix.webpacker }}
14
14
  steps:
15
15
  - uses: actions/checkout@v2
16
- - uses: actions/setup-ruby@v1
16
+ - uses: ruby/setup-ruby@v1
17
17
  with:
18
18
  ruby-version: ${{ matrix.ruby }}
19
19
  - uses: actions/cache@v2
@@ -13,12 +13,12 @@ jobs:
13
13
  runs-on: ubuntu-latest
14
14
  strategy:
15
15
  matrix:
16
- ruby: [ '2.7', '3.0', '3.1' ]
17
- webpacker: [ 'webpacker|~> 4.3', 'webpacker|~> 5.4', 'shakapacker|~> 6.2' ]
16
+ ruby: [ '2.7', '3.0', '3.1', '3.2' ]
17
+ webpacker: [ 'webpacker|~> 4.3', 'webpacker|~> 5.4', 'shakapacker|~> 6.5' ]
18
18
  name: Ruby ${{ matrix.ruby }}, Webpacker ${{ matrix.webpacker }}
19
19
  steps:
20
20
  - uses: actions/checkout@v2
21
- - uses: actions/setup-ruby@v1
21
+ - uses: ruby/setup-ruby@v1
22
22
  with:
23
23
  ruby-version: ${{ matrix.ruby }}
24
24
  - uses: actions/cache@v2
data/.rubocop.yml CHANGED
@@ -16,6 +16,9 @@ Metrics/BlockLength:
16
16
  Style/Documentation:
17
17
  Enabled: false
18
18
 
19
+ Style/FetchEnvVar:
20
+ Enabled: false
21
+
19
22
  Gemspec/RequireMFA:
20
23
  Enabled: false
21
24
 
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ![](https://github.com/lunatic-cat/webpacker-remote/workflows/ci/badge.svg)
4
4
  [![Gem Version](https://badge.fury.io/rb/webpacker-remote.svg)](https://badge.fury.io/rb/webpacker-remote)
5
- [![codecov](https://codecov.io/gh/lunatic-cat/webpacker-remote/branch/master/graph/badge.svg?token=X5K67X3V0Z)](undefined)
5
+ [![codecov](https://codecov.io/gh/lunatic-cat/webpacker-remote/branch/master/graph/badge.svg?token=X5K67X3V0Z)](https://app.codecov.io/gh/lunatic-cat/webpacker-remote)
6
6
 
7
7
  - support for `create-react-app` developed in a separate repo
8
8
  - support for multiple external frontend builds, right now `webpacker` is [a singleton](https://github.com/rails/webpacker/blob/6ba995aed2b609a27e4e35ec28b2a7f688cce0cf/lib/webpacker/helper.rb#L5L7)
@@ -108,4 +108,4 @@ Specify webpacker gem explicitly:
108
108
  ```sh
109
109
  WEBPACKER_GEM_VERSION='shakapacker|6.2.1' bundle exec rspec
110
110
  WEBPACKER_GEM_VERSION='webpacker|5.4.3' bundle exec rspec
111
- ```
111
+ ```
@@ -26,11 +26,17 @@ class Webpacker::Remote::Configuration < Webpacker::Configuration
26
26
 
27
27
  # shakapacker error message
28
28
  def manifest_path
29
- File.join(root_path.to_s, config_path.to_s)
29
+ public_manifest_path
30
30
  end
31
31
 
32
32
  # webpacker error message
33
33
  def public_manifest_path
34
- manifest_path
34
+ public_remote_manifest_path
35
+ end
36
+
37
+ private
38
+
39
+ def public_remote_manifest_path
40
+ File.join(root_path.to_s, config_path.to_s)
35
41
  end
36
42
  end
@@ -17,13 +17,11 @@ class Webpacker::Remote::Manifest < Webpacker::Manifest
17
17
  end
18
18
  end
19
19
 
20
- def public_manifest_content
21
- JSON.parse(Net::HTTP.get_response(public_manifest_content_uri).body)
22
- rescue JSON::ParserError, Errno::ECONNREFUSED, Net::OpenTimeout, Net::ReadTimeout, Errno::ENOENT => e
23
- raise Webpacker::Remote::Error, <<~MSG
24
- having {root_path: #{config.root_path.inspect}, config_path: #{config.config_path.inspect}}
25
- #{e.class}: #{e.message}
26
- MSG
20
+ # be more failsafe than railsy webpacker since we do networking
21
+ def refresh
22
+ @data = load
23
+ rescue Webpacker::Remote::Error
24
+ @data
27
25
  end
28
26
 
29
27
  def lookup_pack_with_chunks(name, pack_type = {})
@@ -63,6 +61,15 @@ class Webpacker::Remote::Manifest < Webpacker::Manifest
63
61
 
64
62
  private
65
63
 
64
+ def public_manifest_content
65
+ JSON.parse(Net::HTTP.get_response(public_manifest_content_uri).body)
66
+ rescue JSON::ParserError, Errno::ECONNREFUSED, Net::OpenTimeout, Net::ReadTimeout, Errno::ENOENT => e
67
+ raise Webpacker::Remote::Error, <<~MSG
68
+ having {root_path: #{config.root_path.inspect}, config_path: #{config.config_path.inspect}}
69
+ #{e.class}: #{e.message}
70
+ MSG
71
+ end
72
+
66
73
  def public_manifest_content_uri
67
74
  URI.parse(File.join(config.root_path.to_s, config.config_path.to_s))
68
75
  rescue URI::InvalidURIError
@@ -10,8 +10,6 @@ class Webpacker::Remote < Webpacker::Instance
10
10
  require 'webpacker/remote/configuration'
11
11
  require 'webpacker/remote/helper'
12
12
 
13
- VERSION = '0.1.0'
14
-
15
13
  class Error < StandardError; end
16
14
 
17
15
  # rubocop:disable Lint/MissingSuper
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'webpacker-remote'
5
- spec.version = '0.3.0'
5
+ spec.version = '0.3.1'
6
6
  spec.authors = ['Vlad Bokov']
7
7
  spec.email = ['vlad@lunatic.cat']
8
8
  spec.license = 'MIT'
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
25
25
  Specify correct one by yourself
26
26
  )
27
27
  spec.add_development_dependency(*ENV.fetch('WEBPACKER_GEM_VERSION', 'shakapacker|~> 6.2').split('|'))
28
+ spec.add_development_dependency('activesupport', '>= 4.2.0')
28
29
  spec.add_development_dependency('rspec', '~> 3.0')
29
30
  spec.add_development_dependency('simplecov', '~> 0.19')
30
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpacker-remote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vlad Bokov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-11 00:00:00.000000000 Z
11
+ date: 2022-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shakapacker
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '6.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 4.2.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 4.2.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rspec
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -94,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
108
  - !ruby/object:Gem::Version
95
109
  version: '0'
96
110
  requirements: []
97
- rubygems_version: 3.3.7
111
+ rubygems_version: 3.4.1
98
112
  signing_key:
99
113
  specification_version: 4
100
114
  summary: Inject external webpack builds into Rails