jets 1.0.0 → 1.0.1

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: 8280c4dd8fd0e5dcf740e5cbba920c4b60bb141929635940592f9bacb576c6a9
4
- data.tar.gz: ae6388ea520d67ae42b72cd8d479c6964cf4faf5ae62fe486c4ff107de395fe4
3
+ metadata.gz: 9a10e580d02662a4ebaf411e72c6d5c6722f4364e8a0bf7adbd032e5846da9c9
4
+ data.tar.gz: dc54bc8b1a45001722702e5a1b6a196120df43efd0ea945e97e23ebd94d29f62
5
5
  SHA512:
6
- metadata.gz: b3db1c42d1671cb0aa18c36f0e91cd32c78bd89c12c7e1f7a84f66a42d804d192f9a540954ebfed14e932c08fa6890076ed89f6912313527b1e86f63859886ff
7
- data.tar.gz: 43681d533614ab99a940ae0495fa5aa21eba0b4e36b54bcda11d72eb03398af1acce0aebb0a771bd91a2916bfde078ad8e140d4d6f85889fb08c9c1723eb5305
6
+ metadata.gz: c21dd6f28a6f5c6d150a441729a6c4ea7db9813160a9cfcf574ede7740ddd0ae58ed97f4c123590d1f8c01526597c10816899a89e187c968deb3b40ae97d8aca
7
+ data.tar.gz: ae3bd8e7d18c10479dc8bdd62a25781c6d34550c997f638ea7f809fe730f56345b1b1753a316146f9293a94385231b5b5536334cb389102030da31fc8865841e
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
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/), even before v1.0.
5
5
 
6
+ ## [1.0.1]
7
+ - jets upgrade:v1 command
8
+ - Merge pull request #52 from tongueroo/upgrade-command
9
+
6
10
  ## [1.0.0]
7
11
  - Mega Mode: Rails Support, Rack Support
8
12
  - jets import:rails command
@@ -18,6 +22,7 @@ This project *loosely tries* to adhere to [Semantic Versioning](http://semver.or
18
22
  - Improve code builder: Tidy class
19
23
  - Improve cfn builder: separate out cfn upload
20
24
  - Improve Jets IO buffer handling
25
+ - Merge pull request #48 from tongueroo/megamode2
21
26
 
22
27
  ## [0.10.4]
23
28
  - Merge pull request #51 from tongueroo/fix-aws-account: fix aws account lookup when ~/.aws/config not configured
data/Gemfile.lock CHANGED
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- jets (1.0.0)
14
+ jets (1.0.1)
15
15
  actionpack (>= 5.2.1)
16
16
  actionview (>= 5.2.1)
17
17
  activerecord (>= 5.2.1)
@@ -65,14 +65,14 @@ GEM
65
65
  tzinfo (~> 1.1)
66
66
  arel (9.0.0)
67
67
  aws-eventstream (1.0.1)
68
- aws-partitions (1.106.0)
68
+ aws-partitions (1.107.0)
69
69
  aws-sdk-cloudformation (1.10.0)
70
70
  aws-sdk-core (~> 3, >= 3.26.0)
71
71
  aws-sigv4 (~> 1.0)
72
72
  aws-sdk-cloudwatchlogs (1.10.0)
73
73
  aws-sdk-core (~> 3, >= 3.26.0)
74
74
  aws-sigv4 (~> 1.0)
75
- aws-sdk-core (3.35.0)
75
+ aws-sdk-core (3.36.0)
76
76
  aws-eventstream (~> 1.0)
77
77
  aws-partitions (~> 1.0)
78
78
  aws-sigv4 (~> 1.0)
@@ -86,7 +86,7 @@ GEM
86
86
  aws-sdk-lambda (1.13.0)
87
87
  aws-sdk-core (~> 3, >= 3.26.0)
88
88
  aws-sigv4 (~> 1.0)
89
- aws-sdk-s3 (1.23.0)
89
+ aws-sdk-s3 (1.23.1)
90
90
  aws-sdk-core (~> 3, >= 3.26.0)
91
91
  aws-sdk-kms (~> 1)
92
92
  aws-sigv4 (~> 1.0)
@@ -178,8 +178,10 @@ class Jets::Builders
178
178
  def update_lazy_load_config
179
179
  size_limit = AWS_CODE_SIZE_LIMIT
180
180
  code_size = dir_size(full(tmp_code))
181
- if code_size > size_limit
181
+ if code_size > size_limit && !Jets.config.ruby.lazy_load
182
182
  # override the setting because we dont have to a choice but to lazy load
183
+ mb_limit = AWS_CODE_SIZE_LIMIT / 1024 / 1024
184
+ puts "Code size close to AWS code size limit of #{mb_limit}MB. Lazy loading automatically enabled."
183
185
  Jets.config.ruby.lazy_load = true
184
186
  end
185
187
  end
data/lib/jets/commands.rb CHANGED
@@ -20,6 +20,7 @@ module Jets::Commands
20
20
  autoload :Runner, 'jets/commands/runner'
21
21
  autoload :Sequence, "jets/commands/sequence"
22
22
  autoload :StackInfo, "jets/commands/stack_info"
23
+ autoload :Upgrade, "jets/commands/upgrade"
23
24
  autoload :Url, "jets/commands/url"
24
25
  autoload :WebpackerTemplate, 'jets/commands/webpacker_template'
25
26
  end
@@ -0,0 +1,11 @@
1
+ module Jets::Commands
2
+ class Upgrade < Jets::Commands::Base
3
+ autoload :V1, "jets/commands/upgrade/v1"
4
+
5
+ desc "v1", "Upgrades application to version 1"
6
+ long_desc Help.text('upgrade:v1')
7
+ def v1
8
+ V1.new(options).run
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,71 @@
1
+ require 'fileutils'
2
+
3
+ class Jets::Commands::Upgrade
4
+ class V1
5
+ def initialize(options)
6
+ @options = options
7
+ end
8
+
9
+ def run
10
+ puts "Upgrading to Jets v1..."
11
+ environment_configs
12
+ update_routes
13
+ update_mode_setting
14
+ puts "Upgrade complete."
15
+ end
16
+
17
+ def environment_configs
18
+ path = File.expand_path("../templates/skeleton/config/environments", File.dirname(__FILE__))
19
+ Dir.glob("#{path}/*").each do |src|
20
+ config_file = "config/environments/#{File.basename(src)}"
21
+ dest = "#{Jets.root}#{config_file}"
22
+ unless File.exist?(dest)
23
+ puts "Create: #{config_file}"
24
+ FileUtils.mkdir_p(File.dirname(dest))
25
+ FileUtils.cp(src, dest)
26
+ end
27
+ end
28
+ end
29
+
30
+ def update_routes
31
+ routes_file = "#{Jets.root}config/routes.rb"
32
+ return unless File.exist?(routes_file)
33
+
34
+ lines = IO.readlines(routes_file)
35
+ deprecated_code = 'root "jets/welcome#index"'
36
+ return unless lines.detect { |l| l.include?(deprecated_code) }
37
+
38
+ puts "Update: config/routes.rb"
39
+ lines.map! do |line|
40
+ if line.include?(deprecated_code)
41
+ %Q| root "jets/public#show"\n| # assume 2 spaces for simplicity
42
+ else
43
+ line
44
+ end
45
+ end
46
+
47
+ content = lines.join
48
+ IO.write(routes_file, content)
49
+ end
50
+
51
+ def update_mode_setting
52
+ application_file = "#{Jets.root}config/application.rb"
53
+ lines = IO.readlines(application_file)
54
+ deprecated_code = 'config.api_generator'
55
+ return unless lines.detect { |l| l.include?(deprecated_code) }
56
+
57
+ puts "Update: config/application.rb"
58
+ lines.map! do |line|
59
+ if line.include?(deprecated_code)
60
+ mode = Jets.config.api_generator ? 'api' : 'html'
61
+ %Q| config.mode = "#{mode}"\n| # assume 2 spaces for simplicity
62
+ else
63
+ line
64
+ end
65
+ end
66
+
67
+ content = lines.join
68
+ IO.write(application_file, content)
69
+ end
70
+ end
71
+ end
data/lib/jets/router.rb CHANGED
@@ -35,6 +35,8 @@ module Jets
35
35
  DEPRECATED: Jets.config.api_generator
36
36
  Instead, please update your config/application.rb to use:
37
37
  Jets.config.mode = 'api'
38
+ You can also run:
39
+ jets upgrade:v1
38
40
  EOL
39
41
  end
40
42
  api_mode = Jets.config.mode == 'api' || Jets.config.api_mode || Jets.config.api_generator
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
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: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
@@ -572,6 +572,8 @@ files:
572
572
  - lib/jets/commands/templates/webpacker/app/javascript/packs/application.js.tt
573
573
  - lib/jets/commands/templates/webpacker/app/javascript/packs/theme.scss.tt
574
574
  - lib/jets/commands/templates/webpacker/app/javascript/src/jets/crud.js
575
+ - lib/jets/commands/upgrade.rb
576
+ - lib/jets/commands/upgrade/v1.rb
575
577
  - lib/jets/commands/url.rb
576
578
  - lib/jets/commands/webpacker_template.rb
577
579
  - lib/jets/controller.rb