Skip to content

Add core TypeScript submodules: cron, retry, rate-limit, and crypto - #5903

Open
bradleyshep wants to merge 3 commits into
masterfrom
bradley/submodules-core
Open

Add core TypeScript submodules: cron, retry, rate-limit, and crypto#5903
bradleyshep wants to merge 3 commits into
masterfrom
bradley/submodules-core

Conversation

@bradleyshep

Copy link
Copy Markdown
Contributor

Description of Changes

Adds reusable scheduling, retry, rate-limit, and cryptographic helpers for SpacetimeDB TypeScript modules.

  • Cron: calendar and interval jobs with typed arguments, time zones, and run history.
  • Retry: scheduled attempts, exponential backoff, and attempt history.
  • Rate-limit: fixed-window limits with configuration and administrative controls.
  • Crypto: hashing, encoding, and webhook-signature helpers.
  • Shared example UI/server support, package documentation, tests, and examples.
  • Registers the packages in the pnpm workspace and existing lint/build commands. Adds a submodule CI job for type checks, tests, and builds.

This is the prerequisite branch for the remaining submodule groups. It is based on master commit 3653d2ed4.

Example screenshots

Existing example screenshots from #5823:

Cron

Cron example

Rate Limit

Rate Limit example

API and ABI breaking changes

No existing SpacetimeDB API or ABI is changed. This adds new TypeScript package APIs that need review before merge.

Rollback safety impact

n/a. This adds opt-in TypeScript packages and examples; it does not change existing server storage formats.

Expected complexity level and risk

3/5

The packages are opt-in and do not change existing server behavior. Complexity is in scheduling, retry recovery, and cron's direct use of the internal spacetime:sys@2.0 host ABI. Review failure recovery and repeated execution for applications that use these packages.

Testing

Verified locally on bradley/submodules-core:

  • Frozen-lockfile install for the root, SDK, and present submodule workspaces.
  • Type checks for the added packages.
  • Existing test scripts for the added packages and examples.
  • Build scripts for the added packages and examples.
  • Regenerate client bindings and verify no tracked changes.
  • Lint and formatting checks for the added packages and examples.
  • Verify workspace dependencies are present in this branch.
  • Review the public APIs, documentation, and cron host-ABI dependency.
  • Run local scheduling/recovery smoke tests against a running SpacetimeDB instance.

Commands used for this group:

pnpm -r -F "./spacetime-cron-ts/**" -F "./spacetime-retry-ts/**" -F "./spacetime-rate-limit-ts/**" -F "./spacetime-crypto-ts/**" -F "./spacetime-submodule-shared-ts/**" run typecheck
pnpm -r -F "./spacetime-cron-ts/**" -F "./spacetime-retry-ts/**" -F "./spacetime-rate-limit-ts/**" -F "./spacetime-crypto-ts/**" -F "./spacetime-submodule-shared-ts/**" run test
pnpm -r -F "./spacetime-cron-ts/**" -F "./spacetime-retry-ts/**" -F "./spacetime-rate-limit-ts/**" -F "./spacetime-crypto-ts/**" -F "./spacetime-submodule-shared-ts/**" run build
pnpm -r -F "./spacetime-cron-ts/**" -F "./spacetime-retry-ts/**" -F "./spacetime-rate-limit-ts/**" -F "./spacetime-crypto-ts/**" -F "./spacetime-submodule-shared-ts/**" run lint

The TypeScript SDK was built first. Live deployment and provider tests were not run during split validation. Existing workspace peer-dependency warnings remain.

@bradleyshep bradleyshep mentioned this pull request Sep 9, 2026
7 tasks
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