diff --git a/CHANGELOG.md b/CHANGELOG.md index e9cb818..e5e7dc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project are documented here, following [Keep a Changelog](https://keepachangelog.com/) and semantic versioning. +## [0.1.10] - 2026-09-15 + +### Fixed + +- Match generated-file markers case-insensitively. + ## [0.1.9] - 2026-09-12 ### Fixed diff --git a/package.json b/package.json index 3f9e1ad..7bea5cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ctxtrim", - "version": "0.1.9", + "version": "0.1.10", "description": "Trim what bloats your AI coding context. Scan a repo, find the high-cost/low-value files ballooning your Claude Code / Cursor / Codex context, and write ignore files to cut token cost. Zero dependencies.", "type": "module", "bin": { diff --git a/src/classify.js b/src/classify.js index e648cfd..2dd9174 100644 --- a/src/classify.js +++ b/src/classify.js @@ -33,7 +33,7 @@ const BINARY_EXT = new Set([ ]); const MINIFIED = /\.(min\.(js|css|mjs)|bundle\.js|map)$/i; -const GENERATED_MARKERS = /(@generated\b|DO NOT EDIT|Code generated by|autogenerated|@auto-generated)/; +const GENERATED_MARKERS = /(@generated\b|DO NOT EDIT|Code generated by|autogenerated|@auto-generated)/i; const dirParts = (rel) => rel.split(/[\\/]/).slice(0, -1); diff --git a/test/ctxtrim.test.js b/test/ctxtrim.test.js index da50d9f..9f1e3a4 100644 --- a/test/ctxtrim.test.js +++ b/test/ctxtrim.test.js @@ -35,6 +35,11 @@ test("classify buckets files correctly", () => { assert.equal(classifyPath("big.json"), null); }); +test("generated markers are case-insensitive", () => { + assert.equal(classify("generated.js", { sample: "// do not edit" }).category, "generated"); + assert.equal(classify("generated.js", { sample: "/* @Generated by protoc */" }).category, "generated"); +}); + test("scan skips binary reads and retains content-dependent classification", (t) => { const root = mkdtempSync(join(tmpdir(), "ctxtrim-binary-read-")); t.after(() => rmSync(root, { recursive: true, force: true }));