@calcit/procs 0.13.10 → 0.13.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -0,0 +1,6 @@
1
+ # 类型强化与 Dynamic 审计记录
2
+
3
+ - 为 `cr` 增加运行/编译阶段的 Dynamic 用量统计,按占比输出 stderr notice/warning,不影响 stdout 的机器可解析性。
4
+ - 新增 `option:or-else` 与 `result:or-else`,并注册到 Option/Result 方法表,支持惰性 fallback 级联。
5
+ - 在 `CalcitAgent.md` 与 `docs/type-guidance.md` 中整理 Dynamic、Option/Result、get-in/update-in 和 Enum 头部构造的推荐实践。
6
+ - 保留 `%::` 作为显式 prototype/动态边界;已知 Enum 优先使用 `Enum :tag ...`,交给类型分析降为命名构造。
@@ -0,0 +1,6 @@
1
+ # Struct 头部构造与 Option 缺省字段
2
+
3
+ - Struct 定义现在统一支持 `Struct :field value` 的类型化头部调用语法。
4
+ - 构造器继续要求所有非 Option 字段显式提供,并校验字段名称、重复字段和字段值类型。
5
+ - 名义 `Option<T>` 字段可以省略,预处理会补成 `%none`;旧 `Optional<T>` 仍保持 `nil` 兼容语义。
6
+ - 补充 Struct、CalcitAgent 和类型指导文档,并新增预处理回归测试。
@@ -0,0 +1,5 @@
1
+ # Release 0.13.12
2
+
3
+ - 合并类型指导与 Dynamic 审计能力,强化 Option/Result 的组合式使用建议。
4
+ - 支持 `Struct :field value` 类型化构造语法,省略的 `Option<T>` 字段自动补为 `%none`。
5
+ - 更新 Struct、Agent 和类型系统相关文档及回归测试。
@@ -0,0 +1,16 @@
1
+ # Query type errors use canonical Symbols
2
+
3
+ ## Summary
4
+
5
+ - Updated `cr query type` guidance and related CLI help to use canonical quoted type symbols such as `'String`, `'Number`, and `'List` instead of legacy tag examples.
6
+ - Allowed `cr query type` to parse canonical quoted builtin symbols while preserving compatibility with legacy lowercase/tag spellings.
7
+ - Added regression coverage for canonical symbols, compound types, the migrated error message, and excess symbol prefixes.
8
+
9
+ ## Validation
10
+
11
+ - `cargo fmt`
12
+ - `cargo clippy --bin cr -- -D warnings`
13
+ - `cargo test`
14
+ - `yarn compile`
15
+ - `yarn check-all`
16
+ - `yarn check-agent-interface`
@@ -0,0 +1,6 @@
1
+ ## Trailing Option parameters
2
+
3
+ - Treat only the continuous `Option<T>` suffix in a typed fixed-arity function schema as omittable; an earlier `Option<T>` does not make later required parameters optional, and rest parameters keep their existing behavior.
4
+ - Fill omitted arguments with the nominal `calcit.core/Option` `%none` value in the native runtime and with the matching `%none` enum value in generated JavaScript.
5
+ - Keep preprocessing arity checks and method-call validation aligned with runtime behavior so accepted calls do not produce false arity diagnostics.
6
+ - Consolidate the end-to-end coverage beside the legacy `?` argument tests, documenting `Option` as the preferred replacement for `?` and `nil` in new typed APIs.
@@ -0,0 +1,5 @@
1
+ ## Review follow-up: core Option identity
2
+
3
+ - Omitted-argument sugar is reserved for source references to `calcit.core/Option`; resolved enum values do not retain a namespace and therefore cannot be safely treated as the core type.
4
+ - A user-defined enum named `Option`, including one with `some` and `none` variants, keeps exact arity and never receives an implicit `%none` argument.
5
+ - Documentation examples use callable enum constructors: `(%none)` and `(%some value)`.
@@ -0,0 +1,5 @@
1
+ ## JS string replacement termination
2
+
3
+ - `&str:replace` must replace each original literal match exactly once; repeatedly replacing until the pattern disappears loops forever when the replacement contains the pattern.
4
+ - Escape the literal pattern and use a global callback replacement so replacement text remains literal too, including `$` sequences.
5
+ - Keep empty-pattern behavior aligned with Rust `str::replace`, and cover self-containing replacements, regex metacharacters, literal replacement text, and empty patterns in the JS runtime regression script.
@@ -0,0 +1,5 @@
1
+ ## Release 0.13.11
2
+
3
+ - Bump the Cargo crate and `@calcit/procs` package together so published artifacts stay version-aligned.
4
+ - This release includes trailing `Option` parameter sugar, stronger typed Option/struct handling, and the terminating JS string replacement fix from the preceding merged PRs.
5
+ - Run the full repository validation before tagging and publishing the release.
@@ -1216,11 +1216,11 @@ export let _$n_set_$o_intersection = (xs, ys) => {
1216
1216
  return xs.intersection(ys);
1217
1217
  };
1218
1218
  export let _$n_str_$o_replace = (x, y, z) => {
1219
- var result = x;
1220
- while (result.indexOf(y) >= 0) {
1221
- result = result.replace(y, z);
1222
- }
1223
- return result;
1219
+ // Use a callback replacement so `$` sequences in `z` remain literal, matching Rust's
1220
+ // `str::replace`. Escaping `y` preserves the proc's literal-pattern contract, while the
1221
+ // global regex completes each original match once even when `z` contains `y`.
1222
+ const literalPattern = y.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1223
+ return x.replace(new RegExp(literalPattern, "gu"), () => z);
1224
1224
  };
1225
1225
  export let split = (xs, x) => {
1226
1226
  return new CalcitSliceList(xs.split(x));
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@calcit/procs",
3
- "version": "0.13.10",
3
+ "version": "0.13.12",
4
4
  "main": "./lib/calcit.procs.mjs",
5
5
  "devDependencies": {
6
6
  "@types/node": "^25.7.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@calcit/procs",
3
- "version": "0.13.10",
3
+ "version": "0.13.12",
4
4
  "main": "./lib/calcit.procs.mjs",
5
5
  "devDependencies": {
6
6
  "@types/node": "^25.7.0",
@@ -1329,11 +1329,11 @@ export let _$n_set_$o_intersection = (xs: CalcitSet, ys: CalcitSet): CalcitSet =
1329
1329
  };
1330
1330
 
1331
1331
  export let _$n_str_$o_replace = (x: string, y: string, z: string): string => {
1332
- var result = x;
1333
- while (result.indexOf(y) >= 0) {
1334
- result = result.replace(y, z);
1335
- }
1336
- return result;
1332
+ // Use a callback replacement so `$` sequences in `z` remain literal, matching Rust's
1333
+ // `str::replace`. Escaping `y` preserves the proc's literal-pattern contract, while the
1334
+ // global regex completes each original match once even when `z` contains `y`.
1335
+ const literalPattern = y.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1336
+ return x.replace(new RegExp(literalPattern, "gu"), () => z);
1337
1337
  };
1338
1338
 
1339
1339
  export let split = (xs: string, x: string): CalcitSliceList => {