Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9473d86
Instance of Generic for Value already exists with aeson update
FintanH Aug 3, 2017
9daa604
Updated resolver to Nightly 2017-07-31 to get to ghc-8.2.1
FintanH Aug 3, 2017
10daf82
Added equational constraint as a solution to build error
FintanH Aug 3, 2017
c2e227d
Fix build with Aeson 1.2.1.0.
chpatrick Aug 14, 2017
c7564bc
Add 401 Unauthorized.
chpatrick Aug 14, 2017
4ec02f2
Add 403 Forbidden.
chpatrick Aug 14, 2017
bf91768
split datatypes definitions out from router...
bitonic Sep 6, 2017
3cba1bd
add library to make requests against solga endpoints
bitonic Sep 8, 2017
cd2002b
add ghcjs version of client library
bitonic Sep 9, 2017
1ebbbaa
make the multipart types better
bitonic Sep 10, 2017
ff05f9c
Merge remote-tracking branch 'origin/aeson-1.2.1.0' into francesco
bitonic Sep 11, 2017
eeeb8c5
simple travis, build on nightly and lts 9
bitonic Sep 11, 2017
4257d7e
use jsval-json for JSON stuf
bitonic Sep 16, 2017
1302c75
export request in ghcjs solga
bitonic Sep 16, 2017
3580b83
move FromSegment to Core
bitonic Sep 17, 2017
2d37ca3
add fromsegment for jsstring
bitonic Sep 19, 2017
3b286eb
use ghcjs-dom to perform xhr
bitonic Sep 26, 2017
1538232
export types
bitonic Sep 26, 2017
21efab9
Eq/Show instances for XHRError
bitonic Sep 26, 2017
bb4eed9
do async requests
bitonic Sep 26, 2017
1a1df45
add js file to js-sources
bitonic Sep 26, 2017
a314922
start path from /
bitonic Sep 26, 2017
8b761dc
simpler multipart data
bitonic Sep 27, 2017
4f1a86d
build solga-client-ghcjs with normal ghc too
bitonic Oct 1, 2017
0a84eba
disallow setting "host" in xhr request...
bitonic Oct 2, 2017
f5d02e6
do not prefix XHR path with /
bitonic Oct 2, 2017
b0b2c91
correct uri escaping in haskell
bitonic Oct 2, 2017
3b16a74
abort request on exception
bitonic Oct 4, 2017
9ec5547
8.2 fix
bitonic Nov 12, 2017
8753517
requestBody -> strictRequestBody
chpatrick Jan 21, 2018
ae259ca
add router to redirect on trailing slashes
bitonic Jan 23, 2018
4b1396a
do not catch all exceptions...
bitonic Apr 22, 2018
a00277b
disable 500 tests for now in solga-client tests
bitonic Apr 22, 2018
68ee849
wrap paths parameter in braces as required by swagger spec
bitonic Apr 25, 2019
2a0b6fd
update stack.yaml to make it work with stack 2
bitonic Jul 4, 2019
835ec86
solga-client-ghcjs: allow users to set base url for request
bitonic Jul 10, 2019
5ebda23
Add WithReferer.
chpatrick May 6, 2018
7b68cf2
wip
bitonic Apr 7, 2020
731fb54
Allow to "hide" routes from the client
bitonic Apr 8, 2020
8dbb7c9
Add support for TypeScript
bitonic Apr 8, 2020
5bf3ec3
routes => route in TypeScript
bitonic Apr 8, 2020
5121888
export TypeScript types
bitonic Apr 8, 2020
4198a41
allow to provide additional TypeScript types
bitonic Apr 8, 2020
ac0ff60
Fix bad instance for `Hidden`
bitonic Apr 22, 2020
9ae00ea
solga-typescript: Specify how to send data at the end...
bitonic Jan 26, 2021
5ac6873
typescript: Allow to push headers when requesting
bitonic Mar 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 13 additions & 169 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,177 +1,21 @@
# Copy these contents into the root directory of your Github project in a file
# named .travis.yml

# Use new container infrastructure to enable caching
language: c
dist: trusty
sudo: required

# Caching so the next build will be fast too.
sudo: false
language: generic
cache:
directories:
- $HOME/.ghc
- $HOME/.cabal
- $HOME/.stack

# The different configurations we want to test. We have BUILD=cabal which uses
# cabal-install, and BUILD=stack which uses Stack. More documentation on each
# of those below.
#
# We set the compiler values here to tell Travis to use a different
# cache file per set of arguments.
#
# If you need to have different apt packages for each combination in the
# matrix, you can use a line such as:
# addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
matrix:
include:
# We grab the appropriate GHC and cabal-install versions from hvr's PPA. See:
# https://github.com/hvr/multi-ghc-travis
#- env: BUILD=cabal GHCVER=7.0.4 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
# compiler: ": #GHC 7.0.4"
# addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
#- env: BUILD=cabal GHCVER=7.2.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
# compiler: ": #GHC 7.2.2"
# addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
#- env: BUILD=cabal GHCVER=7.4.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
# compiler: ": #GHC 7.4.2"
# addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
#- env: BUILD=cab- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fial GHCVER=7.6.3 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
# compiler: ": #GHC 7.6.3"
# addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
#- env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18 HAPPYVER=1.19.5 ALEXVER=3.1.7
# compiler: ": #GHC 7.8.4"
# addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
# - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
# compiler: ": #GHC 7.10.3"
# addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
#- env: BUILD=cabal GHCVER=8.0.1 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
# compiler: ": #GHC 8.0.1"
# addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}

# Build with the newest GHC and cabal-install. This is an accepted failure,
# see below.
- env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
compiler: ": #GHC HEAD"
addons: {apt: {packages: [cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}

# The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
# variable, such as using --stack-yaml to point to a different file.
- env: BUILD=stack ARGS=""
compiler: ": #stack default"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}

#- env: BUILD=stack ARGS="--resolver lts-2"
# compiler: ": #stack 7.8.4"
# addons: {apt: {packages: [ghc-7.8.4], sources: [hvr-ghc]}}

#- env: BUILD=stack ARGS="--resolver lts-3"
# compiler: ": #stack 7.10.2"
# addons: {apt: {packages: [ghc-7.10.2], sources: [hvr-ghc]}}

- env: BUILD=stack ARGS="--resolver lts-7"
compiler: ": #stack 8.0.1"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}

# Nightly builds are allowed to fail
- env: BUILD=stack ARGS="--resolver nightly"
compiler: ": #stack nightly"
addons: {apt: {packages: [libgmp-dev]}}

# Build on OS X in addition to Linux
- env: BUILD=stack ARGS=""
compiler: ": #stack default osx"
os: osx

# - env: BUILD=stack ARGS="--resolver lts-2"
# compiler: ": #stack 7.8.4 osx"
# os: osx

# - env: BUILD=stack ARGS="--resolver lts-3"
# compiler: ": #stack 7.10.2 osx"
# os: osx

- env: BUILD=stack ARGS="--resolver lts-7"
compiler: ": #stack 8.0.1 osx"
os: osx

- env: BUILD=stack ARGS="--resolver nightly"
compiler: ": #stack nightly osx"
os: osx

allow_failures:
- env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
- env: BUILD=stack ARGS="--resolver lts-7"

addons:
apt:
packages:
- libgmp-dev
env:
- ARGS=""
- ARGS="--resolver nightly-2017-09-10"
before_install:
# Using compiler above sets CC to an invalid value, so unset it
- unset CC

# We want to always allow newer versions of packages when building on GHC HEAD
- CABALARGS=""
- if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi

# Download and unpack the stack executable
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:/opt/alex/$ALEXVER/bin:/opt/happy/$HAPPYVER/bin:$HOME/.cabal/bin:$PATH
- mkdir -p ~/.local/bin
- |
if [ `uname` = "Darwin" ]
then
travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
else
travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
fi

# Use the more reliable S3 mirror of Hackage
mkdir -p $HOME/.cabal
echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config
echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config

if [ "$CABALVER" != "1.16" ]
then
echo 'jobs: $ncpus' >> $HOME/.cabal/config
fi

# Get the list of packages from the stack.yaml file
- PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')

- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
install:
- echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
- if [ -f configure.ac ]; then autoreconf -i; fi
- |
set -ex
case "$BUILD" in
stack)
stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies
;;
cabal)
cabal --version
travis_retry cabal update
cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
;;
esac
set +ex

- stack --no-terminal --install-ghc $ARGS test --only-dependencies
script:
- |
set -ex
case "$BUILD" in
stack)
stack --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps
;;
cabal)
cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
- stack --no-terminal test --haddock --no-haddock-deps $ARGS

ORIGDIR=$(pwd)
for dir in $PACKAGES
do
cd $dir
cabal check || [ "$CABALVER" == "1.16" ]
cabal sdist
SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && \
(cd dist && cabal install --force-reinstalls "$SRC_TGZ")
cd $ORIGDIR
done
;;
esac
set +ex
20 changes: 20 additions & 0 deletions solga-client-ghcjs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2017 Francesco Mazzoli

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 2 additions & 0 deletions solga-client-ghcjs/Setup.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import Distribution.Simple
main = defaultMain
42 changes: 42 additions & 0 deletions solga-client-ghcjs/solga-client-ghcjs.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: solga-client-ghcjs
version: 0.1.0.0
synopsis: Simple typesafe web routing
description: A library for easily making requests to solga endpoints
license: MIT
license-file: LICENSE
author: Francesco Mazzoli
maintainer: [email protected]
copyright: Copyright (C) 2017 Francesco Mazzoli
category: Web
build-type: Simple
homepage: https://github.com/chpatrick/solga
bug-reports: https://github.com/chpatrick/solga/issues
-- extra-source-files:
cabal-version: >=1.10

library
exposed-modules: Solga.Client.GHCJS
build-depends: base >= 4.8 && < 5,
solga-core,
dlist,
ghcjs-dom,
safe-exceptions,
transformers
if !impl(ghcjs)
build-depends:
aeson,
http-types,
text,
bytestring,
jsaddle,
jsaddle-dom,
exceptions,
binary
else
build-depends:
ghcjs-base,
jsval-json,
ghcjs-dom-jsffi
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall
Loading