Name an external package in an architecture rule
Declare a package boundary using the name that appears in an import.
Use the name from the import#
For a TypeScript domain layer, the example covers the AWS S3 client package, including its subpaths. Keep the scope and quote the name so the YAML value begins with a string.
version: 2
architecture:
layers:
- name: domain
paths: ["src/domain/**"]
rules:
- id: domain-without-s3
layer: domain
forbidden_packages: ["@aws-sdk/client-s3"]
severity: warning
For Go, use the module path to cover packages beneath it. For Python, use the package name to cover its submodules; names are compared in lowercase with hyphens treated as underscores. A similarly prefixed npm package is separate. Reviews do not yet evaluate these declarations.