Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

难道已经不维护了吗 #48

Open
Super1Windcloud opened this issue Aug 13, 2024 · 6 comments
Open

难道已经不维护了吗 #48

Super1Windcloud opened this issue Aug 13, 2024 · 6 comments
Labels
question Further information is requested

Comments

@Super1Windcloud
Copy link

No description provided.

@bluelovers
Copy link
Owner

  1. bug 解決不了 (無法儲存某些設定)
  2. 除了第一點以外 仍然正常運作
  3. 如果介意BUG的部份的話 有出現官方替代品 與 其他製作者的版本

@bluelovers bluelovers added the question Further information is requested label Aug 13, 2024
@Super1Windcloud
Copy link
Author

官方没有Typescript插件. 现在有两种解决方案

  • 第一种: 使用Nodejs插件这样配置
    image

  • 第二种 : 如何是需要编译成CJS则使用ts-node 在另外一个 run configuration plugin插件 ,但是那个家伙的插件使用TSX会出现致命错误, 因为他的TSX命令行参数过度设计了,

@bluelovers
Copy link
Owner

bluelovers commented Aug 14, 2024

官方没有Typescript插件. 现在有两种解决方案

  • 第一种: 使用Nodejs插件这样配置
    image
  • 第二种 : 如何是需要编译成CJS则使用ts-node 在另外一个 run configuration plugin插件 ,但是那个家伙的插件使用TSX会出现致命错误, 因为他的TSX命令行参数过度设计了,

image

官方不需要安裝插件
已經是內建的
但存在某種設計上的奇怪邏輯

https://youtrack.jetbrains.com/issue/WEB-67577/2024.2-eap-node-js-run-typescript-is-not-same-as-node-js-test-runer

image

@Super1Windcloud
Copy link
Author

我觉得你可以重新开发一款简洁一点的插件, 直接执行TSX就行了, 会自动更具tsconfig.json编译成对应的CJS和ESM模块 , ts-node作者自己都不愿意继续维护支持ESM了 , 现在最好的替代品就是TSX和 swc-node了

@bluelovers
Copy link
Owner

bluelovers commented Aug 14, 2024

ts-node作者自己都不愿意继续维护支持ESM了 ,

當初開始使用 tsx 就是因為 ts-node 開始出現這種問題 而且解決方式非常的煩人 也 無法一勞永逸

现在最好的替代品就是TSX和 swc-node了

曾經試圖讓同時安裝 tsx 與 ts-node 時 以 tsx 為優先
但沒有成功

val tsnodePackageField = TsForm.LazyNodePackageField("&TypeScript Node package:", interpreterField, listOf("tsx", "esno", "ts-node", "esm-ts-node"))

https://youtrack.jetbrains.com/issue/WEB-58993/NodePackageField-didnt-follow-list-order

我觉得你可以重新开发一款简洁一点的插件, 直接执行TSX就行了

這樣的話 也許會考慮直接在這個插件內捨棄 ts-node 讓他只偵測 tsx

@bluelovers
Copy link
Owner

預設為 tsx 的版本

兩個檔案只有內容有差別 選一個裝就可以

idea-run-typescript.zip

idea-run-typescript (2).zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants