Skip to content

feat: serve Swagger UI at /docs and bump SDK to 0.9 - #2

Merged
SnowboardTechie merged 15 commits into
mainfrom
bryan/hono-sdk-0.8-swagger-ui
Oct 28, 2026
Merged

SnowboardTechie merged 15 commits into
mainfrom
bryan/hono-sdk-0.8-swagger-ui

Conversation

@SnowboardTechie

@SnowboardTechie SnowboardTechie commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Changes proposed

Template users get Swagger UI at /docs, @common-grants/sdk 0.9, and a passing pnpm run audit.

  • Bump @common-grants/sdk to ^0.9.0. SDK 0.9 publishes ESM, so .openapi() now works on SDK schemas. PORTING §6 drops the caveat that said it throws, and the route comment that repeated it. PORTING §6 states the subpath exports as the supported surface, since the SDK has no root entrypoint. The bug-report form's version placeholder follows the bump.
  • Raise the zod floor to ^4.6.6 (resolves to 4.6.7) to clear the high advisory GHSA-mrhx-c7xc-m3w5, which reaches the served API through the SDK and @hono/zod-openapi.
  • Add @hono/swagger-ui 0.6.1 and serve Swagger UI at /docs from /openapi.json, with a test. The startup output lists /docs.
  • README: /docs in Endpoints and Get started, docs UI dropped from Scope, and Maintenance opens with the owner line. CONTRIBUTING and the feature-request template drop the docs UI from their out-of-scope lists.
  • Exempt @common-grants/* from pnpm's release-age hold.
  • Refresh postcss and vite in the lockfile to clear two high advisories in dev tooling only: GHSA-68fv-2mgg-jv7q (source-map-js) and GHSA-587h-7wmj-h5pm (vite).

Context for reviewers

Builds on template b266c8cfa10b35b9a9b47322a46ff93923bc97f8.

Swagger UI loads its assets from jsDelivr by default, floating within swagger-ui-dist 5.x. PORTING §9 notes baseUrl for a mirror and version to pin a release.

The pnpm-workspace.yaml exemption is a first-party name pattern, not a version pin, so SDK releases install the day they ship. Third-party packages keep pnpm's one-day hold.

Verified on Node 24 with pnpm 11.20.0: pnpm install --frozen-lockfile, pnpm run ci (90 tests) and pnpm run audit all pass. Under pnpm run dev, /docs returns 200 and the README's list, search and /openapi.json requests return 200.

Additional information

To try it, run pnpm install and pnpm run dev, then open http://localhost:3000/docs and send a search from Swagger UI.

SDK 0.8.0 removed the package root entrypoint on purpose, so the section
no longer describes a tracked bug.
README gains the /docs endpoint and get-started step, drops the docs UI
from Scope, and opens Maintenance with the owner line. PORTING's
pre-ship checklist notes the Swagger UI CDN default.
CONTRIBUTING and the feature-request template still listed a docs UI as
out of scope, which /docs now contradicts.
pnpm run audit failed on GHSA-68fv-2mgg-jv7q: postcss 8.5.28, pulled in
by Vitest through vite, locked source-map-js 1.2.1. Re-resolving postcss
within vite's range picks 8.5.30 with source-map-js 1.2.2. Lockfile only;
the advisory reaches dev tooling, not the served API.
@SnowboardTechie
SnowboardTechie marked this pull request as ready for review October 19, 2026 17:35
An absolute /openapi.json breaks /docs when the app is mounted under a path
prefix. The test now asserts the relative form.
The endpoint table now points to PORTING section 9 for mirroring or pinning
the assets.
pnpm run audit failed on GHSA-587h-7wmj-h5pm: vite 8.3.0, pulled in by
Vitest, is in the affected range (8.3.0 to 8.3.2). Re-resolving vite within
Vitest's range picks 8.3.4, the newest release past pnpm's release-age
hold, which requires rolldown 1.2.14 and @oxc-project/types 0.154.0.
Lockfile only; the advisory reaches dev tooling, not the served API.
SDK 0.9 publishes ESM, so .openapi() now works on its schemas. Drop the
PORTING caveat and the route comment that said otherwise.

Raise zod to ^4.6.6 to clear GHSA-mrhx-c7xc-m3w5.
@SnowboardTechie SnowboardTechie changed the title feat: serve Swagger UI at /docs and bump SDK to 0.8.0 feat: serve Swagger UI at /docs and bump SDK to 0.9 Oct 26, 2026
@SnowboardTechie
SnowboardTechie merged commit af51a09 into main Oct 28, 2026
1 check passed
@SnowboardTechie
SnowboardTechie deleted the bryan/hono-sdk-0.8-swagger-ui branch October 28, 2026 16:47
SnowboardTechie added a commit to HHS/simpler-grants-protocol that referenced this pull request Oct 28, 2026
…sitory (#1341)

### Summary

- Part of #1184
- Builds on #1345, now merged; rebased onto `main`.
- Depends on common-grants/cg-api-template-hono#2
- Time to review: 10 minutes

### Changes proposed

The TypeScript guide now starts from the [Hono API
template](https://github.com/common-grants/cg-api-template-hono) instead
of `cg init` and the Express template. This PR builds on #1345 and keeps
her page: the SDK module table, the SDK validation example, the plugin
and custom-fields walkthrough, and the overall section order.

On top of #1345, it:

- Replaces the `cg init` setup steps and project tree with the
template's **Use this template** flow, the Node.js 24 prerequisite, and
the template's structure.
- Corrects file paths and the services section for the Hono template:
the repository interface, `src/data/schema.ts`, and ESM import paths.
- Reframes "Add the SDK" as "Upgrading from an earlier SDK". The
template already ships SDK 0.9, so the section keeps the module table
and what 0.9 changes, and drops the pinned TypeSpec installs and the
`tsconfig` step.
- Removes the "Update the spec to v0.5" and "Validate your spec"
sections. The Hono template has no TypeSpec spec.
- Retitles the page "Using TypeScript".
- Drops the TypeScript guide from the `cg init` checklist in
`lib/cli/DEVELOPMENT.md`.

### Context for reviewers

- The #1184 criterion about choosing between Express and Hono no longer
applies, because the Express template is retired:
`common-grants/cg-api-template-express` is archived, and #1186 tracks
removing the monorepo copy (`templates/express-js`).
- The spec check is removed for now because the Hono template fails `cg
check spec`. Restoring it is tracked in #1239.
- The page has no commands for template-independent JavaScript tools, so
the package-manager Tabs criterion does not apply.

Verification: on a fresh clone of the Hono template at 25f20b7 with Node
24 and pnpm 11.20.0, I ran each command on the page plus the README's
curl examples, applied the plugin and custom-field code, and `pnpm run
ci` passed. The upgrade steps (SDK, Zod, then `pnpm dedupe`) took the
template at 0342f2d from SDK 0.8 to 0.9 with `pnpm run ci` and `pnpm run
audit` passing. The website build, lint, format, and spelling checks
pass.

### Additional information

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant