Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ jobs:
- name: Build
run: npm run build

- name: Verify Exports
run: npm run test:exports

- name: Run tests
run: npm test
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"test": "vitest run"
"test": "vitest run",
"test:exports": "tsc --noEmit src/verify-exports.ts"
},
"dependencies": {
"@hugeicons/core-free-icons": "^4.1.2",
Expand Down
11 changes: 11 additions & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,14 @@ export { ContractEventFeed } from "./ContractEventFeed";

// Utilities
export { QRCode } from "./QRCode";

// Types
export type {
AccountData,
Balance,
Transaction,
ClaimableBalance,
ContractEvent,
NetworkInfo,
InvokeParams,
} from "../lib/client";
36 changes: 36 additions & 0 deletions src/verify-exports.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// This file ensures that all public exports are available.
// If any of these are removed from the public API, the build will fail.

import {
FeeEstimator,
AddressDisplay,
AssetPill,
ContractEventFeed,
// Types
AccountData,

Check failure on line 10 in src/verify-exports.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

'AccountData' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
Balance,

Check failure on line 11 in src/verify-exports.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

'Balance' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
Transaction,

Check failure on line 12 in src/verify-exports.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

'Transaction' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
ClaimableBalance,

Check failure on line 13 in src/verify-exports.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

'ClaimableBalance' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
ContractEvent,

Check failure on line 14 in src/verify-exports.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

'ContractEvent' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
NetworkInfo,

Check failure on line 15 in src/verify-exports.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

'NetworkInfo' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
InvokeParams,

Check failure on line 16 in src/verify-exports.ts

View workflow job for this annotation

GitHub Actions / test (20.x)

'InvokeParams' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
} from "./components/index";

// Dummy usage to prevent unused warnings if strictly checked
console.log({
FeeEstimator,
AddressDisplay,
AssetPill,
ContractEventFeed,
});

// Dummy type usage to prevent unused type warnings
export type TestExports = {
account: AccountData;
balance: Balance;
tx: Transaction;
claim: ClaimableBalance;
event: ContractEvent;
network: NetworkInfo;
invoke: InvokeParams;
};
Loading