Commit 923f9e49 authored by tom's avatar tom

config validator

parent 788502cc
...@@ -2,3 +2,4 @@ node_modules ...@@ -2,3 +2,4 @@ node_modules
node_modules_linux node_modules_linux
playwright/envs.js playwright/envs.js
tools/marketplace-config-validator/schema.*
\ No newline at end of file
...@@ -48,3 +48,6 @@ yarn-error.log* ...@@ -48,3 +48,6 @@ yarn-error.log*
/playwright/envs.js /playwright/envs.js
**.dec** **.dec**
# tools
tools/marketplace-config-validator/schema.*
...@@ -14,4 +14,8 @@ for file in `git diff --diff-filter=ACMRT --cached --name-only | grep ".svg\$"` ...@@ -14,4 +14,8 @@ for file in `git diff --diff-filter=ACMRT --cached --name-only | grep ".svg\$"`
git add $file git add $file
done done
# format svg
echo 🧿 Running marketplace config validator...
./deploy/scripts/validate_marketplace_config.sh
echo ✅ All pre-commit jobs are done echo ✅ All pre-commit jobs are done
yarn ts-to-zod ./types/client/apps.ts ./tools/marketplace-config-validator/schema.ts
yarn tsc -p ./tools/marketplace-config-validator/tsconfig.json
node ./tools/marketplace-config-validator/index.js
\ No newline at end of file
...@@ -115,10 +115,12 @@ ...@@ -115,10 +115,12 @@
"svgo": "^2.8.0", "svgo": "^2.8.0",
"ts-jest": "^29.0.3", "ts-jest": "^29.0.3",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"ts-to-zod": "^3.0.0",
"typescript": "4.9.5", "typescript": "4.9.5",
"vite-plugin-svgr": "^2.2.2", "vite-plugin-svgr": "^2.2.2",
"vite-tsconfig-paths": "^3.5.2", "vite-tsconfig-paths": "^3.5.2",
"ws": "^8.11.0" "ws": "^8.11.0",
"zod": "^3.21.4"
}, },
"lint-staged": { "lint-staged": {
"*.{js,jsx,ts,tsx}": "eslint --cache --fix" "*.{js,jsx,ts,tsx}": "eslint --cache --fix"
......
/* eslint-disable no-console */
const baseGoerliConfig = require('../../configs/marketplace/base-goerli.json') ;
const ethGoerliConfig = require('../../configs/marketplace/eth-goerli.json') ;
const { appItemOverviewSchema } = require('./schema.js');
console.log('Checking eth-goerli.json...');
appItemOverviewSchema.array().parse(ethGoerliConfig);
console.log('All good!');
console.log('Checking base-goerli.json...');
appItemOverviewSchema.array().parse(baseGoerliConfig);
console.log('All good!');
{
"compilerOptions": {
"target": "es6",
"skipLibCheck": true,
"strict": true,
"esModuleInterop": true,
"module": "CommonJS",
"moduleResolution": "node",
"isolatedModules": true,
"incremental": true,
"baseUrl": ".",
},
"include": ["./**.ts"],
"exclude": ["node_modules", "node_modules_linux"],
}
export enum MarketplaceCategoryId { export type MarketplaceCategoriesIds = 'all' | 'favorites' | 'defi' | 'exchanges' | 'finance' | 'games' | 'marketplaces' | 'nft' |
'all', 'security' | 'social' | 'tools' | 'yieldFarming';
'favorites',
'defi',
'exchanges',
'finance',
'games',
'marketplaces',
'nft',
'security',
'social',
'tools',
'yieldFarming',
}
export type MarketplaceCategoriesIds = keyof typeof MarketplaceCategoryId;
export type MarketplaceCategory = { id: MarketplaceCategoriesIds; name: string } export type MarketplaceCategory = { id: MarketplaceCategoriesIds; name: string }
export type AppItemPreview = { export type AppItemPreview = {
id: string; id: string;
external: boolean; external?: boolean;
title: string; title: string;
logo: string; logo: string;
shortDescription: string; shortDescription: string;
......
...@@ -5,7 +5,7 @@ import React from 'react'; ...@@ -5,7 +5,7 @@ import React from 'react';
type Props = { type Props = {
id: string; id: string;
url: string; url: string;
external: boolean; external?: boolean;
title: string; title: string;
} }
......
...@@ -5,7 +5,7 @@ import React from 'react'; ...@@ -5,7 +5,7 @@ import React from 'react';
type Props = { type Props = {
id: string; id: string;
url: string; url: string;
external: boolean; external?: boolean;
title: string; title: string;
} }
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment