Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions .lintstagedrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
"eslint --ignore-path .gitignore",
"prettier --write"
],
"**/*.{md,json,yaml,yml}": [
"prettier --write"
],
"**/*.{py}": [
"poetry run ruff check --fix",
"pnpm pyright"
]
}
"**/*.{md,json,yaml,yml}": ["prettier --write"],
"**/*.{py}": ["poetry run ruff check --fix", "pnpm pyright"]
}
2 changes: 1 addition & 1 deletion data/projects/m/magpieprotocol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ name: magpieprotocol
display_name: fly trade
description: fly trade aggregates liquidity from DEXs, DeFi protocols, and bridges to provide provably better pricing compared to leading aggregators, while delivering a seamless UX.
websites:
- url: https://www.fly.trade/
- url: https://www.fly.trade/
172 changes: 160 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@
"start": "node --loader ts-node/esm src/cli.ts",
"test": "NODE_OPTIONS=\"--no-warnings --experimental-vm-modules\" jest --passWithNoTests",
"transform": "pnpm start run-transformation",
"types": "pnpm types:json && pnpm types:mv",
"types:json": "pnpm json2ts -i './src/resources/schema/' -o 'src/types' --cwd './src/resources/schema'",
"types:mv": "find src/types/ -name '*.d.ts' -type f | sed s/\\.d.ts$// | xargs -I _ bash -c 'mv _.d.ts _.ts'",
"types": "pnpm types:zod",
"types:zod": "pnpm json-schema-to-zod -i src/resources/schema/blockchain-address.json -o src/types/blockchain-address.ts -n BlockchainAddressSchema -t BlockchainAddress --withJsdocs && pnpm json-schema-to-zod -i src/resources/schema/collection.json -o src/types/collection.ts -n CollectionSchema -t Collection --withJsdocs && pnpm json-schema-to-zod -i src/resources/schema/named.json -o src/types/named.ts -n NamedSchema -t Named --withJsdocs && pnpm json-schema-to-zod -i src/resources/schema/project.json -o src/types/project.ts -n ProjectSchema -t Project --withJsdocs && pnpm json-schema-to-zod -i src/resources/schema/social-profile.json -o src/types/social-profile.ts -n SocialProfileSchema -t SocialProfile --withJsdocs && pnpm json-schema-to-zod -i src/resources/schema/url.json -o src/types/url.ts -n UrlSchema -t URL --withJsdocs",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no way to glob for the files? (e.g. **/*.json)

"validate": "pnpm validate:collections && pnpm validate:projects",
"validate:collections": "pnpm start validate-collections",
"validate:projects": "pnpm start validate-projects",
Expand Down Expand Up @@ -71,6 +70,7 @@
"dotenv": "^16.3.1",
"ethers": "^6.9.0",
"glob": "^10.3.10",
"json-schema-to-zod": "^2.6.1",
"lodash": "^4.17.21",
"mkdirp": "^3.0.1",
"pyright": "^1.1.369",
Expand All @@ -79,6 +79,7 @@
"ts-adt": "^2.1.2",
"winston": "^3.11.0",
"yaml": "^2.3.4",
"yargs": "^17.7.2"
"yargs": "^17.7.2",
"zod": "^3.25.67"
}
}
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/actions/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export async function validateProjects(args: ValidateArgs) {
project.defillama?.forEach((x) => addKey(x.url, file));
// Check that all blockchain addresses belong to a single project file
project.blockchain?.forEach((x) =>
x.networks.forEach((n) => addKey(`${n}:${x.address}`, file)),
x.networks.forEach((n: any) => addKey(`${n}:${x.address}`, file)),
);
} catch (e) {
console.error("Error validating ", file);
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Project, URL, BlockchainAddress } from "./types/project.js";
import { Project } from "./types/project.js";
import { URL } from "./types/url.js";
import { BlockchainAddress } from "./types/blockchain-address.js";
import { Collection } from "./types/collection.js";
import { BlockchainNetwork, BlockchainTag } from "./types/custom.js";
export {
Expand Down
Loading