Commit 06b4e58
committed
refactor: migrate patch-package to native pnpm patch
patch-package and pnpm don't play well together. patch-package writes
to the top-level node_modules/<pkg>/ path; under pnpm's strict layout
that location is a symlink into the .pnpm/<pkg>@<ver>/node_modules/<pkg>/
store directory, but patch-package doesn't follow the symlink to patch
the canonical file. The patch silently fails to apply, and the
postinstall step reports success regardless.
Concrete impact on this branch (before this commit): the lone patch
in patches/ — typescript-react-function-component-props-handler+1.1.1
— never took effect under pnpm. That patch adds an Array.isArray guard
before reading .params.length inside react-docgen's prop-extraction
pipeline; without it, `pnpm generate-readmes` throws
`TypeError: Cannot read properties of undefined (reading 'length')`
on certain components.
Native pnpm patch writes the patched file directly into the .pnpm
store via `pnpm.patchedDependencies` in root package.json. The patch
is now correctly applied at install time.
Mechanics:
- `pnpm patch typescript-react-function-component-props-handler@1.1.1`
→ applied the same Array.isArray fix
- `pnpm patch-commit` wrote patches/typescript-react-function-component-props-handler@1.1.1.patch
(note `@` separator vs patch-package's `+`) and the
patchedDependencies entry in root package.json
- Deleted patches/typescript-react-function-component-props-handler+1.1.1.patch
- Removed `patch-package` from devDependencies
- Removed `pnpm patch-package` invocation from scripts/postinstall.sh
- Reinstalled to regenerate pnpm-lock.yaml (patch-package + transitive
deps removed, patch hash recorded against the patched package)
Verification: `pnpm generate-readmes` now runs to completion. Stale
README content in 10 packages exists as a separate concern — fixed in
the generator/tooling here; regenerating the actual README outputs is
a separate maintenance task.
Resolves FEC-924 follow-up: "patch-package → native pnpm patch".
Side-effect: also resolves "broken pnpm generate-readmes" since the
generator's underlying bug is what the patch was written to fix.1 parent a7d16a3 commit 06b4e58
5 files changed
Lines changed: 25 additions & 122 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| |||
190 | 193 | | |
191 | 194 | | |
192 | 195 | | |
193 | | - | |
194 | 196 | | |
195 | 197 | | |
196 | 198 | | |
| |||
Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 18 | + | |
0 commit comments