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: 起動しなくなっていた問題の緊急修正 #254

Merged
merged 7 commits into from
Jun 11, 2022
Merged

Conversation

MikuroXina
Copy link
Collaborator

Type of Change:

修正, 依存関係の追加

Cause of the Problem (問題の原因)

#247 によって nanoid が 4.0.0 になったことで ES Modules の JavaScript ファイルのみが提供されるようになっていました. しかし, TypeScript はこれまで通り CommonJS のファイルを生成するようになっていたため, CommonJS 側から ES Modules の JavaScript を require で読み込もうとしてしまい, はらちょが起動しなくなっていました.

Dealing with Problems (問題への対処)

nanoid のバージョンを差し戻すなどが考えられました. しかしせっかく Node.js も ES Modules に対応しているので, ビルド方式を見直してシステム全体を ES Modules に統一することにしました.

Details of implementation (実施内容)

  • package.json を ES Modules パッケージのものに書き換え
  • ビルドツールとして esbuild を追加
  • debug スクリプトに --esm オプションを追加
  • tsc を型チェックのみに利用するように変更
  • すべての TypeScript ソースファイルの import パスを, ES Modules の .js で終わる方式に書き換え

Additional Information (追加情報)

esbuild に変更したことで, ビルドがあっという間に終わるようになりました. ただし, esbuild は型検査を行いません.

@MikuroXina MikuroXina requested a review from m1sk9 June 11, 2022 08:06
@MikuroXina MikuroXina self-assigned this Jun 11, 2022
@MikuroXina MikuroXina merged commit 593e69f into main Jun 11, 2022
@MikuroXina MikuroXina deleted the hotfix branch June 11, 2022 08:21
@github-actions
Copy link
Contributor

🎉 This PR is included in version 1.16.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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