Upstream Migrator
Bumping @concepta/* / @nestjs/* in this repo is rarely a clean version flip — upstream
restructures packages between alphas. Work through this checklist; do not assume a bump is mechanical.
1. Establish the real target before editing
- For each package the user lists, run
npm view <pkg>@<version> dependencies peerDependencies version. - Build the dependency graph: note which
@concepta/*packages the new version drops or renames (historicallynestjs-common→nestjs-core;email/eventhad no 8.x;swagger-ui→@concepta/rockets-core;typeorm-extremoved — app-owned entities). - Check what the repo's source actually imports from the dropped packages:
grep -rl "@concepta/nestjs-common" packages/*/src. Those are your migration sites.
2. Apply versions deterministically
- Update root
package.jsonresolutionsand each package's dep entry. A small node script keyed by package name beats N hand edits and avoids touching packages that have no new version. - To use npm instead of a local workspace copy: keep the folder on disk, exclude it from
workspaceswith a!packages/<name>negation (Yarn Berry) so the npm version resolves. - Install with
corepack yarn install(the repo is Yarn Berry 4.x; globalyarnis v1 and will choke on the lockfile).
3. The traps that a bump hides (check every time)
- moduleResolution. New
@concepta/*expose types only viapackage.jsonexportssubpaths (e.g.@concepta/nestjs-core/aggregate). Classicnoderesolution ignoresexports, so types silently degrade andskipLibCheckmasks it. The repo usesmodule/moduleResolution: nodenextfor this reason — keep it. Probe with a throwaway import +tsc --noEmit. - common → core. Re-point moved symbols (
DomainAggregatefrom…/aggregate,ActionEnum,RuntimeException, references, audit) to@concepta/nestjs-core. Removed re-exports (e.g.AccessControlAction) get deleted, not faked. - Exception identity. Concepta exceptions extend
@concepta/nestjs-core'sRuntimeException, which is a different class from@concepta/rockets-app's. Anyinstanceof RuntimeException/ global filter that imported from@concepta/nestjs-commonmust switch to@concepta/nestjs-core, or concepta errors become 500s. - Config shapes. Option interfaces change (e.g. role
assignmentsrequiring a flatentityKey). Read the installed.d.tsinnode_modules/<pkg>/dist, not upstreamsrcat HEAD.
4. Test-runner layer (separate from the build)
- The runner is Vitest (native ESM): package
exportsmaps resolve directly, so a subpath that fails under Vitest fails because the exports map itself is wrong — fix it upstream-side or via aresolve.aliasentry in the relevantvitest*.config.ts, never with a paths/moduleNameMapper mirror. - After a bump, run both
yarn testandyarn test:e2e; aCannot find module '@concepta/.../subpath'here is the exports-map signal above.
5. Verify
tsc --build --forcemust be 0 errors (force, to defeat stale.tsbuildinfo).- Boot
sample-serverandsample-server-auth(ts-node) and exercise signup/login — DI/exception identity only fails at runtime. - Run
yarn test; distinguish pre-existing failures from regressions with agit stashbaseline before claiming a break is yours. - No
any/casts to paper over a shape change — fix the type or ask.