initial commit

This commit is contained in:
-Puter
2026-07-19 02:46:47 +05:30
commit 8033a8edb0
121 changed files with 7845 additions and 0 deletions

1
apps/desktop/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
artifacts

View File

@@ -0,0 +1,35 @@
import type { ElectrobunConfig } from "electrobun";
const webBuildDir = "../web/build/client";
export default {
app: {
name: "code",
identifier: "dev.bettertstack.code.desktop",
version: "0.0.1",
},
runtime: {
exitOnLastWindowClosed: true,
},
build: {
bun: {
entrypoint: "src/bun/index.ts",
},
copy: {
[webBuildDir]: "views/mainview",
},
watchIgnore: [`${webBuildDir}/**`],
mac: {
bundleCEF: true,
defaultRenderer: "cef",
},
linux: {
bundleCEF: true,
defaultRenderer: "cef",
},
win: {
bundleCEF: true,
defaultRenderer: "cef",
},
},
} satisfies ElectrobunConfig;

23
apps/desktop/package.json Normal file
View File

@@ -0,0 +1,23 @@
{
"name": "desktop",
"private": true,
"type": "module",
"scripts": {
"start": "electrobun dev",
"dev:hmr": "concurrently \"bun run hmr\" \"electrobun dev --watch\"",
"hmr": "vp run --filter web dev",
"build": "vp run --filter web build && electrobun build",
"build:stable": "vp run --filter web build && electrobun build --env=stable",
"build:canary": "vp run --filter web build && electrobun build --env=canary",
"check-types": "tsc --noEmit"
},
"dependencies": {
"electrobun": "^1.18.1"
},
"devDependencies": {
"@types/bun": "^1.3.14",
"@types/three": "^0.165.0",
"concurrently": "^10.0.3",
"typescript": "^6"
}
}

View File

@@ -0,0 +1,34 @@
import { BrowserWindow, Updater } from "electrobun/bun";
const DEV_SERVER_PORT = 5173;
const DEV_SERVER_URL = `http://localhost:${DEV_SERVER_PORT}`;
async function getMainViewUrl(): Promise<string> {
const channel = await Updater.localInfo.channel();
if (channel === "dev") {
try {
await fetch(DEV_SERVER_URL, { method: "HEAD" });
console.log(`HMR enabled: Using web dev server at ${DEV_SERVER_URL}`);
return DEV_SERVER_URL;
} catch {
console.log("Web dev server not running. Run dev:hmr for live reload.");
}
}
return "views://mainview/index.html";
}
const url = await getMainViewUrl();
new BrowserWindow({
title: "code",
url,
frame: {
width: 1280,
height: 820,
x: 120,
y: 120,
},
});
console.log("Electrobun desktop shell started.");

View File

@@ -0,0 +1,15 @@
{
"extends": "../../packages/config/tsconfig.base.json",
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"noEmit": true,
"paths": {
"@/*": ["./src/*"]
},
"strictNullChecks": true
},
"include": ["src/**/*.ts", "electrobun.config.ts"]
}