diff --git a/apps/leaderboard/netlify.toml b/apps/leaderboard/netlify.toml index 9317cdb6ab..6bc75bb3c4 100644 --- a/apps/leaderboard/netlify.toml +++ b/apps/leaderboard/netlify.toml @@ -2,8 +2,13 @@ publish = "dist/apps/leaderboard" command = "yarn nx build leaderboard" - # If the branch is not master, continue the build process - # If the branch is master, check if the project's CHANGELOG.md file has changed - # If the CHANGELOG.md file has changed, continue the build process, - # Otherwise, stop the build process - ignore = "[ \"$BRANCH\" != \"master\" ] && exit 1 || git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF -- apps/leaderboard/CHANGELOG.md && exit 0 || exit 1" + # Trigger a master deploy whenever the app's own source, the shared + # libs it consumes, or the workspace dep manifest changes. The previous + # version gated on apps/leaderboard/CHANGELOG.md only, which silently + # cancelled every push that wasn't a release-PR — leaderboard had + # never deployed before we caught it. CHANGELOG.md is now implicitly + # covered (it's inside apps/leaderboard/), and any source/config/ + # lockfile change also re-triggers. + # + # Non-master branches always build (gives PR-preview deploys). + ignore = "[ \"$BRANCH\" != \"master\" ] && exit 1 || git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF -- apps/leaderboard/ libs/ package.json yarn.lock tsconfig.base.json nx.json && exit 0 || exit 1" diff --git a/apps/tangle-cloud/netlify.toml b/apps/tangle-cloud/netlify.toml index c6dfa9f6c5..abbc4ab6d1 100644 --- a/apps/tangle-cloud/netlify.toml +++ b/apps/tangle-cloud/netlify.toml @@ -2,6 +2,17 @@ publish = "dist/apps/tangle-cloud" command = "yarn nx build tangle-cloud" + # Trigger a master deploy whenever the app's own source, the shared + # libs it consumes, or the workspace dep manifest changes. The previous + # version gated on apps/tangle-cloud/CHANGELOG.md only, which silently + # cancelled every push that wasn't a release-PR — a year of overhaul + # work piled up un-deployed before we caught it. CHANGELOG.md is now + # implicitly covered (it's inside apps/tangle-cloud/), and any source/ + # config/lockfile change also re-triggers. + # + # Non-master branches always build (gives PR-preview deploys). + ignore = "[ \"$BRANCH\" != \"master\" ] && exit 1 || git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF -- apps/tangle-cloud/ libs/ package.json yarn.lock tsconfig.base.json nx.json && exit 0 || exit 1" + # ─── Per-context environment ─────────────────────────────────────────── # # Vite reads VITE_* vars at build time and inlines them into the bundle, @@ -28,12 +39,6 @@ # Same default for any non-master branch deploy (e.g. staging). VITE_BLUEPRINT_IFRAME_ENABLED = "true" - # If the branch is not master, continue the build process - # If the branch is master, check if the project's CHANGELOG.md file has changed - # If the CHANGELOG.md file has changed, continue the build process, - # Otherwise, stop the build process - ignore = "[ \"$BRANCH\" != \"master\" ] && exit 1 || git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF -- apps/tangle-cloud/CHANGELOG.md && exit 0 || exit 1" - # ─── Security headers ─────────────────────────────────────────────────── # # Scope is intentionally narrow: we set ONLY the headers needed to harden diff --git a/apps/tangle-cloud/src/components/ServiceRequestDetails/BlueprintInfoCard.tsx b/apps/tangle-cloud/src/components/ServiceRequestDetails/BlueprintInfoCard.tsx index 83c3061dda..1821a23cd8 100644 --- a/apps/tangle-cloud/src/components/ServiceRequestDetails/BlueprintInfoCard.tsx +++ b/apps/tangle-cloud/src/components/ServiceRequestDetails/BlueprintInfoCard.tsx @@ -1,5 +1,5 @@ import { FC } from 'react'; -import { isEthereumAddress } from '@polkadot/util-crypto'; +import { isAddress } from 'viem'; import { twMerge } from 'tailwind-merge'; import { Text } from '../sandbox/SandboxUi'; @@ -25,7 +25,7 @@ const BlueprintInfoCard: FC = ({ instancesCount, operatorsCount, }) => { - const formattedAuthor = isEthereumAddress(author) + const formattedAuthor = isAddress(author, { strict: false }) ? shortenValue(author) : author.length > 24 ? shortenValue(author) diff --git a/apps/tangle-cloud/src/components/TxHistoryDrawer.tsx b/apps/tangle-cloud/src/components/TxHistoryDrawer.tsx index ccbf103d3d..b8c89336ed 100644 --- a/apps/tangle-cloud/src/components/TxHistoryDrawer.tsx +++ b/apps/tangle-cloud/src/components/TxHistoryDrawer.tsx @@ -1,4 +1,3 @@ -import { BN } from '@polkadot/util'; import * as Dialog from '@radix-ui/react-dialog'; import { CheckboxCircleLine, @@ -30,7 +29,7 @@ const shortenHex = (value: string) => value.length > 14 ? `${value.slice(0, 8)}...${value.slice(-6)}` : value; const shortenString = (value: string) => value.length > 14 ? `${value.slice(0, 8)}...${value.slice(-6)}` : value; -const formatDisplayAmount = (value: BN | bigint, decimals: number) => { +const formatDisplayAmount = (value: bigint, decimals: number) => { const raw = value.toString(); if (decimals <= 0) return addCommasToNumber(Number(raw)); const padded = raw.padStart(decimals + 1, '0'); @@ -203,7 +202,7 @@ const DetailRow: FC = ({ if (typeof value === 'number') { if (isAmountKey) { const decimals = tokenMetadata?.decimals ?? 18; - const formatted = formatDisplayAmount(new BN(value), decimals); + const formatted = formatDisplayAmount(BigInt(value), decimals); if (isSharesKey) { return formatted; } @@ -224,7 +223,7 @@ const DetailRow: FC = ({ if (typeof value === 'string') { if (isAmountKey && isNumericString(value)) { const decimals = tokenMetadata?.decimals ?? 18; - const formatted = formatDisplayAmount(new BN(value), decimals); + const formatted = formatDisplayAmount(BigInt(value), decimals); if (isSharesKey) { return formatted; } @@ -244,7 +243,7 @@ const DetailRow: FC = ({ }, [value, isAmountKey, isSharesKey, tokenMetadata, nativeTokenSymbol]); const rawValue = useMemo(() => { - if (BN.isBN(value)) { + if (typeof value === 'bigint') { return value.toString(); } diff --git a/apps/tangle-cloud/src/pages/instances/TotalValueLocked/TotalValueLockedTable.tsx b/apps/tangle-cloud/src/pages/instances/TotalValueLocked/TotalValueLockedTable.tsx index ae879cfed8..c48b594d59 100644 --- a/apps/tangle-cloud/src/pages/instances/TotalValueLocked/TotalValueLockedTable.tsx +++ b/apps/tangle-cloud/src/pages/instances/TotalValueLocked/TotalValueLockedTable.tsx @@ -25,16 +25,20 @@ import type { } from '../../../components/tangleCloudTable/type'; import { Link } from 'react-router'; import { TangleDAppPagePath } from '../../../types'; -import type { BN } from '@polkadot/util'; -const toBigInt = (value: bigint | BN): bigint => +// Locally typed to avoid pulling in `@polkadot/util` for a type-only reference. +// The shared `StakingVault` shape uses BN for some amount fields; we only ever +// call `.toString()` on them, so a structural type is sufficient. +type BigIntish = bigint | { toString(): string }; + +const toBigInt = (value: BigIntish): bigint => typeof value === 'bigint' ? value : BigInt(value.toString()); const pluralize = (word: string, plural: boolean) => plural ? `${word}s` : word; const formatPercentage = (value: number) => `${(value * 100).toLocaleString(undefined, { maximumFractionDigits: 2 })}%`; -const formatAmount = (amount: bigint | BN, decimals: number): string => { +const formatAmount = (amount: BigIntish, decimals: number): string => { const formatted = formatUnits(toBigInt(amount), decimals); const num = parseFloat(formatted); if (num === 0) return '0'; @@ -46,7 +50,7 @@ const formatAmount = (amount: bigint | BN, decimals: number): string => { }); }; -const calculateRatio = (a: bigint | BN, b: bigint | BN): number => { +const calculateRatio = (a: BigIntish, b: BigIntish): number => { const aBigInt = toBigInt(a); const bBigInt = toBigInt(b); if (bBigInt === BigInt(0)) return 0; diff --git a/apps/tangle-cloud/src/pages/rewards/page.tsx b/apps/tangle-cloud/src/pages/rewards/page.tsx index 2c7f57e3e5..ad13020576 100644 --- a/apps/tangle-cloud/src/pages/rewards/page.tsx +++ b/apps/tangle-cloud/src/pages/rewards/page.tsx @@ -24,7 +24,6 @@ import { TableHeader, TableRow, } from '@tangle-network/sandbox-ui/primitives'; -import { BN } from '@polkadot/util'; import { ExternalLinkLine, FileCopyLine, @@ -59,7 +58,7 @@ const shortenHex = (value: string, chars = 6) => ? `${value.slice(0, chars)}...${value.slice(-chars)}` : value; -const formatDisplayAmount = (value: BN, decimals: number) => { +const formatDisplayAmount = (value: bigint, decimals: number) => { const raw = value.toString(); const padded = raw.padStart(decimals + 1, '0'); const whole = padded.slice(0, -decimals); @@ -737,7 +736,7 @@ const PendingRewardAmountCell: FC<{ token: Address; amount: bigint }> = ({ return ( - {formatDisplayAmount(new BN(amount.toString()), decimals)} + {formatDisplayAmount(amount, decimals)} ); }; @@ -759,7 +758,7 @@ const RewardAmountCell: FC<{ token: Address; amount: bigint }> = ({ return ( - {formatDisplayAmount(new BN(amount.toString()), decimals)} + {formatDisplayAmount(amount, decimals)} ); }; diff --git a/apps/tangle-dapp/netlify.toml b/apps/tangle-dapp/netlify.toml index 19ebcec94d..46201c0f6c 100644 --- a/apps/tangle-dapp/netlify.toml +++ b/apps/tangle-dapp/netlify.toml @@ -2,11 +2,16 @@ publish = "dist/apps/tangle-dapp" command = "yarn nx build tangle-dapp" - # If the branch is not master, continue the build process - # If the branch is master, check if the project's CHANGELOG.md file has changed - # If the CHANGELOG.md file has changed, continue the build process, - # Otherwise, stop the build process - ignore = "[ \"$BRANCH\" != \"master\" ] && exit 1 || git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF -- apps/tangle-dapp/CHANGELOG.md && exit 0 || exit 1" + # Trigger a master deploy whenever the app's own source, the shared + # libs it consumes, or the workspace dep manifest changes. The previous + # version gated on apps/tangle-dapp/CHANGELOG.md only, which silently + # cancelled every push that wasn't a release-PR — production was stuck + # on the August 2025 release until we caught it. CHANGELOG.md is now + # implicitly covered (it's inside apps/tangle-dapp/), and any source/ + # config/lockfile change also re-triggers. + # + # Non-master branches always build (gives PR-preview deploys). + ignore = "[ \"$BRANCH\" != \"master\" ] && exit 1 || git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF -- apps/tangle-dapp/ libs/ package.json yarn.lock tsconfig.base.json nx.json && exit 0 || exit 1" # ─── Cache headers ────────────────────────────────────────────────────── #