Skip to content

Add TypeScript implementation of esque - #52

Merged
loesak merged 26 commits into
masterfrom
typescript-implementation
Jul 5, 2026
Merged

Add TypeScript implementation of esque#52
loesak merged 26 commits into
masterfrom
typescript-implementation

Conversation

@loesak

@loesak loesak commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a TypeScript implementation of esque at implementations/typescript/, published to npm as esque-ts (Node 22+, ESM, strict TypeScript, official @elastic/elasticsearch client, commander CLI).
  • Mirrors the JVM/Python implementations module-for-module: configuration, migration model/template resolver/loader, canonical checksum, ES document types/operations, distributed lock, orchestrator, CLI — all with the identical CLI flag surface so the black-box compatibility harness can drive it interchangeably.
  • Registers the new implementation with the compatibility test harness, adds CI (Biome + tsc + node:test + build + npm publish under a dev/latest dist-tag split), a git-tag-based SemVer version script, pre-commit hook coverage, dev container support, and full CLAUDE.md documentation.

Test plan

  • Unit tests: cd implementations/typescript && npm test — 56/56 passing (version ordering, template resolution, canonical checksum incl. two pinned cross-implementation reference vectors, migration loader with fail-loud malformed-YAML handling, distributed lock, ES document (de)serialization, integrity verification)
  • Lint/typecheck/build: npm run lint && npm run typecheck && npm run build — clean
  • Full compatibility suite: cd tests && uv run pytest . -v — 52/52 passing (17 scenarios × 3 implementations + 1 cross-implementation checksum equivalency test), run against a live Elasticsearch 9.3.0 container via testcontainers
  • Pre-commit hook (.githooks/pre-commit) runs JVM + Python + TypeScript checks + the full compat suite end-to-end and passes

Follow-up required before the CI publish steps will succeed: a maintainer needs to create the NPM_TOKEN repository secret (an npm automation token with publish rights for esque-ts).

🤖 Generated with Claude Code

Aaron Loes and others added 26 commits July 4, 2026 14:00
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…okups

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tion

Wires configuration, migration loader, ES operations, and the distributed
lock into the main Esque class, mirroring the Python orchestrator's
execution flow and integrity-check logic method-for-method.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rations

runMigrations previously released the lock in a finally block, which meant
a lock-release failure would unconditionally overwrite whatever the
try/catch was about to throw (or discard a successful migration entirely).
Execution and release outcomes are now captured separately: a release
failure never masks a real execution error (and is at least warned about
if both fail), and a release-only failure after a successful migration
now produces a clear, file-scoped error instead of an unrelated one.

Also adds the missing test for the order-mismatch branch of
verifyRecordIntegrity's OR condition, which no existing test exercised.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…id lock timeout

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds the TypeScript implementation to the project overview, repository
structure, build commands, CI/CD, code conventions, and compatibility
test harness sections. Also corrects a stale claim that the Python
implementation uses httpx instead of the official elasticsearch client.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… that TypeScript exists

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… example

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@loesak
loesak merged commit 7e396c1 into master Jul 5, 2026
7 of 8 checks passed
@loesak
loesak deleted the typescript-implementation branch July 5, 2026 03:45
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