Skip to content

Commit 94a4e63

Browse files
authored
Merge pull request #68 from lamdera/pit-lamdera-namespace
Rename LocalDev to Lamdera.Live
2 parents bd9384c + 9c5f425 commit 94a4e63

File tree

10 files changed

+23
-22
lines changed

10 files changed

+23
-22
lines changed

builder/src/Build.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ source directories when compiling the Lamdera Live harness module
12651265
-}
12661266
lamderaIsLiveHarnessModule :: Src.Module -> Bool
12671267
lamderaIsLiveHarnessModule modul =
1268-
Src.getName modul == "LocalDev"
1268+
Src.getName modul == "Lamdera.Live"
12691269

12701270

12711271
lamderaLiveHarnessEnv :: Env -> Env

extra/Lamdera/CLI/Live.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ directoryConfig =
113113

114114

115115
-- So that Elm's Navigation routing can work on any URL, serve any unmatched
116-
-- non-extensioned paths to the "index" (in this case the src/LocalDev.elm
116+
-- non-extensioned paths to the "index" (in this case the Lamdera/Live.elm
117117
-- harness as we're local in the reactor). Extensioned paths will continue to
118118
-- the next handler, namely `error404` (see `run` fn at top of file)
119119
serveUnmatchedUrlsToIndex :: FilePath -> (FilePath -> Snap()) -> Snap ()
120120
serveUnmatchedUrlsToIndex root serveElm =
121121
do file <- getSafePath
122122
guard (takeExtension file == "")
123-
serveElm (lamderaCache root </> "LocalDev.elm")
123+
serveElm (lamderaCache root </> "Lamdera" </> "Live.elm")
124124

125125

126126
prepareLocalDev :: FilePath -> IO FilePath
@@ -136,7 +136,7 @@ prepareLocalDev root = do
136136

137137
let
138138
cache = lamderaCache root
139-
harnessPath = "LocalDev.elm"
139+
harnessPath = "Lamdera" </> "Live.elm"
140140

141141
patchedContent path content =
142142
if path == harnessPath
@@ -154,19 +154,19 @@ prepareLocalDev root = do
154154

155155

156156
replaceVersionMarker :: Text -> Text
157-
replaceVersionMarker localdev = do
157+
replaceVersionMarker lamderaLive = do
158158
let (m,mi,p) = Lamdera.Version.raw
159-
localdev & T.replace
159+
lamderaLive & T.replace
160160
"( 0, 0, 0 )"
161161
(T.concat ["( ", show_ m , ", ", show_ mi , ", ", show_ p , " )"])
162162

163163

164164
replaceRpcMarker :: Bool -> Text -> Text
165-
replaceRpcMarker shouldReplace localdev =
165+
replaceRpcMarker shouldReplace lamderaLive =
166166
if not shouldReplace
167-
then localdev
167+
then lamderaLive
168168
else
169-
localdev
169+
lamderaLive
170170
& T.replace
171171
"-- MKRRI"
172172
"import RPC\n\

extra/Lamdera/Injection.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type Mains = Map.Map ModuleName.Canonical Opt.Main
4141

4242
graphModifications :: Mode.Mode -> Mains -> Map.Map Opt.Global Opt.Node -> Map.Map Opt.Global Opt.Node
4343
graphModifications mode mains graph = do
44-
if mains & mainsInclude ["LocalDev"]
44+
if mains & mainsInclude ["Lamdera.Live"]
4545
then graph & Map.mapWithKey (modify $ isOptimizedMode mode)
4646
-- & inspect
4747
else graph
@@ -161,7 +161,7 @@ source mode mains =
161161
LamderaBackend
162162
else if mains & mainsInclude ["Frontend", "LFR"] then
163163
LamderaFrontend
164-
else if mains & mainsInclude ["LocalDev"] then
164+
else if mains & mainsInclude ["Lamdera.Live"] then
165165
LamderaLive
166166
else
167167
NotLamdera
@@ -477,7 +477,7 @@ injections outputType mode =
477477
shouldProxy =
478478
onlyIf (outputType == LamderaLive)
479479
[text|
480-
shouldProxy = $$author$$project$$LocalDev$$shouldProxy(msg)
480+
shouldProxy = $$author$$project$$Lamdera$$Live$$shouldProxy(msg)
481481
|]
482482
in
483483
[text|

extra/Lamdera/UiSourceMap.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import StandaloneInstances
2828
updateDecls :: Module.Canonical -> Can.Decls -> Can.Decls
2929
updateDecls fileName decls =
3030
case fileName of
31-
Module.Canonical (Name "author" "project") "LocalDev" ->
31+
Module.Canonical (Name "author" "project") "Lamdera.Live" ->
3232
decls
3333

3434
Module.Canonical (Name "author" "project") _ ->
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"mainPaths":["runtime-src/LocalDev.elm"]}
1+
{"mainPaths":["runtime-src/Lamdera/Live.elm"]}

extra/LocalDev/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
The runtime-src/LocalDev.elm file is what gets paged in as the entry point for `lamdera live`.
2+
The runtime-src/Lamdera/Live.elm file is what gets paged in as the entry point for `lamdera live`.
33
It may import other files from the runtime-src directory.
44

55
The files in tooling-src are not used in the final compiler build, they are only here
6-
to assist editor tooling when developing runtime-src/LocalDev.elm.
6+
to assist editor tooling when developing runtime-src/Lamdera/Live.elm.

extra/LocalDev/runtime-src/LocalDev.elm renamed to extra/LocalDev/runtime-src/Lamdera/Live.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
port module LocalDev exposing (main)
1+
port module Lamdera.Live exposing (main)
22

33
{-
44

extra/dist/live.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extra/live.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,17 @@ window.setupApp = function(name, elid) {
108108
if (app !== null) { return } // Don't init when already initialised
109109
// console.log(`booting with`, { c: clientId, s: sessionId, nt: nodeType, b: initBackendModel })
110110

111-
if (name !== "LocalDev") {
111+
const elm = name.split('.').reduce((o,i)=> o[i], Elm)
112+
if (name !== "Lamdera.Live") {
112113
console.warn('Not a Lamdera app, loading as normal Elm.')
113-
app = name.split('.').reduce((o,i)=> o[i], Elm).init({ node: document.getElementById(elid) })
114+
app = elm.init({ node: document.getElementById(elid) })
114115
if (document.getElementById(elid)) {
115116
document.getElementById(elid).innerText = 'This is a headless program, meaning there is nothing to show here.\n\nI started the program anyway though, and you can access it as `app` in the developer console.'
116117
}
117118
return;
118119
}
119120

120-
app = Elm[name].init({
121+
app = elm.init({
121122
node: document.getElementById(elid),
122123
flags: { c: clientId, s: sessionId, nt: nodeType, b: initBackendModel }
123124
})

terminal/src/Develop.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ runWithRoot root (Flags maybePort) =
136136
<|> Live.openEditorHandler root
137137
<|> Live.serveExperimental root
138138
<|> serveAssets -- Compiler packaged static files
139-
<|> Live.serveUnmatchedUrlsToIndex root (serveElm sentryCache) -- Everything else without extensions goes to Lamdera LocalDev harness
139+
<|> Live.serveUnmatchedUrlsToIndex root (serveElm sentryCache) -- Everything else without extensions goes to Lamdera.Live harness
140140
<|> error404 -- Will get hit for any non-matching extensioned paths i.e. /hello.blah
141141

142142

0 commit comments

Comments
 (0)