Set arbitraryFileRequest in module rule schema

This commit is contained in:
Jeroen Engels 2023-06-02 16:29:52 +02:00
parent 5a30c8495d
commit 9525bda2f5

View File

@ -1125,7 +1125,7 @@ fromModuleRuleSchema ((ModuleRuleSchema schema) as moduleVisitor) =
, initialProjectContext = initialModuleContext
, elmJsonVisitor = compactProjectDataVisitors (Maybe.map .project) schema.elmJsonVisitor
, arbitraryFilesVisitor = compactArbitraryFilesVisitor schema.arbitraryFilesVisitor
, arbitraryFileRequest = Maybe.map Tuple.second schema.arbitraryFilesVisitor |> Maybe.withDefault []
, arbitraryFileRequest = schema.arbitraryFileRequest
, readmeVisitor = compactProjectDataVisitors (Maybe.map .content) schema.readmeVisitor
, directDependenciesVisitor = compactProjectDataVisitors identity schema.directDependenciesVisitor
, dependenciesVisitor = compactProjectDataVisitors identity schema.dependenciesVisitor
@ -2365,7 +2365,11 @@ withArbitraryFilesModuleVisitor requestedFiles baseVisitor (ModuleRuleSchema sch
visitor files context =
baseVisitor (List.filter (globMatch requestedFiles) files) context
in
ModuleRuleSchema { schema | arbitraryFilesVisitor = Just (combineArbitraryFilesModuleVisitor requestedFiles visitor schema) }
ModuleRuleSchema
{ schema
| arbitraryFilesVisitor = Just (combineArbitraryFilesModuleVisitor requestedFiles visitor schema)
, arbitraryFileRequest = requestedFiles ++ schema.arbitraryFileRequest
}
combineArbitraryFilesModuleVisitor : ArbitraryFileRequest -> (a -> context -> context) -> { b | arbitraryFilesVisitor : Maybe ( a -> context -> context, ArbitraryFileRequest ) } -> ( a -> context -> context, ArbitraryFileRequest )