turbo_ready 0.0.7 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +27 -0
- data/Gemfile.lock +102 -59
- data/README.md +14 -19
- data/app/assets/builds/turbo_ready.js +1 -1
- data/app/assets/builds/turbo_ready.js.map +3 -3
- data/app/assets/images/turbo-ready-mark.webp +0 -0
- data/app/javascript/turbo_ready.js +15 -8
- data/bin/standardize +4 -1
- data/docker-compose.yml +45 -0
- data/fly.toml +38 -0
- data/lib/turbo_ready/tag_helper.rb +1 -1
- data/lib/turbo_ready/version.rb +1 -1
- data/package-lock.json +9235 -0
- data/package.json +8 -4
- data/turbo_ready.gemspec +5 -1
- data/yarn.lock +210 -146
- metadata +64 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84e74a8964537c211ee950824e5cab33421cd632888c954f8e1ad5f30a70fcd4
|
4
|
+
data.tar.gz: 1af940c593f7c8af7d8e12d1f61f710209277852432d61135351ffd8f6d431bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60770246c2a8d176d25dd082bd601444153e4aff8d7c622b80120f85e8158b27dfeba7893b5502ad4387efb14b6deb608b86a85d691cc0fa66bccbdb24ec3aad
|
7
|
+
data.tar.gz: f5c450f5affaba551a74877e90eb943ff65e39a831ed597cca47094f9940f000e39a7fa802412985129f7af5d22ae3b313844a10e23eab3fe670b32ffc0ed2d5
|
data/Dockerfile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
FROM ruby:3.1.2
|
2
|
+
|
3
|
+
RUN apt-get -y update && \
|
4
|
+
apt-get -y upgrade && \
|
5
|
+
apt-get -y --force-yes install build-essential sqlite3 tzdata && \
|
6
|
+
apt-get clean
|
7
|
+
|
8
|
+
COPY . /opt/turbo_ready
|
9
|
+
WORKDIR /opt/turbo_ready/test/dummy
|
10
|
+
|
11
|
+
VOLUME /usr/local/bundle
|
12
|
+
|
13
|
+
RUN gem update --system && \
|
14
|
+
gem install bundler && \
|
15
|
+
rm -f Gemfile.lock && \
|
16
|
+
bundle --without test && \
|
17
|
+
bundle update --bundler && \
|
18
|
+
bundle lock --add-platform x86_64-linux && \
|
19
|
+
bundle --without test
|
20
|
+
|
21
|
+
ENV RAILS_ENV=production
|
22
|
+
CMD rm -f tmp/pids/server.pid && \
|
23
|
+
bin/rails db:create db:migrate && \
|
24
|
+
bin/rails log:clear && \
|
25
|
+
bin/rails assets:clobber && \
|
26
|
+
bin/rails assets:precompile && \
|
27
|
+
bin/rails s --binding=0.0.0.0 --port=3000
|
data/Gemfile.lock
CHANGED
@@ -1,81 +1,83 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
turbo_ready (0.0
|
4
|
+
turbo_ready (0.1.0)
|
5
5
|
rails (>= 6.1)
|
6
6
|
turbo-rails (>= 1.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (7.0.
|
12
|
-
actionpack (= 7.0.
|
13
|
-
activesupport (= 7.0.
|
11
|
+
actioncable (7.0.4)
|
12
|
+
actionpack (= 7.0.4)
|
13
|
+
activesupport (= 7.0.4)
|
14
14
|
nio4r (~> 2.0)
|
15
15
|
websocket-driver (>= 0.6.1)
|
16
|
-
actionmailbox (7.0.
|
17
|
-
actionpack (= 7.0.
|
18
|
-
activejob (= 7.0.
|
19
|
-
activerecord (= 7.0.
|
20
|
-
activestorage (= 7.0.
|
21
|
-
activesupport (= 7.0.
|
16
|
+
actionmailbox (7.0.4)
|
17
|
+
actionpack (= 7.0.4)
|
18
|
+
activejob (= 7.0.4)
|
19
|
+
activerecord (= 7.0.4)
|
20
|
+
activestorage (= 7.0.4)
|
21
|
+
activesupport (= 7.0.4)
|
22
22
|
mail (>= 2.7.1)
|
23
23
|
net-imap
|
24
24
|
net-pop
|
25
25
|
net-smtp
|
26
|
-
actionmailer (7.0.
|
27
|
-
actionpack (= 7.0.
|
28
|
-
actionview (= 7.0.
|
29
|
-
activejob (= 7.0.
|
30
|
-
activesupport (= 7.0.
|
26
|
+
actionmailer (7.0.4)
|
27
|
+
actionpack (= 7.0.4)
|
28
|
+
actionview (= 7.0.4)
|
29
|
+
activejob (= 7.0.4)
|
30
|
+
activesupport (= 7.0.4)
|
31
31
|
mail (~> 2.5, >= 2.5.4)
|
32
32
|
net-imap
|
33
33
|
net-pop
|
34
34
|
net-smtp
|
35
35
|
rails-dom-testing (~> 2.0)
|
36
|
-
actionpack (7.0.
|
37
|
-
actionview (= 7.0.
|
38
|
-
activesupport (= 7.0.
|
36
|
+
actionpack (7.0.4)
|
37
|
+
actionview (= 7.0.4)
|
38
|
+
activesupport (= 7.0.4)
|
39
39
|
rack (~> 2.0, >= 2.2.0)
|
40
40
|
rack-test (>= 0.6.3)
|
41
41
|
rails-dom-testing (~> 2.0)
|
42
42
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
43
|
-
actiontext (7.0.
|
44
|
-
actionpack (= 7.0.
|
45
|
-
activerecord (= 7.0.
|
46
|
-
activestorage (= 7.0.
|
47
|
-
activesupport (= 7.0.
|
43
|
+
actiontext (7.0.4)
|
44
|
+
actionpack (= 7.0.4)
|
45
|
+
activerecord (= 7.0.4)
|
46
|
+
activestorage (= 7.0.4)
|
47
|
+
activesupport (= 7.0.4)
|
48
48
|
globalid (>= 0.6.0)
|
49
49
|
nokogiri (>= 1.8.5)
|
50
|
-
actionview (7.0.
|
51
|
-
activesupport (= 7.0.
|
50
|
+
actionview (7.0.4)
|
51
|
+
activesupport (= 7.0.4)
|
52
52
|
builder (~> 3.1)
|
53
53
|
erubi (~> 1.4)
|
54
54
|
rails-dom-testing (~> 2.0)
|
55
55
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
56
|
-
activejob (7.0.
|
57
|
-
activesupport (= 7.0.
|
56
|
+
activejob (7.0.4)
|
57
|
+
activesupport (= 7.0.4)
|
58
58
|
globalid (>= 0.3.6)
|
59
|
-
activemodel (7.0.
|
60
|
-
activesupport (= 7.0.
|
61
|
-
activerecord (7.0.
|
62
|
-
activemodel (= 7.0.
|
63
|
-
activesupport (= 7.0.
|
64
|
-
activestorage (7.0.
|
65
|
-
actionpack (= 7.0.
|
66
|
-
activejob (= 7.0.
|
67
|
-
activerecord (= 7.0.
|
68
|
-
activesupport (= 7.0.
|
59
|
+
activemodel (7.0.4)
|
60
|
+
activesupport (= 7.0.4)
|
61
|
+
activerecord (7.0.4)
|
62
|
+
activemodel (= 7.0.4)
|
63
|
+
activesupport (= 7.0.4)
|
64
|
+
activestorage (7.0.4)
|
65
|
+
actionpack (= 7.0.4)
|
66
|
+
activejob (= 7.0.4)
|
67
|
+
activerecord (= 7.0.4)
|
68
|
+
activesupport (= 7.0.4)
|
69
69
|
marcel (~> 1.0)
|
70
70
|
mini_mime (>= 1.1.0)
|
71
|
-
activesupport (7.0.
|
71
|
+
activesupport (7.0.4)
|
72
72
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
73
73
|
i18n (>= 1.6, < 2)
|
74
74
|
minitest (>= 5.1)
|
75
75
|
tzinfo (~> 2.0)
|
76
76
|
addressable (2.8.1)
|
77
77
|
public_suffix (>= 2.0.2, < 6.0)
|
78
|
+
ansi (1.5.0)
|
78
79
|
ast (2.4.2)
|
80
|
+
bindex (0.8.1)
|
79
81
|
builder (3.2.4)
|
80
82
|
byebug (11.1.3)
|
81
83
|
capybara (3.37.1)
|
@@ -88,11 +90,20 @@ GEM
|
|
88
90
|
regexp_parser (>= 1.5, < 3.0)
|
89
91
|
xpath (~> 3.2)
|
90
92
|
childprocess (4.1.0)
|
93
|
+
cliver (0.3.2)
|
91
94
|
coderay (1.1.3)
|
92
95
|
concurrent-ruby (1.1.10)
|
93
96
|
crass (1.0.6)
|
97
|
+
cuprite (0.13)
|
98
|
+
capybara (>= 2.1, < 4)
|
99
|
+
ferrum (~> 0.11.0)
|
94
100
|
digest (3.1.0)
|
95
101
|
erubi (1.11.0)
|
102
|
+
ferrum (0.11)
|
103
|
+
addressable (~> 2.5)
|
104
|
+
cliver (~> 0.3)
|
105
|
+
concurrent-ruby (~> 1.1)
|
106
|
+
websocket-driver (>= 0.6, < 0.8)
|
96
107
|
globalid (1.0.0)
|
97
108
|
activesupport (>= 5.0)
|
98
109
|
i18n (1.12.0)
|
@@ -101,7 +112,7 @@ GEM
|
|
101
112
|
actionpack (>= 6.0.0)
|
102
113
|
railties (>= 6.0.0)
|
103
114
|
json (2.6.2)
|
104
|
-
loofah (2.
|
115
|
+
loofah (2.19.0)
|
105
116
|
crass (~> 1.0.2)
|
106
117
|
nokogiri (>= 1.5.9)
|
107
118
|
magic_frozen_string_literal (1.2.0)
|
@@ -111,7 +122,13 @@ GEM
|
|
111
122
|
matrix (0.4.2)
|
112
123
|
method_source (1.0.0)
|
113
124
|
mini_mime (1.1.2)
|
125
|
+
mini_portile2 (2.8.0)
|
114
126
|
minitest (5.16.3)
|
127
|
+
minitest-reporters (1.5.0)
|
128
|
+
ansi
|
129
|
+
builder
|
130
|
+
minitest (>= 5.0)
|
131
|
+
ruby-progressbar
|
115
132
|
net-imap (0.2.3)
|
116
133
|
digest
|
117
134
|
net-protocol
|
@@ -127,6 +144,11 @@ GEM
|
|
127
144
|
net-protocol
|
128
145
|
timeout
|
129
146
|
nio4r (2.5.8)
|
147
|
+
nokogiri (1.13.8)
|
148
|
+
mini_portile2 (~> 2.8.0)
|
149
|
+
racc (~> 1.4)
|
150
|
+
nokogiri (1.13.8-aarch64-linux)
|
151
|
+
racc (~> 1.4)
|
130
152
|
nokogiri (1.13.8-arm64-darwin)
|
131
153
|
racc (~> 1.4)
|
132
154
|
parallel (1.22.1)
|
@@ -145,28 +167,28 @@ GEM
|
|
145
167
|
rack (2.2.4)
|
146
168
|
rack-test (2.0.2)
|
147
169
|
rack (>= 1.3)
|
148
|
-
rails (7.0.
|
149
|
-
actioncable (= 7.0.
|
150
|
-
actionmailbox (= 7.0.
|
151
|
-
actionmailer (= 7.0.
|
152
|
-
actionpack (= 7.0.
|
153
|
-
actiontext (= 7.0.
|
154
|
-
actionview (= 7.0.
|
155
|
-
activejob (= 7.0.
|
156
|
-
activemodel (= 7.0.
|
157
|
-
activerecord (= 7.0.
|
158
|
-
activestorage (= 7.0.
|
159
|
-
activesupport (= 7.0.
|
170
|
+
rails (7.0.4)
|
171
|
+
actioncable (= 7.0.4)
|
172
|
+
actionmailbox (= 7.0.4)
|
173
|
+
actionmailer (= 7.0.4)
|
174
|
+
actionpack (= 7.0.4)
|
175
|
+
actiontext (= 7.0.4)
|
176
|
+
actionview (= 7.0.4)
|
177
|
+
activejob (= 7.0.4)
|
178
|
+
activemodel (= 7.0.4)
|
179
|
+
activerecord (= 7.0.4)
|
180
|
+
activestorage (= 7.0.4)
|
181
|
+
activesupport (= 7.0.4)
|
160
182
|
bundler (>= 1.15.0)
|
161
|
-
railties (= 7.0.
|
183
|
+
railties (= 7.0.4)
|
162
184
|
rails-dom-testing (2.0.3)
|
163
185
|
activesupport (>= 4.2.0)
|
164
186
|
nokogiri (>= 1.6)
|
165
187
|
rails-html-sanitizer (1.4.3)
|
166
188
|
loofah (~> 2.3)
|
167
|
-
railties (7.0.
|
168
|
-
actionpack (= 7.0.
|
169
|
-
activesupport (= 7.0.
|
189
|
+
railties (7.0.4)
|
190
|
+
actionpack (= 7.0.4)
|
191
|
+
activesupport (= 7.0.4)
|
170
192
|
method_source
|
171
193
|
rake (>= 12.2)
|
172
194
|
thor (~> 1.0)
|
@@ -175,6 +197,7 @@ GEM
|
|
175
197
|
rake (13.0.6)
|
176
198
|
regexp_parser (2.5.0)
|
177
199
|
rexml (3.2.5)
|
200
|
+
rouge (4.0.0)
|
178
201
|
rubocop (1.35.1)
|
179
202
|
json (~> 2.3)
|
180
203
|
parallel (~> 1.10)
|
@@ -204,13 +227,22 @@ GEM
|
|
204
227
|
actionpack (>= 5.2)
|
205
228
|
activesupport (>= 5.2)
|
206
229
|
sprockets (>= 3.0.0)
|
207
|
-
sqlite3 (1.
|
230
|
+
sqlite3 (1.5.0)
|
231
|
+
mini_portile2 (~> 2.8.0)
|
232
|
+
sqlite3 (1.5.0-aarch64-linux)
|
233
|
+
sqlite3 (1.5.0-arm64-darwin)
|
208
234
|
standard (1.16.1)
|
209
235
|
rubocop (= 1.35.1)
|
210
236
|
rubocop-performance (= 1.14.3)
|
211
237
|
standardrb (1.0.1)
|
212
238
|
standard
|
213
239
|
strscan (3.0.4)
|
240
|
+
tailwindcss-rails (2.0.13)
|
241
|
+
railties (>= 6.0.0)
|
242
|
+
tailwindcss-rails (2.0.13-aarch64-linux)
|
243
|
+
railties (>= 6.0.0)
|
244
|
+
tailwindcss-rails (2.0.13-arm64-darwin)
|
245
|
+
railties (>= 6.0.0)
|
214
246
|
thor (1.2.1)
|
215
247
|
timeout (0.3.0)
|
216
248
|
turbo-rails (1.1.1)
|
@@ -219,8 +251,13 @@ GEM
|
|
219
251
|
railties (>= 6.0.0)
|
220
252
|
tzinfo (2.0.5)
|
221
253
|
concurrent-ruby (~> 1.0)
|
222
|
-
unicode-display_width (2.
|
223
|
-
|
254
|
+
unicode-display_width (2.3.0)
|
255
|
+
web-console (4.2.0)
|
256
|
+
actionview (>= 6.0.0)
|
257
|
+
activemodel (>= 6.0.0)
|
258
|
+
bindex (>= 0.4.0)
|
259
|
+
railties (>= 6.0.0)
|
260
|
+
webdrivers (5.1.0)
|
224
261
|
nokogiri (~> 1.6)
|
225
262
|
rubyzip (>= 1.3.0)
|
226
263
|
selenium-webdriver (~> 4.0)
|
@@ -233,22 +270,28 @@ GEM
|
|
233
270
|
zeitwerk (2.6.0)
|
234
271
|
|
235
272
|
PLATFORMS
|
273
|
+
aarch64-linux
|
236
274
|
arm64-darwin-21
|
275
|
+
ruby
|
237
276
|
|
238
277
|
DEPENDENCIES
|
239
278
|
capybara
|
279
|
+
cuprite
|
240
280
|
importmap-rails
|
241
281
|
magic_frozen_string_literal
|
282
|
+
minitest-reporters
|
242
283
|
net-smtp
|
243
284
|
pry-byebug
|
244
285
|
puma
|
245
286
|
rake
|
246
287
|
rexml
|
247
|
-
|
288
|
+
rouge
|
248
289
|
sprockets-rails
|
249
290
|
sqlite3
|
250
291
|
standardrb
|
292
|
+
tailwindcss-rails
|
251
293
|
turbo_ready!
|
294
|
+
web-console
|
252
295
|
webdrivers
|
253
296
|
|
254
297
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -11,28 +11,28 @@
|
|
11
11
|
</h1>
|
12
12
|
<p align="center">
|
13
13
|
<a href="http://blog.codinghorror.com/the-best-code-is-no-code-at-all/">
|
14
|
-
<img alt="Lines of Code" src="https://img.shields.io/badge/loc-
|
14
|
+
<img alt="Lines of Code" src="https://img.shields.io/badge/loc-140-47d299.svg" />
|
15
15
|
</a>
|
16
16
|
<a href="https://codeclimate.com/github/hopsoft/turbo_ready/maintainability">
|
17
17
|
<img src="https://api.codeclimate.com/v1/badges/a69b6f73abc3ccd49261/maintainability" />
|
18
18
|
</a>
|
19
19
|
<a href="https://rubygems.org/gems/turbo_ready">
|
20
|
-
<img alt="GEM" src="https://img.shields.io/gem/v/turbo_ready?color=168AFE&include_prereleases&logo=ruby&logoColor=FE1616">
|
20
|
+
<img alt="GEM Version" src="https://img.shields.io/gem/v/turbo_ready?color=168AFE&include_prereleases&logo=ruby&logoColor=FE1616">
|
21
21
|
</a>
|
22
22
|
<a href="https://rubygems.org/gems/turbo_ready">
|
23
|
-
<img alt="
|
23
|
+
<img alt="GEM Downloads" src="https://img.shields.io/gem/dt/turbo_ready?color=168AFE&logo=ruby&logoColor=FE1616">
|
24
24
|
</a>
|
25
25
|
<a href="https://github.com/testdouble/standard">
|
26
26
|
<img alt="Ruby Style" src="https://img.shields.io/badge/style-standard-168AFE?logo=ruby&logoColor=FE1616" />
|
27
27
|
</a>
|
28
28
|
<a href="https://www.npmjs.com/package/turbo_ready">
|
29
|
-
<img alt="NPM" src="https://img.shields.io/npm/v/turbo_ready?color=168AFE&logo=npm">
|
29
|
+
<img alt="NPM Version" src="https://img.shields.io/npm/v/turbo_ready?color=168AFE&logo=npm">
|
30
30
|
</a>
|
31
31
|
<a href="https://www.npmjs.com/package/turbo_ready">
|
32
|
-
<img alt="
|
32
|
+
<img alt="NPM Downloads" src="https://img.shields.io/npm/dm/turbo_ready?color=168AFE&logo=npm">
|
33
33
|
</a>
|
34
34
|
<a href="https://bundlephobia.com/package/turbo_ready@">
|
35
|
-
<img alt="
|
35
|
+
<img alt="NPM Bundle Size" src="https://img.shields.io/bundlephobia/minzip/turbo_ready?label=bundle%20size&logo=npm&color=47d299">
|
36
36
|
</a>
|
37
37
|
<a href="https://github.com/sheerun/prettier-standard">
|
38
38
|
<img alt="JavaScript Style" src="https://img.shields.io/badge/style-prettier--standard-168AFE?logo=javascript&logoColor=f4e137" />
|
@@ -67,7 +67,7 @@ You can `invoke` any DOM method on the client with Turbo Streams.
|
|
67
67
|
- [Setup](#setup)
|
68
68
|
- [Usage](#usage)
|
69
69
|
- [Method Chaining](#method-chaining)
|
70
|
-
- [
|
70
|
+
- [Event Dispatch](#event-dispatch)
|
71
71
|
- [Syntax Styles](#syntax-styles)
|
72
72
|
- [Extending Behavior](#extending-behavior)
|
73
73
|
- [Implementation Details](#implementation-details)
|
@@ -114,7 +114,7 @@ This is because CableReady already provides a rich set of powerful [DOM operatio
|
|
114
114
|
|
115
115
|
- [rails](https://rubygems.org/gems/rails) `>=6.1`
|
116
116
|
- [turbo-rails](https://rubygems.org/gems/turbo-rails) `>=1.1`
|
117
|
-
- [@hotwired/turbo-rails](https://yarnpkg.com/package/@hotwired/turbo-rails) `>=7.2.0-
|
117
|
+
- [@hotwired/turbo-rails](https://yarnpkg.com/package/@hotwired/turbo-rails) `>=7.2.0-rc.2`
|
118
118
|
|
119
119
|
## Installation
|
120
120
|
|
@@ -137,7 +137,7 @@ Import and intialize TurboReady in your application.
|
|
137
137
|
```diff
|
138
138
|
# package.json
|
139
139
|
"dependencies": {
|
140
|
-
|
140
|
+
"@hotwired/turbo-rails": ">=7.2.0-rc.2",
|
141
141
|
+ "turbo_ready": "^0.0.6"
|
142
142
|
```
|
143
143
|
|
@@ -171,16 +171,16 @@ turbo_stream
|
|
171
171
|
.invoke("classList.add", args: ["turbo-ready"], selector: "a") # dot notation + selector
|
172
172
|
```
|
173
173
|
|
174
|
-
###
|
174
|
+
### Event Dispatch
|
175
175
|
|
176
176
|
It's possible to fire events on `window`, `document`, and element(s).
|
177
177
|
|
178
178
|
```ruby
|
179
179
|
turbo_stream
|
180
|
-
.invoke(
|
180
|
+
.invoke(:dispatch_event, args: ["turbo-ready:demo"]) # fires on window
|
181
181
|
.invoke("document.dispatchEvent", args: ["turbo-ready:demo"]) # fires on document
|
182
|
-
.invoke(
|
183
|
-
.invoke(
|
182
|
+
.invoke(:dispatch_event, args: ["turbo-ready:demo"], selector: "#my-element") # fires on matching element(s)
|
183
|
+
.invoke(:dispatch_event, args: ["turbo-ready:demo", {bubbles: true, detail: {...}}]) # set event options
|
184
184
|
```
|
185
185
|
|
186
186
|
### Syntax Styles
|
@@ -189,7 +189,7 @@ You can use [`snake_case`](https://en.wikipedia.org/wiki/Snake_case) when invoki
|
|
189
189
|
It will implicitly convert to [`camelCase`](https://en.wikipedia.org/wiki/Camel_case).
|
190
190
|
|
191
191
|
```ruby
|
192
|
-
turbo_stream.invoke :
|
192
|
+
turbo_stream.invoke :event,
|
193
193
|
args: ["turbo-ready:demo", {detail: {converts_to_camel_case: true}}]
|
194
194
|
```
|
195
195
|
|
@@ -385,11 +385,6 @@ Connect with the core team on Twitter.
|
|
385
385
|
<img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/hopsoft?logo=twitter&style=social">
|
386
386
|
</a>
|
387
387
|
|
388
|
-
## TODOs
|
389
|
-
|
390
|
-
- [ ] Add system tests [(review turbo-rails for guidance)](https://github.com/hotwired/turbo-rails/blob/main/test/system/broadcasts_test.rb)
|
391
|
-
- [ ] Look into adding method chaining for broadcasts
|
392
|
-
|
393
388
|
## Releasing
|
394
389
|
|
395
390
|
1. Run `yarn` and `bundle` to pick up the latest
|
@@ -1,2 +1,2 @@
|
|
1
|
-
function
|
1
|
+
function f(i,a,o={}){let r=new CustomEvent(a,o);i.forEach(t=>t.dispatchEvent(r))}function h(){let i=JSON.parse(this.templateContent.textContent),{id:a,selector:o,receiver:r,method:t,args:c}=i,e=[self];if(o&&(e=Array.from(document.querySelectorAll(o))),r&&(e=e.map(n=>{let s=n,l=r.split(".");for(;l.length>0;)s=s[l.shift()];return s})),t==="dispatchEvent")return f(e,c[0],c[1]||{});if(t.endsWith("="))return e.forEach(n=>n[t.slice(0,-1).trim()]=c[0]);e.forEach(n=>n[t].apply(n,c))}function p(i){i.invoke=h}var u={initialize:p};export{u as default};
|
2
2
|
//# sourceMappingURL=turbo_ready.js.map
|
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../javascript/turbo_ready.js"],
|
4
|
-
"sourcesContent": ["function invoke () {\n const payload = JSON.parse(this.templateContent.textContent)\n const { id, selector, receiver, method, args } = payload\n let receivers = [self]\n if (selector) receivers = Array.from(document.querySelectorAll(selector))\n\n if (receiver) {\n receivers = receivers.map(r => {\n let context = r\n const chain = receiver.split('.')\n while (chain.length > 0) context = context[chain.shift()]\n return context\n })\n }\n\n
|
5
|
-
"mappings": "AAAA,SAASA,GAAU,CACjB,IAAMC,EAAU,KAAK,MAAM,KAAK,gBAAgB,WAAW,EACrD,CAAE,GAAAC,EAAI,SAAAC,EAAU,SAAAC,EAAU,OAAAC,EAAQ,KAAAC,CAAK,EAAIL,EAC7CM,EAAY,CAAC,IAAI,
|
6
|
-
"names": ["invoke", "payload", "id", "selector", "receiver", "method", "args", "receivers", "r", "context", "chain", "
|
4
|
+
"sourcesContent": ["function dispatch (targets, name, options = {}) {\n const evt = new CustomEvent(name, options)\n targets.forEach(t => t.dispatchEvent(evt))\n}\n\nfunction invoke () {\n const payload = JSON.parse(this.templateContent.textContent)\n const { id, selector, receiver, method, args } = payload\n let receivers = [self]\n if (selector) receivers = Array.from(document.querySelectorAll(selector))\n\n if (receiver) {\n receivers = receivers.map(r => {\n let context = r\n const chain = receiver.split('.')\n while (chain.length > 0) context = context[chain.shift()]\n return context\n })\n }\n\n // event dispatch\n if (method === 'dispatchEvent')\n return dispatch(receivers, args[0], args[1] || {})\n\n // property assignment\n if (method.endsWith('='))\n return receivers.forEach(r => (r[method.slice(0, -1).trim()] = args[0]))\n\n // method invocation\n receivers.forEach(r => r[method].apply(r, args))\n}\n\nfunction initialize (streamActions) {\n streamActions.invoke = invoke\n}\n\nexport default { initialize }\n"],
|
5
|
+
"mappings": "AAAA,SAASA,EAAUC,EAASC,EAAMC,EAAU,CAAC,EAAG,CAC9C,IAAMC,EAAM,IAAI,YAAYF,EAAMC,CAAO,EACzCF,EAAQ,QAAQ,GAAK,EAAE,cAAcG,CAAG,CAAC,CAC3C,CAEA,SAASC,GAAU,CACjB,IAAMC,EAAU,KAAK,MAAM,KAAK,gBAAgB,WAAW,EACrD,CAAE,GAAAC,EAAI,SAAAC,EAAU,SAAAC,EAAU,OAAAC,EAAQ,KAAAC,CAAK,EAAIL,EAC7CM,EAAY,CAAC,IAAI,EAarB,GAZIJ,IAAUI,EAAY,MAAM,KAAK,SAAS,iBAAiBJ,CAAQ,CAAC,GAEpEC,IACFG,EAAYA,EAAU,IAAIC,GAAK,CAC7B,IAAIC,EAAUD,EACRE,EAAQN,EAAS,MAAM,GAAG,EAChC,KAAOM,EAAM,OAAS,GAAGD,EAAUA,EAAQC,EAAM,MAAM,GACvD,OAAOD,CACT,CAAC,GAICJ,IAAW,gBACb,OAAOV,EAASY,EAAWD,EAAK,GAAIA,EAAK,IAAM,CAAC,CAAC,EAGnD,GAAID,EAAO,SAAS,GAAG,EACrB,OAAOE,EAAU,QAAQC,GAAMA,EAAEH,EAAO,MAAM,EAAG,EAAE,EAAE,KAAK,GAAKC,EAAK,EAAG,EAGzEC,EAAU,QAAQC,GAAKA,EAAEH,GAAQ,MAAMG,EAAGF,CAAI,CAAC,CACjD,CAEA,SAASK,EAAYC,EAAe,CAClCA,EAAc,OAASZ,CACzB,CAEA,IAAOa,EAAQ,CAAE,WAAAF,CAAW",
|
6
|
+
"names": ["dispatch", "targets", "name", "options", "evt", "invoke", "payload", "id", "selector", "receiver", "method", "args", "receivers", "r", "context", "chain", "initialize", "streamActions", "turbo_ready_default"]
|
7
7
|
}
|
Binary file
|
@@ -1,3 +1,8 @@
|
|
1
|
+
function dispatch (targets, name, options = {}) {
|
2
|
+
const evt = new CustomEvent(name, options)
|
3
|
+
targets.forEach(t => t.dispatchEvent(evt))
|
4
|
+
}
|
5
|
+
|
1
6
|
function invoke () {
|
2
7
|
const payload = JSON.parse(this.templateContent.textContent)
|
3
8
|
const { id, selector, receiver, method, args } = payload
|
@@ -13,14 +18,16 @@ function invoke () {
|
|
13
18
|
})
|
14
19
|
}
|
15
20
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
// event dispatch
|
22
|
+
if (method === 'dispatchEvent')
|
23
|
+
return dispatch(receivers, args[0], args[1] || {})
|
24
|
+
|
25
|
+
// property assignment
|
26
|
+
if (method.endsWith('='))
|
27
|
+
return receivers.forEach(r => (r[method.slice(0, -1).trim()] = args[0]))
|
28
|
+
|
29
|
+
// method invocation
|
30
|
+
receivers.forEach(r => r[method].apply(r, args))
|
24
31
|
}
|
25
32
|
|
26
33
|
function initialize (streamActions) {
|
data/bin/standardize
CHANGED
@@ -2,4 +2,7 @@
|
|
2
2
|
|
3
3
|
bundle exec magic_frozen_string_literal
|
4
4
|
bundle exec standardrb --fix
|
5
|
-
yarn run prettier-standard
|
5
|
+
yarn run prettier-standard app/javascript/**/*.js
|
6
|
+
yarn run prettier-standard test/dummy/app/javascript/**/*.js
|
7
|
+
yarn run rustywind --write test/dummy/app
|
8
|
+
yarn run rustywind --write --custom-regex "(:\s[\"'])(.+)[\"']" test/dummy/app/views/_tailwind.yml.erb
|
data/docker-compose.yml
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
version: "3.9"
|
2
|
+
|
3
|
+
x-default-app: &default_app
|
4
|
+
build: .
|
5
|
+
image: turbo_ready
|
6
|
+
tty: true
|
7
|
+
stdin_open: true
|
8
|
+
working_dir: /opt/turbo_ready/test/dummy
|
9
|
+
environment:
|
10
|
+
RAILS_ENV: development
|
11
|
+
volumes:
|
12
|
+
- ./:/opt/turbo_ready:cached
|
13
|
+
- bundle:/usr/local/bundle:delegated
|
14
|
+
- node_modules:/opt/turbo_ready/node_modules:delegated
|
15
|
+
|
16
|
+
volumes:
|
17
|
+
bundle:
|
18
|
+
node_modules:
|
19
|
+
|
20
|
+
services:
|
21
|
+
# ----------------------------------------------------------------------------
|
22
|
+
# Shell - Intended for tinkering and running misc commands
|
23
|
+
# ----------------------------------------------------------------------------
|
24
|
+
shell:
|
25
|
+
<<: *default_app
|
26
|
+
container_name: turbo_ready-shell
|
27
|
+
command: /bin/bash -c "tail -f /dev/null"
|
28
|
+
|
29
|
+
# ----------------------------------------------------------------------------
|
30
|
+
# Web - Runs the test/dummy Rails app
|
31
|
+
# ----------------------------------------------------------------------------
|
32
|
+
web:
|
33
|
+
<<: *default_app
|
34
|
+
container_name: turbo_ready-web
|
35
|
+
ports:
|
36
|
+
- 3000:3000
|
37
|
+
command: >
|
38
|
+
/bin/bash -c "rm -f tmp/pids/server.pid &&
|
39
|
+
bundle --without test &&
|
40
|
+
bundle lock --add-platform aarch64-linux &&
|
41
|
+
bin/rails db:create db:migrate &&
|
42
|
+
bin/rails log:clear &&
|
43
|
+
bin/rails assets:clobber &&
|
44
|
+
bin/rails assets:precompile &&
|
45
|
+
bin/rails s --binding=0.0.0.0 --port=3000"
|
data/fly.toml
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# fly.toml file generated for turbo-ready on 2022-09-19T05:16:01-06:00
|
2
|
+
|
3
|
+
app = "turbo-ready"
|
4
|
+
kill_signal = "SIGINT"
|
5
|
+
kill_timeout = 5
|
6
|
+
processes = []
|
7
|
+
|
8
|
+
[env]
|
9
|
+
|
10
|
+
[experimental]
|
11
|
+
allowed_public_ports = []
|
12
|
+
auto_rollback = true
|
13
|
+
|
14
|
+
[[services]]
|
15
|
+
http_checks = []
|
16
|
+
internal_port = 3000
|
17
|
+
processes = ["app"]
|
18
|
+
protocol = "tcp"
|
19
|
+
script_checks = []
|
20
|
+
[services.concurrency]
|
21
|
+
hard_limit = 25
|
22
|
+
soft_limit = 20
|
23
|
+
type = "connections"
|
24
|
+
|
25
|
+
[[services.ports]]
|
26
|
+
force_https = true
|
27
|
+
handlers = ["http"]
|
28
|
+
port = 80
|
29
|
+
|
30
|
+
[[services.ports]]
|
31
|
+
handlers = ["tls", "http"]
|
32
|
+
port = 443
|
33
|
+
|
34
|
+
[[services.tcp_checks]]
|
35
|
+
grace_period = "1s"
|
36
|
+
interval = "15s"
|
37
|
+
restart_limit = 0
|
38
|
+
timeout = "2s"
|
@@ -17,7 +17,7 @@ module TurboReady::TagHelper
|
|
17
17
|
args = camelize_args(args)
|
18
18
|
end
|
19
19
|
|
20
|
-
method_parts = method.to_s.split(".")
|
20
|
+
method_parts = method.to_s.split(".").map(&:strip).select(&:present?)
|
21
21
|
|
22
22
|
HashWithIndifferentAccess.new(
|
23
23
|
receiver: method_parts[0..-2].join("."),
|
data/lib/turbo_ready/version.rb
CHANGED