feat(trading-signals-vocs): add Vocs documentation site with interactive demos and backtesting - #1318
Open
bennycode wants to merge 2 commits into
Open
feat(trading-signals-vocs): add Vocs documentation site with interactive demos and backtesting#1318bennycode wants to merge 2 commits into
bennycode wants to merge 2 commits into
Conversation
CandleSchema and CandleBaseSchema move from Broker.ts into src/schemas.ts, which only imports zod. The new @typedtrader/exchange/schemas subpath lets browser bundles validate candles without pulling in broker code that relies on Node.js built-ins. Broker.ts re-exports everything, so the package barrel stays unchanged for existing consumers.
…ive demos and backtesting New docs site (part of #1288) built on Vocs 2 with interactive MDX: - 127 generated indicator pages across trend, momentum, volatility, and volume, each with a live Highcharts demo (dataset pills incl. candle JSON upload, price chart, collapsible sample values) and a Twoslash-checked usage snippet derived from the demo registry - utility function playgrounds, a full in-browser backtester (strategies, protection modal, buy-and-hold baseline), and a welcome page with a mermaid architecture diagram and package overview cards - pages and sidebar are generated via npm run generate; hand-written intros in src/intros/<category>/<id>.md survive regeneration - scripts/site.ts wraps vite with the vocs plugin to shim Node.js built-ins (events, crypto, assert, util) for the client bundle, which lets trading-strategies and the exchange broker mocks run in the browser - Twoslash needs a package-local TypeScript 5 (the repo's TS 7 has no JS compiler API); waku is pinned to 1.0.0-beta.6 because beta.9 breaks the vocs router
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.
Part of #1288.
This adds a new
trading-signals-vocspackage: a documentation site built on Vocs 2 (the framework behind the XMTP docs referenced in the ticket), with full feature parity to the current Next.js site plus docs-native extras. It runs alongsidetrading-signals-docsfor now — swapping the deployment is a follow-up.What's in the site
npm run generate). Each page has a live Highcharts demo (dataset pills incl. custom candle JSON upload, price chart, collapsible sample values) and a Twoslash-checked usage snippet: class name and constructor args are extracted from each demo'screateIndicator, and a wrong snippet fails the build.src/intros/<category>/<id>.mdand survive regeneration (RMI has one as an example).trading-signalsbuild,llms.txt/llms-full.txt, per-page "Copy for AI".Engineering notes
@typedtrader/exchange/schemassubpath (first commit):CandleSchema/CandleBaseSchemamoved to a zod-only module so browser bundles can validate uploaded candles without dragging broker code (Node built-ins) into the client graph. The barrel re-exports everything, so existing consumers are unaffected — exchange tests, dependent typechecks, and knip are green.configFile: false, soscripts/site.tswraps the same Vite invocation with a small plugin that shimsnode:events/node:crypto/node:assert/node:utilin the client environment only. That is what letstrading-strategiesandAlpacaBrokerMockrun the backtester in the browser.lib.*.d.ts, so the package pins a localtypescript@^5.9and points Twoslash at its lib directory invocs.config.ts.1.0.0-beta.6via a root override: beta.9 satisfies vocs' peer range but breaks its router at runtime (blank pages).Verification
Built statically (267 files) and clicked through in Chrome in both themes: indicator demos incl. custom renders (MACD, QQE, Ichimoku), candle JSON upload, and a full backtest run (buy-and-hold on Synthetic Uptrend, +32.49% ROI with baseline comparison). oxlint, tsc, and knip are green across the repo.
Not ported yet (intentionally): Playwright e2e specs and deployment wiring — those belong to the actual site swap.