Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,7 @@ jobs:
calcit analyze weak-types --only coverage --summary-only --format json |
jq -e '.data.summary.levels | .none == 0 and .partial <= 1'
calcit analyze weak-types --format json |
jq -e '
.data.summary.hits <= 1 and
all(.data.definitions[];
.id == "app.server/on-request!" and
(.occurrences | length == 1) and
all(.occurrences[]; .kind == "schema-dynamic" and .intent == "intentional-js-ffi"))'
jq -e '.data.summary.hits == 0'

- name: Compile browser and server bundles
run: |
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Environment variable:
* `HOST`, listening address (default `0.0.0.0`; use `127.0.0.1` for isolated tests)
* `NO_VERSION_CHECK=1`, skip version checking (`false` or unset checks once)

### Calcit 0.42.0 源码迁移
### Calcit 0.42.1 源码迁移

源码构建需成套使用正式 CLI / `@calcit/procs` **0.42.0**,重新安装依赖并生成浏览器、Node 两个入口。
源码构建需成套使用正式 CLI / `@calcit/procs` **0.42.1**,重新安装依赖并生成浏览器、Node 两个入口。
文件选择使用 `RespoEvent`,数组遍历和 FormData 写入标明实际宿主参数与返回类型。
采用正式 Skir 0.0.40、JS FFI 0.2.13、Respo 0.19.5、UI 0.15.2、Reel 0.11.0 和 Markdown 0.8.2,传递 Router 0.12.2。
依赖按正式版本解析并执行 Caps strict。本轮源码候选沿用 npm 版本 0.1.14。
Expand All @@ -42,7 +42,7 @@ Environment variable:

### 构建与验收

使用 Node 24、Yarn 4.18.0、Caps 0.1.1 和 Calcit 0.42.0:
使用 Node 24、Yarn 4.18.0、Caps 0.1.1 和 Calcit 0.42.1:

```bash
caps --strict --ci
Expand Down
74 changes: 49 additions & 25 deletions calcit.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
:schema $ quote $ Fn (reel.typed/State schema/Op schema/Store)
Fn reel.typed/Control $ -> Unit
-> respo.schema/Component
:features :js-ffi
:features :io :js-ffi
'on-file-selected! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn on-file-selected! (e d!)
let
Expand Down Expand Up @@ -176,7 +176,7 @@
:schema $ quote $ Fn respo.schema/RespoEvent
Fn schema/Op $ -> Unit
-> Unit
:features :js-ffi
:features :io :js-ffi
:ns $ %{} 'NsEntry (:doc |)
:code $ quote $ ns app.comp.container
:require
Expand Down Expand Up @@ -217,7 +217,7 @@
:timestamp $ shared/date-now-snapshot
, &unit
:examples $ []
:schema $ quote $ Fn schema/Op (-> Unit)
:schema $ quote $ Fn schema/Op (-> Unit) (:features :io :state)
'main! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn main! ()
when config/dev? $ load-console-formatter!
Expand All @@ -229,7 +229,7 @@
println "|App started."
, &unit
:examples $ []
:schema $ quote $ Fn (-> Unit) (:features :js-ffi)
:schema $ quote $ Fn (-> Unit) (:features :io :js-ffi :state)
'mount-target $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn mount-target ()
.unwrap $ dom/query-selector |.app
Expand All @@ -240,14 +240,14 @@
reset! *reel $ typed/apply-control updater @*reel control
, &unit
:examples $ []
:schema $ quote $ Fn typed/Control (-> Unit)
:schema $ quote $ Fn typed/Control (-> Unit) (:features :io :state)
'persist-storage! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn persist-storage! ()
browser/storage-set!
.unwrap-or (get config/site :storage) |file-sucker
format-cirru-edn $ :store @*reel
:examples $ []
:schema $ quote $ Fn (-> Unit) (:features :js-ffi)
:schema $ quote $ Fn (-> Unit) (:features :js-ffi :state)
'reload! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn reload! ()
if (nil? build-errors)
Expand All @@ -258,12 +258,12 @@
hud! |error build-errors
, &unit
:examples $ []
:schema $ quote $ Fn (-> Unit) (:features :js-ffi)
:schema $ quote $ Fn (-> Unit) (:features :io :js-ffi :state)
'render-app! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn render-app! ()
render! (mount-target) (comp-container @*reel on-control!) dispatch!
:examples $ []
:schema $ quote $ Fn (-> Unit)
:schema $ quote $ Fn (-> Unit) (:features :io :state)
:ns $ %{} 'NsEntry (:doc |)
:code $ quote $ ns app.main
:require
Expand Down Expand Up @@ -351,6 +351,15 @@
:code $ quote $ defunion FileIndexItem String respo.schema/Element
:examples $ []
:schema $ quote UnionDef
'FileIndexPromiseHost $ %{} 'CodeEntry (:doc |)
:code $ quote $ deftrait FileIndexPromiseHost
.then! $ Fn app.server/FileIndexPromiseHost
Fn (Map Tag HttpResponseField) (-> Unit)
-> app.server/FileIndexPromiseHost
:examples $ []
:ffi $ {} (:backend :js) (:kind :external-object) (:target :node)
:names $ {} $ :then! |then
:schema $ quote Trait
'FilesHost $ %{} 'CodeEntry (:doc |)
:code $ quote $ deftrait FilesHost
:file $ JsNullish app.server/UploadedFilesHost
Expand All @@ -370,6 +379,14 @@
:examples $ []
:ffi $ {} (:backend :js) (:kind :external-object) (:target :node)
:schema $ quote Trait
'HttpResponse $ %{} 'CodeEntry
:doc "|An immediate HTTP response or a deferred handler."
:code $ quote $ defunion HttpResponse (Map Tag HttpResponseField)
Fn
Fn (Map Tag HttpResponseField) (-> Unit)
-> Unit
:examples $ []
:schema $ quote UnionDef
'HttpResponseField $ %{} 'CodeEntry (:doc |)
:code $ quote $ defunion HttpResponseField Number String (Map String String)
:examples $ []
Expand Down Expand Up @@ -409,21 +426,18 @@
:ffi $ {} (:backend :js) (:kind :external-object) (:target :node)
:writable $ #{} :url
:schema $ quote Trait
'RouteResult $ %{} 'CodeEntry
:doc "|An immediate response, deferred response, or completed Node response effect."
:code $ quote $ defunion RouteResult HttpResponse Tag
:examples $ []
:schema $ quote UnionDef
'TaskArrayHost $ %{} 'CodeEntry (:doc |)
:code $ quote $ deftrait TaskArrayHost
.push! $ Fn app.server/TaskArrayHost JsObject $ -> Number
:examples $ []
:ffi $ {} (:backend :js) (:kind :external-object) (:target :node)
:names $ {} $ :push! |push
:schema $ quote Trait
'UploadRouteResult $ %{} 'CodeEntry
:doc "|An immediate HTTP response or a deferred upload handler."
:code $ quote $ defunion UploadRouteResult (Map Tag HttpResponseField)
Fn
Fn (Map Tag HttpResponseField) (-> Unit)
-> Unit
:examples $ []
:schema $ quote UnionDef
'UploadedFileHost $ %{} 'CodeEntry (:doc |)
:code $ quote $ deftrait UploadedFileHost
:original-filename $ JsNullish String
Expand Down Expand Up @@ -457,7 +471,7 @@
println $ yellow-text $ str "|New version " npm-version "| available, current one is " version "| . Please upgrade!" "|\n\nyarn global add file-sucker\n"
, &unit
:examples $ []
:schema $ quote $ Fn (-> Unit) (:features :js-ffi) (:async)
:schema $ quote $ Fn (-> Unit) (:features :io :js-ffi) (:async)
'dirname $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn dirname ()
let
Expand Down Expand Up @@ -542,7 +556,7 @@
, &unit
, &unit
:examples $ []
:schema $ quote $ Fn (-> Unit) (:features :js-ffi)
:schema $ quote $ Fn (-> Unit) (:features :io :js-ffi)
'make-task-array $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn make-task-array ()
js-cast (js-array) app.server/TaskArrayHost
Expand All @@ -556,7 +570,7 @@
serve-files! req res
, :effect
:examples $ []
:schema $ quote $ Fn RequestHost node/NodeServerResponseHost (-> Tag) (:features :js-ffi)
:schema $ quote $ Fn RequestHost node/NodeServerResponseHost (-> Tag) (:features :io :js-ffi)
'on-file-indexed! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn on-file-indexed! (req res)
hint-fn $ Fn RequestHost node/NodeServerResponseHost
Expand Down Expand Up @@ -628,7 +642,9 @@
:code $ quote $ defn on-request! (req-edn res)
match (:original-request req-edn)
(:none)
{} (:code 500) (:body "|Missing original Node request")
assert-type
{} (:code 500) (:body "|Missing original Node request")
Map Tag HttpResponseField
(:some original)
let
req $ js-cast original 'app.server/RequestHost
Expand All @@ -637,11 +653,19 @@
= |/upload req-url
on-upload! req res
(or (= req-url |/files) (= req-url |/files/))
on-file-indexed! req res
fn (send!)
hint-fn $ Fn
Fn (Map Tag HttpResponseField) (-> Unit)
-> Unit
:features :js-ffi :io
let
index-promise $ js-cast (on-file-indexed! req res) 'app.server/FileIndexPromiseHost
index-promise .then! send!
, &unit
(starts-with? req-url |/files/) (on-download! req res)
true $ on-page! req res
:examples $ []
:schema $ quote $ Fn skir.schema/Request node/NodeServerResponseHost (-> Dynamic) (:features :js-ffi)
:schema $ quote $ Fn skir.schema/Request node/NodeServerResponseHost (-> RouteResult) (:features :io :js-ffi)
'on-upload! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn on-upload! (req res)
match
Expand Down Expand Up @@ -696,7 +720,7 @@
|OPTIONS $ {} (:code 200) (:body |ok)
_ $ {} (:code 404) (:body "|method not supported")
:examples $ []
:schema $ quote $ Fn RequestHost node/NodeServerResponseHost (-> UploadRouteResult) (:features :js-ffi)
:schema $ quote $ Fn RequestHost node/NodeServerResponseHost (-> HttpResponse) (:features :io :js-ffi)
'read-file-names $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn read-file-names () (node/read-dir! |.)
:examples $ []
Expand All @@ -713,7 +737,7 @@
'reload! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn reload! () (println |reloaded!) &unit
:examples $ []
:schema $ quote $ Fn (-> Unit) (:features :js-ffi)
:schema $ quote $ Fn (-> Unit) (:features :io :js-ffi)
'serve $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn serve (req res) (static/servePage req res) &unit
:examples $ []
Expand Down Expand Up @@ -760,7 +784,7 @@
assoc store :logs $ []
_ $ do (println "|Unknown op:" op) store
:examples $ []
:schema $ quote $ Fn app.schema/Store app.schema/Op String Number (-> app.schema/Store)
:schema $ quote $ Fn app.schema/Store app.schema/Op String Number (-> app.schema/Store) (:features :io)
:ns $ %{} 'NsEntry (:doc |)
:code $ quote $ ns app.updater
:require $ respo.cursor :refer $ update-states
Expand Down
2 changes: 1 addition & 1 deletion deps.cirru
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

{} (:calcit-version |0.42.0)
{} (:calcit-version |0.42.1)
:version |0.1.14
:dependencies $ {} (|Respo/reel.calcit |0.11.0)
|Respo/respo-markdown.calcit |0.8.2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"vite": "8.3.3"
},
"dependencies": {
"@calcit/procs": "0.42.0",
"@calcit/procs": "0.42.1",
"chalk": "^5.2.0",
"dayjs": "^1.11.7",
"finalhandler": "^1.2.0",
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading