Skip to content

Commit

Permalink
chore: fix release, upgrade yarn (#280)
Browse files Browse the repository at this point in the history
* chore: fix release, upgrade yarn

* fix: missing yarn file
  • Loading branch information
Nejc authored Oct 31, 2023
1 parent 62037d7 commit 7cf5dfc
Show file tree
Hide file tree
Showing 11 changed files with 21,254 additions and 13,801 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: 🧩 Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install
run: yarn install --immutable --inline-builds

- name: 📋 Yarn Lock Changes
uses: Simek/yarn-lock-changes@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: 🧩 Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --prefer-offline --frozen-lockfile
run: yarn install --immutable --inline-builds

- name: 📦 Release
run: yarn release
Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,12 @@ dist-ssr
*.njsproj
*.sln
*.sw?
.yarn

# yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.1.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.1.cjs
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"version": "1.2.0",
"type": "module",
"packageManager": "yarn@3.5.0",
"packageManager": "yarn@4.0.1",
"scripts": {
"dev": "vite",
"build": "node version.cjs && tsc && vite build && echo '/* /index.html 200' | cat > dist/_redirects",
Expand Down Expand Up @@ -74,12 +74,12 @@
"@polkadot/types-create": "^9.9.1",
"@polkadot/types-known": "^9.9.1",
"@preact/preset-vite": "^2.5.0",
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^11.0.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^8.0.7",
"@semantic-release/npm": "^9.0.2",
"@semantic-release/release-notes-generator": "^10.0.3",
"@semantic-release/github": "^9.2.1",
"@semantic-release/npm": "^11.0.0",
"@semantic-release/release-notes-generator": "^12.0.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/preact": "^3.2.3",
"@testing-library/preact-hooks": "^1.1.0",
Expand All @@ -105,7 +105,7 @@
"prettier": "^2.8.4",
"react-table": "^7.8.0",
"sass": "^1.58.3",
"semantic-release": "^20.1.0",
"semantic-release": "^20.1.3",
"tailwindcss": "^3.2.7",
"typescript": "^4.9.5",
"vite": "^3.2.5"
Expand Down
7 changes: 4 additions & 3 deletions src/hooks/spacewalk/useBridgeSettings.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import _ from 'lodash';
import React, { StateUpdater, useEffect, useMemo, useState } from 'react';
import { Asset } from 'stellar-sdk';
Expand All @@ -23,12 +24,12 @@ function useBridgeSettings(): BridgeSettings {
const [manualVaultSelection, setManualVaultSelection] = useState(false);
const { getVaults, getVaultsWithIssuableTokens, getVaultsWithRedeemableTokens } = useVaultRegistryPallet();
const [selectedVault, setSelectedVault] = useState<ExtendedRegistryVault>();
const { selectedAsset, setSelectedAsset } = React.useContext(BridgeContext);
const { selectedAsset, setSelectedAsset } = (React.useContext(BridgeContext) || {}) as any;

useEffect(() => {
const combinedVaults: ExtendedRegistryVault[] = [];
Promise.all([getVaultsWithIssuableTokens(), getVaultsWithRedeemableTokens()]).then((data) => {
getVaults().forEach((vaultFromRegistry) => {
getVaults().forEach((vaultFromRegistry: any) => {
const vaultWithIssuable = data[0]?.find(([id, _]) => id.eq(vaultFromRegistry.id));
const vaultWithRedeemable = data[1]?.find(([id, _]) => id.eq(vaultFromRegistry.id));
const extended: ExtendedRegistryVault = vaultFromRegistry;
Expand Down Expand Up @@ -84,7 +85,7 @@ function useBridgeSettings(): BridgeSettings {
}
}
}
}, [manualVaultSelection, selectedAsset, selectedVault, vaultsForCurrency, wrappedAssets]);
}, [manualVaultSelection, selectedAsset, selectedVault, setSelectedAsset, vaultsForCurrency, wrappedAssets]);

return {
selectedVault,
Expand Down
8 changes: 4 additions & 4 deletions src/pages/bridge/Issue/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { useCallback, useMemo, useState } from 'preact/hooks';
import { Button } from 'react-daisyui';
import { useForm } from 'react-hook-form';
import { toast } from 'react-toastify';
import { useGlobalState } from '../../../GlobalStateProvider';
import { useNodeInfoState } from '../../../NodeInfoProvider';
import From from '../../../components/Form/From';
import OpenWallet from '../../../components/Wallet';
import { useGlobalState } from '../../../GlobalStateProvider';
import { getErrors, getEventBySectionAndMethod } from '../../../helpers/substrate';
import { RichIssueRequest, useIssuePallet } from '../../../hooks/spacewalk/issue';
import useBridgeSettings from '../../../hooks/spacewalk/useBridgeSettings';
import { useNodeInfoState } from '../../../NodeInfoProvider';
import { decimalToStellarNative, nativeToDecimal } from '../../../shared/parseNumbers';
import { FeeBox } from '../FeeBox';
import { ConfirmationDialog } from './ConfirmationDialog';
Expand Down Expand Up @@ -67,7 +67,7 @@ function Issue(props: IssueProps): JSX.Element {
}, [amountNative, api, createIssueRequestExtrinsic, selectedVault]);

const submitRequestIssueExtrinsic = useCallback(
(values: IssueFormValues) => {
(_values: IssueFormValues) => {
if (!requestIssueExtrinsic || !api || !selectedVault) {
return;
}
Expand Down Expand Up @@ -129,7 +129,7 @@ function Issue(props: IssueProps): JSX.Element {
onClose={() => setConfirmationDialogVisible(false)}
/>
<div className="w-full">
<form className="px-5 flex flex-col" onSubmit={handleSubmit(submitRequestIssueExtrinsic, () => {})}>
<form className="px-5 flex flex-col" onSubmit={handleSubmit(submitRequestIssueExtrinsic, () => undefined)}>
<From
register={register('amount')}
setValue={(n: number) => setValue('amount', n)}
Expand Down
15 changes: 8 additions & 7 deletions src/pages/bridge/Redeem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import { useEffect } from 'react';
import { Button } from 'react-daisyui';
import { useForm } from 'react-hook-form';
import { toast } from 'react-toastify';
import { useGlobalState } from '../../../GlobalStateProvider';
import { useNodeInfoState } from '../../../NodeInfoProvider';
import From from '../../../components/Form/From';
import LabelledInputField from '../../../components/LabelledInputField';
import OpenWallet from '../../../components/Wallet';
import { useGlobalState } from '../../../GlobalStateProvider';
import { assetDisplayName } from '../../../helpers/spacewalk';
import { isPublicKey } from '../../../helpers/stellar';
import { getErrors, getEventBySectionAndMethod } from '../../../helpers/substrate';
import { RichRedeemRequest, useRedeemPallet } from '../../../hooks/spacewalk/redeem';
import useBridgeSettings from '../../../hooks/spacewalk/useBridgeSettings';
import useBalances from '../../../hooks/useBalances';
import { useNodeInfoState } from '../../../NodeInfoProvider';
import { decimalToStellarNative, nativeToDecimal } from '../../../shared/parseNumbers';
import { FeeBox } from '../FeeBox';
import { ConfirmationDialog } from './ConfirmationDialog';
Expand Down Expand Up @@ -88,7 +88,7 @@ function Redeem(props: RedeemProps): JSX.Element {

requestRedeemExtrinsic
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.signAndSend(walletAccount.address, { signer: walletAccount.signer as any }, (result) => {
.signAndSend(walletAccount.address, { signer: walletAccount.signer as any }, (result: any) => {
const { status, events } = result;

const errors = getErrors(events, api);
Expand All @@ -107,7 +107,8 @@ function Redeem(props: RedeemProps): JSX.Element {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const redeemId = (requestRedeemEvent.data as any).redeemId;

getRedeemRequest(redeemId).then((redeemRequest) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
getRedeemRequest(redeemId).then((redeemRequest: any) => {
setSubmittedRedeemRequest(redeemRequest);
});
}
Expand All @@ -119,9 +120,9 @@ function Redeem(props: RedeemProps): JSX.Element {
}
}
})
.catch((error) => {
.catch((error: unknown) => {
console.error('Transaction submission failed', error);
toast('Transaction submission failed:' + error.toString(), {
toast(`Transaction submission failed: ${String(error)}`, {
type: 'error',
});
setSubmissionPending(false);
Expand All @@ -136,7 +137,7 @@ function Redeem(props: RedeemProps): JSX.Element {
onClose={() => setConfirmationDialogVisible(false)}
/>
<div className="w-full">
<form className="px-5 flex flex-col" onSubmit={handleSubmit(submitRequestRedeemExtrinsic, () => {})}>
<form className="px-5 flex flex-col" onSubmit={handleSubmit(submitRequestRedeemExtrinsic)}>
<From
register={register('amount')}
setValue={(n: number) => setValue('amount', n)}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/bridge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React from 'preact/compat';
import { StateUpdater, useMemo, useState } from 'preact/hooks';
import { Button, Card, Tabs } from 'react-daisyui';
import { Asset } from 'stellar-sdk';
import { useNodeInfoState } from '../../NodeInfoProvider';
import AmplitudeLogo from '../../assets/AmplitudeLogo';
import PendulumLogo from '../../assets/PendulumLogo';
import SettingsIcon from '../../assets/SettingsIcon';
import StellarLogo from '../../assets/StellarLogo';
import { SpacewalkConstants } from '../../helpers/spacewalk';
import { useNodeInfoState } from '../../NodeInfoProvider';
import Issue from './Issue';
import SettingsDialog from './Issue/SettingsDialog';
import Redeem from './Redeem';
Expand All @@ -23,7 +23,7 @@ interface BridgeContextValue {
setSelectedAsset: StateUpdater<Asset | undefined>;
}

export const BridgeContext = React.createContext<BridgeContextValue>({ setSelectedAsset: () => {} });
export const BridgeContext = React.createContext<BridgeContextValue>({ setSelectedAsset: () => undefined });

function Bridge(): JSX.Element | null {
const [tabValue, setTabValue] = useState(BridgeTabs.Issue);
Expand Down
Loading

0 comments on commit 7cf5dfc

Please sign in to comment.