Docs: JavaScript SDK onboarding, starter workflow, and generated API sync#147
Docs: JavaScript SDK onboarding, starter workflow, and generated API sync#147
Conversation
Deploying qf-api-docs with
|
| Latest commit: |
bcdd02a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://58788b62.qf-api-docs.pages.dev |
| Branch Preview URL: | https://sdk-updates.qf-api-docs.pages.dev |
There was a problem hiding this comment.
Pull request overview
This PR updates the public documentation site to match the new JavaScript SDK runtime split (@quranjs/api/server vs @quranjs/api/public), adds an NPX-based starter onboarding path, and syncs generated/derived docs outputs and supporting build/test tooling.
Changes:
- Adds/updates JS SDK docs for the new runtime entrypoints, including new “matrix/quickstart” pages and updated endpoint pages.
- Adds an
npx @quranjs/create-app@latest ...starter tutorial and enforces onboarding consistency via new node:test checks. - Updates
llms.txtgeneration ordering/URL normalization and adds TS declaration shims for OpenAPI theme modules used by the custom API demo panel.
Reviewed changes
Copilot reviewed 27 out of 29 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/tutorials-onboarding-docs.test.cjs | Adds tests enforcing the public NPX scaffold command + canonical prompt marker + no local-only patterns on key onboarding pages. |
| tests/sdk-docs-config.test.cjs | Adds tests asserting new JS SDK docs are present in shared sidebars and excluded from llms output where appropriate. |
| src/theme/openapi-theme.d.ts | Adds TS module declarations for theme modules used by custom OpenAPI demo panel overrides. |
| sidebars.js | Adds the new JS SDK doc IDs into the shared “SDKs → JS/TS” sidebar items. |
| plugins/llms-txt-plugin.js | Reorders sections, normalizes slug-to-URL behavior, and prioritizes key JS SDK/onboarding pages in llms output. |
| docs/tutorials/oidc/user-apis-quickstart.mdx | Adds a pointer to the recommended JS SDK runtime split and the NPX starter tutorial. |
| docs/tutorials/oidc/starter-with-npx.mdx | Adds a new public onboarding tutorial for scaffolding via npx @quranjs/create-app@latest. |
| docs/tutorials/oidc/getting-started-with-oauth2.mdx | Adds the “Fastest Way To Start” scaffold section + canonical prompt marker. |
| docs/tutorials/oidc/example-integration.mdx | Adds a scaffold-first note before the standalone OAuth2 example. |
| docs/tutorials/oidc/client-setup.mdx | Rewrites/condenses OAuth2 client setup guidance and frontmatter metadata. |
| docs/sdk/javascript/index.mdx | Rewrites the SDK landing page around runtime entrypoints, scaffold onboarding, and AI handoff prompt. |
| docs/sdk/javascript/app-shapes.mdx | Adds an “app shapes” decision guide mapping app type → runtime → API families. |
| docs/sdk/javascript/runtime-matrix.mdx | Adds a runtime capabilities matrix for server vs public usage. |
| docs/sdk/javascript/auth-matrix.mdx | Adds a concise matrix explaining confidential vs public vs proxy client patterns. |
| docs/sdk/javascript/entrypoint-matrix.mdx | Adds a quick reference mapping import path → intended use. |
| docs/sdk/javascript/apis-by-runtime.mdx | Adds a matrix mapping API families to supported runtimes. |
| docs/sdk/javascript/server-quickstart.mdx | Adds a backend-focused SDK quickstart page. |
| docs/sdk/javascript/public-quickstart.mdx | Adds a frontend/mobile focused quickstart page for the public entrypoint. |
| docs/sdk/javascript/full-stack.mdx | Adds a recommended full-stack (public+server) architecture quickstart. |
| docs/sdk/javascript/common-errors.mdx | Adds a common errors table tailored to the runtime split. |
| docs/sdk/javascript/migration-cheat-sheet.mdx | Adds a compact migration cheat sheet from legacy client usage to entrypoints. |
| docs/sdk/javascript/v1-migration-guide.mdx | Replaces the legacy migration guide content with a brief pointer to new entrypoints. |
| docs/sdk/javascript/chapters.mdx | Updates Chapters docs to the new client.content.v4.* server usage pattern. |
| docs/sdk/javascript/verses.mdx | Updates Verses docs to the new server client usage pattern. |
| docs/sdk/javascript/audio.mdx | Updates Audio docs to the new server client usage pattern. |
| docs/sdk/javascript/resources.mdx | Updates Resources docs to the new server client usage pattern. |
| docs/sdk/javascript/juzs.mdx | Updates Juzs docs to the new server client usage pattern. |
| docs/sdk/javascript/search.mdx | Updates Search docs to the new client.search.v1.query server usage pattern. |
| .gitignore | Ignores .claude/ worktree noise. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 29 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Ported the remaining word-by-word audio clarification from superseded #123 / quran/api-js#48 into this PR. The docs now explain that word.audioUrl is a relative wbw asset path resolved against https://audio.qurancdn.com/, and is distinct from chapter or ayah recitation audio. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 47 out of 49 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 49 out of 51 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (4)
src/components/AgentPromptCallout/index.tsx:1
- The prompt content is hardcoded here but also exists as a canonical public artifact in
static/agent-prompts/qf-next-starter.md(and is referenced fromstatic/.well-known/agent-prompts/index.json). Maintaining multiple sources of truth increases drift risk (formatting, wording, even the presence of the prompt ID header). Consider making the “Copy prompt” payload derive from the canonical prompt artifact (e.g., fetch/agent-prompts/qf-next-starter.mdat click time, or generate both the static file and this in-code constant from a single build-time source) so the copied text always matches the published prompt verbatim.
src/pages/index.tsx:1 - This clipboard helper is duplicated (a nearly identical
copyTextexists insrc/components/AgentPromptCallout/index.tsx). Duplication makes it easy for fallback behavior, error handling, or future browser compatibility tweaks to diverge between “copy command” and “copy prompt”. Consider extracting a shared utility/hook (e.g.,copyToClipboard(text)) and reusing it in both places.
sidebars.js:1 - The sidebar ordering places
migration-cheat-sheetbeforev1-migration-guide, but the docs front matter setsv1-migration-guidetosidebar_position: 14andmigration-cheat-sheettosidebar_position: 16, implying the opposite order. Since this sidebar is explicitly ordered, thesidebar_positionvalues become misleading metadata for future maintainers. Consider either adjusting the explicit sidebar order to match the declared positions or removing/aligning thesidebar_positionfields for these pages to avoid contradictory sources of ordering truth.
tests/prelive-docs-config.test.cjs:1 urls.filter(... urls.indexOf(...) ...)is O(n²) andllms.txtcan grow to hundreds/thousands of links as docs expand. Using aSetto detect duplicates in a single pass keeps this test linear and avoids slowing CI as the docs corpus grows.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 50 out of 52 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
This PR updates the public API docs for the coordinated JavaScript SDK, starter kit, and create-app rollout.
The docs now present the runtime-specific SDK entrypoints as the recommended path for new code:
@quranjs/api/serverfor backend, serverless, worker, Content, Search, and confidential OAuth2 flows.@quranjs/api/publicfor browser/mobile PKCE and frontend user-session flows.The SDK remains backwards-compatible: existing
import { QuranClient } from "@quranjs/api"integrations are still supported. The migration docs now describe the split entrypoints as recommended cleanup, not a breaking upgrade requirement.What Changed
word.audioUrlis a relative word-by-word asset path resolved againsthttps://audio.qurancdn.com/, not a Content API endpoint.QuranClientcompatibility across the SDK index, entrypoint matrix, and migration guides.npx @quranjs/create-app@latest ...starter path on onboarding pages.node --test tests.ApiDemoPanelcurl sample override.yarn buildwas recreating, eliminating generated-doc drift.postbuild:seoand generated API alias cleanup..claude/worktree noise so local tooling does not pollute repo status.Coordinated PRs
Required Merge Order
Validation
Previously run locally on Windows/PowerShell:
yarn testyarn typecheckyarn buildyarn re-gen && npx docusaurus build && yarn postbuild:seoFor the latest docs-only compatibility clarification, no full rebuild was rerun. The targeted checks were:
git diff --check -- docs/sdk/javascript/index.mdx docs/sdk/javascript/entrypoint-matrix.mdx docs/sdk/javascript/migration-cheat-sheet.mdx docs/sdk/javascript/v1-migration-guide.mdxdocs/sdk/javascript/*.mdxCross-Repo Validation
Manually validated that the documented SDK, starter kit, and create-app flow works together in a generated Next.js app using pre-live credentials.
npm run smoke:configandnpm run smoke:routes.16 passed.Reviewer Notes
@quranjs/create-app@latest, so the create-app package should be publish-ready before these docs are promoted.Linked Issues
Closes quran/api-js#47.