-
Notifications
You must be signed in to change notification settings - Fork 846
feat: migrate build system to ESM with tsdown #969
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
5416fc4 to
60ad4fa
Compare
Dependency Review SummaryThe full dependency review summary is too large to display here. Please download the artifact named "dependency-review-summary" to view the complete report. |
E2E Test Results ✅All tests have completed. Tests passed. Matrix: 2 OS (Ubuntu, macOS) × 2 Templates (TypeScript, Python) = 4 jobs This comment is automatically posted by the PR E2E Results workflow. |
0ebafbb to
364a075
Compare
364a075 to
f9441b6
Compare
…creation and dependency management fix: increase timeout for flows dropdown visibility check in WorkbenchPage refactor: enhance FlowTabMenuItem to display loading state for flows and improve dropdown menu structure fix: update runner path in language-runner to support custom TypeScript runner files in test mode chore: update pnpm-lock.yaml to upgrade various dependencies including prettier, eslint, express, and ts-jest, while ensuring compatibility with TypeScript and improving overall project stability refactor: enhance jsRunner path resolution in language-runner to support test mode with TypeScript and improve command arguments refactor: update jsRunner path resolution in language-runner to support test mode with TypeScript and module file extensions chore: update pnpm-lock.yaml and package.json to remove esbuild dependency and upgrade to esbuild version 0.25.12, while refactoring tsdown configuration and enhancing CLI functionality with Redis memory server management chore: update pnpm-lock.yaml and package.json to upgrade tsx version and refactor tsx loader path resolution in language-runner chore: update pnpm-lock.yaml and package.json for dependency adjustments, enhance TypeScript configuration for ES module support, and refactor test package structure chore: update CI workflow to exclude playground directory from tests chore: update CI workflow to exclude plugins directory from tests and enhance global setup with server output tracking chore: update pnpm-lock.yaml and package.json for dependency version upgrades and add plugins directory to workflow refactor: remove unused CSS plugins from tsdown configurations and clean up package.json files across multiple plugins fix: update pnpm-lock.yaml with dependency version adjustments and add warm-up functionality for Motia plugins in workbench middleware fix: update package.json and import paths for ES module compatibility in snap and stream-client packages fix: add module type to package.json for ES module support fix: update import paths in petstore step templates to use absolute paths and remove module type from package.json fix: update package.json and tsdown.config.ts to include esbuild and tsx dependencies, adjust TypeScript module settings for improved compatibility fix: change import statement in state-audit-cron step to use type import for Order fix: update import statements in petstore step templates to use type imports and add Babel plugin for React in workbench package.json fix: update pnpm-lock.yaml to adjust lucide-react version and remove unused dependencies, while refining TypeScript configuration in header component fix: update workbench middleware to include Babel plugin for React and remove unused Radix UI dependencies fix: update workbench configuration to include new Rollup URL plugin and adjust entry points for improved asset handling fix: update pnpm-lock.yaml with new dependencies, including Babel plugin, and adjust tsdown version for improved compatibility fix: update dependencies to latest versions, including React and Lucide, and integrate Babel plugin for improved JSX support fix: add React and ReactDOM as dependencies and remove unused example plugin from motia.config.ts fix: remove unused dependencies from pnpm-lock.yaml and ensure consistent versioning for React fix: update TypeScript configuration to support ES modules and refine project structure by removing unused dependencies in templates chore: add TypeScript configuration files for app and node environments in workbench fix: refactor import statements in motia.config.ts templates and remove unused dependencies from workbench fix: streamline import paths and remove unused dependencies in middleware and header components fix: update import paths for various components and add eslint configuration for workbench fix: update import statement for Order type to include .ts extension and export CronConfig type in core index fix: correct import statements in validate-event-input, button, and table components fix: update built CLI path in E2E tests to use .mjs extension chore: update Node.js version to 24.11.1 in setup actions fix: correct import path for utility functions in Empty component fix(tests): add missing on method in LockedData mock for middleware management tests chore: update schema version in biome.json to 2.3.5 chore: update package configurations and add tsdown config files for multiple packages
e43be17 to
bcd29ba
Compare
…ndencies including express, @types/express, lucide-react, and Storybook packages, while ensuring compatibility with TypeScript and improving overall project stability
Summary
This PR introduces a comprehensive migration of the Motia monorepo build system from CommonJS to native ES Modules (ESM), replacing the previous build tooling (tsc/Vite) with tsdown across all packages. This modernization improves build performance, simplifies configuration, and ensures better compatibility with the modern JavaScript ecosystem.
Key Changes
"type": "module"and output.mjsfilesbundlerand module format toESNextRelated Issues
Type of Change
Packages Affected
Core Packages
@motiadev/core- Migrated to ESM with tsdown@motiadev/snap- Migrated to ESM with tsdown, updated CLI entry pointAdapter Packages
@motiadev/adapter-rabbitmq-events- Added tsdown config@motiadev/adapter-redis-cron- Added tsdown config@motiadev/adapter-redis-state- Added tsdown config@motiadev/adapter-redis-streams- Added tsdown configStream Client Packages
@motiadev/stream-client- Migrated to ESM with tsdown@motiadev/stream-client-browser- Added tsdown config@motiadev/stream-client-node- Migrated to ESM, removed custom build script@motiadev/stream-client-react- Added tsdown configUI Packages
@motiadev/ui- Replaced Vite with tsdown@motiadev/workbench- Migrated to tsdown, updated post-build scriptPlugins
plugin-endpoint- Replaced Vite with tsdownplugin-example- Replaced Vite with tsdownplugin-logs- Replaced Vite with tsdownplugin-observability- Replaced Vite with tsdownplugin-states- Replaced Vite with tsdownChanges Overview
Build System Changes
tscfor TypeScript compilationtsdownfor bundlingtsdownfor all buildsrequire)import).jsoutput files.mjsoutput filesdist/cjs/anddist/esm/dist/(ESM only)Package.json Export Changes
Test Configuration
NODE_OPTIONS='--experimental-vm-modules'for ESM supportjest.config.jstojest.config.cjswhere neededChecklist
Testing Performed
pnpm buildMigration Notes
For Contributors
importsyntax instead ofrequire--experimental-vm-modulesflagFor Users
Additional Context
This migration prepares Motia for better tree-shaking, faster builds, and improved compatibility with modern tooling. The tsdown bundler was chosen for its simplicity, speed, and excellent TypeScript support.
Files Added
tsdown.config.tsin each package (17 new configs)jest.config.cjsfor packages needing CommonJS Jest configFiles Removed
vite.config.tsfrom plugins and UI packagesscripts/build.shfrom several packagestsconfig.build.jsonandtsconfig.node.jsonwhere redundant.d.tsdeclaration files that are now auto-generated