@luhtech/site-template 0.7.0 → 0.8.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.
@@ -0,0 +1,100 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Pulls each real venture's current favicon.svg (its own repo's real,
4
+ * production-serving mark -- not a formally schema-governed asset yet;
5
+ * portfolio/brand-identity.schema.json's logo.requiredVariants only
6
+ * covers the full wordmark, via asset-bank CDN URLs, not this small
7
+ * square glyph) into a consuming site's public/brand/ directory.
8
+ *
9
+ * Built because LuhTech-business's public/brand/*-mark.svg copies had
10
+ * gone stale against 3 of 9 real ventures (Ectropy, JobsiteControl,
11
+ * Viiva each redesigned their own favicon after the last manual copy --
12
+ * JobsiteControl by 4 days, the other two same-day but hours later) --
13
+ * each fix before this was a one-off PR re-copying a single file by
14
+ * hand, which is exactly how it went stale again. This is the repeatable
15
+ * replacement for that manual process.
16
+ *
17
+ * Local dev-time tool only -- reads from sibling repo checkouts on disk
18
+ * (the real venture repos live as siblings under one parent dev
19
+ * directory, e.g. ~/dev/luhtech/<Venture>), so it can't run in CI. Run it
20
+ * by hand when a venture's own favicon changes, or periodically to catch
21
+ * drift, matching this codebase's existing "manual, documented sync"
22
+ * convention (see e.g. business-tools/data/roadmap-cache/cache-manifest.json's
23
+ * syncMethod:"manual" entries) rather than assuming a live cross-repo
24
+ * automation that doesn't exist.
25
+ *
26
+ * Usage:
27
+ * luhtech-sync-marks <output-dir> [--dev-root <path>] [--dry-run]
28
+ * luhtech-sync-marks public/brand
29
+ * luhtech-sync-marks public/brand --dev-root ~/dev/luhtech --dry-run
30
+ */
31
+ import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'node:fs';
32
+ import { dirname, resolve, join } from 'node:path';
33
+ import { homedir } from 'node:os';
34
+
35
+ // Real repo directory name + real favicon path within it, per venture --
36
+ // the two differ from the venture id (repo casing, Replique's nested
37
+ // site/ dir) so this can't be derived mechanically from the id alone.
38
+ const VENTURES = [
39
+ { id: 'ectropy', repo: 'Ectropy-Business', favicon: 'apps/marketing-site/public/favicon.svg' },
40
+ { id: 'qullqa', repo: 'Qullqa', favicon: 'public/favicon.svg' },
41
+ { id: 'siltana', repo: 'Siltana-Business', favicon: 'public/favicon.svg' },
42
+ { id: 'jobsitecontrol', repo: 'JobsiteControl', favicon: 'public/favicon.svg' },
43
+ { id: 'viiva', repo: 'Viiva', favicon: 'public/favicon.svg' },
44
+ { id: 'ohjaus', repo: 'Ohjaus', favicon: 'public/favicon.svg' },
45
+ { id: 'raizal', repo: 'Raizal', favicon: 'public/favicon.svg' },
46
+ { id: 'replique', repo: 'Replique', favicon: 'site/public/favicon.svg' },
47
+ { id: 'hilja', repo: 'Hilja', favicon: 'public/favicon.svg' },
48
+ ];
49
+
50
+ const args = process.argv.slice(2);
51
+ const outputArg = args.find((a) => !a.startsWith('--'));
52
+ const devRootFlagIdx = args.indexOf('--dev-root');
53
+ const devRoot = devRootFlagIdx >= 0 ? args[devRootFlagIdx + 1] : join(homedir(), 'dev', 'luhtech');
54
+ const dryRun = args.includes('--dry-run');
55
+
56
+ if (!outputArg) {
57
+ console.error('Usage: luhtech-sync-marks <output-dir> [--dev-root <path>] [--dry-run]');
58
+ process.exit(1);
59
+ }
60
+ const outputDir = resolve(process.cwd(), outputArg);
61
+
62
+ function main() {
63
+ mkdirSync(outputDir, { recursive: true });
64
+ let changed = 0;
65
+ let unchanged = 0;
66
+ let missing = 0;
67
+
68
+ for (const v of VENTURES) {
69
+ const srcPath = join(devRoot, v.repo, v.favicon);
70
+ const destPath = join(outputDir, `${v.id}-mark.svg`);
71
+
72
+ if (!existsSync(srcPath)) {
73
+ console.warn(` ! ${v.id}: no favicon at ${srcPath} -- skipped`);
74
+ missing++;
75
+ continue;
76
+ }
77
+
78
+ const src = readFileSync(srcPath, 'utf-8');
79
+ const existing = existsSync(destPath) ? readFileSync(destPath, 'utf-8') : null;
80
+
81
+ if (existing === src) {
82
+ unchanged++;
83
+ continue;
84
+ }
85
+
86
+ console.log(` ${existing === null ? '+' : '~'} ${v.id}: ${srcPath} -> ${destPath}`);
87
+ if (!dryRun) {
88
+ mkdirSync(dirname(destPath), { recursive: true });
89
+ writeFileSync(destPath, src, 'utf-8');
90
+ }
91
+ changed++;
92
+ }
93
+
94
+ console.log(
95
+ `\n${dryRun ? '[dry run] ' : ''}${changed} updated, ${unchanged} already current, ${missing} source missing.`
96
+ );
97
+ if (missing > 0) process.exitCode = 1;
98
+ }
99
+
100
+ main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luhtech/site-template",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Shared Astro component library + content-instance contract for LuhTech venture marketing sites -- one template renders every site from content/page.schema.json + content/site.schema.json instances.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -26,7 +26,8 @@
26
26
  "bin": {
27
27
  "luhtech-tokens": "./bin/luhtech-tokens.mjs",
28
28
  "luhtech-page-lexicon": "./bin/luhtech-page-lexicon.mjs",
29
- "luhtech-page-claims": "./bin/luhtech-page-claims.mjs"
29
+ "luhtech-page-claims": "./bin/luhtech-page-claims.mjs",
30
+ "luhtech-sync-marks": "./bin/luhtech-sync-marks.mjs"
30
31
  },
31
32
  "scripts": {
32
33
  "test": "node --experimental-strip-types --test test/*.test.mjs"
@@ -4,6 +4,16 @@
4
4
  // exempts crossLinks from the bare-sibling-name check for exactly this
5
5
  // reason: the relationshipLine is authored text stating the real
6
6
  // relationship, not an incidental mention).
7
+ //
8
+ // Mark image (2026-09-11): a consuming site may keep the referenced
9
+ // sibling's real mark at /brand/{brandRef}-mark.svg (the convention every
10
+ // site's own public/brand/ already follows for its own wordmark) -- shown
11
+ // when present. Not every consuming site carries every sibling's mark
12
+ // (e.g. ectropy.ai's own about.json cross-links to "luhtech" but has no
13
+ // luhtech-mark.svg locally, by design -- only the holding-company site
14
+ // needs every sibling's mark), so a missing file must fail silently
15
+ // (onerror hides the broken-image icon) rather than assuming the asset
16
+ // exists everywhere this shared component is used.
7
17
  export interface Props {
8
18
  crossLink: { brandRef: string; relationshipLine: string; href: string };
9
19
  }
@@ -13,6 +23,13 @@ const { crossLink } = Astro.props;
13
23
  href={crossLink.href}
14
24
  class="block rounded-md border border-ink/15 p-4 hover:border-accent-primary transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-primary"
15
25
  >
26
+ <img
27
+ src={`/brand/${crossLink.brandRef}-mark.svg`}
28
+ alt=""
29
+ class="h-6 w-6 mb-2"
30
+ loading="lazy"
31
+ onerror="this.style.display='none'"
32
+ />
16
33
  <span class="font-display font-semibold">{crossLink.brandRef}</span>
17
34
  <p class="text-sm text-ink/70 mt-1">{crossLink.relationshipLine}</p>
18
35
  </a>