Skip to content

Commit c0913c1

Browse files
committed
Tune up webpacker
Introduce new `lcms_engine_javascript_pack_tag` method to be used to include(and compile) lcms-engine based packs. This is a solution to be able to isolate project specific packs and packs created inside the gem. As an alternative we could use the solution provided here - rails/webpacker#348 (comment) This looks more reliable to me. - Update Dockerfile to set explicitly locale. - Update gems to the latest versions
1 parent de4bf9f commit c0913c1

File tree

5 files changed

+29
-21
lines changed

5 files changed

+29
-21
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased](https://github.com/learningtapestry/lcms-engine/compare/v0.1.2...HEAD)
88

9+
### Changed
10+
- Introduced method `lcms_engine_javascript_pack_tag` to be used instead of `javascript_pack_tag` when one needs to include the JS assets from the engine [@paranoicsan](https://github.com/paranoicsan)
11+
912
### Fixed
1013
- Fix case insensitive metadata table HTML header searching [@shlag3n](https://github.com/shlag3n)
1114

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM ruby:2.5.7
22

33
ENV APP_PATH /app/
4+
ENV LANG C.UTF-8
45

56
WORKDIR $APP_PATH
67

Gemfile.lock

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -147,19 +147,19 @@ GEM
147147
airbrake-ruby (4.14.1)
148148
rbtree3 (~> 0.5)
149149
arel (6.0.4)
150-
ast (2.4.0)
150+
ast (2.4.1)
151151
autoprefixer-rails (6.4.1.1)
152152
execjs
153153
aws-eventstream (1.1.0)
154-
aws-sdk-core (2.11.516)
154+
aws-sdk-core (2.11.527)
155155
aws-sigv4 (~> 1.0)
156156
jmespath (~> 1.0)
157157
aws-sdk-rails (1.0.1)
158158
aws-sdk-resources (~> 2)
159159
railties (>= 3)
160-
aws-sdk-resources (2.11.516)
161-
aws-sdk-core (= 2.11.516)
162-
aws-sigv4 (1.1.3)
160+
aws-sdk-resources (2.11.527)
161+
aws-sdk-core (= 2.11.527)
162+
aws-sigv4 (1.1.4)
163163
aws-eventstream (~> 1.0, >= 1.0.2)
164164
axiom-types (0.1.1)
165165
descendants_tracker (~> 0.0.4)
@@ -207,7 +207,7 @@ GEM
207207
closure_tree (7.1.0)
208208
activerecord (>= 4.2.10)
209209
with_advisory_lock (>= 4.0.0)
210-
coderay (1.1.2)
210+
coderay (1.1.3)
211211
coercible (1.0.0)
212212
descendants_tracker (~> 0.0.1)
213213
coffee-rails (4.1.1)
@@ -220,15 +220,15 @@ GEM
220220
combine_pdf (1.0.16)
221221
ruby-rc4 (>= 0.1.5)
222222
concurrent-ruby (1.1.6)
223-
connection_pool (2.2.2)
223+
connection_pool (2.2.3)
224224
crass (1.0.6)
225225
daemons (1.3.1)
226226
database_cleaner (1.8.5)
227227
declarative (0.0.10)
228228
declarative-option (0.1.0)
229229
descendants_tracker (0.0.4)
230230
thread_safe (~> 0.3, >= 0.3.1)
231-
devise (4.7.1)
231+
devise (4.7.2)
232232
bcrypt (~> 3.0)
233233
orm_adapter (~> 0.1)
234234
railties (>= 4.1.0)
@@ -273,7 +273,7 @@ GEM
273273
et-orbi (1.2.4)
274274
tzinfo
275275
eventmachine (1.0.9.1)
276-
excon (0.73.0)
276+
excon (0.74.0)
277277
execjs (2.7.0)
278278
factory_bot (5.2.0)
279279
activesupport (>= 4.2.0)
@@ -283,7 +283,7 @@ GEM
283283
multipart-post (>= 1.2, < 3)
284284
faraday_middleware (1.0.0)
285285
faraday (~> 1.0)
286-
ffi (1.12.2)
286+
ffi (1.13.1)
287287
fog-aws (2.0.1)
288288
fog-core (~> 1.38)
289289
fog-json (~> 1.0)
@@ -308,12 +308,12 @@ GEM
308308
railties (>= 3.1.0)
309309
sass (>= 3.3.0, < 3.5)
310310
sprockets-es6 (>= 0.9.0)
311-
fugit (1.3.5)
311+
fugit (1.3.6)
312312
et-orbi (~> 1.1, >= 1.1.8)
313-
raabro (~> 1.1)
313+
raabro (~> 1.3)
314314
globalid (0.4.2)
315315
activesupport (>= 4.2.0)
316-
google-api-client (0.39.5)
316+
google-api-client (0.40.2)
317317
addressable (~> 2.5, >= 2.5.1)
318318
googleauth (~> 0.9)
319319
httpclient (>= 2.8.1, < 3.0)
@@ -353,7 +353,7 @@ GEM
353353
http-cookie (1.0.3)
354354
domain_name (~> 0.5)
355355
http_parser.rb (0.6.0)
356-
httparty (0.18.0)
356+
httparty (0.18.1)
357357
mime-types (~> 3.0)
358358
multi_xml (>= 0.5.2)
359359
httpclient (2.8.3)
@@ -419,7 +419,7 @@ GEM
419419
nenv (0.3.0)
420420
nested_form (0.3.2)
421421
netrc (0.11.0)
422-
newrelic_rpm (6.10.0.364)
422+
newrelic_rpm (6.11.0.365)
423423
nikkou (0.0.5)
424424
activesupport
425425
nokogiri
@@ -553,7 +553,7 @@ GEM
553553
redis (3.3.5)
554554
redis-namespace (1.7.0)
555555
redis (>= 3.0.4)
556-
regexp_parser (1.7.0)
556+
regexp_parser (1.7.1)
557557
representable (3.0.4)
558558
declarative (< 0.1.0)
559559
declarative-option (< 0.2.0)
@@ -610,7 +610,7 @@ GEM
610610
fugit (~> 1.1, >= 1.1.6)
611611
safe_attributes (1.0.10)
612612
activerecord (>= 3.0.0)
613-
sanitize (5.1.0)
613+
sanitize (5.2.0)
614614
crass (~> 1.0.2)
615615
nokogiri (>= 1.8.0)
616616
nokogumbo (~> 2.0)
@@ -621,7 +621,7 @@ GEM
621621
sprockets (>= 2.8, < 4.0)
622622
sprockets-rails (>= 2.0, < 4.0)
623623
tilt (>= 1.1, < 3)
624-
sassc (2.3.0)
624+
sassc (2.4.0)
625625
ffi (~> 1.9)
626626
sdoc (0.4.2)
627627
json (~> 1.7, >= 1.7.7)

app/helpers/lcms/engine/application_helper.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ module ApplicationHelper
88
include ViewHelper
99
include ::Webpacker::Helper
1010

11-
def current_webpacker_instance
12-
Lcms::Engine.webpacker
11+
# Use this to include lcms-engine based packs
12+
def lcms_engine_javascript_pack_tag(*names, **options)
13+
entries = names
14+
.map { |name| Lcms::Engine.webpacker.manifest.lookup!(name, type: :javascript) }
15+
.flatten
16+
javascript_include_tag(*entries, **options)
1317
end
1418
end
1519
end

app/views/layouts/lcms/engine/admin.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<%= csrf_meta_tags %>
1414
<%# NOTE: JS served via Assets pipeline should be added first %>
1515
<%= javascript_include_tag 'lcms/engine/admin/application', 'data-turbolinks-track' => 'reload' %>
16-
<%= javascript_pack_tag 'admin' %>
16+
<%= lcms_engine_javascript_pack_tag 'admin' %>
1717
</head>
1818
<body>
1919
<%= render partial: 'lcms/engine/shared/unsupported' %>

0 commit comments

Comments
 (0)