From cd4f4633a547231478e96e295c9adadc1becc6df Mon Sep 17 00:00:00 2001 From: Steven Syrek Date: Tue, 28 Jul 2026 11:18:12 -0400 Subject: [PATCH] chore(jest): keep haste map out of .claude agent worktrees MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit testPathIgnorePatterns already excluded worktree test files, but jest still indexed their modules, so a leftover worktree's copy of tests/__mocks__/version.ts triggered "duplicate manual mock found" on every run. modulePathIgnorePatterns closes the gap permanently, since agent worktrees may recur. Verified warning-free with a worktree present. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- CHANGELOG.md | 1 + jest.config.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cff7abc..d8265f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- **tests**: Jest's haste map no longer indexes `.claude/` (via `modulePathIgnorePatterns`). A leftover agent worktree under `.claude/worktrees/` duplicated the manual mocks in `tests/__mocks__/` and made every jest run emit a `jest-haste-map: duplicate manual mock found` warning; test files in worktrees were already excluded, but module indexing was not. Verified warning-free with a worktree present. - **BREAKING — package**: The package is now published as the scoped **`@deepl/cli`** (previously the unpublished working name `deepl-cli`). Scoped packages default to restricted visibility, so `publishConfig.access: "public"` is set explicitly — without it the publish fails. The `bin` name is unchanged: the command is still `deepl`, and scoping changes only the install string (`npm install -g @deepl/cli`). Repository, bugs, and homepage metadata now point at `github.com/DeepL/deepl-cli` directly instead of relying on the redirect from the legacy `DeepLcom` org name. - **BREAKING — cache/runtime**: The translation cache now uses Node's built-in `node:sqlite` module instead of the `better-sqlite3` native addon, and the CLI consequently requires **Node.js >= 24** (`engines.node` is now `>=24.0.0`). Node 24 is the first release where `node:sqlite` is non-experimental; Node 18/20 lack the module entirely and Node 22 would both warn on every invocation and downgrade the bundled SQLite (3.50.4 vs 3.53.1). Existing cache databases are read in place with no migration — the on-disk format is unchanged (SQLite 3.53.2-written files verified readable, WAL mode and `user_version` stamp included). **Migration**: upgrade to Node 24 (current LTS), e.g. `nvm install 24`; no other action is needed, and the cache keeps its contents. diff --git a/jest.config.js b/jest.config.js index 01fa249..44601fb 100644 --- a/jest.config.js +++ b/jest.config.js @@ -13,6 +13,9 @@ export default { '/node_modules/', '/.claude/worktrees/', ], + // Keep haste-map from indexing agent worktrees too — a leftover worktree + // otherwise duplicates manual mocks (tests/__mocks__/*) and warns on every run. + modulePathIgnorePatterns: ['/.claude/'], // Coverage configuration collectCoverageFrom: [