Merge pull request #207 from AikidoSec/improve-build-stdio

Improve build stdio
This commit is contained in:
bitterpanda 2025-12-03 16:06:35 +01:00 committed by GitHub
commit de1fd001d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,10 +13,14 @@ if (!target) {
} }
(async function main() { (async function main() {
const startBuildTime = performance.now();
await clearOutputFolder(); await clearOutputFolder();
console.log("- Cleared output folder ✅")
// Esbuild creates a single safe-chain.cjs with all dependencies included // Esbuild creates a single safe-chain.cjs with all dependencies included
await bundleSafeChain(); await bundleSafeChain();
console.log("- Bundled safe-chain into safe-chain.cjs (es-build) ✅")
// Copy assets that need to be included in the binary // Copy assets that need to be included in the binary
// - All shell scripts that are used to setup safe-chain // - All shell scripts that are used to setup safe-chain
@ -25,9 +29,15 @@ if (!target) {
await copyShellScripts(); await copyShellScripts();
await copyCertifi(); await copyCertifi();
await copyAndModifyPackageJson(); await copyAndModifyPackageJson();
console.log("- Copied auxiliary resources (shell, package.json,...) ✅")
// Creates a single binary with safe-chain.cjs and the copied assets // Creates a single binary with safe-chain.cjs and the copied assets
await buildSafeChainBinary(target); await buildSafeChainBinary(target);
console.log(`- Built safe-chain binary for ${target} (pkg) ✅`)
const endBuildTime = performance.now();
console.log(`🏁 Finished build in ${((endBuildTime - startBuildTime)/1000).toFixed(2)}s`);
})(); })();
async function clearOutputFolder() { async function clearOutputFolder() {