Commit b7a7e62
authored
Fail fast on unsupported Node versions (#140)
* Fail fast on unsupported Node versions
npm install now errors immediately with a clear "Unsupported engine"
message on Node <24, instead of silently proceeding and failing later
with a confusing Rollup syntax error deep in the Google-Photos-Toolkit
submodule build (see #135).
* Standardize on Node 22 throughout
Both CI jobs, .nvmrc, and package.json engines now agree on Node 22.
The test job was already pinned to 22 (Node 24.16.0 hangs installing
Playwright's browser, see #123); aligning everything else avoids the
same conflict resurfacing elsewhere.
* Replace engines field with a preinstall version check
package.json's "engines" field broke the extension: Plasmo builds on
Parcel, which reads "engines" to infer build targets. With engines.node
set, Parcel misidentified the browser bundle's target environment and
stopped bundling react/jsx-runtime for the browser, leaving the app tab
blank (reproduced locally — all 18 integration tests failed with
"Cannot find module 'react/jsx-runtime'" as a pageerror).
A preinstall script gives the same fail-fast UX on npm install without
package.json ever declaring "engines", so Parcel's target inference is
unaffected. Verified: npm ci fails fast on Node <22 (simulated), and the
built extension renders correctly on Node 22.
Drop .npmrc/engine-strict too — it only existed to enforce our own
engines field, which no longer exists.1 parent 76abecd commit b7a7e62
4 files changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments