init 生成的 cpu-usage compute 函数包含 TypeScript 类型注解,Node 无法直接执行 #25
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
即使手动将
index.ts重命名为index.js,Node 仍然无法执行,因为代码中包含 TypeScript 语法(如Promise<unknown>返回类型注解)。Where
packages/cli/src/commands/init.ts中的CPU_USAGE_INDEX模板。Expected
init 模板应该生成纯 JavaScript 代码(ESM),不包含 TypeScript 类型注解。
Note
此 issue 与 #N(.ts vs .js 文件名)相关但不同 — 即使文件名修对了,内容也跑不了。