Commit 18b5a6d
committed
fix(deploy): rewrite workspace:* to file: refs in Dockerfile + record Lesson #55
The npm install in the container failed with EUNSUPPORTEDPROTOCOL on
the previous deploy attempt — npm 10.8.2 (and 11.x) reject pnpm's
`workspace:*` protocol even with the workspaces field present in
root package.json. Switching source files to `*` would break pnpm
locally (it tries to fetch @pushflip/client from the npm registry),
so source stays pnpm-native and the rewrite happens at Dockerfile
build time only.
What changed:
- Both Dockerfiles add a `node -e ...` step right after copying
workspace package.json files. The script walks app/, faucet/, and
scripts/ package.json (the three workspaces with cross-workspace
deps), maps known workspace names (@pushflip/client,
@pushflip/dealer) to relative paths, and rewrites every
`"workspace:*"` to `"file:../<path>"`. npm understands file: refs
to sibling directories as symlinks.
- Rewrite happens *before* npm install, so npm sees a tree of
npm-compatible specifiers and resolves cleanly. Subsequent COPYs
of source bring the actual workspace files into place; the install
symlinks become live.
Lesson #55 records:
- The full 4-step migration to npm (workspaces field, source-stays-
workspace:*, file: rewrite at build time, npm scripts in CMD).
- The "switching source to *" dead-end (pnpm fetches from registry).
- Why npm 11 on tucker doesn't help (npm runs inside the container).
- Meta-lesson: when 2+ workarounds have stacked and the bug recurs,
switch tools rather than adding a third patch.1 parent 98f8733 commit 18b5a6d
3 files changed
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
50 | 77 | | |
51 | 78 | | |
52 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2078 | 2078 | | |
2079 | 2079 | | |
2080 | 2080 | | |
| 2081 | + | |
| 2082 | + | |
2081 | 2083 | | |
2082 | 2084 | | |
2083 | 2085 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
42 | 69 | | |
43 | 70 | | |
44 | 71 | | |
| |||
0 commit comments