Skip to content

docs(website): start the TypeScript guide from the Hono template repository - #1341

Merged
SnowboardTechie merged 8 commits into
mainfrom
bryan/1184-using-typescript-guide
Oct 28, 2026
Merged

SnowboardTechie merged 8 commits into
mainfrom
bryan/1184-using-typescript-guide

Conversation

@SnowboardTechie

@SnowboardTechie SnowboardTechie commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Changes proposed

The TypeScript guide now starts from the Hono API template 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

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.

@github-actions github-actions Bot added website Issues related to the website typescript Issue or PR related to TypeScript tooling labels Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Website Preview Deployed!

Preview your changes at: https://pr-1341-common-grants.agile6.workers.dev

Built from commit cadb2df

@github-actions github-actions Bot added the cli Issue or PR related to the @common-grants/cli library label Oct 22, 2026
@SnowboardTechie
SnowboardTechie force-pushed the bryan/1184-using-typescript-guide branch from 5c9c7a5 to 001bb3e Compare October 26, 2026 18:27
@SnowboardTechie
SnowboardTechie changed the base branch from main to karina/1311-update-TS-guide October 26, 2026 18:27
@SnowboardTechie
SnowboardTechie marked this pull request as ready for review October 26, 2026 19:07
@SnowboardTechie SnowboardTechie linked an issue Oct 26, 2026 that may be closed by this pull request
5 of 6 tasks
Base automatically changed from karina/1311-update-TS-guide to main October 27, 2026 16:21
…list

The TypeScript guide starts from the Hono template repository and no longer runs cg init.
…sitory

Replace the cg init and Express setup steps and project tree with the Hono template's Use this template flow, Node.js 24 prerequisite, and structure.
…ript guide

The Hono template has no TypeSpec spec and currently fails cg check spec. Restoring the check is tracked in #1239.
…the Hono template

Point the schema, services, and plugin examples at the Hono template's files: the repository interface, src/data/schema.ts, and ESM import paths.
The Hono template already ships SDK 0.9. Keep the module table and the 0.9 changes, and drop the pinned TypeSpec installs and tsconfig step that only applied to cg init projects.
Upgrade zod alongside the SDK and dedupe so the SDK no longer keeps
zod 4.6.5 (GHSA-mrhx-c7xc-m3w5). List .nvmrc and PORTING.md in the
template tree and drop the orphaned TypeSpec link.

@karinamzalez karinamzalez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved! Good to merge once common-grants/cg-api-template-hono#2 · feat: serve Swagger UI at /docs… merges since template main doesn’t serve /docs yet and is still on SDK ^0.7.2.

Quick question! Template main is still on SDK ^0.7.2, and the description tests the upgrade from 0.8. Does this command also work for projects starting from 0.7, or do you know if 0.7 -> 0.9 needs extra steps?

@SnowboardTechie
SnowboardTechie force-pushed the bryan/1184-using-typescript-guide branch from d55e013 to 518dfb8 Compare October 27, 2026 17:35
@SnowboardTechie

Copy link
Copy Markdown
Collaborator Author

Thanks for the review! Yeah, it works from 0.7 too. The only breaking change in 0.8 was removing the package root entrypoint, and the guide already says to import from the subpaths. Template main only imports from @common-grants/sdk/schemas, so nothing changes there. 0.7 was already on Zod 4, so the Zod bump is the same either way. I ran the same steps on template main at 0.7.2 (add SDK 0.9 + Zod, pnpm dedupe, pnpm run ci) and everything passed. pnpm run audit still fails on the vite/postcss advisories, but main fails the same way before the upgrade, and common-grants/cg-api-template-hono#2 clears those.

SnowboardTechie added a commit to common-grants/cg-api-template-hono that referenced this pull request Oct 28, 2026
### Summary

- Supports HHS/simpler-grants-protocol#1184: the TypeScript guide in
HHS/simpler-grants-protocol#1341 starts from this template.
- Time to review: 10 minutes

### 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](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](GHSA-68fv-2mgg-jv7q)
(source-map-js) and
[GHSA-587h-7wmj-h5pm](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.
# Conflicts:
#	lib/cli/DEVELOPMENT.md
@SnowboardTechie
SnowboardTechie merged commit c184eaa into main Oct 28, 2026
7 checks passed
@SnowboardTechie
SnowboardTechie deleted the bryan/1184-using-typescript-guide branch October 28, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Issue or PR related to the @common-grants/cli library typescript Issue or PR related to TypeScript tooling website Issues related to the website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Website] Repoint the TypeScript and Python guides to the template repositories

2 participants