Skip to content

Commit

Permalink
[nop] Update project template
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed May 6, 2024
1 parent 92bfe26 commit 2283f17
Show file tree
Hide file tree
Showing 14 changed files with 499 additions and 76 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/graal-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
version: 'latest'
java-version: ${{ matrix.java }}
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}

- uses: DeLaGuardo/setup-clojure@10.0
- uses: DeLaGuardo/setup-clojure@12.5
with:
lein: latest
bb: latest

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: deps-${{ hashFiles('deps.edn') }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ jobs:

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: ${{ matrix.java }}

- uses: DeLaGuardo/setup-clojure@10.0
- uses: DeLaGuardo/setup-clojure@12.5
with:
lein: latest

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache-deps
with:
path: ~/.m2/repository
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ pom.xml*
/target/
/checkouts/
/logs/
/wiki/.git
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This is a minor **feature release**, and should be a non-breaking upgrade.
```

> This is a **feature release**. Should be non-breaking.
> See [here](https://github.com/ptaoussanis/encore#recommended-steps-after-any-significant-dependency-update) for a tip re: general recommended steps when updating any Clojure/Script dependencies.
> See [here](https://github.com/taoensso/encore#recommended-steps-after-any-significant-dependency-update) for a tip re: general recommended steps when updating any Clojure/Script dependencies.
### Since `1.8.0`

Expand All @@ -62,7 +62,7 @@ This is a minor **feature release**, and should be a non-breaking upgrade.
```

> This is a **maintenance release**. _Should_ be non-breaking.
> See [here](https://github.com/ptaoussanis/encore#recommended-steps-after-any-significant-dependency-update) for a tip re: general recommended steps when updating any Clojure/Script dependencies.
> See [here](https://github.com/taoensso/encore#recommended-steps-after-any-significant-dependency-update) for a tip re: general recommended steps when updating any Clojure/Script dependencies.
### Since `v1.7.2`

Expand All @@ -77,7 +77,7 @@ This is a minor **feature release**, and should be a non-breaking upgrade.
```

> This is a **maintenance release**. Changes may be BREAKING for some users, see relevant commits referenced below for details.
> See [here](https://github.com/ptaoussanis/encore#recommended-steps-after-any-significant-dependency-update) for a tip re: general recommended steps when updating any Clojure/Script dependencies.
> See [here](https://github.com/taoensso/encore#recommended-steps-after-any-significant-dependency-update) for a tip re: general recommended steps when updating any Clojure/Script dependencies.
### Changes since `v1.6.0`

Expand All @@ -94,7 +94,7 @@ This is a minor **feature release**, and should be a non-breaking upgrade.
```

> Minor feature release. _Should_ be non-breaking.
> See [here](https://github.com/ptaoussanis/encore#recommended-steps-after-any-significant-dependency-update) for a tip re: general recommended steps when updating any Clojure/Script dependencies.
> See [here](https://github.com/taoensso/encore#recommended-steps-after-any-significant-dependency-update) for a tip re: general recommended steps when updating any Clojure/Script dependencies.
Identical to `1.6.0-RC1`.

Expand Down
51 changes: 18 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@

# Truss

#### Assertions micro-library for Clojure/Script
### Assertions micro-library for Clojure/Script

**Truss** is a tiny Clojure/Script library that provides fast and flexible **runtime assertions** with **terrific error messages**. Use it as a complement or alternative to [clojure.spec](https://clojure.org/about/spec), [core.typed](https://github.com/clojure/core.typed), etc.

<img src="hero.png" width="600" alt="Egyptian ship with rope truss, the oldest known use of trusses (about 1250 BC)."/>
<img width="600" src="../../blob/master/hero.png" alt="Egyptian ship with rope truss, the oldest known use of trusses (about 1250 BC)."/>

> A doubtful friend is worse than a certain enemy. Let a man be one thing or the other, and we then know how to meet him. - Aesop
## Latest release/s

- `2023-07-31` `1.11.0`: [changes](../../releases/tag/v1.11.0)
- `2023-07-31` `1.11.0`: [release info](../../releases/tag/v1.11.0)

[![Main tests][Main tests SVG]][Main tests URL]
[![Graal tests][Graal tests SVG]][Graal tests URL]
Expand All @@ -30,24 +30,20 @@ See [here][GitHub releases] for earlier releases.
- No commitment or costly buy-in: use it just when+where needed
- Perfect for library authors: no bulky dependencies

## Quickstart
## Video demo

1\. Add the [relevant dependency](#latest-releases) to your project:
See for intro and usage:

```clojure
Leiningen: [com.taoensso/truss "x-y-z"] ; or
deps.edn: com.taoensso/truss {:mvn/version "x-y-z"}
```
<a href="https://www.youtube.com/watch?v=gMB4Y-EIArA" target="_blank">
<img src="https://img.youtube.com/vi/gMB4Y-EIArA/maxresdefault.jpg" alt="Truss demo video" width="480" border="0" />
</a>

2\. Setup your namespace imports:
## Quick example

```clojure
(ns my-ns (:require [taoensso.truss :as truss :refer (have have! have?)]))
```

3\. Truss uses the simple `(predicate arg)` pattern familiar to Clojure users:
(require '[taoensso.truss :as truss :refer [have have?]])

```clojure
;; Truss uses the simple `(predicate arg)` pattern familiar to Clojure users:
(defn square [n]
(let [n (have integer? n)] ; <- A Truss assertion
(* n n)))
Expand All @@ -69,31 +65,20 @@ deps.edn: com.taoensso/truss {:mvn/version "x-y-z"}
;; :file "examples/truss_examples.cljc"}}
```

That's everything most users will need to know, but see the [documentation](#documentation) for more.
That's everything most users will need to know, but see the [documentation](#documentation) below for more!

## Documentation

- [Full documentation][GitHub wiki] (detailed usage, etc.)
- Auto-generated API reference: [Codox][Codox docs], [clj-doc][clj-doc docs]

## Motivation

<a href="https://youtu.be/gMB4Y-EIArA" title="Truss talk (YouTube)">
<img src="https://raw.githubusercontent.com/ptaoussanis/truss/master/talk.jpg" width="600"/>
</a>

See [here][GitHub wiki] for more.
- [Wiki][GitHub wiki] (getting started, usage, etc.)
- API reference: [cljdoc][cljdoc docs], [Codox][Codox docs]][cljdoc docs]

## Funding

You can [help support continued work][funding] on this project, thank you!! 🙏

Copyright &copy; 2015-2023 [Peter Taoussanis][].
Licensed under [EPL 1.0](LICENSE.txt) (same as Clojure).
You can [help support][sponsor] continued work on this project, thank you!! 🙏

## License

Copyright &copy; 2014-2023 [Peter Taoussanis][].
Copyright &copy; 2014-2024 [Peter Taoussanis][].
Licensed under [EPL 1.0](LICENSE.txt) (same as Clojure).

<!-- Common -->
Expand All @@ -103,12 +88,12 @@ Licensed under [EPL 1.0](LICENSE.txt) (same as Clojure).
[GitHub wiki]: ../../wiki

[Peter Taoussanis]: https://www.taoensso.com
[funding]: https://www.taoensso.com/clojure/backers
[sponsor]: https://www.taoensso.com/sponsor

<!-- Project -->

[Codox docs]: https://taoensso.github.io/truss/
[clj-doc docs]: https://cljdoc.org/d/com.taoensso/truss/
[cljdoc docs]: https://cljdoc.org/d/com.taoensso/truss/

[Clojars SVG]: https://img.shields.io/clojars/v/com.taoensso/truss.svg
[Clojars URL]: https://clojars.org/com.taoensso/truss
Expand Down
4 changes: 3 additions & 1 deletion bb/graal_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
(let [graalvm-home (System/getenv "GRAALVM_HOME")
bin-dir (str (fs/file graalvm-home "bin"))]
(shell (executable bin-dir "gu") "install" "native-image")
(shell (executable bin-dir "native-image") "-jar" "target/graal-tests.jar" "--no-fallback" "graal_tests")))
(shell (executable bin-dir "native-image")
"--features=clj_easy.graal_build_time.InitClojureClasses"
"--no-fallback" "-jar" "target/graal-tests.jar" "graal_tests")))

(defn run-tests []
(let [{:keys [out]} (shell {:out :string} (executable "." "graal_tests"))]
Expand Down
61 changes: 30 additions & 31 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,48 @@
{:name "Eclipse Public License - v 1.0"
:url "https://www.eclipse.org/legal/epl-v10.html"}

:dependencies
[]
:test-paths ["test" #_"src"]
:dependencies []

:profiles
{;; :default [:base :system :user :provided :dev]
:provided {:dependencies [[org.clojure/clojurescript "1.11.60"]
[org.clojure/clojure "1.11.1"]]}
:c1.11 {:dependencies [[org.clojure/clojure "1.11.1"]]}
:provided {:dependencies [[org.clojure/clojurescript "1.11.132"]
[org.clojure/clojure "1.11.3"]]}
:c1.12 {:dependencies [[org.clojure/clojure "1.12.0-alpha11"]]}
:c1.11 {:dependencies [[org.clojure/clojure "1.11.3"]]}
:c1.10 {:dependencies [[org.clojure/clojure "1.10.3"]]}
:c1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:test
{:jvm-opts ["-Dtaoensso.elide-deprecated=true"]

:graal-tests
{:source-paths ["test"]
:main taoensso.graal-tests
:aot [taoensso.graal-tests]
:uberjar-name "graal-tests.jar"
:dependencies
[[org.clojure/clojure "1.11.3"]
[com.github.clj-easy/graal-build-time "1.0.5"]]}

:dev
{:jvm-opts ["-server" "-Dtaoensso.elide-deprecated=true"]
:global-vars
{*warn-on-reflection* true
*assert* true
*unchecked-math* false #_:warn-on-boxed}

:dependencies
[[org.clojure/test.check "1.1.1"]
[com.taoensso/encore "3.77.0"
:exclusions [com.taoensso/truss]]]}
[com.taoensso/encore "3.107.0"
:exclusions [com.taoensso/truss]]]

:graal-tests
{:dependencies [[org.clojure/clojure "1.11.1"]
[com.github.clj-easy/graal-build-time "0.1.4"]]
:main taoensso.graal-tests
:aot [taoensso.graal-tests]
:uberjar-name "graal-tests.jar"}
:plugins
[[lein-pprint "1.3.2"]
[lein-ancient "0.7.0"]
[lein-cljsbuild "1.1.8"]
[com.taoensso.forks/lein-codox "0.10.11"]]

:dev
[:c1.11 :test
{:jvm-opts ["-server"]
:plugins
[[lein-pprint "1.3.2"]
[lein-ancient "0.7.0"]
[lein-cljsbuild "1.1.8"]
[com.taoensso.forks/lein-codox "0.10.10"]]

:codox
{:language #{:clojure :clojurescript}
:base-language :clojure}}]}

:test-paths ["test" #_"src"]
:codox
{:language #{:clojure :clojurescript}
:base-language :clojure}}}

:cljsbuild
{:test-commands {"node" ["node" "target/test.js"]}
Expand All @@ -72,6 +71,6 @@
"build-once" ["do" ["clean"] ["cljsbuild" "once"]]
"deploy-lib" ["do" ["build-once"] ["deploy" "clojars"] ["install"]]

"test-clj" ["with-profile" "+c1.11:+c1.10:+c1.9" "test"]
"test-cljs" ["with-profile" "+test" "cljsbuild" "test"]
"test-clj" ["with-profile" "+c1.12:+c1.11:+c1.10:+c1.9" "test"]
"test-cljs" ["with-profile" "+c1.12" "cljsbuild" "test"]
"test-all" ["do" ["clean"] ["test-clj"] ["test-cljs"]]})
Binary file removed talk.jpg
Binary file not shown.
6 changes: 6 additions & 0 deletions test/taoensso/truss_tests.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,10 @@

;;;;

#?(:cljs
(defmethod test/report [:cljs.test/default :end-run-tests] [m]
(when-not (test/successful? m)
;; Trigger non-zero `lein test-cljs` exit code for CI
(throw (ex-info "ClojureScript tests failed" {})))))

#?(:cljs (test/run-tests))
1 change: 1 addition & 0 deletions wiki/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
Loading

0 comments on commit 2283f17

Please sign in to comment.