| |
| |
| |
| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| import { rmSync, readFileSync } from 'node:fs'; |
| import { dirname, join } from 'node:path'; |
| import { fileURLToPath } from 'node:url'; |
| import { globSync } from 'glob'; |
|
|
| const __dirname = dirname(fileURLToPath(import.meta.url)); |
| const root = join(__dirname, '..'); |
|
|
| |
| rmSync(join(root, 'node_modules'), { recursive: true, force: true }); |
| rmSync(join(root, 'bundle'), { recursive: true, force: true }); |
| rmSync(join(root, 'packages/cli/src/generated/'), { |
| recursive: true, |
| force: true, |
| }); |
| const RMRF_OPTIONS = { recursive: true, force: true }; |
| rmSync(join(root, 'bundle'), RMRF_OPTIONS); |
| |
| const rootPackageJson = JSON.parse( |
| readFileSync(join(root, 'package.json'), 'utf-8'), |
| ); |
| for (const workspace of rootPackageJson.workspaces) { |
| const packages = globSync(join(workspace, 'package.json'), { cwd: root }); |
| for (const pkgPath of packages) { |
| const pkgDir = dirname(join(root, pkgPath)); |
| rmSync(join(pkgDir, 'dist'), RMRF_OPTIONS); |
| } |
| } |
|
|
| |
| const vsixFiles = globSync('packages/vscode-ide-companion/*.vsix', { |
| cwd: root, |
| }); |
| for (const vsixFile of vsixFiles) { |
| rmSync(join(root, vsixFile), RMRF_OPTIONS); |
| } |
|
|