Skip to content

feat(docs-site): add Nextra docs + demo site - #259

Merged
michaeljymsgutierrez merged 266 commits into
mainfrom
feat/nextra-docs-site
Nov 5, 2026
Merged

michaeljymsgutierrez merged 266 commits into
mainfrom
feat/nextra-docs-site

Conversation

@michaeljymsgutierrez

@michaeljymsgutierrez michaeljymsgutierrez commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Description

Replaces the project's old demo app and 1000-line README with a proper documentation + live demo site built on Next.js and Nextra, deployed separately from the library package itself. apps/docs now serves hand-written guides, a 47-page API reference generated straight from the library's own JSDoc comments, and 22 interactive demo pages that exercise the real library against local API routes. The old apps/create-next-app demo is deleted outright, README.md is trimmed down to a short pitch that links out to the new site, and the root DOCS.md (a static JSDoc-to-Markdown dump) is retired entirely now that the live API reference supersedes it. Along the way this also fixes a handful of real bugs found while building the site: four internal methods were missing @private JSDoc tags and showed up as public API, the site's favicon never actually resolved at runtime, and the homepage's status badges were rendering broken.

Github Issue: none - no GitHub issue was filed for this work (confirmed via gh search issues/gh search prs before starting; this is a self-directed docs/site initiative, not tracked work).

Changes

New apps/docs site (Next.js + Nextra)

  • Added a new Next.js/Nextra app at apps/docs serving /docs/* guides, a /docs/api-reference/* reference, and /demo/* live demos.
  • Added 5 hand-written guide pages under apps/docs/content/docs/guides/ (collection-records.mdx, collections.mdx, request-functions.mdx, root-scope.mdx, utility-functions.mdx), plus getting-started.mdx and configuration.mdx.
  • Added apps/docs/scripts/generate-api-reference.mjs, which generates the API reference from the JSDoc on ApiResourceManager via jsdoc-to-markdown, producing 47 .mdx files under apps/docs/content/docs/api-reference/ (45 per-method pages, types.mdx, and index.mdx); private/internal (_-prefixed) methods are excluded by design.
  • Added 22 interactive demo pages under apps/docs/app/demo/**/page.jsx, backed by real Next.js API routes (apps/docs/app/api/v1/{addresses,users}/route.js and [id]/route.js) and fixture data (apps/docs/src/data/{addresses,users}.js).
  • Each guide page links to its matching demo via a "Try it live" link (e.g. apps/docs/content/docs/guides/request-functions.mdx links to /demo/request-functions-from-server/query).
  • Added apps/docs/app/sitemap.js, apps/docs/app/robots.js, and apps/docs/app/llms.txt/route.js.
  • Removed apps/docs/app/demo/page.jsx, the /demo landing/index page - demos are reached only via each guide's "Try it live" link, so /demo itself now has no page and 404s intentionally.

Deleted the old demo app

  • Deleted apps/create-next-app in its entirety (the app apps/docs replaces), including its src/app/demo/** pages, API routes, yarn.lock, and config.

README / CONTRIBUTING

  • Trimmed README.md from ~1000 lines to a short pitch: badges, a "Quick example" snippet, a credits table, and links out to the new docs site, removing the old inline Table of Contents / full API walkthrough.
  • Replaced the externally-hosted logo URL in README.md with the self-hosted ./assets/arm-js-logo.png.
  • Updated CONTRIBUTING.md with instructions for running apps/docs (yarn dev on port 3002), a note that content/docs/api-reference/*.mdx is generated from JSDoc and should never be hand-edited, and dropped the retired DOCS.md rebuild step from the release-pipeline description.

Retired DOCS.md

  • Deleted the root DOCS.md (2258 lines of static JSDoc-to-Markdown output).
  • Removed packages/package.json's build:jsdocs script and jsdoc-to-markdown devDependency (and its jsdoc-to-markdown/**/lodash resolution), and dropped DOCS.md from files.
  • Removed DOCS.md/build:jsdocs from .releaserc.json's prepareCmd and release assets list.
  • Removed the now-dead "Build jsdocs" step (yarn build:jsdocs) from .github/workflows/ci-cd.yml - CI was still calling the removed script directly and failing every run with Command "build:jsdocs" not found. until this was caught and fixed.

JSDoc polish in packages/src/lib/api-resource-manager.js

  • Added the missing @private tag to 4 methods that were wrongly documented as public: _request, _processRequestPayload, _processRequestURL, _processRequestOverride.
  • Fixed _processRequestURL's @param order (was documented as requestOptions, resourceName, resourceId; now matches the real signature resourceName, resourceId, requestOptions).
  • Rewrote roughly 20 private-method docblocks, cutting restated-in-prose descriptions down to one or two sentences of non-obvious behavior.

Logo / favicon / badge fixes

  • Added real logo assets: apps/docs/public/logo-icon.png, apps/docs/public/logo-landscape.png, apps/docs/app/icon.png, and root assets/arm-js-logo.png.
  • Added apps/docs/src/components/arm-logo.jsx (shared ArmLogo component, icon/landscape variants), used in the docs navbar (apps/docs/app/(docs)/layout.jsx, replacing a plain <b>ARM JS Library</b> text logo) and the demo page header (apps/docs/src/components/demo/demo-page.jsx, which had no logo before this branch).
  • Fixed a real bug: apps/docs/app/(docs)/favicon.ico and apps/docs/app/demo/favicon.ico never resolved at runtime - the (docs) route group's [[...mdxPath]] catch-all route intercepted /favicon.ico before Next's special-file convention could serve it. Both were deleted and replaced by a single top-level apps/docs/app/icon.png, generated with a transparent background (the prior icon asset had an opaque black background that showed as a visible box on dark browser tabs).
  • Fixed the homepage status badges in apps/docs/content/index.mdx to lay out the CI/CD, npm version, and license badges in an explicit flex container, avoiding the stacking/wrapping that inline badge images are prone to.

Rebuilt the dist bundle

  • Rebuilt packages/dist/arm-js-library.js (297 lines changed) to bring the committed bundle back in sync with the JSDoc changes in api-resource-manager.js.

Screenshots/Images

image image image image image

How Has This Been Tested?

  • packages test suite: 83/83 passing (yarn test inside packages/), run multiple times this session after the JSDoc and dist changes - always green.
  • packages build: yarn build succeeds and produces dist/arm-js-library.js.
  • apps/docs: yarn lint (eslint) is clean, and yarn build succeeds, producing all static docs/demo pages with no errors - confirmed multiple times across the session.
  • apps/docs dev server was manually smoke-tested: curl checks plus interactive browser automation clicking through the homepage, several demo pages, navigation, the badges, and the logo, confirming they render correctly. This is manual/interactive verification, not an automated test suite.
  • No automated tests were added for apps/docs itself - it's a docs/demo Next.js app with no existing test setup in this repo.

Checklist

  • Code follows the project's coding standards and best practices.
  • Tests are written for new functionality and existing tests pass.
  • Documentation is updated to reflect changes.
  • The PR is assigned to the correct reviewers.

Reviewer Guidance

  1. Open the preview link's root URL. Confirm the homepage renders: the "ARM JS Library" title, three horizontally-arranged badges (CI/CD, npm, license) that sit in a single row (not stacked), the pitch paragraph, an npm install snippet, and three links - "Get started", "API reference", "Guides".
  2. Click "Guides", then open "Request functions from server". Confirm the navbar at the top shows the real ARM logo image (not plain bold text).
  3. On the guide page, find the query() section and click its "Try it live" link. Confirm it navigates to /demo/request-functions-from-server/query and the page shows a table of addresses loaded from the local API route (not an error or blank state).
  4. Navigate, via its own guide's "Try it live" link (under Collection Records -> Request and Retrieve Functions -> save), to /demo/collection-records/request-retrieve-functions/save. Edit the address field and click "Save". Confirm it round-trips: the button shows a "Saving" busy state, then returns to normal with no error, confirming the save() call actually hit the local PUT /api/v1/addresses/:id route.
  5. Go to /docs/api-reference. Open a couple of method pages (e.g. findRecord, pushPayload). Confirm each shows a signature, parameter table, and example - and that no page exposes an internal (_-prefixed) method.
  6. Manually navigate to /demo directly (not through a guide link). Confirm it 404s - this is intentional, there is no /demo landing page in this PR.
  7. Open the michaeljymsgutierrez/arm-js-library repo on GitHub, on this branch, and confirm README.md renders correctly: the logo image loads (served from ./assets/arm-js-logo.png, not a broken external link), the badges and the "Quick example" code block render, and the credits table displays properly.
  8. Check the browser tab favicon on the docs site and on a demo page - both should show the new ARM icon with no black box background, especially visible in dark-mode tabs.

Add a bold npm text icon for the navbar's npm chatLink, since the official
npm wordmark reads thinner than the other solid-silhouette navbar icons.
… nav

The generated API reference sidebar already lists every method, making
this hand-maintained index page duplicate upkeep.
Pad the icon-only logo to a square canvas with a transparent background and
downscale to 64x64, replacing the old asset that had an opaque black
background baked in and showed as a visible box on dark browser tabs.
This file never actually resolved - the (docs) route group's catch-all
[[...mdxPath]] route intercepted /favicon.ico before Next's special-file
convention could serve it. Replaced by the top-level app/icon.png instead.
@michaeljymsgutierrez michaeljymsgutierrez self-assigned this Nov 5, 2026
@michaeljymsgutierrez
michaeljymsgutierrez marked this pull request as ready for review November 5, 2026 17:28
@michaeljymsgutierrez
michaeljymsgutierrez merged commit 7dd99f4 into main Nov 5, 2026
3 checks passed
@michaeljymsgutierrez
michaeljymsgutierrez deleted the feat/nextra-docs-site branch November 5, 2026 17:29
@michaeljymsgutierrez

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 2.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant