pnpm-engine
БесплатноБез исполняемых скриптовНе проверенWork on the pnpm Rust engine (`@pnpm/napi`, the pacquet crates) that `bit install` runs through. Use when a `bit install` problem sits inside dependency…
от teambit★ 18 508 звёзд на GitHubОб этом скилле
Working on the pnpm engine behind bit install
Bit does not shell out to the pnpm CLI. scopes/dependencies/pnpm/lynx.ts calls
nodeApi.install from @pnpm/napi, a Node addon around pnpm's Rust engine
(pnpm v12, "pacquet"). Most install behavior therefore lives in the pnpm
monorepo, not in this repo.
Where the code is
In this repo:
scopes/dependencies/pnpm/lynx.tsbuilds theInstallOptions, passes every project manifest in memory, and maps the result (stats.added + removed + linkedToRoot > 0) todependenciesChanged. It also keeps Bit'sbit:block inpnpm-lock.yaml(readBitLockfileAttrs/addBitAttributesToLockfile).scopes/dependencies/pnpm/pnpm-prune-modules.tsremoves virtual-store directories the current lockfile no longer lists, after every install.scopes/workspace/install/install.main.runtime.tsis thebit installcommand: manifest calculation, the install loop, linking, compile.workspace.jsoncpins the@pnpm/napiversion Bit ships.
In the pnpm monorepo (pnpm/ is the Rust product; read pnpm/CLAUDE.md first):
pnpm/crates/napi/src/install.rs— the binding: option overlay, engine mode, and the lockfile policy the in-memory manifests get.pnpm/crates/package-manager/src/install/run/—Install::run: the workspace-state fast path, the lockfile-vs-manifests dispatch, materialization.pnpm/crates/package-manager/src/optimistic_repeat_install.rs— the "Already up to date" check againstnode_modules/.pnpm-workspace-state-v1.json. Node-API callers useManifestFreshness::Content: their manifests are in memory (a component directory has nopackage.json), so each importer is compared with the lockfile by content, never by mtime.pnpm/crates/package-manager/src/install/prepare_modules_state/up_to_date.rs— the second short-circuit, after the lockfile is verified against the manifests: skip materialization when the tree is intact. It never fires when the lockfile holdsfile:directory packages, which Bit's injected components always are.pnpm/crates/deps-restorer/src/— the frozen (headless) install: warm-slot skipping (create_virtual_store/snapshot_plan.rs), directory fetches. Afile:directory snapshot is re-copied (hardlinked) on every materialization, matching pnpm's TypeScript engine, so a repeat install that reaches this stage reportsadded Nfor the injected components.
Build the addon locally
cd <pnpm-checkout>
cargo build -p pnpm-napi --profile napi-release
napi-release is the release profile with panic = "unwind" (the addon must
not abort the host node). Release builds use fat LTO, so linking takes
minutes; use it for timing measurements, and --profile dev for quick
iterations when runtime speed does not matter. A cold build of the workspace is
long. If another worktree of the pnpm repo already has a target/ directory,
point CARGO_TARGET_DIR at it to reuse the compiled dependencies.
Run Bit against the local build
The @pnpm/napi loader honors PNPM_NAPI_BINARY; the path must end in
.node:
cp target/napi-release/libpnpm_napi.so /tmp/pnpm-napi.node # .dylib on macOS
PNPM_NAPI_BINARY=/tmp/pnpm-napi.node bit install --log
This works with a bvm-installed bit as well as bit-dev. The loader falls
back silently to the installed platform package when the path does not
exist, so a typo tests the old engine and looks like a failed fix. Check the
file exists and that the addon reports the version you expect before a long
run:
test -f /tmp/pnpm-napi.node && PNPM_NAPI_BINARY=/tmp/pnpm-napi.node \
node -e "console.log(require('@pnpm/napi').engineVersion())"
The same trap applies to a released build: the platform package is not
hoisted, so its binary lives at
node_modules/.pnpm/@pnpm+napi.<platform>@<version>/node_modules/@pnpm/napi.<platform>/pnpm-napi.node,
not under node_modules/@pnpm/.
Read what the engine did
bit install --log interleaves Bit's log with the engine's reporter output.
The lines that matter:
Already up to date— the workspace-state fast path returned before any install setup; nothing was read from the store or the registry.Lockfile is up to date, resolution step is skipped— the lockfile satisfies every manifest; the frozen path ran.Progress: resolved N, reused N, downloaded N, added N—addedcounts packages materialized into the virtual store. On a repeat install anything above 0 is packages re-copied (usuallyfile:directory snapshots).✔ done running package installation using pnpm (completed in Ns)— Bit's timer around the engine call, including the tworeadLockfilecalls Bit makes around it.
Engine tracing is enabled with the TRACE environment variable, which takes
tracing EnvFilter directives and prints to stderr:
TRACE='pacquet::install=debug' PNPM_NAPI_BINARY=... bit install --log
A skipped fast path logs its reason at debug level
Установить pnpm-engine в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл pnpm-engine?
Work on the pnpm Rust engine (`@pnpm/napi`, the pacquet crates) that `bit install` runs through. Use when a `bit install` problem sits inside dependency resolution, lockfile handling, linking, the virtual store, or the repeat-install fast path, and the fix or the diagnosis needs a locally built engine wired into Bit.
Как установить скилл pnpm-engine?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pnpm-engine запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic