Conversation
Two bugs conflated in the old cf:d1:seed that made every CF D1 deploy fall over: 1. The grep filter missed 'INSERT INTO sqlite_schema' — which is how sqlite3's .dump represents FTS5 virtual tables. D1 rejects any sqlite_schema write with 'table sqlite_master may not be modified'. Error reported as an emdash/CF adapter bug was in our own plumbing. 2. wrangler auto-add (via 'Would you like Wrangler to add it on your behalf?' during 'wrangler d1 create') names bindings dashcommerce_demo / dashcommerce_demo_media, but our astro.config.mjs + emdash both expect DB / MEDIA / SESSION. Bindings drifted, runtime failed to find them. Fixes: scripts/cf-d1-dump.mjs — operates on a throwaway copy of data.db, drops FTS5 virtual tables + their triggers, then dumps. Filter rewrite catches sqlite_* / sqlite_schema / multiple statement-head patterns. Local dev + search stay intact because the live data.db is untouched. scripts/cf-d1-seed.mjs — orchestrates the whole flow: bootstrap → dump → temp-patch wrangler.jsonc with CF_D1_DATABASE_ID env var → drop existing D1 tables (avoids PK collisions on rerun) → import. Always restores the template wrangler.jsonc on exit (including SIGINT). Multi-tenant-safe: the committed file stays a template, deployers bring their own id via env. package.json cf:d1:seed — now just 'node scripts/cf-d1-seed.mjs'. wrangler.jsonc — bindings back to canonical DB / MEDIA / SESSION, ids wiped to placeholder. Duplicate r2_buckets entry removed. Usage: wrangler d1 create dashcommerce-demo export CF_D1_DATABASE_ID=<uuid> bun run cf:d1:seed Full-text search won't work on D1 yet — FTS5 virtual tables are stripped. That's an upstream emdash/cloudflare adapter gap, separate from what this commit fixes.
0.6.0 ships the upstream fix for syncSearchState attempting first-time FTS enablement during field creation (emdash PR #595). That was the root cause of two independent pain points we spent most of a session working around: 1. Cloudflare D1 admin setup endpoint created only the first 3 of N user fields per collection and then silently stopped — the FTS enablement step crashed partway through field-creation loop. Pattern reproduced cleanly on ec_site_text (3 of 7 fields) and ec_products. 2. Postgres seed on Railway threw 'Full-text search is only available with SQLite databases' from applySeed because the same syncSearchState code path hit Postgres and bailed hard rather than skipping. Both disappear on 0.6. Changes: - packages/starter: bump emdash and @emdash-cms/cloudflare to ^0.6.0 - packages/core: widen emdash peer range to '>=0.5.0 <0.7.0'; bump devDeps @emdash-cms/admin + emdash to ^0.6.0 - Regenerated the Stripe webhook body-clone patch for 0.6 (request.clone().json() x4 + plugin-route Response passthrough). Removed the stale 0.5 patch from patches/ and patchedDependencies. - Added a changeset (core patch, starter minor) so the release pipeline handles the next publish. Verified locally with the full CI sequence: rm -rf node_modules packages/*/node_modules bun install --frozen-lockfile bun run --filter '*' typecheck All three packages exit 0 with zero errors. Unlike 0.4 -> 0.5, no storefront port needed — schemas are unchanged.
Merged
cavewebs
added a commit
that referenced
this pull request
Apr 21, 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.1.4 ### Patch Changes - [#12](#12) [`321e810`](321e810) Thanks [@cavewebs](https://github.com/cavewebs)! - Upgrade to emdash 0.6.0. - `@dashcommerce/core`: widen `emdash` peer range to `>=0.5.0 <0.7.0`. Bump the bundled devDeps (`emdash`, `@emdash-cms/admin`) to `^0.6.0` so the package builds against current types. No public API changes. - `@dashcommerce/starter`: bump `emdash` and `@emdash-cms/cloudflare` to `^0.6.0`. 0.6's [release fix for `syncSearchState` FTS-during-field-creation](emdash-cms/emdash#595) eliminates the partial-DDL issue that was truncating collection schemas on Cloudflare D1 setup and throwing mid-seed on Postgres. Storefront surfaced zero typecheck errors on the upgrade — no porting required. Stripe webhook body-clone patch regenerated for 0.6 (`patches/emdash@0.6.0.patch`) since the upstream `request.clone().json()` fix still isn't in place. All notable changes to this package are documented here and in the [monorepo CHANGELOG.md](../../CHANGELOG.md). The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## @dashcommerce/starter@0.3.0 ### Minor Changes - [#12](#12) [`321e810`](321e810) Thanks [@cavewebs](https://github.com/cavewebs)! - Upgrade to emdash 0.6.0. - `@dashcommerce/core`: widen `emdash` peer range to `>=0.5.0 <0.7.0`. Bump the bundled devDeps (`emdash`, `@emdash-cms/admin`) to `^0.6.0` so the package builds against current types. No public API changes. - `@dashcommerce/starter`: bump `emdash` and `@emdash-cms/cloudflare` to `^0.6.0`. 0.6's [release fix for `syncSearchState` FTS-during-field-creation](emdash-cms/emdash#595) eliminates the partial-DDL issue that was truncating collection schemas on Cloudflare D1 setup and throwing mid-seed on Postgres. Storefront surfaced zero typecheck errors on the upgrade — no porting required. Stripe webhook body-clone patch regenerated for 0.6 (`patches/emdash@0.6.0.patch`) since the upstream `request.clone().json()` fix still isn't in place. ### Patch Changes - Updated dependencies \[[`321e810`](321e810)]: - @dashcommerce/core@0.1.4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
emdash+@emdash-cms/cloudflareto^0.6.0emdashpeer range to>=0.5.0 <0.7.0