plutonium 0.18.7 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3bc75122683cce879de19c0ba79d14c3f47529c9ae8184f6cc1ef5e0f7ac533
4
- data.tar.gz: 3af762cf2fd2ad8543d4bf3030ccaf5280549fc74491fc4427edf8cf258ed514
3
+ metadata.gz: e258fecf4bb703998367bdb017632e7d574353b0ea17ab1095f2a51e48830e5f
4
+ data.tar.gz: 5e9204d931880a93b5c1431b899170f5ad84b15bd98ecff6159e1dba804b181a
5
5
  SHA512:
6
- metadata.gz: 30c19b4400f82a0480d59fce7f45c47fbc021d61c7e1d67c9649d5bc445c335a112af0b0f83080a33bbdbf2a128bce6ea4470dda1ed9150a332202535d167b4c
7
- data.tar.gz: d7aff561f705bd229113bada8b189b4000a483cc258e7f085bf4a016e7c48fd763f6e418ad06889491598ccfc449d818157634f360c064bf52a764d28fb4f3d0
6
+ metadata.gz: 89092ba600c685b58f1b8138c7cef005b12ff614adc1cac75c2173e8e808bdc033140f992331725d31263a4e26e432bc6d1a3fc3a6a71deae1b573ce17b2bf69
7
+ data.tar.gz: 2e7db8b31e25b248e92113653231db0b5d4dc459ec3b9bd51ef2d43ea282a94ab909a11fc66e264eea0b6ed532dd9de9c74e8674f0dbaa16b82db70ccf60fad4
@@ -12,7 +12,7 @@
12
12
  ```
13
13
  - Install useful gems
14
14
  ```bash
15
- rails g pu:gem:annotate
15
+ rails g pu:gem:annotated
16
16
  ```
17
17
  - Install rodauth
18
18
  ```bash
@@ -224,7 +224,7 @@ Add helpful development gems:
224
224
 
225
225
  ```ruby
226
226
  # Generate model annotations
227
- rails generate pu:gem:annotate
227
+ rails generate pu:gem:annotated
228
228
 
229
229
  # Set up environment variables
230
230
  rails generate pu:gem:dotenv
@@ -1,6 +1,8 @@
1
- gem "plutonium"
2
-
3
1
  after_bundle do
2
+ Bundler.with_unbundled_env do
3
+ run "bundle add plutonium"
4
+ end
5
+
4
6
  generate "pu:core:install"
5
7
 
6
8
  git add: "."
@@ -1,6 +1,11 @@
1
1
  after_bundle do
2
2
  # Run the plutonium install
3
- rails_command "app:template LOCATION=https://radioactive-labs.github.io/plutonium-core/templates/plutonium.rb"
3
+ template_location = if ENV["LOCAL"]
4
+ "/Users/stefan/Documents/plutonium/plutonium-core/docs/public/templates/plutonium.rb"
5
+ else
6
+ "https://radioactive-labs.github.io/plutonium-core/templates/plutonium.rb"
7
+ end
8
+ rails_command "app:template LOCATION=#{template_location}"
4
9
 
5
10
  # Enliten!
6
11
  rails_command "app:template LOCATION=https://raw.githubusercontent.com/thedumbtechguy/enlitenment/main/template.rb"
@@ -3,13 +3,18 @@ after_bundle do
3
3
  git(add: ".") && git(commit: %( -m 'initial commit' ))
4
4
 
5
5
  # Run the base install
6
- rails_command "app:template LOCATION=https://radioactive-labs.github.io/plutonium-core/templates/base.rb"
6
+ template_location = if ENV["LOCAL"]
7
+ "/Users/stefan/Documents/plutonium/plutonium-core/docs/public/templates/base.rb"
8
+ else
9
+ "https://radioactive-labs.github.io/plutonium-core/templates/base.rb"
10
+ end
11
+ rails_command "app:template LOCATION=#{template_location}"
7
12
 
8
13
  # Add development tools
9
14
  generate "pu:gem:dotenv"
10
15
  git(add: ".") && git(commit: %( -m 'add dotenv' ))
11
16
 
12
- generate "pu:gem:annotate"
17
+ generate "pu:gem:annotated"
13
18
  git(add: ".") && git(commit: %( -m 'add annotate' ))
14
19
 
15
20
  generate "pu:gem:standard"
@@ -9,10 +9,11 @@ module Pu
9
9
 
10
10
  source_root File.expand_path("templates", __dir__)
11
11
 
12
- desc "Install the annnotate gem"
12
+ desc "Install the annnotated gem"
13
13
 
14
14
  def start
15
- bundle "annotate", group: :development
15
+ bundle "annotated", group: :development
16
+ generate "annotated:install"
16
17
  copy_file "lib/tasks/auto_annotate_models.rake"
17
18
  rescue => e
18
19
  exception "#{self.class} failed:", e
@@ -3,11 +3,11 @@
3
3
  # NOTE: to have a dev-mode tool do its thing in production.
4
4
  return unless Rails.env.development?
5
5
 
6
- require "annotate"
6
+ require "annotated"
7
7
  task :set_annotation_options do
8
8
  # You can override any of these by setting an environment variable of the
9
9
  # same name.
10
- Annotate.set_defaults(
10
+ Annotated.set_defaults(
11
11
  "active_admin" => "false",
12
12
  "additional_file_patterns" => [],
13
13
  "routes" => "false",
@@ -56,4 +56,4 @@ task :set_annotation_options do
56
56
  )
57
57
  end
58
58
 
59
- Annotate.load_tasks
59
+ Annotated.load_tasks
@@ -76,15 +76,15 @@ module PlutoniumGenerators
76
76
  type = type.to_sym if type
77
77
 
78
78
  if dangerous_name?(name)
79
- raise Error, "Could not generate field '#{name}', as it is already defined by Active Record."
79
+ raise "Could not generate field '#{name}', as it is already defined by Active Record."
80
80
  end
81
81
 
82
82
  if type && !valid_type?(type)
83
- raise Error, "Could not generate field '#{name}' with unknown type '#{type}'."
83
+ raise "Could not generate field '#{name}' with unknown type '#{type}'."
84
84
  end
85
85
 
86
86
  if index_type && !valid_index_type?(index_type)
87
- raise Error, "Could not generate field '#{name}' with unknown index '#{index_type}'."
87
+ raise "Could not generate field '#{name}' with unknown index '#{index_type}'."
88
88
  end
89
89
 
90
90
  if type && reference?(type)
@@ -7,6 +7,8 @@ module Plutonium
7
7
  include Plutonium::UI::Component::Behaviour
8
8
 
9
9
  class Builder < Builder
10
+ include Plutonium::UI::Display::Options::InferredTypes
11
+
10
12
  def association_tag(**, &)
11
13
  create_component(Plutonium::UI::Display::Components::Association, :association, **, &)
12
14
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Plutonium
4
+ module UI
5
+ module Display
6
+ module Options
7
+ module InferredTypes
8
+ private
9
+
10
+ def infer_field_component
11
+ case inferred_field_type
12
+ when :attachment
13
+ :attachment
14
+ else
15
+ super
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -32,6 +32,7 @@ module Plutonium
32
32
  create_component(Components::Uppy, :uppy, **, &)
33
33
  end
34
34
  alias_method :file_tag, :uppy_tag
35
+ alias_method :attachment_tag, :uppy_tag
35
36
 
36
37
  def secure_association_tag(**attributes, &)
37
38
  attributes[:data_controller] = tokens(attributes[:data_controller], "slim-select") # TODO: put this behind a config
@@ -1,5 +1,5 @@
1
1
  module Plutonium
2
- VERSION = "0.18.7"
2
+ VERSION = "0.19.0"
3
3
  NEXT_MAJOR_VERSION = VERSION.split(".").tap { |v|
4
4
  v[1] = v[1].to_i + 1
5
5
  v[2] = 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.18.7
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-01-08 00:00:00.000000000 Z
11
+ date: 2025-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -30,20 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '7.1'
34
- - - "<"
35
- - !ruby/object:Gem::Version
36
- version: '8.0'
33
+ version: '7.2'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - ">="
42
39
  - !ruby/object:Gem::Version
43
- version: '7.1'
44
- - - "<"
45
- - !ruby/object:Gem::Version
46
- version: '8.0'
40
+ version: '7.2'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: listen
49
43
  requirement: !ruby/object:Gem::Requirement
@@ -582,9 +576,9 @@ files:
582
576
  - lib/generators/pu/field/renderer/renderer_generator.rb
583
577
  - lib/generators/pu/field/renderer/templates/.keep
584
578
  - lib/generators/pu/field/renderer/templates/renderer.rb.tt
585
- - lib/generators/pu/gem/annotate/annotate_generator.rb
586
- - lib/generators/pu/gem/annotate/templates/.keep
587
- - lib/generators/pu/gem/annotate/templates/lib/tasks/auto_annotate_models.rake
579
+ - lib/generators/pu/gem/annotated/annotated_generator.rb
580
+ - lib/generators/pu/gem/annotated/templates/.keep
581
+ - lib/generators/pu/gem/annotated/templates/lib/tasks/auto_annotate_models.rake
588
582
  - lib/generators/pu/gem/dotenv/dotenv_generator.rb
589
583
  - lib/generators/pu/gem/dotenv/templates/.env
590
584
  - lib/generators/pu/gem/dotenv/templates/.env.local
@@ -814,6 +808,7 @@ files:
814
808
  - lib/plutonium/ui/display/components/association.rb
815
809
  - lib/plutonium/ui/display/components/attachment.rb
816
810
  - lib/plutonium/ui/display/components/markdown.rb
811
+ - lib/plutonium/ui/display/options/inferred_types.rb
817
812
  - lib/plutonium/ui/display/resource.rb
818
813
  - lib/plutonium/ui/display/theme.rb
819
814
  - lib/plutonium/ui/dyna_frame/content.rb