onsystem 0.10.1 → 0.10.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 toPosix, B as statusKinds, C as countBaseline, D as pruneBaseline, Dt as matchesGlob, E as onLines, Et as isInside, Ft as unique, J as ConfigError, L as toDesignMd, Lt as readProjectConfig, M as writeBaseline, Nt as plural, O as readBaseline, R as toDtcg, S as applyBaseline, T as goneFiles, Tt as SCRIPT_FILE, Y as DEFAULT_DOCS, _ as formatDiagnostics, at as excludedBy, b as BASELINE_FILE, c as silentLogger, et as FALLBACK_TOKENS, g as escapeData, gt as PACKAGE_FIELD, h as uncheckedNotice, ht as notReadYet, i as componentFiles, j as updateBaseline, k as rulesRun, kt as relativePath, l as stderrLogger, lt as rulesFor, mt as libraryTitle, nt as RULE_IDS, o as loadDesignSystem, q as CONFIG_FILES, s as tokenFiles, tt as LEGACY_CONFIG_FILES, v as NAME, vt as declaredConfig, w as findMoves, x as LEGACY_BASELINE_FILE, xt as isDesignSystemName, y as VERSION, yt as detectProject } from "./design-system-CPH4C7-1.js";
3
- import { a as notReadNotices, i as missingDependencies, o as explainProject, s as librariesLeftOut, t as serveStdio } from "./stdio-BK2kMN1x.js";
4
- import { r as loadTarget } from "./workspace-BINqxi7p.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-rl__N6tw.js";
3
+ import { a as notReadNotices, i as missingDependencies, o as explainProject, s as librariesLeftOut, t as serveStdio } from "./stdio-CkczPt_1.js";
4
+ import { r as loadTarget } from "./workspace-INef0Yqt.js";
5
5
  import fs from "node:fs";
6
6
  import path from "node:path";
7
7
  import { escapePath, glob } from "tinyglobby";
@@ -10,7 +10,7 @@ import fsp from "node:fs/promises";
10
10
  import { spawnSync } from "node:child_process";
11
11
  import readline from "node:readline/promises";
12
12
  import { parseArgs } from "node:util";
13
- //#region src/init.ts
13
+ // src/init.ts
14
14
  const SCHEMA = "https://unpkg.com/onsystem/schema.json";
15
15
  /** More detected globs than this are files, not folders: zero config keeps them. */
16
16
  const MAX_GLOBS = 6;
@@ -685,8 +685,7 @@ function count$1(n, word) {
685
685
  function andList(items, conjunction = "and") {
686
686
  return items.length > 1 ? `${items.slice(0, -1).join(", ")} ${conjunction} ${items.at(-1) ?? ""}` : items.join("");
687
687
  }
688
- //#endregion
689
- //#region src/cli.ts
688
+ // src/cli.ts
690
689
  const DOCS = "https://onsystem.vercel.app/docs";
691
690
  const HELP = `${NAME} ${VERSION}
692
691
 
@@ -1881,13 +1880,11 @@ function displayPath(cwd, file) {
1881
1880
  const rel = path.relative(cwd, file);
1882
1881
  return rel && !rel.startsWith("..") && !path.isAbsolute(rel) ? rel : file;
1883
1882
  }
1884
- //#endregion
1885
- //#region src/bin.ts
1883
+ // src/bin.ts
1886
1884
  main(process.argv.slice(2)).then((code) => {
1887
1885
  process.exitCode = code;
1888
1886
  }, (error) => {
1889
1887
  process.stderr.write(`${error.stack ?? String(error)}\n`);
1890
1888
  process.exitCode = 1;
1891
1889
  });
1892
- //#endregion
1893
1890
  export {};
@@ -1,5 +1,4 @@
1
1
  import * as z from "zod";
2
- //#region src/detect.d.ts
3
2
  /**
4
3
  * How apps import a design-system module, from a package's `exports`:
5
4
  * `@midday/ui/button` → `../../packages/ui/src/components/button.tsx`, or a
@@ -45,8 +44,6 @@ interface DesignSystemSource {
45
44
  */
46
45
  registry?: string | undefined;
47
46
  }
48
- //#endregion
49
- //#region src/types.d.ts
50
47
  /**
51
48
  * The design-system model the server exposes. Everything here is plain JSON so
52
49
  * it can be cached on disk and returned as MCP structured content.
@@ -269,8 +266,6 @@ interface CheckResult {
269
266
  */
270
267
  skipped?: string;
271
268
  }
272
- //#endregion
273
- //#region src/libraries/index.d.ts
274
269
  /** The ids of the libraries onsystem can read, for the config's `libraries` list. */
275
270
  declare const LIBRARY_IDS: readonly ["mui"];
276
271
  type LibraryId = (typeof LIBRARY_IDS)[number];
@@ -287,8 +282,6 @@ interface LibrarySource {
287
282
  */
288
283
  designSystem?: true | undefined;
289
284
  }
290
- //#endregion
291
- //#region src/config.d.ts
292
285
  declare const RULE_IDS: readonly ["no-hardcoded-color", "no-hardcoded-spacing", "no-hardcoded-radius", "prefer-design-system-component", "no-unknown-component", "no-unknown-prop", "no-unknown-variant", "icon-button-accessible-name"];
293
286
  type RuleId = (typeof RULE_IDS)[number];
294
287
  declare const severitySchema: z.ZodEnum<{
@@ -504,9 +497,14 @@ interface LoadConfigOptions {
504
497
  * choose, unlike the folder the server was started in.
505
498
  */
506
499
  jsonConfigOnly?: boolean | undefined;
500
+ /**
501
+ * With `jsonConfigOnly`: the folder the MCP server was started for (its `--root` or the
502
+ * client's root) when that folder is no project but holds the one read, which the error for a
503
+ * JavaScript or TypeScript config names.
504
+ */
505
+ jsonConfigWithin?: string | undefined;
507
506
  }
508
507
  declare function loadConfig(options?: LoadConfigOptions): Promise<ResolvedConfig>;
509
508
  /** JSON Schema for editor completion in `onsystem.config.json`. */
510
509
  declare function configJsonSchema(): Record<string, unknown>;
511
- //#endregion
512
510
  export { TOKEN_CATEGORIES as C, VariantInfo as D, TokenCategory as E, ImportMapping as O, SourceLocation as S, Token as T, DocSection as _, ResolvedRule as a, PropInfo as b, configJsonSchema as c, CheckResult as d, ComponentDocs as f, Diagnostic as g, DesignSystemModel as h, ResolvedConfig as i, defineConfig as l, CompoundVariantInfo as m, LoadConfigOptions as n, RuleId as o, ComponentInfo as p, RULE_IDS as r, RuleOptions as s, Config as t, loadConfig as u, ExampleInfo as v, TextEdit as w, Severity as x, InheritedProps as y };