Skip to content

feat: implement glob in TauriFSAdapter#4

Open
Alexi5000 wants to merge 1 commit into
zdenham:mainfrom
Alexi5000:pr/implement-tauri-fs-glob
Open

feat: implement glob in TauriFSAdapter#4
Alexi5000 wants to merge 1 commit into
zdenham:mainfrom
Alexi5000:pr/implement-tauri-fs-glob

Conversation

@Alexi5000
Copy link
Copy Markdown

Summary

  • Implement the glob() method in TauriFSAdapter which was a TODO stub that threw Error("glob not implemented")
  • Add a globToRegExp() helper that converts simple glob patterns (*, **, ?) to RegExp
  • Recursively walks directories using the existing listDir IPC call
  • No new dependencies — uses the FilesystemClient.listDir that already exists
  • Returns relative paths matching the glob pattern

Motivation

The FSAdapter interface requires a glob() method, but the Tauri frontend implementation threw an error. While skill discovery currently doesn't call it, any future feature that uses FSAdapter.glob() on the frontend would crash. This resolves the TODO and makes the adapter interface fully implemented.

Test Plan

  • glob("*.md", "/some/dir") returns markdown files in that directory
  • glob("**/*.ts", "/some/dir") recursively finds TypeScript files
  • glob("src/index.?s", "/some/dir") matches both .ts and .js
  • Empty directories return an empty array

Replace the TODO stub with a working implementation that recursively
walks directories via the existing listDir IPC call and matches file
paths against a simple glob-to-regex converter supporting *, **, and
? wildcards. No new dependencies required.
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.

1 participant