@lets-ship/brand-dna 0.0.0-stage → 1.0.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 (334) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +35 -2
  3. package/bin/dna.js +5 -0
  4. package/catalog/fonts/fraunces-latin-600-normal.woff2 +0 -0
  5. package/catalog/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
  6. package/catalog/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
  7. package/catalog/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
  8. package/catalog/fonts/ibm-plex-sans-latin-700-normal.woff2 +0 -0
  9. package/catalog/fonts/inter-latin-400-normal.woff2 +0 -0
  10. package/catalog/fonts/inter-latin-600-normal.woff2 +0 -0
  11. package/catalog/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
  12. package/catalog/fonts/jetbrains-mono-latin-600-normal.woff2 +0 -0
  13. package/catalog/fonts/merriweather-latin-300-normal.woff2 +0 -0
  14. package/catalog/fonts/merriweather-latin-400-normal.woff2 +0 -0
  15. package/catalog/fonts/merriweather-latin-700-normal.woff2 +0 -0
  16. package/catalog/fonts/merriweather-sans-latin-400-normal.woff2 +0 -0
  17. package/catalog/fonts/merriweather-sans-latin-600-normal.woff2 +0 -0
  18. package/catalog/fonts/merriweather-sans-latin-700-normal.woff2 +0 -0
  19. package/catalog/fonts/open-sans-latin-400-normal.woff2 +0 -0
  20. package/catalog/fonts/open-sans-latin-600-normal.woff2 +0 -0
  21. package/catalog/fonts/open-sans-latin-700-normal.woff2 +0 -0
  22. package/catalog/fonts/open-sans-latin-ext-400-normal.woff2 +0 -0
  23. package/catalog/fonts/open-sans-latin-ext-600-normal.woff2 +0 -0
  24. package/catalog/fonts/open-sans-latin-ext-700-normal.woff2 +0 -0
  25. package/catalog/fonts/space-grotesk-latin-700-normal.woff2 +0 -0
  26. package/catalog/fonts/work-sans-latin-400-normal.woff2 +0 -0
  27. package/catalog/fonts/work-sans-latin-600-normal.woff2 +0 -0
  28. package/catalog/fonts.lock.json +269 -0
  29. package/dist/core/assets/asset-pack.d.ts +65 -0
  30. package/dist/core/assets/asset-pack.d.ts.map +1 -0
  31. package/dist/core/assets/asset-pack.js +159 -0
  32. package/dist/core/assets/asset-pack.js.map +1 -0
  33. package/dist/core/assets/mark.d.ts +10 -0
  34. package/dist/core/assets/mark.d.ts.map +1 -0
  35. package/dist/core/assets/mark.js +24 -0
  36. package/dist/core/assets/mark.js.map +1 -0
  37. package/dist/core/canonical/canonical.d.ts +15 -0
  38. package/dist/core/canonical/canonical.d.ts.map +1 -0
  39. package/dist/core/canonical/canonical.js +58 -0
  40. package/dist/core/canonical/canonical.js.map +1 -0
  41. package/dist/core/canonical/hash.d.ts +5 -0
  42. package/dist/core/canonical/hash.d.ts.map +1 -0
  43. package/dist/core/canonical/hash.js +15 -0
  44. package/dist/core/canonical/hash.js.map +1 -0
  45. package/dist/core/canonical/index.d.ts +4 -0
  46. package/dist/core/canonical/index.d.ts.map +1 -0
  47. package/dist/core/canonical/index.js +4 -0
  48. package/dist/core/canonical/index.js.map +1 -0
  49. package/dist/core/canonical/semver.d.ts +13 -0
  50. package/dist/core/canonical/semver.d.ts.map +1 -0
  51. package/dist/core/canonical/semver.js +64 -0
  52. package/dist/core/canonical/semver.js.map +1 -0
  53. package/dist/core/channels/normalize.d.ts +19 -0
  54. package/dist/core/channels/normalize.d.ts.map +1 -0
  55. package/dist/core/channels/normalize.js +95 -0
  56. package/dist/core/channels/normalize.js.map +1 -0
  57. package/dist/core/channels/registry.d.ts +44 -0
  58. package/dist/core/channels/registry.d.ts.map +1 -0
  59. package/dist/core/channels/registry.js +43 -0
  60. package/dist/core/channels/registry.js.map +1 -0
  61. package/dist/core/channels/rules.d.ts +21 -0
  62. package/dist/core/channels/rules.d.ts.map +1 -0
  63. package/dist/core/channels/rules.js +169 -0
  64. package/dist/core/channels/rules.js.map +1 -0
  65. package/dist/core/color/color.d.ts +29 -0
  66. package/dist/core/color/color.d.ts.map +1 -0
  67. package/dist/core/color/color.js +84 -0
  68. package/dist/core/color/color.js.map +1 -0
  69. package/dist/core/color/index.d.ts +4 -0
  70. package/dist/core/color/index.d.ts.map +1 -0
  71. package/dist/core/color/index.js +4 -0
  72. package/dist/core/color/index.js.map +1 -0
  73. package/dist/core/color/pairs.d.ts +11 -0
  74. package/dist/core/color/pairs.d.ts.map +1 -0
  75. package/dist/core/color/pairs.js +19 -0
  76. package/dist/core/color/pairs.js.map +1 -0
  77. package/dist/core/color/tonal.d.ts +15 -0
  78. package/dist/core/color/tonal.d.ts.map +1 -0
  79. package/dist/core/color/tonal.js +56 -0
  80. package/dist/core/color/tonal.js.map +1 -0
  81. package/dist/core/compile/build.d.ts +20 -0
  82. package/dist/core/compile/build.d.ts.map +1 -0
  83. package/dist/core/compile/build.js +55 -0
  84. package/dist/core/compile/build.js.map +1 -0
  85. package/dist/core/compile/css.d.ts +5 -0
  86. package/dist/core/compile/css.d.ts.map +1 -0
  87. package/dist/core/compile/css.js +76 -0
  88. package/dist/core/compile/css.js.map +1 -0
  89. package/dist/core/compile/design-md.d.ts +8 -0
  90. package/dist/core/compile/design-md.d.ts.map +1 -0
  91. package/dist/core/compile/design-md.js +119 -0
  92. package/dist/core/compile/design-md.js.map +1 -0
  93. package/dist/core/compile/dtcg.d.ts +8 -0
  94. package/dist/core/compile/dtcg.d.ts.map +1 -0
  95. package/dist/core/compile/dtcg.js +77 -0
  96. package/dist/core/compile/dtcg.js.map +1 -0
  97. package/dist/core/compile/fumadocs.d.ts +12 -0
  98. package/dist/core/compile/fumadocs.d.ts.map +1 -0
  99. package/dist/core/compile/fumadocs.js +75 -0
  100. package/dist/core/compile/fumadocs.js.map +1 -0
  101. package/dist/core/compile/index.d.ts +11 -0
  102. package/dist/core/compile/index.d.ts.map +1 -0
  103. package/dist/core/compile/index.js +11 -0
  104. package/dist/core/compile/index.js.map +1 -0
  105. package/dist/core/compile/motion.d.ts +14 -0
  106. package/dist/core/compile/motion.d.ts.map +1 -0
  107. package/dist/core/compile/motion.js +52 -0
  108. package/dist/core/compile/motion.js.map +1 -0
  109. package/dist/core/compile/patterns.d.ts +11 -0
  110. package/dist/core/compile/patterns.d.ts.map +1 -0
  111. package/dist/core/compile/patterns.js +74 -0
  112. package/dist/core/compile/patterns.js.map +1 -0
  113. package/dist/core/compile/shared.d.ts +28 -0
  114. package/dist/core/compile/shared.d.ts.map +1 -0
  115. package/dist/core/compile/shared.js +81 -0
  116. package/dist/core/compile/shared.js.map +1 -0
  117. package/dist/core/compile/site-theme-rules.d.ts +49 -0
  118. package/dist/core/compile/site-theme-rules.d.ts.map +1 -0
  119. package/dist/core/compile/site-theme-rules.js +102 -0
  120. package/dist/core/compile/site-theme-rules.js.map +1 -0
  121. package/dist/core/compile/site-theme-values.d.ts +16 -0
  122. package/dist/core/compile/site-theme-values.d.ts.map +1 -0
  123. package/dist/core/compile/site-theme-values.js +124 -0
  124. package/dist/core/compile/site-theme-values.js.map +1 -0
  125. package/dist/core/compile/site-theme.d.ts +11 -0
  126. package/dist/core/compile/site-theme.d.ts.map +1 -0
  127. package/dist/core/compile/site-theme.js +56 -0
  128. package/dist/core/compile/site-theme.js.map +1 -0
  129. package/dist/core/compile/skill.d.ts +13 -0
  130. package/dist/core/compile/skill.d.ts.map +1 -0
  131. package/dist/core/compile/skill.js +168 -0
  132. package/dist/core/compile/skill.js.map +1 -0
  133. package/dist/core/compile/tailwind.d.ts +8 -0
  134. package/dist/core/compile/tailwind.d.ts.map +1 -0
  135. package/dist/core/compile/tailwind.js +108 -0
  136. package/dist/core/compile/tailwind.js.map +1 -0
  137. package/dist/core/compile/yaml.d.ts +8 -0
  138. package/dist/core/compile/yaml.d.ts.map +1 -0
  139. package/dist/core/compile/yaml.js +16 -0
  140. package/dist/core/compile/yaml.js.map +1 -0
  141. package/dist/core/derive/derive.d.ts +19 -0
  142. package/dist/core/derive/derive.d.ts.map +1 -0
  143. package/dist/core/derive/derive.js +113 -0
  144. package/dist/core/derive/derive.js.map +1 -0
  145. package/dist/core/lint/catalog.d.ts +22 -0
  146. package/dist/core/lint/catalog.d.ts.map +1 -0
  147. package/dist/core/lint/catalog.js +118 -0
  148. package/dist/core/lint/catalog.js.map +1 -0
  149. package/dist/core/lint/css-colour.d.ts +17 -0
  150. package/dist/core/lint/css-colour.d.ts.map +1 -0
  151. package/dist/core/lint/css-colour.js +164 -0
  152. package/dist/core/lint/css-colour.js.map +1 -0
  153. package/dist/core/lint/engine.d.ts +13 -0
  154. package/dist/core/lint/engine.d.ts.map +1 -0
  155. package/dist/core/lint/engine.js +54 -0
  156. package/dist/core/lint/engine.js.map +1 -0
  157. package/dist/core/lint/index.d.ts +5 -0
  158. package/dist/core/lint/index.d.ts.map +1 -0
  159. package/dist/core/lint/index.js +4 -0
  160. package/dist/core/lint/index.js.map +1 -0
  161. package/dist/core/lint/rules/color.d.ts +10 -0
  162. package/dist/core/lint/rules/color.d.ts.map +1 -0
  163. package/dist/core/lint/rules/color.js +152 -0
  164. package/dist/core/lint/rules/color.js.map +1 -0
  165. package/dist/core/lint/rules/misc.d.ts +13 -0
  166. package/dist/core/lint/rules/misc.d.ts.map +1 -0
  167. package/dist/core/lint/rules/misc.js +195 -0
  168. package/dist/core/lint/rules/misc.js.map +1 -0
  169. package/dist/core/lint/rules/pattern.d.ts +9 -0
  170. package/dist/core/lint/rules/pattern.d.ts.map +1 -0
  171. package/dist/core/lint/rules/pattern.js +83 -0
  172. package/dist/core/lint/rules/pattern.js.map +1 -0
  173. package/dist/core/lint/rules/refs.d.ts +5 -0
  174. package/dist/core/lint/rules/refs.d.ts.map +1 -0
  175. package/dist/core/lint/rules/refs.js +74 -0
  176. package/dist/core/lint/rules/refs.js.map +1 -0
  177. package/dist/core/lint/rules/type.d.ts +8 -0
  178. package/dist/core/lint/rules/type.d.ts.map +1 -0
  179. package/dist/core/lint/rules/type.js +128 -0
  180. package/dist/core/lint/rules/type.js.map +1 -0
  181. package/dist/core/lint/svg-safety.d.ts +3 -0
  182. package/dist/core/lint/svg-safety.d.ts.map +1 -0
  183. package/dist/core/lint/svg-safety.js +25 -0
  184. package/dist/core/lint/svg-safety.js.map +1 -0
  185. package/dist/core/lint/types.d.ts +23 -0
  186. package/dist/core/lint/types.d.ts.map +1 -0
  187. package/dist/core/lint/types.js +2 -0
  188. package/dist/core/lint/types.js.map +1 -0
  189. package/dist/core/media/ico.d.ts +9 -0
  190. package/dist/core/media/ico.d.ts.map +1 -0
  191. package/dist/core/media/ico.js +29 -0
  192. package/dist/core/media/ico.js.map +1 -0
  193. package/dist/core/pattern/select.d.ts +9 -0
  194. package/dist/core/pattern/select.d.ts.map +1 -0
  195. package/dist/core/pattern/select.js +32 -0
  196. package/dist/core/pattern/select.js.map +1 -0
  197. package/dist/core/presets/base.dna.json +2058 -0
  198. package/dist/core/presets/presets.d.ts +19 -0
  199. package/dist/core/presets/presets.d.ts.map +1 -0
  200. package/dist/core/presets/presets.js +93 -0
  201. package/dist/core/presets/presets.js.map +1 -0
  202. package/dist/core/presets/specs.d.ts +134 -0
  203. package/dist/core/presets/specs.d.ts.map +1 -0
  204. package/dist/core/presets/specs.js +70 -0
  205. package/dist/core/presets/specs.js.map +1 -0
  206. package/dist/core/release/diff.d.ts +15 -0
  207. package/dist/core/release/diff.d.ts.map +1 -0
  208. package/dist/core/release/diff.js +196 -0
  209. package/dist/core/release/diff.js.map +1 -0
  210. package/dist/core/release/release.d.ts +23 -0
  211. package/dist/core/release/release.d.ts.map +1 -0
  212. package/dist/core/release/release.js +41 -0
  213. package/dist/core/release/release.js.map +1 -0
  214. package/dist/core/site/colours.d.ts +8 -0
  215. package/dist/core/site/colours.d.ts.map +1 -0
  216. package/dist/core/site/colours.js +31 -0
  217. package/dist/core/site/colours.js.map +1 -0
  218. package/dist/core/site/i18n.d.ts +25 -0
  219. package/dist/core/site/i18n.d.ts.map +1 -0
  220. package/dist/core/site/i18n.js +161 -0
  221. package/dist/core/site/i18n.js.map +1 -0
  222. package/dist/core/site/shiki.d.ts +10 -0
  223. package/dist/core/site/shiki.d.ts.map +1 -0
  224. package/dist/core/site/shiki.js +61 -0
  225. package/dist/core/site/shiki.js.map +1 -0
  226. package/dist/core/site/site.d.ts +54 -0
  227. package/dist/core/site/site.d.ts.map +1 -0
  228. package/dist/core/site/site.js +155 -0
  229. package/dist/core/site/site.js.map +1 -0
  230. package/dist/core/skeleton/canvas.d.ts +22 -0
  231. package/dist/core/skeleton/canvas.d.ts.map +1 -0
  232. package/dist/core/skeleton/canvas.js +38 -0
  233. package/dist/core/skeleton/canvas.js.map +1 -0
  234. package/dist/core/skeleton/rules.d.ts +33 -0
  235. package/dist/core/skeleton/rules.d.ts.map +1 -0
  236. package/dist/core/skeleton/rules.js +180 -0
  237. package/dist/core/skeleton/rules.js.map +1 -0
  238. package/dist/core/tokens/resolve.d.ts +37 -0
  239. package/dist/core/tokens/resolve.d.ts.map +1 -0
  240. package/dist/core/tokens/resolve.js +113 -0
  241. package/dist/core/tokens/resolve.js.map +1 -0
  242. package/dist/node/bin.d.ts +3 -0
  243. package/dist/node/bin.d.ts.map +1 -0
  244. package/dist/node/bin.js +9 -0
  245. package/dist/node/bin.js.map +1 -0
  246. package/dist/node/catalog.d.ts +15 -0
  247. package/dist/node/catalog.d.ts.map +1 -0
  248. package/dist/node/catalog.js +38 -0
  249. package/dist/node/catalog.js.map +1 -0
  250. package/dist/node/cli.d.ts +5 -0
  251. package/dist/node/cli.d.ts.map +1 -0
  252. package/dist/node/cli.js +70 -0
  253. package/dist/node/cli.js.map +1 -0
  254. package/dist/node/commands.d.ts +13 -0
  255. package/dist/node/commands.d.ts.map +1 -0
  256. package/dist/node/commands.js +84 -0
  257. package/dist/node/commands.js.map +1 -0
  258. package/dist/node/io.d.ts +11 -0
  259. package/dist/node/io.d.ts.map +1 -0
  260. package/dist/node/io.js +34 -0
  261. package/dist/node/io.js.map +1 -0
  262. package/dist/node/pack.d.ts +13 -0
  263. package/dist/node/pack.d.ts.map +1 -0
  264. package/dist/node/pack.js +40 -0
  265. package/dist/node/pack.js.map +1 -0
  266. package/dist/node/site-check.d.ts +7 -0
  267. package/dist/node/site-check.d.ts.map +1 -0
  268. package/dist/node/site-check.js +39 -0
  269. package/dist/node/site-check.js.map +1 -0
  270. package/dist/node/takumi.d.ts +18 -0
  271. package/dist/node/takumi.d.ts.map +1 -0
  272. package/dist/node/takumi.js +53 -0
  273. package/dist/node/takumi.js.map +1 -0
  274. package/dist/render/compose.d.ts +45 -0
  275. package/dist/render/compose.d.ts.map +1 -0
  276. package/dist/render/compose.js +246 -0
  277. package/dist/render/compose.js.map +1 -0
  278. package/dist/render/fit.d.ts +42 -0
  279. package/dist/render/fit.d.ts.map +1 -0
  280. package/dist/render/fit.js +86 -0
  281. package/dist/render/fit.js.map +1 -0
  282. package/dist/render/pattern.d.ts +16 -0
  283. package/dist/render/pattern.d.ts.map +1 -0
  284. package/dist/render/pattern.js +138 -0
  285. package/dist/render/pattern.js.map +1 -0
  286. package/dist/render/still.d.ts +27 -0
  287. package/dist/render/still.d.ts.map +1 -0
  288. package/dist/render/still.js +2 -0
  289. package/dist/render/still.js.map +1 -0
  290. package/dist/render/svg-symbol.d.ts +7 -0
  291. package/dist/render/svg-symbol.d.ts.map +1 -0
  292. package/dist/render/svg-symbol.js +60 -0
  293. package/dist/render/svg-symbol.js.map +1 -0
  294. package/dist/schema/build-manifest.d.ts +58 -0
  295. package/dist/schema/build-manifest.d.ts.map +1 -0
  296. package/dist/schema/build-manifest.js +37 -0
  297. package/dist/schema/build-manifest.js.map +1 -0
  298. package/dist/schema/channel-spec.d.ts +3045 -0
  299. package/dist/schema/channel-spec.d.ts.map +1 -0
  300. package/dist/schema/channel-spec.js +243 -0
  301. package/dist/schema/channel-spec.js.map +1 -0
  302. package/dist/schema/dna.d.ts +1708 -0
  303. package/dist/schema/dna.d.ts.map +1 -0
  304. package/dist/schema/dna.js +225 -0
  305. package/dist/schema/dna.js.map +1 -0
  306. package/dist/schema/fonts-lock.d.ts +58 -0
  307. package/dist/schema/fonts-lock.d.ts.map +1 -0
  308. package/dist/schema/fonts-lock.js +20 -0
  309. package/dist/schema/fonts-lock.js.map +1 -0
  310. package/dist/schema/gen.d.ts +427 -0
  311. package/dist/schema/gen.d.ts.map +1 -0
  312. package/dist/schema/gen.js +148 -0
  313. package/dist/schema/gen.js.map +1 -0
  314. package/dist/schema/lint-report.d.ts +49 -0
  315. package/dist/schema/lint-report.d.ts.map +1 -0
  316. package/dist/schema/lint-report.js +23 -0
  317. package/dist/schema/lint-report.js.map +1 -0
  318. package/dist/schema/pattern.d.ts +413 -0
  319. package/dist/schema/pattern.d.ts.map +1 -0
  320. package/dist/schema/pattern.js +82 -0
  321. package/dist/schema/pattern.js.map +1 -0
  322. package/dist/schema/release.d.ts +96 -0
  323. package/dist/schema/release.d.ts.map +1 -0
  324. package/dist/schema/release.js +29 -0
  325. package/dist/schema/release.js.map +1 -0
  326. package/dist/schema/skeleton.d.ts +567 -0
  327. package/dist/schema/skeleton.d.ts.map +1 -0
  328. package/dist/schema/skeleton.js +140 -0
  329. package/dist/schema/skeleton.js.map +1 -0
  330. package/dist/schema/tokens.d.ts +1181 -0
  331. package/dist/schema/tokens.d.ts.map +1 -0
  332. package/dist/schema/tokens.js +178 -0
  333. package/dist/schema/tokens.js.map +1 -0
  334. package/package.json +162 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 IKIGAI Ventures BV
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,36 @@
1
- # Temporary Holding Version
1
+ # @lets-ship/brand-dna
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The schema, the lint and the compiler of a brand DNA: one JSON file that holds a brand's identity, colours, type, logos and voice. The compiler turns it into themes, design tokens, an asset pack and a site check.
4
+
5
+ ```sh
6
+ npm install @lets-ship/brand-dna
7
+ ```
8
+
9
+ ## The dna command
10
+
11
+ | Command | What it does |
12
+ | --- | --- |
13
+ | `dna lint <brand.dna.json> [--assets <dir>] [--json]` | Checks the DNA against the schema and the brand rules. |
14
+ | `dna derive <brand.dna.json> [--write]` | Computes the tonal steps and the contrast pairs from the source colours. |
15
+ | `dna hash <brand.dna.json>` | Prints the hash of the canonical DNA. |
16
+ | `dna build <brand.dna.json> --out <dir> [--assets <dir>]` | Writes the themes, the tokens, the logos, the icons and the fonts. |
17
+ | `dna preset <name> --id <id> --name <name> --out <dir>` | Writes a new DNA from a preset: harbor, fern, ember, slate, plum or sand. |
18
+ | `dna site check <out> --dna <brand.dna.json> [--assets <dir>] [--url <origin>]` | Checks a built site: every colour comes from the DNA, the fonts come from the DNA, and every page has a social card. |
19
+
20
+ ## In code
21
+
22
+ The modules under `schema`, `canonical`, `color`, `derive`, `lint`, `compile` and `site` run in a browser, a Worker and Node.js. The modules under `node` (the asset pack, the social card, the bin) need Node.js 20.12 or later.
23
+
24
+ ```ts
25
+ import { lintDna } from "@lets-ship/brand-dna/lint";
26
+
27
+ const report = await lintDna(JSON.parse(source));
28
+ if (report.counts.error > 0) throw new Error(report.findings.map((f) => `${f.path}: ${f.message}`).join("\n"));
29
+ const dna = report.dna;
30
+ ```
31
+
32
+ The same input always gives the same bytes. The compiler reads no clock, no network and no system font.
33
+
34
+ ## License
35
+
36
+ MIT
package/bin/dna.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ // The dna command. A committed file rather than dist/node/bin.js itself: a package manager links
3
+ // a bin when it installs the package, and in a workspace the package is installed before it is
4
+ // built, so a bin inside dist/ would never be linked.
5
+ import "../dist/node/bin.js";
@@ -0,0 +1,269 @@
1
+ {
2
+ "fonts": [
3
+ {
4
+ "family": "Inter",
5
+ "file": "inter-latin-400-normal.woff2",
6
+ "format": "woff2",
7
+ "license": "OFL-1.1",
8
+ "sha256": "sha256:8909904ab6c872eb994093482a88a28eca2cd95912d7b6fecd72103b0dc07edc",
9
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/inter@5.3.0/files/inter-latin-400-normal.woff2",
10
+ "style": "normal",
11
+ "subset": "latin",
12
+ "weight": 400
13
+ },
14
+ {
15
+ "family": "Inter",
16
+ "file": "inter-latin-600-normal.woff2",
17
+ "format": "woff2",
18
+ "license": "OFL-1.1",
19
+ "sha256": "sha256:f9a06e79cd3a2a20951c0f0e28f66dd0e6d3fda73911d640a2125c8fcb78f21a",
20
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/inter@5.3.0/files/inter-latin-600-normal.woff2",
21
+ "style": "normal",
22
+ "subset": "latin",
23
+ "weight": 600
24
+ },
25
+ {
26
+ "family": "Space Grotesk",
27
+ "file": "space-grotesk-latin-700-normal.woff2",
28
+ "format": "woff2",
29
+ "license": "OFL-1.1",
30
+ "sha256": "sha256:35f8aec56cfd5cbfdb03cc68733a54a0b05bb3617ffcd5fd332badc0b045ca55",
31
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/space-grotesk@5.3.0/files/space-grotesk-latin-700-normal.woff2",
32
+ "style": "normal",
33
+ "subset": "latin",
34
+ "weight": 700
35
+ },
36
+ {
37
+ "family": "JetBrains Mono",
38
+ "file": "jetbrains-mono-latin-400-normal.woff2",
39
+ "format": "woff2",
40
+ "license": "OFL-1.1",
41
+ "sha256": "sha256:14425ba9c695763c1547f48a206b7aa60350a33ae23de09f0407877f3fcd89eb",
42
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/jetbrains-mono@5.3.0/files/jetbrains-mono-latin-400-normal.woff2",
43
+ "style": "normal",
44
+ "subset": "latin",
45
+ "weight": 400
46
+ },
47
+ {
48
+ "family": "JetBrains Mono",
49
+ "file": "jetbrains-mono-latin-600-normal.woff2",
50
+ "format": "woff2",
51
+ "license": "OFL-1.1",
52
+ "sha256": "sha256:400c6bfda18d5d14acad1c15d6dcb9f8e13c015e7286317e0b9a482539bef147",
53
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/jetbrains-mono@5.3.0/files/jetbrains-mono-latin-600-normal.woff2",
54
+ "style": "normal",
55
+ "subset": "latin",
56
+ "weight": 600
57
+ },
58
+ {
59
+ "family": "Fraunces",
60
+ "file": "fraunces-latin-600-normal.woff2",
61
+ "format": "woff2",
62
+ "license": "OFL-1.1",
63
+ "sha256": "sha256:3a1de7711d147bad4422825045f87597fd77cca72e7c96d3b0a81735d00dda82",
64
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/fraunces@5.3.0/files/fraunces-latin-600-normal.woff2",
65
+ "style": "normal",
66
+ "subset": "latin",
67
+ "weight": 600
68
+ },
69
+ {
70
+ "family": "Work Sans",
71
+ "file": "work-sans-latin-400-normal.woff2",
72
+ "format": "woff2",
73
+ "license": "OFL-1.1",
74
+ "sha256": "sha256:418b06936717d2e9b6c7a1fb61acb7e2f40030be4b230452f96505230e7b6b41",
75
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/work-sans@5.3.0/files/work-sans-latin-400-normal.woff2",
76
+ "style": "normal",
77
+ "subset": "latin",
78
+ "weight": 400
79
+ },
80
+ {
81
+ "family": "Work Sans",
82
+ "file": "work-sans-latin-600-normal.woff2",
83
+ "format": "woff2",
84
+ "license": "OFL-1.1",
85
+ "sha256": "sha256:c536b548fdcb2734cdc97e0ff0bf26e6719a8b067856d7021971f52ed53a874e",
86
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/work-sans@5.3.0/files/work-sans-latin-600-normal.woff2",
87
+ "style": "normal",
88
+ "subset": "latin",
89
+ "weight": 600
90
+ },
91
+ {
92
+ "family": "IBM Plex Sans",
93
+ "file": "ibm-plex-sans-latin-400-normal.woff2",
94
+ "format": "woff2",
95
+ "license": "OFL-1.1",
96
+ "sha256": "sha256:3b646991d30055a93a4ecc499713d4347953a74a947ecab435ab72070cbdab0e",
97
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/ibm-plex-sans@5.3.0/files/ibm-plex-sans-latin-400-normal.woff2",
98
+ "style": "normal",
99
+ "subset": "latin",
100
+ "weight": 400
101
+ },
102
+ {
103
+ "family": "IBM Plex Sans",
104
+ "file": "ibm-plex-sans-latin-600-normal.woff2",
105
+ "format": "woff2",
106
+ "license": "OFL-1.1",
107
+ "sha256": "sha256:8960851d691c054ed38e259bdcf1a6190d157b4203ed5bb32c632a863fb8ec2f",
108
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/ibm-plex-sans@5.3.0/files/ibm-plex-sans-latin-600-normal.woff2",
109
+ "style": "normal",
110
+ "subset": "latin",
111
+ "weight": 600
112
+ },
113
+ {
114
+ "family": "IBM Plex Sans",
115
+ "file": "ibm-plex-sans-latin-700-normal.woff2",
116
+ "format": "woff2",
117
+ "license": "OFL-1.1",
118
+ "sha256": "sha256:42e7b0c143c19df9d99fd896e76b48f846edf0902d200bc29796b34d12c33aa7",
119
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/ibm-plex-sans@5.3.0/files/ibm-plex-sans-latin-700-normal.woff2",
120
+ "style": "normal",
121
+ "subset": "latin",
122
+ "weight": 700
123
+ },
124
+ {
125
+ "family": "IBM Plex Mono",
126
+ "file": "ibm-plex-mono-latin-400-normal.woff2",
127
+ "format": "woff2",
128
+ "license": "OFL-1.1",
129
+ "sha256": "sha256:08949f728dc52d528e69b1667d15c89a5686a4ee9a296ff90983985f99c380f7",
130
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/ibm-plex-mono@5.3.0/files/ibm-plex-mono-latin-400-normal.woff2",
131
+ "style": "normal",
132
+ "subset": "latin",
133
+ "weight": 400
134
+ },
135
+ {
136
+ "family": "Merriweather",
137
+ "file": "merriweather-latin-300-normal.woff2",
138
+ "format": "woff2",
139
+ "license": "OFL-1.1",
140
+ "sha256": "sha256:812f07132c1c43e195da96f7cfaddeb6843722e8a9c429280e4dc2c492162533",
141
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/merriweather@5.3.0/files/merriweather-latin-300-normal.woff2",
142
+ "style": "normal",
143
+ "subset": "latin",
144
+ "weight": 300
145
+ },
146
+ {
147
+ "family": "Merriweather",
148
+ "file": "merriweather-latin-400-normal.woff2",
149
+ "format": "woff2",
150
+ "license": "OFL-1.1",
151
+ "sha256": "sha256:66f5bd22d738a801a9e58d71920559743b0baaced04be299e3c4feca3dce3556",
152
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/merriweather@5.3.0/files/merriweather-latin-400-normal.woff2",
153
+ "style": "normal",
154
+ "subset": "latin",
155
+ "weight": 400
156
+ },
157
+ {
158
+ "family": "Merriweather",
159
+ "file": "merriweather-latin-700-normal.woff2",
160
+ "format": "woff2",
161
+ "license": "OFL-1.1",
162
+ "sha256": "sha256:4e1ab49396c02be0d9a2a25eed7bc73781c047d85fcb5dfc2889873eaf992b09",
163
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/merriweather@5.3.0/files/merriweather-latin-700-normal.woff2",
164
+ "style": "normal",
165
+ "subset": "latin",
166
+ "weight": 700
167
+ },
168
+ {
169
+ "family": "Merriweather Sans",
170
+ "file": "merriweather-sans-latin-400-normal.woff2",
171
+ "format": "woff2",
172
+ "license": "OFL-1.1",
173
+ "sha256": "sha256:283718899a0070a86c04eae7972abb4df8bf7a7a255fa61f5dfb4b99307ff9a3",
174
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/merriweather-sans@5.3.0/files/merriweather-sans-latin-400-normal.woff2",
175
+ "style": "normal",
176
+ "subset": "latin",
177
+ "weight": 400
178
+ },
179
+ {
180
+ "family": "Merriweather Sans",
181
+ "file": "merriweather-sans-latin-600-normal.woff2",
182
+ "format": "woff2",
183
+ "license": "OFL-1.1",
184
+ "sha256": "sha256:4f0b3ea55ef6c7389d49705c1c5a59146188d5c3851e06872882f1018f0b8b21",
185
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/merriweather-sans@5.3.0/files/merriweather-sans-latin-600-normal.woff2",
186
+ "style": "normal",
187
+ "subset": "latin",
188
+ "weight": 600
189
+ },
190
+ {
191
+ "family": "Merriweather Sans",
192
+ "file": "merriweather-sans-latin-700-normal.woff2",
193
+ "format": "woff2",
194
+ "license": "OFL-1.1",
195
+ "sha256": "sha256:015ba915e162cbaade9ace294e9601f9d7dbd165db4f3a2d400b0240a52cb18c",
196
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/merriweather-sans@5.3.0/files/merriweather-sans-latin-700-normal.woff2",
197
+ "style": "normal",
198
+ "subset": "latin",
199
+ "weight": 700
200
+ },
201
+ {
202
+ "family": "Open Sans",
203
+ "file": "open-sans-latin-400-normal.woff2",
204
+ "format": "woff2",
205
+ "license": "OFL-1.1",
206
+ "sha256": "sha256:0e44026ad31376af1b56593cd4acb4f353f8e8789c51759e18f64578e4ef296a",
207
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/open-sans@5.3.0/files/open-sans-latin-400-normal.woff2",
208
+ "style": "normal",
209
+ "subset": "latin",
210
+ "weight": 400
211
+ },
212
+ {
213
+ "family": "Open Sans",
214
+ "file": "open-sans-latin-600-normal.woff2",
215
+ "format": "woff2",
216
+ "license": "OFL-1.1",
217
+ "sha256": "sha256:a97a6ed7ef9f75c495e9224f5c59b2271d826e4a4345b738b390b0c76cc9f412",
218
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/open-sans@5.3.0/files/open-sans-latin-600-normal.woff2",
219
+ "style": "normal",
220
+ "subset": "latin",
221
+ "weight": 600
222
+ },
223
+ {
224
+ "family": "Open Sans",
225
+ "file": "open-sans-latin-700-normal.woff2",
226
+ "format": "woff2",
227
+ "license": "OFL-1.1",
228
+ "sha256": "sha256:594a622208d1dad5d1dd58aef74f212ce7132d8f0aa5bacea6cfeb86d308c17a",
229
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/open-sans@5.3.0/files/open-sans-latin-700-normal.woff2",
230
+ "style": "normal",
231
+ "subset": "latin",
232
+ "weight": 700
233
+ },
234
+ {
235
+ "family": "Open Sans",
236
+ "file": "open-sans-latin-ext-400-normal.woff2",
237
+ "format": "woff2",
238
+ "license": "OFL-1.1",
239
+ "sha256": "sha256:c260ffc9d1acb022e1037cb8ffc8baa8fe8c44c2ae74429d3231c7ce6d2b7f21",
240
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/open-sans@5.3.0/files/open-sans-latin-ext-400-normal.woff2",
241
+ "style": "normal",
242
+ "subset": "latin-ext",
243
+ "weight": 400
244
+ },
245
+ {
246
+ "family": "Open Sans",
247
+ "file": "open-sans-latin-ext-600-normal.woff2",
248
+ "format": "woff2",
249
+ "license": "OFL-1.1",
250
+ "sha256": "sha256:6dbc7eadcc20f0d1f2dccddd62a5431e66e8f7bd675c3a5147270325fe1555a4",
251
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/open-sans@5.3.0/files/open-sans-latin-ext-600-normal.woff2",
252
+ "style": "normal",
253
+ "subset": "latin-ext",
254
+ "weight": 600
255
+ },
256
+ {
257
+ "family": "Open Sans",
258
+ "file": "open-sans-latin-ext-700-normal.woff2",
259
+ "format": "woff2",
260
+ "license": "OFL-1.1",
261
+ "sha256": "sha256:3f959194168b9c2f90b70f7a2a548d3bac2a4328df65b1656fd848bfdeb7efe7",
262
+ "source": "https://cdn.jsdelivr.net/npm/@fontsource/open-sans@5.3.0/files/open-sans-latin-ext-700-normal.woff2",
263
+ "style": "normal",
264
+ "subset": "latin-ext",
265
+ "weight": 700
266
+ }
267
+ ],
268
+ "version": 1
269
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * The derived asset pack of a DNA build: every logo variant as SVG and PNG, the favicon set and
3
+ * app icons from the smallest symbol variant, and the font files with `fonts.css`. Pure: the
4
+ * requests and static files come out; the caller renders and encodes.
5
+ */
6
+ import type { StillRequest } from "../../render/still.js";
7
+ import type { Dna } from "../../schema/dna.js";
8
+ import type { FontsLockEntry } from "../../schema/fonts-lock.js";
9
+ export type PackFile = {
10
+ path: string;
11
+ content: Uint8Array;
12
+ };
13
+ export type PackRender = {
14
+ path: string;
15
+ req: StillRequest;
16
+ };
17
+ export type Pack = {
18
+ files: PackFile[];
19
+ renders: PackRender[];
20
+ ico: Array<{
21
+ size: number;
22
+ req: StillRequest;
23
+ }>;
24
+ };
25
+ export declare const LOGO_PNG_PX: readonly [512, 1024];
26
+ export declare const ICO_PX: readonly [16, 32, 48];
27
+ /** The variant favicons come from: a derived small mark, else any symbol, else the primary. */
28
+ export declare function iconVariant(dna: Dna): Dna["logo"]["variants"][number];
29
+ /** Fontsource's unicode ranges per subset, so a browser loads each file only for its characters. */
30
+ export declare const UNICODE_RANGE: Record<string, string>;
31
+ /** A DNA names a font file that neither the catalog lock nor the site's brand/assets holds. */
32
+ export declare class FontFileMissingError extends Error {
33
+ readonly family: string;
34
+ readonly blob: string;
35
+ constructor(family: string, blob: string);
36
+ }
37
+ /** A DNA font file whose weight, style or format disagrees with the catalog entry of the same bytes. */
38
+ export declare class FontFaceMismatchError extends Error {
39
+ constructor(family: string, blob: string, detail: string);
40
+ }
41
+ type DnaFontFile = Dna["fonts"][number]["files"][number];
42
+ export type FontFace = {
43
+ family: string;
44
+ weight: number;
45
+ style: string;
46
+ format: DnaFontFile["format"];
47
+ /** A catalog subset, or "all" for a site's own file that carries every character it has. */
48
+ subset: string;
49
+ path: string;
50
+ sha256: string;
51
+ source: "catalog" | "brand";
52
+ };
53
+ /**
54
+ * The @font-face rules and font files of a DNA. Every file comes from the catalog lock or from the
55
+ * site's brand/assets (`brandFonts`, by SHA-256). Any other file is a FontFileMissingError, never a
56
+ * silent omission (SHIP Sites D28).
57
+ */
58
+ export declare function fontsCss(dna: Dna, lock: readonly FontsLockEntry[], brandFonts: ReadonlySet<string>): {
59
+ css: string;
60
+ files: FontFace[];
61
+ };
62
+ export declare function assetPack(dna: Dna, logos: ReadonlyMap<string, Uint8Array>): Pack;
63
+ export declare const textFile: (path: string, content: string) => PackFile;
64
+ export {};
65
+ //# sourceMappingURL=asset-pack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-pack.d.ts","sourceRoot":"","sources":["../../../src/core/assets/asset-pack.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAIjE,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AAC7D,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,YAAY,CAAA;CAAE,CAAC;AAC7D,MAAM,MAAM,IAAI,GAAG;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,GAAG,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,YAAY,CAAA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B;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,EAAE,CAAA;CAAE,CAMpC;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,IAAI,CA0BhF;AAmBD,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,SAAS,MAAM,KAAG,QAGvD,CAAC"}
@@ -0,0 +1,159 @@
1
+ import { roleHex } from "../compile/shared.js";
2
+ import { indexTokens } from "../tokens/resolve.js";
3
+ const enc = new TextEncoder();
4
+ export const LOGO_PNG_PX = [512, 1024];
5
+ export const ICO_PX = [16, 32, 48];
6
+ const APP_ICONS = [
7
+ ["apple-touch-icon.png", 180],
8
+ ["icon-192.png", 192],
9
+ ["icon-512.png", 512],
10
+ ];
11
+ function fitIcon(svg, aspect, box, bg, scale = 1) {
12
+ const [w, h] = aspect >= 1 ? [box * scale, (box * scale) / aspect] : [box * scale * aspect, box * scale];
13
+ return {
14
+ html: `<div style="display:flex;align-items:center;justify-content:center;width:${box}px;height:${box}px${bg ? `;background:${bg}` : ""}"><img src="l.svg" width="${Math.round(w)}" height="${Math.round(h)}" /></div>`,
15
+ width: box,
16
+ height: box,
17
+ format: "png",
18
+ images: [{ src: "l.svg", data: svg }],
19
+ };
20
+ }
21
+ function sized(svg, aspect, short) {
22
+ const [w, h] = aspect >= 1 ? [Math.round(short * aspect), short] : [short, Math.round(short / aspect)];
23
+ return {
24
+ html: `<div style="display:flex;width:${w}px;height:${h}px"><img src="l.svg" width="${w}" height="${h}" /></div>`,
25
+ width: w,
26
+ height: h,
27
+ format: "png",
28
+ images: [{ src: "l.svg", data: svg }],
29
+ };
30
+ }
31
+ /** The variant favicons come from: a derived small mark, else any symbol, else the primary. */
32
+ export function iconVariant(dna) {
33
+ const v = dna.logo.variants;
34
+ const found = v.find((x) => x.layout === "symbol" && x.derivedFrom) ??
35
+ v.find((x) => x.layout === "symbol") ??
36
+ v.find((x) => x.id === "primary") ??
37
+ v[0];
38
+ if (!found)
39
+ throw new Error("logo: the DNA has no logo variant");
40
+ return found;
41
+ }
42
+ /** Fontsource's unicode ranges per subset, so a browser loads each file only for its characters. */
43
+ export const UNICODE_RANGE = {
44
+ latin: "U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",
45
+ "latin-ext": "U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",
46
+ };
47
+ /** A DNA names a font file that neither the catalog lock nor the site's brand/assets holds. */
48
+ export class FontFileMissingError extends Error {
49
+ family;
50
+ blob;
51
+ constructor(family, blob) {
52
+ super(`fonts: ${family} names ${blob}, which is neither in the font catalog nor in brand/assets. Add the file to brand/assets, named by its SHA-256, or pick a catalog font.`);
53
+ this.name = "FontFileMissingError";
54
+ this.family = family;
55
+ this.blob = blob;
56
+ }
57
+ }
58
+ /** A DNA font file whose weight, style or format disagrees with the catalog entry of the same bytes. */
59
+ export class FontFaceMismatchError extends Error {
60
+ constructor(family, blob, detail) {
61
+ super(`fonts: ${family} names ${blob} as ${detail}. Fix the DNA's file entry to match the file.`);
62
+ this.name = "FontFaceMismatchError";
63
+ }
64
+ }
65
+ function catalogFace(family, file, entry) {
66
+ const claims = `${file.weight} ${file.style} ${file.format}`;
67
+ const actual = `${entry.weight} ${entry.style} ${entry.format}`;
68
+ if (claims !== actual)
69
+ throw new FontFaceMismatchError(family, file.blob, `${claims}, but the catalog file is ${actual}`);
70
+ if (!UNICODE_RANGE[entry.subset])
71
+ throw new FontFaceMismatchError(family, file.blob, `subset ${entry.subset}, which has no unicode range`);
72
+ const face = { family, weight: file.weight, style: file.style, format: file.format, sha256: file.blob };
73
+ return { ...face, subset: entry.subset, path: `fonts/${entry.file}`, source: "catalog" };
74
+ }
75
+ function fontFace(family, file, lock, brandFonts) {
76
+ const entry = lock.find((l) => l.sha256 === file.blob);
77
+ if (entry)
78
+ return catalogFace(family, file, entry);
79
+ if (!brandFonts.has(file.blob))
80
+ throw new FontFileMissingError(family, file.blob);
81
+ const path = `fonts/${file.blob.slice(7)}.${file.format}`;
82
+ const face = { family, weight: file.weight, style: file.style, format: file.format, sha256: file.blob };
83
+ return { ...face, subset: "all", path, source: "brand" };
84
+ }
85
+ const CSS_FORMAT = {
86
+ woff2: "woff2",
87
+ woff: "woff",
88
+ ttf: "truetype",
89
+ otf: "opentype",
90
+ };
91
+ /** A family name as a CSS string: quotes, backslashes and line breaks escaped. */
92
+ const cssString = (value) => `"${value
93
+ .replace(/\\/g, "\\\\")
94
+ .replace(/"/g, '\\"')
95
+ .replace(/[\r\n]/g, "\\A ")}"`;
96
+ function faceCss(f) {
97
+ const range = f.subset === "all" ? "" : `\n unicode-range: ${UNICODE_RANGE[f.subset]};`;
98
+ return `@font-face {\n font-family: ${cssString(f.family)};\n font-weight: ${f.weight};\n font-style: ${f.style};\n font-display: swap;\n src: url("./${f.path.slice(6)}") format("${CSS_FORMAT[f.format]}");${range}\n}`;
99
+ }
100
+ /**
101
+ * The @font-face rules and font files of a DNA. Every file comes from the catalog lock or from the
102
+ * site's brand/assets (`brandFonts`, by SHA-256). Any other file is a FontFileMissingError, never a
103
+ * silent omission (SHIP Sites D28).
104
+ */
105
+ export function fontsCss(dna, lock, brandFonts) {
106
+ const files = dna.fonts.flatMap((f) => f.files.map((file) => fontFace(f.family, file, lock, brandFonts)));
107
+ return {
108
+ css: `/* Generated by brand-dna from ${dna.brand.id}@${dna.brand.version}. Do not edit. */\n${files.map(faceCss).join("\n")}\n`,
109
+ files,
110
+ };
111
+ }
112
+ export function assetPack(dna, logos) {
113
+ const index = indexTokens(dna.tokens);
114
+ const files = [];
115
+ const renders = [];
116
+ for (const v of dna.logo.variants) {
117
+ const svg = logos.get(v.svg);
118
+ if (!svg)
119
+ throw new Error(`logo ${v.id}: no bytes for ${v.svg}`);
120
+ files.push({ path: `logo/${v.id}.svg`, content: svg });
121
+ for (const px of LOGO_PNG_PX)
122
+ renders.push({ path: `logo/${v.id}-${px}.png`, req: sized(svg, v.aspect, px) });
123
+ }
124
+ const icon = iconVariant(dna);
125
+ const svg = logos.get(icon.svg);
126
+ if (!svg)
127
+ throw new Error(`logo ${icon.id}: no bytes for ${icon.svg}`);
128
+ const mode = icon.modes?.includes("light") === false ? "dark" : "light";
129
+ const background = icon.allowedOn[0];
130
+ const bg = background ? roleHex(index, dna, background, mode) : undefined;
131
+ // A tab, a bookmark and a site's nav show the favicon on a page-like ground, so a mark the
132
+ // DNA keeps off the surface (a white mark, say) gets the tile the app icons always have.
133
+ const tile = icon.allowedOn.includes("surface") ? undefined : bg;
134
+ files.push({ path: "favicon.svg", content: tile ? tiledSvg(svg, icon.aspect, tile) : svg });
135
+ for (const [path, px] of APP_ICONS)
136
+ renders.push({ path, req: fitIcon(svg, icon.aspect, px, bg, 0.8) });
137
+ return {
138
+ files,
139
+ renders,
140
+ ico: ICO_PX.map((size) => ({ size, req: fitIcon(svg, icon.aspect, size, tile, tile ? 0.8 : 1) })),
141
+ };
142
+ }
143
+ const TILE = 64;
144
+ const base64 = (bytes) => btoa(Array.from(bytes, (byte) => String.fromCharCode(byte)).join(""));
145
+ /** A mark on a square tile of one colour, at the app icons' 80 percent, as one SVG. */
146
+ function tiledSvg(svg, aspect, fill) {
147
+ const box = TILE * 0.8;
148
+ const [w, h] = aspect >= 1 ? [box, box / aspect] : [box * aspect, box];
149
+ const [x, y] = [(TILE - w) / 2, (TILE - h) / 2].map((n) => Math.round(n * 100) / 100);
150
+ const size = `width="${Math.round(w * 100) / 100}" height="${Math.round(h * 100) / 100}"`;
151
+ return enc.encode(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${TILE} ${TILE}" width="${TILE}" height="${TILE}">` +
152
+ `<rect width="${TILE}" height="${TILE}" fill="${fill}"/>` +
153
+ `<image x="${x}" y="${y}" ${size} href="data:image/svg+xml;base64,${base64(svg)}"/></svg>`);
154
+ }
155
+ export const textFile = (path, content) => ({
156
+ path,
157
+ content: enc.encode(content),
158
+ });
159
+ //# sourceMappingURL=asset-pack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-pack.js","sourceRoot":"","sources":["../../../src/core/assets/asset-pack.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAUnD,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;AAC9B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,IAAI,CAAU,CAAC;AAChD,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAU,CAAC;AAC5C,MAAM,SAAS,GAAoC;IAClD,CAAC,sBAAsB,EAAE,GAAG,CAAC;IAC7B,CAAC,cAAc,EAAE,GAAG,CAAC;IACrB,CAAC,cAAc,EAAE,GAAG,CAAC;CACrB,CAAC;AAEF,SAAS,OAAO,CAAC,GAAe,EAAE,MAAc,EAAE,GAAW,EAAE,EAAW,EAAE,KAAK,GAAG,CAAC;IACpF,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,GAAG,MAAM,EAAE,GAAG,GAAG,KAAK,CAAC,CAAC;IACzG,OAAO;QACN,IAAI,EAAE,4EAA4E,GAAG,aAAa,GAAG,KAAK,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