8000 refactor(cli): find .sql files with node's own glob by colinhacks · Pull Request #48 · colinhacks/reylo · GitHub
[go: up one dir, main page]

Skip to content

refactor(cli): find .sql files with node's own glob - #48

Merged
colinhacks merged 2 commits into
mainfrom
native-glob
Oct 22, 2026
Merged

colinhacks merged 2 commits into
mainfrom
native-glob

Conversation

@colinhacks
Copy link
Copy Markdown
Owner

reylo generate found a project's .sql files with tinyglobby, the package's only runtime dependency. Reylo requires Node 24, whose fs/promises has a stable glob with pattern arrays and exclude globs, so the CLI now uses that and reylo has no dependencies.

Checked against tinyglobby with the CLI's own patterns on Node 24 and 26: the same files on a fixture covering node_modules, build output, dot directories, .server directories and cli.include / cli.exclude (including ../ patterns and an exclude without /**), and the same 2,327 .sql files on this repository's checkout, with target/ and every node_modules pruned.

One difference: Node's glob does not descend into a symlinked directory, where tinyglobby did, so a query reached only through one is no longer found by reylo generate with no paths; naming it still works. Matching is case-insensitive on macOS and Windows, which the existing .sql extension check already covers.

Copilot AI balanced review requested due to automatic review settings October 22, 2026 22:44
@vercel
vercel Bot commented Oct 22, 2026 •
Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
reylo Ready Ready Preview Oct 22, 2026 10:53pm UTC

Request Review

Copilot AI left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@pullfrog pullfrog Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

I compared Node's fs.glob with tinyglobby@0.2.17 on Node 24.21, using the CLI's own patterns. It finds the same files for the default globs, .server, dot directories, ./ and ../ patterns, and a bare-directory exclude. It also differs in two ways the description doesn't mention: it yields directories, and it drops tinyglobby's directory expansion and negation for cli.include. Both are inline.

Reviewed changes

Reviewed the swap from tinyglobby to node:fs/promises glob in reylo generate's file discovery.

  • sqlFiles on Node's glob: src/cli.ts now calls Node's glob with exclude and resolves each relative result against dir. A new comment notes the symlink and case behavior.
  • No runtime dependencies: the dependencies block in package.json is gone. The root pnpm-lock.yaml no longer lists tinyglobby, fdir or picomatch.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread src/cli.ts Resolved
Comment thread src/cli.ts Resolved
@pullfrog pullfrog Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Reviewed 5e9d9a2, which fixes both concerns from the previous review. I ran the new sqlFiles on Node 24.21 against a fixture: it gives the expected files for the default globs, .server, a directory named x.sql, ["src/"], ["src", "!src/legacy"], a literal file include, a bare-directory exclude and ./ patterns. Files matched by both **/*.sql and its expanded **/*.sql/** come back only once.

  • Directories dropped: glob now runs with withFileTypes, skips directories and resolves each file against parentPath, so a directory named x.sql is searched instead of passed to readFileSync.
  • Old cli.include meaning kept: a pattern that doesn't end in * also matches <pattern>/**, and an include starting with ! (but not !() moves to exclude, as with tinyglobby.
  • Regression test: tests/cli.test.ts covers the x.sql directory, a bare-directory include and a negated include.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

8000

@colinhacks
colinhacks merged commit c4860b3 into main Oct 22, 2026
6 checks passed
@colinhacks
colinhacks deleted the native-glob branch October 22, 2026 23:35
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

0