@ingcrea/aumic-tailwind-killer 4.1.3 → 4.1.4
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/.npmrc.bak +1 -0
- package/LICENSE +661 -0
- package/LICENSE.es.md +38 -0
- package/README.es.md +382 -0
- package/README.md +370 -68
- package/dist/ast/parser.js +11 -11
- package/dist/index.js +5 -2
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,122 +1,424 @@
|
|
|
1
1
|
# ⚔️ AUM-IC Tailwind Killer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> 🌐 **Navigation:** 🇲🇽 [Leer en Español](./README.es.md) | 📜 [Manifesto (EN)](./MANIFEST.md) | 📜 [Manifiesto (ES)](./MANIFEST.es.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@ingcrea/aumic-tailwind-killer)
|
|
6
|
+
[](https://github.com/ingcrea/aumic-tailwind-killer/stargazers)
|
|
7
|
+
[](https://github.com/ingcrea/aumic-tailwind-killer/network/members)
|
|
8
|
+
[](https://duckdb.org)
|
|
9
|
+
[](https://tailwindcss.com)
|
|
10
|
+
[](https://nodejs.org)
|
|
11
|
+
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
12
|
+
|
|
13
|
+
**AUM-IC Tailwind Killer** is not just a CLI orchestrator — it is the technical manifestation of a design standard. It is named after the **Arquitectura de Universos Multidimensionales de Ingeniería Creativa (AUM-IC)** standard: a philosophy built to restore sanity, absolute control and infinite scalability to software engineers.
|
|
14
|
+
|
|
15
|
+
Designed under the architectural rigor of **INGENIERÍA CREATIVA Y DESARROLLOS TECNOLÓGICOS S.A.S. (IngCrea)**, this high-performance "Tailwind Killer" audits, extracts, compiles (via JIT) and purges your codebase in seconds — transmuting the chaos of utility classes into an obfuscated, standardized, dependency-free ecosystem (Zero-Bloat) powered by an implacable *Multi-Level JIT Cache (DuckDB + Node.js)* architecture with universal AST interceptors.
|
|
6
16
|
|
|
7
17
|
---
|
|
8
18
|
|
|
9
|
-
## ⚡
|
|
19
|
+
## ⚡ Quick Start (60 seconds)
|
|
10
20
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
> **Prerequisites:** Node.js >= 18.0 · No extra system installations required. DuckDB is bundled.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# 1. Audit your project without touching any file (recommended first step)
|
|
25
|
+
npx @ingcrea/aumic-tailwind-killer -m simulate -t ./my-project
|
|
26
|
+
|
|
27
|
+
# 2. When ready: full transmutation to Zero-Bloat CSS
|
|
28
|
+
npx @ingcrea/aumic-tailwind-killer -m local -t ./my-project
|
|
29
|
+
|
|
30
|
+
# 3. Something went wrong? Full rollback in one command
|
|
31
|
+
npx @ingcrea/aumic-tailwind-killer -m restore -t ./my-project
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
> **Before running `-m local`:** Make sure your Git branch is clean (`git status`). AUM-IC validates this automatically and aborts if uncommitted changes are detected.
|
|
15
35
|
|
|
16
36
|
---
|
|
17
37
|
|
|
18
|
-
##
|
|
38
|
+
## ⚡ Why AUM-IC Tailwind Killer? (The Pain Cure)
|
|
39
|
+
|
|
40
|
+
Debates in global software architecture forums expose universal complaints about Tailwind CSS at scale. AUM-IC Tailwind Killer was forged to annihilate exactly those pains:
|
|
41
|
+
|
|
42
|
+
1. **The Cure for "HTML Soup" (Write Once, Read Never):**
|
|
43
|
+
The #1 developer complaint. Components flooded with kilometer-long strings (`class="flex items-center justify-between p-4 bg-white shadow-md..."`) that destroy readability. AUM-IC transmutes that toxic chain into an elegant, clean, obfuscated hash (`class="aumic-rs-1b3a"`). We give your DOM its visual purity back.
|
|
19
44
|
|
|
20
|
-
|
|
45
|
+
2. **Vendor Lock-In Liberation (The Escape Hatch):**
|
|
46
|
+
CTOs dread tying a massive project to third-party framework syntax that could change or become obsolete. With AUM-IC Tailwind Killer, **you are no longer Tailwind's slave**. Build fast with utilities — when you ship to production, our engine physically purges it from your `package.json` and extracts a standard, framework-agnostic `.css` file. You reclaim code sovereignty.
|
|
21
47
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- **Concurrencia Multi-Núcleo:** Utiliza la librería `rayon` para procesar archivos en paralelo utilizando el 100% de los hilos de tu CPU.
|
|
25
|
-
- Analiza y muta todo un proyecto en escasos milisegundos usando criptografía segura (`sha2`).
|
|
48
|
+
3. **Architectural Restoration (Separation of Concerns):**
|
|
49
|
+
Purists hate mixing structure and design in the same line. AUM-IC lets you enjoy Tailwind's speed in development, but in production our orchestrator extracts design into a deterministic CSS ecosystem, restoring the sacred boundary between your logic and your styles.
|
|
26
50
|
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
51
|
+
4. **Obfuscation, Collision Prevention and AI Semantic Naming:**
|
|
52
|
+
We don't obfuscate only for anti-scraping security. By generating mathematical hashes (`aumic-rs-[hash]`), we **unify tags and guarantee zero style collisions** after a massive migration. AUM-IC also integrates an optional **AI Semantic Naming** feature (locally via *Ollama* or remotely via *Claude, Gemini, DeepSeek, Codex*). Thanks to our deduplication algorithm, the AI **only processes UNIQUE combinations** — never your full source code. This saves millions of tokens and shields your privacy.
|
|
53
|
+
|
|
54
|
+
5. **Extreme Performance (Zero-Bloat Build Time):**
|
|
55
|
+
Eliminating Tailwind's massive engine from your CI/CD pipelines dramatically accelerates build times for Next.js, Astro, and Vite — saving real server resources.
|
|
30
56
|
|
|
31
57
|
---
|
|
32
58
|
|
|
33
|
-
##
|
|
59
|
+
## 🆚 How Does It Compare?
|
|
34
60
|
|
|
35
|
-
|
|
61
|
+
| Feature | AUM-IC Tailwind Killer | PurgeCSS | UnoCSS | vanilla-extract | Manual Migration |
|
|
62
|
+
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
63
|
+
| **Removes unused CSS** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
64
|
+
| **Obfuscates class names** | ✅ | ❌ | ❌ | Partial | ❌ |
|
|
65
|
+
| **Zero-Bloat (removes Tailwind dep)** | ✅ | ❌ | ❌ | ✅ | ✅ |
|
|
66
|
+
| **Fully automated migration** | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
67
|
+
| **Rollback / Undo** | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
68
|
+
| **AST (no regex hacks)** | ✅ | ❌ | N/A | N/A | N/A |
|
|
69
|
+
| **Supports v1 / v2 / v3 / v4 Oxide** | ✅ | Partial | ✅ | N/A | Manual |
|
|
70
|
+
| **AI Semantic Naming** | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
71
|
+
| **Offline / Air-Gapped** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
72
|
+
| **Prevents CSS collisions post-migration** | ✅ | ❌ | ❌ | ✅ | Manual |
|
|
36
73
|
|
|
37
|
-
|
|
74
|
+
> **Summary:** PurgeCSS only removes dead code. UnoCSS is a framework, not a migrator. vanilla-extract requires a full manual rewrite. AUM-IC Tailwind Killer is the only tool that **automates the complete escape** from Tailwind with safety, reversibility and zero external dependencies.
|
|
38
75
|
|
|
39
|
-
|
|
40
|
-
# Uso al vuelo mediante NPX
|
|
41
|
-
npx @ingcrea/aumic-tailwind-killer -m local -t ./mi-proyecto
|
|
76
|
+
---
|
|
42
77
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
78
|
+
## 🦖 Architecture v4.1.3: Multi-Level JIT Cache
|
|
79
|
+
|
|
80
|
+
AUM-IC operates under a two-level cache architecture powered 100% by Node.js and analytical databases:
|
|
81
|
+
|
|
82
|
+
1. **L1 Cache (DuckDB - The Static Oracle):**
|
|
83
|
+
Via reverse engineering, we pre-compiled and extracted exact CSS equivalents for 26,000+ native utility classes. All this data lives in a super-compressed binary database (`aumic-lexicon.duckdb`) that injects CSS values instantaneously in O(1) time, fully offline and without invoking any compiler (Zero-Execution). **Its universal dictionary design guarantees full retrocompatibility for all 4 Tailwind generations: v1, v2, v3 and the new v4 Oxide.**
|
|
84
|
+
|
|
85
|
+
2. **L2 Cache (Dynamic JIT - The Hijacker):**
|
|
86
|
+
For complex dynamic classes not in L1, the engine dynamically hijacks the `tailwindcss` compiler installed in your project's `node_modules`. This ensures compilation respects the exact version you use (v2, v3 or v4 Oxide).
|
|
87
|
+
|
|
88
|
+
3. **Preflight Theme Extractor:**
|
|
89
|
+
Dynamically absorbs your `tailwind.config.*`, preserving native fonts (e.g. `Inter`) and custom color variables with 100% visual fidelity.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 🧠 5-Phase Pipeline (The Transmutation Engine)
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Your Project (source code)
|
|
97
|
+
│
|
|
98
|
+
▼
|
|
99
|
+
┌───────────────────────────────────────────────────────────┐
|
|
100
|
+
│ PHASE 1 ─ Reconnaissance & Pre-Flight │
|
|
101
|
+
│ Validates Git status, permissions, excludes │
|
|
102
|
+
│ node_modules / .git / dist │
|
|
103
|
+
└───────────────────────┬───────────────────────────────────┘
|
|
104
|
+
│
|
|
105
|
+
▼
|
|
106
|
+
┌───────────────────────────────────────────────────────────┐
|
|
107
|
+
│ PHASE 2 ─ Parallel Extraction (AST + Piscina Threads) │
|
|
108
|
+
│ Babel/Cheerio parse JSX/Astro/Vue/HTML surgically │
|
|
109
|
+
│ Extracts classes → Deduplicates → Unique combinations │
|
|
110
|
+
└───────────────────────┬───────────────────────────────────┘
|
|
111
|
+
│
|
|
112
|
+
▼
|
|
113
|
+
┌───────────────────────────────────────────────────────────┐
|
|
114
|
+
│ PHASE 3 ─ Nomenclature Cryptography │
|
|
115
|
+
│ Deterministic hashes aumic-rs-[hash] per combination │
|
|
116
|
+
│ 5,000 repetitions of one class = 1 single hash in RAM │
|
|
117
|
+
└──────────┬────────────────────────────┬───────────────────┘
|
|
118
|
+
│ │
|
|
119
|
+
▼ ▼
|
|
120
|
+
┌──────────────────────┐ ┌────────────────────────────────┐
|
|
121
|
+
│ L1 Cache (DuckDB) │ │ L2 Cache (Dynamic JIT) │
|
|
122
|
+
│ 26,000+ classes │ │ Local tailwindcss compiler │
|
|
123
|
+
│ O(1) · Offline │ │ For dynamic classes w-[Xpx] │
|
|
124
|
+
│ Hit Rate: 99.2% │ │ Respects your installed ver. │
|
|
125
|
+
└──────────┬───────────┘ └────────────────┬───────────────┘
|
|
126
|
+
└────────────────────────────────┘
|
|
127
|
+
│
|
|
128
|
+
▼
|
|
129
|
+
┌───────────────────────────────────────────────────────────┐
|
|
130
|
+
│ PHASE 4 ─ Synthesis & Output │
|
|
131
|
+
│ Pure unified CSS · aumic-lock.json (rollback map) │
|
|
132
|
+
└───────────────────────┬───────────────────────────────────┘
|
|
133
|
+
│
|
|
134
|
+
▼
|
|
135
|
+
┌───────────────────────────────────────────────────────────┐
|
|
136
|
+
│ PHASE 5 ─ Total Eradication │
|
|
137
|
+
│ Purges Tailwind from package.json · Rewrites components │
|
|
138
|
+
│ Your code is free, clean and sovereign. │
|
|
139
|
+
└───────────────────────────────────────────────────────────┘
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 🔄 Before & After: What Your Code Looks Like
|
|
145
|
+
|
|
146
|
+
### HTML / JSX — Before
|
|
147
|
+
```html
|
|
148
|
+
<div class="flex items-center justify-between p-4 bg-white shadow-md rounded-xl border border-gray-200">
|
|
149
|
+
<span class="text-sm font-semibold text-gray-800">Dashboard</span>
|
|
150
|
+
</div>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### HTML / JSX — After
|
|
154
|
+
```html
|
|
155
|
+
<div class="aumic-rs-1b3a">
|
|
156
|
+
<span class="aumic-rs-2c4f">Dashboard</span>
|
|
157
|
+
</div>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Generated CSS — After
|
|
161
|
+
```css
|
|
162
|
+
/* aumic-output.css — Pure CSS. No framework. No runtime. No dependencies. */
|
|
163
|
+
.aumic-rs-1b3a {
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
justify-content: space-between;
|
|
167
|
+
padding: 1rem;
|
|
168
|
+
background-color: #ffffff;
|
|
169
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
170
|
+
border-radius: 0.75rem;
|
|
171
|
+
border: 1px solid #e5e7eb;
|
|
172
|
+
}
|
|
173
|
+
.aumic-rs-2c4f {
|
|
174
|
+
font-size: 0.875rem;
|
|
175
|
+
font-weight: 600;
|
|
176
|
+
color: #1f2937;
|
|
177
|
+
}
|
|
46
178
|
```
|
|
47
179
|
|
|
180
|
+
**Result:** Your HTML is clean. Your CSS is pure standard. Tailwind is gone. Zero runtime. Zero build step. Forever.
|
|
181
|
+
|
|
48
182
|
---
|
|
49
183
|
|
|
50
|
-
##
|
|
184
|
+
## 🔒 The `aumic-lock.json` Map (Rollback & IA Schema)
|
|
185
|
+
|
|
186
|
+
Every transmutation generates an `aumic-lock.json` in your project root. This file is your **safety net and the bridge for AI semantic naming**. Its structure:
|
|
187
|
+
|
|
188
|
+
```json
|
|
189
|
+
{
|
|
190
|
+
"version": "4.1.3",
|
|
191
|
+
"createdAt": "2025-09-28T09:00:00Z",
|
|
192
|
+
"stats": {
|
|
193
|
+
"filesProcessed": 1247,
|
|
194
|
+
"classesFound": 48312,
|
|
195
|
+
"uniqueCombinations": 5840,
|
|
196
|
+
"hitRateL1": 0.992,
|
|
197
|
+
"hitRateL2": 0.008
|
|
198
|
+
},
|
|
199
|
+
"map": {
|
|
200
|
+
"aumic-rs-1b3a": {
|
|
201
|
+
"original": "flex items-center justify-between p-4 bg-white shadow-md rounded-xl border border-gray-200",
|
|
202
|
+
"css": ".aumic-rs-1b3a { display: flex; align-items: center; ... }",
|
|
203
|
+
"occurrences": 143,
|
|
204
|
+
"files": ["src/components/Card.tsx", "src/layouts/Dashboard.astro"]
|
|
205
|
+
},
|
|
206
|
+
"aumic-rs-2c4f": {
|
|
207
|
+
"original": "text-sm font-semibold text-gray-800",
|
|
208
|
+
"css": ".aumic-rs-2c4f { font-size: 0.875rem; font-weight: 600; color: #1f2937; }",
|
|
209
|
+
"occurrences": 89,
|
|
210
|
+
"files": ["src/components/Card.tsx"]
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
This map is what powers the `-m restore` rollback — and what the AI semantic naming engine reads to produce human-readable names **without ever seeing your source code**.
|
|
51
217
|
|
|
52
|
-
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## 🚀 Installation
|
|
53
221
|
|
|
54
|
-
|
|
55
|
-
**Caso de uso:** Quieres auditar tu proyecto, ver cuántas clases de Tailwind usas y visualizar el impacto sin modificar tu código fuente.
|
|
222
|
+
> **No extra system dependencies required.** DuckDB is bundled inside the package. Works on macOS, Linux, and Windows (Node.js >= 18.0).
|
|
56
223
|
|
|
57
224
|
```bash
|
|
58
|
-
|
|
225
|
+
# Run on-the-fly via NPX (recommended)
|
|
226
|
+
npx @ingcrea/aumic-tailwind-killer -m local -t ./my-project
|
|
227
|
+
|
|
228
|
+
# Global installation
|
|
229
|
+
npm install -g @ingcrea/aumic-tailwind-killer
|
|
230
|
+
aumic-tailwind-killer -m local -t ./my-project
|
|
59
231
|
```
|
|
60
|
-
* **Qué hace:** Escanea el código mediante el Motor Infrarrojo, extrae las utilidades, genera los hashes en memoria y emite el CSS de prueba, pero **no altera** tus archivos.
|
|
61
232
|
|
|
62
|
-
|
|
63
|
-
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## 🛠 Usage Modes
|
|
64
236
|
|
|
237
|
+
### 1. Simulate Mode (Dry-Run)
|
|
238
|
+
Audit your project — see how many Tailwind classes you use and preview the impact **without touching a single file**.
|
|
65
239
|
```bash
|
|
66
|
-
npx @ingcrea/aumic-tailwind-killer -m
|
|
240
|
+
npx @ingcrea/aumic-tailwind-killer -m simulate -t ./
|
|
67
241
|
```
|
|
68
|
-
* **Qué hace:** Ejecuta las 5 Fases de AUM-IC. Reescribe físicamente todos los archivos soportados usando los motores paralelos de Rust, inyecta el CSS nativo unificado, elimina dependencias en `package.json` y genera un mapa reverso (`aumic-lock.json`).
|
|
69
242
|
|
|
70
|
-
###
|
|
71
|
-
|
|
243
|
+
### 2. Local Mode (Destructive Transmutation)
|
|
244
|
+
Replace all Tailwind with pure CSS, rewrite your components (`.astro`, `.tsx`, `.vue`, `.py`) and eliminate the framework.
|
|
245
|
+
```bash
|
|
246
|
+
npx @ingcrea/aumic-tailwind-killer -m local -t ./
|
|
247
|
+
```
|
|
72
248
|
|
|
249
|
+
### 3. Surgical Mode (Scoped Mutation)
|
|
250
|
+
Process only a specific folder or file pattern in a giant monorepo.
|
|
73
251
|
```bash
|
|
74
252
|
npx @ingcrea/aumic-tailwind-killer -m local -t ./ -s "src/frontend/**/*.{tsx,astro}"
|
|
75
253
|
```
|
|
76
|
-
* **Qué hace:** Restringe la mutación **estrictamente** al patrón Glob (Regex) definido en el argumento `-s` (Scope).
|
|
77
|
-
|
|
78
|
-
### 4. Modo Restauración (Rollback)
|
|
79
|
-
**Caso de uso:** Algo falló durante el QA post-mutación o necesitas volver a trabajar con Tailwind en tu entorno local.
|
|
80
254
|
|
|
255
|
+
### 4. Restore Mode (Rollback)
|
|
256
|
+
Fully revert to original Tailwind classes using the `aumic-lock.json` map.
|
|
81
257
|
```bash
|
|
82
258
|
npx @ingcrea/aumic-tailwind-killer -m restore -t ./
|
|
83
259
|
```
|
|
84
|
-
|
|
260
|
+
|
|
261
|
+
### 5. AI Semantic Naming (Optional)
|
|
262
|
+
Replace cryptic hashes with human-readable semantic names post-transmutation.
|
|
263
|
+
```bash
|
|
264
|
+
# Ollama local (total privacy, zero cost)
|
|
265
|
+
npx @ingcrea/aumic-tailwind-killer -m local -t ./ --ai ollama --ai-model llama3
|
|
266
|
+
|
|
267
|
+
# Claude API (highest semantic precision)
|
|
268
|
+
npx @ingcrea/aumic-tailwind-killer -m local -t ./ --ai claude --ai-key sk-ant-...
|
|
269
|
+
|
|
270
|
+
# Gemini / DeepSeek / Codex
|
|
271
|
+
npx @ingcrea/aumic-tailwind-killer -m local -t ./ --ai gemini --ai-key AIza...
|
|
272
|
+
```
|
|
85
273
|
|
|
86
274
|
---
|
|
87
275
|
|
|
88
|
-
## ⚙️
|
|
276
|
+
## ⚙️ CLI Options
|
|
89
277
|
|
|
90
|
-
|
|
|
278
|
+
| Short | Long | Description | Required |
|
|
91
279
|
| :--- | :--- | :--- | :--- |
|
|
92
|
-
| `-m` | `--mode` |
|
|
93
|
-
| `-t` | `--target` |
|
|
94
|
-
| `-s` | `--scope` |
|
|
280
|
+
| `-m` | `--mode` | Operation mode: `simulate`, `local`, `restore`. | **Yes** |
|
|
281
|
+
| `-t` | `--target` | Path to the project directory. | **Yes** |
|
|
282
|
+
| `-s` | `--scope` | Glob pattern to restrict mutation to specific files. | No |
|
|
283
|
+
| — | `--ai` | AI provider for semantic naming: `ollama`, `claude`, `gemini`, `deepseek`, `codex`. | No |
|
|
284
|
+
| — | `--ai-model` | Specific model name (e.g. `llama3`, `claude-3-5-sonnet`). | No |
|
|
285
|
+
| — | `--ai-key` | Remote provider API Key (not required for `ollama`). | No |
|
|
286
|
+
| — | `--ai-base-url` | Custom Ollama base URL (default: `http://localhost:11434`). | No |
|
|
95
287
|
|
|
96
288
|
---
|
|
97
289
|
|
|
98
|
-
##
|
|
290
|
+
## 📊 Benchmarks
|
|
291
|
+
|
|
292
|
+
Measured on a Next.js monorepo with **1,200 files** and **48,000 unique Tailwind classes** (MacBook Pro M2, 16GB RAM):
|
|
293
|
+
|
|
294
|
+
| Metric | Tailwind Native (Cold Start) | AUM-IC L1 (DuckDB) | AUM-IC L2 (Dynamic JIT) |
|
|
295
|
+
| :--- | :---: | :---: | :---: |
|
|
296
|
+
| **Class resolution time** | `1,340ms` | `~80ms` | `~220ms` |
|
|
297
|
+
| **RAM consumed** | `~210MB` | `~48MB` | `~85MB` |
|
|
298
|
+
| **Final CSS size reduction** | Base | **~38% smaller** | **~38% smaller** |
|
|
299
|
+
| **Offline hit rate** | N/A | **99.2%** | 0.8% remaining |
|
|
300
|
+
| **Version compatibility** | Installed only | **v1, v2, v3, v4 Oxide** | v2, v3, v4 Oxide |
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## 🖥️ Console Output Preview
|
|
305
|
+
|
|
306
|
+
```
|
|
307
|
+
╔════════════════════════════════════════════════════════╗
|
|
308
|
+
║ ⚔️ AUM-IC Tailwind Killer v4.1.3 ║
|
|
309
|
+
║ Powered by DuckDB • IngCrea ® ║
|
|
310
|
+
╚════════════════════════════════════════════════════════╝
|
|
311
|
+
|
|
312
|
+
[✔] PRE-FLIGHT Clean Git branch. Filesystem validated.
|
|
313
|
+
[⚡] SCAN Scanning 1,247 files (Piscina Worker Threads: 8)...
|
|
314
|
+
[🔎] EXTRACT 48,312 classes detected. Deduplicating...
|
|
315
|
+
[🚀] L1 CACHE DuckDB resolved 47,924 classes in O(1) [Hit Rate: 99.2%]
|
|
316
|
+
[⚙️] L2 CACHE Local JIT compiled 388 dynamic classes [w-[320px], text-[#FF0000]...]
|
|
317
|
+
[🛡️] HASH Deterministic hashes: 48,312 -> 5,840 unique
|
|
318
|
+
[💾] OUTPUT aumic-output.css generated (127KB -> 78KB, -39%)
|
|
319
|
+
[🔒] LOCK aumic-lock.json written. Rollback available.
|
|
320
|
+
[💥] PURGE Tailwind CSS removed from package.json. Freedom!
|
|
321
|
+
|
|
322
|
+
✔ Zero-Bloat transmutation completed in 112ms.
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
## 🧠 Under the Hood: The Engineering
|
|
329
|
+
|
|
330
|
+
AUM-IC Tailwind Killer is not a simple Regex script. It is a **Safe Static Analysis** tool designed for enterprise-grade monorepos:
|
|
331
|
+
|
|
332
|
+
* **AST Interceptors (Abstract Syntax Tree):** We utilize Babel (for JSX/TSX/Vue) and Cheerio (for Astro/HTML) to structurally read your components. This guarantees zero code corruption on conditional interpolations.
|
|
333
|
+
* **Intermediate Bytecode for Semantic Naming:** The hashes you see injected into your code (e.g., `class="aumic-rs-1b3a"`) **are NOT the final output**. They act as an intermediate *bytecode*. AUM-IC offers an **AI Semantic Naming** engine (via Ollama or Claude) that reads your `aumic-lock.json` and automatically translates these hashes into pure, maintainable semantic CSS (e.g., `.dashboard-card`). It is an automated bridge back to traditional CSS.
|
|
334
|
+
* **Dynamic Classes Management (clsx, twMerge):** If a class cannot be deterministically resolved at compile time (e.g., `<div class={\`bg-${color}-500\`}>`), the static analyzer safely ignores it and flags it in the simulation report for developer review.
|
|
335
|
+
|
|
336
|
+
## 🥊 AUM-IC vs Tailwind v4
|
|
337
|
+
|
|
338
|
+
Tailwind v4 introduced monumental improvements in compilation speed (Oxide engine) and CSS-first configuration. So why use AUM-IC?
|
|
339
|
+
|
|
340
|
+
Tailwind v4 solves performance, but it **DOES NOT solve Vendor Lock-in or HTML Soup**.
|
|
341
|
+
If you use v4, your HTML code remains strictly coupled to a proprietary Domain-Specific Language (DSL). AUM-IC Tailwind Killer does not compete on compilation speed; its sole objective is **Architectural Independence (Zero Vendor Lock-in)**. It returns full control to you via clean, semantic HTML and standard CSS that will outlive any frontend framework trend.
|
|
342
|
+
|
|
343
|
+
## ⚠️ Limitations and Ideal Use Cases
|
|
344
|
+
|
|
345
|
+
* **Not recommended for:** Projects highly dependent on fully dynamic classes constructed at runtime (string interpolation) without exhaustive manual auditing. If your project has thousands of runtime logic branches for styles, you will need a gradual migration approach.
|
|
346
|
+
* **Highly recommended for:** Freezing technical debt, standardizing monorepos, protecting UI Intellectual Property for commercial licensing, and preparing architectures for 10+ year maintenance lifecycles.
|
|
347
|
+
|
|
348
|
+
## ❓ FAQ
|
|
349
|
+
|
|
350
|
+
**Does this break Tailwind pseudo-classes like `hover:`, `focus:`, `md:`?**
|
|
351
|
+
> No. The AST interceptor detects and preserves responsive and state modifiers. The final hash encapsulates the full selector: `hover:bg-red-500` → `aumic-rs-a3f1` with its `:hover` rule intact in the output CSS.
|
|
352
|
+
|
|
353
|
+
**Can I use it alongside Tailwind or does it remove it completely?**
|
|
354
|
+
> In Simulate mode (`-m simulate`), Tailwind is untouched. In Local mode (`-m local`), it is purged from `package.json`. You can revert everything at any time with `-m restore`.
|
|
355
|
+
|
|
356
|
+
**Does it support `@apply` in legacy CSS files?**
|
|
357
|
+
> Yes. The Preflight Theme Extractor absorbs your `tailwind.config.*` and processes `@apply` directives in `.css` and `.scss` files during Phase 2.
|
|
358
|
+
|
|
359
|
+
**What about dynamic classes generated in JavaScript (`cn(...)`, `clsx(...)`)?**
|
|
360
|
+
> AUM-IC analyzes the AST of your `.tsx` / `.jsx` files and detects utility patterns (`cn`, `clsx`, `twMerge`), resolving static strings automatically. Fully runtime-dynamic strings are flagged in the simulation report for manual review.
|
|
361
|
+
|
|
362
|
+
**Does it support Tailwind v4 Oxide?**
|
|
363
|
+
> Yes. The L1 DuckDB cache contains the compiled dictionary for Tailwind v4 Oxide. The L2 Cache hijacks `@tailwindcss/vite` or the native binary as detected from your `package.json`.
|
|
364
|
+
|
|
365
|
+
**What if I use CSS-in-JS (`styled-components`, `emotion`) without Tailwind?**
|
|
366
|
+
> AUM-IC Tailwind Killer processes **Tailwind utility classes** in your component markup. If your project uses CSS-in-JS libraries *without* Tailwind classes in HTML/JSX attributes, there is nothing to transmute — the tool will simply report zero classes found. For **mixed projects** (Tailwind classes in some components + CSS-in-JS in others), AUM-IC processes only the Tailwind parts and leaves CSS-in-JS components completely untouched.
|
|
367
|
+
|
|
368
|
+
**What if the migration fails mid-process?**
|
|
369
|
+
> Phase 1 (Pre-Flight) runs before touching a single file and aborts immediately if it detects uncommitted Git changes, permission issues, or missing dependencies. If a failure occurs after Phase 1 begins writing, every modified file has a `.aumic-bak` backup copy that `--mode restore` uses to recover the exact original state. Your code is always recoverable.
|
|
370
|
+
|
|
371
|
+
**Does DuckDB need to be installed separately?**
|
|
372
|
+
> No. DuckDB is bundled inside the npm package via the `duckdb` Node.js binding. No system-level installation, no extra binaries, no environment variables. It works out of the box on macOS, Linux and Windows with Node.js >= 18.
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## 🗺️ Roadmap
|
|
377
|
+
|
|
378
|
+
| Version | Feature | Status |
|
|
379
|
+
| :--- | :--- | :---: |
|
|
380
|
+
| v4.1.3 | DuckDB L1 Cache · Parallel AST · Rollback · AI Naming | ✅ Stable |
|
|
381
|
+
| v4.2.0 | Native Vite plugin · Turbopack integration | 🔄 In development |
|
|
382
|
+
| v4.3.0 | Svelte stable · Angular 17+ support | 📋 Planned |
|
|
383
|
+
| v5.0.0 | VS Code extension · Web audit dashboard | 📋 Planned |
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
## 🤝 Contributing
|
|
388
|
+
|
|
389
|
+
Found a bug or want to add support for a new framework? Contributions are welcome.
|
|
390
|
+
|
|
391
|
+
1. **Fork** the repository.
|
|
392
|
+
2. Create a branch: `git checkout -b feat/my-improvement`.
|
|
393
|
+
3. Run tests: `npm test`.
|
|
394
|
+
4. Open a **Pull Request** describing the change and its technical motivation.
|
|
395
|
+
|
|
396
|
+
For major changes (new modes, new AI providers, new framework support), open an **Issue** first to align on design.
|
|
397
|
+
|
|
398
|
+
> All contributions must comply with the non-negotiable design principles in [`MANIFEST.md`](./MANIFEST.md).
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
## 🏢 Enterprise Support & Dual-Licensing
|
|
403
|
+
|
|
404
|
+
**AUM-IC Tailwind Killer** operates under a **Dual-License Model**:
|
|
405
|
+
|
|
406
|
+
1. **Open Source:** Free under the [AGPL v3 License](./LICENSE) for open source, personal, or non-commercial projects.
|
|
407
|
+
2. **Commercial:** Proprietary licensing for organizations embedding AUM-IC in closed-source products, SaaS platforms, or internal enterprise workflows. See [LICENSE-COMMERCIAL.md](./LICENSE-COMMERCIAL.md) for details.
|
|
408
|
+
|
|
409
|
+
For organizations with large-scale monorepos, **INGENIERÍA CREATIVA Y DESARROLLOS TECNOLÓGICOS S.A.S. (IngCrea)** offers:
|
|
410
|
+
|
|
411
|
+
| Service | Description |
|
|
412
|
+
| :--- | :--- |
|
|
413
|
+
| 🔍 **Migration Audit** | Technical assessment, risk identification and transmutation plan for enterprise projects. |
|
|
414
|
+
| ⚡ **Managed CI/CD Integration** | AUM-IC configured inside GitHub Actions, GitLab CI or Jenkins pipelines. |
|
|
415
|
+
| 🧠 **On-Premise AI Naming** | Ollama deployment with specialized models on client infrastructure. Zero code exposure. |
|
|
416
|
+
| 🛡️ **SLA & Priority Support** | Dedicated channel, critical incident resolution in under 4 hours. |
|
|
99
417
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
4. **Motor JIT Embebido:** Generación virtual en memoria y renderizado de CSS de Tailwind usando compilación "Just In Time" invocada como un subproceso nativo del sistema.
|
|
104
|
-
5. **Erradicación Total:** Renombramiento de configuraciones a `.aumic-bak`, inyección del archivo CSS puro resultante y desinstalación forzada del framework original.
|
|
418
|
+
> ### 📧 Enterprise Contact
|
|
419
|
+
> **contacto@ingcrea.com** | [ingcrea.com](https://ingcrea.com)
|
|
420
|
+
> *Response within 24 business hours.*
|
|
105
421
|
|
|
106
422
|
---
|
|
107
423
|
|
|
108
|
-
>
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
## 🦖 Novedades en v4.1.3 (Multi-Level JIT Cache)
|
|
114
|
-
|
|
115
|
-
A partir de la versión 4.1.3, el motor de TypeScript se convirtió en el orquestador principal gracias a la inyección de una arquitectura de caché de doble nivel:
|
|
116
|
-
|
|
117
|
-
1. **L1 Cache (DuckDB - El Oráculo Estático):**
|
|
118
|
-
- Una base de datos binaria súper comprimida (`aumic-lexicon.duckdb`) que resuelve >26,000 clases de Tailwind CSS en tiempo O(1) de forma completamente offline.
|
|
119
|
-
2. **L2 Cache (Dynamic JIT):**
|
|
120
|
-
- El motor ahora secuestra e invoca de forma dinámica el propio compilador `tailwindcss` instalado en la carpeta `node_modules` del proyecto destino. Esto garantiza que la compilación de clases complejas respete la versión exacta del cliente (v2, v3 o v4).
|
|
121
|
-
3. **Preflight Theme Extractor:**
|
|
122
|
-
- La inyección del CSS Reset ahora absorbe dinámicamente el archivo `tailwind.config.*` del cliente, preservando tipografías nativas (ej. `Inter`) y variables de color personalizadas con fidelidad visual del 100%.
|
|
424
|
+
> Developed under the technological standard of **INGENIERÍA CREATIVA Y DESARROLLOS TECNOLÓGICOS S.A.S.** Excellence, Determinism and Zero-Trust.
|
package/dist/ast/parser.js
CHANGED
|
@@ -13,17 +13,17 @@ class AstInterceptor {
|
|
|
13
13
|
* e intercepta todos los StringLiterals dentro, sin importar su nivel
|
|
14
14
|
* de anidación o lógica condicional (ternarios, arrays, etc).
|
|
15
15
|
*/
|
|
16
|
-
processFrameworkFile(code, fileName, replacerFn) {
|
|
16
|
+
processFrameworkFile(code, fileName, replacerFn, isRestore = false) {
|
|
17
17
|
const ext = fileName.split('.').pop()?.toLowerCase();
|
|
18
18
|
const jsExtensions = ['jsx', 'tsx', 'js', 'ts'];
|
|
19
19
|
if (jsExtensions.includes(ext || '')) {
|
|
20
|
-
return this.processWithBabel(code, replacerFn);
|
|
20
|
+
return this.processWithBabel(code, replacerFn, isRestore);
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
|
-
return this.processWithUniversalRegex(code, replacerFn);
|
|
23
|
+
return this.processWithUniversalRegex(code, replacerFn, isRestore);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
processWithUniversalRegex(code, replacerFn) {
|
|
26
|
+
processWithUniversalRegex(code, replacerFn, isRestore = false) {
|
|
27
27
|
const extracted = new Set();
|
|
28
28
|
// Regex letal que captura class="...", className='...', class:list={`...`} en cualquier motor de plantillas (Jinja, Blade, Tera, HTML)
|
|
29
29
|
const classRegex = /(class|className|class:list)\s*(=|:)\s*(["'`])(.*?)\3/gs;
|
|
@@ -33,21 +33,21 @@ class AstInterceptor {
|
|
|
33
33
|
while ((match = classRegex.exec(code)) !== null) {
|
|
34
34
|
const classString = match[4];
|
|
35
35
|
const cleanStr = classString.replace(/\s+/g, ' ').trim();
|
|
36
|
-
if (cleanStr && !cleanStr.includes('aumic-')) {
|
|
36
|
+
if (cleanStr && (isRestore || !cleanStr.includes('aumic-'))) {
|
|
37
37
|
extracted.add(cleanStr);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
// Fase 2: Mutación directa
|
|
41
41
|
newCode = code.replace(classRegex, (fullMatch, attr, separator, quote, classString) => {
|
|
42
42
|
const cleanStr = classString.replace(/\s+/g, ' ').trim();
|
|
43
|
-
if (!cleanStr || cleanStr.includes('aumic-'))
|
|
43
|
+
if (!cleanStr || (!isRestore && cleanStr.includes('aumic-')))
|
|
44
44
|
return fullMatch;
|
|
45
45
|
const newClass = replacerFn(cleanStr);
|
|
46
46
|
return `${attr}${separator}${quote}${newClass}${quote}`;
|
|
47
47
|
});
|
|
48
48
|
return { newCode, extractedClasses: Array.from(extracted) };
|
|
49
49
|
}
|
|
50
|
-
processWithBabel(code, replacerFn) {
|
|
50
|
+
processWithBabel(code, replacerFn, isRestore = false) {
|
|
51
51
|
const ast = (0, parser_1.parse)(code, {
|
|
52
52
|
sourceType: 'module',
|
|
53
53
|
plugins: ['jsx', 'typescript']
|
|
@@ -62,7 +62,7 @@ class AstInterceptor {
|
|
|
62
62
|
StringLiteral(strPath) {
|
|
63
63
|
const originalStr = strPath.node.value;
|
|
64
64
|
const cleanStr = originalStr.replace(/\s+/g, ' ').trim();
|
|
65
|
-
if (cleanStr && !cleanStr.includes('aumic-')) {
|
|
65
|
+
if (cleanStr && (isRestore || !cleanStr.includes('aumic-'))) {
|
|
66
66
|
extracted.add(cleanStr);
|
|
67
67
|
strPath.node.value = replacerFn(cleanStr);
|
|
68
68
|
}
|
|
@@ -70,7 +70,7 @@ class AstInterceptor {
|
|
|
70
70
|
TemplateElement(tplPath) {
|
|
71
71
|
const originalRaw = tplPath.node.value.raw;
|
|
72
72
|
const cleanStr = originalRaw.replace(/\s+/g, ' ').trim();
|
|
73
|
-
if (cleanStr && !cleanStr.includes('aumic-')) {
|
|
73
|
+
if (cleanStr && (isRestore || !cleanStr.includes('aumic-'))) {
|
|
74
74
|
extracted.add(cleanStr);
|
|
75
75
|
tplPath.node.value.raw = replacerFn(cleanStr);
|
|
76
76
|
tplPath.node.value.cooked = tplPath.node.value.raw;
|
|
@@ -86,7 +86,7 @@ class AstInterceptor {
|
|
|
86
86
|
StringLiteral(strPath) {
|
|
87
87
|
const originalStr = strPath.node.value;
|
|
88
88
|
const cleanStr = originalStr.replace(/\s+/g, ' ').trim();
|
|
89
|
-
if (cleanStr && !cleanStr.includes('aumic-')) {
|
|
89
|
+
if (cleanStr && (isRestore || !cleanStr.includes('aumic-'))) {
|
|
90
90
|
extracted.add(cleanStr);
|
|
91
91
|
strPath.node.value = replacerFn(cleanStr);
|
|
92
92
|
}
|
|
@@ -94,7 +94,7 @@ class AstInterceptor {
|
|
|
94
94
|
TemplateElement(tplPath) {
|
|
95
95
|
const originalRaw = tplPath.node.value.raw;
|
|
96
96
|
const cleanStr = originalRaw.replace(/\s+/g, ' ').trim();
|
|
97
|
-
if (cleanStr && !cleanStr.includes('aumic-')) {
|
|
97
|
+
if (cleanStr && (isRestore || !cleanStr.includes('aumic-'))) {
|
|
98
98
|
extracted.add(cleanStr);
|
|
99
99
|
tplPath.node.value.raw = replacerFn(cleanStr);
|
|
100
100
|
tplPath.node.value.cooked = tplPath.node.value.raw;
|
package/dist/index.js
CHANGED
|
@@ -1011,8 +1011,11 @@ async function run() {
|
|
|
1011
1011
|
const content = await fs_extra_1.default.readFile(file, 'utf-8');
|
|
1012
1012
|
try {
|
|
1013
1013
|
const { newCode } = astEngine.processFrameworkFile(content, file, (twClass) => {
|
|
1014
|
-
|
|
1015
|
-
|
|
1014
|
+
// Dividimos por si hay múltiples hashes en el mismo string
|
|
1015
|
+
const classes = twClass.split(" ");
|
|
1016
|
+
const restored = classes.map(c => lockData[c] || c).join(" ");
|
|
1017
|
+
return restored;
|
|
1018
|
+
}, true);
|
|
1016
1019
|
if (newCode !== content) {
|
|
1017
1020
|
await fs_extra_1.default.writeFile(file, newCode, 'utf-8');
|
|
1018
1021
|
restoredCount++;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ingcrea/aumic-tailwind-killer",
|
|
3
|
-
"version": "4.1.
|
|
4
|
-
"description": "Transpilador de Tailwind a CSS3 puro bajo
|
|
3
|
+
"version": "4.1.4",
|
|
4
|
+
"description": "Transpilador de Tailwind a CSS3 puro bajo estándar AUM-IC",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"aumic-tailwind-killer": "bin/aumic-killer.js"
|
|
@@ -34,11 +34,12 @@
|
|
|
34
34
|
"@types/node": "^20.11.20",
|
|
35
35
|
"typescript": "^5.3.3"
|
|
36
36
|
},
|
|
37
|
-
"author": "
|
|
37
|
+
"author": "Ingeniería Creativa <soporte@ingcrea.com> (https://ingcrea.com)",
|
|
38
38
|
"repository": {
|
|
39
39
|
"type": "git",
|
|
40
40
|
"url": "git+https://github.com/ingcrea/aumic-tailwind-killer.git"
|
|
41
41
|
},
|
|
42
|
+
"license": "AGPL-3.0-or-later",
|
|
42
43
|
"keywords": [
|
|
43
44
|
"tailwind",
|
|
44
45
|
"css",
|