Skip to content

fix(0.13.1): inline DURABLE_SCHEMA_SQL as exported string#21

Merged
tangletools merged 1 commit into
mainfrom
fix/durable-schema-export
May 20, 2026
Merged

fix(0.13.1): inline DURABLE_SCHEMA_SQL as exported string#21
tangletools merged 1 commit into
mainfrom
fix/durable-schema-export

Conversation

@tangletools
Copy link
Copy Markdown
Contributor

Summary

tsup builds JS only — `schema.sql` was not copied into `dist/`, so consumers importing the package couldn't bootstrap a D1 store.

Inline the schema as a string constant exported from the package root:
```ts
import { DURABLE_SCHEMA_SQL } from '@tangle-network/agent-runtime'
await env.DB.exec(DURABLE_SCHEMA_SQL)
```

A sync test (`schema-sync.test.ts`) asserts the constant stays byte-identical to `src/durable/schema.sql` so the `.sql` file remains the source of truth without drift.

Test plan

  • `pnpm test` — 177 pass (2 new schema-sync tests)
  • `pnpm typecheck` — clean

tsup builds JS only — schema.sql was not copied into dist/, so consumers
importing the package couldn't bootstrap a D1 store. Inline the schema
as a string constant exported from the package root:

  import { DURABLE_SCHEMA_SQL } from '@tangle-network/agent-runtime'
  await env.DB.exec(DURABLE_SCHEMA_SQL)

A sync test (schema-sync.test.ts) asserts the constant stays
byte-identical to src/durable/schema.sql so the .sql file remains the
source of truth without drift. 177 tests pass (2 new).

DURABLE_SCHEMA_VERSION is exported alongside for migration tooling.
@tangletools tangletools merged commit c65df48 into main May 20, 2026
1 check passed
@tangletools tangletools deleted the fix/durable-schema-export branch May 20, 2026 14:19
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.

2 participants