
deploy.ts
Brian Eno
Caching here cuts the cold build in half. Lovely.
Two lines out, two lines in. A reviewer leaves a short note on the new line, a second cursor presses Approve to mark the change approved, and the review plays again.
The import and the props worth knowing about, in one place.
import { Code19 } from "@/components/beste/piece/code19";
<Code19
fileName="deploy.ts"
lines={[
{
"kind": "context",
"text": "export async function ship(env: string) {"
},
{
"kind": "removed",
"text": " const url = await build(env);"
},
{
"kind": "removed",
"text": " return publish(url);"
},
{
"kind": "added",
"text": " const out = await build(env, { cache: true });"
},
{
"kind": "added",
"text": " return publish(out.url, { preview: true });"
},
{
"kind": "context",
"text": "}"
}
]}
commentLine={3}
comment={{
"author": "Brian Eno",
"avatar": {
"src": "https://images.unsplash.com/photo-1656337789708-cdf37b07112d?q=80&w=200&h=200&auto=format&fit=crop",
"alt": "Smiling man in a floral shirt"
},
"body": "Caching here cuts the cold build in half. Lovely."
}}
approveLabel="Approve"
approvedLabel="Approved"
framed={true}
stepMs={1000}
/>Make sync retries configurable
src/sync/retry.ts
Leonard Cohen
Nice and small. Maybe call it retryLimit so it reads well in the config? Happy to ship either way.
export function total(cart: Cart) { const sum = cart.lines.reduce(add, 0) return sum const discount = coupon(cart, sum) return sum - discount}