@iksnerd/blazon 0.2.0 → 0.3.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.
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@iksnerd/blazon",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Brand book and design token compiler: DTCG tokens, brand rules checked by blazon check, a static brand book that wears the brand",
5
5
  "type": "module",
6
6
  "bin": {
7
- "blazon": "./bin/blazon.js"
7
+ "blazon": "./bin/blazon.js",
8
+ "blazon-mcp": "./mcp/dist/index.js"
8
9
  },
9
10
  "main": "./dist/index.js",
10
11
  "module": "./dist/index.js",
@@ -23,6 +24,7 @@
23
24
  "files": [
24
25
  "dist",
25
26
  "bin",
27
+ "mcp/dist/index.js",
26
28
  "plugins",
27
29
  "template",
28
30
  "THIRD-PARTY-NOTICES.md"
@@ -32,18 +34,20 @@
32
34
  ],
33
35
  "scripts": {
34
36
  "dev": "vite build --watch",
35
- "build": "vite build && vite build -c vite.viewer.config.ts && npm run build:plugins",
37
+ "build": "vite build && vite build -c vite.viewer.config.ts && npm run build:plugins && npm run build:mcp",
38
+ "build:mcp": "node scripts/build-mcp.mjs",
36
39
  "build:plugins": "tsx scripts/build-plugins.mjs && tsx scripts/shipped-lock.mjs",
37
40
  "test": "vitest run",
38
41
  "test:related": "vitest related --run",
39
42
  "test:files": "vitest run",
40
43
  "test:deck": "vitest run test/deck/brand-deck-plan test/deck/brand-deck-fonts.test.ts test/deck/brand-deck-examples.test.ts test/deck/examples-deck.test.ts test/plugins/shipped/brand-deck test/brand/brand-python.test.ts",
41
- "test:docs": "vitest run test/docs/manual.test.ts test/docs/rfc.test.ts test/docs/checks-generated.test.ts",
44
+ "test:docs": "vitest run test/docs/manual.test.ts test/docs/rfc.test.ts test/docs/checks-generated.test.ts test/docs/versions.test.ts",
42
45
  "conformance:reads": "rm -f reads.json reads.json.lines && CONFORMANCE_READS=reads.json vitest run test/plugins/host && tsx scripts/conformance-reads.ts reads.json",
43
46
  "test:watch": "vitest",
44
47
  "typecheck": "node node_modules/typescript7/bin/tsc --noEmit && node scripts/typecheck-mcp.mjs",
45
48
  "lint": "eslint .",
46
49
  "lint:fix": "eslint . --fix",
50
+ "lint:files": "eslint --no-warn-ignored",
47
51
  "lint:py": "uvx ruff check scripts test/deck/python",
48
52
  "format": "prettier --write .",
49
53
  "format:check": "prettier --check .",
@@ -12,7 +12,7 @@ Run commands from the folder that holds this file, or pass the folder as the las
12
12
  2. For each finding, read `code`, `message`, `path`, `file`, `line` and `fix`, and edit the file it names. The `checks` chapter describes every code; look it up, do not guess.
13
13
  3. Check again until `counts.errors` is 0, then run `blazon build`.
14
14
 
15
- - Never edit `dist/`. `blazon tokens` writes `dist/tokens/` (`theme.css`, `tokens.ts`, `tokens.json`) and `blazon build` also writes the site to `dist/site/`; both overwrite it, and both stop on an error. `--no-plugins` builds without Google Chrome.
15
+ - Never edit `dist/`. `blazon tokens` writes `dist/tokens/` (`theme.css`, `typography.css`, `tokens.ts`, `tokens.json`, and the Tailwind and shadcn/ui files in `blazon.tailwind/` and `blazon.shadcn/`) and `blazon build` also writes the site to `dist/site/`; both overwrite it, and both stop on an error. `--no-plugins` builds without Google Chrome.
16
16
  - The brand lives in `tokens/` (DTCG JSON, `{ "$value": ..., "$type": ... }`, an alias is `"{color.ink.graphite}"`), `docs/` (numbered Markdown pages), `assets/` (images, each with a JSON sidecar of the same name: `mark.svg` and `mark.json`), `blazon.json` (title, theme, logo, plugins) and `blazon.resolver.json` (the token files that load, and the themes; a new token file is listed in `sets` there or it is not read; dark is `tokens/theme/dark.json`).
17
17
  - Safe to change: token values, pages, assets with their sidecars, and the title and theme in `blazon.json`. Everything under "Do not touch" needs the person.
18
18
  - `blazon dev` serves the book with live reload; `-p <port>` sets the port.
@@ -32,7 +32,7 @@ Codes you meet first:
32
32
 
33
33
  ## The MCP server
34
34
 
35
- `blazon mcp` sets up blazon-mcp, a server that answers questions about this brand as Model Context Protocol tool calls: `check_brand`, `list_tokens`, `get_token`, `get_rules`, `can_use`, `get_fonts`, `get_logo`. It is not published yet, so it runs only from a blazon source checkout with the server built. Run `blazon mcp --check` to learn whether it is ready; each failed check names the `fix` to run. Without it, the commands above do the same work. Setup: the `blazon-for-agents` chapter.
35
+ `blazon mcp` sets up blazon-mcp, a server that answers questions about this brand as Model Context Protocol tool calls: `check_brand`, `list_tokens`, `get_token`, `get_rules`, `can_use`, `get_fonts`, `get_logo`. It ships inside the blazon package. Run `blazon mcp --print-config` for the command that starts it and `blazon mcp --check` to learn whether it is ready; each failed check names the `fix` to run. Without it, the commands above do the same work. Setup: the `blazon-for-agents` chapter.
36
36
 
37
37
  ## Building a site from this brand
38
38
 
@@ -89,6 +89,24 @@
89
89
  "11-voice.md"
90
90
  ]
91
91
  }
92
+ },
93
+ {
94
+ "name": "blazon.tailwind"
95
+ },
96
+ {
97
+ "name": "blazon.shadcn",
98
+ "options": {
99
+ "variables": {
100
+ "ring": "text.primary",
101
+ "sidebar-ring": "text.primary",
102
+ "destructive": "text.primary",
103
+ "chart-1": "text.primary",
104
+ "chart-2": "text.muted",
105
+ "chart-3": "surface.canvas",
106
+ "chart-4": "rule.default",
107
+ "chart-5": "rule.quiet"
108
+ }
109
+ }
92
110
  }
93
111
  ]
94
112
  }
@@ -28,7 +28,7 @@ The brand and the build come from the same files. A build that breaks the brand'
28
28
  | Readable from any language | `blazon build` also writes `brand.json`: the tokens with their rules, the pages, the assets and the findings, with a JSON Schema. |
29
29
  | Open to plugins | A plugin is a program in any language. blazon ships ten, and a config names one to turn it on. |
30
30
 
31
- blazon is at version 0.1.0 and on npm as `@iksnerd/blazon`. The attributes above describe what is built today.
31
+ blazon is on npm as `@iksnerd/blazon`. The attributes above describe what is built today.
32
32
 
33
33
  ## Exposed structure
34
34
 
@@ -147,7 +147,7 @@ Three details give a page the brand's industrial look. Each uses only tokens, an
147
147
 
148
148
  ## Using shadcn/ui
149
149
 
150
- A shadcn/ui project takes its colors from the brand through the `blazon.shadcn` plugin, as the "Using shadcn/ui" section of `docs/manual/19-building-a-website.md` in the blazon source repository describes: `blazon tokens` writes `dist/tokens/blazon.shadcn/shadcn.css` and `shadcn.json`. Its components also hard-code `text-sm`, `h-8`, `rounded-xl`, `ring/10`, opacity blends such as `hover:bg-primary/80`, and 0.35s transitions. The brand takes none of them. A site overrides each in its own button and card components, using the rules on this page.
150
+ A shadcn/ui project takes its colors from the brand through the `blazon.shadcn` plugin. Run `blazon tokens` to write `dist/tokens/blazon.shadcn/shadcn.css` and `shadcn.json`. The "Using shadcn/ui" section of `docs/manual/19-building-a-website.md` in the blazon source repository describes both. Its components also hard-code `text-sm`, `h-8`, `rounded-xl`, `ring/10`, opacity blends such as `hover:bg-primary/80`, and 0.35s transitions. The brand takes none of them. A site overrides each in its own button and card components, using the rules on this page.
151
151
 
152
152
  The brand has no role for two groups of shadcn variables, so the `variables` option of `blazon.shadcn` in `blazon.json` maps them:
153
153