diff --git a/.github/workflows/upload.yaml b/.github/workflows/upload.yaml index 0a74703..7918e65 100644 --- a/.github/workflows/upload.yaml +++ b/.github/workflows/upload.yaml @@ -17,6 +17,7 @@ concurrency: jobs: test: runs-on: ubuntu-24.04 + timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -45,6 +46,7 @@ jobs: caps --ci --strict yarn install --immutable caps verify --toolchain + git diff --quiet -- deps.cirru package.json yarn.lock .yarnrc.yml - name: Validate Calcit snapshot run: | @@ -54,9 +56,9 @@ jobs: test ! -e compact.cirru test ! -e package.cirru calcit calcit.cirru edit format - git diff --exit-code -- calcit.cirru + git diff --quiet -- calcit.cirru calcit calcit.cirru --check-only --all-defs - calcit calcit.cirru fix --workflow strict --verify --format json + calcit calcit.cirru fix --workflow strict --verify --format json | jq -e '.data.workflow.status == "passed" and .diagnostics == []' - name: Build client with CDN asset URLs id: asset-path @@ -78,6 +80,7 @@ jobs: node --test scripts/upgrade.test.mjs - name: Upload static assets to COS + timeout-minutes: 10 if: github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login != 'dependabot[bot]') uses: worktools/cos-upload-action@06d6027dcca6413c5936e04a9b6e9f0d5ef71ba0 # v1.2.0 with: diff --git a/.yarnrc.yml b/.yarnrc.yml index 1e8c592..3186f3f 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,3 +1 @@ nodeLinker: node-modules -npmPreapprovedPackages: - - "@calcit/procs@0.30.1-alpha.5" diff --git a/README.md b/README.md index e29780f..d787e2e 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,16 @@ http://r.tiye.me/Memkits/diffview/ ### 使用者影响:正式 Calcit 0.30.1 配对 -CLI/runtime一起升级到正式 **0.30.1**,同步Reel0.6.41、UI0.8.0、Respo0.16.124 -及传递JS-FFI0.2.5、Router0.8.37。请重新安装完整依赖图、生成JS并刷新,勿混装旧alpha缓存。 -本次不改Snapshot、行/词差异、Sorted/Swap/Clear、快捷键或存档格式/key;旧Struct/Map恢复合同保留。 -删除all-defs已覆盖的重复namespace清单,完整strict、原六项业务回归和COS内置verify保留, -不增加验证脚本、concurrently、预算或兼容强转。不改原前端/服务器路径;PR只预览,不部署生产。 +CLI/runtime 继续正式 **0.30.1**,同步精确正式 Reel 0.6.42、UI 0.8.1、Respo 0.16.126, +及传递 JS-FFI 0.2.6、Router 0.8.38。请重新安装完整依赖图、生成 JS 并刷新,勿混装旧 alpha 缓存。 +启动改为先恢复存档成功,再首次渲染/注册保存,避免解析失败后被默认状态覆盖;不吞掉异常或清空原值。 +行/词差异、Sorted/Swap/Clear、快捷键或存档格式/key 不变;旧 Struct/Map 恢复合同及真实 HUD 保留。 +7 处 Option unwrap-or 改为方法,保留空字符串/false 默认值;7 个 DOM 回调补实际 EventHandler 合同, +comp-checked 的处理器参数从错误的 RespoEvent Struct 改为真实 Map 事件/dispatch Fn 合同,不伪装为封闭业务 Op。 +19 处 CSS 长度/关键字按原渲染规则改为等价 String,不改变尺寸、颜色或布局。 +完整 strict、原六项业务回归和 COS 内置 verify 保留;不新增验证脚本、concurrently、预算、强转或测试框架。 +删除旧 alpha 的 npm 预批准例外,正式包按普通安装策略验证,不新增正式包例外。 +不改原前端/服务器路径;PR 只预览,不部署生产。正常刷新恢复不代表坏存档验收;进展见 [#46](https://github.com/Memkits/diffview/issues/46)。 Use paired formal Calcit / `@calcit/procs` 0.30.1 and the canonical `calcit.cirru` / `deps.cirru` files. Retired `compact.cirru` and `package.cirru` snapshots are ignored and rejected diff --git a/calcit.cirru b/calcit.cirru index 0d05244..1d1886c 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -14,17 +14,17 @@ :code $ quote $ defcomp comp-checked (checked? text handler) div {} (:class-name css/row-center) - :style $ {} $ :cursor :pointer + :style $ {} $ :cursor |pointer :on-click handler input $ {} (:type |checkbox) (:checked checked?) - :style $ {} $ :cursor :pointer + :style $ {} $ :cursor |pointer <> text css/font-fancy :examples $ [] :schema $ :: 'Fn $ {} (:return 'respo.schema/Component) :args $ [] 'Bool 'String $ :: 'Fn {} (:return 'Unit) - :args $ [] 'respo.schema/RespoEvent $ :: 'Fn - {} (:return 'Unit) + :args $ [] (:: 'Map 'Tag 'Dynamic) + :: 'Fn $ {} (:rest 'Dynamic) (:return 'Unit) :args $ [] 'Dynamic 'comp-container $ %{} 'CodeEntry (:doc |) :code $ quote $ defcomp comp-container (reel) @@ -48,7 +48,7 @@ div {} :class-name $ str-spaced css/flex css/row - :style $ {} $ :overflow :auto + :style $ {} $ :overflow |auto if show-result? (comp-diff-view changes by-word?) div {} $ :class-name $ str-spaced css/expand css/row css/flex @@ -57,7 +57,11 @@ :value $ :old-text store :placeholder "|Old text" :on-input $ fn (e d!) - d! $ :: :write-old $ option:unwrap-or (get e :value) | + hint-fn $ {} (:return 'Unit) + :args $ [] (:: 'Map 'Tag 'Dynamic) + :: 'Fn $ {} (:return 'Unit) (:rest 'Dynamic) + :args $ [] 'Dynamic + d! $ :: :write-old $ .unwrap-or (get e :value) | :spell-check false :autofocus true comp-divider @@ -66,10 +70,14 @@ :value $ :new-text store :placeholder "|New text" :on-input $ fn (e d!) - d! $ :: :write-new $ option:unwrap-or (get e :value) | + hint-fn $ {} (:return 'Unit) + :args $ [] (:: 'Map 'Tag 'Dynamic) + :: 'Fn $ {} (:return 'Unit) (:rest 'Dynamic) + :args $ [] 'Dynamic + d! $ :: :write-new $ .unwrap-or (get e :value) | :spellcheck false when dev? $ comp-reel (>> states :reel) (reel-view/view-data reel) ({}) - when dev? $ comp-inspect |Store store $ {} (:bottom 0) + when dev? $ comp-inspect |Store store $ {} (:bottom |0px) :examples $ [] :schema $ :: 'Fn $ {} (:return 'respo.schema/Component) :args $ [] $ :: 'reel.typed/State 'Enum 'app.schema/StoreData @@ -78,17 +86,17 @@ :code $ quote $ defcomp comp-diff-view (changes by-word?) list-> {} (:class-name css/flex) - :style $ {} (:padding-bottom 80) (:overflow :auto) + :style $ {} (:padding-bottom |80px) (:overflow |auto) :line-height $ if by-word? |20px -> changes $ map-indexed $ fn (idx chunk) [] idx $ let tok $ :value chunk cond - option:unwrap-or (:removed chunk) false + .unwrap-or (:removed chunk) false div $ {} (:inner-text tok) :class-name $ str-spaced style-line style-removed $ if by-word? style-word-mode :title $ str "|Removed " (:count chunk) "| chunks" - (option:unwrap-or (:added chunk) false) + (.unwrap-or (:added chunk) false) div $ {} (:inner-text tok) :class-name $ str-spaced style-line style-added $ if by-word? style-word-mode :title $ str "|Added " (:count chunk) "| chunks" @@ -101,7 +109,7 @@ 'comp-divider $ %{} 'CodeEntry (:doc |) :code $ quote $ defcomp comp-divider () div $ {} $ :style - {} (:width 1) + {} (:width |1px) :background-color $ hsl 0 0 94 :examples $ [] :schema $ :: 'Fn $ {} (:return 'respo.schema/Component) @@ -116,20 +124,40 @@ div {} $ :class-name css/row-center comp-checked show-result? "|Result?(⌘ e)" $ fn (e d!) + hint-fn $ {} (:return 'Unit) + :args $ [] (:: 'Map 'Tag 'Dynamic) + :: 'Fn $ {} (:return 'Unit) (:rest 'Dynamic) + :args $ [] 'Dynamic d! $ :: :toggle-result =< 16 nil comp-checked sorted? |Sorted $ fn (e d!) + hint-fn $ {} (:return 'Unit) + :args $ [] (:: 'Map 'Tag 'Dynamic) + :: 'Fn $ {} (:return 'Unit) (:rest 'Dynamic) + :args $ [] 'Dynamic d! $ :: :toggle-sorted =< 16 nil comp-checked by-word? |ByWord $ fn (e d!) + hint-fn $ {} (:return 'Unit) + :args $ [] (:: 'Map 'Tag 'Dynamic) + :: 'Fn $ {} (:return 'Unit) (:rest 'Dynamic) + :args $ [] 'Dynamic d! $ :: :toggle-word =< 16 nil a $ {} (:class-name css/link) (:inner-text |Swap) (:title "|⌘ i") :on-click $ fn (e d!) + hint-fn $ {} (:return 'Unit) + :args $ [] (:: 'Map 'Tag 'Dynamic) + :: 'Fn $ {} (:return 'Unit) (:rest 'Dynamic) + :args $ [] 'Dynamic d! $ :: :swap-text =< 16 nil a $ {} (:class-name css/link) (:inner-text |Clear) (:title "|⌘ k") :on-click $ fn (e d!) + hint-fn $ {} (:return 'Unit) + :args $ [] (:: 'Map 'Tag 'Dynamic) + :: 'Fn $ {} (:return 'Unit) (:rest 'Dynamic) + :args $ [] 'Dynamic d! $ :: :clear-text :examples $ [] :schema $ :: 'Fn $ {} (:return 'respo.schema/Component) @@ -151,7 +179,7 @@ :schema $ :: 'String 'style-line $ %{} 'CodeEntry (:doc |) :code $ quote $ defstyle style-line - {} $ |& $ {} (:line-height |24px) (:font-size 12) (:font-family ui/font-code) (:margin 0) (:padding "|0 8px") (:white-space :pre) (:overflow-x :auto) + {} $ |& $ {} (:line-height |24px) (:font-size |12px) (:font-family ui/font-code) (:margin |0px) (:padding "|0 8px") (:white-space |pre) (:overflow-x |auto) :examples $ [] :schema $ :: 'String 'style-no-change $ %{} 'CodeEntry (:doc |) @@ -165,12 +193,12 @@ :code $ quote $ defstyle style-removed {} $ |& $ {} :background-color $ hsl 0 100 78 - :color :white + :color |white :examples $ [] :schema $ :: 'String 'style-text $ %{} 'CodeEntry (:doc |) :code $ quote $ defstyle style-text - {} $ |& $ {} (:font-family ui/font-code) (:line-height |20px) (:font-size 12) (:white-space :pre) (:overflow :auto) (:border :none) (:padding "|8px 8px 80px 8px") (:resize :none) + {} $ |& $ {} (:font-family ui/font-code) (:line-height |20px) (:font-size |12px) (:white-space |pre) (:overflow |auto) (:border |none) (:padding "|8px 8px 80px 8px") (:resize |none) :examples $ [] :schema $ :: 'String 'style-toolbar $ %{} 'CodeEntry (:doc |) @@ -183,7 +211,7 @@ :schema $ :: 'String 'style-word-mode $ %{} 'CodeEntry (:doc |) :code $ quote $ defstyle style-word-mode - {} $ |& $ {} (:display :inline) (:white-space :pre-wrap) + {} $ |& $ {} (:display |inline) (:white-space |pre-wrap) :examples $ [] :schema $ :: 'String :ns $ %{} 'NsEntry (:doc |) @@ -204,7 +232,7 @@ :defs $ {} 'dev? $ %{} 'CodeEntry (:doc |) :code $ quote $ def dev? - = |dev $ option:unwrap-or (get-env |mode) |release + = |dev $ .unwrap-or (get-env |mode) |release :examples $ [] :schema $ :: 'Bool 'site $ %{} 'CodeEntry (:doc |) @@ -239,6 +267,11 @@ :code $ quote $ defn main! () if config/dev? $ load-console-formatter! println "|Running mode:" $ if config/dev? |dev |release + match + browser/storage-get $ .unwrap-or (get config/site :storage-key) | + (:some raw) + dispatch! $ :: :hydrate-storage $ parse-cirru-edn raw + (:none) &unit render-app! add-watch! *reel :changes $ fn (r p) hint-fn $ {} @@ -252,11 +285,6 @@ :return 'Unit persist-storage! repeat! 60 persist-storage! - match - browser/storage-get $ option:unwrap-or (get config/site :storage-key) | - (:some raw) - dispatch! $ :: :hydrate-storage $ parse-cirru-edn raw - (:none) &unit browser/add-event-listener! |keydown $ fn (event) hint-fn $ {} :args $ [] 'js-ffi.browser/EventHost @@ -292,7 +320,7 @@ 'persist-storage! $ %{} 'CodeEntry (:doc |) :code $ quote $ defn persist-storage! () browser/storage-set! - option:unwrap-or (get config/site :storage-key) | + .unwrap-or (get config/site :storage-key) | format-cirru-edn $ &struct:to-map $ :store @*reel :examples $ [] :schema $ :: 'Fn $ {} (:return 'Unit) diff --git a/deps.cirru b/deps.cirru index 18f5ce9..d3c311e 100644 --- a/deps.cirru +++ b/deps.cirru @@ -1,6 +1,6 @@ {} (:calcit-version |0.30.1) :version |0.1.3 - :dependencies $ {} (|Respo/reel.calcit |0.6.41) - |Respo/respo-ui.calcit |0.8.0 - |Respo/respo.calcit |0.16.124 + :dependencies $ {} (|Respo/reel.calcit |0.6.42) + |Respo/respo-ui.calcit |0.8.1 + |Respo/respo.calcit |0.16.126