inertia_rails-contrib 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/README.md +12 -134
  4. data/lib/inertia_rails_contrib/version.rb +1 -1
  5. metadata +5 -134
  6. data/lib/generators/inertia/controller/controller_generator.rb +0 -16
  7. data/lib/generators/inertia/controller/templates/controller.rb.tt +0 -10
  8. data/lib/generators/inertia/install/frameworks.yml +0 -98
  9. data/lib/generators/inertia/install/helpers.rb +0 -48
  10. data/lib/generators/inertia/install/install_generator.rb +0 -286
  11. data/lib/generators/inertia/install/templates/assets/inertia.svg +0 -1
  12. data/lib/generators/inertia/install/templates/assets/react.svg +0 -1
  13. data/lib/generators/inertia/install/templates/assets/svelte.svg +0 -1
  14. data/lib/generators/inertia/install/templates/assets/vite_ruby.svg +0 -1
  15. data/lib/generators/inertia/install/templates/assets/vue.svg +0 -1
  16. data/lib/generators/inertia/install/templates/controller.rb +0 -7
  17. data/lib/generators/inertia/install/templates/dev +0 -23
  18. data/lib/generators/inertia/install/templates/initializer.rb +0 -4
  19. data/lib/generators/inertia/install/templates/react/InertiaExample.jsx +0 -60
  20. data/lib/generators/inertia/install/templates/react/InertiaExample.module.css +0 -80
  21. data/lib/generators/inertia/install/templates/react/InertiaExample.tsx +0 -60
  22. data/lib/generators/inertia/install/templates/react/inertia.js +0 -34
  23. data/lib/generators/inertia/install/templates/react/inertia.ts +0 -36
  24. data/lib/generators/inertia/install/templates/react/tsconfig.app.json +0 -27
  25. data/lib/generators/inertia/install/templates/react/tsconfig.json +0 -11
  26. data/lib/generators/inertia/install/templates/react/tsconfig.node.json +0 -13
  27. data/lib/generators/inertia/install/templates/react/vite-env.d.ts +0 -1
  28. data/lib/generators/inertia/install/templates/svelte/InertiaExample.svelte +0 -112
  29. data/lib/generators/inertia/install/templates/svelte/InertiaExample.ts.svelte +0 -112
  30. data/lib/generators/inertia/install/templates/svelte/inertia.js +0 -30
  31. data/lib/generators/inertia/install/templates/svelte/inertia.ts +0 -30
  32. data/lib/generators/inertia/install/templates/svelte/svelte.config.js +0 -7
  33. data/lib/generators/inertia/install/templates/svelte/tsconfig.json +0 -21
  34. data/lib/generators/inertia/install/templates/svelte/tsconfig.node.json +0 -12
  35. data/lib/generators/inertia/install/templates/svelte/vite-env.d.ts +0 -2
  36. data/lib/generators/inertia/install/templates/svelte4/InertiaExample.svelte +0 -116
  37. data/lib/generators/inertia/install/templates/svelte4/InertiaExample.ts.svelte +0 -116
  38. data/lib/generators/inertia/install/templates/svelte4/inertia.js +0 -29
  39. data/lib/generators/inertia/install/templates/svelte4/inertia.ts +0 -29
  40. data/lib/generators/inertia/install/templates/svelte4/svelte.config.js +0 -7
  41. data/lib/generators/inertia/install/templates/svelte4/tsconfig.json +0 -21
  42. data/lib/generators/inertia/install/templates/svelte4/tsconfig.node.json +0 -12
  43. data/lib/generators/inertia/install/templates/svelte4/vite-env.d.ts +0 -2
  44. data/lib/generators/inertia/install/templates/tailwind/application.css +0 -13
  45. data/lib/generators/inertia/install/templates/tailwind/postcss.config.js +0 -6
  46. data/lib/generators/inertia/install/templates/tailwind/tailwind.config.js.tt +0 -18
  47. data/lib/generators/inertia/install/templates/vue/InertiaExample.ts.vue +0 -117
  48. data/lib/generators/inertia/install/templates/vue/InertiaExample.vue +0 -117
  49. data/lib/generators/inertia/install/templates/vue/inertia.js +0 -33
  50. data/lib/generators/inertia/install/templates/vue/inertia.ts +0 -33
  51. data/lib/generators/inertia/install/templates/vue/tsconfig.app.json +0 -24
  52. data/lib/generators/inertia/install/templates/vue/tsconfig.json +0 -11
  53. data/lib/generators/inertia/install/templates/vue/tsconfig.node.json +0 -22
  54. data/lib/generators/inertia/install/templates/vue/vite-env.d.ts +0 -1
  55. data/lib/generators/inertia/scaffold/scaffold_generator.rb +0 -16
  56. data/lib/generators/inertia/scaffold_controller/scaffold_controller_generator.rb +0 -56
  57. data/lib/generators/inertia/scaffold_controller/templates/controller.rb.tt +0 -100
  58. data/lib/generators/inertia_templates/controller/controller_generator.rb +0 -12
  59. data/lib/generators/inertia_templates/controller/templates/react/view.jsx.tt +0 -8
  60. data/lib/generators/inertia_templates/controller/templates/svelte/view.svelte.tt +0 -2
  61. data/lib/generators/inertia_templates/controller/templates/svelte4/view.svelte.tt +0 -2
  62. data/lib/generators/inertia_templates/controller/templates/vue/view.vue.tt +0 -4
  63. data/lib/generators/inertia_templates/scaffold/scaffold_generator.rb +0 -12
  64. data/lib/generators/inertia_templates/scaffold/templates/react/Edit.jsx.tt +0 -35
  65. data/lib/generators/inertia_templates/scaffold/templates/react/Form.jsx.tt +0 -111
  66. data/lib/generators/inertia_templates/scaffold/templates/react/Index.jsx.tt +0 -26
  67. data/lib/generators/inertia_templates/scaffold/templates/react/New.jsx.tt +0 -27
  68. data/lib/generators/inertia_templates/scaffold/templates/react/One.jsx.tt +0 -26
  69. data/lib/generators/inertia_templates/scaffold/templates/react/Show.jsx.tt +0 -39
  70. data/lib/generators/inertia_templates/scaffold/templates/svelte/Edit.svelte.tt +0 -36
  71. data/lib/generators/inertia_templates/scaffold/templates/svelte/Form.svelte.tt +0 -98
  72. data/lib/generators/inertia_templates/scaffold/templates/svelte/Index.svelte.tt +0 -35
  73. data/lib/generators/inertia_templates/scaffold/templates/svelte/New.svelte.tt +0 -29
  74. data/lib/generators/inertia_templates/scaffold/templates/svelte/One.svelte.tt +0 -28
  75. data/lib/generators/inertia_templates/scaffold/templates/svelte/Show.svelte.tt +0 -41
  76. data/lib/generators/inertia_templates/scaffold/templates/svelte4/Edit.svelte.tt +0 -37
  77. data/lib/generators/inertia_templates/scaffold/templates/svelte4/Form.svelte.tt +0 -96
  78. data/lib/generators/inertia_templates/scaffold/templates/svelte4/Index.svelte.tt +0 -36
  79. data/lib/generators/inertia_templates/scaffold/templates/svelte4/New.svelte.tt +0 -30
  80. data/lib/generators/inertia_templates/scaffold/templates/svelte4/One.svelte.tt +0 -28
  81. data/lib/generators/inertia_templates/scaffold/templates/svelte4/Show.svelte.tt +0 -46
  82. data/lib/generators/inertia_templates/scaffold/templates/vue/Edit.vue.tt +0 -36
  83. data/lib/generators/inertia_templates/scaffold/templates/vue/Form.vue.tt +0 -94
  84. data/lib/generators/inertia_templates/scaffold/templates/vue/Index.vue.tt +0 -31
  85. data/lib/generators/inertia_templates/scaffold/templates/vue/New.vue.tt +0 -29
  86. data/lib/generators/inertia_templates/scaffold/templates/vue/One.vue.tt +0 -26
  87. data/lib/generators/inertia_templates/scaffold/templates/vue/Show.vue.tt +0 -44
  88. data/lib/generators/inertia_tw_templates/controller/controller_generator.rb +0 -12
  89. data/lib/generators/inertia_tw_templates/controller/templates/react/view.jsx.tt +0 -8
  90. data/lib/generators/inertia_tw_templates/controller/templates/svelte/view.svelte.tt +0 -2
  91. data/lib/generators/inertia_tw_templates/controller/templates/svelte4/view.svelte.tt +0 -2
  92. data/lib/generators/inertia_tw_templates/controller/templates/vue/view.vue.tt +0 -4
  93. data/lib/generators/inertia_tw_templates/scaffold/scaffold_generator.rb +0 -12
  94. data/lib/generators/inertia_tw_templates/scaffold/templates/react/Edit.jsx.tt +0 -42
  95. data/lib/generators/inertia_tw_templates/scaffold/templates/react/Form.jsx.tt +0 -122
  96. data/lib/generators/inertia_tw_templates/scaffold/templates/react/Index.jsx.tt +0 -43
  97. data/lib/generators/inertia_tw_templates/scaffold/templates/react/New.jsx.tt +0 -30
  98. data/lib/generators/inertia_tw_templates/scaffold/templates/react/One.jsx.tt +0 -26
  99. data/lib/generators/inertia_tw_templates/scaffold/templates/react/Show.jsx.tt +0 -54
  100. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/Edit.svelte.tt +0 -44
  101. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/Form.svelte.tt +0 -119
  102. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/Index.svelte.tt +0 -42
  103. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/New.svelte.tt +0 -32
  104. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/One.svelte.tt +0 -28
  105. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte/Show.svelte.tt +0 -57
  106. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Edit.svelte.tt +0 -45
  107. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Form.svelte.tt +0 -120
  108. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Index.svelte.tt +0 -43
  109. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/New.svelte.tt +0 -33
  110. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/One.svelte.tt +0 -28
  111. data/lib/generators/inertia_tw_templates/scaffold/templates/svelte4/Show.svelte.tt +0 -58
  112. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/Edit.vue.tt +0 -44
  113. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/Form.vue.tt +0 -127
  114. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/Index.vue.tt +0 -43
  115. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/New.vue.tt +0 -32
  116. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/One.vue.tt +0 -26
  117. data/lib/generators/inertia_tw_templates/scaffold/templates/vue/Show.vue.tt +0 -56
  118. data/lib/inertia_rails_contrib/generators/controller_template_base.rb +0 -56
  119. data/lib/inertia_rails_contrib/generators/scaffold_template_base.rb +0 -35
  120. data/lib/inertia_rails_contrib/generators_helper.rb +0 -89
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
@@ -1,112 +0,0 @@
1
- <script>
2
- import svelteSvg from '/assets/svelte.svg'
3
- import inertiaSvg from '/assets/inertia.svg'
4
- import viteRubySvg from '/assets/vite_ruby.svg'
5
-
6
- let { name } = $props()
7
-
8
- let count = $state(0)
9
- </script>
10
-
11
- <svelte:head>
12
- <title>Inertia + Vite Ruby + Svelte Example</title>
13
- </svelte:head>
14
-
15
- <div class="inertia_example">
16
- <h1>Hello {name}!</h1>
17
-
18
- <div>
19
- <a href="https://inertia-rails.netlify.app" target="_blank">
20
- <img class="logo" src={inertiaSvg} alt="Inertia logo" />
21
- </a>
22
- <a href="https://vite-ruby.netlify.app" target="_blank">
23
- <img class="logo vite" src={viteRubySvg} alt="Vite Ruby logo" />
24
- </a>
25
- <a href="https://svelte.dev" target="_blank">
26
- <img class="logo svelte" src={svelteSvg} alt="Svelte logo" />
27
- </a>
28
- </div>
29
-
30
- <h2>Inertia + Vite Ruby + Svelte</h2>
31
-
32
- <div class="card">
33
- <button onclick={() => count++}>
34
- count is {count}
35
- </button>
36
- <p>
37
- Edit <code>app/frontend/pages/InertiaExample.svelte</code> and save to test
38
- HMR
39
- </p>
40
- </div>
41
- <p class="read-the-docs">
42
- Click on the Inertia, Vite Ruby, and Svelte logos to learn more
43
- </p>
44
- </div>
45
-
46
- <style>
47
- .inertia_example {
48
- font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
49
- line-height: 1.5;
50
- font-weight: 400;
51
- color: #213547;
52
- background-color: #ffffff;
53
- max-width: 1280px;
54
- margin: 0 auto;
55
- padding: 2rem;
56
- text-align: center;
57
- }
58
-
59
- h1 {
60
- font-size: 3.2em;
61
- line-height: 1.1;
62
- }
63
-
64
- h2 {
65
- font-size: 2.6em;
66
- line-height: 1.1;
67
- }
68
-
69
- button {
70
- border-radius: 8px;
71
- border: 1px solid transparent;
72
- padding: 0.6em 1.2em;
73
- font-size: 1em;
74
- font-weight: 500;
75
- font-family: inherit;
76
- background-color: #f9f9f9;
77
- cursor: pointer;
78
- transition: border-color 0.25s;
79
- }
80
- button:hover {
81
- border-color: #646cff;
82
- }
83
- button:focus,
84
- button:focus-visible {
85
- outline: 4px auto -webkit-focus-ring-color;
86
- }
87
-
88
- .logo {
89
- display: inline-block;
90
- height: 6em;
91
- padding: 1.5em;
92
- will-change: filter;
93
- transition: filter 300ms;
94
- }
95
- .logo:hover {
96
- filter: drop-shadow(0 0 2em #646cffaa);
97
- }
98
- .logo.vite:hover {
99
- filter: drop-shadow(0 0 2em #e4023baa);
100
- }
101
- .logo.svelte:hover {
102
- filter: drop-shadow(0 0 2em #ff3e00aa);
103
- }
104
-
105
- .card {
106
- padding: 2em;
107
- }
108
-
109
- .read-the-docs {
110
- color: #888;
111
- }
112
- </style>
@@ -1,112 +0,0 @@
1
- <script lang="ts">
2
- import svelteSvg from '/assets/svelte.svg'
3
- import inertiaSvg from '/assets/inertia.svg'
4
- import viteRubySvg from '/assets/vite_ruby.svg'
5
-
6
- let { name }: { name: string } = $props()
7
-
8
- let count = $state(0)
9
- </script>
10
-
11
- <svelte:head>
12
- <title>Inertia + Vite Ruby + Svelte Example</title>
13
- </svelte:head>
14
-
15
- <div class="inertia_example">
16
- <h1>Hello {name}!</h1>
17
-
18
- <div>
19
- <a href="https://inertia-rails.netlify.app" target="_blank">
20
- <img class="logo" src={inertiaSvg} alt="Inertia logo" />
21
- </a>
22
- <a href="https://vite-ruby.netlify.app" target="_blank">
23
- <img class="logo vite" src={viteRubySvg} alt="Vite Ruby logo" />
24
- </a>
25
- <a href="https://svelte.dev" target="_blank">
26
- <img class="logo svelte" src={svelteSvg} alt="Svelte logo" />
27
- </a>
28
- </div>
29
-
30
- <h2>Inertia + Vite Ruby + Svelte</h2>
31
-
32
- <div class="card">
33
- <button onclick={() => count++}>
34
- count is {count}
35
- </button>
36
- <p>
37
- Edit <code>app/frontend/pages/InertiaExample.svelte</code> and save to test
38
- HMR
39
- </p>
40
- </div>
41
- <p class="read-the-docs">
42
- Click on the Inertia, Vite Ruby, and Svelte logos to learn more
43
- </p>
44
- </div>
45
-
46
- <style>
47
- .inertia_example {
48
- font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
49
- line-height: 1.5;
50
- font-weight: 400;
51
- color: #213547;
52
- background-color: #ffffff;
53
- max-width: 1280px;
54
- margin: 0 auto;
55
- padding: 2rem;
56
- text-align: center;
57
- }
58
-
59
- h1 {
60
- font-size: 3.2em;
61
- line-height: 1.1;
62
- }
63
-
64
- h2 {
65
- font-size: 2.6em;
66
- line-height: 1.1;
67
- }
68
-
69
- button {
70
- border-radius: 8px;
71
- border: 1px solid transparent;
72
- padding: 0.6em 1.2em;
73
- font-size: 1em;
74
- font-weight: 500;
75
- font-family: inherit;
76
- background-color: #f9f9f9;
77
- cursor: pointer;
78
- transition: border-color 0.25s;
79
- }
80
- button:hover {
81
- border-color: #646cff;
82
- }
83
- button:focus,
84
- button:focus-visible {
85
- outline: 4px auto -webkit-focus-ring-color;
86
- }
87
-
88
- .logo {
89
- display: inline-block;
90
- height: 6em;
91
- padding: 1.5em;
92
- will-change: filter;
93
- transition: filter 300ms;
94
- }
95
- .logo:hover {
96
- filter: drop-shadow(0 0 2em #646cffaa);
97
- }
98
- .logo.vite:hover {
99
- filter: drop-shadow(0 0 2em #e4023baa);
100
- }
101
- .logo.svelte:hover {
102
- filter: drop-shadow(0 0 2em #ff3e00aa);
103
- }
104
-
105
- .card {
106
- padding: 2em;
107
- }
108
-
109
- .read-the-docs {
110
- color: #888;
111
- }
112
- </style>
@@ -1,30 +0,0 @@
1
- import { createInertiaApp } from '@inertiajs/svelte'
2
- import { mount } from 'svelte';
3
-
4
- createInertiaApp({
5
- // Set default page title
6
- // see https://inertia-rails.netlify.app/guide/title-and-meta
7
- //
8
- // title: title => title ? `${title} - App` : 'App',
9
-
10
- // Disable progress bar
11
- //
12
- // see https://inertia-rails.netlify.app/guide/progress-indicators
13
- // progress: false,
14
-
15
- resolve: (name) => {
16
- const pages = import.meta.glob('../pages/**/*.svelte', { eager: true })
17
- return pages[`../pages/${name}.svelte`]
18
-
19
- // To use a default layout, import the Layout component
20
- // and use the following lines.
21
- // see https://inertia-rails.netlify.app/guide/pages#default-layouts
22
- //
23
- // const page = pages[`../pages/${name}.svelte`]
24
- // return { default: page.default, layout: page.layout || Layout }
25
- },
26
-
27
- setup({ el, App, props }) {
28
- mount(App, { target: el, props })
29
- },
30
- })
@@ -1,30 +0,0 @@
1
- import { createInertiaApp, type ResolvedComponent } from '@inertiajs/svelte'
2
- import { mount } from 'svelte'
3
-
4
- createInertiaApp({
5
- // Set default page title
6
- // see https://inertia-rails.netlify.app/guide/title-and-meta
7
- //
8
- // title: title => title ? `${title} - App` : 'App',
9
-
10
- // Disable progress bar
11
- //
12
- // see https://inertia-rails.netlify.app/guide/progress-indicators
13
- // progress: false,
14
-
15
- resolve: (name) => {
16
- const pages = import.meta.glob<ResolvedComponent>('../pages/**/*.svelte', { eager: true })
17
- return pages[`../pages/${name}.svelte`]
18
-
19
- // To use a default layout, import the Layout component
20
- // and use the following lines.
21
- // see https://inertia-rails.netlify.app/guide/pages#default-layouts
22
- //
23
- // const page = pages[`../pages/${name}.svelte`]
24
- // return { default: page.default, layout: page.layout || Layout }
25
- },
26
-
27
- setup({ el, App, props }) {
28
- mount(App, { target: el, props })
29
- },
30
- })
@@ -1,7 +0,0 @@
1
- import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
2
-
3
- export default {
4
- // Consult https://svelte.dev/docs#compile-time-svelte-preprocess
5
- // for more information about preprocessors
6
- preprocess: vitePreprocess(),
7
- }
@@ -1,21 +0,0 @@
1
- {
2
- "extends": "@tsconfig/svelte/tsconfig.json",
3
- "compilerOptions": {
4
- "target": "ESNext",
5
- "useDefineForClassFields": true,
6
- "module": "ESNext",
7
- "resolveJsonModule": true,
8
- /**
9
- * Typecheck JS in `.svelte` and `.js` files by default.
10
- * Disable checkJs if you'd like to use dynamic types in JS.
11
- * Note that setting allowJs false does not prevent the use
12
- * of JS in `.svelte` files.
13
- */
14
- "allowJs": true,
15
- "checkJs": true,
16
- "isolatedModules": true,
17
- "moduleDetection": "force",
18
- },
19
- "include": ["<%= js_destination_path %>/**/*.ts", "<%= js_destination_path %>/**/*.js", "<%= js_destination_path %>/**/*.svelte"],
20
- "references": [{ "path": "./tsconfig.node.json" }]
21
- }
@@ -1,12 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
5
- "skipLibCheck": true,
6
- "module": "ESNext",
7
- "moduleResolution": "bundler",
8
- "strict": true,
9
- "noEmit": true,
10
- },
11
- "include": ["vite.config.ts"]
12
- }
@@ -1,2 +0,0 @@
1
- /// <reference types="svelte" />
2
- /// <reference types="vite/client" />
@@ -1,116 +0,0 @@
1
- <script>
2
- import svelteSvg from '/assets/svelte.svg'
3
- import inertiaSvg from '/assets/inertia.svg'
4
- import viteRubySvg from '/assets/vite_ruby.svg'
5
-
6
- export let name
7
-
8
- let count = 0
9
-
10
- function handleClick() {
11
- count += 1
12
- }
13
- </script>
14
-
15
- <svelte:head>
16
- <title>Inertia + Vite Ruby + Svelte Example</title>
17
- </svelte:head>
18
-
19
- <div class="inertia_example">
20
- <h1>Hello {name}!</h1>
21
-
22
- <div>
23
- <a href="https://inertia-rails.netlify.app" target="_blank">
24
- <img class="logo" src={inertiaSvg} alt="Inertia logo" />
25
- </a>
26
- <a href="https://vite-ruby.netlify.app" target="_blank">
27
- <img class="logo vite" src={viteRubySvg} alt="Vite Ruby logo" />
28
- </a>
29
- <a href="https://svelte.dev" target="_blank">
30
- <img class="logo svelte" src={svelteSvg} alt="Svelte logo" />
31
- </a>
32
- </div>
33
-
34
- <h2>Inertia + Vite Ruby + Svelte</h2>
35
-
36
- <div class="card">
37
- <button on:click={handleClick}>
38
- count is {count}
39
- </button>
40
- <p>
41
- Edit <code>app/frontend/pages/InertiaExample.svelte</code> and save to test
42
- HMR
43
- </p>
44
- </div>
45
- <p class="read-the-docs">
46
- Click on the Inertia, Vite Ruby, and Svelte logos to learn more
47
- </p>
48
- </div>
49
-
50
- <style>
51
- .inertia_example {
52
- font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
53
- line-height: 1.5;
54
- font-weight: 400;
55
- color: #213547;
56
- background-color: #ffffff;
57
- max-width: 1280px;
58
- margin: 0 auto;
59
- padding: 2rem;
60
- text-align: center;
61
- }
62
-
63
- h1 {
64
- font-size: 3.2em;
65
- line-height: 1.1;
66
- }
67
-
68
- h2 {
69
- font-size: 2.6em;
70
- line-height: 1.1;
71
- }
72
-
73
- button {
74
- border-radius: 8px;
75
- border: 1px solid transparent;
76
- padding: 0.6em 1.2em;
77
- font-size: 1em;
78
- font-weight: 500;
79
- font-family: inherit;
80
- background-color: #f9f9f9;
81
- cursor: pointer;
82
- transition: border-color 0.25s;
83
- }
84
- button:hover {
85
- border-color: #646cff;
86
- }
87
- button:focus,
88
- button:focus-visible {
89
- outline: 4px auto -webkit-focus-ring-color;
90
- }
91
-
92
- .logo {
93
- display: inline-block;
94
- height: 6em;
95
- padding: 1.5em;
96
- will-change: filter;
97
- transition: filter 300ms;
98
- }
99
- .logo:hover {
100
- filter: drop-shadow(0 0 2em #646cffaa);
101
- }
102
- .logo.vite:hover {
103
- filter: drop-shadow(0 0 2em #e4023baa);
104
- }
105
- .logo.svelte:hover {
106
- filter: drop-shadow(0 0 2em #ff3e00aa);
107
- }
108
-
109
- .card {
110
- padding: 2em;
111
- }
112
-
113
- .read-the-docs {
114
- color: #888;
115
- }
116
- </style>
@@ -1,116 +0,0 @@
1
- <script lang="ts">
2
- import svelteSvg from '/assets/svelte.svg'
3
- import inertiaSvg from '/assets/inertia.svg'
4
- import viteRubySvg from '/assets/vite_ruby.svg'
5
-
6
- export let name: string
7
-
8
- let count = 0
9
-
10
- function handleClick() {
11
- count += 1
12
- }
13
- </script>
14
-
15
- <svelte:head>
16
- <title>Inertia + Vite Ruby + Svelte Example</title>
17
- </svelte:head>
18
-
19
- <div class="inertia_example">
20
- <h1>Hello {name}!</h1>
21
-
22
- <div>
23
- <a href="https://inertia-rails.netlify.app" target="_blank">
24
- <img class="logo" src={inertiaSvg} alt="Inertia logo" />
25
- </a>
26
- <a href="https://vite-ruby.netlify.app" target="_blank">
27
- <img class="logo vite" src={viteRubySvg} alt="Vite Ruby logo" />
28
- </a>
29
- <a href="https://svelte.dev" target="_blank">
30
- <img class="logo svelte" src={svelteSvg} alt="Svelte logo" />
31
- </a>
32
- </div>
33
-
34
- <h2>Inertia + Vite Ruby + Svelte</h2>
35
-
36
- <div class="card">
37
- <button on:click={handleClick}>
38
- count is {count}
39
- </button>
40
- <p>
41
- Edit <code>app/frontend/pages/InertiaExample.svelte</code> and save to test
42
- HMR
43
- </p>
44
- </div>
45
- <p class="read-the-docs">
46
- Click on the Inertia, Vite Ruby, and Svelte logos to learn more
47
- </p>
48
- </div>
49
-
50
- <style>
51
- .inertia_example {
52
- font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
53
- line-height: 1.5;
54
- font-weight: 400;
55
- color: #213547;
56
- background-color: #ffffff;
57
- max-width: 1280px;
58
- margin: 0 auto;
59
- padding: 2rem;
60
- text-align: center;
61
- }
62
-
63
- h1 {
64
- font-size: 3.2em;
65
- line-height: 1.1;
66
- }
67
-
68
- h2 {
69
- font-size: 2.6em;
70
- line-height: 1.1;
71
- }
72
-
73
- button {
74
- border-radius: 8px;
75
- border: 1px solid transparent;
76
- padding: 0.6em 1.2em;
77
- font-size: 1em;
78
- font-weight: 500;
79
- font-family: inherit;
80
- background-color: #f9f9f9;
81
- cursor: pointer;
82
- transition: border-color 0.25s;
83
- }
84
- button:hover {
85
- border-color: #646cff;
86
- }
87
- button:focus,
88
- button:focus-visible {
89
- outline: 4px auto -webkit-focus-ring-color;
90
- }
91
-
92
- .logo {
93
- display: inline-block;
94
- height: 6em;
95
- padding: 1.5em;
96
- will-change: filter;
97
- transition: filter 300ms;
98
- }
99
- .logo:hover {
100
- filter: drop-shadow(0 0 2em #646cffaa);
101
- }
102
- .logo.vite:hover {
103
- filter: drop-shadow(0 0 2em #e4023baa);
104
- }
105
- .logo.svelte:hover {
106
- filter: drop-shadow(0 0 2em #ff3e00aa);
107
- }
108
-
109
- .card {
110
- padding: 2em;
111
- }
112
-
113
- .read-the-docs {
114
- color: #888;
115
- }
116
- </style>
@@ -1,29 +0,0 @@
1
- import { createInertiaApp } from '@inertiajs/svelte'
2
-
3
- createInertiaApp({
4
- // Set default page title
5
- // see https://inertia-rails.netlify.app/guide/title-and-meta
6
- //
7
- // title: title => title ? `${title} - App` : 'App',
8
-
9
- // Disable progress bar
10
- //
11
- // see https://inertia-rails.netlify.app/guide/progress-indicators
12
- // progress: false,
13
-
14
- resolve: (name) => {
15
- const pages = import.meta.glob('../pages/**/*.svelte', { eager: true })
16
- return pages[`../pages/${name}.svelte`]
17
-
18
- // To use a default layout, import the Layout component
19
- // and use the following lines.
20
- // see https://inertia-rails.netlify.app/guide/pages#default-layouts
21
- //
22
- // const page = pages[`../pages/${name}.svelte`]
23
- // return { default: page.default, layout: page.layout || Layout }
24
- },
25
-
26
- setup({ el, App, props }) {
27
- new App({ target: el, props })
28
- },
29
- })
@@ -1,29 +0,0 @@
1
- import { createInertiaApp, type ResolvedComponent } from '@inertiajs/svelte'
2
-
3
- createInertiaApp({
4
- // Set default page title
5
- // see https://inertia-rails.netlify.app/guide/title-and-meta
6
- //
7
- // title: title => title ? `${title} - App` : 'App',
8
-
9
- // Disable progress bar
10
- //
11
- // see https://inertia-rails.netlify.app/guide/progress-indicators
12
- // progress: false,
13
-
14
- resolve: (name) => {
15
- const pages = import.meta.glob<ResolvedComponent>('../pages/**/*.svelte', { eager: true })
16
- return pages[`../pages/${name}.svelte`]
17
-
18
- // To use a default layout, import the Layout component
19
- // and use the following lines.
20
- // see https://inertia-rails.netlify.app/guide/pages#default-layouts
21
- //
22
- // const page = pages[`../pages/${name}.svelte`]
23
- // return { default: page.default, layout: page.layout || Layout }
24
- },
25
-
26
- setup({ el, App, props }) {
27
- new App({ target: el, props })
28
- },
29
- })
@@ -1,7 +0,0 @@
1
- import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
2
-
3
- export default {
4
- // Consult https://svelte.dev/docs#compile-time-svelte-preprocess
5
- // for more information about preprocessors
6
- preprocess: vitePreprocess(),
7
- }
@@ -1,21 +0,0 @@
1
- {
2
- "extends": "@tsconfig/svelte/tsconfig.json",
3
- "compilerOptions": {
4
- "target": "ESNext",
5
- "useDefineForClassFields": true,
6
- "module": "ESNext",
7
- "resolveJsonModule": true,
8
- /**
9
- * Typecheck JS in `.svelte` and `.js` files by default.
10
- * Disable checkJs if you'd like to use dynamic types in JS.
11
- * Note that setting allowJs false does not prevent the use
12
- * of JS in `.svelte` files.
13
- */
14
- "allowJs": true,
15
- "checkJs": true,
16
- "isolatedModules": true,
17
- "moduleDetection": "force",
18
- },
19
- "include": ["<%= js_destination_path %>/**/*.ts", "<%= js_destination_path %>/**/*.js", "<%= js_destination_path %>/**/*.svelte"],
20
- "references": [{ "path": "./tsconfig.node.json" }]
21
- }
@@ -1,12 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
5
- "skipLibCheck": true,
6
- "module": "ESNext",
7
- "moduleResolution": "bundler",
8
- "strict": true,
9
- "noEmit": true,
10
- },
11
- "include": ["vite.config.ts"]
12
- }
@@ -1,2 +0,0 @@
1
- /// <reference types="svelte" />
2
- /// <reference types="vite/client" />
@@ -1,13 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- /*
6
-
7
- @layer components {
8
- .btn-primary {
9
- @apply py-2 px-4 bg-blue-200;
10
- }
11
- }
12
-
13
- */