From 3341d629cb7b40e4cd5504863f6ff79480cd7a89 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Tue, 26 Sep 2023 17:22:13 +0100 Subject: [PATCH] Update release pipeline, update TS interfaces --- .github/workflows/publish.yml | 4 ++-- package.json | 3 ++- src/core/interfaces/ChainsMetadata.ts | 14 +++++++++++++- src/core/metadata.ts | 6 +++--- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4b4f3ea..0c15f01 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: node-version: '18.x' registry-url: 'https://registry.npmjs.org' @@ -46,7 +46,7 @@ jobs: echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV - name: Yarn build run: | - yarn run build + yarn build:lib - name: Publish on npm run: | if [[ "$BRANCH" == "stable" ]]; then diff --git a/package.json b/package.json index 126d9ec..6f23dae 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,8 @@ "lint": "eslint --ext .js,.jsx,.ts,.tsx --fix", "prettier": "prettier --write \"src/**/*.{ts,tsx,js,mdx}\"", "test": "vitest", - "test:cov": "vitest run --coverage" + "test:cov": "vitest run --coverage", + "version": "node -e \"console.log(require('./package.json').version);\"" }, "devDependencies": { "@storybook/addon-essentials": "7.4.0", diff --git a/src/core/interfaces/ChainsMetadata.ts b/src/core/interfaces/ChainsMetadata.ts index 92a43cc..2c41898 100644 --- a/src/core/interfaces/ChainsMetadata.ts +++ b/src/core/interfaces/ChainsMetadata.ts @@ -21,16 +21,24 @@ * @copyright SKALE Labs 2022-Present */ +import { SkaleNetwork } from './Config' + export interface ChainMetadata { alias?: string minSfuelWei?: string faucetUrl?: string category: string + background: string + gradientBackground?: string + description?: string + url?: string apps?: { [appName: string]: { alias: string background: string - url: string + gradientBackground?: string + description?: string + url?: string } } } @@ -38,3 +46,7 @@ export interface ChainMetadata { export interface ChainsMetadataMap { [chainName: string]: ChainMetadata } + +export type NetworksMetadataMap = { + [key in SkaleNetwork]: ChainsMetadataMap +} diff --git a/src/core/metadata.ts b/src/core/metadata.ts index 89b5329..2475604 100644 --- a/src/core/metadata.ts +++ b/src/core/metadata.ts @@ -22,7 +22,7 @@ */ import { TokenData } from './dataclasses' -import { SkaleNetwork } from './interfaces' +import { SkaleNetwork, NetworksMetadataMap } from './interfaces' import { MAINNET_CHAIN_NAME } from './constants' import mainnetMeta from '../meta/mainnet/chains.json' @@ -37,14 +37,14 @@ import * as REGRESSION_CHAIN_ICONS from '../meta/regression/icons' import * as icons from '../icons' -const CHAIN_ICONS = { +const CHAIN_ICONS: { [network in SkaleNetwork]: any } = { mainnet: MAINNET_CHAIN_ICONS, staging: STAGING_CHAIN_ICONS, legacy: LEGACY_CHAIN_ICONS, regression: REGRESSION_CHAIN_ICONS } -export const CHAINS_META = { +export const CHAINS_META: NetworksMetadataMap = { mainnet: mainnetMeta, staging: stagingMeta, legacy: legacyMeta,