Hey is a decentralized and permissionless social media app built with Lens Protocol 馃尶
at main 26 lines 836 B view raw
1#!/usr/bin/env node 2import { execSync } from "node:child_process"; 3import { readdir } from "node:fs/promises"; 4import { join } from "node:path"; 5 6async function sortPackages(directory) { 7 const entries = await readdir(directory, { withFileTypes: true }); 8 await Promise.all( 9 entries.map(async (entry) => { 10 const fullPath = join(directory, entry.name); 11 if (entry.isDirectory()) { 12 if (entry.name === "node_modules") { 13 return; 14 } 15 await sortPackages(fullPath); 16 } else if (entry.name === "package.json") { 17 console.log(`Sorting ${fullPath}`); 18 execSync(`npx sort-package-json ${fullPath}`, { stdio: "inherit" }); 19 } 20 }) 21 ); 22} 23 24console.log("Sorting package.json \ud83d\udce6"); 25await sortPackages(process.cwd()); 26console.log("package.json sorted \ud83c\udf89");