[PR #1886] fix(internal): align build setup with LC #1810

Open
opened 2026-02-15 20:16:55 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/1886
Author: @christian-bromann
Created: 1/12/2026
Status: 🔄 Open

Base: mainHead: cb/tsdown-setup


📝 Commits (1)

  • b31749a fix(internal): align build setup with LC

📊 Changes

62 files changed (+2304 additions, -1531 deletions)

View changed files

📝 .gitignore (+11 -1)
📝 examples/ui-react-transport/package.json (+1 -1)
📝 examples/ui-react-transport/turbo.json (+3 -3)
📝 examples/ui-react/package.json (+1 -1)
📝 examples/ui-react/turbo.json (+2 -2)
internal/build/.prettierrc (+9 -0)
internal/build/cli.ts (+0 -229)
internal/build/index.ts (+0 -120)
📝 internal/build/package.json (+12 -6)
internal/build/src/index.ts (+103 -0)
internal/build/src/plugins/cjs-compat.ts (+231 -0)
internal/build/src/utils.ts (+22 -0)
internal/build/tsconfig.json (+34 -0)
internal/build/turbo.json (+6 -0)
internal/build/types.ts (+0 -39)
internal/build/utils.ts (+0 -120)
📝 libs/checkpoint-mongodb/package.json (+17 -12)
libs/checkpoint-mongodb/tsdown.config.ts (+10 -0)
📝 libs/checkpoint-mongodb/turbo.json (+2 -2)
📝 libs/checkpoint-postgres/package.json (+22 -18)

...and 42 more files

📄 Description

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)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langgraphjs/pull/1886 **Author:** [@christian-bromann](https://github.com/christian-bromann) **Created:** 1/12/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `cb/tsdown-setup` --- ### 📝 Commits (1) - [`b31749a`](https://github.com/langchain-ai/langgraphjs/commit/b31749a0f1279856f3ca8e60b227e8d6e7ea695a) fix(internal): align build setup with LC ### 📊 Changes **62 files changed** (+2304 additions, -1531 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+11 -1) 📝 `examples/ui-react-transport/package.json` (+1 -1) 📝 `examples/ui-react-transport/turbo.json` (+3 -3) 📝 `examples/ui-react/package.json` (+1 -1) 📝 `examples/ui-react/turbo.json` (+2 -2) ➕ `internal/build/.prettierrc` (+9 -0) ➖ `internal/build/cli.ts` (+0 -229) ➖ `internal/build/index.ts` (+0 -120) 📝 `internal/build/package.json` (+12 -6) ➕ `internal/build/src/index.ts` (+103 -0) ➕ `internal/build/src/plugins/cjs-compat.ts` (+231 -0) ➕ `internal/build/src/utils.ts` (+22 -0) ➕ `internal/build/tsconfig.json` (+34 -0) ➕ `internal/build/turbo.json` (+6 -0) ➖ `internal/build/types.ts` (+0 -39) ➖ `internal/build/utils.ts` (+0 -120) 📝 `libs/checkpoint-mongodb/package.json` (+17 -12) ➕ `libs/checkpoint-mongodb/tsdown.config.ts` (+10 -0) 📝 `libs/checkpoint-mongodb/turbo.json` (+2 -2) 📝 `libs/checkpoint-postgres/package.json` (+22 -18) _...and 42 more files_ </details> ### 📄 Description 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:internal` → `build: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: ```typescript 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 20:16:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#1810