Skip to content

@inkform/astro, and @inkform/framework 0.8.0 - #28

Merged
CharanMN7 merged 7 commits into
mainfrom
feat/astro-integration
Oct 22, 2026
Merged

CharanMN7 merged 7 commits into
mainfrom
feat/astro-integration

Conversation

@CharanMN7

Copy link
Copy Markdown
Contributor

Adds @inkform/astro, an Astro 7 integration that serves an Inkform content folder from any Astro site. It also prepares @inkform/framework 0.8.0, which the integration needs.

@inkform/astro (new, 0.1.0)

  • One prerendered <base>/[...slug] route covering:
    • docs.json pages;
    • the native API Reference, with a page per operation;
    • blog and changelog;
    • llms.txt and llms-full.txt.
  • Pagefind search runs at build end.
  • MDX goes through the framework's own pipeline and kit, rendered with react-dom/static at build time, so the markup matches the Next.js themes.
  • Browser behaviour is small TypeScript modules, with no React shipped to docs pages.
  • CSP-safe: Shiki and kit styles move into one hashed <style> per page.
  • Tested on Astro's base, trailingSlash and static/server output, and with a packed tarball installed outside the monorepo.
  • examples/astro-docs: 34 Playwright tests, covering every route with no CSP violation, every kit component, search, Try It, and no React on docs pages.

@inkform/framework 0.8.0 (additive)

  • New exports:
    • ./mdx-options and compileMdx();
    • ./routes: apiTab, apiTabSlug, docRouteSlugs, joinHref;
    • ./slug;
    • ./mermaid/render, ./openapi-render/try-it, ./openapi-render/sample.
  • buildLlmsTxt({ basePath }).
  • next is now an optional peer.
  • Every 0.7.0 export is still present.

Security

Templates and examples move to Next.js 16.4.2:

DOMPurify and ip-address are fixed in the lockfile, and npm audit --audit-level=high is clean again (it was failing on main).

Checks (local, same steps as CI)

  • npm run lint, npm run typecheck: clean.
  • npm test: framework 124 tests, astro 54 tests.
  • npm run build: all workspaces build (Next themes, examples, Astro example).
  • npm run test:e2e --workspace=@inkform/example-astro-docs: 34 pass.
  • npm audit --audit-level=high: 0 vulnerabilities.

Release after merge

  • Tag framework-v0.8.0 to publish the framework through release.yml (it waits for the npm-publish approval).
  • @inkform/astro is a new package, so it needs one first publish to npm before trusted publishing can be configured for it. Then tag astro-v0.1.0 (or later versions).

🤖 Generated with Claude Code

CharanMN7 and others added 6 commits October 23, 2026 02:28
…-Next hosts

Additive pieces the Astro integration builds on; the Next.js APIs and their
output are unchanged.

- ./mdx-options: the remark/rehype plugin lists and next-mdx-remote options
  <Mdx> renders with (it now reads them from here), plus compileMdx() for
  hosts that render MDX to a React element themselves. compileMdx resolves
  every capitalized component the source uses through the map, so the
  mdxComponents() fallback renders unknown components: compiled MDX copies
  `components` with an object spread, which can't see a Proxy's fallback.
- ./routes: apiTab, apiTabSlug, docRouteSlugs, joinHref. Pure, no IO.
  slugify moves to a pure ./slug module; ./content re-exports it.
- buildLlmsTxt({ basePath }) prefixes doc, blog and changelog links for docs
  served under a path. Defaults to '', so existing output is the same.
- Subpath exports for browser code outside React: ./mermaid/render,
  ./openapi-render/try-it, ./openapi-render/sample.
- next is an optional peer dependency: nothing in src imports it, and npm
  no longer installs Next.js into a site that doesn't use it.

Tests: routes, compileMdx (pipeline, kit, fallback), llms.txt basePath.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyuLZBytD3smoMaGTbXTYZ
…ontent

inkform({ base, contentRoot, theme, ... }) serves a content folder from any
Astro site under one base path (default /docs), with prerendered routes
that work in an output: 'server' app:

- docs pages from docs.json + MDX, the native API Reference (index and a
  page per operation), blog and changelog when their folders have entries,
  and llms.txt / llms-full.txt, all from one injected [...slug] route whose
  getStaticPaths reads the content. Two sources claiming one URL fail the
  build with both names.
- MDX goes through the framework's pipeline (compileMdx) with every kit
  component available without imports, and operation pages are the
  framework's OperationPage; React renders both to static HTML at build
  time. The shell (header, tabs, sidebar, TOC, breadcrumbs, pagination,
  drawer) is Astro components with the framework's fw-* markup.
- In the browser, small modules and no React: tabs, code groups, TOC
  highlight, drawer, theme toggle, search dialog, API sample pickers, Try It
  (the framework's request executor), newsletter form, and Mermaid diagrams
  when the mermaid option is on.
- Pagefind indexes the built docs pages in astro:build:done, into
  <base>/_pagefind/. The index comes from getFiles(): writeFiles() returned
  before its files were written in about one run in four, leaving an empty
  pagefind.js.
- Works under security.csp: Shiki's inline style attributes move into one
  <style> per page, whose hash is registered with Astro.csp along with the
  theme script's; search pages add 'wasm-unsafe-eval' and diagram pages
  inline styles, on their own policy only.
- Themes are --fw-* token files: galley (default, ported from
  templates/galley), plain, or your own; customCss for more. publicBase for
  hosts that serve the docs from another path or host. Site-root links to
  docs pages get the base added, so Next.js-theme content works as is.

examples/astro-docs is a host app (output: 'server', Node adapter, a React
island on its own home page, CSP on) with every component on one page and a
Playwright suite: 34 tests over pages, CSP, kit behaviour, search, Try It
and the absence of React on docs pages.

Root: the vite ^7.3.7 override now applies to vitest only, since Astro 7
needs Vite 8; npm test also runs the integration's unit tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyuLZBytD3smoMaGTbXTYZ
- README, CONTRIBUTING: the new package and example; npm test covers both
  packages.
- CHANGELOG [Unreleased]: the framework additions and the new package.
- PUBLISHING and release.yml: an astro-v* tag publishes packages/astro,
  after the framework release it depends on.
- ci.yml: an astro-e2e job runs the example's Playwright suite. It builds
  and serves the example itself and blocks every outside request.
- The Claude Code skill points Astro sites at @inkform/astro.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyuLZBytD3smoMaGTbXTYZ
mermaid is only resolved when the `mermaid` option is on, so it's an
optional peer, as in @inkform/framework.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyuLZBytD3smoMaGTbXTYZ
Templates and examples move from Next.js 16.3.8 to 16.4.2 for the critical
advisories in 16.0.0-16.4.0 (remote code execution in image optimization
with SVGs and in 'use cache' functions; a Server Actions DoS). npm audit fix
updates DOMPurify and ip-address in the lockfile. npm audit --audit-level=high
is clean; lint, typecheck, unit tests, every build and the Astro e2e pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WCbnXZc9E5T8kYNNv2JekV
Bumps packages/framework to 0.8.0 and dates the CHANGELOG entry: the new
./mdx-options, ./routes, ./slug, ./mermaid/render, ./openapi-render/try-it
and ./openapi-render/sample exports, buildLlmsTxt({ basePath }), next as an
optional peer, and the Next.js 16.4.2 / audit fixes. Every 0.7.0 export is
still present.

Templates, examples and @inkform/astro move to "@inkform/framework": "^0.8.0"
in the same commit (for a 0.x package ^0.7.0 stops below 0.8.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WCbnXZc9E5T8kYNNv2JekV
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
framework-inkform-docs Ready Ready Preview Oct 22, 2026 11:24pm UTC
pokeapi Ready Ready Preview Oct 22, 2026 11:24pm UTC

Request Review

Astro 7 needs Node >= 22.23.4 and the runners' Node 22 is 22.23.3, so
astro check failed in ci and would fail in release. Node 24 is what the
branch was verified on locally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WCbnXZc9E5T8kYNNv2JekV

This branch was successfully deployed

2 active deployments
Preview – pokeapi — 226b02e8 Deployed Oct 22, 2026 by vercel[bot]
Preview – framework-inkform-docs — 226b02e8 Deployed Oct 22, 2026 by vercel[bot]
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