diff --git a/.gitignore b/.gitignore index 701ad4089f..3ac5a88fdf 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ node_modules *.log *.tsbuildinfo apps/*/dist -apps/*/dist-electron packages/*/dist .env .env.local diff --git a/.oxfmtrc.json b/.oxfmtrc.json index 8bb9df7241..561b8b83f4 100644 --- a/.oxfmtrc.json +++ b/.oxfmtrc.json @@ -3,7 +3,6 @@ "ignorePatterns": [ ".plans", "dist", - "dist-electron", "node_modules", "bun.lock", "*.tsbuildinfo" diff --git a/.oxlintrc.json b/.oxlintrc.json index d45179a4c4..d112b92ce8 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -1,6 +1,6 @@ { "$schema": "./node_modules/oxlint/configuration_schema.json", - "ignorePatterns": ["dist", "dist-electron", "node_modules", "bun.lock", "*.tsbuildinfo"], + "ignorePatterns": ["dist", "node_modules", "bun.lock", "*.tsbuildinfo"], "plugins": ["eslint", "oxc", "react", "unicorn", "typescript"], "categories": { "correctness": "warn", diff --git a/README.md b/README.md index e1389eb4a4..df2c0e171f 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,18 @@ Current implementation is: 2. Provider-ready: renderer speaks a provider abstraction so Claude Code can plug in later. 3. Typed end-to-end: contracts validate payloads across the WebSocket boundary. +## Quickstart + +```bash +npx t3 +``` + +On launch, `t3`: + +1. starts a local WebSocket runtime (`127.0.0.1`), +2. serves the web UI in your browser, +3. auto-connects to your current working directory as the default project. + ## Workspace layout - `/apps/t3`: CLI launcher + local WebSocket runtime server. diff --git a/apps/renderer/index.html b/apps/renderer/index.html index c2c8793a7c..d8fd8a14ea 100644 --- a/apps/renderer/index.html +++ b/apps/renderer/index.html @@ -3,7 +3,7 @@ - Electron Todo + CodeThing
diff --git a/apps/renderer/vite.config.ts b/apps/renderer/vite.config.ts index e57fcd856a..d4875ae61e 100644 --- a/apps/renderer/vite.config.ts +++ b/apps/renderer/vite.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ tailwindcss(), ], server: { - port: Number(process.env.ELECTRON_RENDERER_PORT ?? 5173), + port: Number(process.env.T3_WEB_PORT ?? 5173), strictPort: true, }, build: { diff --git a/apps/t3/package.json b/apps/t3/package.json index eb518cd1f2..dd8844e8ad 100644 --- a/apps/t3/package.json +++ b/apps/t3/package.json @@ -1,5 +1,5 @@ { - "name": "t3", + "name": "@acme/t3-runtime", "version": "0.0.0", "private": true, "bin": { @@ -8,7 +8,7 @@ "type": "module", "scripts": { "dev": "tsx src/cli.ts", - "build": "tsup src/cli.ts --format esm --dts --clean", + "build": "tsup --config tsup.config.ts", "typecheck": "tsc --noEmit", "test": "vitest run --passWithNoTests" }, diff --git a/apps/t3/tsconfig.json b/apps/t3/tsconfig.json index 374bac5520..037bd16c40 100644 --- a/apps/t3/tsconfig.json +++ b/apps/t3/tsconfig.json @@ -3,5 +3,5 @@ "compilerOptions": { "types": ["node"] }, - "include": ["src"] + "include": ["src", "tsup.config.ts"] } diff --git a/apps/t3/tsup.config.ts b/apps/t3/tsup.config.ts new file mode 100644 index 0000000000..dcd1efb243 --- /dev/null +++ b/apps/t3/tsup.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: ["src/cli.ts"], + format: ["esm"], + dts: true, + clean: true, + noExternal: ["@acme/contracts"], + outDir: "dist", +}); diff --git a/bun.lock b/bun.lock index 0d6e56b087..c0aa50a704 100644 --- a/bun.lock +++ b/bun.lock @@ -4,6 +4,10 @@ "workspaces": { "": { "name": "ct-round-5", + "dependencies": { + "ws": "^8.18.0", + "zod": "^3.24.1", + }, "devDependencies": { "oxfmt": "^0.28.0", "oxlint": "^1.43.0", @@ -50,7 +54,7 @@ }, }, "apps/t3": { - "name": "t3", + "name": "@acme/t3-runtime", "version": "0.0.0", "bin": { "t3": "dist/cli.js", @@ -87,6 +91,8 @@ "@acme/runtime": ["@acme/runtime@workspace:apps/desktop"], + "@acme/t3-runtime": ["@acme/t3-runtime@workspace:apps/t3"], + "@babel/code-frame": ["@babel/code-frame@7.29.0", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="], "@babel/compat-data": ["@babel/compat-data@7.29.0", "", {}, "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg=="], @@ -701,8 +707,6 @@ "sucrase": ["sucrase@3.35.1", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.2", "commander": "^4.0.0", "lines-and-columns": "^1.1.6", "mz": "^2.7.0", "pirates": "^4.0.1", "tinyglobby": "^0.2.11", "ts-interface-checker": "^0.1.9" }, "bin": { "sucrase": "bin/sucrase", "sucrase-node": "bin/sucrase-node" } }, "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw=="], - "t3": ["t3@workspace:apps/t3"], - "tailwindcss": ["tailwindcss@4.1.18", "", {}, "sha512-4+Z+0yiYyEtUVCScyfHCxOYP06L5Ne+JiHhY2IjR2KWMIWhJOYZKLSGZaP5HkZ8+bY0cxfzwDE5uOmzFXyIwxw=="], "tapable": ["tapable@2.3.0", "", {}, "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg=="], diff --git a/package.json b/package.json index 49c42ddeb1..afd4f3d7fa 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,15 @@ { "name": "t3", + "version": "0.1.0", "private": false, "bin": { "t3": "apps/t3/dist/cli.js" }, + "files": [ + "apps/t3/dist/**", + "apps/renderer/dist/**", + "README.md" + ], "workspaces": [ "apps/*", "packages/*" @@ -15,8 +21,13 @@ "lint": "oxlint --report-unused-disable-directives", "test": "turbo run test", "fmt": "oxfmt", + "prepack": "bun run build", "build:contracts": "bun run --cwd packages/contracts build" }, + "dependencies": { + "ws": "^8.18.0", + "zod": "^3.24.1" + }, "devDependencies": { "oxfmt": "^0.28.0", "oxlint": "^1.43.0", diff --git a/turbo.json b/turbo.json index 89fbd7b969..44828ecc94 100644 --- a/turbo.json +++ b/turbo.json @@ -1,10 +1,10 @@ { "$schema": "https://turbo.build/schema.json", - "globalEnv": ["ELECTRON_RENDERER_PORT"], + "globalEnv": ["T3_BACKEND_PORT", "T3_WEB_PORT"], "tasks": { "build": { "dependsOn": ["^build"], - "outputs": ["dist/**", "dist-electron/**"] + "outputs": ["dist/**"] }, "dev": { "cache": false, @@ -17,11 +17,6 @@ "test": { "dependsOn": ["^build"], "outputs": [] - }, - "smoke-test": { - "dependsOn": ["build"], - "cache": false, - "outputs": [] } } }