Skip to content

Commit 7e43524

Browse files
committed
switch to ESM6
and update some dependencies
1 parent a876d13 commit 7e43524

3 files changed

Lines changed: 564 additions & 1200 deletions

File tree

gulpfile.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
const gulp = require('gulp');
2-
const zip = require('gulp-zip');
3-
const replace = require('gulp-replace');
4-
const newer = require('gulp-newer');
5-
const exist = require('@existdb/gulp-exist');
6-
const dateformat = require('dateformat');
7-
const fs = require('fs');
8-
9-
const packageJson = require('./package.json');
10-
const existConfig = require('./existConfig.json');
1+
import gulp from 'gulp';
2+
import zip from 'gulp-zip';
3+
import replace from 'gulp-replace';
4+
import newer from 'gulp-newer';
5+
import exist from '@existdb/gulp-exist';
6+
import dateformat from 'dateformat';
7+
import fs from 'fs';
8+
import { readFileSync } from 'fs';
9+
import git from 'git-rev-sync';
10+
import { deleteAsync } from 'del';
11+
import { exec } from 'child_process';
12+
13+
const packageJson = JSON.parse(readFileSync('./package.json', 'utf8'));
14+
const existConfig = JSON.parse(readFileSync('./existConfig.json', 'utf8'));
1115
const existClient = exist.createClient(existConfig);
1216

13-
const git = require('git-rev-sync');
14-
const del = require("del");
1517

1618
//handles xqueries
1719
gulp.task('xql', function(){
@@ -85,7 +87,6 @@ gulp.task('openapi_v1', function(){
8587

8688
// bundles the v2 openapi file using redocly and saves it to the build folder
8789
gulp.task('openapi_v2', function (done) {
88-
const { exec } = require('child_process');
8990

9091
// create the target folder
9192
const outputDir = './build';
@@ -106,7 +107,7 @@ gulp.task('openapi_v2', function (done) {
106107

107108
//empty build folder
108109
gulp.task('del', function() {
109-
return del(['./build/**/*','./dist/' + packageJson.name + '-' + getPackageJsonVersion() + '.xar']);
110+
return deleteAsync(['./build/**/*','./dist/' + packageJson.name + '-' + getPackageJsonVersion() + '.xar']);
110111
});
111112

112113
/**

0 commit comments

Comments
 (0)