fix(developer-hub): remove price feeds from docs search index#3816
Open
aditya520 wants to merge 2 commits into
Open
fix(developer-hub): remove price feeds from docs search index#3816aditya520 wants to merge 2 commits into
aditya520 wants to merge 2 commits into
Conversation
The global search index was fetching ~9,262 price feeds from Hermes mainnet + Hermes beta + Lazer on every cold start, expanding to ~36k Orama records — ~95% of the index by volume. The dedicated price-feed pages already have their own in-page SearchInput, so the global hits just funneled users to those same pages via ?search= query params. Drop the Hermes/Lazer fetches and helpers entirely so the search index contains only MDX pages.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
The build task in apps/developer-hub/turbo.json inherited outputs of ".next/**" only from the root turbo.json, but `next build` (via the fumadocs-mdx createMDX wrapper) also generates `.source/server.ts` and related files that downstream tasks (`test:types`, `test:lint`) import through `src/lib/source.ts`. When CI restored a cached `build` artifact, only `.next/**` was rehydrated and the `.source/` directory was missing, so `tsc` failed with "Cannot find module '../../.source/server'" and the cascading "Property 'body' / 'toc' / 'full' / 'structuredData' does not exist on type 'PageData'" errors. Adding `.source/**` to the build outputs ensures the fumadocs-generated source files are restored alongside `.next/`.
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.
Parent issue: [[i-wjchrnyb]]
Summary
apps/developer-hub/src/app/api/search/route.tswas fetching ~9,262 price feeds from Hermes mainnet + Hermes beta + Lazer on every cold start and expanding them to ~36k Orama records — ~95% of the global search index. The dedicated/price-feeds/core/price-feeds/price-feed-idsand/price-feeds/pro/price-feed-idspages already have their own in-pageSearchInput(match-sorterover the same Hermes/Lazer data), and the global search entries just funneled users to those pages via?search=query params — pure redundancy. Theprice-feed-core/price-feed-protags were consumed nowhere.Changes
1.
apps/developer-hub/src/app/api/search/route.ts(primary, scoped change)getHermesFeeds(),getLazerFeeds(),toAdvancedIndex(),hermesSchema,lazerSchema.indexescallback now returns only the MDX pages fromsource.getPages().zfromzod,SYMBOLS_API_URLfrom../../../config/pyth-pro-public.AdvancedIndextype import for the static-pages cast (matches what was there before).SYMBOLS_API_URLitself is intentionally left insrc/config/pyth-pro-public.tsper the issue's out-of-scope list.PriceFeedIdsCoreTable/PriceFeedIdsProTableuntouched — they retain their in-page search and Hermes/Lazer fetches.2.
apps/developer-hub/turbo.json(rework: CI fix)Override the inherited
buildoutputsto add.source/**alongside.next/**.next build(via thefumadocs-mdxcreateMDXwrapper innext.config.js) generatesapps/developer-hub/.source/server.tsetc., whichsrc/lib/source.tsimports. The previous outputs only listed.next/**(inherited from rootturbo.json), so when CI's turbo cache restored a priordeveloper-hub#buildartifact,.source/was missing —test:typesthen rantscand failed withCannot find module '../../.source/server'plus the cascade ofProperty 'body' / 'toc' / 'full' / 'structuredData' does not exist on type 'PageData'errors that prompted the rework (see the prior run https://github.com/pyth-network/pyth-crosschain/actions/runs/27693529743/job/81910556027). Reproduced locally by deletingapps/developer-hub/.sourceafter a build and re-runningpnpm exec tsc: same errors. With.source/**in outputs, turbo now restores it from cache alongside.next/**, so dependent type-check / lint tasks resolve the generated module reliably.(The inherited
lib/**/dist/**entries were dropped from the override because developer-hub is a Next.js app and never produces those.)Verification
grep -rn "price-feed-core\|price-feed-pro" apps/developer-hub/src→ no matches.pnpm turbo run test:types --filter=@pythnetwork/developer-hub→ passes (fresh cache).apps/developer-hub/.nextand.source, re-ranpnpm turbo run test:types --filter=@pythnetwork/developer-hubwith a populated turbo cache → cache-hit onbuild,.source/restored from cache,test:typespasses.pnpm turbo run test:lint --filter=@pythnetwork/developer-hub→ passes.git merge-tree origin/main HEAD→ clean (no conflicts).Manual dev-server check could not be performed in this environment (no browser). Vercel's preview deployment for developer-hub succeeded on the prior commit, exercising the production build.