dockerfile-rails 1.5.7 → 1.5.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72398e19c6ec602cb3ee07308355ee88cb742f99b0fc5662f9853577d9821da0
4
- data.tar.gz: ffe47ec3fd02742f6616624bbccc44396bd0e0857628dd016d5e702251c59c60
3
+ metadata.gz: c5e9c1e8d960ae456906f2936d6153ded39849a02208fa11a05ca4b8bc0d543e
4
+ data.tar.gz: 950ef36696d78e571d9a762235194009fedbf98f3f1809aa3a6740d7fb8aa507
5
5
  SHA512:
6
- metadata.gz: 14eecd6bd9cb250dc156beb8520c57879d51531b5c5174d9b361d48a3dc2ca6e754062546b15201d8e67b7e851c62e5ef5d1efcd18f535e35acc0e164a87a307
7
- data.tar.gz: ea07ff6cfcb76487cd07038e82895dfcf99ed7eec998e378046950a8406456b2de590f265186eb09c7f783f7cc1b60673a15ef4373a1920a1dca6234a1033b9b
6
+ metadata.gz: 66806af153d826188e9e3d7e582f683f66b4cae76b8d0307db0dbc1e9d3d839aa6037ccf578d8a9aa894d2dd18dd42549d23adcacde544e0000a09f58ef3cd22
7
+ data.tar.gz: 8589fe07b31ca9064c8b6b9d9a839efb78f36f512a00dc3e589bf1a18cbd5605b63e15933d1eb844168501a4283624c160b45f2dea068f06283317fdef731b11
@@ -387,6 +387,11 @@ private
387
387
  @using_node = File.exist? "package.json"
388
388
  end
389
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
+
390
395
  def using_redis?
391
396
  # Note: If you have redis installed on your computer, 'rails new` will
392
397
  # automatically add redis to your Gemfile, so having it in your Gemfile is
@@ -501,7 +506,7 @@ private
501
506
  if options.ci? && options.lock? && @gemfile.include?("debug")
502
507
  # https://github.com/rails/rails/pull/47515
503
508
  # https://github.com/rubygems/rubygems/issues/6082#issuecomment-1329756343
504
- 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")
505
510
  end
506
511
 
507
512
  gems.sort
@@ -954,6 +959,14 @@ private
954
959
  "latest"
955
960
  end
956
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
+
957
970
  def depend_on_bootsnap?
958
971
  @gemfile.include? "bootsnap"
959
972
  end
@@ -982,7 +995,7 @@ private
982
995
  client = api_client_dir
983
996
  return unless client
984
997
 
985
- Dir["#{client}/{package.json,package-lock.json,yarn.lock}"]
998
+ Dir["#{client}/{package.json,package-lock.json,yarn.lock,bun.lockb}"]
986
999
  end
987
1000
 
988
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.7
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