Skip to content

refactor(api): productize public API surface to 18 flat export paths - #264

Merged
kojiwakayama merged 3 commits into
mainfrom
refactor-api
Feb 7, 2026
Merged

kojiwakayama merged 3 commits into
mainfrom
refactor-api

Conversation

@kojiwakayama

Copy link
Copy Markdown
Contributor

Summary

  • 62 → 18 export paths — every npm-visible export is now justified as user-facing
  • 4 new barrels — veryfront/chat, veryfront/markdown, veryfront/mdx, veryfront/fs
  • All star-exports replaced with selective re-exports across 15 barrel files
  • CLI-only paths moved from exports to imports (invisible to npm, dnt resolves at build)
  • 29 type errors fixed in newly typechecked entrypoints (pre-existing bugs surfaced by adding entrypoints to typecheck)
  • docs/api.md — full public API documentation for all 18 paths

The 18 Paths

Path Purpose
veryfront App primitives: config, server, routing, data, validation
veryfront/head <Head> component
veryfront/router Client-side routing + <Link>
veryfront/context Page context + frontmatter
veryfront/fonts Google Fonts loader
veryfront/chat Chat UI components + hooks (useChat, useAgent, etc.)
veryfront/markdown Runtime markdown rendering (AI content)
veryfront/mdx MDXProvider + useMDXComponents (page customization)
veryfront/agent Agent factory, runtime, memory, composition
veryfront/tool Tool definitions for agents
veryfront/workflow Durable DAG workflows, DSL, backends, React hooks
veryfront/prompt Prompt templates
veryfront/resource Data resources for MCP
veryfront/mcp MCP server
veryfront/middleware HTTP middleware (cors, rateLimit, logger, timeout)
veryfront/oauth OAuth 2.0 with 37 providers
veryfront/provider AI provider abstraction
veryfront/fs Filesystem + path utilities

Key Changes

  • Root barrel slimmed to server core + config + routing + data + validation
  • Workflow barrel slimmed from ~40 internal exports to DSL + types + backends + client + hooks
  • Agent barrel added AgentMessage alias (Message deprecated), kept composition utils
  • Chat barrel merges UI components (from react/components/ai) + hooks (from agent/react)
  • Templates and examples updated to use new import paths
  • Browser import maps updated for all CDN providers + self-hosted

Test plan

  • deno task typecheck — 0 errors across 36 entrypoints
  • deno task lint — clean
  • deno task test — 1078 passed, 0 failed
  • All public entrypoints individually typechecked (deno check src/{chat,markdown,mdx,fs,oauth,agent,tool,workflow,prompt,resource,mcp,provider,middleware}/index.ts)

Reduce npm-visible exports from 62 paths to 18 product-oriented paths.
Every export is now justified as user-facing; internal infrastructure
is invisible to npm consumers.

New barrels: chat, markdown, mdx, fs
Slimmed barrels: agent, tool, workflow, prompt, resource, mcp,
middleware, oauth, provider, react, config, platform, cache, build,
rendering
Root barrel: server core + config + routing + data + validation

- Convert all star-exports to selective re-exports
- Move CLI-only paths from exports to imports (dnt resolves at build)
- Create src/chat (UI components + hooks), src/markdown (runtime
  rendering), src/mdx (MDX provider), src/fs (filesystem + path utils)
- Slim workflow barrel to DSL + types + backends + client + hooks
- Fix 29 type errors in newly typechecked entrypoints
- Update all templates, examples, and browser import maps
- Add docs/api.md with full public API documentation
- 1078 tests passing, 0 type errors across 36 entrypoints

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 862890760c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/server/handlers/request/lib-modules.handler.ts Outdated
Without this, requests for /_veryfront/lib/mdx.js 404 in self-hosted
module resolution mode.
- Run deno fmt on workflow/index.ts, html/utils.ts, agent-card.tsx
- Inline Link component in router barrel (avoids relative import in
  embedded framework sources that breaks compiled binary SSR resolution)
- Delete components/Link.tsx (zero consumers), remove from components barrel
- Link now lives exclusively in veryfront/router
@kojiwakayama
kojiwakayama merged commit b3cb6ea into main Feb 7, 2026
12 checks passed
@kojiwakayama
kojiwakayama deleted the refactor-api branch February 7, 2026 21:33
kwakayama added a commit that referenced this pull request Feb 9, 2026
The API surface refactor (#264) reduced exports to 18 flat paths, none
of which transitively import react-dom/client. dnt fails when a mapping
is specified but no entry point source file references it.
kwakayama added a commit that referenced this pull request Feb 9, 2026
The API surface refactor (#264) reduced exports to 18 flat paths, none
of which transitively import react-dom/client. dnt fails when a mapping
is specified but no entry point source file references it.
ariskemper pushed a commit that referenced this pull request Feb 9, 2026
…264)

* refactor(api): productize public API surface to 18 flat export paths

Reduce npm-visible exports from 62 paths to 18 product-oriented paths.
Every export is now justified as user-facing; internal infrastructure
is invisible to npm consumers.

New barrels: chat, markdown, mdx, fs
Slimmed barrels: agent, tool, workflow, prompt, resource, mcp,
middleware, oauth, provider, react, config, platform, cache, build,
rendering
Root barrel: server core + config + routing + data + validation

- Convert all star-exports to selective re-exports
- Move CLI-only paths from exports to imports (dnt resolves at build)
- Create src/chat (UI components + hooks), src/markdown (runtime
  rendering), src/mdx (MDX provider), src/fs (filesystem + path utils)
- Slim workflow barrel to DSL + types + backends + client + hooks
- Fix 29 type errors in newly typechecked entrypoints
- Update all templates, examples, and browser import maps
- Add docs/api.md with full public API documentation
- 1078 tests passing, 0 type errors across 36 entrypoints

* fix(server): add mdx.js to allowed self-hosted lib modules

Without this, requests for /_veryfront/lib/mdx.js 404 in self-hosted
module resolution mode.

* fix(ci): resolve format and binary E2E test failures

- Run deno fmt on workflow/index.ts, html/utils.ts, agent-card.tsx
- Inline Link component in router barrel (avoids relative import in
  embedded framework sources that breaks compiled binary SSR resolution)
- Delete components/Link.tsx (zero consumers), remove from components barrel
- Link now lives exclusively in veryfront/router
ariskemper pushed a commit that referenced this pull request Feb 9, 2026
The API surface refactor (#264) reduced exports to 18 flat paths, none
of which transitively import react-dom/client. dnt fails when a mapping
is specified but no entry point source file references it.
kojiwakayama added a commit that referenced this pull request Aug 17, 2026
Production HTML selects the single content-addressed hydration runtime from the rendered release's configured build output and uses it for preload and execution across component, script-page, and snippet shells. Canonical enriched release identity now survives the complete snippet path, and public release-aware shell calls fail closed unless a runtime was selected.

Constraint: Pre-change immutable releases cannot gain new manifest metadata, so selection must discover the runtime already present in the release artifact set.

Rejected: Serve the current runtime under a release URL | recreates the cross-artifact compatibility skew from incident #264

Rejected: Assume dist is the build output | build.outDir is a supported project contract

Confidence: high

Scope-risk: moderate

Reversibility: clean

Directive: Retire a release hydration runtime only with its release; never redirect its hashed path to newer bytes.

Tested: Full integration 302 tests/2840 steps; focused 10 suites/175 steps; aged-release Chromium 2 steps; isolated NavigationMenu 9 steps; production/test typecheck; lint/fmt; dependency/module boundaries; anti-slop; guide/public docs; pinned Deno 2.7.7 API docs

Not-tested: A wholly green local unit aggregate; 3919 tests/29929 steps passed before the known NavigationMenu timer-leak flake, whose isolated rerun passed. Exact-head GitHub CI is required before merge.

Related: veryfront/veryfront-issue-inbox#277
kojiwakayama added a commit that referenced this pull request Aug 17, 2026
Production HTML selects the single content-addressed hydration runtime from the rendered release build output and uses it for preload and execution across component, script-page, and snippet shells. Canonical enriched release identity now survives the complete snippet path, while standalone source serving falls back to the current runtime only when its synthetic release has no build artifact directory.

Constraint: Pre-change immutable releases cannot gain new manifest metadata, so selection must discover the runtime already present in the release artifact set.

Rejected: Serve the current runtime under a release URL | recreates the cross-artifact compatibility skew from incident #264

Rejected: Treat every production release identity as artifact-backed | compiled standalone source serving uses the synthetic standalone-dev identity without a build output directory

Confidence: high

Scope-risk: moderate

Reversibility: clean

Directive: Retire a release hydration runtime only with its release; never redirect its hashed path to newer bytes.

Tested: Fresh compiled-binary E2E 1 test/65 steps; focused release-render matrix 18 tests/255 steps; aged-release Chromium 2 steps; full integration 302 tests/2840 steps; production/test typecheck; lint/fmt; dependency/module boundaries; anti-slop; guide/public docs; pinned Deno 2.7.7 API docs

Not-tested: A wholly green local unit aggregate; 3919 tests/29929 steps passed before the known NavigationMenu timer-leak flake, whose isolated rerun passed. Exact-head GitHub CI is required before merge.

Related: veryfront/veryfront-issue-inbox#277
kojiwakayama added a commit that referenced this pull request Aug 17, 2026
Production HTML selects the single content-addressed hydration runtime from the rendered release build output and uses it for preload and execution across component, script-page, and snippet shells. Canonical enriched release identity now survives the complete snippet path, while standalone source serving falls back to the current runtime only when its synthetic release has no build artifact directory.

Constraint: Pre-change immutable releases cannot gain new manifest metadata, so selection must discover the runtime already present in the release artifact set.

Rejected: Serve the current runtime under a release URL | recreates the cross-artifact compatibility skew from incident #264

Rejected: Treat every production release identity as artifact-backed | compiled standalone source serving uses the synthetic standalone-dev identity without a build output directory

Confidence: high

Scope-risk: moderate

Reversibility: clean

Directive: Retire a release hydration runtime only with its release; never redirect its hashed path to newer bytes.

Tested: Fresh compiled-binary E2E 1 test/65 steps; focused release-render matrix 18 tests/255 steps; aged-release Chromium 2 steps; full integration 302 tests/2840 steps; production/test typecheck; lint/fmt; dependency/module boundaries; anti-slop; guide/public docs; pinned Deno 2.7.7 API docs

Not-tested: A wholly green local unit aggregate; 3919 tests/29929 steps passed before the known NavigationMenu timer-leak flake, whose isolated rerun passed. Exact-head GitHub CI is required before merge.

Related: veryfront/veryfront-issue-inbox#277
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