Skip to content

Extract node library to dedicated package #253

@bchapuis

Description

@bchapuis

Summary

Extract the node library into a standalone package (@dafthunk/nodes) to enable tree-shaking, code splitting, and clearer boundaries between node definitions and platform-specific execution.

Key components to move

  • apps/api/src/nodes/base-node-registry.ts - Registry pattern
  • apps/api/src/nodes/types.ts - ExecutableNode base class and parameter types
  • All category folders (anthropic/, text/, image/, etc.)
  • apps/api/src/nodes/parameter-mapper.ts - API ↔ node format conversion

Decoupling required

  • Abstract NodeContext to remove direct Cloudflare bindings (env.DB, env.AI, env.RESSOURCES)
  • Convert cloudflare-node-registry.ts to dynamic/lazy loading
  • Create NodeEnvironment interface for storage, secrets, and AI providers
  • Separate nodes by tier: core (no deps) → integration (API deps) → AI (provider deps)

Dependencies

  • @dafthunk/types (already shared)
  • ~50+ npm packages for specific integrations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions