Skip to content
Open
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
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,30 @@ jobs:
- name: Verify only intended files would be published
run: pnpm pack:check

packages:
name: Companion package tarball smoke tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20, 22, 24]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
# Packs each companion workspace package (`sdk-agent`, `sdk-react`,
# `sdk-vue`, `sdk-solid`, `sdk-svelte`, `codemod`, `test-vectors`) and
# smoke-tests it as an independently publishable tarball: ESM, types,
# documented exports, published file list, and that no workspace-only
# import fails to resolve from npm in a clean fixture.
- run: pnpm test:packages

framework-types:
name: Framework package types
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion examples/stellar-nextjs-app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@wraith-protocol/sdk": "file:../..",
"@wraith-protocol/sdk-react": "file:../../packages/sdk-react",
"@stellar/stellar-sdk": "^13.1.0",
"next": "^14.2.35",
"next": "^15.5.28",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"test": "vitest run --exclude 'test/chains/stellar/properties.test.ts' --exclude 'test/leaks/scan-leak.test.ts' --exclude 'test/leaks/heap-snapshot.test.ts' && pnpm --filter @wraith-protocol/sdk-svelte test",
"docs": "typedoc",
"test:exports": "node test/smoke/run.mjs",
"test:packages": "node test/smoke/packages.mjs",
"test:compat": "node scripts/compat/run.mjs",
"compat:doc": "node scripts/compat/check.mjs --write",
"test:watch": "vitest",
Expand Down
16 changes: 12 additions & 4 deletions packages/sdk-react/src/platform-native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,18 @@ export const nativePlatform: Platform = {
},
},
setup(): void {
require('react-native-get-random-values');
const { Buffer } = require('buffer');
if (typeof globalThis.Buffer === 'undefined') {
(globalThis as any).Buffer = Buffer;
try {
require('react-native-get-random-values');
} catch {
// react-native-get-random-values may not be installed or dynamic require unavailable in ESM
}
try {
const { Buffer } = require('buffer');
if (typeof globalThis.Buffer === 'undefined') {
(globalThis as any).Buffer = Buffer;
}
} catch {
// buffer unavailable or already present
}
},
};
Loading
Loading