Files
openidea/generators/phoenix.toml
T
l0ng-ai 605d5f4985 feat(new-project): project generators for mainstream languages and frameworks (#2689)
File › New Project offers 38 generators grouped by language (Java, Spring Boot, Quarkus, Micronaut, Kotlin, Ktor, Scala, Python/Django/FastAPI/Flask, Node/Vite/Next.js/Nuxt/Angular/SvelteKit/Astro/NestJS/Express, Go, Rust, C/C++, Zig, .NET, PHP/Laravel/Symfony, Ruby/Rails, Dart/Flutter, Swift, Elixir/Phoenix, Haskell, static website, empty). Each is a declaration in generators/<id>.toml run by the new ide-scaffold crate: built-in templates, the framework's official CLI run non-interactively, or a project service zip (Spring Initializr, code.quarkus.io, Micronaut Launch) whose metadata becomes form fields. Projects are built in a staging directory and moved into place only on success. The dialog renders each form from its schema, flags missing toolchains with install hints and streams progress; created projects open trusted. New Project is also on the welcome screen and the title bar project menu.

Closes #709
2026-11-11 17:22:57 +08:00

45 lines
1.0 KiB
TOML

id = "phoenix"
name = "Phoenix"
group = "Elixir"
icon = "project-phoenix"
order = 1
description = "A Phoenix application from mix phx.new."
[[requires]]
program = "mix"
hint = "Install Elixir: https://elixir-lang.org/install.html"
[[fields]]
id = "app"
label = "Application name:"
type = "text"
pattern = '^[a-z][a-z0-9_]*$'
default = "{{name|snake}}"
[[fields]]
id = "database"
label = "Database:"
type = "choice"
options = [
{ value = "postgres", label = "PostgreSQL" },
{ value = "mysql", label = "MySQL" },
{ value = "sqlite3", label = "SQLite" },
{ value = "none", label = "None" },
]
default = "postgres"
[[steps]]
label = "Installing the Phoenix generator"
program = "mix"
args = ["archive.install", "hex", "phx_new", "--force"]
[[steps]]
label = "Running mix phx.new"
program = "mix"
cwd = "parent"
args = [
"phx.new", "{{name}}", "--app", "{{app}}", "--no-install",
{ when = { database = ["postgres", "mysql", "sqlite3"] }, args = ["--database", "{{database}}"] },
{ when = { database = "none" }, args = ["--no-ecto"] },
]