chore: full-repo cleanup — dead code, duplicate code, stale docs#851
Merged
Conversation
Deletes unreferenced functions (extractSymbol, toIdentifierName), dead default exports (FileCursorStore, S3CursorStore), a dead deprecated type alias, unused imports, and an unused param on generateContractArtifacts. Also drops the root package.json "overrides" block, which pnpm v10 never reads (only pnpm-workspace.yaml's copy is consulted), and removes unused tsx/vite devDependency drift across packages. Deletes the orphaned apps/web/components/CodeSnippet.tsx, superseded by CodeSection.tsx.
Removes unused imports/vars in test files (unused destructures, unused mock helpers, unused React imports) flagged by eslint's no-unused-vars. No behavior change.
Three near-identical blocks were copy-pasted across sibling files; pulled each into one shared implementation with no behavior change (existing tests pass unchanged): - abi-registry: AbiRegistryClient and LocalAbiRegistryClient each carried their own byte-identical TTL-cache constants/type/get/set logic -> extracted to TtlLruCache. (LocalAbiRegistryClient's stray `catch (e)` unused-binding lint fix rides along in this diff.) - pulse-core: EventEngine and SorobanSubscriber each computed the same full-jitter exponential backoff inline -> extracted to fullJitterBackoffMs in backoff.ts. (EventEngine's unused CursorStore import removal rides along in this diff.) - pulse-notify: connectionPool's acquireEventConnection and acquireContractEventConnection shared ~90 lines of identical onopen/onmessage/onerror/devtools wiring -> extracted to acquireSseConnection. Also merged the near-duplicate ConnectionKey/ ConnectionSubscriber types from connectionPool.ts and wsTransport.ts into one connectionTypes.ts.
…rypoint
bin/orbital imported `{ DeadLetterStore }` from a module that only exports
`MemoryDeadLetterStore`, and resolved paths against `../src/*.js` instead
of the built `../dist/*.js` — the `orbital dlq` CLI could not run at all
as shipped.
- Fix the import name and dist-relative paths in bin/orbital.
- Extract WebhookDelivery's private HMAC signing into an exported
`signWebhookPayload` (packages/pulse-webhooks/src/signing.ts), reused by
verifyWebhookRaw's expected-signature computation (pure refactor, no
behavior change).
- Make `replayDLQ` real: it now delegates to the store's existing
`replay()`/`ReplayHandler` mechanism instead of silently re-adding the
entry. bin/orbital wires a real fetch-based ReplayHandler signed via
`signWebhookPayload`, configurable via `--secret`/`ORBITAL_WEBHOOK_SECRET`.
- Reuse `signWebhookPayload` in apps/web's webhook-sample demo route
instead of a second inline HMAC implementation.
- Add missing test coverage: cli.test.ts (list/dump/replay) and
signing.test.ts (round-trips against verifyWebhookRaw, pinned ADR-003
fixture).
isEventType is exported public API (published to npm) but had zero test coverage. Covers single-type narrowing, multi-type OR-narrowing, the negative case, and filtering an event array by type.
Packages are already live on npm under the @orbital-stellar scope (published out-of-band), so the previously-commented-out publish step would otherwise keep looking like an unfinished TODO forever. Uncommented it to handle future version-bump releases. Note: this step still requires an NPM_TOKEN secret to be added under the repo's GitHub Actions secrets before the next tagged release — that's a settings change, not something this commit can do.
README.md, PROGRESS.md, ROADMAP.md, docs/ARCHITECTURE.md, docs/COOKBOOK.md, and docs/proposal.md all described Soroban event subscription, cursor persistence, and the abi-registry package as unshipped "Phase 1" work, when all three are fully implemented, tested, and wired end-to-end. Corrects the status across all of them so they agree with each other and with the code: - Soroban subscription, cursor/retry persistence, and the ABI registry client are marked shipped, not planned. - docs/proposal.md (the live SCF grant application) is reframed so its funding ask covers only the genuinely-remaining milestones (M3 discriminated-union refinement, M5 starter boilerplates, M6 stability pledge) instead of pitching already-shipped work (M1, M2) as unbuilt. - Package counts/tables updated from three to four packages (abi-registry was missing) in PROGRESS.md, CONTRIBUTING.md, CHANGELOG.md, and docs/proposal.md. - Stale test counts (103/13) replaced with current figures across docs/ARCHITECTURE.md and docs/proposal.md. - pulse-webhooks/README.md gains a documented "Durable retry queues" section (RetryQueue was shipped but undocumented). - Fixed four docs linking to the wrong GitHub org/repo (github.com/orbital/orbital instead of github.com/determined-001/orbital_stellar). - Fixed broken links in webhook-durability.md (pointed at nonexistent reference/cli pages) and apps/web/README.md's wrong package name. - Wired the orphaned cursor-persistence guide into the docs nav (apps/web/lib/docroutes.ts) and authored the previously-missing migrate-from-eventsource guide the nav already linked to.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
apps/web/app/api/webhook-sample/route.ts now imports @orbital-stellar/pulse-webhooks (added earlier in this cleanup to dedupe its HMAC signing), but ci.yml's typecheck-web job and release.yml's release job only built pulse-core before typechecking apps/web — the new import couldn't resolve since pulse-webhooks' dist/index.d.ts was never emitted first. Added a real build step (not --noEmit) for pulse-webhooks before each apps/web typecheck step.
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
Full-repo cleanup pass: dead/unused code, duplicated logic, and stale docs across all four packages, root config, and the docs site.
TtlLruCache,fullJitterBackoffMs,acquireSseConnection).packages/pulse-webhooks/bin/orbitalwas broken (wrong import name, wrong path) — theorbital dlqCLI could not run. Fixed, and madereplayDLQdo a real signed HTTP redelivery instead of a no-op stub.See individual commits for the full breakdown — each is scoped to one concern.
Test plan
pnpm lint— 0 warningspnpm build— all 4 packages compile cleanpnpm -r test— 940 tests green (abi-registry 128, pulse-core 558/7 skipped, pulse-webhooks 188, pulse-notify 66)pnpm --filter orbital/web build— typechecks and builds clean, new/updated docs pages statically generatereplayDLQ's real HTTP delivery end-to-end (mock server, verified signature)Note: the npm-publish step enabled in
release.ymlstill needs anNPM_TOKENsecret added under repo settings before the next tagged release.