@takazudo/zudo-doc 5.12.0 → 5.12.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 +10 -0
- package/bin/tags-audit-runner.ts +2 -2
- package/dist/tags-audit.d.ts +3 -2
- package/dist/tags-audit.js +21 -0
- package/package.json +9 -11
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ All notable changes to `@takazudo/zudo-doc` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on Keep a Changelog, and release notes are generated from the changelog MDX pages.
|
|
6
6
|
|
|
7
|
+
## [5.12.1] - 2026-08-24
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- Removed the deprecated `string-similarity` runtime dependency from tag auditing while preserving its whitespace-insensitive near-duplicate scoring behavior. (`b5fa7a6c`)
|
|
12
|
+
|
|
13
|
+
### Other Changes
|
|
14
|
+
|
|
15
|
+
- Updated the zfb package family to 2.10.1 and raised the `@takazudo/zudo-doc-history-server` peer floor to the published 5.12.0 release. (`b5fa7a6c`)
|
|
16
|
+
|
|
7
17
|
## [5.12.0] - 2026-08-23
|
|
8
18
|
|
|
9
19
|
### Features
|
package/bin/tags-audit-runner.ts
CHANGED
|
@@ -21,10 +21,10 @@ import { resolve } from "node:path";
|
|
|
21
21
|
|
|
22
22
|
import pc from "picocolors";
|
|
23
23
|
import pluralize from "pluralize";
|
|
24
|
-
import stringSimilarity from "string-similarity";
|
|
25
24
|
|
|
26
25
|
import {
|
|
27
26
|
audit,
|
|
27
|
+
compareTwoStrings,
|
|
28
28
|
formatTextReport,
|
|
29
29
|
hasHardIssues,
|
|
30
30
|
type AuditOptions,
|
|
@@ -71,7 +71,7 @@ async function main(): Promise<void> {
|
|
|
71
71
|
vocabularyActive: config.vocabularyActive,
|
|
72
72
|
nearDupHelpers: {
|
|
73
73
|
singular: pluralize.singular,
|
|
74
|
-
compareTwoStrings
|
|
74
|
+
compareTwoStrings,
|
|
75
75
|
},
|
|
76
76
|
};
|
|
77
77
|
|
package/dist/tags-audit.d.ts
CHANGED
|
@@ -42,8 +42,7 @@ export interface AuditOptions {
|
|
|
42
42
|
vocabularyActive: boolean;
|
|
43
43
|
/**
|
|
44
44
|
* Near-duplicate detection callbacks. Optional — if omitted the relevant
|
|
45
|
-
* checks are silently skipped so callers
|
|
46
|
-
* can still use the core functions.
|
|
45
|
+
* checks are silently skipped so callers can still use the core functions.
|
|
47
46
|
*/
|
|
48
47
|
nearDupHelpers?: NearDupHelpers;
|
|
49
48
|
}
|
|
@@ -65,6 +64,8 @@ export interface NearDupHelpers {
|
|
|
65
64
|
export declare function buildIndex(vocab: readonly TagVocabularyEntry[]): VocabularyIndex;
|
|
66
65
|
export declare function collectMdxFiles(dir: string): Promise<string[]>;
|
|
67
66
|
export declare function normalizeTags(value: unknown): string[];
|
|
67
|
+
/** Return the Sørensen–Dice similarity of two whitespace-insensitive bigram sets. */
|
|
68
|
+
export declare function compareTwoStrings(first: string, second: string): number;
|
|
68
69
|
export declare function findNearDuplicates(tags: string[], helpers: NearDupHelpers): NearDuplicatePair[];
|
|
69
70
|
export declare function audit(opts: AuditOptions): Promise<AuditReport>;
|
|
70
71
|
export declare function hasHardIssues(report: AuditReport): boolean;
|
package/dist/tags-audit.js
CHANGED
|
@@ -34,6 +34,26 @@ function normalizeTags(value) {
|
|
|
34
34
|
if (!Array.isArray(value)) return [];
|
|
35
35
|
return value.filter((v) => typeof v === "string");
|
|
36
36
|
}
|
|
37
|
+
function compareTwoStrings(first, second) {
|
|
38
|
+
const normalizedFirst = first.replace(/\s+/g, "");
|
|
39
|
+
const normalizedSecond = second.replace(/\s+/g, "");
|
|
40
|
+
if (normalizedFirst === normalizedSecond) return 1;
|
|
41
|
+
if (normalizedFirst.length < 2 || normalizedSecond.length < 2) return 0;
|
|
42
|
+
const firstBigrams = /* @__PURE__ */ new Map();
|
|
43
|
+
for (let index = 0; index < normalizedFirst.length - 1; index++) {
|
|
44
|
+
const bigram = normalizedFirst.slice(index, index + 2);
|
|
45
|
+
firstBigrams.set(bigram, (firstBigrams.get(bigram) ?? 0) + 1);
|
|
46
|
+
}
|
|
47
|
+
let intersectionSize = 0;
|
|
48
|
+
for (let index = 0; index < normalizedSecond.length - 1; index++) {
|
|
49
|
+
const bigram = normalizedSecond.slice(index, index + 2);
|
|
50
|
+
const remaining = firstBigrams.get(bigram) ?? 0;
|
|
51
|
+
if (remaining === 0) continue;
|
|
52
|
+
firstBigrams.set(bigram, remaining - 1);
|
|
53
|
+
intersectionSize++;
|
|
54
|
+
}
|
|
55
|
+
return 2 * intersectionSize / (normalizedFirst.length + normalizedSecond.length - 2);
|
|
56
|
+
}
|
|
37
57
|
const NEAR_DUP_THRESHOLD = 0.82;
|
|
38
58
|
function findNearDuplicates(tags, helpers) {
|
|
39
59
|
const pairs = [];
|
|
@@ -151,6 +171,7 @@ export {
|
|
|
151
171
|
audit,
|
|
152
172
|
buildIndex,
|
|
153
173
|
collectMdxFiles,
|
|
174
|
+
compareTwoStrings,
|
|
154
175
|
findNearDuplicates,
|
|
155
176
|
formatTextReport,
|
|
156
177
|
hasHardIssues,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takazudo/zudo-doc",
|
|
3
|
-
"version": "5.12.
|
|
3
|
+
"version": "5.12.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "zudo-doc framework primitives layer that sits on top of zfb's engine — sidebar, theme, TOC, breadcrumb, layouts, head injection, View Transitions, SSR-skip wrappers (per ADR-003).",
|
|
6
6
|
"license": "MIT",
|
|
@@ -634,10 +634,10 @@
|
|
|
634
634
|
],
|
|
635
635
|
"peerDependencies": {
|
|
636
636
|
"@takazudo/zdtp": "^0.4.12",
|
|
637
|
-
"@takazudo/zfb": "^2.10.
|
|
638
|
-
"@takazudo/zfb-md-wasm": "^2.10.
|
|
639
|
-
"@takazudo/zfb-runtime": "^2.10.
|
|
640
|
-
"@takazudo/zudo-doc-history-server": "^5.
|
|
637
|
+
"@takazudo/zfb": "^2.10.1",
|
|
638
|
+
"@takazudo/zfb-md-wasm": "^2.10.1",
|
|
639
|
+
"@takazudo/zfb-runtime": "^2.10.1",
|
|
640
|
+
"@takazudo/zudo-doc-history-server": "^5.12.0",
|
|
641
641
|
"diff": "^8.0.0",
|
|
642
642
|
"katex": "^0.16.0",
|
|
643
643
|
"preact": "^10.29.1",
|
|
@@ -669,18 +669,16 @@
|
|
|
669
669
|
"picocolors": "^1.1.1",
|
|
670
670
|
"pluralize": "^8.0.0",
|
|
671
671
|
"smol-toml": "^1.8.0",
|
|
672
|
-
"string-similarity": "^4.0.4",
|
|
673
672
|
"tsx": "^4.21.0"
|
|
674
673
|
},
|
|
675
674
|
"devDependencies": {
|
|
676
|
-
"@takazudo/zfb": "2.10.
|
|
677
|
-
"@takazudo/zfb-md-wasm": "2.10.
|
|
678
|
-
"@takazudo/zfb-runtime": "2.10.
|
|
675
|
+
"@takazudo/zfb": "2.10.1",
|
|
676
|
+
"@takazudo/zfb-md-wasm": "2.10.1",
|
|
677
|
+
"@takazudo/zfb-runtime": "2.10.1",
|
|
679
678
|
"@types/fs-extra": "^11.0.4",
|
|
680
679
|
"@types/minimist": "^1.2.5",
|
|
681
680
|
"@types/node": "^25.3.5",
|
|
682
681
|
"@types/pluralize": "^0.0.33",
|
|
683
|
-
"@types/string-similarity": "^4.0.2",
|
|
684
682
|
"happy-dom": "^20.10.6",
|
|
685
683
|
"npm-run-all2": "^7.0.2",
|
|
686
684
|
"preact": "^10.29.1",
|
|
@@ -689,7 +687,7 @@
|
|
|
689
687
|
"typescript": "^5.0.0",
|
|
690
688
|
"vitest": "^4.1.0",
|
|
691
689
|
"zod": "^4.3.6",
|
|
692
|
-
"@takazudo/zudo-doc-history-server": "5.12.
|
|
690
|
+
"@takazudo/zudo-doc-history-server": "5.12.1"
|
|
693
691
|
},
|
|
694
692
|
"scripts": {
|
|
695
693
|
"gen:search-widget-script": "node scripts/gen-search-widget-script.mjs",
|