diff --git a/deps.ts b/deps.ts index f477b4d..8604049 100644 --- a/deps.ts +++ b/deps.ts @@ -39,7 +39,7 @@ if (parsed.success) { "✅ Valid package.json", Object.keys(parsed.data) .map((dep) => cyan(dep)) - .join(" and ") + .join(" and "), ); } else { console.error("🚨 Invalid dependencies fields in your package.json"); @@ -50,9 +50,11 @@ if (parsed.success) { const dependencies_map = new Map(); for (const [type, dependencies] of Object.entries(parsed.data)) { - for (const [dep, ver] of Object.entries(dependencies).map( - ([dep, ver]) => [dep, coerce(ver)] as const - )) { + for ( + const [dep, ver] of Object.entries(dependencies).map( + ([dep, ver]) => [dep, coerce(ver)] as const, + ) + ) { if (dependencies_map.has(dep)) { console.error("🚨 Duplicate dependency:", dep); Deno.exit(1); @@ -82,8 +84,8 @@ const fetched_peers = await Promise.all( fetch( new URL( `${dependency}@${version.version}/package.json`, - "https://esm.sh/" - ) + "https://esm.sh/", + ), ) .then((res) => res.json()) .then(parse_peers) @@ -92,16 +94,18 @@ const fetched_peers = await Promise.all( console.error("🚨 Failed to parse package.json for", dependency); Deno.exit(2); }) - ) + ), ); let missing_peer_dependencies = 0; -for (const { - dependency, - peerDependencies, - peerDependenciesMeta, -} of fetched_peers) { +for ( + const { + dependency, + peerDependencies, + peerDependenciesMeta, + } of fetched_peers +) { if (peerDependencies) { const mismatched = Object.entries(peerDependencies).filter(([dep, ver]) => { const specified_version = dependencies_map.get(dep); @@ -114,13 +118,15 @@ for (const { if (mismatched.length === 0) { console.info( - `✅ All ${cyan("peerDependencies")} satisfied for ${blue(dependency)}` + `✅ All ${cyan("peerDependencies")} satisfied for ${blue(dependency)}`, ); } else { console.error( - `🚨 The following ${cyan("peerDependencies")} from ${blue( - dependency - )} are unsatisfied:` + `🚨 The following ${cyan("peerDependencies")} from ${ + blue( + dependency, + ) + } are unsatisfied:`, ); for (const [dep, ver] of mismatched) { console.error(` - ${[blue(dep), gray("@"), yellow(ver)].join("")}`);