Skip to content

fix: Deno 2 compatibility and ignore patterns support#36

Open
nLight wants to merge 2 commits intovrtmrz:mainfrom
nLight:main
Open

fix: Deno 2 compatibility and ignore patterns support#36
nLight wants to merge 2 commits intovrtmrz:mainfrom
nLight:main

Conversation

@nLight
Copy link

@nLight nLight commented Feb 9, 2026

Fixes for running on Deno 2:

  • Fix dependencies import in deno.jsonc
  • Fix startup order: CouchDB peers init before storage peers
  • Add ignore patterns support for PeerStorage (glob-based filtering)
  • Add node-fetch-native dependency for fetch compatibility
  • Make Hub.start() async to properly await peer initialization

Note: pouchdb-fetch requires manual patching after deno install to use native fetch instead of node-fetch for Deno compatibility.

nLight and others added 2 commits February 8, 2026 15:00
- Fix startup order: CouchDB peers init before storage peers
- Add ignore patterns support for PeerStorage (glob-based filtering)
- Add node-fetch-native dependency for fetch compatibility
- Make Hub.start() async to properly await peer initialization

Note: pouchdb-fetch requires manual patching after deno install
to use native fetch instead of node-fetch for Deno compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@waspeer
Copy link

waspeer commented Feb 15, 2026

Bug found: offline scan hangs when vault contains .git/ directory

When scanOfflineChanges: true and the vault contains a .git/ directory with thousands of objects, the offline scan hangs because isChanged() is called for every file before the ignore check. The shouldIgnore() in dispatch() is never reached.

Fix: Pass skip regexps to walk() so ignored directories are never traversed:

const ignorePatterns = this.config.ignore ?? [];
const skipRegexps = ignorePatterns.map(p => {
    const escaped = lP.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
    const pattern = p.replace(/\*\*/g, ".*").replace(/\*/g, "[^/]*");
    return new RegExp(`${escaped}/${pattern}`);
});
for await (const entry of walk(lP, { skip: skipRegexps })) {

Config example: "ignore": ["**/.git/**", "**/node_modules/**"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants