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

fix: not-generator-file-on-window #51

Merged

Conversation

yolo-jane
Copy link
Contributor

问题复现:在 window 下,ytt.config.js 中设置 target: 'javascript', 发觉没有生成 对应的文件 *.js 与 *d.ts,

排查过程:排查定位到是在 line 521 左右
if (syntheticalConfig.target === 'javascript') { await this.tsc(outputFilePath) await Promise.all([ fs.remove(requestFunctionFilePath).catch(noop), fs.remove(requestHookMakerFilePath).catch(noop), fs.remove(outputFilePath).catch(noop), ]) }
this.tsc() 执行不成功,没有将对应的 *.ts 通过 tsc 编译成 *.d.ts 与 *.js 。

原因: linux 与 macos 都能直接执行 require.resolve(typescript/bin/tsc) 该可执行文件,而 window 的可执行文件是 *.cmd
故,this.tsc 在 window 执行失败

demo: https://github.com/yolo-jane/yapi2ts-bug-on-win

@fjc0k fjc0k merged commit 0181fb2 into fjc0k:master Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants