Skip to content

Commit 699b7fd

Browse files
committed
fix(ci): restore snippet-check package.json + switch workflow to pnpm
- #48 (auto-generated Stellar reference PR) accidentally rewrote the root package.json and dropped the snippet-check scripts and their deps introduced by #47. Merge both PRs' fields: - check:snippets / check:stellar-testnet (from #47) - generate:stellar-reference / mint:* (from #48) and restore @wraith-protocol/sdk, @stellar/stellar-sdk, @solana/web3.js + tsx / typescript / @types/node. - Add pnpm-lock.yaml so `--frozen-lockfile` works. - .github/workflows/snippets.yml: switch from `npm ci` (which looked for package-lock.json and failed since we're a pnpm repo) to `pnpm install --frozen-lockfile`. - Content fixes flushed out by rerunning the snippet checker locally: - guides/stellar-payment-links.mdx: two React component fences were tagged ```typescript instead of ```tsx. - reference/stellar-react-hooks.mdx: three "Return Type" fences are documentation-only object-shape blocks (not compilable statements); mark them ```typescript no-check. - api-reference/types.mdx, architecture/tee.mdx, architecture/chain-connectors.mdx, guides/spectre-stellar-cookbook.mdx, guides/stellar-wallet-integration.mdx, guides/stellar-federation.mdx, reference/docs/architecture.md, reference/docs/chain-connectors.md: retag ```typescript fences containing JSX as ```tsx. Local `pnpm run check:snippets` now reports "Snippet check passed" over 454 code fences (438 compiled + 16 no-check skips).
1 parent 6017d9b commit 699b7fd

368 files changed

Lines changed: 73538 additions & 24 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/snippets.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,22 @@ jobs:
1515
- name: Checkout
1616
uses: actions/checkout@v4
1717

18+
- name: Setup pnpm
19+
uses: pnpm/action-setup@v4
20+
with:
21+
version: 10
22+
1823
- name: Setup Node
1924
uses: actions/setup-node@v4
2025
with:
2126
node-version: 22
22-
cache: npm
27+
cache: pnpm
2328

2429
- name: Install dependencies
25-
run: npm ci
30+
run: pnpm install --frozen-lockfile
2631

2732
- name: Check snippets
28-
run: npm run check:snippets
33+
run: pnpm run check:snippets
2934

3035
stellar-testnet-snippets:
3136
name: Stellar snippet testnet validation
@@ -35,14 +40,19 @@ jobs:
3540
- name: Checkout
3641
uses: actions/checkout@v4
3742

43+
- name: Setup pnpm
44+
uses: pnpm/action-setup@v4
45+
with:
46+
version: 10
47+
3848
- name: Setup Node
3949
uses: actions/setup-node@v4
4050
with:
4151
node-version: 22
42-
cache: npm
52+
cache: pnpm
4353

4454
- name: Install dependencies
45-
run: npm ci
55+
run: pnpm install --frozen-lockfile
4656

4757
- name: Validate Stellar testnet snippets
48-
run: npm run check:stellar-testnet
58+
run: pnpm run check:stellar-testnet

api-reference/types.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ When `accountId` starts with `st:xlm:` it is a Wraith stealth meta-address and s
367367

368368
Pluggable cache interface accepted by `resolveStellarFederation()`. Implement this with any backend (in-memory, Redis, etc.).
369369

370-
```typescript
370+
```tsx
371371
interface FederationCache {
372372
get(key: string): Promise<FederationRecord | undefined>;
373373
set(key: string, record: FederationRecord, ttlMs: number): Promise<void>;
@@ -407,7 +407,7 @@ Internal types used by the TEE server. Documented here for developers building c
407407

408408
### `ChainConnector`
409409

410-
```typescript
410+
```tsx
411411
interface ChainConnector {
412412
readonly chain: string;
413413
readonly nativeAsset: string;

architecture/chain-connectors.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Chain connectors are the abstraction layer between Wraith's chain-agnostic agent
99

1010
Every chain connector implements `ChainConnector`:
1111

12-
```typescript
12+
```tsx
1313
interface ChainConnector {
1414
readonly chain: string;
1515
readonly nativeAsset: string;

architecture/tee.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The path includes the chain identifier to prevent key collision. The same agent
2727

2828
### Implementation
2929

30-
```typescript
30+
```tsx
3131
class TeeService {
3232
async deriveAgentPrivateKey(agentId: string, chain: string): Promise<Uint8Array> {
3333
// DStack derives key from hardware root secret + path

guides/spectre-stellar-cookbook.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ curl -X POST https://api.usewraith.xyz/agent/create \
636636

637637
### Step 2 — Run the weekly privacy analysis
638638

639-
```typescript
639+
```tsx
640640
// privacy-analysis.ts
641641
import { Wraith } from "@wraith-protocol/sdk";
642642

@@ -723,7 +723,7 @@ Best Practices:
723723

724724
### Step 3 — Send Slack and email reports
725725

726-
```typescript
726+
```tsx
727727
// reporters.ts
728728

729729
// Slack report

guides/stellar-federation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ Federation resolution makes two HTTP requests (stellar.toml + federation GET) fo
307307

308308
`resolveStellarFederation()` accepts a `cache` option conforming to a simple interface:
309309

310-
```typescript
310+
```tsx
311311
interface FederationCache {
312312
get(key: string): Promise<FederationRecord | undefined>;
313313
set(key: string, record: FederationRecord, ttlMs: number): Promise<void>;

guides/stellar-payment-links.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ The Wraith demo includes `StellarPaymentLink.tsx` — a React component that gen
320320

321321
### Component: `StellarPaymentLink.tsx`
322322

323-
```typescript
323+
```tsx
324324
import React, { useEffect, useState } from "react";
325325
import QRCode from "qrcode";
326326
import { Wraith, Chain } from "@wraith-protocol/sdk";
@@ -412,7 +412,7 @@ export function StellarPaymentLink({
412412

413413
### Usage in a Next.js invoice page
414414

415-
```typescript
415+
```tsx
416416
// pages/invoice/[id].tsx
417417
import { StellarPaymentLink } from "@/components/StellarPaymentLink";
418418

guides/stellar-wallet-integration.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ async function signWithLOBSTR(xdr: string): Promise<string> {
229229

230230
### Wallet descriptor type
231231

232-
```typescript
232+
```tsx
233233
export type StellarWalletId = "freighter" | "albedo" | "xbull" | "lobstr";
234234

235235
export interface StellarWallet {
@@ -465,7 +465,7 @@ const accounts = provider.accounts;
465465

466466
## Session Persistence
467467

468-
```typescript
468+
```tsx
469469
const SESSION_KEY = "wraith:stellar:session";
470470

471471
interface StellarSession {
@@ -507,7 +507,7 @@ async function restoreSession(): Promise<StellarSession | null> {
507507

508508
### React hook
509509

510-
```typescript
510+
```tsx
511511
import { useEffect, useState } from "react";
512512

513513
export function useWalletSession() {

package.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
{
2+
"name": "@wraith-protocol/docs",
3+
"private": true,
24
"type": "module",
35
"scripts": {
4-
"generate:stellar-reference": "node scripts/generate-stellar-reference.ts",
5-
"check:stellar-reference": "node scripts/generate-stellar-reference.ts --check --allow-missing",
6+
"check:snippets": "tsx scripts/check-snippets.ts",
7+
"check:stellar-testnet": "tsx scripts/check-stellar-testnet-snippets.ts",
8+
"generate:stellar-reference": "tsx scripts/generate-stellar-reference.ts",
9+
"check:stellar-reference": "tsx scripts/generate-stellar-reference.ts --check --allow-missing",
610
"mint:validate": "mint validate",
7-
"mint:broken-links": "mint broken-links"
11+
"mint:broken-links": "mint broken-links",
12+
"test": "npm run check:snippets"
13+
},
14+
"dependencies": {
15+
"@solana/web3.js": "^1.95.0",
16+
"@stellar/stellar-sdk": "^13.1.0",
17+
"@wraith-protocol/sdk": "^1.4.5"
18+
},
19+
"devDependencies": {
20+
"@types/node": "^22.10.2",
21+
"tsx": "^4.19.2",
22+
"typescript": "^5.7.2"
823
}
924
}

0 commit comments

Comments
 (0)