Files
calendar/apps/web/scripts/copy-app-store-static.js
T
Alex van AndelGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>Keith Williams
4689775a1f chore: Skip static file copy if not required (#23903)
* chore: Skip static file copy if not required

* feat: Replace MD5 hash checks with Turborepo caching for static file copying

- Add copy-app-store-static Turborepo task with proper inputs/outputs
- Remove manual MD5 hash calculation logic that was causing performance issues
- Update package.json scripts to use Turborepo task
- Addresses Keith's feedback about using Turborepo cache instead of manual checks

Co-Authored-By: alex@cal.com <me@alexvanandel.com>

* fix: Add copy-app-store-static script to package.json for Turborepo task execution

- Add missing script definition in apps/web/package.json
- Enables Turborepo to properly execute the static file copying task
- Fixes 'No tasks were executed' issue by providing the command to run

Co-Authored-By: alex@cal.com <me@alexvanandel.com>

* fix: Remove skipped jobs from required check failure condition

- Allow conditional E2E jobs to be skipped without failing the required check
- Maintain failure detection for actual job failures and cancellations
- Apply fix consistently to both pr.yml and all-checks.yml workflows

Co-Authored-By: alex@cal.com <me@alexvanandel.com>

* Revert "fix: Remove skipped jobs from required check failure condition"

This reverts commit 429f0506d009eaae7fa88be6db077681d5124f2a.

* Only write new logs

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2025-09-18 16:44:06 +00:00

32 lines
1009 B
JavaScript

const fs = require("fs");
const path = require("path");
const glob = require("glob");
const copyAppStoreStatic = () => {
// Get all static files from app-store packages
const staticFiles = glob.sync("../../packages/app-store/**/static/**/*", { nodir: true });
staticFiles.forEach((file) => {
// Extract app name from path
const appNameMatch = file.match(/app-store\/(.*?)\/static/);
if (!appNameMatch) return;
const appName = appNameMatch[1];
const fileName = path.basename(file);
// Create destination directory if it doesn't exist
const destDir = path.join(process.cwd(), "public", "app-store", appName);
if (!fs.existsSync(destDir)) {
fs.mkdirSync(destDir, { recursive: true });
}
// Copy file to destination (Turborepo caching handles change detection)
const destPath = path.join(destDir, fileName);
fs.copyFileSync(file, destPath);
console.log(`Copied ${file} to ${destPath}`);
});
};
// Run the copy function
copyAppStoreStatic();