增强 Deno 兼容性,添加降级处理逻辑以支持在无法执行原生命令时返回基础数据,同时更新文档以反映这些更改。#44
Merged
增强 Deno 兼容性,添加降级处理逻辑以支持在无法执行原生命令时返回基础数据,同时更新文档以反映这些更改。#44
Conversation
test/deno/smoke-test.ts 使用 import.meta.url,仅供 Deno 直接运行, 不应纳入 CommonJS 模式的 tsc 编译范围。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deno 在未声明模块类型时默认将 .js 文件视为 ESM, 即使通过 createRequire 加载也会走 loadESMFromCJS 路径并抛出 "exports is not defined"。显式声明 "type": "commonjs" 后 Deno 可正确识别并加载 CommonJS 格式的 dist 产物。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deno 的 --allow-read 默认不授权读取 /proc/meminfo, 原先直接 throw 导致 memory.info() 返回 failure。 现改为降级到 os.totalmem()/os.freemem() 并发出 warnDegradation, 与 CPU 和 Windows 适配器的处理策略保持一致。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 添加 "type": "commonjs" 声明,解决 Deno 加载 CJS 产物失败 - Linux/macOS 适配器在 /proc/meminfo 不可读时降级到 os 模块 - CommandExecutor 处理 Deno 兼容层抛出的非对象异常 - 修复 getNetworkStats 静默返回空数组的错误行为 - cpu.average() 标记为 @deprecated,引导迁移到 cpu.usage() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Background
Key Changes
Test Matrix
npm run buildnpm run test:unitnpm run test:linux / windows(if applicable)npm run lint:checkRelated Issues
Platform & Permissions
Documentation
README.md/README-zh.mdAdditional Notes