@iksnerd/blazon 0.0.0-stage → 0.1.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.
Files changed (503) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +264 -2
  3. package/THIRD-PARTY-NOTICES.md +60 -0
  4. package/bin/blazon.js +4 -0
  5. package/dist/builder/site-builder.d.ts +10 -0
  6. package/dist/builder/site-builder.d.ts.map +1 -0
  7. package/dist/chunks/site-builder-vpzUWoiA.js +13777 -0
  8. package/dist/cli/commands/approvals.d.ts +8 -0
  9. package/dist/cli/commands/approvals.d.ts.map +1 -0
  10. package/dist/cli/commands/build.d.ts +8 -0
  11. package/dist/cli/commands/build.d.ts.map +1 -0
  12. package/dist/cli/commands/check.d.ts +33 -0
  13. package/dist/cli/commands/check.d.ts.map +1 -0
  14. package/dist/cli/commands/cwd.d.ts +14 -0
  15. package/dist/cli/commands/cwd.d.ts.map +1 -0
  16. package/dist/cli/commands/dev.d.ts +5 -0
  17. package/dist/cli/commands/dev.d.ts.map +1 -0
  18. package/dist/cli/commands/doctor.d.ts +34 -0
  19. package/dist/cli/commands/doctor.d.ts.map +1 -0
  20. package/dist/cli/commands/drift.d.ts +11 -0
  21. package/dist/cli/commands/drift.d.ts.map +1 -0
  22. package/dist/cli/commands/explain.d.ts +5 -0
  23. package/dist/cli/commands/explain.d.ts.map +1 -0
  24. package/dist/cli/commands/init.d.ts +46 -0
  25. package/dist/cli/commands/init.d.ts.map +1 -0
  26. package/dist/cli/commands/mcp-check.d.ts +57 -0
  27. package/dist/cli/commands/mcp-check.d.ts.map +1 -0
  28. package/dist/cli/commands/mcp.d.ts +13 -0
  29. package/dist/cli/commands/mcp.d.ts.map +1 -0
  30. package/dist/cli/commands/pin.d.ts +7 -0
  31. package/dist/cli/commands/pin.d.ts.map +1 -0
  32. package/dist/cli/commands/plugin.d.ts +32 -0
  33. package/dist/cli/commands/plugin.d.ts.map +1 -0
  34. package/dist/cli/commands/preview.d.ts +5 -0
  35. package/dist/cli/commands/preview.d.ts.map +1 -0
  36. package/dist/cli/commands/tokens.d.ts +5 -0
  37. package/dist/cli/commands/tokens.d.ts.map +1 -0
  38. package/dist/cli/errors.d.ts +53 -0
  39. package/dist/cli/errors.d.ts.map +1 -0
  40. package/dist/cli/handlers/brand.d.ts +7 -0
  41. package/dist/cli/handlers/brand.d.ts.map +1 -0
  42. package/dist/cli/handlers/can.d.ts +7 -0
  43. package/dist/cli/handlers/can.d.ts.map +1 -0
  44. package/dist/cli/handlers/fonts.d.ts +4 -0
  45. package/dist/cli/handlers/fonts.d.ts.map +1 -0
  46. package/dist/cli/handlers/get.d.ts +7 -0
  47. package/dist/cli/handlers/get.d.ts.map +1 -0
  48. package/dist/cli/handlers/index.d.ts +8 -0
  49. package/dist/cli/handlers/index.d.ts.map +1 -0
  50. package/dist/cli/handlers/list.d.ts +7 -0
  51. package/dist/cli/handlers/list.d.ts.map +1 -0
  52. package/dist/cli/handlers/logo.d.ts +4 -0
  53. package/dist/cli/handlers/logo.d.ts.map +1 -0
  54. package/dist/cli/handlers/rules.d.ts +10 -0
  55. package/dist/cli/handlers/rules.d.ts.map +1 -0
  56. package/dist/cli/handlers/types.d.ts +17 -0
  57. package/dist/cli/handlers/types.d.ts.map +1 -0
  58. package/dist/cli/help.d.ts +18 -0
  59. package/dist/cli/help.d.ts.map +1 -0
  60. package/dist/cli/index.d.ts +2 -0
  61. package/dist/cli/index.d.ts.map +1 -0
  62. package/dist/cli/index.js +3850 -0
  63. package/dist/cli/init-flow.d.ts +24 -0
  64. package/dist/cli/init-flow.d.ts.map +1 -0
  65. package/dist/cli/init-ui.d.ts +20 -0
  66. package/dist/cli/init-ui.d.ts.map +1 -0
  67. package/dist/cli/json.d.ts +18 -0
  68. package/dist/cli/json.d.ts.map +1 -0
  69. package/dist/cli/operations.d.ts +11 -0
  70. package/dist/cli/operations.d.ts.map +1 -0
  71. package/dist/cli/options.d.ts +8 -0
  72. package/dist/cli/options.d.ts.map +1 -0
  73. package/dist/cli/project.d.ts +8 -0
  74. package/dist/cli/project.d.ts.map +1 -0
  75. package/dist/cli/read.d.ts +13 -0
  76. package/dist/cli/read.d.ts.map +1 -0
  77. package/dist/cli/where.d.ts +10 -0
  78. package/dist/cli/where.d.ts.map +1 -0
  79. package/dist/core/assets/categories.d.ts +47 -0
  80. package/dist/core/assets/categories.d.ts.map +1 -0
  81. package/dist/core/assets/fields.d.ts +12 -0
  82. package/dist/core/assets/fields.d.ts.map +1 -0
  83. package/dist/core/assets/image-size.d.ts +10 -0
  84. package/dist/core/assets/image-size.d.ts.map +1 -0
  85. package/dist/core/assets/measure.d.ts +22 -0
  86. package/dist/core/assets/measure.d.ts.map +1 -0
  87. package/dist/core/assets/scanner.d.ts +26 -0
  88. package/dist/core/assets/scanner.d.ts.map +1 -0
  89. package/dist/core/assets/sidecar.d.ts +22 -0
  90. package/dist/core/assets/sidecar.d.ts.map +1 -0
  91. package/dist/core/blazon-pin.d.ts +36 -0
  92. package/dist/core/blazon-pin.d.ts.map +1 -0
  93. package/dist/core/brand/export.d.ts +128 -0
  94. package/dist/core/brand/export.d.ts.map +1 -0
  95. package/dist/core/brand/schema.d.ts +1000 -0
  96. package/dist/core/brand/schema.d.ts.map +1 -0
  97. package/dist/core/brand-theme.d.ts +16 -0
  98. package/dist/core/brand-theme.d.ts.map +1 -0
  99. package/dist/core/checker/approvals.d.ts +15 -0
  100. package/dist/core/checker/approvals.d.ts.map +1 -0
  101. package/dist/core/checker/cascade.d.ts +8 -0
  102. package/dist/core/checker/cascade.d.ts.map +1 -0
  103. package/dist/core/checker/catalogue.d.ts +593 -0
  104. package/dist/core/checker/catalogue.d.ts.map +1 -0
  105. package/dist/core/checker/contrast.d.ts +30 -0
  106. package/dist/core/checker/contrast.d.ts.map +1 -0
  107. package/dist/core/checker/duplicates.d.ts +3 -0
  108. package/dist/core/checker/duplicates.d.ts.map +1 -0
  109. package/dist/core/checker/fixes.d.ts +6 -0
  110. package/dist/core/checker/fixes.d.ts.map +1 -0
  111. package/dist/core/checker/font-meta.d.ts +8 -0
  112. package/dist/core/checker/font-meta.d.ts.map +1 -0
  113. package/dist/core/checker/index.d.ts +23 -0
  114. package/dist/core/checker/index.d.ts.map +1 -0
  115. package/dist/core/checker/location.d.ts +7 -0
  116. package/dist/core/checker/location.d.ts.map +1 -0
  117. package/dist/core/checker/logo-rules.d.ts +19 -0
  118. package/dist/core/checker/logo-rules.d.ts.map +1 -0
  119. package/dist/core/checker/logo-surfaces.d.ts +7 -0
  120. package/dist/core/checker/logo-surfaces.d.ts.map +1 -0
  121. package/dist/core/checker/page-tokens.d.ts +5 -0
  122. package/dist/core/checker/page-tokens.d.ts.map +1 -0
  123. package/dist/core/checker/print.d.ts +9 -0
  124. package/dist/core/checker/print.d.ts.map +1 -0
  125. package/dist/core/checker/proportion.d.ts +3 -0
  126. package/dist/core/checker/proportion.d.ts.map +1 -0
  127. package/dist/core/checker/review.d.ts +40 -0
  128. package/dist/core/checker/review.d.ts.map +1 -0
  129. package/dist/core/checker/source.d.ts +4 -0
  130. package/dist/core/checker/source.d.ts.map +1 -0
  131. package/dist/core/checker/spdx.d.ts +8 -0
  132. package/dist/core/checker/spdx.d.ts.map +1 -0
  133. package/dist/core/checker/tier.d.ts +3 -0
  134. package/dist/core/checker/tier.d.ts.map +1 -0
  135. package/dist/core/checker/usage.d.ts +4 -0
  136. package/dist/core/checker/usage.d.ts.map +1 -0
  137. package/dist/core/checker/variables.d.ts +8 -0
  138. package/dist/core/checker/variables.d.ts.map +1 -0
  139. package/dist/core/colors.d.ts +10 -0
  140. package/dist/core/colors.d.ts.map +1 -0
  141. package/dist/core/config/defaults.d.ts +3 -0
  142. package/dist/core/config/defaults.d.ts.map +1 -0
  143. package/dist/core/config/index.d.ts +15 -0
  144. package/dist/core/config/index.d.ts.map +1 -0
  145. package/dist/core/config/validate.d.ts +21 -0
  146. package/dist/core/config/validate.d.ts.map +1 -0
  147. package/dist/core/config/vocabulary.d.ts +10 -0
  148. package/dist/core/config/vocabulary.d.ts.map +1 -0
  149. package/dist/core/confine.d.ts +25 -0
  150. package/dist/core/confine.d.ts.map +1 -0
  151. package/dist/core/docs/directives.d.ts +152 -0
  152. package/dist/core/docs/directives.d.ts.map +1 -0
  153. package/dist/core/docs/parser.d.ts +7 -0
  154. package/dist/core/docs/parser.d.ts.map +1 -0
  155. package/dist/core/docs/sections.d.ts +11 -0
  156. package/dist/core/docs/sections.d.ts.map +1 -0
  157. package/dist/core/drift/compare.d.ts +30 -0
  158. package/dist/core/drift/compare.d.ts.map +1 -0
  159. package/dist/core/drift/read.d.ts +22 -0
  160. package/dist/core/drift/read.d.ts.map +1 -0
  161. package/dist/core/email-signature.d.ts +35 -0
  162. package/dist/core/email-signature.d.ts.map +1 -0
  163. package/dist/core/emit.d.ts +22 -0
  164. package/dist/core/emit.d.ts.map +1 -0
  165. package/dist/core/fonts.d.ts +43 -0
  166. package/dist/core/fonts.d.ts.map +1 -0
  167. package/dist/core/icons/icon-sets.d.ts +22 -0
  168. package/dist/core/icons/icon-sets.d.ts.map +1 -0
  169. package/dist/core/index.d.ts +9 -0
  170. package/dist/core/index.d.ts.map +1 -0
  171. package/dist/core/init/answers.d.ts +45 -0
  172. package/dist/core/init/answers.d.ts.map +1 -0
  173. package/dist/core/init/from-site/apply.d.ts +7 -0
  174. package/dist/core/init/from-site/apply.d.ts.map +1 -0
  175. package/dist/core/init/from-site/clean-colors.d.ts +21 -0
  176. package/dist/core/init/from-site/clean-colors.d.ts.map +1 -0
  177. package/dist/core/init/from-site/colors.d.ts +10 -0
  178. package/dist/core/init/from-site/colors.d.ts.map +1 -0
  179. package/dist/core/init/from-site/context.d.ts +24 -0
  180. package/dist/core/init/from-site/context.d.ts.map +1 -0
  181. package/dist/core/init/from-site/fonts.d.ts +10 -0
  182. package/dist/core/init/from-site/fonts.d.ts.map +1 -0
  183. package/dist/core/init/from-site/html.d.ts +10 -0
  184. package/dist/core/init/from-site/html.d.ts.map +1 -0
  185. package/dist/core/init/from-site/index.d.ts +6 -0
  186. package/dist/core/init/from-site/index.d.ts.map +1 -0
  187. package/dist/core/init/from-site/inspect.d.ts +4 -0
  188. package/dist/core/init/from-site/inspect.d.ts.map +1 -0
  189. package/dist/core/init/from-site/logo.d.ts +20 -0
  190. package/dist/core/init/from-site/logo.d.ts.map +1 -0
  191. package/dist/core/init/from-site/sections/colors.d.ts +4 -0
  192. package/dist/core/init/from-site/sections/colors.d.ts.map +1 -0
  193. package/dist/core/init/from-site/sections/config.d.ts +10 -0
  194. package/dist/core/init/from-site/sections/config.d.ts.map +1 -0
  195. package/dist/core/init/from-site/sections/directives.d.ts +3 -0
  196. package/dist/core/init/from-site/sections/directives.d.ts.map +1 -0
  197. package/dist/core/init/from-site/sections/fonts.d.ts +8 -0
  198. package/dist/core/init/from-site/sections/fonts.d.ts.map +1 -0
  199. package/dist/core/init/from-site/sections/intro.d.ts +4 -0
  200. package/dist/core/init/from-site/sections/intro.d.ts.map +1 -0
  201. package/dist/core/init/from-site/sections/logo.d.ts +9 -0
  202. package/dist/core/init/from-site/sections/logo.d.ts.map +1 -0
  203. package/dist/core/init/from-site/sections/placeholder.d.ts +5 -0
  204. package/dist/core/init/from-site/sections/placeholder.d.ts.map +1 -0
  205. package/dist/core/init/from-site/tree.d.ts +14 -0
  206. package/dist/core/init/from-site/tree.d.ts.map +1 -0
  207. package/dist/core/init/from-site/types.d.ts +37 -0
  208. package/dist/core/init/from-site/types.d.ts.map +1 -0
  209. package/dist/core/init/palette.d.ts +34 -0
  210. package/dist/core/init/palette.d.ts.map +1 -0
  211. package/dist/core/init/prompts.d.ts +78 -0
  212. package/dist/core/init/prompts.d.ts.map +1 -0
  213. package/dist/core/init/shared/google-fonts.d.ts +4 -0
  214. package/dist/core/init/shared/google-fonts.d.ts.map +1 -0
  215. package/dist/core/init/shared/hex.d.ts +6 -0
  216. package/dist/core/init/shared/hex.d.ts.map +1 -0
  217. package/dist/core/init/shared/svg.d.ts +3 -0
  218. package/dist/core/init/shared/svg.d.ts.map +1 -0
  219. package/dist/core/init/vocabulary.d.ts +42 -0
  220. package/dist/core/init/vocabulary.d.ts.map +1 -0
  221. package/dist/core/inputs.d.ts +25 -0
  222. package/dist/core/inputs.d.ts.map +1 -0
  223. package/dist/core/logo/lockup.d.ts +54 -0
  224. package/dist/core/logo/lockup.d.ts.map +1 -0
  225. package/dist/core/logo.d.ts +23 -0
  226. package/dist/core/logo.d.ts.map +1 -0
  227. package/dist/core/mcp-config.d.ts +65 -0
  228. package/dist/core/mcp-config.d.ts.map +1 -0
  229. package/dist/core/operations/check.d.ts +8 -0
  230. package/dist/core/operations/check.d.ts.map +1 -0
  231. package/dist/core/operations/index.d.ts +7 -0
  232. package/dist/core/operations/index.d.ts.map +1 -0
  233. package/dist/core/operations/limits.d.ts +6 -0
  234. package/dist/core/operations/limits.d.ts.map +1 -0
  235. package/dist/core/operations/list.d.ts +8 -0
  236. package/dist/core/operations/list.d.ts.map +1 -0
  237. package/dist/core/operations/project.d.ts +10 -0
  238. package/dist/core/operations/project.d.ts.map +1 -0
  239. package/dist/core/operations/types.d.ts +96 -0
  240. package/dist/core/operations/types.d.ts.map +1 -0
  241. package/dist/core/operations/validate.d.ts +4 -0
  242. package/dist/core/operations/validate.d.ts.map +1 -0
  243. package/dist/core/order.d.ts +9 -0
  244. package/dist/core/order.d.ts.map +1 -0
  245. package/dist/core/outputs.d.ts +22 -0
  246. package/dist/core/outputs.d.ts.map +1 -0
  247. package/dist/core/package-name.d.ts +3 -0
  248. package/dist/core/package-name.d.ts.map +1 -0
  249. package/dist/core/package-root.d.ts +3 -0
  250. package/dist/core/package-root.d.ts.map +1 -0
  251. package/dist/core/plugin-name.d.ts +27 -0
  252. package/dist/core/plugin-name.d.ts.map +1 -0
  253. package/dist/core/preflight.d.ts +10 -0
  254. package/dist/core/preflight.d.ts.map +1 -0
  255. package/dist/core/read/can.d.ts +44 -0
  256. package/dist/core/read/can.d.ts.map +1 -0
  257. package/dist/core/read/fonts.d.ts +47 -0
  258. package/dist/core/read/fonts.d.ts.map +1 -0
  259. package/dist/core/read/index.d.ts +8 -0
  260. package/dist/core/read/index.d.ts.map +1 -0
  261. package/dist/core/read/list.d.ts +28 -0
  262. package/dist/core/read/list.d.ts.map +1 -0
  263. package/dist/core/read/logo.d.ts +34 -0
  264. package/dist/core/read/logo.d.ts.map +1 -0
  265. package/dist/core/read/lookup.d.ts +9 -0
  266. package/dist/core/read/lookup.d.ts.map +1 -0
  267. package/dist/core/read/rules.d.ts +80 -0
  268. package/dist/core/read/rules.d.ts.map +1 -0
  269. package/dist/core/read/token.d.ts +46 -0
  270. package/dist/core/read/token.d.ts.map +1 -0
  271. package/dist/core/shipped-names.d.ts +9 -0
  272. package/dist/core/shipped-names.d.ts.map +1 -0
  273. package/dist/core/starter.d.ts +31 -0
  274. package/dist/core/starter.d.ts.map +1 -0
  275. package/dist/core/suggest.d.ts +7 -0
  276. package/dist/core/suggest.d.ts.map +1 -0
  277. package/dist/core/tokens/alias.d.ts +18 -0
  278. package/dist/core/tokens/alias.d.ts.map +1 -0
  279. package/dist/core/tokens/contexts.d.ts +10 -0
  280. package/dist/core/tokens/contexts.d.ts.map +1 -0
  281. package/dist/core/tokens/formatters/css.d.ts +15 -0
  282. package/dist/core/tokens/formatters/css.d.ts.map +1 -0
  283. package/dist/core/tokens/formatters/json.d.ts +4 -0
  284. package/dist/core/tokens/formatters/json.d.ts.map +1 -0
  285. package/dist/core/tokens/formatters/tailwind.d.ts +37 -0
  286. package/dist/core/tokens/formatters/tailwind.d.ts.map +1 -0
  287. package/dist/core/tokens/formatters/ts.d.ts +6 -0
  288. package/dist/core/tokens/formatters/ts.d.ts.map +1 -0
  289. package/dist/core/tokens/groups.d.ts +44 -0
  290. package/dist/core/tokens/groups.d.ts.map +1 -0
  291. package/dist/core/tokens/key-lines.d.ts +8 -0
  292. package/dist/core/tokens/key-lines.d.ts.map +1 -0
  293. package/dist/core/tokens/load.d.ts +12 -0
  294. package/dist/core/tokens/load.d.ts.map +1 -0
  295. package/dist/core/tokens/merge.d.ts +17 -0
  296. package/dist/core/tokens/merge.d.ts.map +1 -0
  297. package/dist/core/tokens/names.d.ts +5 -0
  298. package/dist/core/tokens/names.d.ts.map +1 -0
  299. package/dist/core/tokens/resolve.d.ts +8 -0
  300. package/dist/core/tokens/resolve.d.ts.map +1 -0
  301. package/dist/core/tokens/resolver/compile.d.ts +17 -0
  302. package/dist/core/tokens/resolver/compile.d.ts.map +1 -0
  303. package/dist/core/tokens/resolver/inputs.d.ts +7 -0
  304. package/dist/core/tokens/resolver/inputs.d.ts.map +1 -0
  305. package/dist/core/tokens/resolver/parse.d.ts +34 -0
  306. package/dist/core/tokens/resolver/parse.d.ts.map +1 -0
  307. package/dist/core/tokens/resolver/sources.d.ts +17 -0
  308. package/dist/core/tokens/resolver/sources.d.ts.map +1 -0
  309. package/dist/core/tokens/shadcn.d.ts +43 -0
  310. package/dist/core/tokens/shadcn.d.ts.map +1 -0
  311. package/dist/core/tokens/theme.d.ts +17 -0
  312. package/dist/core/tokens/theme.d.ts.map +1 -0
  313. package/dist/core/tokens/values/color.d.ts +2 -0
  314. package/dist/core/tokens/values/color.d.ts.map +1 -0
  315. package/dist/core/tokens/values/composite.d.ts +7 -0
  316. package/dist/core/tokens/values/composite.d.ts.map +1 -0
  317. package/dist/core/tokens/values/font.d.ts +3 -0
  318. package/dist/core/tokens/values/font.d.ts.map +1 -0
  319. package/dist/core/tokens/values/index.d.ts +9 -0
  320. package/dist/core/tokens/values/index.d.ts.map +1 -0
  321. package/dist/core/tokens/values/shared.d.ts +5 -0
  322. package/dist/core/tokens/values/shared.d.ts.map +1 -0
  323. package/dist/core/tokens/values/simple.d.ts +3 -0
  324. package/dist/core/tokens/values/simple.d.ts.map +1 -0
  325. package/dist/core/tokens/values/units.d.ts +3 -0
  326. package/dist/core/tokens/values/units.d.ts.map +1 -0
  327. package/dist/core/tokens/walk.d.ts +30 -0
  328. package/dist/core/tokens/walk.d.ts.map +1 -0
  329. package/dist/core/version.d.ts +3 -0
  330. package/dist/core/version.d.ts.map +1 -0
  331. package/dist/index.d.ts +27 -0
  332. package/dist/index.d.ts.map +1 -0
  333. package/dist/index.js +40 -0
  334. package/dist/plugins/host/admit.d.ts +35 -0
  335. package/dist/plugins/host/admit.d.ts.map +1 -0
  336. package/dist/plugins/host/call.d.ts +59 -0
  337. package/dist/plugins/host/call.d.ts.map +1 -0
  338. package/dist/plugins/host/check.d.ts +54 -0
  339. package/dist/plugins/host/check.d.ts.map +1 -0
  340. package/dist/plugins/host/scrub.d.ts +17 -0
  341. package/dist/plugins/host/scrub.d.ts.map +1 -0
  342. package/dist/plugins/index.d.ts +14 -0
  343. package/dist/plugins/index.d.ts.map +1 -0
  344. package/dist/plugins/pins/interpreter.d.ts +49 -0
  345. package/dist/plugins/pins/interpreter.d.ts.map +1 -0
  346. package/dist/plugins/pins/lock.d.ts +47 -0
  347. package/dist/plugins/pins/lock.d.ts.map +1 -0
  348. package/dist/plugins/pins/pin.d.ts +65 -0
  349. package/dist/plugins/pins/pin.d.ts.map +1 -0
  350. package/dist/plugins/pins/shipped.d.ts +40 -0
  351. package/dist/plugins/pins/shipped.d.ts.map +1 -0
  352. package/dist/plugins/roles/breaker.d.ts +18 -0
  353. package/dist/plugins/roles/breaker.d.ts.map +1 -0
  354. package/dist/plugins/roles/check-cases.d.ts +4 -0
  355. package/dist/plugins/roles/check-cases.d.ts.map +1 -0
  356. package/dist/plugins/roles/dev.d.ts +35 -0
  357. package/dist/plugins/roles/dev.d.ts.map +1 -0
  358. package/dist/plugins/roles/fixes.d.ts +24 -0
  359. package/dist/plugins/roles/fixes.d.ts.map +1 -0
  360. package/dist/plugins/roles/gate.d.ts +26 -0
  361. package/dist/plugins/roles/gate.d.ts.map +1 -0
  362. package/dist/plugins/roles/integrate.d.ts +12 -0
  363. package/dist/plugins/roles/integrate.d.ts.map +1 -0
  364. package/dist/plugins/roles/roles.d.ts +69 -0
  365. package/dist/plugins/roles/roles.d.ts.map +1 -0
  366. package/dist/plugins/wire/environment.d.ts +9 -0
  367. package/dist/plugins/wire/environment.d.ts.map +1 -0
  368. package/dist/plugins/wire/forms.d.ts +13 -0
  369. package/dist/plugins/wire/forms.d.ts.map +1 -0
  370. package/dist/plugins/wire/limits.d.ts +11 -0
  371. package/dist/plugins/wire/limits.d.ts.map +1 -0
  372. package/dist/plugins/wire/manifest.d.ts +31 -0
  373. package/dist/plugins/wire/manifest.d.ts.map +1 -0
  374. package/dist/plugins/wire/profile.d.ts +36 -0
  375. package/dist/plugins/wire/profile.d.ts.map +1 -0
  376. package/dist/plugins/wire/text.d.ts +14 -0
  377. package/dist/plugins/wire/text.d.ts.map +1 -0
  378. package/dist/server/assets.d.ts +13 -0
  379. package/dist/server/assets.d.ts.map +1 -0
  380. package/dist/server/coalesce.d.ts +12 -0
  381. package/dist/server/coalesce.d.ts.map +1 -0
  382. package/dist/server/data-script.d.ts +8 -0
  383. package/dist/server/data-script.d.ts.map +1 -0
  384. package/dist/server/dev-server.d.ts +34 -0
  385. package/dist/server/dev-server.d.ts.map +1 -0
  386. package/dist/server/editor-guard.d.ts +13 -0
  387. package/dist/server/editor-guard.d.ts.map +1 -0
  388. package/dist/server/error-reporter.d.ts +11 -0
  389. package/dist/server/error-reporter.d.ts.map +1 -0
  390. package/dist/server/icon-sets.d.ts +9 -0
  391. package/dist/server/icon-sets.d.ts.map +1 -0
  392. package/dist/server/plugin.d.ts +4 -0
  393. package/dist/server/plugin.d.ts.map +1 -0
  394. package/dist/server/preview-guard.d.ts +11 -0
  395. package/dist/server/preview-guard.d.ts.map +1 -0
  396. package/dist/types/assets.d.ts +130 -0
  397. package/dist/types/assets.d.ts.map +1 -0
  398. package/dist/types/catalog.d.ts +95 -0
  399. package/dist/types/catalog.d.ts.map +1 -0
  400. package/dist/types/config.d.ts +97 -0
  401. package/dist/types/config.d.ts.map +1 -0
  402. package/dist/types/data.d.ts +38 -0
  403. package/dist/types/data.d.ts.map +1 -0
  404. package/dist/types/docs.d.ts +47 -0
  405. package/dist/types/docs.d.ts.map +1 -0
  406. package/dist/types/findings.d.ts +18 -0
  407. package/dist/types/findings.d.ts.map +1 -0
  408. package/dist/types/index.d.ts +13 -0
  409. package/dist/types/index.d.ts.map +1 -0
  410. package/dist/types/parsed.d.ts +86 -0
  411. package/dist/types/parsed.d.ts.map +1 -0
  412. package/dist/types/theme.d.ts +19 -0
  413. package/dist/types/theme.d.ts.map +1 -0
  414. package/dist/types/tokens.d.ts +101 -0
  415. package/dist/types/tokens.d.ts.map +1 -0
  416. package/dist/ui/assets/geist-OFL.txt +93 -0
  417. package/dist/ui/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  418. package/dist/ui/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  419. package/dist/ui/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  420. package/dist/ui/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  421. package/dist/ui/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  422. package/dist/ui/assets/index-BdbihVvH.js +77 -0
  423. package/dist/ui/assets/index-DluSqfla.css +2 -0
  424. package/dist/ui/index.html +14 -0
  425. package/package.json +151 -4
  426. package/plugins/blazon.brand-deck/README.md +38 -0
  427. package/plugins/blazon.brand-deck/bin/blazon-blazon.brand-deck./360/237/224/214 +2695 -0
  428. package/plugins/blazon.brand-deck/package.json +3 -0
  429. package/plugins/blazon.copy/README.md +29 -0
  430. package/plugins/blazon.copy/bin/blazon-blazon.copy./360/237/224/214 +438 -0
  431. package/plugins/blazon.copy/package.json +3 -0
  432. package/plugins/blazon.favicons/README.md +13 -0
  433. package/plugins/blazon.favicons/bin/blazon-blazon.favicons./360/237/224/214 +8816 -0
  434. package/plugins/blazon.favicons/package.json +3 -0
  435. package/plugins/blazon.logo-geometry/README.md +5 -0
  436. package/plugins/blazon.logo-geometry/bin/blazon-blazon.logo-geometry./360/237/224/214 +1522 -0
  437. package/plugins/blazon.logo-geometry/package.json +3 -0
  438. package/plugins/blazon.logo-kit/README.md +5 -0
  439. package/plugins/blazon.logo-kit/bin/blazon-blazon.logo-kit./360/237/224/214 +617 -0
  440. package/plugins/blazon.logo-kit/package.json +3 -0
  441. package/plugins/blazon.office-template/README.md +29 -0
  442. package/plugins/blazon.office-template/bin/blazon-blazon.office-template./360/237/224/214 +1788 -0
  443. package/plugins/blazon.office-template/package.json +3 -0
  444. package/plugins/blazon.platform-tokens/README.md +22 -0
  445. package/plugins/blazon.platform-tokens/bin/blazon-blazon.platform-tokens./360/237/224/214 +8418 -0
  446. package/plugins/blazon.platform-tokens/package.json +3 -0
  447. package/plugins/blazon.press-kit/README.md +17 -0
  448. package/plugins/blazon.press-kit/bin/blazon-blazon.press-kit./360/237/224/214 +897 -0
  449. package/plugins/blazon.press-kit/package.json +3 -0
  450. package/plugins/blazon.print-book/README.md +38 -0
  451. package/plugins/blazon.print-book/bin/blazon-blazon.print-book./360/237/224/214 +9262 -0
  452. package/plugins/blazon.print-book/package.json +3 -0
  453. package/plugins/blazon.social-cards/README.md +5 -0
  454. package/plugins/blazon.social-cards/bin/blazon-blazon.social-cards./360/237/224/214 +1165 -0
  455. package/plugins/blazon.social-cards/package.json +3 -0
  456. package/plugins/shipped.lock +75 -0
  457. package/template/AGENTS.md +55 -0
  458. package/template/CLAUDE.md +1 -0
  459. package/template/assets/backgrounds/aurora.json +5 -0
  460. package/template/assets/backgrounds/aurora.svg +39 -0
  461. package/template/assets/construction/blazon-mark.json +9 -0
  462. package/template/assets/construction/blazon-mark.svg +54 -0
  463. package/template/assets/icons/arrow-right.json +5 -0
  464. package/template/assets/icons/arrow-right.svg +1 -0
  465. package/template/assets/icons/check.json +5 -0
  466. package/template/assets/icons/check.svg +1 -0
  467. package/template/assets/icons/download.json +5 -0
  468. package/template/assets/icons/download.svg +1 -0
  469. package/template/assets/icons/file.json +5 -0
  470. package/template/assets/icons/file.svg +1 -0
  471. package/template/assets/icons/token.json +5 -0
  472. package/template/assets/icons/token.svg +1 -0
  473. package/template/assets/icons/warning.json +5 -0
  474. package/template/assets/icons/warning.svg +1 -0
  475. package/template/assets/logos/blazon-bone.json +6 -0
  476. package/template/assets/logos/blazon-bone.svg +1 -0
  477. package/template/assets/logos/blazon-graphite.json +6 -0
  478. package/template/assets/logos/blazon-graphite.svg +1 -0
  479. package/template/assets/logos/blazon-mark.json +6 -0
  480. package/template/assets/logos/blazon-mark.svg +1 -0
  481. package/template/blazon.json +104 -0
  482. package/template/blazon.resolver.json +46 -0
  483. package/template/docs/01-principles.md +47 -0
  484. package/template/docs/02-logo.md +43 -0
  485. package/template/docs/03-color.md +79 -0
  486. package/template/docs/04-type.md +36 -0
  487. package/template/docs/05-form.md +80 -0
  488. package/template/docs/06-layout.md +28 -0
  489. package/template/docs/07-icons.md +22 -0
  490. package/template/docs/08-diagrams.md +20 -0
  491. package/template/docs/09-social.md +21 -0
  492. package/template/docs/10-applications.md +20 -0
  493. package/template/docs/11-voice.md +74 -0
  494. package/template/docs/12-web.md +167 -0
  495. package/template/fonts/IBMPlexMono-Regular-latin.woff2 +0 -0
  496. package/template/fonts/IBMPlexMono-SemiBold-latin.woff2 +0 -0
  497. package/template/fonts/OFL.txt +93 -0
  498. package/template/tokens/colors.json +257 -0
  499. package/template/tokens/form.json +199 -0
  500. package/template/tokens/social.json +26 -0
  501. package/template/tokens/spacing.json +65 -0
  502. package/template/tokens/theme/dark.json +121 -0
  503. package/template/tokens/typography.json +233 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,29 @@
1
+ # blazon.copy
2
+
3
+ The plugin blazon ships to hold a brand book's text to the brand's copy rules: the terms it avoids, the case of its headings and the length of its sentences. It fills the `check` role, reads `brand.json` only (the pages' Markdown and the assets' sidecar text), writes nothing and needs only Node.
4
+
5
+ The source is `src/shipped/copy/`, and `npm run build` (`npm run build:plugins`) bundles it, with the blazon code it uses, into `bin/blazon-blazon.copy.🔌`, the one file that holds the plugin's code and that `plugins/shipped.lock` pins. It loads nothing from `node_modules`, so the pin covers all the code it runs, apart from Node itself. Name it in `blazon.json` and give it the rules:
6
+
7
+ ```ts
8
+ plugins: [
9
+ {
10
+ name: 'blazon.copy',
11
+ options: {
12
+ avoid: [{ terms: ['powerful', 'seamless', 'robust', 'effortless'], say: 'a number, or nothing' }],
13
+ headings: 'sentence',
14
+ sentences: { maxWords: 25 },
15
+ skip: ['11-voice.md'],
16
+ },
17
+ },
18
+ ],
19
+ ```
20
+
21
+ With no options it checks nothing. The options and the findings are in [the manual](../../docs/manual/14-shipped-plugins.md#blazoncopy), and the design is [RFC 0006](../../docs/rfc/0006-copy-rules.md).
22
+
23
+ ## What it reads
24
+
25
+ A page's title and description, and its Markdown outside code spans, code fences, HTML comments (the directives) and link targets. An asset's `title`, `description`, `traits`, `do` and `dont`. A group of terms may be scoped to some pages or assets with `only` and `skip` (a path ending in `*` is a prefix, so `social/*` is a category), and `headings` may be an object `{ case, maxWords, only, skip }` that also limits the words of a heading on the pages it names. A term ending in `*` is a stem that matches every form of a word (`решени*`). `ignoreQuoted: true` leaves text inside quotation marks out of the search for avoided terms. Sentences are split at a capital letter of any script, so Cyrillic text works. A term inside code is not flagged, so a counter-example written as code is safe; a page that quotes counter-examples as plain text goes in `skip`.
26
+
27
+ ## What it does not do
28
+
29
+ It does not judge tone, spelling or meaning, and it does not rewrite a page. The checks are heuristics, so every finding but a wrong option is a warning. A term is a literal compared as text, never a pattern, so a term cannot make a check run away.
@@ -0,0 +1,438 @@
1
+ #!/usr/bin/env node
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ let node_fs = require("node:fs");
23
+ node_fs = __toESM(node_fs, 1);
24
+ require("node:path");
25
+ /** What the findings may take on the wire, in bytes. The limit is 65,536; the rest is the envelope, the summary finding and a newline, with room to spare. */
26
+ var FINDINGS_BUDGET = 6e4;
27
+ var RANK = {
28
+ error: 0,
29
+ warning: 1,
30
+ info: 2
31
+ };
32
+ var rank = (severity) => RANK[severity] ?? 3;
33
+ var wire = (finding) => Buffer.byteLength(JSON.stringify(finding), "utf-8") + 1;
34
+ /**
35
+ * The findings as they are when they fit. When they do not, the first ones that fit, errors before warnings before notes and each
36
+ * group in the order it was found, then one `<name>/findings-left-out` warning that says how many are not shown. The summary is a
37
+ * warning so that it never hides that there were errors: the errors come first, and a run with any error is already failed.
38
+ */
39
+ function boundFindings(findings, name) {
40
+ let size = 0;
41
+ for (const finding of findings) size += wire(finding);
42
+ if (size <= 6e4) return findings;
43
+ const ordered = [...findings].sort((a, b) => rank(a.severity) - rank(b.severity));
44
+ const kept = [];
45
+ size = 0;
46
+ for (const finding of ordered) {
47
+ if (size + wire(finding) > 6e4) break;
48
+ size += wire(finding);
49
+ kept.push(finding);
50
+ }
51
+ const left = ordered.length - kept.length;
52
+ kept.push({
53
+ code: `${name}/findings-left-out`,
54
+ severity: "warning",
55
+ path: "findings",
56
+ message: `${left} more findings are not shown, because the answer would not fit the ${FINDINGS_BUDGET.toLocaleString("en-US")} bytes a plugin may print; fix the ones above and run again`
57
+ });
58
+ return kept;
59
+ }
60
+ /** The plugin cannot do what it was asked; the message is the reason blazon shows. */
61
+ var Cannot = class extends Error {};
62
+ /** The builder of a plugin's findings: `findingFor(NAME)('code', severity, path, message)` is a finding coded `NAME/code`. */
63
+ var findingFor = (name) => (code, severity, path, message) => ({
64
+ code: `${name}/${code}`,
65
+ severity,
66
+ path,
67
+ message
68
+ });
69
+ var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
70
+ /** The brand.json a plugin reads: the object when its format and version are the ones this reader understands, Cannot otherwise (RFC 0001: a reader checks both before it interprets anything). */
71
+ function requireBrand(raw) {
72
+ const shown = (value) => JSON.stringify(value) ?? "nothing";
73
+ if (!isObject(raw) || raw.format !== "blazon-brand") throw new Cannot(`the brand in the request is not a blazon brand: its format is ${shown(isObject(raw) ? raw.format : void 0)}, not "blazon-brand"`);
74
+ if (raw.version !== 1) throw new Cannot(`the brand in the request is version ${shown(raw.version)}; this reader understands version 1`);
75
+ return raw;
76
+ }
77
+ /** The request as an object of version 1, or Cannot with the reason. Its role and folders are for the plugin to check. */
78
+ function readRequest(text) {
79
+ let request;
80
+ try {
81
+ request = JSON.parse(text);
82
+ } catch {
83
+ throw new Cannot("the request is not JSON");
84
+ }
85
+ if (!isObject(request)) throw new Cannot("the request is not a JSON object");
86
+ if (request.v !== 1) throw new Cannot(`the request is version ${JSON.stringify(request.v)}; this plugin speaks version 1`);
87
+ return request;
88
+ }
89
+ /**
90
+ * The entry: `--blazon-manifest` prints the manifest; otherwise one request on standard input gets the answer of `build` as
91
+ * JSON, or exit 2 with the reason as the first line of standard output. `failure` starts the reason for an error that is
92
+ * not a Cannot. `name` is the plugin's, for the summary when the findings are bounded to what a call may print (bound.ts). Returns the exit status.
93
+ */
94
+ async function runPlugin(argv, manifest, build, failure, name) {
95
+ if (argv[0] === "--blazon-manifest") {
96
+ process.stdout.write(`${JSON.stringify(manifest)}\n`);
97
+ return 0;
98
+ }
99
+ try {
100
+ const answer = await build(node_fs.default.readFileSync(0, "utf-8"));
101
+ const bounded = isObject(answer) && Array.isArray(answer.findings) ? {
102
+ ...answer,
103
+ findings: boundFindings(answer.findings, name)
104
+ } : answer;
105
+ process.stdout.write(`${JSON.stringify(bounded)}\n`);
106
+ return 0;
107
+ } catch (error) {
108
+ const reason = error instanceof Cannot ? error.message : `${failure}: ${String(error.message ?? error).split("\n")[0].slice(0, 500)}`;
109
+ process.stdout.write(`${reason}\n`);
110
+ return 2;
111
+ }
112
+ }
113
+ /** The plugin's name, which blazon's config names it by, and the prefix of its finding codes */
114
+ var NAME = "blazon.copy";
115
+ var MANIFEST = {
116
+ v: 2,
117
+ roles: ["check"],
118
+ title: "Copy rules",
119
+ description: "Holds the brand book's text to the brand's word rules: terms it avoids, heading case and sentence length.",
120
+ version: "1.1.0",
121
+ timeout_ms: 1e4,
122
+ env: []
123
+ };
124
+ /** The job a check request asks for, or Cannot with the reason. The options are checked later, and wrong ones are findings. */
125
+ function jobFor(text) {
126
+ const request = readRequest(text);
127
+ if (request.type !== "check") throw new Cannot(`the request is for the ${String(request.type)} role; this plugin is a check plugin`);
128
+ if (!isObject(request.brand)) throw new Cannot("the request has no brand");
129
+ return {
130
+ brand: requireBrand(request.brand),
131
+ options: request.options ?? {}
132
+ };
133
+ }
134
+ var finding = findingFor(NAME);
135
+ var KNOWN = [
136
+ "avoid",
137
+ "headings",
138
+ "ignoreQuoted",
139
+ "names",
140
+ "sentences",
141
+ "skip"
142
+ ];
143
+ var GROUP_KEYS = [
144
+ "terms",
145
+ "say",
146
+ "only",
147
+ "skip"
148
+ ];
149
+ var HEADING_KEYS = [
150
+ "case",
151
+ "maxWords",
152
+ "only",
153
+ "skip"
154
+ ];
155
+ var strings = (value) => Array.isArray(value) && value.every((item) => typeof item === "string");
156
+ /** The options the config gave, with a finding for each one that is wrong; a wrong option is left out and the others stay. */
157
+ function parseOptions(raw) {
158
+ const options = {
159
+ avoid: [],
160
+ headings: "any",
161
+ ignoreQuoted: false,
162
+ names: /* @__PURE__ */ new Set(),
163
+ skip: /* @__PURE__ */ new Set()
164
+ };
165
+ const findings = [];
166
+ const bad = (message) => findings.push(finding("option-invalid", "error", "options", message));
167
+ if (!isObject(raw)) {
168
+ bad("options must be an object");
169
+ return {
170
+ options,
171
+ findings
172
+ };
173
+ }
174
+ for (const key of Object.keys(raw)) if (!KNOWN.includes(key)) bad(`${key} is not an option; the options are ${KNOWN.join(", ")}`);
175
+ if (raw.avoid !== void 0) {
176
+ if (!Array.isArray(raw.avoid)) bad("avoid must be a list of groups");
177
+ else raw.avoid.forEach((group, i) => {
178
+ if (!isObject(group) || !strings(group.terms) || group.terms.length === 0) return bad(`avoid[${i}].terms must be a list of strings`);
179
+ if (group.terms.some((term) => term.trim() === "" || term.trim() === "*")) return bad(`avoid[${i}].terms holds an empty term`);
180
+ if (group.say !== void 0 && typeof group.say !== "string") return bad(`avoid[${i}].say must be a string`);
181
+ for (const key of Object.keys(group)) if (!GROUP_KEYS.includes(key)) return bad(`avoid[${i}].${key} is not an option of a group; they are ${GROUP_KEYS.join(", ")}`);
182
+ for (const key of ["only", "skip"]) if (group[key] !== void 0 && !strings(group[key])) return bad(`avoid[${i}].${key} must be a list of page paths`);
183
+ options.avoid.push({
184
+ terms: group.terms,
185
+ ...typeof group.say === "string" && { say: group.say },
186
+ ...strings(group.only) && { only: new Set(group.only) },
187
+ ...strings(group.skip) && { skip: new Set(group.skip) }
188
+ });
189
+ });
190
+ }
191
+ if (raw.headings !== void 0) {
192
+ if (raw.headings === "sentence" || raw.headings === "any") options.headings = raw.headings;
193
+ else if (isObject(raw.headings)) {
194
+ const unknown = Object.keys(raw.headings).find((key) => !HEADING_KEYS.includes(key));
195
+ const { case: kind, maxWords, only, skip } = raw.headings;
196
+ if (unknown) bad(`headings.${unknown} is not an option of headings; they are ${HEADING_KEYS.join(", ")}`);
197
+ else if (kind !== void 0 && kind !== "sentence" && kind !== "any") bad("headings.case must be \"sentence\" or \"any\"");
198
+ else if (maxWords !== void 0 && !(Number.isInteger(maxWords) && maxWords > 0)) bad("headings.maxWords must be a positive integer");
199
+ else if (only !== void 0 && !strings(only)) bad("headings.only must be a list of page paths");
200
+ else if (skip !== void 0 && !strings(skip)) bad("headings.skip must be a list of page paths");
201
+ else {
202
+ if (kind === "sentence" || kind === "any") options.headings = kind;
203
+ if (maxWords !== void 0) options.headingMaxWords = maxWords;
204
+ if (strings(only)) options.headingOnly = new Set(only);
205
+ if (strings(skip)) options.headingSkip = new Set(skip);
206
+ }
207
+ } else bad("headings must be \"sentence\", \"any\" or an object with case and maxWords");
208
+ }
209
+ if (raw.ignoreQuoted !== void 0) {
210
+ if (typeof raw.ignoreQuoted === "boolean") options.ignoreQuoted = raw.ignoreQuoted;
211
+ else bad("ignoreQuoted must be true or false");
212
+ }
213
+ if (raw.names !== void 0) {
214
+ if (strings(raw.names)) options.names = new Set(raw.names);
215
+ else bad("names must be a list of strings");
216
+ }
217
+ if (raw.sentences !== void 0) {
218
+ const max = isObject(raw.sentences) ? raw.sentences.maxWords : void 0;
219
+ if (Number.isInteger(max) && max > 0) options.maxWords = max;
220
+ else bad("sentences.maxWords must be a positive integer");
221
+ }
222
+ if (raw.skip !== void 0) {
223
+ if (strings(raw.skip)) options.skip = new Set(raw.skip);
224
+ else bad("skip must be a list of page paths");
225
+ }
226
+ return {
227
+ options,
228
+ findings
229
+ };
230
+ }
231
+ /** Inline markup removed: code spans, images, link targets, tags and emphasis marks. */
232
+ function clean(text) {
233
+ return text.replace(/`[^`]*`/g, "").replace(/!\[[^\]]*\]\([^)]*\)/g, "").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/<[^>]*>/g, "").replace(/[*_]/g, "").replace(/\s+/g, " ").trim();
234
+ }
235
+ /** The Markdown of a page as blocks, in order. Code fences and HTML comments (the directives) are skipped. */
236
+ function blocksOf(markdown) {
237
+ const blocks = [];
238
+ let current;
239
+ let fence;
240
+ let comment = false;
241
+ const flush = () => {
242
+ if (current && clean(current.text)) blocks.push({
243
+ kind: current.kind,
244
+ text: clean(current.text)
245
+ });
246
+ current = void 0;
247
+ };
248
+ for (const line of markdown.split("\n")) {
249
+ const trimmed = line.trim();
250
+ if (fence) {
251
+ if (trimmed.startsWith(fence)) fence = void 0;
252
+ continue;
253
+ }
254
+ if (comment) {
255
+ if (trimmed.includes("-->")) comment = false;
256
+ continue;
257
+ }
258
+ if (trimmed.startsWith("```") || trimmed.startsWith("~~~")) {
259
+ flush();
260
+ fence = trimmed.slice(0, 3);
261
+ continue;
262
+ }
263
+ if (trimmed.startsWith("<!--")) {
264
+ flush();
265
+ comment = !trimmed.includes("-->");
266
+ continue;
267
+ }
268
+ if (trimmed === "") {
269
+ flush();
270
+ continue;
271
+ }
272
+ const heading = /^#{1,6}\s+(.*?)\s*#*$/.exec(trimmed);
273
+ if (heading) {
274
+ flush();
275
+ current = {
276
+ kind: "heading",
277
+ text: heading[1]
278
+ };
279
+ flush();
280
+ continue;
281
+ }
282
+ if (trimmed.startsWith("|")) {
283
+ flush();
284
+ if (!/^[|\s:-]+$/.test(trimmed)) blocks.push({
285
+ kind: "table",
286
+ text: clean(trimmed.replace(/\|/g, " "))
287
+ });
288
+ continue;
289
+ }
290
+ const item = /^([-*+]|\d+[.)])\s+(.*)$/.exec(trimmed);
291
+ if (item) {
292
+ flush();
293
+ current = {
294
+ kind: "item",
295
+ text: item[2]
296
+ };
297
+ continue;
298
+ }
299
+ const text = trimmed.replace(/^>\s?/, "");
300
+ if (current) current.text += ` ${text}`;
301
+ else current = {
302
+ kind: "paragraph",
303
+ text
304
+ };
305
+ }
306
+ flush();
307
+ return blocks.filter((block) => block.text !== "");
308
+ }
309
+ var ABBREVIATIONS = /\b(e\.g|i\.e|etc|vs|cf|fig|mr|mrs|dr)\./gi;
310
+ /** The sentences of a block of prose: a stop followed by a capital letter of any script, or a digit. A full stop in an abbreviation does not end one. */
311
+ function sentencesOf(text) {
312
+ return text.replace(ABBREVIATIONS, (match) => match.replace(/\./g, "")).split(/(?<=[.!?])\s+(?=[\p{Lu}\p{N}"'([])/u).map((sentence) => sentence.replace(/\uE000/g, ".").trim()).filter((sentence) => sentence !== "");
313
+ }
314
+ /** The words of a sentence: each stretch of text with a letter or a digit in it. */
315
+ var wordsOf = (sentence) => sentence.split(/\s+/).filter((word) => /[\p{L}\p{N}]/u.test(word));
316
+ var isWordChar = (char) => char !== void 0 && /[\p{L}\p{N}]/u.test(char);
317
+ /**
318
+ * How often `term` is in `text`, and the first place. A term that starts or ends with a letter or a digit matches whole words only. A single
319
+ * trailing `*` makes the term a stem: it matches every word that begins with it (`решени*` finds решение, решения and решенията). No other
320
+ * character has a meaning, so no pattern is built from a term.
321
+ */
322
+ function occurrences(text, term) {
323
+ const haystack = text.toLowerCase();
324
+ const stem = term.length > 1 && term.endsWith("*");
325
+ const needle = (stem ? term.slice(0, -1) : term).toLowerCase();
326
+ const startsWord = isWordChar(needle[0]);
327
+ const endsWord = !stem && isWordChar(needle[needle.length - 1]);
328
+ let count = 0;
329
+ let first = -1;
330
+ for (let at = haystack.indexOf(needle); at !== -1; at = haystack.indexOf(needle, at + needle.length)) {
331
+ if (startsWord && isWordChar(haystack[at - 1])) continue;
332
+ if (endsWord && isWordChar(haystack[at + needle.length])) continue;
333
+ count += 1;
334
+ if (first === -1) first = at;
335
+ }
336
+ return {
337
+ count,
338
+ first
339
+ };
340
+ }
341
+ var quote = (text, at, length) => `${at > 20 ? "..." : ""}${text.slice(Math.max(0, at - 20), at + length + 20).replace(/\s+/g, " ").trim()}${at + length + 20 < text.length ? "..." : ""}`;
342
+ /** Whether a path is in a list of them: written in full, or covered by one ending in `*`, which is a prefix (`social/*`, a category of assets). */
343
+ var inScope = (path, paths) => [...paths].some((entry) => entry.endsWith("*") ? path.startsWith(entry.slice(0, -1)) : entry === path);
344
+ /** Whether a group applies to a page or an asset, by its path: every one, or those in `only`, less those in `skip`. */
345
+ var applies = (group, path) => (!group.only || inScope(path, group.only)) && !(group.skip && inScope(path, group.skip));
346
+ /** The text with whatever is inside quotation marks (straight, curly, low-high and guillemets) turned to spaces of the same length, so a place in it is still a place in the text. */
347
+ var QUOTED = /"[^"]*"|\u201C[^\u201D]*\u201D|\u201E[^\u201C\u201D]*[\u201C\u201D]|\u00AB[^\u00BB]*\u00BB/g;
348
+ var withoutQuoted = (text) => text.replace(QUOTED, (quoted) => " ".repeat(quoted.length));
349
+ /** A finding for each avoided term the blocks hold: how often, and the block of its first appearance, so a quote never runs across two blocks. */
350
+ function avoidedTerms(path, blocks, groups, ignoreQuoted) {
351
+ const found = [];
352
+ for (const group of groups.filter((candidate) => applies(candidate, path))) for (const term of group.terms) {
353
+ let count = 0;
354
+ let first;
355
+ for (const block of blocks) {
356
+ const seen = occurrences(ignoreQuoted ? withoutQuoted(block.text) : block.text, term);
357
+ count += seen.count;
358
+ if (seen.count > 0 && !first) first = {
359
+ block,
360
+ at: seen.first
361
+ };
362
+ }
363
+ if (!first) continue;
364
+ const advice = group.say ? ` The brand says: ${group.say}.` : "";
365
+ found.push(finding("avoided-term", "warning", path, `"${term}" is avoided and appears ${count === 1 ? "once" : `${count} times`}, as in "${quote(first.block.text, first.at, term.length)}".${advice}`));
366
+ }
367
+ return found;
368
+ }
369
+ /** Whether a heading is in title case: three or more words, and each word after the first that is not a name starts with a capital. */
370
+ function isTitleCase(heading, names) {
371
+ const words = heading.split(/\s+/).filter((word) => /^\p{L}/u.test(word));
372
+ if (words.length < 3) return false;
373
+ const rest = words.slice(1).filter((word) => !names.has(word.replace(/[^\p{L}\p{N}]+$/u, "")));
374
+ return rest.length > 0 && rest.every((word) => /^\p{Lu}/u.test(word));
375
+ }
376
+ function sentenceLengths(path, text, max) {
377
+ const found = [];
378
+ for (const sentence of sentencesOf(text)) {
379
+ const count = wordsOf(sentence).length;
380
+ if (count > max) found.push(finding("sentence-length", "warning", path, `a sentence of ${count} words, and the brand allows ${max}: "${sentence.slice(0, 60)}${sentence.length > 60 ? "..." : ""}"`));
381
+ }
382
+ return found;
383
+ }
384
+ /** The findings for one source of text: a page's blocks, or an asset's strings given as paragraphs. */
385
+ function checkBlocks(path, blocks, options) {
386
+ const found = avoidedTerms(path, blocks, options.avoid, options.ignoreQuoted);
387
+ const headings = (!options.headingOnly || inScope(path, options.headingOnly)) && !(options.headingSkip && inScope(path, options.headingSkip));
388
+ for (const block of blocks) {
389
+ if (block.kind === "heading" && headings && options.headings === "sentence" && isTitleCase(block.text, options.names)) found.push(finding("heading-case", "warning", path, `"${block.text}" is in title case, and the brand sets headings in sentence case`));
390
+ if (block.kind === "heading" && headings && options.headingMaxWords !== void 0) {
391
+ const count = wordsOf(block.text).length;
392
+ if (count > options.headingMaxWords) found.push(finding("heading-length", "warning", path, `"${block.text}" is a heading of ${count} words, and the brand allows ${options.headingMaxWords}`));
393
+ }
394
+ if ((block.kind === "paragraph" || block.kind === "item") && options.maxWords !== void 0) found.push(...sentenceLengths(path, block.text, options.maxWords));
395
+ }
396
+ return found;
397
+ }
398
+ var text = (value) => typeof value === "string" ? [value] : Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
399
+ /** The findings for a brand: every page and every asset sidecar, in the order `brand.json` lists them. */
400
+ function copyFindings(brand, options) {
401
+ const found = [];
402
+ for (const page of Array.isArray(brand.pages) ? brand.pages : []) {
403
+ if (!isObject(page) || typeof page.markdown !== "string") continue;
404
+ const path = typeof page.sourceFile === "string" ? page.sourceFile : String(page.slug ?? "page");
405
+ if (inScope(path, options.skip)) continue;
406
+ const meta = isObject(page.meta) ? page.meta : {};
407
+ const front = [...text(page.title), ...text(meta.description)].map((value) => ({
408
+ kind: "paragraph",
409
+ text: value
410
+ }));
411
+ found.push(...checkBlocks(path, [...front, ...blocksOf(page.markdown)], options));
412
+ }
413
+ for (const asset of Array.isArray(brand.assets) ? brand.assets : []) {
414
+ if (!isObject(asset) || !isObject(asset.meta)) continue;
415
+ const path = typeof asset.id === "string" ? asset.id : "asset";
416
+ if (inScope(path, options.skip)) continue;
417
+ const strings = [
418
+ asset.meta.title,
419
+ asset.meta.description,
420
+ asset.meta.traits,
421
+ asset.meta.do,
422
+ asset.meta.dont
423
+ ].flatMap(text);
424
+ found.push(...checkBlocks(path, strings.map((value) => ({
425
+ kind: "paragraph",
426
+ text: value
427
+ })), options));
428
+ }
429
+ return found;
430
+ }
431
+ async function check(text) {
432
+ const job = jobFor(text);
433
+ const { options, findings } = parseOptions(job.options);
434
+ return { findings: [...findings, ...copyFindings(job.brand, options)] };
435
+ }
436
+ runPlugin(process.argv.slice(2), MANIFEST, check, "the copy rules could not be checked", NAME).then((code) => {
437
+ process.exitCode = code;
438
+ });
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,13 @@
1
+ # blazon.favicons
2
+
3
+ The plugin blazon ships to draw a brand's favicon and app-icon set from its symbol, with three views of the set for the brand book, and to judge the symbol as an icon. It fills the `check` and `build` roles. Drawing needs Node and a Chrome (`BLAZON_CHROME`, or the Google Chrome installed on the computer); the check needs neither. Its options, the files it writes, the findings it returns and the Favicons page it copies into the site are in the plugins chapter of the manual, "blazon.favicons".
4
+
5
+ List it before `blazon.print-book`, so the printed book has a Favicons chapter.
6
+
7
+ The source is `src/shipped/favicons/`, and `npm run build` (`npm run build:plugins`) bundles it, with the blazon code it uses, into `bin/blazon-blazon.favicons.🔌`, the one file that holds the plugin's code and that `plugins/shipped.lock` pins. The program loads `playwright-core` from `node_modules` when it runs; that is outside the pin.
8
+
9
+ ## Variables
10
+
11
+ | Variable | Says | Secret |
12
+ |---|---|---|
13
+ | `BLAZON_CHROME` | The path to a Chrome or Chromium program. Without it the plugin uses the Google Chrome installed on the computer. It never downloads a browser | no |