CodeVetter · Repo Unpack · System map
yarnpkg/berry
The repository separates command dispatch, project management, protocol integrations, and filesystem installation. The CLI composes plugins around reusable core classes rather than containing the dependency engine itself. Distribution includes generated CLI bundles and published library packages, while documentation has its own application and build configuration.
- The root package is a private packages/* workspace monorepo; it declares Jest, ESLint, and TypeScript scripts and pins packageManager to Yarn 4.2.1.
- The executable source entrypoint imports polyfills and calls runExit with argv, portable cwd, its own path, and getPluginConfiguration().
- lib.ts owns Clipanion context, Node >=18.12.0 validation, yarnPath delegation, plugin command registration, exit-code handling, and temporary-directory cleanup.
- Core exposes Configuration, Project, Workspace, Cache, and Manifest; Project.find initializes resolutions and workspaces and uses linker lookup when cwd belongs to an installed package.
- Plugin contributions are typed as configuration, commands, fetchers, linkers, resolvers, and hooks; the CLI’s standard bundle includes npm, JSR, constraints, linking, and workspace plugins.
- Filesystem installation has distinct implementations: PnpLinker generates loader/data files, NodeModulesLinker persists a package tree, and plugin-pnpm registers PnpmLinker with a configurable store.
- build:cli invokes builder build bundle, which bundles sources/cli.ts into bundles/yarn.js using esbuild; the manual release workflow builds binaries, pushes tags, and invokes release publishing scripts.
- The separate Docusaurus workspace uses React 19 and provides development/build scripts; its configuration generates CLI and TypeDoc API documentation alongside docs and blog routes.