Skip to content

Fix the ParcelDesk SDK quickstart - #1

Open
ZIJ wants to merge 1 commit into
mainfrom
fix/quickstart
Open

Fix the ParcelDesk SDK quickstart#1
ZIJ wants to merge 1 commit into
mainfrom
fix/quickstart

Conversation

@ZIJ

@ZIJ ZIJ commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

The scheduled quickstart check reproduced a failure in docs/quickstart.md against the released ParcelDesk SDK. ParcelDesk is a deliberately constructed example fixture.

Diagnosis: released parceldesk-sdk-2.0.0.tgz's client.orders.list() resolves to a paged response object { items, nextCursor } (confirmed in the installed package's src/index.js and src/index.d.ts: Promise<OrderPage> where OrderPage = { items: Order[]; nextCursor: string | null }). The guide's snippet assigned the raw resolved value to orders and called .map() directly on it, which throws because the value is a plain object, not an array. Fix: destructure items from the resolved page (const { items: orders } = await client.orders.list({ limit: 2 });) so .map() operates on the actual array. No other guide content, SDK release URL, version, or expected output changed.

Verification command, run before and after the documentation change in separate fresh projects:

node scripts/verify-quickstart.mjs docs/quickstart.md

Before:

Command: node scripts/verify-quickstart.mjs docs/quickstart.md (exit 1)
Guide: docs/quickstart.md
SDK: https://github.com/diggerhq/opencomputer-example-quickstart-check/releases/download/sdk-v2.0.0/parceldesk-sdk-2.0.0.tgz
file://<quickstart>/quickstart.mjs:8
    .map((order) => `${order.id}: ${order.customer} ($${(order.totalCents / 100).toFixed(2)})`)
     ^

TypeError: orders.map is not a function
    at file://<quickstart>/quickstart.mjs:8:6

Node.js v22.23.2
QUICKSTART FAILED

Separately, in <temp-project>, ran:
npm install --ignore-scripts --no-audit --no-fund https://github.com/diggerhq/opencomputer-example-quickstart-check/releases/download/sdk-v2.0.0/parceldesk-sdk-2.0.0.tgz
(exit 0, 1 package added)

Inspected <temp-project>/node_modules/@parceldesk/sdk/src/index.js and index.d.ts:
list(options?: ListOrdersOptions): Promise<OrderPage>
where OrderPage = { items: Order[]; nextCursor: string | null }
confirming client.orders.list() resolves to an object with an `items` array, not a bare array.

After:

Command: node scripts/verify-quickstart.mjs docs/quickstart.md (exit 0)
Guide: docs/quickstart.md
SDK: https://github.com/diggerhq/opencomputer-example-quickstart-check/releases/download/sdk-v2.0.0/parceldesk-sdk-2.0.0.tgz
ord_1042: Ada Lovelace ($49.00)
ord_1043: Grace Hopper ($125.00)
QUICKSTART PASSED — output matches the guide.

Only docs/quickstart.md is changed. The SDK release and expected result are preserved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant