chore(build): clean all packages, not just published ones (#40469)

This commit is contained in:
Yury Semikhatsky
2026-04-28 12:25:38 -07:00
committed by GitHub
parent 21ca7274ed
commit 95a1211e1c
+10 -7
View File
@@ -1,16 +1,19 @@
// @ts-check
const { workspace } = require('../workspace');
const fs = require('fs');
const path = require('path');
const rmSync = (dir) => fs.rmSync(dir, { recursive: true, force: true, maxRetries: 10 });
for (const pkg of workspace.packages()) {
rmSync(path.join(pkg.path, 'node_modules'));
rmSync(path.join(pkg.path, 'lib'));
rmSync(path.join(pkg.path, 'dist'));
rmSync(path.join(pkg.path, 'src', 'generated'));
const bundles = path.join(pkg.path, 'bundles');
const packagesDir = path.join(__dirname, '..', '..', 'packages');
for (const entry of fs.readdirSync(packagesDir, { withFileTypes: true })) {
if (!entry.isDirectory())
continue;
const pkgPath = path.join(packagesDir, entry.name);
rmSync(path.join(pkgPath, 'node_modules'));
rmSync(path.join(pkgPath, 'lib'));
rmSync(path.join(pkgPath, 'dist'));
rmSync(path.join(pkgPath, 'src', 'generated'));
const bundles = path.join(pkgPath, 'bundles');
if (fs.existsSync(bundles) && fs.statSync(bundles).isDirectory()) {
for (const bundle of fs.readdirSync(bundles, { withFileTypes: true })) {
if (bundle.isDirectory())