You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Allow possibility to exclude files
* Add test for exclude functionality
* Take files and excludeFiles into account when converting spago config to manifest
* Rename excludedFiles to excludeFiles
* Don't error out when excluding files outside of package directory
* Ensure mandatory files are always included
* Rename files and excludeFiles to include and exclude
* Use excludeFiles / includeFiles
* Add links to always-ignored and always-included files
* Apply suggestions from code review
Co-authored-by: Fabrizio Ferrai <[email protected]>
---------
Co-authored-by: Thomas Honeyman <[email protected]>
Co-authored-by: Fabrizio Ferrai <[email protected]>
Copy file name to clipboardExpand all lines: SPEC.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,10 +199,15 @@ All packages in the registry contain a `purs.json` manifest file in their root d
199
199
-`location`: a valid [`Location`](#location)
200
200
-`owners` (optional): a non-empty array of [`Owner`](#owner)
201
201
-`description` (optional): a description of your library as a plain text string, not markdown, up to 300 characters
202
-
-`files` (optional): a non-empty array of globs, where globs are used to match files outside the `src` directory you want included in your package tarball
203
-
- Globs 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.
202
+
-`includeFiles` (optional): a non-empty array of globs, where globs are used to match file paths (in addition to the `src` directory and other [always-included files](#always-included-files)) that you want included in your package tarball
203
+
-`excludeFiles` (optional): a non-empty array of globs, where globs are used to match file paths in your package source to exclude them (in addition to the [always-ignored files](#always-ignored-files)) from your package tarball.
204
204
-`dependencies`: dependencies of your package as key-value pairs where the keys are [`PackageName`](#packagename)s and values are [`Range`](#range)s; this is a required field, but if you have no dependencies you can provide an empty object.
205
-
- All dependencies you provide must exist in the registry, and the dependency ranges must be solvable (ie. it must be possible to produce a single version of each dependency that satisfies the provided version bounds, including any transitive dependencies).
205
+
206
+
Note:
207
+
208
+
- 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.
209
+
- 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 ([always-ignored files](#always-ignored-files) cannot be included). Finally, it will apply the excluding globs indicated by the `excludeFiles` key to the included files ([always-included files](#always-included-files) cannot be excluded).
210
+
- Dependencies you provide at the `dependencies` key must exist in the registry, and the dependency ranges must be solvable (ie. it must be possible to produce a single version of each dependency that satisfies the provided version bounds, including any transitive dependencies).
-- Since we will only subtract the excluded globs we can safely ignore the failed globs
922
+
Log.warn $ "The following paths matched by globs in the 'exclude' key are outside your package directory: " <> String.joinWith ", " failed
923
+
case validateNoExcludedObligatoryFiles succeeded of
924
+
Right _ -> pure succeeded
925
+
Left removedObligatoryFiles ->do
926
+
Log.warn $ "The following paths matched by globs in the 'excludeFiles' key will be included in the tarball and cannot be excluded: " <> String.joinWith ", " (NonEmptySet.toUnfoldable removedObligatoryFiles)
927
+
pure $ succeeded Array.\\ NonEmptySet.toUnfoldable removedObligatoryFiles
928
+
929
+
userFiles <-case includeFiles of
930
+
Nothing-> pure []
931
+
Just nonEmptyGlobs ->do
932
+
let globs = map NonEmptyString.toString $ NonEmptyArray.toArray nonEmptyGlobs
Operation.Validation.validatePursModules fullPaths >>= case _ of
927
947
Left formattedError ->
928
-
Except.throw $ "Some PureScript modules listed in the 'files' section of your manifest contain malformed or disallowed module names." <> formattedError
948
+
Except.throw $ "Some PureScript modules listed in the 'includeFiles' section of your manifest contain malformed or disallowed module names." <> formattedError
0 commit comments