onsystem 0.11.1 → 0.11.2

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/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { $ as DEFAULT_TOKENS, A as unrecordedRules, At as relativePath, B as statusKinds, C as countBaseline, D as pruneBaseline, Dt as isInside, E as onLines, Et as SCRIPT_FILE, It as unique, J as ConfigError, L as toDesignMd, M as writeBaseline, O as readBaseline, Ot as matchesGlob, Pt as plural, R as toDtcg, Rt as readProjectConfig, S as applyBaseline, St as isDesignSystemName, T as goneFiles, Y as DEFAULT_DOCS, _ as formatDiagnostics, _t as PACKAGE_FIELD, b as BASELINE_FILE, bt as detectProject, c as silentLogger, et as FALLBACK_TOKENS, g as escapeData, gt as notReadYet, h as uncheckedNotice, ht as libraryTitle, i as componentFiles, j as updateBaseline, jt as toPosix, k as rulesRun, l as stderrLogger, o as loadDesignSystem, ot as excludedBy, q as CONFIG_FILES, rt as RULE_IDS, s as tokenFiles, tt as LEGACY_CONFIG_FILES, ut as rulesFor, v as NAME, w as findMoves, x as LEGACY_BASELINE_FILE, y as VERSION, yt as declaredConfig } from "./design-system-D7ppJYbd.js";
3
- import { a as notReadNotices, i as missingDependencies, o as explainProject, s as librariesLeftOut, t as serveStdio } from "./stdio-c3Y34to3.js";
4
- import { r as loadTarget } from "./workspace-DUgzMLGs.js";
2
+ import { $ as DEFAULT_TOKENS, A as unrecordedRules, At as relativePath, B as statusKinds, C as countBaseline, D as pruneBaseline, Dt as isInside, E as onLines, Et as SCRIPT_FILE, It as unique, J as ConfigError, L as toDesignMd, M as writeBaseline, O as readBaseline, Ot as matchesGlob, Pt as plural, R as toDtcg, Rt as readProjectConfig, S as applyBaseline, St as isDesignSystemName, T as goneFiles, Y as DEFAULT_DOCS, _ as formatDiagnostics, _t as PACKAGE_FIELD, b as BASELINE_FILE, bt as detectProject, c as silentLogger, et as FALLBACK_TOKENS, g as escapeData, gt as notReadYet, h as uncheckedNotice, ht as libraryTitle, i as componentFiles, j as updateBaseline, jt as toPosix, k as rulesRun, l as stderrLogger, o as loadDesignSystem, ot as excludedBy, q as CONFIG_FILES, rt as RULE_IDS, s as tokenFiles, tt as LEGACY_CONFIG_FILES, ut as rulesFor, v as NAME, w as findMoves, x as LEGACY_BASELINE_FILE, y as VERSION, yt as declaredConfig } from "./design-system-BZoTfLBU.js";
3
+ import { a as notReadNotices, i as missingDependencies, o as explainProject, s as librariesLeftOut, t as serveStdio } from "./stdio-WCDCmwJx.js";
4
+ import { r as loadTarget } from "./workspace-Dx0ogKg8.js";
5
5
  import fs from "node:fs";
6
6
  import path from "node:path";
7
7
  import { escapePath, glob } from "tinyglobby";
@@ -724,15 +724,16 @@ with a config, components.json or package.json, and inspect lists every project.
724
724
 
725
725
  Options
726
726
  --root <dir> Project root (default: the config file's directory, or cwd)
727
- --config <file> Config file (default: onsystem.config.{json,ts,mjs,js})
727
+ --config <file> Config file (default: onsystem.config.{json,ts,mts,js,mjs})
728
728
  --components <glob> Component sources, repeatable (default: found through
729
729
  components.json or a workspace package, else
730
730
  components/ui/**/*.{tsx,jsx} and src/components/ui/...)
731
- --tokens <file> Token file (DTCG .json or CSS), repeatable
731
+ --tokens <file> Token file (DTCG .json, CSS or DESIGN.md), repeatable
732
732
  --docs <glob> Component docs (Markdown/MDX), repeatable
733
733
  --no-cache Ignore the on-disk extraction cache
734
734
  --no-watch serve: do not reload when files change
735
735
  --format <format> check: pretty | json | github | sarif (default: pretty);
736
+ inspect: pretty | json (default: pretty);
736
737
  export: dtcg | design-md
737
738
  --out <file> export: write to this file instead of stdout
738
739
  --max-warnings <n> check: exit 1 when there are more than n warnings
@@ -1514,6 +1515,11 @@ function listOf(items, max = 3) {
1514
1515
  return `${items.slice(0, max).join(", ")} and ${items.length - max} more`;
1515
1516
  }
1516
1517
  async function inspect(configOptions, values, io) {
1518
+ const format = values.format ?? "pretty";
1519
+ if (!["pretty", "json"].includes(format)) {
1520
+ io.stderr(`inspect: unknown --format "${format}" (pretty, json)`);
1521
+ return 2;
1522
+ }
1517
1523
  const target = await loadTarget(configOptions);
1518
1524
  const { config } = target;
1519
1525
  warnDeprecated(config.deprecations, "pretty", io);
@@ -12346,7 +12346,7 @@ function isObject(value) {
12346
12346
  // package.json
12347
12347
  var name = "onsystem";
12348
12348
  // src/version.ts
12349
- const VERSION = "0.11.1";
12349
+ const VERSION = "0.11.2";
12350
12350
  const NAME = name;
12351
12351
  // src/lint/sarif.ts
12352
12352
  const SCHEMA = "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json";
@@ -12992,7 +12992,7 @@ const STEMMED_SYNONYMS = new Map(Object.entries({
12992
12992
  surface: ["card"],
12993
12993
  section: ["card"],
12994
12994
  dropdown: ["select", "menu"],
12995
- picker: ["select"],
12995
+ picker: ["select", "calendar"],
12996
12996
  combobox: ["select"],
12997
12997
  notification: ["toast", "alert"],
12998
12998
  snackbar: ["toast"],
@@ -13002,7 +13002,20 @@ const STEMMED_SYNONYMS = new Map(Object.entries({
13002
13002
  loader: ["spinner", "skeleton"],
13003
13003
  loading: ["spinner", "skeleton"],
13004
13004
  divider: ["separator"],
13005
- avatar: ["avatar"]
13005
+ profile: ["avatar"],
13006
+ initials: ["avatar"],
13007
+ headshot: ["avatar"],
13008
+ gravatar: ["avatar"],
13009
+ offcanvas: ["sheet"],
13010
+ slideover: ["sheet"],
13011
+ expandable: ["accordion"],
13012
+ faq: ["accordion"],
13013
+ multiline: ["textarea"],
13014
+ range: ["slider"],
13015
+ date: ["calendar"],
13016
+ schedule: ["calendar"],
13017
+ palette: ["command"],
13018
+ cmdk: ["command"]
13006
13019
  }).map(([word, related]) => [stemmer(word), related.map((r) => stemmer(r))]));
13007
13020
  /** Query terms plus synonyms; synonyms carry a lower weight. */
13008
13021
  function expandQuery(query) {
@@ -1,5 +1,5 @@
1
- import { At as relativePath, a as fingerprint, i as componentFiles, ot as excludedBy, r as buildModel } from "./design-system-D7ppJYbd.js";
2
- import { r as loadTarget } from "./workspace-DUgzMLGs.js";
1
+ import { At as relativePath, a as fingerprint, i as componentFiles, ot as excludedBy, r as buildModel } from "./design-system-BZoTfLBU.js";
2
+ import { r as loadTarget } from "./workspace-Dx0ogKg8.js";
3
3
  import { createHash } from "node:crypto";
4
4
  import fs from "node:fs";
5
5
  import path from "node:path";
package/dist/eslint.js CHANGED
@@ -1,4 +1,4 @@
1
- import { At as relativePath, N as RULES, Q as DEFAULT_TEST_FOLDERS, X as DEFAULT_SEVERITY, Z as DEFAULT_TEST_EXCLUDE, m as checkSource, rt as RULE_IDS, t as DesignSystem, ut as rulesFor, v as NAME, y as VERSION } from "./design-system-D7ppJYbd.js";
1
+ import { At as relativePath, N as RULES, Q as DEFAULT_TEST_FOLDERS, X as DEFAULT_SEVERITY, Z as DEFAULT_TEST_EXCLUDE, m as checkSource, rt as RULE_IDS, t as DesignSystem, ut as rulesFor, v as NAME, y as VERSION } from "./design-system-BZoTfLBU.js";
2
2
  import path from "node:path";
3
3
  import { MessageChannel, Worker, receiveMessageOnPort } from "node:worker_threads";
4
4
  // src/eslint/bridge.ts
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { F as loadTokens, G as parseDoc, H as parseDesignMd, I as mergeTokens, K as extractComponents, L as toDesignMd, N as RULES, P as TokenIndex, R as toDtcg, U as parseCssTokens, V as parseDtcgTokens, W as attachDocs, _ as formatDiagnostics, a as fingerprint, at as defineConfig, ct as loadConfig, f as searchComponents, ft as findVariantDefinitions, it as configJsonSchema, m as checkSource, n as DesignSystemHost, o as loadDesignSystem, p as applyFixes, r as buildModel, rt as RULE_IDS, t as DesignSystem, y as VERSION } from "./design-system-D7ppJYbd.js";
2
- import { n as INSTRUCTIONS, r as createServer, t as serveStdio } from "./stdio-c3Y34to3.js";
1
+ import { F as loadTokens, G as parseDoc, H as parseDesignMd, I as mergeTokens, K as extractComponents, L as toDesignMd, N as RULES, P as TokenIndex, R as toDtcg, U as parseCssTokens, V as parseDtcgTokens, W as attachDocs, _ as formatDiagnostics, a as fingerprint, at as defineConfig, ct as loadConfig, f as searchComponents, ft as findVariantDefinitions, it as configJsonSchema, m as checkSource, n as DesignSystemHost, o as loadDesignSystem, p as applyFixes, r as buildModel, rt as RULE_IDS, t as DesignSystem, y as VERSION } from "./design-system-BZoTfLBU.js";
2
+ import { n as INSTRUCTIONS, r as createServer, t as serveStdio } from "./stdio-WCDCmwJx.js";
3
3
  export { DesignSystem, DesignSystemHost, INSTRUCTIONS, RULES, RULE_IDS, TokenIndex, VERSION, applyFixes, attachDocs, buildModel, checkSource, configJsonSchema, createServer, defineConfig, extractComponents, findVariantDefinitions, fingerprint, formatDiagnostics, loadConfig, loadDesignSystem, loadTokens, mergeTokens, parseCssTokens, parseDesignMd, parseDoc, parseDtcgTokens, searchComponents, serveStdio, toDesignMd, toDtcg };
@@ -1,5 +1,5 @@
1
- import { At as relativePath, Ct as isWorkspaceRoot, Dt as isInside, Et as SCRIPT_FILE, Ft as truncate, It as unique, J as ConfigError, Lt as defaultProjectConfig, Mt as closest, Nt as json, Pt as plural, X as DEFAULT_SEVERITY, bt as detectProject, ct as loadConfig, d as descriptionOf, dt as formatPx, f as searchComponents, gt as notReadYet, h as uncheckedNotice, ht as libraryTitle, kt as pathOf, mt as LIBRARY_IDS, n as DesignSystemHost, ot as excludedBy, pt as LIBRARIES, q as CONFIG_FILES, r as buildModel, rt as RULE_IDS, tt as LEGACY_CONFIG_FILES, u as buildSearchIndex, v as NAME, xt as findDesignSystemPackage, y as VERSION, z as TOKEN_CATEGORIES } from "./design-system-D7ppJYbd.js";
2
- import { i as projectDirOf, n as hasProjectMarker, r as loadTarget, t as findProjectRoot } from "./workspace-DUgzMLGs.js";
1
+ import { At as relativePath, Ct as isWorkspaceRoot, Dt as isInside, Et as SCRIPT_FILE, Ft as truncate, It as unique, J as ConfigError, Lt as defaultProjectConfig, Mt as closest, Nt as json, Pt as plural, X as DEFAULT_SEVERITY, bt as detectProject, ct as loadConfig, d as descriptionOf, dt as formatPx, f as searchComponents, gt as notReadYet, h as uncheckedNotice, ht as libraryTitle, kt as pathOf, mt as LIBRARY_IDS, n as DesignSystemHost, ot as excludedBy, pt as LIBRARIES, q as CONFIG_FILES, r as buildModel, rt as RULE_IDS, tt as LEGACY_CONFIG_FILES, u as buildSearchIndex, v as NAME, xt as findDesignSystemPackage, y as VERSION, z as TOKEN_CATEGORIES } from "./design-system-BZoTfLBU.js";
2
+ import { i as projectDirOf, n as hasProjectMarker, r as loadTarget, t as findProjectRoot } from "./workspace-Dx0ogKg8.js";
3
3
  import fs from "node:fs";
4
4
  import path from "node:path";
5
5
  import { fileURLToPath } from "node:url";
@@ -1,4 +1,4 @@
1
- import { At as relativePath, Ct as isWorkspaceRoot, Dt as isInside, Tt as workspacePatterns, ct as loadConfig, i as componentFiles, lt as loadConfigWith, nt as PROJECT_MARKERS, st as hasOwnConfig, vt as PackageFinder, wt as workspacePackageDirs, xt as findDesignSystemPackage } from "./design-system-D7ppJYbd.js";
1
+ import { At as relativePath, Ct as isWorkspaceRoot, Dt as isInside, Tt as workspacePatterns, ct as loadConfig, i as componentFiles, lt as loadConfigWith, nt as PROJECT_MARKERS, st as hasOwnConfig, vt as PackageFinder, wt as workspacePackageDirs, xt as findDesignSystemPackage } from "./design-system-BZoTfLBU.js";
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import os from "node:os";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onsystem",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "mcpName": "io.github.dgesteves/onsystem",
5
5
  "description": "Keeps coding agents on your design system: catches palette colors, native elements and APIs your system lacks, at every edit and pull request, with the fix. Set it up once in your design-system package; every app in your monorepo gets it.",
6
6
  "keywords": [