← Back to Pull requests

fix(install): write the importer of a new project without dependencies #18190

Closed
unknown closed this pull request without merging on Nov 17, 2026 23:45 UTC
View on GitHub
unknown unknown commented on Nov 17, 2026 18:01 UTC
Author

<!-- A maintainer will only start reviewing once CodeRabbit has approved and
CI is green. Please wait for those to pass before expecting human review. -->

Summary

When a new workspace package has no dependencies, pnpm install leaves it out of importers in pnpm-lock.yaml. The freshness gate allows the missing entry, and the fast lockfile update saw no drift for it, so nothing wrote the lockfile. pnpm 11 adds an empty importer for such a project and writes the lockfile.

The fast update now counts a missing importer as drift even when the project declares nothing, and writes the importer from the manifest (publishDirectory and dependenciesMeta included). The result is the same entry a full resolve writes. --frozen-lockfile still accepts the missing entry and does not write it.

Fixes pnpm/pnpm#18189

Squash Commit Body

A workspace project with no dependencies and no importer entry passed the
freshness gate, and the fast lockfile update reported no drift for it, so
pnpm install never wrote its importer. Tools that list workspace packages
from pnpm-lock.yaml missed it until --fix-lockfile ran.

The fast update now treats a missing importer as drift whatever the
manifest declares, and builds the entry the way it does for a new project
with dependencies. pnpm 11 already writes these importers when it reads
the lockfile.

Fixes pnpm/pnpm#18189

Checklist

  • I checked the referenced issue and verified that none of the PRs

  • already linked to it solves it.
  • Bug fixes are implemented in every affected version. pnpm 11 already

  • writes the empty importer.
  • Added a changeset (pnpm changeset) if this PR changes any published

  • package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.
  • ---

    <!-- codesmith:footer -->
    ---
    <a href="https://backend.blacksmith.sh/track/enable-autofix?expires=1797530516&installation_model_id=426870&pr_number=18190&ref=codesmith_pr_footer&repository=pnpm%2Fpnpm&return_to=https%3A%2F%2Fgithub.com%2Fpnpm%2Fpnpm%2Fpull%2F18190&signature=66cc3308e0435cf1dc3780d6a62960509011de2339d572e2e68e6885b82cedd4"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png" width="190" height="28"></picture></a>
    <sup><a href="https://app.blacksmith.sh/pnpm/codesmith/pnpm/pr/18190?autoLogin=true&ref=codesmith_pr_footer">Open in [code]smith</a> · Need help on this PR? Tag <code>@codesmith-bot</code> with what you need.</sup>

    <!-- codesmith:autofix:disabled -->
    <!-- /codesmith:footer -->

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Normal pnpm install now records dependency-free workspace packages in pnpm-lock.yaml; frozen installs leave missing workspace entries unchanged.
    * Fast updates handle dependency-free workspace packages without changing existing optional-package snapshots.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 427 lines (+320 / -107) across 5 files Reviewer: zkochan Review duration: 343m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 427 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.363
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #18190"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.1% (MEDIUM) · Higher = larger blast radius
    45.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.8% · Safe to merge
    17.8%
    Repository