-
Notifications
You must be signed in to change notification settings - Fork 130
Add include and exclude to publish config #972
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 include and exclude to publish config #972
Conversation
@@ -94,13 +94,17 @@ type PublishConfig = | |||
{ version :: Version | |||
, license :: License | |||
, location :: Maybe Location | |||
, include :: Maybe (Array FilePath) | |||
, exclude :: Maybe (Array FilePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are really globs, right? Should we newtype and sanitize this the way it’s done in the registry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part of the PR is about specifying things in the config file. I am not sure we'd want to parse/validate things here already, all this stuff is mostly about reading things in.
Even in the registry the sanitizePath
function that you link is only used at glob-matching time, inside Registry.Foreign.FastGlob.match'
.
We use that same function to match globs here, so if I understand correctly we're already getting the sanitization for free.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh so it's impossible to add sources from a sibling project in the same project? I guess we can always relax that if the need ever arises.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be impossible to add sources from a sibling project as far as the registry (publishing) is concerned, though I suppose it’s fine for Spago
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it should be fine for Spago either, the proper mechanism for adding sibling projects is through a package dependency.
This change adds config keys
include
for specifying an array of globs matching files that shall be published in addition to the default (anything matching in/src/**.purs
)exclude
for finally specifying an array of globs to remove from the union of what's matched by the default andinclude
It's the first step to supporting this in the registry. Once this is merged, we'll add support and validation for this in the
registry-dev
repo and then finally finish with a PR tospago/app
.See #967 for discussion leading to this change.