Skip to content

Commit d88e89c

Browse files
authored
[RELEASE] chore(deps): sync tnt-core ABIs + modernize deps to prod-ready
Sync ABIs/fixtures from tnt-core HEAD (+onBinaryVersionPublished, +onOperatorBinaryAcked). Modernize deps: ~45 within-major bumps, @swc/core, storybook 8.6.18 alignment, @PolkaDot coherent ^13. Reverted majors that fragmented the tree (@tangle-network ui/sandbox/blueprint, @PolkaDot 14) — need coordinated React-19 / peer migration. Removed dead @mysten/dapp-kit + roleStore.tsx; consolidated browser-safe assert in @tangle-network/browser-utils repo-wide. Fixed pre-existing typecheck break. Peer-clean (0 warnings). Gates: typecheck, lint, 197 tests, build dapp+cloud all green.
1 parent 8490935 commit d88e89c

24 files changed

Lines changed: 4555 additions & 2728 deletions

File tree

apps/tangle-cloud/src/stores/roleStore.tsx

Lines changed: 0 additions & 47 deletions
This file was deleted.

apps/tangle-dapp/src/data/evm/useContractReadOnce.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ensureError from '@tangle-network/tangle-shared-ui/utils/ensureError';
2-
import assert from 'assert';
2+
import { assert } from '@tangle-network/browser-utils';
33
import { useCallback } from 'react';
44
import {
55
Abi as ViemAbi,

apps/tangle-dapp/src/utils/chainToNetwork.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
TANGLE_MAINNET_NETWORK,
1111
TANGLE_TESTNET_NATIVE_NETWORK,
1212
} from '@tangle-network/ui-components/constants/networks';
13-
import assert from 'assert';
13+
import { assert } from '@tangle-network/browser-utils';
1414

1515
const chainToNetworkMap = {
1616
[PresetTypedChainId.TangleLocalEVM]: TANGLE_LOCAL_DEV_NETWORK,

apps/tangle-dapp/src/utils/enumValueToNumber.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import assert from 'assert';
1+
import { assert } from '@tangle-network/browser-utils';
22

33
const enumValueToNumber = <T>(enumValue: T): number => {
44
assert(

eslint.config.js

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,6 @@ import reactRefresh from 'eslint-plugin-react-refresh';
77
import storybook from 'eslint-plugin-storybook';
88
import tseslint from 'typescript-eslint';
99

10-
const reactCompilerReadinessRules = {
11-
'react-hooks/config': 'warn',
12-
'react-hooks/error-boundaries': 'warn',
13-
'react-hooks/gating': 'warn',
14-
'react-hooks/globals': 'warn',
15-
'react-hooks/immutability': 'warn',
16-
'react-hooks/preserve-manual-memoization': 'warn',
17-
'react-hooks/purity': 'warn',
18-
'react-hooks/refs': 'warn',
19-
'react-hooks/set-state-in-effect': 'warn',
20-
'react-hooks/set-state-in-render': 'warn',
21-
'react-hooks/static-components': 'warn',
22-
'react-hooks/unsupported-syntax': 'warn',
23-
'react-hooks/use-memo': 'warn',
24-
};
25-
2610
export default tseslint.config(
2711
tseslint.configs.recommended,
2812
js.configs.recommended,
@@ -60,7 +44,19 @@ export default tseslint.config(
6044
// The v7 hooks plugin adds React Compiler readiness diagnostics to the
6145
// Nx React preset. Keep them visible without making compiler adoption a
6246
// repo-wide CI gate before the codebase is migrated.
63-
...reactCompilerReadinessRules,
47+
'react-hooks/config': 'warn',
48+
'react-hooks/error-boundaries': 'warn',
49+
'react-hooks/gating': 'warn',
50+
'react-hooks/globals': 'warn',
51+
'react-hooks/immutability': 'warn',
52+
'react-hooks/preserve-manual-memoization': 'warn',
53+
'react-hooks/purity': 'warn',
54+
'react-hooks/refs': 'warn',
55+
'react-hooks/set-state-in-effect': 'warn',
56+
'react-hooks/set-state-in-render': 'warn',
57+
'react-hooks/static-components': 'warn',
58+
'react-hooks/unsupported-syntax': 'warn',
59+
'react-hooks/use-memo': 'warn',
6460
'@nx/enforce-module-boundaries': [
6561
'error',
6662
{

libs/api-provider-environment/src/ConnectWallet/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
WebbErrorCodes,
1515
type WalletId,
1616
} from '@tangle-network/dapp-types';
17-
import assert from 'assert';
17+
import { assert } from '@tangle-network/browser-utils';
1818
import { useObservableState } from 'observable-hooks';
1919
import { useCallback, useEffect, useMemo } from 'react';
2020
import { useWebContext } from '../webb-context/webb-context';

libs/browser-utils/src/assert.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Browser-safe assertion. Throws a plain `Error` (not Node's `AssertionError`)
3+
* so callers introduce no Node-built-in dependency and stay bundle-clean for
4+
* browser targets. Carries a TypeScript `asserts condition` signature so call
5+
* sites retain type-narrowing, matching the ergonomics of Node's `assert`.
6+
*
7+
* @param condition - The condition to check.
8+
* @param message - Optional error message used when `condition` is falsy.
9+
* @throws {Error} when `condition` is falsy.
10+
*/
11+
export function assert(
12+
condition: unknown,
13+
message?: string,
14+
): asserts condition {
15+
if (!condition) {
16+
throw new Error(message ?? 'Assertion failed');
17+
}
18+
}

libs/browser-utils/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export { assert } from './assert';
12
export { default as isBrowser } from './isBrowser';
23
export * from './logger';
34
export * from './platform';

libs/tangle-shared-ui/src/abi/blueprintServiceManager.ts

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,56 @@ const ABI = [
363363
outputs: [],
364364
stateMutability: 'payable',
365365
},
366+
{
367+
type: 'function',
368+
name: 'onBinaryVersionPublished',
369+
inputs: [
370+
{
371+
name: 'blueprintId',
372+
type: 'uint64',
373+
internalType: 'uint64',
374+
},
375+
{
376+
name: 'version',
377+
type: 'tuple',
378+
internalType: 'struct Types.BinaryVersion',
379+
components: [
380+
{
381+
name: 'versionId',
382+
type: 'uint64',
383+
internalType: 'uint64',
384+
},
385+
{
386+
name: 'sha256Hash',
387+
type: 'bytes32',
388+
internalType: 'bytes32',
389+
},
390+
{
391+
name: 'binaryUri',
392+
type: 'string',
393+
internalType: 'string',
394+
},
395+
{
396+
name: 'attestationHash',
397+
type: 'bytes32',
398+
internalType: 'bytes32',
399+
},
400+
{
401+
name: 'publishedAt',
402+
type: 'uint64',
403+
internalType: 'uint64',
404+
},
405+
{
406+
name: 'deprecated',
407+
type: 'bool',
408+
internalType: 'bool',
409+
},
410+
],
411+
},
412+
],
413+
outputs: [],
414+
stateMutability: 'nonpayable',
415+
},
366416
{
367417
type: 'function',
368418
name: 'onBlueprintCreated',
@@ -493,6 +543,29 @@ const ABI = [
493543
outputs: [],
494544
stateMutability: 'payable',
495545
},
546+
{
547+
type: 'function',
548+
name: 'onOperatorBinaryAcked',
549+
inputs: [
550+
{
551+
name: 'serviceId',
552+
type: 'uint64',
553+
internalType: 'uint64',
554+
},
555+
{
556+
name: 'versionId',
557+
type: 'uint64',
558+
internalType: 'uint64',
559+
},
560+
{
561+
name: 'operator',
562+
type: 'address',
563+
internalType: 'address',
564+
},
565+
],
566+
outputs: [],
567+
stateMutability: 'nonpayable',
568+
},
496569
{
497570
type: 'function',
498571
name: 'onOperatorJoined',

libs/tangle-shared-ui/src/data/staking/useSubstrateStakingAssets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { TANGLE_TOKEN_DECIMALS } from '@tangle-network/dapp-config';
22
import { isEvmAddress } from '@tangle-network/ui-components';
33
import { BN } from '@polkadot/util';
4-
import assert from 'assert';
4+
import { assert } from '@tangle-network/browser-utils';
55
import { useCallback, useMemo } from 'react';
66
import { map } from 'rxjs';
77
import { NATIVE_ASSET_ID } from '../../constants/staking';

0 commit comments

Comments
 (0)