gign 0.2.0 → 0.3.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Antonio Carlos
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,11 +1,4 @@
1
- # GIGN
2
-
3
- [![CI/CD Pipeline](https://github.com/juninmd/gign/actions/workflows/ci.yml/badge.svg)](https://github.com/juninmd/gign/actions/workflows/ci.yml)
4
- [![codecov](https://codecov.io/gh/juninmd/gign/branch/main/graph/badge.svg)](https://codecov.io/gh/juninmd/gign)
5
- [![NPM Version](https://img.shields.io/npm/v/gign.svg)](https://npmjs.org/package/gign)
6
- [![NPM Downloads](https://img.shields.io/npm/dm/gign.svg)](https://npmjs.org/package/gign)
7
- ![Node.js](https://img.shields.io/badge/Node.js-339933?logo=node.js&logoColor=white)
8
- ![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?logo=typescript&logoColor=white)
1
+ <div align="center">
9
2
 
10
3
  ```
11
4
  ________.__
@@ -16,53 +9,167 @@
16
9
  \/ /_____/ \/
17
10
  ```
18
11
 
19
- > Gerador automático de arquivos `.gitignore` para seus projetos. Inspirado no [gitignore.io](https://www.toptal.com/developers/gitignore).
12
+ # gign
13
+
14
+ ### ⚡ Gerador inteligente, offline e automático de `.gitignore` para qualquer projeto
15
+
16
+ [![npm version](https://img.shields.io/npm/v/gign.svg?style=flat-square&color=cb3837&logo=npm)](https://www.npmjs.com/package/gign)
17
+ [![npm downloads](https://img.shields.io/npm/dm/gign.svg?style=flat-square&color=blue)](https://www.npmjs.com/package/gign)
18
+ [![GitHub release](https://img.shields.io/github/v/release/juninmd/gign?style=flat-square&color=success)](https://github.com/juninmd/gign/releases)
19
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg?style=flat-square&logo=node.js)](https://nodejs.org/)
20
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](LICENSE)
21
+ [![codecov](https://img.shields.io/codecov/c/github/juninmd/gign/master?style=flat-square&logo=codecov)](https://codecov.io/gh/juninmd/gign)
22
+
23
+ <p>
24
+ <a href="#-recursos">Recursos</a> •
25
+ <a href="#-instalação">Instalação</a> •
26
+ <a href="#-uso">Uso</a> •
27
+ <a href="#-como-funciona">Como funciona</a> •
28
+ <a href="#-stacks-suportadas">Stacks</a> •
29
+ <a href="#-automação--deploy">Deploy</a> •
30
+ <a href="#-desenvolvimento">Desenvolvimento</a> •
31
+ <a href="#-licença">Licença</a>
32
+ </p>
33
+
34
+ </div>
20
35
 
21
- ## 📝 Descrição
36
+ ---
22
37
 
23
- **GIGN** é uma ferramenta CLI que gera automaticamente arquivos `.gitignore` personalizados para seus projetos. Basta informar o diretório e as tecnologias desejadas.
38
+ ## 💡 O que é o gign?
24
39
 
25
- ## ✨ Funcionalidades
40
+ O **gign** inspeciona a estrutura do seu projeto, detecta o sistema operacional e todas as linguagens, frameworks e ferramentas em uso (Node.js, TypeScript, Python, Docker, Rust, Go, VS Code, JetBrains, e muito mais) e gera um `.gitignore` sob medida, **deduplicado** e **100% offline**, sem chamadas a APIs externas.
26
41
 
27
- - Geração automática de `.gitignore`, 100% offline (templates embutidos, sem API externa)
28
- - Remove regras duplicadas entre templates
29
- - Publicação automática no npm a cada release
30
- - Suporte a múltiplas linguagens e frameworks
31
- - Interface CLI simples e rápida
32
- - CI/CD com GitHub Actions
33
- - Cobertura de testes com Codecov
42
+ Inspirado pelo clássico [gitignore.io](https://www.toptal.com/developers/gitignore), mas totalmente autocontido.
34
43
 
35
- ## 🛠️ Tech Stack
44
+ ---
36
45
 
37
- - **Runtime:** Node.js
38
- - **Linguagem:** TypeScript
39
- - **Testes:** Jest
40
- - **Linting:** ESLint
41
- - **CI:** GitHub Actions
42
- - **Cobertura:** Codecov
46
+ ## ✨ Recursos
47
+
48
+ | | Recurso | Descrição |
49
+ | --- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
50
+ | 🚀 | **Offline e instantâneo** | Templates oficiais de [`github/gitignore`](https://github.com/github/gitignore) embutidos no pacote. Zero chamadas de rede. |
51
+ | 🔍 | **Detecção automática** | Mapeia arquivos de configuração, lockfiles e diretórios para identificar tecnologias. |
52
+ | 🖥️ | **Sensível ao sistema** | Inclui automaticamente as regras do SO atual (`.DS_Store`, `Thumbs.db`, etc.). |
53
+ | 🧹 | **Deduplicação inteligente** | Mescla múltiplos templates sem repetir regras. |
54
+ | 📦 | **Sem dependências em runtime** | Distribuído como um único bundle minificado via `esbuild`. |
55
+ | 🔐 | **Proveniência npm** | Publicação com assinatura criptográfica via OIDC no GitHub Actions. |
56
+
57
+ ---
43
58
 
44
59
  ## 🚀 Instalação
45
60
 
61
+ ### Execução direta (sem instalar)
62
+
46
63
  ```bash
47
- # Via npm
48
- npm install -g gign
64
+ npx gign .
65
+ ```
66
+
67
+ ### Instalação global
49
68
 
50
- # Via yarn
51
- yarn global add gign
69
+ ```bash
70
+ npm install -g gign # npm
71
+ pnpm add -g gign # pnpm
72
+ yarn global add gign # yarn
73
+ bun add -g gign # bun
52
74
  ```
53
75
 
76
+ ---
77
+
54
78
  ## 📖 Uso
55
79
 
56
80
  ```bash
57
- gign <caminho>
81
+ # No diretório atual
82
+ gign .
83
+
84
+ # Em um diretório específico
85
+ gign ./meu-projeto
86
+ ```
87
+
88
+ Exemplo de saída:
89
+
90
+ ```text
91
+ [gign] generated at /workspace/meu-projeto/.gitignore
92
+ [gign] tags: macos,node,react,typescript,visualstudiocode
93
+ [gign] manual tags: jest,prettier,typescript,vite
94
+ ```
95
+
96
+ O arquivo gerado já vem organizado por seções, pronto para ser versionado. ✅
97
+
98
+ ---
99
+
100
+ ## 🧠 Como funciona
101
+
102
+ ```mermaid
103
+ flowchart LR
104
+ A["📁 Projeto"] --> B["🔎 Scanner de padrões"]
105
+ B --> C["🧩 Tags & SO"]
106
+ C --> D["⚡ Deduplicação + regras"]
107
+ D --> E["📄 .gitignore"]
108
+ ```
109
+
110
+ 1. **Varredura:** analisa arquivos-chave como `package.json`, `Cargo.toml`, `go.mod` e `requirements.txt`.
111
+ 2. **Resolução de tags:** identifica o SO host e cruza arquivos e extensões com `pattern.json` e `manual.json`.
112
+ 3. **Composição:** carrega os templates de `src/data/templates.json`, adiciona as regras manuais e remove duplicatas linha a linha.
113
+ 4. **Gravação:** salva o `.gitignore` final no diretório alvo.
114
+
115
+ ---
116
+
117
+ ## 🛠️ Stacks suportadas
118
+
119
+ Mais de **250 ecossistemas** são suportados nativamente.
120
+
121
+ <details>
122
+ <summary><b>Ver as principais tecnologias detectadas</b></summary>
123
+
124
+ <br>
125
+
126
+ - **Linguagens:** TypeScript, JavaScript, Python, Go, Rust, Java, Kotlin, C/C++, C#, Ruby, PHP, Swift, Dart, Elixir, Scala, Lua, Zig
127
+ - **Frontend & meta-frameworks:** React, Next.js, Vue, Nuxt, Svelte, SvelteKit, Astro, Remix, Angular, Vite, Gatsby
128
+ - **Backend & runtimes:** Node.js, Bun, Deno, NestJS, Express, Fastify, Django, Flask, FastAPI, Laravel, Spring Boot
129
+ - **Infraestrutura & DevOps:** Docker, Kubernetes, Terraform, Helm, Serverless, AWS CDK, Pulumi, Cloudflare Workers
130
+ - **IDEs & editores:** Visual Studio Code, JetBrains (IntelliJ, WebStorm, PyCharm, CLion, Rider, GoLand), Xcode, Sublime Text, Vim
131
+ - **Testes & qualidade:** Jest, Vitest, Playwright, Cypress, ESLint, Prettier, Biome, Ruff, Coverage
132
+
133
+ </details>
134
+
135
+ ---
136
+
137
+ ## 🔄 Automação & deploy
138
+
139
+ Entregas totalmente automatizadas:
140
+
141
+ - **Conventional Commits:** `feat:`, `fix:`, `perf:` e `BREAKING CHANGE` definem o bump de versão (minor, patch ou major).
142
+ - **semantic-release:** analisa os commits, calcula a próxima versão e gera tags e notas de release, sem aprovação manual.
143
+ - **Publicação no npm:** a cada push em `master`, o GitHub Actions valida testes e lint, compila o bundle e publica no [npm](https://www.npmjs.com/package/gign) com **proveniência**.
144
+
145
+ ---
146
+
147
+ ## 💻 Desenvolvimento
148
+
149
+ ```bash
150
+ git clone https://github.com/juninmd/gign.git
151
+ cd gign
152
+ npm ci
153
+
154
+ npm test # suíte de testes (Jest)
155
+ npm run test:coverage # testes com cobertura
156
+ npm run lint # ESLint
157
+ npm run format # Prettier (escrita)
158
+ npm run format:check # Prettier (checagem)
159
+ npm run build # bundle de produção em dist/
160
+ npm run sync:templates # atualiza templates a partir de github/gitignore
58
161
  ```
59
162
 
60
- O comando irá gerar um arquivo `.gitignore` personalizado no diretório especificado.
163
+ Veja [CONTRIBUTING.md](CONTRIBUTING.md) para as diretrizes de contribuição.
164
+
165
+ ---
166
+
167
+ ## 📄 Licença
61
168
 
62
- ## ✅ Requisitos
169
+ Distribuído sob a licença [MIT](LICENSE).
63
170
 
64
- - Node.js 8+ (para suporte a Async/Await)
171
+ <div align="center">
65
172
 
66
- ## 📜 Licença
173
+ Feito com ☕ por [Antonio Carlos](https://github.com/juninmd)
67
174
 
68
- MIT
175
+ </div>