onsystem 0.9.1 → 0.10.1

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,4 +1,4 @@
1
- import { $ as LEGACY_CONFIG_FILES, At as relativePath, Ot as isInside, St as workspacePatterns, at as loadConfig, bt as isWorkspaceRoot, ht as PackageFinder, i as componentFiles, it as hasOwnConfig, ot as loadConfigWith, q as CONFIG_FILES, vt as findDesignSystemPackage, xt as workspacePackageDirs } from "./design-system-DZm2aP1z.js";
1
+ import { Ct as workspacePackageDirs, Et as isInside, St as isWorkspaceRoot, _t as PackageFinder, bt as findDesignSystemPackage, ct as loadConfigWith, i as componentFiles, kt as relativePath, ot as hasOwnConfig, q as CONFIG_FILES, st as loadConfig, tt as LEGACY_CONFIG_FILES, wt as workspacePatterns } from "./design-system-CPH4C7-1.js";
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import os from "node:os";
@@ -121,7 +121,7 @@ async function discoverWorkspace(rootConfig, options) {
121
121
  for (const dir of workspacePackageDirs(root)) {
122
122
  const config = await loadProjectConfig(dir, root, rootConfig.configFile, options);
123
123
  const files = (await componentFiles(config)).length;
124
- const own = config.configFile !== void 0 && config.configFile !== rootConfig.configFile;
124
+ const own = config.configFile !== void 0 && config.configFile !== rootConfig.configFile || config.designSystemPackage !== void 0;
125
125
  const library = config.libraries?.some((l) => l.dir !== void 0) ?? false;
126
126
  if (files || own || library) projects.push({
127
127
  root: dir,
@@ -138,10 +138,11 @@ async function discoverWorkspace(rootConfig, options) {
138
138
  return new Workspace(root, source, projects, others, rootConfig.configFile, options, rootConfig, otherConfigs);
139
139
  }
140
140
  /**
141
- * A project's config: its own config file, else the config its design-system package declares
142
- * (a dependency with `"onsystem"` in its package.json), else the workspace root's, with paths
143
- * relative to the workspace root, else zero config. `loadConfig` from the project's folder finds
144
- * the first two the same way. CLI flags that apply to every project carry over.
141
+ * A project's config: its own config file, else the workspace root's, with paths relative to
142
+ * the workspace root, read over the config its design-system package declares (a dependency with
143
+ * `"onsystem"` in its package.json), else zero config. `loadConfig` from the project's folder
144
+ * finds its own config and the package's the same way. CLI flags that apply to every project
145
+ * carry over.
145
146
  */
146
147
  function loadProjectConfig(dir, workspaceRoot, rootConfigFile, options) {
147
148
  const shared = {
@@ -155,7 +156,7 @@ function loadProjectConfig(dir, workspaceRoot, rootConfigFile, options) {
155
156
  root: dir
156
157
  }, { packages });
157
158
  const lookup = findDesignSystemPackage(dir, packages);
158
- if (lookup?.found || lookup?.problems.length) return loadConfigWith({
159
+ if (lookup?.problems.length) return loadConfigWith({
159
160
  ...shared,
160
161
  root: dir
161
162
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onsystem",
3
- "version": "0.9.1",
3
+ "version": "0.10.1",
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": [
package/schema.json CHANGED
@@ -7,6 +7,10 @@
7
7
  "$schema": {
8
8
  "type": "string"
9
9
  },
10
+ "extends": {
11
+ "description": "Whether this config builds on the one a design-system package declares (\"onsystem\" in the package.json of a dependency, found from the dependencies): its rules apply over the package's, and, unless it sets components of its own, what it leaves out comes from the package's (components with their importPath, docs, elements, tokens and libraries). Default: true. false reads this config alone.",
12
+ "type": "boolean"
13
+ },
10
14
  "components": {
11
15
  "description": "Globs for component source files, relative to the root.",
12
16
  "anyOf": [
@@ -103,7 +107,7 @@
103
107
  "type": "string"
104
108
  },
105
109
  "importPath": {
106
- "description": "Package name components are imported from, e.g. \"@acme/ui\", or a pattern for packages imported by path: \"@acme/ui/{path}\" is @acme/ui/primitives/button for primitives/button.tsx in the package. Default: inferred from package exports and tsconfig paths.",
110
+ "description": "Package name components are imported from, e.g. \"@acme/ui\", or a pattern for packages imported by path: \"@acme/ui/{path}\" is @acme/ui/primitives/button for primitives/button.tsx in the package. An installed dependency it names exactly, whose component sources the project does not read, is read from its type declarations (.d.ts). Default: inferred from package exports and tsconfig paths.",
107
111
  "type": "string"
108
112
  },
109
113
  "elements": {