Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

fix(brand): use the Akeru icon in development (#147)

Leo50ede552cf95
diff --git a/apps/desktop/scripts/electron-launcher.mjs b/apps/desktop/scripts/electron-launcher.mjs
index 405bbc50b..7e1564095 100644
--- a/apps/desktop/scripts/electron-launcher.mjs
+++ b/apps/desktop/scripts/electron-launcher.mjs
@@ -21,12 +21,6 @@ export const APP_BUNDLE_ID = isDevelopment
: "dev.leodoes.akeru";
const APP_PROTOCOL_SCHEMES = isDevelopment ? ["akeru-dev", "t3code-dev"] : ["akeru", "t3code"];
const LAUNCHER_VERSION = 15;
-const developmentMacIconPngPath = NodePath.join(
- repoRoot,
- "assets",
- "dev",
- "blueprint-macos-1024.png",
-);
const productionMacIconPngPath = NodePath.join(repoRoot, "assets", "prod", "akeru-macos-1024.png");
// oxlint-disable-next-line t3code/no-global-process-runtime -- Standalone launcher script has no Effect runtime.
const hostPlatform = NodeOS.platform();
@@ -167,8 +161,11 @@ function registerMacLauncherBundle(appBundlePath) {
export function resolveMacLauncherIconPaths(runtimeDir, development = isDevelopment) {
return {
- sourceIconPath: development ? developmentMacIconPngPath : productionMacIconPngPath,
- generatedIconPath: NodePath.join(runtimeDir, development ? "icon-dev.icns" : "icon-prod.icns"),
+ sourceIconPath: productionMacIconPngPath,
+ generatedIconPath: NodePath.join(
+ runtimeDir,
+ development ? "icon-akeru-dev.icns" : "icon-prod.icns",
+ ),
};
}
diff --git a/apps/desktop/scripts/electron-launcher.test.mjs b/apps/desktop/scripts/electron-launcher.test.mjs
index 67581c9b7..dbd0f8512 100644
--- a/apps/desktop/scripts/electron-launcher.test.mjs
+++ b/apps/desktop/scripts/electron-launcher.test.mjs
@@ -89,8 +89,8 @@ describe("electron development launcher", () => {
const development = resolveMacLauncherIconPaths("/runtime", true);
const production = resolveMacLauncherIconPaths("/runtime", false);
- assert.match(development.sourceIconPath, /assets\/dev\/blueprint-macos-1024\.png$/);
- assert.equal(development.generatedIconPath, "/runtime/icon-dev.icns");
+ assert.match(development.sourceIconPath, /assets\/prod\/akeru-macos-1024\.png$/);
+ assert.equal(development.generatedIconPath, "/runtime/icon-akeru-dev.icns");
assert.match(production.sourceIconPath, /assets\/prod\/akeru-macos-1024\.png$/);
assert.equal(production.generatedIconPath, "/runtime/icon-prod.icns");
});
diff --git a/apps/desktop/src/app/DesktopAssets.test.ts b/apps/desktop/src/app/DesktopAssets.test.ts
index 26fa35c2c..983e1714b 100644
--- a/apps/desktop/src/app/DesktopAssets.test.ts
+++ b/apps/desktop/src/app/DesktopAssets.test.ts
@@ -44,7 +44,11 @@ describe("DesktopAssets", () => {
),
);
const fileSystemLayer = FileSystem.layerNoop({
- exists: (path) => Effect.succeed(String(path).includes("/assets/dev/")),
+ exists: (path) =>
+ Effect.succeed(
+ String(path).includes("/apps/web/public/") ||
+ String(path).includes("/apps/marketing/public/"),
+ ),
});
const assets = yield* DesktopAssets.DesktopAssets.pipe(
Effect.provide(
@@ -56,8 +60,8 @@ describe("DesktopAssets", () => {
const icons = yield* assets.iconPaths;
- assert.match(Option.getOrThrow(icons.ico), /assets\/dev\/blueprint-windows\.ico$/);
- assert.match(Option.getOrThrow(icons.png), /assets\/dev\/blueprint-universal-1024\.png$/);
+ assert.match(Option.getOrThrow(icons.ico), /apps\/web\/public\/favicon\.ico$/);
+ assert.match(Option.getOrThrow(icons.png), /apps\/marketing\/public\/icon\.png$/);
assert.isTrue(Option.isNone(icons.icns));
}),
);
diff --git a/apps/desktop/src/app/DesktopAssets.ts b/apps/desktop/src/app/DesktopAssets.ts
index 36b0c6bde..11d36df9b 100644
--- a/apps/desktop/src/app/DesktopAssets.ts
+++ b/apps/desktop/src/app/DesktopAssets.ts
@@ -63,9 +63,9 @@ const resolveResourcePath = Effect.fn("desktop.assets.resolveResourcePath")(func
const sourceTreeIconPaths = {
dev: {
- ico: ["assets", "dev", "blueprint-windows.ico"],
- macPng: ["assets", "dev", "blueprint-macos-1024.png"],
- universalPng: ["assets", "dev", "blueprint-universal-1024.png"],
+ ico: ["apps", "web", "public", "favicon.ico"],
+ macPng: ["assets", "prod", "akeru-macos-1024.png"],
+ universalPng: ["apps", "marketing", "public", "icon.png"],
},
prod: {
ico: ["apps", "web", "public", "favicon.ico"],
diff --git a/apps/mobile/app.config.ts b/apps/mobile/app.config.ts
index bc16e5341..81863da63 100644
--- a/apps/mobile/app.config.ts
+++ b/apps/mobile/app.config.ts
@@ -46,14 +46,14 @@ if (expoOwner && !EXPO_OWNER_PATTERN.test(expoOwner)) {
}
const DEVELOPMENT_ASSETS = {
- appIcon: fromRepoRoot(BRAND_ASSET_PATHS.developmentIosIconPng),
- iosIcon: fromRepoRoot(BRAND_ASSET_PATHS.developmentIconComposerProject),
- splashIcon: fromRepoRoot(BRAND_ASSET_PATHS.developmentIosIconPng),
- androidAdaptiveForeground: fromRepoRoot(BRAND_ASSET_PATHS.developmentUniversalIconPng),
- androidAdaptiveBackgroundColor: "#00639B",
- androidMonochromeIcon: "./assets/android-dev-monochrome.png",
- androidNotificationIcon: "./assets/android-dev-monochrome.png",
- androidNotificationColor: "#00639B",
+ appIcon: fromRepoRoot(BRAND_ASSET_PATHS.productionIosIconPng),
+ iosIcon: fromRepoRoot(BRAND_ASSET_PATHS.productionIosIconPng),
+ splashIcon: fromRepoRoot(BRAND_ASSET_PATHS.productionIosIconPng),
+ androidAdaptiveForeground: fromRepoRoot(BRAND_ASSET_PATHS.productionIosIconPng),
+ androidAdaptiveBackgroundColor: "#F4F1EA",
+ androidMonochromeIcon: "./assets/android-akeru-monochrome.png",
+ androidNotificationIcon: "./assets/android-akeru-monochrome.png",
+ androidNotificationColor: "#F4F1EA",
} as const;
const RELEASE_ASSETS = {
diff --git a/apps/mobile/assets/android-dev-monochrome.png b/apps/mobile/assets/android-dev-monochrome.png
deleted file mode 100644
index 12c1405b5..000000000
Binary files a/apps/mobile/assets/android-dev-monochrome.png and /dev/null differ
diff --git a/apps/mobile/plugins/withWidgetLogoAsset.cjs b/apps/mobile/plugins/withWidgetLogoAsset.cjs
index fa6bebce4..6a6644644 100644
--- a/apps/mobile/plugins/withWidgetLogoAsset.cjs
+++ b/apps/mobile/plugins/withWidgetLogoAsset.cjs
@@ -40,17 +40,7 @@ function withAssetFiles(config) {
return withDangerousMod(config, [
"ios",
(cfg) => {
- const source =
- process.env.APP_VARIANT === "development"
- ? path.join(
- cfg.modRequest.projectRoot,
- "..",
- "..",
- "assets",
- "dev",
- "blueprint-ios-1024.png",
- )
- : path.join(cfg.modRequest.projectRoot, "..", "marketing", "public", "icon.png");
+ const source = path.join(cfg.modRequest.projectRoot, "..", "marketing", "public", "icon.png");
const catalogDir = path.join(cfg.modRequest.platformProjectRoot, TARGET_NAME, CATALOG_NAME);
const imageSetDir = path.join(catalogDir, IMAGE_SET);
fs.mkdirSync(imageSetDir, { recursive: true });
diff --git a/apps/mobile/src/components/BrandIcon.tsx b/apps/mobile/src/components/BrandIcon.tsx
index db34214cc..701ef1acd 100644
--- a/apps/mobile/src/components/BrandIcon.tsx
+++ b/apps/mobile/src/components/BrandIcon.tsx
@@ -1,10 +1,6 @@
-import Constants from "expo-constants";
import { Image } from "expo-image";
-const source =
- Constants.expoConfig?.extra?.appVariant === "development"
- ? require("../../../../assets/dev/blueprint-ios-1024.png")
- : require("../../../marketing/public/icon.png");
+const source = require("../../../marketing/public/icon.png");
export function BrandIcon(props: { readonly borderRadius: number; readonly size: number }) {
return (
diff --git a/assets/README.md b/assets/README.md
index ac9d19ee2..9db20d69b 100644
--- a/assets/README.md
+++ b/assets/README.md
@@ -1,46 +1,7 @@
# Brand icons
-The development Icon Composer project is the source of truth for development application icons:
+Akeru Bot uses one icon in development and production.
-- `dev/app-icon.icon`
-
-Production apps use `apps/marketing/public/icon.png`. Windows uses the matching
-`apps/web/public/favicon.ico`. These are the Akeru favicon artwork.
-
-The project uses `text.svg` for the development mark and `background.svg` when the background is a vector layer. Additional layers use semantic names that describe their role and placement.
-
-Run `vp run icons:export` from the repository root to regenerate the tracked development iOS, Linux, and Windows assets. Run `vp run icons:check` to verify that the generated assets match their source without changing files.
-
-Exporting requires Icon Composer 2 or newer on macOS. The script selects the newest compatible exporter from Xcode or a standalone Icon Composer installation and pins design generation 26. Set `ICON_COMPOSER_TOOL` to the full path of `Icon Composer.app/Contents/Executables/ictool` to override automatic discovery.
-
-## macOS exports
-
-Icon Composer's command-line exporter does not expose the `macOS pre-Tahoe` preset. A plain command-line `macOS` export is full bleed and is not suitable for the desktop app, so the export script intentionally leaves the tracked macOS PNGs unchanged and prints a reminder after every run.
-
-After changing an Icon Composer project, open it in Icon Composer and export the macOS PNG with exactly these settings:
-
-- Platform: `macOS pre-Tahoe`
-- Appearance: `Default`
-- Size: `1024pt`
-- Scale: `1×`
-
-Save the export to:
-
-- `dev/app-icon.icon` -> `dev/blueprint-macos-1024.png`
-
-The result must be a 1024×1024 PNG with the classic macOS safe area: the opaque icon body is 824×824, inset 100 pixels on every side, with only the native Icon Composer shadow extending into the surrounding transparent canvas.
-
-To have Codex perform the native exports, paste this prompt into a task opened at the repository root:
-
-```text
-Use [@Computer](plugin://computer-use@openai-bundled) and the Icon Composer app to export the development macOS app icon in this repository.
-
-For each project below, use Platform: macOS pre-Tahoe, Appearance: Default, Size: 1024pt, and Scale: 1×, then save the PNG to the exact destination:
-
-- assets/dev/app-icon.icon -> assets/dev/blueprint-macos-1024.png
-Do not resize, composite, or otherwise post-process the exported PNGs.
-
-Verify every result is 1024×1024 and has the classic macOS safe area: an 824×824 opaque body inset 100px on every side, with only Icon Composer's native shadow extending beyond it.
-```
-
-Do not edit the generated PNG or ICO files directly.
+- macOS: `prod/akeru-macos-1024.png`
+- iOS, Android, and Linux: `apps/marketing/public/icon.png`
+- Windows and web: `apps/web/public/favicon.ico`
diff --git a/assets/dev/app-icon.icon/Assets/annotations.svg b/assets/dev/app-icon.icon/Assets/annotations.svg
deleted file mode 100644
index dffde3355..000000000
--- a/assets/dev/app-icon.icon/Assets/annotations.svg
+++ /dev/null
@@ -1,37 +0,0 @@
-<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
- <defs>
- <marker id="arrowStart" markerWidth="5" markerHeight="5" refX="1.2" refY="2.5" orient="auto" markerUnits="strokeWidth">
- <path d="M4.5 0.6L1 2.5L4.5 4.4" fill="none" stroke="#DDF7FF" stroke-width="0.8" stroke-linecap="round"/>
- </marker>
- <marker id="arrowEnd" markerWidth="5" markerHeight="5" refX="3.8" refY="2.5" orient="auto" markerUnits="strokeWidth">
- <path d="M0.5 0.6L4 2.5L0.5 4.4" fill="none" stroke="#DDF7FF" stroke-width="0.8" stroke-linecap="round"/>
- </marker>
- </defs>
-
- <g stroke="#DDF7FF" stroke-linecap="round" stroke-linejoin="round">
- <g opacity="0.9" stroke-width="0.44">
- <path d="M15.5309 31V25.6M64.3309 31V25.6M68.1653 31V25.6M107.365 31V25.6"/>
- <path d="M16.9 27.2H62.96" marker-start="url(#arrowStart)" marker-end="url(#arrowEnd)"/>
- <path d="M69.54 27.2H105.99" marker-start="url(#arrowStart)" marker-end="url(#arrowEnd)"/>
- <path d="M33.4509 97.3V103M46.4109 97.3V103M65.3653 97.3V103M109.925 97.3V103"/>
- <path d="M34.82 101.1H45.04" marker-start="url(#arrowStart)" marker-end="url(#arrowEnd)"/>
- <path d="M66.74 101.1H108.55" marker-start="url(#arrowStart)" marker-end="url(#arrowEnd)"/>
- <path d="M10.2 37H6.1M10.2 47.6H6.1M10.2 93H6.1"/>
- <path d="M7.9 38.4V46.2" marker-start="url(#arrowStart)" marker-end="url(#arrowEnd)"/>
- <path d="M7.9 49V91.6" marker-start="url(#arrowStart)" marker-end="url(#arrowEnd)"/>
- </g>
-
- <g opacity="0.58" stroke-width="0.34">
- <path d="M12.5 35.1H66.8M39.9309 94.8V44.5M64.3309 34.2V49.9M68.1653 34.2V49.9" stroke-dasharray="1.6 1.6"/>
- <path d="M65.3653 65.2H109.925M87.2 32.7V98.2" stroke-dasharray="1.2 2"/>
- <circle cx="87.2" cy="65.2" r="20.8"/>
- <circle cx="87.2" cy="65.2" r="1.1"/>
- </g>
-
- <g opacity="0.76" stroke-width="0.4">
- <path d="M24 20V24M22 22H26M101 17V21M99 19H103M114 106V110M112 108H116"/>
- <path d="M54 107L57 110M57 107L54 110M16 74L19 77M19 74L16 77"/>
- <path d="M74 22H82M78 18V26" stroke-dasharray="0.7 1.1"/>
- </g>
- </g>
-</svg>
diff --git a/assets/dev/app-icon.icon/Assets/background.svg b/assets/dev/app-icon.icon/Assets/background.svg
deleted file mode 100644
index db5c319d6..000000000
--- a/assets/dev/app-icon.icon/Assets/background.svg
+++ /dev/null
@@ -1,51 +0,0 @@
-<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
- <defs>
- <linearGradient id="paper" x1="36" y1="0" x2="92" y2="128" gradientUnits="userSpaceOnUse">
- <stop stop-color="#67C2FF"/>
- <stop offset="0.44" stop-color="#347FF8"/>
- <stop offset="1" stop-color="#1538D0"/>
- </linearGradient>
- <radialGradient id="cyanGlow" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(92 22) rotate(137) scale(78 70)">
- <stop stop-color="#D4F6FF" stop-opacity="0.62"/>
- <stop offset="0.52" stop-color="#65C8FF" stop-opacity="0.24"/>
- <stop offset="1" stop-color="#276AF1" stop-opacity="0"/>
- </radialGradient>
- <radialGradient id="edgeShade" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(64 58) rotate(90) scale(77)">
- <stop offset="0.68" stop-color="#102EBC" stop-opacity="0"/>
- <stop offset="1" stop-color="#061A88" stop-opacity="0.48"/>
- </radialGradient>
- <pattern id="minorGrid" width="4" height="4" patternUnits="userSpaceOnUse">
- <path d="M4 0H0V4" stroke="#D9F7FF" stroke-width="0.18" opacity="0.38"/>
- </pattern>
- <pattern id="majorGrid" width="16" height="16" patternUnits="userSpaceOnUse">
- <rect width="16" height="16" fill="url(#minorGrid)"/>
- <path d="M16 0H0V16" stroke="#F0FCFF" stroke-width="0.34" opacity="0.52"/>
- </pattern>
- <clipPath id="frame">
- <rect width="128" height="128" rx="10"/>
- </clipPath>
- </defs>
-
- <g clip-path="url(#frame)">
- <rect width="128" height="128" fill="url(#paper)"/>
- <rect width="128" height="128" fill="url(#cyanGlow)"/>
- <rect x="4" y="4" width="120" height="120" fill="url(#majorGrid)" opacity="0.96"/>
- <path d="M64 4V124M4 64H124" stroke="#F0FCFF" stroke-width="0.3" opacity="0.46"/>
- <rect x="5.75" y="5.75" width="116.5" height="116.5" rx="5.5" stroke="#F1FCFF" stroke-width="0.5" opacity="0.66"/>
-
- <g stroke="#BFE9F7" stroke-linecap="round" opacity="0.2">
- <path d="M14 19L24 12M17 22L29 13" stroke-width="0.5"/>
- <path d="M106 25L115 18M104 30L118 20" stroke-width="0.38"/>
- <path d="M11 108L23 101M16 113L28 105" stroke-width="0.42"/>
- <path d="M102 113L116 104M107 116L120 108" stroke-width="0.46"/>
- </g>
- <g fill="#D7F4FF" opacity="0.22">
- <circle cx="18" cy="30" r="0.45"/>
- <circle cx="112" cy="38" r="0.35"/>
- <circle cx="22" cy="98" r="0.3"/>
- <circle cx="109" cy="94" r="0.5"/>
- <circle cx="94" cy="14" r="0.32"/>
- </g>
- <rect width="128" height="128" fill="url(#edgeShade)"/>
- </g>
-</svg>
diff --git a/assets/dev/app-icon.icon/Assets/text.svg b/assets/dev/app-icon.icon/Assets/text.svg
deleted file mode 100644
index 1f13f4039..000000000
--- a/assets/dev/app-icon.icon/Assets/text.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path fill-rule="evenodd" clip-rule="evenodd" d="M64 34L100 94H28L64 34ZM64 55L83 87H45L64 55Z" fill="white"/>
-<path d="M47 72H81V81H47V72Z" fill="white"/>
-</svg>
diff --git a/assets/dev/app-icon.icon/icon.json b/assets/dev/app-icon.icon/icon.json
deleted file mode 100644
index ff7d43d78..000000000
--- a/assets/dev/app-icon.icon/icon.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "fill": {
- "solid": "display-p3:0.00000,0.00000,0.00000,1.00000"
- },
- "groups": [
- {
- "layers": [
- {
- "glass": true,
- "image-name": "text.svg",
- "name": "Text",
- "position": {
- "scale": 8.5,
- "translation-in-points": [0, 0]
- }
- },
- {
- "glass": false,
- "image-name": "annotations.svg",
- "name": "Annotations",
- "position": {
- "scale": 8.5,
- "translation-in-points": [0, 0]
- }
- },
- {
- "glass": true,
- "image-name": "background.svg",
- "name": "Background",
- "position": {
- "scale": 8.1,
- "translation-in-points": [0, 0]
- }
- }
- ],
- "shadow": {
- "kind": "neutral",
- "opacity": 0.6
- },
- "translucency": {
- "enabled": true,
- "value": 0.2
- }
- }
- ],
- "supported-platforms": {
- "circles": ["watchOS"],
- "squares": "shared"
- }
-}
diff --git a/assets/dev/blueprint-ios-1024.png b/assets/dev/blueprint-ios-1024.png
deleted file mode 100644
index e35a6de7e..000000000
Binary files a/assets/dev/blueprint-ios-1024.png and /dev/null differ
diff --git a/assets/dev/blueprint-macos-1024.png b/assets/dev/blueprint-macos-1024.png
deleted file mode 100644
index a4a7d3c5e..000000000
Binary files a/assets/dev/blueprint-macos-1024.png and /dev/null differ
diff --git a/assets/dev/blueprint-universal-1024.png b/assets/dev/blueprint-universal-1024.png
deleted file mode 100644
index e35a6de7e..000000000
Binary files a/assets/dev/blueprint-universal-1024.png and /dev/null differ
diff --git a/assets/dev/blueprint-web-apple-touch-180.png b/assets/dev/blueprint-web-apple-touch-180.png
deleted file mode 100644
index 5a54718e8..000000000
Binary files a/assets/dev/blueprint-web-apple-touch-180.png and /dev/null differ
diff --git a/assets/dev/blueprint-web-favicon-16x16.png b/assets/dev/blueprint-web-favicon-16x16.png
deleted file mode 100644
index 17e4c8b62..000000000
Binary files a/assets/dev/blueprint-web-favicon-16x16.png and /dev/null differ
diff --git a/assets/dev/blueprint-web-favicon-32x32.png b/assets/dev/blueprint-web-favicon-32x32.png
deleted file mode 100644
index 243106175..000000000
Binary files a/assets/dev/blueprint-web-favicon-32x32.png and /dev/null differ
diff --git a/assets/dev/blueprint-web-favicon.ico b/assets/dev/blueprint-web-favicon.ico
deleted file mode 100644
index 8e13c0aed..000000000
Binary files a/assets/dev/blueprint-web-favicon.ico and /dev/null differ
diff --git a/assets/dev/blueprint-windows.ico b/assets/dev/blueprint-windows.ico
deleted file mode 100644
index 8e13c0aed..000000000
Binary files a/assets/dev/blueprint-windows.ico and /dev/null differ
diff --git a/package.json b/package.json
index 26bf1e041..107f8ccd6 100644
--- a/package.json
+++ b/package.json
@@ -17,8 +17,6 @@
"start:marketing": "vp run --filter @t3tools/marketing preview",
"start:mock-update-server": "node scripts/mock-update-server.ts",
"screenshots:mobile": "node scripts/mobile-showcase.ts",
- "icons:export": "node scripts/export-brand-icons.ts",
- "icons:check": "node scripts/export-brand-icons.ts --check",
"plugins:check": "node scripts/validate-plugin-catalog.ts",
"build": "vp run --filter './apps/*' --filter './packages/*' --filter './oxlint-plugin-t3code' --filter './scripts' build",
"build:marketing": "vp run --filter @t3tools/marketing build",
diff --git a/scripts/export-brand-icons.ts b/scripts/export-brand-icons.ts
deleted file mode 100644
index 7370099a0..000000000
--- a/scripts/export-brand-icons.ts
+++ /dev/null
@@ -1,768 +0,0 @@
-#!/usr/bin/env node
-
-import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
-import * as NodeServices from "@effect/platform-node/NodeServices";
-import { HostProcessEnvironment } from "@t3tools/shared/hostProcess";
-import * as Console from "effect/Console";
-import * as Effect from "effect/Effect";
-import * as FileSystem from "effect/FileSystem";
-import * as Option from "effect/Option";
-import * as Path from "effect/Path";
-import * as Schema from "effect/Schema";
-import * as Stream from "effect/Stream";
-import { Command, Flag } from "effect/unstable/cli";
-import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
-
-import { BRAND_ASSET_PATHS } from "./lib/brand-assets.ts";
-import { encodePngIco, readPngDimensions, WINDOWS_ICON_SIZES } from "./lib/icon-export.ts";
-
-const DESIGN_GENERATION = 26;
-const ICON_COMPOSER_EXECUTABLE_PARTS = [
- "Contents",
- "Applications",
- "Icon Composer.app",
- "Contents",
- "Executables",
- "ictool",
-] as const;
-const STANDALONE_ICON_COMPOSER_EXECUTABLE_PARTS = [
- "Icon Composer.app",
- "Contents",
- "Executables",
- "ictool",
-] as const;
-const NonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
-
-const IconComposerVersion = Schema.Struct({
- "bundle-version": Schema.NonEmptyString,
- "short-bundle-version": Schema.NonEmptyString,
-});
-const decodeIconComposerVersion = Schema.decodeUnknownEffect(
- Schema.fromJsonString(IconComposerVersion),
-);
-
-type IconPlatform = "iOS";
-
-interface VariantOutputs {
- readonly ios: string;
- readonly macos: string;
- readonly universal: string;
- readonly appleTouch: string;
- readonly favicon16: string;
- readonly favicon32: string;
- readonly faviconIco: string;
- readonly windowsIco: string;
-}
-
-interface IconVariant {
- readonly label: string;
- readonly source: string;
- readonly outputs: VariantOutputs;
-}
-
-interface IconComposerTool {
- readonly path: string;
- readonly version: string;
- readonly bundleVersion: string;
- readonly supportsDesignGeneration: boolean;
-}
-
-interface CommandResult {
- readonly stdout: string;
- readonly stderr: string;
- readonly exitCode: number;
-}
-
-export class IconExportFileSystemError extends Schema.TaggedErrorClass<IconExportFileSystemError>()(
- "IconExportFileSystemError",
- {
- operation: Schema.Literals([
- "resolve-repository-root",
- "check-path",
- "read-directory",
- "read-file",
- "make-directory",
- "make-temp-directory",
- "make-temp-file",
- "write-file",
- "rename-file",
- ]),
- path: Schema.String,
- cause: Schema.Defect(),
- },
-) {
- override get message(): string {
- return `Icon export file-system operation '${this.operation}' failed for ${this.path}.`;
- }
-}
-
-export class IconExportProcessError extends Schema.TaggedErrorClass<IconExportProcessError>()(
- "IconExportProcessError",
- {
- operation: Schema.Literals(["spawn", "collect-stdout", "collect-stderr", "wait-for-exit"]),
- command: Schema.String,
- argumentCount: NonNegativeInt,
- cause: Schema.Defect(),
- },
-) {
- override get message(): string {
- return `Icon export process operation '${this.operation}' failed for ${this.command}.`;
- }
-}
-
-export class IconExportCommandFailedError extends Schema.TaggedErrorClass<IconExportCommandFailedError>()(
- "IconExportCommandFailedError",
- {
- command: Schema.String,
- argumentCount: NonNegativeInt,
- exitCode: Schema.Int,
- sourcePath: Schema.String,
- size: Schema.Int,
- stdout: Schema.optional(Schema.String),
- stderr: Schema.optional(Schema.String),
- },
-) {
- override get message(): string {
- return `Icon Composer failed to export ${this.sourcePath} at ${this.size}x${this.size}.`;
- }
-}
-
-export class IconExportToolResolutionError extends Schema.TaggedErrorClass<IconExportToolResolutionError>()(
- "IconExportToolResolutionError",
- {
- reason: Schema.Literals(["configured-invalid", "configured-outdated", "not-found"]),
- designGeneration: Schema.Int,
- toolPath: Schema.optional(Schema.String),
- version: Schema.optional(Schema.String),
- },
-) {
- override get message(): string {
- switch (this.reason) {
- case "configured-invalid":
- return `ICON_COMPOSER_TOOL does not point to Icon Composer's export-capable ictool: ${this.toolPath}`;
- case "configured-outdated":
- return `ICON_COMPOSER_TOOL points to Icon Composer ${this.version}, but version 2 or newer is required for design generation ${this.designGeneration}.`;
- case "not-found":
- return `Could not find an Icon Composer 2.x exporter compatible with design generation ${this.designGeneration}. Install a compatible Icon Composer/Xcode or set ICON_COMPOSER_TOOL to Icon Composer.app/Contents/Executables/ictool.`;
- }
- }
-}
-
-export class IconExportSourceMissingError extends Schema.TaggedErrorClass<IconExportSourceMissingError>()(
- "IconExportSourceMissingError",
- {
- sourcePath: Schema.String,
- },
-) {
- override get message(): string {
- return `Missing Icon Composer source project: ${this.sourcePath}`;
- }
-}
-
-export class IconExportRenditionError extends Schema.TaggedErrorClass<IconExportRenditionError>()(
- "IconExportRenditionError",
- {
- sourcePath: Schema.String,
- outputPath: Schema.String,
- expectedSize: Schema.Int,
- actualWidth: Schema.optional(Schema.Int),
- actualHeight: Schema.optional(Schema.Int),
- cause: Schema.optional(Schema.Defect()),
- },
-) {
- override get message(): string {
- const actual =
- this.actualWidth === undefined || this.actualHeight === undefined
- ? "an invalid PNG"
- : `${this.actualWidth}x${this.actualHeight}`;
- return `Icon Composer produced ${actual}; expected ${this.expectedSize}x${this.expectedSize} for ${this.sourcePath}.`;
- }
-}
-
-export class IconExportEncodingError extends Schema.TaggedErrorClass<IconExportEncodingError>()(
- "IconExportEncodingError",
- {
- variant: Schema.String,
- cause: Schema.Defect(),
- },
-) {
- override get message(): string {
- return `Failed to encode ICO renditions for the ${this.variant} icon.`;
- }
-}
-
-export class IconExportAssetsStaleError extends Schema.TaggedErrorClass<IconExportAssetsStaleError>()(
- "IconExportAssetsStaleError",
- {
- paths: Schema.Array(Schema.String),
- },
-) {
- override get message(): string {
- return `Generated icon assets are stale:\n${this.paths.map((path) => `- ${path}`).join("\n")}`;
- }
-}
-
-const ICON_VARIANTS = [
- {
- label: "development",
- source: BRAND_ASSET_PATHS.developmentIconComposerProject,
- outputs: {
- ios: BRAND_ASSET_PATHS.developmentIosIconPng,
- macos: BRAND_ASSET_PATHS.developmentDesktopIconPng,
- universal: BRAND_ASSET_PATHS.developmentUniversalIconPng,
- appleTouch: BRAND_ASSET_PATHS.developmentWebAppleTouchIconPng,
- favicon16: BRAND_ASSET_PATHS.developmentWebFavicon16Png,
- favicon32: BRAND_ASSET_PATHS.developmentWebFavicon32Png,
- faviconIco: BRAND_ASSET_PATHS.developmentWebFaviconIco,
- windowsIco: BRAND_ASSET_PATHS.developmentWindowsIconIco,
- },
- },
-] as const satisfies ReadonlyArray<IconVariant>;
-
-const MACOS_EXPORT_CODEX_PROMPT = [
- "Use [@Computer](plugin://computer-use@openai-bundled) and the Icon Composer app to export the development macOS app icon in this repository.",
- "For each project below, use Platform: macOS pre-Tahoe, Appearance: Default, Size: 1024pt, and Scale: 1×, then save the PNG to the exact destination:",
- ...ICON_VARIANTS.map((variant) => `- ${variant.source} -> ${variant.outputs.macos}`),
- "Do not resize, composite, or otherwise post-process the exported PNGs.",
- "Verify every result is 1024×1024 and has the classic macOS safe area: an 824×824 opaque body inset 100px on every side, with only Icon Composer's native shadow extending beyond it.",
-];
-
-const RepositoryRoot = Effect.service(Path.Path).pipe(
- Effect.flatMap((path) => path.fromFileUrl(new URL("..", import.meta.url))),
- Effect.mapError(
- (cause) =>
- new IconExportFileSystemError({
- operation: "resolve-repository-root",
- path: new URL("..", import.meta.url).pathname,
- cause,
- }),
- ),
-);
-
-const collectStreamAsString = <E>(stream: Stream.Stream<Uint8Array, E>) =>
- stream.pipe(
- Stream.decodeText(),
- Stream.runFold(
- () => "",
- (acc, chunk) => acc + chunk,
- ),
- );
-
-const runCommand = Effect.fn("iconExport.runCommand")(function* (
- command: string,
- args: ReadonlyArray<string>,
-) {
- const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
- const child = yield* spawner.spawn(ChildProcess.make(command, args)).pipe(
- Effect.mapError(
- (cause) =>
- new IconExportProcessError({
- operation: "spawn",
- command,
- argumentCount: args.length,
- cause,
- }),
- ),
- );
- const [stdout, stderr, exitCode] = yield* Effect.all(
- [
- collectStreamAsString(child.stdout).pipe(
- Effect.mapError(
- (cause) =>
- new IconExportProcessError({
- operation: "collect-stdout",
- command,
- argumentCount: args.length,
- cause,
- }),
- ),
- ),
- collectStreamAsString(child.stderr).pipe(
- Effect.mapError(
- (cause) =>
- new IconExportProcessError({
- operation: "collect-stderr",
- command,
- argumentCount: args.length,
- cause,
- }),
- ),
- ),
- child.exitCode.pipe(
- Effect.map(Number),
- Effect.mapError(
- (cause) =>
- new IconExportProcessError({
- operation: "wait-for-exit",
- command,
- argumentCount: args.length,
- cause,
- }),
- ),
- ),
- ],
- { concurrency: "unbounded" },
- );
-
- return { stdout, stderr, exitCode } satisfies CommandResult;
-});
-
-const iconComposerToolFromDeveloperDirectory = (developerDirectory: string, path: Path.Path) =>
- path.resolve(developerDirectory, "..", ...ICON_COMPOSER_EXECUTABLE_PARTS.slice(1));
-
-const readSelectedDeveloperDirectory = Effect.fn("iconExport.readSelectedDeveloperDirectory")(
- function* () {
- const result = yield* runCommand("xcode-select", ["-p"]).pipe(Effect.option);
- return Option.flatMap(result, (output) => {
- const developerDirectory = output.stdout.trim();
- return output.exitCode === 0 && developerDirectory.length > 0
- ? Option.some(developerDirectory)
- : Option.none();
- });
- },
-);
-
-const findXcodeAppCandidates = Effect.fn("iconExport.findXcodeAppCandidates")(function* (
- directory: string,
-) {
- const fs = yield* FileSystem.FileSystem;
- const path = yield* Path.Path;
- const entries = yield* fs.readDirectory(directory).pipe(
- Effect.mapError(
- (cause) =>
- new IconExportFileSystemError({
- operation: "read-directory",
- path: directory,
- cause,
- }),
- ),
- Effect.orElseSucceed(() => []),
- );
- return entries
- .filter((entry) => /^Xcode.*\.app$/.test(entry))
- .map((entry) => path.join(directory, entry, ...ICON_COMPOSER_EXECUTABLE_PARTS));
-});
-
-const probeIconComposerTool = Effect.fn("iconExport.probeIconComposerTool")(function* (
- candidate: string,
-) {
- const fs = yield* FileSystem.FileSystem;
- const exists = yield* fs.exists(candidate).pipe(
- Effect.mapError(
- (cause) =>
- new IconExportFileSystemError({
- operation: "check-path",
- path: candidate,
- cause,
- }),
- ),
- Effect.orElseSucceed(() => false),
- );
- if (!exists) return Option.none<IconComposerTool>();
-
- const result = yield* runCommand(candidate, ["--version"]).pipe(Effect.option);
- if (Option.isNone(result) || result.value.exitCode !== 0) {
- return Option.none<IconComposerTool>();
- }
-
- const version = yield* decodeIconComposerVersion(result.value.stdout).pipe(Effect.option);
- if (Option.isNone(version)) return Option.none<IconComposerTool>();
-
- const bundleVersion = version.value["bundle-version"];
- const shortVersion = version.value["short-bundle-version"];
- return Option.some({
- path: candidate,
- version: `${shortVersion} (${bundleVersion})`,
- bundleVersion,
- supportsDesignGeneration: Number.parseInt(shortVersion, 10) >= 2,
- });
-});
-
-const resolveIconComposerTool = Effect.fn("iconExport.resolveIconComposerTool")(function* () {
- const path = yield* Path.Path;
- const environment = yield* HostProcessEnvironment;
- const configuredTool = environment.ICON_COMPOSER_TOOL?.trim();
- if (configuredTool) {
- const tool = yield* probeIconComposerTool(configuredTool);
- if (Option.isNone(tool)) {
- return yield* new IconExportToolResolutionError({
- reason: "configured-invalid",
- designGeneration: DESIGN_GENERATION,
- toolPath: configuredTool,
- });
- }
- if (!tool.value.supportsDesignGeneration) {
- return yield* new IconExportToolResolutionError({
- reason: "configured-outdated",
- designGeneration: DESIGN_GENERATION,
- toolPath: configuredTool,
- version: tool.value.version,
- });
- }
- return tool.value;
- }
-
- const selectedDeveloperDirectory = yield* readSelectedDeveloperDirectory();
- const configuredDeveloperDirectory = environment.DEVELOPER_DIR?.trim();
- const homeDirectory = environment.HOME?.trim();
- const searchDirectories = [
- "/Applications",
- ...(homeDirectory ? [path.join(homeDirectory, "Downloads")] : []),
- ];
- const xcodeCandidates = yield* Effect.forEach(searchDirectories, findXcodeAppCandidates, {
- concurrency: "unbounded",
- });
- const candidates = new Set<string>([
- ...(configuredDeveloperDirectory
- ? [iconComposerToolFromDeveloperDirectory(configuredDeveloperDirectory, path)]
- : []),
- ...Option.match(selectedDeveloperDirectory, {
- onNone: () => [],
- onSome: (developerDirectory) => [
- iconComposerToolFromDeveloperDirectory(developerDirectory, path),
- ],
- }),
- path.join("/Applications", ...STANDALONE_ICON_COMPOSER_EXECUTABLE_PARTS),
- ...(homeDirectory
- ? [path.join(homeDirectory, "Applications", ...STANDALONE_ICON_COMPOSER_EXECUTABLE_PARTS)]
- : []),
- ...xcodeCandidates.flat(),
- ]);
- const probed = yield* Effect.forEach([...candidates], probeIconComposerTool, {
- concurrency: "unbounded",
- });
- const compatibleTools = probed
- .filter(Option.isSome)
- .map((tool) => tool.value)
- .filter((tool) => tool.supportsDesignGeneration)
- .sort((left, right) =>
- right.bundleVersion.localeCompare(left.bundleVersion, undefined, { numeric: true }),
- );
- const newestTool = compatibleTools[0];
- if (newestTool) return newestTool;
-
- return yield* new IconExportToolResolutionError({
- reason: "not-found",
- designGeneration: DESIGN_GENERATION,
- });
-});
-
-const renderIcon = Effect.fn("iconExport.renderIcon")(function* (
- toolPath: string,
- sourcePath: string,
- outputPath: string,
- platform: IconPlatform,
- size: number,
-) {
- const fs = yield* FileSystem.FileSystem;
- const args = [
- sourcePath,
- "--export-image",
- "--output-file",
- outputPath,
- "--platform",
- platform,
- "--rendition",
- "Default",
- "--width",
- String(size),
- "--height",
- String(size),
- "--scale",
- "1",
- "--design-generation",
- String(DESIGN_GENERATION),
- ];
- const result = yield* runCommand(toolPath, args);
- if (result.exitCode !== 0) {
- return yield* new IconExportCommandFailedError({
- command: toolPath,
- argumentCount: args.length,
- exitCode: result.exitCode,
- sourcePath,
- size,
- ...(result.stdout.trim() ? { stdout: result.stdout.trim() } : {}),
- ...(result.stderr.trim() ? { stderr: result.stderr.trim() } : {}),
- });
- }
-
- const contents = yield* fs.readFile(outputPath).pipe(
- Effect.mapError(
- (cause) =>
- new IconExportFileSystemError({
- operation: "read-file",
- path: outputPath,
- cause,
- }),
- ),
- );
- const buffer = Buffer.from(contents);
- const dimensions = yield* Effect.try({
- try: () => readPngDimensions(buffer),
- catch: (cause) =>
- new IconExportRenditionError({
- sourcePath,
- outputPath,
- expectedSize: size,
- cause,
- }),
- });
- if (dimensions.width !== size || dimensions.height !== size) {
- return yield* new IconExportRenditionError({
- sourcePath,
- outputPath,
- expectedSize: size,
- actualWidth: dimensions.width,
- actualHeight: dimensions.height,
- });
- }
- return buffer;
-});
-
-const renderVariant = Effect.fn("iconExport.renderVariant")(function* (
- toolPath: string,
- repositoryRoot: string,
- temporaryDirectory: string,
- variant: IconVariant,
-) {
- const fs = yield* FileSystem.FileSystem;
- const path = yield* Path.Path;
- const sourcePath = path.join(repositoryRoot, variant.source);
- const sourceExists = yield* fs.exists(sourcePath).pipe(
- Effect.mapError(
- (cause) =>
- new IconExportFileSystemError({
- operation: "check-path",
- path: sourcePath,
- cause,
- }),
- ),
- );
- if (!sourceExists) {
- return yield* new IconExportSourceMissingError({ sourcePath: variant.source });
- }
-
- const renditionCache = new Map<string, Buffer>();
- const render = Effect.fn("iconExport.renderVariant.rendition")(function* (
- platform: IconPlatform,
- size: number,
- ) {
- const cacheKey = `${platform}-${size}`;
- const cached = renditionCache.get(cacheKey);
- if (cached) return cached;
-
- const outputPath = path.join(temporaryDirectory, `${variant.label}-${platform}-${size}.png`);
- const contents = yield* renderIcon(toolPath, sourcePath, outputPath, platform, size);
- renditionCache.set(cacheKey, contents);
- return contents;
- });
-
- const ios = yield* render("iOS", 1024);
- const icoRenditions = yield* Effect.forEach(
- WINDOWS_ICON_SIZES,
- (size) => render("iOS", size).pipe(Effect.map((contents) => ({ size, contents }))),
- { concurrency: 1 },
- );
- const ico = yield* Effect.try({
- try: () => encodePngIco(icoRenditions),
- catch: (cause) => new IconExportEncodingError({ variant: variant.label, cause }),
- });
-
- return new Map<string, Buffer>([
- [variant.outputs.ios, ios],
- [variant.outputs.universal, ios],
- [variant.outputs.appleTouch, yield* render("iOS", 180)],
- [variant.outputs.favicon16, yield* render("iOS", 16)],
- [variant.outputs.favicon32, yield* render("iOS", 32)],
- [variant.outputs.faviconIco, ico],
- [variant.outputs.windowsIco, ico],
- ]);
-});
-
-const logManualMacOsExportInstructions = Effect.fn("iconExport.logManualMacOsExportInstructions")(
- function* () {
- yield* Console.warn(
- [
- "macOS icons require Icon Composer's GUI-only pre-Tahoe preset and were not changed.",
- "Export each source with Platform: macOS pre-Tahoe, Appearance: Default, Size: 1024pt, Scale: 1×:",
- ...ICON_VARIANTS.map((variant) => `- ${variant.source} -> ${variant.outputs.macos}`),
- "See assets/README.md for the complete workflow.",
- "",
- "Copy/paste this prompt into Codex to perform the native exports:",
- "---",
- ...MACOS_EXPORT_CODEX_PROMPT,
- "---",
- ].join("\n"),
- );
- },
-);
-
-const writeAtomically = Effect.fn("iconExport.writeAtomically")(function* (
- repositoryRoot: string,
- relativePath: string,
- contents: Buffer,
-) {
- const fs = yield* FileSystem.FileSystem;
- const path = yield* Path.Path;
- const targetPath = path.join(repositoryRoot, relativePath);
- const targetDirectory = path.dirname(targetPath);
- yield* fs.makeDirectory(targetDirectory, { recursive: true }).pipe(
- Effect.mapError(
- (cause) =>
- new IconExportFileSystemError({
- operation: "make-directory",
- path: targetDirectory,
- cause,
- }),
- ),
- );
- const temporaryPath = yield* fs
- .makeTempFileScoped({
- directory: targetDirectory,
- prefix: ".t3-icon-export-",
- suffix: ".tmp",
- })
- .pipe(
- Effect.mapError(
- (cause) =>
- new IconExportFileSystemError({
- operation: "make-temp-file",
- path: targetDirectory,
- cause,
- }),
- ),
- );
- yield* fs.writeFile(temporaryPath, contents).pipe(
- Effect.mapError(
- (cause) =>
- new IconExportFileSystemError({
- operation: "write-file",
- path: temporaryPath,
- cause,
- }),
- ),
- );
- yield* fs.rename(temporaryPath, targetPath).pipe(
- Effect.mapError(
- (cause) =>
- new IconExportFileSystemError({
- operation: "rename-file",
- path: targetPath,
- cause,
- }),
- ),
- );
-});
-
-const isCurrent = Effect.fn("iconExport.isCurrent")(function* (
- repositoryRoot: string,
- relativePath: string,
- expected: Buffer,
-) {
- const fs = yield* FileSystem.FileSystem;
- const path = yield* Path.Path;
- const targetPath = path.join(repositoryRoot, relativePath);
- const exists = yield* fs.exists(targetPath).pipe(
- Effect.mapError(
- (cause) =>
- new IconExportFileSystemError({
- operation: "check-path",
- path: targetPath,
- cause,
- }),
- ),
- );
- if (!exists) return false;
-
- const actual = yield* fs.readFile(targetPath).pipe(
- Effect.mapError(
- (cause) =>
- new IconExportFileSystemError({
- operation: "read-file",
- path: targetPath,
- cause,
- }),
- ),
- );
- return Buffer.from(actual).equals(expected);
-});
-
-export const exportBrandIcons = Effect.fn("exportBrandIcons")(function* (checkOnly: boolean) {
- const fs = yield* FileSystem.FileSystem;
- const repositoryRoot = yield* RepositoryRoot;
- const tool = yield* resolveIconComposerTool();
- const temporaryDirectory = yield* fs
- .makeTempDirectoryScoped({
- prefix: "t3-icon-export-",
- })
- .pipe(
- Effect.mapError(
- (cause) =>
- new IconExportFileSystemError({
- operation: "make-temp-directory",
- path: "system temporary directory",
- cause,
- }),
- ),
- );
- yield* Console.log(
- `Exporting icons with Icon Composer ${tool.version}, design generation ${DESIGN_GENERATION}.`,
- );
-
- const generated = new Map<string, Buffer>();
- for (const variant of ICON_VARIANTS) {
- yield* Console.log(`Rendering ${variant.label} from ${variant.source}...`);
- const variantAssets = yield* renderVariant(
- tool.path,
- repositoryRoot,
- temporaryDirectory,
- variant,
- );
- for (const [relativePath, contents] of variantAssets) {
- generated.set(relativePath, contents);
- }
- }
-
- if (checkOnly) {
- const stale = yield* Effect.filter(
- [...generated.entries()],
- ([relativePath, contents]) =>
- isCurrent(repositoryRoot, relativePath, contents).pipe(Effect.map((current) => !current)),
- { concurrency: "unbounded" },
- );
- if (stale.length > 0) {
- return yield* new IconExportAssetsStaleError({
- paths: stale.map(([relativePath]) => relativePath),
- });
- }
- yield* Console.log(`All ${generated.size} generated icon assets are current.`);
- yield* logManualMacOsExportInstructions();
- return;
- }
-
- yield* Effect.forEach(
- generated,
- ([relativePath, contents]) => writeAtomically(repositoryRoot, relativePath, contents),
- { concurrency: 1, discard: true },
- );
- yield* Console.log(`Updated ${generated.size} generated icon assets.`);
- yield* logManualMacOsExportInstructions();
-});
-
-export const exportBrandIconsCommand = Command.make(
- "export-brand-icons",
- {
- check: Flag.boolean("check").pipe(
- Flag.withDescription("Verify generated icon assets without modifying files."),
- Flag.withDefault(false),
- ),
- },
- ({ check }) => exportBrandIcons(check).pipe(Effect.scoped),
-).pipe(Command.withDescription("Export development assets from the Icon Composer project."));
-
-if (import.meta.main) {
- Command.run(exportBrandIconsCommand, { version: "0.0.0" }).pipe(
- Effect.provide(NodeServices.layer),
- NodeRuntime.runMain,
- );
-}
diff --git a/scripts/lib/brand-assets.test.ts b/scripts/lib/brand-assets.test.ts
index 048f5ef11..598fa62d5 100644
--- a/scripts/lib/brand-assets.test.ts
+++ b/scripts/lib/brand-assets.test.ts
@@ -33,7 +33,7 @@ describe("brand-assets", () => {
it("maps server build web assets to development icons", () => {
expect(DEVELOPMENT_ICON_OVERRIDES[0]).toEqual({
- sourceRelativePath: BRAND_ASSET_PATHS.developmentWebFaviconIco,
+ sourceRelativePath: BRAND_ASSET_PATHS.productionWebFaviconIco,
targetRelativePath: "dist/client/favicon.ico",
});
});
@@ -41,19 +41,19 @@ describe("brand-assets", () => {
it("maps development web assets to the public splash and favicon files", () => {
expect(DEVELOPMENT_PUBLIC_ICON_OVERRIDES).toEqual([
{
- sourceRelativePath: BRAND_ASSET_PATHS.developmentWebFaviconIco,
+ sourceRelativePath: BRAND_ASSET_PATHS.productionWebFaviconIco,
targetRelativePath: "apps/web/public/favicon.ico",
},
{
- sourceRelativePath: BRAND_ASSET_PATHS.developmentWebFavicon16Png,
+ sourceRelativePath: BRAND_ASSET_PATHS.productionWebFavicon16Png,
targetRelativePath: "apps/web/public/favicon-16x16.png",
},
{
- sourceRelativePath: BRAND_ASSET_PATHS.developmentWebFavicon32Png,
+ sourceRelativePath: BRAND_ASSET_PATHS.productionWebFavicon32Png,
targetRelativePath: "apps/web/public/favicon-32x32.png",
},
{
- sourceRelativePath: BRAND_ASSET_PATHS.developmentWebAppleTouchIconPng,
+ sourceRelativePath: BRAND_ASSET_PATHS.productionWebAppleTouchIconPng,
targetRelativePath: "apps/web/public/apple-touch-icon.png",
},
]);
@@ -75,8 +75,6 @@ describe("brand-assets", () => {
});
it("uses the Akeru favicon artwork for production desktop and web icons", () => {
- expect(BRAND_ASSET_PATHS.developmentIconComposerProject).toBe("assets/dev/app-icon.icon");
- expect(BRAND_ASSET_PATHS.developmentDesktopIconPng).toMatch(/^assets\/dev\/blueprint-/);
expect(BRAND_ASSET_PATHS.productionMacIconPng).toBe("assets/prod/akeru-macos-1024.png");
expect(BRAND_ASSET_PATHS.productionLinuxIconPng).toBe("apps/marketing/public/icon.png");
expect(BRAND_ASSET_PATHS.productionWindowsIconIco).toBe("apps/web/public/favicon.ico");
diff --git a/scripts/lib/brand-assets.ts b/scripts/lib/brand-assets.ts
index 92a770014..03762c936 100644
--- a/scripts/lib/brand-assets.ts
+++ b/scripts/lib/brand-assets.ts
@@ -1,8 +1,4 @@
export const BRAND_ASSET_PATHS = {
- developmentIconComposerProject: "assets/dev/app-icon.icon",
- developmentIosIconPng: "assets/dev/blueprint-ios-1024.png",
- developmentUniversalIconPng: "assets/dev/blueprint-universal-1024.png",
-
productionIosIconPng: "apps/marketing/public/icon.png",
productionMacIconPng: "assets/prod/akeru-macos-1024.png",
productionLinuxIconPng: "apps/marketing/public/icon.png",
@@ -11,13 +7,6 @@ export const BRAND_ASSET_PATHS = {
productionWebFavicon16Png: "apps/web/public/favicon-16x16.png",
productionWebFavicon32Png: "apps/web/public/favicon-32x32.png",
productionWebAppleTouchIconPng: "apps/web/public/apple-touch-icon.png",
-
- developmentDesktopIconPng: "assets/dev/blueprint-macos-1024.png",
- developmentWindowsIconIco: "assets/dev/blueprint-windows.ico",
- developmentWebFaviconIco: "assets/dev/blueprint-web-favicon.ico",
- developmentWebFavicon16Png: "assets/dev/blueprint-web-favicon-16x16.png",
- developmentWebFavicon32Png: "assets/dev/blueprint-web-favicon-32x32.png",
- developmentWebAppleTouchIconPng: "assets/dev/blueprint-web-apple-touch-180.png",
} as const;
export type WebAssetBrand = "development" | "production";
@@ -48,10 +37,10 @@ const WEB_ICON_TARGET_FILENAMES = {
const WEB_ICON_SOURCE_PATHS_BY_BRAND = {
development: {
- faviconIco: BRAND_ASSET_PATHS.developmentWebFaviconIco,
- favicon16Png: BRAND_ASSET_PATHS.developmentWebFavicon16Png,
- favicon32Png: BRAND_ASSET_PATHS.developmentWebFavicon32Png,
- appleTouchIconPng: BRAND_ASSET_PATHS.developmentWebAppleTouchIconPng,
+ faviconIco: BRAND_ASSET_PATHS.productionWebFaviconIco,
+ favicon16Png: BRAND_ASSET_PATHS.productionWebFavicon16Png,
+ favicon32Png: BRAND_ASSET_PATHS.productionWebFavicon32Png,
+ appleTouchIconPng: BRAND_ASSET_PATHS.productionWebAppleTouchIconPng,
},
production: {
faviconIco: BRAND_ASSET_PATHS.productionWebFaviconIco,
diff --git a/scripts/lib/icon-export.test.ts b/scripts/lib/icon-export.test.ts
deleted file mode 100644
index 3db6f22cb..000000000
--- a/scripts/lib/icon-export.test.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import { assert, describe, it } from "@effect/vitest";
-
-import { encodePngIco, readPngDimensions } from "./icon-export.ts";
-
-const pngHeader = (width: number, height: number) => {
- const contents = Buffer.alloc(24);
- Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]).copy(contents);
- contents.write("IHDR", 12, "ascii");
- contents.writeUInt32BE(width, 16);
- contents.writeUInt32BE(height, 20);
- return contents;
-};
-
-describe("icon export", () => {
- it("reads dimensions from a PNG IHDR chunk", () => {
- assert.deepEqual(readPngDimensions(pngHeader(1024, 512)), { width: 1024, height: 512 });
- });
-
- it("encodes PNG renditions into an ICO directory", () => {
- const small = pngHeader(16, 16);
- const large = pngHeader(256, 256);
- const ico = encodePngIco([
- { size: 16, contents: small },
- { size: 256, contents: large },
- ]);
-
- assert.equal(ico.readUInt16LE(2), 1);
- assert.equal(ico.readUInt16LE(4), 2);
- assert.equal(ico.readUInt8(6), 16);
- assert.equal(ico.readUInt8(22), 0);
- assert.equal(ico.readUInt32LE(18), 38);
- assert.equal(ico.readUInt32LE(34), 38 + small.length);
- assert.deepEqual(ico.subarray(38, 38 + small.length), small);
- assert.deepEqual(ico.subarray(38 + small.length), large);
- });
-
- it("rejects duplicate ICO rendition sizes", () => {
- assert.throws(
- () =>
- encodePngIco([
- { size: 32, contents: pngHeader(32, 32) },
- { size: 32, contents: pngHeader(32, 32) },
- ]),
- /provided more than once/,
- );
- });
-});
diff --git a/scripts/lib/icon-export.ts b/scripts/lib/icon-export.ts
deleted file mode 100644
index f48228a94..000000000
--- a/scripts/lib/icon-export.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-const PNG_SIGNATURE = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
-
-export const WINDOWS_ICON_SIZES = [16, 24, 32, 48, 64, 128, 256] as const;
-
-export interface PngIconImage {
- readonly size: number;
- readonly contents: Buffer;
-}
-
-export function readPngDimensions(contents: Buffer): {
- readonly width: number;
- readonly height: number;
-} {
- if (
- contents.length < 24 ||
- !contents.subarray(0, PNG_SIGNATURE.length).equals(PNG_SIGNATURE) ||
- contents.toString("ascii", 12, 16) !== "IHDR"
- ) {
- throw new Error("Icon Composer produced an invalid PNG.");
- }
-
- return {
- width: contents.readUInt32BE(16),
- height: contents.readUInt32BE(20),
- };
-}
-
-/** Encodes PNG renditions directly into a modern, multi-resolution ICO file. */
-export function encodePngIco(images: ReadonlyArray<PngIconImage>): Buffer {
- if (images.length === 0) {
- throw new Error("An ICO file requires at least one PNG rendition.");
- }
-
- const seenSizes = new Set<number>();
- for (const image of images) {
- if (!Number.isInteger(image.size) || image.size < 1 || image.size > 256) {
- throw new Error(`ICO rendition size must be an integer from 1 to 256, got ${image.size}.`);
- }
- if (seenSizes.has(image.size)) {
- throw new Error(`ICO rendition size ${image.size} was provided more than once.`);
- }
- if (image.contents.length === 0) {
- throw new Error(`ICO rendition ${image.size}x${image.size} is empty.`);
- }
- seenSizes.add(image.size);
- }
-
- const headerSize = 6;
- const directoryEntrySize = 16;
- const directorySize = directoryEntrySize * images.length;
- const header = Buffer.alloc(headerSize + directorySize);
- header.writeUInt16LE(0, 0);
- header.writeUInt16LE(1, 2);
- header.writeUInt16LE(images.length, 4);
-
- let imageOffset = header.length;
- images.forEach((image, index) => {
- const entryOffset = headerSize + index * directoryEntrySize;
- const encodedSize = image.size === 256 ? 0 : image.size;
- header.writeUInt8(encodedSize, entryOffset);
- header.writeUInt8(encodedSize, entryOffset + 1);
- header.writeUInt8(0, entryOffset + 2);
- header.writeUInt8(0, entryOffset + 3);
- header.writeUInt16LE(1, entryOffset + 4);
- header.writeUInt16LE(32, entryOffset + 6);
- header.writeUInt32LE(image.contents.length, entryOffset + 8);
- header.writeUInt32LE(imageOffset, entryOffset + 12);
- imageOffset += image.contents.length;
- });
-
- return Buffer.concat([header, ...images.map((image) => image.contents)]);
-}
diff --git a/scripts/mobile-showcase-environment.ts b/scripts/mobile-showcase-environment.ts
index 32a2e84e9..5193c9354 100644
--- a/scripts/mobile-showcase-environment.ts
+++ b/scripts/mobile-showcase-environment.ts
@@ -93,10 +93,9 @@ export function RemoteHandoffCard(props: { machine: string; latencyMs: number })
`;
const PROJECT_FAVICONS = {
- t3code: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
- <rect width="128" height="128" rx="10" fill="#000"/>
- <path fill-rule="evenodd" d="M64 34L100 94H28L64 34ZM64 55L83 87H45L64 55Z" fill="#fff"/>
- <path d="M47 72H81V81H47V72Z" fill="#fff"/>
+ akeru: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
+ <rect width="128" height="128" rx="24" fill="#f4f1ea"/>
+ <text x="64" y="91" fill="#171716" font-family="Georgia,serif" font-size="96" text-anchor="middle">a</text>
</svg>`,
react: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
<rect width="64" height="64" rx="15" fill="#20232a"/>
@@ -119,7 +118,7 @@ export const SHOWCASE_PROJECTS = [
title: "Akeru Bot",
directory: "akeru-bot",
repositoryUrl: "https://github.com/opencoredev/akeru-bot.git",
- favicon: PROJECT_FAVICONS.t3code,
+ favicon: PROJECT_FAVICONS.akeru,
},
{
id: "react",
@@ -299,7 +298,7 @@ async function seedT3CodeWorkspace(workspaceRoot: string): Promise<void> {
NodePath.join(workspaceRoot, "package.json"),
`${JSON.stringify({ name: "t3code", private: true, scripts: { test: "vp test" } }, null, 2)}\n`,
);
- await NodeFSP.writeFile(NodePath.join(workspaceRoot, "favicon.svg"), PROJECT_FAVICONS.t3code);
+ await NodeFSP.writeFile(NodePath.join(workspaceRoot, "favicon.svg"), PROJECT_FAVICONS.akeru);
await NodeFSP.writeFile(
NodePath.join(workspaceRoot, "apps/mobile/src/features/home/environmentPresence.ts"),
BASE_ENVIRONMENT_PRESENCE,
diff --git a/t3.json b/t3.json
index f7e4221a8..022dc84b6 100644
--- a/t3.json
+++ b/t3.json
@@ -1,6 +1,6 @@
{
"$schema": "https://t3.codes/schema/t3.json",
- "iconPath": "assets/dev/blueprint-web-apple-touch-180.png",
+ "iconPath": "apps/web/public/apple-touch-icon.png",
"scripts": [
{
"name": "Setup Worktree",