Skip to content

Commit 1ae9e3f

Browse files
authored
Merge pull request #4 from Respo/upgrade-respo
switch to new respo; update workflow
2 parents 005d99c + f163d62 commit 1ae9e3f

File tree

13 files changed

+669
-450
lines changed

13 files changed

+669
-450
lines changed

.github/workflows/deploy.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
name: Deploy package
3+
4+
on:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
deploy:
10+
name: Deploy
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- run: curl -O https://download.clojure.org/install/linux-install-1.10.1.507.sh && chmod +x linux-install-1.10.1.507.sh && sudo ./linux-install-1.10.1.507.sh
16+
17+
- uses: actions/checkout@v2
18+
19+
- name: Get yarn cache
20+
id: yarn-cache
21+
run: echo "::set-output name=dir::$(yarn cache dir)"
22+
23+
- uses: actions/cache@v1
24+
name: Cache node modules of yarn
25+
with:
26+
path: ${{ steps.yarn-cache.outputs.dir }}
27+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
28+
restore-keys: |
29+
${{ runner.os }}-yarn-
30+
31+
- name: Cache Clojars
32+
uses: actions/cache@v1
33+
env:
34+
cache-name: cache-clojars
35+
with:
36+
path: ~/.m2/repository
37+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('shadow-cljs.edn') }}
38+
restore-keys: |
39+
${{ runner.os }}-clojars
40+
41+
- name: run tests
42+
run: 'yarn && yarn shadow-cljs compile client'
43+
44+
- run: echo Working on ${{ github.ref }}
45+
46+
- name: deploy to clojars
47+
run: env CLOJARS_USERNAME=jiyinyiyong CLOJARS_PASSWORD=${{ secrets.CLOJARS_PASSWORD }} clojure -A:release

.github/workflows/upload.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
name: Upload Assets
3+
4+
on:
5+
pull_request: {}
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
upload-assets:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: docker://timbru31/java-node:latest
16+
17+
- name: Get yarn cache
18+
id: yarn-cache
19+
run: echo "::set-output name=dir::$(yarn cache dir)"
20+
21+
- uses: actions/cache@v1
22+
name: Cache node modules of yarn
23+
with:
24+
path: ${{ steps.yarn-cache.outputs.dir }}
25+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
26+
restore-keys: |
27+
${{ runner.os }}-yarn-
28+
29+
- name: Cache Clojars
30+
uses: actions/cache@v1
31+
env:
32+
cache-name: cache-clojars
33+
with:
34+
path: ~/.m2/repository
35+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('shadow-cljs.edn') }}
36+
restore-keys: |
37+
${{ runner.os }}-clojars
38+
39+
- run: yarn && yarn build
40+
name: Build web assets
41+
42+
- name: Deploy to server
43+
id: deploy
44+
uses: Pendect/action-rsyncer@v1.1.0
45+
env:
46+
DEPLOY_KEY: ${{secrets.rsync_private_key}}
47+
with:
48+
flags: '-avzr --progress'
49+
options: ''
50+
ssh_options: ''
51+
src: 'dist/*'
52+
dest: 'rsync-user@tiye.me:/web-assets/repo/${{ github.repository }}'
53+
54+
- name: Display status from deploy
55+
run: echo "${{ steps.deploy.outputs.status }}"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Demo http://repo.respo-mvc.org/reel/
1313
[![Clojars Project](https://img.shields.io/clojars/v/respo/reel.svg)](https://clojars.org/respo/reel)
1414

1515
```edn
16-
[respo/reel "0.3.5"]
16+
[respo/reel "0.4.0-a1"]
1717
```
1818

1919
> "shortid" from npm is on dependency list, make sure it's installed.
@@ -66,7 +66,7 @@ Call `handle-reload!` with so many arguments to reload store and element caches:
6666
To use records panel, please refer to `comp-reel`:
6767

6868
```clojure
69-
(comp-reel reel styles)
69+
(comp-reel (>> states :reel) reel styles)
7070
```
7171

7272
Listening to `Command Shift a` to launch DevTools:

calcit.cirru

Lines changed: 105 additions & 57 deletions
Large diffs are not rendered by default.

deps.edn

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
{:paths ["src"]
2-
:deps {
3-
cirru/favored-edn {:mvn/version "0.1.1"}
4-
}
5-
}
1+
{
2+
:paths ["src"]
3+
:deps {
4+
cirru/favored-edn {:mvn/version "0.1.1"}
5+
respo/value {:mvn/version "0.3.0-a1"}
6+
}
7+
:aliases {
8+
:release {
9+
:extra-deps {
10+
appliedscience/deps-library {:mvn/version "0.3.4"}
11+
}
12+
:main-opts ["-m" "deps-library.release"]
13+
}
14+
}
15+
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
"author": "jiyinyiyong",
2121
"license": "MIT",
2222
"devDependencies": {
23-
"http-server": "^0.11.1",
24-
"shadow-cljs": "2.8.37"
23+
"http-server": "^0.12.1",
24+
"shadow-cljs": "2.8.93"
2525
},
2626
"dependencies": {
27-
"shortid": "^2.2.14"
27+
"shortid": "^2.2.15"
2828
}
2929
}

release.edn

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{:version "0.4.0-a1"
2+
:group-id "respo"
3+
:artifact-id "reel"
4+
:skip-tag true
5+
:description "Time travel demo for Respo"
6+
:scm-url "https://github.com/mvc-works/calcit-workflow"}

shadow-cljs.edn

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
1-
2-
{:source-paths ["src" "cli"]
3-
:cache-blockers #{cumulo-util.build}
4-
:dependencies [[mvc-works/hsl "0.1.2"]
5-
[mvc-works/shell-page "0.1.10"]
6-
[respo "0.10.11"]
7-
[respo/ui "0.3.13"]
8-
[respo/value "0.2.5"]
9-
[cumulo/util "0.1.10"]
10-
[cirru/favored-edn "0.1.1"]
11-
[org.clojure/core.incubator "0.1.4"]]
12-
:repositories {"central" {:url "https://maven.aliyun.com/nexus/content/groups/public/"}
13-
"clojars" {:url "https://mirrors.ustc.edu.cn/clojars/"}}
14-
:open-file-command ["subl" ["%s:%s:%s" :file :line :column]]
15-
:dev-http {7000 "target/"}
16-
:builds {:client {:target :browser
17-
:output-dir "target/"
18-
:asset-path "./"
19-
:modules {:client {:init-fn reel.main/main!}}
20-
:devtools {:after-load reel.main/reload!}
21-
:release {:output-dir "dist/"
22-
:module-hash-names 8
23-
:build-options {:manifest-name "assets.edn"}}}
24-
:page {:target :node-script
25-
:output-to "target/page.js"
26-
:main reel.page/main!
27-
:devtools {:after-load reel.page/main!}}
28-
:upload {:target :node-script
29-
:output-to "target/upload.js"
30-
:main reel.upload/main!
31-
:devtools {:after-load reel.upload/main!}}}}
1+
{
2+
:source-paths ["src" "cli"]
3+
:cache-blockers #{cumulo-util.build}
4+
:dependencies [
5+
[mvc-works/hsl "0.1.2"]
6+
[mvc-works/shell-page "0.1.10"]
7+
[respo "0.12.0-a1"]
8+
[respo/ui "0.3.14"]
9+
[respo/value "0.3.0-a1"]
10+
[cumulo/util "0.1.10"]
11+
[cirru/favored-edn "0.1.3"]
12+
[org.clojure/core.incubator "0.1.4"]
13+
]
14+
:open-file-command [
15+
"subl"
16+
["%s:%s:%s" :file :line :column]
17+
]
18+
:dev-http {7000 "target/"}
19+
:builds {
20+
:client {
21+
:target :browser, :output-dir "target/", :asset-path "./"
22+
:modules {
23+
:client {:init-fn reel.main/main!}
24+
}
25+
:devtools {:after-load reel.main/reload!}
26+
:release {
27+
:output-dir "dist/", :module-hash-names 8
28+
:build-options {:manifest-name "assets.edn"}
29+
}
30+
}
31+
:page {
32+
:target :node-script, :output-to "target/page.js", :main reel.page/main!
33+
:devtools {:after-load reel.page/main!}
34+
}
35+
:upload {
36+
:target :node-script, :output-to "target/upload.js", :main reel.upload/main!
37+
:devtools {:after-load reel.upload/main!}
38+
}
39+
}
40+
}

src/reel/comp/container.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
(ns reel.comp.container
33
(:require [hsl.core :refer [hsl]]
44
[respo-ui.core :as ui]
5-
[respo.core :refer [defcomp cursor-> <> div span]]
5+
[respo.core :refer [defcomp <> >> div span]]
66
[respo.comp.space :refer [=<]]
77
[reel.comp.reel :refer [comp-reel]]
88
[reel.comp.todolist :refer [comp-todolist]]))
@@ -14,4 +14,4 @@
1414
(div
1515
{:style (merge ui/global)}
1616
(comp-todolist states (:tasks store))
17-
(cursor-> :reel comp-reel states reel nil))))
17+
(comp-reel (>> states :reel) reel nil))))

src/reel/comp/reel.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
(ns reel.comp.reel
3-
(:require [respo.core :refer [defcomp cursor-> action-> <> div button span]]
3+
(:require [respo.core :refer [defcomp <> >> div button span]]
44
[hsl.core :refer [hsl]]
55
[respo.comp.inspect :refer [comp-inspect]]
66
[respo-ui.core :as ui]
@@ -66,7 +66,7 @@
6666
:font-size 12,
6767
:font-family ui/font-fancy,
6868
:color (hsl 200 100 84)},
69-
:on-click (action-> :reel/remove (:pointer reel))}))))
69+
:on-click (fn [e d!] (d! :reel/remove (:pointer reel)))}))))
7070
(div
7171
{:style (merge
7272
style/code

0 commit comments

Comments
 (0)