Move SharedTemplate to copied gen folder.

This commit is contained in:
Dillon Kearns 2021-05-15 20:07:11 -07:00
parent 3a8db2f7cb
commit 62675b6a16
6 changed files with 9 additions and 185 deletions

View File

@ -1,46 +0,0 @@
module SharedTemplate exposing (..)
import Browser.Navigation
import DataSource
import Document exposing (Document)
import Html exposing (Html)
import Pages.PagePath exposing (PagePath)
import Route exposing (Route)
type alias SharedTemplate msg sharedModel sharedData sharedMsg mappedMsg =
{ init :
Maybe Browser.Navigation.Key
->
Maybe
{ path :
{ path : PagePath
, query : Maybe String
, fragment : Maybe String
}
, metadata : Maybe Route
}
-> ( sharedModel, Cmd msg )
, update : msg -> sharedModel -> ( sharedModel, Cmd msg )
, view :
sharedData
->
{ path : PagePath
, frontmatter : Maybe Route
}
-> sharedModel
-> (msg -> mappedMsg)
-> Document mappedMsg
-> { body : Html mappedMsg, title : String }
, data : DataSource.DataSource sharedData
, subscriptions : PagePath -> sharedModel -> Sub msg
, onPageChange :
Maybe
({ path : PagePath
, query : Maybe String
, fragment : Maybe String
}
-> msg
)
, sharedMsg : sharedMsg -> msg
}

View File

@ -1,46 +0,0 @@
module SharedTemplate exposing (..)
import Browser.Navigation
import DataSource
import Document exposing (Document)
import Html exposing (Html)
import Pages.PagePath exposing (PagePath)
import Route exposing (Route)
type alias SharedTemplate msg sharedModel sharedData sharedMsg mappedMsg =
{ init :
Maybe Browser.Navigation.Key
->
Maybe
{ path :
{ path : PagePath
, query : Maybe String
, fragment : Maybe String
}
, metadata : Maybe Route
}
-> ( sharedModel, Cmd msg )
, update : msg -> sharedModel -> ( sharedModel, Cmd msg )
, view :
sharedData
->
{ path : PagePath
, frontmatter : Maybe Route
}
-> sharedModel
-> (msg -> mappedMsg)
-> Document mappedMsg
-> { body : Html mappedMsg, title : String }
, data : DataSource.DataSource sharedData
, subscriptions : PagePath -> sharedModel -> Sub msg
, onPageChange :
Maybe
({ path : PagePath
, query : Maybe String
, fragment : Maybe String
}
-> msg
)
, sharedMsg : sharedMsg -> msg
}

View File

@ -1,46 +0,0 @@
module SharedTemplate exposing (..)
import Browser.Navigation
import DataSource
import Document exposing (Document)
import Html exposing (Html)
import Pages.PagePath exposing (PagePath)
import Route exposing (Route)
type alias SharedTemplate msg sharedModel sharedData sharedMsg mappedMsg =
{ init :
Maybe Browser.Navigation.Key
->
Maybe
{ path :
{ path : PagePath
, query : Maybe String
, fragment : Maybe String
}
, metadata : Maybe Route
}
-> ( sharedModel, Cmd msg )
, update : msg -> sharedModel -> ( sharedModel, Cmd msg )
, view :
sharedData
->
{ path : PagePath
, frontmatter : Maybe Route
}
-> sharedModel
-> (msg -> mappedMsg)
-> Document mappedMsg
-> { body : Html mappedMsg, title : String }
, data : DataSource.DataSource sharedData
, subscriptions : PagePath -> sharedModel -> Sub msg
, onPageChange :
Maybe
({ path : PagePath
, query : Maybe String
, fragment : Maybe String
}
-> msg
)
, sharedMsg : sharedMsg -> msg
}

View File

@ -1,4 +1,4 @@
module SharedTemplate exposing (..)
module SharedTemplate exposing (SharedTemplate)
import Browser.Navigation
import DataSource

View File

@ -23,6 +23,14 @@ async function writeFiles() {
path.join(__dirname, `./Page.elm`),
`./elm-stuff/elm-pages/Page.elm`
);
fs.copyFileSync(
path.join(__dirname, `./SharedTemplate.elm`),
`./gen/SharedTemplate.elm`
);
fs.copyFileSync(
path.join(__dirname, `./SharedTemplate.elm`),
`./elm-stuff/elm-pages/SharedTemplate.elm`
);
// prevent compilation errors if migrating from previous elm-pages version
deleteIfExists("./elm-stuff/elm-pages/Pages/ContentCache.elm");

View File

@ -1,46 +0,0 @@
module SharedTemplate exposing (..)
import Browser.Navigation
import DataSource
import Document exposing (Document)
import Html exposing (Html)
import Pages.PagePath exposing (PagePath)
import Route exposing (Route)
type alias SharedTemplate msg sharedModel sharedData sharedMsg mappedMsg =
{ init :
Maybe Browser.Navigation.Key
->
Maybe
{ path :
{ path : PagePath
, query : Maybe String
, fragment : Maybe String
}
, metadata : Maybe Route
}
-> ( sharedModel, Cmd msg )
, update : msg -> sharedModel -> ( sharedModel, Cmd msg )
, view :
sharedData
->
{ path : PagePath
, frontmatter : Maybe Route
}
-> sharedModel
-> (msg -> mappedMsg)
-> Document mappedMsg
-> { body : Html mappedMsg, title : String }
, data : DataSource.DataSource sharedData
, subscriptions : PagePath -> sharedModel -> Sub msg
, onPageChange :
Maybe
({ path : PagePath
, query : Maybe String
, fragment : Maybe String
}
-> msg
)
, sharedMsg : sharedMsg -> msg
}