@stayicon/drift-guard 0.1.0 → 0.2.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 +31 -1
- package/dist/{chunk-27T45SVD.js → chunk-HI6H6PCS.js} +526 -16
- package/dist/chunk-HI6H6PCS.js.map +1 -0
- package/dist/cli/index.js +438 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +118 -1
- package/dist/index.js +17 -3
- package/package.json +1 -1
- package/dist/chunk-27T45SVD.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,8 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
> When AI writes code, your design survives.
|
|
6
6
|
|
|
7
|
-
[](https://www.npmjs.com/package/@stayicon/drift-guard)
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
[](https://github.com/Hwani-Net/drift-guard)
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<img src="docs/assets/cli-demo.png" alt="drift-guard CLI demo" width="680">
|
|
13
|
+
</p>
|
|
9
14
|
|
|
10
15
|
---
|
|
11
16
|
|
|
@@ -117,6 +122,30 @@ npx drift-guard snapshot update
|
|
|
117
122
|
| 🌫️ Shadows | `box-shadow`, `text-shadow` | `box-shadow: 0 4px 6px rgba(0,0,0,0.1)` |
|
|
118
123
|
| ⭕ Radius | `border-radius` | `border-radius: 8px` |
|
|
119
124
|
| 📐 Layout | `display`, `flex-direction`, `justify-content`, `align-items` | `display: flex` |
|
|
125
|
+
| ✨ Effects | `backdrop-filter`, `filter`, `animation`, `transition` | `backdrop-filter: blur(10px)` |
|
|
126
|
+
| 🏗️ Structure | Semantic tags, DOM depth, layout hash, child sequence | `<header> → <nav> → <main> → <footer>` |
|
|
127
|
+
|
|
128
|
+
### DOM Structure Detection (v0.2.0)
|
|
129
|
+
|
|
130
|
+
drift-guard now fingerprints your HTML structure — not just CSS tokens.
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Initialize with structure tracking (on by default)
|
|
134
|
+
npx drift-guard init --from design.html
|
|
135
|
+
|
|
136
|
+
# Check detects structural changes too
|
|
137
|
+
npx drift-guard check
|
|
138
|
+
# 🏗️ Structure Drift:
|
|
139
|
+
# ⚠️ maxDepth: 6 → 4
|
|
140
|
+
# ⚠️ section count: 3 → 2
|
|
141
|
+
# ⚠️ layoutHash changed
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
What it tracks:
|
|
145
|
+
- **Semantic tags**: `header`, `nav`, `main`, `section`, `article`, `aside`, `footer` counts
|
|
146
|
+
- **Max depth**: DOM nesting depth changes (AI flattening your layout)
|
|
147
|
+
- **Layout hash**: `display:flex/grid` element fingerprint
|
|
148
|
+
- **Child sequence**: Body direct children order changes
|
|
120
149
|
|
|
121
150
|
## Supported AI Tools
|
|
122
151
|
|
|
@@ -184,6 +213,7 @@ const rules = generateRules(snapshot, 'claude-md');
|
|
|
184
213
|
| **AI-aware** | ✅ Generates agent rules | ❌ No AI integration |
|
|
185
214
|
| **Speed** | < 1 second | Minutes (browser rendering) |
|
|
186
215
|
| **Dependencies** | Zero (no browser) | Headless Chrome required |
|
|
216
|
+
| **Token overhead** | 0 tokens (CLI) | N/A |
|
|
187
217
|
| **Cost** | Free, forever | Percy: $99+/mo for teams |
|
|
188
218
|
|
|
189
219
|
## Philosophy
|