Skip to content

fix(internal): align build setup with LC#1886

Draft
christian-bromann wants to merge 1 commit intomainfrom
cb/tsdown-setup
Draft

fix(internal): align build setup with LC#1886
christian-bromann wants to merge 1 commit intomainfrom
cb/tsdown-setup

Conversation

@christian-bromann
Copy link
Member

This PR aligns LangGraph.js's build process with the patterns established in LangChain.js by migrating from a custom build CLI to tsdown with standardized configuration.

Key Changes

  • Migrate build system to tsdown: Replace the custom @langchain/build CLI with tsdown-based builds using a shared getBuildConfig() helper
  • Standardize package builds: Each package now has its own tsdown.config.ts that uses shared configuration defaults
  • Add build-time validation: Integrate ATTW (Are The Types Wrong), publint, and unused dependency checking into the build pipeline
  • Update Turbo pipeline: Rename build:internalbuild:compile and update task dependencies
  • CJS compatibility plugin: Add cjsCompatPlugin to handle CommonJS barrel file generation for better backwards compatibility

Build Configuration

Each package's tsdown.config.ts now follows a standard pattern:

import { getBuildConfig, cjsCompatPlugin } from "@langchain/build";

export default getBuildConfig({
  entry: ["./src/index.ts"],
  plugins: [
    cjsCompatPlugin({
      files: ["dist/", "CHANGELOG.md", "README.md", "LICENSE"],
    }),
  ],
});

The shared config provides:

  • Dual format output (ESM + CommonJS)
  • TypeScript declaration files (.d.ts and .d.cts)
  • Source maps
  • Automatic exports field generation
  • Build validation (ATTW, publint, unused deps)

@changeset-bot
Copy link

changeset-bot bot commented Jan 12, 2026

⚠️ No Changeset found

Latest commit: b31749a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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