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

Cypressがソリューションスタイルのtsconfigに対応したら、 ルートのtsconfigのmoduleフィールドを削除する #1075

Closed
1 task
KentaHizume opened this issue Apr 11, 2024 · 5 comments
Assignees
Labels
target: Dressca サンプルアプリケーションDresscaに関係がある 定期的な確認が必要 他のサービスの不具合亜解消待ちなど、定期的な情報のアップデートが必要である

Comments

@KentaHizume
Copy link
Contributor

KentaHizume commented Apr 11, 2024

概要

create-vueのテンプレート作成時にE2EテストツールとしてCypressを選択した場合、
ルートのtsconfig.jsonにmodule:NodeNextが追加されるようになっている。
というのも、Cypressが依存しているts-nodeが、
ソリューションスタイルのtsconfigに対応していないからである。

詳細 / 機能詳細(オプション)

下記のissueの状況を確認する。

完了条件

  • ルートのtsconfigのmoduleフィールドを消しても、Cypressが動作すること
@KentaHizume
Copy link
Contributor Author

@KentaHizume
Copy link
Contributor Author

  • create-vueのテンプレート作成時の処理

https://github.com/vuejs/create-vue/blob/be8b3a8d25c8a63427029c8f9d2f688c50ebc163/index.ts#L417

    if (needsCypress) {
      render('tsconfig/cypress')
      // Cypress uses `ts-node` internally, which doesn't support solution-style tsconfig.
      // So we have to set a dummy `compilerOptions` in the root tsconfig to make it work.
      // I use `NodeNext` here instead of `ES2015` because that's what the actual environment is.
      // (Cypress uses the ts-node/esm loader when `type: module` is specified in package.json.)
      // @ts-ignore
      rootTsConfig.compilerOptions = {
        module: 'NodeNext'
      }

@KentaHizume KentaHizume self-assigned this Apr 11, 2024
@KentaHizume KentaHizume added the target: Dressca サンプルアプリケーションDresscaに関係がある label Apr 11, 2024
@tsuna-can-se tsuna-can-se added サンプルAP 定期的な確認が必要 他のサービスの不具合亜解消待ちなど、定期的な情報のアップデートが必要である labels Apr 11, 2024
@KentaHizume
Copy link
Contributor Author

  • 下記の記事が比較的わかりやすい

Node.js + TypeScriptのモジュールを整理してみる

@KentaHizume KentaHizume changed the title CypressがESMに対応したら、tsconfigのmodule:NodeNextをやめる Cypressがソリューションスタイルのtsconfigに対応したら、 ルートのtsconfigのmoduleフィールドを削除する May 21, 2024
@KentaHizume
Copy link
Contributor Author

Cypressかts-nodeの対応がなされたら、
create-vueのテンプレートが変更されるはずなので、

@KentaHizume
Copy link
Contributor Author

Cypressかts-nodeの対応がなされたら、
create-vueのテンプレートが変更されるはずなので、

@KentaHizume KentaHizume closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target: Dressca サンプルアプリケーションDresscaに関係がある 定期的な確認が必要 他のサービスの不具合亜解消待ちなど、定期的な情報のアップデートが必要である
Projects
None yet
Development

No branches or pull requests

2 participants