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 Mar 19, 2024
1 parent bb9b02c commit c746989
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 66 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/main-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Main tests
on: [push, pull_request]

jobs:
tests:
strategy:
matrix:
java: ['17', '18', '19']
os: [ubuntu-latest]

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

- uses: DeLaGuardo/[email protected]
with:
lein: latest

- uses: actions/cache@v4
id: cache-deps
with:
path: ~/.m2/repository
key: deps-${{ hashFiles('project.clj') }}
restore-keys: deps-

- run: lein test-all
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
> This project uses [Break Versioning](https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md)
This project uses Break Versioning (https://www.taoensso.com/break-versioning)

## v1.1.0 - 2021 Jan 12

Expand All @@ -7,7 +7,7 @@
```

> This is a release to update dependencies. Should be **non-breaking**.
> See [here](https://github.com/ptaoussanis/encore#recommended-steps-after-any-significant-dependency-update) for recommended steps when updating any Clojure/Script dependencies.
> See [here](https://github.com/taoensso/encore#recommended-steps-after-any-significant-dependency-update) for recommended steps when updating any Clojure/Script dependencies.
**Changes** since `v1.0.0`:

Expand Down
2 changes: 1 addition & 1 deletion FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github: ptaoussanis
custom: "https://www.taoensso.com/clojure/backers"
custom: "https://www.taoensso.com/clojure"
34 changes: 16 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<a href="https://www.taoensso.com" title="More stuff by @ptaoussanis at www.taoensso.com">
<img src="https://www.taoensso.com/taoensso-open-source.png" alt="Taoensso open-source" width="400"/></a>
<img src="https://www.taoensso.com/taoensso-open-source.png" alt="Taoensso open-source" width="350"/></a>

**[CHANGELOG]** | [API] | current [Break Version]:
**[CHANGELOG][]** | [API][] | current [Break Version][]:

```clojure
[com.taoensso/tengen "1.1.0"] ; See CHANGELOG for details
[com.taoensso/tengen "1.1.0"] ; Mature/stable (basically "done")
```

> See [here](https://taoensso.com/clojure/backers) if you're interested in helping support my open-source work, thanks! - Peter Taoussanis
> See [here][backers] if to help support my open-source work, thanks! - [Peter Taoussanis][Taoensso.com]
# Tengen: let-based [Reagent][] components for Clojure/Script

> **Ten-gen** (天元) is a Japanese [Go][] term for the central, and only unique point on the Go board.
[Reactjs][] has its pros and cons. Overall, it can be a good fit for web/native application development with Clojure/Script.

But while React's [lifecycle methods] are flexible, using them correctly can be a little unintuitive.
But while React's [lifecycle methods][] are flexible, using them correctly can be a little unintuitive.

One of the sharper edges I've found in practice, is the difficulty of **managing simple state flow** through the component lifecycle process. This can actually be harder to do in Clojure/Script than vanilla JS since Clojure intentionally discourages the kind of disposable mutable state that could be handy here.

Expand Down Expand Up @@ -112,29 +112,27 @@ You can also use `(reagent.core/dom-node this-cmpt)`, etc. - but would **strongl

## Contacting me / contributions

Please use the project's [GitHub issues page] for all questions, ideas, etc. **Pull requests welcome**. See the project's [GitHub contributors page] for a list of contributors.
Please use the project's [GitHub issues page][] for all questions, ideas, etc. **Pull requests welcome**. See the project's [GitHub contributors page][] for a list of contributors.

Otherwise, you can reach me at [Taoensso.com]. Happy hacking!
Otherwise, you can reach me at [Taoensso.com][]. Happy hacking!

\- [Peter Taoussanis]
\- [Peter Taoussanis][Taoensso.com]

## License

Distributed under the [EPL v1.0] \(same as Clojure).
Copyright &copy; 2016-2020 [Peter Taoussanis].
Distributed under the [EPL v1.0][] \(same as Clojure).
Copyright &copy; 2016-2022 [Peter Taoussanis][Taoensso.com].

<!--- Standard links -->
[Taoensso.com]: https://www.taoensso.com
[Peter Taoussanis]: https://www.taoensso.com
[@ptaoussanis]: https://www.taoensso.com
[More by @ptaoussanis]: https://www.taoensso.com
[Break Version]: https://github.com/ptaoussanis/encore/blob/master/BREAK-VERSIONING.md
[Break Version]: https://github.com/taoensso/encore/blob/master/BREAK-VERSIONING.md
[backers]: https://taoensso.com/clojure/backers

<!--- Standard links (repo specific) -->
[CHANGELOG]: https://github.com/ptaoussanis/tengen/releases
[API]: http://ptaoussanis.github.io/tengen/
[GitHub issues page]: https://github.com/ptaoussanis/tengen/issues
[GitHub contributors page]: https://github.com/ptaoussanis/tengen/graphs/contributors
[CHANGELOG]: https://github.com/taoensso/tengen/releases
[API]: http://taoensso.github.io/tengen/
[GitHub issues page]: https://github.com/taoensso/tengen/issues
[GitHub contributors page]: https://github.com/taoensso/tengen/graphs/contributors
[EPL v1.0]: https://raw.githubusercontent.com/ptaoussanis/tengen/master/LICENSE
[Hero]: https://raw.githubusercontent.com/ptaoussanis/tengen/master/hero.png "Title"

Expand Down
104 changes: 60 additions & 44 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,60 +1,76 @@
(defproject com.taoensso/tengen "1.1.0"
:author "Peter Taoussanis <https://www.taoensso.com>"
:description "Simple let-based Reagent component fns for Clojure/Script"
:url "https://github.com/ptaoussanis/tengen"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"
:distribution :repo
:comments "Same as Clojure"}
:min-lein-version "2.3.3"
:global-vars {*warn-on-reflection* true
*assert* true}
:description "Simple React component DSL for Clojure/Script"
:url "https://github.com/taoensso/tengen"

:dependencies
[[com.taoensso/encore "3.10.1"]]
:license
{:name "Eclipse Public License - v 1.0"
:url "https://www.eclipse.org/legal/epl-v10.html"}

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

:plugins
[[lein-pprint "1.3.2"]
[lein-ancient "0.6.15"]
[lein-codox "0.10.7"]
[lein-cljsbuild "1.1.8"]]
:dependencies
[[com.taoensso/encore "3.31.0"]]

:profiles
{;; :default [:base :system :user :provided :dev]
:server-jvm {:jvm-opts ^:replace ["-server"]}
:provided {:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.773"]
[reagent "1.0.0"]]}
:1.8 {:dependencies [[org.clojure/clojure "1.8.0"]]}
:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
:1.10 {:dependencies [[org.clojure/clojure "1.10.1"]]}
:test {:dependencies [[org.clojure/test.check "1.1.0"]]}
:depr {:jvm-opts ["-Dtaoensso.elide-deprecated=true"]}
:dev [:1.10 :test :server-jvm :depr]}
:provided {:dependencies [[reagent "1.1.1"]
[org.clojure/clojurescript "1.11.60"]
[org.clojure/clojure "1.11.1"]]}
:c1.12 {:dependencies [[org.clojure/clojure "1.12.0-alpha9"]]}
:c1.11 {:dependencies [[org.clojure/clojure "1.11.1"]]}
:c1.10 {:dependencies [[org.clojure/clojure "1.10.3"]]}
:c1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}

:cljsbuild
{:test-commands
{"node" ["node" :node-runner "target/main.js"]
"phantom" ["phantomjs" :runner "target/main.js"]}
: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"]
[cljsjs/react "17.0.2-0"]
[cljsjs/react-dom "17.0.2-0"]
[reagent "1.1.1"]]

:plugins
[[lein-pprint "1.3.2"]
[lein-ancient "0.7.0"]
[lein-cljsbuild "1.1.8"]
[com.taoensso.forks/lein-codox "0.10.11"]]

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

:cljsbuild
{:test-commands {"node" ["node" "target/test.js"]}
:builds
[{:id :main
:source-paths ["src" "test"]
:source-paths ["src"]
:compiler
{:output-to "target/main.js"
:optimizations :advanced
:pretty-print false}}]}
:optimizations :advanced}}

{:id :test
:source-paths ["src" "test"]
:compiler
{:output-to "target/test.js"
:target :nodejs
:npm-deps true
:optimizations #_:simple :none
:main taoensso.tengen-tests}}]}

:aliases
{"start-dev" ["with-profile" "+dev" "repl" ":headless"]
"deploy-lib" ["do" "build-once," "deploy" "clojars," "install"]
"build-once" ["cljsbuild" "once"]
"test-cljs" ["cljsbuild" "test"]
"test-all"
["do" ["clean"]
"with-profile" "+1.10:+1.9" "test,"
"with-profile" "+test" "cljsbuild" "test"]}

:repositories
{"sonatype-oss-public"
"https://oss.sonatype.org/content/groups/public/"})
"build-once" ["do" ["clean"] ["cljsbuild" "once"]]
"deploy-lib" ["do" ["build-once"] ["deploy" "clojars"] ["install"]]

"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"]]})
2 changes: 1 addition & 1 deletion src/taoensso/tengen/common.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(:require
[taoensso.encore :as enc :refer [have have?]]))

(enc/assert-min-encore-version [2 85 0])
(enc/assert-min-encore-version [3 31 0])

#?(:clj
(defmacro binding-rvals
Expand Down
24 changes: 24 additions & 0 deletions test/taoensso/tengen_tests.cljc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
(ns taoensso.tengen-tests
(:require
[clojure.test :as test :refer [deftest testing is]]
[taoensso.encore :as enc]
[taoensso.tengen.common :as common]))

(comment
(remove-ns 'taoensso.tengen-tests)
(test/run-tests 'taoensso.tengen-tests))

;;;;

#?(:clj (deftest _test-clj (is (= 1 1))))
#?(:cljs (deftest _test-cljs (is (= 1 1))))

;;;;

#?(: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))

0 comments on commit c746989

Please sign in to comment.