svelte-on-rails 19.0.0 → 19.1.0

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: 6b284e11f440211f67f51444cb124baf8e2877f0e3bf3f61b2d9c8da091a1167
4
- data.tar.gz: f8ba49f78fcb374c85aa2c99d26de8f33b5c308855a60c4d4284c6c7f7104090
3
+ metadata.gz: 5049b130ccd29a617efacc42ad6519c00da77ca6540aa120a6fb49e9861cb148
4
+ data.tar.gz: 72109a11c7830f358d8a1a06b006be4c7ba23f9b2b9538a5dbdaca743cead441
5
5
  SHA512:
6
- metadata.gz: 0c7cfed392c0ddb72e2780fa622eea2b5aa2400ff247e353b04d0c521a10094e3e4f491f92919b7981df233ba550f5cc5f876bcf7cf098543f633951705d435a
7
- data.tar.gz: 31ddd13fcc562b8d9642ecd33a2295acb95b93c35ef4ea93b0291cdc54f00f0a0266bb8496271392ccecebaa9b90047bebc0d1d25c62fe6771aa97630c49cb89
6
+ metadata.gz: b0b8649b96c1f633d2b3f8697d385d1e078b5e965c07edfc4197b0e1b5d82e1791792184119968f5555244876ad8d13c596dbedfd1840fff238c524ec8173fcf
7
+ data.tar.gz: 3a2fb7867f8ffb487b35eedf7d83b6ddba6258d0bfee08c05d6341c52da01304b05dd8649c56947584e06da609d9826629b2317c9d802757544b65a79e5851a4
@@ -54,14 +54,14 @@ module SvelteOnRails
54
54
  path = if aliases[ali]
55
55
  File.join(aliases[ali], component.sub(/^#{ali}\//, '')) + '.svelte'
56
56
  elsif cnf[:default_components_root].to_s.match(/^app\/views/)
57
- attempts = [
57
+ @attempts = [
58
58
  File.join('app', 'views', dir, "_#{file_basename}" + '.svelte'),
59
59
  File.join('app', 'views', dir, file_basename + '.svelte'),
60
60
  File.join('app', 'views', current_controller_path, dir, "_#{file_basename}" + '.svelte'),
61
61
  File.join('app', 'views', current_controller_path, dir, file_basename + '.svelte'),
62
62
  ]
63
63
 
64
- attempts.find { |f| File.exist? Rails.root.join(f) }
64
+ @attempts.find { |f| File.exist? Rails.root.join(f) }
65
65
  else
66
66
  cmp_root = File.join(cnf[:vite_source_dir], cnf[:components_subdir])
67
67
  File.join(cmp_root, dir, file_basename + '.svelte')
@@ -81,7 +81,8 @@ module SvelteOnRails
81
81
  component: [(dir.present? ? dir : nil), file_basename].compact.join('/'),
82
82
  file_basename: file_basename,
83
83
  name: file_basename.camelcase,
84
- vite_path: vite_path
84
+ vite_path: vite_path,
85
+ failed_attempts: (@attempts unless path)
85
86
  }
86
87
  end
87
88
 
@@ -32,10 +32,14 @@ module SvelteOnRails
32
32
  # check file existence and capitalization
33
33
 
34
34
  p = component_paths
35
- unless File.exist?(Rails.root.join(p[:path]))
35
+ if !p[:path]
36
36
  raise <<~TEXT
37
- [SOR] Source file not found: «#{p[:path]}»
38
-
37
+ [Svelte on Rails] Component source file not found, searched by:
38
+ • #{p[:failed_attempts].join("\n • ")}
39
+ TEXT
40
+ elsif !File.exist?(Rails.root.join(p[:path]))
41
+ raise <<~TEXT
42
+ [Svelte on Rails] Source file not found: «#{p[:path]}»
39
43
  TEXT
40
44
  end
41
45
  if p[:path][0..9] == 'app/views/'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svelte-on-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 19.0.0
4
+ version: 19.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Sedlmair