Skip to content

refactor(@angular-devkit/build-angular): remove usage of rimraf package #21049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/angular_devkit/build_angular/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ ts_library(
"@npm//@types/node",
"@npm//@types/parse5-html-rewriting-stream",
"@npm//@types/postcss-preset-env",
"@npm//@types/rimraf",
"@npm//@types/sass",
"@npm//@types/semver",
"@npm//@types/text-table",
Expand Down Expand Up @@ -171,7 +170,6 @@ ts_library(
"@npm//raw-loader",
"@npm//regenerator-runtime",
"@npm//resolve-url-loader",
"@npm//rimraf",
"@npm//rxjs",
"@npm//sass",
"@npm//sass-loader",
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"raw-loader": "4.0.2",
"regenerator-runtime": "0.13.7",
"resolve-url-loader": "4.0.0",
"rimraf": "3.0.2",
"rxjs": "6.6.7",
"sass": "1.34.1",
"sass-loader": "12.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
* found in the LICENSE file at https://angular.io/license
*/

import { rmdirSync } from 'fs';
import { resolve } from 'path';
import * as rimraf from 'rimraf';

/**
* Delete an output directory, but error out if it's the root of the project.
*/
export function deleteOutputDir(root: string, outputPath: string) {
export function deleteOutputDir(root: string, outputPath: string): void {
const resolvedOutputPath = resolve(root, outputPath);
if (resolvedOutputPath === root) {
throw new Error('Output path MUST not be project root directory!');
}

rimraf.sync(resolvedOutputPath);
rmdirSync(resolvedOutputPath, { recursive: true, maxRetries: 3 });
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { json } from '@angular-devkit/core';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import * as rimraf from 'rimraf';
import { Schema as BrowserBuilderSchema } from '../browser/schema';
import { Schema as ServerBuilderSchema } from '../server/schema';
import { readTsconfig } from '../utils/read-tsconfig';
Expand Down Expand Up @@ -268,7 +267,7 @@ export async function configureI18nBuild<T extends BrowserBuilderSchema | Server
// Remove temporary directory used for i18n processing
process.on('exit', () => {
try {
rimraf.sync(tempPath);
fs.rmdirSync(tempPath, { recursive: true, maxRetries: 3 });
} catch {}
});
}
Expand Down