[DRAFT] New docs#1413
Conversation
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Important
Apache-specific affordances — The Link response headers (RFC 8288) and Accept-based markdown content negotiation are implemented in
public/.htaccessusingmod_rewriteandmod_headers. They only take effect on Apache hosts. On GitHub Pages, Cloudflare Pages, Netlify, and any other host that doesn't honor.htaccess, those features silently degrade to the URL-.mdconvention only (no errors, just no Link header and no content negotiation). If we move the docs to a non-Apache host, the same behaviors need to be re-expressed in that host's native format (_headersfile, edge function, etc.).Note
Deploy target is
stellar.github.io/js-stellar-sdk—config/site.tsis the single source of truth:SITE_URL = "https://stellar.github.io",BASE_PATH = "/js-stellar-sdk". All generated artifacts (docs/llms.txt,docs/llms-full.txt,public/robots.txt,public/.htaccess, and the Astro sitemap) reference those values. To retarget to a different host or sub-path, editconfig/site.tsand runpnpm docs.Warning
No auto-deploy workflow —
docs_build.ymlbuilds and diff-checks the docs on every PR but does not push to any host. Whoever owns docs publishing needs to wire up a follow-up workflow (or update an existing one) that uploadsdist/site/after amasterpush. Deferred from this PR by design.Note
Generated artifacts are gitignored —
public/robots.txt,public/llms.txt,public/llms-full.txt, andpublic/.htaccessare produced on every build and not committed. Reviewers should runpnpm docslocally to inspect the deployed output; the source-tree diff alone does not show them.Summary
New Astro/Starlight docs site replacing the legacy JSDoc pipeline: Adds
astro.config.mjs,docs/content collection,src/content.config.ts, and a StarlightPageTitlecomponent override (suppresses a duplicate H1 from frontmatter; preserves the SkipLink target). Retires the oldwebsite/scripts and bundle-publish workflow.TypeDoc-driven reference generator (
build-docs.ts): Parses every exported SDK symbol via TypeDoc, buckets them by source-file path into named groups ("Core / Keys", "Network / Horizon", "SEPs / WebAuth", etc.), and renders one markdown page per bucket with title + description frontmatter. Source links pin to an evergreen ref so generated pages don't churn on every commit.Source-wide TSDoc migration: Every module (
horizon,rpc,webauth,base,stellartoml,contract,utils,index) had its JSDoc-flavored comments converted to TSDoc. Removed@constant,@default,@memberof,@class,@enum,@typedef,@hideconstructor,@static; converted@param {Type} name descto@param name - desc(types come from signatures); replaced@throws {Error}with@throws; wrapped@examplesnippets in fenced code blocks. Comment-only changes — no runtime behavior change.Single-source-of-truth deploy config (
config/site.ts): CentralizesSITE_URL,BASE_PATH,SITE_BASE_URL,AI_POLICY(Cloudflare Content Signals), andALLOWED_AI_BOTS. Consumed byastro.config.mjs,build-robots.ts, andbuild-htaccess.tsso a single edit retargets the entire site to a new host or base path.LLMs bundles + README→index sync (
build-llms.ts): Emitsdocs/llms.txt(compact routing-map index) anddocs/llms-full.txt(full corpus + appendedCHANGELOG.md) with bundle-relative URLs so the bundles resolve correctly on any host or sub-path. Also syncsREADME.md→docs/index.md(frontmatter prepended, title derived from README's H1) so the GitHub README and the docs homepage are one source.Agent-readiness server config (
build-robots.ts+build-htaccess.ts): Generates arobots.txtcarrying explicit per-botAllowrules for major AI crawlers and Cloudflare Content Signals (search,ai-input,ai-train). Generates an Apache.htaccessadvertising the LLMs bundles via RFC 8288Linkresponse headers and implementing Accept-based markdown content negotiation. Files inert on hosts that don't honor.htaccess.Raw markdown siblings (
build-md-siblings.ts): Copies every docs page to aURL.mdsibling in the build output so agents can fetch the raw markdown by appending.mdto any rendered URL. Rewrites relative non-.mdlink targets (drops one leading../) so internal links resolve correctly in both the HTML and raw-.mdURL spaces, regardless of deployment base path.agents.mdpage + sidebar entry: New "AI Agents" docs page describing all three agent-facing surfaces (bundles, raw markdown, crawler policy) and explicitly listing the agent-readiness conventions deliberately not implemented for a JS SDK doc site (RFC 9727 API catalog, MCP server card, OAuth discovery, A2A agent card, commerce protocols).Docs build CI (
docs_build.yml): New PR-time workflow chainingdocs:reference → docs:llms → docs:robots → docs:htaccess → docs:siteand diff-checkingdocs/for drift between generated and committed content. CONTRIBUTING refreshed to point at the new docs guide.