@justmpm/ai-tool 0.7.10 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -108
- package/dist/{chunk-MWM2INVY.js → chunk-FO7NK3UM.js} +224 -539
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +16 -61
- package/dist/index.js +3 -9
- package/dist/{server-IBNLXRUS.js → server-VTMQAF6Z.js} +1 -1
- package/package.json +1 -1
|
@@ -1502,7 +1502,7 @@ var DEFAULT_CONFIG = {
|
|
|
1502
1502
|
areas: {},
|
|
1503
1503
|
descriptions: {},
|
|
1504
1504
|
settings: {
|
|
1505
|
-
autoDetect:
|
|
1505
|
+
autoDetect: false,
|
|
1506
1506
|
inferDescriptions: true,
|
|
1507
1507
|
groupByCategory: true
|
|
1508
1508
|
}
|
|
@@ -1566,367 +1566,6 @@ function getFileDescription(cwd, filePath) {
|
|
|
1566
1566
|
|
|
1567
1567
|
// src/areas/detector.ts
|
|
1568
1568
|
import { minimatch } from "minimatch";
|
|
1569
|
-
|
|
1570
|
-
// src/areas/patterns.ts
|
|
1571
|
-
var FOLDER_PATTERNS = [
|
|
1572
|
-
// ============================================================================
|
|
1573
|
-
// NEXT.JS APP ROUTER - Rotas genéricas (alta prioridade)
|
|
1574
|
-
// ============================================================================
|
|
1575
|
-
{ pattern: /app\/.*\/dashboard\//, area: "dashboard", priority: 100 },
|
|
1576
|
-
{ pattern: /app\/.*\/admin\//, area: "admin", priority: 100 },
|
|
1577
|
-
{ pattern: /app\/.*\/login\//, area: "auth", priority: 100 },
|
|
1578
|
-
{ pattern: /app\/.*\/cadastro\//, area: "auth", priority: 100 },
|
|
1579
|
-
{ pattern: /app\/.*\/signup\//, area: "auth", priority: 100 },
|
|
1580
|
-
{ pattern: /app\/.*\/register\//, area: "auth", priority: 100 },
|
|
1581
|
-
{ pattern: /app\/.*\/auth\//, area: "auth", priority: 100 },
|
|
1582
|
-
{ pattern: /app\/.*\/perfil\//, area: "profile", priority: 100 },
|
|
1583
|
-
{ pattern: /app\/.*\/profile\//, area: "profile", priority: 100 },
|
|
1584
|
-
{ pattern: /app\/.*\/configuracoes\//, area: "settings", priority: 100 },
|
|
1585
|
-
{ pattern: /app\/.*\/settings\//, area: "settings", priority: 100 },
|
|
1586
|
-
{ pattern: /app\/.*\/onboarding/, area: "onboarding", priority: 100 },
|
|
1587
|
-
{ pattern: /app\/.*\/precos\//, area: "pricing", priority: 100 },
|
|
1588
|
-
{ pattern: /app\/.*\/pricing\//, area: "pricing", priority: 100 },
|
|
1589
|
-
{ pattern: /app\/.*\/checkout\//, area: "checkout", priority: 100 },
|
|
1590
|
-
{ pattern: /app\/.*\/cart\//, area: "cart", priority: 100 },
|
|
1591
|
-
{ pattern: /app\/.*\/shop\//, area: "shop", priority: 100 },
|
|
1592
|
-
{ pattern: /app\/.*\/products\//, area: "products", priority: 100 },
|
|
1593
|
-
{ pattern: /app\/.*\/orders\//, area: "orders", priority: 100 },
|
|
1594
|
-
{ pattern: /app\/.*\/blog\//, area: "blog", priority: 100 },
|
|
1595
|
-
{ pattern: /app\/.*\/docs\//, area: "docs", priority: 100 },
|
|
1596
|
-
{ pattern: /app\/.*\/legal\//, area: "legal", priority: 100 },
|
|
1597
|
-
{ pattern: /app\/.*\/privacy\//, area: "legal", priority: 100 },
|
|
1598
|
-
{ pattern: /app\/.*\/terms\//, area: "legal", priority: 100 },
|
|
1599
|
-
{ pattern: /app\/.*\/about\//, area: "about", priority: 100 },
|
|
1600
|
-
{ pattern: /app\/.*\/contact\//, area: "contact", priority: 100 },
|
|
1601
|
-
{ pattern: /app\/.*\/faq\//, area: "faq", priority: 100 },
|
|
1602
|
-
{ pattern: /app\/.*\/help\//, area: "help", priority: 100 },
|
|
1603
|
-
{ pattern: /app\/.*\/support\//, area: "support", priority: 100 },
|
|
1604
|
-
// ============================================================================
|
|
1605
|
-
// VITE / CRA - src/pages/ ou src/views/ (alta prioridade)
|
|
1606
|
-
// ============================================================================
|
|
1607
|
-
{ pattern: /src\/pages\/[Dd]ashboard/, area: "dashboard", priority: 100 },
|
|
1608
|
-
{ pattern: /src\/pages\/[Aa]dmin/, area: "admin", priority: 100 },
|
|
1609
|
-
{ pattern: /src\/pages\/[Aa]uth/, area: "auth", priority: 100 },
|
|
1610
|
-
{ pattern: /src\/pages\/[Ll]ogin/, area: "auth", priority: 100 },
|
|
1611
|
-
{ pattern: /src\/pages\/[Rr]egister/, area: "auth", priority: 100 },
|
|
1612
|
-
{ pattern: /src\/pages\/[Ss]ignup/, area: "auth", priority: 100 },
|
|
1613
|
-
{ pattern: /src\/pages\/[Pp]rofile/, area: "profile", priority: 100 },
|
|
1614
|
-
{ pattern: /src\/pages\/[Ss]ettings/, area: "settings", priority: 100 },
|
|
1615
|
-
{ pattern: /src\/pages\/[Pp]ricing/, area: "pricing", priority: 100 },
|
|
1616
|
-
{ pattern: /src\/pages\/[Cc]heckout/, area: "checkout", priority: 100 },
|
|
1617
|
-
{ pattern: /src\/pages\/[Cc]art/, area: "cart", priority: 100 },
|
|
1618
|
-
{ pattern: /src\/pages\/[Ss]hop/, area: "shop", priority: 100 },
|
|
1619
|
-
{ pattern: /src\/pages\/[Pp]roducts?/, area: "products", priority: 100 },
|
|
1620
|
-
{ pattern: /src\/pages\/[Oo]rders?/, area: "orders", priority: 100 },
|
|
1621
|
-
{ pattern: /src\/pages\/[Bb]log/, area: "blog", priority: 100 },
|
|
1622
|
-
{ pattern: /src\/views\/[Dd]ashboard/, area: "dashboard", priority: 100 },
|
|
1623
|
-
{ pattern: /src\/views\/[Aa]dmin/, area: "admin", priority: 100 },
|
|
1624
|
-
{ pattern: /src\/views\/[Aa]uth/, area: "auth", priority: 100 },
|
|
1625
|
-
// ============================================================================
|
|
1626
|
-
// REMIX - app/routes/
|
|
1627
|
-
// ============================================================================
|
|
1628
|
-
{ pattern: /app\/routes\/dashboard/, area: "dashboard", priority: 100 },
|
|
1629
|
-
{ pattern: /app\/routes\/admin/, area: "admin", priority: 100 },
|
|
1630
|
-
{ pattern: /app\/routes\/auth/, area: "auth", priority: 100 },
|
|
1631
|
-
{ pattern: /app\/routes\/login/, area: "auth", priority: 100 },
|
|
1632
|
-
{ pattern: /app\/routes\/_auth/, area: "auth", priority: 100 },
|
|
1633
|
-
// ============================================================================
|
|
1634
|
-
// NUXT - pages/ (sem src/)
|
|
1635
|
-
// ============================================================================
|
|
1636
|
-
{ pattern: /^pages\/dashboard/, area: "dashboard", priority: 100 },
|
|
1637
|
-
{ pattern: /^pages\/admin/, area: "admin", priority: 100 },
|
|
1638
|
-
{ pattern: /^pages\/auth/, area: "auth", priority: 100 },
|
|
1639
|
-
// ============================================================================
|
|
1640
|
-
// SVELTEKIT - src/routes/
|
|
1641
|
-
// ============================================================================
|
|
1642
|
-
{ pattern: /src\/routes\/dashboard/, area: "dashboard", priority: 100 },
|
|
1643
|
-
{ pattern: /src\/routes\/admin/, area: "admin", priority: 100 },
|
|
1644
|
-
{ pattern: /src\/routes\/auth/, area: "auth", priority: 100 },
|
|
1645
|
-
{ pattern: /src\/routes\/\(auth\)/, area: "auth", priority: 100 },
|
|
1646
|
-
{ pattern: /src\/routes\/\(app\)/, area: "app", priority: 90 },
|
|
1647
|
-
// ============================================================================
|
|
1648
|
-
// ASTRO - src/pages/
|
|
1649
|
-
// ============================================================================
|
|
1650
|
-
{ pattern: /src\/pages\/blog/, area: "blog", priority: 100 },
|
|
1651
|
-
{ pattern: /src\/pages\/docs/, area: "docs", priority: 100 },
|
|
1652
|
-
// ============================================================================
|
|
1653
|
-
// COMPONENTS - Por subpasta (alta prioridade)
|
|
1654
|
-
// Funciona em qualquer framework (com ou sem src/)
|
|
1655
|
-
// ============================================================================
|
|
1656
|
-
{ pattern: /components\/chat\//, area: "chat", priority: 90 },
|
|
1657
|
-
{ pattern: /components\/auth\//, area: "auth", priority: 90 },
|
|
1658
|
-
{ pattern: /components\/admin\//, area: "admin", priority: 90 },
|
|
1659
|
-
{ pattern: /components\/landing\//, area: "landing", priority: 90 },
|
|
1660
|
-
{ pattern: /components\/marketing\//, area: "landing", priority: 90 },
|
|
1661
|
-
{ pattern: /components\/dashboard\//, area: "dashboard", priority: 90 },
|
|
1662
|
-
{ pattern: /components\/subscription\//, area: "billing", priority: 90 },
|
|
1663
|
-
{ pattern: /components\/stripe\//, area: "billing", priority: 90 },
|
|
1664
|
-
{ pattern: /components\/payment\//, area: "billing", priority: 90 },
|
|
1665
|
-
{ pattern: /components\/checkout\//, area: "checkout", priority: 90 },
|
|
1666
|
-
{ pattern: /components\/cart\//, area: "cart", priority: 90 },
|
|
1667
|
-
{ pattern: /components\/notification\//, area: "notifications", priority: 90 },
|
|
1668
|
-
{ pattern: /components\/seo\//, area: "seo", priority: 90 },
|
|
1669
|
-
{ pattern: /components\/blog\//, area: "blog", priority: 90 },
|
|
1670
|
-
{ pattern: /components\/docs\//, area: "docs", priority: 90 },
|
|
1671
|
-
{ pattern: /components\/legal\//, area: "legal", priority: 90 },
|
|
1672
|
-
{ pattern: /components\/onboarding\//, area: "onboarding", priority: 90 },
|
|
1673
|
-
{ pattern: /components\/settings\//, area: "settings", priority: 90 },
|
|
1674
|
-
{ pattern: /components\/profile\//, area: "profile", priority: 90 },
|
|
1675
|
-
{ pattern: /components\/user\//, area: "user", priority: 90 },
|
|
1676
|
-
{ pattern: /components\/products?\//, area: "products", priority: 90 },
|
|
1677
|
-
{ pattern: /components\/orders?\//, area: "orders", priority: 90 },
|
|
1678
|
-
{ pattern: /components\/shop\//, area: "shop", priority: 90 },
|
|
1679
|
-
{ pattern: /components\/forms?\//, area: "forms", priority: 85 },
|
|
1680
|
-
{ pattern: /components\/tables?\//, area: "tables", priority: 85 },
|
|
1681
|
-
{ pattern: /components\/modals?\//, area: "modals", priority: 85 },
|
|
1682
|
-
{ pattern: /components\/dialogs?\//, area: "modals", priority: 85 },
|
|
1683
|
-
// Componentes compartilhados (baixa prioridade)
|
|
1684
|
-
{ pattern: /components\/ui\//, area: "shared-ui", priority: 30 },
|
|
1685
|
-
{ pattern: /components\/common\//, area: "shared-ui", priority: 30 },
|
|
1686
|
-
{ pattern: /components\/shared\//, area: "shared-ui", priority: 30 },
|
|
1687
|
-
{ pattern: /components\/base\//, area: "shared-ui", priority: 30 },
|
|
1688
|
-
{ pattern: /components\/core\//, area: "shared-ui", priority: 30 },
|
|
1689
|
-
{ pattern: /components\/primitives\//, area: "shared-ui", priority: 30 },
|
|
1690
|
-
{ pattern: /components\/providers\//, area: "core", priority: 40 },
|
|
1691
|
-
{ pattern: /components\/layout\//, area: "layout", priority: 40 },
|
|
1692
|
-
{ pattern: /components\/layouts\//, area: "layout", priority: 40 },
|
|
1693
|
-
// ============================================================================
|
|
1694
|
-
// FEATURES (padrão comum em projetos maiores)
|
|
1695
|
-
// ============================================================================
|
|
1696
|
-
{ pattern: /features\/auth\//, area: "auth", priority: 95 },
|
|
1697
|
-
{ pattern: /features\/dashboard\//, area: "dashboard", priority: 95 },
|
|
1698
|
-
{ pattern: /features\/admin\//, area: "admin", priority: 95 },
|
|
1699
|
-
{ pattern: /features\/checkout\//, area: "checkout", priority: 95 },
|
|
1700
|
-
{ pattern: /features\/cart\//, area: "cart", priority: 95 },
|
|
1701
|
-
{ pattern: /features\/products?\//, area: "products", priority: 95 },
|
|
1702
|
-
{ pattern: /features\/orders?\//, area: "orders", priority: 95 },
|
|
1703
|
-
{ pattern: /features\/user\//, area: "user", priority: 95 },
|
|
1704
|
-
{ pattern: /features\/settings\//, area: "settings", priority: 95 },
|
|
1705
|
-
{ pattern: /features\/notifications?\//, area: "notifications", priority: 95 },
|
|
1706
|
-
{ pattern: /features\/blog\//, area: "blog", priority: 95 },
|
|
1707
|
-
// ============================================================================
|
|
1708
|
-
// MODULES (outro padrão comum)
|
|
1709
|
-
// ============================================================================
|
|
1710
|
-
{ pattern: /modules\/auth\//, area: "auth", priority: 95 },
|
|
1711
|
-
{ pattern: /modules\/dashboard\//, area: "dashboard", priority: 95 },
|
|
1712
|
-
{ pattern: /modules\/admin\//, area: "admin", priority: 95 },
|
|
1713
|
-
{ pattern: /modules\/checkout\//, area: "checkout", priority: 95 },
|
|
1714
|
-
{ pattern: /modules\/products?\//, area: "products", priority: 95 },
|
|
1715
|
-
// ============================================================================
|
|
1716
|
-
// LIB - Módulos específicos
|
|
1717
|
-
// ============================================================================
|
|
1718
|
-
{ pattern: /lib\/firebase\//, area: "firebase", priority: 80 },
|
|
1719
|
-
{ pattern: /lib\/stripe\//, area: "billing", priority: 80 },
|
|
1720
|
-
{ pattern: /lib\/i18n\//, area: "i18n", priority: 80 },
|
|
1721
|
-
{ pattern: /lib\/analytics\//, area: "analytics", priority: 80 },
|
|
1722
|
-
// ============================================================================
|
|
1723
|
-
// HOOKS - Por nome genérico
|
|
1724
|
-
// ============================================================================
|
|
1725
|
-
{ pattern: /hooks\/.*[Aa]uth/, area: "auth", priority: 70 },
|
|
1726
|
-
{ pattern: /hooks\/.*[Ss]ubscription/, area: "billing", priority: 70 },
|
|
1727
|
-
{ pattern: /hooks\/.*[Nn]otification/, area: "notifications", priority: 70 },
|
|
1728
|
-
// ============================================================================
|
|
1729
|
-
// STORE - Por nome genérico
|
|
1730
|
-
// ============================================================================
|
|
1731
|
-
{ pattern: /store\/.*[Aa]uth/, area: "auth", priority: 70 },
|
|
1732
|
-
{ pattern: /store\/.*[Uu]ser/, area: "user", priority: 70 },
|
|
1733
|
-
// ============================================================================
|
|
1734
|
-
// FIREBASE CLOUD FUNCTIONS (expandido)
|
|
1735
|
-
// ============================================================================
|
|
1736
|
-
{ pattern: /functions\/src\//, area: "cloud-functions", priority: 80 },
|
|
1737
|
-
{ pattern: /functions\/src\/triggers\//, area: "triggers", priority: 95 },
|
|
1738
|
-
{ pattern: /functions\/src\/callable\//, area: "callable", priority: 95 },
|
|
1739
|
-
{ pattern: /functions\/src\/scheduled\//, area: "scheduled", priority: 95 },
|
|
1740
|
-
{ pattern: /functions\/src\/firestore\//, area: "firestore-triggers", priority: 95 },
|
|
1741
|
-
{ pattern: /functions\/src\/auth\//, area: "auth-triggers", priority: 95 },
|
|
1742
|
-
{ pattern: /functions\/src\/storage\//, area: "storage-triggers", priority: 95 },
|
|
1743
|
-
{ pattern: /functions\/src\/pubsub\//, area: "pubsub", priority: 95 },
|
|
1744
|
-
{ pattern: /functions\/src\/https\//, area: "callable", priority: 95 },
|
|
1745
|
-
// ============================================================================
|
|
1746
|
-
// OUTROS
|
|
1747
|
-
// ============================================================================
|
|
1748
|
-
{ pattern: /messages\//, area: "i18n", priority: 60 },
|
|
1749
|
-
{ pattern: /i18n\//, area: "i18n", priority: 60 },
|
|
1750
|
-
{ pattern: /locales\//, area: "i18n", priority: 60 },
|
|
1751
|
-
{ pattern: /public\//, area: "assets", priority: 50 },
|
|
1752
|
-
{ pattern: /scripts\//, area: "scripts", priority: 50 }
|
|
1753
|
-
];
|
|
1754
|
-
var KEYWORD_PATTERNS = [
|
|
1755
|
-
// Auth (genérico)
|
|
1756
|
-
{ keyword: /[Aa]uth(?!or)/, area: "auth", priority: 60 },
|
|
1757
|
-
// auth mas não author
|
|
1758
|
-
{ keyword: /[Ll]ogin/, area: "auth", priority: 60 },
|
|
1759
|
-
{ keyword: /[Rr]egister/, area: "auth", priority: 60 },
|
|
1760
|
-
{ keyword: /[Ss]ignup/, area: "auth", priority: 60 },
|
|
1761
|
-
{ keyword: /[Ss]ignin/, area: "auth", priority: 60 },
|
|
1762
|
-
{ keyword: /[Ss]ignout/, area: "auth", priority: 60 },
|
|
1763
|
-
{ keyword: /[Ll]ogout/, area: "auth", priority: 60 },
|
|
1764
|
-
// Billing/Payments (genérico)
|
|
1765
|
-
{ keyword: /[Ss]tripe/, area: "billing", priority: 65 },
|
|
1766
|
-
{ keyword: /[Ss]ubscription/, area: "billing", priority: 60 },
|
|
1767
|
-
{ keyword: /[Pp]ayment/, area: "billing", priority: 60 },
|
|
1768
|
-
{ keyword: /[Bb]illing/, area: "billing", priority: 65 },
|
|
1769
|
-
{ keyword: /[Ii]nvoice/, area: "billing", priority: 60 },
|
|
1770
|
-
// Checkout (genérico)
|
|
1771
|
-
{ keyword: /[Cc]heckout/, area: "checkout", priority: 60 },
|
|
1772
|
-
// Pricing (genérico)
|
|
1773
|
-
{ keyword: /[Pp]ricing/, area: "pricing", priority: 60 },
|
|
1774
|
-
// Notifications (genérico)
|
|
1775
|
-
{ keyword: /[Nn]otification/, area: "notifications", priority: 60 },
|
|
1776
|
-
{ keyword: /[Ff][Cc][Mm]/, area: "notifications", priority: 65 },
|
|
1777
|
-
// i18n (genérico)
|
|
1778
|
-
{ keyword: /[Ii]18n/, area: "i18n", priority: 60 },
|
|
1779
|
-
{ keyword: /[Ll]ocale/, area: "i18n", priority: 55 },
|
|
1780
|
-
{ keyword: /[Tt]ranslat/, area: "i18n", priority: 55 },
|
|
1781
|
-
// SEO (genérico)
|
|
1782
|
-
{ keyword: /[Ss][Ee][Oo]/, area: "seo", priority: 60 },
|
|
1783
|
-
{ keyword: /[Ss]itemap/, area: "seo", priority: 60 },
|
|
1784
|
-
// Analytics (genérico)
|
|
1785
|
-
{ keyword: /[Aa]nalytics/, area: "analytics", priority: 60 },
|
|
1786
|
-
// Admin (genérico)
|
|
1787
|
-
{ keyword: /[Aa]dmin/, area: "admin", priority: 55 },
|
|
1788
|
-
// PWA (genérico)
|
|
1789
|
-
{ keyword: /[Pp][Ww][Aa]/, area: "pwa", priority: 60 },
|
|
1790
|
-
{ keyword: /[Ss]ervice[Ww]orker/, area: "pwa", priority: 60 },
|
|
1791
|
-
{ keyword: /[Mm]anifest/, area: "pwa", priority: 55 },
|
|
1792
|
-
// PDF (genérico)
|
|
1793
|
-
{ keyword: /[Pp]df[Ee]xport/, area: "export", priority: 60 },
|
|
1794
|
-
{ keyword: /[Dd]ocx[Ee]xport/, area: "export", priority: 60 },
|
|
1795
|
-
// Firebase Cloud Functions triggers
|
|
1796
|
-
{ keyword: /[Oo]nCall/, area: "callable", priority: 70 },
|
|
1797
|
-
{ keyword: /[Oo]nRequest/, area: "callable", priority: 70 },
|
|
1798
|
-
{ keyword: /[Oo]nSchedule/, area: "scheduled", priority: 70 },
|
|
1799
|
-
{ keyword: /[Oo]n[A-Z].*Created/, area: "triggers", priority: 70 },
|
|
1800
|
-
{ keyword: /[Oo]n[A-Z].*Updated/, area: "triggers", priority: 70 },
|
|
1801
|
-
{ keyword: /[Oo]n[A-Z].*Deleted/, area: "triggers", priority: 70 },
|
|
1802
|
-
{ keyword: /[Oo]n[A-Z].*Written/, area: "triggers", priority: 70 },
|
|
1803
|
-
{ keyword: /[Oo]nObject/, area: "storage-triggers", priority: 70 },
|
|
1804
|
-
{ keyword: /[Oo]nMessage/, area: "pubsub", priority: 70 }
|
|
1805
|
-
];
|
|
1806
|
-
var AREA_NAMES = {
|
|
1807
|
-
// Autenticação e usuário
|
|
1808
|
-
auth: "Autentica\xE7\xE3o",
|
|
1809
|
-
user: "Usu\xE1rio",
|
|
1810
|
-
profile: "Perfil",
|
|
1811
|
-
settings: "Configura\xE7\xF5es",
|
|
1812
|
-
onboarding: "Onboarding",
|
|
1813
|
-
// E-commerce / Billing
|
|
1814
|
-
billing: "Pagamentos",
|
|
1815
|
-
checkout: "Checkout",
|
|
1816
|
-
cart: "Carrinho",
|
|
1817
|
-
shop: "Loja",
|
|
1818
|
-
products: "Produtos",
|
|
1819
|
-
orders: "Pedidos",
|
|
1820
|
-
pricing: "Pre\xE7os",
|
|
1821
|
-
// Comunicação
|
|
1822
|
-
notifications: "Notifica\xE7\xF5es",
|
|
1823
|
-
chat: "Chat",
|
|
1824
|
-
feedback: "Feedback",
|
|
1825
|
-
support: "Suporte",
|
|
1826
|
-
help: "Ajuda",
|
|
1827
|
-
faq: "FAQ",
|
|
1828
|
-
contact: "Contato",
|
|
1829
|
-
// Firebase
|
|
1830
|
-
firebase: "Firebase",
|
|
1831
|
-
// Conteúdo
|
|
1832
|
-
blog: "Blog",
|
|
1833
|
-
docs: "Documenta\xE7\xE3o",
|
|
1834
|
-
legal: "P\xE1ginas Legais",
|
|
1835
|
-
about: "Sobre",
|
|
1836
|
-
// Marketing e SEO
|
|
1837
|
-
landing: "Landing Pages",
|
|
1838
|
-
seo: "SEO",
|
|
1839
|
-
analytics: "Analytics",
|
|
1840
|
-
// Admin e Dashboard
|
|
1841
|
-
admin: "Admin",
|
|
1842
|
-
dashboard: "Dashboard",
|
|
1843
|
-
// Técnico
|
|
1844
|
-
i18n: "Internacionaliza\xE7\xE3o",
|
|
1845
|
-
pwa: "PWA",
|
|
1846
|
-
export: "Exporta\xE7\xE3o",
|
|
1847
|
-
core: "Core",
|
|
1848
|
-
layout: "Layout",
|
|
1849
|
-
"shared-ui": "UI Compartilhada",
|
|
1850
|
-
"cloud-functions": "Cloud Functions",
|
|
1851
|
-
triggers: "Triggers Firebase",
|
|
1852
|
-
callable: "Callable Functions",
|
|
1853
|
-
scheduled: "Scheduled Functions",
|
|
1854
|
-
"firestore-triggers": "Firestore Triggers",
|
|
1855
|
-
"auth-triggers": "Auth Triggers",
|
|
1856
|
-
"storage-triggers": "Storage Triggers",
|
|
1857
|
-
pubsub: "Pub/Sub",
|
|
1858
|
-
assets: "Assets",
|
|
1859
|
-
scripts: "Scripts",
|
|
1860
|
-
// UI patterns
|
|
1861
|
-
forms: "Formul\xE1rios",
|
|
1862
|
-
tables: "Tabelas",
|
|
1863
|
-
modals: "Modais",
|
|
1864
|
-
// Genéricos
|
|
1865
|
-
app: "Aplica\xE7\xE3o"
|
|
1866
|
-
};
|
|
1867
|
-
var AREA_DESCRIPTIONS = {
|
|
1868
|
-
// Autenticação e usuário
|
|
1869
|
-
auth: "Autentica\xE7\xE3o e gerenciamento de sess\xE3o",
|
|
1870
|
-
user: "Gerenciamento de dados do usu\xE1rio",
|
|
1871
|
-
profile: "Perfil do usu\xE1rio",
|
|
1872
|
-
settings: "Configura\xE7\xF5es do usu\xE1rio",
|
|
1873
|
-
onboarding: "Fluxo de onboarding de novos usu\xE1rios",
|
|
1874
|
-
// E-commerce / Billing
|
|
1875
|
-
billing: "Sistema de pagamentos e assinaturas",
|
|
1876
|
-
checkout: "Fluxo de checkout e finaliza\xE7\xE3o",
|
|
1877
|
-
cart: "Carrinho de compras",
|
|
1878
|
-
shop: "Loja e cat\xE1logo",
|
|
1879
|
-
products: "Gerenciamento de produtos",
|
|
1880
|
-
orders: "Gerenciamento de pedidos",
|
|
1881
|
-
pricing: "P\xE1gina de pre\xE7os e planos",
|
|
1882
|
-
// Comunicação
|
|
1883
|
-
notifications: "Sistema de notifica\xE7\xF5es",
|
|
1884
|
-
chat: "Sistema de chat e mensagens",
|
|
1885
|
-
feedback: "Coleta de feedback",
|
|
1886
|
-
support: "Suporte ao cliente",
|
|
1887
|
-
help: "Central de ajuda",
|
|
1888
|
-
faq: "Perguntas frequentes",
|
|
1889
|
-
contact: "P\xE1gina de contato",
|
|
1890
|
-
// Firebase
|
|
1891
|
-
firebase: "Configura\xE7\xE3o e servi\xE7os Firebase",
|
|
1892
|
-
// Conteúdo
|
|
1893
|
-
blog: "Blog e artigos",
|
|
1894
|
-
docs: "Documenta\xE7\xE3o e guias",
|
|
1895
|
-
legal: "Termos de uso, privacidade e pol\xEDticas",
|
|
1896
|
-
about: "P\xE1gina sobre",
|
|
1897
|
-
// Marketing e SEO
|
|
1898
|
-
landing: "Landing pages e marketing",
|
|
1899
|
-
seo: "SEO, meta tags e sitemaps",
|
|
1900
|
-
analytics: "Analytics e tracking",
|
|
1901
|
-
// Admin e Dashboard
|
|
1902
|
-
admin: "Painel administrativo",
|
|
1903
|
-
dashboard: "Dashboard do usu\xE1rio",
|
|
1904
|
-
// Técnico
|
|
1905
|
-
i18n: "Internacionaliza\xE7\xE3o e tradu\xE7\xF5es",
|
|
1906
|
-
pwa: "Progressive Web App",
|
|
1907
|
-
export: "Exporta\xE7\xE3o de documentos",
|
|
1908
|
-
core: "Providers e configura\xE7\xE3o principal",
|
|
1909
|
-
layout: "Layout e navega\xE7\xE3o",
|
|
1910
|
-
"shared-ui": "Componentes de UI compartilhados",
|
|
1911
|
-
"cloud-functions": "Firebase Cloud Functions (serverless)",
|
|
1912
|
-
triggers: "Event-driven Firebase triggers",
|
|
1913
|
-
callable: "HTTPS callable functions (frontend SDK)",
|
|
1914
|
-
scheduled: "Scheduled/cron functions",
|
|
1915
|
-
"firestore-triggers": "Triggers para eventos do Firestore",
|
|
1916
|
-
"auth-triggers": "Triggers para eventos de autentica\xE7\xE3o",
|
|
1917
|
-
"storage-triggers": "Triggers para eventos do Storage",
|
|
1918
|
-
pubsub: "Triggers para mensagens Pub/Sub",
|
|
1919
|
-
assets: "Assets p\xFAblicos",
|
|
1920
|
-
scripts: "Scripts de automa\xE7\xE3o",
|
|
1921
|
-
// UI patterns
|
|
1922
|
-
forms: "Componentes de formul\xE1rio",
|
|
1923
|
-
tables: "Componentes de tabela",
|
|
1924
|
-
modals: "Modais e dialogs",
|
|
1925
|
-
// Genéricos
|
|
1926
|
-
app: "\xC1rea principal da aplica\xE7\xE3o"
|
|
1927
|
-
};
|
|
1928
|
-
|
|
1929
|
-
// src/areas/detector.ts
|
|
1930
1569
|
function isFileIgnored(filePath, config) {
|
|
1931
1570
|
const ignorePatterns = config.ignore || [];
|
|
1932
1571
|
if (ignorePatterns.length === 0) return false;
|
|
@@ -1941,38 +1580,12 @@ function isFileIgnored(filePath, config) {
|
|
|
1941
1580
|
function detectFileAreas(filePath, config) {
|
|
1942
1581
|
const normalizedPath = filePath.replace(/\\/g, "/");
|
|
1943
1582
|
const matches = [];
|
|
1944
|
-
const autoDetect = config.settings?.autoDetect !== false;
|
|
1945
|
-
if (filePath.includes("useAuth.ts")) {
|
|
1946
|
-
console.error(`[DEBUG] autoDetect for ${filePath}:`, autoDetect);
|
|
1947
|
-
console.error(`[DEBUG] config.settings:`, JSON.stringify(config.settings));
|
|
1948
|
-
}
|
|
1949
1583
|
for (const [areaId, areaConfig] of Object.entries(config.areas)) {
|
|
1950
1584
|
if (matchesAreaConfig(normalizedPath, areaConfig)) {
|
|
1951
|
-
matches.push(
|
|
1585
|
+
matches.push(areaId);
|
|
1952
1586
|
}
|
|
1953
1587
|
}
|
|
1954
|
-
|
|
1955
|
-
const unique2 = [...new Set(matches.map((m) => m.area))];
|
|
1956
|
-
return unique2;
|
|
1957
|
-
}
|
|
1958
|
-
for (const { pattern, area: area2, priority } of FOLDER_PATTERNS) {
|
|
1959
|
-
if (pattern.test(normalizedPath)) {
|
|
1960
|
-
if (!matches.some((m) => m.area === area2 && m.source === "config")) {
|
|
1961
|
-
matches.push({ area: area2, priority, source: "folder" });
|
|
1962
|
-
}
|
|
1963
|
-
}
|
|
1964
|
-
}
|
|
1965
|
-
const fileName = normalizedPath.split("/").pop() || "";
|
|
1966
|
-
for (const { keyword, area: area2, priority } of KEYWORD_PATTERNS) {
|
|
1967
|
-
if (keyword.test(fileName) || keyword.test(normalizedPath)) {
|
|
1968
|
-
if (!matches.some((m) => m.area === area2)) {
|
|
1969
|
-
matches.push({ area: area2, priority, source: "keyword" });
|
|
1970
|
-
}
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
const sorted = matches.sort((a, b) => b.priority - a.priority);
|
|
1974
|
-
const unique = [...new Set(sorted.map((m) => m.area))];
|
|
1975
|
-
return unique;
|
|
1588
|
+
return matches;
|
|
1976
1589
|
}
|
|
1977
1590
|
function matchesAreaConfig(filePath, config) {
|
|
1978
1591
|
if (config.exclude) {
|
|
@@ -2001,16 +1614,10 @@ function getAreaName(areaId, config) {
|
|
|
2001
1614
|
if (config.areas[areaId]?.name) {
|
|
2002
1615
|
return config.areas[areaId].name;
|
|
2003
1616
|
}
|
|
2004
|
-
if (AREA_NAMES[areaId]) {
|
|
2005
|
-
return AREA_NAMES[areaId];
|
|
2006
|
-
}
|
|
2007
1617
|
return areaId.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
2008
1618
|
}
|
|
2009
1619
|
function getAreaDescription(areaId, config) {
|
|
2010
|
-
|
|
2011
|
-
return config.areas[areaId].description;
|
|
2012
|
-
}
|
|
2013
|
-
return AREA_DESCRIPTIONS[areaId];
|
|
1620
|
+
return config.areas[areaId]?.description;
|
|
2014
1621
|
}
|
|
2015
1622
|
function inferFileDescription(filePath, category) {
|
|
2016
1623
|
const fileName = filePath.split("/").pop() || "";
|
|
@@ -4389,12 +3996,6 @@ function resolveAreaId(target, config, allFiles) {
|
|
|
4389
3996
|
return id;
|
|
4390
3997
|
}
|
|
4391
3998
|
}
|
|
4392
|
-
for (const [id, name] of Object.entries(AREA_NAMES)) {
|
|
4393
|
-
const nameNormalized = name.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
|
4394
|
-
if (nameNormalized === targetLower) {
|
|
4395
|
-
return id;
|
|
4396
|
-
}
|
|
4397
|
-
}
|
|
4398
3999
|
for (const id of Object.keys(config.areas)) {
|
|
4399
4000
|
if (id.toLowerCase().includes(targetLower)) {
|
|
4400
4001
|
return id;
|
|
@@ -4570,6 +4171,160 @@ var IGNORED_DIRS4 = /* @__PURE__ */ new Set([
|
|
|
4570
4171
|
".vercel",
|
|
4571
4172
|
".analyze"
|
|
4572
4173
|
]);
|
|
4174
|
+
function createInitialConfig(files) {
|
|
4175
|
+
const suggestedIgnore = detectSuggestedIgnorePatterns(files);
|
|
4176
|
+
const framework = detectFramework(files);
|
|
4177
|
+
return {
|
|
4178
|
+
$schema: "./areas.schema.json",
|
|
4179
|
+
version: "1.0.0",
|
|
4180
|
+
ignore: suggestedIgnore,
|
|
4181
|
+
areas: getFrameworkAreas(framework),
|
|
4182
|
+
descriptions: {},
|
|
4183
|
+
settings: {
|
|
4184
|
+
autoDetect: false,
|
|
4185
|
+
inferDescriptions: true,
|
|
4186
|
+
groupByCategory: true
|
|
4187
|
+
}
|
|
4188
|
+
};
|
|
4189
|
+
}
|
|
4190
|
+
function detectFramework(files) {
|
|
4191
|
+
const hasAppDir = files.some((f) => f.startsWith("app/"));
|
|
4192
|
+
const hasPagesDir = files.some((f) => f.startsWith("pages/"));
|
|
4193
|
+
const hasSrcDir = files.some((f) => f.startsWith("src/"));
|
|
4194
|
+
if (hasAppDir) return "nextjs-app";
|
|
4195
|
+
if (hasPagesDir) return "nextjs-pages";
|
|
4196
|
+
if (hasSrcDir) return "vite";
|
|
4197
|
+
return "generic";
|
|
4198
|
+
}
|
|
4199
|
+
function getFrameworkAreas(framework) {
|
|
4200
|
+
switch (framework) {
|
|
4201
|
+
case "nextjs-app":
|
|
4202
|
+
return {
|
|
4203
|
+
auth: {
|
|
4204
|
+
name: "Autentica\xE7\xE3o",
|
|
4205
|
+
description: "Login, signup e gerenciamento de sess\xE3o",
|
|
4206
|
+
patterns: [
|
|
4207
|
+
"app/**/auth/**",
|
|
4208
|
+
"app/**/login/**",
|
|
4209
|
+
"app/**/signup/**",
|
|
4210
|
+
"app/**/cadastro/**",
|
|
4211
|
+
"components/auth/**"
|
|
4212
|
+
],
|
|
4213
|
+
keywords: ["auth", "login", "signup", "signin"]
|
|
4214
|
+
},
|
|
4215
|
+
dashboard: {
|
|
4216
|
+
name: "Dashboard",
|
|
4217
|
+
description: "Painel principal do usu\xE1rio",
|
|
4218
|
+
patterns: ["app/**/dashboard/**", "components/dashboard/**"],
|
|
4219
|
+
keywords: ["dashboard"]
|
|
4220
|
+
},
|
|
4221
|
+
admin: {
|
|
4222
|
+
name: "Administra\xE7\xE3o",
|
|
4223
|
+
description: "Painel administrativo",
|
|
4224
|
+
patterns: ["app/**/admin/**", "components/admin/**"],
|
|
4225
|
+
keywords: ["admin"]
|
|
4226
|
+
},
|
|
4227
|
+
profile: {
|
|
4228
|
+
name: "Perfil",
|
|
4229
|
+
description: "Perfil e configura\xE7\xF5es do usu\xE1rio",
|
|
4230
|
+
patterns: ["app/**/profile/**", "app/**/perfil/**", "app/**/settings/**", "app/**/configuracoes/**"],
|
|
4231
|
+
keywords: ["profile", "perfil", "settings", "configuracoes"]
|
|
4232
|
+
},
|
|
4233
|
+
billing: {
|
|
4234
|
+
name: "Pagamentos",
|
|
4235
|
+
description: "Sistema de pagamentos e assinaturas",
|
|
4236
|
+
patterns: ["components/stripe/**", "components/payment/**", "lib/stripe/**"],
|
|
4237
|
+
keywords: ["stripe", "payment", "billing", "subscription", "checkout"]
|
|
4238
|
+
},
|
|
4239
|
+
checkout: {
|
|
4240
|
+
name: "Checkout",
|
|
4241
|
+
description: "Fluxo de checkout e finaliza\xE7\xE3o de compra",
|
|
4242
|
+
patterns: ["app/**/checkout/**", "components/checkout/**"],
|
|
4243
|
+
keywords: ["checkout"]
|
|
4244
|
+
},
|
|
4245
|
+
"shared-ui": {
|
|
4246
|
+
name: "UI Compartilhada",
|
|
4247
|
+
description: "Componentes de UI reutiliz\xE1veis (bot\xF5es, inputs, etc)",
|
|
4248
|
+
patterns: ["components/ui/**", "components/common/**", "components/shared/**"],
|
|
4249
|
+
keywords: []
|
|
4250
|
+
},
|
|
4251
|
+
api: {
|
|
4252
|
+
name: "API Routes",
|
|
4253
|
+
description: "Rotas de API do Next.js",
|
|
4254
|
+
patterns: ["app/**/api/**"],
|
|
4255
|
+
keywords: ["api"]
|
|
4256
|
+
}
|
|
4257
|
+
};
|
|
4258
|
+
case "nextjs-pages":
|
|
4259
|
+
return {
|
|
4260
|
+
auth: {
|
|
4261
|
+
name: "Autentica\xE7\xE3o",
|
|
4262
|
+
description: "Login, signup e gerenciamento de sess\xE3o",
|
|
4263
|
+
patterns: [
|
|
4264
|
+
"pages/**/auth/**",
|
|
4265
|
+
"pages/**/login/**",
|
|
4266
|
+
"pages/**/signup/**",
|
|
4267
|
+
"components/auth/**"
|
|
4268
|
+
],
|
|
4269
|
+
keywords: ["auth", "login", "signup"]
|
|
4270
|
+
},
|
|
4271
|
+
dashboard: {
|
|
4272
|
+
name: "Dashboard",
|
|
4273
|
+
description: "Painel principal do usu\xE1rio",
|
|
4274
|
+
patterns: ["pages/**/dashboard/**", "components/dashboard/**"],
|
|
4275
|
+
keywords: ["dashboard"]
|
|
4276
|
+
},
|
|
4277
|
+
api: {
|
|
4278
|
+
name: "API Routes",
|
|
4279
|
+
description: "Rotas de API do Next.js (pages/api)",
|
|
4280
|
+
patterns: ["pages/api/**"],
|
|
4281
|
+
keywords: ["api"]
|
|
4282
|
+
},
|
|
4283
|
+
"shared-ui": {
|
|
4284
|
+
name: "UI Compartilhada",
|
|
4285
|
+
description: "Componentes de UI reutiliz\xE1veis",
|
|
4286
|
+
patterns: ["components/ui/**", "components/common/**"],
|
|
4287
|
+
keywords: []
|
|
4288
|
+
}
|
|
4289
|
+
};
|
|
4290
|
+
case "vite":
|
|
4291
|
+
return {
|
|
4292
|
+
auth: {
|
|
4293
|
+
name: "Autentica\xE7\xE3o",
|
|
4294
|
+
description: "Login, signup e gerenciamento de sess\xE3o",
|
|
4295
|
+
patterns: ["src/pages/**/auth/**", "src/pages/**/login/**", "components/auth/**"],
|
|
4296
|
+
keywords: ["auth", "login", "signup"]
|
|
4297
|
+
},
|
|
4298
|
+
dashboard: {
|
|
4299
|
+
name: "Dashboard",
|
|
4300
|
+
description: "Painel principal do usu\xE1rio",
|
|
4301
|
+
patterns: ["src/pages/**/dashboard/**", "components/dashboard/**"],
|
|
4302
|
+
keywords: ["dashboard"]
|
|
4303
|
+
},
|
|
4304
|
+
"shared-ui": {
|
|
4305
|
+
name: "UI Compartilhada",
|
|
4306
|
+
description: "Componentes de UI reutiliz\xE1veis",
|
|
4307
|
+
patterns: ["components/ui/**", "components/common/**"],
|
|
4308
|
+
keywords: []
|
|
4309
|
+
}
|
|
4310
|
+
};
|
|
4311
|
+
default:
|
|
4312
|
+
return {
|
|
4313
|
+
auth: {
|
|
4314
|
+
name: "Autentica\xE7\xE3o",
|
|
4315
|
+
description: "Login e sess\xE3o",
|
|
4316
|
+
patterns: ["**/auth/**", "**/login/**"],
|
|
4317
|
+
keywords: ["auth", "login"]
|
|
4318
|
+
},
|
|
4319
|
+
"shared-ui": {
|
|
4320
|
+
name: "UI Compartilhada",
|
|
4321
|
+
description: "Componentes reutiliz\xE1veis",
|
|
4322
|
+
patterns: ["components/ui/**", "components/common/**"],
|
|
4323
|
+
keywords: []
|
|
4324
|
+
}
|
|
4325
|
+
};
|
|
4326
|
+
}
|
|
4327
|
+
}
|
|
4573
4328
|
async function areasInit(options = {}) {
|
|
4574
4329
|
const cwd = options.cwd || process.cwd();
|
|
4575
4330
|
const force = options.force ?? false;
|
|
@@ -4585,159 +4340,92 @@ Ou edite manualmente o arquivo existente.
|
|
|
4585
4340
|
`.trim();
|
|
4586
4341
|
}
|
|
4587
4342
|
const allFiles = getAllCodeFiles5(cwd);
|
|
4588
|
-
const
|
|
4589
|
-
const areaCounts = /* @__PURE__ */ new Map();
|
|
4590
|
-
for (const filePath of allFiles) {
|
|
4591
|
-
const areas2 = detectFileAreas(filePath, currentConfig);
|
|
4592
|
-
for (const areaId of areas2) {
|
|
4593
|
-
if (!areaCounts.has(areaId)) {
|
|
4594
|
-
areaCounts.set(areaId, /* @__PURE__ */ new Set());
|
|
4595
|
-
}
|
|
4596
|
-
areaCounts.get(areaId).add(filePath);
|
|
4597
|
-
}
|
|
4598
|
-
}
|
|
4599
|
-
const generatedAreas = {};
|
|
4600
|
-
for (const [areaId, files] of areaCounts) {
|
|
4601
|
-
const patterns = inferPatternsFromFiles([...files]);
|
|
4602
|
-
generatedAreas[areaId] = {
|
|
4603
|
-
name: getAreaName(areaId, currentConfig),
|
|
4604
|
-
description: getAreaDescription(areaId, currentConfig),
|
|
4605
|
-
patterns
|
|
4606
|
-
};
|
|
4607
|
-
}
|
|
4608
|
-
const suggestedIgnore = detectSuggestedIgnorePatterns(allFiles);
|
|
4609
|
-
const newConfig = {
|
|
4610
|
-
$schema: "./areas.schema.json",
|
|
4611
|
-
version: "1.0.0",
|
|
4612
|
-
ignore: suggestedIgnore,
|
|
4613
|
-
areas: generatedAreas,
|
|
4614
|
-
descriptions: {},
|
|
4615
|
-
settings: {
|
|
4616
|
-
autoDetect: true,
|
|
4617
|
-
inferDescriptions: true,
|
|
4618
|
-
groupByCategory: true
|
|
4619
|
-
}
|
|
4620
|
-
};
|
|
4343
|
+
const newConfig = createInitialConfig(allFiles);
|
|
4621
4344
|
writeConfig(cwd, newConfig);
|
|
4622
|
-
const
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4345
|
+
const framework = detectFramework(allFiles);
|
|
4346
|
+
const frameworkName = {
|
|
4347
|
+
"nextjs-app": "Next.js (App Router)",
|
|
4348
|
+
"nextjs-pages": "Next.js (Pages Router)",
|
|
4349
|
+
"vite": "Vite/CRA",
|
|
4350
|
+
"generic": "Gen\xE9rico"
|
|
4351
|
+
}[framework] || framework;
|
|
4352
|
+
const areasCount = Object.keys(newConfig.areas).length;
|
|
4626
4353
|
let out = `
|
|
4627
4354
|
\u2705 Arquivo criado: .analyze/areas.config.json
|
|
4628
4355
|
|
|
4629
|
-
\u{
|
|
4356
|
+
\u{1F3AF} Framework detectado: ${frameworkName}
|
|
4357
|
+
\u{1F4E6} \xC1reas configuradas: ${areasCount}
|
|
4630
4358
|
`;
|
|
4631
|
-
if (
|
|
4632
|
-
out += `\u{1F6AB} Padr\xF5es ignorados: ${
|
|
4359
|
+
if (newConfig.ignore && newConfig.ignore.length > 0) {
|
|
4360
|
+
out += `\u{1F6AB} Padr\xF5es ignorados: ${newConfig.ignore.length}
|
|
4633
4361
|
`;
|
|
4634
4362
|
}
|
|
4635
4363
|
out += `
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4364
|
+
\u{1F4DD} Pr\xF3ximos passos:
|
|
4365
|
+
|
|
4366
|
+
1\uFE0F\u20E3 Personalize as \xE1reas:
|
|
4367
|
+
Edite .analyze/areas.config.json e ajuste:
|
|
4368
|
+
- Adicione suas \xE1reas de neg\xF3cio (ex: "pets", "veterinary", "activities")
|
|
4369
|
+
- Ajuste os padr\xF5es (patterns) para cada \xE1rea
|
|
4370
|
+
- Renomeie \xE1reas conforme seu dom\xEDnio
|
|
4371
|
+
|
|
4372
|
+
2\uFE0F\u20E3 Adicione descri\xE7\xF5es (opcional):
|
|
4373
|
+
"descriptions": {
|
|
4374
|
+
"src/hooks/useAuth.ts": "Hook principal de autentica\xE7\xE3o",
|
|
4375
|
+
"src/services/petService.ts": "Servi\xE7o de gerenciamento de pets"
|
|
4376
|
+
}
|
|
4377
|
+
|
|
4378
|
+
3\uFE0F\u20E3 Valide a configura\xE7\xE3o:
|
|
4379
|
+
ai-tool areas # Ver todas as \xE1reas
|
|
4380
|
+
ai-tool area auth # Ver arquivos de uma \xE1rea
|
|
4381
|
+
ai-tool map # Ver resumo do projeto
|
|
4382
|
+
|
|
4383
|
+
\u{1F4A1} Dicas:
|
|
4384
|
+
|
|
4385
|
+
\u2022 Use patterns para pastas: "app/dashboard/**"
|
|
4386
|
+
\u2022 Use keywords para arquivos espalhados: ["auth", "login"]
|
|
4387
|
+
\u2022 Um arquivo pode pertencer a m\xFAltiplas \xE1reas
|
|
4388
|
+
\u2022 Use "exclude" para remover arquivos espec\xEDficos de uma \xE1rea
|
|
4389
|
+
|
|
4390
|
+
\u{1F4D6} Exemplo completo:
|
|
4391
|
+
|
|
4392
|
+
{
|
|
4393
|
+
"areas": {
|
|
4394
|
+
"meus-pets": {
|
|
4395
|
+
"name": "Meus Pets",
|
|
4396
|
+
"description": "Listagem e gerenciamento de pets do usu\xE1rio",
|
|
4397
|
+
"patterns": [
|
|
4398
|
+
"app/meus-pets/**",
|
|
4399
|
+
"components/pets/**",
|
|
4400
|
+
"hooks/usePets.*",
|
|
4401
|
+
"services/petService.*"
|
|
4402
|
+
],
|
|
4403
|
+
"keywords": ["pet", "animal"],
|
|
4404
|
+
"exclude": ["components/pets/shared/**"] // opcional
|
|
4405
|
+
},
|
|
4406
|
+
"auth": {
|
|
4407
|
+
"name": "Autentica\xE7\xE3o",
|
|
4408
|
+
"patterns": ["app/**/auth/**", "components/auth/**"],
|
|
4409
|
+
"keywords": ["auth", "login"]
|
|
4645
4410
|
}
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
\u26A0\uFE0F ${unmappedCount} arquivos sem \xE1rea definida
|
|
4649
|
-
Use 'ai-tool areas' para ver detalhes
|
|
4650
|
-
`;
|
|
4651
|
-
}
|
|
4652
|
-
if (suggestedIgnore.length > 0) {
|
|
4653
|
-
out += `
|
|
4654
|
-
\u{1F4CB} Padr\xF5es adicionados ao ignore:
|
|
4655
|
-
`;
|
|
4656
|
-
for (const pattern of suggestedIgnore) {
|
|
4657
|
-
out += ` \u2022 ${pattern}
|
|
4411
|
+
}
|
|
4412
|
+
}
|
|
4658
4413
|
`;
|
|
4659
|
-
}
|
|
4660
|
-
}
|
|
4661
|
-
out += `
|
|
4662
|
-
\u{1F4A1} Boas pr\xE1ticas:
|
|
4663
|
-
- Ideal: 5-15 \xE1reas (muitas \xE1reas \xE9 dif\xEDcil de navegar)
|
|
4664
|
-
- Use patterns para pastas, keywords para arquivos espalhados
|
|
4665
|
-
- Se uma \xE1rea tem <3 arquivos, considere mesclar com outra
|
|
4666
|
-
- Se tem >50 arquivos, considere dividir em sub-\xE1reas
|
|
4667
|
-
|
|
4668
|
-
\u{1F4DD} Como customizar:
|
|
4669
|
-
1. Renomear \xE1reas: altere o campo "name"
|
|
4670
|
-
2. Ajustar padr\xF5es: edite "patterns" (glob) ou "keywords"
|
|
4671
|
-
3. Adicionar descri\xE7\xF5es: campo "description" explica o dom\xEDnio
|
|
4672
|
-
4. Descri\xE7\xF5es de arquivos: use "descriptions" para documentos espec\xEDficos
|
|
4673
|
-
|
|
4674
|
-
\u{1F4A1} Exemplo de customiza\xE7\xE3o:
|
|
4675
|
-
|
|
4676
|
-
Antes (nome gen\xE9rico detectado):
|
|
4677
|
-
"user-profile": { "name": "User Profile", ... }
|
|
4678
|
-
|
|
4679
|
-
Depois (renomeado para dom\xEDnio de neg\xF3cio):
|
|
4680
|
-
"meu-perfil": { "name": "Meu Perfil", "description": "Edi\xE7\xE3o de perfil do usu\xE1rio" }
|
|
4681
|
-
|
|
4682
|
-
\u2699\uFE0F Quando usar autoDetect: false
|
|
4683
|
-
- Quando quer controle total das \xE1reas
|
|
4684
|
-
- Quando a detec\xE7\xE3o autom\xE1tica est\xE1 muito imprecisa
|
|
4685
|
-
- Quando o projeto tem dom\xEDnios muito espec\xEDficos
|
|
4686
|
-
|
|
4687
|
-
\u{1F4A1} Casos especiais:
|
|
4688
|
-
- Arquivos compartilhados: adicione a m\xFAltiplas \xE1reas
|
|
4689
|
-
- Utils globais: crie \xE1rea 'shared' ou use 'ignore'
|
|
4690
|
-
- Monorepo: use 'patterns' com caminhos relativos \xE0 raiz
|
|
4691
|
-
|
|
4692
|
-
\u{1F527} Manuten\xE7\xE3o:
|
|
4693
|
-
- Atualize o config ao criar/mover arquivos
|
|
4694
|
-
- Use 'ai-tool areas' para verificar arquivos sem \xE1rea
|
|
4695
|
-
- Use 'ai-tool area <nome>' para ver o que foi detectado
|
|
4696
|
-
|
|
4697
|
-
\u{1F4CB} Pr\xF3ximos passos:
|
|
4698
|
-
\u2192 Execute 'ai-tool areas' para ver o resultado
|
|
4699
|
-
\u2192 Use 'ai-tool area <nome>' para validar uma \xE1rea espec\xEDfica
|
|
4700
|
-
\u2192 Execute 'ai-tool map' para ver o resumo atualizado
|
|
4701
|
-
`;
|
|
4702
4414
|
return out.trim();
|
|
4703
4415
|
} catch (error) {
|
|
4704
4416
|
const message = error instanceof Error ? error.message : String(error);
|
|
4705
4417
|
throw new Error(`Erro ao executar areas init: ${message}`);
|
|
4706
4418
|
}
|
|
4707
4419
|
}
|
|
4708
|
-
function inferPatternsFromFiles(files) {
|
|
4709
|
-
const patterns = /* @__PURE__ */ new Set();
|
|
4710
|
-
const folderGroups = /* @__PURE__ */ new Map();
|
|
4711
|
-
for (const file of files) {
|
|
4712
|
-
const parts = file.split("/");
|
|
4713
|
-
if (parts.length > 1) {
|
|
4714
|
-
const folder = parts.slice(0, Math.min(3, parts.length - 1)).join("/");
|
|
4715
|
-
if (!folderGroups.has(folder)) {
|
|
4716
|
-
folderGroups.set(folder, []);
|
|
4717
|
-
}
|
|
4718
|
-
folderGroups.get(folder).push(file);
|
|
4719
|
-
}
|
|
4720
|
-
}
|
|
4721
|
-
for (const [folder, folderFiles] of folderGroups) {
|
|
4722
|
-
if (folderFiles.length >= 2) {
|
|
4723
|
-
patterns.add(`${folder}/**`);
|
|
4724
|
-
} else {
|
|
4725
|
-
patterns.add(folderFiles[0]);
|
|
4726
|
-
}
|
|
4727
|
-
}
|
|
4728
|
-
for (const file of files) {
|
|
4729
|
-
if (!file.includes("/")) {
|
|
4730
|
-
patterns.add(file);
|
|
4731
|
-
}
|
|
4732
|
-
}
|
|
4733
|
-
return [...patterns].sort();
|
|
4734
|
-
}
|
|
4735
4420
|
function detectSuggestedIgnorePatterns(files) {
|
|
4736
4421
|
const patterns = [];
|
|
4422
|
+
patterns.push("node_modules/**");
|
|
4737
4423
|
if (files.some((f) => f.includes("functions/lib/"))) {
|
|
4738
4424
|
patterns.push("functions/lib/**");
|
|
4739
4425
|
}
|
|
4740
|
-
const testCount = files.filter(
|
|
4426
|
+
const testCount = files.filter(
|
|
4427
|
+
(f) => /\.(test|spec)\.(ts|tsx|js|jsx)$/.test(f)
|
|
4428
|
+
).length;
|
|
4741
4429
|
if (testCount > 3) {
|
|
4742
4430
|
patterns.push("**/*.test.{ts,tsx,js,jsx}");
|
|
4743
4431
|
patterns.push("**/*.spec.{ts,tsx,js,jsx}");
|
|
@@ -5245,10 +4933,7 @@ export {
|
|
|
5245
4933
|
removeArea,
|
|
5246
4934
|
setFileDescription,
|
|
5247
4935
|
getFileDescription,
|
|
5248
|
-
|
|
5249
|
-
KEYWORD_PATTERNS,
|
|
5250
|
-
AREA_NAMES,
|
|
5251
|
-
AREA_DESCRIPTIONS,
|
|
4936
|
+
isFileIgnored,
|
|
5252
4937
|
detectFileAreas,
|
|
5253
4938
|
getAreaName,
|
|
5254
4939
|
getAreaDescription,
|