Contributing to MemberJunction
Thanks for your interest in contributing to MemberJunction! This guide covers how to get set up, the standards we follow, and how to propose changes.
Ways to contribute
Section titled “Ways to contribute”- Report bugs and request features via GitHub Issues.
- Ask questions and share ideas in GitHub Discussions.
- Improve documentation — fixes to READMEs and guides are always welcome.
- Submit code via pull requests (see below).
Getting set up
Section titled “Getting set up”MemberJunction is a pnpm-workspace monorepo built with Turborepo.
⚠️ Never run
npm installhere. It would write apackage-lock.jsonthis repo no longer uses and resolve a different dependency tree. The package manager is pinned bypackageManagerin the rootpackage.json;corepack enablewill honour it automatically.
# Clone and install (always install from the repo root)git clone https://github.com/MemberJunction/MJ.git && cd MJpnpm install
# Build everythingpnpm run build
# Build a single package (run inside that package's directory)cd packages/<PackageName> && pnpm run buildPrerequisites: Node.js 22+ (24 recommended — see
.nvmrc), pnpm 10.33+, SQL Server 2019+ (or Azure SQL). The Angular CLI is a workspace dependency — you do not need it installed globally.
Adding a dependency? Put it in the individual package’s package.json, then run pnpm install
at the repository root — never inside a package directory. pnpm enforces declared
dependencies strictly, so a package that imports something it does not declare fails to resolve
rather than falling through to a hoisted copy.
See the root README.md for install and architecture, and
DEPLOYMENT.md for deployment details.
Coding standards
Section titled “Coding standards”Before writing code, read CLAUDE.md. It is the authoritative guide to MemberJunction’s conventions and contains rules that PRs are expected to follow, including:
- Strong typing — no
any; always use MJ’s generatedBaseEntitysubclasses,Metadata, andRunViewwith generics. - Class member naming — PascalCase for public members, camelCase for private/protected.
- Functional decomposition — small, focused functions (~30–40 lines max).
- Angular conventions — modern
@if/@fortemplate syntax,inject()DI, design tokens (no hardcoded colors). - No re-exports between packages,
BaseSingletonfor singletons, and the other critical rules called out inCLAUDE.md.
Topic-specific guides live in guides/ and in per-area CLAUDE.md files (e.g. migrations/CLAUDE.md, packages/Angular/CLAUDE.md). New to building on the platform? Start with Building Applications on MemberJunction.
MemberJunction uses Vitest across all packages.
# Unit tests — all packages, from repo root (Turborepo-cached, so unchanged packages skip)pnpm test
# Unit tests — one packagecd packages/<PackageName> && pnpm test
# Deterministic integration tier (run after migrations + CodeGen have been applied)pnpm run test:integrationBefore opening a PR, the local CI mirrors are worth a minute — each one mirrors a gate that would otherwise fail your PR:
pnpm run check:ui # design-token + button gates on changed CSS/SCSSpnpm run check:standards # every adopted MJ standard (see .mj-standards.json)pnpm run check:esm # native-ESM import guard for "type": "module" packagespnpm run check:browser-manifest # server-only packages leaking into the browser bundlepnpm run check:codegen-tail # new-table migrations ship their generated entity- When you change a package’s source, run that package’s tests and update them to match new behavior.
- New PRs must pass the unit-test gate in CI.
See TESTING_GUIDELINES.md and UNIT_TESTING_STRATEGY.md for details.
Database migrations
Section titled “Database migrations”Schema changes go through Flyway migrations. Read migrations/CLAUDE.md before authoring one — it covers naming, hardcoded UUIDs, the columns and indexes CodeGen manages for you, and the CodeGen handoff.
Pull request process
Section titled “Pull request process”- Branch from
next(the default branch) using a descriptive feature-branch name, and push withgit push -u origin <branch-name>so it tracks a same-named remote branch. A feature branch left trackingorigin/nextsends your commits straight tonexton the next baregit push, bypassing review entirely. Verify withgit branch -vvbefore pushing. - Make focused changes that follow the standards above.
- Build and test the affected packages locally (
pnpm run build+pnpm test), then run the deterministic integration tier (pnpm run test:integration). - Add a changeset (
pnpm run change) describing the user-visible change.minoris reserved for branches that add or modify a migration or anything undermetadata/; everything else ispatch. Check it withpnpm run check:changeset. - Open a PR with a clear description of what changed and why. Link any related issues.
- Respond to review feedback — CI must be green before merge.
License
Section titled “License”By contributing, you agree that your contributions will be licensed under the repository’s Business Source License 1.1.