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
14 changes: 7 additions & 7 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
base-url: ${{ steps.asset-path.outputs.base-url }}
artifact-name: frontend-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false

- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
- uses: actions/setup-node@v6.5.0
with:
node-version: 24
package-manager-cache: false
Expand All @@ -31,7 +31,7 @@ jobs:
corepack prepare yarn@4.18.0 --activate
yarn --version
- uses: calcit-lang/setup-calcit@ca701be5a471759e442aa053cd100720bbe1f09f # v1.5.0
- uses: calcit-lang/setup-calcit@v1.5.0
with:
tools: calcit,caps
caps-version: "0.1.1"
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
yarn build
- name: Save tested frontend artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
uses: actions/upload-artifact@v7.0.2
with:
name: frontend-${{ github.run_id }}-${{ github.run_attempt }}
path: dist
Expand All @@ -95,7 +95,7 @@ jobs:
queue: max
steps:
- name: Download tested frontend artifact
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
uses: actions/download-artifact@v8.0.2
with:
name: ${{ needs.test.outputs.artifact-name }}
path: dist
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
- name: Upload and publicly verify frontend assets
if: steps.deploy-head.outputs.current == 'true' && steps.cos-credentials.outputs.available == 'true'
timeout-minutes: 10
uses: worktools/cos-upload-action@06d6027dcca6413c5936e04a9b6e9f0d5ef71ba0 # v1.2.0
uses: worktools/cos-upload-action@v1.2.0
with:
source-dir: dist
bucket: ${{ secrets.COS_BUCKET }}
Expand All @@ -169,7 +169,7 @@ jobs:
- name: Deploy to server
id: deploy
if: steps.deploy-head.outputs.current == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: Pendect/action-rsyncer@8e05ffa5c93e5d9c9b167796b26044d2c616b2b9 # v2.0.0
uses: Pendect/action-rsyncer@v2.0.0
env:
DEPLOY_KEY: ${{secrets.rsync_private_key}}
with:
Expand Down
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
nodeLinker: node-modules

npmMinimalAgeGate: 60
42 changes: 23 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,30 @@ http://map.clj.im

### Contribute

Fork and edit Clojure code, and send PR!
Fork and edit the Calcit source with the structured CLI, then send a PR.

### Workflow

https://github.com/calcit-lang/respo-calcit-workflow

### 使用者影响

CLI / `@calcit/procs` 配对正式 **0.32.1**,升级后整图安装、重新生成JS并完整刷新。
使用已发布Respo **0.17.1**、JS-FFI **0.2.9**、Reel **0.7.0-alpha.5**;仍有精确alpha
依赖,不宣称整图全部稳定,不使用本地候选、未发布tag或hash。

官方工具规范化四处类型表达式,26个项目定义schema保持。站点链接、存档key/格式、
恢复成功后启用保存的顺序、60秒间隔和真实HUD不变。保留原全定义、公开合同、
完整strict和两项存档/状态测试,不新增强转、预算或验证脚本。
真实Caps strict/toolchain、原检查/测试、构建和immutable安装通过,npm等待为一小时。

此前0.32.0候选已验收四类导航、12个社区链接及源码链接目标、刷新;本次未重跑
浏览器、坏存档、60秒定时器或HMR,不访问外站或真实存档。
损坏存档仍报告错误并关闭后续保存,静态链接仍可用,不用默认状态覆盖原文。
本PR不合并、生产部署或发版,原COS路径、artifact与阻止旧提交部署的条件保持。

### Development and deployment

开发与 CI 使用配对正式 Calcit/procs 0.31.0,以及已发布 Reel 0.7.0-alpha.4、Respo 0.17.0-alpha.4、
js-ffi 0.2.7;模块图仍含 alpha,可能有样式差异;升级后需重新安装模块并构建、刷新,避免混用旧生成代码。
站点链接、存储键、存档格式与部署路径不变,仅同步 procs 锁版本。
本次补齐默认入口 DispatchOp Enum 绑定,原 Enum 守卫与业务/Reel 分派保持;不增加强转或放宽门禁。
此前已将自动保存从误用的 60 毫秒修正为 60 秒;存档恢复成功后才安装定时器与卸载保存监听。
损坏存档仍明确报告错误,但不会被后续自动保存覆盖;页面静态链接仍可用。
Use Node.js 24 and Yarn 4.18.0. The canonical source files are
`calcit.cirru` and `deps.cirru`; do not recreate `compact.cirru` or `package.cirru`.

Expand All @@ -51,18 +61,12 @@ legacy Map/new Store data when hydrating the original `map.clj.im` storage key.
保留一处实际 `&struct:to-map` 转换,不以类型断言或 Dynamic 擦除伪造身份。
移除无引用的模板 `repeat!` / `snippets`,不引入新的定时器框架。

此前三处源码的 Option helper 已改为接收者 `.unwrap`;本轮原测试中的 `get-in` 已返回 Result,改用 `:ok/:err` 分支,仍在缺失时失败;
没有改为吞错、nil 或默认值。原两项测试的业务断言不变。
三份静态样式的行高改为无单位 String(4、3、2.4),对应 schema 从
`Map<Tag,Dynamic>` 收紧为 `Map<Tag,String>`。实际 Respo DOM 实现原本就将这些
数值行高输出为同样的无单位字符串,因此不改变行高,也不新增运行期转换或强断言。
`hud!`、恢复成功后才启用保存的顺序、60 秒间隔和卸载保存均保持。
这些真实源头类型可以直接收紧,不需要增加编译器 fix/proof 规则或迁移脚本。

本轮本地未运行 Caps;开发者仍须执行上述安装步骤以生成模块链接,CI 独立 strict 解析。
两项定义附着业务测试覆盖旧 Map/Struct 存档往返、局部状态更新及 content 保留,
不新增检查脚本。此前 alpha 迁移曾用隔离合成存档验收恢复、保存重载、热更新回放及损坏存档卸载不覆盖;
这不是正式版本的同范围验收证明,临时观察页不提交。外部历史链接可达性及移动端未验收,本 PR 不授权合并或生产部署。
原两项定义附带测试保留旧Map/Struct往返、局部状态和content断言,get-in的Result
仍按ok/err分支处理,不吞错或填默认值。三份静态样式保留Map<Tag,String>与无单位
行高,不引入额外转换、强断言或compiler proof/fix规则。
HUD、60秒保存和恢复后才注册定时/卸载保存的顺序保持。此前隔离合成存档验收
不代表本次坏存档、热更新或保存重载已复验,移动端和外部历史链接也未验证。
本轮依赖安装使用真实已发布图,不沿用本地候选结果作为发布证明。

`VITE_BASE_URL` controls asset URLs (default `./`). CI builds against
`https://cos-sh.tiye.me/clojure-china/map.clojure-china.org/`, with
Expand Down
79 changes: 30 additions & 49 deletions calcit.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
:code $ quote $ defn address (a-text a-link)
a $ {} (:style style-link) (:href a-link) (:inner-text a-text) (:target |_blank)
:examples $ []
:schema $ :: 'Fn $ {} (:return 'respo.schema/Element)
:args $ [] 'String 'String
:schema $ quote $ Fn String String (-> respo.schema/Element)
'comp-container $ %{} 'CodeEntry (:doc |)
:code $ quote $ defcomp comp-container (reel)
let
Expand Down Expand Up @@ -77,25 +76,24 @@
address "|知乎 Clojure 标签" |https://www.zhihu.com/topic/19597039/hot
div $ {} $ :style style-section
:examples $ []
:schema $ :: 'Fn $ {} (:return 'respo.schema/Component)
:args $ [] $ :: 'reel.typed/State 'Enum 'app.schema/Store
:schema $ quote $ Fn (reel.typed/State Enum app.schema/Store) (-> respo.schema/Component)
'style-a $ %{} 'CodeEntry (:doc |)
:code $ quote $ def style-a
{}
:color $ hsl 200 40 70
:text-decoration |none
:examples $ []
:schema $ :: 'Map 'Tag 'String
:schema $ quote $ Map Tag String
'style-category $ %{} 'CodeEntry (:doc |)
:code $ quote $ def style-category
{} (:font-size |32px) (:font-weight |bold) (:line-height |4)
:examples $ []
:schema $ :: 'Map 'Tag 'String
:schema $ quote $ Map Tag String
'style-container $ %{} 'CodeEntry (:doc |)
:code $ quote $ def style-container
{} $ :font-family "|Helvetica Neue, PingFang SC, Microsoft Yahei, 微软雅黑, STXihei, 华文细黑, sans-serif"
:examples $ []
:schema $ :: 'Map 'Tag 'String
:schema $ quote $ Map Tag String
'style-header $ %{} 'CodeEntry (:doc |)
:code $ quote $ def style-header
{}
Expand All @@ -106,28 +104,28 @@
:line-height |160px
:height |160px
:examples $ []
:schema $ :: 'Map 'Tag 'String
:schema $ quote $ Map Tag String
'style-hint $ %{} 'CodeEntry (:doc |)
:code $ quote $ def style-hint
{} (:text-align |center) (:font-size |12px) (:line-height |3)
:background-color $ hsl 120 40 92
:examples $ []
:schema $ :: 'Map 'Tag 'String
:schema $ quote $ Map Tag String
'style-link $ %{} 'CodeEntry (:doc |)
:code $ quote $ def style-link
{} (:line-height |2.4) (:font-size |18px) (:text-decoration |none) (:display |block)
:examples $ []
:schema $ :: 'Map 'Tag 'String
:schema $ quote $ Map Tag String
'style-resources $ %{} 'CodeEntry (:doc |)
:code $ quote $ def style-resources
{} $ :padding-left |40px
:examples $ []
:schema $ :: 'Map 'Tag 'String
:schema $ quote $ Map Tag String
'style-section $ %{} 'CodeEntry (:doc |)
:code $ quote $ def style-section
{} (:margin |auto) (:padding |40px) (:max-width |400px)
:examples $ []
:schema $ :: 'Map 'Tag 'String
:schema $ quote $ Map Tag String
:ns $ %{} 'NsEntry (:doc |)
:code $ quote $ ns app.comp.container
:require
Expand All @@ -141,14 +139,14 @@
get-env |cdn
, .unwrap-or |false
:examples $ []
:schema $ :: 'Bool
:schema $ quote Bool
'dev? $ %{} 'CodeEntry (:doc |)
:code $ quote $ def dev?
= |dev $
get-env |mode
, .unwrap-or |release
:examples $ []
:schema $ :: 'Bool
:schema $ quote Bool
'site $ %{} 'CodeEntry (:doc |)
:code $ quote $ def site
{} (:dev-ui |http://localhost:8100/main-fonts.css) (:release-ui |http://cdn.tiye.me/favored-fonts/main-fonts.css)
Expand All @@ -157,7 +155,7 @@
:icon |http://cdn.tiye.me/logo/cljs.png
:storage-key |map.clj.im
:examples $ []
:schema $ :: 'Map 'Tag 'String
:schema $ quote $ Map Tag String
:ns $ %{} 'NsEntry (:doc |)
:code $ quote $ ns app.config
'app.main $ %{} 'FileEntry
Expand All @@ -166,7 +164,7 @@
:code $ quote $ defref *reel
typed/State :base schema/store :store schema/store :records ([]) :pointer (Option :none) :stopped? false :display? false :merged? false
:examples $ []
:schema $ :: 'Ref $ :: 'reel.typed/State 'Enum 'app.schema/Store
:schema $ quote $ Ref (reel.typed/State Enum app.schema/Store)
'dispatch! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn dispatch! (raw-op)
if (enum? raw-op)
Expand All @@ -180,17 +178,13 @@
raise |Dispatch-expected-an-Enum
, &unit
:examples $ []
:schema $ :: 'Fn $ {} (:return 'Unit)
:args $ [] 'Dynamic
:features $ #{} :js-ffi
:schema $ quote $ Fn Dynamic (-> Unit) (:features :js-ffi)
'main! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn main! ()
println "|Running mode:" $ if config/dev? |dev |release
render-app!
add-watch! *reel :changes $ fn (r p)
hint-fn $ {}
:args $ [] (:: 'reel.typed/State 'Enum 'app.schema/Store) (:: 'reel.typed/State 'Enum 'app.schema/Store)
:return 'Unit
hint-fn $ Fn (reel.typed/State Enum app.schema/Store) (reel.typed/State Enum app.schema/Store) (-> Unit)
render-app!
listen-devtools! |a dispatch!
match
Expand All @@ -204,50 +198,40 @@
browser/set-interval! persist-storage! 60000
println "|App started."
:examples $ []
:schema $ :: 'Fn $ {} (:return 'Unit)
:args $ []
:features $ #{} :js-ffi
:schema $ quote $ Fn (-> Unit) (:features :js-ffi)
'mount-target $ %{} 'CodeEntry (:doc |)
:code $ quote $ def mount-target
.unwrap $ dom/query-selector |.app
:examples $ []
:schema $ :: 'respo.dom/DomElement
:schema $ quote respo.dom/DomElement
'persist-storage! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn persist-storage! ()
browser/storage-set!
get config/site :storage-key
, .unwrap
format-cirru-edn $ :store @*reel
:examples $ []
:schema $ :: 'Fn $ {} (:return 'Unit)
:args $ []
:features $ #{} :js-ffi
:schema $ quote $ Fn (-> Unit) (:features :js-ffi)
'reload! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn reload! ()
if (js-nullish? build-errors)
do (remove-watch! *reel :changes) (clear-cache!)
add-watch! *reel :changes $ fn (reel prev)
hint-fn $ {}
:args $ [] (:: 'reel.typed/State 'Enum 'app.schema/Store) (:: 'reel.typed/State 'Enum 'app.schema/Store)
:return 'Unit
hint-fn $ Fn (reel.typed/State Enum app.schema/Store) (reel.typed/State Enum app.schema/Store) (-> Unit)
render-app!
reset! *reel $ typed/refresh updater @*reel schema/store
hud! |ok~ |Ok
hud! |error build-errors
, &unit
:examples $ []
:schema $ :: 'Fn $ {} (:return 'Unit)
:args $ []
:features $ #{} :js-ffi
:schema $ quote $ Fn (-> Unit) (:features :js-ffi)
'render-app! $ %{} 'CodeEntry (:doc |)
:code $ quote $ defn render-app! ()
render-with! mount-target
fn () $ comp-container @*reel
, dispatch!
:examples $ []
:schema $ :: 'Fn $ {} (:return 'Unit)
:args $ []
:features $ #{} :js-ffi
:schema $ quote $ Fn (-> Unit) (:features :js-ffi)
:ns $ %{} 'NsEntry (:doc |)
:code $ quote $ ns app.main
:require
Expand All @@ -268,19 +252,19 @@
'DispatchOp $ %{} 'CodeEntry (:doc "|Respo 入口事件合同,容纳应用和 Reel 控制事件;代表值不发送。")
:code $ quote $ def DispatchOp (:: :unhandled)
:examples $ []
:schema $ :: 'Enum
:schema $ quote Enum
'StatesInput $ %{} 'CodeEntry (:doc |)
:code $ quote $ defstruct StatesInput
:cursor $ :: 'List 'Tag
:cursor $ quote $ List Tag
:data 'Dynamic
:examples $ []
:schema $ :: 'StructDef
:schema $ quote StructDef
'Store $ %{} 'CodeEntry (:doc |)
:code $ quote $ defstruct Store
:states $ :: 'Map 'Tag 'Dynamic
:states $ quote $ Map Tag Dynamic
:content 'String
:examples $ []
:schema $ :: 'StructDef
:schema $ quote StructDef
'decode-store $ %{} 'CodeEntry
:doc "|Restore legacy Maps or parsed Struct archives by validating named fields into the current Store constructor. The single struct-to-map conversion is an actual archive boundary, not a type assertion; unrelated legacy keys remain ignored."
:code $ quote $ defn decode-store (raw)
Expand All @@ -292,8 +276,7 @@
:content $ .unwrap $ get fields :content
, Store
:examples $ []
:schema $ :: 'Fn $ {} (:return 'app.schema/Store)
:args $ [] 'Dynamic
:schema $ quote $ Fn Dynamic (-> app.schema/Store)
:tests $ [] $ %{} 'TestEntry (:name |legacy-map-and-struct-archive)
:code $ quote $ let
decoded $ decode-store $ {}
Expand All @@ -308,7 +291,7 @@
:code $ quote $ def store
Store :states ({}) :content |
:examples $ []
:schema $ :: 'app.schema/Store
:schema $ quote app.schema/Store
:ns $ %{} 'NsEntry (:doc |)
:code $ quote $ ns app.schema
'app.updater $ %{} 'FileEntry
Expand All @@ -329,9 +312,7 @@
(:hydrate-storage data) (decode-store data)
_ $ do (eprintln "|Unknown op:" op) store
:examples $ []
:schema $ :: 'Fn $ {} (:return 'app.schema/Store)
:args $ [] 'app.schema/Store 'Enum 'String 'Number
:features $ #{} :js-ffi
:schema $ quote $ Fn app.schema/Store Enum String Number (-> app.schema/Store) (:features :js-ffi)
:tests $ [] $ %{} 'TestEntry (:name |cursor-preserves-content)
:code $ quote $ let
base $ app.schema/Store :states ({}) :content |keep
Expand Down
8 changes: 4 additions & 4 deletions deps.cirru
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{} (:calcit-version |0.31.0)
{} (:calcit-version |0.32.1)
:version |0.0.1
:dependencies $ {}
|Respo/reel.calcit |0.7.0-alpha.4
|Respo/respo.calcit |0.17.0-alpha.4
|calcit-lang/js-ffi |0.2.7
|Respo/reel.calcit |0.7.0-alpha.5
|Respo/respo.calcit |0.17.1
|calcit-lang/js-ffi |0.2.9
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"vite": "^8.3.3"
},
"dependencies": {
"@calcit/procs": "0.31.0",
"@calcit/procs": "0.32.1",
"bottom-tip": "^0.1.5"
}
}
Loading