@hanzo/design 0.5.7 → 0.5.8
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/package.json +1 -1
- package/scripts/lint.mjs +17 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/design",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"packageManager": "pnpm@11.17.0",
|
|
5
5
|
"description": "Hanzo Design System \u2014 monochrome, dark-default tokens + components + brand assets, the single source of truth for every Hanzo surface. CSS + typed programmatic tokens.",
|
|
6
6
|
"license": "MIT OR Apache-2.0",
|
package/scripts/lint.mjs
CHANGED
|
@@ -291,10 +291,18 @@ const RULES = [
|
|
|
291
291
|
*
|
|
292
292
|
* { "raw-color": 412, "redeclared-token": 6 }
|
|
293
293
|
*
|
|
294
|
-
* A count
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
294
|
+
* A count UNDER its allowance is REPORTED, loudly, and does not fail. That was
|
|
295
|
+
* the other way round for one release and it froze hanzo.app's: the count a tree
|
|
296
|
+
* produces is not identical everywhere — a working copy holds files a fresh
|
|
297
|
+
* checkout does not — so an allowance that has to match EXACTLY turns a
|
|
298
|
+
* difference of environment into a red release. Every gate this package exists
|
|
299
|
+
* to add has to be worth more than the shipping it stops, and a stale number is
|
|
300
|
+
* never worth that.
|
|
301
|
+
*
|
|
302
|
+
* So: over the allowance FAILS — that violation was written today and there is
|
|
303
|
+
* nothing environmental about it. Under it prints the number to write down. The
|
|
304
|
+
* ratchet is still a ratchet, because the allowance can only be lowered by hand
|
|
305
|
+
* and this line tells you exactly what to lower it to.
|
|
298
306
|
*
|
|
299
307
|
* A rule with no entry is allowed ZERO, so a new rule is live everywhere the
|
|
300
308
|
* day it ships and no surface has to opt in.
|
|
@@ -333,15 +341,16 @@ if (unknown.length) {
|
|
|
333
341
|
process.exit(1)
|
|
334
342
|
}
|
|
335
343
|
|
|
336
|
-
|
|
344
|
+
for (const r of under)
|
|
345
|
+
console.log(` ${r}: ${count[r]} found against ${allow[r] ?? 0} allowed — ${(allow[r] ?? 0) - count[r]} fixed. ` +
|
|
346
|
+
`Lower it to ${count[r]} in ${RATCHET}.`)
|
|
347
|
+
|
|
348
|
+
if (!over.length) {
|
|
337
349
|
const owed = RULES.reduce((a, r) => a + (allow[r] ?? 0), 0)
|
|
338
350
|
console.log(`hanzo-design-lint: ${scanned} files, clean${owed ? ` (${owed} allowed by ${RATCHET})` : ''}`)
|
|
339
351
|
process.exit(0)
|
|
340
352
|
}
|
|
341
353
|
for (const r of over)
|
|
342
354
|
console.log(`\n ${r}: ${count[r]} found, ${allow[r] ?? 0} allowed — a NEW violation. Fix it.`)
|
|
343
|
-
for (const r of under)
|
|
344
|
-
console.log(`\n ${r}: ${count[r]} found, ${allow[r] ?? 0} allowed — you fixed ${(allow[r] ?? 0) - count[r]}. ` +
|
|
345
|
-
`Lower it in ${RATCHET}; the allowance only shrinks.`)
|
|
346
355
|
console.log(`\n${findings.length} violation(s) across ${scanned} files`)
|
|
347
356
|
process.exit(1)
|