refactor: resolve comments

This commit is contained in:
Catriel Müller
2026-05-18 11:45:36 -03:00
parent ad8d57707d
commit 2aa1b95074
24 changed files with 359 additions and 118 deletions
@@ -5,8 +5,8 @@ test("fixScripts preserves Kilo-only root scripts from base", () => {
const ours = {
scripts: {
"dev-setup": "kilo dev-setup",
"postinstall": "bun run --cwd packages/opencode fix-node-pty && bun run script/setup-git.ts",
"extension": "bun --cwd packages/kilo-vscode script/launch.ts",
postinstall: "bun run --cwd packages/opencode fix-node-pty && bun run script/setup-git.ts",
extension: "bun --cwd packages/kilo-vscode script/launch.ts",
},
}
const pkg: Record<string, unknown> = {
@@ -25,7 +25,7 @@ test("fixScripts preserves Kilo-only root scripts from base", () => {
test("fixScripts removes upstream-only dead scripts from root", () => {
const pkg: Record<string, unknown> = {
scripts: {
"dev": "bun run --cwd packages/opencode src/index.ts",
dev: "bun run --cwd packages/opencode src/index.ts",
"dev:desktop": "bun --cwd packages/desktop-electron dev",
"dev:web": "bun --cwd packages/app dev",
"dev:console": "ulimit -n 10240 2>/dev/null; bun run --cwd packages/console/app dev",
@@ -247,7 +247,12 @@ const DELETE_UPSTREAM_CATALOG: Record<string, string[]> = {
* Re-apply Kilo-specific scripts on top of the upstream-shaped scripts block,
* and prune upstream-only scripts that target packages Kilo doesn't ship.
*/
export function fixScripts(pkg: Record<string, unknown>, path: string, ours: Record<string, unknown> | null, changes: string[]): void {
export function fixScripts(
pkg: Record<string, unknown>,
path: string,
ours: Record<string, unknown> | null,
changes: string[],
): void {
const theirs = (pkg.scripts as Record<string, string> | undefined) || {}
const oursScripts = (ours?.scripts as Record<string, string> | undefined) || {}