jets 4.0.13 → 4.0.15
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/CHANGELOG.md +6 -0
- data/lib/jets/builders/ruby_packager.rb +15 -15
- data/lib/jets/cfn/template_source.rb +5 -2
- data/lib/jets/cfn/upload.rb +19 -19
- data/lib/jets/commands/upgrade/templates/bin/webpack +3 -2
- data/lib/jets/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 108be85a1805da5a04aa2bca0c9b923a558f43a49d7b5b40707294ff442c84e5
|
4
|
+
data.tar.gz: ce8de5d61abb74c397ec7017847153a1173ede8c0657721e96e1d97584948758
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b83a363461f11e43bf5a1273dfb1a5e792f85ec83e627062624e098014f3f9200a1647e60c2ffcd26ed90b01c348e71de07291b48028f3c9aa788476a17d1a17
|
7
|
+
data.tar.gz: bf40c7291462c4479742695993158be55162163dd2e6bcef3f7c96df9f65bf995f54bf9ac792d3e744a8726506cba1f9c6e266c827d1752979b932c7bc614611
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## [4.0.15] - 2025-10-10
|
7
|
+
- clean up remove comment
|
8
|
+
|
9
|
+
## [4.0.14] - 2025-10-08
|
10
|
+
- require logger before bundler in bin/webpack
|
11
|
+
|
6
12
|
## [4.0.13] - 2025-10-08
|
7
13
|
- require logger and pin activemodel 6.1.7
|
8
14
|
|
@@ -4,7 +4,7 @@ module Jets::Builders
|
|
4
4
|
class RubyPackager
|
5
5
|
include Util
|
6
6
|
|
7
|
-
GEM_REGEXP = /-(arm|x)\d+.*-(darwin|linux)/
|
7
|
+
GEM_REGEXP = /-(arm|x)\d+.*-(darwin|linux|gnu)|-(aarch64|x86_64|arm64|i386|powerpc|sparc|mips|riscv|loongarch|sw_64|hppa|ia64|s390).*-(darwin|linux|gnu)/
|
8
8
|
|
9
9
|
attr_reader :full_app_root
|
10
10
|
def initialize(relative_app_root)
|
@@ -76,7 +76,7 @@ module Jets::Builders
|
|
76
76
|
# For example we add the jets-rails to the Gemfile.
|
77
77
|
copy_back_gemfile_lock
|
78
78
|
|
79
|
-
puts
|
79
|
+
puts "Bundle install completed"
|
80
80
|
end
|
81
81
|
|
82
82
|
# Example `bundle check` error:
|
@@ -91,7 +91,7 @@ module Jets::Builders
|
|
91
91
|
# The Gemfile's dependencies are satisfied
|
92
92
|
#
|
93
93
|
def bundle_check
|
94
|
-
out =
|
94
|
+
out = ""
|
95
95
|
Bundler.with_unbundled_env do
|
96
96
|
out = `cd #{cache_area} && bundle check 2>&1`
|
97
97
|
end
|
@@ -123,7 +123,7 @@ module Jets::Builders
|
|
123
123
|
puts "Tidying project: removing ignored files to reduce package size."
|
124
124
|
tidy_project(@full_app_root)
|
125
125
|
# The rack sub project has it's own gitignore.
|
126
|
-
tidy_project(@full_app_root+"/rack")
|
126
|
+
tidy_project(@full_app_root + "/rack")
|
127
127
|
end
|
128
128
|
|
129
129
|
def tidy_project(path)
|
@@ -157,7 +157,7 @@ module Jets::Builders
|
|
157
157
|
|
158
158
|
# IE: /tmp/jets/demo/cache/vendor/gems/ruby/2.5.0/bundler/gems/webpacker-a8c46614c675
|
159
159
|
Dir.glob("#{cache_area}/vendor/gems/ruby/2.5.0/bundler/gems/*").each do |path|
|
160
|
-
sha = path.split(
|
160
|
+
sha = path.split("-").last[0..6] # only first 7 chars of the git sha
|
161
161
|
unless git_shas.include?(sha)
|
162
162
|
# puts "Removing old submoduled gem: #{path}" # uncomment to see and debug
|
163
163
|
FileUtils.rm_rf(path) # REMOVE old submodule directory
|
@@ -191,7 +191,7 @@ module Jets::Builders
|
|
191
191
|
# amount is the number of lines to remove
|
192
192
|
new_lines, capture, count, amount = [], true, 0, 2
|
193
193
|
lines.each do |l|
|
194
|
-
capture = false if l.include?(
|
194
|
+
capture = false if l.include?("BUNDLED WITH")
|
195
195
|
if capture
|
196
196
|
new_lines << l
|
197
197
|
end
|
@@ -204,7 +204,7 @@ module Jets::Builders
|
|
204
204
|
# Replace things like nokogiri (1.11.1-x86_64-darwin) => nokogiri (1.11.1)
|
205
205
|
lines, new_lines = new_lines, []
|
206
206
|
lines.each do |l|
|
207
|
-
l.sub!(GEM_REGEXP,
|
207
|
+
l.sub!(GEM_REGEXP, "") if GEM_REGEXP.match?(l)
|
208
208
|
new_lines << l
|
209
209
|
end
|
210
210
|
|
@@ -225,11 +225,11 @@ module Jets::Builders
|
|
225
225
|
next
|
226
226
|
end
|
227
227
|
|
228
|
-
in_platforms_section = l.include?(
|
228
|
+
in_platforms_section = l.include?("PLATFORMS")
|
229
229
|
new_lines << l
|
230
230
|
end
|
231
231
|
|
232
|
-
content = new_lines.join(
|
232
|
+
content = new_lines.join("")
|
233
233
|
IO.write(gemfile_lock, content)
|
234
234
|
end
|
235
235
|
|
@@ -250,12 +250,12 @@ module Jets::Builders
|
|
250
250
|
# Dont know why this is the case.
|
251
251
|
def create_bundle_config(frozen: false)
|
252
252
|
FileUtils.rm_rf("#{cache_area}/.bundle")
|
253
|
-
frozen_line = %
|
254
|
-
text
|
255
|
-
---
|
256
|
-
#{frozen_line}BUNDLE_PATH: "vendor/gems"
|
257
|
-
BUNDLE_WITHOUT: "development:test"
|
258
|
-
EOL
|
253
|
+
frozen_line = %(BUNDLE_FROZEN: "true"\n) if frozen
|
254
|
+
text = <<~EOL
|
255
|
+
---
|
256
|
+
#{frozen_line}BUNDLE_PATH: "vendor/gems"
|
257
|
+
BUNDLE_WITHOUT: "development:test"
|
258
|
+
EOL
|
259
259
|
bundle_config = "#{cache_area}/.bundle/config"
|
260
260
|
FileUtils.mkdir_p(File.dirname(bundle_config))
|
261
261
|
IO.write(bundle_config, text)
|
@@ -44,8 +44,7 @@ module Jets::Cfn
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def upload_file_to_s3
|
47
|
-
|
48
|
-
obj.upload_file(path)
|
47
|
+
transfer_manager.upload_file(path, bucket: bucket_name, key: s3_key)
|
49
48
|
|
50
49
|
"https://s3.amazonaws.com/#{bucket_name}/#{s3_key}"
|
51
50
|
end
|
@@ -57,5 +56,9 @@ module Jets::Cfn
|
|
57
56
|
def s3_key
|
58
57
|
@s3_key ||= "jets/cfn-templates/#{File.basename(path)}"
|
59
58
|
end
|
59
|
+
|
60
|
+
def transfer_manager
|
61
|
+
@transfer_manager ||= Aws::S3::TransferManager.new
|
62
|
+
end
|
60
63
|
end
|
61
64
|
end
|
data/lib/jets/cfn/upload.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "action_view"
|
2
|
+
require "digest"
|
3
|
+
require "rack/mime"
|
4
4
|
|
5
5
|
module Jets::Cfn
|
6
6
|
class Upload
|
@@ -13,6 +13,10 @@ module Jets::Cfn
|
|
13
13
|
@bucket_name = bucket_name
|
14
14
|
end
|
15
15
|
|
16
|
+
def transfer_manager
|
17
|
+
@transfer_manager ||= Aws::S3::TransferManager.new
|
18
|
+
end
|
19
|
+
|
16
20
|
def upload
|
17
21
|
upload_cfn_templates
|
18
22
|
upload_zip_files
|
@@ -26,8 +30,7 @@ module Jets::Cfn
|
|
26
30
|
next unless File.file?(path)
|
27
31
|
|
28
32
|
key = "jets/cfn-templates/#{File.basename(path)}"
|
29
|
-
|
30
|
-
obj.upload_file(path)
|
33
|
+
transfer_manager.upload_file(path, bucket: bucket_name, key: key)
|
31
34
|
end
|
32
35
|
end
|
33
36
|
|
@@ -45,17 +48,16 @@ module Jets::Cfn
|
|
45
48
|
puts "Uploading #{path} (#{file_size}) to S3"
|
46
49
|
start_time = Time.now
|
47
50
|
s3_key = "jets/code/#{File.basename(path)}"
|
48
|
-
|
49
|
-
obj.upload_file(path)
|
51
|
+
transfer_manager.upload_file(path, bucket: bucket_name, key: s3_key)
|
50
52
|
puts "Uploaded to s3://#{bucket_name}/#{s3_key}".color(:green)
|
51
|
-
puts "Time to upload code to s3: #{pretty_time(Time.now-start_time).color(:green)}"
|
53
|
+
puts "Time to upload code to s3: #{pretty_time(Time.now - start_time).color(:green)}"
|
52
54
|
end
|
53
55
|
|
54
56
|
def upload_assets
|
55
57
|
puts "Checking for modified public assets and uploading to S3."
|
56
58
|
start_time = Time.now
|
57
59
|
upload_public_assets
|
58
|
-
puts "Time for public assets to s3: #{pretty_time(Time.now-start_time).color(:green)}"
|
60
|
+
puts "Time for public assets to s3: #{pretty_time(Time.now - start_time).color(:green)}"
|
59
61
|
end
|
60
62
|
|
61
63
|
def upload_public_assets
|
@@ -88,32 +90,31 @@ module Jets::Cfn
|
|
88
90
|
end
|
89
91
|
|
90
92
|
def upload_to_s3(full_path)
|
91
|
-
return if identical_on_s3?(full_path) && !ENV[
|
93
|
+
return if identical_on_s3?(full_path) && !ENV["JETS_ASSET_UPLOAD_FORCE"]
|
92
94
|
|
93
95
|
key = s3_key(full_path)
|
94
|
-
obj = s3_resource.bucket(bucket_name).object(key)
|
95
96
|
content_type = content_type_headers(full_path)
|
96
97
|
Jets.logger.debug "Uploading and setting content type for s3://#{bucket_name}/#{key} content_type #{content_type[:content_type].inspect}"
|
97
|
-
|
98
|
+
transfer_manager.upload_file(full_path, bucket: bucket_name, key: key, acl: "public-read", cache_control: cache_control, **content_type)
|
98
99
|
end
|
99
100
|
|
100
101
|
CONTENT_TYPES_BY_EXTENSION = {
|
101
|
-
|
102
|
-
|
103
|
-
|
102
|
+
".css" => "text/css",
|
103
|
+
".html" => "text/html",
|
104
|
+
".js" => "application/javascript"
|
104
105
|
}
|
105
106
|
def content_type_headers(full_path)
|
106
107
|
ext = File.extname(full_path)
|
107
108
|
content_type = CONTENT_TYPES_BY_EXTENSION[ext] || Rack::Mime.mime_type(ext)
|
108
109
|
if content_type
|
109
|
-
{
|
110
|
+
{content_type: content_type}
|
110
111
|
else
|
111
112
|
{}
|
112
113
|
end
|
113
114
|
end
|
114
115
|
|
115
116
|
def s3_key(full_path)
|
116
|
-
relative_path = full_path.sub("#{Jets.root}/",
|
117
|
+
relative_path = full_path.sub("#{Jets.root}/", "")
|
117
118
|
"jets/#{relative_path}"
|
118
119
|
end
|
119
120
|
|
@@ -152,6 +153,5 @@ module Jets::Cfn
|
|
152
153
|
"#{minutes.to_i}m #{seconds.to_i}s"
|
153
154
|
end
|
154
155
|
end
|
155
|
-
|
156
156
|
end
|
157
|
-
end
|
157
|
+
end
|
@@ -1,12 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
ENV["JETS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
4
|
-
ENV["NODE_ENV"]
|
4
|
+
ENV["NODE_ENV"] ||= "development"
|
5
5
|
|
6
6
|
require "pathname"
|
7
7
|
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
8
8
|
Pathname.new(__FILE__).realpath)
|
9
9
|
|
10
|
+
require "logger" # must require logger before bundler
|
10
11
|
require "rubygems"
|
11
12
|
require "bundler/setup"
|
12
13
|
|
@@ -16,4 +17,4 @@ require "webpacker/webpack_runner"
|
|
16
17
|
APP_ROOT = File.expand_path("..", __dir__)
|
17
18
|
Dir.chdir(APP_ROOT) do
|
18
19
|
Webpacker::WebpackRunner.run(ARGV)
|
19
|
-
end
|
20
|
+
end
|
data/lib/jets/version.rb
CHANGED