@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.
- package/.yarn/install-state.gz +0 -0
- package/202608121618-type-guidance.md +6 -0
- package/202608121730-struct-option-constructor.md +6 -0
- package/202608121900-release-0.13.12.md +5 -0
- package/editing-history/202608120129-type-symbol-query-errors.md +16 -0
- package/history/202608111550-trailing-option-parameters.md +6 -0
- package/history/202608111610-review-core-option-identity.md +5 -0
- package/history/202608111624-js-string-replace-termination.md +5 -0
- package/history/202608111650-release-0.13.11.md +5 -0
- package/lib/calcit.procs.mjs +5 -5
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/ts-src/calcit.procs.mts +5 -5
package/.yarn/install-state.gz
CHANGED
|
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,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.
|
package/lib/calcit.procs.mjs
CHANGED
|
@@ -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
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
}
|
|
1223
|
-
return
|
|
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
package/package.json
CHANGED
package/ts-src/calcit.procs.mts
CHANGED
|
@@ -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
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
}
|
|
1336
|
-
return
|
|
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 => {
|