@@ -2,6 +2,9 @@ import * as fs from 'node:fs';
22import { join , parse as parsePath } from 'node:path' ;
33
44import type { AddressLike } from 'ethers' ;
5+ import { format } from 'prettier' ;
6+
7+ const PRETTIER_CONFIG = join ( __dirname , '..' , '..' , '.prettierrc' ) ;
58
69export interface Deployment {
710 deploymentName : string ; // The full deterministic name from the artifact file
@@ -41,7 +44,7 @@ function extractContractName(deploymentName: string): string {
4144 * with an array of deployment instances.
4245 * @returns A stringified JSON object of deployment addresses.
4346 */
44- export function getDeploymentAddresses ( ) : string {
47+ export async function getDeploymentAddresses ( ) : Promise < string > {
4548 const allDeployments : AllDeploymentsByContract = { } ;
4649 // Assumes this script is in data-feed-proxy-combinators/scripts/src/
4750 // and the deployments directory is at data-feed-proxy-combinators/deployments/
@@ -90,5 +93,8 @@ export function getDeploymentAddresses(): string {
9093 } ;
9194 }
9295 }
93- return `${ JSON . stringify ( allDeployments , null , 2 ) } \n` ;
96+
97+ const rawContent = JSON . stringify ( allDeployments ) ;
98+ const prettierConfig = JSON . parse ( fs . readFileSync ( PRETTIER_CONFIG , 'utf8' ) ) ;
99+ return format ( rawContent , { ...prettierConfig , parser : 'json' } ) ;
94100}
0 commit comments