-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
setLicenses(
await Promise.all(
[...Object.keys(dependencies), ...Object.keys(devDependencies)].map(async dep => {
// TODO: Add back types in a more sane way
let npmPackage: any;
try {
npmPackage = await ky.get(`https://registry.npmjs.org/${dep}`).json();
const normalizedRepoURL = new URL(
npmPackage.repository?.url.replace(/\.git$/, '').replace('git+', '') || `https://github.com/npm/${dep}`,
);
normalizedRepoURL.protocol = 'https';
if (npmPackage.repository?.url && npmPackage.repository?.type === 'git') {
const repoDefaultBranch = await getRepoDefaultBranch(normalizedRepoURL.href);
console.log(normalizedRepoURL.href, repoDefaultBranch);
// license = await ky