diff --git a/.github/workflows/upload.yaml b/.github/workflows/upload.yaml index dfac41c..cecd278 100644 --- a/.github/workflows/upload.yaml +++ b/.github/workflows/upload.yaml @@ -53,7 +53,14 @@ jobs: calcit fix --workflow strict --verify --format json | jq -e '.data.workflow.status == "passed" and .diagnostics == []' calcit --check-only --ns app.comp.button --ns app.comp.container --ns app.config --ns app.main --ns app.schema --ns app.updater --summary-only calcit calcit.cirru test --require-match - calcit calcit.cirru analyze quality --baseline config/calcit-quality.cirru + calcit analyze weak-types --only coverage --coverage-level none,partial --format json | + jq -e '.data.definitions == []' + calcit analyze weak-types --format json | + jq -e 'all(.data.definitions[]; + .id == "app.schema/store" and + (.occurrences | length <= 1 and all(.[]; .kind == "code-nil" and .intent == "unresolved")))' + calcit analyze weak-types --only deprecated-call --summary-only --format json | + jq -e '.data.summary.calls == 0' - name: Select CDN asset path id: asset-path diff --git a/README.md b/README.md index 1783fe6..ab74311 100644 --- a/README.md +++ b/README.md @@ -8,19 +8,19 @@ _TODO_ ### 使用者影响 -升级到 Calcit **0.40.0** 后,请重新安装依赖、生成 JS 并刷新页面。原存档可以继续打开, +升级到 Calcit **0.41.0** 后,请重新安装依赖、生成 JS 并刷新页面。原存档可以继续打开, Run、文本输入、复制、错误 HUD 和开发模式的 Reel 面板沿用原有行为。 Reel 使用 `State`,按钮和文本框通过 Respo 的类型化事件派发具名 `Op`。应用派发使用 `Op | reel.typed/Control`,旧面板事件只在渲染入口解码。按钮路径使用 `CoordKey` union,局部状态使用 `Map Tag Bool`。 复制边界以 `CopyScalar` 表示 String、Number、Bool、Tag、Symbol,空值仍复制为空字符串, -复合数据仍会报错。`Store.data` 保留对任意旧存档数据的支持,恢复成功后才启用自动保存。 +复合数据仍会报错。新输出操作只接收 `String`,包括 Run 的格式化结果和输出文本框输入。`Store.data` 保留对任意旧存档数据的支持,恢复成功后才启用自动保存。 -配对正式 `@calcit/procs` **0.40.0**、Respo **0.19.5**、Reel **0.11.0**、UI **0.15.2**、 +配对正式 `@calcit/procs` **0.41.0**、Respo **0.19.5**、Reel **0.11.0**、UI **0.15.2**、 JS-FFI **0.2.13**,传递依赖 Router **0.12.2**。 ### 开发 -使用 Node 24、Yarn 4.18.0、Caps 0.1.1 和配对 Calcit 0.40.0: +使用 Node 24、Yarn 4.18.0、Caps 0.1.1 和配对 Calcit 0.41.0: ```sh caps --strict --ci @@ -29,11 +29,12 @@ caps verify --toolchain calcit --check-only --all-defs calcit fix --workflow strict --verify calcit test --require-match -calcit analyze quality --baseline config/calcit-quality.cirru yarn build node --test scripts/former-regression.test.mjs ``` +CI 使用 `analyze weak-types` 执行原质量上限。仅初始 Store 允许一处未解决的 nil,其余项目代码的弱类型、覆盖缺口和弃用调用上限为零。 + Use only `calcit.cirru` and `deps.cirru`; do not restore retired `compact.cirru` and `package.cirru` snapshots. CI uploads and publicly verifies only frontend `dist/` at `https://cos-sh.tiye.me/Cirru/data-former/`, with a diff --git a/calcit.cirru b/calcit.cirru index 9d7ffca..a3ace9c 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -41,7 +41,7 @@ :examples $ [] :schema $ quote $ Fn respo.schema/States String Fn respo.schema/RespoEvent - Fn app.schema/Op $ -> Unit + Fn Op $ -> Unit -> Unit -> respo.schema/Component :features :js-ffi @@ -106,10 +106,10 @@ -> Unit d! $ Op :data $ input-text e if dev? - Option :some $ reel.comp.reel/comp-typed-reel (>> states :reel) reel ({}) on-control - Option :none + Some $ reel.comp.reel/comp-typed-reel (>> states :reel) reel ({}) on-control + , None :examples $ [] - :schema $ quote $ Fn (reel.typed/State app.schema/Op app.schema/Store) + :schema $ quote $ Fn (reel.typed/State Op Store) Fn reel.typed/Control $ -> Unit -> respo.schema/Component :features :js-ffi @@ -183,9 +183,9 @@ :defs $ {} '*reel $ %{} 'CodeEntry (:doc |) :code $ quote $ defref *reel - reel.typed/State :base schema/store :store schema/store :records ([]) :pointer (Option :none) :stopped? false :display? false :merged? false + reel.typed/State :base schema/store :store schema/store :records ([]) :pointer None :stopped? false :display? false :merged? false :examples $ [] - :schema $ quote $ Ref (reel.typed/State app.schema/Op app.schema/Store) + :schema $ quote $ Ref (reel.typed/State schema/Op schema/Store) 'dispatch! $ %{} 'CodeEntry (:doc |) :code $ quote $ defn dispatch! (op) when config/dev? $ println |Dispatch: op @@ -195,7 +195,7 @@ reel.typed/record-op updater @*reel action (generate-id!) (js-ffi.shared/now-ms) , &unit :examples $ [] - :schema $ quote $ Fn app.schema/ResolvedOp (-> Unit) (:features :js-ffi) + :schema $ quote $ Fn schema/ResolvedOp (-> Unit) (:features :js-ffi) 'main! $ %{} 'CodeEntry (:doc |) :code $ quote $ defn main! () println "|Running mode:" $ if config/dev? |dev |release @@ -272,7 +272,7 @@ :code $ quote $ defenum Op :states (List respo.schema/CoordKey) (Map Tag Bool) :content String - :data Dynamic + :data String :hydrate-storage app.schema/Store :examples $ [] :schema $ quote EnumDef @@ -301,7 +301,7 @@ raise "|Expected Data Former Store" decode-map-as data 'app.schema/Store :examples $ [] - :schema $ quote $ Fn T (-> app.schema/Store) (:generics T) + :schema $ quote $ Fn T (-> Store) (:generics T) :tests $ [] $ %{} 'TestEntry (:name |legacy-map-and-store-roundtrip) :code $ quote $ let legacy $ {} @@ -330,7 +330,7 @@ :code $ quote $ def store Store :states ({}) :content | :data nil :examples $ [] - :schema $ quote app.schema/Store + :schema $ quote Store :ns $ %{} 'NsEntry (:doc |) :code $ quote $ ns app.schema 'app.updater $ %{} 'FileEntry @@ -346,19 +346,15 @@ (:data data) (assoc store :data data) (:hydrate-storage data) data :examples $ [] - :schema $ quote $ Fn app.schema/Store app.schema/Op String Number (-> app.schema/Store) + :schema $ quote $ Fn Store Op String Number (-> Store) :tests $ [] $ %{} 'TestEntry (:name |nominal-store-operations) :code $ quote $ let initial $ Store :states ({}) :content | :data nil content-store $ updater initial (Op :content |hello) |content-op 1 - data-store $ updater content-store - Op :data $ {} $ :ok true - , |data-op 2 + data-store $ updater content-store (Op :data |formatted) |data-op 2 hydrated $ Store :states ({}) :content |restored :data 42 assert= (assoc initial :content |hello) content-store - assert= - assoc content-store :data $ {} $ :ok true - , data-store + assert= (assoc content-store :data |formatted) data-store assert= hydrated $ updater data-store (Op :hydrate-storage hydrated) |hydrate-op 3 :ns $ %{} 'NsEntry (:doc |) :code $ quote $ ns app.updater diff --git a/config/calcit-quality.cirru b/config/calcit-quality.cirru deleted file mode 100644 index 40d7288..0000000 --- a/config/calcit-quality.cirru +++ /dev/null @@ -1,21 +0,0 @@ -{} (:schemaVersion 2) - :definitions $ {} $ |app.schema/store - {} (:codeDynamic 0) - :codeNil 1 - :deprecatedCalls 0 - :schemaDynamic 0 - :typeNone 0 - :typeNotFull 0 - :unresolved 1 - :unsafeCoerce 0 - :metrics $ {} (:codeDynamic 0) - :codeNil 1 - :deprecatedCalls 0 - :schemaDynamic 0 - :typeNone 0 - :typeNotFull 0 - :unresolved 1 - :unsafeCoerce 0 - :scope $ {} (:includeDependencies false) - :namespace nil - :namespacePrefix nil diff --git a/deps.cirru b/deps.cirru index f2193e1..51d79f4 100644 --- a/deps.cirru +++ b/deps.cirru @@ -1,5 +1,5 @@ -{} (:calcit-version |0.40.0) +{} (:calcit-version |0.41.0) :version |0.1.2 :dependencies $ {} (|Respo/reel.calcit |0.11.0) |Respo/respo-ui.calcit |0.15.2 diff --git a/package.json b/package.json index 32af275..cc4c668 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "vite": "8.3.3" }, "dependencies": { - "@calcit/procs": "0.40.0", + "@calcit/procs": "0.41.0", "copy-text-to-clipboard": "^3.1.0", "feather-icons": "^4.29.0", "shortid": "^2.2.16" diff --git a/scripts/former-regression.test.mjs b/scripts/former-regression.test.mjs index 0b11787..849e552 100644 --- a/scripts/former-regression.test.mjs +++ b/scripts/former-regression.test.mjs @@ -84,6 +84,9 @@ test('typed hydrate-storage operation preserves the exact Store', () => { const wire = c.parse_cirru_edn(c.format_cirru_edn(saved)); assert.ok(c._$e_(restore_store(wire), saved)); assert.ok(c._$e_(restore_store(map(t.states, states, t.content, 'saved', t.data, field(saved, t.data))), saved)); + const legacyData = map(t.value, c._$L_(1, false)); + const legacyStore = restore_store(map(t.states, states, t.content, 'saved', t.data, legacyData)); + assert.ok(c._$e_(field(legacyStore, t.data), legacyData)); assert.throws(() => restore_store(map(t.states, map(), t.content, 42, t.data, 'saved'))); assert.ok(c._$e_(updater(store, c._PCT__$o__$o_(Op, c.newTag('hydrate-storage'), saved), 'hydrate', 1), saved)); }); diff --git a/yarn.lock b/yarn.lock index a43a0f7..c175e5c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,15 +12,15 @@ __metadata: languageName: node linkType: hard -"@calcit/procs@npm:0.40.0": - version: 0.40.0 - resolution: "@calcit/procs@npm:0.40.0" +"@calcit/procs@npm:0.41.0": + version: 0.41.0 + resolution: "@calcit/procs@npm:0.41.0" dependencies: "@calcit/finger-vec": "npm:0.1.1" "@calcit/ternary-tree": "npm:0.0.26" "@cirru/parser.ts": "npm:0.0.10" "@cirru/writer.ts": "npm:^0.1.9" - checksum: 10c0/4122eaa8d63fd57826d24c6c072dbd1cb6cdd2934dbfdb4fd0afc03f4aec73f07d71ccba246120c15e198134b7e92a324f1f1900b43c458b02e871354739cf84 + checksum: 10c0/5de94b39e435363d0f80611b63914c9abd6b0afac3c77adf9b9846ac439fce319ac0780697364cabf67b2997d39495a1e72086e1496ac560c51bb57462f37628 languageName: node linkType: hard @@ -236,7 +236,7 @@ __metadata: version: 0.0.0-use.local resolution: "data-former@workspace:." dependencies: - "@calcit/procs": "npm:0.40.0" + "@calcit/procs": "npm:0.41.0" bottom-tip: "npm:^0.1.5" copy-text-to-clipboard: "npm:^3.1.0" feather-icons: "npm:^4.29.0"