Skip to content

Conversation

@volnei
Copy link
Contributor

@volnei volnei commented Jan 2, 2026

What does this PR do?

This is a stacked PR on top of #26392 (ES2022 target upgrade) that adds "type": "module" to the platform packages and removes remaining CommonJS configuration as preparation for ESM migration.

Changes:

  • Added "type": "module" to @calcom/platform-constants
  • Added "type": "module" to @calcom/platform-enums
  • Added "type": "module" to @calcom/platform-types
  • Added "type": "module" to @calcom/platform-utils
  • Removed "module": "CommonJS" from @calcom/platform-libraries tsconfig
  • Converted i18n.ts from CommonJS require() calls to ESM-compatible approach using createRequire

Context: The base PR removed explicit "module": "CommonJS" from the constants, enums, types, and utils packages' tsconfigs. This PR takes the next step by declaring them as ES modules in package.json and also removes CommonJS from the libraries package.

⚠️ Important: This change may require additional configuration updates for:

  • Jest test configuration in packages that have tests (enums, utils)
  • Any consumers using require() to import these packages
  • Import paths that may need explicit file extensions

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - no documentation changes needed.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Merge the base PR (chore: upgrade ts target (perf) #26392) first
  2. Build the platform packages: yarn turbo run build --filter=@calcom/platform-libraries --force
  3. Run API v2 tests to verify runtime compatibility
  4. Check that Jest tests in packages/platform/enums and packages/platform/utils still pass

Human Review Checklist

  • Verify the createRequire pattern in i18n.ts works correctly at runtime for loading CommonJS config
  • Verify all consumers of platform packages can handle ESM imports
  • Check if Jest configuration needs updates for test scripts
  • Confirm this is intentionally exploratory/draft work for ESM migration

Checklist

  • I have read the contributing guide
  • My code follows the style guidelines of this project
  • I have checked if my changes generate no new warnings

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@volnei volnei added ready-for-e2e run-ci Approve CI to run for external contributors core area: core, team members only foundation labels Jan 2, 2026
@volnei volnei marked this pull request as ready for review January 2, 2026 17:16
@volnei volnei requested review from a team as code owners January 2, 2026 17:16
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@vercel
Copy link

vercel bot commented Jan 2, 2026

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

3 Skipped Deployments
Project Deployment Review Updated (UTC)
cal Ignored Ignored Jan 2, 2026 5:24pm
cal-companion Ignored Ignored Preview Jan 2, 2026 5:24pm
cal-eu Ignored Ignored Jan 2, 2026 5:24pm

@volnei volnei merged commit d01dac4 into chore/updated-ts-target Jan 2, 2026
12 of 13 checks passed
@volnei volnei deleted the devin/platform-esm-migration-1767373778 branch January 2, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only foundation ready-for-e2e run-ci Approve CI to run for external contributors size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants