@uniweb/build 1.10.12 → 1.10.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/build",
3
- "version": "1.10.12",
3
+ "version": "1.10.13",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
@@ -57,11 +57,11 @@
57
57
  "sharp": "^0.35.5",
58
58
  "yaml": "^2.5.0",
59
59
  "@uniweb/content-reader": "~1.5.7",
60
+ "@uniweb/content-writer": "~1.3.1",
61
+ "@uniweb/projections": "~1.2.7",
60
62
  "@uniweb/schemas": "~1.6.5",
61
- "@uniweb/theming": "~1.2.1",
62
63
  "@uniweb/semantic-parser": "~1.13.0",
63
- "@uniweb/projections": "~1.2.6",
64
- "@uniweb/content-writer": "~1.3.1"
64
+ "@uniweb/theming": "~1.2.1"
65
65
  },
66
66
  "optionalDependencies": {
67
67
  "@uniweb/runtime": "~1.2.12"
package/src/images.js CHANGED
@@ -56,6 +56,23 @@ export async function readImageSize(imagePath) {
56
56
  }
57
57
  }
58
58
 
59
+ /**
60
+ * Whether every pixel of an image is opaque — an alpha channel alone does not say, since most
61
+ * PNGs carry one whether they use it or not — or null when sharp cannot read the file. It decodes
62
+ * the whole image, so it is for a small one: `uniweb doctor` asks it of a site's touch icon,
63
+ * whose transparent pixels iOS draws black.
64
+ *
65
+ * @param {string} imagePath
66
+ * @returns {Promise<boolean|null>}
67
+ */
68
+ export async function isImageOpaque(imagePath) {
69
+ try {
70
+ return (await sharp(imagePath).stats()).isOpaque
71
+ } catch {
72
+ return null
73
+ }
74
+ }
75
+
59
76
  /**
60
77
  * Convert an image to webp format
61
78
  */
@@ -89,7 +89,10 @@
89
89
  "seo": [
90
90
  "site.yml::seo"
91
91
  ],
92
- "theme": null
92
+ "theme": null,
93
+ "touch_icon": [
94
+ "site.yml::touchIcon"
95
+ ]
93
96
  }
94
97
  },
95
98
  "services": {
@@ -192,6 +192,9 @@ const SETTINGS_TO_SITE_YML = {
192
192
  // offered through `config.services` and resolved at render, never entering the
193
193
  // stored record, so a pull cannot launder it into authored config.
194
194
  agents: 'agents',
195
+ // The touch icon, verbatim: the path the author wrote, which `restoreAssetRefs` has already put
196
+ // back from the serve URL the push recorded (asset-map.js), else a URL.
197
+ touch_icon: 'touchIcon',
195
198
  }
196
199
 
197
200
 
package/src/uwx/site.js CHANGED
@@ -1356,6 +1356,12 @@ function settingsNested(siteYml, { headHtml, themeYml, sourceLocale, translation
1356
1356
  // carries the translation collector with it.
1357
1357
  setIf(settings, 'keywords', plainTextTargets(localizeScalarList(siteYml.keywords, sourceLocale, translations), sourceLocale))
1358
1358
 
1359
+ // ⭐ The touch icon — `site.yml::touchIcon`, the PNG iOS puts on a home screen — where the
1360
+ // deployment's `settings` takes it (`touchIconValue`). A site path is media to the upload walk
1361
+ // (`sync-package.js::walkEntityAssets`), so it goes up with the site's other files and is sent
1362
+ // as its serve URL, which a pull puts back as the path (`asset-map.js::restoreAssetRefs`).
1363
+ setIf(settings, 'touch_icon', touchIconValue(siteYml.touchIcon, settingsFields))
1364
+
1359
1365
  // ⛔ NO SERVICE IS HERE. A service's address and options ride its row in the
1360
1366
  // `services` Section, whole (`requestedServices`) [Diego, 2026-10-06: "If it's on and
1361
1367
  // has configuration, it can all be in the same place"]. *Until that evening
@@ -1390,6 +1396,21 @@ function settingsNested(siteYml, { headHtml, themeYml, sourceLocale, translation
1390
1396
  return Object.keys(settings).length > 0 ? settings : undefined
1391
1397
  }
1392
1398
 
1399
+ /**
1400
+ * `site.yml::touchIcon` as a push sends it: only to a deployment whose `settings` declares
1401
+ * `touch_icon`, since one that does not refuses a push carrying it (`deploymentFields`). Such a
1402
+ * site is told; with no list in hand, nothing optional is sent.
1403
+ */
1404
+ function touchIconValue(named, settingsFields) {
1405
+ if (typeof named !== 'string' || !named.trim() || !Array.isArray(settingsFields)) return undefined
1406
+ if (settingsFields.includes('touch_icon')) return named
1407
+ console.warn(
1408
+ "uwx/site: `touchIcon:` is not sent — this backend's site settings take no touch icon, so " +
1409
+ 'the pages it serves link none.'
1410
+ )
1411
+ return undefined
1412
+ }
1413
+
1393
1414
  /**
1394
1415
  * Map a file site project to the nested `@uniweb/site-content` `$`-document
1395
1416
  * (see the lane header above). PURE — reads the project, never mints, never writes.