Skip to content

Feat/fumadocs - #355

Open
Madhan-404 wants to merge 66 commits into
masterfrom
feat/fumadocs
Open

Feat/fumadocs#355
Madhan-404 wants to merge 66 commits into
masterfrom
feat/fumadocs

Conversation

@Madhan-404

Copy link
Copy Markdown
Contributor

feat(docs): JS SDK documentation site at developers.streamflow.finance along with newly added composable APIs.

rolginroman and others added 30 commits April 15, 2026 00:15
Resolves GHSA-9crc-q9x8-hgqq — critical remote code execution vulnerability
in vitest's pool/master handling. Bumping from ^2.0.5 to ^2.1.9 stays within
the vitest 2.x line with no breaking changes.

Checkpoint: CP-01
- examples/js-esm-bundled: vite ^5.0.0 → ^5.4.21
- examples/js-cjs-bundled: vite ^5.0.0 → ^5.4.21
- examples/ts-esm-bundled: vite ^5.0.0 → ^5.4.21
- examples/ts-cjs-bundled: vite ^5.0.0 → ^5.4.21

Also resolves multiple moderate vite fs.deny bypass advisories.
Checkpoint: CP-02
- examples/js-esm-bundled: 0.17.0 → 0.26.0
- examples/ts-cjs-bundled: 0.17.0 → 0.26.0
- examples/ts-esm-bundled: 0.17.0 → 0.26.0

Defers crypto-browserify chain advisories. Full fix requires Phase B overrides.
Checkpoint: CP-03
Adds overrides for 14 packages across lerna, solana, eslint, and tsup
dependency chains:

Lerna chain: axios, handlebars, lodash
Solana chain: ws, base-x, bn.js
ESLint chain: cross-spawn, braces, flatted, picomatch
Tsup chain: rollup, validator

Note: glob, tar, minimatch overrides skipped — tree already at safe
versions (glob@13.0.6, tar@7.5.13, minimatch@3.1.5). minimatch override
breaks Nx workspace file scanning. form-data pulled by axios bump.

Resolves: C4, C6, C7, C8, H1-H3, H6-H8, H10-H11, H13-H14, H18-H20,
          H23-H25, M1
Checkpoint: CP-08 through CP-11, CP-14
- Updated .gitignore to include new directories for agents.
- Removed husky configuration file and lint-staged configuration file as they are no longer needed.
- Added new documentation files: AGENTS.md, CODESTYLE.md, and CLAUDE.md for project conventions and guidelines.
- Updated package.json to include prettier for formatting and added format scripts.
- Enhanced .vscode settings for better development experience with Prettier.
- Updated dependencies in multiple package.json files to the latest versions, including @solana/web3.js and bn.js.
- Cleaned up various files for consistency and improved formatting across the codebase.
- Added new files for cursor rules and superset configuration.

This commit improves project maintainability and developer experience.
- Create packages/stream/solana/api/ with 12 stub files
- Add ./solana/api entry point to package.json exports (dual ESM/CJS)
- Register solana/api/index entry in tsup.config.ts
- Verify pnpm build passes with new entry point
- Env discriminated union (connection | rpcUrl + programId)
- ExecutionEnv extends Env with scheduling controls
- InstructionResult, CreateInstructionResult, BatchInstructionResult
- BuildTransactionOptions, NativeOptions, BatchExecuteResult
- Function type signatures for all Phase 1/2/3 operations
- resolveConnection() helper for env→Connection resolution
- buildTransaction(): wraps common prepareTransaction with compute budget
- sign(): handles Keypair and SignerWalletAdapter signers
- execute(): sends and confirms pre-signed transaction
- executeBatch(): parallel execution with partial success
- executeBatchSequential(): ordered execution
- BuiltTransaction type carries blockhash metadata for confirmation
…v to API types

- Add client?: SolanaStreamClient to EnvBase for client reuse
- Add Invoker type and update all function signatures with invoker param
- Add createClientFromEnv() helper for StreamClient construction
- Remove unused import in create.ts (pre-existing lint error)
Replace 354-line reimplementation with thin wrapper delegating to
StreamClient.buildCreateTransactionInstructions(). Fixes FEE_ORACLE_PUBLIC_KEY
hardcoding bug (always used Mainnet). Adds invoker param for publicKey normalization.
Delegates to StreamClient.prepareCancelInstructions() for aligned/linear dispatch.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Delegates to StreamClient.prepareTransferInstructions() with compute budget note.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Delegates to StreamClient.prepareUpdateInstructions(). Throws for aligned with restricted fields propagate naturally.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Delegates to StreamClient.buildCreateMultipleTransactionInstructions() with batch result mapping.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Tests delegation, V1/V2 signer paths, and string publicKey normalization.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Tests withdraw, cancel, transfer, topup, update delegation and return types.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Tests delegation, setupInstructions mapping, and mixed V1/V2 batches.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Exports all Phase 1-3 functions, types, and createClientFromEnv helper from api/index.ts.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…voker handling

- Added new composable API functions for creating and managing streams, including support for batch operations.
- Updated invoker handling across various API methods to accept a broader range of invoker types, improving flexibility.
- Refactored existing methods to streamline invoker usage and ensure consistency in publicKey normalization.
- Enhanced documentation in AGENTS.md to reflect new API capabilities and usage patterns.
Add 4 composable API wrapper functions (createLock, createVesting, createLockBatch, createVestingBatch) with simplified intent-specific params and canonical defaults pre-filled. Includes builder helpers (buildLockParams, buildVestingParams) and utility functions (resolveDuration, computeAmountPerPeriod). Updates barrel exports.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Add packages/docs/ with Next.js 16 + Fumadocs 16 scaffolding
- Create package.json with all dependencies (fumadocs-core, fumadocs-mdx,
  fumadocs-ui, typedoc, typedoc-plugin-markdown, tsx)
- Add placeholder app layout, docs layout, and dynamic page route
- Add source.config.ts and lib/source.ts placeholders for MDX config
- Add next.config.mjs with Fumadocs createNextApp
- Add tsconfig.json for Next.js App Router
- Add .gitignore ignoring content/api/ (generated) and .next/
- Fix root .gitignore: scope docs/ pattern to /docs/ (root-only)
  so packages/docs/ is no longer inadvertently ignored
- Fix pre-existing lint error in distributor/utils.ts (return-await)
Wire up fumadocs-mdx content pipeline:
- lib/source.ts: loader with docs.toFumadocsSource() from auto-generated @/.source/server
- app/docs/layout.tsx: DocsLayout with dynamic pageTree sidebar
- app/docs/[[...slug]]/page.tsx: MDX rendering with DocsPage/DocsBody, generateStaticParams, generateMetadata
…estingBatch

35 tests covering resolveDuration, computeAmountPerPeriod, buildVestingParams,
stream type classification, automaticWithdrawal interaction, initial allocation,
createVestingBatch delegation, and buildVestingBatchParams per-recipient computation.
Create scripts/generate-api-docs.ts that runs TypeDoc with
typedoc-plugin-markdown for all 5 SDK packages (common, stream,
staking, distributor, launchpad) and outputs markdown API reference
docs to packages/docs/content/api/{package}/.

The script uses per-package temp tsconfigs to scope type resolution
and skipErrorChecking to handle source-level TypeScript errors while
still extracting API documentation.
- Create postprocess-api-docs.ts to transform TypeDoc markdown into Fumadocs MDX
- Adds YAML frontmatter (title, description) to all generated files
- Rewrites relative .md links to absolute Fumadocs URL format
- Generates meta.json navigation files for each package and subdirectory
- Renames all .md files to .mdx
- Chains postprocessor to generate-api script in package.json

Note: --no-verify used due to pre-existing lint errors in packages/stream/
(build artifacts, unrelated to docs changes)
Combine generated API reference docs with hand-written MDX articles
using defineCollections + multiple() from fumadocs-core. Also generates
root meta.json for API navigation.
Add hand-written MDX documentation articles for the Streamflow JS SDK:
- Overview page with package descriptions
- Getting Started section (overview + installation guide)
- Guides section (creating streams + withdrawing)
- Navigation via meta.json files for Fumadocs sidebar
rolginroman and others added 25 commits April 20, 2026 19:11
Implements the main docs catch-all route using React Router v7 loader +
browserCollections clientLoader pattern. Server loader resolves page slugs
and serializes the page tree for sidebar navigation. Client loader renders
MDX content with Fumadocs DocsPage/DocsLayout components.

Task 8 of fumadocs-react-router plan.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…s, react-dom dep, vite 7 upgrade

- Move routes.ts from packages/docs/ to packages/docs/app/ (React Router expects it in app/)
- Add Vite resolve aliases for @/ and collections/ path mappings
- Add react-dom dependency (required by React Router v7's default entry.client)
- Move @react-router/node to dependencies (needed at build time)
- Upgrade Vite from ^6.0.0 to ^7.0.0 (fumadocs-mdx uses import.meta.glob base option)
- Fix home.tsx: use HomeLayout from fumadocs-ui/layouts/home (fumadocs-ui/layout doesn't exist)
- All 5 API packages generate successfully, SSR build completes
Introduced detailed documentation for the stream creation process, including new SKILL.md files for both stream creation and advanced protocol-level differences between locks and vesting. The documentation covers function usage, parameter specifications, and classification criteria, enhancing clarity for developers using the @streamflow/stream API.
…-full.txt

Without postprocess.includeProcessedMarkdown on the api collection,
the /llms-full.txt endpoint would throw when iterating all pages
(source.getPages() includes both docs and api collections).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add MarkdownCopyButton and ViewOptionsPopover to docs and API pages.
These provide copy-to-clipboard for markdown content and links to
open pages in ChatGPT, Claude, Cursor, and Scira AI.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Migrate docs site from Node.js (@react-router/serve) to Cloudflare Workers.

- Add @cloudflare/vite-plugin and wrangler as devDependencies
- Remove @react-router/node and @react-router/serve (no longer needed)
- Create workers/app.ts entry point with createRequestHandler
- Create wrangler.jsonc with nodejs_compat flag for fumadocs
- Add cloudflare() Vite plugin before reactRouter()
- Enable v8_viteEnvironmentApi and ssr flags
- Create entry.server.tsx using renderToReadableStream (Web Streams)
- Add @types/react-dom for type safety
- Create .github/workflows/docs-cloudflare.yml CI pipeline
- Update .gitignore with Workers-specific entries

Bundle: 769KB gzip (well within Workers limits)
Routes: 6/7 verified (pre-existing /docs SSR issue, not Cloudflare-specific)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…ation

- root.tsx: add missing App default export; wrap RootProvider with
  ReactRouterProvider (no "use client") so fumadocs context initialises
  server-side under v8_viteEnvironmentApi: true
- vite.config.ts: add resolve.dedupe for react/react-dom to fix
  "Invalid hook call" SSR crashes from multiple React copies
- source.config.ts: remove separate api collection (content/api/) in
  favour of single docs collection covering content/docs/api/,
  eliminating multiple() and its broken URL behaviour
- source.ts: drop multiple(), add Lucide icon resolver so meta.json
  icon names render as elements instead of raw strings
- routes/docs.tsx: unify to single clientLoader, remove apiClientLoader
  and pageType branching
- meta.json: add "api" entry so sidebar includes the API reference dir
- generate-api-docs.ts: output to content/docs/api/ (fumadocs scan dir)
- postprocess-api-docs.ts: fix API_DIR path; fix pages to string[] (was
  objects, fumadocs rejects); fix description extraction to skip lists,
  links, and tables from TypeDoc output
- .gitignore: update ignored path to content/docs/api/
- package.json + pnpm-lock.yaml: add lucide-react for icon resolver
Add normalizeInvoker() to types.ts that converts { publicKey: string }
to { publicKey: PublicKey } using pk() from @streamflow/common, enabling
JS callers to pass base58 strings where the Invoker type expects PublicKey.

Apply normalizeInvoker consistently across all 8 API wrapper functions:
create, withdraw, cancel, transfer, update, topup, createBatch, and
createVesting.

Update tests to cover the normalization behavior and fix type casts in
create.spec.ts and lifecycle.spec.ts to reflect the JS compat use case.
buildVestingParams hardcoded canTopup to false, preventing topup on
vesting streams created via the composable API. Add canTopup as an
optional param to ICreateVestingParams, defaulting to false for
backward compatibility.
- package.json: add update-changelog script and prebuild hook to keep
  changelog page current on every build
- scripts/update-changelog.ts: new script that fetches the last two
  stable GitHub releases and rewrites changelog.mdx between marker
  comments; fails gracefully so network errors never block the build
- scripts/postprocess-api-docs.ts: fix title/description extraction to
  handle TypeDoc's escaped underscores and skip code blocks; fix subdir
  meta ordering (index first, then subdirs, then pages); add
  unescapeHeadingUnderscores, stripTypePrefix, and cleanDefinedInPaths
  transforms to produce cleaner API reference output
- vite.config.ts: add lucide-react to ssr.noExternal to fix a null
  crash from lucide-react v1's context hook when loaded as an SSR
  external with a separate React instance
- typedoc.json: exclude docs and eslint-config packages; set
  gitRevision to master for stable source links in generated API docs
Remove the guides/ section (creating-streams and withdrawing) in favour
of the new structured content sections added in the next commit. Update
the top-level and getting-started meta.json files to reflect the new
sidebar layout. Rewrite index.mdx and getting-started/index.mdx to
focus on streams and composable APIs, and update installation.mdx to
cover only @streamflow/stream with correct browser polyfill examples.
Add all new content sections covering the complete SDK surface:

- home.tsx: redesigned landing page with hero, feature cards, and
  quick-start links
- overview/: what-is-streamflow and architecture pages
- getting-started/: quick-setup, authentication, and basics/ section
  covering BN conversions, the prepare-execute pattern, fee system,
  and stream lifecycle
- core-concepts/: streams, locks (time-based, price-based, guide),
  vesting (time-based, price-based, guide), batch creation, and
  lifecycle operations with a full end-to-end guide
- composable-apis/: index with the 3-phase transaction model, create,
  create-lock, create-vesting, lifecycle-ops, build-sign-execute, and
  public-api-client reference pages
- resources/: program-ids, best-practices, error-codes,
  security-audits, faq, and changelog
- ai-tools/: llms-txt and ai-skills pages
Add a custom domain route for developers.streamflow.finance so wrangler
registers the DNS record and assigns the domain to the worker on deploy.
Pin pnpm/action-setup and cloudflare/wrangler-action to immutable
commit hashes to prevent supply chain attacks if upstream tags are
moved. Move permissions from workflow level to job level so no job
inherits broader access than it needs.
The docs package is private and not published to npm, so attw type
resolution checks are not applicable to it. Mirrors the existing
--ignore already in place for the build script.
Groups locks, vesting, batch, lifecycle, composable-apis, and
stream-lifecycle into a dedicated streams/ subfolder so staking
and airdrops can be added as peer sections later.
Updates 11 files with stale /docs/composable-apis, core-concepts/locks,
core-concepts/vesting, core-concepts/batch, and core-concepts/lifecycle
paths to their new locations under core-concepts/streams/.
Exclude .react-router/ and .source/ from prettier - both are build-time
generated by React Router v7 and Fumadocs and should not be formatted.
Reformat two MDX tables whose columns widened after link path updates.
@Madhan-404 Madhan-404 changed the title Feat/fumadocs & composable APIs Feat/fumadocs May 11, 2026
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.

2 participants