Make mono repo (#22)

This commit is contained in:
Sebastian
2025-08-15 13:03:59 +02:00
committed by GitHub
parent 268e1da983
commit 35566b2126
112 changed files with 122 additions and 88 deletions
-5
View File
@@ -36,9 +36,4 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
# Finder (MacOS) folder config
.DS_Store
# Zig build cache
.zig-cache
zig-out
src/zig/lib
screenshot-*.png
+6 -25
View File
@@ -4,38 +4,19 @@ OpenTUI is a TypeScript library for building terminal user interfaces (TUIs). It
development and is not ready for production use. It will be the foundational TUI framework for both
[opencode](https://opencode.ai) and [terminaldotshop](https://terminal.shop).
This monorepo contains the following packages:
- [`@opentui/core`](packages/core) - The core library also works completely standalone, providing an imperative API and all the primitives.
## Install
```bash
bun install @opentui/core
```
## Build
```bash
bun run build
```
This creates platform-specific libraries that are automatically loaded by the TypeScript layer.
## Examples
## Running Examples
```bash
bun install
cd packages/core
bun run src/examples/index.ts
```
## CLI Renderer
### Renderables
Renderables are hierarchical objects that can be positioned, nested, styled and rendered to the terminal:
```typescript
import { createCliRenderer, TextRenderable } from "@opentui/core"
const renderer = await createCliRenderer()
const obj = new TextRenderable("my-obj", { content: "Hello, world!" })
renderer.root.add(obj)
```
+8 -2
View File
@@ -3,6 +3,10 @@
"workspaces": {
"": {
"name": "opentui",
},
"packages/core": {
"name": "@opentui/core",
"version": "0.1.1",
"dependencies": {
"jimp": "1.6.0",
"yoga-layout": "3.2.1",
@@ -91,6 +95,8 @@
"@jimp/utils": ["@jimp/utils@1.6.0", "", { "dependencies": { "@jimp/types": "1.6.0", "tinycolor2": "^1.6.0" } }, "sha512-gqFTGEosKbOkYF/WFj26jMHOI5OH2jeP1MmC/zbK6BF6VJBf8rIC5898dPfSzZEbSA0wbbV5slbntWVc5PKLFA=="],
"@opentui/core": ["@opentui/core@workspace:packages/core"],
"@opentui/core-darwin-arm64": ["@opentui/core-darwin-arm64@0.1.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-qz6ATFSoHIlHYtaIUZuHTJaGa6dZ7AWccCOW9C3V774ZUvhbx6FjMABVvX2XYemnA0AHNZzUdmqpDty2j3VIWQ=="],
"@opentui/core-darwin-x64": ["@opentui/core-darwin-x64@0.1.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-lyNmS6aB9oO9elxfu6tQsliwq36vnLrBpu5ipx34n/2TBiYPPwzJkqsYkJZxyr9SwNfBSD7Nm3LO1i4ZR4rlMw=="],
@@ -107,7 +113,7 @@
"@tweenjs/tween.js": ["@tweenjs/tween.js@23.1.3", "", {}, "sha512-vJmvvwFxYuGnF2axRtPYocag6Clbb5YS7kLL+SO/TeVFzHqDIWrNKYtcsPMibjDx9O+bu+psAy9NKfWklassUA=="],
"@types/bun": ["@types/bun@1.2.19", "", { "dependencies": { "bun-types": "1.2.19" } }, "sha512-d9ZCmrH3CJ2uYKXQIUuZ/pUnTqIvLDS0SK7pFmbx8ma+ziH/FRMoAq5bYpRG7y+w1gl+HgyNZbtqgMq4W4e2Lg=="],
"@types/bun": ["@types/bun@1.2.20", "", { "dependencies": { "bun-types": "1.2.20" } }, "sha512-dX3RGzQ8+KgmMw7CsW4xT5ITBSCrSbfHc36SNT31EOUg/LA9JWq0VDdEXDRSe1InVWpd2yLUM1FUF/kEOyTzYA=="],
"@types/node": ["@types/node@16.9.1", "", {}, "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g=="],
@@ -133,7 +139,7 @@
"buffer": ["buffer@6.0.3", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA=="],
"bun-types": ["bun-types@1.2.19", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-uAOTaZSPuYsWIXRpj7o56Let0g/wjihKCkeRqUBhlLVM/Bt+Fj9xTo+LhC1OV1XDaGkz4hNC80et5xgy+9KTHQ=="],
"bun-types": ["bun-types@1.2.20", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-pxTnQYOrKvdOwyiyd/7sMt9yFOenN004Y6O4lCcCUoKVej48FS5cvTw9geRaEcB9TsDZaJKAxPTVvi8tFsVuXA=="],
"bun-webgpu": ["bun-webgpu@0.1.3", "", { "dependencies": { "@webgpu/types": "^0.1.60" }, "optionalDependencies": { "bun-webgpu-darwin-arm64": "^0.1.3", "bun-webgpu-darwin-x64": "^0.1.3", "bun-webgpu-linux-x64": "^0.1.3", "bun-webgpu-win32-x64": "^0.1.3" } }, "sha512-IXFxaIi4rgsEEpl9n/QVDm5RajCK/0FcOXZeMb52YRjoiAR1YVYK5hLrXT8cm+KDi6LVahA9GJFqOR4yiloVCw=="],
+5 -56
View File
@@ -1,58 +1,7 @@
{
"name": "@opentui/core",
"description": "OpenTUI is a TypeScript library for building terminal user interfaces (TUIs)",
"repository": {
"type": "git",
"url": "https://github.com/sst/opentui"
},
"types": "src/index.ts",
"module": "src/index.ts",
"main": "dist/index.js",
"version": "0.1.1",
"type": "module",
"scripts": {
"build:dev": "cd src/zig && zig build -Doptimize=Debug",
"build:prod": "cd src/zig && zig build -Doptimize=ReleaseFast",
"build": "bun run build:native && bun run build:lib",
"build:lib": "node scripts/build.mjs --lib",
"build:native": "node scripts/build.mjs --native",
"pack": "node scripts/pack.mjs",
"pack:verbose": "node scripts/pack.mjs --verbose",
"publish": "node scripts/publish.mjs",
"test": "bun test",
"prettier:write": "prettier --write ."
},
"license": "MIT",
"devDependencies": {
"@types/bun": "latest",
"@types/three": "^0.177.0",
"commander": "^13.1.0",
"prettier": "3.6.2"
},
"peerDependencies": {
"typescript": "^5"
},
"prettier": {
"semi": false,
"printWidth": 120
},
"dependencies": {
"jimp": "1.6.0",
"yoga-layout": "3.2.1"
},
"optionalDependencies": {
"@dimforge/rapier2d-simd-compat": "^0.17.3",
"bun-webgpu": "0.1.3",
"planck": "^1.4.2",
"three": "0.177.0",
"@opentui/core-darwin-x64": "latest",
"@opentui/core-darwin-arm64": "latest",
"@opentui/core-linux-x64": "latest",
"@opentui/core-linux-arm64": "latest",
"@opentui/core-win32-x64": "latest",
"@opentui/core-win32-arm64": "latest"
},
"engines": {
"bun": ">=1.2.0"
}
"name": "@opentui",
"private": true,
"workspaces": [
"packages/*"
]
}
+4
View File
@@ -0,0 +1,4 @@
# Zig build cache
.zig-cache
zig-out
src/zig/lib
+41
View File
@@ -0,0 +1,41 @@
# OpenTUI Core
OpenTUI Core is a TypeScript library for building terminal user interfaces (TUIs). It is currently in
development and is not ready for production use.
## Install
```bash
bun install @opentui/core
```
## Build
```bash
bun run build
```
This creates platform-specific libraries that are automatically loaded by the TypeScript layer.
## Examples
```bash
bun install
bun run src/examples/index.ts
```
## CLI Renderer
### Renderables
Renderables are hierarchical objects that can be positioned, nested, styled and rendered to the terminal:
```typescript
import { createCliRenderer, TextRenderable } from "@opentui/core"
const renderer = await createCliRenderer()
const obj = new TextRenderable("my-obj", { content: "Hello, world!" })
renderer.root.add(obj)
```
+58
View File
@@ -0,0 +1,58 @@
{
"name": "@opentui/core",
"description": "OpenTUI is a TypeScript library for building terminal user interfaces (TUIs)",
"repository": {
"type": "git",
"url": "https://github.com/sst/opentui"
},
"types": "src/index.ts",
"module": "src/index.ts",
"main": "dist/index.js",
"version": "0.1.1",
"type": "module",
"scripts": {
"build:dev": "cd src/zig && zig build -Doptimize=Debug",
"build:prod": "cd src/zig && zig build -Doptimize=ReleaseFast",
"build": "bun run build:native && bun run build:lib",
"build:lib": "node scripts/build.mjs --lib",
"build:native": "node scripts/build.mjs --native",
"pack": "node scripts/pack.mjs",
"pack:verbose": "node scripts/pack.mjs --verbose",
"publish": "node scripts/publish.mjs",
"test": "bun test",
"prettier:write": "prettier --write ."
},
"license": "MIT",
"devDependencies": {
"@types/bun": "latest",
"@types/three": "^0.177.0",
"commander": "^13.1.0",
"prettier": "3.6.2"
},
"peerDependencies": {
"typescript": "^5"
},
"prettier": {
"semi": false,
"printWidth": 120
},
"dependencies": {
"jimp": "1.6.0",
"yoga-layout": "3.2.1"
},
"optionalDependencies": {
"@dimforge/rapier2d-simd-compat": "^0.17.3",
"bun-webgpu": "0.1.3",
"planck": "^1.4.2",
"three": "0.177.0",
"@opentui/core-darwin-x64": "latest",
"@opentui/core-darwin-arm64": "latest",
"@opentui/core-linux-x64": "latest",
"@opentui/core-linux-arm64": "latest",
"@opentui/core-win32-x64": "latest",
"@opentui/core-win32-arm64": "latest"
},
"engines": {
"bun": ">=1.2.0"
}
}

Before

Width:  |  Height:  |  Size: 428 KiB

After

Width:  |  Height:  |  Size: 428 KiB

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 200 KiB

Before

Width:  |  Height:  |  Size: 378 KiB

After

Width:  |  Height:  |  Size: 378 KiB

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Before

Width:  |  Height:  |  Size: 521 KiB

After

Width:  |  Height:  |  Size: 521 KiB

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Some files were not shown because too many files have changed in this diff Show More