Skip to content

stitchkit v0.108.0

Choose a tag to compare

@github-actions github-actions released this 06 Oct 13:33
· 129 commits to master since this release

⚠️ Breaking changes

Who must act: code with an exhaustive switch or Record over TelegramSendFailureReason or
TelegramSendFailure['evidence']; builds whose entry imports a stitchkit installation other
than the one their native packaging plugin came from.

  • stitchkit/telegram — a request that never left is its own send outcome.
    TelegramSendFailureReason gains not-dispatched (retryable, recipient reachable) and
    TelegramSendFailure.evidence gains transport: classifyTelegramSendFailure returns them for a
    TelegramNotDispatchedError anywhere in the cause chain, so a broadcast retries such a send as
    transient and the operator channel sends it again, where both used to give it up as unknown.
    // before: const code: Record<TelegramSendFailureReason, string> = { …, unknown: 'E_UNKNOWN' }
    → // after: const code: Record<TelegramSendFailureReason, string> = { …, 'not-dispatched': 'E_NOT_SENT', unknown: 'E_UNKNOWN' }
    Who must act: exhaustive code over the reasons or the evidence. See
    migration. → ADR 0253
    Affects: stitchkit/telegram TelegramSendFailureReason, TelegramSendFailure(evidence), TELEGRAM_SEND_FAILURE_REASONS, classifyTelegramSendFailure(reason)
  • stitchkit/files/packaging — a packaging plugin fails a build that carries another
    installation's loader.
    The plugin packages only the default Darwin loader of the stitchkit it
    was created from; an entry that imports another installation (another version, or the same
    version under another path, as when a build tool brings its own copy) used to build, ship that
    installation's default loader and refuse the addon on macOS at run time. The build now fails with
    an error naming both versions and roots.
    // before: Bun.build({ plugins: [toolCopy.createNativePackaging(…).plugin] }) // entry imports another stitchkit
    → // after: Bun.build({ plugins: [entryCopy.createNativePackaging(…).plugin] })
    Who must act: builds that take the plugin from a stitchkit the entry does not import. See
    migration. → ADR 0254
    Affects: stitchkit/files/packaging createNativePackaging(plugin)

Added

  • stitchkit/telegram — createTelegramBotTransport(), a fetch for the Bot API senders that
    connects before it writes: a failure before the first byte is TelegramNotDispatchedError
    (stage: lookup, connect, request), any later one stays unknown. Addresses race in the
    resolver's order (Happy Eyeballs); the lookup, the connection rounds, the answer's time and its size are bounded.
    The senders' fetch option is now typed TelegramFetch ((url, init) => Promise<Response>), which
    the global fetch still satisfies. → ADR 0253
  • stitchkit — parseNDJSON and parseSSE read any byte source: a Response, a
    ReadableStream<Uint8Array> (a Bun child's stdout) or an AsyncIterable<Uint8Array> (a Node
    child's stdout), with signal cancelling the source. createNDJSONDecoder drives the same
    bounded reader by push(chunk) / end() for a socket's data callback. A line past
    maxLineBytes throws StreamLineLimitError (limitBytes, lineBytes) at the chunk that crossed
    the limit, so memory stays bounded; a source ended inside a line under finalLine: 'require-newline' throws StreamTruncatedLineError. They extend the RangeError and SyntaxError
    thrown before, so instanceof still holds; their name is now the class name and their message
    ends with the bytes seen. A decoder stops at
    its first error, and an abort rejects with the signal's reason even when onParseError is set.
  • stitchkit/files/packaging — inspectNativeArtifact(bytes) classifies a built artifact as
    packaged, unpackaged or no-loader by a marker every generated loader now carries
    (module.exports.stitchkitNativeLoader), in latin1 and UTF-16LE. It replaces the documented search
    for STITCHKIT_NATIVE_NOT_PACKAGED, which every bundle with a lock carries as an error code and so
    refused correct builds. → ADR 0254
  • stitchkit upgrade — every breaking item from 0.104.0 carries an **Affects:** line naming its
    entrypoints and exports (or behaviour), and release:check refuses a breaking item without it.
    The CLI reads the project's imports (--cwd, default .) and gives each item a verdict:
    affects this project with path:line, not used here, behavioural — check by hand with the
    importing files, or not declared — check by hand for older items; --json prints the verdicts.
  • stitchkit/testing — createManualClock(): manual time for schedules, retries and deadlines. Due
    timers fire in deadline order with real event-loop yields between them, so advance(10_000) does
    not skip a retry armed at the fifth second; hold keeps time still while real work of unknown
    length runs and fails naming it past holdLimitMs; until moves deadline to deadline; one move
    runs at a time. It is the
    clock of createManagedSchedule, a durable sleep, a revision signal and bounded admission.

Fixed

  • stitchkit/server, stitchkit/process, stitchkit/files — loading these leaves no longer calls
    a Node API: process identity built its command runner with promisify(execFile) at module scope,
    so a browser bundle that reached the server leaf for an error class (where node:util is an empty
    module) threw promisify is not a function while loading, although nothing called it.