Skip to content

Commit 1ca5900

Browse files
Copilotbtravers
authored andcommitted
fix: reformat markdown files with oxfmt 0.58.0
1 parent 2017f8a commit 1ca5900

5 files changed

Lines changed: 29 additions & 84 deletions

File tree

docs/guide/activity-handlers.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,7 @@ export const activities = declareActivitiesHandler({
356356
contract: orderContract,
357357
// logging wraps timing wraps the implementation
358358
middleware: composeActivityMiddleware(logging, timing),
359-
activities: {
360-
/* ... */
361-
},
359+
activities: {/* ... */},
362360
});
363361
```
364362

docs/guide/client-usage.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ await client.executeWorkflow("processOrder", {
133133
// ❌ Error - Wrong workflow name
134134
await client.executeWorkflow("invalidWorkflow", {
135135
workflowId: "order-123",
136-
args: {
137-
/* ... */
138-
},
136+
args: {/* ... */},
139137
});
140138
```
141139

@@ -328,9 +326,8 @@ const logging: ClientInterceptor = (args, next) =>
328326

329327
// Retry a transient failure once
330328
const retryOnce: ClientInterceptor = (args, next) =>
331-
next().flatMapErr(
332-
(error): ReturnType<typeof next> =>
333-
error instanceof RuntimeClientError ? next() : Err(error).toAsync(),
329+
next().flatMapErr((error): ReturnType<typeof next> =>
330+
error instanceof RuntimeClientError ? next() : Err(error).toAsync(),
334331
);
335332

336333
const client = await TypedClient.create({
@@ -413,15 +410,9 @@ const inventoryClient = await TypedClient.create({
413410
}).getOrThrow();
414411

415412
// Each client is typed to its contract
416-
await orderClient.executeWorkflow("processOrder", {
417-
/* ... */
418-
});
419-
await paymentClient.executeWorkflow("processPayment", {
420-
/* ... */
421-
});
422-
await inventoryClient.executeWorkflow("updateStock", {
423-
/* ... */
424-
});
413+
await orderClient.executeWorkflow("processOrder", {/* ... */});
414+
await paymentClient.executeWorkflow("processPayment", {/* ... */});
415+
await inventoryClient.executeWorkflow("updateStock", {/* ... */});
425416
```
426417

427418
## Testing

docs/guide/core-concepts.md

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,9 @@ const contract = defineContract({
2525
taskQueue: "my-queue",
2626
workflows: {
2727
myWorkflow: {
28-
input: z.object({
29-
/* ... */
30-
}),
31-
output: z.object({
32-
/* ... */
33-
}),
34-
activities: {
35-
/* ... */
36-
},
28+
input: z.object({/* ... */}),
29+
output: z.object({/* ... */}),
30+
activities: {/* ... */},
3731
},
3832
},
3933
});
@@ -90,9 +84,7 @@ const contract = defineContract({
9084
success: z.boolean(),
9185
transactionId: z.string(),
9286
}),
93-
activities: {
94-
/* ... */
95-
},
87+
activities: {/* ... */},
9688
},
9789
},
9890
});
@@ -177,9 +169,7 @@ const contract = defineContract({
177169
},
178170
},
179171

180-
workflows: {
181-
/* ... */
182-
},
172+
workflows: {/* ... */},
183173
});
184174
```
185175

@@ -287,18 +277,14 @@ const emailActivities = {
287277
const ordersContract = defineContract({
288278
taskQueue: "orders",
289279
activities: emailActivities,
290-
workflows: {
291-
/* ... */
292-
},
280+
workflows: {/* ... */},
293281
});
294282

295283
// Contract 2 (reusing activities)
296284
const shipmentsContract = defineContract({
297285
taskQueue: "shipments",
298286
activities: emailActivities,
299-
workflows: {
300-
/* ... */
301-
},
287+
workflows: {/* ... */},
302288
});
303289
```
304290

@@ -313,28 +299,18 @@ Define focused contracts for specific domains:
313299
const ordersContract = defineContract({
314300
taskQueue: "orders",
315301
workflows: {
316-
processOrder: {
317-
/* ... */
318-
},
319-
cancelOrder: {
320-
/* ... */
321-
},
302+
processOrder: {/* ... */},
303+
cancelOrder: {/* ... */},
322304
},
323305
});
324306

325307
// ❌ Avoid - too broad
326308
const everythingContract = defineContract({
327309
taskQueue: "everything",
328310
workflows: {
329-
processOrder: {
330-
/* ... */
331-
},
332-
sendEmail: {
333-
/* ... */
334-
},
335-
updateInventory: {
336-
/* ... */
337-
},
311+
processOrder: {/* ... */},
312+
sendEmail: {/* ... */},
313+
updateInventory: {/* ... */},
338314
// ... 50 more workflows
339315
},
340316
});

docs/guide/defining-contracts.md

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -312,23 +312,17 @@ export const ecommerceContract = defineContract({
312312
processOrder: {
313313
input: z.object({ orderId: z.string() }),
314314
output: z.object({ success: z.boolean() }),
315-
activities: {
316-
/* ... */
317-
},
315+
activities: {/* ... */},
318316
},
319317
processRefund: {
320318
input: z.object({ orderId: z.string(), reason: z.string() }),
321319
output: z.object({ refunded: z.boolean() }),
322-
activities: {
323-
/* ... */
324-
},
320+
activities: {/* ... */},
325321
},
326322
updateInventory: {
327323
input: z.object({ productId: z.string(), delta: z.number() }),
328324
output: z.object({ newQuantity: z.number() }),
329-
activities: {
330-
/* ... */
331-
},
325+
activities: {/* ... */},
332326
},
333327
},
334328
});
@@ -345,31 +339,19 @@ Group related workflows in the same contract:
345339
export const orderContract = defineContract({
346340
taskQueue: "orders",
347341
workflows: {
348-
createOrder: {
349-
/* ... */
350-
},
351-
cancelOrder: {
352-
/* ... */
353-
},
354-
updateOrder: {
355-
/* ... */
356-
},
342+
createOrder: {/* ... */},
343+
cancelOrder: {/* ... */},
344+
updateOrder: {/* ... */},
357345
},
358346
});
359347

360348
// ❌ Avoid - mixing unrelated workflows
361349
export const contract = defineContract({
362350
taskQueue: "everything",
363351
workflows: {
364-
processOrder: {
365-
/* ... */
366-
},
367-
sendEmail: {
368-
/* ... */
369-
},
370-
generateReport: {
371-
/* ... */
372-
},
352+
processOrder: {/* ... */},
353+
sendEmail: {/* ... */},
354+
generateReport: {/* ... */},
373355
},
374356
});
375357
```

packages/contract/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ export const myContract = defineContract({
2222
processOrder: {
2323
input: z.object({ orderId: z.string() }),
2424
output: z.object({ success: z.boolean() }),
25-
activities: {
26-
/* ... */
27-
},
25+
activities: {/* ... */},
2826
},
2927
},
3028
});

0 commit comments

Comments
 (0)