Skip to content

Commit 156388f

Browse files
committed
Making Typescript as an option
1 parent f047f7b commit 156388f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/generators/rails/next_rails_scaffold/next_rails_scaffold_generator.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ def create_frontend_project
5050
create_next_app!
5151
install_hygen!
5252

53-
run("npx hygen scaffold javascript #{name} #{mapped_attributes.join(" ")}")
53+
language = File.exist?("tsconfig.json") ? "typescript" : "javascript"
54+
55+
run("npx hygen scaffold #{language} #{name} #{mapped_attributes.join(" ")}")
5456
run("yarn build")
5557
end
5658
end

0 commit comments

Comments
 (0)