-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcargo-generate.toml
60 lines (47 loc) · 2.67 KB
/
cargo-generate.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
[template]
cargo_generate_version = ">=0.9.0"
ignore = [".github/workflows/ci.yml", "Readme.org"]
exclude = ["cliff.toml", "release.toml"]
[hooks]
post = ["post-script.rhai"]
[placeholders.license]
type = "string"
prompt = "Choose the license for your project"
default = "all"
choices = ["all", "MIT", "Apache-2.0"]
# General Placeholders
[placeholders]
description = { type = "string", prompt = "Provide a brief description of your Zed extension" }
plugin_name = { type = "string", prompt = "Enter the name of your Zed extension" }
plugin_id = { type = "string", prompt = "Enter a unique identifier for your plugin (e.g., 'my-awesome-plugin')" }
gh_username = { type = "string", prompt = "What is the github user where everything will be published?" }
deploy_release = { type = "bool", prompt = "Would you like to set up GitHub releases for this plugin?", default = true }
plugin_type = { type = "string", prompt = "What type of Zed plugin are you creating?", choices = ["Language Server", "Theme", "Slash Command"] }
[conditional.'!deploy_release']
ignore = [".github/workflows/cliff.yml", ".github/workflows/publish-extension.yml", "cliff.toml", "release.toml"]
# Language Server Plugin
[conditional.'plugin_type == "Language Server"'.placeholders]
lsp_name = { type = "string", prompt = "Enter the name of the language server (e.g., 'rust-analyzer')" }
language_name = { type = "string", prompt = "Enter the name of the language this server supports" }
lsp_repo = { type = "string", prompt = "Enter the GitHub repository of the language server (format: author/repo_name)" }
use_tree_sitter = { type = "bool", prompt = "Does this language have a Tree-sitter grammar?" }
[conditional.'plugin_type == "Language Server" && use_tree_sitter'.placeholders]
ts_repo = { type = "string", prompt = "Enter the GitHub repository of the Tree-sitter grammar" }
ts_commit = { type = "string", prompt = "Enter the commit hash of the Tree-sitter grammar to use" }
[conditional.'plugin_type != "Language Server"']
ignore = ["src/{{lsp_name}}.rs"]
# Theme Plugin
[conditional.'plugin_type == "Theme"'.placeholders]
theme_name = { type = "string", prompt = "Enter the name of your theme" }
[conditional.'plugin_type != "Theme"']
ignore = ["themes"]
# Slash Command Plugin
[conditional.'plugin_type == "Slash Command"'.placeholders]
slash_command_name = { type = "string", prompt = "Enter the name of your slash command" }
[conditional.'plugin_type == "Theme"']
ignore = ["src/{{slash_command_name}}.rs", ".github/workflows/checks.yml", "rust-toolchain.toml"]
# License files
[conditional.'license != "MIT" && license != "all"']
ignore = ["LICENSE-MIT"]
[conditional.'license != "Apache-2.0" && license != "all"']
ignore = ["LICENSE-APACHE"]