Skip to content

feat(downloads): compilable MQL5 source ZIP per EA - #1

Merged
ghwmelite-dotcom merged 3 commits into
mainfrom
feat/ea-source-downloads
Jul 1, 2026
Merged

feat(downloads): compilable MQL5 source ZIP per EA#1
ghwmelite-dotcom merged 3 commits into
mainfrom
feat/ea-source-downloads

Conversation

@ghwmelite-dotcom

Copy link
Copy Markdown
Owner

Summary

Adds a Source (.mq5) button to each EA card (Master / Follower / Journal) in Downloads & Setup. Each button downloads a self-contained, MT5-structured ZIP so users can inspect, audit, or modify the EA and compile it themselves.

Each ZIP contains, laid out for direct extraction into the MT5 Data Folder:

  • Experts/<EA>.mq5
  • Include/*.mqh — the transitive #include closure the EA needs to compile
  • README.txt — install + compile steps

Trade\Trade.mqh is intentionally omitted (ships with MT5).

Bundles

ZIP Experts/ Include/
EdgeRelay_Master_Source.zip EdgeRelay_Master.mq5 Common, Crypto, Http, Queue, Display, JournalSync, JournalQueue
EdgeRelay_Follower_Source.zip EdgeRelay_Follower.mq5 Common, Crypto, Http, Equity, PropGuard, PropGuardDisplay, JsonParser
TradeJournal_Sync_Source.zip TradeJournal_Sync.mq5 Common, Crypto, Http, JournalSync, JournalQueue

Implementation

  • GET /v1/accounts/ea-source/:type — builds the ZIP from an EA_BUNDLES manifest. Authenticated (inherits authMiddleware); no per-account check since the source carries no per-user credentials.
  • src/lib/zip.ts — dependency-free STORE-method ZIP writer for the Workers runtime (no node:zlib).
  • scripts/embed-ea-source.mjs — generates src/generated/ea-source.ts from the canonical apps/ea sources (single source of truth), wired into prebuild/predev/predeploy. The generated file is committed so wrangler deploy needs no codegen step.
  • DownloadsPage.tsx — secondary ghost-variant button + handler using the existing API_BASE helper.

Verification

  • The hand-rolled ZIP writer was validated end-to-end: a real Master bundle built through the actual zip.ts + generated source, then extracted with an independent (.NET) unzipper — correct structure, all includes intact.
  • tsc was not run locally (no TypeScript installed in the dev environment); the CI Typecheck api-gateway / web jobs will verify types and gate the deploy.

Deploy note

Scoped to only this feature (branched from main), so merging deploys just this change via the existing deploy.yml (api-gateway + web).

🤖 Generated with Claude Code

ghwmelite-dotcom and others added 3 commits July 1, 2026 12:45
Add a "Source (.mq5)" button to each EA card (Master, Follower, Journal)
in Downloads & Setup. Each button downloads a self-contained, MT5-structured
ZIP: the EA plus the transitive closure of the .mqh includes it needs to
compile, laid out as Experts/ + Include/ with a README.

- New GET /v1/accounts/ea-source/:type route builds the ZIP from an
  EA_BUNDLES manifest. Authenticated but no per-account check (source
  carries no per-user credentials).
- src/lib/zip.ts: dependency-free STORE-method ZIP writer for the Workers
  runtime (no node:zlib). Verified end-to-end via independent unzip.
- scripts/embed-ea-source.mjs generates src/generated/ea-source.ts from the
  canonical apps/ea sources (single source of truth), wired into
  prebuild/predev/predeploy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pnpm/action-setup@v4 errors with "Multiple versions of pnpm specified"
when both the workflow's `version:` key and package.json's
`packageManager` field are set. Drop the `version: 9` override so the
action reads the pinned version (pnpm@9.15.0) from packageManager, which
is pnpm's recommended setup. Unblocks the PR typecheck for all PRs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The PR typecheck (previously never run due to the pnpm setup bug) surfaced
6 latent strict-mode errors in files unrelated to the EA-source feature:

- marketPulse.ts: drop unused ApiResponse import; hoist the byCurrency
  bucket into a local so noUncheckedIndexedAccess sees the assignment
  (fixes 3x "Object is possibly undefined"). Behavior unchanged.
- strategyHub.ts: remove dead masterAccount query (result never read;
  magic number derives from magicFromSlug); underscore-prefix the unused
  generateFallbackSignal params (keeps arity for callers).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ghwmelite-dotcom
ghwmelite-dotcom merged commit ec700bf into main Jul 1, 2026
2 checks passed
@ghwmelite-dotcom
ghwmelite-dotcom deleted the feat/ea-source-downloads branch July 1, 2026 13:34
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