diff --git a/package-lock.json b/package-lock.json index 3e8f801..242d8a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,10 +9,10 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "@kud/ink-ui": "0.32.0", + "@kud/ink-ui": "0.44.1", "@opencode/client": "2.1.0", - "ink": "7.1.1", - "react": "19.2.8" + "ink": "8.0.0", + "react": "19.3.1" }, "bin": { "ocs": "dist/cli.js", @@ -20,7 +20,7 @@ }, "devDependencies": { "@types/node": "26.5.0", - "@types/react": "19.2.18", + "@types/react": "19.3.0", "ink-testing-library": "4.0.0", "tsup": "8.5.1", "tsx": "4.23.15", @@ -535,9 +535,9 @@ } }, "node_modules/@kud/ink-ui": { - "version": "0.32.0", - "resolved": "https://registry.npmjs.org/@kud/ink-ui/-/ink-ui-0.32.0.tgz", - "integrity": "sha512-BF+gLI/4b6BF/XLzKH31iUCiOHTPZEDXaTrPa4xY1Uh12taAvqg0BPi7NnAtC60lf9yXWVhxlCauAfKGzIMLgw==", + "version": "0.44.1", + "resolved": "https://registry.npmjs.org/@kud/ink-ui/-/ink-ui-0.44.1.tgz", + "integrity": "sha512-6DXN7hSklN5AEgDiUb/QtQQ6e3dFZPIfrf1O5AmlEHuEWtuOz5r5SvKDAos01iD2G2tvAjSSk6mpJDYIpIYNFA==", "license": "MIT", "dependencies": { "@kud/glyphs": "0.4.0", @@ -561,9 +561,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -742,9 +739,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -763,9 +757,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -784,9 +775,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -805,9 +793,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -826,9 +811,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -847,9 +829,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1014,9 +993,6 @@ "arm" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1031,9 +1007,6 @@ "arm" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1048,9 +1021,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1065,9 +1035,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1082,9 +1049,6 @@ "loong64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1099,9 +1063,6 @@ "loong64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1116,9 +1077,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1133,9 +1091,6 @@ "ppc64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1150,9 +1105,6 @@ "riscv64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1167,9 +1119,6 @@ "riscv64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1184,9 +1133,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1201,9 +1147,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1218,9 +1161,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1353,9 +1293,9 @@ } }, "node_modules/@types/react": { - "version": "19.2.18", - "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.18.tgz", - "integrity": "sha512-AnzbBERsrLKtk2XSfTbYRLjQPdy116Sty4q+T+Bp3IC4l6jNBvreVPAHmpq9qhXQM7CXZPjLVmGMw9sy+hxQ3w==", + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.0.tgz", + "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==", "devOptional": true, "license": "MIT", "dependencies": { @@ -1528,12 +1468,12 @@ } }, "node_modules/chalk": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", - "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-6.0.1.tgz", + "integrity": "sha512-/Ce6KNm3vIbWdMlNna6RVIZ/ICQxnJxCicet5LBKK9ZffBkqzDw0xh9EiKSljdRtiIQ1S1z4YgcscUUGzNCWrA==", "license": "MIT", "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" + "node": ">=22" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" @@ -1887,43 +1827,41 @@ } }, "node_modules/ink": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/ink/-/ink-7.1.1.tgz", - "integrity": "sha512-Y43xxa1ZSPvpmfLHcN5o+OdP8Rf8ykkNJEuKYOUNZKT8wXVNLFTtEm1nSDMQkfBH+YANF4Xuu0hhZ4ejqAtN2w==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/ink/-/ink-8.0.0.tgz", + "integrity": "sha512-M2aFwZOqmkFxCwedy6xrP4E+DGoK57iahAFnfTqNyOyJ54O7DZzu027z/NI8EGy44Sw9O9BcbTF4QEUS2GHAtg==", "license": "MIT", "dependencies": { - "@alcalzone/ansi-tokenize": "^0.3.0", + "@alcalzone/ansi-tokenize": "^0.3.1", "ansi-escapes": "^7.3.0", - "ansi-styles": "^6.2.3", + "ansi-styles": "^7.0.0", "auto-bind": "^5.0.1", - "chalk": "^5.6.2", + "chalk": "^6.0.1", "cli-boxes": "^4.0.1", "cli-cursor": "^4.0.0", "cli-truncate": "^6.0.0", "code-excerpt": "^4.0.0", - "es-toolkit": "^1.45.1", + "es-toolkit": "^1.52.0", "indent-string": "^5.0.0", "is-in-ci": "^2.0.0", "patch-console": "^2.0.0", - "react-reconciler": "^0.33.0", - "scheduler": "^0.27.0", + "quick-lru": "^7.3.0", + "react-reconciler": "^0.34.0", "signal-exit": "^3.0.7", - "slice-ansi": "^9.0.0", "stack-utils": "^2.0.6", - "string-width": "^8.2.0", + "string-width": "^8.3.0", "terminal-size": "^4.0.1", - "type-fest": "^5.5.0", + "type-fest": "^5.10.0", "widest-line": "^6.0.0", - "wrap-ansi": "^10.0.0", - "ws": "^8.20.0", + "wrap-ansi": "^10.0.2", "yoga-layout": "~3.2.1" }, "engines": { "node": ">=22" }, "peerDependencies": { - "@types/react": ">=19.2.0", - "react": ">=19.2.0", + "@types/react": ">=19.3.0", + "react": ">=19.3.0", "react-devtools-core": ">=6.1.2" }, "peerDependenciesMeta": { @@ -1953,6 +1891,34 @@ } } }, + "node_modules/ink/node_modules/ansi-styles": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-7.0.0.tgz", + "integrity": "sha512-kKvt3m4uwzqL0wlkPd09CmljPJGOZZ4D0fP65sqFSvPkMRKhNi+74MgIJ5QxE6SxqB4t4KyUFGg8+n5zjo6hew==", + "license": "MIT", + "engines": { + "node": ">=22" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ink/node_modules/string-width": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.3.0.tgz", + "integrity": "sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==", + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.5.0", + "strip-ansi": "^7.1.2" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-fullwidth-code-point": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", @@ -2154,9 +2120,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -2179,9 +2142,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -2204,9 +2164,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -2229,9 +2186,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -2561,28 +2515,40 @@ } } }, + "node_modules/quick-lru": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-7.3.0.tgz", + "integrity": "sha512-k9lSsjl36EJdK7I06v7APZCbyGT2vMTsYSRX1Q2nbYmnkBqgUhRkAuzH08Ciotteu/PLJmIF2+tti7o3C/ts2g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/react": { - "version": "19.2.8", - "resolved": "https://registry.npmjs.org/react/-/react-19.2.8.tgz", - "integrity": "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==", + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.1.tgz", + "integrity": "sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/react-reconciler": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.33.0.tgz", - "integrity": "sha512-KetWRytFv1epdpJc3J4G75I4WrplZE5jOL7Yq0p34+OVOKF4Se7WrdIdVC45XsSSmUTlht2FM/fM1FZb1mfQeA==", + "version": "0.34.0", + "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.34.0.tgz", + "integrity": "sha512-eVibvB1fc9j5Qf1KRkiM3GzRPBdjg2P6G6QV2f3P6Eb3OGMxRBhdg2rrUwjbV5JrQaJj8nOa8uajmmJA5tJWjQ==", "license": "MIT", "dependencies": { - "scheduler": "^0.27.0" + "scheduler": "^0.28.0" }, "engines": { "node": ">=0.10.0" }, "peerDependencies": { - "react": "^19.2.0" + "react": "^19.3.0" } }, "node_modules/readdirp": { @@ -2707,9 +2673,9 @@ } }, "node_modules/scheduler": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", - "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz", + "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==", "license": "MIT" }, "node_modules/siginfo": { @@ -3769,27 +3735,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/ws": { - "version": "8.22.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.0.tgz", - "integrity": "sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==", - "license": "MIT", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/yoga-layout": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/yoga-layout/-/yoga-layout-3.2.1.tgz", diff --git a/package.json b/package.json index 4c20c11..5120727 100644 --- a/package.json +++ b/package.json @@ -12,24 +12,24 @@ "dist" ], "engines": { - "node": ">=20" + "node": ">=22" }, "scripts": { - "dev": "tsx src/cli.tsx", + "dev": "NODE_ENV=${NODE_ENV:-development} tsx src/cli.ts", "build": "tsup", "typecheck": "tsc --noEmit", "test": "vitest run", "test:watch": "vitest" }, "dependencies": { - "@kud/ink-ui": "0.32.0", + "@kud/ink-ui": "0.44.1", "@opencode/client": "2.1.0", - "ink": "7.1.1", - "react": "19.2.8" + "ink": "8.0.0", + "react": "19.3.1" }, "devDependencies": { "@types/node": "26.5.0", - "@types/react": "19.2.18", + "@types/react": "19.3.0", "ink-testing-library": "4.0.0", "tsup": "8.5.1", "tsx": "4.23.15", diff --git a/src/cli.ts b/src/cli.ts new file mode 100644 index 0000000..f2a50ea --- /dev/null +++ b/src/cli.ts @@ -0,0 +1,6 @@ +#!/usr/bin/env node +// React picks its development or production build from NODE_ENV when it is +// first loaded, so set it before the app (and with it react and ink) is imported. +process.env.NODE_ENV ??= "production" + +await import("./main.js") diff --git a/src/cli.tsx b/src/main.tsx similarity index 98% rename from src/cli.tsx rename to src/main.tsx index 573bf1f..73550e9 100644 --- a/src/cli.tsx +++ b/src/main.tsx @@ -1,4 +1,3 @@ -#!/usr/bin/env node import { readFileSync } from "node:fs" import React from "react" import { render } from "ink" diff --git a/tsup.config.ts b/tsup.config.ts index 136458c..45280d4 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -1,8 +1,8 @@ import { defineConfig } from "tsup" export default defineConfig({ - entry: ["src/cli.tsx"], + entry: ["src/cli.ts"], format: ["esm"], clean: true, - target: "node20", + target: "node22", })