mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-24 12:22:27 +03:00
Pass in all metadata to make sure files are generated correctly.
This commit is contained in:
parent
e59aebf6dc
commit
05704eb744
@ -408,7 +408,7 @@ initLegacy { secrets, mode, staticHttpCache } toModel contentCache siteMetadata
|
||||
-- TODO need to handle errors better?
|
||||
StaticResponses.init staticHttpCache siteMetadata config []
|
||||
in
|
||||
StaticResponses.nextStep config (siteMetadata |> Result.map (List.take 1)) mode secrets staticHttpCache [] staticResponses
|
||||
StaticResponses.nextStep config siteMetadata (siteMetadata |> Result.map (List.take 1)) mode secrets staticHttpCache [] staticResponses
|
||||
|> nextStepToEffect contentCache config (Model staticResponses secrets [] staticHttpCache mode [] (siteMetadata |> Result.withDefault []))
|
||||
|> Tuple.mapFirst toModel
|
||||
|
||||
@ -476,6 +476,7 @@ updateAndSendPortIfDone contentCache config siteMetadata model toModel =
|
||||
in
|
||||
StaticResponses.nextStep
|
||||
config
|
||||
siteMetadata
|
||||
(Ok nextToProcess)
|
||||
model.mode
|
||||
model.secrets
|
||||
@ -563,6 +564,7 @@ update contentCache siteMetadata config msg model =
|
||||
drop1 updatedModel
|
||||
in
|
||||
StaticResponses.nextStep config
|
||||
siteMetadata
|
||||
(Ok nextToProcess)
|
||||
updatedModel.mode
|
||||
updatedModel.secrets
|
||||
@ -584,6 +586,7 @@ update contentCache siteMetadata config msg model =
|
||||
drop1 model
|
||||
in
|
||||
StaticResponses.nextStep config
|
||||
siteMetadata
|
||||
(Ok nextToProcess)
|
||||
updatedModel.mode
|
||||
updatedModel.secrets
|
||||
|
@ -211,16 +211,17 @@ nextStep :
|
||||
)
|
||||
}
|
||||
-> Result (List BuildError) (List ( PagePath pathKey, metadata ))
|
||||
-> Result (List BuildError) (List ( PagePath pathKey, metadata ))
|
||||
-> Mode
|
||||
-> SecretsDict
|
||||
-> RequestsAndPending
|
||||
-> List BuildError
|
||||
-> StaticResponses
|
||||
-> NextStep pathKey
|
||||
nextStep config siteMetadata mode secrets allRawResponses errors (StaticResponses staticResponses) =
|
||||
nextStep config allSiteMetadata siteMetadata mode secrets allRawResponses errors (StaticResponses staticResponses) =
|
||||
let
|
||||
metadataForGenerateFiles =
|
||||
siteMetadata
|
||||
allSiteMetadata
|
||||
|> Result.withDefault []
|
||||
|> List.map
|
||||
-- TODO extract helper function that processes next step *for a single page* at a time
|
||||
|
@ -31,7 +31,7 @@ all =
|
||||
[ test "andThen" <|
|
||||
\() ->
|
||||
StaticResponses.init Dict.empty (Ok []) config []
|
||||
|> StaticResponses.nextStep config (Ok []) Mode.Dev (SecretsDict.unmasked Dict.empty) Dict.empty []
|
||||
|> StaticResponses.nextStep config (Ok []) (Ok []) Mode.Dev (SecretsDict.unmasked Dict.empty) Dict.empty []
|
||||
|> Expect.equal
|
||||
(StaticResponses.Finish
|
||||
(ToJsPayload.Success
|
||||
|
Loading…
Reference in New Issue
Block a user