ci: enforce project dependency layers with nx conformance
Summary
Nothing checked which projects may depend on which. This PR adds pnpm nx conformance:check to CI with two rules:
layer:core core/* -> core
layer:sdk sdk/* -> core
layer:wallet wallet-gateway/* -> core, sdk
layer:app examples/*, tools/* -> core, sdk, app
layer:docs docs/wallet-integration-guide/examples -> core, sdk, app
layer:tooling scripts, api-specs, mock-oauth2,
core/rpc-generator -> nothing
layer:e2e e2e/* -> everything
npm:public must not depend on npm:private
The projects that break these rules today are exempted in nx.json, each with a TODO explanation. The follow-up PRs fix them one by one and remove their exemptions.
Also included:
- Test-only workspace dependencies are declared as dev dependencies, and runtime ones as runtime dependencies.
- The nonexistent
example-scriptsfolder is removed from the pnpm workspace.
Part of #3102
Evidence
- Before: no dependency check in CI. Running the rules on main reports 7 rule-breaking projects.
- After:
pnpm nx conformance:checkpasses with those projects exempted. Removing one exemption makes it fail again.
Merge Danger
Door: two-way
Blast Radius: CI
A PR that adds a dependency across layers now fails test-static.