diff --git a/bin/build-module.js b/bin/build-module.js index d77952d6d5..edd10dcf2b 100755 --- a/bin/build-module.js +++ b/bin/build-module.js @@ -14,7 +14,7 @@ var rollupPlugins = require('./rollupPlugins'); var path = require('path'); var denodeify = require('denodeify'); -const { mkdirSync } = require('fs'); +const { mkdir } = require('node:fs/promises'); var rimraf = denodeify(require('rimraf')); var builtInModules = require('builtin-modules'); var fs = require('fs'); @@ -67,7 +67,8 @@ function buildModule(filepath) { return Promise.resolve().then(function () { return rimraf(path.resolve(filepath, 'lib')); }).then(function () { - mkdirSync(path.resolve(filepath, 'lib'), { recursive:true }); + return mkdir(path.resolve(filepath, 'lib'), { recursive:true }); + }).then(function () { return all(versions.map(function (isBrowser) { return rollup({ input: path.resolve(filepath, './src/index.js'), diff --git a/bin/build-pouchdb.js b/bin/build-pouchdb.js index a81cfed214..94fbfddc80 100755 --- a/bin/build-pouchdb.js +++ b/bin/build-pouchdb.js @@ -12,7 +12,7 @@ var denodeify = require('denodeify'); var rollup = require('rollup'); var rollupPlugins = require('./rollupPlugins'); var rimraf = denodeify(require('rimraf')); -const { mkdirSync } = require('fs'); +const { mkdir } = require('node:fs/promises'); var all = Promise.all.bind(Promise); var buildUtils = require('./build-utils'); var addPath = buildUtils.addPath; @@ -150,7 +150,9 @@ var rimrafMkdirp = function (...args) { return all(args.map(function (otherPath) { return rimraf(addPath('pouchdb', otherPath)); })).then(function () { - args.map(otherPath => mkdirSync(addPath('pouchdb', otherPath), { recursive:true })); + return all(args.map(function (otherPath) { + return mkdir(addPath('pouchdb', otherPath), { recursive:true }); + })); }); }; @@ -163,8 +165,8 @@ var doAll = function (...args) { }; function doBuildNode() { - mkdirSync(addPath('pouchdb', 'lib/plugins'), { recursive:true }); - return buildForNode(); + return mkdir(addPath('pouchdb', 'lib/plugins'), { recursive:true }) + .then(buildForNode); } function doBuildAll() {