Repository navigation
feat: serve Swagger UI at /docs and bump SDK to 0.9 - #2
Merged
Merged
Conversation
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
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
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.
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.
Summary
Changes proposed
Template users get Swagger UI at
/docs,@common-grants/sdk0.9, and a passingpnpm run audit.@common-grants/sdkto^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.zodfloor 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.@hono/swagger-ui0.6.1 and serve Swagger UI at/docsfrom/openapi.json, with a test. The startup output lists/docs./docsin 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.@common-grants/*from pnpm's release-age hold.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
baseUrlfor a mirror andversionto pin a release.The
pnpm-workspace.yamlexemption 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) andpnpm run auditall pass. Underpnpm run dev,/docsreturns 200 and the README's list, search and/openapi.jsonrequests return 200.Additional information
To try it, run
pnpm installandpnpm run dev, then open http://localhost:3000/docs and send a search from Swagger UI.