plutonium 0.18.7 → 0.19.0
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 +4 -4
- data/# Plutonium: The pre-alpha demo.md +1 -1
- data/docs/guide/getting-started/installation.md +1 -1
- data/docs/public/templates/base.rb +4 -2
- data/docs/public/templates/pluton8.rb +6 -1
- data/docs/public/templates/plutonium.rb +7 -2
- data/lib/generators/pu/gem/{annotate/annotate_generator.rb → annotated/annotated_generator.rb} +3 -2
- data/lib/generators/pu/gem/{annotate → annotated}/templates/lib/tasks/auto_annotate_models.rake +3 -3
- data/lib/generators/pu/lib/plutonium_generators/model_generator_base.rb +3 -3
- data/lib/plutonium/ui/display/base.rb +2 -0
- data/lib/plutonium/ui/display/options/inferred_types.rb +22 -0
- data/lib/plutonium/ui/form/base.rb +1 -0
- data/lib/plutonium/version.rb +1 -1
- metadata +8 -13
- /data/lib/generators/pu/gem/{annotate → annotated}/templates/.keep +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e258fecf4bb703998367bdb017632e7d574353b0ea17ab1095f2a51e48830e5f
|
4
|
+
data.tar.gz: 5e9204d931880a93b5c1431b899170f5ad84b15bd98ecff6159e1dba804b181a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89092ba600c685b58f1b8138c7cef005b12ff614adc1cac75c2173e8e808bdc033140f992331725d31263a4e26e432bc6d1a3fc3a6a71deae1b573ce17b2bf69
|
7
|
+
data.tar.gz: 2e7db8b31e25b248e92113653231db0b5d4dc459ec3b9bd51ef2d43ea282a94ab909a11fc66e264eea0b6ed532dd9de9c74e8674f0dbaa16b82db70ccf60fad4
|
@@ -1,6 +1,11 @@
|
|
1
1
|
after_bundle do
|
2
2
|
# Run the plutonium install
|
3
|
-
|
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
|
-
|
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:
|
17
|
+
generate "pu:gem:annotated"
|
13
18
|
git(add: ".") && git(commit: %( -m 'add annotate' ))
|
14
19
|
|
15
20
|
generate "pu:gem:standard"
|
data/lib/generators/pu/gem/{annotate/annotate_generator.rb → annotated/annotated_generator.rb}
RENAMED
@@ -9,10 +9,11 @@ module Pu
|
|
9
9
|
|
10
10
|
source_root File.expand_path("templates", __dir__)
|
11
11
|
|
12
|
-
desc "Install the
|
12
|
+
desc "Install the annnotated gem"
|
13
13
|
|
14
14
|
def start
|
15
|
-
bundle "
|
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
|
data/lib/generators/pu/gem/{annotate → annotated}/templates/lib/tasks/auto_annotate_models.rake
RENAMED
@@ -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 "
|
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
|
-
|
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
|
-
|
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
|
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
|
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
|
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
|
data/lib/plutonium/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|
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/
|
586
|
-
- lib/generators/pu/gem/
|
587
|
-
- lib/generators/pu/gem/
|
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
|
File without changes
|