Shared
Generic code with no product meaning. MIT, recorded in ADR 0012. Decision 34 is ADR 0001. Folder rules are guideline §1. Folders are created with their first code.
Each package on the tree has "license": "MIT" in its package.json and a LICENSE file.
| Package | Path | Status |
|---|---|---|
| config | shared/config | config |
| errors | shared/errors | errors |
| host-pin | shared/host-pin | host-pin |
| http | shared/http | http |
| lexicons | shared/lexicons | lexicons |
| log | shared/log | log |
| safe-href | shared/safe-href | Link checker. No page of its own. |
| ui | shared/ui | ui |
| ui-build | shared/ui-build | ui-build |
Owns
The packages in the table. LEAF_SHARED in scripts/lint/.dependency-cruiser.cjs also names the path shared/admin-envelope/. ZERO_DEP_ALLOWLIST in that file is that same path.
| Path | CODEOWNERS section |
|---|---|
shared/http/ | Security review, and trusted base |
shared/config/ | Security review |
shared/safe-href/ | Security review, and trusted base |
shared/lexicons/ | Security review, and trusted base |
May import
Transcribed from scripts/lint/.dependency-cruiser.cjs (MATRIX and the forbidden rules named here). dependency-cruiser 18.7.0 is pinned in package.json. The checked-rule table that names these rules is docs/human/architecture.md. The config states that an edge no row lists fails as not-in-allowed.
shared-leaf: shared/ imports nothing under apps/, interfaces/, domains/ or infrastructure/.
The general shared row applies where LEAF_SHARED does not. LEAF_SHARED names ui, ui-build, lexicons, admin-envelope, host-pin and safe-href. admin-envelope and safe-href are paths that file names; the others have a page.
| From | May reach |
|---|---|
shared/config/, shared/errors/, shared/http/, shared/log/ | shared/, Node built-ins, and npm dependency types npm, npm-dev, npm-optional, npm-peer, npm-bundled. |
Who may reach shared/:
| From | May reach |
|---|---|
apps/<app>/ | shared/ |
interfaces/<name>/, except the paths ADMIN_SERVICES names | shared/ |
domains/<name>/ | shared/errors/, shared/lexicons/, and shared/config/ as types only |
infrastructure/<name>/, except net-guard | shared/ |
deployment/preflight/ | shared/host-pin/index.ts |
interfaces/pds-admin/, interfaces/chat-admin/ (paths ADMIN_SERVICES names) | shared/admin-envelope/ (the path ZERO_DEP_ALLOWLIST names) |
infrastructure/net-guard/ | Nothing under shared/ |
Tooling (scripts/, tests/, *.test.ts, an app vite.config.ts) | The tooling row, which allows every target |
infra-shared-via-index (rule DC-2): from outside a package, and from another shared/ or infrastructure/ package, the only file reached is that package’s index.ts. A *.fake.ts and a .css file are the exceptions the rule names.
Rules that also narrow an edge the rows would allow:
| Rule | Effect |
|---|---|
no-product-imports-tooling | Product code does not import scripts/ or tests/. |
fake-only-in-composition-root | A *.fake.ts is imported by tests and interfaces/*/compose.ts. |
vendor-sdk-one-adapter | @atproto/lex* is imported only under shared/lexicons/. |
lexicon-scripts-not-imported | Nothing outside shared/lexicons/scripts/ imports that folder. |
Entry points
No package here has a main.ts. The file another workspace imports is index.ts.
| Package | Import |
|---|---|
@unset/shared-config | config |
@unset/shared-errors | errors |
@unset/shared-host-pin | host-pin |
@unset/shared-http | http |
@unset/shared-lexicons | lexicons |
@unset/shared-safe-href | shared/safe-href |
@unset/shared-log | log |
@unset/shared-ui | ui |
@unset/shared-ui-build | ui-build |
Data
No schema, role or table lives under shared/. Lexicon JSON is on lexicons. Sheet copies, tokens and icons are on ui.