onsystem 0.10.0 → 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.
@@ -1,21 +1,8 @@
1
- import { At as isInside, Ct as workspacePackageDirs, Mt as relativePath, St as isWorkspaceRoot, _t as PackageFinder, bt as findDesignSystemPackage, ct as loadConfigWith, i as componentFiles, ot as hasOwnConfig, q as CONFIG_FILES, st as loadConfig, tt as LEGACY_CONFIG_FILES, wt as workspacePatterns } from "./design-system-D53Jxybo.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-rl__N6tw.js";
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import os from "node:os";
5
- //#region src/workspace.ts
6
- /**
7
- * What marks the folder a file belongs to: the nearest one at or above it with a config,
8
- * a components.json, a package.json or an Nx project.json. The Claude Code hook finds a
9
- * file's project the same way, so `check` from a workspace root and the hook agree on
10
- * every file.
11
- */
12
- const PROJECT_MARKERS = [
13
- ...CONFIG_FILES,
14
- ...LEGACY_CONFIG_FILES,
15
- "components.json",
16
- "package.json",
17
- "project.json"
18
- ];
5
+ // src/workspace.ts
19
6
  /**
20
7
  * A monorepo seen from its root: every workspace package with a design system (an app
21
8
  * that uses one, from source or a published library, or the design-system package
@@ -23,7 +10,7 @@ const PROJECT_MARKERS = [
23
10
  * any file in it. Without a design system at the root, `check`, `inspect` and the MCP
24
11
  * server work from here, each file checked by its own project's design system.
25
12
  */
26
- var Workspace = class {
13
+ var Workspace = class Workspace {
27
14
  root;
28
15
  source;
29
16
  projects;
@@ -71,6 +58,10 @@ var Workspace = class {
71
58
  }
72
59
  return project;
73
60
  }
61
+ /** The workspace without the projects at `roots`. */
62
+ without(roots) {
63
+ return new Workspace(this.root, this.source, this.projects.filter((p) => !roots.includes(p.root)), this.others, this.configFile, this.options, this.rootConfig, this.otherConfigs);
64
+ }
74
65
  rootProject() {
75
66
  return {
76
67
  root: this.root,
@@ -148,7 +139,8 @@ function loadProjectConfig(dir, workspaceRoot, rootConfigFile, options) {
148
139
  const shared = {
149
140
  cwd: options.cwd,
150
141
  includeDesignSystem: options.includeDesignSystem,
151
- jsonConfigOnly: options.jsonConfigOnly
142
+ jsonConfigOnly: options.jsonConfigOnly,
143
+ jsonConfigWithin: options.jsonConfigWithin
152
144
  };
153
145
  const packages = new PackageFinder(dir);
154
146
  if (!rootConfigFile || hasOwnConfig(dir)) return loadConfigWith({
@@ -224,5 +216,4 @@ function isDirectory(target) {
224
216
  return false;
225
217
  }
226
218
  }
227
- //#endregion
228
- export { hasProjectMarker as n, loadTarget as r, findProjectRoot as t };
219
+ export { projectDirOf as i, hasProjectMarker as n, loadTarget as r, findProjectRoot as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onsystem",
3
- "version": "0.10.0",
3
+ "version": "0.10.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": [