diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fcc9926..4bbdd08 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,35 +9,6 @@ permissions: contents: read jobs: - verify-jsr: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - submodules: true - persist-credentials: false - - - name: setup deno - uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4 - with: - deno-version: v2.x - - - name: build wasm - run: make - - - name: Get Version - id: vars - run: echo "version=$(echo "${GITHUB_REF_NAME}" | sed 's/^v//')" >> $GITHUB_OUTPUT - - - name: Build JSR - run: deno task build:jsr "${STEPS_VARS_OUTPUTS_VERSION}" - env: - STEPS_VARS_OUTPUTS_VERSION: ${{steps.vars.outputs.version}} - - - name: dry run publish - run: deno publish --dry-run --allow-dirty - verify-npm: runs-on: ubuntu-latest steps: @@ -82,7 +53,7 @@ jobs: path: ./build/npm publish-npm: - needs: [verify-jsr, verify-npm] + needs: [verify-npm] runs-on: ubuntu-latest permissions: contents: read @@ -105,37 +76,3 @@ jobs: - name: Publish NPM run: npm publish --access=public --tag=latest working-directory: ./build/npm - - publish-jsr: - needs: [verify-jsr, verify-npm] - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - - steps: - - name: checkout - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - submodules: true - persist-credentials: false - - - name: setup deno - uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4 - with: - deno-version: v2.x - - - name: build wasm - run: make - - - name: Get Version - id: vars - run: echo "version=$(echo "${GITHUB_REF_NAME}" | sed 's/^v//')" >> $GITHUB_OUTPUT - - - name: Build JSR - run: deno task build:jsr "${STEPS_VARS_OUTPUTS_VERSION}" - env: - STEPS_VARS_OUTPUTS_VERSION: ${{steps.vars.outputs.version}} - - - name: Publish JSR - run: deno publish --allow-dirty diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index 31698f3..a13644c 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -82,30 +82,6 @@ jobs: - name: test run: deno task test - jsr: - needs: test - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - with: - submodules: true - persist-credentials: false - - - name: setup deno - uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4 - with: - deno-version: v2.x - - - name: build wasm - run: make - - - name: Build JSR - run: deno task build:jsr 0.0.0-verify.0 - - - name: dry run publish - run: deno publish --dry-run --allow-dirty - npm: needs: test runs-on: ubuntu-latest diff --git a/BUILD.md b/BUILD.md index 4946ba1..ee34081 100644 --- a/BUILD.md +++ b/BUILD.md @@ -1,6 +1,6 @@ -# Building clayterm from source +# Building @bomb.sh/tty from source -This guide is for maintainers and builders working on clayterm itself. +This guide is for maintainers and builders working on `@bomb.sh/tty` itself. It covers: @@ -10,7 +10,7 @@ It covers: - building the local development artifacts, and - verifying that the repo is ready for development. -It does **not** cover npm/JSR packaging or publishing. +It does **not** cover npm packaging or publishing. ## What the local build produces @@ -30,8 +30,8 @@ The build depends on the `clay` git submodule. Preferred fresh clone: ```sh -git clone --recurse-submodules https://github.com/bombshell-dev/clayterm.git -cd clayterm +git clone --recurse-submodules https://github.com/bombshell-dev/tty.git +cd tty ``` If you already cloned without submodules: @@ -77,7 +77,7 @@ Then install LLVM and Deno with Homebrew: brew install llvm deno ``` -Use Homebrew LLVM before Apple's system `clang` when building clayterm: +Use Homebrew LLVM before Apple's system `clang` when building `@bomb.sh/tty`: ```sh echo 'export PATH="$(brew --prefix llvm)/bin:$PATH"' >> ~/.zshrc @@ -290,7 +290,5 @@ This document is intentionally limited to local source builds for development. Out of scope: - `deno task build:npm` -- `deno task build:jsr` - `npm publish` -- `deno publish` - release tagging and package publishing workflows diff --git a/README.md b/README.md index 4d55961..123dcad 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,30 @@ -# clayterm +# @bomb.sh/tty A low-level, platform-independent terminal renderer and event parser for -JavaScript. You can use clayterm directly, or as the foundation for your own -framework. +JavaScript. You can use `@bomb.sh/tty` directly, or as the foundation for your +own framework. ## Features **Declarative terminal UI** — Build terminal interfaces the same way you'd build -a web page. Clayterm uses [Clay](https://github.com/nicbarker/clay) under the -hood, giving you flexbox-like layout, pointer detection, and scroll containers — -all rendered to the terminal as box-drawing characters and ANSI escape -sequences. +a web page. `@bomb.sh/tty` uses [Clay](https://github.com/nicbarker/clay) under +the hood, giving you flexbox-like layout, pointer detection, and scroll +containers — all rendered to the terminal as box-drawing characters and ANSI +escape sequences. -**Zero I/O** — Clayterm never reads stdin or writes stdout. You feed it bytes -and get bytes back. This makes it trivially embeddable in any framework, any -runtime, any event loop. There are no opinions about how you do I/O, just pure -computation. +**Zero I/O** — `@bomb.sh/tty` never reads stdin or writes stdout. You feed it +bytes and get bytes back. This makes it trivially embeddable in any framework, +any runtime, any event loop. There are no opinions about how you do I/O, just +pure computation. -**Runs everywhere** — The entire engine is compiled to WebAssembly, so clayterm -will run anywhere JavaScript runs with no native dependencies, and no build step -for consumers. +**Runs everywhere** — The entire engine is compiled to WebAssembly, so +`@bomb.sh/tty` will run anywhere JavaScript runs with no native dependencies, +and no build step for consumers. ### Examples See this keyboard example and more in the [examples folder](examples/README.md). -This demo uses Clayterm for all layout and input parsing. +This demo uses `@bomb.sh/tty` for all layout and input parsing. #### Keyboard Events @@ -42,9 +42,9 @@ state. Clay drives the hit testing; no manual coordinate math required. ## Architecture -Clayterm does not do any I/O itself. On the ouput side, it converts UI elements -into a raw sequence of bytes and pointer events, and on the input side, it -converts a stream of raw bytes into structured events. +`@bomb.sh/tty` does not do any I/O itself. On the ouput side, it converts UI +elements into a raw sequence of bytes and pointer events, and on the input side, +it converts a stream of raw bytes into structured events. ### Output @@ -117,7 +117,7 @@ To render this: ``` ```typescript -import { close, createTerm, grow, open, rgba, text } from "clayterm"; +import { close, createTerm, grow, open, rgba, text } from "@bomb.sh/tty"; let term = await createTerm({ width: 80, height: 24 }); @@ -146,8 +146,8 @@ process.stdout.write(output); ### Pointer detection -Pass pointer state to `render()` to have clayterm do hit detection and return -pointer events in addition to the byte sequence. +Pass pointer state to `render()` to have `@bomb.sh/tty` do hit detection and +return pointer events in addition to the byte sequence. ```typescript let { output, events } = term.render( @@ -186,7 +186,7 @@ process.stdout.write(output); ### Input parsing ```typescript -import { createInput } from "clayterm/input"; +import { createInput } from "@bomb.sh/tty/input"; let input = await createInput({ escLatency: 25 }); diff --git a/deno.json b/deno.json index 901feb9..f6bcb17 100644 --- a/deno.json +++ b/deno.json @@ -1,12 +1,11 @@ { - "name": "@clayterm/clayterm", + "name": "@bomb.sh/tty", "license": "MIT", "tasks": { "test": "deno test", "fmt": "deno fmt && clang-format -i src/*.c src/*.h", "fmt:check": "deno fmt --check && clang-format --dry-run --Werror src/*.c src/*.h", "build:npm": "deno run -A tasks/build-npm.ts", - "build:jsr": "deno run -A tasks/build-jsr.ts", "bench": "deno run -A bench/mod.ts" }, "imports": { @@ -23,10 +22,6 @@ ".": "./mod.ts", "./validate": "./validate.ts" }, - "publish": { - "include": ["*.ts"], - "exclude": ["!wasm.ts"] - }, "nodeModulesDir": "auto", "fmt": { "exclude": ["clay", "build"] diff --git a/lint/prefer-let.ts b/lint/prefer-let.ts index 8e6f26a..2960d13 100644 --- a/lint/prefer-let.ts +++ b/lint/prefer-let.ts @@ -1,7 +1,7 @@ type VariableDeclaration = Deno.lint.VariableDeclaration; const plugin: Deno.lint.Plugin = { - name: "clayterm", + name: "tty", rules: { "prefer-let": { create(context) { diff --git a/ops.ts b/ops.ts index 131a796..c5d7ca9 100644 --- a/ops.ts +++ b/ops.ts @@ -64,7 +64,7 @@ function packString( let next = o + 4 + paddedLength; if (next > end) { throw new RangeError( - `clayterm transfer buffer capacity exceeded while packing ${context} ` + + `transfer buffer capacity exceeded while packing ${context} ` + `(${next} byte offset, ${end} byte limit). ` + `Render a smaller visible slice or reduce frame content.`, ); diff --git a/tasks/build-jsr.ts b/tasks/build-jsr.ts deleted file mode 100644 index bf45f1c..0000000 --- a/tasks/build-jsr.ts +++ /dev/null @@ -1,15 +0,0 @@ -import jsonDeno from "../deno.json" with { type: "json" }; - -const [version] = Deno.args; - -if (!version) { - throw new Error("a version argument is required to build the jsr package"); -} - -await Deno.writeTextFile( - new URL("../deno.json", import.meta.url), - JSON.stringify({ - ...jsonDeno, - version, - }), -); diff --git a/tasks/build-npm.ts b/tasks/build-npm.ts index da64792..bae171d 100644 --- a/tasks/build-npm.ts +++ b/tasks/build-npm.ts @@ -23,17 +23,17 @@ await build({ }, skipSourceOutput: true, package: { - name: "clayterm", + name: "@bomb.sh/tty", version, description: "A terminal rendering backend for Clay, compiled to WebAssembly", license: "MIT", repository: { type: "git", - url: "git+https://github.com/bombshell-dev/clayterm.git", + url: "git+https://github.com/bombshell-dev/tty.git", }, bugs: { - url: "https://github.com/bombshell-dev/clayterm/issues", + url: "https://github.com/bombshell-dev/tty/issues", }, engines: { node: ">= 22",