mj dev workspace: three override-pin rules break MJ's own build in a generated workspace (rollup binding, per-major selectors, newest-wins)

Aperta
#6,824 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
nodejs, typescript
Ambito
build-system, cli

Direzione di ricerca

The three override rules live in packages/MJCLI/src/lib/dev-workspace/, mainly lockfile.ts (the DeriveLockfilePins derivation) and build.ts. Start by generating a workspace from the listed members and reading the overrides it writes for @rollup/rollup-linux-x64-gnu, @types/express and rolldown. Done when each rule is fixed, a generated workspace builds @memberjunction/graphql-dataprovider and @memberjunction/server, and the @types/compression case typechecks.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happened

A workspace generated by mj dev workspace on today's next (19cbf7d07f), with members MJ, bizapps-common, bizapps-tasks and bizapps-forms, could not build MJ itself. Three separate override-pin rules in packages/MJCLI/src/lib/dev-workspace/ caused it. Each one fails silently at generation time and loudly at build time.

  1. Platform binaries are pinned workspace-wide. MJ's root lists @rollup/rollup-linux-x64-gnu 4.17.2 directly, and the lockfile derivation turns that into a global override. rollup 4.57.1 then loads a 4.17 native parser, and every pkgroll build fails with Error: ast.body is not iterable (first seen on @memberjunction/graphql-dataprovider). The same happens with @lmdb/lmdb-* (3.0.8 binaries pinned under lmdb 3.5.1) and @esbuild/win32-x64. A binary package has to be the exact version of the package that loads it, so it should never get a global pin.
  2. Per-major selectors catch wildcard ranges. For a name resolved in two majors, the generator writes @types/express@^4 and @types/express@^5. pnpm applies name@^4 to any dependency whose range intersects it, including *. So @types/compression (@types/express: *) got express types 4 next to the app's 5. Every Express handler then failed with TS2769 … not assignable to 'PathParams', even though both member lockfiles resolve @types/compression to express types 5.0.6.
  3. The newest version wins over MJ's own resolution. Where MJ's lockfile and an app's lockfile resolve the same tool to different versions in one major, the generator pins the newest. Examples: rollup 4.62.4 over MJ's 4.57.1, and rolldown 1.0.0-beta.58 vs 1.0.0-rc.4; there were 28 such names in this set.

A fourth difference is worth noting. A filtered install (pnpm install --filter <app>...) hoists a different @types/express than a full install, and MJ's server then stops compiling. A full install at the parent works.

Steps

  1. Put MJ (next), bizapps-common, bizapps-tasks and bizapps-forms (each at next) side by side, run mj dev workspace, then pnpm install at the parent.
  2. Build @memberjunction/graphql-dataprovider. It fails on item 1.
  3. Fix item 1 (drop the binding pin) and build @memberjunction/server plus the bizapps-forms server specs. They fail on item 2.

Workaround in use (not silent)

Open App CI now builds next against MJ next in this generated workspace (.github/actions/ci-install in every BizApps repo). Its mj-next-workspace.mjs post-processes the generator's overrides before writing them:

  • it drops platform-binding pins;
  • it keeps only the newest major of a multi-major pin;
  • it prefers MJ's lockfile resolution when that still satisfies every member's declared range.

With those changes MJ and the siblings (240 packages) build in about 9 minutes on a GitHub runner, and Forms builds and typechecks. The real fix belongs in lockfile.ts / build.ts. Once it lands, the CI post-processing can be removed.

Confidence

Reproduced locally and on a GitHub runner (bizapps-forms run 44926409441). Each item was confirmed by changing only that pin and rebuilding.

Environment

MJ next @ 19cbf7d07f / b219376ecf, pnpm 10.33.0, Node 22/24, Linux x64.

Severity

Any developer who regenerates a workspace with these members today gets an MJ that does not build. CI depends on it now too.

Target line

next

Duplicate search

Searched MJ issues for "dev workspace" with rollup, overrides, ast.body is not iterable and DeriveLockfilePins. #4129 (closed) is the closest: it concerns pins taken from different members for wrapper libs vs their inner SDKs, which is a different mechanism. I filed this on MJ because the generator is in packages/MJCLI.

Lingua principale
TSQL
Stelle
32
Fork
7
Merge medio
1g 16h
PR unite (30g)
504

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MemberJunction/MJ

Tutte le issue di MemberJunction/MJ

Issue simili

Altre issue su Build System

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.