-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopier.yml
More file actions
179 lines (149 loc) · 5.98 KB
/
Copy pathcopier.yml
File metadata and controls
179 lines (149 loc) · 5.98 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
_min_copier_version: "9.0.0"
# Seleciona qual subtemplate será usado como raiz do template
_subdirectory: "templates/{{ template }}"
# Um arquivo de respostas por template, permitindo update seguro por filho
_answers_file: ".copier-answers.{{ template }}.yml"
# Mensagens mais informativas
_message_before_copy: |
Vou gerar um projeto a partir do starterkit. Escolha o template desejado
e confirme as opções. Ao final, receberá instruções de próximos passos.
_message_after_copy: |
Projeto "{{ project_name }}" criado a partir do template "{{ template }}".
{% if template == 'python-starter' and include_vscode %}
ATENÇÃO (VS Code): você incluiu as configurações do VS Code. Após executar
`uv sync` abra o arquivo "{{ project_name }}/.vscode/settings.json" e
ajuste "python.defaultInterpreterPath" para o caminho do venv do projeto:
- Windows: ".venv/Scripts/python"
- Linux/macOS: ".venv/bin/python"
Isso garante que o VS Code use o interpretador do ambiente virtual criado.
{% endif %}
{% if template == 'nextjs15-starter' %}
Para instalar dependências do Node e preparar o projeto execute:
cd "{{ project_name }}"
pnpm install
Se o pnpm solicitar aprovação de builds (native builds verification),
execute também:
pnpm approve-builds
Isso instalará as dependências e aprovará quaisquer builds nativos necessários.
{% endif %}
_message_before_update: |
Atualizarei seu projeto com as novas opções. As respostas anteriores serão
pré-preenchidas — revise antes de confirmar.
_message_after_update: |
Projeto "{{ project_name }}" atualizado com sucesso!
Revise arquivos com conflitos (se houver), ajuste e confirme no Git.
# Sufixo para renderizar arquivos como templates
_templates_suffix: ".jinja"
# Escolha do template filho — rótulos mais amigáveis
template:
type: str
help: "Qual template você quer usar? (use as setas para escolher)"
choices:
"Projeto Python (simples)": python-starter
"Next.js 15 (approuter)": nextjs15-starter
"Astro 5": astrojs-starter
default: python-starter
# Perguntas comuns
project_name:
type: str
help: "Nome do projeto (ex: meu-projeto). Usado como raiz do repositório."
placeholder: "meu-projeto"
default: "meu-projeto"
validator: >-
{% if not project_name or not (project_name | regex_search('^[a-z][a-z0-9\\-_]+$')) %}
O nome deve começar com letra minúscula e conter apenas letras, dígitos, '-' ou '_'.
{% endif %}
# Nome do projeto em snake_case gerado a partir de project_name (não perguntado)
project_name_snake_case:
type: str
help: "Gerado automaticamente a partir de project_name se vazio."
default: "{{ project_name | lower | replace(' ', '_') | replace('-', '_') }}"
when: false
# Perguntas específicas do template "python-starter"
python_version:
type: str
help: "Versão do Python a ser usada"
choices:
"3.13 (recomendada)": "3.13"
"3.12": "3.12"
"3.11": "3.11"
default: "3.13"
when: "{{ template == 'python-starter' }}"
# Booleans (somente quando python-starter)
include_ruff:
type: bool
help: "Incluir Ruff (formatter + linter)?"
default: true
when: "{{ template == 'python-starter' }}"
include_pre_commit:
type: bool
help: "Incluir pre-commit com hooks do Ruff? (requer Ruff)"
default: true
when: "{{ template == 'python-starter' and include_ruff }}"
include_jupyter:
type: bool
help: "Incluir suporte a Jupyter (notebooks)?"
default: false
when: "{{ template == 'python-starter' }}"
include_pydantic:
type: bool
help: "Incluir Pydantic 2.x (modelos/validações)?"
default: true
when: "{{ template == 'python-starter' }}"
include_tests:
type: bool
help: "Incluir estrutura de testes (pytest)?"
default: true
when: "{{ template == 'python-starter' }}"
include_makefile:
type: bool
help: "Incluir Makefile com alvos úteis (venv/test/lint)?"
default: true
when: "{{ template == 'python-starter' }}"
include_mkdocs:
type: bool
help: "Incluir documentação com MkDocs Material?"
default: false
when: "{{ template == 'python-starter' }}"
include_vscode:
type: bool
help: "Incluir configurações do VS Code (.vscode)?"
default: true
when: "{{ template == 'python-starter' }}"
include_copilot:
type: bool
help: "Incluir configurações do Copilot (.vscode/copilot)?"
default: true
when: "{{ template == 'python-starter' and include_vscode }}"
include_readme:
type: bool
help: "Gerar um README.md inicial com instruções básicas?"
default: true
when: "{{ template == 'python-starter' }}"
# Excludes condicionais (herdados do filho)
_exclude:
- "copier.yaml"
- "copier.yml"
- "~*"
- "*.py[co]"
- "__pycache__"
- ".git"
- ".DS_Store"
- ".svn"
# VSCode/Copilot (excluir apenas no projeto gerado)
- "{% if template == 'python-starter' and not include_vscode %}{{ project_name }}/.vscode/{% endif %}"
- "{% if template == 'python-starter' and include_vscode and not include_copilot %}{{ project_name }}/.vscode/copilot/{% endif %}"
- "{% if template == 'python-starter' and include_vscode and not include_copilot %}{{ project_name }}/.vscode/mcp.json{% endif %}"
# Pre-commit opcional (somente se Ruff habilitado)
- "{% if template == 'python-starter' and ((not include_pre_commit) or (not include_ruff)) %}{{ project_name }}/.pre-commit-config.yaml{% endif %}"
# Tests
- "{% if template == 'python-starter' and not include_tests %}{{ project_name }}/tests/{% endif %}"
# Makefile (opcional)
- "{% if template == 'python-starter' and not include_makefile %}{{ project_name }}/Makefile{% endif %}"
# Ruff opcional
- "{% if template == 'python-starter' and not include_ruff %}{{ project_name }}/ruff.toml{% endif %}"
# README opcional
- "{% if template == 'python-starter' and not include_readme %}{{ project_name }}/README.md{% endif %}"
# MkDocs opcional
- "{% if template == 'python-starter' and not include_mkdocs %}{{ project_name }}/mkdocs.yml{% endif %}"
- "{% if template == 'python-starter' and not include_mkdocs %}{{ project_name }}/docs/{% endif %}"