purescript / spago

🍝 PureScript package manager and build tool
BSD 3-Clause "New" or "Revised" License
792 stars 132 forks source link

Monorepo setup issue with duplicate `Test.Main` module #1282

Closed onslaughtq closed 2 months ago

onslaughtq commented 2 months ago

When attempting to create a monorepo, if we have two packages, each with their own Test.Main module (test/Test/Main.purs), spago build reports an error Module Test.Main has been defined multiple times

f-f commented 2 months ago

This is expected - you can't have two modules with the same name in a single build, so you should rename one of them.

You can configure each package to have a different entry point for tests, e.g. see how it's done in Spago itself - the package.test.main key will point to the entrypoint module: https://github.com/purescript/spago/blob/188e61d9eeb278bf526389875baaa2f412398fd0/docs-search/index/spago.yaml#L34-L39

I'll close this ticket as I believe the above will be sufficient to solve the issue, but let's reopen it if we think there's something we can improve. (docs possibly?)