jets 3.0.6 → 3.0.10

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: 3ed89daa4700646743805940f6847196c9be132562bb1f4e90bf4cbeb0053e65
4
- data.tar.gz: '09db7db5170f8aefffbd963986a007c1643814cd853c77451b27d06f2f522335'
3
+ metadata.gz: 0b2e85111e507304b3bd11375499c70f4ba880e1f2523e5f7b2ff627e6558b76
4
+ data.tar.gz: 5e7bbb320f5e580726ab4d66e11cc47feca970edc61d6d01f1ed25fea2693bad
5
5
  SHA512:
6
- metadata.gz: ddba3375086b7269d52cdcb0cbe2edca842ac94ab43fd65ea72d0a9ee5ab76cae42f3fc2f67678c4cb3a83533a9cf0993b84278e2268c133ed5bf1de57e41f20
7
- data.tar.gz: 9907b63ebf1a56d1eb7ec51b171a98e3a9adb894cebd8dbdcb2a451510975da48704172c71401af5766c85a6ed0f39f804efa180b09aa2645364c62e5ec5397f
6
+ metadata.gz: 7dbf8891880be71e8b40da911ebb13e5ad39365158efa9bd62426b17e94d8b264a9832f14e32f10a8b402daf34cecda8f5986bcfcc70cb9278a7793b398b61d0
7
+ data.tar.gz: 6397148e88442a557552397ab01c7b7697f3642593f0aaedcbddd15f01c824e47b64922d21208bf99e01dd2929b547fcc3ef07a0c91afb6e49a58fe46185667f
data/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
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
+ ## [3.0.10] - 2021-07-14
7
+ - [#575](https://github.com/boltops-tools/jets/pull/575) fix missing webpacker helpers
8
+ - [#576](https://github.com/boltops-tools/jets/pull/576) Fixes API Gateway base path Lambda not respecting various config opts
9
+ - [#577](https://github.com/boltops-tools/jets/pull/577) Adjust .jetskeep handling and add .jetsignore docs
10
+ - fix dbconsole (#568)
11
+
12
+ ## [3.0.9] - 2021-06-14
13
+ - fix content type s3 metadata (#564)
14
+
15
+ ## [3.0.8] - 2021-06-03
16
+ - Update cli.md (#560)
17
+ - respect .jetsignore also (#562)
18
+
19
+ ## [3.0.7] - 2021-05-27
20
+ - Dont bypass class_attribute setters (#559)
21
+ - update pg version in jets new Gemfile to latest (#558)
22
+
6
23
  ## [3.0.6] - 2021-05-27
7
24
  - Handle Errors::InvalidClientTokenId when `get_caller_identity` fails (#543)
8
25
  - Use description specifed in function properties (#545)
@@ -35,9 +35,10 @@ module Jets::Builders
35
35
  removals = always_removals
36
36
  removals += get_removals("#{@project_root}/.gitignore")
37
37
  removals += get_removals("#{@project_root}/.dockerignore")
38
+ removals += get_removals("#{@project_root}/.jetsignore")
38
39
  removals = removals.reject do |p|
39
40
  jetskeep.find do |keep|
40
- p.include?(keep)
41
+ p == keep
41
42
  end
42
43
  end
43
44
  removals.uniq
@@ -55,7 +56,7 @@ module Jets::Builders
55
56
  # We clean out ignored files pretty aggressively. So provide
56
57
  # a way for users to keep files from being cleaned out.
57
58
  def jetskeep
58
- always = %w[.bundle packs vendor]
59
+ always = %w[.bundle /public/packs /public/packs-test vendor]
59
60
  path = "#{@project_root}/.jetskeep"
60
61
  return always unless File.exist?(path)
61
62
 
@@ -1,5 +1,6 @@
1
1
  require 'action_view'
2
2
  require 'digest'
3
+ require 'rack/mime'
3
4
 
4
5
  module Jets::Cfn
5
6
  class Upload
@@ -8,12 +9,6 @@ module Jets::Cfn
8
9
 
9
10
  attr_reader :bucket_name
10
11
 
11
- CONTENT_TYPES_BY_EXTENSION = {
12
- '.css' => 'text/css',
13
- '.js' => 'application/javascript',
14
- '.html' => 'text/html'
15
- }
16
-
17
12
  def initialize(bucket_name)
18
13
  @bucket_name = bucket_name
19
14
  end
@@ -93,16 +88,23 @@ module Jets::Cfn
93
88
  end
94
89
 
95
90
  def upload_to_s3(full_path)
96
- return if identical_on_s3?(full_path)
91
+ return if identical_on_s3?(full_path) && !ENV['JETS_ASSET_UPLOAD_FORCE']
97
92
 
98
93
  key = s3_key(full_path)
99
94
  obj = s3_resource.bucket(bucket_name).object(key)
100
- puts "Uploading and setting content type for s3://#{bucket_name}/#{key}" # uncomment to see and debug
101
- obj.upload_file(full_path, { acl: "public-read", cache_control: cache_control }.merge(content_type_headers(full_path)))
95
+ content_type = content_type_headers(full_path)
96
+ puts "Uploading and setting content type for s3://#{bucket_name}/#{key} content_type #{content_type[:content_type].inspect}"
97
+ obj.upload_file(full_path, { acl: "public-read", cache_control: cache_control }.merge(content_type))
102
98
  end
103
99
 
100
+ CONTENT_TYPES_BY_EXTENSION = {
101
+ '.css' => 'text/css',
102
+ '.html' => 'text/html',
103
+ '.js' => 'application/javascript',
104
+ }
104
105
  def content_type_headers(full_path)
105
- content_type = CONTENT_TYPES_BY_EXTENSION[File.extname(full_path)]
106
+ ext = File.extname(full_path)
107
+ content_type = CONTENT_TYPES_BY_EXTENSION[ext] || Rack::Mime.mime_type(ext)
106
108
  if content_type
107
109
  { content_type: content_type }
108
110
  else
@@ -1,12 +1,15 @@
1
1
  # Thanks: Rails dbconsole_command.rb
2
2
  module Jets::Commands
3
3
  class Dbconsole
4
+ extend Memoist
5
+
4
6
  def self.start(*args)
5
7
  new(*args).start
6
8
  end
7
9
 
8
10
  def initialize(options = {})
9
- @options = options
11
+ defaults = {"include_password" => true}
12
+ @options = defaults.merge(options)
10
13
  end
11
14
 
12
15
  def start
@@ -85,14 +88,14 @@ module Jets::Commands
85
88
  end
86
89
 
87
90
  def config
88
- @config ||= begin
89
- if configurations[environment].blank?
90
- raise ActiveRecord::AdapterNotSpecified, "'#{environment}' database is not configured. Available configuration: #{configurations.inspect}"
91
- else
92
- configurations[environment]
93
- end
91
+ configs = configurations.configs_for(env_name: environment)
92
+ if configs.blank?
93
+ raise ActiveRecord::AdapterNotSpecified, "'#{environment}' database is not configured. Available configuration: #{configurations.inspect}"
94
+ else
95
+ configs.first.configuration_hash.dup.stringify_keys!
94
96
  end
95
97
  end
98
+ memoize :config
96
99
 
97
100
  def environment
98
101
  Jets.env.to_s
@@ -9,11 +9,11 @@ gem "jetpacker"
9
9
  <% if @database == 'postgresql' %>
10
10
  # Include pg gem if you are using ActiveRecord, remove next line
11
11
  # and config/database.yml file if you are not
12
- gem "pg", "~> 1.1.3"
12
+ gem "pg", "~> 1.2.3"
13
13
  <% elsif @database == 'mysql' %>
14
14
  # Include mysql2 gem if you are using ActiveRecord, remove next line
15
15
  # and config/database.yml file if you are not
16
- gem "mysql2", "~> 0.5.2"
16
+ gem "mysql2", "~> 0.5.3"
17
17
  <% end %>
18
18
  <% unless options[:mode] == 'job' -%>
19
19
  gem "dynomite"
@@ -17,10 +17,12 @@ class Jets::Controller
17
17
  end
18
18
 
19
19
  def skip_before_action(meth, options = {})
20
- # adds the methods in the only to the exception list for the callback
21
- return append_except_to_callbacks(self.before_actions, meth, options[:only]) if options[:only].present?
22
-
23
- self.before_actions.reject! { |el| el.first.to_s == meth.to_s }
20
+ self.before_actions = before_actions
21
+ .reject { |act| act.first.to_s == meth.to_s }
22
+
23
+ # If options include the `only` option,
24
+ # re-add the action using the setter with the `except` option
25
+ before_action(meth, { except: options[:only] }) if options[:only].present?
24
26
  end
25
27
 
26
28
  alias_method :append_before_action, :before_action
@@ -38,20 +40,6 @@ class Jets::Controller
38
40
  end
39
41
 
40
42
  alias_method :append_after_action, :after_action
41
-
42
- private
43
-
44
- def append_except_to_callbacks(callback_methods, meth, excepted_methods)
45
- callback_methods.map! do |callback_method|
46
- if callback_method.first.to_s == meth.to_s
47
- exceptions = callback_method.second[:except] || []
48
- exceptions.concat(Array.wrap(excepted_methods))
49
- callback_method.second[:except] = exceptions
50
- end
51
-
52
- callback_method
53
- end
54
- end
55
43
  end
56
44
  end # included
57
45
 
data/lib/jets/core.rb CHANGED
@@ -43,7 +43,7 @@ module Jets::Core
43
43
  memoize :logger
44
44
 
45
45
  def webpacker?
46
- Gem.loaded_specs.keys.include?("webpacker")
46
+ Gem.loaded_specs.keys.any?{|k| k.start_with?("webpacker")}
47
47
  end
48
48
  memoize :webpacker?
49
49
 
@@ -25,7 +25,9 @@ module Jets::Resource::ApiGateway::BasePath
25
25
  end
26
26
 
27
27
  def layers
28
- ["!Ref GemLayer"]
28
+ return Jets.config.lambda.layers if Jets.config.gems.disable
29
+
30
+ ["!Ref GemLayer"] + Jets.config.lambda.layers
29
31
  end
30
32
 
31
33
  def function_name
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "3.0.6"
2
+ VERSION = "3.0.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.6
4
+ version: 3.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-27 00:00:00.000000000 Z
11
+ date: 2021-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer