opal_stimulus 0.1.6 → 0.1.8
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 +9 -0
- data/README.md +2 -2
- data/lib/install/install_opal_stimulus.rb +7 -2
- data/lib/opal_stimulus/railtie.rb +9 -0
- data/lib/opal_stimulus/version.rb +1 -1
- data/lib/opal_stimulus.rb +1 -0
- data/lib/tasks/build.rake +3 -0
- metadata +36 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e85c862c3473c9962b0e1e9be1887e208648a8cd67301f6ac03bf7da0bf4257
|
4
|
+
data.tar.gz: 60f54f0a320aa035c476462dae509e9c3758e506392dc9a78e873f4641f18573
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10a698fdc0764eebb12942136946e074feca1f4d1fa1afd2ed8722ed84d80451b6bde4f84a853a77d3edbbb2436b68fcb9a56e2e3d767dffd5fb2eace477bb86
|
7
|
+
data.tar.gz: 4b618ed01261320c78212f3a8f625aa92f4ee781cc343c19fb35510879e797423727588a3c4bf4981bf906d1dc2310df4a86b78f53ffd05b82e4ad7006d90a38
|
data/CHANGELOG.md
CHANGED
@@ -38,3 +38,12 @@
|
|
38
38
|
- Simplify installation importing `application` and `Controller` with ESM
|
39
39
|
Now `app/javascript/controllers/application.js` will be not modified,
|
40
40
|
and only compiled code will be imported inside application layout.
|
41
|
+
|
42
|
+
## [0.1.7] - 2025-08-20
|
43
|
+
|
44
|
+
- Add installation on Rails tests
|
45
|
+
- Make it production ready enhancing `assets:precompile` with `opal_stimulus:build`
|
46
|
+
|
47
|
+
## [0.1.8] - 2025-08-27
|
48
|
+
|
49
|
+
- Improve installation on Rails tests
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Opal Stimulus for Rails
|
2
2
|
|
3
|
-
**Opal Stimulus** is a Stimulus wrapper made with Opal (a source-to-source Ruby to JavaScript compiler) that allows you to write Stimulus controllers in Ruby instead of JavaScript (It works only with Rails).
|
3
|
+
**Opal Stimulus** is a Stimulus wrapper made with Opal (a source-to-source Ruby to JavaScript compiler) that allows you to write Stimulus controllers in Ruby instead of JavaScript (It works only with Rails >= 7.2 and < 8.0.3).
|
4
4
|
|
5
5
|
[](https://github.com/josephschito/opal_stimulus/actions/workflows/main.yml)
|
6
6
|
|
@@ -28,7 +28,7 @@ bin/dev
|
|
28
28
|
Create a new controller:
|
29
29
|
|
30
30
|
```bash
|
31
|
-
bin/rails opal_stimulus hello
|
31
|
+
bin/rails generate opal_stimulus hello
|
32
32
|
```
|
33
33
|
This command will create `app/opal/controllers/hello_controller.rb`
|
34
34
|
|
@@ -22,14 +22,19 @@ if File.exist? APPLICATION_LAYOUT_PATH
|
|
22
22
|
say "Ensure foreman is installed"
|
23
23
|
run "gem install foreman"
|
24
24
|
end
|
25
|
+
|
26
|
+
manifest = Rails.root.join("app/assets/config/manifest.js")
|
27
|
+
if manifest.exist?
|
28
|
+
append_to_file manifest, "//= link opal.js"
|
29
|
+
end
|
25
30
|
append_to_file ".gitignore", "/.opal-cache\n"
|
26
31
|
append_to_file ".gitignore", "app/assets/builds/opal.js\n"
|
27
32
|
append_to_file ".gitignore", "app/assets/builds/opal.js.map\n"
|
28
33
|
empty_directory APPLICATION_OPAL_STIMULUS_BIN_PATH
|
29
34
|
empty_directory APPLICATION_OPAL_STIMULUS_PATH
|
30
35
|
empty_directory "#{APPLICATION_OPAL_STIMULUS_PATH}/controllers"
|
31
|
-
|
32
|
-
|
36
|
+
keep_file "#{APPLICATION_OPAL_STIMULUS_PATH}/controllers"
|
37
|
+
keep_file "app/assets/builds"
|
33
38
|
copy_file "#{__dir__}/dev", "#{APPLICATION_OPAL_STIMULUS_BIN_PATH}/dev"
|
34
39
|
FileUtils.chmod("+x", "#{APPLICATION_OPAL_STIMULUS_BIN_PATH}/dev")
|
35
40
|
copy_file "#{__dir__}/application.rb", "#{APPLICATION_OPAL_STIMULUS_PATH}/application.rb"
|
data/lib/opal_stimulus.rb
CHANGED
data/lib/tasks/build.rake
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal_stimulus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joseph Schito
|
@@ -51,6 +51,40 @@ dependencies:
|
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: 0.1.1
|
54
|
+
- !ruby/object:Gem::Dependency
|
55
|
+
name: rails
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '7.2'
|
61
|
+
- - "<"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 8.0.3
|
64
|
+
type: :runtime
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '7.2'
|
71
|
+
- - "<"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: 8.0.3
|
74
|
+
- !ruby/object:Gem::Dependency
|
75
|
+
name: propshaft
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - "~>"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '1.2'
|
81
|
+
type: :development
|
82
|
+
prerelease: false
|
83
|
+
version_requirements: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - "~>"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '1.2'
|
54
88
|
description: Opal Stimulus provides a way to write Stimulus controllers in Ruby, leveraging
|
55
89
|
the Opal compiler to convert Ruby code into JavaScript. This allows developers familiar
|
56
90
|
with Ruby to use the Stimulus framework without needing to write JavaScript directly.
|
@@ -74,6 +108,7 @@ files:
|
|
74
108
|
- lib/install/dev
|
75
109
|
- lib/install/install_opal_stimulus.rb
|
76
110
|
- lib/opal_stimulus.rb
|
111
|
+
- lib/opal_stimulus/railtie.rb
|
77
112
|
- lib/opal_stimulus/stimulus_controller.rb
|
78
113
|
- lib/opal_stimulus/version.rb
|
79
114
|
- lib/tasks/build.rake
|