Skip to content

Instantly share code, notes, and snippets.

@rcline
Last active January 3, 2019 21:38
Show Gist options
  • Save rcline/00c4935f435a0e3c22064ecb0a56e05a to your computer and use it in GitHub Desktop.
Save rcline/00c4935f435a0e3c22064ecb0a56e05a to your computer and use it in GitHub Desktop.
Run on the PRs file view page to get a list of monorepo packages that where edited.
((doc, log) => {
el = doc.getElementsByClassName("link-gray-dark");
pkgs = [];
Object.keys(el).map((c) => {
const split = el[c].innerText.split('/');
if (split[0] == 'packages') {
pkgs.push(
`@sstk/${split[1]}`
)
}
});
pkgs = pkgs.filter(function(item, pos, self) {
return self.indexOf(item) == pos;
});
log(pkgs.length);
log(`(${pkgs.join(', ')})`);
})(document, console.log);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment