-
Notifications
You must be signed in to change notification settings - Fork 134
Description
In an attempt to solve #416, I described in this comment the idea of "output targets" (since target already refers to the output file one produces when bundling an app).
Problem
If you want to add "developer dependencies," "test dependencies," or do a mono-repo, you have to define one spago.dhall config file for each output target. Hence, one may find a spago.dhall file, a test.dhall file, an examples.dhall file, and sometimes a benchmark.dhall file.
Rather than duplicating our work, this feature would define all of those targets within a single spago.dhall file.
Below is an example of what spago.dhall would look like after this change:
{-
Welcome to a Spago project!
You can edit this file as you like.
-}
let packages = ./packages.dhall
let main = { packages = packages
, dependencies = [ "dep1" ,"dep2" ]
, sources = [ "src/**/*.purs" ]
}
let test = { packages = packages
, dependencies = main.dependencies # [ "spec" ]
, sources = main.sources # [ "test/**/*.purs" ]
}
-- let otherTarget = --
in { name = "my-project"
, outputs =
{ main = main
, test = test
-- , otherTarget = otherTarget
}
}Unanswered Questions
- When would we want to implement this change and how would we handle the transition process since it will be a big breaking change?
- How should publishing change in light of this? Could we publish multiple projects from the same repo? (e.g. Halogen Hooks and it's corresponding testing library)
- What would the command line argument look like?
For 3, we could "desugar" commands:
spago build->spago --output main buildspago run->spago -o main runspago test->spago -o test run
I don't think this feature should remove the -x config.dhall part. Both features could exist at the same time.