mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Usage of the `fast-glob` package has been replaced with the `tinyglobby` package. The change reduces the number of transitive dependencies related to these packages from 17 to 2 while also maintaining equivalent functionality. This was also changed in the Angular CLI packages. PR Close #60264
32 lines
1 KiB
JavaScript
32 lines
1 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
/**
|
|
* Script that deletes all `yarn.lock` files for integration tests and
|
|
* re-builds them from scratch. This script is useful as lock files in
|
|
* integration tests are not necessarily up-to-date, given dependencies
|
|
* being linked from the root `/package.json`, or locally-built 1st party
|
|
* packages being used from tarball archives.
|
|
*/
|
|
|
|
import childProcess from 'child_process';
|
|
import url from 'url';
|
|
import path from 'path';
|
|
import { globSync } from 'tinyglobby';
|
|
import fs from 'fs';
|
|
|
|
const containingDir = path.dirname(url.fileURLToPath(import.meta.url));
|
|
const testDirs = globSync('*/BUILD.bazel', {cwd: containingDir})
|
|
.map((d) => path.join(containingDir, path.dirname(d)));
|
|
|
|
const yarnTestTmpDir = path.join(containingDir, '.tmp-yarn-cache');
|
|
|
|
for (const testDir of testDirs) {
|
|
fs.rmSync(path.join(testDir, 'yarn.lock'));
|
|
childProcess.spawnSync('yarn', ['install', '--cache-folder', yarnTestTmpDir], {
|
|
cwd: testDir,
|
|
shell: true,
|
|
stdio: 'inherit',
|
|
});
|
|
}
|
|
|
|
fs.rmSync(yarnTestTmpDir, {recursive: true});
|