jets 3.0.9 → 3.0.13

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: bccb565973aab7e6793924820d026a97e056a75fc5827f0e227d11d17f2c76d8
4
- data.tar.gz: c0935a069903b2406e4c06948d35e679d4a2837dc002bc56168f94a4c441774f
3
+ metadata.gz: a8e4fbbeb4ae84a9c2f7d3c6fac9fdbb6cdcda684ae9387ba8c09b4f7c07cb7e
4
+ data.tar.gz: 0ca4432001005d29d4104cf48c2e92d68abb6d3018e2fdc15f3cc5f50769a703
5
5
  SHA512:
6
- metadata.gz: a0368aad05b5cd49fb3e5f175e672306c62906b9f3909fc8e9df29ca722cff15695a8c9de2a9d5f34bfe404828fc06401f04bc1b63ed6486c57f963191d3de43
7
- data.tar.gz: 90eab98e9f5664bb27b67a14f5d3b2cba53f4cdfabd8828629d467cd0c00351746c6425ef5a38080cdec814ebd2d69aa480d132415bf6531bf1775f37bf944d1
6
+ metadata.gz: 79ac35eaf167a60a3bd6ab384fd5cd2cee55adaf3726d72d2c2648103af4153c7906560ac6977b270f55d69e4ce641582bd8f8e8e9a102af9ecbaffa071b50bd
7
+ data.tar.gz: 0df8301c1d590dc62119baf244eedd93d152b5d23d2149304d4223d28f7fd4b733eb05f9fcd69c8faba5df873e0023c4d88de694717d0493d30b627091110d2a
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.13] - 2021-08-17
7
+ - [#582](https://github.com/boltops-tools/jets/pull/582) use Shotgun::Static middleware always
8
+
9
+ ## [3.0.12] - 2021-08-08
10
+ - [#578](https://github.com/boltops-tools/jets/pull/578) Update "jets delete" documentation to be --yes instead of --skip
11
+ - [#580](https://github.com/boltops-tools/jets/pull/580) Use active support instead of actionview
12
+ - [#581](https://github.com/boltops-tools/jets/pull/581) Csrf csrf-param authenticity_token and use @rails/ujs for crud
13
+
14
+ ## [3.0.11] - 2021-07-15
15
+ - update serverlessgems gem
16
+
17
+ ## [3.0.10] - 2021-07-14
18
+ - [#575](https://github.com/boltops-tools/jets/pull/575) fix missing webpacker helpers
19
+ - [#576](https://github.com/boltops-tools/jets/pull/576) Fixes API Gateway base path Lambda not respecting various config opts
20
+ - [#577](https://github.com/boltops-tools/jets/pull/577) Adjust .jetskeep handling and add .jetsignore docs
21
+ - fix dbconsole (#568)
22
+
6
23
  ## [3.0.9] - 2021-06-14
7
24
  - fix content type s3 metadata (#564)
8
25
 
data/jets.gemspec CHANGED
@@ -57,7 +57,7 @@ Gem::Specification.new do |spec|
57
57
  spec.add_dependency "railties", "~> 6.1.0" # for ActiveRecord database_tasks.rb
58
58
  spec.add_dependency "rainbow"
59
59
  spec.add_dependency "recursive-open-struct"
60
- spec.add_dependency "serverlessgems", "~> 0.1.3"
60
+ spec.add_dependency "serverlessgems", "~> 0.1.4"
61
61
  spec.add_dependency "shotgun"
62
62
  spec.add_dependency "text-table"
63
63
  spec.add_dependency "thor"
@@ -1,4 +1,4 @@
1
- require 'action_view'
1
+ require "active_support/number_helper"
2
2
 
3
3
  # Examples:
4
4
  #
@@ -10,7 +10,7 @@ require 'action_view'
10
10
  #
11
11
  module Jets::Builders
12
12
  class Md5Zip
13
- include ActionView::Helpers::NumberHelper # number_to_human_size
13
+ include ActiveSupport::NumberHelper # number_to_human_size
14
14
  include Util
15
15
 
16
16
  def initialize(folder)
@@ -38,7 +38,7 @@ module Jets::Builders
38
38
  removals += get_removals("#{@project_root}/.jetsignore")
39
39
  removals = removals.reject do |p|
40
40
  jetskeep.find do |keep|
41
- p.include?(keep)
41
+ p == keep
42
42
  end
43
43
  end
44
44
  removals.uniq
@@ -56,7 +56,7 @@ module Jets::Builders
56
56
  # We clean out ignored files pretty aggressively. So provide
57
57
  # a way for users to keep files from being cleaned out.
58
58
  def jetskeep
59
- always = %w[.bundle packs vendor]
59
+ always = %w[.bundle /public/packs /public/packs-test vendor]
60
60
  path = "#{@project_root}/.jetskeep"
61
61
  return always unless File.exist?(path)
62
62
 
@@ -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
@@ -2,7 +2,7 @@ module Jets::Commands
2
2
  class Gems < Jets::Commands::Base
3
3
  desc "check", "Check if pre-built Lambda gems are available from the sources"
4
4
  long_desc Help.text("gems:check")
5
- option :show_source, type: :boolean, desc: "Show source"
5
+ option :verbose, type: :boolean, desc: "Verbose mode"
6
6
  def check
7
7
  check = Jets::Gems::Check.new(@options)
8
8
  check.run! # exits early if missing gems found
@@ -17,6 +17,6 @@ This deletes the all the contents in the internal s3 bucket that jets uses and t
17
17
  Project demo-dev deleted!
18
18
  $
19
19
 
20
- You can bypass the are you sure prompt with the `--sure` flag.
20
+ You can bypass the are you sure prompt with the `--yes` flag.
21
21
 
22
- $ jets delete --sure
22
+ $ jets delete --yes
@@ -114,7 +114,7 @@ JS
114
114
  after = "const { environment } = require('@rails/webpacker')\n"
115
115
  insert_into_file("config/webpack/environment.js", jquery, after: after)
116
116
 
117
- run("yarn add bootstrap jquery popper.js postcss-cssnext")
117
+ run("yarn add bootstrap jquery popper.js postcss-cssnext @rails/ujs")
118
118
  end
119
119
 
120
120
  def git_init
@@ -18,5 +18,6 @@
18
18
  <% if @bootstrap -%>
19
19
  import 'bootstrap/dist/js/bootstrap';
20
20
  <% end -%>
21
- import '../src/jets/crud'
22
- console.log('Hello World from Webpacker')
21
+
22
+ import Rails from "@rails/ujs"
23
+ Rails.start()
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
 
@@ -1,3 +1,5 @@
1
+ require "shotgun"
2
+
1
3
  module Jets::Middleware
2
4
  class DefaultStack
3
5
  attr_reader :config, :app
@@ -8,7 +10,7 @@ module Jets::Middleware
8
10
 
9
11
  def build_stack
10
12
  Stack.new do |middleware|
11
- middleware.use Shotgun::Static if Jets.env.development?
13
+ middleware.use Shotgun::Static
12
14
  middleware.use Rack::Runtime
13
15
  middleware.use Jets::Controller::Middleware::Cors if cors_enabled?
14
16
  middleware.use Rack::MethodOverride # must come before Middleware::Local for multipart post forms to work
@@ -77,7 +77,10 @@ module Jets::UrlHelper
77
77
 
78
78
  def csrf_meta_tags
79
79
  if protect_against_forgery?
80
- tag("meta", name: "csrf-token", content: masked_authenticity_token).html_safe
80
+ html = tag("meta", name: "csrf-token", content: masked_authenticity_token).html_safe
81
+ html << "\n"
82
+ html << tag("meta", name: "csrf-param", content: "authenticity_token").html_safe
83
+ html
81
84
  end
82
85
  end
83
86
  end # UrlHelper
@@ -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.9"
2
+ VERSION = "3.0.13"
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.9
4
+ version: 3.0.13
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-06-14 00:00:00.000000000 Z
11
+ date: 2021-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -436,14 +436,14 @@ dependencies:
436
436
  requirements:
437
437
  - - "~>"
438
438
  - !ruby/object:Gem::Version
439
- version: 0.1.3
439
+ version: 0.1.4
440
440
  type: :runtime
441
441
  prerelease: false
442
442
  version_requirements: !ruby/object:Gem::Requirement
443
443
  requirements:
444
444
  - - "~>"
445
445
  - !ruby/object:Gem::Version
446
- version: 0.1.3
446
+ version: 0.1.4
447
447
  - !ruby/object:Gem::Dependency
448
448
  name: shotgun
449
449
  requirement: !ruby/object:Gem::Requirement
@@ -776,7 +776,6 @@ files:
776
776
  - lib/jets/commands/templates/skeleton/spec/spec_helper.rb.tt
777
777
  - lib/jets/commands/templates/webpacker/app/javascript/packs/application.js.tt
778
778
  - lib/jets/commands/templates/webpacker/app/javascript/packs/theme.scss.tt
779
- - lib/jets/commands/templates/webpacker/app/javascript/src/jets/crud.js
780
779
  - lib/jets/commands/upgrade.rb
781
780
  - lib/jets/commands/upgrade/templates/bin/webpack
782
781
  - lib/jets/commands/upgrade/templates/bin/webpack-dev-server
@@ -1,90 +0,0 @@
1
- // This file is automatically generated by Jets. It is used by
2
- // app/javascript/packs/application.js.
3
- //
4
- // It handles the delete and update action in an unobstrusive way.
5
- // Code could be improved and is meant to provide only a starting point.
6
-
7
- $(function() {
8
- function handleAll(e) {
9
- var target = $(e.target);
10
- if (target.is('a') && target.data("method") == "delete") {
11
- return handleDelete(e);
12
- } else if (target.attr('type') == "submit") {
13
- return handleUpdate(e);
14
- } else {
15
- return true;
16
- }
17
-
18
- e.preventDefault();
19
- }
20
-
21
- function handleDelete(e) {
22
- event.preventDefault();
23
- var link = $(e.target);
24
- var message = link.data("confirm");
25
- if (message) {
26
- var sure = confirm(message);
27
- if (sure) {
28
- deleteItem(link);
29
- } else {
30
- console.log("Deletion cancelled");
31
- }
32
- }
33
- }
34
-
35
- function handleUpdate(e) {
36
- var submit = $(e.target);
37
- var form = submit.closest('form');
38
- var url = form.attr("action");
39
- var method = $("input[name=_method]");
40
-
41
- if (method.attr("value") != "put") {
42
- return true;
43
- }
44
-
45
- e.preventDefault();
46
- var data = $(form).serialize();
47
- $.ajax({
48
- url: url,
49
- type: 'PUT',
50
- data: data,
51
- dataType: "json",
52
- success: function(response) {
53
- window.location.href = response.location;
54
- },
55
- error: function(xhr, textStatus, errorThrown) {
56
- console.log('Error! Status = ' + xhr.status);
57
- },
58
- complete: function(data) {
59
- console.log("data %o", data);
60
- }
61
- });
62
- }
63
-
64
- function deleteItem(link) {
65
- var node = link.closest('.jets-element-to-delete');
66
- node.hide(); // immediately hide element
67
-
68
- var resource = link.attr("href");
69
- var token = $('meta[name=csrf-token]').attr('content');
70
- var data = { authenticity_token: token };
71
- var request = $.ajax({
72
- url: resource,
73
- method: "DELETE",
74
- data: data,
75
- dataType: "json"
76
- });
77
-
78
- request.done(function(msg) {
79
- console.log("msg %o", msg)
80
- node.remove();
81
- });
82
-
83
- request.fail(function(jqXHR, textStatus) {
84
- console.log("textStatus %o", textStatus)
85
- node.show(); // in the event of a failure re-display the node
86
- });
87
- }
88
-
89
- $('body').click(handleAll)
90
- });