onsystem 0.0.0-stage → 0.4.0

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/package.json CHANGED
@@ -1,6 +1,108 @@
1
1
  {
2
2
  "name": "onsystem",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.4.0",
4
+ "mcpName": "io.github.dgesteves/onsystem",
5
+ "description": "Keeps coding agents on your design system: it knows your real components, props, variants and tokens, catches the moment an agent invents one and has it fix it, and the same check gates your PRs. Local, zero config, works alongside @shadcn/lint.",
6
+ "keywords": [
7
+ "design-system",
8
+ "design-system-lint",
9
+ "agent-guardrails",
10
+ "linter",
11
+ "lint",
12
+ "react",
13
+ "shadcn",
14
+ "cva",
15
+ "tailwindcss",
16
+ "design-tokens",
17
+ "accessibility",
18
+ "ci",
19
+ "claude-code",
20
+ "claude-code-plugin",
21
+ "cursor",
22
+ "ai-agents",
23
+ "mcp",
24
+ "model-context-protocol"
25
+ ],
26
+ "homepage": "https://github.com/dgesteves/onsystem#readme",
27
+ "bugs": "https://github.com/dgesteves/onsystem/issues",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/dgesteves/onsystem.git"
31
+ },
32
+ "license": "MIT",
33
+ "author": "Diogo Esteves (https://github.com/dgesteves)",
34
+ "type": "module",
35
+ "exports": {
36
+ ".": {
37
+ "types": "./dist/index.d.ts",
38
+ "default": "./dist/index.js"
39
+ },
40
+ "./schema.json": "./schema.json",
41
+ "./package.json": "./package.json"
42
+ },
43
+ "types": "./dist/index.d.ts",
44
+ "bin": {
45
+ "onsystem": "dist/cli.js"
46
+ },
47
+ "files": [
48
+ "dist",
49
+ "schema.json"
50
+ ],
51
+ "engines": {
52
+ "node": ">=20.19"
53
+ },
54
+ "publishConfig": {
55
+ "access": "public",
56
+ "provenance": true
57
+ },
58
+ "dependencies": {
59
+ "@modelcontextprotocol/server": "^2.3.1",
60
+ "culori": "^4.0.2",
61
+ "postcss": "^8.5.29",
62
+ "stemmer": "^2.0.1",
63
+ "tinyglobby": "^0.2.17",
64
+ "typescript": "~6.0.3",
65
+ "zod": "^4.6.5"
66
+ },
67
+ "devDependencies": {
68
+ "@changesets/changelog-github": "^1.0.1",
69
+ "@changesets/cli": "^3.0.3",
70
+ "@eslint/js": "^10.0.1",
71
+ "@modelcontextprotocol/client": "^2.3.1",
72
+ "@modelcontextprotocol/sdk": "^1.32.1",
73
+ "@types/culori": "^4.0.1",
74
+ "@types/node": "^24.19.1",
75
+ "eslint": "^10.12.0",
76
+ "eslint-config-prettier": "^10.1.8",
77
+ "geist": "^1.7.2",
78
+ "globals": "^17.13.0",
79
+ "opentype.js": "^2.0.0",
80
+ "prettier": "^3.9.9",
81
+ "publint": "^0.3.25",
82
+ "react-aria-components": "^1.21.1",
83
+ "tailwind-variants": "^3.3.1",
84
+ "tsdown": "^0.23.0",
85
+ "typescript-eslint": "^8.71.1",
86
+ "vitest": "^5.0.3"
87
+ },
88
+ "scripts": {
89
+ "build": "tsdown && node scripts/build-schema.mjs",
90
+ "dev": "tsdown --watch",
91
+ "lint": "eslint .",
92
+ "format": "prettier --write .",
93
+ "format:check": "prettier --check .",
94
+ "typecheck": "tsc --noEmit",
95
+ "test": "vitest run",
96
+ "test:watch": "vitest",
97
+ "smoke": "node scripts/smoke.mjs",
98
+ "pack-test": "node scripts/pack-test.mjs",
99
+ "assets": "node scripts/build-assets.mjs",
100
+ "palette": "node scripts/build-palette.mjs",
101
+ "corpus": "node scripts/corpus.mjs",
102
+ "demo:check": "cd examples/shadcn-demo && node ../../dist/cli.js check \"app/**/*.tsx\"",
103
+ "demo:inspect": "node dist/cli.js inspect --root examples/shadcn-demo",
104
+ "changeset": "changeset",
105
+ "version-packages": "changeset version && node scripts/sync-versions.mjs",
106
+ "release": "pnpm build && changeset publish"
107
+ }
6
108
  }
package/schema.json ADDED
@@ -0,0 +1,301 @@
1
+ {
2
+ "$id": "https://unpkg.com/onsystem/schema.json",
3
+ "title": "onsystem config",
4
+ "$schema": "http://json-schema.org/draft-07/schema#",
5
+ "type": "object",
6
+ "properties": {
7
+ "$schema": {
8
+ "type": "string"
9
+ },
10
+ "components": {
11
+ "description": "Globs for component source files, relative to the root.",
12
+ "anyOf": [
13
+ {
14
+ "type": "string"
15
+ },
16
+ {
17
+ "type": "array",
18
+ "items": {
19
+ "type": "string"
20
+ }
21
+ }
22
+ ]
23
+ },
24
+ "exclude": {
25
+ "description": "Globs to ignore when finding components and when `check` expands folders and globs (stories, tests). Replaces the defaults; node_modules is skipped either way unless a pattern names it.",
26
+ "type": "array",
27
+ "items": {
28
+ "type": "string"
29
+ }
30
+ },
31
+ "tokens": {
32
+ "description": "Token files: W3C DTCG JSON (*.json) or CSS custom properties (*.css).",
33
+ "anyOf": [
34
+ {
35
+ "anyOf": [
36
+ {
37
+ "type": "string"
38
+ },
39
+ {
40
+ "type": "object",
41
+ "properties": {
42
+ "path": {
43
+ "type": "string",
44
+ "description": "File or glob."
45
+ },
46
+ "prefix": {
47
+ "description": "DTCG only: custom property prefix, e.g. \"acme\" for --acme-color-primary.",
48
+ "type": "string"
49
+ }
50
+ },
51
+ "required": [
52
+ "path"
53
+ ],
54
+ "additionalProperties": false
55
+ }
56
+ ]
57
+ },
58
+ {
59
+ "type": "array",
60
+ "items": {
61
+ "anyOf": [
62
+ {
63
+ "type": "string"
64
+ },
65
+ {
66
+ "type": "object",
67
+ "properties": {
68
+ "path": {
69
+ "type": "string",
70
+ "description": "File or glob."
71
+ },
72
+ "prefix": {
73
+ "description": "DTCG only: custom property prefix, e.g. \"acme\" for --acme-color-primary.",
74
+ "type": "string"
75
+ }
76
+ },
77
+ "required": [
78
+ "path"
79
+ ],
80
+ "additionalProperties": false
81
+ }
82
+ ]
83
+ }
84
+ }
85
+ ]
86
+ },
87
+ "docs": {
88
+ "description": "Globs for per-component Markdown/MDX docs.",
89
+ "anyOf": [
90
+ {
91
+ "type": "string"
92
+ },
93
+ {
94
+ "type": "array",
95
+ "items": {
96
+ "type": "string"
97
+ }
98
+ }
99
+ ]
100
+ },
101
+ "tsconfig": {
102
+ "description": "tsconfig used to resolve types and path aliases.",
103
+ "type": "string"
104
+ },
105
+ "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.",
107
+ "type": "string"
108
+ },
109
+ "elements": {
110
+ "description": "Extra native element → component mappings, e.g. { \"a\": \"Link\" }.",
111
+ "type": "object",
112
+ "propertyNames": {
113
+ "type": "string"
114
+ },
115
+ "additionalProperties": {
116
+ "type": "string"
117
+ }
118
+ },
119
+ "includeDesignSystem": {
120
+ "description": "check: lint the design system's own component files too. Off by default: they implement the scale and primitives the rules enforce.",
121
+ "type": "boolean"
122
+ },
123
+ "rules": {
124
+ "description": "Rule severities and options: \"off\" | \"warn\" | \"error\" | [severity, { allow }].",
125
+ "type": "object",
126
+ "propertyNames": {
127
+ "type": "string",
128
+ "enum": [
129
+ "no-hardcoded-color",
130
+ "no-hardcoded-spacing",
131
+ "no-hardcoded-radius",
132
+ "prefer-design-system-component",
133
+ "no-unknown-component",
134
+ "no-unknown-prop",
135
+ "no-unknown-variant",
136
+ "icon-button-accessible-name"
137
+ ]
138
+ },
139
+ "additionalProperties": {
140
+ "anyOf": [
141
+ {
142
+ "type": "string",
143
+ "enum": [
144
+ "off",
145
+ "warn",
146
+ "error"
147
+ ]
148
+ },
149
+ {
150
+ "type": "array",
151
+ "items": [
152
+ {
153
+ "type": "string",
154
+ "enum": [
155
+ "off",
156
+ "warn",
157
+ "error"
158
+ ]
159
+ }
160
+ ],
161
+ "additionalItems": false,
162
+ "minItems": 1,
163
+ "maxItems": 1
164
+ },
165
+ {
166
+ "type": "array",
167
+ "items": [
168
+ {
169
+ "type": "string",
170
+ "enum": [
171
+ "off",
172
+ "warn",
173
+ "error"
174
+ ]
175
+ },
176
+ {
177
+ "type": "object",
178
+ "properties": {
179
+ "allow": {
180
+ "description": "Values the rule accepts anyway: colors, lengths, element or component names.",
181
+ "type": "array",
182
+ "items": {
183
+ "type": "string"
184
+ }
185
+ }
186
+ },
187
+ "additionalProperties": false
188
+ }
189
+ ],
190
+ "additionalItems": false,
191
+ "minItems": 2,
192
+ "maxItems": 2
193
+ }
194
+ ]
195
+ }
196
+ },
197
+ "overrides": {
198
+ "description": "Rules for some files: [{ \"files\": [\"app/legacy/**\"], \"rules\": { \"no-hardcoded-color\": \"warn\" } }]. Later entries win.",
199
+ "type": "array",
200
+ "items": {
201
+ "type": "object",
202
+ "properties": {
203
+ "files": {
204
+ "anyOf": [
205
+ {
206
+ "type": "string"
207
+ },
208
+ {
209
+ "type": "array",
210
+ "items": {
211
+ "type": "string"
212
+ }
213
+ }
214
+ ],
215
+ "description": "Globs, relative to the root, of the files these rules apply to: \"app/legacy/**\", \"**/*.generated.tsx\"."
216
+ },
217
+ "rules": {
218
+ "type": "object",
219
+ "propertyNames": {
220
+ "type": "string",
221
+ "enum": [
222
+ "no-hardcoded-color",
223
+ "no-hardcoded-spacing",
224
+ "no-hardcoded-radius",
225
+ "prefer-design-system-component",
226
+ "no-unknown-component",
227
+ "no-unknown-prop",
228
+ "no-unknown-variant",
229
+ "icon-button-accessible-name"
230
+ ]
231
+ },
232
+ "additionalProperties": {
233
+ "anyOf": [
234
+ {
235
+ "type": "string",
236
+ "enum": [
237
+ "off",
238
+ "warn",
239
+ "error"
240
+ ]
241
+ },
242
+ {
243
+ "type": "array",
244
+ "items": [
245
+ {
246
+ "type": "string",
247
+ "enum": [
248
+ "off",
249
+ "warn",
250
+ "error"
251
+ ]
252
+ }
253
+ ],
254
+ "additionalItems": false,
255
+ "minItems": 1,
256
+ "maxItems": 1
257
+ },
258
+ {
259
+ "type": "array",
260
+ "items": [
261
+ {
262
+ "type": "string",
263
+ "enum": [
264
+ "off",
265
+ "warn",
266
+ "error"
267
+ ]
268
+ },
269
+ {
270
+ "type": "object",
271
+ "properties": {
272
+ "allow": {
273
+ "description": "Values the rule accepts anyway: colors, lengths, element or component names.",
274
+ "type": "array",
275
+ "items": {
276
+ "type": "string"
277
+ }
278
+ }
279
+ },
280
+ "additionalProperties": false
281
+ }
282
+ ],
283
+ "additionalItems": false,
284
+ "minItems": 2,
285
+ "maxItems": 2
286
+ }
287
+ ]
288
+ },
289
+ "description": "Rule severities and options for those files, over \"rules\"."
290
+ }
291
+ },
292
+ "required": [
293
+ "files",
294
+ "rules"
295
+ ],
296
+ "additionalProperties": false
297
+ }
298
+ }
299
+ },
300
+ "additionalProperties": false
301
+ }