Skip to content

Conversation

@Tobbe
Copy link
Member

@Tobbe Tobbe commented Dec 31, 2025

Update tsconfig and jsconfig for the api side and for scripts to align with the fact that we now require Node 24. This lets TS know that it's safe to require ES modules, allowing both scripts and the api side to use modern esm packages.

If you're upgrading to this version of Cedar we recommend you manually update your tsconfig.json/jsconfig.json files in api/ and scripts/.

Docs on "module": "node20"
microsoft/TypeScript#60761
https://www.typescriptlang.org/tsconfig/#node16node18node20nodenext

@netlify
Copy link

netlify bot commented Dec 31, 2025

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit 875a0b3
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/6956b55aa192b100085080bf

@github-actions github-actions bot added this to the next-release milestone Dec 31, 2025
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 31, 2025

Greptile Summary

Updated TypeScript and JavaScript compiler configurations across all project templates and fixtures to align with Node.js 24 requirements. The changes update target from ES2023 to ES2024 and module from Node16 to Node20, enabling TypeScript to recognize Node 24's native support for synchronously requiring ES modules.

Key Changes:

  • Updated 12 configuration files across templates (ts, js, esm-ts, esm-js) and test fixtures
  • Consistent configuration: target: "ES2024" and module: "Node20" with moduleResolution: "Node16"
  • Enables modern ESM packages to be used with require() in Node 24+ environments
  • Affects both api and scripts directories in all templates

Impact:
This change allows developers using Cedar with Node 24 to use modern ESM-only npm packages in their API and scripts without module loading errors.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - straightforward configuration updates aligned with Node 24 upgrade
  • The changes are mechanical, consistent across all files, and align with the project's documented Node 24 requirement. The configuration combination (module: "Node20" with moduleResolution: "Node16") follows existing patterns in the codebase (e.g., packages/cli/tsconfig.json). All changes are to configuration templates that will be used for new projects or fixtures, with no runtime code modifications.
  • No files require special attention - all changes are identical configuration updates

Important Files Changed

Filename Overview
packages/create-cedar-app/templates/esm-js/api/jsconfig.json Updated target to ES2024 and module to Node20 for Node 24 compatibility
packages/create-cedar-app/templates/esm-ts/api/tsconfig.json Updated target to ES2024 and module to Node20 for Node 24 compatibility
packages/create-cedar-app/templates/js/api/jsconfig.json Updated target to ES2024 and module to Node20 for Node 24 compatibility
packages/create-cedar-app/templates/js/scripts/jsconfig.json Updated target to ES2024 and module to Node20 for Node 24 compatibility
packages/create-cedar-app/templates/ts/api/tsconfig.json Updated target to ES2024 and module to Node20 for Node 24 compatibility
packages/create-cedar-app/templates/ts/scripts/tsconfig.json Updated target to ES2024 and module to Node20 for Node 24 compatibility

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant TS as TypeScript Compiler
    participant Node as Node.js 24
    participant ESM as ES Module Package
    
    Dev->>TS: Write code with require() for ESM
    Note over TS: Uses module: "Node20"<br/>target: "ES2024"<br/>moduleResolution: "Node16"
    TS->>TS: Validates module syntax
    TS->>Dev: Type checking passes
    Dev->>Node: Run script/API code
    Node->>ESM: require(ESM) synchronously
    Note over Node: Node 24+ supports<br/>require() for ESM modules<br/>(without top-level await)
    ESM->>Node: Module loaded
    Node->>Dev: Execution succeeds
Loading

@nx-cloud
Copy link

nx-cloud bot commented Dec 31, 2025

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 875a0b3

Command Status Duration Result
nx run-many -t build ✅ Succeeded 3m 32s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-01 21:01:06 UTC

@nx-cloud
Copy link

nx-cloud bot commented Dec 31, 2025

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit b531a9e

Command Status Duration Result
nx run-many -t build ✅ Succeeded 2m 32s View ↗
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 41s View ↗
nx run-many -t test --minWorkers=1 --maxWorkers=4 ✅ Succeeded 6s View ↗
nx run-many -t test:types ✅ Succeeded 6s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-31 13:55:53 UTC

@Tobbe Tobbe merged commit cffac23 into main Jan 1, 2026
85 of 91 checks passed
@Tobbe Tobbe deleted the tobbe-update-template-api-tsconfig branch January 1, 2026 21:01
@Tobbe Tobbe modified the milestones: next-release, v2.3.0 Jan 2, 2026
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.

2 participants