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

Add "sources" config key #173

Closed
f-f opened this issue Apr 9, 2019 · 4 comments · Fixed by #273
Closed

Add "sources" config key #173

f-f opened this issue Apr 9, 2019 · 4 comments · Fixed by #273

Comments

@f-f
Copy link
Member

f-f commented Apr 9, 2019

Spago includes some default path globs in the build:

  • src/**/*.purs
  • test/**/*.purs

However, if you don't have those directories, it will complain:

purs compile: No files found using pattern: src/**/*.purs
purs compile: No files found using pattern: test/**/*.purs

I propose we instead make this explicit (and configurable) by adding a sources (or paths) key to the configuration, and removing the implicit paths.
We should migrate existing configurations so the change is backwards compatible.

@jmackie
Copy link

jmackie commented Apr 12, 2019

+1

@f-f
Copy link
Member Author

f-f commented Apr 12, 2019

Related to this: I just discovered that purs build --watch doesn't work if you are missing one of the defaults folders.

I'll add a "bug" label because I think the fix for this issue should also address it.

@f-f f-f added the bug label Apr 12, 2019
@f-f f-f added this to the 0.8 milestone Apr 18, 2019
@f-f f-f modified the milestones: 0.8, 0.9 May 13, 2019
@bbarker
Copy link
Contributor

bbarker commented May 20, 2019

Perhaps this can also be disabled somehow, since in the case where one's tests has additional dependencies, it should be structured as a separate project described in https://github.com/spacchetti/spago/#separate-devdependencies-or-test-dependencies ?

@f-f
Copy link
Member Author

f-f commented May 20, 2019

@bbarker Once we enable this you'd explicitly have the globs in your spago.dhall, e.g. for a test-only project:

{ name = "my-tests"
, packages = ../packages.dhall
, dependencies = [ "console", "effect", "prelude" ]
, sources = [ "test/**/*.purs" ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants