Kotlin, Typescript & Python monorepo all in IntelliJ IDEA?
已回答
I have a large monorepo that has project with differing languages (kotlin/java, typescript/vue, and python). I want to use IntelliJ IDEA to edit everything. The kotlin/java stuff is based on the Gradle Kotlin DSL, the typescript/vue stuff uses npm & turbo, and the python stuff uses uv workspaces, whose pyproject.toml & uv.lock is in the root of the monorepo. How do I end up with a .idea directory that allows me to work on all projects at time same time in IntelliJ IDEA and have all features of WebStorm & PyCharm within IDEA? I have an all-product pack license.
请先登录再写评论。
Hi Matthew,
You can use the IDE Workspace feature that relies on the official Multi-Project Workspace plugin.
jb-workspace.xmlfile within an.ideafolder in a repository. This file lists the configurations and Git repository URLs of various projects, enabling IntelliJ IDEA to automatically check out all listed projects upon cloning the repository..ideafolder. When a project is added to a workspace, its settings are copied to the workspace folder, allowing for local modifications without affecting the original project settings. This enables a single project to be included in multiple workspaces with different configurations.More information can be found in the official documentation: https://www.jetbrains.com/help/idea/workspaces.html
OMG if only IDEA would autodetect that when I open the root of the mono repo via `idea .`. I wasn’t aware of that plugin. Is it bundled with IDEA?
It is not bundled, you need install and enable it manually.
Note: The plugin is not available in IntelliJ IDEA Community Edition.
I've installed the plugin and review its documentation. As I read it, it seems as though there's still a fundamental assumption that the plugin, and all JetBrains products, make: each IDE project must be in its own directory so that it can have its own `.idea` folder in the root folder of the project. Please confirm if this is true or not.
As I mentioned in my original post, our monorepo's root directory contains our root gradle files `build.gradle.kts` & `settings.gradle.kts` for our kotlin projects, our `package.json` & `turbo.json` for our npm projects, and `pyproject.toml` & `uv.lock` for our uv-based python workspace. The various projects exist below the root, scattered across the monorepo.
We typically organize our directory tree by libraries versus back-end applications versus user interfaces, then by technology. For example, the repo has
Please advise as to how I'm supposed to create the Workspace project in this scenario, because I'm not sure that the Multi-Project Workspace will still not work in this repository as-is. My only thought is to somehow create an IntelliJ IDEA project in each project within a `jvm` directory, a WebStorm project in each project within a `web` directory, and a PyCharm project in each project within a `python` directory, then create a Workspace project in the root, and add each project to the workspace. If there's a better way, I'm all ears.
Thanks for your help so far.
⬆️ @..., any input here? What I think would be perfect would be to move away from using the `.idea` directory-based IDE project files back to file-based `.ipr` files with different filenames for each product & project (like `all-idea.ipr`, `analytics-pycharm.ipr`, `somethingelse-pycharm.ipr`, `webuis-webstorm.ipr`, `myandroidapp-studio.ipr`, etc), but I'm getting the impression that the use of project files is going away or is otherwise unsupported. If each IDE instead used different directory names, that would work, too, but they all use `.idea`. If PyCharm used `.pycharm`, and WebStorm used `.webstorm`, etc, I think I'd be in ok shape, too. Is the name of the directory containing project files configurable?
FYI, I filed https://youtrack.jetbrains.com/issue/IJPL-219182/IDEs-clobber-each-others-settings-AKA-support-monorepos-better as a result of this discussion.
Thanks for reporting this issue. Yes, currently, it is not possible to work with the same project directory in different IDEs simultaneously.
I have shared a workaround in your created issue: https://youtrack.jetbrains.com/issue/IJPL-219182/IDEs-clobber-each-others-settings-AKA-support-monorepos-better#focus=Change-27-13026997.0-0
Please try it.