From 1d36cb346e90b0c9e56561a8557c2f451c501c37 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Wed, 13 Dec 2017 17:42:55 -0500 Subject: [PATCH] Use modern packaging practices - Move sources under src - Use hpack via package.yaml - Remove the network-uri flag --- .gitignore | 7 +- package.yaml | 72 ++++++++++++++ {URI => src/URI}/ByteString/Extension.hs | 0 {Yesod => src/Yesod}/Auth/OAuth2.hs | 0 {Yesod => src/Yesod}/Auth/OAuth2/BattleNet.hs | 0 {Yesod => src/Yesod}/Auth/OAuth2/Bitbucket.hs | 0 {Yesod => src/Yesod}/Auth/OAuth2/EveOnline.hs | 0 {Yesod => src/Yesod}/Auth/OAuth2/Github.hs | 0 {Yesod => src/Yesod}/Auth/OAuth2/Google.hs | 0 {Yesod => src/Yesod}/Auth/OAuth2/Nylas.hs | 0 .../Yesod}/Auth/OAuth2/Salesforce.hs | 0 {Yesod => src/Yesod}/Auth/OAuth2/Slack.hs | 0 {Yesod => src/Yesod}/Auth/OAuth2/Spotify.hs | 0 {Yesod => src/Yesod}/Auth/OAuth2/Upcase.hs | 0 stack.yaml | 3 - yesod-auth-oauth2.cabal | 96 ------------------- 16 files changed, 73 insertions(+), 105 deletions(-) create mode 100644 package.yaml rename {URI => src/URI}/ByteString/Extension.hs (100%) rename {Yesod => src/Yesod}/Auth/OAuth2.hs (100%) rename {Yesod => src/Yesod}/Auth/OAuth2/BattleNet.hs (100%) rename {Yesod => src/Yesod}/Auth/OAuth2/Bitbucket.hs (100%) rename {Yesod => src/Yesod}/Auth/OAuth2/EveOnline.hs (100%) rename {Yesod => src/Yesod}/Auth/OAuth2/Github.hs (100%) rename {Yesod => src/Yesod}/Auth/OAuth2/Google.hs (100%) rename {Yesod => src/Yesod}/Auth/OAuth2/Nylas.hs (100%) rename {Yesod => src/Yesod}/Auth/OAuth2/Salesforce.hs (100%) rename {Yesod => src/Yesod}/Auth/OAuth2/Slack.hs (100%) rename {Yesod => src/Yesod}/Auth/OAuth2/Spotify.hs (100%) rename {Yesod => src/Yesod}/Auth/OAuth2/Upcase.hs (100%) delete mode 100644 yesod-auth-oauth2.cabal diff --git a/.gitignore b/.gitignore index 537ac9d..bccf700 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,3 @@ -*.swp -.cabal-sandbox +*.cabal .env* .stack-work -cabal-dev/ -cabal.sandbox.config -dist/ -tags diff --git a/package.yaml b/package.yaml new file mode 100644 index 0000000..a411e84 --- /dev/null +++ b/package.yaml @@ -0,0 +1,72 @@ +--- +name: yesod-auth-oauth2 +version: '0.3.0' +synopsis: OAuth 2.0 authentication plugins +description: Library to authenticate with OAuth 2.0 for Yesod web applications. +category: Web +author: Tom Streller +maintainer: Pat Brisbin +license: BSD3 +github: thoughtbot/yesod-auth-oauth2.git +homepage: http://github.com/thoughtbot/yesod-auth-oauth2 + +dependencies: + - base >=4.5 && <5 + +library: + source-dirs: src + dependencies: + - aeson >=0.6 && <1.3 + - authenticate >=1.3.2.7 && <1.4 + - bytestring >=0.9.1.4 + - hoauth2 >=1.3.0 && <1.6 + - http-client >=0.4.0 && <0.6 + - http-conduit >=2.0 && <3.0 + - http-types >=0.8 && <0.10 + - lifted-base >=0.2 && <0.4 + - microlens + - network-uri >=2.6 + - random + - text >=0.7 && <2.0 + - transformers >=0.2.2 && <0.6 + - uri-bytestring + - vector >=0.10 && <0.13 + - yesod-auth >=1.3 && <1.5 + - yesod-core >=1.2 && <1.5 + - yesod-form >=1.3 && <1.5 + +executables: + yesod-auth-oauth2-example: + main: main.hs + source-dirs: example + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + dependencies: + - yesod-auth-oauth2 + - containers + - http-conduit + - load-env + - text + - warp + - yesod + - yesod-auth + when: + - condition: ! '!(flag(example))' + buildable: false + +tests: + test: + main: Spec.hs + source-dirs: test + dependencies: + - yesod-auth-oauth2 + - hspec + - uri-bytestring + +flags: + example: + description: Build the example application + manual: false + default: false diff --git a/URI/ByteString/Extension.hs b/src/URI/ByteString/Extension.hs similarity index 100% rename from URI/ByteString/Extension.hs rename to src/URI/ByteString/Extension.hs diff --git a/Yesod/Auth/OAuth2.hs b/src/Yesod/Auth/OAuth2.hs similarity index 100% rename from Yesod/Auth/OAuth2.hs rename to src/Yesod/Auth/OAuth2.hs diff --git a/Yesod/Auth/OAuth2/BattleNet.hs b/src/Yesod/Auth/OAuth2/BattleNet.hs similarity index 100% rename from Yesod/Auth/OAuth2/BattleNet.hs rename to src/Yesod/Auth/OAuth2/BattleNet.hs diff --git a/Yesod/Auth/OAuth2/Bitbucket.hs b/src/Yesod/Auth/OAuth2/Bitbucket.hs similarity index 100% rename from Yesod/Auth/OAuth2/Bitbucket.hs rename to src/Yesod/Auth/OAuth2/Bitbucket.hs diff --git a/Yesod/Auth/OAuth2/EveOnline.hs b/src/Yesod/Auth/OAuth2/EveOnline.hs similarity index 100% rename from Yesod/Auth/OAuth2/EveOnline.hs rename to src/Yesod/Auth/OAuth2/EveOnline.hs diff --git a/Yesod/Auth/OAuth2/Github.hs b/src/Yesod/Auth/OAuth2/Github.hs similarity index 100% rename from Yesod/Auth/OAuth2/Github.hs rename to src/Yesod/Auth/OAuth2/Github.hs diff --git a/Yesod/Auth/OAuth2/Google.hs b/src/Yesod/Auth/OAuth2/Google.hs similarity index 100% rename from Yesod/Auth/OAuth2/Google.hs rename to src/Yesod/Auth/OAuth2/Google.hs diff --git a/Yesod/Auth/OAuth2/Nylas.hs b/src/Yesod/Auth/OAuth2/Nylas.hs similarity index 100% rename from Yesod/Auth/OAuth2/Nylas.hs rename to src/Yesod/Auth/OAuth2/Nylas.hs diff --git a/Yesod/Auth/OAuth2/Salesforce.hs b/src/Yesod/Auth/OAuth2/Salesforce.hs similarity index 100% rename from Yesod/Auth/OAuth2/Salesforce.hs rename to src/Yesod/Auth/OAuth2/Salesforce.hs diff --git a/Yesod/Auth/OAuth2/Slack.hs b/src/Yesod/Auth/OAuth2/Slack.hs similarity index 100% rename from Yesod/Auth/OAuth2/Slack.hs rename to src/Yesod/Auth/OAuth2/Slack.hs diff --git a/Yesod/Auth/OAuth2/Spotify.hs b/src/Yesod/Auth/OAuth2/Spotify.hs similarity index 100% rename from Yesod/Auth/OAuth2/Spotify.hs rename to src/Yesod/Auth/OAuth2/Spotify.hs diff --git a/Yesod/Auth/OAuth2/Upcase.hs b/src/Yesod/Auth/OAuth2/Upcase.hs similarity index 100% rename from Yesod/Auth/OAuth2/Upcase.hs rename to src/Yesod/Auth/OAuth2/Upcase.hs diff --git a/stack.yaml b/stack.yaml index 1b47e39..98c8e2e 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,8 +1,5 @@ --- resolver: lts-9.18 -flags: - yesod-auth-oauth2: - network-uri: true packages: - . extra-deps: diff --git a/yesod-auth-oauth2.cabal b/yesod-auth-oauth2.cabal deleted file mode 100644 index 93b97a8..0000000 --- a/yesod-auth-oauth2.cabal +++ /dev/null @@ -1,96 +0,0 @@ -name: yesod-auth-oauth2 -version: 0.3.0 -license: BSD3 -license-file: LICENSE -author: Tom Streller -maintainer: Pat Brisbin -synopsis: OAuth 2.0 authentication plugins -description: Library to authenticate with OAuth 2.0 for Yesod web applications. -category: Web -stability: Experimental -cabal-version: >= 1.8 -build-type: Simple -homepage: http://github.com/thoughtbot/yesod-auth-oauth2 - -flag network-uri - description: Get Network.URI from the network-uri package - default: True - -flag example - description: Build the example application - default: False - -library - if flag(network-uri) - build-depends: network-uri >= 2.6 - else - build-depends: network < 2.6 - - build-depends: base >= 4.5 && < 5 - , bytestring >= 0.9.1.4 - , http-client >= 0.4.0 && < 0.6 - , http-conduit >= 2.0 && < 3.0 - , http-types >= 0.8 && < 0.10 - , aeson >= 0.6 && < 1.3 - , yesod-core >= 1.2 && < 1.5 - , authenticate >= 1.3.2.7 && < 1.4 - , random - , yesod-auth >= 1.3 && < 1.5 - , text >= 0.7 && < 2.0 - , yesod-form >= 1.3 && < 1.5 - , transformers >= 0.2.2 && < 0.6 - , hoauth2 >= 1.3.0 && < 1.6 - , lifted-base >= 0.2 && < 0.4 - , vector >= 0.10 && < 0.13 - , uri-bytestring - , microlens - - exposed-modules: Yesod.Auth.OAuth2 - Yesod.Auth.OAuth2.Github - Yesod.Auth.OAuth2.Google - Yesod.Auth.OAuth2.Spotify - Yesod.Auth.OAuth2.Upcase - Yesod.Auth.OAuth2.EveOnline - Yesod.Auth.OAuth2.Nylas - Yesod.Auth.OAuth2.Slack - Yesod.Auth.OAuth2.Salesforce - Yesod.Auth.OAuth2.Bitbucket - Yesod.Auth.OAuth2.BattleNet - URI.ByteString.Extension - -- ^ exposed for testing - - ghc-options: -Wall - -executable yesod-auth-oauth2-example - if flag(example) - buildable: True - else - buildable: False - - hs-source-dirs: example - main-is: main.hs - ghc-options: -threaded -rtsopts -with-rtsopts=-N - build-depends: base - , containers - , http-conduit - , load-env - , text - , warp - , yesod - , yesod-auth - , yesod-auth-oauth2 - -test-suite test - type: exitcode-stdio-1.0 - main-is: Spec.hs - hs-source-dirs: test - ghc-options: -Wall - build-depends: base - , yesod-auth-oauth2 - , hspec - , uri-bytestring - other-modules: URI.ByteString.ExtensionSpec - -source-repository head - type: git - location: https://github.com/thoughtbot/yesod-auth-oauth2.git