Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@t3tools/desktop",
"name": "@liteeditor/desktop",
"version": "0.0.13",
"private": true,
"main": "dist-electron/main.js",
Expand All @@ -23,8 +23,8 @@
"simple-git": "^3.27.0"
},
"devDependencies": {
"@t3tools/contracts": "workspace:*",
"@t3tools/shared": "workspace:*",
"@liteeditor/contracts": "workspace:*",
"@liteeditor/shared": "workspace:*",
"@types/better-sqlite3": "^7.6.13",
"@types/node": "catalog:",
"tsdown": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/liteeditor/preloadApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type IntegrationProgress = {
message?: string;
};

const commitHash = process.env.T3CODE_COMMIT_HASH ?? "unknown";
const commitHash = process.env.LITEEDITOR_COMMIT_HASH ?? "unknown";
const buildDate = process.env.BUILD_DATE ?? new Date(0).toISOString();
const homeDir = process.env.USERPROFILE || process.env.HOME || "";

Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/liteeditor/registerLiteEditorDesktop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ function registerBridgeHandlers(options: LiteEditorDesktopRegistrationOptions):
links: [
{
label: "LiteEditor",
url: "https://github.com/t3tools/t3code",
url: "https://github.com/litesuite/liteeditor",
},
],
};
Expand Down
38 changes: 19 additions & 19 deletions apps/desktop/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ import type {
DesktopTheme,
DesktopUpdateActionResult,
DesktopUpdateState,
} from "@t3tools/contracts";
} from "@liteeditor/contracts";
import { autoUpdater } from "electron-updater";

import type { ContextMenuItem } from "@t3tools/contracts";
import { NetService } from "@t3tools/shared/Net";
import { RotatingFileSink } from "@t3tools/shared/logging";
import type { ContextMenuItem } from "@liteeditor/contracts";
import { NetService } from "@liteeditor/shared/Net";
import { RotatingFileSink } from "@liteeditor/shared/logging";
import { showDesktopConfirmDialog } from "./confirmDialog";
import {
registerLiteEditorDesktop,
Expand Down Expand Up @@ -70,9 +70,9 @@ const UPDATE_STATE_CHANNEL = "desktop:update-state";
const UPDATE_GET_STATE_CHANNEL = "desktop:update-get-state";
const UPDATE_DOWNLOAD_CHANNEL = "desktop:update-download";
const UPDATE_INSTALL_CHANNEL = "desktop:update-install";
const BASE_DIR = process.env.T3CODE_HOME?.trim() || Path.join(OS.homedir(), ".t3");
const BASE_DIR = process.env.LITEEDITOR_HOME?.trim() || Path.join(OS.homedir(), ".liteeditor/ProjectData");
const STATE_DIR = Path.join(BASE_DIR, "userdata");
const DESKTOP_SCHEME = "t3";
const DESKTOP_SCHEME = "liteeditor";
const ROOT_DIR = Path.resolve(__dirname, "../../..");
const isDevelopment = Boolean(process.env.VITE_DEV_SERVER_URL);
const APP_DISPLAY_NAME = isDevelopment ? "LiteEditor (Dev)" : "LiteEditor (Alpha)";
Expand Down Expand Up @@ -372,8 +372,8 @@ function resolveEmbeddedCommitHash(): string | null {

try {
const raw = FS.readFileSync(packageJsonPath, "utf8");
const parsed = JSON.parse(raw) as { t3codeCommitHash?: unknown };
return normalizeCommitHash(parsed.t3codeCommitHash);
const parsed = JSON.parse(raw) as { liteeditorCommitHash?: unknown };
return normalizeCommitHash(parsed.liteeditorCommitHash);
} catch {
return null;
}
Expand All @@ -384,7 +384,7 @@ function resolveAboutCommitHash(): string | null {
return aboutCommitHashCache;
}

const envCommitHash = normalizeCommitHash(process.env.T3CODE_COMMIT_HASH);
const envCommitHash = normalizeCommitHash(process.env.LITEEDITOR_COMMIT_HASH);
if (envCommitHash) {
aboutCommitHashCache = envCommitHash;
return aboutCommitHashCache;
Expand Down Expand Up @@ -546,7 +546,7 @@ function handleCheckForUpdatesMenuClick(): void {
isPackaged: app.isPackaged,
platform: process.platform,
appImage: process.env.APPIMAGE,
disabledByEnv: process.env.T3CODE_DISABLE_AUTO_UPDATE === "1",
disabledByEnv: process.env.LITEEDITOR_DISABLE_AUTO_UPDATE === "1",
});
if (disabledReason) {
console.info("[desktop-updater] Manual update check requested, but updates are disabled.");
Expand Down Expand Up @@ -694,7 +694,7 @@ function resolveIconPath(ext: "ico" | "icns" | "png"): string | null {
* parentheses (e.g. `~/.config/LiteEditor (Alpha)` on Linux). This is
* unfriendly for shell usage and violates Linux naming conventions.
*
* We override it to a clean lowercase name (`t3code`). If the legacy
* We override it to a clean lowercase name (`liteeditor`). If the legacy
* directory already exists we keep using it so existing users don't
* lose their Chromium profile data (localStorage, cookies, sessions).
*/
Expand Down Expand Up @@ -765,7 +765,7 @@ function shouldEnableAutoUpdates(): boolean {
isPackaged: app.isPackaged,
platform: process.platform,
appImage: process.env.APPIMAGE,
disabledByEnv: process.env.T3CODE_DISABLE_AUTO_UPDATE === "1",
disabledByEnv: process.env.LITEEDITOR_DISABLE_AUTO_UPDATE === "1",
}) === null
);
}
Expand Down Expand Up @@ -850,7 +850,7 @@ function configureAutoUpdater(): void {
updaterConfigured = true;

const githubToken =
process.env.T3CODE_DESKTOP_UPDATE_GITHUB_TOKEN?.trim() || process.env.GH_TOKEN?.trim() || "";
process.env.LITEEDITOR_DESKTOP_UPDATE_GITHUB_TOKEN?.trim() || process.env.GH_TOKEN?.trim() || "";
if (githubToken) {
// When a token is provided, re-configure the feed with `private: true` so
// electron-updater uses the GitHub API (api.github.com) instead of the
Expand Down Expand Up @@ -949,11 +949,11 @@ function configureAutoUpdater(): void {
function backendEnv(): NodeJS.ProcessEnv {
return {
...process.env,
T3CODE_MODE: "desktop",
T3CODE_NO_BROWSER: "1",
T3CODE_PORT: String(backendPort),
T3CODE_HOME: BASE_DIR,
T3CODE_AUTH_TOKEN: backendAuthToken,
LITEEDITOR_MODE: "desktop",
LITEEDITOR_NO_BROWSER: "1",
LITEEDITOR_PORT: String(backendPort),
LITEEDITOR_HOME: BASE_DIR,
LITEEDITOR_AUTH_TOKEN: backendAuthToken,
};
}

Expand Down Expand Up @@ -1391,7 +1391,7 @@ async function bootstrap(): Promise<void> {
writeDesktopLogHeader(`reserved backend port via NetService port=${backendPort}`);
backendAuthToken = Crypto.randomBytes(24).toString("hex");
backendWsUrl = `ws://127.0.0.1:${backendPort}/?token=${encodeURIComponent(backendAuthToken)}`;
process.env.T3CODE_DESKTOP_WS_URL = backendWsUrl;
process.env.LITEEDITOR_DESKTOP_WS_URL = backendWsUrl;
writeDesktopLogHeader(`bootstrap resolved websocket url=${backendWsUrl}`);

registerIpcHandlers();
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/preload.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { contextBridge, ipcRenderer } from "electron";
import type { DesktopBridge } from "@t3tools/contracts";
import type { DesktopBridge } from "@liteeditor/contracts";
import "./liteeditor/preloadApi";

const PICK_FOLDER_CHANNEL = "desktop:pick-folder";
Expand All @@ -12,7 +12,7 @@ const UPDATE_STATE_CHANNEL = "desktop:update-state";
const UPDATE_GET_STATE_CHANNEL = "desktop:update-get-state";
const UPDATE_DOWNLOAD_CHANNEL = "desktop:update-download";
const UPDATE_INSTALL_CHANNEL = "desktop:update-install";
const wsUrl = process.env.T3CODE_DESKTOP_WS_URL ?? null;
const wsUrl = process.env.LITEEDITOR_DESKTOP_WS_URL ?? null;

contextBridge.exposeInMainWorld("desktopBridge", {
getWsUrl: () => wsUrl,
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/rotatingFileSink.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import fs from "node:fs";
import os from "node:os";
import path from "node:path";

import { RotatingFileSink } from "@t3tools/shared/logging";
import { RotatingFileSink } from "@liteeditor/shared/logging";
import { afterEach, describe, expect, it } from "vitest";

const tempRoots: string[] = [];

function makeTempDir(): string {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "t3-rotating-log-"));
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "liteeditor-rotating-log-"));
tempRoots.push(dir);
return dir;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/runtimeArch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DesktopRuntimeArch, DesktopRuntimeInfo } from "@t3tools/contracts";
import type { DesktopRuntimeArch, DesktopRuntimeInfo } from "@liteeditor/contracts";

interface ResolveDesktopRuntimeInfoInput {
readonly platform: NodeJS.Platform;
Expand Down
57 changes: 0 additions & 57 deletions apps/desktop/src/src/confirmDialog.test.ts

This file was deleted.

26 changes: 0 additions & 26 deletions apps/desktop/src/src/confirmDialog.ts

This file was deleted.

40 changes: 0 additions & 40 deletions apps/desktop/src/src/liteeditor/claude/claude-preload.ts

This file was deleted.

Loading
Loading