From 7580c8daad11ac442ed9418d7374d0829a14c197 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 25 Sep 2025 13:50:21 +0000 Subject: [PATCH 1/2] Initial plan From e14144e9016ac666ce0c13900bd45c5e2b117865 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 25 Sep 2025 14:04:03 +0000 Subject: [PATCH 2/2] Complete TypeScript API documentation integration Co-authored-by: dannywillems <6018454+dannywillems@users.noreply.github.com> --- Makefile | 16 +- .../docs/developers/frontend/api/README.md | 15 ++ .../frontend/api/interfaces/MinaEnv.md | 181 ++++++++++++++ .../frontend/api/interfaces/MinaNode.md | 82 +++++++ .../frontend/api/type-aliases/FeatureType.md | 14 ++ .../api/type-aliases/FeaturesConfig.md | 24 ++ website/package-lock.json | 224 ++++++++++++++++++ website/package.json | 7 +- website/sidebars.ts | 16 ++ website/src/typedoc-entry.ts | 6 + website/tsconfig.typedoc.json | 18 ++ website/typedoc.json | 21 ++ 12 files changed, 618 insertions(+), 6 deletions(-) create mode 100644 website/docs/developers/frontend/api/README.md create mode 100644 website/docs/developers/frontend/api/interfaces/MinaEnv.md create mode 100644 website/docs/developers/frontend/api/interfaces/MinaNode.md create mode 100644 website/docs/developers/frontend/api/type-aliases/FeatureType.md create mode 100644 website/docs/developers/frontend/api/type-aliases/FeaturesConfig.md create mode 100644 website/src/typedoc-entry.ts create mode 100644 website/tsconfig.typedoc.json create mode 100644 website/typedoc.json diff --git a/Makefile b/Makefile index 7dfd19e162..557330bc3a 100644 --- a/Makefile +++ b/Makefile @@ -481,16 +481,22 @@ docs-install: ## Install documentation dependencies @echo "Installing documentation dependencies..." @cd website && npm install +.PHONY: docs-typescript +docs-typescript: docs-install ## Generate TypeScript API documentation + @echo "Generating TypeScript API documentation..." + @cd website && npm run typedoc + @echo "TypeScript API documentation generated in website/docs/developers/frontend/api/" + .PHONY: docs-build -docs-build: docs-integrate-rust docs-install ## Build the documentation website with Rust API docs - @echo "Building documentation website with Rust API documentation..." +docs-build: docs-integrate-rust docs-typescript docs-install ## Build the documentation website with Rust and TypeScript API docs + @echo "Building documentation website with API documentation..." @cd website && npm run build @echo "Documentation built successfully!" @echo "Built files are in website/build/" .PHONY: docs-serve -docs-serve: docs-integrate-rust docs-install ## Serve the documentation website locally with Rust API docs - @echo "Starting documentation server with Rust API documentation..." +docs-serve: docs-integrate-rust docs-typescript docs-install ## Serve the documentation website locally with Rust and TypeScript API docs + @echo "Starting documentation server with API documentation..." @echo "Documentation will be available at: http://localhost:$(DOCS_PORT)" @cd website && npm start -- --port $(DOCS_PORT) @@ -533,7 +539,7 @@ docs-integrate-rust: docs-rust ## Integrate Rust API documentation into website .PHONY: docs-clean docs-clean: ## Clean documentation build artifacts @echo "Cleaning documentation build artifacts..." - @rm -rf website/build website/.docusaurus website/static/api-docs target/doc + @rm -rf website/build website/.docusaurus website/static/api-docs website/docs/developers/frontend/api target/doc @echo "Documentation artifacts cleaned!" # Release management targets diff --git a/website/docs/developers/frontend/api/README.md b/website/docs/developers/frontend/api/README.md new file mode 100644 index 0000000000..993d5dde86 --- /dev/null +++ b/website/docs/developers/frontend/api/README.md @@ -0,0 +1,15 @@ +**Frontend TypeScript API** + +*** + +# Frontend TypeScript API + +## Interfaces + +- [MinaEnv](interfaces/MinaEnv.md) +- [MinaNode](interfaces/MinaNode.md) + +## Type Aliases + +- [FeaturesConfig](type-aliases/FeaturesConfig.md) +- [FeatureType](type-aliases/FeatureType.md) diff --git a/website/docs/developers/frontend/api/interfaces/MinaEnv.md b/website/docs/developers/frontend/api/interfaces/MinaEnv.md new file mode 100644 index 0000000000..506f257cdc --- /dev/null +++ b/website/docs/developers/frontend/api/interfaces/MinaEnv.md @@ -0,0 +1,181 @@ +[**Frontend TypeScript API**](../README.md) + +*** + +[Frontend TypeScript API](../README.md) / MinaEnv + +# Interface: MinaEnv + +Defined in: [mina-env.type.ts:16](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L16) + +Main environment configuration interface for the Mina Rust frontend. +This interface defines all possible configuration options that can be set +per environment (development, production, local, etc.). + +To configure a frontend instance, modify the appropriate environment file: +- Development: src/environments/environment.ts +- Production: src/environments/environment.prod.ts +- Local: src/environments/environment.local.ts +- WebNode: src/environments/environment.webnodelocal.ts +- Producer: src/environments/environment.producer.ts +- Fuzzing: src/environments/environment.fuzzing.ts + +## See + +[https://github.com/o1-labs/mina-rust/tree/develop/frontend/src/environments](https://github.com/o1-labs/mina-rust/tree/develop/frontend/src/environments) + +## Properties + +### production + +> **production**: `boolean` + +Defined in: [mina-env.type.ts:18](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L18) + +Whether this is a production build + +*** + +### configs + +> **configs**: [`MinaNode`](MinaNode.md)[] + +Defined in: [mina-env.type.ts:21](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L21) + +Array of Mina node configurations to connect to + +*** + +### identifier? + +> `optional` **identifier**: `string` + +Defined in: [mina-env.type.ts:24](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L24) + +Human-readable identifier for this environment (e.g., "Dev FE") + +*** + +### hideToolbar? + +> `optional` **hideToolbar**: `boolean` + +Defined in: [mina-env.type.ts:27](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L27) + +Hide the top toolbar in the UI + +*** + +### hideNodeStats? + +> `optional` **hideNodeStats**: `boolean` + +Defined in: [mina-env.type.ts:30](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L30) + +Hide node statistics display + +*** + +### canAddNodes? + +> `optional` **canAddNodes**: `boolean` + +Defined in: [mina-env.type.ts:33](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L33) + +Allow adding custom nodes through the UI + +*** + +### showWebNodeLandingPage? + +> `optional` **showWebNodeLandingPage**: `boolean` + +Defined in: [mina-env.type.ts:36](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L36) + +Show the WebNode landing page + +*** + +### showLeaderboard? + +> `optional` **showLeaderboard**: `boolean` + +Defined in: [mina-env.type.ts:39](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L39) + +Show the leaderboard/uptime tracking feature + +*** + +### hidePeersPill? + +> `optional` **hidePeersPill**: `boolean` + +Defined in: [mina-env.type.ts:42](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L42) + +Hide the peers pill in the status bar + +*** + +### hideTxPill? + +> `optional` **hideTxPill**: `boolean` + +Defined in: [mina-env.type.ts:45](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L45) + +Hide the transactions pill in the status bar + +*** + +### sentry? + +> `optional` **sentry**: `object` + +Defined in: [mina-env.type.ts:48](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L48) + +Sentry error tracking configuration + +#### dsn + +> **dsn**: `string` + +Sentry Data Source Name for error reporting + +#### tracingOrigins + +> **tracingOrigins**: `string`[] + +Origins to trace for performance monitoring + +*** + +### globalConfig? + +> `optional` **globalConfig**: `object` + +Defined in: [mina-env.type.ts:56](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L56) + +Global configuration shared across all nodes + +#### features? + +> `optional` **features**: [`FeaturesConfig`](../type-aliases/FeaturesConfig.md) + +Feature flags configuration defining which UI sections are available + +#### graphQL? + +> `optional` **graphQL**: `string` + +GraphQL endpoint URL for blockchain queries + +#### firebase? + +> `optional` **firebase**: `any` + +Firebase configuration for leaderboard and hosting + +#### heartbeats? + +> `optional` **heartbeats**: `boolean` + +Enable heartbeat/uptime tracking functionality diff --git a/website/docs/developers/frontend/api/interfaces/MinaNode.md b/website/docs/developers/frontend/api/interfaces/MinaNode.md new file mode 100644 index 0000000000..9cb6327be1 --- /dev/null +++ b/website/docs/developers/frontend/api/interfaces/MinaNode.md @@ -0,0 +1,82 @@ +[**Frontend TypeScript API**](../README.md) + +*** + +[Frontend TypeScript API](../README.md) / MinaNode + +# Interface: MinaNode + +Defined in: [mina-env.type.ts:72](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L72) + +Configuration for a single Mina node connection. +Each node can have different endpoints and feature sets enabled. + +## Properties + +### name + +> **name**: `string` + +Defined in: [mina-env.type.ts:74](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L74) + +Display name for this node (e.g., "Local rust node", "Producer-0") + +*** + +### url? + +> `optional` **url**: `string` + +Defined in: [mina-env.type.ts:77](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L77) + +Base URL for the node's API endpoint (e.g., "http://127.0.0.1:3000") + +*** + +### memoryProfiler? + +> `optional` **memoryProfiler**: `string` + +Defined in: [mina-env.type.ts:80](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L80) + +URL for memory profiling endpoint + +*** + +### debugger? + +> `optional` **debugger**: `string` + +Defined in: [mina-env.type.ts:83](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L83) + +URL for debugger interface + +*** + +### features? + +> `optional` **features**: [`FeaturesConfig`](../type-aliases/FeaturesConfig.md) + +Defined in: [mina-env.type.ts:86](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L86) + +Node-specific feature configuration (overrides globalConfig.features) + +*** + +### isCustom? + +> `optional` **isCustom**: `boolean` + +Defined in: [mina-env.type.ts:89](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L89) + +Whether this is a user-added custom node + +*** + +### isWebNode? + +> `optional` **isWebNode**: `boolean` + +Defined in: [mina-env.type.ts:92](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L92) + +Whether this node runs in the browser as a WebNode diff --git a/website/docs/developers/frontend/api/type-aliases/FeatureType.md b/website/docs/developers/frontend/api/type-aliases/FeatureType.md new file mode 100644 index 0000000000..92898cd9ed --- /dev/null +++ b/website/docs/developers/frontend/api/type-aliases/FeatureType.md @@ -0,0 +1,14 @@ +[**Frontend TypeScript API**](../README.md) + +*** + +[Frontend TypeScript API](../README.md) / FeatureType + +# Type Alias: FeatureType + +> **FeatureType** = keyof [`FeaturesConfig`](FeaturesConfig.md) + +Defined in: [mina-env.type.ts:144](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L144) + +Union type of all available feature names. +Used for type safety when referencing features in code. diff --git a/website/docs/developers/frontend/api/type-aliases/FeaturesConfig.md b/website/docs/developers/frontend/api/type-aliases/FeaturesConfig.md new file mode 100644 index 0000000000..be74a0b6f8 --- /dev/null +++ b/website/docs/developers/frontend/api/type-aliases/FeaturesConfig.md @@ -0,0 +1,24 @@ +[**Frontend TypeScript API**](../README.md) + +*** + +[Frontend TypeScript API](../README.md) / FeaturesConfig + +# Type Alias: FeaturesConfig + +> **FeaturesConfig** = `Partial`\<\{ `dashboard`: `string`[]; `nodes`: `string`[]; `state`: `string`[]; `network`: `string`[]; `snarks`: `string`[]; `resources`: `string`[]; `block-production`: `string`[]; `mempool`: `string`[]; `benchmarks`: `string`[]; `fuzzing`: `string`[]; \}\> + +Defined in: [mina-env.type.ts:108](https://github.com/o1-labs/mina-rust/blob/7580c8daad11ac442ed9418d7374d0829a14c197/frontend/src/app/shared/types/core/environment/mina-env.type.ts#L108) + +Feature flags configuration that controls which UI sections and sub-features +are available. Each feature can have multiple sub-features enabled. + +## Example + +```typescript +features: { + 'dashboard': [], // Dashboard tab (no sub-features) + 'nodes': ['overview', 'live'], // Nodes tab with overview and live sub-tabs + 'network': ['messages', 'blocks'] // Network tab with specific sub-sections +} +``` diff --git a/website/package-lock.json b/website/package-lock.json index aae6874dda..6ff8b41c00 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -20,7 +20,10 @@ "@docusaurus/module-type-aliases": "^3.8.1", "@docusaurus/tsconfig": "^3.8.1", "@docusaurus/types": "^3.8.1", + "docusaurus-plugin-typedoc": "^1.4.2", "raw-loader": "^4.0.2", + "typedoc": "^0.28.13", + "typedoc-plugin-markdown": "^4.9.0", "typescript": "~5.6.2" }, "engines": { @@ -3855,6 +3858,20 @@ "node": ">=18.0" } }, + "node_modules/@gerrit0/mini-shiki": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.13.0.tgz", + "integrity": "sha512-mCrNvZNYNrwKer5PWLF6cOc0OEe2eKzgy976x+IT2tynwJYl+7UpHTSeXQJGijgTcoOf+f359L946unWlYRnsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/engine-oniguruma": "^3.13.0", + "@shikijs/langs": "^3.13.0", + "@shikijs/themes": "^3.13.0", + "@shikijs/types": "^3.13.0", + "@shikijs/vscode-textmate": "^10.0.2" + } + }, "node_modules/@hapi/hoek": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", @@ -4085,6 +4102,55 @@ "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", "license": "MIT" }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.13.0.tgz", + "integrity": "sha512-O42rBGr4UDSlhT2ZFMxqM7QzIU+IcpoTMzb3W7AlziI1ZF7R8eS2M0yt5Ry35nnnTX/LTLXFPUjRFCIW+Operg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.13.0", + "@shikijs/vscode-textmate": "^10.0.2" + } + }, + "node_modules/@shikijs/langs": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.13.0.tgz", + "integrity": "sha512-672c3WAETDYHwrRP0yLy3W1QYB89Hbpj+pO4KhxK6FzIrDI2FoEXNiNCut6BQmEApYLfuYfpgOZaqbY+E9b8wQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.13.0" + } + }, + "node_modules/@shikijs/themes": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.13.0.tgz", + "integrity": "sha512-Vxw1Nm1/Od8jyA7QuAenaV78BG2nSr3/gCGdBkLpfLscddCkzkL36Q5b67SrLLfvAJTOUzW39x4FHVCFriPVgg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.13.0" + } + }, + "node_modules/@shikijs/types": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.13.0.tgz", + "integrity": "sha512-oM9P+NCFri/mmQ8LoFGVfVyemm5Hi27330zuOBp0annwJdKH1kOLndw3zCtAVDehPLg9fKqoEx3Ht/wNZxolfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", + "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", + "dev": true, + "license": "MIT" + }, "node_modules/@sideway/address": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", @@ -7073,6 +7139,19 @@ "node": ">=6" } }, + "node_modules/docusaurus-plugin-typedoc": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/docusaurus-plugin-typedoc/-/docusaurus-plugin-typedoc-1.4.2.tgz", + "integrity": "sha512-1qerRejLSYxEWdyVPLDMMeKFPLA/37yZAsdwJy9ThHFQR78+v3b5spSbk67VHGLr2mAn4FVHu0aGJ6p7iWotSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "typedoc-docusaurus-theme": "^1.4.0" + }, + "peerDependencies": { + "typedoc-plugin-markdown": ">=4.8.0" + } + }, "node_modules/dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -9606,6 +9685,16 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "license": "MIT" }, + "node_modules/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "uc.micro": "^2.0.0" + } + }, "node_modules/loader-runner": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", @@ -9720,6 +9809,13 @@ "yallist": "^3.0.2" } }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true, + "license": "MIT" + }, "node_modules/markdown-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz", @@ -9732,6 +9828,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/markdown-it": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", + "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" + }, + "bin": { + "markdown-it": "bin/markdown-it.mjs" + } + }, "node_modules/markdown-table": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", @@ -10159,6 +10273,13 @@ "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", "license": "CC0-1.0" }, + "node_modules/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", + "dev": true, + "license": "MIT" + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -14381,6 +14502,16 @@ "node": ">=6" } }, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/pupa": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pupa/-/pupa-3.1.0.tgz", @@ -16467,6 +16598,79 @@ "is-typedarray": "^1.0.0" } }, + "node_modules/typedoc": { + "version": "0.28.13", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.28.13.tgz", + "integrity": "sha512-dNWY8msnYB2a+7Audha+aTF1Pu3euiE7ySp53w8kEsXoYw7dMouV5A1UsTUY345aB152RHnmRMDiovuBi7BD+w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@gerrit0/mini-shiki": "^3.12.0", + "lunr": "^2.3.9", + "markdown-it": "^14.1.0", + "minimatch": "^9.0.5", + "yaml": "^2.8.1" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 18", + "pnpm": ">= 10" + }, + "peerDependencies": { + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x || 5.9.x" + } + }, + "node_modules/typedoc-docusaurus-theme": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/typedoc-docusaurus-theme/-/typedoc-docusaurus-theme-1.4.2.tgz", + "integrity": "sha512-i9YYDcScLD0WUiX8I+LXHX3ZVvRDlJsmRo9l/uWrFT37cHlMz4Ay0GOnWzHUBnnwAo1uzYOw9RjUXznbWozBEA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "typedoc-plugin-markdown": ">=4.8.0" + } + }, + "node_modules/typedoc-plugin-markdown": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.9.0.tgz", + "integrity": "sha512-9Uu4WR9L7ZBgAl60N/h+jqmPxxvnC9nQAlnnO/OujtG2ubjnKTVUFY1XDhcMY+pCqlX3N2HsQM2QTYZIU9tJuw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "typedoc": "0.28.x" + } + }, + "node_modules/typedoc/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/typedoc/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/typescript": { "version": "5.6.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", @@ -16481,6 +16685,13 @@ "node": ">=14.17" } }, + "node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "dev": true, + "license": "MIT" + }, "node_modules/undici-types": { "version": "7.8.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz", @@ -17523,6 +17734,19 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "license": "ISC" }, + "node_modules/yaml": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + } + }, "node_modules/yocto-queue": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", diff --git a/website/package.json b/website/package.json index fcdb752c20..9f13b4033b 100644 --- a/website/package.json +++ b/website/package.json @@ -12,7 +12,9 @@ "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", - "typecheck": "tsc" + "typecheck": "tsc", + "typedoc": "typedoc --options typedoc.json", + "typedoc-clean": "rm -rf ./docs/developers/frontend/api" }, "dependencies": { "@docusaurus/core": "^3.8.1", @@ -27,7 +29,10 @@ "@docusaurus/module-type-aliases": "^3.8.1", "@docusaurus/tsconfig": "^3.8.1", "@docusaurus/types": "^3.8.1", + "docusaurus-plugin-typedoc": "^1.4.2", "raw-loader": "^4.0.2", + "typedoc": "^0.28.13", + "typedoc-plugin-markdown": "^4.9.0", "typescript": "~5.6.2" }, "browserslist": { diff --git a/website/sidebars.ts b/website/sidebars.ts index dcd3d33e88..4cacf10d72 100644 --- a/website/sidebars.ts +++ b/website/sidebars.ts @@ -82,6 +82,22 @@ const sidebars: SidebarsConfig = { 'developers/ledger-crate', ], }, + { + type: 'category', + label: 'Frontend Development', + items: [ + { + type: 'category', + label: 'TypeScript API', + items: [ + { + type: 'autogenerated', + dirName: 'developers/frontend/api', + }, + ], + }, + ], + }, { type: 'category', label: 'APIs and Data', diff --git a/website/src/typedoc-entry.ts b/website/src/typedoc-entry.ts new file mode 100644 index 0000000000..be9dfc6a56 --- /dev/null +++ b/website/src/typedoc-entry.ts @@ -0,0 +1,6 @@ +/** + * @fileoverview Entry point for TypeDoc generation of Mina Frontend TypeScript API + */ + +// Export all types from the mina-env.type.ts file +export * from '../../frontend/src/app/shared/types/core/environment/mina-env.type.ts'; \ No newline at end of file diff --git a/website/tsconfig.typedoc.json b/website/tsconfig.typedoc.json new file mode 100644 index 0000000000..546e75e5fa --- /dev/null +++ b/website/tsconfig.typedoc.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "commonjs", + "moduleResolution": "node", + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "skipLibCheck": true, + "strict": false, + "declaration": true, + "emitDeclarationOnly": true, + "types": [] + }, + "include": [ + "src/typedoc-entry.ts", + "../frontend/src/app/shared/types/core/environment/mina-env.type.ts" + ] +} \ No newline at end of file diff --git a/website/typedoc.json b/website/typedoc.json new file mode 100644 index 0000000000..4857cc61e6 --- /dev/null +++ b/website/typedoc.json @@ -0,0 +1,21 @@ +{ + "entryPoints": [ + "src/typedoc-entry.ts" + ], + "tsconfig": "tsconfig.typedoc.json", + "out": "./docs/developers/frontend/api", + "plugin": ["typedoc-plugin-markdown"], + "name": "Frontend TypeScript API", + "readme": "none", + "excludePrivate": true, + "excludeProtected": true, + "excludeInternal": true, + "sort": ["source-order"], + "kindSortOrder": [ + "Interface", + "TypeAlias", + "Function", + "Variable" + ], + "skipErrorChecking": true +} \ No newline at end of file