refactor(auto-melhoria): ERR-20260519-002 tsup DTS break + FR-* + PATTERN_COUNTER atualizado
This commit is contained in:
@@ -4,4 +4,43 @@ _Registro de erros, exceções e falhas com contexto de reprodução._
|
||||
|
||||
---
|
||||
|
||||
## [ERR-20260519-002] tsup-flat-infinity-breaks-dts
|
||||
|
||||
**Logged**: 2026-05-19T21:35:00-03:00
|
||||
**Severity**: high
|
||||
**Area**: config | build
|
||||
|
||||
### What happened
|
||||
`cn()` usava `flat(Infinity)` no array de classes. O gerador de DTS do tsup v8 quebra com tipos recursivos infinitos, lançando `Type instantiation is excessively deep`.
|
||||
|
||||
### Error message
|
||||
```
|
||||
src/utils/index.ts: error TS2589: Type instantiation is excessively deep and possibly infinite.
|
||||
DTS Build error
|
||||
```
|
||||
|
||||
### Reproduction
|
||||
```ts
|
||||
type ClassValue = string | false | null | undefined | ClassValue[];
|
||||
// ❌ flat(Infinity) → tipo recursivo infinito → DTS quebra
|
||||
export function cn(...inputs: ClassValue[]): string {
|
||||
return inputs.flat(Infinity)....
|
||||
}
|
||||
```
|
||||
|
||||
### Fix
|
||||
```ts
|
||||
type ClassValue = string | boolean | null | undefined | Array<ClassValue>;
|
||||
// ✅ flat(2) — máximo de aninhamento é 2 níveis (cls, [cls2])
|
||||
export function cn(...inputs: ClassValue[]): string {
|
||||
return inputs.flat(2)....
|
||||
}
|
||||
```
|
||||
|
||||
### Also fixed in same session
|
||||
- `process.env.NODE_ENV` no código → quebra SSR / bundler. Solução: guarda `typeof localStorage !== 'undefined'`
|
||||
- `documentoSchema` usava `.replace()` direto na string Zod → `.transform(v => v.replace(…))`
|
||||
|
||||
---
|
||||
|
||||
<!-- Novas entradas acima desta linha -->
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
# Feature Requests — Capacidades requisitadas
|
||||
|
||||
_Registro de funcionalidades que foram pedidas ou que faltam._
|
||||
| ID | Feature | Justificativa | Prioridade |
|
||||
|---|---|---|---|
|
||||
| FR-001 | python-script-generator skill | Fecha lacuna de backend Python/FastAPI | alta |
|
||||
| FR-002 | Obsidian vault configurado | skill obsidian-vault-linker instalada, precisa de vault real | media |
|
||||
| FR-003 | GitHub remote configurado | pulse-agent/libs precisa de push automático | alta |
|
||||
| FR-004 | npmjs.org publish configurado | @pulse-libs/core não está publicado ainda | media |
|
||||
| FR-005 | CI/CD auto-run em cada commit | Sem CI/CD configurado ainda | alta |
|
||||
|
||||
---
|
||||
|
||||
<!-- Novas entradas acima desta linha -->
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
# Pattern Counter — Contador de Sucessos
|
||||
|
||||
_Rastreia quantas vezes cada abordagem funcionou para identificar skills candidatas._
|
||||
|
||||
| Pattern-Key | Count | Last-Seen | Status |
|
||||
|---|---|---|---|
|
||||
| clawhub.cli_path | 1 | 2026-05-19 | tracking |
|
||||
| clawhub.search_strategy | 1 | 2026-05-19 | tracking |
|
||||
| libs.shared_knowledge_base | 1 | 2026-05-19 | tracking |
|
||||
| skill.extra | 3 | 2026-05-19 | tracking |
|
||||
| tsup.multi-entry-esm-cjs | 1 | 2026-05-19 | tracking |
|
||||
| zod.safe-parse-generic | 1 | 2026-05-19 | tracking |
|
||||
| ts.flat2-not-flatinfinity | 1 | 2026-05-19 | tracking |
|
||||
| docker.multi-stage-node-alpine | 1 | 2026-05-19 | tracking |
|
||||
| git.conventional-commits | 2 | 2026-05-19 | tracking |
|
||||
|
||||
_Quando Count >= 3 e visto em >= 2 tarefas distintas em 30 dias → promover para AGENTS.md_
|
||||
_Quando Count >= 3 em >= 2 tarefas distintas em 30 dias → promover para AGENTS.md como skill/recomendacao permanente_
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user