Skip to content

workspace

Documentation / @wtf/project-resolve / workspace

The workspace a project is in, as its package manager reads it: workspaceOf a folder, the nearest from it up that holds it, and workspaceAt a folder, the one whose root it is. A workspace is its root, its package manager, and its packages, each by its name: of pnpm, the packages of its pnpm-workspace.yaml, ! exclusions among them, and of npm, yarn and bun, the workspaces of the package.json of its root. Each reads by the file system of the platform it is given, its navigator.storage.getDirectory(), the handle of the root of their paths, and its paths, each read a promise (filesOf gives that file system to a reader of paths of its own).

And the workspace a process runs in, as the hook of ./register and the configs of Vitest read it, by the platform they are given: its root, the folder of the nearest pnpm-workspace.yaml (workspaceRootOf, or workspaceRootAbove of a folder that may be in none), and each package of it in packages/ with an export map (packagesOf). A run from the root and a run in a package find the same one.

It depends on nothing, and on no library of globs or YAML: what reads a workspace — the hook, the configs of Vitest, and any tool of your own — finds the same packages the package manager does.

Type Aliases

Functions