Harden t3 packaging for npx distribution

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-09 22:08:41 +00:00
1 parent 6dc4c80bc9
commit 29aeea5bdb
12 files changed
+48 -18

No files matched your search

-1
View File
@@ -5,7 +5,6 @@ node_modules
*.log
*.tsbuildinfo
apps/*/dist
apps/*/dist-electron
packages/*/dist
.env
.env.local
-1
View File
@@ -3,7 +3,6 @@
"ignorePatterns": [
".plans",
"dist",
"dist-electron",
"node_modules",
"bun.lock",
"*.tsbuildinfo"
+1 -1
View File
@@ -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",
+12
View File
@@ -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.
+1 -1
View File
@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Electron Todo</title>
<title>CodeThing</title>
</head>
<body>
<div id="root"></div>
+1 -1
View File
@@ -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: {
+2 -2
View File
@@ -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"
},
+1 -1
View File
@@ -3,5 +3,5 @@
"compilerOptions": {
"types": ["node"]
},
"include": ["src"]
"include": ["src", "tsup.config.ts"]
}
+10
View File
@@ -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",
});
+7 -3
View File
@@ -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/[email protected]", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="],
"@babel/compat-data": ["@babel/[email protected]", "", {}, "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg=="],
@@ -701,8 +707,6 @@
"sucrase": ["[email protected]", "", { "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": ["[email protected]", "", {}, "sha512-4+Z+0yiYyEtUVCScyfHCxOYP06L5Ne+JiHhY2IjR2KWMIWhJOYZKLSGZaP5HkZ8+bY0cxfzwDE5uOmzFXyIwxw=="],
"tapable": ["[email protected]", "", {}, "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg=="],
+11
View File
@@ -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",
+2 -7
View File
@@ -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": []
}
}
}