Skip to content

Commit a098c2c

Browse files
committed
Refactor gulpfile to use Node built-ins
1 parent 2387a6b commit a098c2c

File tree

3 files changed

+36
-1435
lines changed

3 files changed

+36
-1435
lines changed

vscode-wpilib/gulpfile.mjs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6+
import { globSync } from 'fs';
7+
import { glob, rm, rmdir } from 'fs/promises';
68
import gulp from 'gulp';
7-
89
import yaml from 'gulp-yaml';
9-
import { deleteSync } from 'del';
1010
import nls from 'vscode-nls-dev';
1111

1212
// If all VS Code languages are supported you can use nls.coreLanguages
@@ -16,22 +16,22 @@ const languages = [
1616
},
1717
];
1818

19-
gulp.task('i18n-compile', async function () {
20-
return gulp.src('./locale/**/*.yaml').pipe(yaml()).pipe(gulp.dest('./i18n/'));
21-
});
19+
gulp.task('i18n-compile', async () =>
20+
gulp.src('./locale/**/*.yaml').pipe(yaml()).pipe(gulp.dest('./i18n/'))
21+
);
2222

23-
gulp.task('i18n-additional', async function () {
24-
return gulp
23+
gulp.task('i18n-additional', async () =>
24+
gulp
2525
.src(['package.nls.json'])
2626
.pipe(nls.createAdditionalLanguageFiles(languages, 'i18n'))
27-
.pipe(gulp.dest('.'));
28-
});
27+
.pipe(gulp.dest('.'))
28+
);
2929

30-
gulp.task('clean', async function () {
31-
return deleteSync(['package.nls.*.json', 'vscode-wpilib*.vsix', 'out/']);
30+
gulp.task('clean', async () => {
31+
await rm('out/', { force: true, recursive: true });
32+
globSync(['package.nls.*.json', '*.vsix']).map(async (file) => await rm(file));
3233
});
3334

3435
gulp.task('build', gulp.series('clean', 'i18n-compile', 'i18n-additional'));
3536

3637
gulp.task('default', gulp.series('build'));
37-

0 commit comments

Comments
 (0)