gign 0.0.3 → 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 +21 -0
- package/README.md +175 -45
- package/dist/index.js +8612 -0
- package/dist/index.js.map +7 -0
- package/package.json +49 -7
- package/.vscode/launch.json +0 -17
- package/.vscode/settings.json +0 -3
- package/index.js +0 -9
- package/manual.json +0 -11
- package/pattern.json +0 -13
- package/src/actions/generateFile.js +0 -52
- package/src/util/download.js +0 -19
- package/src/util/os.js +0 -12
- package/src/util/project.js +0 -55
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,45 +1,175 @@
|
|
|
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
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
________.__
|
|
5
|
+
/ _____/|__| ____ ____
|
|
6
|
+
/ \ ___| |/ ___\ / \
|
|
7
|
+
\ \_\ \ / /_/ > | \
|
|
8
|
+
\______ /__\___ /|___| /
|
|
9
|
+
\/ /_____/ \/
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
# gign
|
|
13
|
+
|
|
14
|
+
### ⚡ Gerador inteligente, offline e automático de `.gitignore` para qualquer projeto
|
|
15
|
+
|
|
16
|
+
[](https://www.npmjs.com/package/gign)
|
|
17
|
+
[](https://www.npmjs.com/package/gign)
|
|
18
|
+
[](https://github.com/juninmd/gign/releases)
|
|
19
|
+
[](https://nodejs.org/)
|
|
20
|
+
[](LICENSE)
|
|
21
|
+
[](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>
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 💡 O que é o gign?
|
|
39
|
+
|
|
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.
|
|
41
|
+
|
|
42
|
+
Inspirado pelo clássico [gitignore.io](https://www.toptal.com/developers/gitignore), mas totalmente autocontido.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
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
|
+
---
|
|
58
|
+
|
|
59
|
+
## 🚀 Instalação
|
|
60
|
+
|
|
61
|
+
### Execução direta (sem instalar)
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npx gign .
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Instalação global
|
|
68
|
+
|
|
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
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 📖 Uso
|
|
79
|
+
|
|
80
|
+
```bash
|
|
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
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Veja [CONTRIBUTING.md](CONTRIBUTING.md) para as diretrizes de contribuição.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 📄 Licença
|
|
168
|
+
|
|
169
|
+
Distribuído sob a licença [MIT](LICENSE).
|
|
170
|
+
|
|
171
|
+
<div align="center">
|
|
172
|
+
|
|
173
|
+
Feito com ☕ por [Antonio Carlos](https://github.com/juninmd)
|
|
174
|
+
|
|
175
|
+
</div>
|