-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
awb99
committed
Jul 15, 2024
1 parent
dd206be
commit 45dd719
Showing
4 changed files
with
155 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Use Node.js 12.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
- name: Prepare java | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'zulu' # https://github.com/actions/setup-java/blob/main/README.md#Supported-distributions | ||
java-version: '14' | ||
java-package: jdk # optional (jdk or jre) - defaults to jdk | ||
- name: Install clojure tools | ||
uses: DeLaGuardo/[email protected] | ||
with: | ||
cli: 1.10.3.929 # Clojure CLI based on tools.deps | ||
- name: Release | ||
if: success() | ||
# if: github.event_name == 'push' | ||
env: | ||
CLOJARS_USERNAME: ${{ secrets.ReleaseUsername }} | ||
CLOJARS_PASSWORD: ${{ secrets.ReleasePassword }} | ||
CODECOV_TOKEN: ${{ secrets.CodecovToken }} | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "CI/CD" | ||
clojure -T:build jar | ||
clojure -T:build deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,57 @@ | ||
# re-flow | ||
# re-flow [](https://github.com/pink-gorilla/re-flow/actions?workflow=CI)[](https://clojars.org/org.pinkgorilla/re-flow) | ||
|
||
- re-flow allows to consume missionary flows in clojurescript. | ||
- flows can be consumed: | ||
- either from a sci-clojurescipt code via re-flow.core/re-flow | ||
- or from a reagent/react view via re-flow.core/flow-ui | ||
- the idea is that clj-services are "exposed" for consumption for the | ||
browser via clj-service library. Any clojure function that is exposed | ||
this way (this be permissioned managed via permission library) must | ||
return a flow, and this flow can be consumed. | ||
- the idea is to extend request-reply style communication between clojure | ||
and the browser (clojurescipt) with publish/subscribe model and use | ||
missionarys design to clean up resources when they are no longer needed. | ||
- the benefits to this approach are: | ||
- keep using reagent/react | ||
- all pure render-functions from react/reagent can be used to render | ||
updates that come in via a re(directed)-flow. | ||
- render functions can be defined via interpreted sci-clojurescript | ||
code, and therefore can be extended at runtime by arbitrary code that | ||
should defined the view. | ||
|
||
stage: exploratory/experimental | ||
|
||
# syntax | ||
|
||
``` | ||
(require '[re-flow.core :refer [re-flow flow-ui]]) | ||
(re-flow 'demo.service/a-seed) | ||
; this returns a missionary flow that has the same data as the | ||
; flow of demo.service/a-seed would produce | ||
[flow-ui {:clj 'demo.service/quotes | ||
:args [] | ||
:render 'demo.ui/quotes-ui}]] | ||
; this returns a reagent render function that on each update of the | ||
; flow renders html that is produced by evaluating demo.ui/quotes-ui. | ||
``` | ||
|
||
# demo | ||
|
||
``` | ||
cd demo | ||
clj -X:webly:npm-install | ||
clj -X:webly:compile | ||
clj -X:webly:run | ||
``` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
(ns build | ||
(:require | ||
[clojure.tools.build.api :as b] | ||
[deps-deploy.deps-deploy :as dd])) | ||
|
||
(def lib 'org.pinkgorilla/re-flow) | ||
(def version (format "0.1.%s" (b/git-count-revs nil))) | ||
(def class-dir "target/classes") | ||
(def basis (b/create-basis {:project "deps.edn"})) | ||
(def jar-file (format "target/%s-%s.jar" (name lib) version)) | ||
|
||
(defn clean [_] | ||
(b/delete {:path "target"})) | ||
|
||
(def pom-template | ||
[[:licenses | ||
[:license | ||
[:name "Eclipse Public License"] | ||
[:url "https://www.eclipse.org/legal/epl-v10.html"]]] | ||
[:developers | ||
[:developer | ||
[:name "pink-gorilla"]]] | ||
[:scm | ||
[:url "https://github.com/pink-gorilla/re-flow/"] | ||
[:connection "scm:git:git://github.com/pink-gorilla/re-flow.git"] | ||
[:developerConnection "scm:git:ssh://[email protected]/pink-gorilla/re-flowgit"]]]) | ||
|
||
(def opts {:class-dir class-dir | ||
:lib lib | ||
:version version | ||
:basis basis | ||
:pom-data pom-template | ||
:src-dirs ["src"]}) | ||
|
||
(defn jar [_] | ||
(b/write-pom opts) | ||
(b/copy-dir {:src-dirs ["src" | ||
"resources"] | ||
:target-dir class-dir}) | ||
(b/jar {:class-dir class-dir | ||
:jar-file jar-file})) | ||
|
||
(defn deploy "Deploy the JAR to Clojars." [_] | ||
(println "Deploying to Clojars..") | ||
(dd/deploy {:installer :remote | ||
;:sign-releases? true | ||
:pom-file (b/pom-path (select-keys opts [:lib :class-dir])) | ||
;:artifact "target/tech.ml.dataset.jar" | ||
:artifact (b/resolve-path jar-file)})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters