inertia_rails 3.4.0 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +17 -13
  4. data/lib/generators/inertia/controller/controller_generator.rb +18 -0
  5. data/lib/generators/inertia/controller/templates/controller.rb.tt +10 -0
  6. data/lib/generators/inertia/install/frameworks.yml +98 -0
  7. data/lib/generators/inertia/install/helpers.rb +51 -0
  8. data/lib/generators/inertia/install/install_generator.rb +291 -0
  9. data/lib/generators/inertia/install/js_package_manager.rb +50 -0
  10. data/lib/generators/inertia/install/templates/assets/inertia.svg +1 -0
  11. data/lib/generators/inertia/install/templates/assets/react.svg +1 -0
  12. data/lib/generators/inertia/install/templates/assets/svelte.svg +1 -0
  13. data/lib/generators/inertia/install/templates/assets/vite_ruby.svg +1 -0
  14. data/lib/generators/inertia/install/templates/assets/vue.svg +1 -0
  15. data/lib/generators/{inertia_rails/install → inertia/install/templates}/controller.rb +3 -1
  16. data/lib/generators/inertia/install/templates/dev +23 -0
  17. data/lib/generators/inertia/install/templates/initializer.rb +6 -0
  18. data/lib/generators/inertia/install/templates/react/InertiaExample.jsx +60 -0
  19. data/lib/generators/inertia/install/templates/react/InertiaExample.module.css +80 -0
  20. data/lib/generators/inertia/install/templates/react/InertiaExample.tsx +60 -0
  21. data/lib/generators/inertia/install/templates/react/inertia.js +45 -0
  22. data/lib/generators/inertia/install/templates/react/inertia.ts +51 -0
  23. data/lib/generators/inertia/install/templates/react/tsconfig.app.json +27 -0
  24. data/lib/generators/inertia/install/templates/react/tsconfig.json +11 -0
  25. data/lib/generators/inertia/install/templates/react/tsconfig.node.json +13 -0
  26. data/lib/generators/inertia/install/templates/react/vite-env.d.ts +1 -0
  27. data/lib/generators/inertia/install/templates/svelte/InertiaExample.svelte +112 -0
  28. data/lib/generators/inertia/install/templates/svelte/InertiaExample.ts.svelte +112 -0
  29. data/lib/generators/inertia/install/templates/svelte/inertia.js +44 -0
  30. data/lib/generators/inertia/install/templates/svelte/inertia.ts.tt +45 -0
  31. data/lib/generators/inertia/install/templates/svelte/svelte.config.js +7 -0
  32. data/lib/generators/inertia/install/templates/svelte/tsconfig.json +21 -0
  33. data/lib/generators/inertia/install/templates/svelte/tsconfig.node.json +12 -0
  34. data/lib/generators/inertia/install/templates/svelte/vite-env.d.ts +2 -0
  35. data/lib/generators/inertia/install/templates/svelte4/InertiaExample.svelte +116 -0
  36. data/lib/generators/inertia/install/templates/svelte4/InertiaExample.ts.svelte +116 -0
  37. data/lib/generators/inertia/install/templates/svelte4/inertia.js +43 -0
  38. data/lib/generators/inertia/install/templates/svelte4/inertia.ts.tt +44 -0
  39. data/lib/generators/inertia/install/templates/svelte4/svelte.config.js +7 -0
  40. data/lib/generators/inertia/install/templates/svelte4/tsconfig.json +21 -0
  41. data/lib/generators/inertia/install/templates/svelte4/tsconfig.node.json +12 -0
  42. data/lib/generators/inertia/install/templates/svelte4/vite-env.d.ts +2 -0
  43. data/lib/generators/inertia/install/templates/tailwind/application.css +13 -0
  44. data/lib/generators/inertia/install/templates/tailwind/postcss.config.js +6 -0
  45. data/lib/generators/inertia/install/templates/tailwind/tailwind.config.js.tt +18 -0
  46. data/lib/generators/inertia/install/templates/vue/InertiaExample.ts.vue +117 -0
  47. data/lib/generators/inertia/install/templates/vue/InertiaExample.vue +117 -0
  48. data/lib/generators/inertia/install/templates/vue/inertia.js +35 -0
  49. data/lib/generators/inertia/install/templates/vue/inertia.ts +35 -0
  50. data/lib/generators/inertia/install/templates/vue/tsconfig.app.json +24 -0
  51. data/lib/generators/inertia/install/templates/vue/tsconfig.json +11 -0
  52. data/lib/generators/inertia/install/templates/vue/tsconfig.node.json +22 -0
  53. data/lib/generators/inertia/install/templates/vue/vite-env.d.ts +1 -0
  54. data/lib/generators/inertia/scaffold/scaffold_generator.rb +16 -0
  55. data/lib/generators/inertia/scaffold_controller/scaffold_controller_generator.rb +60 -0
  56. data/lib/generators/inertia/scaffold_controller/templates/controller.rb.tt +100 -0
  57. data/lib/generators/inertia_templates/controller/controller_generator.rb +12 -0
  58. data/lib/generators/inertia_templates/controller/templates/react/view.jsx.tt +8 -0
  59. data/lib/generators/inertia_templates/controller/templates/react/view.tsx.tt +8 -0
  60. data/lib/generators/inertia_templates/controller/templates/svelte/view.svelte.tt +2 -0
  61. data/lib/generators/inertia_templates/controller/templates/svelte4/view.svelte.tt +2 -0
  62. data/lib/generators/inertia_templates/controller/templates/vue/view.vue.tt +4 -0
  63. data/lib/generators/inertia_templates/scaffold/scaffold_generator.rb +12 -0
  64. data/lib/generators/inertia_templates/scaffold/templates/react/Edit.jsx.tt +35 -0
  65. data/lib/generators/inertia_templates/scaffold/templates/react/Edit.tsx.tt +40 -0
  66. data/lib/generators/inertia_templates/scaffold/templates/react/Form.jsx.tt +111 -0
  67. data/lib/generators/inertia_templates/scaffold/templates/react/Form.tsx.tt +130 -0
  68. data/lib/generators/inertia_templates/scaffold/templates/react/Index.jsx.tt +26 -0
  69. data/lib/generators/inertia_templates/scaffold/templates/react/Index.tsx.tt +32 -0
  70. data/lib/generators/inertia_templates/scaffold/templates/react/New.jsx.tt +27 -0
  71. data/lib/generators/inertia_templates/scaffold/templates/react/New.tsx.tt +32 -0
  72. data/lib/generators/inertia_templates/scaffold/templates/react/One.jsx.tt +26 -0
  73. data/lib/generators/inertia_templates/scaffold/templates/react/One.tsx.tt +32 -0
  74. data/lib/generators/inertia_templates/scaffold/templates/react/Show.jsx.tt +32 -0
  75. data/lib/generators/inertia_templates/scaffold/templates/react/Show.tsx.tt +38 -0
  76. data/lib/generators/inertia_templates/scaffold/templates/react/types.ts.tt +19 -0
  77. data/lib/generators/inertia_templates/scaffold/templates/svelte/Edit.svelte.tt +36 -0
  78. data/lib/generators/inertia_templates/scaffold/templates/svelte/Edit.ts.svelte.tt +37 -0
  79. data/lib/generators/inertia_templates/scaffold/templates/svelte/Form.svelte.tt +97 -0
  80. data/lib/generators/inertia_templates/scaffold/templates/svelte/Form.ts.svelte.tt +102 -0
  81. data/lib/generators/inertia_templates/scaffold/templates/svelte/Index.svelte.tt +35 -0
  82. data/lib/generators/inertia_templates/scaffold/templates/svelte/Index.ts.svelte.tt +39 -0
  83. data/lib/generators/inertia_templates/scaffold/templates/svelte/New.svelte.tt +29 -0
  84. data/lib/generators/inertia_templates/scaffold/templates/svelte/New.ts.svelte.tt +30 -0
  85. data/lib/generators/inertia_templates/scaffold/templates/svelte/One.svelte.tt +28 -0
  86. data/lib/generators/inertia_templates/scaffold/templates/svelte/One.ts.svelte.tt +30 -0
  87. data/lib/generators/inertia_templates/scaffold/templates/svelte/Show.svelte.tt +35 -0
  88. data/lib/generators/inertia_templates/scaffold/templates/svelte/Show.ts.svelte.tt +39 -0
  89. data/lib/generators/inertia_templates/scaffold/templates/svelte/types.ts.tt +19 -0
  90. data/lib/generators/inertia_templates/scaffold/templates/svelte4/Edit.svelte.tt +37 -0
  91. data/lib/generators/inertia_templates/scaffold/templates/svelte4/Edit.ts.svelte.tt +38 -0
  92. data/lib/generators/inertia_templates/scaffold/templates/svelte4/Form.svelte.tt +96 -0
  93. data/lib/generators/inertia_templates/scaffold/templates/svelte4/Form.ts.svelte.tt +106 -0
  94. data/lib/generators/inertia_templates/scaffold/templates/svelte4/Index.svelte.tt +36 -0
  95. data/lib/generators/inertia_templates/scaffold/templates/svelte4/Index.ts.svelte.tt +37 -0
  96. data/lib/generators/inertia_templates/scaffold/templates/svelte4/New.svelte.tt +30 -0
  97. data/lib/generators/inertia_templates/scaffold/templates/svelte4/New.ts.svelte.tt +31 -0
  98. data/lib/generators/inertia_templates/scaffold/templates/svelte4/One.svelte.tt +28 -0
  99. data/lib/generators/inertia_templates/scaffold/templates/svelte4/One.ts.svelte.tt +30 -0
  100. data/lib/generators/inertia_templates/scaffold/templates/svelte4/Show.svelte.tt +39 -0
  101. data/lib/generators/inertia_templates/scaffold/templates/svelte4/Show.ts.svelte.tt +40 -0
  102. data/lib/generators/inertia_templates/scaffold/templates/svelte4/types.ts.tt +19 -0
  103. data/lib/generators/inertia_templates/scaffold/templates/vue/Edit.ts.vue.tt +37 -0
  104. data/lib/generators/inertia_templates/scaffold/templates/vue/Edit.vue.tt +36 -0
  105. data/lib/generators/inertia_templates/scaffold/templates/vue/Form.ts.vue.tt +101 -0
  106. data/lib/generators/inertia_templates/scaffold/templates/vue/Form.vue.tt +94 -0
  107. data/lib/generators/inertia_templates/scaffold/templates/vue/Index.ts.vue.tt +35 -0
  108. data/lib/generators/inertia_templates/scaffold/templates/vue/Index.vue.tt +31 -0
  109. data/lib/generators/inertia_templates/scaffold/templates/vue/New.ts.vue.tt +30 -0
  110. data/lib/generators/inertia_templates/scaffold/templates/vue/New.vue.tt +29 -0
  111. data/lib/generators/inertia_templates/scaffold/templates/vue/One.ts.vue.tt +28 -0
  112. data/lib/generators/inertia_templates/scaffold/templates/vue/One.vue.tt +26 -0
  113. data/lib/generators/inertia_templates/scaffold/templates/vue/Show.ts.vue.tt +41 -0
  114. data/lib/generators/inertia_templates/scaffold/templates/vue/Show.vue.tt +37 -0
  115. data/lib/generators/inertia_templates/scaffold/templates/vue/types.ts.tt +19 -0
  116. data/lib/generators/inertia_tw_templates/controller/controller_generator.rb +12 -0
  117. data/lib/generators/inertia_tw_templates/controller/templates/react/view.jsx.tt +8 -0
  118. data/lib/generators/inertia_tw_templates/controller/templates/react/view.tsx.tt +8 -0
  119. data/lib/generators/inertia_tw_templates/controller/templates/svelte/view.svelte.tt +2 -0
  120. data/lib/generators/inertia_tw_templates/controller/templates/svelte4/view.svelte.tt +2 -0
  121. data/lib/generators/inertia_tw_templates/controller/templates/vue/view.vue.tt +4 -0
  122. data/lib/generators/inertia_tw_templates/scaffold/scaffold_generator.rb +12 -0
  123. data/lib/generators/inertia_tw_templates/scaffold/templates/react/Edit.jsx.tt +42 -0
  124. data/lib/generators/inertia_tw_templates/scaffold/templates/react/Edit.tsx.tt +47 -0
  125. data/lib/generators/inertia_tw_templates/scaffold/templates/react/Form.jsx.tt +122 -0
  126. data/lib/generators/inertia_tw_templates/scaffold/templates/react/Form.tsx.tt +142 -0
  127. data/lib/generators/inertia_tw_templates/scaffold/templates/react/Index.jsx.tt +43 -0
  128. data/lib/generators/inertia_tw_templates/scaffold/templates/react/Index.tsx.tt +49 -0
  129. data/lib/generators/inertia_tw_templates/scaffold/templates/react/New.jsx.tt +30 -0
  130. data/lib/generators/inertia_tw_templates/scaffold/templates/react/New.tsx.tt +35 -0
  131. data/lib/generators/inertia_tw_templates/scaffold/templates/react/One.jsx.tt +26 -0
  132. data/lib/generators/inertia_tw_templates/scaffold/templates/react/One.tsx.tt +32 -0
  133. data/lib/generators/inertia_tw_templates/scaffold/templates/react/Show.jsx.tt +47 -0
  134. data/lib/generators/inertia_tw_templates/scaffold/templates/react/Show.tsx.tt +53 -0
  135. data/lib/generators/inertia_tw_templates/scaffold/templates/react/types.ts.tt +19 -0
  136. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/Edit.svelte.tt +44 -0
  137. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/Edit.ts.svelte.tt +45 -0
  138. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/Form.svelte.tt +118 -0
  139. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/Form.ts.svelte.tt +123 -0
  140. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/Index.svelte.tt +42 -0
  141. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/Index.ts.svelte.tt +46 -0
  142. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/New.svelte.tt +32 -0
  143. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/New.ts.svelte.tt +33 -0
  144. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/One.svelte.tt +28 -0
  145. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/One.ts.svelte.tt +30 -0
  146. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/Show.svelte.tt +50 -0
  147. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/Show.ts.svelte.tt +54 -0
  148. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/types.ts.tt +19 -0
  149. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Edit.svelte.tt +45 -0
  150. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Edit.ts.svelte.tt +46 -0
  151. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Form.svelte.tt +120 -0
  152. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Form.ts.svelte.tt +130 -0
  153. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Index.svelte.tt +43 -0
  154. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Index.ts.svelte.tt +44 -0
  155. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/New.svelte.tt +33 -0
  156. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/New.ts.svelte.tt +34 -0
  157. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/One.svelte.tt +28 -0
  158. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/One.ts.svelte.tt +30 -0
  159. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Show.svelte.tt +51 -0
  160. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Show.ts.svelte.tt +52 -0
  161. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/types.ts.tt +19 -0
  162. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/Edit.ts.vue.tt +45 -0
  163. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/Edit.vue.tt +44 -0
  164. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/Form.ts.vue.tt +134 -0
  165. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/Form.vue.tt +127 -0
  166. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/Index.ts.vue.tt +47 -0
  167. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/Index.vue.tt +43 -0
  168. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/New.ts.vue.tt +33 -0
  169. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/New.vue.tt +32 -0
  170. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/One.ts.vue.tt +28 -0
  171. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/One.vue.tt +26 -0
  172. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/Show.ts.vue.tt +53 -0
  173. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/Show.vue.tt +49 -0
  174. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/types.ts.tt +19 -0
  175. data/lib/inertia_rails/always_prop.rb +6 -0
  176. data/lib/inertia_rails/base_prop.rb +14 -0
  177. data/lib/inertia_rails/configuration.rb +4 -1
  178. data/lib/inertia_rails/controller.rb +16 -4
  179. data/lib/inertia_rails/defer_prop.rb +21 -0
  180. data/lib/inertia_rails/generators/controller_template_base.rb +63 -0
  181. data/lib/inertia_rails/generators/helper.rb +139 -0
  182. data/lib/inertia_rails/generators/scaffold_template_base.rb +45 -0
  183. data/lib/inertia_rails/ignore_on_first_load_prop.rb +6 -0
  184. data/lib/inertia_rails/inertia_rails.rb +34 -12
  185. data/lib/inertia_rails/lazy_prop.rb +24 -0
  186. data/lib/inertia_rails/merge_prop.rb +14 -0
  187. data/lib/inertia_rails/middleware.rb +7 -2
  188. data/lib/inertia_rails/optional_prop.rb +6 -0
  189. data/lib/inertia_rails/renderer.rb +106 -20
  190. data/lib/inertia_rails/version.rb +1 -1
  191. data/lib/inertia_rails.rb +2 -0
  192. data/lib/patches/better_errors.rb +10 -8
  193. data/lib/patches/debug_exceptions/patch-5-0.rb +7 -3
  194. data/lib/patches/debug_exceptions/patch-5-1.rb +7 -3
  195. data/lib/patches/mapper.rb +9 -5
  196. data/lib/patches/request.rb +10 -6
  197. metadata +185 -13
  198. data/lib/generators/inertia_rails/install/react/InertiaExample.jsx +0 -9
  199. data/lib/generators/inertia_rails/install/react/inertia.jsx +0 -17
  200. data/lib/generators/inertia_rails/install/svelte/InertiaExample.svelte +0 -11
  201. data/lib/generators/inertia_rails/install/svelte/inertia.js +0 -14
  202. data/lib/generators/inertia_rails/install/vue/InertiaExample.vue +0 -11
  203. data/lib/generators/inertia_rails/install/vue/inertia.js +0 -20
  204. data/lib/generators/inertia_rails/install_generator.rb +0 -84
  205. data/lib/inertia_rails/lazy.rb +0 -28
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inertia_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Knoles
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-11-02 00:00:00.000000000 Z
13
+ date: 2024-12-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: railties
@@ -41,23 +41,195 @@ files:
41
41
  - README.md
42
42
  - app/controllers/inertia_rails/static_controller.rb
43
43
  - app/views/inertia.html.erb
44
- - lib/generators/inertia_rails/install/controller.rb
45
- - lib/generators/inertia_rails/install/react/InertiaExample.jsx
46
- - lib/generators/inertia_rails/install/react/inertia.jsx
47
- - lib/generators/inertia_rails/install/svelte/InertiaExample.svelte
48
- - lib/generators/inertia_rails/install/svelte/inertia.js
49
- - lib/generators/inertia_rails/install/vue/InertiaExample.vue
50
- - lib/generators/inertia_rails/install/vue/inertia.js
51
- - lib/generators/inertia_rails/install_generator.rb
44
+ - lib/generators/inertia/controller/controller_generator.rb
45
+ - lib/generators/inertia/controller/templates/controller.rb.tt
46
+ - lib/generators/inertia/install/frameworks.yml
47
+ - lib/generators/inertia/install/helpers.rb
48
+ - lib/generators/inertia/install/install_generator.rb
49
+ - lib/generators/inertia/install/js_package_manager.rb
50
+ - lib/generators/inertia/install/templates/assets/inertia.svg
51
+ - lib/generators/inertia/install/templates/assets/react.svg
52
+ - lib/generators/inertia/install/templates/assets/svelte.svg
53
+ - lib/generators/inertia/install/templates/assets/vite_ruby.svg
54
+ - lib/generators/inertia/install/templates/assets/vue.svg
55
+ - lib/generators/inertia/install/templates/controller.rb
56
+ - lib/generators/inertia/install/templates/dev
57
+ - lib/generators/inertia/install/templates/initializer.rb
58
+ - lib/generators/inertia/install/templates/react/InertiaExample.jsx
59
+ - lib/generators/inertia/install/templates/react/InertiaExample.module.css
60
+ - lib/generators/inertia/install/templates/react/InertiaExample.tsx
61
+ - lib/generators/inertia/install/templates/react/inertia.js
62
+ - lib/generators/inertia/install/templates/react/inertia.ts
63
+ - lib/generators/inertia/install/templates/react/tsconfig.app.json
64
+ - lib/generators/inertia/install/templates/react/tsconfig.json
65
+ - lib/generators/inertia/install/templates/react/tsconfig.node.json
66
+ - lib/generators/inertia/install/templates/react/vite-env.d.ts
67
+ - lib/generators/inertia/install/templates/svelte/InertiaExample.svelte
68
+ - lib/generators/inertia/install/templates/svelte/InertiaExample.ts.svelte
69
+ - lib/generators/inertia/install/templates/svelte/inertia.js
70
+ - lib/generators/inertia/install/templates/svelte/inertia.ts.tt
71
+ - lib/generators/inertia/install/templates/svelte/svelte.config.js
72
+ - lib/generators/inertia/install/templates/svelte/tsconfig.json
73
+ - lib/generators/inertia/install/templates/svelte/tsconfig.node.json
74
+ - lib/generators/inertia/install/templates/svelte/vite-env.d.ts
75
+ - lib/generators/inertia/install/templates/svelte4/InertiaExample.svelte
76
+ - lib/generators/inertia/install/templates/svelte4/InertiaExample.ts.svelte
77
+ - lib/generators/inertia/install/templates/svelte4/inertia.js
78
+ - lib/generators/inertia/install/templates/svelte4/inertia.ts.tt
79
+ - lib/generators/inertia/install/templates/svelte4/svelte.config.js
80
+ - lib/generators/inertia/install/templates/svelte4/tsconfig.json
81
+ - lib/generators/inertia/install/templates/svelte4/tsconfig.node.json
82
+ - lib/generators/inertia/install/templates/svelte4/vite-env.d.ts
83
+ - lib/generators/inertia/install/templates/tailwind/application.css
84
+ - lib/generators/inertia/install/templates/tailwind/postcss.config.js
85
+ - lib/generators/inertia/install/templates/tailwind/tailwind.config.js.tt
86
+ - lib/generators/inertia/install/templates/vue/InertiaExample.ts.vue
87
+ - lib/generators/inertia/install/templates/vue/InertiaExample.vue
88
+ - lib/generators/inertia/install/templates/vue/inertia.js
89
+ - lib/generators/inertia/install/templates/vue/inertia.ts
90
+ - lib/generators/inertia/install/templates/vue/tsconfig.app.json
91
+ - lib/generators/inertia/install/templates/vue/tsconfig.json
92
+ - lib/generators/inertia/install/templates/vue/tsconfig.node.json
93
+ - lib/generators/inertia/install/templates/vue/vite-env.d.ts
94
+ - lib/generators/inertia/scaffold/scaffold_generator.rb
95
+ - lib/generators/inertia/scaffold_controller/scaffold_controller_generator.rb
96
+ - lib/generators/inertia/scaffold_controller/templates/controller.rb.tt
97
+ - lib/generators/inertia_templates/controller/controller_generator.rb
98
+ - lib/generators/inertia_templates/controller/templates/react/view.jsx.tt
99
+ - lib/generators/inertia_templates/controller/templates/react/view.tsx.tt
100
+ - lib/generators/inertia_templates/controller/templates/svelte/view.svelte.tt
101
+ - lib/generators/inertia_templates/controller/templates/svelte4/view.svelte.tt
102
+ - lib/generators/inertia_templates/controller/templates/vue/view.vue.tt
103
+ - lib/generators/inertia_templates/scaffold/scaffold_generator.rb
104
+ - lib/generators/inertia_templates/scaffold/templates/react/Edit.jsx.tt
105
+ - lib/generators/inertia_templates/scaffold/templates/react/Edit.tsx.tt
106
+ - lib/generators/inertia_templates/scaffold/templates/react/Form.jsx.tt
107
+ - lib/generators/inertia_templates/scaffold/templates/react/Form.tsx.tt
108
+ - lib/generators/inertia_templates/scaffold/templates/react/Index.jsx.tt
109
+ - lib/generators/inertia_templates/scaffold/templates/react/Index.tsx.tt
110
+ - lib/generators/inertia_templates/scaffold/templates/react/New.jsx.tt
111
+ - lib/generators/inertia_templates/scaffold/templates/react/New.tsx.tt
112
+ - lib/generators/inertia_templates/scaffold/templates/react/One.jsx.tt
113
+ - lib/generators/inertia_templates/scaffold/templates/react/One.tsx.tt
114
+ - lib/generators/inertia_templates/scaffold/templates/react/Show.jsx.tt
115
+ - lib/generators/inertia_templates/scaffold/templates/react/Show.tsx.tt
116
+ - lib/generators/inertia_templates/scaffold/templates/react/types.ts.tt
117
+ - lib/generators/inertia_templates/scaffold/templates/svelte/Edit.svelte.tt
118
+ - lib/generators/inertia_templates/scaffold/templates/svelte/Edit.ts.svelte.tt
119
+ - lib/generators/inertia_templates/scaffold/templates/svelte/Form.svelte.tt
120
+ - lib/generators/inertia_templates/scaffold/templates/svelte/Form.ts.svelte.tt
121
+ - lib/generators/inertia_templates/scaffold/templates/svelte/Index.svelte.tt
122
+ - lib/generators/inertia_templates/scaffold/templates/svelte/Index.ts.svelte.tt
123
+ - lib/generators/inertia_templates/scaffold/templates/svelte/New.svelte.tt
124
+ - lib/generators/inertia_templates/scaffold/templates/svelte/New.ts.svelte.tt
125
+ - lib/generators/inertia_templates/scaffold/templates/svelte/One.svelte.tt
126
+ - lib/generators/inertia_templates/scaffold/templates/svelte/One.ts.svelte.tt
127
+ - lib/generators/inertia_templates/scaffold/templates/svelte/Show.svelte.tt
128
+ - lib/generators/inertia_templates/scaffold/templates/svelte/Show.ts.svelte.tt
129
+ - lib/generators/inertia_templates/scaffold/templates/svelte/types.ts.tt
130
+ - lib/generators/inertia_templates/scaffold/templates/svelte4/Edit.svelte.tt
131
+ - lib/generators/inertia_templates/scaffold/templates/svelte4/Edit.ts.svelte.tt
132
+ - lib/generators/inertia_templates/scaffold/templates/svelte4/Form.svelte.tt
133
+ - lib/generators/inertia_templates/scaffold/templates/svelte4/Form.ts.svelte.tt
134
+ - lib/generators/inertia_templates/scaffold/templates/svelte4/Index.svelte.tt
135
+ - lib/generators/inertia_templates/scaffold/templates/svelte4/Index.ts.svelte.tt
136
+ - lib/generators/inertia_templates/scaffold/templates/svelte4/New.svelte.tt
137
+ - lib/generators/inertia_templates/scaffold/templates/svelte4/New.ts.svelte.tt
138
+ - lib/generators/inertia_templates/scaffold/templates/svelte4/One.svelte.tt
139
+ - lib/generators/inertia_templates/scaffold/templates/svelte4/One.ts.svelte.tt
140
+ - lib/generators/inertia_templates/scaffold/templates/svelte4/Show.svelte.tt
141
+ - lib/generators/inertia_templates/scaffold/templates/svelte4/Show.ts.svelte.tt
142
+ - lib/generators/inertia_templates/scaffold/templates/svelte4/types.ts.tt
143
+ - lib/generators/inertia_templates/scaffold/templates/vue/Edit.ts.vue.tt
144
+ - lib/generators/inertia_templates/scaffold/templates/vue/Edit.vue.tt
145
+ - lib/generators/inertia_templates/scaffold/templates/vue/Form.ts.vue.tt
146
+ - lib/generators/inertia_templates/scaffold/templates/vue/Form.vue.tt
147
+ - lib/generators/inertia_templates/scaffold/templates/vue/Index.ts.vue.tt
148
+ - lib/generators/inertia_templates/scaffold/templates/vue/Index.vue.tt
149
+ - lib/generators/inertia_templates/scaffold/templates/vue/New.ts.vue.tt
150
+ - lib/generators/inertia_templates/scaffold/templates/vue/New.vue.tt
151
+ - lib/generators/inertia_templates/scaffold/templates/vue/One.ts.vue.tt
152
+ - lib/generators/inertia_templates/scaffold/templates/vue/One.vue.tt
153
+ - lib/generators/inertia_templates/scaffold/templates/vue/Show.ts.vue.tt
154
+ - lib/generators/inertia_templates/scaffold/templates/vue/Show.vue.tt
155
+ - lib/generators/inertia_templates/scaffold/templates/vue/types.ts.tt
156
+ - lib/generators/inertia_tw_templates/controller/controller_generator.rb
157
+ - lib/generators/inertia_tw_templates/controller/templates/react/view.jsx.tt
158
+ - lib/generators/inertia_tw_templates/controller/templates/react/view.tsx.tt
159
+ - lib/generators/inertia_tw_templates/controller/templates/svelte/view.svelte.tt
160
+ - lib/generators/inertia_tw_templates/controller/templates/svelte4/view.svelte.tt
161
+ - lib/generators/inertia_tw_templates/controller/templates/vue/view.vue.tt
162
+ - lib/generators/inertia_tw_templates/scaffold/scaffold_generator.rb
163
+ - lib/generators/inertia_tw_templates/scaffold/templates/react/Edit.jsx.tt
164
+ - lib/generators/inertia_tw_templates/scaffold/templates/react/Edit.tsx.tt
165
+ - lib/generators/inertia_tw_templates/scaffold/templates/react/Form.jsx.tt
166
+ - lib/generators/inertia_tw_templates/scaffold/templates/react/Form.tsx.tt
167
+ - lib/generators/inertia_tw_templates/scaffold/templates/react/Index.jsx.tt
168
+ - lib/generators/inertia_tw_templates/scaffold/templates/react/Index.tsx.tt
169
+ - lib/generators/inertia_tw_templates/scaffold/templates/react/New.jsx.tt
170
+ - lib/generators/inertia_tw_templates/scaffold/templates/react/New.tsx.tt
171
+ - lib/generators/inertia_tw_templates/scaffold/templates/react/One.jsx.tt
172
+ - lib/generators/inertia_tw_templates/scaffold/templates/react/One.tsx.tt
173
+ - lib/generators/inertia_tw_templates/scaffold/templates/react/Show.jsx.tt
174
+ - lib/generators/inertia_tw_templates/scaffold/templates/react/Show.tsx.tt
175
+ - lib/generators/inertia_tw_templates/scaffold/templates/react/types.ts.tt
176
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte/Edit.svelte.tt
177
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte/Edit.ts.svelte.tt
178
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte/Form.svelte.tt
179
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte/Form.ts.svelte.tt
180
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte/Index.svelte.tt
181
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte/Index.ts.svelte.tt
182
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte/New.svelte.tt
183
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte/New.ts.svelte.tt
184
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte/One.svelte.tt
185
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte/One.ts.svelte.tt
186
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte/Show.svelte.tt
187
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte/Show.ts.svelte.tt
188
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte/types.ts.tt
189
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Edit.svelte.tt
190
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Edit.ts.svelte.tt
191
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Form.svelte.tt
192
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Form.ts.svelte.tt
193
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Index.svelte.tt
194
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Index.ts.svelte.tt
195
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte4/New.svelte.tt
196
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte4/New.ts.svelte.tt
197
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte4/One.svelte.tt
198
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte4/One.ts.svelte.tt
199
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Show.svelte.tt
200
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Show.ts.svelte.tt
201
+ - lib/generators/inertia_tw_templates/scaffold/templates/svelte4/types.ts.tt
202
+ - lib/generators/inertia_tw_templates/scaffold/templates/vue/Edit.ts.vue.tt
203
+ - lib/generators/inertia_tw_templates/scaffold/templates/vue/Edit.vue.tt
204
+ - lib/generators/inertia_tw_templates/scaffold/templates/vue/Form.ts.vue.tt
205
+ - lib/generators/inertia_tw_templates/scaffold/templates/vue/Form.vue.tt
206
+ - lib/generators/inertia_tw_templates/scaffold/templates/vue/Index.ts.vue.tt
207
+ - lib/generators/inertia_tw_templates/scaffold/templates/vue/Index.vue.tt
208
+ - lib/generators/inertia_tw_templates/scaffold/templates/vue/New.ts.vue.tt
209
+ - lib/generators/inertia_tw_templates/scaffold/templates/vue/New.vue.tt
210
+ - lib/generators/inertia_tw_templates/scaffold/templates/vue/One.ts.vue.tt
211
+ - lib/generators/inertia_tw_templates/scaffold/templates/vue/One.vue.tt
212
+ - lib/generators/inertia_tw_templates/scaffold/templates/vue/Show.ts.vue.tt
213
+ - lib/generators/inertia_tw_templates/scaffold/templates/vue/Show.vue.tt
214
+ - lib/generators/inertia_tw_templates/scaffold/templates/vue/types.ts.tt
52
215
  - lib/inertia_rails.rb
53
216
  - lib/inertia_rails/action_filter.rb
217
+ - lib/inertia_rails/always_prop.rb
218
+ - lib/inertia_rails/base_prop.rb
54
219
  - lib/inertia_rails/configuration.rb
55
220
  - lib/inertia_rails/controller.rb
221
+ - lib/inertia_rails/defer_prop.rb
56
222
  - lib/inertia_rails/engine.rb
223
+ - lib/inertia_rails/generators/controller_template_base.rb
224
+ - lib/inertia_rails/generators/helper.rb
225
+ - lib/inertia_rails/generators/scaffold_template_base.rb
57
226
  - lib/inertia_rails/helper.rb
227
+ - lib/inertia_rails/ignore_on_first_load_prop.rb
58
228
  - lib/inertia_rails/inertia_rails.rb
59
- - lib/inertia_rails/lazy.rb
229
+ - lib/inertia_rails/lazy_prop.rb
230
+ - lib/inertia_rails/merge_prop.rb
60
231
  - lib/inertia_rails/middleware.rb
232
+ - lib/inertia_rails/optional_prop.rb
61
233
  - lib/inertia_rails/renderer.rb
62
234
  - lib/inertia_rails/rspec.rb
63
235
  - lib/inertia_rails/version.rb
@@ -86,14 +258,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
258
  requirements:
87
259
  - - ">="
88
260
  - !ruby/object:Gem::Version
89
- version: '0'
261
+ version: '3.0'
90
262
  required_rubygems_version: !ruby/object:Gem::Requirement
91
263
  requirements:
92
264
  - - ">="
93
265
  - !ruby/object:Gem::Version
94
266
  version: '0'
95
267
  requirements: []
96
- rubygems_version: 3.5.11
268
+ rubygems_version: 3.5.22
97
269
  signing_key:
98
270
  specification_version: 4
99
271
  summary: Inertia.js adapter for Rails
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
-
3
- const InertiaExample = ({name}) => (
4
- <>
5
- <h1>Hello {name}!</h1>
6
- </>
7
- );
8
-
9
- export default InertiaExample;
@@ -1,17 +0,0 @@
1
- import { App } from '@inertiajs/inertia-react';
2
- import React from 'react';
3
- import { render } from 'react-dom';
4
- import { InertiaProgress } from '@inertiajs/progress';
5
-
6
- document.addEventListener('DOMContentLoaded', () => {
7
- InertiaProgress.init();
8
- const el = document.getElementById('app')
9
-
10
- render(
11
- <App
12
- initialPage={JSON.parse(el.dataset.page)}
13
- resolveComponent={name => require(`../Pages/${name}`).default}
14
- />,
15
- el
16
- )
17
- });
@@ -1,11 +0,0 @@
1
- <script>
2
- export let name;
3
- </script>
4
-
5
- <style>
6
- h1 { font-family: sans-serif; text-align: center; }
7
- </style>
8
-
9
- <h1>
10
- Hello {name}!
11
- </h1>
@@ -1,14 +0,0 @@
1
- import { createInertiaApp } from '@inertiajs/inertia-svelte'
2
- import { InertiaProgress } from '@inertiajs/progress'
3
-
4
- document.addEventListener('DOMContentLoaded', () => {
5
- InertiaProgress.init()
6
-
7
- createInertiaApp({
8
- id: 'app',
9
- resolve: name => import(`../Pages/${name}.svelte`),
10
- setup({ el, App, props }) {
11
- new App({ target: el, props })
12
- },
13
- })
14
- })
@@ -1,11 +0,0 @@
1
- <template>
2
- <h1 :style="{ 'text-align': 'center' }">Hello {{name}}!</h1>
3
- </template>
4
-
5
- <script>
6
- export default {
7
- props: {
8
- name: { type: String, required: true },
9
- },
10
- }
11
- </script>
@@ -1,20 +0,0 @@
1
- import Vue from 'vue'
2
-
3
- import { app, plugin } from '@inertiajs/inertia-vue'
4
- import { InertiaProgress } from '@inertiajs/progress'
5
-
6
- document.addEventListener('DOMContentLoaded', () => {
7
- InertiaProgress.init();
8
- const el = document.getElementById('app')
9
-
10
- Vue.use(plugin)
11
-
12
- new Vue({
13
- render: h => h(app, {
14
- props: {
15
- initialPage: JSON.parse(el.dataset.page),
16
- resolveComponent: name => require(`../Pages/${name}`).default,
17
- },
18
- }),
19
- }).$mount(el)
20
- })
@@ -1,84 +0,0 @@
1
- module InertiaRails
2
- class InstallGenerator < Rails::Generators::Base
3
- source_root File.expand_path('./install', __dir__)
4
- class_option :front_end, type: :string, default: 'react'
5
-
6
- FRONT_END_INSTALLERS = [
7
- 'react',
8
- 'vue',
9
- 'svelte',
10
- ]
11
-
12
- def install
13
- exit! unless installable?
14
-
15
- install_base!
16
-
17
- send "install_#{options[:front_end]}!"
18
-
19
- say "You're all set! Run rails s and checkout localhost:3000/inertia-example", :green
20
- end
21
-
22
- protected
23
-
24
- def installable?
25
- unless run("./bin/rails webpacker:verify_install")
26
- say "Sorry, you need to have webpacker installed for inertia_rails default setup.", :red
27
- return false
28
- end
29
-
30
- unless options[:front_end].in? FRONT_END_INSTALLERS
31
- say "Sorry, there is no generator for #{options[:front_end]}!\n\n", :red
32
- say "If you are a #{options[:front_end]} developer, please help us improve inertia_rails by contributing an installer.\n\n"
33
- say "https://github.com/inertiajs/inertia-rails/\n\n"
34
-
35
- return false
36
- end
37
-
38
- true
39
- end
40
-
41
- def install_base!
42
- say "Adding inertia pack tag to application layout", :blue
43
- insert_into_file Rails.root.join("app/views/layouts/application.html.erb").to_s, after: "<%= javascript_pack_tag 'application' %>\n" do
44
- "\t\t<%= javascript_pack_tag 'inertia' %>\n"
45
- end
46
-
47
- say "Installing inertia client packages", :blue
48
- run "yarn add @inertiajs/inertia @inertiajs/progress"
49
-
50
- say "Copying example files", :blue
51
- template "controller.rb", Rails.root.join("app/controllers/inertia_example_controller.rb").to_s
52
-
53
- say "Adding a route for the example inertia controller...", :blue
54
- route "get 'inertia-example', to: 'inertia_example#index'"
55
- end
56
-
57
- def install_react!
58
- say "Creating a React page component...", :blue
59
- run 'yarn add @inertiajs/inertia-react'
60
- template "react/InertiaExample.jsx", Rails.root.join("app/javascript/Pages/InertiaExample.js").to_s
61
- say "Copying inertia.jsx into webpacker's packs folder...", :blue
62
- template "react/inertia.jsx", Rails.root.join("app/javascript/packs/inertia.jsx").to_s
63
- say "done!", :green
64
- end
65
-
66
- def install_vue!
67
- say "Creating a Vue page component...", :blue
68
- run 'yarn add @inertiajs/inertia-vue'
69
- template "vue/InertiaExample.vue", Rails.root.join("app/javascript/Pages/InertiaExample.vue").to_s
70
- say "Copying inertia.js into webpacker's packs folder...", :blue
71
- template "vue/inertia.js", Rails.root.join("app/javascript/packs/inertia.js").to_s
72
- say "done!", :green
73
- end
74
-
75
- def install_svelte!
76
- say "Creating a Svelte page component...", :blue
77
- run 'yarn add @inertiajs/inertia-svelte'
78
- template "svelte/InertiaExample.svelte", Rails.root.join("app/javascript/Pages/InertiaExample.svelte").to_s
79
- say "Copying inertia.js into webpacker's packs folder...", :blue
80
- template "svelte/inertia.js", Rails.root.join("app/javascript/packs/inertia.js").to_s
81
- say "done!", :green
82
- end
83
- end
84
- end
@@ -1,28 +0,0 @@
1
- module InertiaRails
2
- class Lazy
3
- def initialize(value = nil, &block)
4
- @value = value
5
- @block = block
6
- end
7
-
8
- def call
9
- to_proc.call
10
- end
11
-
12
- def to_proc
13
- # This is called by controller.instance_exec, which changes self to the
14
- # controller instance. That makes the instance variables unavailable to the
15
- # proc via closure. Copying the instance variables to local variables before
16
- # the proc is returned keeps them in scope for the returned proc.
17
- value = @value
18
- block = @block
19
- if value.respond_to?(:call)
20
- value
21
- elsif value
22
- Proc.new { value }
23
- else
24
- block
25
- end
26
- end
27
- end
28
- end