feat(downloads): compilable MQL5 source ZIP per EA - #1
Merged
Conversation
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>
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
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>.mq5Include/*.mqh— the transitive#includeclosure the EA needs to compileREADME.txt— install + compile stepsTrade\Trade.mqhis intentionally omitted (ships with MT5).Bundles
EdgeRelay_Master_Source.zipEdgeRelay_Follower_Source.zipTradeJournal_Sync_Source.zipImplementation
GET /v1/accounts/ea-source/:type— builds the ZIP from anEA_BUNDLESmanifest. Authenticated (inheritsauthMiddleware); 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 (nonode:zlib).scripts/embed-ea-source.mjs— generatessrc/generated/ea-source.tsfrom the canonicalapps/easources (single source of truth), wired intoprebuild/predev/predeploy. The generated file is committed sowrangler deployneeds no codegen step.DownloadsPage.tsx— secondary ghost-variant button + handler using the existingAPI_BASEhelper.Verification
zip.ts+ generated source, then extracted with an independent (.NET) unzipper — correct structure, all includes intact.tscwas 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 existingdeploy.yml(api-gateway + web).🤖 Generated with Claude Code