@techninja/clearstack 0.3.44 → 0.3.45

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.
@@ -53,10 +53,12 @@ export function loadTokens(projectDir) {
53
53
  const full = resolve(projectDir, p);
54
54
  if (!existsSync(full)) continue;
55
55
  const css = readFileSync(full, 'utf-8');
56
+ /** @type {Record<string, string>} */
56
57
  const vars = {};
57
58
  for (const m of css.matchAll(/--([^:]+):\s*([^;]+)/g)) vars[m[1].trim()] = m[2].trim();
58
59
  if (Object.keys(vars).length) return vars;
59
60
  }
61
+ /** @type {Record<string, string>} */
60
62
  return {};
61
63
  }
62
64
 
@@ -67,15 +69,15 @@ export function loadTokens(projectDir) {
67
69
  * @param {{ tokens?: Record<string, string>, logo?: string, siteName?: string }} site
68
70
  */
69
71
  export function buildContext(config, itemData, site) {
70
- const t = site.tokens || {};
72
+ const t = /** @type {Record<string, string>} */ (site.tokens || {});
71
73
  const title = interpolate(config.title, itemData);
72
74
  const desc = config.description ? interpolate(config.description, itemData) : '';
73
75
  const image = config.image ? interpolate(config.image, itemData) : '';
74
76
  const baseUrl = itemData.store?.url || '';
75
77
  const resolvedImage = image && !image.startsWith('http') ? `${baseUrl}${image}` : image;
76
- const item = itemData.item || {};
77
- const emoji = item.emoji || itemData.emoji || '';
78
- const tags = item.tags || itemData.tags || [];
78
+ const item = /** @type {Record<string, unknown>} */ (itemData.item || {});
79
+ const emoji = /** @type {string} */ (item.emoji || itemData.emoji || '');
80
+ const tags = /** @type {string[]} */ (item.tags || itemData.tags || []);
79
81
  const tagsHtml = tags.map((t) => `<div class="tag">#${t}</div>`).join('');
80
82
  const postTitle = item.title || item.caption || item.name || '';
81
83
  const logoSrc = item.logo?.wordmark || item.logo?.mark || '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techninja/clearstack",
3
- "version": "0.3.44",
3
+ "version": "0.3.45",
4
4
  "type": "module",
5
5
  "description": "A no-build web component framework specification — scaffold, validate, and evolve spec-compliant projects",
6
6
  "bin": {