-
-
Notifications
You must be signed in to change notification settings - Fork 729
Fix "no tasks defined" issue (fix #1681) #1663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 79e8c72 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 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 |
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
packages/cli-v3/src/build/entryPoints.tsOops! Something went wrong! :( ESLint: 8.45.0 ESLint couldn't find the config "custom" to extend from. Please check that the name of the config is correct. The config "custom" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. references/v3-catalog/trigger.config.tsOops! Something went wrong! :( ESLint: 8.45.0 ESLint couldn't find the config "custom" to extend from. Please check that the name of the config is correct. The config "custom" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. packages/cli-v3/src/dev/workerRuntime.tsOops! Something went wrong! :( ESLint: 8.45.0 ESLint couldn't find the config "custom" to extend from. Please check that the name of the config is correct. The config "custom" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.
WalkthroughThis pull request updates multiple components of the project. It fixes the misconfigured directory search issue for trigger.dev by patching configuration and improving error handling in the bundling process. A dependency upgrade for tinyglobby is included. The entry point manager now returns additional pattern properties for improved matching and logging. Worker manifest validation has been refined with structured error output using helper functions. Additionally, a new helloWorld task is added to the catalog and the trigger configuration is updated with new directories. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User/System
participant BW as bundleWorker
participant EPM as EntryPointManager
participant PE as prettyError
U->>BW: Invoke bundling process
BW->>EPM: Retrieve entry points
EPM-->>BW: Return entry points (possibly empty)
alt No entry points found
BW->>PE: Log detailed error message (with config & help link)
BW->>BW: Throw SkipLoggingError to halt bundling
else Entry points exist
BW->>BW: Proceed with bundling
end
sequenceDiagram
participant Dev as Developer
participant VM as validateWorkerManifest
participant HF as HelperFunctions
participant PE as prettyError
Dev->>VM: Provide WorkerManifest
VM->>VM: Validate tasks (check duplicates, no tasks defined)
alt Validation issue found
VM->>HF: Generate header, message, footer
HF-->>VM: Return formatted error details
VM->>PE: Log formatted error details
VM-->>Dev: Return structured ValidationIssue
else No issues
VM-->>Dev: Return undefined
end
Poem
Tip 🌐 Web search-backed reviews and chat
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (6)
references/v3-catalog/src/trigger2/helloWorld.ts (1)
3-8
: Enhance task implementation for production readiness.The task implementation could be improved with proper logging and error handling.
const helloWorld = task({ id: "helloWorld", async run() { - console.log("Hello World!"); + try { + logger.info("Starting helloWorld task"); + // Add your task logic here + logger.info("Successfully completed helloWorld task"); + } catch (error) { + logger.error("Error in helloWorld task", { error }); + throw error; + } }, });packages/cli-v3/src/build/entryPoints.ts (2)
39-45
: Consider making pattern generation more flexible.The pattern generation could be enhanced to support more file extensions and custom patterns.
const patterns = dirs.flatMap((dir) => [ `${ isDynamicPattern(dir) - ? `${dir}/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}` - : `${escapePath(dir)}/**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}` + ? `${dir}/*.{${config.fileExtensions ?? 'ts,tsx,mts,cts,js,jsx,mjs,cjs'}}` + : `${escapePath(dir)}/**/*.{${config.fileExtensions ?? 'ts,tsx,mts,cts,js,jsx,mjs,cjs'}}` }`, ]);
48-54
: Make ignore patterns configurable through config.Consider allowing users to customize additional ignore patterns through configuration.
-let ignorePatterns = config.ignorePatterns ?? DEFAULT_IGNORE_PATTERNS; -ignorePatterns = ignorePatterns.concat([ +const defaultSystemIgnores = [ "**/node_modules/**", "**/.git/**", "**/.trigger/**", "**/.next/**", -]); +]; +let ignorePatterns = [ + ...(config.ignorePatterns ?? DEFAULT_IGNORE_PATTERNS), + ...(config.additionalIgnorePatterns ?? []), + ...defaultSystemIgnores, +];packages/cli-v3/src/build/bundle.ts (1)
76-97
: Enhance error message with more context.The error message could be more helpful by including:
- The current working directory
- The ignored patterns that might be filtering out files
- More specific troubleshooting steps based on the configuration
if (entryPointManager.entryPoints.length === 0) { const errorMessageBody = ` + Working directory: ${resolvedConfig.workingDir} + Dirs config: ${resolvedConfig.dirs.join("\n- ")} Search patterns: ${entryPointManager.patterns.join("\n- ")} + Ignored patterns: + ${entryPointManager.ignorePatterns.join("\n- ")} + Possible solutions: 1. Check if the directory paths in your config are correct 2. Verify that your files match the search patterns 3. Update the search patterns in your config + 4. Check if your files are being excluded by ignore patterns + 5. Ensure you're running the command from the correct directory `.replace(/^ {6}/gm, ""); prettyError( - "No trigger files found", + "No trigger files found in specified directories", errorMessageBody, cliLink("View the config docs", "https://trigger.dev/docs/config/config-file") ); throw new SkipLoggingError(); }packages/cli-v3/src/dev/workerRuntime.ts (1)
369-385
: Consider adding early returns for better readability.The function can be simplified by removing the unused
issues
array and using early returns.function validateWorkerManifest(manifest: WorkerManifest): ValidationIssue | undefined { - const issues: ValidationIssue[] = []; - if (!manifest.tasks || manifest.tasks.length === 0) { return { type: "noTasksDefined" }; } // Check for any duplicate task ids const taskIds = manifest.tasks.map((task) => task.id); const duplicateTaskIds = taskIds.filter((id, index) => taskIds.indexOf(id) !== index); if (duplicateTaskIds.length > 0) { return { type: "duplicateTaskId", duplicationTaskIds: duplicateTaskIds }; } return undefined; }.changeset/eleven-eels-draw.md (1)
1-6
: Fix grammatical issue in the description.The phrase "during in dev" is redundant.
-Fix "No tasks defined" issue because of misconfigured dir search paths. Also improve errors around no files or no tasks found during in dev" +Fix "No tasks defined" issue because of misconfigured dir search paths. Also improve errors around no files or no tasks found during dev"🧰 Tools
🪛 LanguageTool
[style] ~5-~5: This phrase is redundant. Consider writing “during” or “in”.
Context: ...rrors around no files or no tasks found during in dev"(DURING_IN)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
.changeset/eleven-eels-draw.md
(1 hunks)packages/cli-v3/package.json
(1 hunks)packages/cli-v3/src/build/bundle.ts
(2 hunks)packages/cli-v3/src/build/entryPoints.ts
(5 hunks)packages/cli-v3/src/dev/workerRuntime.ts
(3 hunks)references/v3-catalog/src/trigger2/helloWorld.ts
(1 hunks)references/v3-catalog/trigger.config.ts
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
.changeset/eleven-eels-draw.md
[style] ~5-~5: This phrase is redundant. Consider writing “during” or “in”.
Context: ...rrors around no files or no tasks found during in dev"
(DURING_IN)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
- GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
- GitHub Check: typecheck / typecheck
- GitHub Check: units / 🧪 Unit Tests
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
packages/cli-v3/src/dev/workerRuntime.ts (2)
360-367
: LGTM! Well-structured validation issue type.The new
ValidationIssue
type provides clear categorization of validation issues, making it easier to handle and display appropriate error messages.
409-444
: Great error messaging with example code!The error message for "noTasksDefined" is particularly helpful as it includes:
- List of files being processed
- Clear explanation of the issue
- Example code showing how to fix it
packages/cli-v3/package.json (1)
123-123
: Verify the tinyglobby version update.The update from ^0.2.2 to ^0.2.10 is a minor version bump. Let's verify if there are any breaking changes or important updates in this version.
✅ Verification successful
Tinyglobby version bump verified: No breaking changes detected.
Based on the available changelog data, the update from ^0.2.2 to ^0.2.10 involves only minor improvements—such as relicensing to MIT, disabling source maps for smaller bundles, and refining the common root inference algorithm—with no breaking changes.🏁 Scripts executed
The following scripts were executed for the analysis:
Web query:
What are the changes between tinyglobby v0.2.2 and v0.2.10?
Length of output: 4019
@trigger.dev/build
trigger.dev
@trigger.dev/react-hooks
@trigger.dev/rsc
@trigger.dev/core
@trigger.dev/sdk
commit: |
Summary by CodeRabbit
New Features
Bug Fixes
Chores