Skip to content

Commit eb5f9b0

Browse files
committed
chore: isolate Pearce Codes data home
1 parent 77fe51f commit eb5f9b0

16 files changed

Lines changed: 41 additions & 33 deletions

apps/desktop/src/app/DesktopConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const compactEnv = (env: Readonly<Record<string, string | undefined>>): Record<s
3535
export const DesktopConfig = Config.all({
3636
appDataDirectory: trimmedString("APPDATA"),
3737
xdgConfigHome: trimmedString("XDG_CONFIG_HOME"),
38-
t3Home: trimmedString("T3CODE_HOME"),
38+
t3Home: trimmedString("PEARCE_CODES_HOME"),
3939
devServerUrl: Config.url("VITE_DEV_SERVER_URL").pipe(Config.option),
4040
devRemoteT3ServerEntryPath: trimmedString("T3CODE_DEV_REMOTE_T3_SERVER_ENTRY_PATH"),
4141
configuredBackendPort: Config.port("T3CODE_PORT").pipe(Config.option),

apps/desktop/src/app/DesktopEnvironment.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe("DesktopEnvironment", () => {
4242
const environment = yield* makeEnvironment(
4343
{},
4444
{
45-
T3CODE_HOME: " /tmp/t3 ",
45+
PEARCE_CODES_HOME: " /tmp/t3 ",
4646
T3CODE_COMMIT_HASH: " 0123456789abcdef ",
4747
T3CODE_PORT: "4949",
4848
VITE_DEV_SERVER_URL: "http://localhost:5173",
@@ -84,7 +84,7 @@ describe("DesktopEnvironment", () => {
8484
const environment = yield* makeEnvironment(
8585
{},
8686
{
87-
T3CODE_HOME: "/tmp/t3",
87+
PEARCE_CODES_HOME: "/tmp/t3",
8888
},
8989
);
9090

apps/desktop/src/app/DesktopEnvironment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ const makeDesktopEnvironment = Effect.fn("desktop.environment.make")(function* (
151151
: input.platform === "darwin"
152152
? path.join(homeDirectory, "Library", "Application Support")
153153
: Option.getOrElse(config.xdgConfigHome, () => path.join(homeDirectory, ".config"));
154-
const baseDir = Option.getOrElse(config.t3Home, () => path.join(homeDirectory, ".t3"));
154+
const baseDir = Option.getOrElse(config.t3Home, () => path.join(homeDirectory, ".pearce-codes"));
155155
const rootDir = path.resolve(input.dirname, "../../..");
156156
const appRoot = input.isPackaged ? input.appPath : rootDir;
157157
const branding = resolveDesktopAppBranding({

apps/desktop/src/app/DesktopObservability.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const makeEnvironmentLayer = (baseDir: string) =>
5555
Layer.mergeAll(
5656
NodeServices.layer,
5757
DesktopConfig.layerTest({
58-
T3CODE_HOME: baseDir,
58+
PEARCE_CODES_HOME: baseDir,
5959
VITE_DEV_SERVER_URL: "http://127.0.0.1:5733",
6060
}),
6161
),

apps/desktop/src/backend/DesktopBackendConfiguration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function makeEnvironmentLayer(
5858
Layer.mergeAll(
5959
NodeServices.layer,
6060
DesktopConfig.layerTest({
61-
T3CODE_HOME: baseDir,
61+
PEARCE_CODES_HOME: baseDir,
6262
T3CODE_PORT: "9999",
6363
T3CODE_MODE: "desktop",
6464
T3CODE_DESKTOP_LAN_HOST: "192.168.1.50",

apps/desktop/src/backend/DesktopServerExposure.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ function makeEnvironmentLayer(baseDir: string, env: Record<string, string | unde
7777
runningUnderArm64Translation: false,
7878
}).pipe(
7979
Layer.provide(
80-
Layer.mergeAll(NodeServices.layer, DesktopConfig.layerTest({ T3CODE_HOME: baseDir, ...env })),
80+
Layer.mergeAll(
81+
NodeServices.layer,
82+
DesktopConfig.layerTest({ PEARCE_CODES_HOME: baseDir, ...env }),
83+
),
8184
),
8285
);
8386
}
@@ -87,7 +90,7 @@ function makeLayer(input: {
8790
readonly networkInterfaces?: DesktopNetworkInterfaces;
8891
readonly env?: Record<string, string | undefined>;
8992
}) {
90-
const env = { T3CODE_HOME: input.baseDir, ...input.env };
93+
const env = { PEARCE_CODES_HOME: input.baseDir, ...input.env };
9194
const environmentLayer = makeEnvironmentLayer(input.baseDir, env);
9295
const networkLayer = Layer.succeed(DesktopServerExposure.DesktopNetworkInterfacesService, {
9396
read: Effect.succeed(input.networkInterfaces ?? emptyNetworkInterfaces),

apps/desktop/src/settings/DesktopAppSettings.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function makeEnvironmentLayer(baseDir: string, appVersion = "0.0.17") {
3939
runningUnderArm64Translation: false,
4040
}).pipe(
4141
Layer.provide(
42-
Layer.mergeAll(NodeServices.layer, DesktopConfig.layerTest({ T3CODE_HOME: baseDir })),
42+
Layer.mergeAll(NodeServices.layer, DesktopConfig.layerTest({ PEARCE_CODES_HOME: baseDir })),
4343
),
4444
);
4545
}

apps/desktop/src/settings/DesktopClientSettings.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function makeLayer(baseDir: string) {
4848
runningUnderArm64Translation: false,
4949
}).pipe(
5050
Layer.provide(
51-
Layer.mergeAll(NodeServices.layer, DesktopConfig.layerTest({ T3CODE_HOME: baseDir })),
51+
Layer.mergeAll(NodeServices.layer, DesktopConfig.layerTest({ PEARCE_CODES_HOME: baseDir })),
5252
),
5353
);
5454

apps/desktop/src/settings/DesktopSavedEnvironments.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function makeLayer(
104104
runningUnderArm64Translation: false,
105105
}).pipe(
106106
Layer.provide(
107-
Layer.mergeAll(NodeServices.layer, DesktopConfig.layerTest({ T3CODE_HOME: baseDir })),
107+
Layer.mergeAll(NodeServices.layer, DesktopConfig.layerTest({ PEARCE_CODES_HOME: baseDir })),
108108
),
109109
);
110110

apps/desktop/src/updates/DesktopUpdates.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function makeHarness(options: UpdatesHarnessOptions = {}) {
129129
Layer.mergeAll(
130130
NodeServices.layer,
131131
DesktopConfig.layerTest({
132-
T3CODE_HOME: `/tmp/t3-desktop-updates-test-${process.pid}`,
132+
PEARCE_CODES_HOME: `/tmp/t3-desktop-updates-test-${process.pid}`,
133133
T3CODE_DESKTOP_MOCK_UPDATES: "true",
134134
T3CODE_DESKTOP_MOCK_UPDATE_SERVER_PORT: "4141",
135135
...options.env,
@@ -146,7 +146,7 @@ function makeHarness(options: UpdatesHarnessOptions = {}) {
146146
Layer.provideMerge(DesktopAppSettings.layer),
147147
Layer.provideMerge(
148148
DesktopConfig.layerTest({
149-
T3CODE_HOME: `/tmp/t3-desktop-updates-test-${process.pid}`,
149+
PEARCE_CODES_HOME: `/tmp/t3-desktop-updates-test-${process.pid}`,
150150
T3CODE_DESKTOP_MOCK_UPDATES: "true",
151151
T3CODE_DESKTOP_MOCK_UPDATE_SERVER_PORT: "4141",
152152
...options.env,

0 commit comments

Comments
 (0)