Skip to content

Conversation

@i-am-the-slime
Copy link
Contributor

Adds support for exclude files which enables colocation (#602)

excludeFiles is an array of globs. The corresponding expanded paths will be subtracted from all included paths (implicit and explicit via files).

That way it's possible to keep related files close together but not ship them in the package 🥳.

Right now this depends on a forked version of spaghetto which depends on this fork. I'm not sure in what order this could be merged.

@f-f
Copy link
Member

f-f commented Jun 28, 2023

Thanks for putting this together @i-am-the-slime! I am on holiday away from screens this week, so I'll be able to review all of this once I'm back on Sunday 🙂

@f-f
Copy link
Member

f-f commented Jul 3, 2023

@i-am-the-slime the dependency order is spago-core -> registry -> spago, so we'll want to merge a PR to spago-core first, then one to registry (this one), then one to spago

@thomashoneyman
Copy link
Member

I think we should use the same names (include / exclude), which would mean changing the Manifest type (and the associated dhall spec and description in SPEC.md). If you’d like to do that, great! If you’d rather I do it since I know where all the relevant files are then I can — just let me know.

@i-am-the-slime
Copy link
Contributor Author

@thomashoneyman I won't say no to this offer. Especially because I'm having trouble with the new spago in IntelliJ which is what I'm used to using these days.

@thomashoneyman
Copy link
Member

I ended up going with includeFiles and excludeFiles — once I was in the code, it felt more obvious what they were. @f-f, do you want to give this a look, especially how I reworded SPEC.md?

SPEC.md Outdated
Note:

- Globs you provide at the `includeFiles` and `excludeFiles` keys must contain only `*`, `**`, `/`, `.`, `..`, and characters for Linux file paths. It is not possible to negate a glob (ie. the `!` character), and globs cannot represent a path out of the package source directory.
- When packaging your project source, the registry will first "include" your `src` directory and always-included files such as your `purs.json` file. Then it will include files which match globs indicated by the `includeFiles` key. Finally, it will apply the excluding globs indicated by the `excludeFiles` key to the included files (always-included files cannot be excluded).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should link to the list of "always included" files if we have it anywhere

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do, and I've added links to both the always-included and always-ignored files.

@thomashoneyman thomashoneyman merged commit 8177cd3 into purescript:master Aug 1, 2023
@thomashoneyman thomashoneyman mentioned this pull request Sep 13, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants