dockerfile-rails 1.5.6 → 1.5.8

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: 105efccdb33c4cb74b21af428db4eac3c584edbd33cbc24b9a11db86e43f6ef1
4
- data.tar.gz: 00df523cb0297543c13a88b880b82079b76211397ae49e4cdc20cb74f998d9bd
3
+ metadata.gz: c5e9c1e8d960ae456906f2936d6153ded39849a02208fa11a05ca4b8bc0d543e
4
+ data.tar.gz: 950ef36696d78e571d9a762235194009fedbf98f3f1809aa3a6740d7fb8aa507
5
5
  SHA512:
6
- metadata.gz: 1a6f44878a174409bb7fc6b3f1d05f63f51d35978328d7a379fa45ee1381d904a5d9dee89154c5ceb953e58c8397cbe65b30a7051984d6e151df39af821cb865
7
- data.tar.gz: 4fd03449405ce1a306c3d8d7a6812955748b6809b7fae554ea958c6e9fc71b7d0e20abc813ed4d24b4c472523a60da9c5fccb6387131f360fd800bfd5d4824ff
6
+ metadata.gz: 66806af153d826188e9e3d7e582f683f66b4cae76b8d0307db0dbc1e9d3d839aa6037ccf578d8a9aa894d2dd18dd42549d23adcacde544e0000a09f58ef3cd22
7
+ data.tar.gz: 8589fe07b31ca9064c8b6b9d9a839efb78f36f512a00dc3e589bf1a18cbd5605b63e15933d1eb844168501a4283624c160b45f2dea068f06283317fdef731b11
@@ -378,11 +378,20 @@ private
378
378
  options.litefs?
379
379
  end
380
380
 
381
+ def using_litestack?
382
+ @gemfile.include?("litestack")
383
+ end
384
+
381
385
  def using_node?
382
386
  return @using_node if @using_node != nil
383
387
  @using_node = File.exist? "package.json"
384
388
  end
385
389
 
390
+ def using_bun?
391
+ return @using_bun if @using_bun != nil
392
+ @using_bun = File.exist?("bun.config.js") || File.exist?("bun.lockb")
393
+ end
394
+
386
395
  def using_redis?
387
396
  # Note: If you have redis installed on your computer, 'rails new` will
388
397
  # automatically add redis to your Gemfile, so having it in your Gemfile is
@@ -497,7 +506,7 @@ private
497
506
  if options.ci? && options.lock? && @gemfile.include?("debug")
498
507
  # https://github.com/rails/rails/pull/47515
499
508
  # https://github.com/rubygems/rubygems/issues/6082#issuecomment-1329756343
500
- gems += %w(irb reline) - @gemfile unless Gem.ruby_version >= "3.2.2"
509
+ gems += %w(irb reline) - @gemfile unless Gem.ruby_version >= Gem::Version.new("3.2.2")
501
510
  end
502
511
 
503
512
  gems.sort
@@ -705,6 +714,10 @@ private
705
714
  env["BUNDLE_DEPLOYMENT"] = "1"
706
715
  end
707
716
 
717
+ if using_litestack?
718
+ env["LITESTACK_DATA_PATH"] = "/data"
719
+ end
720
+
708
721
  if @@args["base"]
709
722
  env.merge! @@args["base"].to_h { |key, value| [key, "$#{key}"] }
710
723
  end
@@ -946,6 +959,14 @@ private
946
959
  "latest"
947
960
  end
948
961
 
962
+
963
+ def bun_version
964
+ version = `bun --version`[/\d+\.\d+\.\d+/]
965
+ version ||= `npm show bun version`[/\d+\.\d+\.\d+/]
966
+
967
+ version
968
+ end
969
+
949
970
  def depend_on_bootsnap?
950
971
  @gemfile.include? "bootsnap"
951
972
  end
@@ -974,7 +995,7 @@ private
974
995
  client = api_client_dir
975
996
  return unless client
976
997
 
977
- Dir["#{client}/{package.json,package-lock.json,yarn.lock}"]
998
+ Dir["#{client}/{package.json,package-lock.json,yarn.lock,bun.lockb}"]
978
999
  end
979
1000
 
980
1001
  def dbprep_command
@@ -128,7 +128,7 @@ COPY --from=node /usr/local/node /usr/local/node
128
128
  ENV PATH=/usr/local/node/bin:$PATH
129
129
 
130
130
  <% elsif using_node? -%>
131
- <%= render partial: 'npm_install', locals: {sources: Dir[*%w(.npmrc .yarnrc package.json package-lock.json yarn.lock)]} %>
131
+ <%= render partial: 'npm_install', locals: {sources: Dir[*%w(.npmrc .yarnrc package.json package-lock.json yarn.lock bun.lockb)]} %>
132
132
 
133
133
  <% end -%>
134
134
  # Copy application code
@@ -8,14 +8,23 @@
8
8
  <% if node_version && node_version != 'lts' -%>
9
9
  ARG NODE_VERSION=<%= node_version %>
10
10
  <% end -%>
11
+ <% if using_bun? -%>
12
+ <% if bun_version -%>
13
+ ARG BUN_VERSION=<%= bun_version %>
14
+ <% end -%>
15
+ <% else -%>
11
16
  <% if yarn_version -%>
12
17
  ARG YARN_VERSION=<%= yarn_version %>
13
18
  <% end -%>
19
+ <% end -%>
14
20
  <% if node_version && node_version != 'lts' -%>
15
21
  ENV PATH=/usr/local/node/bin:$PATH
16
22
  RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \
17
23
  /tmp/node-build-master/bin/node-build "${NODE_VERSION}" /usr/local/node && \
18
24
  <% end -%>
25
+ <% if using_bun? -%>
26
+ npm install -g bun<% if bun_version %>@$BUN_VERSION<% end %> && \
27
+ <% else -%>
19
28
  <% if yarn_version -%>
20
29
  <% if yarn_version < '2' -%>
21
30
  <% if node_version -%> <% else %>RUN<% end %> npm install -g yarn@$YARN_VERSION<% if node_version -%> && \<% end %>
@@ -28,6 +37,7 @@ RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz
28
37
  corepack prepare yarn@$YARN_VERSION --activate<% if node_version -%> && \<% end %>
29
38
  <% end -%>
30
39
  <% end -%>
40
+ <% end -%>
31
41
  <% if node_version -%>
32
42
  rm -rf /tmp/node-build-master
33
43
  <% end -%>
@@ -5,7 +5,7 @@ COPY<% if options.link? %> --link<% end %> .yarn/releases/* .yarn/releases/
5
5
  <% end -%>
6
6
  <% if sources.join.include? 'yarn' -%>
7
7
  RUN <% if options.cache? -%>--mount=type=cache,id=bld-yarn-cache,target=/root/.yarn \
8
- YARN_CACHE_FOLDER=/root/.yarn <% end -%>yarn install<% if options.lock? %> --frozen-lockfile<% end %>
8
+ YARN_CACHE_FOLDER=/root/.yarn <% end -%><% if using_bun? %>bun<% else %>yarn<% end %> install<% if options.lock? %> --frozen-lockfile<% end %>
9
9
  <% else -%>
10
10
  <% if options.cache? -%>
11
11
  RUN --mount=type=cache,id=bld-npm-cache,target=/root/.npm \
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockerfile-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.6
4
+ version: 1.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-11 00:00:00.000000000 Z
11
+ date: 2023-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails