jets 5.0.16 → 5.0.17

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: 3122354f1e6a078fe2b8b0672065955366f36273906a643abcc6cf6181f10736
4
- data.tar.gz: a47309f9b492bae2803ed0d3eba234f89c008358e35498b05643026fef57ceac
3
+ metadata.gz: 5fea0d31844d91593a90d61ce5b8ed5a161e0971b495b4642e93e3486029262e
4
+ data.tar.gz: ee8ef5828c4544cbb9cc3f529bbd83c649c4cb099a07ba5a1570235d6b472c56
5
5
  SHA512:
6
- metadata.gz: 96a944ebcb5fd408579238ecc63687631172383894944da56d9d0764dc9ca16bf54a01b2cfdf12e8c1d773631c4940ec3473ee1382e46074fc6c83892c7b8861
7
- data.tar.gz: 2c667a738eb867cee4652a0e8d5f62c5f64507c16b6d4511db4030ebeadd00dc2d94fcb9fe6593b27cffea0f90b2156d40598d60e62a1cff4d822d8349bf4f49
6
+ metadata.gz: 8790b20da41e60615ae53bca76f6746d79a5357171a9e35caad437ce969b7243b28265c84d5a28fe962792c8cf0be6de39c01fa2593550aed120009141a1921e
7
+ data.tar.gz: 5a4e9e98778fe904272d5d4e6345a0c1a4eb4e1ba884492b1411cbc9e52b38785ea8d473679e5964114a3da77117643f4a926770ba34c1954fb3e7286ed42146
data/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
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
+ ## [5.0.17] - 2025-10-11
7
+
8
+ - fix crash on deploy if parent stack exists but ApiGateway does not exist yet
9
+ - extract method for request_context so it can be mocked more easily in tests
10
+ - reset Dotenv vars when building/deploying so that remote variables are included
11
+ - use Dotenv.parse to ensure all variables are returned
12
+ - payload may be nil when invoking a Lambda function
13
+
6
14
  ## [5.0.16] - 2025-10-11
7
15
  - update dependency jets-api 0.2.2
8
16
 
@@ -30,6 +30,7 @@ module Jets::Builders
30
30
  cache_check_message
31
31
 
32
32
  clean_start
33
+ reset_dotenv_vars
33
34
  assets_precompile
34
35
  run_webpack # easier to do before we copy the project because node and yarn has been likely setup in the that dir
35
36
  copy_project
@@ -246,6 +247,12 @@ module Jets::Builders
246
247
  FileUtils.mkdir_p(Jets.build_root) # /tmp/jets/demo
247
248
  end
248
249
 
250
+ # Resets Dotenv cached variables so that it will force the Dotenv files to reload including
251
+ # the .remote files for deployment
252
+ def reset_dotenv_vars
253
+ Jets::Dotenv.class_variable_set(:@@vars, nil)
254
+ end
255
+
249
256
  # Copy project into temporary directory. Do this so we can keep the project
250
257
  # directory untouched and we can also remove a bunch of unnecessary files like
251
258
  # logs before zipping it up.
@@ -68,6 +68,7 @@ module Jets::Cfn::Builder::Api
68
68
  memoize :existing_domain_name?
69
69
 
70
70
  def existing_domain_name_on_stack?
71
+ return false unless api_gateway_physical_resource_id
71
72
  cfn.describe_stack_resource(
72
73
  stack_name: api_gateway_physical_resource_id,
73
74
  logical_resource_id: "DomainName"
@@ -79,6 +80,7 @@ module Jets::Cfn::Builder::Api
79
80
  end
80
81
 
81
82
  def existing_dns_record_on_stack?
83
+ return false unless api_gateway_physical_resource_id
82
84
  cfn.describe_stack_resource(
83
85
  stack_name: api_gateway_physical_resource_id,
84
86
  logical_resource_id: "DnsRecord"
@@ -75,8 +75,8 @@ module Jets::Commands::Call
75
75
  end
76
76
 
77
77
  add_console_link_to_clipboard
78
- result = resp.payload.read # already been normalized/JSON.dump by AWS
79
- unless @options[:mute_output]
78
+ result = resp.payload&.read # already been normalized/JSON.dump by AWS
79
+ unless result.nil? || @options[:mute_output]
80
80
  STDOUT.puts result # only thing that goes to stdout
81
81
  end
82
82
  end
@@ -40,7 +40,7 @@ class Jets::Controller::Middleware::Mimic
40
40
  "multiValueQueryStringParameters" => multi_value_query_string_parameters,
41
41
  "pathParameters" => @route.extract_parameters(path),
42
42
  "stageVariables" => nil,
43
- "requestContext" => {},
43
+ "requestContext" => request_context,
44
44
  "body" => get_body,
45
45
  "isBase64Encoded" => false,
46
46
  }
@@ -63,6 +63,16 @@ class Jets::Controller::Middleware::Mimic
63
63
  "Upgrade-Insecure-Requests" => "upgrade-insecure-requests",
64
64
  }
65
65
 
66
+ # For mocking in RSepc:
67
+ #
68
+ # allow_any_instance_of(Jets::Controller::Middleware::Mimic::Apigw).to receive(:request_context) {
69
+ # {'authorizer' => { 'claims' => { 'sub' => sub, 'email_verified' => 'true', 'email' => 'me@example.com' }}}
70
+ # }
71
+ #
72
+ def request_context
73
+ {}
74
+ end
75
+
66
76
  # Map rack env headers to Api Gateway event headers. Most rack env headers are
67
77
  # prepended by HTTP_.
68
78
  #
data/lib/jets/dotenv.rb CHANGED
@@ -17,7 +17,7 @@ class Jets::Dotenv
17
17
  def load!
18
18
  return @@vars if @@vars
19
19
  return if on_aws? # this prevents ssm calls if used in dotenv files
20
- vars = ::Dotenv.load(*dotenv_files)
20
+ vars = ::Dotenv.parse(*dotenv_files)
21
21
  @@vars = Ssm.new(vars).interpolate!
22
22
  end
23
23
 
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "5.0.16"
2
+ VERSION = "5.0.17"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.16
4
+ version: 5.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen