fix(builders): enable directive discovery in dot-prefixed files and directories#1228
Conversation
…irectories The glob-based file scanning in getInputFiles() was using tinyglobby's default behavior which skips dot-prefixed files/directories. This prevented discovering files with 'use step' / 'use workflow' directives inside paths like .config/step.ts or .hidden-workflow.ts. Switch to relative glob patterns with per-directory cwd and dot: true to ensure dot-files are scanned while still respecting the explicit ignore list (.git, .next, .vercel, etc.).
🦋 Changeset detectedLatest commit: 4b15310 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express workflow with 25 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 50 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.all with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
|
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (48 failed)mongodb (1 failed):
turso (47 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
There was a problem hiding this comment.
Pull request overview
Updates the builders’ input-file discovery so getInputFiles() can find directive-bearing source files located in dot-prefixed files/directories, while preserving the explicit ignore list for common generated/vendor directories.
Changes:
- Switched
getInputFiles()to run relative globs per configured directory (cwdper dir) withdot: true, to correctly match dot-prefixed paths and apply ignores consistently. - Added a new Vitest suite covering dot-prefixed file/dir discovery and confirming explicitly ignored dot-directories remain excluded.
- Added a changeset to publish the fix as a patch for
@workflow/builders.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/builders/src/base-builder.ts |
Adjusts globbing strategy to include dot-prefixed paths and keep ignore behavior working. |
packages/builders/src/get-input-files.test.ts |
Adds tests validating discovery/exclusion behavior for dot-prefixed paths. |
.changeset/dot-file-directive-discovery.md |
Releases the behavior change as a patch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add workbench fixtures and E2E tests verifying that 'use step' / 'use workflow' directives inside dot-prefixed directories (.well-known/agent/) are correctly discovered, included in manifests, and executed at runtime.
tinyglobby returns forward-slash paths even on Windows, while Node's path.join() uses backslashes. Normalize both sides to forward slashes before comparison.
Cleaner and more idiomatic way to get the parent directory.
With dot: true enabled, framework build output directories like .nuxt/ are now traversed and their generated files picked up as input files. This caused a circular dependency in the nuxt builder where generated .nuxt/workflow/steps.mjs was being re-discovered as an input file. Add .nuxt, .turbo, .cache, .yarn, and .pnpm-store to the ignore list, matching the directories already ignored by the eager builder's watcher.
Summary
getInputFiles()to discover files with"use step"/"use workflow"directives inside dot-prefixed files and directories (e.g..config/step.ts,.hidden-workflow.ts)cwdanddot: true, working around atinyglobbyquirk where**in ignore patterns does not match dot-prefixed segments when using absolute patterns.git,.next,.vercel, etc.) continues to work correctlyTest Plan
Added
get-input-files.test.tswith 4 tests covering:.git,.next,.vercel,.svelte-kit,.workflow-data,.well-known/workflow,node_modules)Closes #1227 (duplicate)