-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix(cli): use Kilo cache for npm packages #9581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@kilocode/cli": patch | ||
| --- | ||
|
|
||
| Install npm-managed plugins and runtime packages under Kilo's cache directory. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,9 @@ import path from "path" | |
| import { describe, expect, test } from "bun:test" | ||
| import { Npm } from "../src/npm" | ||
| import { tmpdir } from "./fixture/fixture" | ||
| // kilocode_change start | ||
| import { Global } from "../src/global" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Kilo-specific test changes need annotation coverage
|
||
| // kilocode_change end | ||
|
|
||
| const win = process.platform === "win32" | ||
| const writePackage = (dir: string, pkg: Record<string, unknown>) => | ||
|
|
@@ -51,5 +54,19 @@ describe("Npm.install", () => { | |
|
|
||
| await expect(fs.stat(path.join(tmp.path, "node_modules", "prod-pkg"))).resolves.toBeDefined() | ||
| await expect(fs.stat(path.join(tmp.path, "node_modules", "dev-pkg"))).rejects.toThrow() | ||
| }) // kilocode_change | ||
| }) // kilocode_change | ||
|
|
||
| // kilocode_change start - Kilo should not inherit opencode-branded npm cache paths. | ||
| describe("Npm.add", () => { | ||
| test("uses Kilo cache path", async () => { | ||
| const dir = path.join(Global.Path.cache, "packages", "acme", "node_modules", ".bin") | ||
| await fs.mkdir(dir, { recursive: true }) | ||
| await Bun.write(path.join(dir, "acme"), "#!/usr/bin/env node\n") | ||
|
|
||
| const result = await Npm.which("acme") | ||
|
|
||
| expect(result).toBe(path.join(dir, "acme")) | ||
| }) | ||
| }) | ||
| // kilocode_change end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WARNING: Kilo-specific change is outside the annotation block
This line is the actual default-layer switch from the shared opencode global paths to Kilo paths, but it is not covered by a
kilocode_changemarker. The opencode annotation check scans added lines in sharedpackages/opencodefiles, so this and the related unmarked changed lines will fail CI unless they are covered by an inline marker or surrounding block.