Skip to content

improvement(triggers): move TRIGGER_TYPES to a dependency-free module - #8711

Merged
waleedlatif1 merged 1 commit into
stagingfrom
improvement/trigger-types-split
Oct 7, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
improvement/trigger-types-split

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Move TRIGGER_TYPES / TriggerType into lib/workflows/triggers/types.ts, which has no imports
  • lib/execution/files.ts only needed that constant, but importing it from triggers.ts pulled getBlock → the whole block registry (icons, emcn, workflow-renderer) into every Trigger.dev task that touches uploads
  • Point the three importers at the new module; triggers.ts imports it instead of defining it (no re-export)

Static import graph (esbuild metafile, Trigger externals), block registry now unreachable from all three:

  • knowledge-connector-sync: 4,876 → 3,716 modules
  • knowledge-process-document: 4,529 → 3,367 modules
  • workspace-file-search-dispatch: 3,375 → 1,708 modules (runs on small-1x, 512 MB)

Type of Change

  • Improvement

Testing

  • Tests beside every changed file plus the three suites that mock triggers.ts (8 files, 133 tests)
  • bun run lint, bun run type-check, bun run check:audits (incl. check:file-names, check:unused-exports, check:tool-registry-boundary) — green
  • Pure constant move, no behavior change, no new tests

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 7, 2026 1:06am UTC

Request Review

@cubic-dev-ai cubic-dev-ai 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 issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low risk] Moves trigger type constants to a separate module.

This PR appears safe to merge; no actionable issues were found.

What we checked:

  • Trigger strings stay unchanged: All trigger strings and the derived type are unchanged. processInputFileFields still compares block types against the same values.

Summary

Moves TRIGGER_TYPES and TriggerType into a dependency-free module.

  • Updates all callers of the moved exports.
  • Removes the files.ts import edge to triggers.ts and the block registry.
  • Removes an obsolete test mock entry.
  • No actionable issues found. This review checked code and imports; it did not run tests.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Files["execution/files.ts"] --> Types["triggers/types.ts"]
  Outputs["block-outputs.ts"] --> Types
  Tags["block-reference-tags.ts"] --> Types
  Triggers["triggers.ts"] --> Types
  Outputs --> Triggers
  Triggers --> Registry["Block registry"]
  Tags --> Registry
Loading

Reviews (1) · Last reviewed commit: "improvement(triggers): move TRIGGER_TYPE..." · Reviewed by Greptile

@waleedlatif1
waleedlatif1 merged commit db30e1a into staging Oct 7, 2026
24 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/trigger-types-split branch October 7, 2026 01:10

This branch was previously deployed

1 inactive deployment
Preview — b607feb9 Deployed Oct 7, 2026 by vercel[bot]
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