Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec, for custom Scalars, cannot be satisfied #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 25 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
.calva/output-window/
.classpath
.clj-kondo/.cache
.cpcache
.DS_Store
.eastwood
.factorypath
.hg/
.hgignore
.java-version
.lein-*
.lsp/.cache
.lsp/sqlite.db
.nrepl-history
.nrepl-port
.portal
.project
.rebel_readline_history
.settings
.socket-repl-port
.sw*
.vscode
*.class
*.jar
/.lein-*
/.nrepl-history
/.nrepl-port
/checkouts
/classes
/node_modules
/package-lock.json
/pom.xml
/pom.xml.asc
/scratch.*
/target
/yarn.lock
*.swp
*~
target
3 changes: 0 additions & 3 deletions boot.properties

This file was deleted.

73 changes: 0 additions & 73 deletions build.boot

This file was deleted.

87 changes: 87 additions & 0 deletions build.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
(ns build
(:refer-clojure :exclude [test])
(:require [clojure.tools.deps :as t]
[clojure.tools.build.api :as b]
[deps-deploy.maven-settings :as ms]
[deps-deploy.deps-deploy :as dd]))

(def lib 'neax.clojure.serene/serene)
(def version "0.0.3-SNAPSHOT")
(def class-dir "target/classes")
(def uber-file (str "target/serene.jar"))
(def basis (b/create-basis {:project "deps.edn"}))

(def repo-url "https://maven.pkg.github.com/neaxplore/xplore-backend-lambda-functions")

(defn test "Run all the tests." [opts]
(println "\nRunning tests...")
(let [basis (b/create-basis {:aliases [:test]})
combined (t/combine-aliases basis [:test])
cmds (b/java-command
{:basis basis
:java-opts (:jvm-opts combined)
:main 'clojure.main
:main-args ["-m" "cognitect.test-runner"]})
{:keys [exit]} (b/process cmds)]
(when-not (zero? exit) (throw (ex-info "Tests failed" {}))))
opts)

(defn- jar-opts [opts]
(assoc opts
:lib lib :version version
:jar-file (format "target/%s-%s.jar" lib version)
:scm {:tag (str "v" version)}
:basis (b/create-basis {})
:class-dir class-dir
:target "target"
:src-dirs ["src"]))

(defn compile-ns [opts]
(b/compile-clj {:basis basis
:src-dirs ["src"]
:class-dir class-dir
:compile-opts {:direct-linking true
:elide-meta [:file :line :added]}}))

(defn clean [path]
(b/delete {:path path}))

(defn uber [_]
(println (format "building: %s %s" lib version))
(clean "target/classes")
(b/copy-dir {:src-dirs ["src"]
:target-dir class-dir})
(compile-ns nil)
;; only remove uberjar after successful compilation
(clean uber-file)
(b/uber {:class-dir class-dir
:uber-file uber-file
:basis basis
:main lib}))

(defn ci "Run the CI pipeline of tests (and build the JAR)." [opts]
(b/delete {:path "target"})
(test nil)
(let [opts (jar-opts opts)]
(println "\nWriting pom.xml...")
(b/write-pom opts)
(println "\nCopying source...")
(b/copy-dir {:src-dirs ["resources" "src"] :target-dir class-dir})
(compile-ns nil)
(println "\nBuilding JAR...")
(b/jar opts))
opts)

(defn install "Install the JAR locally." [opts]
(let [opts (jar-opts opts)]
(b/install opts))
opts)

(defn deploy "Deploy the JAR to Github." [opts]
(let [{:keys [jar-file] :as opts} (jar-opts opts)]
(dd/deploy {:installer :remote :artifact (b/resolve-path jar-file)
:repository (assoc-in (ms/deps-repo-by-id-plaintext "github")
["github" :url]
repo-url)
:pom-file (b/pom-path (select-keys opts [:lib :class-dir]))}))
opts)
41 changes: 41 additions & 0 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{:paths ["src" "resources"]
:deps {fipp/fipp {:mvn/version "0.6.26"}
org.clojure/clojure {:mvn/version "1.12.0-rc2"}
org.clojure/spec.alpha {:mvn/version "0.5.238"}}
:aliases {:build ;; clj -T:build uber
{:deps {io.github.clojure/tools.build {:mvn/version "0.10.5"}
io.github.se-neaxplore/deps-deploy {:git/tag "v0.0.1" :git/sha "01c90a7"}
org.clojure/tools.deps {:mvn/version "0.20.1440"}}
:ns-default build}
:cider {:extra-paths ["test" "target/classes"]
:extra-deps {cider/cider-nrepl {:mvn/version "0.50.2"}
com.walmartlabs/lacinia {:mvn/version "1.2.2"}
org.clojure/test.check {:mvn/version "1.1.1"}}
:main-opts ["-m" "nrepl.cmdline"
"--middleware" "[cider.nrepl/cider-middleware]"
"--interactive"]}
:codox {:extra-deps {codox/codox {:mvn/version "0.10.8"}
com.balloneij/familiar-codox-theme {:mvn/version "0.1.0"}}
:exec-fn codox.main/generate-docs
:exec-args {:source-paths ["src"]
:source-uri "https://github.com/se-neaxplore/serene/blob/8ccb4453826c4011aa4b9647ceb63ba0bbc7191e/{filepath}#L{line}"
:themes [:familiar]}}
:format/check {:deps {dev.weavejester/cljfmt {:mvn/version "0.12.0"}}
:main-opts ["-m" "cljfmt.main" "check"]}
:format/fix {:deps {dev.weavejester/cljfmt {:mvn/version "0.12.0"}}
:main-opts ["-m" "cljfmt.main" "fix"]}
:kaocha ;; clj -M:kaocha
{:extra-deps {com.walmartlabs/lacinia {:mvn/version "1.2.2"}
lambdaisland/kaocha {:mvn/version "1.91.1392"}
lambdaisland/kaocha-cloverage {:mvn/version "1.1.89"}
lambdaisland/kaocha-junit-xml {:mvn/version "1.17.101"}
org.clojure/test.check {:mvn/version "1.1.1"}}
:extra-paths ["test"]
:main-opts ["-m" "kaocha.runner"]}
:test {:extra-paths ["test"]
:extra-deps {io.github.cognitect-labs/test-runner
{:git/tag "v0.5.1" :git/sha "dfb30dd"}
org.clojure/test.check {:mvn/version "1.1.1"}
com.walmartlabs/lacinia {:mvn/version "1.2.2"}}
:main-opts ["-m" "cognitect.test-runner"]
:exec-fn cognitect.test-runner.api/test}}}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ scalar Scalar_Any

scalar Scalar_Email

scalar Scalar_Instant

interface Interface_ID {
id: ID!
}
Expand All @@ -11,15 +13,15 @@ interface Interface_EmailOrUsername {
username(downcase: Boolean! = false): String
}

type Object_EmailOrUsername implements Interface_EmailOrUsername Interface_ID {
type Object_EmailOrUsername implements Interface_EmailOrUsername & Interface_ID {
id: ID!
email: Scalar_Email
username(downcase: Boolean! = false): String
}

input InputObject_EmailOrUsername {
email: Scalar_Email
username(downcase: Boolean! = false): String
username: String
}

type Object_IffHasChildThenChild implements Interface_ID {
Expand Down
Loading