@coveo/semantic-monorepo-tools
Version:
A library of helper functions to do SemVer2 compliant releases from Conventional Commits in monorepos
15 lines (14 loc) • 655 B
JavaScript
import { runOnChanged } from "./utils/runOnChanged.js";
/**
* Get the name of every package that changed
* @param since selects all the packages changed since the specified commit/branch/tag
* @param excludePackages filter out the specified packages/directory from the output
* @return an array representing the output of the command in each changed package
*/
export default async function (since, excludePackages = []) {
const out = (await runOnChanged("printenv PNPM_PACKAGE_NAME", since, [], excludePackages)).stdout.trim();
if (out.includes("No projects matched the filters in")) {
return [];
}
return out.split("\n");
}