Skip to content

build: repair package-lock.json and ignore claude worktrees#272

Open
whitelonng wants to merge 18 commits into
KunAgent:developfrom
whitelonng:fix/lockfile-and-gitignore
Open

build: repair package-lock.json and ignore claude worktrees#272
whitelonng wants to merge 18 commits into
KunAgent:developfrom
whitelonng:fix/lockfile-and-gitignore

Conversation

@whitelonng

@whitelonng whitelonng commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Two repository-hygiene improvements on develop. Not a release-blocker — see note below.

1. Repair package-lock.json (local install hygiene)

pdfjs-dist declares @napi-rs/canvas as an optional dependency, but the lockfile only listed the declaration without the resolution entries for the actual platform packages.

Impact is environment-dependent:

  • CI is unaffected. release.yml runs npm ci on Linux runners, where npm tolerates the missing platform-optional entries and the build succeeds.
  • ⚠️ Local installs on other platforms fail. On macOS with npm 11, npm ci fails with EUSAGE ("Missing: @napi-rs/canvas@0.1.100 from lock file"), pdfjs-dist is absent from node_modules, and the write-pdf-text-service test fails with Cannot find package 'pdfjs-dist/legacy/build/pdf.mjs'.

The same broken lockfile is present on both master and develop (identical content/hash), so this fix applies cleanly to either branch.

Fix: Regenerated lockfile entries via npm install --package-lock-only --no-audit --ignore-scripts. Minimal and scoped:

  • Added: @napi-rs/canvas@0.1.100 platform packages (android-arm64, darwin-arm64, darwin-x64, linux-, win32-) and their node-gyp-build toolchain dependency
  • Removed: an orphaned pend@1.2.0 entry (no longer referenced) and the stale optionalDependencies block on pdfjs-dist
  • Touched nothing else — all other packages keep their resolved versions

2. Ignore .claude/worktrees/

Transient agent worktrees under .claude/worktrees/ were not gitignored. Never tracked by git, but ESLint was scanning them and producing duplicate warnings (e.g. ConnectPhoneView.tsx warnings appeared for both the main checkout and each worktree copy).

Fix: Add .claude/worktrees/ to .gitignore. Scoped to the worktrees/ subdirectory only — does not affect .claude/commands/, .claude/settings.json, or other tracked files.

Verification

  • npm ci succeeds locally on macOS (947 packages, no EUSAGE) — was failing before
  • node_modules/pdfjs-dist/legacy/build/pdf.mjs exists
  • npx vitest run src/main/services/write-pdf-text-service.test.ts passes — was failing before
  • npm run lint — 0 errors; warnings reduced from 25 → 18 (worktree duplicates eliminated)
  • npm run typecheck passes
  • GitHub reports this PR as MERGEABLE / CLEAN against develop (no conflicts)

Note on scope

This is a hygiene improvement, not a critical bug fix. The lockfile mismatch does not affect releases (CI's npm ci on Linux succeeds). The value is in unblocking local development on platforms/environments where npm ci fails. Happy to close if maintainers consider this too minor.

huqiantao and others added 18 commits June 7, 2026 23:47
…entering

fix: center placeholder text and input content vertically in composer input
fix: preserve sidebar chat history when viewing scheduled tasks
…ar-schedule-bug

Revert "fix: preserve sidebar chat history when viewing scheduled tasks"
…-placeholder-centering

Revert "fix: center placeholder text and input content vertically in composer input"
…bility-badges

[codex] Compact provider model capability badges
…t-model-capability-badges

Revert "[codex] Compact provider model capability badges"
The lockfile was missing @napi-rs/canvas optional dependency entries
declared by pdfjs-dist. This is a repository-hygiene fix, not a
release-blocker: CI (release.yml) runs npm ci on Linux and tolerates
the missing platform-optional entries there, but local installs on
other platforms (e.g. macOS with npm 11) fail npm ci with EUSAGE and
pdfjs-dist ends up absent from node_modules, breaking the
write-pdf-text-service test which imports
pdfjs-dist/legacy/build/pdf.mjs.

Regenerated lockfile entries via npm install --package-lock-only.
Minimal patch: adds @napi-rs/canvas platform packages and removes
an orphaned pend entry; touches no other package versions.

Also add .claude/worktrees/ to .gitignore to prevent transient agent
worktrees from being committed or scanned by ESLint.
@whitelonng whitelonng force-pushed the fix/lockfile-and-gitignore branch from ee9d1a6 to ebf1220 Compare June 13, 2026 16:36
@whitelonng whitelonng changed the title fix: repair package-lock.json and ignore claude worktrees build: repair package-lock.json and ignore claude worktrees Jun 13, 2026
@whitelonng whitelonng changed the base branch from master to develop June 13, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants