Convert Deno client to universal Node.js/Deno/Bun compatibility#180
Open
just-be-dev wants to merge 2 commits intomainfrom
Open
Convert Deno client to universal Node.js/Deno/Bun compatibility#180just-be-dev wants to merge 2 commits intomainfrom
just-be-dev wants to merge 2 commits intomainfrom
Conversation
- Replace deno.json with package.json configuration - Convert Deno APIs to Node.js built-ins with node: prefix - Add TypeScript configuration for extensionless imports - Create post-build script to fix imports for Node.js compatibility - Update all examples to use new import paths - Add support for cross-runtime binary downloading - Remove Deno-specific configuration files
- Delete all compiled .js, .js.map, .d.ts, and .d.ts.map files - Keep fix-imports.js as it's a source script - Add .gitignore to prevent future build artifacts from being committed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR converts the Deno-specific webview client to be universally compatible with Deno, Node.js, and Bun runtimes. The changes enable cross-platform usage while maintaining backward compatibility with existing Deno workflows.
• Configuration Migration: Replaced
deno.jsonwithpackage.jsonfor npm ecosystem compatibility• API Conversion: Converted all Deno-specific APIs to Node.js built-ins using
node:prefix• Import System: Implemented TypeScript configuration for extensionless imports with post-build processing
• Cross-Runtime Support: Added platform detection and fallback handling for unknown runtimes
• Binary Management: Enhanced binary downloading with cross-platform cache directory resolution
• Examples Update: Updated all examples to use new import paths and work with compiled JavaScript
Key Technical Changes
Runtime API Conversion
Deno.Command→node:child_process.spawnDeno.env→process.envDeno.writeFile→node:fs/promises.writeFileDeno.readTextFile→node:fs/promises.readFileDeno.mkdir→node:fs/promises.mkdirBuild System
fix-imports.jsscript to convert extensionless imports to.jsextensionsDependency Management
@bcheidemann/tracing→ custom console logger@gabriel/ts-pattern→ts-patternTest Plan
cd src/clients/deno && npm installnpm run buildnode examples/simple.jsdeno run --allow-all examples/simple.tsRuntime Compatibility
Breaking Changes
None for existing Deno users - the package maintains full backward compatibility while adding Node.js/Bun support.