Skip to content

Conversation

@tanujbhaud
Copy link

Summary

Fixes Windows incompatibility issues where Unix-specific shell commands (rm, cp, cd) prevented yarn install and yarn dx from working on Windows systems.

Fixes #25376

Changes Made

  • Replaced rm -rf commands in 9 packages with cross-platform Node.js fs.rmSync() and fs.cpSync()
  • Fixed @calcom/platform-enums build script (removed rm -rf ./dist)
  • Fixed @calcom/platform-types build script (removed rm -rf ./dist)
  • Fixed @calcom/embed-core build and clean scripts (replaced Unix commands)
  • Fixed @calcom/embed-react build and clean scripts (replaced rm and cp)
  • Fixed @calcom/embed-snippet build and clean scripts
  • Fixed @calcom/prisma db-up script to run from correct directory
  • Fixed @calcom/web and @calcom/api clean scripts
  • Removed problematic .env symlink in packages/prisma/.env that caused Docker Compose failures
  • Added database port mapping to docker-compose.yml (5450:5432)

Test Plan

  • ✅ Tested yarn install completes successfully on Windows 11
  • ✅ Tested Docker Compose starts database and redis containers
  • ✅ Verified all scripts use cross-platform Node.js APIs
  • ✅ Changes work on Windows, macOS, and Linux (Node.js fs module is cross-platform)

Related Issues

This extends the fix from #14445 which only addressed @calcom/embed-core. The same issue existed in platform packages and other embed packages, blocking Windows developers from setting up the project.

Additional Context

  • Windows has significant market share among developers, and cross-platform compatibility is essential for an open-source project
  • The fix uses native Node.js APIs with zero dependencies
  • No impact on Unix/macOS users - Node.js fs module works identically across all platforms

@tanujbhaud tanujbhaud requested review from a team as code owners November 24, 2025 21:20
@vercel
Copy link

vercel bot commented Nov 24, 2025

@tanuj-ekayaa is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Nov 24, 2025
@CLAassistant
Copy link

CLAassistant commented Nov 24, 2025

CLA assistant check
All committers have signed the CLA.

…m alternatives

## Summary
Fixes Windows incompatibility issues where Unix-specific shell commands (`rm`, `cp`, `cd`) prevented `yarn install` and `yarn dx` from working on Windows systems.

## Changes
- **Replaced `rm -rf` commands** in 9 packages with cross-platform Node.js `fs.rmSync()` and `fs.cpSync()`
- **Fixed `@calcom/platform-enums`** build script (removed `rm -rf ./dist`)
- **Fixed `@calcom/platform-types`** build script (removed `rm -rf ./dist`)
- **Fixed `@calcom/embed-core`** build and clean scripts (replaced Unix commands)
- **Fixed `@calcom/embed-react`** build and clean scripts (replaced `rm` and `cp`)
- **Fixed `@calcom/embed-snippet`** build and clean scripts
- **Fixed `@calcom/prisma`** db-up script to run from correct directory
- **Fixed `@calcom/web` and `@calcom/api`** clean scripts
- **Removed problematic `.env` symlink** in `packages/prisma/.env` that caused Docker Compose failures
- **Added database port mapping** to `docker-compose.yml` (5450:5432)

## Test Plan
- Tested `yarn install` completes successfully on Windows 11
- Tested Docker Compose starts database and redis containers
- Verified all scripts use cross-platform Node.js APIs
- Changes work on Windows, macOS, and Linux (Node.js fs module is cross-platform)

## Related Issues
This extends the fix from calcom#14445 which only addressed `@calcom/embed-core`. The same issue existed in platform packages and other embed packages, blocking Windows developers from setting up the project.
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.

2 issues found across 10 files

Prompt for AI agents (all 2 issues)

Understand the root cause of the following 2 issues and fix them.


<file name="packages/platform/types/package.json">

<violation number="1" location="packages/platform/types/package.json:8">
Build no longer clears `dist`, so removed/renamed files can linger and be published. Please restore a cross‑platform clean step before running `tsc`.</violation>
</file>

<file name="packages/platform/enums/package.json">

<violation number="1" location="packages/platform/enums/package.json:20">
Dropping the dist cleanup step means stale compiled files stick around when sources are removed or renamed, because `tsc --build` never deletes old outputs. Ensure the build script removes `./dist` in a cross-platform way before running tsc.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

"scripts": {
"build": "yarn clean && tsc --build --force tsconfig.json",
"clean": "rm -rf ./dist",
"build": "tsc --build --force tsconfig.json",
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 24, 2025

Choose a reason for hiding this comment

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

Build no longer clears dist, so removed/renamed files can linger and be published. Please restore a cross‑platform clean step before running tsc.

Prompt for AI agents
Address the following comment on packages/platform/types/package.json at line 8:

<comment>Build no longer clears `dist`, so removed/renamed files can linger and be published. Please restore a cross‑platform clean step before running `tsc`.</comment>

<file context>
@@ -5,8 +5,7 @@
   &quot;scripts&quot;: {
-    &quot;build&quot;: &quot;yarn clean &amp;&amp; tsc --build --force tsconfig.json&quot;,
-    &quot;clean&quot;: &quot;rm -rf ./dist&quot;,
+    &quot;build&quot;: &quot;tsc --build --force tsconfig.json&quot;,
     &quot;build:watch&quot;: &quot;tsc --build --force ./tsconfig.json --watch&quot;,
     &quot;post-install&quot;: &quot;yarn build&quot;
</file context>
Suggested change
"build": "tsc --build --force tsconfig.json",
"build": "node -e \"require('fs').rmSync('./dist',{recursive:true,force:true})\" && tsc --build --force tsconfig.json",

✅ Addressed in 8424f07

"scripts": {
"test": "jest ./tests",
"build": "rm -rf ./dist && tsc --build --force tsconfig.json",
"build": "tsc --build --force tsconfig.json",
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 24, 2025

Choose a reason for hiding this comment

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

Dropping the dist cleanup step means stale compiled files stick around when sources are removed or renamed, because tsc --build never deletes old outputs. Ensure the build script removes ./dist in a cross-platform way before running tsc.

Prompt for AI agents
Address the following comment on packages/platform/enums/package.json at line 20:

<comment>Dropping the dist cleanup step means stale compiled files stick around when sources are removed or renamed, because `tsc --build` never deletes old outputs. Ensure the build script removes `./dist` in a cross-platform way before running tsc.</comment>

<file context>
@@ -17,7 +17,7 @@
   &quot;scripts&quot;: {
     &quot;test&quot;: &quot;jest ./tests&quot;,
-    &quot;build&quot;: &quot;rm -rf ./dist &amp;&amp; tsc --build --force tsconfig.json&quot;,
+    &quot;build&quot;: &quot;tsc --build --force tsconfig.json&quot;,
     &quot;build:watch&quot;: &quot;tsc --build --force ./tsconfig.json --watch&quot;,
     &quot;post-install&quot;: &quot;yarn build&quot;
</file context>
Suggested change
"build": "tsc --build --force tsconfig.json",
"build": "node -e \"require('fs').rmSync('./dist', { recursive: true, force: true });\" && tsc --build --force tsconfig.json",

✅ Addressed in 8424f07

- Add explicit dist cleanup before tsc build in platform-enums
- Add explicit dist cleanup before tsc build in platform-types
- Addresses cubic-dev-ai review: tsc --build --force doesn't remove stale files
- Uses Node.js fs.rmSync for cross-platform compatibility
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.

1 issue found across 2 files (reviewed changes from recent commits).

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="packages/platform/types/package.json">

<violation number="1" location="packages/platform/types/package.json:8">
After deleting ./dist, the build needs to force TypeScript to re-emit outputs; otherwise the stale tsconfig.tsbuildinfo makes `tsc --build` skip compilation and leaves dist empty.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

"scripts": {
"build": "yarn clean && tsc --build --force tsconfig.json",
"clean": "rm -rf ./dist",
"build": "node -e \"require('fs').rmSync('./dist',{recursive:true,force:true})\" && tsc --build tsconfig.json",
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 25, 2025

Choose a reason for hiding this comment

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

After deleting ./dist, the build needs to force TypeScript to re-emit outputs; otherwise the stale tsconfig.tsbuildinfo makes tsc --build skip compilation and leaves dist empty.

Prompt for AI agents
Address the following comment on packages/platform/types/package.json at line 8:

<comment>After deleting ./dist, the build needs to force TypeScript to re-emit outputs; otherwise the stale tsconfig.tsbuildinfo makes `tsc --build` skip compilation and leaves dist empty.</comment>

<file context>
@@ -5,7 +5,7 @@
   &quot;private&quot;: true,
   &quot;scripts&quot;: {
-    &quot;build&quot;: &quot;tsc --build --force tsconfig.json&quot;,
+    &quot;build&quot;: &quot;node -e \&quot;require(&#39;fs&#39;).rmSync(&#39;./dist&#39;,{recursive:true,force:true})\&quot; &amp;&amp; tsc --build tsconfig.json&quot;,
     &quot;build:watch&quot;: &quot;tsc --build --force ./tsconfig.json --watch&quot;,
     &quot;post-install&quot;: &quot;yarn build&quot;
</file context>
Suggested change
"build": "node -e \"require('fs').rmSync('./dist',{recursive:true,force:true})\" && tsc --build tsconfig.json",
"build": "node -e \"require('fs').rmSync('./dist',{recursive:true,force:true})\" && tsc --build --force tsconfig.json",
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Created by Linear-GitHub Sync size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows compatibility: Unix commands prevent yarn install and yarn dx

2 participants