Skip to content

Commit 624296f

Browse files
committed
Migrando para Astro
1 parent a11b3b3 commit 624296f

148 files changed

Lines changed: 1558 additions & 61800 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.astro/content-assets.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default new Map();

.astro/content-modules.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default new Map();

.astro/data-store.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[["Map",1,2],"meta::meta",["Map",3,4,5,6],"astro-version","5.18.1","astro-config-digest","{\"root\":{},\"srcDir\":{},\"publicDir\":{},\"outDir\":{},\"cacheDir\":{},\"site\":\"https://vilanova.severinobiu.com.br\",\"compressHTML\":true,\"base\":\"/\",\"trailingSlash\":\"ignore\",\"output\":\"static\",\"scopedStyleStrategy\":\"attribute\",\"build\":{\"format\":\"directory\",\"client\":{},\"server\":{},\"assets\":\"_astro\",\"serverEntry\":\"entry.mjs\",\"redirects\":true,\"inlineStylesheets\":\"auto\",\"concurrency\":1},\"server\":{\"open\":false,\"host\":false,\"port\":4321,\"streaming\":true,\"allowedHosts\":[]},\"redirects\":{},\"image\":{\"endpoint\":{\"route\":\"/_image\"},\"service\":{\"entrypoint\":\"astro/assets/services/sharp\",\"config\":{}},\"domains\":[],\"remotePatterns\":[],\"responsiveStyles\":false},\"devToolbar\":{\"enabled\":true},\"markdown\":{\"syntaxHighlight\":{\"type\":\"shiki\",\"excludeLangs\":[\"math\"]},\"shikiConfig\":{\"langs\":[],\"langAlias\":{},\"theme\":\"github-dark\",\"themes\":{},\"wrap\":false,\"transformers\":[]},\"remarkPlugins\":[],\"rehypePlugins\":[],\"remarkRehype\":{},\"gfm\":true,\"smartypants\":true},\"security\":{\"checkOrigin\":true,\"allowedDomains\":[],\"actionBodySizeLimit\":1048576},\"env\":{\"schema\":{},\"validateSecrets\":false},\"experimental\":{\"clientPrerender\":false,\"contentIntellisense\":false,\"headingIdCompat\":false,\"preserveScriptOrder\":false,\"liveContentCollections\":false,\"csp\":false,\"staticImportMetaEnv\":false,\"chromeDevtoolsWorkspace\":false,\"failOnPrerenderConflict\":false,\"svgo\":false},\"legacy\":{\"collections\":false}}"]

.astro/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"_variables": {
3+
"lastUpdateCheck": 1775413711715
4+
}
5+
}

.astro/types.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="astro/client" />

.cursorrules

Lines changed: 29 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -125,26 +125,12 @@ Em `public/data/index.json` → `metadata`:
125125
}
126126
```
127127

128-
### 4. Atualize acervoCompat.ts
128+
### 4. Build do site (Astro)
129129

130-
**Arquivo:** `view/src/lib/acervoCompat.ts`
131-
132-
Adicione o import e inclua no array `repentes`:
133-
134-
```typescript
135-
import novaCantoria from "../../../public/data/cantorias/nova-cantoria.json";
136-
137-
// No array repentes:
138-
repentes: [
139-
// ... existentes
140-
novaCantoria,
141-
],
142-
```
143-
144-
### 5. Sincronize para dist/
130+
O acervo é lido em tempo de build a partir de `public/data/cantorias/*.json` (ver `src/lib/acervo.ts`). **Não** é necessário manter lista manual de imports: basta o ficheiro JSON novo e o índice atualizado.
145131

146132
```bash
147-
npm run data:sync
133+
npm run build
148134
```
149135

150136
### ⚠️ IMPORTANTE: NÃO crie arquivos .txt
@@ -193,53 +179,43 @@ npm run data:sync
193179
- Esquema: AAAAAAAABC (mote fixo BC)
194180
- Usado em pelejas
195181

196-
**Consulte:** `public/data/estilos.json` e `/estilos/*.md` para detalhes completos.
182+
**Consulte:** `public/data/estilos.json` e `docs/estilos/*.md` para detalhes completos.
197183

198184
---
199185

200-
## 🎨 Padrões de Código
201-
202-
### Imports
186+
## 🎨 Padrões de Código (Astro + React)
203187

204-
```typescript
205-
// ✅ CORRETO - Use acervoCompat
206-
import acervoData from "../lib/acervoCompat";
188+
### Stack
207189

208-
// ❌ ERRADO - Não importe acervo.json diretamente
209-
import acervoData from "../../../public/data/acervo.json";
210-
```
190+
- **Astro** (`output: static`) — rotas em `src/pages/`, layout em `src/layouts/Layout.astro`
191+
- **React** — ilhas com `client:load` quando há estado (ex.: filtros, busca)
192+
- **Dados em build** — `src/lib/acervo.ts` usa `fs` para ler `public/data/` (apenas no servidor/build)
211193

212194
### Navegação
213195

214-
```typescript
215-
// ✅ CORRETO - Use TanStack Router Link
216-
<Link to="/cantorias/$slug" params={{ slug: "cantoria-slug" }}>
217-
218-
// ❌ ERRADO - Não use <a> para rotas internas
219-
<a href="/cantorias/cantoria-slug">
196+
```html
197+
<!-- Rotas internas: links normais (bom para SEO) -->
198+
<a href="/cantorias/slug-da-cantoria">...</a>
220199
```
221200

222-
### Hooks RPC
201+
### Imports
223202

224203
```typescript
225-
// ✅ CORRETO - Use TanStack Query hooks
226-
const { data } = useMyTool({ param: "value" });
227-
228-
// ❌ ERRADO - Não chame client.TOOL() diretamente em componentes
229-
const data = await client.MY_TOOL({ param: "value" });
204+
// Alias @ → src/
205+
import { getAcervoData } from "@/lib/acervo";
230206
```
231207

232208
---
233209

234210
## 🔍 Localização de Arquivos
235211

236-
### Componentes React
212+
### Site (Astro)
237213
```
238-
view/src/
239-
├── routes/ # Páginas (TanStack Router)
240-
├── components/ # Componentes reutilizáveis
241-
├── lib/ # Utilitários
242-
└── hooks/ # Custom hooks
214+
src/
215+
├── pages/ # Rotas (ficheiros .astro)
216+
├── layouts/ # Layout.astro (meta, OG, CSS global)
217+
├── components/ # React + partilhados
218+
└── lib/ # acervo.ts, types, cantadores, utils
243219
```
244220

245221
### Dados
@@ -286,18 +262,19 @@ jq . public/data/index.json > /dev/null && echo "✅ Válido"
286262
# Contar cantorias
287263
jq '.cantorias | length' public/data/index.json
288264

289-
# Sincronizar para dist
290-
npm run data:sync
265+
# Build estático
266+
npm run build
291267
```
292268

293269
---
294270

295271
## 📚 Referências Importantes
296272

297-
- **Data Model:** `DATA-MODEL.md`
298-
- **Estilos de Repente:** `/estilos/*.md`
273+
- **Data Model:** `docs/projeto/DATA-MODEL.md`
274+
- **Estilos de Repente:** `docs/estilos/*.md`
299275
- **Contribuição:** `README.md`
300-
- **Refatoração:** `SUMMARY-REFATORACAO.md`
276+
- **Refatoração:** `docs/projeto/SUMMARY-REFATORACAO.md`
277+
- **Índice da documentação:** `docs/README.md`
301278

302279
---
303280

@@ -310,8 +287,7 @@ npm run data:sync
310287
3. **Crie** arquivo em `cantorias/{id}.json`
311288
4. **Adicione** entrada no `index.json`
312289
5. **Atualize** metadata (totals + data)
313-
6. **Crie** transcrição em `repentes/{id}.txt`
314-
7. **Confirme** que tudo foi adicionado
290+
6. **Confirme** com `npm run build` (opcional)
315291

316292
### Quando usuário pede "Corrija esta cantoria..."
317293

@@ -327,7 +303,7 @@ npm run data:sync
327303
- Use `index.json` para listar/filtrar (leve)
328304
- Carregue arquivo individual só quando necessário
329305
- Não carregue todos os 13 arquivos de uma vez se não precisar
330-
- `acervoCompat.ts` agrega tudo (use para retrocompatibilidade)
306+
- `src/lib/acervo.ts` agrega cantorias a partir da pasta `public/data/cantorias/`
331307

332308
---
333309

.github/copilot-instructions.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,14 @@ public/data/
3232

3333
## ✅ SEMPRE FAÇA ISSO
3434

35-
- ✅ Use imports relativos a `../lib/acervoCompat`
35+
- ✅ Use dados via `src/lib/acervo.ts` (build Astro)
3636
- ✅ Siga estrutura de estilos em `estilos.json`
3737
- ✅ Valide contagem de sílabas
3838
- ✅ Atualize metadata
3939

4040
## 📚 Consulte
4141

42-
- `DATA-MODEL.md` - Estrutura completa
43-
- `public/data/README.md` - Guia de uso
42+
- `docs/projeto/DATA-MODEL.md` - Estrutura completa
43+
- `docs/public-data/README.md` - Guia de uso de `public/data/`
44+
- `docs/README.md` - Índice da pasta `docs/`
4445
- `.cursorrules` - Regras detalhadas
45-
46-
**Documentação completa:** Ver arquivos *.md na raiz do projeto

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# SpecStory (histórico local da extensão/CLI)
2+
.specstory/
13

24
# Environment files
35
.env

.specstory/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)