@cardenelabs/cdl 0.41.0 → 0.41.1
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/CHANGELOG.md +30 -1
- package/dist/index.cjs +19 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -21
- package/dist/index.js.map +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/visual-validate.ts +76 -23
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,34 @@ CDL (Chainome Diagram Language) の主要変更履歴。
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.41.1] - 2026-09-10
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **検査の速さの判定を、1 枚ごとの壁時計から全図の合計へ移した** (#776)
|
|
13
|
+
|
|
14
|
+
同じ図を同じ process で 3 周すると答えが変わっていた。
|
|
15
|
+
|
|
16
|
+
| 図 | 1 周目 | 2 周目 | 3 周目 |
|
|
17
|
+
|---|---|---|---|
|
|
18
|
+
| `interactive-social-share-buttons` | 53ms | 0ms | 1ms |
|
|
19
|
+
| `interactive-traffic-sankey` | 50ms | 159ms | 115ms |
|
|
20
|
+
|
|
21
|
+
1 つ目は最初の 1 回だけ掛かる下準備、2 つ目は機械の混み具合で、どちらも図の性質ではない。
|
|
22
|
+
100ms の境で数えると **入力が同じなのに超過が 0 / 1 / 1 件** と周ごとに変わり、
|
|
23
|
+
測れなかったことを「遅い」 に倒していた。
|
|
24
|
+
|
|
25
|
+
合計は同じ 3 周で 559 / 877 / 858 ms と 1.6 倍の幅に収まり、境の 5000ms から充分離れて
|
|
26
|
+
いるので判定が安定する。 **合計だけを見る**。
|
|
27
|
+
|
|
28
|
+
**報告を 1 件に丸めるのもやめた**。 旧実装は `findIndex` で最初に当たった 1 枚しか
|
|
29
|
+
出しておらず、20 枚が超過した周でも報告は 1 枚だった。 超過した時は重い順の内訳を文面へ
|
|
30
|
+
載せ、出し切れない分は「残り N 図は出していない」 と件数で残す。
|
|
31
|
+
|
|
32
|
+
判定は `perfBudgetViolations` として切り出した。 合計が 5000ms を超える状況を実際に作ると
|
|
33
|
+
確かめる検査そのものが 5 秒以上掛かるため、時間の配列を直接渡せる形にしている。
|
|
34
|
+
`index.ts` からは出していないので、公開する API は変わらない。
|
|
35
|
+
|
|
8
36
|
## [0.41.0] - 2026-09-10
|
|
9
37
|
|
|
10
38
|
### Removed (破壊的変更)
|
|
@@ -2111,7 +2139,8 @@ Initial OSS release.
|
|
|
2111
2139
|
使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
|
|
2112
2140
|
行き止まりになる。
|
|
2113
2141
|
|
|
2114
|
-
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.41.
|
|
2142
|
+
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.41.1...HEAD
|
|
2143
|
+
[0.41.1]: https://github.com/cardene777/cdl/compare/v0.41.0...v0.41.1
|
|
2115
2144
|
[0.41.0]: https://github.com/cardene777/cdl/compare/v0.40.12...v0.41.0
|
|
2116
2145
|
[0.40.12]: https://github.com/cardene777/cdl/compare/v0.40.11...v0.40.12
|
|
2117
2146
|
[0.40.11]: https://github.com/cardene777/cdl/compare/v0.40.10...v0.40.11
|
package/dist/index.cjs
CHANGED
|
@@ -17707,6 +17707,24 @@ function visualValidateAll(diagrams, opts) {
|
|
|
17707
17707
|
metaViolations
|
|
17708
17708
|
};
|
|
17709
17709
|
}
|
|
17710
|
+
var PERF_BUDGET_TOTAL_MS = 5e3;
|
|
17711
|
+
var PERF_SLOWEST_SAMPLE = 5;
|
|
17712
|
+
function perfBudgetViolations(durations, diagrams = []) {
|
|
17713
|
+
const total = durations.reduce((s, d) => s + d, 0);
|
|
17714
|
+
if (total <= PERF_BUDGET_TOTAL_MS) return [];
|
|
17715
|
+
const \u91CD\u3044\u9806 = durations.map((ms, i) => ({ id: diagrams[i]?.id ?? "?", ms })).sort((a, b) => b.ms - a.ms);
|
|
17716
|
+
const \u629C\u7C8B = \u91CD\u3044\u9806.slice(0, PERF_SLOWEST_SAMPLE);
|
|
17717
|
+
const \u6B8B\u308A = \u91CD\u3044\u9806.length - \u629C\u7C8B.length;
|
|
17718
|
+
const \u5185\u8A33 = \u629C\u7C8B.map((d) => `"${d.id}" ${d.ms}ms`).join(" / ") + (\u6B8B\u308A > 0 ? `\u3001 \u6B8B\u308A ${\u6B8B\u308A} \u56F3\u306F\u51FA\u3057\u3066\u3044\u306A\u3044` : "");
|
|
17719
|
+
return [
|
|
17720
|
+
{
|
|
17721
|
+
axis: "validate-performance-budget",
|
|
17722
|
+
diagramId: "__meta__",
|
|
17723
|
+
detail: `visualValidateAll \u5168 ${durations.length} \u56F3\u306E\u7D2F\u8A08 ${total}ms > ${PERF_BUDGET_TOTAL_MS}ms budget (\u91CD\u3044\u9806 ${\u5185\u8A33})`,
|
|
17724
|
+
severity: "warn"
|
|
17725
|
+
}
|
|
17726
|
+
];
|
|
17727
|
+
}
|
|
17710
17728
|
function validateMetaAxes(totalCounts, diagrams = [], durations = [], reports = []) {
|
|
17711
17729
|
const out = [];
|
|
17712
17730
|
const totalErrors = reports.reduce(
|
|
@@ -17722,27 +17740,7 @@ function validateMetaAxes(totalCounts, diagrams = [], durations = [], reports =
|
|
|
17722
17740
|
severity: "warn"
|
|
17723
17741
|
});
|
|
17724
17742
|
}
|
|
17725
|
-
|
|
17726
|
-
const PERF_BUDGET_TOTAL_MS = 5e3;
|
|
17727
|
-
const overBudgetIdx = durations.findIndex((d) => d > PERF_BUDGET_PER_DIAGRAM_MS);
|
|
17728
|
-
if (overBudgetIdx >= 0) {
|
|
17729
|
-
const did = diagrams[overBudgetIdx]?.id ?? "?";
|
|
17730
|
-
out.push({
|
|
17731
|
-
axis: "validate-performance-budget",
|
|
17732
|
-
diagramId: did,
|
|
17733
|
-
detail: `diagram "${did}" validate ${durations[overBudgetIdx]}ms > ${PERF_BUDGET_PER_DIAGRAM_MS}ms budget`,
|
|
17734
|
-
severity: "warn"
|
|
17735
|
-
});
|
|
17736
|
-
}
|
|
17737
|
-
const totalDur = durations.reduce((s, d) => s + d, 0);
|
|
17738
|
-
if (totalDur > PERF_BUDGET_TOTAL_MS) {
|
|
17739
|
-
out.push({
|
|
17740
|
-
axis: "validate-performance-budget",
|
|
17741
|
-
diagramId: "__meta__",
|
|
17742
|
-
detail: `visualValidateAll \u5168 diagram \u7D2F\u8A08 ${totalDur}ms > ${PERF_BUDGET_TOTAL_MS}ms budget`,
|
|
17743
|
-
severity: "warn"
|
|
17744
|
-
});
|
|
17745
|
-
}
|
|
17743
|
+
out.push(...perfBudgetViolations(durations, diagrams));
|
|
17746
17744
|
const DEAD_ALLOWLIST = [
|
|
17747
17745
|
// catalog で自然発火なしを許容する security / migration / performance / meta / dev-quality axis 群。
|
|
17748
17746
|
// 実 diagram に該当データ (XSS / migration list / oversized / broken doc) が混入するのが稀なため。
|