Skip to content

fix(api): resolve Veryfront imports in Deno temp modules - #3547

Merged
kwakayama merged 2 commits into
mainfrom
fix/deno-api-subpath-imports
Aug 10, 2026
Merged

kwakayama merged 2 commits into
mainfrom
fix/deno-api-subpath-imports

Conversation

@kojiwakayama

Copy link
Copy Markdown
Contributor

Summary

  • resolve noncompiled Deno veryfront imports through the running package export map
  • preserve the existing compiled Deno shims and Node/Bun behavior
  • reject package export targets that escape the installed package root
  • add focused regressions for static and dynamic subpath imports

Root cause

Fresh Deno projects do not inherit this repository's import map. When a generated API route had to use the bundled temporary-module path, bare imports such as veryfront/embedding remained external. Deno then evaluated the temporary file outside the installed package context and could not resolve the framework import.

Using import.meta.resolve alone was insufficient because the packed npm build uses a DNT resolver ponyfill that loses package self-resolution. This change reads the active package export map and converts framework imports to contained file URLs before Deno evaluates the temporary module.

Verification

  • focused rewriter regression captured red, then passed green
  • module-loader suites: 5 passed, 97 steps, 0 failed
  • formatting, lint, and typecheck passed
  • full pre-push checks passed, including parallel unit tests and isolated CWD suites
  • generated docs-agent Deno project passed scaffold, install, build, production serve, /, /uploads, browser checks, and /api/uploads with a clean network log

Related: veryfront/veryfront-issue-inbox#456

Bundled API handlers execute from temporary directories, so non-compiled Deno routes must replace external Veryfront imports with file URLs derived from the active package export map.

Constraint: Deno scaffolds run Veryfront through an exact npm task and do not declare Veryfront as a project dependency.

Rejected: Add Veryfront to every Deno project dependency list | duplicates the task-owned runtime and permits package drift.

Rejected: Use import.meta.resolve directly | the npm build ponyfill loses package self-resolution.

Confidence: high

Scope-risk: narrow

Directive: Keep compiled Deno on runtime shims and validate package export containment before emitting file URLs.

Tested: API module-loader suites, formatting, lint, typecheck, and generated Deno docs-agent scaffold/install/build/serve/browser flow including GET /api/uploads.

Not-tested: Remaining template and runtime production matrix is pending.
@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@kojiwakayama, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 17 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 58f7c8f4-00b6-4c04-b13e-5dc3e64e6fdb

📥 Commits

Reviewing files that changed from the base of the PR and between 80fb3a0 and e4fc6d9.

📒 Files selected for processing (2)
  • src/routing/api/module-loader/external-import-rewriter.test.ts
  • src/routing/api/module-loader/external-import-rewriter.ts

Comment @coderabbitai help to get the list of available commands.

@kwakayama
kwakayama enabled auto-merge August 10, 2026 17:53
@kojiwakayama

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: e4fc6d9d12

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kojiwakayama

Copy link
Copy Markdown
Contributor Author

@codex review

@kwakayama
kwakayama added this pull request to the merge queue Aug 10, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: e4fc6d9d12

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Merged via the queue into main with commit 837e8f9 Aug 10, 2026
59 of 60 checks passed
@kwakayama
kwakayama deleted the fix/deno-api-subpath-imports branch August 10, 2026 18:22
@kwakayama kwakayama mentioned this pull request Aug 10, 2026
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.

2 participants