Skip to content

Commit 17f08d5

Browse files
committed
doing several workflow updates
1 parent a27643c commit 17f08d5

File tree

6 files changed

+311
-328
lines changed

6 files changed

+311
-328
lines changed

.github/workflows/upload.yaml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,23 @@ jobs:
1414

1515
- uses: actions/setup-node@v3
1616
with:
17-
node-version: 16
18-
cache: yarn
17+
node-version: 18
18+
cache: 'yarn'
1919

20-
- name: ACTIONS_ALLOW_UNSECURE_COMMANDS
21-
id: ACTIONS_ALLOW_UNSECURE_COMMANDS
22-
run: echo 'ACTIONS_ALLOW_UNSECURE_COMMANDS=true' >> $GITHUB_ENV
23-
24-
- name: add cr
25-
run: |
26-
mkdir -p $GITHUB_WORKSPACE/bin
27-
wget -O $GITHUB_WORKSPACE/bin/cr https://github.com/calcit-lang/calcit/releases/download/0.6.19/cr
28-
chmod +x $GITHUB_WORKSPACE/bin/cr
29-
echo "::add-path::$GITHUB_WORKSPACE/bin"
30-
31-
- name: "prepare modules"
32-
run: >
33-
mkdir -p ~/.config/calcit/modules/ && cd ~/.config/calcit/modules/
34-
&& git clone https://github.com/calcit-lang/lilac.git
35-
&& git clone https://github.com/calcit-lang/memof.git
36-
&& git clone https://github.com/Respo/respo.calcit.git
37-
&& git clone https://github.com/Respo/reel.calcit.git
38-
&& git clone https://github.com/Respo/respo-markdown.calcit.git
39-
&& git clone https://github.com/Respo/respo-ui.calcit.git
20+
- uses: supplypike/setup-bin@v3
21+
with:
22+
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.7.13/cr'
23+
name: 'cr'
24+
version: '0.7.13'
4025

26+
- uses: supplypike/setup-bin@v3
27+
with:
28+
uri: 'https://github.com/calcit-lang/calcit/releases/download/0.7.13/caps'
29+
name: 'caps'
30+
version: '0.7.13'
4131
- name: "compiles to js"
4232
run: >
43-
cr --emit-js --once
33+
caps --ci && cr --emit-js --once
4434
&& yarn && yarn vite build --base=./
4535
4636
- name: Deploy to server

calcit.cirru

Lines changed: 29 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compact.cirru

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11

22
{} (:package |app)
3-
:configs $ {} (:init-fn |app.main/main!) (:reload-fn |app.main/reload!)
3+
:configs $ {} (:init-fn |app.main/main!) (:reload-fn |app.main/reload!) (:version |0.0.1)
44
:modules $ [] |respo.calcit/compact.cirru |lilac/compact.cirru |memof/compact.cirru |respo-ui.calcit/compact.cirru |respo-markdown.calcit/compact.cirru |reel.calcit/compact.cirru
5-
:version |0.0.1
65
:entries $ {}
76
:files $ {}
87
|app.comp.container $ {}
9-
:ns $ quote
10-
ns app.comp.container $ :require ([] respo-ui.core :as ui)
11-
respo.util.format :refer $ hsl
12-
[] respo.core :refer $ [] defcomp defeffect <> >> div button textarea span input a body img
13-
[] respo.comp.space :refer $ [] =<
14-
[] reel.comp.reel :refer $ [] comp-reel
15-
[] respo-md.comp.md :refer $ [] comp-md comp-md-block
16-
[] app.config :refer $ [] dev?
17-
"\"cirru-color" :as cirru-color
188
:defs $ {}
9+
|add-link $ quote
10+
defn add-link (title url)
11+
a $ {} (:inner-text title) (:href url) (:target "\"_blank")
12+
|comp-bg $ quote
13+
defcomp comp-bg () (println "\"@@@@@@@@@@@@@@@@\n@\n@ Well, code is not minified on purpose~\n@\n@ although it's still bundled with Vite.\n@\n@@@@@@@@@@@@@@@@")
14+
; img $ {} (:src "\"http://cdn.tiye.me/logo/calcit.png")
15+
:style $ {} (:width "\"60vw") (:z-index -10) (:min-width "\"480px") (:position :fixed) (:opacity 0.12) (:right 0) (:top "\"10vh")
16+
div $ {} (:class-name "\"tile")
17+
:style $ {} (:width "\"100vw") (:height "\"100vh") (:z-index -10) (:position :fixed) (:opacity 0.5)
1918
|comp-container $ quote
2019
defcomp comp-container (reel)
2120
let
@@ -50,11 +49,6 @@
5049
fn (code lang) (cirru-color/generateHtml code)
5150
=< nil 200
5251
when dev? $ comp-reel (>> states :reel) reel ({})
53-
|add-link $ quote
54-
defn add-link (title url)
55-
a $ {} (:inner-text title) (:href url) (:target "\"_blank")
56-
|inline-content! $ quote
57-
defmacro inline-content! (path) (read-file path)
5852
|comp-header $ quote
5953
defcomp comp-header () $ div
6054
{} $ :style
@@ -83,57 +77,43 @@
8377
=< 16 nil
8478
add-link "\"Guidebook" "\"http://repo.calcit-lang.org/guidebook/"
8579
div ({}) (add-link "\"GitHub" "\"https://github.com/calcit-lang/calcit/")
80+
|inline-content! $ quote
81+
defmacro inline-content! (path) (read-file path)
8682
|style-content $ quote
8783
def style-content $ {}
8884
|style-middle $ quote
8985
def style-middle $ {} (:margin "\"0 auto") (:max-width 1000) (:padding "\"0 40px")
90-
|comp-bg $ quote
91-
defcomp comp-bg () (println "\"@@@@@@@@@@@@@@@@\n@\n@ Well, code is not minified on purpose~\n@\n@ although it's still bundled with Vite.\n@\n@@@@@@@@@@@@@@@@")
92-
; img $ {} (:src "\"http://cdn.tiye.me/logo/calcit.png")
93-
:style $ {} (:width "\"60vw") (:z-index -10) (:min-width "\"480px") (:position :fixed) (:opacity 0.12) (:right 0) (:top "\"10vh")
94-
div $ {} (:class-name "\"tile")
95-
:style $ {} (:width "\"100vw") (:height "\"100vh") (:z-index -10) (:position :fixed) (:opacity 0.5)
96-
|app.schema $ {}
97-
:ns $ quote (ns app.schema)
98-
:defs $ {}
99-
|store $ quote
100-
def store $ {}
101-
:states $ {}
102-
:cursor $ []
103-
|app.updater $ {}
10486
:ns $ quote
105-
ns app.updater $ :require
106-
[] respo.cursor :refer $ [] update-states
87+
ns app.comp.container $ :require ([] respo-ui.core :as ui)
88+
respo.util.format :refer $ hsl
89+
[] respo.core :refer $ [] defcomp defeffect <> >> div button textarea span input a body img
90+
[] respo.comp.space :refer $ [] =<
91+
[] reel.comp.reel :refer $ [] comp-reel
92+
[] respo-md.comp.md :refer $ [] comp-md comp-md-block
93+
[] app.config :refer $ [] dev?
94+
"\"cirru-color" :as cirru-color
95+
|app.config $ {}
10796
:defs $ {}
108-
|updater $ quote
109-
defn updater (store op data op-id op-time)
110-
case op
111-
:states $ update-states store data
112-
:hydrate-storage data
113-
op store
97+
|cdn? $ quote
98+
def cdn? $ cond
99+
exists? js/window
100+
, false
101+
(exists? js/process) (= "\"true" js/process.env.cdn)
102+
:else false
103+
|dev? $ quote (def dev? true)
104+
|site $ quote
105+
def site $ {} (:dev-ui "\"http://localhost:8100/main-fonts.css") (:release-ui "\"http://cdn.tiye.me/favored-fonts/main-fonts.css") (:cdn-url "\"http://cdn.tiye.me/calcit-workflow/") (:title "\"Calcit") (:icon "\"http://cdn.tiye.me/logo/mvc-works.png") (:storage-key "\"workflow")
106+
:ns $ quote (ns app.config)
114107
|app.main $ {}
115-
:ns $ quote
116-
ns app.main $ :require
117-
[] respo.core :refer $ [] render! clear-cache! realize-ssr!
118-
[] app.comp.container :refer $ [] comp-container
119-
[] app.updater :refer $ [] updater
120-
[] app.schema :as schema
121-
[] reel.util :refer $ [] listen-devtools!
122-
[] reel.core :refer $ [] reel-updater refresh-reel
123-
[] reel.schema :as reel-schema
124-
[] app.config :as config
125-
"\"./calcit.build-errors" :default build-errors
126-
"\"bottom-tip" :default hud!
127108
:defs $ {}
128-
|render-app! $ quote
129-
defn render-app! () $ render! mount-target (comp-container @*reel) dispatch!
130-
|persist-storage! $ quote
131-
defn persist-storage! () $ .setItem js/localStorage (:storage-key config/site)
132-
js/JSON.stringify $ to-cirru-edn (:store @*reel)
133-
|mount-target $ quote
134-
def mount-target $ .querySelector js/document |.app
135109
|*reel $ quote
136110
defatom *reel $ -> reel-schema/reel (assoc :base schema/store) (assoc :store schema/store)
111+
|dispatch! $ quote
112+
defn dispatch! (op)
113+
when
114+
and config/dev? $ not= (nth op 0) :states
115+
println "\"Dispatch:" op
116+
reset! *reel $ reel-updater updater @*reel op
137117
|main! $ quote
138118
defn main! ()
139119
println "\"Running mode:" $ if config/dev? "\"dev" "\"release"
@@ -147,36 +127,56 @@
147127
when (some? raw)
148128
dispatch! :hydrate-storage $ extract-cirru-edn (js/JSON.parse raw)
149129
println "|App started."
150-
|snippets $ quote
151-
defn snippets () $ println config/cdn?
152-
|dispatch! $ quote
153-
defn dispatch! (op op-data)
154-
when
155-
and config/dev? $ not= op :states
156-
println "\"Dispatch:" op
157-
reset! *reel $ reel-updater updater @*reel op op-data
130+
|mount-target $ quote
131+
def mount-target $ .querySelector js/document |.app
132+
|persist-storage! $ quote
133+
defn persist-storage! () $ .setItem js/localStorage (:storage-key config/site)
134+
js/JSON.stringify $ to-cirru-edn (:store @*reel)
158135
|reload! $ quote
159136
defn reload! () $ if (nil? build-errors)
160137
do (remove-watch *reel :changes) (clear-cache!)
161138
add-watch *reel :changes $ fn (reel prev) (render-app!)
162139
reset! *reel $ refresh-reel @*reel schema/store updater
163140
hud! "\"ok~" "\"Ok"
164141
hud! "\"error" build-errors
142+
|render-app! $ quote
143+
defn render-app! () $ render! mount-target (comp-container @*reel) dispatch!
165144
|repeat! $ quote
166145
defn repeat! (duration cb)
167146
js/setTimeout
168147
fn () (cb)
169148
repeat! (* 1000 duration) cb
170149
* 1000 duration
171-
|app.config $ {}
172-
:ns $ quote (ns app.config)
150+
|snippets $ quote
151+
defn snippets () $ println config/cdn?
152+
:ns $ quote
153+
ns app.main $ :require
154+
[] respo.core :refer $ [] render! clear-cache! realize-ssr!
155+
[] app.comp.container :refer $ [] comp-container
156+
[] app.updater :refer $ [] updater
157+
[] app.schema :as schema
158+
[] reel.util :refer $ [] listen-devtools!
159+
[] reel.core :refer $ [] reel-updater refresh-reel
160+
[] reel.schema :as reel-schema
161+
[] app.config :as config
162+
"\"./calcit.build-errors" :default build-errors
163+
"\"bottom-tip" :default hud!
164+
|app.schema $ {}
173165
:defs $ {}
174-
|cdn? $ quote
175-
def cdn? $ cond
176-
exists? js/window
177-
, false
178-
(exists? js/process) (= "\"true" js/process.env.cdn)
179-
:else false
180-
|dev? $ quote (def dev? true)
181-
|site $ quote
182-
def site $ {} (:dev-ui "\"http://localhost:8100/main-fonts.css") (:release-ui "\"http://cdn.tiye.me/favored-fonts/main-fonts.css") (:cdn-url "\"http://cdn.tiye.me/calcit-workflow/") (:title "\"Calcit") (:icon "\"http://cdn.tiye.me/logo/mvc-works.png") (:storage-key "\"workflow")
166+
|store $ quote
167+
def store $ {}
168+
:states $ {}
169+
:cursor $ []
170+
:ns $ quote (ns app.schema)
171+
|app.updater $ {}
172+
:defs $ {}
173+
|updater $ quote
174+
defn updater (store op op-id op-time)
175+
tag-match op
176+
:states cursor s
177+
update-states store cursor s
178+
(:hydrate-storage d) d
179+
_ $ do (eprintln "\"Unknown op:" op) store
180+
:ns $ quote
181+
ns app.updater $ :require
182+
[] respo.cursor :refer $ [] update-states

package.cirru

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
{}
3+
:dependencies $ {}
4+
|calcit-lang/lilac |main
5+
|calcit-lang/memof |main
6+
|Respo/respo.calcit |main
7+
|Respo/reel.calcit |main
8+
|Respo/respo-markdown.calcit |main
9+
|Respo/respo-ui.calcit |main

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"dependencies": {
3-
"@calcit/procs": "^0.6.19",
3+
"@calcit/procs": "^0.7.13",
44
"cirru-color": "^0.2.3"
55
},
66
"devDependencies": {
7-
"bottom-tip": "^0.1.3",
8-
"vite": "^4.0.4"
7+
"bottom-tip": "^0.1.5",
8+
"vite": "^4.4.9"
99
},
1010
"version": "0.0.1"
1111
}

0 commit comments

Comments
 (0)