Skip to content

SDK 0.4.0: typed records, React and CommonJS entries, pinned CDN URLs - #9

Merged
heyderekj merged 3 commits into
mainfrom
claude/sdk-developer-experience-ce5d17
Nov 13, 2026
Merged

heyderekj merged 3 commits into
mainfrom
claude/sdk-developer-experience-ce5d17

Conversation

@heyderekj

Copy link
Copy Markdown
Contributor

Makes @heresmychurch/lookup easier to set up in apps, ahead of publishing it to npm.

What changed

Types

  • ChurchRecord.fields is now a typed ChurchFields, so record.fields.city is string | null with no casts. It matches what worker/src/record.ts returns.
  • Types resolve under every TypeScript moduleResolution, including node10, which used to fail with TS2307. The type test now installs the package into a throwaway app and checks bundler, node16, nodenext and node10.
  • React 19: the onchurch-* event props, HTML props and fieldMap/strings/lookup are typed. Vue templates get typed @church-* events.

Entries

  • @heresmychurch/lookup/react exports useChurchLookup, with React as an optional peer dependency. The registry hook is now generated from it.
  • Every entry also has a .cjs build with .d.cts types, so Jest loads the package without transforms.

Client and element

  • New timeout option (15 s by default). A timed-out request fails with a LookupError whose code is "timeout"; a caller's own abort still rejects with AbortError.
  • On local dev hosts, the console warns once when client isn't set, or when a chosen church found no fields to fill.

Publishing

  • Pinned script URLs at /sdk/<version>/, served as immutable for a year. copy-assets writes each version once and never replaces it.
  • npm metadata (repository, homepage, keywords, publishConfig.access), LICENSE and CHANGELOG in the tarball, and a CI workflow.

For reviewers

  • Breaking, types only: unknown camelCase props on <church-lookup>, such as maxResults, are now type errors in React 19. Use max-results.
  • Core size budget goes from 5 KB to 5.5 KB gzipped (it's 5.16 KB now), for the timeout and setup hints.
  • site/sdk/0.3.0/ and site/sdk/0.4.0/ are committed on purpose. A deploy serves only what's in site/, so old pinned versions have to stay in git.
  • Not tested through the Worker: wrangler dev fails at startup. That's not caused by this branch: workerd rejects the ATTRIBUTION const exported from worker/src/index.ts. Please check /sdk/0.4.0/element.js and its cache headers after deploying.
  • New CI workflow: it hasn't run on GitHub yet; this PR is its first run.

Testing

  • pnpm test: registry check, 207 Worker tests and 188 SDK tests, all passing.
  • pnpm typecheck passes, and the shadcn demo type-checks.
  • In a browser on localhost, the pinned 0.4.0 build searched, picked a church and filled fields. Spanish text loaded from /sdk/0.4.0/strings-es.js, and the two setup warnings each printed once.

🤖 Generated with Claude Code

heyderekj and others added 3 commits November 12, 2026 18:19
Types
- ChurchRecord.fields is a typed ChurchFields (string | null, string[],
  ServiceTimes with slots), so apps read fields without casts. New types:
  ChurchFields, ChurchField, ServiceTimes, ServiceSlot.
- Types resolve under every moduleResolution, including node10, through
  top-level main/types and typesVersions. The type test now installs the
  package into a throwaway app and checks bundler, node16, nodenext and
  node10.
- React 19: onchurch-* event props are typed, HTML props come from React's
  own types, and fieldMap/strings/lookup are typed. Unknown camelCase props
  such as maxResults are now type errors. Vue templates get typed
  @Church-* events; global JSX (React 18, Preact) gets typed on<event> props.

Entries
- @heresmychurch/lookup/react exports useChurchLookup (React is an optional
  peer). The registry hook is now generated from it.
- Every entry also builds to .cjs with .d.cts types behind a require
  condition, so Jest loads it without transforms.

Client and element
- timeout option (15 s default) fails with LookupError code "timeout"; a
  caller's abort still rejects with AbortError.
- On local dev hosts, warn once when client is unset or a chosen church
  found no fields to fill.
- Core size budget is now 5.5 KB gzipped (was 5 KB).

Publishing
- Each release is also served at /sdk/<version>/, immutable for a year.
  copy-assets writes it once and never replaces it; site/sdk/0.3.0 and
  0.4.0 are committed so pinned versions stay deployed. Docs use the
  pinned URL, and a test keeps it matching the package version.
- package.json gains repository, homepage, bugs, keywords, engines and
  publishConfig.access; LICENSE and CHANGELOG ship in the tarball.
- CI workflow runs pnpm test and pnpm typecheck.

Docs: README events, properties, client options and React/Vue usage;
widget docs get React 19, React 18 and Vue tabs; README sizes corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…isolated storage

On Linux CI, the edge cache's put in waitUntil outlived a test and left a
.sqlite-shm file, failing isolated storage cleanup. No test depends on a
cache hit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@heyderekj
heyderekj merged commit deaffe7 into main Nov 13, 2026
1 check passed
@heyderekj
heyderekj deleted the claude/sdk-developer-experience-ce5d17 branch November 13, 2026 02:14
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