Skip to content

Commit

Permalink
refactor: use node:fs/promises (typeorm#11206)
Browse files Browse the repository at this point in the history
* refactor: use fs promises

* refactor: remove del, update rimraf
  • Loading branch information
alumni authored Dec 30, 2024
1 parent 30f801f commit 71addb2
Show file tree
Hide file tree
Showing 17 changed files with 163 additions and 381 deletions.
12 changes: 6 additions & 6 deletions gulpfile.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Gulpclass, Task, SequenceTask, MergedTask } from "gulpclass";

import fs from "fs";
import fs from "fs/promises";
import gulp from "gulp";
import del from "del";
import shell from "gulp-shell";
import replace from "gulp-replace";
import rename from "gulp-rename";
import sourcemaps from "gulp-sourcemaps";
import ts from "gulp-typescript";
import { rimraf } from "rimraf";

@Gulpclass()
export class Gulpfile {
Expand All @@ -21,7 +21,7 @@ export class Gulpfile {
*/
@Task()
async clean() {
return del(["./build/**"]);
return rimraf(["./build/**"]);
}

/**
Expand Down Expand Up @@ -86,7 +86,7 @@ export class Gulpfile {

@Task()
async browserClearPackageDirectory() {
return del([
return rimraf([
"./build/browser/**"
]);
}
Expand Down Expand Up @@ -174,7 +174,7 @@ export class Gulpfile {
`export {\n ${cjsKeys.join(",\n ")}\n};\n` +
'export default TypeORM;\n';

fs.writeFileSync(`${buildDir}/index.mjs`, indexMjsContent, "utf8");
await fs.writeFile(`${buildDir}/index.mjs`, indexMjsContent, "utf8");
}

/**
Expand All @@ -193,7 +193,7 @@ export class Gulpfile {
*/
@Task()
async packageClearPackageDirectory() {
return del([
return rimraf([
"build/package/src/**"
]);
}
Expand Down
Loading

0 comments on commit 71addb2

Please sign in to comment.