potassium 6.7.0 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +9 -1
  3. data/.node-version +1 -1
  4. data/.rubocop.yml +4 -0
  5. data/CHANGELOG.md +40 -0
  6. data/README.md +8 -1
  7. data/docs/CONTRIBUTING.md +6 -6
  8. data/lib/potassium/assets/.circleci/config.yml.erb +19 -13
  9. data/lib/potassium/assets/.env.development.erb +1 -0
  10. data/lib/potassium/assets/.env.test.erb +1 -0
  11. data/lib/potassium/assets/.eslintrc.json +14 -9
  12. data/lib/potassium/assets/.rubocop.yml +66 -1
  13. data/lib/potassium/assets/README.yml +3 -9
  14. data/lib/potassium/assets/app/frontend/active_admin/jquery.js +2 -0
  15. data/lib/potassium/assets/app/frontend/api/__mocks__/index.mock.ts +3 -0
  16. data/lib/potassium/assets/app/frontend/api/index.ts +63 -0
  17. data/lib/potassium/assets/app/frontend/css/application.css +3 -0
  18. data/lib/potassium/assets/app/frontend/entrypoints/active_admin.js +7 -0
  19. data/lib/potassium/assets/app/frontend/entrypoints/active_admin.scss +38 -0
  20. data/lib/potassium/assets/app/frontend/entrypoints/application.js +12 -0
  21. data/lib/potassium/assets/app/{javascript → frontend}/types/vue.d.ts +1 -0
  22. data/lib/potassium/assets/app/{javascript → frontend}/utils/case-converter.ts +2 -2
  23. data/lib/potassium/assets/app/frontend/utils/csrf-token.ts +9 -0
  24. data/lib/potassium/assets/bin/setup.erb +1 -1
  25. data/lib/potassium/assets/bin/update.erb +1 -1
  26. data/lib/potassium/assets/config/initializers/session_store.rb +20 -0
  27. data/lib/potassium/assets/config/sentry.rb.erb +2 -10
  28. data/lib/potassium/assets/lib/dotenv_monkeypatch.rb +19 -0
  29. data/lib/potassium/assets/lib/environment_variables.rb +9 -0
  30. data/lib/potassium/assets/package.json +7 -0
  31. data/lib/potassium/assets/tailwind.config.js +14 -0
  32. data/lib/potassium/assets/testing/simplecov_config.rb +10 -1
  33. data/lib/potassium/assets/tsconfig.config.json +18 -0
  34. data/lib/potassium/assets/tsconfig.json +17 -27
  35. data/lib/potassium/assets/vite.config.ts +46 -0
  36. data/lib/potassium/cli_options.rb +6 -4
  37. data/lib/potassium/helpers/rubocop-helpers.rb +6 -12
  38. data/lib/potassium/platanus_config.rb +1 -1
  39. data/lib/potassium/recipes/admin.rb +43 -72
  40. data/lib/potassium/recipes/background_processor.rb +0 -30
  41. data/lib/potassium/recipes/bullet.rb +41 -0
  42. data/lib/potassium/recipes/ci.rb +5 -0
  43. data/lib/potassium/recipes/cleanup.rb +0 -1
  44. data/lib/potassium/recipes/coverage.rb +4 -27
  45. data/lib/potassium/recipes/database_container.rb +1 -1
  46. data/lib/potassium/recipes/environment_variables.rb +18 -0
  47. data/lib/potassium/recipes/error_reporting.rb +2 -2
  48. data/lib/potassium/recipes/front_end_vite.rb +155 -0
  49. data/lib/potassium/recipes/google_tag_manager.rb +19 -23
  50. data/lib/potassium/recipes/mailer.rb +1 -1
  51. data/lib/potassium/recipes/mjml.rb +1 -1
  52. data/lib/potassium/recipes/node.rb +1 -1
  53. data/lib/potassium/recipes/rails.rb +2 -0
  54. data/lib/potassium/recipes/redis.rb +57 -0
  55. data/lib/potassium/recipes/style.rb +4 -6
  56. data/lib/potassium/recipes/vue_admin.rb +18 -14
  57. data/lib/potassium/recipes/yarn.rb +1 -1
  58. data/lib/potassium/templates/application.rb +11 -13
  59. data/lib/potassium/version.rb +8 -7
  60. data/spec/features/api_spec.rb +2 -2
  61. data/spec/features/background_processor_spec.rb +2 -2
  62. data/spec/features/bullet_spec.rb +29 -0
  63. data/spec/features/ci_spec.rb +17 -4
  64. data/spec/features/coverage_spec.rb +7 -10
  65. data/spec/features/database_container_spec.rb +1 -1
  66. data/spec/features/database_spec.rb +1 -1
  67. data/spec/features/draper_spec.rb +1 -1
  68. data/spec/features/environment_variables_spec.rb +28 -0
  69. data/spec/features/error_reporting_spec.rb +2 -2
  70. data/spec/features/file_storage_spec.rb +4 -4
  71. data/spec/features/google_tag_manager_spec.rb +1 -1
  72. data/spec/features/i18n_spec.rb +1 -1
  73. data/spec/features/mailer_spec.rb +1 -2
  74. data/spec/features/new_project_spec.rb +2 -8
  75. data/spec/features/node_spec.rb +1 -1
  76. data/spec/features/power_types_spec.rb +1 -1
  77. data/spec/features/pundit_spec.rb +1 -1
  78. data/spec/features/redis_spec.rb +43 -0
  79. data/spec/features/schedule_spec.rb +1 -1
  80. data/spec/features/testing_spec.rb +0 -1
  81. data/spec/features/vue_admin_spec.rb +1 -1
  82. data/spec/front_end_vite_spec.rb +79 -0
  83. data/spec/support/potassium_test_helpers.rb +0 -6
  84. metadata +36 -19
  85. data/lib/potassium/assets/app/javascript/api/index.ts +0 -55
  86. data/lib/potassium/assets/config/webpack/rules/css.js +0 -5
  87. data/lib/potassium/assets/config/webpack/rules/index.js +0 -11
  88. data/lib/potassium/assets/config/webpack/rules/jquery.js +0 -11
  89. data/lib/potassium/assets/config/webpack/rules/typescript.js +0 -32
  90. data/lib/potassium/assets/config/webpack/rules/vue.js +0 -19
  91. data/lib/potassium/assets/config/webpack/webpack.config.js +0 -4
  92. data/lib/potassium/recipes/front_end.rb +0 -270
  93. data/spec/features/front_end_spec.rb +0 -76
  94. /data/lib/potassium/assets/app/{javascript → frontend}/components/app.spec.ts +0 -0
  95. /data/lib/potassium/assets/app/{javascript → frontend}/components/app.vue +0 -0
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe 'EnvironmentVariables' do
4
+ let(:environment_variables) { IO.read("#{project_path}/lib/environment_variables.rb") }
5
+
6
+ before :all do
7
+ drop_dummy_database
8
+ remove_project_directory
9
+ create_dummy_project
10
+ end
11
+
12
+ it 'creates a .env.test file' do
13
+ expect(File.exists?("#{project_path}/.env.test")).to eq(true)
14
+ end
15
+
16
+ it 'creates an EnvironmentVariables module with a constant and its method' do
17
+ expect(environment_variables).to include(
18
+ 'module EnvironmentVariables',
19
+ "APPLICATION_HOST = ENV.fetch('APPLICATION_HOST')",
20
+ 'def application_host'
21
+ )
22
+ end
23
+
24
+ it 'requires module in application configuration' do
25
+ expect(File.read("#{project_path}/config/application.rb"))
26
+ .to include("require Rails.root.join('lib/environment_variables.rb')")
27
+ end
28
+ end
@@ -10,13 +10,13 @@ RSpec.describe "Error Reporting" do
10
10
  it "adds the Sentry gem to Gemfile" do
11
11
  gemfile_content = IO.read("#{project_path}/Gemfile")
12
12
 
13
- expect(gemfile_content).to include("gem 'sentry-raven'")
13
+ expect(gemfile_content).to include("sentry-rails")
14
14
  end
15
15
 
16
16
  it "creates the initializer" do
17
17
  initializer_content = IO.read("#{project_path}/config/initializers/sentry.rb")
18
18
 
19
- expect(initializer_content).to include("Raven.configure")
19
+ expect(initializer_content).to include("Sentry.init")
20
20
  end
21
21
 
22
22
  it "adds the environment variable to .env.development" do
@@ -10,7 +10,7 @@ RSpec.describe "File Storage" do
10
10
 
11
11
  it "adds the aws-sdk-s3 gem to Gemfile" do
12
12
  gemfile_content = IO.read("#{project_path}/Gemfile")
13
- expect(gemfile_content).to include("gem 'aws-sdk-s3'")
13
+ expect(gemfile_content).to include("aws-sdk-s3")
14
14
  end
15
15
 
16
16
  it "customizes config file" do
@@ -43,9 +43,9 @@ RSpec.describe "File Storage" do
43
43
  shared_examples 'common shrine setup' do
44
44
  it "adds the aws-sdk-s3, shrine and marcel gems to Gemfile" do
45
45
  gemfile_content = IO.read("#{project_path}/Gemfile")
46
- expect(gemfile_content).to include("gem 'aws-sdk-s3'")
47
- expect(gemfile_content).to include("gem 'shrine'")
48
- expect(gemfile_content).to include("gem 'marcel'")
46
+ expect(gemfile_content).to include("aws-sdk-s3")
47
+ expect(gemfile_content).to include("shrine")
48
+ expect(gemfile_content).to include("marcel")
49
49
  end
50
50
 
51
51
  it "adds brief to README file" do
@@ -31,6 +31,6 @@ RSpec.describe "Google Tag Manager" do
31
31
 
32
32
  it 'add content security policy' do
33
33
  expect(content_security_policy_file)
34
- .to include("\nRails.application.config.content_security_policy do |policy|")
34
+ .to include("https://developers.google.com/tag-manager/web/csp")
35
35
  end
36
36
  end
@@ -10,7 +10,7 @@ RSpec.describe "I18n" do
10
10
  it "adds the Clockwork gem to Gemfile" do
11
11
  content = IO.read("#{project_path}/Gemfile")
12
12
 
13
- expect(content).to include("gem 'rails-i18n'")
13
+ expect(content).to include("rails-i18n")
14
14
  end
15
15
 
16
16
  it "configures application.rb" do
@@ -1,4 +1,3 @@
1
- # rubocop:disable Rspec/MultipleMemoizedHelpers
2
1
  require "spec_helper"
3
2
 
4
3
  RSpec.describe "Mailer" do
@@ -18,7 +17,7 @@ RSpec.describe "Mailer" do
18
17
  end
19
18
  let(:mailer_config_text) do
20
19
  <<~RUBY
21
- require Rails.root.join("config", "mailer")
20
+ require Rails.root.join("config/mailer")
22
21
  RUBY
23
22
  end
24
23
 
@@ -9,21 +9,15 @@ RSpec.describe "A new project" do
9
9
  end
10
10
 
11
11
  it "is correctly bundled" do
12
- expect { on_project { `bundle exec rails -v` } }.to_not output.to_stderr
12
+ expect { on_project { `bundle exec rails -v` } }.not_to output.to_stderr
13
13
  end
14
14
 
15
- # it "is a valid rubocop project" do
16
- # on_project do
17
- # expect(run_rubocop).to eq(true)
18
- # end
19
- # end
20
-
21
15
  it "configures postgresql" do
22
16
  database_config_file = IO.read("#{project_path}/config/database.yml")
23
17
  gemfile = IO.read("#{project_path}/Gemfile")
24
18
 
25
19
  expect(database_config_file).to include(%{adapter: postgresql})
26
- expect(gemfile).to include %{gem 'pg'}
20
+ expect(gemfile).to include %{pg}
27
21
  end
28
22
 
29
23
  it "configures the correct ruby version" do
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe "Node" do
4
- let(:version) { "14" }
4
+ let(:version) { Potassium::NODE_VERSION }
5
5
 
6
6
  before(:all) do
7
7
  drop_dummy_database
@@ -9,7 +9,7 @@ RSpec.describe "PowerTypes" do
9
9
 
10
10
  it "adds the PowerTypes gem to Gemfile" do
11
11
  gemfile_content = IO.read("#{project_path}/Gemfile")
12
- expect(gemfile_content).to include("gem 'power-types'")
12
+ expect(gemfile_content).to include("power-types")
13
13
  end
14
14
 
15
15
  it "adds the PowerTypes brief to README file" do
@@ -10,7 +10,7 @@ RSpec.describe "Pundit" do
10
10
  it "adds the Pundit gem to Gemfile" do
11
11
  content = IO.read("#{project_path}/Gemfile")
12
12
 
13
- expect(content).to include("gem 'pundit'")
13
+ expect(content).to include("pundit")
14
14
  end
15
15
 
16
16
  it "setup active admin" do
@@ -0,0 +1,43 @@
1
+ require "spec_helper"
2
+ require 'yaml'
3
+
4
+ RSpec.describe "RedisProcessor" do
5
+ before :all do
6
+ drop_dummy_database
7
+ remove_project_directory
8
+ create_dummy_project("heroku" => true)
9
+ end
10
+
11
+ context "when installed" do
12
+ it "adds redis-actionpack gem to Gemfile" do
13
+ gemfile_content = IO.read("#{project_path}/Gemfile")
14
+ expect(gemfile_content).to include("redis-actionpack")
15
+ end
16
+
17
+ it "adds ENV vars" do
18
+ content = IO.read("#{project_path}/.env.development")
19
+ expect(content).to include('REDIS_HOST=127.0.0.1')
20
+ expect(content).to include(
21
+ 'REDIS_PORT=COMMAND_EXPAND(make services-port SERVICE=redis PORT=6379)'
22
+ )
23
+ expect(content).to include('REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}/1')
24
+ end
25
+
26
+ it "adds redis.yml file" do
27
+ content = IO.read("#{project_path}/config/redis.yml")
28
+ expect(content).to include("REDIS_URL")
29
+ end
30
+
31
+ it 'adds redis to docker-compose' do
32
+ compose_file = IO.read("#{project_path}/docker-compose.yml")
33
+ compose_content = YAML.safe_load(compose_file, symbolize_names: true)
34
+
35
+ expect(compose_content[:services]).to include(:redis)
36
+ end
37
+
38
+ it 'copies session store config' do
39
+ content = IO.read("#{project_path}/config/initializers/session_store.rb")
40
+ expect(content).to include("RedisClient::Config")
41
+ end
42
+ end
43
+ end
@@ -13,7 +13,7 @@ RSpec.describe "schedule" do
13
13
 
14
14
  it "adds the sidekiq-scheduler gem to Gemfile" do
15
15
  gemfile_content = IO.read("#{project_path}/Gemfile")
16
- expect(gemfile_content).to include("gem 'sidekiq-scheduler'")
16
+ expect(gemfile_content).to include("sidekiq-scheduler")
17
17
  end
18
18
 
19
19
  it "adds schedule section to sidekiq config" do
@@ -31,7 +31,6 @@ RSpec.describe "Testing" do
31
31
  create_dummy_project(devise: true)
32
32
  end
33
33
 
34
- it { expect(gemfile_content).to include("gem 'rspec-rails'") }
35
34
  it { expect(gemfile_content).to include('rspec-rails') }
36
35
  it { expect(gemfile_content).to include('factory_bot_rails') }
37
36
  it { expect(gemfile_content).to include('faker') }
@@ -22,7 +22,7 @@ RSpec.describe "VueAdmin" do
22
22
  end
23
23
 
24
24
  it "adds admin_component to vue components" do
25
- application_pack_path = "#{project_path}/app/javascript/components/admin-component.vue"
25
+ application_pack_path = "#{project_path}/app/frontend/components/admin-component.vue"
26
26
  expect(File).to be_file(application_pack_path)
27
27
  end
28
28
 
@@ -0,0 +1,79 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe 'Front end' do
4
+ before :all do
5
+ drop_dummy_database
6
+ remove_project_directory
7
+ create_dummy_project('front_end_vite' => true)
8
+ end
9
+
10
+ def read_file(file_path)
11
+ IO.read("#{project_path}/#{file_path}")
12
+ end
13
+
14
+ let(:gemfile) { read_file('Gemfile') }
15
+ let(:application_file) { read_file('config/application.rb') }
16
+ let(:node_modules_file) { read_file('package.json') }
17
+ let(:application_js_file) { read_file('app/frontend/entrypoints/application.js') }
18
+ let(:layout_file) { read_file('app/views/layouts/application.html.erb') }
19
+ let(:csp_initializer) { read_file('config/initializers/content_security_policy.rb') }
20
+ let(:application_css_file) { read_file('app/frontend/css/application.css') }
21
+ let(:tailwind_config_file) { read_file('tailwind.config.js') }
22
+ let(:rails_css_file) { read_file('app/assets/stylesheets/application.css') }
23
+ let(:api_index_file) { read_file('app/frontend/api/index.ts') }
24
+ let(:case_converter_file) { read_file('app/frontend/utils/case-converter.ts') }
25
+ let(:csrf_token_file) { read_file('app/frontend/utils/csrf-token.ts') }
26
+ let(:mock_example_file) { read_file('app/frontend/api/__mocks__/index.mock.ts') }
27
+
28
+ it 'creates a project with vite' do
29
+ expect(gemfile).to include('vite_rails')
30
+ expect(layout_file.scan('vite_client_tag').length).to eq(1)
31
+ expect(layout_file.scan('vite_javascript_tag').length).to eq(2)
32
+ end
33
+
34
+ it 'creates a project with vue as frontend framework' do
35
+ expect(node_modules_file).to include('"vue"')
36
+ expect(application_js_file).to include('vue')
37
+ expect(application_js_file).to include("app.mount('#vue-app')")
38
+ expect(layout_file).to include('id="vue-app"')
39
+ end
40
+
41
+ it 'creates a vue project with client css' do
42
+ expect(application_js_file).to include("import '../css/application.css';")
43
+ end
44
+
45
+ it 'creates a vue project with tailwindcss' do
46
+ expect(node_modules_file).to include('"tailwindcss"')
47
+ expect(application_css_file).to include(
48
+ '@tailwind base;',
49
+ '@tailwind components;'
50
+ )
51
+ expect(tailwind_config_file).to include('module.exports')
52
+ expect(File.exists?(File.join(project_path, 'tailwind.config.js'))).to be(true)
53
+ expect(File.exists?(File.join(project_path, 'postcss.config.js'))).to be(true)
54
+ end
55
+
56
+ it 'updates suggested csp policy' do
57
+ expect(csp_initializer).to include('ViteRuby.config.host_with_port')
58
+ end
59
+
60
+ it 'includes correct packages for basic api client' do
61
+ expect(node_modules_file).to include('"axios"')
62
+ expect(node_modules_file).to include('"humps"')
63
+ end
64
+
65
+ it 'includes api client files' do
66
+ expect(api_index_file).to include('axios.create')
67
+ expect(case_converter_file).to include('humps')
68
+ expect(csrf_token_file).to include('meta[name=csrf-token]')
69
+ end
70
+
71
+ it 'includes mock example' do
72
+ expect(mock_example_file).to include('vi.fn()')
73
+ end
74
+
75
+ it 'includes the dotenv monkeypatch' do
76
+ expect(application_file).to include("require_relative '../lib/dotenv_monkeypatch'")
77
+ expect(File.exists?(File.join(project_path, 'lib/dotenv_monkeypatch.rb'))).to be(true)
78
+ end
79
+ end
@@ -97,10 +97,4 @@ module PotassiumTestHelpers
97
97
  def run_command(command)
98
98
  system(command)
99
99
  end
100
-
101
- def run_rubocop
102
- options, paths = RuboCop::Options.new.parse(["."])
103
- runner = RuboCop::Runner.new(options, RuboCop::ConfigStore.new)
104
- runner.run(paths)
105
- end
106
100
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: potassium
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.7.0
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - juliogarciag
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-03 00:00:00.000000000 Z
11
+ date: 2023-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -212,14 +212,14 @@ dependencies:
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: 6.1.4.4
215
+ version: 7.0.4.2
216
216
  type: :runtime
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: 6.1.4.4
222
+ version: 7.0.4.2
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: semantic
225
225
  requirement: !ruby/object:Gem::Requirement
@@ -266,6 +266,7 @@ files:
266
266
  - lib/potassium/assets/.dockerignore
267
267
  - lib/potassium/assets/.editorconfig
268
268
  - lib/potassium/assets/.env.development.erb
269
+ - lib/potassium/assets/.env.test.erb
269
270
  - lib/potassium/assets/.eslintrc.json
270
271
  - lib/potassium/assets/.github/pull_request_template.md
271
272
  - lib/potassium/assets/.pryrc
@@ -281,11 +282,18 @@ files:
281
282
  - lib/potassium/assets/active_admin/policies/comment_policy.rb
282
283
  - lib/potassium/assets/active_admin/policies/default_policy.rb
283
284
  - lib/potassium/assets/active_admin/policies/page_policy.rb
284
- - lib/potassium/assets/app/javascript/api/index.ts
285
- - lib/potassium/assets/app/javascript/components/app.spec.ts
286
- - lib/potassium/assets/app/javascript/components/app.vue
287
- - lib/potassium/assets/app/javascript/types/vue.d.ts
288
- - lib/potassium/assets/app/javascript/utils/case-converter.ts
285
+ - lib/potassium/assets/app/frontend/active_admin/jquery.js
286
+ - lib/potassium/assets/app/frontend/api/__mocks__/index.mock.ts
287
+ - lib/potassium/assets/app/frontend/api/index.ts
288
+ - lib/potassium/assets/app/frontend/components/app.spec.ts
289
+ - lib/potassium/assets/app/frontend/components/app.vue
290
+ - lib/potassium/assets/app/frontend/css/application.css
291
+ - lib/potassium/assets/app/frontend/entrypoints/active_admin.js
292
+ - lib/potassium/assets/app/frontend/entrypoints/active_admin.scss
293
+ - lib/potassium/assets/app/frontend/entrypoints/application.js
294
+ - lib/potassium/assets/app/frontend/types/vue.d.ts
295
+ - lib/potassium/assets/app/frontend/utils/case-converter.ts
296
+ - lib/potassium/assets/app/frontend/utils/csrf-token.ts
289
297
  - lib/potassium/assets/app/jobs/shrine_promote_job.rb
290
298
  - lib/potassium/assets/app/mailers/application_mailer.rb
291
299
  - lib/potassium/assets/app/mailers/example_mailer.rb
@@ -304,6 +312,7 @@ files:
304
312
  - lib/potassium/assets/bin/update.erb
305
313
  - lib/potassium/assets/config/database_mysql.yml.erb
306
314
  - lib/potassium/assets/config/database_postgresql.yml.erb
315
+ - lib/potassium/assets/config/initializers/session_store.rb
307
316
  - lib/potassium/assets/config/initializers/shrine/plugins/image_handling_utilities.rb
308
317
  - lib/potassium/assets/config/mailer.rb.erb
309
318
  - lib/potassium/assets/config/puma.rb
@@ -311,14 +320,10 @@ files:
311
320
  - lib/potassium/assets/config/sentry.rb.erb
312
321
  - lib/potassium/assets/config/shrine.rb
313
322
  - lib/potassium/assets/config/storage.yml
314
- - lib/potassium/assets/config/webpack/rules/css.js
315
- - lib/potassium/assets/config/webpack/rules/index.js
316
- - lib/potassium/assets/config/webpack/rules/jquery.js
317
- - lib/potassium/assets/config/webpack/rules/typescript.js
318
- - lib/potassium/assets/config/webpack/rules/vue.js
319
- - lib/potassium/assets/config/webpack/webpack.config.js
320
323
  - lib/potassium/assets/docker-compose.yml
321
324
  - lib/potassium/assets/es-CL.yml
325
+ - lib/potassium/assets/lib/dotenv_monkeypatch.rb
326
+ - lib/potassium/assets/lib/environment_variables.rb
322
327
  - lib/potassium/assets/lib/tasks/auto_annotate_models.rake
323
328
  - lib/potassium/assets/package.json
324
329
  - lib/potassium/assets/public/mails/platanus-logo.png
@@ -329,6 +334,7 @@ files:
329
334
  - lib/potassium/assets/seeds/seeds.rb
330
335
  - lib/potassium/assets/sidekiq.rb.erb
331
336
  - lib/potassium/assets/sidekiq.yml
337
+ - lib/potassium/assets/tailwind.config.js
332
338
  - lib/potassium/assets/testing/.rspec
333
339
  - lib/potassium/assets/testing/devise_config.rb
334
340
  - lib/potassium/assets/testing/factory_bot_config.rb
@@ -339,7 +345,9 @@ files:
339
345
  - lib/potassium/assets/testing/shoulda_matchers_config.rb
340
346
  - lib/potassium/assets/testing/simplecov_config.rb
341
347
  - lib/potassium/assets/testing/system_tests_config.rb
348
+ - lib/potassium/assets/tsconfig.config.json
342
349
  - lib/potassium/assets/tsconfig.json
350
+ - lib/potassium/assets/vite.config.ts
343
351
  - lib/potassium/cli.rb
344
352
  - lib/potassium/cli/commands/create.rb
345
353
  - lib/potassium/cli/commands/install.rb
@@ -366,6 +374,7 @@ files:
366
374
  - lib/potassium/recipes/api.rb
367
375
  - lib/potassium/recipes/background_processor.rb
368
376
  - lib/potassium/recipes/better_errors.rb
377
+ - lib/potassium/recipes/bullet.rb
369
378
  - lib/potassium/recipes/ci.rb
370
379
  - lib/potassium/recipes/cleanup.rb
371
380
  - lib/potassium/recipes/coverage.rb
@@ -376,9 +385,10 @@ files:
376
385
  - lib/potassium/recipes/draper.rb
377
386
  - lib/potassium/recipes/editorconfig.rb
378
387
  - lib/potassium/recipes/env.rb
388
+ - lib/potassium/recipes/environment_variables.rb
379
389
  - lib/potassium/recipes/error_reporting.rb
380
390
  - lib/potassium/recipes/file_storage.rb
381
- - lib/potassium/recipes/front_end.rb
391
+ - lib/potassium/recipes/front_end_vite.rb
382
392
  - lib/potassium/recipes/github.rb
383
393
  - lib/potassium/recipes/google_tag_manager.rb
384
394
  - lib/potassium/recipes/heroku.rb
@@ -395,6 +405,7 @@ files:
395
405
  - lib/potassium/recipes/rack_cors.rb
396
406
  - lib/potassium/recipes/rails.rb
397
407
  - lib/potassium/recipes/readme.rb
408
+ - lib/potassium/recipes/redis.rb
398
409
  - lib/potassium/recipes/ruby.rb
399
410
  - lib/potassium/recipes/schedule.rb
400
411
  - lib/potassium/recipes/script.rb
@@ -417,15 +428,16 @@ files:
417
428
  - spec/fakes/bin/hub
418
429
  - spec/features/api_spec.rb
419
430
  - spec/features/background_processor_spec.rb
431
+ - spec/features/bullet_spec.rb
420
432
  - spec/features/ci_spec.rb
421
433
  - spec/features/coverage_spec.rb
422
434
  - spec/features/data_migrate_spec.rb
423
435
  - spec/features/database_container_spec.rb
424
436
  - spec/features/database_spec.rb
425
437
  - spec/features/draper_spec.rb
438
+ - spec/features/environment_variables_spec.rb
426
439
  - spec/features/error_reporting_spec.rb
427
440
  - spec/features/file_storage_spec.rb
428
- - spec/features/front_end_spec.rb
429
441
  - spec/features/github_spec.rb
430
442
  - spec/features/google_tag_manager_spec.rb
431
443
  - spec/features/heroku_spec.rb
@@ -436,9 +448,11 @@ files:
436
448
  - spec/features/node_spec.rb
437
449
  - spec/features/power_types_spec.rb
438
450
  - spec/features/pundit_spec.rb
451
+ - spec/features/redis_spec.rb
439
452
  - spec/features/schedule_spec.rb
440
453
  - spec/features/testing_spec.rb
441
454
  - spec/features/vue_admin_spec.rb
455
+ - spec/front_end_vite_spec.rb
442
456
  - spec/spec_helper.rb
443
457
  - spec/support/fake_github.rb
444
458
  - spec/support/fake_heroku.rb
@@ -465,7 +479,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
465
479
  - !ruby/object:Gem::Version
466
480
  version: '0'
467
481
  requirements: []
468
- rubygems_version: 3.2.22
482
+ rubygems_version: 3.4.10
469
483
  signing_key:
470
484
  specification_version: 4
471
485
  summary: An application generator from Platanus
@@ -474,15 +488,16 @@ test_files:
474
488
  - spec/fakes/bin/hub
475
489
  - spec/features/api_spec.rb
476
490
  - spec/features/background_processor_spec.rb
491
+ - spec/features/bullet_spec.rb
477
492
  - spec/features/ci_spec.rb
478
493
  - spec/features/coverage_spec.rb
479
494
  - spec/features/data_migrate_spec.rb
480
495
  - spec/features/database_container_spec.rb
481
496
  - spec/features/database_spec.rb
482
497
  - spec/features/draper_spec.rb
498
+ - spec/features/environment_variables_spec.rb
483
499
  - spec/features/error_reporting_spec.rb
484
500
  - spec/features/file_storage_spec.rb
485
- - spec/features/front_end_spec.rb
486
501
  - spec/features/github_spec.rb
487
502
  - spec/features/google_tag_manager_spec.rb
488
503
  - spec/features/heroku_spec.rb
@@ -493,9 +508,11 @@ test_files:
493
508
  - spec/features/node_spec.rb
494
509
  - spec/features/power_types_spec.rb
495
510
  - spec/features/pundit_spec.rb
511
+ - spec/features/redis_spec.rb
496
512
  - spec/features/schedule_spec.rb
497
513
  - spec/features/testing_spec.rb
498
514
  - spec/features/vue_admin_spec.rb
515
+ - spec/front_end_vite_spec.rb
499
516
  - spec/spec_helper.rb
500
517
  - spec/support/fake_github.rb
501
518
  - spec/support/fake_heroku.rb
@@ -1,55 +0,0 @@
1
- import axios, { type AxiosRequestTransformer, type AxiosResponseTransformer } from 'axios';
2
- import convertKeys from '../utils/case-converter';
3
-
4
- const api = axios.create({
5
- transformRequest: [
6
- (data: any) => convertKeys(data, 'decamelize'),
7
- ...(axios.defaults.transformRequest as AxiosRequestTransformer[]),
8
- ],
9
- transformResponse: [
10
- ...(axios.defaults.transformResponse as AxiosResponseTransformer[]),
11
- (data: any) => convertKeys(data, 'camelize'),
12
- ],
13
- });
14
-
15
- export default api;
16
-
17
- /*
18
- // Example to use the api object in the path ´app/javascript/api/users.ts´
19
-
20
- import api from './index';
21
-
22
- export default {
23
- index() {
24
- const path = '/api/internal/users';
25
-
26
- return api({
27
- method: 'get',
28
- url: path,
29
- });
30
- },
31
- create(data: Partial<User>) {
32
- const path = '/api/internal/users';
33
-
34
- return api({
35
- method: 'post',
36
- url: path,
37
- data: {
38
- user: data,
39
- },
40
- });
41
- },
42
- update(data: Partial<User>) {
43
- const path = `/api/internal/users/${data.id}`;
44
-
45
- return api({
46
- method: 'put',
47
- url: path,
48
- data: {
49
- user: data,
50
- },
51
- });
52
- },
53
- };
54
-
55
- */
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- resolve: {
3
- extensions: ['.css', '.scss']
4
- }
5
- }
@@ -1,11 +0,0 @@
1
- const vueConfig = require('./vue');
2
- const cssConfig = require('./css');
3
- const jQueryConfig = require('./jquery');
4
- const typescriptConfig = require('./typescript');
5
-
6
- module.exports = {
7
- vueConfig,
8
- cssConfig,
9
- jQueryConfig,
10
- typescriptConfig,
11
- };
@@ -1,11 +0,0 @@
1
- const webpack = require('webpack');
2
-
3
- module.exports = {
4
- plugins: [
5
- new webpack.ProvidePlugin({
6
- $: 'jquery',
7
- jQuery: 'jquery',
8
- "window.jQuery":"jquery"
9
- })
10
- ],
11
- }
@@ -1,32 +0,0 @@
1
- const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
2
-
3
- module.exports = {
4
- module: {
5
- rules: [
6
- {
7
- test: /\.ts$/,
8
- loader: 'ts-loader',
9
- exclude: /node_modules/,
10
- options: {
11
- appendTsSuffixTo: [/\.vue$/],
12
- transpileOnly: true,
13
- },
14
- },
15
- ],
16
- },
17
- resolve: {
18
- extensions: ['.ts'],
19
- },
20
- plugins: [
21
- new ForkTsCheckerWebpackPlugin({
22
- typescript: {
23
- extensions: {
24
- vue: {
25
- enabled: true,
26
- compiler: '@vue/compiler-sfc',
27
- },
28
- },
29
- },
30
- }),
31
- ],
32
- };
@@ -1,19 +0,0 @@
1
- const { VueLoaderPlugin } = require('vue-loader')
2
-
3
- module.exports = {
4
- module: {
5
- rules: [
6
- {
7
- test: /\.vue$/,
8
- loader: 'vue-loader'
9
- }
10
- ]
11
- },
12
- plugins: [new VueLoaderPlugin()],
13
- resolve: {
14
- extensions: ['.vue'],
15
- alias: {
16
- 'vue$': 'vue/dist/vue.esm-bundler.js',
17
- }
18
- },
19
- }