Skip to content
Beskid The Beskid Book

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

04.3 Visibility basics

Private by default, pub exports, and not leaking every helper across the monorepo."

Visibility basics

Default visibility is private. If you wanted everything public, you already have JavaScript.

Mark items pub when other modules may depend on them. Keep helpers private unless you enjoy semver pain from accidental API growth.

Use boundary modules (api.bd, mod service; files) to:

  • Hide experimental internals in private siblings
  • Re-export a narrow surface with pub use (chapter 05)

When mod domain.feature; owns a file, everything top-level in that file shares the module scope—additional mod declarations are disallowed to prevent nested chaos.

SmellFix
pub on every functionDelete pub from helpers
Cross-layer importsIntroduce boundary module + pub use
”Util” package imported everywhereSplit domain modules

Corelib layout