-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support packages (was: Input file globs) #23
Comments
Hi! Can you show me a concrete example of:
|
I can in fact provide a full repository: https://github.com/unisonweb/ui-core This is consumed as a "library" via elm-git-install. Here's the elm-watch.json: https://github.com/unisonweb/ui-core/blob/main/elm-watch.json |
A glob solution might look like this: {
"targets": {
"UI": {
"inputs": [
"src/UI/**/*.elm"
],
"output": "build/ui.js"
},
"Code": {
"inputs": [
"src/Code/**/*.elm"
],
"output": "build/code.js"
},
"Lib": {
"inputs": [
"src/Lib/**/*.elm"
],
"output": "build/lib.js"
}
}
} |
Awesome, thank you! So you have The thing here is that I don’t write many packages myself – only applications. And when I’ve written packages, they haven’t been very large. Either so small that running type checking in my editor (with an occasional I do have thought a lot about if elm-watch could be used for packages as well, and for a while I even supported
So, I don’t know, maybe this it how it should be: {
"targets": {
"MyPackage": {
"type": "package",
"elm.json": "elm.json"
},
"Cool demo": {
"type": "application",
"inputs": ["demo/src/Main.elm"],
"output": "build/demo.js"
}
}
} In summary, I have a lot of thoughts around this, but I can’t make up my mind if it makes sense to build something like this or not. One thing that has been great while developing elm-watch is that I knew exactly what I needed: I had worked with Elm professionally for several years, and I knew the pain points and wishes I had from the old Elm setup at work. So I have built it exactly for my own use cases (while still keeping it general enough to be usable by others). Since I’m not a big package developer, packages was down prioritized, partly to avoid scope creep and partly since I don’t know exactly what’s needed for the package use case. While the above JSON with Finally: What we do at work is actually generating the What happens now?
|
@lydell thank you for this very thoughtful reply. I think the package option sounds really cool. For now I'll follow your suggestion of generating the file. Thank you! |
Loving this project!!
It would be really neat if it was possible to provide a folder or glob to the input array.
Context: I'm working on some library code that don't have an entry file, and listing modules out manually is a bit of a pain.
The text was updated successfully, but these errors were encountered: