Skip to content

@saflib/dev-tools


@saflib/dev-tools

Set of utilities for workspace packages.

Interfaces

InterfaceDescription
MonorepoContextFor tools which need to work across the monorepo. Use buildMonorepoContext to get an instance of this. Package names are used as keys throughout.
MonorepoPackageDirectoriesAbsolute paths.
MonorepoPackageJsonsRaw package.json files.
PackageJsonInterface of package.json fields which are used in this package.
WorkspaceDependencyGraphLists of direct "@saflib/*" dependencies.

Functions

FunctionDescription
buildMonorepoContextCreates a MonorepoContext. If no rootdir is provided, it will find the first parent directory with a package-lock.json and use that as the root, effectively returning "this" package's monorepo context.
getAllPackageWorkspaceDependenciesReturns all direct and transitive "@saflib/*" dependencies for a given package.
getCurrentPackageNameFinds the name of the package for the current working directory.