actionview-svelte-handler 0.5.7 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -1
- data/README.md +1 -1
- data/actionview-svelte-handler.gemspec +3 -0
- data/lib/actionview-svelte-handler.rb +1 -0
- data/lib/generators/svelte/install_generator.rb +2 -1
- data/lib/svelte/errors.rb +140 -138
- data/lib/svelte/handler.rb +45 -41
- data/lib/svelte/helpers.rb +1 -1
- data/lib/svelte/js/builder.js +78 -37
- data/lib/svelte/railtie.rb +3 -0
- data/lib/svelte/templates/assembler.js.erb +5 -3
- data/lib/svelte/templates/island.html.erb +7 -9
- data/lib/svelte/version.rb +1 -1
- data/lib/svelte.rb +9 -6
- data/lib/ts/builder.ts +72 -34
- data/lib/ts/types/builder.d.ts +4 -2
- data/package-lock.json +970 -114
- data/package.json +11 -3
- data/rbs_collection.lock.yaml +60 -28
- data/sig/lib/svelte/errors.rbs +35 -34
- data/sig/lib/svelte.rbs +1 -1
- data/tmp/.gitkeep +0 -0
- metadata +19 -4
- data/svelte-on-rails.png +0 -0
data/package.json
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
"name": "actionview-svelte-handler",
|
3
3
|
"type": "module",
|
4
4
|
"private": true,
|
5
|
+
"main": "lib/svelte/js/builder.js",
|
5
6
|
"types": "lib/ts/types/builder.d.ts",
|
6
7
|
"typescript": {
|
7
8
|
"definition": "lib/ts/types/builder.d.ts"
|
@@ -16,10 +17,17 @@
|
|
16
17
|
"dependencies": {
|
17
18
|
"@babel/core": "^7.25.2",
|
18
19
|
"@babel/preset-env": "^7.25.3",
|
19
|
-
"
|
20
|
+
"@rollup/plugin-alias": "^5.1.1",
|
21
|
+
"@rollup/plugin-commonjs": "^26.0.2",
|
22
|
+
"@rollup/plugin-node-resolve": "^15.2.4",
|
23
|
+
"@rollup/plugin-swc": "^0.4.0",
|
24
|
+
"@rollup/plugin-virtual": "^3.0.2",
|
25
|
+
"@swc/core": "^1.7.26",
|
20
26
|
"module-from-string": "^3.3.1",
|
21
27
|
"recast": "^0.23.9",
|
22
|
-
"
|
28
|
+
"rollup": "^4.22.4",
|
29
|
+
"rollup-plugin-svelte": "^7.2.2",
|
30
|
+
"svelte": "^4.2.19",
|
23
31
|
"svelte-preprocess": "^6.0.2"
|
24
32
|
},
|
25
33
|
"engines": {
|
@@ -36,7 +44,7 @@
|
|
36
44
|
"docs:deploy": "vitepress build docs && surge docs/.vitepress/dist"
|
37
45
|
},
|
38
46
|
"devDependencies": {
|
39
|
-
"
|
47
|
+
"@types/convert-source-map": "^2.0.3",
|
40
48
|
"surge": "^0.23.1",
|
41
49
|
"ts-standard": "^12.0.2",
|
42
50
|
"typescript": "^5.5.4",
|
data/rbs_collection.lock.yaml
CHANGED
@@ -6,7 +6,7 @@ gems:
|
|
6
6
|
source:
|
7
7
|
type: git
|
8
8
|
name: ruby/gem_rbs_collection
|
9
|
-
revision:
|
9
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
10
10
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
11
11
|
repo_dir: gems
|
12
12
|
- name: actionmailer
|
@@ -14,7 +14,7 @@ gems:
|
|
14
14
|
source:
|
15
15
|
type: git
|
16
16
|
name: ruby/gem_rbs_collection
|
17
|
-
revision:
|
17
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
18
18
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
19
19
|
repo_dir: gems
|
20
20
|
- name: actionpack
|
@@ -22,7 +22,7 @@ gems:
|
|
22
22
|
source:
|
23
23
|
type: git
|
24
24
|
name: ruby/gem_rbs_collection
|
25
|
-
revision:
|
25
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
26
26
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
27
27
|
repo_dir: gems
|
28
28
|
- name: actionview
|
@@ -30,7 +30,7 @@ gems:
|
|
30
30
|
source:
|
31
31
|
type: git
|
32
32
|
name: ruby/gem_rbs_collection
|
33
|
-
revision:
|
33
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
34
34
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
35
35
|
repo_dir: gems
|
36
36
|
- name: activejob
|
@@ -38,7 +38,7 @@ gems:
|
|
38
38
|
source:
|
39
39
|
type: git
|
40
40
|
name: ruby/gem_rbs_collection
|
41
|
-
revision:
|
41
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
42
42
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
43
43
|
repo_dir: gems
|
44
44
|
- name: activemodel
|
@@ -46,7 +46,7 @@ gems:
|
|
46
46
|
source:
|
47
47
|
type: git
|
48
48
|
name: ruby/gem_rbs_collection
|
49
|
-
revision:
|
49
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
50
50
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
51
51
|
repo_dir: gems
|
52
52
|
- name: activerecord
|
@@ -54,7 +54,7 @@ gems:
|
|
54
54
|
source:
|
55
55
|
type: git
|
56
56
|
name: ruby/gem_rbs_collection
|
57
|
-
revision:
|
57
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
58
58
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
59
59
|
repo_dir: gems
|
60
60
|
- name: activestorage
|
@@ -62,7 +62,7 @@ gems:
|
|
62
62
|
source:
|
63
63
|
type: git
|
64
64
|
name: ruby/gem_rbs_collection
|
65
|
-
revision:
|
65
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
66
66
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
67
67
|
repo_dir: gems
|
68
68
|
- name: activesupport
|
@@ -70,7 +70,7 @@ gems:
|
|
70
70
|
source:
|
71
71
|
type: git
|
72
72
|
name: ruby/gem_rbs_collection
|
73
|
-
revision:
|
73
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
74
74
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
75
75
|
repo_dir: gems
|
76
76
|
- name: ast
|
@@ -78,7 +78,7 @@ gems:
|
|
78
78
|
source:
|
79
79
|
type: git
|
80
80
|
name: ruby/gem_rbs_collection
|
81
|
-
revision:
|
81
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
82
82
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
83
83
|
repo_dir: gems
|
84
84
|
- name: base64
|
@@ -98,7 +98,7 @@ gems:
|
|
98
98
|
source:
|
99
99
|
type: git
|
100
100
|
name: ruby/gem_rbs_collection
|
101
|
-
revision:
|
101
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
102
102
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
103
103
|
repo_dir: gems
|
104
104
|
- name: connection_pool
|
@@ -106,7 +106,7 @@ gems:
|
|
106
106
|
source:
|
107
107
|
type: git
|
108
108
|
name: ruby/gem_rbs_collection
|
109
|
-
revision:
|
109
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
110
110
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
111
111
|
repo_dir: gems
|
112
112
|
- name: csv
|
@@ -138,7 +138,7 @@ gems:
|
|
138
138
|
source:
|
139
139
|
type: git
|
140
140
|
name: ruby/gem_rbs_collection
|
141
|
-
revision:
|
141
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
142
142
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
143
143
|
repo_dir: gems
|
144
144
|
- name: i18n
|
@@ -146,7 +146,7 @@ gems:
|
|
146
146
|
source:
|
147
147
|
type: git
|
148
148
|
name: ruby/gem_rbs_collection
|
149
|
-
revision:
|
149
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
150
150
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
151
151
|
repo_dir: gems
|
152
152
|
- name: io-console
|
@@ -162,7 +162,7 @@ gems:
|
|
162
162
|
source:
|
163
163
|
type: git
|
164
164
|
name: ruby/gem_rbs_collection
|
165
|
-
revision:
|
165
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
166
166
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
167
167
|
repo_dir: gems
|
168
168
|
- name: logger
|
@@ -174,7 +174,7 @@ gems:
|
|
174
174
|
source:
|
175
175
|
type: git
|
176
176
|
name: ruby/gem_rbs_collection
|
177
|
-
revision:
|
177
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
178
178
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
179
179
|
repo_dir: gems
|
180
180
|
- name: marcel
|
@@ -182,7 +182,7 @@ gems:
|
|
182
182
|
source:
|
183
183
|
type: git
|
184
184
|
name: ruby/gem_rbs_collection
|
185
|
-
revision:
|
185
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
186
186
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
187
187
|
repo_dir: gems
|
188
188
|
- name: mini_mime
|
@@ -190,7 +190,7 @@ gems:
|
|
190
190
|
source:
|
191
191
|
type: git
|
192
192
|
name: ruby/gem_rbs_collection
|
193
|
-
revision:
|
193
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
194
194
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
195
195
|
repo_dir: gems
|
196
196
|
- name: minitest
|
@@ -218,19 +218,27 @@ gems:
|
|
218
218
|
source:
|
219
219
|
type: git
|
220
220
|
name: ruby/gem_rbs_collection
|
221
|
-
revision:
|
221
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
222
222
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
223
223
|
repo_dir: gems
|
224
224
|
- name: optparse
|
225
225
|
version: '0'
|
226
226
|
source:
|
227
227
|
type: stdlib
|
228
|
+
- name: parallel
|
229
|
+
version: '1.20'
|
230
|
+
source:
|
231
|
+
type: git
|
232
|
+
name: ruby/gem_rbs_collection
|
233
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
234
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
235
|
+
repo_dir: gems
|
228
236
|
- name: parser
|
229
237
|
version: '3.2'
|
230
238
|
source:
|
231
239
|
type: git
|
232
240
|
name: ruby/gem_rbs_collection
|
233
|
-
revision:
|
241
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
234
242
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
235
243
|
repo_dir: gems
|
236
244
|
- name: pathname
|
@@ -250,7 +258,7 @@ gems:
|
|
250
258
|
source:
|
251
259
|
type: git
|
252
260
|
name: ruby/gem_rbs_collection
|
253
|
-
revision:
|
261
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
254
262
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
255
263
|
repo_dir: gems
|
256
264
|
- name: rails-dom-testing
|
@@ -258,7 +266,7 @@ gems:
|
|
258
266
|
source:
|
259
267
|
type: git
|
260
268
|
name: ruby/gem_rbs_collection
|
261
|
-
revision:
|
269
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
262
270
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
263
271
|
repo_dir: gems
|
264
272
|
- name: railties
|
@@ -266,7 +274,7 @@ gems:
|
|
266
274
|
source:
|
267
275
|
type: git
|
268
276
|
name: ruby/gem_rbs_collection
|
269
|
-
revision:
|
277
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
270
278
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
271
279
|
repo_dir: gems
|
272
280
|
- name: rainbow
|
@@ -274,7 +282,7 @@ gems:
|
|
274
282
|
source:
|
275
283
|
type: git
|
276
284
|
name: ruby/gem_rbs_collection
|
277
|
-
revision:
|
285
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
278
286
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
279
287
|
repo_dir: gems
|
280
288
|
- name: rake
|
@@ -282,17 +290,41 @@ gems:
|
|
282
290
|
source:
|
283
291
|
type: git
|
284
292
|
name: ruby/gem_rbs_collection
|
285
|
-
revision:
|
293
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
286
294
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
287
295
|
repo_dir: gems
|
288
296
|
- name: rbs
|
289
|
-
version: 3.5.
|
297
|
+
version: 3.5.3
|
290
298
|
source:
|
291
299
|
type: rubygems
|
292
300
|
- name: rdoc
|
293
301
|
version: '0'
|
294
302
|
source:
|
295
303
|
type: stdlib
|
304
|
+
- name: regexp_parser
|
305
|
+
version: '2.8'
|
306
|
+
source:
|
307
|
+
type: git
|
308
|
+
name: ruby/gem_rbs_collection
|
309
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
310
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
311
|
+
repo_dir: gems
|
312
|
+
- name: rubocop
|
313
|
+
version: '1.57'
|
314
|
+
source:
|
315
|
+
type: git
|
316
|
+
name: ruby/gem_rbs_collection
|
317
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
318
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
319
|
+
repo_dir: gems
|
320
|
+
- name: rubocop-ast
|
321
|
+
version: '1.30'
|
322
|
+
source:
|
323
|
+
type: git
|
324
|
+
name: ruby/gem_rbs_collection
|
325
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
326
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
327
|
+
repo_dir: gems
|
296
328
|
- name: securerandom
|
297
329
|
version: '0'
|
298
330
|
source:
|
@@ -314,7 +346,7 @@ gems:
|
|
314
346
|
source:
|
315
347
|
type: git
|
316
348
|
name: ruby/gem_rbs_collection
|
317
|
-
revision:
|
349
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
318
350
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
319
351
|
repo_dir: gems
|
320
352
|
- name: time
|
@@ -334,7 +366,7 @@ gems:
|
|
334
366
|
source:
|
335
367
|
type: git
|
336
368
|
name: ruby/gem_rbs_collection
|
337
|
-
revision:
|
369
|
+
revision: f5ccba01753a601607c36f3eb1b5b213307300ab
|
338
370
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
339
371
|
repo_dir: gems
|
340
372
|
- name: uri
|
data/sig/lib/svelte/errors.rbs
CHANGED
@@ -1,38 +1,39 @@
|
|
1
1
|
module Svelte
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
2
|
+
module Errors
|
3
|
+
class CompilerError
|
4
|
+
# TODO: ActiveSupport::SyntaxErrorProxy is untyped, so this is an incomplete type definition
|
5
|
+
attr_accessor location: { file: String, line: Integer, lineText: String, suggestion: String }
|
6
|
+
attr_accessor suggestion: String
|
7
|
+
attr_accessor template: ActionView::Template
|
8
|
+
attr_accessor message: String
|
9
|
+
|
10
|
+
def initialize: (String, ActionView::Template) -> self
|
11
|
+
|
12
|
+
def backtrace: -> Array[String]
|
13
|
+
def cause: -> nil
|
14
|
+
def binding: -> Array[Binding]
|
15
|
+
def backtrace_locations: -> Array[untyped]
|
16
|
+
def annotated_source_code: -> Array[String]
|
17
|
+
end
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
19
|
+
class TemplateError
|
20
|
+
SOURCE_CODE_RADIUS: Integer
|
21
|
+
attr_reader template: ActionView::Template
|
22
|
+
attr_reader cause: Svelte::Errors::CompilerError
|
23
|
+
|
24
|
+
def initialize: (ActionView::Template, Errors::CompilerError) -> self
|
25
|
+
|
26
|
+
def message: -> String
|
27
|
+
def annotated_source_code: -> Array[String]
|
28
|
+
# ActionView::Template::Error stuff here
|
29
|
+
def file_name: -> String
|
30
|
+
def line_number: -> String?
|
31
|
+
def source_extract: (Integer?) -> Array[String]
|
32
|
+
def backtrace: -> Array[String]
|
33
|
+
|
34
|
+
private
|
35
|
+
def formatted_code_for: (Array[String], Integer?, Integer) -> Array[String]
|
36
|
+
def source_location: -> String
|
37
|
+
end
|
37
38
|
end
|
38
39
|
end
|
data/sig/lib/svelte.rbs
CHANGED
@@ -11,7 +11,7 @@ module Svelte
|
|
11
11
|
def self.preprocess: -> flexi_hash
|
12
12
|
|
13
13
|
def self.ssr=: (boolish) -> void
|
14
|
-
def self.aliases=: (strict_hash) -> void
|
14
|
+
def self.aliases=: (strict_hash, bool) -> void
|
15
15
|
def self.preprocess=: (flexi_hash) -> void
|
16
16
|
|
17
17
|
def self.props: -> flexi_hash
|
data/tmp/.gitkeep
ADDED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionview-svelte-handler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- reesericci
|
8
|
-
autorequire:
|
8
|
+
autorequire: svelte
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '7.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: zeitwerk
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2'
|
27
41
|
description: Documentation is available at https://svelte.rb.obl.ong
|
28
42
|
email:
|
29
43
|
- me@reeseric.ci
|
@@ -44,6 +58,7 @@ files:
|
|
44
58
|
- actionview-svelte-handler.gemspec
|
45
59
|
- bin/test
|
46
60
|
- build.esbuild.js
|
61
|
+
- lib/actionview-svelte-handler.rb
|
47
62
|
- lib/generators/svelte/install_generator.rb
|
48
63
|
- lib/generators/svelte/templates/install/initializer.rb
|
49
64
|
- lib/svelte.rb
|
@@ -70,7 +85,7 @@ files:
|
|
70
85
|
- sig/lib/svelte/handler.rbs
|
71
86
|
- sig/lib/svelte/helpers.rbs
|
72
87
|
- sig/lib/svelte/version.rbs
|
73
|
-
-
|
88
|
+
- tmp/.gitkeep
|
74
89
|
- tsconfig.json
|
75
90
|
- watch.esbuild.js
|
76
91
|
homepage: https://svelte.rb.obl.ong
|
data/svelte-on-rails.png
DELETED
Binary file
|