@biaoo/tiangong-wiki 0.3.4 → 0.3.5

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.
@@ -184,6 +184,15 @@ export function applyChanges(db, changes, wikiPath, config, ftsExtensionVersion)
184
184
  const summaryChangedIds = [];
185
185
  const hasContentChanges = parsedEntries.length > 0 || changes.deleted.length > 0;
186
186
  const transaction = db.transaction(() => {
187
+ for (const page of changes.deleted) {
188
+ const existing = selectPageRowid.get(page.id);
189
+ deleteEdgesBySourcePage.run(page.id);
190
+ if (existing) {
191
+ deleteVecRow.run(BigInt(existing.rowid));
192
+ }
193
+ deletePage.run(page.id);
194
+ deleted.push(page.id);
195
+ }
187
196
  for (const { entry, parsed } of parsedEntries) {
188
197
  const existing = selectExistingPage.get(entry.id);
189
198
  const isInsert = !existing;
@@ -217,15 +226,6 @@ export function applyChanges(db, changes, wikiPath, config, ftsExtensionVersion)
217
226
  });
218
227
  }
219
228
  }
220
- for (const page of changes.deleted) {
221
- const existing = selectPageRowid.get(page.id);
222
- deleteEdgesBySourcePage.run(page.id);
223
- if (existing) {
224
- deleteVecRow.run(BigInt(existing.rowid));
225
- }
226
- deletePage.run(page.id);
227
- deleted.push(page.id);
228
- }
229
229
  if (hasContentChanges) {
230
230
  rebuildFts(db, config, ftsExtensionVersion);
231
231
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biaoo/tiangong-wiki",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Local-first wiki index and query engine for Markdown knowledge pages (Tiangong Wiki).",
5
5
  "type": "module",
6
6
  "publishConfig": {