Skip to content

Conversation

PaulRBerg
Copy link
Member

@PaulRBerg PaulRBerg commented Apr 22, 2025

Explainer

This PR significantly reduces the maintenance cost of the documentation site by auto-generating:

In addition, this PR has also made a few other improvements, such as integrating BiomeJS and polishing the ESLint config (using ESLint v9 now).

Issues Closed

@PaulRBerg
Copy link
Member Author

The PR is now ready for your review @sablier-labs/evm

@smol-ninja
Copy link
Member

smol-ninja commented Apr 30, 2025

bun run check is going crazy.

Click to view recording
Screen.Recording.2025-04-30.at.11.26.41.mov

Copy link
Member

@smol-ninja smol-ninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Phenomenal work @PaulRBerg.

9sfljx

@PaulRBerg
Copy link
Member Author

Received a question from a user (SYNTHR) for which the docs in this PR would have been helpful:

SCR-20250625-tdkm

Specifically, the new section about "Choosing Your Approach":

SCR-20250625-tduz

@razgraf
Copy link
Member

razgraf commented Jul 15, 2025

This new version auto-generates queries in the API section.

The idea behind the Queries page under Indexers was to provide popular queries stemming from user requests over time. It was a good place to point to for copy-paste examples.

As a general feedback for these auto-generate queries and descriptions: since they can already be found in the indexer's page, in the schema, in the Hasura (or similar explorer) section describing the endpoint, I don't see a point in duplicating them yet again in our docs. They don't provide extra value and they increase maintanance cost since we'll have to remember re-generating if/when we update our endpoints.

I'd propose replacing them with the old custom queries and maybe adding a note about being able to find all filters and field descriptions using Hasura, if there's no human input necessary.

@PaulRBerg
Copy link
Member Author

PaulRBerg commented Jul 15, 2025

We can add some default queries, too. But let's please do that after we merge the PR because it's been open for a long time. And let's only add a handful - getting some streams and some campaigns, and that's it.

Also, the Indexers repo provides some default queries now (though they use the $where argument):

https://github.com/sablier-labs/indexers/blob/2e6ed1df82002c1c7141e6eae9e33dbb6c53c363/src/exports/queries/common/streams/graph.ts

I don't see a point in duplicating them yet again in our docs

  • It's a much better UX to have the GraphQL docs in the same site where all other Sablier docs are located.
  • Readers of the website may be too lazy to open Hasura, or may not like the context-switch.
  • Keeping the docs on this site would also make them LLM friendly, and it would enable the Chef AI to provide better answers.

they increase maintanance cost since we'll have to remember re-generating if/when we update our endpoints.

The maintenance cost is super low now, because everything is automated. Bumping the @sablier/indexers package will auto-update the docs.

@razgraf
Copy link
Member

razgraf commented Jul 15, 2025

And let's only add a handful

The current docs contain the most requested ones e.g. streams from a campaign, campaigns with an asset, recipients who claimed etc. They can be probably be copy-pasted.

@PaulRBerg
Copy link
Member Author

PaulRBerg commented Aug 21, 2025

TODOs left here:

… upgrade

This major refactor modernizes the entire documentation infrastructure and API reference system:

**Toolchain Modernization:**
- Migrate from ESLint/Prettier YAML configs to Biome for faster, unified formatting and linting
- Replace package.json scripts with Just CLI for improved task automation
- Add comprehensive autogeneration CLI tools for GraphQL schema documentation
- Implement structured config organization (plugins, presets, redirects, sidebars, theme-config)
- Upgrade to deployments package for better contract management

**API Documentation Restructure:**
- Complete overhaul of API documentation structure with new identifier system
- Add comprehensive GraphQL schema documentation for both Envio and The Graph indexers
- Generate 500+ auto-generated GraphQL type, query, input, and enum documentation files
- Restructure airdrops and flow API sections with consistent categorization
- Implement unified indexer documentation patterns across all API endpoints
- Add getting started guides and overview sections for better developer onboarding

**Infrastructure Improvements:**
- Modernize GitHub Actions with new CD pipeline and workflow optimization
- Update VS Code settings and extensions for better developer experience
- Implement lint-staged configuration for automated code quality checks
- Add comprehensive redirects management for backward compatibility
- Organize Docusaurus configuration into modular, maintainable files

**Developer Experience:**
- Add autogeneration scripts for maintaining up-to-date API documentation
- Implement consistent file naming and organization patterns
- Provide clear migration paths from legacy endpoints to new indexer systems
- Establish foundation for automated documentation maintenance workflows

This refactor positions the documentation system for scalable maintenance while providing comprehensive, auto-generated API references that stay synchronized with the underlying GraphQL schemas.

Co-Authored-By: smol-ninja <[email protected]>
@razgraf
Copy link
Member

razgraf commented Aug 23, 2025

Reply for #349 (comment)

LGTM. I think we can merge. We don't mention anywhere that the schema (and ids) has undergone changes in August 2025, should we add that somewhere?

@PaulRBerg
Copy link
Member Author

I don't think it would be worth mentioning that here in the docs as per the explanation given here.

There are other priorities at Sablier.

@PaulRBerg PaulRBerg merged commit 1ad3ed1 into main Aug 25, 2025
1 check passed
@PaulRBerg PaulRBerg deleted the refactor/deployments-package branch August 25, 2025 10:11
@PaulRBerg PaulRBerg mentioned this pull request Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment