Skip to content

chore(tsconfig): include node types so Deno can resolve type information - #5538

Open
q404365631 wants to merge 2 commits into
asyncapi:masterfrom
q404365631:chore/deno-types-5087
Open

chore(tsconfig): include node types so Deno can resolve type information#5538
q404365631 wants to merge 2 commits into
asyncapi:masterfrom
q404365631:chore/deno-types-5087

Conversation

@q404365631

@q404365631 q404365631 commented Jun 4, 2026

Copy link
Copy Markdown

What

Adds an explicit "types": ["node"] entry to tsconfig.json's compilerOptions so Deno (and any other runtime) can pull in the node type definitions from node_modules/@types/node when type-checking.

Why

package.json already uses Deno for some tests (test:netlify = deno test ...), and per #5087 Deno is unable to resolve type information for this project because tsconfig.json had no types field. With types: ["node"], Deno can read the typings from the existing @types/node (already a transitive dep) instead of falling back to any.

Changes

  • tsconfig.json: Added "types": ["node"] to compilerOptions.

1 file changed, 4 insertions(+), 1 deletion(-).

Closes #5087

Summary by CodeRabbit

  • Chores
    • Updated TypeScript compiler configuration to include Node.js type definitions for improved development environment compatibility.
    • Added a patch changeset entry documenting the TypeScript config update so runtime tooling (e.g., Deno) can resolve Node built-in types for scripts that rely on them.

@netlify

netlify Bot commented Jun 4, 2026

Copy link
Copy Markdown

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit d5f2c77
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/6a2190f5c845fb0008196fdd
😎 Deploy Preview https://deploy-preview-5538--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jun 4, 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

Run ID: 71241dfc-1562-4ac1-bfa3-694b4d5e81e5

📥 Commits

Reviewing files that changed from the base of the PR and between 5c6c573 and d5f2c77.

📒 Files selected for processing (1)
  • .changeset/chore-deno-types-5087.md
✅ Files skipped from review due to trivial changes (1)
  • .changeset/chore-deno-types-5087.md

📝 Walkthrough

Walkthrough

This PR adds explicit Node.js type definitions to the TypeScript configuration by specifying types: ["node"] in compilerOptions within tsconfig.json, and adds a changeset entry documenting the update.

Changes

TypeScript Configuration

Layer / File(s) Summary
Node.js types configuration
tsconfig.json
compilerOptions.types array is added with "node" specified, and closing-brace placement adjusted.
Changeset entry
.changeset/chore-deno-types-5087.md
New changeset documenting the tsconfig update and declaring a patch bump for asyncapi-website.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A config so clean, a rabbit's delight,
Node types declared, the setup's now right!
One simple addition, so modest and small,
TypeScript's peace found—clear paths for all! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR only addresses part of issue #5087 (adding types to tsconfig) but omits the primary requirement of creating netlify/edge-functions/deno.json configuration. Create the netlify/edge-functions/deno.json file with compilerOptions.lib and types as specified in issue #5087 to fully resolve edge function IDE errors.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: adding node types to tsconfig to resolve Deno type information.
Out of Scope Changes check ✅ Passed The changes are focused on tsconfig.json and changelog entry, both directly related to the linked issue #5087.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b1beb34) to head (d5f2c77).
⚠️ Report is 73 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #5538   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines          931       931           
  Branches       180       180           
=========================================
  Hits           931       931           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tsconfig.json`:
- Around line 8-10: Root tsconfig.json adding "types": ["node"] doesn't satisfy
files under netlify/edge-functions that use Deno globals and URL imports; create
or update a Deno-scoped tsconfig for netlify/edge-functions that enables Deno
typings and appropriate module resolution so files like serve-definitions.ts
(uses Deno.env.get) and serve-definitions.test.ts (uses Deno.test) compile
correctly. Specifically, add a tsconfig (e.g., in netlify/edge-functions) that
includes "types": ["deno"], or the official Deno lib, and set
moduleResolution/isolatedModules options appropriate for Deno/URL imports so the
Deno globals and remote imports are recognized by TypeScript for that directory.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 244a5af0-bb50-4678-8203-816cd59bdc96

📥 Commits

Reviewing files that changed from the base of the PR and between b1beb34 and 5c6c573.

📒 Files selected for processing (1)
  • tsconfig.json

Comment thread tsconfig.json
Comment on lines +8 to +10
"types": [
"node"
],

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether netlify/edge-functions has a dedicated Deno TS config
# and whether root tsconfig excludes netlify from compilation scope.

set -euo pipefail

echo "== Root tsconfig exclusion check =="
rg -n '"exclude"|"netlify"|"types"|\"moduleResolution\"' tsconfig.json -n -C2 || true

echo
echo "== Search for Deno config under netlify =="
fd -i 'deno\.json|deno\.jsonc|tsconfig\.json' netlify || true

echo
echo "== Search for Deno global or URL import usage in edge functions =="
rg -n --iglob '*.{ts,tsx,js,mjs,cjs}' '\bDeno\b|https://edge\.netlify\.com|from\s+["'\'']https?://' netlify || true

Repository: asyncapi/website

Length of output: 1925


Root tsconfig.json "types": ["node"] won’t fix netlify/edge-functions Deno/URL-import typing for #5087

netlify/edge-functions/serve-definitions.ts and netlify/edge-functions/tests/serve-definitions.test.ts use Deno globals (Deno.env.get, Deno.test) and import modules from https://.... Adding Node types in the root tsconfig.json is insufficient for this Deno environment; a Deno-aware TS config (scoped to netlify/edge-functions) is still needed to address #5087.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tsconfig.json` around lines 8 - 10, Root tsconfig.json adding "types":
["node"] doesn't satisfy files under netlify/edge-functions that use Deno
globals and URL imports; create or update a Deno-scoped tsconfig for
netlify/edge-functions that enables Deno typings and appropriate module
resolution so files like serve-definitions.ts (uses Deno.env.get) and
serve-definitions.test.ts (uses Deno.test) compile correctly. Specifically, add
a tsconfig (e.g., in netlify/edge-functions) that includes "types": ["deno"], or
the official Deno lib, and set moduleResolution/isolatedModules options
appropriate for Deno/URL imports so the Deno globals and remote imports are
recognized by TypeScript for that directory.

@asyncapi-bot

asyncapi-bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 48
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-5538--asyncapi-website.netlify.app/

@asyncapi-bot
asyncapi-bot requested a review from CBID2 June 4, 2026 14:51
@sonarqubecloud

sonarqubecloud Bot commented Jun 4, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Be Triaged

Development

Successfully merging this pull request may close these issues.

[Bug 🐞 report]: Add Deno types configuration to eliminate IDE errors in edge functions

2 participants