@ubx/docs-ui 0.1.0 → 0.2.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/dist/theme-a.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { ThemeRegistration } from "shiki";
2
2
  export declare const themeA: ThemeRegistration;
3
3
  /** Languages theme A has been verified against, token by token. */
4
- export declare const SUPPORTED_LANGS: readonly ["go", "typescript", "python", "bash", "hcl", "json"];
4
+ export declare const SUPPORTED_LANGS: readonly ["go", "typescript", "python", "bash", "hcl", "json", "yaml", "toml", "docker"];
5
5
  export type SupportedLang = (typeof SUPPORTED_LANGS)[number];
6
6
  export declare function isSupportedLang(lang: string): lang is SupportedLang;
package/dist/theme-a.js CHANGED
@@ -87,6 +87,15 @@ export const themeA = {
87
87
  // when the provider site's rendered code was diffed before and
88
88
  // after the swap.
89
89
  "variable.other.property",
90
+ // YAML and TOML mapping keys. UBI-247 slice 3: verified against
91
+ // real token output before being written, and the naive
92
+ // assumption was wrong in two ways. YAML keys carry BOTH
93
+ // entity.name.tag.yaml and string.unquoted.plain.out.yaml, so
94
+ // override 1 below (which exists for shell) was silently
95
+ // stripping every key in every CI example to plain. TOML keys
96
+ // are variable.other.key.toml, covered by nothing above.
97
+ "entity.name.tag",
98
+ "variable.other.key.toml",
90
99
  ],
91
100
  settings: { foreground: "var(--color-code-yellow)" },
92
101
  },
@@ -112,6 +121,24 @@ export const themeA = {
112
121
  scope: ["keyword.operator"],
113
122
  settings: { foreground: "var(--color-foreground)" },
114
123
  },
124
+ // OVERRIDE 5. The YAML grammar scopes a bare `on` as a boolean
125
+ // constant, not as a key, because YAML 1.1 really does treat `on` as
126
+ // true. In GitHub Actions `on:` is the trigger key and appears in
127
+ // essentially every CI example (25 of 29 YAML fences in these docs
128
+ // are Actions workflows), so leaving it green made one key in every
129
+ // file render as though it were a language keyword while its
130
+ // siblings were yellow.
131
+ //
132
+ // The grammar cannot distinguish the two, so this is a real
133
+ // trade-off rather than a clean fix: a genuine YAML boolean value
134
+ // now renders plain instead of green. Chosen deliberately, because
135
+ // in this corpus `on:` as a key is common and `true`/`false` as a
136
+ // scalar value is rare, and a wrongly-emphasised key is more
137
+ // misleading than an unemphasised boolean.
138
+ {
139
+ scope: ["constant.language.boolean.yaml"],
140
+ settings: { foreground: "var(--color-foreground)" },
141
+ },
115
142
  // OVERRIDE 4. TypeScript scopes the arrow of an arrow function as
116
143
  // storage.type.function.arrow, which the generic `storage.type` rule
117
144
  // above catches and paints green. The hand-rolled tokenizer left it
@@ -139,6 +166,12 @@ export const SUPPORTED_LANGS = [
139
166
  "bash",
140
167
  "hcl",
141
168
  "json",
169
+ // Added UBI-247 slice 3, each verified token by token: yaml (29
170
+ // fences, concentrated in the Integrations section where CI config is
171
+ // the entire subject), toml, and dockerfile.
172
+ "yaml",
173
+ "toml",
174
+ "docker",
142
175
  ];
143
176
  export function isSupportedLang(lang) {
144
177
  return SUPPORTED_LANGS.includes(lang);
package/package.json CHANGED
@@ -1,14 +1,19 @@
1
1
  {
2
2
  "name": "@ubx/docs-ui",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Shared UI for ubx documentation sites: theme A, Shiki-backed CodeBlock, header, search, theme toggle.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
- "files": ["dist"],
7
+ "files": [
8
+ "dist"
9
+ ],
8
10
  "main": "./dist/index.js",
9
11
  "types": "./dist/index.d.ts",
10
12
  "exports": {
11
- ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.js"
16
+ }
12
17
  },
13
18
  "scripts": {
14
19
  "build": "tsc -p tsconfig.json",
@@ -32,6 +37,11 @@
32
37
  "react-dom": "19.2.8",
33
38
  "typescript": "^5"
34
39
  },
35
- "publishConfig": { "access": "public" },
36
- "repository": { "type": "git", "url": "git+https://github.com/Ubiquex/ubx-docs-ui.git" }
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/Ubiquex/ubx-docs-ui.git"
46
+ }
37
47
  }