Skip to content

Commit 84e3b66

Browse files
committed
fixes
1 parent c04eec3 commit 84e3b66

82 files changed

Lines changed: 2404 additions & 3470 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
-116 KB
Binary file not shown.
-23.5 KB
Binary file not shown.

apps/desktop/build/generated-icon.icon/icon.json

Lines changed: 0 additions & 28 deletions
This file was deleted.

apps/desktop/scripts/build.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { cpSync, rmSync } from 'node:fs'
22
import { build } from 'esbuild'
3+
import { identityForOrigin } from './channels'
34

45
const watch = process.argv.includes('--watch')
56

@@ -23,19 +24,7 @@ if (bakedDefaultOrigin) {
2324
console.log(`• Baking default server origin: ${bakedDefaultOrigin}`)
2425
}
2526

26-
/** Selects the branded app icon that matches the build's baked environment. */
27-
function iconForOrigin(origin: string): string {
28-
if (!origin) return 'build/icon.icon'
29-
const host = new URL(origin).hostname.toLowerCase()
30-
if (host === 'localhost' || host === '127.0.0.1') return 'build/icon-local.icon'
31-
if (host === 'dev.sim.ai' || host.endsWith('.dev.sim.ai')) return 'build/icon-dev.icon'
32-
if (host === 'staging.sim.ai' || host.endsWith('.staging.sim.ai')) {
33-
return 'build/icon-staging.icon'
34-
}
35-
return 'build/icon.icon'
36-
}
37-
38-
const appIcon = iconForOrigin(bakedDefaultOrigin)
27+
const appIcon = identityForOrigin(bakedDefaultOrigin).icon
3928
const generatedIcon = 'build/generated-icon.icon'
4029
rmSync(generatedIcon, { force: true, recursive: true })
4130
cpSync(appIcon, generatedIcon, { recursive: true })

apps/desktop/scripts/channels.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export interface ChannelIdentity {
2323
appId: string
2424
/** Baked default origin + persisted settings origin. */
2525
origin: string
26+
/** Native Icon Composer source copied into the packager's generated path. */
27+
icon: string
2628
/**
2729
* Artifact filename stem, and the per-channel scratch directory name.
2830
* Space-free for the same reason electron-builder.yml's artifactName is:
@@ -36,24 +38,28 @@ export const PROD: ChannelIdentity = {
3638
name: 'Sim',
3739
appId: 'ai.sim.desktop',
3840
origin: PROD_ORIGIN,
41+
icon: 'build/icon.icon',
3942
slug: 'sim',
4043
}
4144
export const STAGING: ChannelIdentity = {
4245
name: 'Sim Staging',
4346
appId: 'ai.sim.desktop.staging',
4447
origin: STAGING_ORIGIN,
48+
icon: 'build/icon-staging.icon',
4549
slug: 'sim-staging',
4650
}
4751
export const DEV: ChannelIdentity = {
4852
name: 'Sim Dev',
4953
appId: 'ai.sim.desktop.dev',
5054
origin: DEV_ORIGIN,
55+
icon: 'build/icon-dev.icon',
5156
slug: 'sim-dev',
5257
}
5358
export const LOCAL: ChannelIdentity = {
5459
name: 'Sim Local',
5560
appId: 'ai.sim.desktop.local',
5661
origin: LOCAL_ORIGIN,
62+
icon: 'build/icon-local.icon',
5763
slug: 'sim-local',
5864
}
5965

apps/desktop/scripts/package-share.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* naming itself "Sim Dev" at runtime.
2424
*
2525
* Channels build ONE AT A TIME on purpose. scripts/build.ts writes the bundle
26-
* to dist/ and the app icon to build/generated-icon.icns, both fixed paths, so
26+
* to dist/ and the app icon to build/generated-icon.icon, both fixed paths, so
2727
* concurrent channels would overwrite each other's bundle mid-package and ship
2828
* a dmg whose baked origin belongs to a different environment — invisible until
2929
* someone signs in. Giving each channel its own bundle directory is what would

0 commit comments

Comments
 (0)