dsh-plugin-wiki-tools 0.13.0 → 0.14.0
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/lib/lint.js +19 -1
- package/lib/vault.js +3 -1
- package/package.json +1 -1
package/lib/lint.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module dsh-plugin-wiki-tools/lib/lint
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { mkdir, readFile, writeFile } from 'node:fs/promises'
|
|
9
|
+
import { mkdir, readFile, stat, writeFile } from 'node:fs/promises'
|
|
10
10
|
import { join } from 'node:path'
|
|
11
11
|
import {
|
|
12
12
|
PAGE_STATUSES,
|
|
@@ -39,6 +39,7 @@ export async function lintVault(root) {
|
|
|
39
39
|
checkOrphans(pages, inbound, indexed, add)
|
|
40
40
|
checkFrontmatterGaps(pages, add)
|
|
41
41
|
checkStatusVocabulary(pages, add)
|
|
42
|
+
await checkStructurePages(root, add)
|
|
42
43
|
checkEmptySections(pages, add)
|
|
43
44
|
await checkHotCacheStaleness(root, pages, add)
|
|
44
45
|
|
|
@@ -193,6 +194,23 @@ function checkStatusVocabulary(pages, add) {
|
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
196
|
|
|
197
|
+
/**
|
|
198
|
+
* The narrative structure page every vault layout expects. `overview.md` is
|
|
199
|
+
* human-maintained, so its absence is info — a nudge, not a defect.
|
|
200
|
+
* @param {string} root - absolute vault root.
|
|
201
|
+
* @param {Add} add - issue recorder.
|
|
202
|
+
*/
|
|
203
|
+
async function checkStructurePages(root, add) {
|
|
204
|
+
const overview = join(root, 'wiki', 'overview.md')
|
|
205
|
+
const exists = await stat(overview).then(() => true, () => false)
|
|
206
|
+
if (!exists) {
|
|
207
|
+
add('missing-structure', 'info', 'overview',
|
|
208
|
+
'wiki/overview.md does not exist',
|
|
209
|
+
'Run wiki_scaffold (generic) or write a ~200-word vault overview: what the vault is for, its areas, and where things go',
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
196
214
|
/**
|
|
197
215
|
* Headings with no content before the next heading.
|
|
198
216
|
* @param {Pages} pages - collected pages.
|
package/lib/vault.js
CHANGED
|
@@ -439,7 +439,9 @@ export class Vault {
|
|
|
439
439
|
// `\]` / `\|` would be eaten by the template literal and leave an
|
|
440
440
|
// empty alternation branch matching every `[[title` prefix.
|
|
441
441
|
const pattern = new RegExp(`\\[\\[${escapeRegExp(title)}(\\]\\]|\\||#)`, 'g')
|
|
442
|
-
|
|
442
|
+
let updated = raw.replace(pattern, `[[${cleanNew}$1`)
|
|
443
|
+
// A page whose links changed today is not "current" as of yesterday.
|
|
444
|
+
if (updated !== raw) updated = updated.replace(/^(updated:\s*).+$/m, `$1${today()}`)
|
|
443
445
|
if (updated !== raw) {
|
|
444
446
|
await writeFile(page.path, updated, 'utf8')
|
|
445
447
|
rewritten.push(page.name)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-wiki-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Native DeepSeek Harness tools for an Obsidian wiki vault: wiki_query, wiki_write, and wiki_lint implement the mechanical core (path routing, delta tracking, index/log bookkeeping, health checks) of the wiki skill suite.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|