hotwire-spark 0.1.2 → 0.1.4
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: 771d94935221f422b97adce54e2bcd95f0ac91a9c9ef8eeb6879a070d8645a01
|
4
|
+
data.tar.gz: 8e895a8c43b15c695c8774385af6983440be723a2b37fb7fb2361c5a6bef70c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 502ec0abffe9ce53cda5fccc52b9dd7f41ad597ebbd9385d2ed87f7f1f0c6a6c046b9c40bc9afd4fe17bb3f61280dd8397aa59344173819b124e9d32819fe447
|
7
|
+
data.tar.gz: 92aed611dab508073314d801a29263ed0fced3dd3b0e7649d1602eb14af6f0584d9ba3f5084eca2eb1657a2f5174bd942945a825c677cf20b1178f178bf8402a
|
data/README.md
CHANGED
@@ -20,7 +20,7 @@ $ bundle
|
|
20
20
|
|
21
21
|
That's it!
|
22
22
|
|
23
|
-
##
|
23
|
+
## How it works
|
24
24
|
|
25
25
|
The system will listen for three kinds of changes and will take action depending on each:
|
26
26
|
|
@@ -28,6 +28,9 @@ The system will listen for three kinds of changes and will take action depending
|
|
28
28
|
* **CSS change:** it fetches and reloads the stylesheet that changed.
|
29
29
|
* **Stimulus controller change:** it fetches the Stimulus controller that changed and reloads all the controllers in the page.
|
30
30
|
|
31
|
+
> [!NOTE]
|
32
|
+
> Hotwire Spark currently does not support `jsbundling`, only import maps.
|
33
|
+
|
31
34
|
## Configuration
|
32
35
|
|
33
36
|
You can set configuration options on your `development.rb`. For example:
|
@@ -39,7 +42,7 @@ config.hotwire.spark.html_paths += %w[ lib ]
|
|
39
42
|
| Name | Description |
|
40
43
|
|------------------|------------------------------------------------------------------------------------------------------------------------------|
|
41
44
|
| `html_paths` | Paths where file changes trigger a content refresh. By default: `app/controllers`, `app/helpers`, `app/models`, `app/views`. |
|
42
|
-
| `css_paths` | Paths where file changes trigger a CSS refresh. By default: `app/assets/stylesheets
|
45
|
+
| `css_paths` | Paths where file changes trigger a CSS refresh. By default: `app/assets/stylesheets` or `app/assets/builds` if exists. |
|
43
46
|
| `stimulus_paths` | Paths where file changes trigger a Stimulus controller refresh. By default: `app/javascript/controllers`. |
|
44
47
|
| `enabled` | Enable or disable live reloading. By default, it's only enabled in `development`. |
|
45
48
|
| `logging` | Show logs in the browser console when reloading happens. It's false by default. |
|
data/lib/hotwire/spark/engine.rb
CHANGED
@@ -8,7 +8,7 @@ module Hotwire::Spark
|
|
8
8
|
config.hotwire.spark = ActiveSupport::OrderedOptions.new
|
9
9
|
config.hotwire.spark.merge! \
|
10
10
|
enabled: Rails.env.development?,
|
11
|
-
css_paths: %w[ app/assets/stylesheets ],
|
11
|
+
css_paths: File.directory?("app/assets/builds") ? %w[ app/assets/builds ] : %w[ app/assets/stylesheets ],
|
12
12
|
html_paths: %w[ app/controllers app/helpers app/models app/views ],
|
13
13
|
stimulus_paths: %w[ app/javascript/controllers ]
|
14
14
|
|
@@ -25,7 +25,11 @@ class Hotwire::Spark::FileWatcher
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def paths
|
28
|
-
@callbacks_by_path.keys
|
28
|
+
only_existing_paths @callbacks_by_path.keys
|
29
|
+
end
|
30
|
+
|
31
|
+
def only_existing_paths(paths)
|
32
|
+
paths.select(&:exist?)
|
29
33
|
end
|
30
34
|
|
31
35
|
def process_changed_files(changed_files)
|
data/lib/hotwire-spark.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotwire-spark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jorge Manrubia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -137,7 +137,6 @@ files:
|
|
137
137
|
- lib/hotwire-spark.rb
|
138
138
|
- lib/hotwire/spark/action_cable/persistent_cable_middleware.rb
|
139
139
|
- lib/hotwire/spark/action_cable/persistent_cable_server.rb
|
140
|
-
- lib/hotwire/spark/action_cable/solid_cable_listener_with_safe_reloads.rb
|
141
140
|
- lib/hotwire/spark/engine.rb
|
142
141
|
- lib/hotwire/spark/file_watcher.rb
|
143
142
|
- lib/hotwire/spark/installer.rb
|