Open-Source Wikis

/

Angular

/

How to contribute

/

Tooling

angular/angular

Tooling

The framework has a deep stack of internal tools. Most contributors only see pnpm, bazelisk, and ng-dev, but the others come up when working in the more specialized corners of the repo.

ng-dev

The umbrella CLI for repository operations. Source lives in the sister repository angular/dev-infra and is published to this repo via the @angular/ng-dev dependency. Configuration lives in .ng-dev/:

File Purpose
.ng-dev/config.mjs Top-level config, references all other modules.
.ng-dev/commit-message.mjs Allowed commit types and scopes.
.ng-dev/format.mjs Files to format and the formatter (prettier).
.ng-dev/pull-request.mjs PR validation rules (target labels, commit count, etc.).
.ng-dev/release.mjs Release branch / publish configuration.
.ng-dev/github.mjs GitHub repo info for the bot.
.ng-dev/caretaker.mjs Caretaker-specific dashboards and queries.

Common subcommands:

  • pnpm ng-dev format changed [shaOrRef] — format files changed since a ref.
  • pnpm ng-dev format files <files…> — format specific files.
  • pnpm ng-dev commit-message validate-file <file> — validate a commit message.
  • pnpm ng-dev caretaker check — generate a caretaker dashboard.
  • pnpm ng-dev release publish — publish a release (run by the release pipeline only).
  • pnpm ng-dev pr merge <number> — merge a PR (used by the bot).
  • pnpm ng-dev misc build-and-link <path> — build and pnpm link packages into a target project.

Bazel

bazelisk is the launcher; the actual Bazel version comes from .bazelversion. Build configuration:

  • MODULE.bazel — Bzlmod module definitions and dependencies.
  • MODULE.bazel.lock — locked dependency graph.
  • tools/defaults.bzl — default flags applied to the standard Angular Bazel macros (ng_module, ng_web_test_suite, etc.).
  • Per-package BUILD.bazel files describe the test, library, and bundle targets.

Common workflows:

pnpm bazel build //packages/core:core            # Build a specific target.
pnpm bazel test //packages/core/test:test        # Run a single test target.
pnpm bazel test //packages/...                   # All targets under a path.
pnpm bazel query //...                           # Inspect the build graph.
pnpm bazel clean --expunge                       # Hard reset.

ibazel is the iterative watcher used by pnpm adev and pnpm devtools:devserver. It re-runs the watched target whenever its sources change.

Remote build execution and remote caching require Google authentication; community contributors run with the local cache only. CI uses a shared remote cache for speed.

goldens/

Golden snapshots are version-controlled fixtures that fail CI on unintended drift.

  • goldens/public-api/*.api.md — public API surface per package. Update with pnpm public-api:update. The mechanism is implemented in goldens/public-api/manage.js.
  • goldens/size-tracking/*.json — exported symbol lists from production bundles, generated by tools/symbol-extractor. Update with pnpm symbol-extractor:update.
  • goldens/circular-deps/ — known circular import edges. Update via the circular-deps script.

Reviewers expect goldens to be updated in the same commit as the code that changes them.

tools/

Selected tools used during framework development:

scripts/

Smaller imperative scripts that don't fit into Bazel:

Migrations (ng update)

When the framework removes or changes APIs, automated migrations live under each package's schematics/migrations/:

Each migration is a ng-update schematic shipped in the package and run when end-users execute ng update @angular/<package>. Adding a new migration involves:

  1. Writing the schematic under <package>/schematics/migrations/<name>/.
  2. Registering it in the package's migrations.json.
  3. Adding tests (<name>/index_spec.ts).

The migrations are also runnable manually via ng-dev's migration tooling for repository-wide tests.

CI workflows

Workflow definitions live in .github/workflows/:

Workflow Purpose
ci.yml Main test matrix run on PRs and merges.
pr.yml PR-only checks (label validation, commit message lint).
adev-preview-build.yml / adev-preview-deploy.yml Build a preview of angular.dev for the PR and deploy it.
cross-repo-adev-docs.yml Trigger downstream rebuilds when docs-shared content changes.
dev-infra.yml Updates the dev-infra dependency.
benchmark-compare.yml Run benchmarks vs base for performance-tagged PRs.
perf.yml Long-running performance tracking.
merge-ready-status.yml Surface "ready to merge" state in PR checks.
assistant-to-the-branch-manager.yml Branch manager helper bot.
scorecard.yml OSSF scorecard run.
google-internal-tests.yml Triggers internal Google CI on PRs.

CI is one of the heavier matrices in the JavaScript ecosystem; the optimization investment is documented in contributing-docs/branches-and-versioning.md.

Pre-commit hooks

husky is configured to run on commit. Hooks:

  • commit-msg — validates the conventional commit format via ng-dev commit-message validate-file.
  • (Other hooks may be enabled via pnpm prepare; check the directory for current state.)

To install / refresh hooks: pnpm prepare. To bypass (rarely): git commit --no-verify.

Tsec / trusted types

tsec is Google's TypeScript security analyzer. The framework runs it to enforce that DOM-injection sinks (innerHTML, outerHTML, document.write, etc.) are not introduced inside Ivy. Exemptions are explicitly listed in packages/tsec-exemption.json.

pnpm test-tsec

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Tooling – Angular wiki | Factory