plutonium 0.10.1 → 0.10.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -0
  3. data/app/assets/javascripts/turbo/index.js +1 -1
  4. data/app/views/application/_flash_alerts.html.erb +3 -0
  5. data/app/views/application/_flash_toasts.html.erb +2 -0
  6. data/app/views/application/_resource_header.html.erb +12 -12
  7. data/app/views/components/base.rb +1 -1
  8. data/app/views/layouts/resource.html copy.erb +2 -2
  9. data/app/views/layouts/resource.html.erb +3 -2
  10. data/app/views/layouts/rodauth.html.erb +13 -8
  11. data/app/views/resource/_nav_user.html.erb +1 -1
  12. data/app/views/resource/index.rabl +1 -1
  13. data/app/views/rodauth/add_recovery_codes.html.erb +8 -7
  14. data/app/views/rodauth/otp_auth.html.erb +1 -1
  15. data/app/views/rodauth/otp_setup.html.erb +10 -8
  16. data/brakeman.ignore +1 -1
  17. data/config/initializers/rabl.rb +2 -0
  18. data/css.manifest +1 -1
  19. data/js.manifest +2 -2
  20. data/lib/generators/pu/core/install/templates/config/initializers/plutonium.rb +0 -3
  21. data/lib/generators/pu/core/ruby/ruby_generator.rb +30 -0
  22. data/lib/generators/pu/core/ruby/templates/.keep +0 -0
  23. data/lib/generators/pu/docker/install/install_generator.rb +35 -0
  24. data/lib/generators/pu/docker/install/templates/.keep +0 -0
  25. data/lib/generators/pu/docker/install/templates/Dockerfile.dev.tt +30 -0
  26. data/lib/generators/pu/docker/install/templates/Dockerfile.tt +75 -0
  27. data/lib/generators/pu/docker/install/templates/bin/console +3 -0
  28. data/lib/generators/pu/docker/install/templates/bin/restart +3 -0
  29. data/lib/generators/pu/docker/install/templates/bin/shell +3 -0
  30. data/lib/generators/pu/docker/install/templates/docker-compose.yml +29 -0
  31. data/lib/generators/pu/gem/dotenv/dotenv_generator.rb +32 -0
  32. data/lib/generators/pu/gem/dotenv/templates/.env +6 -0
  33. data/lib/generators/pu/gem/dotenv/templates/.env.local +5 -0
  34. data/lib/generators/pu/gem/dotenv/templates/.env.local.template +5 -0
  35. data/lib/generators/pu/gem/dotenv/templates/.env.template +6 -0
  36. data/lib/generators/pu/gem/dotenv/templates/.keep +0 -0
  37. data/lib/generators/pu/gem/dotenv/templates/config/initializers/001_ensure_required_env.rb +15 -0
  38. data/lib/generators/pu/gem/redis/redis_generator.rb +22 -0
  39. data/lib/generators/pu/gem/redis/templates/.keep +0 -0
  40. data/lib/generators/pu/gen/pug/pug_generator.rb +6 -0
  41. data/lib/generators/pu/gen/pug/templates/pug.rb.tt +1 -1
  42. data/lib/generators/pu/lib/plutonium_generators/concerns/actions.rb +154 -32
  43. data/lib/generators/pu/lib/plutonium_generators/generator.rb +6 -6
  44. data/lib/generators/pu/lib/plutonium_generators/installer.rb +1 -1
  45. data/lib/generators/pu/pkg/app/templates/config/routes.rb.tt +3 -3
  46. data/lib/generators/pu/rodauth/account_generator.rb +10 -10
  47. data/lib/generators/pu/rodauth/install_generator.rb +9 -2
  48. data/lib/generators/pu/rodauth/migration/sequel/audit_logging.erb +2 -2
  49. data/lib/generators/pu/rodauth/migration_generator.rb +1 -1
  50. data/lib/generators/pu/rodauth/templates/app/{misc → rodauth}/account_rodauth_plugin.rb.tt +2 -2
  51. data/lib/generators/pu/rodauth/templates/app/{misc → rodauth}/rodauth_plugin.rb.tt +0 -3
  52. data/lib/generators/pu/rodauth/templates/db/migrate/install_rodauth.rb.tt +5 -0
  53. data/lib/generators/pu/service/postgres/postgres_generator.rb +61 -0
  54. data/lib/generators/pu/service/postgres/templates/.keep +0 -0
  55. data/lib/generators/pu/service/postgres/templates/bin/initdb.d/create-multiple-postgresql-databases.sh +22 -0
  56. data/lib/generators/pu/service/postgres/templates/database.yml.tt +93 -0
  57. data/lib/generators/pu/service/sidekiq/sidekiq_generator.rb +62 -0
  58. data/lib/generators/pu/service/sidekiq/templates/.keep +0 -0
  59. data/lib/generators/pu/service/sidekiq/templates/app/sidekiq/sidekiq_job.rb +5 -0
  60. data/lib/generators/pu/service/sidekiq/templates/config/initializers/sidekiq.rb +53 -0
  61. data/lib/generators/pu/service/sidekiq/templates/config/sidekiq.yml +6 -0
  62. data/lib/plutonium/config.rb +7 -13
  63. data/lib/plutonium/core/autodiscovery/input_discoverer.rb +1 -1
  64. data/lib/plutonium/core/autodiscovery/renderer_discoverer.rb +1 -1
  65. data/lib/plutonium/core/controllers/base.rb +13 -3
  66. data/lib/plutonium/core/controllers/entity_scoping.rb +3 -3
  67. data/lib/plutonium/core/controllers/queryable.rb +3 -1
  68. data/lib/plutonium/icons.rb +1 -1
  69. data/lib/plutonium/pkg/app.rb +6 -0
  70. data/lib/plutonium/railtie.rb +19 -0
  71. data/lib/plutonium/reloader.rb +99 -0
  72. data/lib/plutonium/resource/controller.rb +62 -22
  73. data/lib/plutonium/resource/policy.rb +56 -9
  74. data/lib/plutonium/resource/presenter.rb +44 -12
  75. data/lib/plutonium/resource/query_object.rb +186 -73
  76. data/lib/plutonium/resource/record.rb +213 -119
  77. data/lib/plutonium/rodauth/controller_methods.rb +7 -0
  78. data/lib/plutonium/version.rb +1 -1
  79. data/lib/plutonium.rb +54 -12
  80. data/lib/tasks/create_rodauth_admin.rake +16 -0
  81. data/package-lock.json +174 -0
  82. data/package.json +2 -0
  83. data/public/plutonium-assets/plutonium-app-6WILQCTT.js +39 -0
  84. data/public/plutonium-assets/plutonium-app-6WILQCTT.js.map +7 -0
  85. data/public/plutonium-assets/plutonium-logo-original.png +0 -0
  86. data/public/plutonium-assets/plutonium-logo-white.png +0 -0
  87. data/public/plutonium-assets/plutonium-logo.png +0 -0
  88. data/public/plutonium-assets/plutonium.2d4f0c333cd000051d3b.css +3424 -0
  89. data/public/plutonium-assets/plutonium.8bee7a8482988b0360e3.css +3420 -0
  90. data/public/plutonium-assets/plutonium.ico +0 -0
  91. metadata +44 -7
  92. data/lib/plutonium/reactor/core.rb +0 -78
  93. data/public/plutonium-assets/logo.png +0 -0
  94. /data/lib/generators/pu/rodauth/templates/app/{misc → rodauth}/rodauth_app.rb.tt +0 -0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plutonium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-12 00:00:00.000000000 Z
11
+ date: 2024-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -861,6 +861,25 @@ files:
861
861
  - lib/generators/pu/core/install/templates/app/query_objects/resource_query_object.rb.tt
862
862
  - lib/generators/pu/core/install/templates/config/initializers/plutonium.rb
863
863
  - lib/generators/pu/core/install/templates/config/packages.rb
864
+ - lib/generators/pu/core/ruby/ruby_generator.rb
865
+ - lib/generators/pu/core/ruby/templates/.keep
866
+ - lib/generators/pu/docker/install/install_generator.rb
867
+ - lib/generators/pu/docker/install/templates/.keep
868
+ - lib/generators/pu/docker/install/templates/Dockerfile.dev.tt
869
+ - lib/generators/pu/docker/install/templates/Dockerfile.tt
870
+ - lib/generators/pu/docker/install/templates/bin/console
871
+ - lib/generators/pu/docker/install/templates/bin/restart
872
+ - lib/generators/pu/docker/install/templates/bin/shell
873
+ - lib/generators/pu/docker/install/templates/docker-compose.yml
874
+ - lib/generators/pu/gem/dotenv/dotenv_generator.rb
875
+ - lib/generators/pu/gem/dotenv/templates/.env
876
+ - lib/generators/pu/gem/dotenv/templates/.env.local
877
+ - lib/generators/pu/gem/dotenv/templates/.env.local.template
878
+ - lib/generators/pu/gem/dotenv/templates/.env.template
879
+ - lib/generators/pu/gem/dotenv/templates/.keep
880
+ - lib/generators/pu/gem/dotenv/templates/config/initializers/001_ensure_required_env.rb
881
+ - lib/generators/pu/gem/redis/redis_generator.rb
882
+ - lib/generators/pu/gem/redis/templates/.keep
864
883
  - lib/generators/pu/gen/component/component_generator.rb
865
884
  - lib/generators/pu/gen/component/templates/component.html.erb.tt
866
885
  - lib/generators/pu/gen/component/templates/component.rb.tt
@@ -962,10 +981,10 @@ files:
962
981
  - lib/generators/pu/rodauth/templates/app/controllers/rodauth_controller.rb.tt
963
982
  - lib/generators/pu/rodauth/templates/app/mailers/account_mailer.rb.tt
964
983
  - lib/generators/pu/rodauth/templates/app/mailers/rodauth_mailer.rb.tt
965
- - lib/generators/pu/rodauth/templates/app/misc/account_rodauth_plugin.rb.tt
966
- - lib/generators/pu/rodauth/templates/app/misc/rodauth_app.rb.tt
967
- - lib/generators/pu/rodauth/templates/app/misc/rodauth_plugin.rb.tt
968
984
  - lib/generators/pu/rodauth/templates/app/models/account.rb.tt
985
+ - lib/generators/pu/rodauth/templates/app/rodauth/account_rodauth_plugin.rb.tt
986
+ - lib/generators/pu/rodauth/templates/app/rodauth/rodauth_app.rb.tt
987
+ - lib/generators/pu/rodauth/templates/app/rodauth/rodauth_plugin.rb.tt
969
988
  - lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/email_auth.text.erb
970
989
  - lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/password_changed.text.erb
971
990
  - lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/reset_password.text.erb
@@ -975,7 +994,17 @@ files:
975
994
  - lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/verify_login_change.text.erb
976
995
  - lib/generators/pu/rodauth/templates/config/initializers/rodauth.rb.tt
977
996
  - lib/generators/pu/rodauth/templates/db/migrate/create_rodauth.rb.tt
997
+ - lib/generators/pu/rodauth/templates/db/migrate/install_rodauth.rb.tt
978
998
  - lib/generators/pu/rodauth/views_generator.rb
999
+ - lib/generators/pu/service/postgres/postgres_generator.rb
1000
+ - lib/generators/pu/service/postgres/templates/.keep
1001
+ - lib/generators/pu/service/postgres/templates/bin/initdb.d/create-multiple-postgresql-databases.sh
1002
+ - lib/generators/pu/service/postgres/templates/database.yml.tt
1003
+ - lib/generators/pu/service/sidekiq/sidekiq_generator.rb
1004
+ - lib/generators/pu/service/sidekiq/templates/.keep
1005
+ - lib/generators/pu/service/sidekiq/templates/app/sidekiq/sidekiq_job.rb
1006
+ - lib/generators/pu/service/sidekiq/templates/config/initializers/sidekiq.rb
1007
+ - lib/generators/pu/service/sidekiq/templates/config/sidekiq.yml
979
1008
  - lib/plutonium.rb
980
1009
  - lib/plutonium/application/controller.rb
981
1010
  - lib/plutonium/auth.rb
@@ -1050,8 +1079,8 @@ files:
1050
1079
  - lib/plutonium/preserved__/field.rb.bk
1051
1080
  - lib/plutonium/preserved__/input.rb.bk
1052
1081
  - lib/plutonium/railtie.rb
1053
- - lib/plutonium/reactor/core.rb
1054
1082
  - lib/plutonium/refinements/parameter_refinements.rb
1083
+ - lib/plutonium/reloader.rb
1055
1084
  - lib/plutonium/resource/context.rb
1056
1085
  - lib/plutonium/resource/controller.rb
1057
1086
  - lib/plutonium/resource/interaction.rb
@@ -1064,6 +1093,7 @@ files:
1064
1093
  - lib/plutonium/simple_form/attachment_component.rb
1065
1094
  - lib/plutonium/simple_form/input_group_component.rb
1066
1095
  - lib/plutonium/version.rb
1096
+ - lib/tasks/create_rodauth_admin.rake
1067
1097
  - package-lock.json
1068
1098
  - package.json
1069
1099
  - postcss.config.js
@@ -1072,10 +1102,17 @@ files:
1072
1102
  - public/plutonium-assets/application.js
1073
1103
  - public/plutonium-assets/fonts/bootstrap-icons.woff
1074
1104
  - public/plutonium-assets/fonts/bootstrap-icons.woff2
1075
- - public/plutonium-assets/logo.png
1076
1105
  - public/plutonium-assets/plutonium-app-36KN5FVJ.js
1077
1106
  - public/plutonium-assets/plutonium-app-36KN5FVJ.js.map
1107
+ - public/plutonium-assets/plutonium-app-6WILQCTT.js
1108
+ - public/plutonium-assets/plutonium-app-6WILQCTT.js.map
1109
+ - public/plutonium-assets/plutonium-logo-original.png
1110
+ - public/plutonium-assets/plutonium-logo-white.png
1111
+ - public/plutonium-assets/plutonium-logo.png
1112
+ - public/plutonium-assets/plutonium.2d4f0c333cd000051d3b.css
1078
1113
  - public/plutonium-assets/plutonium.50232e35b5495f5ad90d.css
1114
+ - public/plutonium-assets/plutonium.8bee7a8482988b0360e3.css
1115
+ - public/plutonium-assets/plutonium.ico
1079
1116
  - sig/plutonium.rbs
1080
1117
  - tailwind.config.js
1081
1118
  - templates/base.rb
@@ -1,78 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
- # This is a glorified initializer
3
-
4
- module Plutonium
5
- module Reactor
6
- class Core
7
- def self.achieve_criticality!
8
- # Eager load the framework
9
- # Plutonium::ZEITWERK_LOADER.eager_load
10
-
11
- # Load view components
12
- load Plutonium.root.join("app", "views", "components", "base.rb")
13
-
14
- # Load initializers
15
- Dir.glob(Plutonium.root.join("config", "initializers", "**", "*.rb")) { |file| load file }
16
-
17
- start_reloader!
18
- end
19
-
20
- def self.start_reloader!
21
- # TODO: see which parts of this can be moved into zeitwerk
22
- return unless Plutonium::Config.enable_hotreload
23
-
24
- # GLORIOUS hotreload!!!
25
- @listener ||= begin
26
- require "listen"
27
-
28
- reload_paths = []
29
-
30
- if Plutonium::Config.development
31
- reload_paths << Plutonium.lib_root.to_s
32
- reload_paths << Plutonium.root.join("app", "views", "components").to_s
33
- reload_paths << Plutonium.root.join("config", "initializers").to_s
34
- end
35
-
36
- # we want to always watch packages for changes to engines
37
- packages_dir = Rails.root.join("packages/").to_s
38
- reload_paths << packages_dir if File.directory?(packages_dir)
39
-
40
- listener = Listen.to(*reload_paths, only: /\.rb$/) do |modified, added, removed|
41
- (modified + added).each do |file|
42
- next if file == __FILE__ # reloading this file does nothing
43
-
44
- if file.starts_with?(packages_dir)
45
- # if package file was added, ignore it
46
- # otherwise rails gets mad at us since engines cannot be loaded after initial boot
47
- # TODO: check if guard has apis to control reloading dynamically
48
- next if added.include? file
49
-
50
- case File.basename(file)
51
- when "engine.rb"
52
- # rails engines are loaded once,
53
- # so in order to detect resource registration changes, we need to handle reloads ourselves
54
-
55
- # load the engine and reload routes to pick up any registration changes
56
- Rails.logger.debug "\nplutonium: reloaded #{file}\n"
57
- load file
58
- Rails.application.reload_routes!
59
- else
60
- # non engine package files are reloaded by rails automatically
61
- end
62
- else
63
- Plutonium::ZEITWERK_LOADER.reload
64
- load Plutonium.root.join("app", "views", "components", "base.rb")
65
- load file # this just a lazy way to ensure we load files that do not contain constants like initializers
66
- end
67
- Rails.logger.debug "\n\nplutonium: reload #{file}\n"
68
- rescue => e
69
- Rails.logger.error "\n\nplutonium: reload failed #{file}\n\n#{e}\n"
70
- end
71
- end
72
- listener.start
73
- listener
74
- end
75
- end
76
- end
77
- end
78
- end
Binary file