Skip to content

chore: adopt typescript-native-bridge - #3088

Open
KazariAI wants to merge 1 commit into
npmx-dev:mainfrom
KazariAI:feat/typescript-native-bridge
Open

chore: adopt typescript-native-bridge#3088
KazariAI wants to merge 1 commit into
npmx-dev:mainfrom
KazariAI:feat/typescript-native-bridge

Conversation

@KazariAI

Copy link
Copy Markdown
Contributor

Adjusts the Nuxt app config augmentation and cached fetch wrapper to avoid two tsgo diagnostic differences exposed by the migration.


This pull request was created with assistance from a code agent.

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
docs.npmx.dev Ready Ready Preview, Comment Jul 28, 2026 8:05am
npmx.dev Ready Ready Preview, Comment Jul 28, 2026 8:05am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Jul 28, 2026 8:05am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 32a51099-d6ef-484c-9342-3b6f8dff285c

📥 Commits

Reviewing files that changed from the base of the PR and between 2c78c40 and 2d43538.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • modules/build-env.ts
  • modules/runtime/server/cache.ts
  • pnpm-workspace.yaml

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved cached data fetching to ensure requests use the application’s configured fetch behaviour.
  • Chores
    • Updated TypeScript tooling configuration for improved compatibility.
    • Refined internal configuration typing without changing available app configuration properties.

Walkthrough

Changes

App-config typing

Layer / File(s) Summary
Rename app-config interface
modules/build-env.ts
The Nuxt app-config augmentation is renamed from AppConfig to CustomAppConfig, retaining env and buildInfo.

Cached fetch delegation

Layer / File(s) Summary
Delegate cached fetch requests
modules/runtime/server/cache.ts
event.context.cachedFetch now retrieves data through fetchWrapper instead of globalThis.$fetch.

TypeScript workspace override

Layer / File(s) Summary
Add TypeScript override
pnpm-workspace.yaml
The workspace adds a TypeScript override targeting typescript-native-bridge@6.0.3-bridge.7.tsgo.7.0.2.

Suggested reviewers: iiio2

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: adopting typescript-native-bridge.
Description check ✅ Passed The description is clearly related to the migration and the tsgo-related code adjustments.
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 unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown

📊 Dependency Size Changes

Warning

This PR adds 12.4 MB of new dependencies, which exceeds the threshold of 200 kB.

📦 Package 📏 Size
typescript-native-bridge@6.0.3-bridge.7.tsgo.7.0.2 36.5 MB
typescript@6.0.3 -24.3 MB
@typescript-native-bridge/linux-x64@6.0.3-bridge.7.tsgo.7.0.2 23.9 MB
typescript@5.9.3 -23.6 MB
typescript@typescript-native-bridge@6.0.3-bridge.7.tsgo.7.0.2 Unknown

Total size change: 12.4 MB

@ghostdevv ghostdevv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you give some more context around this issue?

@KazariEX

Copy link
Copy Markdown
Contributor

typescript-native-bridge makes it possible to integrate TS7 type checking into projects built on the TS6 API. This PR primarily aims to speed up CI and the agent development cycle. It also helps bring TNB into real-world use, where broader adoption can uncover more issues and generate valuable feedback.

event.context.cachedFetch = async (url: string, options?: any) => {
return {
data: await globalThis.$fetch(url, options),
data: await fetchWrapper(url, options),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this seems like it's a behavior change?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

fetchWrapper has already been assigned to globalThis.$fetch above. Using globalThis.$fetch here causes the TS2321 error: "Excessive stack depth comparing types ..."

Comment thread modules/build-env.ts

declare module '@nuxt/schema' {
interface AppConfig {
interface CustomAppConfig {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How come?

@KazariEX KazariEX Aug 1, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The AppConfig interface merges in a literal object inferred from the runtime value, where prNumber is always inferred as null. Therefore, overriding the type of buildInfo directly on AppConfig causes the TS2430 error: "Interface 'AppConfig' incorrectly extends interface 'MergedAppConfig<...>'."

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.

3 participants