@hanzo/design 0.5.6 → 0.5.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/lint.mjs +19 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/design",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
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
@@ -106,9 +106,16 @@ function lintUnresolved(rel, src) {
106
106
  }
107
107
  }
108
108
 
109
+ /** A build product says so at the top, and there is no point telling anyone to
110
+ * fix it — the fix belongs in the generator. Every convention in use is
111
+ * accepted, and only the head of the file is read, so a file that merely
112
+ * MENTIONS the phrase is still linted. */
113
+ const GENERATED = /@generated|AUTO-?GENERATED|DO NOT EDIT|Generated by|autogenerated/i
114
+
109
115
  function lintFile(abs, root) {
110
116
  const rel = relative(root, abs).split(sep).join('/')
111
117
  const raw = readFileSync(abs, 'utf8')
118
+ if (GENERATED.test(raw.slice(0, 400))) return
112
119
  if (extname(rel) === '.md') {
113
120
  // Line numbers stay true: replace everything outside a css fence with
114
121
  // blanks rather than extracting the fences, so a reported line is the line.
@@ -248,10 +255,18 @@ function lintFile(abs, root) {
248
255
  // an org switcher, an app launcher and a footer are ONE set of controls
249
256
  // across every Hanzo surface — that is what makes them recognisable as
250
257
  // one product. A local copy is a control that drifts by a release.
251
- for (const m of src.matchAll(
252
- /\b(?:function|const)\s+(Hanzo?(?:Header|Footer)|(?:Site|App|Global|Main|Top)(?:Header|Nav|Footer|Bar)|(?:Header|Nav|Command|Search)(?:Search|Palette|Trigger|Bar)|OrgSwitcher|OrgHeader|AppLauncher|MegaMenu)\b/g))
253
- flag(rel, lineOf(src, m.index), 'shell-owned-chrome', m[1],
254
- 'import it from @hanzogui/shell the chrome is one set of controls, fleet-wide')
258
+ //
259
+ // A WRAPPER IS NOT A COPY, and the question is which one this is. A file
260
+ // that imports the shell and composes it — passing this site's pages into
261
+ // `HanzoHeader`is doing exactly what it should, and hanzo.ai's
262
+ // `SiteHeader`/`SiteFooter` are that. So the rule asks whether the shell
263
+ // is in the file at all; if it is, the name is a local alias for shell
264
+ // chrome and not a second implementation of it.
265
+ if (!/['"]@hanzogui\/shell/.test(src))
266
+ for (const m of src.matchAll(
267
+ /\b(?:function|const)\s+(Hanzo?(?:Header|Footer)|(?:Site|App|Global|Main|Top)(?:Header|Nav|Footer|Bar)|(?:Header|Nav|Command|Search)(?:Search|Palette|Trigger|Bar)|OrgSwitcher|OrgHeader|AppLauncher|MegaMenu)\b/g))
268
+ flag(rel, lineOf(src, m.index), 'shell-owned-chrome', m[1],
269
+ 'import it from @hanzogui/shell — the chrome is one set of controls, fleet-wide')
255
270
  }
256
271
 
257
272
  // ── run ──────────────────────────────────────────────────────────────────