actionview-svelte-handler 0.3.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "actionview-svelte-handler",
3
+ "type": "module",
4
+ "private": true,
5
+ "types": "lib/ts/types/builder.d.ts",
6
+ "typescript": {
7
+ "definition": "lib/ts/types/builder.d.ts"
8
+ },
9
+ "ts-standard": {
10
+ "project": "./tsconfig.json",
11
+ "ignore": [
12
+ "./lib/ts/types/",
13
+ "types/"
14
+ ]
15
+ },
16
+ "dependencies": {
17
+ "@babel/core": "^7.25.2",
18
+ "@babel/preset-env": "^7.25.3",
19
+ "esbuild-svelte": "^0.8.1",
20
+ "module-from-string": "^3.3.1",
21
+ "recast": "^0.23.9",
22
+ "svelte": "^4.2.18",
23
+ "svelte-preprocess": "^6.0.2"
24
+ },
25
+ "engines": {
26
+ "node": ">=12.16.0"
27
+ },
28
+ "scripts": {
29
+ "lint": "ts-standard lib/ts/ --fix --format github",
30
+ "build": "node build.esbuild.js",
31
+ "postbuild": "tsc",
32
+ "watch": "node watch.esbuild.js"
33
+ },
34
+ "devDependencies": {
35
+ "esbuild": "0.23.0",
36
+ "ts-standard": "^12.0.2",
37
+ "typescript": "^5.5.4"
38
+ }
39
+ }
@@ -0,0 +1,344 @@
1
+ ---
2
+ path: ".gem_rbs_collection"
3
+ gems:
4
+ - name: actioncable
5
+ version: '7.1'
6
+ source:
7
+ type: git
8
+ name: ruby/gem_rbs_collection
9
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
10
+ remote: https://github.com/ruby/gem_rbs_collection.git
11
+ repo_dir: gems
12
+ - name: actionmailer
13
+ version: '7.0'
14
+ source:
15
+ type: git
16
+ name: ruby/gem_rbs_collection
17
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
18
+ remote: https://github.com/ruby/gem_rbs_collection.git
19
+ repo_dir: gems
20
+ - name: actionpack
21
+ version: '6.0'
22
+ source:
23
+ type: git
24
+ name: ruby/gem_rbs_collection
25
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
26
+ remote: https://github.com/ruby/gem_rbs_collection.git
27
+ repo_dir: gems
28
+ - name: actionview
29
+ version: '6.0'
30
+ source:
31
+ type: git
32
+ name: ruby/gem_rbs_collection
33
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
34
+ remote: https://github.com/ruby/gem_rbs_collection.git
35
+ repo_dir: gems
36
+ - name: activejob
37
+ version: '6.0'
38
+ source:
39
+ type: git
40
+ name: ruby/gem_rbs_collection
41
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
42
+ remote: https://github.com/ruby/gem_rbs_collection.git
43
+ repo_dir: gems
44
+ - name: activemodel
45
+ version: '7.0'
46
+ source:
47
+ type: git
48
+ name: ruby/gem_rbs_collection
49
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
50
+ remote: https://github.com/ruby/gem_rbs_collection.git
51
+ repo_dir: gems
52
+ - name: activerecord
53
+ version: '7.1'
54
+ source:
55
+ type: git
56
+ name: ruby/gem_rbs_collection
57
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
58
+ remote: https://github.com/ruby/gem_rbs_collection.git
59
+ repo_dir: gems
60
+ - name: activestorage
61
+ version: '6.1'
62
+ source:
63
+ type: git
64
+ name: ruby/gem_rbs_collection
65
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
66
+ remote: https://github.com/ruby/gem_rbs_collection.git
67
+ repo_dir: gems
68
+ - name: activesupport
69
+ version: '7.0'
70
+ source:
71
+ type: git
72
+ name: ruby/gem_rbs_collection
73
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
74
+ remote: https://github.com/ruby/gem_rbs_collection.git
75
+ repo_dir: gems
76
+ - name: ast
77
+ version: '2.4'
78
+ source:
79
+ type: git
80
+ name: ruby/gem_rbs_collection
81
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
82
+ remote: https://github.com/ruby/gem_rbs_collection.git
83
+ repo_dir: gems
84
+ - name: base64
85
+ version: '0'
86
+ source:
87
+ type: stdlib
88
+ - name: bigdecimal
89
+ version: '0'
90
+ source:
91
+ type: stdlib
92
+ - name: cgi
93
+ version: '0'
94
+ source:
95
+ type: stdlib
96
+ - name: concurrent-ruby
97
+ version: '1.1'
98
+ source:
99
+ type: git
100
+ name: ruby/gem_rbs_collection
101
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
102
+ remote: https://github.com/ruby/gem_rbs_collection.git
103
+ repo_dir: gems
104
+ - name: connection_pool
105
+ version: '2.4'
106
+ source:
107
+ type: git
108
+ name: ruby/gem_rbs_collection
109
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
110
+ remote: https://github.com/ruby/gem_rbs_collection.git
111
+ repo_dir: gems
112
+ - name: csv
113
+ version: '0'
114
+ source:
115
+ type: stdlib
116
+ - name: date
117
+ version: '0'
118
+ source:
119
+ type: stdlib
120
+ - name: dbm
121
+ version: '0'
122
+ source:
123
+ type: stdlib
124
+ - name: erb
125
+ version: '0'
126
+ source:
127
+ type: stdlib
128
+ - name: fileutils
129
+ version: '0'
130
+ source:
131
+ type: stdlib
132
+ - name: forwardable
133
+ version: '0'
134
+ source:
135
+ type: stdlib
136
+ - name: globalid
137
+ version: '1.1'
138
+ source:
139
+ type: git
140
+ name: ruby/gem_rbs_collection
141
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
142
+ remote: https://github.com/ruby/gem_rbs_collection.git
143
+ repo_dir: gems
144
+ - name: i18n
145
+ version: '1.10'
146
+ source:
147
+ type: git
148
+ name: ruby/gem_rbs_collection
149
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
150
+ remote: https://github.com/ruby/gem_rbs_collection.git
151
+ repo_dir: gems
152
+ - name: io-console
153
+ version: '0'
154
+ source:
155
+ type: stdlib
156
+ - name: json
157
+ version: '0'
158
+ source:
159
+ type: stdlib
160
+ - name: listen
161
+ version: '3.9'
162
+ source:
163
+ type: git
164
+ name: ruby/gem_rbs_collection
165
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
166
+ remote: https://github.com/ruby/gem_rbs_collection.git
167
+ repo_dir: gems
168
+ - name: logger
169
+ version: '0'
170
+ source:
171
+ type: stdlib
172
+ - name: mail
173
+ version: '2.8'
174
+ source:
175
+ type: git
176
+ name: ruby/gem_rbs_collection
177
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
178
+ remote: https://github.com/ruby/gem_rbs_collection.git
179
+ repo_dir: gems
180
+ - name: marcel
181
+ version: '1.0'
182
+ source:
183
+ type: git
184
+ name: ruby/gem_rbs_collection
185
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
186
+ remote: https://github.com/ruby/gem_rbs_collection.git
187
+ repo_dir: gems
188
+ - name: mini_mime
189
+ version: '0.1'
190
+ source:
191
+ type: git
192
+ name: ruby/gem_rbs_collection
193
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
194
+ remote: https://github.com/ruby/gem_rbs_collection.git
195
+ repo_dir: gems
196
+ - name: minitest
197
+ version: '0'
198
+ source:
199
+ type: stdlib
200
+ - name: monitor
201
+ version: '0'
202
+ source:
203
+ type: stdlib
204
+ - name: mutex_m
205
+ version: '0'
206
+ source:
207
+ type: stdlib
208
+ - name: net-protocol
209
+ version: '0'
210
+ source:
211
+ type: stdlib
212
+ - name: net-smtp
213
+ version: '0'
214
+ source:
215
+ type: stdlib
216
+ - name: nokogiri
217
+ version: '1.11'
218
+ source:
219
+ type: git
220
+ name: ruby/gem_rbs_collection
221
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
222
+ remote: https://github.com/ruby/gem_rbs_collection.git
223
+ repo_dir: gems
224
+ - name: optparse
225
+ version: '0'
226
+ source:
227
+ type: stdlib
228
+ - name: parser
229
+ version: '3.2'
230
+ source:
231
+ type: git
232
+ name: ruby/gem_rbs_collection
233
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
234
+ remote: https://github.com/ruby/gem_rbs_collection.git
235
+ repo_dir: gems
236
+ - name: pathname
237
+ version: '0'
238
+ source:
239
+ type: stdlib
240
+ - name: pstore
241
+ version: '0'
242
+ source:
243
+ type: stdlib
244
+ - name: psych
245
+ version: '0'
246
+ source:
247
+ type: stdlib
248
+ - name: rack
249
+ version: '2.2'
250
+ source:
251
+ type: git
252
+ name: ruby/gem_rbs_collection
253
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
254
+ remote: https://github.com/ruby/gem_rbs_collection.git
255
+ repo_dir: gems
256
+ - name: rails-dom-testing
257
+ version: '2.0'
258
+ source:
259
+ type: git
260
+ name: ruby/gem_rbs_collection
261
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
262
+ remote: https://github.com/ruby/gem_rbs_collection.git
263
+ repo_dir: gems
264
+ - name: railties
265
+ version: '6.0'
266
+ source:
267
+ type: git
268
+ name: ruby/gem_rbs_collection
269
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
270
+ remote: https://github.com/ruby/gem_rbs_collection.git
271
+ repo_dir: gems
272
+ - name: rainbow
273
+ version: '3.0'
274
+ source:
275
+ type: git
276
+ name: ruby/gem_rbs_collection
277
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
278
+ remote: https://github.com/ruby/gem_rbs_collection.git
279
+ repo_dir: gems
280
+ - name: rake
281
+ version: '13.0'
282
+ source:
283
+ type: git
284
+ name: ruby/gem_rbs_collection
285
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
286
+ remote: https://github.com/ruby/gem_rbs_collection.git
287
+ repo_dir: gems
288
+ - name: rbs
289
+ version: 3.5.2
290
+ source:
291
+ type: rubygems
292
+ - name: rdoc
293
+ version: '0'
294
+ source:
295
+ type: stdlib
296
+ - name: securerandom
297
+ version: '0'
298
+ source:
299
+ type: stdlib
300
+ - name: singleton
301
+ version: '0'
302
+ source:
303
+ type: stdlib
304
+ - name: strscan
305
+ version: '0'
306
+ source:
307
+ type: stdlib
308
+ - name: tempfile
309
+ version: '0'
310
+ source:
311
+ type: stdlib
312
+ - name: thor
313
+ version: '1.2'
314
+ source:
315
+ type: git
316
+ name: ruby/gem_rbs_collection
317
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
318
+ remote: https://github.com/ruby/gem_rbs_collection.git
319
+ repo_dir: gems
320
+ - name: time
321
+ version: '0'
322
+ source:
323
+ type: stdlib
324
+ - name: timeout
325
+ version: '0'
326
+ source:
327
+ type: stdlib
328
+ - name: tsort
329
+ version: '0'
330
+ source:
331
+ type: stdlib
332
+ - name: tzinfo
333
+ version: '2.0'
334
+ source:
335
+ type: git
336
+ name: ruby/gem_rbs_collection
337
+ revision: 7062b1ca78ffa29275176daa236f9e1cf4018723
338
+ remote: https://github.com/ruby/gem_rbs_collection.git
339
+ repo_dir: gems
340
+ - name: uri
341
+ version: '0'
342
+ source:
343
+ type: stdlib
344
+ gemfile_lock_path: Gemfile.lock
@@ -0,0 +1,18 @@
1
+ # Download sources
2
+ sources:
3
+ - type: git
4
+ name: ruby/gem_rbs_collection
5
+ remote: https://github.com/ruby/gem_rbs_collection.git
6
+ revision: main
7
+ repo_dir: gems
8
+
9
+ # You can specify local directories as sources also.
10
+ # - type: local
11
+ # path: path/to/your/local/repository
12
+
13
+ # A directory to install the downloaded RBSs
14
+ path: .gem_rbs_collection
15
+
16
+ gems:
17
+ - name: ffi
18
+ ignore: true
@@ -0,0 +1,38 @@
1
+ module Svelte
2
+ class CompilerError
3
+ # TODO: ActiveSupport::SyntaxErrorProxy is untyped, so this is an incomplete type definition
4
+ attr_accessor location: { file: String, line: Integer, lineText: String, suggestion: String }
5
+ attr_accessor suggestion: String
6
+ attr_accessor template: ActionView::Template
7
+ attr_accessor message: String
8
+
9
+ def initialize: (String, ActionView::Template) -> self
10
+
11
+ def backtrace: -> Array[String]
12
+ def cause: -> nil
13
+ def binding: -> Array[Binding]
14
+ def backtrace_locations: -> Array[untyped]
15
+ def annotated_source_code: -> Array[String]
16
+ end
17
+
18
+ class TemplateError
19
+ SOURCE_CODE_RADIUS: Integer
20
+ attr_reader template: ActionView::Template
21
+ attr_reader cause: Svelte::CompilerError
22
+
23
+ def initialize: (ActionView::Template, CompilerError) -> self
24
+
25
+ def message: -> String
26
+ def annotated_source_code: -> Array[String]
27
+ # ActionView::Template::Error stuff here
28
+ def file_name: -> String
29
+ def line_number: -> String?
30
+ def source_extract: (Integer?) -> Array[String]
31
+ def backtrace: -> Array[String]
32
+
33
+ private
34
+ def formatted_code_for: (Array[String], Integer?, Integer) -> Array[String]
35
+ def source_location: -> String
36
+
37
+ end
38
+ end
@@ -0,0 +1,9 @@
1
+ module Svelte
2
+ DISCARD_PROPS: Array[String]
3
+ ISLAND_ATTRS: Hash[String, String]
4
+
5
+ class Handler
6
+ def call: (ActionView::Template, String) -> String
7
+ def self.call: (ActionView::Template, String) -> String
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ module Svelte
2
+ module Helpers
3
+ include ActionView::Helpers
4
+ def svelte_tags: -> String
5
+ def destructure_attrs: (Hash[String,String]) -> String
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module Svelte
2
+ VERSION: String
3
+ end
@@ -0,0 +1,19 @@
1
+ type strict_hash = Hash[Symbol, String]
2
+ type flexi_hash = Hash[Symbol | String, String]
3
+
4
+ module Svelte
5
+ self.@ssr: bool
6
+ self.@aliases: strict_hash
7
+ self.@preprocess: flexi_hash
8
+
9
+ def self.ssr: -> bool
10
+ def self.aliases: -> strict_hash
11
+ def self.preprocess: -> flexi_hash
12
+
13
+ def self.ssr=: (boolish) -> void
14
+ def self.aliases=: (strict_hash) -> void
15
+ def self.preprocess=: (flexi_hash) -> void
16
+
17
+ def self.props: -> flexi_hash
18
+ def self.gem_dir: -> String
19
+ end
Binary file
data/tsconfig.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2022",
4
+ "module": "nodenext",
5
+ "rootDir": "./lib/ts/",
6
+ "checkJs": false,
7
+ "declaration": true,
8
+ "declarationDir": "lib/ts/types",
9
+ "emitDeclarationOnly": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "strict": true,
12
+ "noImplicitAny": true,
13
+ "skipLibCheck": true
14
+ }
15
+ }
data/watch.esbuild.js ADDED
@@ -0,0 +1,4 @@
1
+ import buildOpts from './build.esbuild.js'
2
+ import esbuild from 'esbuild'
3
+
4
+ await (await esbuild.context(buildOpts)).watch()
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.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - reesericci
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-29 00:00:00.000000000 Z
11
+ date: 2024-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -31,14 +31,48 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
+ - ".forgejo/workflows/javascript_police.yml"
35
+ - ".forgejo/workflows/ruby_police.yml"
36
+ - ".gitignore"
37
+ - ".ruby-version"
38
+ - Gemfile
39
+ - Gemfile.lock
34
40
  - LICENSE.md
35
41
  - README.md
36
42
  - Rakefile
43
+ - Steepfile
44
+ - actionview-svelte-handler.gemspec
45
+ - bin/test
46
+ - build.esbuild.js
47
+ - lib/generators/svelte/install_generator.rb
48
+ - lib/generators/svelte/templates/install/initializer.rb
37
49
  - lib/svelte.rb
50
+ - lib/svelte/errors.rb
38
51
  - lib/svelte/handler.rb
39
52
  - lib/svelte/helpers.rb
53
+ - lib/svelte/js/.DO_NOT_MODIFY.md
54
+ - lib/svelte/js/builder.js
40
55
  - lib/svelte/railtie.rb
56
+ - lib/svelte/templates/assembler.js.erb
57
+ - lib/svelte/templates/island.html.erb
58
+ - lib/svelte/variabilization.rb
41
59
  - lib/svelte/version.rb
60
+ - lib/tasks/svelte_tasks.rake
61
+ - lib/ts/builder.ts
62
+ - lib/ts/types/.DO_NOT_MODIFY.md
63
+ - lib/ts/types/builder.d.ts
64
+ - package-lock.json
65
+ - package.json
66
+ - rbs_collection.lock.yaml
67
+ - rbs_collection.yaml
68
+ - sig/lib/svelte.rbs
69
+ - sig/lib/svelte/errors.rbs
70
+ - sig/lib/svelte/handler.rbs
71
+ - sig/lib/svelte/helpers.rbs
72
+ - sig/lib/svelte/version.rbs
73
+ - svelte-on-rails.png
74
+ - tsconfig.json
75
+ - watch.esbuild.js
42
76
  homepage: https://codeberg.org/reesericci/actionview-svelte-handler
43
77
  licenses:
44
78
  - LGPL-v3.0-or-later
@@ -60,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
94
  - !ruby/object:Gem::Version
61
95
  version: '0'
62
96
  requirements: []
63
- rubygems_version: 3.5.9
97
+ rubygems_version: 3.5.3
64
98
  signing_key:
65
99
  specification_version: 4
66
100
  summary: Create .svelte views seamlessly in Rails applications