hotwired_component 0.1.0 → 0.2.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e54c39d514ec1c512a060a3260142f8ceb8847055bc071c1a83a44a90da3e507
|
4
|
+
data.tar.gz: dadfb497f35a9ed01ffbf236e4727cf529fcc2e7291c067a8c7df5f2cb71f7dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6684a70a745b802a9b3096ed0b2ee38eba5534bc93c42998f654103ec473a44ac4b203ce25d1403a071e0aa902f9d311643ad3a78a502147cbaad1dd0a09d316
|
7
|
+
data.tar.gz: '0822e71d8d76dcae04f099754ce20668235ba76ee52f52eb6445e1814476c7a1b6c6357f20f2c44c00a7b01f72e6a36337dec4b724a57066655df54fa3abd7f4'
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module HotwiredComponent
|
2
|
+
class InstallGenerator < Rails::Generators::Base
|
3
|
+
source_root File.expand_path('templates', __dir__)
|
4
|
+
|
5
|
+
def install_hotwired_rails
|
6
|
+
run "rails hotwire:install"
|
7
|
+
end
|
8
|
+
|
9
|
+
def add_component_controllers
|
10
|
+
append_to_file "app/javascript/packs/application.js" do
|
11
|
+
<<~JAVASCRIPT
|
12
|
+
const component_stylesheets = require.context(
|
13
|
+
"../../components/",
|
14
|
+
true,
|
15
|
+
/\.scss$/
|
16
|
+
);
|
17
|
+
|
18
|
+
component_stylesheets.keys().map(component_stylesheets);
|
19
|
+
JAVASCRIPT
|
20
|
+
|
21
|
+
end
|
22
|
+
append_to_file "app/javascript/controllers/index.js" do
|
23
|
+
<<~JAVASCRIPT
|
24
|
+
context = require.context("components", true, /_controller\.js$/)
|
25
|
+
application.load(definitionsFromContext(context))
|
26
|
+
JAVASCRIPT
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def update_webpacker_config
|
31
|
+
gsub_file "config/webpacker.yml", "additional_paths: [",
|
32
|
+
"additional_paths: [\"app/components\""
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/hotwired_component.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotwired_component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fugufish
|
@@ -30,6 +30,20 @@ dependencies:
|
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 6.1.3.1
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: hotwire-rails
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0.1'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.1'
|
33
47
|
- !ruby/object:Gem::Dependency
|
34
48
|
name: view_component
|
35
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -62,6 +76,8 @@ files:
|
|
62
76
|
- lib/generators/hotwired_component/component/templates/component.scss.erb
|
63
77
|
- lib/generators/hotwired_component/component/templates/component_controller.js.erb
|
64
78
|
- lib/generators/hotwired_component/component/templates/component_spec.rb.erb
|
79
|
+
- lib/generators/hotwired_component/install/USAGE
|
80
|
+
- lib/generators/hotwired_component/install/install_generator.rb
|
65
81
|
- lib/hotwired_component.rb
|
66
82
|
- lib/hotwired_component/engine.rb
|
67
83
|
- lib/hotwired_component/version.rb
|