Skip to content

feat: support emdash 0.28 - #16

Merged
cavewebs merged 1 commit into
mainfrom
update-to-emdash-v0.28
Jul 9, 2026
Merged

cavewebs merged 1 commit into
mainfrom
update-to-emdash-v0.28

Conversation

@cavewebs

@cavewebs cavewebs commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Upgrades DashCommerce from emdash 0.6.0 to 0.28.1 (22 minor versions) and
propagates the change across the plugin, starter template, and demo build.

Changes

@dashcommerce/core

  • sandbox-entry.ts builds the plugin via native definePlugin (single-arg
    RouteContext handlers) instead of adaptSandboxEntry. In 0.28
    adaptSandboxEntry flattens routeCtx.request to {url,method,headers}
    with no body, which would break the Stripe webhook.
  • Capability names updated to the current vocabulary (network:request,
    content:read, content:write, media:read, users:read).
  • emdash peer range → >=0.28.0 <0.29.0.

emdash patch (patches/emdash@0.28.1.patch)

  • Plugin route handlers may return a raw Response (apiSuccess would
    serialize it to {} and drop Set-Cookie).
  • Request body is cloned before parsing and ctx.request is left
    unguarded, so the Stripe webhook can read raw bytes for signature
    verification.

Starter

  • src/worker.ts + wrangler.jsonc triggers.crons so plugin cron
    (abandoned-cart recovery, dunning, stock-lock sweeps) runs on Cloudflare.
  • Regenerated emdash-env.d.ts.

Verification

  • Monorepo typecheck / build / tests: 0 errors, all packages build, 84/84
    tests pass.
  • Starter builds for Node and Cloudflare; generated entry.mjs bundles
    emdash's scheduled() handler with the cron trigger.
  • Dev server: public route Response passthrough, Set-Cookie forwarding,
    and ctx.input bodies all confirmed.
  • Stripe webhook: a fake signature returns 400 Invalid signature,
    confirming the raw body is read (no "body already read" crash).
  • Seed validates and applies cleanly on 0.28.

Not covered here

The Cloudflare demo redeploy (bun run cf:deploy) — build artifacts are
correct, but it needs a live wrangler deploy + a check that the cron
trigger fires.

this should now fix the #15 issue

feat: support emdash 0.28

Migrate @dashcommerce/core and the starter from emdash 0.6.0 to 0.28.1.

- Build the native ResolvedPlugin with definePlugin (single-arg
  RouteContext handlers) instead of adaptSandboxEntry, whose 0.28 form
  flattens the request and drops the body — breaking the Stripe webhook.
- Update capabilities to the current vocabulary (network:request,
  content:read, content:write, media:read, users:read); bump the emdash
  peer range to >=0.28.0 <0.29.0.
- Re-author the emdash patch for 0.28.1: plugin routes may return a raw
  Response (cookies, redirects, webhook 200s), and the raw request body is
  preserved so ctx.request.text() works for Stripe signature verification.
- Wire a Cloudflare Worker entry (src/worker.ts) + Cron Trigger so plugin
  cron (abandoned-cart recovery, dunning, stock-lock sweeps) runs on
  Workers — emdash 0.19+ drives cron from a scheduled() handler.
@cavewebs
cavewebs merged commit 772f21a into main Jul 9, 2026
1 check passed
@github-actions github-actions Bot mentioned this pull request Jul 9, 2026
cavewebs added a commit that referenced this pull request Sep 14, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @dashcommerce/core@0.2.0

### Minor Changes

- [#23](#23)
[`ef8360b`](ef8360b)
Thanks [@cavewebs](https://github.com/cavewebs)! - Upgrade to EmDash
0.37.0 with comprehensive auto-update safety system.

**Breaking Change**: Minimum EmDash version is now `0.37.0` (peer
dependency updated from `>=0.28.0 <0.29.0` to `>=0.37.0 <0.38.0`). This
is a breaking change for consumers on EmDash 0.28-0.36.

  **EmDash 0.37 Upgrade**:

- All EmDash dependencies upgraded from 0.28.x to 0.37.0 across the
monorepo
- Ported EmDash patch for request.clone().json() and Response
passthrough to 0.37.0 structure
- Fixed Node.js build by externalizing Cloudflare Workers runtime
modules (`cloudflare:sockets`, etc.) that EmDash 0.37 imports
conditionally

**Auto-Update Safety System** (prevents silent breakage on future EmDash
updates):

1. **Runtime Compatibility Check**: New `version-check.ts` module
validates EmDash version at plugin initialization, providing clear error
messages when version is incompatible
2. **Renovate Configuration**: Auto-merges EmDash patch/minor updates
when CI passes; requires manual review for major versions
3. **CI Compatibility Matrix**: Tests DashCommerce against all supported
EmDash versions in parallel

**Supported EmDash Range**: This release supports `0.37.0 <= version <
0.38.0`. Future EmDash updates will be gated by CI and runtime
compatibility checks.

  All typechecks, builds, and tests pass on EmDash 0.37.0.

### Patch Changes

- [#16](#16)
[`b865dd7`](b865dd7)
Thanks [@cavewebs](https://github.com/cavewebs)! - Support EmDash 0.28.

  Migrate from emdash 0.6 to 0.28.1. The plugin now builds its native
`ResolvedPlugin` via `definePlugin` with single-argument `RouteContext`
handlers (emdash's native route shape) instead of `adaptSandboxEntry`,
whose
0.28 form flattens the request and would break the Stripe webhook's
raw-body
signature check. Capability names are updated to the current vocabulary
  (`network:request`, `content:read`, `content:write`, `media:read`,
  `users:read`), and the emdash peer range is now `>=0.28.0 <0.29.0`.

The bundled emdash patch is re-authored for 0.28.1: plugin route
handlers may
still return a raw `Response` (cookies, redirects, webhook 200s), and
the raw
request body is preserved so `ctx.request.text()` works for Stripe
webhook
  signature verification.

The starter adds a Cloudflare Worker entry (`src/worker.ts`) plus a Cron
Trigger so plugin cron — abandoned-cart recovery, subscription dunning,
and
  stock-lock sweeps — runs on Workers (emdash 0.19+ drives cron from a
  `scheduled()` handler, not request side effects).
## @dashcommerce/starter@0.3.1

### Patch Changes

- [#16](#16)
[`b865dd7`](b865dd7)
Thanks [@cavewebs](https://github.com/cavewebs)! - Support EmDash 0.28.

  Migrate from emdash 0.6 to 0.28.1. The plugin now builds its native
`ResolvedPlugin` via `definePlugin` with single-argument `RouteContext`
handlers (emdash's native route shape) instead of `adaptSandboxEntry`,
whose
0.28 form flattens the request and would break the Stripe webhook's
raw-body
signature check. Capability names are updated to the current vocabulary
  (`network:request`, `content:read`, `content:write`, `media:read`,
  `users:read`), and the emdash peer range is now `>=0.28.0 <0.29.0`.

The bundled emdash patch is re-authored for 0.28.1: plugin route
handlers may
still return a raw `Response` (cookies, redirects, webhook 200s), and
the raw
request body is preserved so `ctx.request.text()` works for Stripe
webhook
  signature verification.

The starter adds a Cloudflare Worker entry (`src/worker.ts`) plus a Cron
Trigger so plugin cron — abandoned-cart recovery, subscription dunning,
and
  stock-lock sweeps — runs on Workers (emdash 0.19+ drives cron from a
  `scheduled()` handler, not request side effects).

- Updated dependencies
[[`ef8360b`](ef8360b),
[`b865dd7`](b865dd7)]:
  - @dashcommerce/core@0.2.0
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