view_primitives 0.1.0 → 0.1.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +3 -0
- data/lib/generators/view_primitives/add/add_generator.rb +12 -10
- data/lib/view_primitives/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3bef69fa2796d5fec3caefbc2030477efadbe97cb28542e54b6f015edb3196de
|
|
4
|
+
data.tar.gz: a85bd022df50687b09ad134173dd76e264c66a7b24a4df8eff09918794a209cb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 424be22b1983a620253005a43f6598043553603eb6822de5c28b8bf10a49181039c3c5165f33ced82da6266af526422824b88ae7d0f7adad1d139e0fd695cf26
|
|
7
|
+
data.tar.gz: a3c8c3a237183d849329f998ad3c0d276fde2873db327d24d091ceeeff503518ba0ca20e3512c8683dc5ded47e13fd97066a16b62131e6923cea050f40a4e9f4
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.1] - 2026-06-01
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- `AddGenerator#copy_component` called `source_root` as an instance method; changed to `self.class.source_root` (caught by Ruby 4.0 stricter method dispatch)
|
|
15
|
+
- `template` and `copy_file` overrides in `AddGenerator` were treated as Thor generator actions and invoked with zero arguments; wrapped in `no_tasks` to exclude them from action dispatch
|
|
16
|
+
- Test helper did not require `ViewPrimitives::Generators::Components`, causing two tests to error with `NameError: uninitialized constant`
|
|
17
|
+
|
|
10
18
|
## [0.1.0] - 2026-05-30
|
|
11
19
|
|
|
12
20
|
### Added
|
data/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# ViewPrimitives
|
|
2
2
|
|
|
3
|
+
[](https://badge.fury.io/rb/view_primitives)
|
|
4
|
+
[](https://github.com/alec-c4/view_primitives/actions)
|
|
5
|
+
|
|
3
6
|
A [shadcn/ui](https://ui.shadcn.com)-inspired component library for Rails built on [ViewComponent](https://viewcomponent.org).
|
|
4
7
|
|
|
5
8
|
> **Acknowledgements** — The visual design, CSS class choices, and component structure of ViewPrimitives are heavily inspired by [shadcn/ui](https://ui.shadcn.com) and its Svelte port [shadcn-svelte](https://www.shadcn-svelte.com). We are grateful to [@shadcn](https://github.com/shadcn) and all contributors for their outstanding open-source work. ViewPrimitives is an independent Rails adaptation and is not affiliated with or endorsed by the shadcn/ui project.
|
|
@@ -49,22 +49,24 @@ module ViewPrimitives
|
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
no_tasks do
|
|
53
|
+
def template(source, *args, **options, &block)
|
|
54
|
+
destination = args.first || options[:to]
|
|
55
|
+
warn_overwrite(destination) if destination
|
|
56
|
+
super
|
|
57
|
+
end
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
def copy_file(source, *args, **options)
|
|
60
|
+
destination = args.first || options[:to]
|
|
61
|
+
warn_overwrite(destination) if destination
|
|
62
|
+
super
|
|
63
|
+
end
|
|
62
64
|
end
|
|
63
65
|
|
|
64
66
|
private
|
|
65
67
|
|
|
66
68
|
def copy_component(name)
|
|
67
|
-
dir = File.join(source_root, name)
|
|
69
|
+
dir = File.join(self.class.source_root, name)
|
|
68
70
|
Dir.each_child(dir).sort.each { |file| copy_template_file(name, file) }
|
|
69
71
|
copy_extra_stimulus(name)
|
|
70
72
|
end
|