From 8678c952088f51a31efaa2c0bc23cfb5a71a0f4b Mon Sep 17 00:00:00 2001 From: Dillon Kearns Date: Fri, 30 Jul 2021 15:21:16 -0700 Subject: [PATCH] Rename internal module. --- elm.json | 2 +- .../src/generate-template-module-connector.js | 14 +++++++------- src/{ => Pages/Internal}/Router.elm | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) rename src/{ => Pages/Internal}/Router.elm (95%) diff --git a/elm.json b/elm.json index 6892d88f..d298b01d 100644 --- a/elm.json +++ b/elm.json @@ -25,7 +25,7 @@ "Pages.Flags", "Pages.Internal.Platform", "Pages.Internal.Platform.Cli", - "Router", + "Pages.Internal.Router", "Pages.Internal.RoutePattern", "Pages.Internal.NotFoundReason" ], diff --git a/generator/src/generate-template-module-connector.js b/generator/src/generate-template-module-connector.js index cc256c3e..8819ef08 100644 --- a/generator/src/generate-template-module-connector.js +++ b/generator/src/generate-template-module-connector.js @@ -681,7 +681,7 @@ mapBoth fnA fnB ( a, b, c ) = import Html exposing (Attribute, Html) import Html.Attributes as Attr import Path exposing (Path) -import Router +import Pages.Internal.Router {-| -} @@ -694,7 +694,7 @@ urlToRoute : { url | path : String } -> Maybe Route urlToRoute url = url.path |> withoutBaseUrl - |> Router.firstMatch matchers + |> Pages.Internal.Router.firstMatch matchers baseUrl : String @@ -716,7 +716,7 @@ withoutBaseUrl path = path {-| -} -matchers : List (Router.Matcher Route) +matchers : List (Pages.Internal.Router.Matcher Route) matchers = [ ${sortTemplates(templates) .map( @@ -749,10 +749,10 @@ routeToPath route = : `[ "${camelToKebab(param.name)}" ]`; } case "optional": { - return `Router.maybeToList params.${param.name}`; + return `Pages.Internal.Router.maybeToList params.${param.name}`; } case "required-splat": { - return `Router.nonEmptyToList params.${param.name}`; + return `Pages.Internal.Router.nonEmptyToList params.${param.name}`; } case "dynamic": { return `[ params.${param.name} ]`; @@ -969,10 +969,10 @@ function routeRegex(name) { function prefixThing(param) { switch (param.kind) { case "optional-splat": { - return "Router.fromOptionalSplat "; + return "Pages.Internal.Router.fromOptionalSplat "; } case "required-splat": { - return "Router.toNonEmpty "; + return "Pages.Internal.Router.toNonEmpty "; } default: { return ""; diff --git a/src/Router.elm b/src/Pages/Internal/Router.elm similarity index 95% rename from src/Router.elm rename to src/Pages/Internal/Router.elm index 40f9058e..283a5fee 100644 --- a/src/Router.elm +++ b/src/Pages/Internal/Router.elm @@ -1,4 +1,4 @@ -module Router exposing (Matcher, firstMatch, fromOptionalSplat, maybeToList, nonEmptyToList, toNonEmpty) +module Pages.Internal.Router exposing (Matcher, firstMatch, fromOptionalSplat, maybeToList, nonEmptyToList, toNonEmpty) {-| Exposed for internal use only (used in generated code).