Skip to content

Commit

Permalink
fix: add tokenlist to ts exports (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra authored Feb 21, 2024
1 parent 0fcb0fa commit bb0acd6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "This repository contains an up-to-date registry of all addresses of the Aave ecosystem's smart contracts, for its usage in Solidity codebases.",
"private": false,
"files": [
"dist"
"dist",
"tokenlist.json"
],
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -33,7 +34,7 @@
"generate:addresses": "tsx scripts/generateAddresses.ts && npm run prettier",
"start": "tsx scripts/generateABIs.ts &&tsx scripts/generateAddresses.ts && npm run prettier",
"build": "tsup",
"ci:publish": "npm run build && cp tokenlist.json dist/tokenlist.json && npm publish --access=public",
"ci:publish": "npm run build && npm publish --access=public",
"test": "echo 'no tests exist yet'"
},
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion scripts/generateAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ async function main() {

const jsExports = [
...imports.map((f) => f.js).flat(),
"export * as AaveV3Harmony from './AaveV3Harmony';",
"export {default as tokenlist} from './../../tokenlist.json';" +
"export * as AaveV3Harmony from './AaveV3Harmony';",
];
writeFileSync(`./src/ts/AaveAddressBook.ts`, prefixWithGeneratedWarning(''));
jsExports.map((jsExport) => appendFileSync('./src/ts/AaveAddressBook.ts', `${jsExport}\n`));
Expand Down
1 change: 1 addition & 0 deletions src/ts/AaveAddressBook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ export {IStkAaveToken_ABI} from './abis/IStkAaveToken';
export {IATokenWithDelegation_ABI} from './abis/IATokenWithDelegation';
export {IStaticATokenFactory_ABI} from './abis/IStaticATokenFactory';
export {IStaticATokenLM_ABI} from './abis/IStaticATokenLM';
export {default as tokenlist} from './../../tokenlist.json';
export * as AaveV3Harmony from './AaveV3Harmony';
2 changes: 1 addition & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default await defineConfig({
clean: true,
splitting: false,
dts: true,
esbuildPlugins: [esbuildPluginFilePathExtensions({cjsExtension: 'js'})],
esbuildPlugins: [esbuildPluginFilePathExtensions({cjsExtension: 'js', filter: /.*\.ts/})],
});

0 comments on commit bb0acd6

Please sign in to comment.