Skip to content

pnpm patch cannot bring old patch back while repatch #8919

Closed
@byronogis

Description

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

v9

Which area(s) of pnpm are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

❯ mkdir pnpm-patch && cd pnpm-patch

❯ node -v
v20.18.1

❯ npm init -y

❯ corepack use pnpm@9.15.2

❯ pnpm -v                 
9.15.2

❯ pnpm i es-toolkit@1.31.0
Packages: +1
+
Progress: resolved 1, reused 1, downloaded 0, added 1, done

dependencies:
+ es-toolkit 1.31.0

Done in 506ms

❯ pnpm patch es-toolkit
Patch: You can now edit the package at:

  /home/.../pnpm-patch/node_modules/.pnpm_patches/es-toolkit@1.31.0

To commit your changes, run:

  pnpm patch-commit '/home/.../pnpm-patch/node_modules/.pnpm_patches/es-toolkit@1.31.0'

❯ echo 'patch 1' > ./node_modules/.pnpm_patches/es-toolkit@1.31.0/README.md 

❯ cat ./node_modules/.pnpm_patches/es-toolkit@1.31.0/README.md             
patch 1  

❯ pnpm patch-commit '/home/.../pnpm-patch/node_modules/.pnpm_patches/es-toolkit@1.31.0'
Packages: -1
-
Progress: resolved 1, reused 2, downloaded 0, added 1, done

❯ rm -rf node_modules

❯ pnpm i
Lockfile is up to date, resolution step is skipped
Packages: +1
+
Progress: resolved 1, reused 1, downloaded 0, added 1, done

dependencies:
+ es-toolkit 1.31.0

Done in 495ms

❯ pnpm patch es-toolkit
Patch: You can now edit the package at:

  /home/.../pnpm-patch/node_modules/.pnpm_patches/es-toolkit@1.31.0

To commit your changes, run:

  pnpm patch-commit '/home/.../pnpm-patch/node_modules/.pnpm_patches/es-toolkit@1.31.0'

❯ cat ./node_modules/.pnpm_patches/es-toolkit@1.31.0/README.md             
...... (original content

Describe the Bug

pnpm patch cannot bring old patch back while repatch

Expected Behavior

should echo patched content while repatch

Which Node.js version are you using?

v20.18.1

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

Linux 6.6.64 NixOS

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions