with one click
lifecycle
Understanding implementation of nx-lifecycle and targets
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Understanding implementation of nx-lifecycle and targets
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | lifecycle |
| description | Understanding implementation of nx-lifecycle and targets |
This directory's ../lifecycle.json is the single source of truth for how every task in this monorepo is ordered and connected. It is managed by nx-lifecycle and generates all dependsOn entries in nx.json and every project.json.
For why this approach exists at all, see WHY-NX-LIFECYCLE.md.
There are 4 main orchestration targets:
format intentionally runs after lint, in case fixers have changed code structure that doesn't match formatting rules.no-check configs for implementations, to allow steps like build to run in a dev mode without abiding by strict linter rules.pre targets should do any work that requires editing the actual source code (e.g. barrelify) or resetting the output (to avoid conflicts with previous runs).run targets should be the main work to populate a /dist that will actually get published/executed.post targets should perform any additional codegen that relies on the /dist (e.g. exporting JSON schemas to /out via populate-files)reset should clear any reporting from previous runs.run should do the actual testing. Multiple test suites can be executed if necessary (e.g. a unit test AND an integration test)Currently this repo is entirely typescript, so all implementations are for typescript packages, but that could change in the future, and is explicitly supported.
See how those are wired up to implementations in the lifecycle.json itself, and tasks can be better understood via nx-tasks-reference
To add a new work target (e.g. a new codegen step):
targetDefaults in nx.jsonlifecycle.json mapping the target name to the appropriate stage hooknx run @leyman/main:lifecycle to regenerate all dependsOn entriesproject.json for all projects that will use it (does not get added implicitly)Avoid editing dependsOn by hand in nx.json or any project.json. nx-lifecycle will make sure the orchestrator dependencies are maintained, but in general this is a sign that the dependencies should be reflected in the top level targets (which might require creating more sub-targets).
coverage-report exceptioncoverage-report is intentionally not bound to the test lifecycle. It validates the 100% coverage threshold after all test data has been collected, and must run as a separate nx run-many -t coverage-report pass. The test-ci script runs both in sequence.
Binding it inside test would mean coverage thresholds are enforced on every incremental test run, which is unhelpful during development. Keeping it separate lets nx run-many -t test run fast and iteratively, while CI enforces coverage as a final gate.
Coding patterns and conventions (package design, types, DI, docs)
Creating a new package in the monorepo
Running CI locally with Dagger
Debugging (source maps, cache, test failures)
DevContainer runtimes, CLI tools, and version parity with Dagger
Installing a package dependency