fix(build): replace rm -rf with rimraf for Windows compatibility#26641
fix(build): replace rm -rf with rimraf for Windows compatibility#26641simiondolha wants to merge 1 commit intocalcom:mainfrom
Conversation
|
@simiondolha is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
2 issues found across 12 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/embeds/embed-react/package.json">
<violation number="1" location="packages/embeds/embed-react/package.json:14">
P1: The `shx` package is not installed as a dependency, but it's being used in the build script. The build will fail because the `shx` command won't be found. Either add `shx` to devDependencies (root or this package), or use a different approach like `cp-cli` or keep the rimraf change but use Node's built-in file copy in a postbuild script.</violation>
</file>
<file name="package.json">
<violation number="1" location="package.json:32">
P1: Missing `--glob` flag for rimraf. In rimraf v5+, glob patterns are disabled by default and arguments are treated as literal paths. Without the `--glob` flag, this command will silently fail to delete anything because it will look for directories literally named `**/node_modules` instead of expanding the glob pattern.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| "scripts": { | ||
| "dev": "vite --port=3101 --open", | ||
| "build": "rm -rf dist && vite build && cp ./dist/Cal.es.js ./dist/Cal.es.mjs && tsc --emitDeclarationOnly --declarationDir dist", | ||
| "build": "rimraf dist && vite build && shx cp ./dist/Cal.es.js ./dist/Cal.es.mjs && tsc --emitDeclarationOnly --declarationDir dist", |
There was a problem hiding this comment.
P1: The shx package is not installed as a dependency, but it's being used in the build script. The build will fail because the shx command won't be found. Either add shx to devDependencies (root or this package), or use a different approach like cp-cli or keep the rimraf change but use Node's built-in file copy in a postbuild script.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/embeds/embed-react/package.json, line 14:
<comment>The `shx` package is not installed as a dependency, but it's being used in the build script. The build will fail because the `shx` command won't be found. Either add `shx` to devDependencies (root or this package), or use a different approach like `cp-cli` or keep the rimraf change but use Node's built-in file copy in a postbuild script.</comment>
<file context>
@@ -11,7 +11,7 @@
"scripts": {
"dev": "vite --port=3101 --open",
- "build": "rm -rf dist && vite build && cp ./dist/Cal.es.js ./dist/Cal.es.mjs && tsc --emitDeclarationOnly --declarationDir dist",
+ "build": "rimraf dist && vite build && shx cp ./dist/Cal.es.js ./dist/Cal.es.mjs && tsc --emitDeclarationOnly --declarationDir dist",
"preview": "vite preview",
"type-check": "tsc --pretty --noEmit",
</file context>
| "build": "rimraf dist && vite build && shx cp ./dist/Cal.es.js ./dist/Cal.es.mjs && tsc --emitDeclarationOnly --declarationDir dist", | |
| "build": "rimraf dist && vite build && node -e \"require('fs').copyFileSync('./dist/Cal.es.js', './dist/Cal.es.mjs')\" && tsc --emitDeclarationOnly --declarationDir dist", |
package.json
Outdated
| "build": "turbo run build --filter=@calcom/web...", | ||
| "build:ai": "turbo run build --filter=\"@calcom/ai\"", | ||
| "clean": "find . -name node_modules -o -name .next -o -name .turbo -o -name dist -type d -prune | xargs rm -rf", | ||
| "clean": "rimraf **/node_modules **/.next **/.turbo **/dist", |
There was a problem hiding this comment.
P1: Missing --glob flag for rimraf. In rimraf v5+, glob patterns are disabled by default and arguments are treated as literal paths. Without the --glob flag, this command will silently fail to delete anything because it will look for directories literally named **/node_modules instead of expanding the glob pattern.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At package.json, line 32:
<comment>Missing `--glob` flag for rimraf. In rimraf v5+, glob patterns are disabled by default and arguments are treated as literal paths. Without the `--glob` flag, this command will silently fail to delete anything because it will look for directories literally named `**/node_modules` instead of expanding the glob pattern.</comment>
<file context>
@@ -29,7 +29,7 @@
"build": "turbo run build --filter=@calcom/web...",
"build:ai": "turbo run build --filter=\"@calcom/ai\"",
- "clean": "find . -name node_modules -o -name .next -o -name .turbo -o -name dist -type d -prune | xargs rm -rf",
+ "clean": "rimraf **/node_modules **/.next **/.turbo **/dist",
"db-deploy": "turbo run db-deploy",
"db-seed": "turbo run db-seed",
</file context>
| "clean": "rimraf **/node_modules **/.next **/.turbo **/dist", | |
| "clean": "rimraf --glob **/node_modules **/.next **/.turbo **/dist", |
✅ Addressed in b60eed1
Use rimraf and shx instead of Unix-specific rm and cp commands to ensure build scripts work cross-platform on Windows. Updated packages: - apps/api/v1 - apps/web - packages/embeds/embed-core - packages/embeds/embed-react - packages/embeds/embed-snippet - packages/platform/atoms - packages/platform/enums - packages/platform/libraries - packages/platform/types - packages/prisma Fixes calcom#25812
c6aa4ec to
b60eed1
Compare
|
Fixed by this:- #25814 |
Summary
rm -rfcommands with cross-platformrimrafin all package.json clean scriptsrimrafas a devDependency to enable Windows compatibilityrmcommand is not recognizedUpdated packages
apps/api/v1apps/webpackages/embeds/embed-corepackages/embeds/embed-reactpackages/embeds/embed-snippetpackages/platform/atomspackages/platform/enumspackages/platform/librariespackages/platform/typespackages/prismapackage.jsonTest plan
yarn cleanon Windows to verify no errorsyarn buildon Windows to verify clean scripts workFixes #25812
🤖 Generated with Claude Code