Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
at main 609 B view raw
1#!/usr/bin/env node 2 3import { listPackages } from './lib/packages.mjs'; 4import { preparePackage, packPackage } from './lib/commands.mjs'; 5import { uploadArtifact } from './lib/github.mjs'; 6 7(async () => { 8 try { 9 const isPR = process.env.GITHUB_EVENT_NAME === 'pull_request'; 10 const packages = await listPackages(); 11 const packs = packages.map(async cwd => { 12 await preparePackage(cwd); 13 await packPackage(cwd); 14 if (isPR) { 15 await uploadArtifact(cwd); 16 } 17 }); 18 19 await Promise.all(packs); 20 } catch (e) { 21 console.error(e.message); 22 process.exit(1); 23 } 24})();