Skip to content

fix(extensions): keep optional Deno imports optional - #3542

Merged
kojiwakayama merged 1 commit into
mainfrom
fix/deno-missing-extension-classification
Aug 10, 2026
Merged

kojiwakayama merged 1 commit into
mainfrom
fix/deno-missing-extension-classification

Conversation

@kojiwakayama

@kojiwakayama kojiwakayama commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Deno 2.7.7 can report an unavailable optional first-party extension as:

Import "@veryfront/ext-auth-jwt" not a dependency

The classifier accepted only the older wording, not a dependency and not in import map, so build orchestration treated an absent optional builtin as a hard error for Deno scaffolds. The missing-extension regex now accepts both exact forms while still matching only the explicitly probed first-party specifier.

PR #3541 is the independent SSG fix needed for the ai-agent case in the combined 21-case template matrix. This PR is the optional-extension classifier fix and does not depend on that change.

Regression test

  • Added a focused classifier regression for Deno's shortened not a dependency wording.

Verification

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of missing dependency errors reported in Bun-style formats.
    • Correctly identifies missing first-party packages when no import-map details are included.
  • Tests

    • Added coverage for missing-dependency error scenarios.

Deno 2.7.7 can report an unavailable first-party package as `Import "@veryfront/ext-auth-jwt" not a dependency` instead of the older `not a dependency and not in import map` wording. The classifier now accepts both forms so optional builtins remain optional when a scaffold does not install them.

Constraint: Deno emits both shortened and older missing-dependency wording

Rejected: Install optional auth extensions into every scaffold | the extension is not required for templates that do not use it

Confidence: high

Scope-risk: narrow

Directive: Keep first-party missing-extension classification tolerant of runtime wording variants, but limited to explicitly probed first-party specifiers

Tested: Focused RED then GREEN 1 test/29 steps; src/extensions suite 78/510; unit suite 3786/28100 with 1 ignored; fmt 4980; lint 4905; check src/index.ts; 21-case scaffold/install/production-build matrix when combined with PR #3541

Not-tested: none
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 61794878-fff6-49c6-9a08-26d25453d814

📥 Commits

Reviewing files that changed from the base of the PR and between bb90d94 and 1de2dd4.

📒 Files selected for processing (2)
  • src/extensions/first-party-import.test.ts
  • src/extensions/first-party-import.ts

📝 Walkthrough

Walkthrough

The missing-module parser now accepts Bun/Deno messages without an import-map clause. A test verifies that the parser recognizes a matching missing first-party package.

Changes

Missing dependency parsing

Layer / File(s) Summary
Parser update and test coverage
src/extensions/first-party-import.ts, src/extensions/first-party-import.test.ts
The parser accepts both missing-dependency message forms. A test covers the shorter Deno-style message and matching package identifier.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: kwakayama

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: preserving optional Deno imports when their dependencies are unavailable.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/deno-missing-extension-classification

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

@kojiwakayama
kojiwakayama added this pull request to the merge queue Aug 10, 2026
@kojiwakayama

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Merged via the queue into main with commit 48cd2d5 Aug 10, 2026
33 checks passed
@kojiwakayama
kojiwakayama deleted the fix/deno-missing-extension-classification branch August 10, 2026 17:19
kwakayama added a commit that referenced this pull request Aug 10, 2026
Ships the build fixes for veryfront-issue-inbox#456. `veryfront build` has
been broken for every project since 0.1.1206, and 5 of 7 scaffold templates
could not build at all.

- #3538 prime host contracts in the build extension path
- #3541 resolve server-side esm.sh modules with a server target
- #3542 keep optional Deno imports optional
- #3540 isolate cwd-mutating unit tests

The version is embedded in hydration-runtime.generated.ts, so a bump must be
followed by `deno task generate`; the manifests check fails otherwise.

There is no earlier version to pin to: 0.1.1205 fails the same templates with
the CSSProcessor error that #3417 was fixing.
This was referenced 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.

1 participant