From 4801593c898b48ec6f0040677d87c6c5d47eaeb6 Mon Sep 17 00:00:00 2001 From: KtorZ Date: Mon, 3 Sep 2018 22:12:14 +0200 Subject: [PATCH] Review examples and the way they're built This to avoid having to carry unneeded dependencies in the library. I use a symlink as a trick to make the module available to the examples without having to require it explicitly as a dependency This commit also makes 'deploy.sh' less verbose & fix example publication - If the tag doesn't already exist, it displays an error message in the console which we ought to ignore. - Also, the publication to gh-pages was completely broken. It will now nicely create a single commit with only the exported artefacts and get back to master. Finally, we are making examples a bit more sexy - Review overall look-and-feel (colors, fonts, sizes, etc.) - Remove the 'clientId' input and hard-code a demo clientId - Display current 'Model' next to the actual content --- deploy.sh | 21 ++-- examples/elm.json | 27 +++++ examples/images/google.png | Bin 10841 -> 0 bytes examples/implicit/Main.elm | 209 ++++++++++++++++++++++++------------- examples/src | 1 + 5 files changed, 176 insertions(+), 82 deletions(-) create mode 100644 examples/elm.json delete mode 100644 examples/images/google.png create mode 120000 examples/src diff --git a/deploy.sh b/deploy.sh index 818f49e..08db4ed 100755 --- a/deploy.sh +++ b/deploy.sh @@ -27,19 +27,24 @@ else fi ## Create tag and publish -git tag -d $version +git tag -d $version 1>/dev/null 2>&1 git tag -a $version -m "release version $version" && git push origin $version elm publish || exit 1 + ## Deploy examples git checkout "gh-pages" || exit 1 -for d in examples/*; do - if [ "$d" != "examples/images" ]; then - elm make "$d/Main.elm" - mv index.html $d - fi +git merge --squash - +git commit -m "tmp" +cd examples +for d in $(find . -type d ! -path '*elm-stuff*' ! -name '.') ; do + elm make --optimize --output $d/index.html "$d/Main.elm" + git add -f $d/index.html done -git add . && git commit -m "release version $version" -git push origin HEAD && git checkout - +git commit -m "release version $version" +git rebase HEAD~ --onto HEAD~2 +git push origin HEAD +git checkout - + echo "==========\nDONE." diff --git a/examples/elm.json b/examples/elm.json new file mode 100644 index 0000000..4bf007f --- /dev/null +++ b/examples/elm.json @@ -0,0 +1,27 @@ +{ + "type": "application", + "source-directories": [ + "src" + ], + "elm-version": "0.19.0", + "dependencies": { + "direct": { + "elm/browser": "1.0.0", + "elm/core": "1.0.0", + "elm/html": "1.0.0", + "elm/http": "1.0.0", + "elm/json": "1.0.0", + "elm/url": "1.0.0", + "truqu/elm-base64": "2.0.4" + }, + "indirect": { + "elm/regex": "1.0.0", + "elm/time": "1.0.0", + "elm/virtual-dom": "1.0.0" + } + }, + "test-dependencies": { + "direct": {}, + "indirect": {} + } +} diff --git a/examples/images/google.png b/examples/images/google.png deleted file mode 100644 index 7ef3e0106832b7eac7a52c857adef47c59f9b320..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10841 zcmdUV`9IWO^#5y&CCTtIHpn?9R z0Z!0Ezy1dQJOqFX!iIX6ErTc5XBflYSY^m>r9APxaMI=u?aB24FZZmh8g_zC(o`XO zh4i9NP2d{CRRas(ua^au`CKb6yq~*xQ8tQC$uhad5K};7Vi9%!8kyfto36p!oHj91 z+Qs4I!C=-c7=uw-*6-PUGKj_Pe4Nuq<}?lMPajq-PK3=Tsn?#yEbayzaN*&#(zB3sr=jp!L?B52^vatrdPuXhY=ob#Rh9?5@dU+(aWW0QGW*}j1&%*bdq@R;dF{8uQ_18EZ)E$f<3D?%=xpnUmDU zWc&Sv#uY9CBhK>-H5-8pio z&9;WKqN*Y%`bmkyqlwE-%wUnz{$X0X8nOMP&+s5id~CVIEzu*{B<3_lZgg`hzi0L1 ztNT^It3UsC{<&bkw!rRr1ja?P7}0yM4O%DIi98>BMI=td*wj}$%I%{Tb5 zgzV9VJv|al3bqp!#P3;*PGmFfru|Y$YHO9sR zp<6${Y0EO74^p!W44qo#AnU<6k$6O{>u4}u2y3a&&Ov9x8!W9s`*1?zQZ*$S#+i}2 za|_x*TKKaE0tq}%g zznOFYHcwr|O7u`*Ud`NM8U%43M>%QDTBNyR(TDV>77nMo%U2>QbKTIcmA?f(vU+*1 zHUGSiy>LXP{MxUAyEV3u}KVCf4AOXRBNi|9&z{g^}OU9lx;hvm)~( z&x+-pciBg~%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jUMG2BcPY^zbcG}ZiWsU$F`3P@amrIQ{A+kqEr${soeuZ5Y8 z>yYfbSWO2jo34a&;dpEuh-y775!PEY@{37u=QicPxv{#tC5e&Sxl-eF2X>p!LYU;IZE04mLgI;ymZK1eP>lW`CRHtDv5taue zMR~RLe~tGIBNhy|VA5iDx7EZN=i8IoirT}uKwjS1U->|}(ddu%2j6lCDyH3J3R zEF)0rb1V6{@XA-xm(PP250E|B+O_X*HIuT4N#F)4l&rJ(*@^Ya7zqr7Xb6u(jcpxb x)S{Dj2hZ48o2S{;6DkD$|9S2B&r-}V$Y3E7qNOzQ-u-yM@ahe{GF`_f{|CqT)e`^! diff --git a/examples/implicit/Main.elm b/examples/implicit/Main.elm index 6ccfd69..b1c9101 100644 --- a/examples/implicit/Main.elm +++ b/examples/implicit/Main.elm @@ -29,10 +29,7 @@ main = type alias Model = - { oauth : - { clientId : String - , redirectUri : Url - } + { redirectUri : Url , error : Maybe String , token : Maybe OAuth.Token , profile : Maybe Profile @@ -54,6 +51,27 @@ profileDecoder = (Json.field "picture" Json.string) +preModel : Int -> Model -> String +preModel n model = + preRecord n + "Model" + [ ( "redirectUri", preString 30 <| Url.toString model.redirectUri ) + , ( "error", preMaybe (preString 30) model.error ) + , ( "token", preMaybe (\s -> preString 30 <| OAuth.showToken s) model.token ) + , ( "profile", preMaybe (preProfile (n + 1)) model.profile ) + ] + + +preProfile : Int -> Profile -> String +preProfile n profile = + preRecord n + "Profile" + [ ( "email", preString 30 profile.email ) + , ( "name", preString 30 profile.name ) + , ( "picture", preString 30 profile.picture ) + ] + + -- Msg @@ -62,10 +80,8 @@ type Msg -- No Operation, terminal case = NoOp - -- The 'clientId' input has changed - | ClientIdChanged String - -- The 'clientId' input has been submitted - | ClientIdSubmitted + -- The 'sign-in' button has been hit + | SignInRequested -- Got a response from the googleapis user info | GotUserInfo (Result Http.Error Profile) @@ -78,7 +94,7 @@ init : () -> Url -> Key -> ( Model, Cmd Msg ) init _ origin navKey = let model = - { oauth = { clientId = "", redirectUri = origin } + { redirectUri = origin , error = Nothing , token = Nothing , profile = Nothing @@ -134,25 +150,16 @@ showParseErr oauthErr = update : Msg -> Model -> ( Model, Cmd Msg ) -update msg ({ oauth } as model) = +update msg model = case msg of NoOp -> ( model, Cmd.none ) - ClientIdChanged clientId -> - let - oauthBis = - { oauth | clientId = clientId } - in - ( { model | oauth = oauthBis } - , Cmd.none - ) - - ClientIdSubmitted -> + SignInRequested -> ( model , OAuth.Implicit.authorize - { clientId = model.oauth.clientId - , redirectUri = model.oauth.redirectUri + { clientId = clientId + , redirectUri = model.redirectUri , responseType = OAuth.Token , scope = [ "email", "profile" ] , state = Nothing @@ -183,7 +190,7 @@ view model = content = case ( model.token, model.profile ) of ( Nothing, Nothing ) -> - viewForm model.oauth.clientId + viewSignInButton ( Just token, Nothing ) -> viewFetching @@ -192,25 +199,21 @@ view model = viewProfile profile in { title = "Elm OAuth2 Example - Implicit Flow" - , body = [ viewBody content model.error ] + , body = [ viewBody model content ] } -viewBody : Html Msg -> Maybe String -> Html Msg -viewBody content error = +viewBody : Model -> Html Msg -> Html Msg +viewBody model content = div [ style "display" "flex" , style "flex-direction" "column" , style "align-items" "center" - , style "padding" "3em" + , style "justify-content" "center" + , style "height" "95vh" + , style "overflow" "hidden" ] - [ h2 - [ style "display" "flex" - , style "font-family" "Roboto, Arial, sans-serif" - , style "color" "#141414" - ] - [ text "OAuth 2.0 Implicit Flow Example" ] - , case error of + [ case model.error of Nothing -> div [ style "display" "none" ] [] @@ -227,46 +230,45 @@ viewBody content error = , style "color" "#ffffff" ] [ text msg ] - , content + , div + [ style "display" "flex" + , style "align-items" "center" + , style "justify-content" "center" + , style "width" "70%" + ] + [ content + , pre [ style "padding" "2em" ] [ text (preModel 1 model) ] + ] ] -viewForm : String -> Html Msg -viewForm clientId = - Html.form - [ onSubmit ClientIdSubmitted - , style "flex-direction" "column" - ] - [ input - [ onInput ClientIdChanged - , type_ "text" - , placeholder "clientId" - , value clientId - , style "border" "none" - , style "border-bottom" "1px solid #757575" - , style "color" "#757575" - , style "font" "1.5em" - , style "font" "Roboto Arial" - , style "outline" "none" - , style "padding" "0.5em 1em" - , style "text-align" "center" - ] - [] - , button - [ style "background" "url('/elm-oauth2/examples/images/google.png') 1em center no-repeat" - , style "background-size" "2em" - , style "border" "none" - , style "box-shadow" "rgba(0,0,0,0.25) 0px 2px 4px 0px" - , style "color" "#757575" - , style "font" "Roboto Arial" - , style "margin" "1em" - , style "outline" "none" - , style "padding" "1em 1em 1em 3em" - , style "text-align" "right" - , onClick ClientIdSubmitted - ] - [ text "Sign in" ] + +-- type alias Model = +-- { redirectUri : Url +-- , error : Maybe String +-- , token : Maybe OAuth.Token +-- , profile : Maybe Profile +-- } + + +viewSignInButton : Html Msg +viewSignInButton = + button + [ style "background" "0 center no-repeat url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAqIElEQVR42u3dCXydVZkw8JSCbCoKWVoECu3NbWmbm7QR7ECS26SA6PiNyzcdRwdFSFJwwUEd5xtnsSqo4Do6LoMbM1STtEmKogJNUoNjR/wcXD4FulFRBJGBLGVfCvnOm1YBB0uXm+Te9/z/v9/zq+BGe568z/Oec95zysoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAOK1euPGD58jXTy8rGpvnTAIAilxTtM9505bHL2ntPamlf+7KW1u6zWtp6L2xp771oaXvP51vaetYsbev9TnN774/DrzeFv7+1ub37tqXt3b9tae8eWdra/UD47zwW/v7Y72Jpa+/jLa29j4Z4cGlb9z27/vObW9p7ftLS2nNdc1vvleF/7/Lw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B/1SvCLvHLxz8RU2CLdF2//O7x0yD7K84cu6HsIJkLQOFmBkJhGR2oPD05GS65BU7hnfI3/W07N3JWNY8Nlh0oQwGY+GYgXP86tK5qYXjrfE/YQPhdxw9PzrG8Q30V3xlZX/E3yQ5+V/ACMOWSA2TCNPSfhkL1qZGB8p8r2AX5XO+JMNPy/8ZvfAxT+8kXGzINgKK2vf/oo5JDh5LiFeKHu26TU9if5Q1/uL/8B2FW5WPJ4Tyj3zvihTIJgJJ26+CsQ8Imwj8JywXvGOmr6Bzuq9w0/oYbbbGvfDx8nndzOHe/I/z1hff0VS5JNlzKFABSb3zZYH3FKWFd+82hMfhMsr4dNrbdlb6b9SrvDL+vgWTDXthEeV5S7E3nA8AfSJYPRgeqTg4zBK8Plxi9NzQHVySn2CW73otxKWHn5rzKW8Kvg+Gv/224v/Ifh9ZXvm60f8ZJpvEBoACSg23CzMGMcHzxotG+ipeG9fI3Jrviw5LCpcN9Ff8aGobVoQCvS9bSw2bEnyWFORTlO3YeaFR+fzjg6KHffbGQLEEk/zr5e8m/t+vQozuSm/GS/+74evxA5bVhD0PX+P92f+Ul4d9/1/D6ijeEk/XOGFlXUZdcueywHQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACK0f8HUiF5PDPTqGkAAAAASUVORK5CYII=')" + , style "background-size" "100px" + , style "border" "none" + , style "box-shadow" "rgba(0,0,0,0.25) 0px 2px 4px 0px" + , style "color" "#757575" + , style "font" "24px Roboto, Arial" + , style "outline" "none" + , style "cursor" "pointer" + , style "height" "100px" + , style "width" "200px" + , style "text-align" "right" + , style "padding" "0 0.5em" + , onClick SignInRequested ] + [ text "Sign in" ] viewFetching : Html Msg @@ -288,17 +290,76 @@ viewProfile profile = ] [ img [ src profile.picture - , style "height" "150px" - , style "margin" "1em" - , style "width" "150px" + , style "height" "25vh" + , style "width" "25vh" + , style "border-radius" "50%" + , style "box-shadow" "rgba(0,0,0,0.25) 0 0 4px 2px" ] [] - , text <| profile.name ++ " <" ++ profile.email ++ ">" + , div + [ style "margin" "2em" + , style "font" "24px Roboto, Arial" + , style "color" "#757575" + ] + [ text <| profile.name ] ] +-- Formatting Helpers + + +preString : Int -> String -> String +preString maxSize str = + if String.length str > maxSize then + String.left maxSize str ++ "..." + + else + str + + +preRecord : Int -> String -> List ( String, String ) -> String +preRecord n name fields = + let + preField ( k, v ) = + k ++ " = " ++ v + + padded s = + "\n" ++ String.repeat (n * 2) " " ++ s + in + case fields of + [] -> + name + + [ fst ] -> + name ++ " = { " ++ preField fst ++ " }" + + fst :: rest -> + String.concat + [ name ++ " =" ++ padded "{ " ++ preField fst ++ padded ", " + , String.join (padded ", ") (List.map preField rest) + , padded "}" + ] + + +preMaybe : (a -> String) -> Maybe a -> String +preMaybe pre m = + case m of + Nothing -> + "Nothing" + + Just a -> + "Just (" ++ pre a ++ ")" + + + -- Constants / Google APIs endpoints +-- Demo clientId, configured to target the github repository's gh-pages only + + +clientId : String +clientId = + "909608474358-sucp6e4js3nvfkfnab5t69qoelampt3t.apps.googleusercontent.com" authorizationEndpoint : Url diff --git a/examples/src b/examples/src new file mode 120000 index 0000000..5cd551c --- /dev/null +++ b/examples/src @@ -0,0 +1 @@ +../src \ No newline at end of file