-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify installation by providing tailwind & vite installation steps
- Loading branch information
Showing
19 changed files
with
599 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ gem "rake", "~> 13.0" | |
gem "rspec", "~> 3.0" | ||
|
||
gem "standard", "~> 1.3" | ||
|
||
gem "generator_spec", "~> 0.10" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
react: | ||
packages: | ||
- "@inertiajs/react" | ||
- "react" | ||
- "react-dom" | ||
- "@vitejs/plugin-react" | ||
vite_plugin_import: "import react from '@vitejs/plugin-react'" | ||
vite_plugin_call: "react()" | ||
copy_files: | ||
"InertiaExample.jsx": "%{js_destination_path}/pages/InertiaExample.jsx" | ||
"InertiaExample.module.css": "%{js_destination_path}/pages/InertiaExample.module.css" | ||
"../assets/react.svg": "%{js_destination_path}/assets/react.svg" | ||
"../assets/inertia.svg": "%{js_destination_path}/assets/inertia.svg" | ||
"../assets/vite_ruby.svg": "%{js_destination_path}/assets/vite_ruby.svg" | ||
|
||
vue: | ||
packages: | ||
- "@inertiajs/vue3" | ||
- "vue" | ||
- "@vitejs/plugin-vue" | ||
vite_plugin_import: "import vue from '@vitejs/plugin-vue'" | ||
vite_plugin_call: "vue()" | ||
copy_files: | ||
"InertiaExample.vue": "%{js_destination_path}/pages/InertiaExample.vue" | ||
"../assets/vue.svg": "%{js_destination_path}/assets/vue.svg" | ||
"../assets/inertia.svg": "%{js_destination_path}/assets/inertia.svg" | ||
"../assets/vite_ruby.svg": "%{js_destination_path}/assets/vite_ruby.svg" | ||
|
||
svelte: | ||
packages: | ||
- "@inertiajs/svelte" | ||
- "svelte" | ||
- "@sveltejs/vite-plugin-svelte" | ||
vite_plugin_import: "import { svelte } from '@sveltejs/vite-plugin-svelte'" | ||
vite_plugin_call: "svelte()" | ||
copy_files: | ||
"svelte.config.js": "svelte.config.js" | ||
"InertiaExample.svelte": "%{js_destination_path}/pages/InertiaExample.svelte" | ||
"../assets/svelte.svg": "%{js_destination_path}/assets/svelte.svg" | ||
"../assets/inertia.svg": "%{js_destination_path}/assets/inertia.svg" | ||
"../assets/vite_ruby.svg": "%{js_destination_path}/assets/vite_ruby.svg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
module Inertia | ||
module Generators | ||
module Helpers | ||
### FS Helpers | ||
def js_destination_path | ||
defined?(ViteRuby) ? ViteRuby.config.source_code_dir : "app/frontend" | ||
end | ||
|
||
def js_destination_root | ||
file_path(js_destination_path) | ||
end | ||
|
||
def js_file_path(*relative_path) | ||
File.join(js_destination_root, *relative_path) | ||
end | ||
|
||
def file?(*relative_path) | ||
File.file?(file_path(*relative_path)) | ||
end | ||
|
||
def file_path(*relative_path) | ||
File.join(destination_root, *relative_path) | ||
end | ||
|
||
# Interactivity Helpers | ||
def ask(*) | ||
unless options[:interactive] | ||
say_error "Specify all options when running the generator non-interactively.", :red | ||
exit(1) | ||
end | ||
|
||
super | ||
end | ||
|
||
def yes?(*) | ||
return false unless options[:interactive] | ||
|
||
super | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.