diff --git a/raw/chains/Chain11155420.svg b/raw/chains/Chain11155420.svg index 098392b7..a165bc09 100644 --- a/raw/chains/Chain11155420.svg +++ b/raw/chains/Chain11155420.svg @@ -1,21 +1,3 @@ - - - - - - - + + diff --git a/raw/chains/Chain599.svg b/raw/chains/Chain599.svg index cf4a63a1..f91b74a5 100644 --- a/raw/chains/Chain599.svg +++ b/raw/chains/Chain599.svg @@ -1,7 +1,7 @@ diff --git a/scripts/build-svg.js b/scripts/build-svg.js index c258011c..c6eccb03 100644 --- a/scripts/build-svg.js +++ b/scripts/build-svg.js @@ -10,14 +10,18 @@ const outputPath = './dist'; const categories = ['chain', 'symbol', 'api-provider']; +let chainLightLogos = []; +let apiProviderLightLogos = []; +let symbolLightLogos = []; + function getManualLogos(mode) { switch (mode) { case 'chain': - return ['5001-light', '5000-light', '280-light', '324-light', '59140-light', '59144-light']; + return [...chainLightLogos]; case 'symbol': - return []; + return [...symbolLightLogos]; case 'api-provider': - return []; + return [...apiProviderLightLogos]; default: break; } @@ -133,10 +137,27 @@ async function renameFiles() { }); } +async function findLightLogos() { + const [chainFiles, apiProviderFiles, symbolFiles] = await Promise.all([ + fs.readdir('./optimized/chain', 'utf-8'), + fs.readdir('./optimized/api-provider', 'utf-8'), + fs.readdir('./optimized/symbol', 'utf-8') + ]); + + chainLightLogos = chainFiles + .filter((file) => file.includes('light')) + .map((file) => file.replace('Chain', '')) + + apiProviderLightLogos = apiProviderFiles.filter((file) => file.includes('light')); + + symbolLightLogos = symbolFiles.filter((file) => file.includes('light')); +} + async function main() { console.log('🏗 Building logo package...'); rimraf(`${outputPath}/`) - .then(() => Promise.all([renameFiles()])) + .then(findLightLogos) + .then(renameFiles) .then(() => Promise.all([generateLogos('cjs'), generateLogos('esm')])) .then(() => console.log('✅ Finished building package.')); }