diff --git a/gulpfile.js b/gulpfile.js index 0656eca08e..3e1a181291 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,9 +5,10 @@ const path = require('path'); const fs = require('fs'); const fse = require('fs-extra'); const child_process = require('child_process'); +const { styleText } = require('node:util'); // var gulp = require('gulp'); -const gutil = require('gulp-util'); +const minimist = require('minimist'); const Less = require('gulp-less'); const Sass = require('gulp-sass')(require('sass')); const header = require('gulp-header'); @@ -22,9 +23,11 @@ const Crawler = require('simplecrawler'); const ncp = require('ncp'); const nextversion = require('./tools/bin/nextversion'); -const util = require('./tools/bin/util'); +const { listdirsSync, srcTocfileName, logger } = require('./tools/bin/util'); const gulp = require('gulp'); +const argv = minimist(process.argv.slice(2)); + // constants const ROOT_DIR = '.'; const CONFIG_DIR = 'conf'; @@ -66,23 +69,23 @@ const WATCH_INTERVAL = 1000; // in milliseconds const VERSION_VAR_NAME = 'latest_docs_version'; const LATEST_DOCS_VERSION = fs.readFileSync(VERSION_FILE, 'utf-8').trim(); const NEXT_DOCS_VERSION = nextversion.getNextVersion(LATEST_DOCS_VERSION); -const LANGUAGES = util.listdirsSync(DOCS_DIR); +const LANGUAGES = listdirsSync(DOCS_DIR); const PROD_BY_DEFAULT = false; // compute/get/set/adjust passed options -gutil.env.prod = gutil.env.prod || PROD_BY_DEFAULT; -gutil.env.dev = !gutil.env.prod; -gutil.env.outDir = gutil.env.prod ? PROD_DIR : DEV_DIR; +argv.prod = argv.prod || PROD_BY_DEFAULT; +argv.dev = !argv.prod; +argv.outDir = argv.prod ? PROD_DIR : DEV_DIR; // check for errors -if (gutil.env.prod && gutil.env.nodocs) { +if (argv.prod && argv.nodocs) { fatal("can't ignore docs when doing a production build"); } // helpers function fatal (message) { - gutil.log(gutil.colors.red('ERROR') + ': ' + message); + logger(styleText(['red'], 'ERROR') + ': ' + message); process.exit(1); } @@ -119,14 +122,14 @@ function getJekyllConfigs () { let configs = BASE_CONFIGS; // add build-specific config files - if (gutil.env.prod) { + if (argv.prod) { configs = configs.concat(PROD_CONFIGS); } else { configs = configs.concat(DEV_CONFIGS); } // add a special exclude file if "nodocs" was specified - if (gutil.env.nodocs) { + if (argv.nodocs) { configs = configs.concat(NODOCS_CONFIG_FILE); } @@ -136,7 +139,7 @@ function getJekyllConfigs () { function jekyllBuild (done) { const bundle = getBundleExecutable(); const configs = getJekyllConfigs(); - let flags = gutil.env.prod ? PROD_FLAGS : DEV_FLAGS; + let flags = argv.prod ? PROD_FLAGS : DEV_FLAGS; flags = flags.concat(['--config', configs.join(',')]); @@ -166,9 +169,9 @@ function copyDocsVersion (oldVersion, newVersion, cb) { LANGUAGES.forEach(function (languageName) { // get files to copy const oldVersionDocs = path.join(DOCS_DIR, languageName, oldVersion); - const oldVersionToc = path.join(TOC_DIR, util.srcTocfileName(languageName, oldVersion)); + const oldVersionToc = path.join(TOC_DIR, srcTocfileName(languageName, oldVersion)); const newVersionDocs = path.join(DOCS_DIR, languageName, newVersion); - const newVersionToc = path.join(TOC_DIR, util.srcTocfileName(languageName, newVersion)); + const newVersionToc = path.join(TOC_DIR, srcTocfileName(languageName, newVersion)); const copyOptions = { stopOnErr: true @@ -187,50 +190,49 @@ function copyDocsVersion (oldVersion, newVersion, cb) { // tasks module.exports.help = module.exports.default = function help () { - gutil.log(''); - gutil.log('Tasks:'); - gutil.log(''); - gutil.log(' build same as configs + data + styles + jekyll'); - gutil.log(' jekyll build with jekyll'); - gutil.log(' regen same as jekyll + reload'); - gutil.log(' serve build the site and open it in a browser'); - gutil.log(' reload refresh the browser'); - gutil.log(''); - gutil.log(' newversion create ' + NEXT_DOCS_VERSION + ' docs from dev docs'); - gutil.log(' snapshot copy dev docs to ' + LATEST_DOCS_VERSION + ' docs'); - gutil.log(''); - gutil.log(' configs run all the below tasks'); - gutil.log(' defaults create ' + DEFAULTS_CONFIG_FILE); - gutil.log(' version create ' + VERSION_CONFIG_FILE); - gutil.log(''); - gutil.log(' data run all the below tasks'); - gutil.log(' docs-versions create ' + DOCS_VERSION_FILE); - gutil.log(' pages-dict create ' + ALL_PAGES_FILE); - gutil.log(' toc create all generated ToC files in ' + TOC_DIR); - gutil.log(' fetch download docs specified in ' + FETCH_CONFIG); - gutil.log(''); - gutil.log(' styles run all the below tasks'); - gutil.log(' less compile all .less files'); - gutil.log(' sass compile all .scss files'); - gutil.log(' css copy over all .css files'); - gutil.log(''); - gutil.log(' watch serve + then watch all source files and regenerate as necessary'); - gutil.log(' link-bugs replace CB-XXXX references with nice links'); - gutil.log(''); - gutil.log(' help show this text'); - gutil.log(' clean remove all generated files and folders'); - gutil.log(''); - gutil.log('Arguments:'); - gutil.log(" --nodocs don't generate docs"); - gutil.log(' --prod build for production; without it, will build dev instead'); - gutil.log(''); + logger(''); + logger('Tasks:'); + logger(''); + logger(' build same as configs + data + styles + jekyll'); + logger(' jekyll build with jekyll'); + logger(' regen same as jekyll + reload'); + logger(' serve build the site and open it in a browser'); + logger(' reload refresh the browser'); + logger(''); + logger(' newversion create ' + NEXT_DOCS_VERSION + ' docs from dev docs'); + logger(' snapshot copy dev docs to ' + LATEST_DOCS_VERSION + ' docs'); + logger(''); + logger(' configs run all the below tasks'); + logger(' defaults create ' + DEFAULTS_CONFIG_FILE); + logger(' version create ' + VERSION_CONFIG_FILE); + logger(''); + logger(' data run all the below tasks'); + logger(' docs-versions create ' + DOCS_VERSION_FILE); + logger(' pages-dict create ' + ALL_PAGES_FILE); + logger(' toc create all generated ToC files in ' + TOC_DIR); + logger(' fetch download docs specified in ' + FETCH_CONFIG); + logger(''); + logger(' styles run all the below tasks'); + logger(' less compile all .less files'); + logger(' sass compile all .scss files'); + logger(' css copy over all .css files'); + logger(''); + logger(' watch serve + then watch all source files and regenerate as necessary'); + logger(' link-bugs replace CB-XXXX references with nice links'); + logger(''); + logger(' help show this text'); + logger(' clean remove all generated files and folders'); + logger(''); + logger('Arguments:'); + logger(" --nodocs don't generate docs"); + logger(' --prod build for production; without it, will build dev instead'); + logger(''); }; const fetch = module.exports.fetch = function fetch (done) { // skip fetching if --nofetch was passed - if (gutil.env.nofetch) { - gutil.log(gutil.colors.yellow( - 'Skipping fetching external docs.')); + if (argv.nofetch) { + logger(styleText(['yellow'], 'Skipping fetching external docs.')); done(); return; } @@ -293,7 +295,7 @@ const less = module.exports.less = function less () { .pipe(Less()) .pipe(header(YAML_FRONT_MATTER)) .pipe(gulp.dest(CSS_OUT_DIR)) - .pipe(gulp.dest(CSS_OUT_DIR.replace(SOURCE_DIR, gutil.env.outDir))) + .pipe(gulp.dest(CSS_OUT_DIR.replace(SOURCE_DIR, argv.outDir))) .pipe(browsersync.reload({ stream: true })); }; @@ -301,7 +303,7 @@ const css = module.exports.css = function css () { return gulp.src(path.join(CSS_SRC_DIR, '**', '*.css')) .pipe(header(YAML_FRONT_MATTER)) .pipe(gulp.dest(CSS_OUT_DIR)) - .pipe(gulp.dest(CSS_OUT_DIR.replace(SOURCE_DIR, gutil.env.outDir))) + .pipe(gulp.dest(CSS_OUT_DIR.replace(SOURCE_DIR, argv.outDir))) .pipe(browsersync.reload({ stream: true })); }; @@ -310,7 +312,7 @@ const sass = module.exports.sass = function sass () { .pipe(Sass().on('error', Sass.logError)) .pipe(header(YAML_FRONT_MATTER)) .pipe(gulp.dest(CSS_OUT_DIR)) - .pipe(gulp.dest(CSS_OUT_DIR.replace(SOURCE_DIR, gutil.env.outDir))) + .pipe(gulp.dest(CSS_OUT_DIR.replace(SOURCE_DIR, argv.outDir))) .pipe(browsersync.reload({ stream: true })); }; @@ -331,14 +333,14 @@ const serve = module.exports.serve = gulp.series(build, function serve () { const route = {}; // set site root for browsersync - if (gutil.env.prod) { - route[BASE_URL] = gutil.env.outDir; + if (argv.prod) { + route[BASE_URL] = argv.outDir; } browsersync({ notify: true, server: { - baseDir: gutil.env.outDir, + baseDir: argv.outDir, routes: route } }); @@ -412,11 +414,11 @@ module.exports.checklinks = function checkLinks (done) { const crawler = new Crawler('http://localhost:3000/'); crawler.on('fetch404', function (queueItem, response) { - gutil.log( + logger( 'Resource not found linked from ' + queueItem.referrer + ' to', queueItem.url ); - gutil.log('Status code: ' + response.statusCode); + logger('Status code: ' + response.statusCode); }).on('complete', function () { done(); }); diff --git a/package-lock.json b/package-lock.json index 37b434e988..1b1398acc5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,8 +29,8 @@ "gulp-less": "^5.0.0", "gulp-rename": "^2.0.0", "gulp-sass": "^5.0.0", - "gulp-util": "^3.0.8", "js-yaml": "^4.1.0", + "minimist": "^1.2.8", "ncp": "^2.0.0", "optimist": "^0.6.1", "sass": "^1.62.0", @@ -987,15 +987,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array-differ": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", - "integrity": "sha512-LeZY+DZDRnvP7eMuQ6LHfCzUGxAAIViUBliK24P3hWXL6y4SortgR6Nim6xrkfSLlmH0+k+9NYNwVC2s53ZrYQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/array-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", @@ -1034,15 +1025,6 @@ "node": ">=0.10.0" } }, - "node_modules/array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/array.prototype.findlastindex": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", @@ -1262,15 +1244,6 @@ "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", "dev": true }, - "node_modules/beeper": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz", - "integrity": "sha512-3vqtKL1N45I5dV0RdssXZG7X6pCqQrWPNOlBPZPrd+QkE2HEhR57Z04m0KtpbsZH73j+a3F8UD1TQnn+ExTvIA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -1647,15 +1620,6 @@ "node": ">=12" } }, - "node_modules/clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, "node_modules/clone-buffer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", @@ -1665,12 +1629,6 @@ "node": ">= 0.10" } }, - "node_modules/clone-stats": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", - "integrity": "sha512-dhUqc57gSMCo6TX85FLfe51eC/s+Im2MLkAgJwfaRRexR2tA4dd3eLEW4L6efzHc2iNorrRRXITifnDLlRrhaA==", - "dev": true - }, "node_modules/cloneable-readable": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", @@ -1929,15 +1887,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/dateformat": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", - "integrity": "sha512-GODcnWq3YGoTnygPfi02ygEiRxqUxpJwuRHjdhJYuxpcZmDq4rjBiXYmbCCzStxo176ixfLT6i4NPwQooRySnw==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -2103,39 +2052,6 @@ "domelementtype": "1" } }, - "node_modules/duplexer2": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", - "integrity": "sha512-+AWBwjGadtksxjOQSFDhPNQbed7icNXApT4+2BNpsXzcCBiInq2H9XW0O8sfHFaPmnQRs7cg/P0fAr2IWQSW0g==", - "dev": true, - "dependencies": { - "readable-stream": "~1.1.9" - } - }, - "node_modules/duplexer2/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", - "dev": true - }, - "node_modules/duplexer2/node_modules/readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/duplexer2/node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", - "dev": true - }, "node_modules/each-props": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/each-props/-/each-props-3.0.0.tgz", @@ -3632,178 +3548,6 @@ "node": ">=12" } }, - "node_modules/gulp-util": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz", - "integrity": "sha512-q5oWPc12lwSFS9h/4VIjG+1NuNDlJ48ywV2JKItY4Ycc/n1fXJeYPVQsfu5ZrhQi7FGSDBalwUCLar/GyHXKGw==", - "deprecated": "gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5", - "dev": true, - "dependencies": { - "array-differ": "^1.0.0", - "array-uniq": "^1.0.2", - "beeper": "^1.0.0", - "chalk": "^1.0.0", - "dateformat": "^2.0.0", - "fancy-log": "^1.1.0", - "gulplog": "^1.0.0", - "has-gulplog": "^0.1.0", - "lodash._reescape": "^3.0.0", - "lodash._reevaluate": "^3.0.0", - "lodash._reinterpolate": "^3.0.0", - "lodash.template": "^3.0.0", - "minimist": "^1.1.0", - "multipipe": "^0.1.2", - "object-assign": "^3.0.0", - "replace-ext": "0.0.1", - "through2": "^2.0.0", - "vinyl": "^0.5.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/gulp-util/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-util/node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-util/node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-util/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/gulp-util/node_modules/glogg": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", - "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", - "dev": true, - "dependencies": { - "sparkles": "^1.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/gulp-util/node_modules/gulplog": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", - "integrity": "sha512-hm6N8nrm3Y08jXie48jsC55eCZz9mnb4OirAStEk2deqeyhXU3C1otDVh+ccttMuc1sBi6RX6ZJ720hs9RCvgw==", - "dev": true, - "dependencies": { - "glogg": "^1.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/gulp-util/node_modules/lodash.template": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz", - "integrity": "sha512-0B4Y53I0OgHUJkt+7RmlDFWKjVAI/YUpWNiL9GQz5ORDr4ttgfQGo+phBWKFLJbBdtOwgMuUkdOHOnPg45jKmQ==", - "dev": true, - "dependencies": { - "lodash._basecopy": "^3.0.0", - "lodash._basetostring": "^3.0.0", - "lodash._basevalues": "^3.0.0", - "lodash._isiterateecall": "^3.0.0", - "lodash._reinterpolate": "^3.0.0", - "lodash.escape": "^3.0.0", - "lodash.keys": "^3.0.0", - "lodash.restparam": "^3.0.0", - "lodash.templatesettings": "^3.0.0" - } - }, - "node_modules/gulp-util/node_modules/lodash.templatesettings": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz", - "integrity": "sha512-TcrlEr31tDYnWkHFWDCV3dHYroKEXpJZ2YJYvJdhN+y4AkWMDZ5I4I8XDtUKqSAyG81N7w+I1mFEJtcED+tGqQ==", - "dev": true, - "dependencies": { - "lodash._reinterpolate": "^3.0.0", - "lodash.escape": "^3.0.0" - } - }, - "node_modules/gulp-util/node_modules/object-assign": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "integrity": "sha512-jHP15vXVGeVh1HuaA2wY6lxk+whK/x4KBG88VXeRma7CCun7iGD5qPc4eYykQ9sdQvg8jkwFKsSxHln2ybW3xQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-util/node_modules/replace-ext": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", - "integrity": "sha512-AFBWBy9EVRTa/LhEcG8QDP3FvpwZqmvN2QFDuJswFeaVhWnZMp8q3E6Zd90SR04PlIwfGdyVjNyLPyen/ek5CQ==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/gulp-util/node_modules/sparkles": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", - "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/gulp-util/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/gulp-util/node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/gulplog": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-2.2.0.tgz", @@ -3816,27 +3560,6 @@ "node": ">= 10.13.0" } }, - "node_modules/has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/has-ansi/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -3855,27 +3578,6 @@ "node": ">=8" } }, - "node_modules/has-gulplog": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", - "integrity": "sha512-+F4GzLjwHNNDEAJW2DC1xXfEoPkRDmUdJ7CBYw4MpqtDwOnqdImJl7GWlpqx+Wko6//J8uKTnIe4wZSv7yCqmw==", - "dev": true, - "dependencies": { - "sparkles": "^1.0.0" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/has-gulplog/node_modules/sparkles": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", - "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/has-property-descriptors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", @@ -4765,116 +4467,30 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "node_modules/lodash._basecopy": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha512-rFR6Vpm4HeCK1WPGvjZSJ+7yik8d8PVUdCJx5rT2pogG4Ve/2ZS7kfmO5l5T2o5V2mqlNIfSF5MZlr1+xOoYQQ==", - "dev": true - }, - "node_modules/lodash._basetostring": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", - "integrity": "sha512-mTzAr1aNAv/i7W43vOR/uD/aJ4ngbtsRaCubp2BfZhlGU/eORUjg/7F6X0orNMdv33JOrdgGybtvMN/po3EWrA==", - "dev": true - }, - "node_modules/lodash._basevalues": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz", - "integrity": "sha512-H94wl5P13uEqlCg7OcNNhMQ8KvWSIyqXzOPusRgHC9DK3o54P6P3xtbXlVbRABG4q5gSmp7EDdJ0MSuW9HX6Mg==", - "dev": true - }, - "node_modules/lodash._getnative": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha512-RrL9VxMEPyDMHOd9uFbvMe8X55X16/cGM5IgOKgRElQZutpX89iS6vwl64duTV1/16w5JY7tuFNXqoekmh1EmA==", - "dev": true - }, - "node_modules/lodash._isiterateecall": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha512-De+ZbrMu6eThFti/CSzhRvTKMgQToLxbij58LMfM8JnYDNSOjkjTCIaa8ixglOeGh2nyPlakbt5bJWJ7gvpYlQ==", - "dev": true - }, - "node_modules/lodash._reescape": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz", - "integrity": "sha512-Sjlavm5y+FUVIF3vF3B75GyXrzsfYV8Dlv3L4mEpuB9leg8N6yf/7rU06iLPx9fY0Mv3khVp9p7Dx0mGV6V5OQ==", - "dev": true - }, - "node_modules/lodash._reevaluate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz", - "integrity": "sha512-OrPwdDc65iJiBeUe5n/LIjd7Viy99bKwDdk7Z5ljfZg0uFRFlfQaCy9tZ4YMAag9WAZmlVpe1iZrkIMMSMHD3w==", - "dev": true - }, "node_modules/lodash._reinterpolate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", "integrity": "sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==", "dev": true }, - "node_modules/lodash._root": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", - "integrity": "sha512-O0pWuFSK6x4EXhM1dhZ8gchNtG7JMqBtrHdoUFUWXD7dJnNSUze1GuyQr5sOs0aCvgGeI3o/OJW8f4ca7FDxmQ==", - "dev": true - }, "node_modules/lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", "dev": true }, - "node_modules/lodash.escape": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", - "integrity": "sha512-n1PZMXgaaDWZDSvuNZ/8XOcYO2hOKDqZel5adtR30VKQAtoWs/5AOeFA0vPV8moiPzlqe7F4cP2tzpFewQyelQ==", - "dev": true, - "dependencies": { - "lodash._root": "^3.0.0" - } - }, - "node_modules/lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==", - "dev": true - }, - "node_modules/lodash.isarray": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha512-JwObCrNJuT0Nnbuecmqr5DgtuBppuCvGD9lxjFpAzwnVtdGoDQ1zig+5W8k5/6Gcn0gZ3936HDAlGd28i7sOGQ==", - "dev": true - }, "node_modules/lodash.isfinite": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz", "integrity": "sha512-7FGG40uhC8Mm633uKW1r58aElFlBlxCrg9JfSi3P6aYiWmfiWF0PgMd86ZUsxE5GwWPdHoS2+48bwTh2VPkIQA==", "dev": true }, - "node_modules/lodash.keys": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "integrity": "sha512-CuBsapFjcubOGMn3VD+24HOAPxM79tH+V6ivJL3CHYjtrawauDJHUk//Yew9Hvc6e9rbCrURGk8z6PC+8WJBfQ==", - "dev": true, - "dependencies": { - "lodash._getnative": "^3.0.0", - "lodash.isarguments": "^3.0.0", - "lodash.isarray": "^3.0.0" - } - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.restparam": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", - "integrity": "sha512-L4/arjjuq4noiUJpt3yS6KIKDtJwNe2fIYgMqyYYKoeIfV1iEqvPwhCx23o+R9dzouGihDAPN1dTIRWa7zk8tw==", - "dev": true - }, "node_modules/lodash.template": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", @@ -5016,6 +4632,7 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5032,15 +4649,6 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "node_modules/multipipe": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", - "integrity": "sha512-7ZxrUybYv9NonoXgwoOqtStIu18D1c3eFZj27hqgf5kBrBF8Q+tE8V0MW8dKM5QLkQPh1JhhbKgHLY9kifov4Q==", - "dev": true, - "dependencies": { - "duplexer2": "0.0.2" - } - }, "node_modules/mute-stdout": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-2.0.0.tgz", @@ -7156,20 +6764,6 @@ "node": ">= 0.8" } }, - "node_modules/vinyl": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", - "integrity": "sha512-P5zdf3WB9uzr7IFoVQ2wZTmUwHL8cMZWJGzLBNCHNZ3NB6HTMsYABtt7z8tAGIINLXyAob9B9a1yzVGMFOYKEA==", - "dev": true, - "dependencies": { - "clone": "^1.0.0", - "clone-stats": "^0.0.1", - "replace-ext": "0.0.1" - }, - "engines": { - "node": ">= 0.9" - } - }, "node_modules/vinyl-buffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/vinyl-buffer/-/vinyl-buffer-1.0.1.tgz", @@ -7408,15 +7002,6 @@ "node": ">=0.10.0" } }, - "node_modules/vinyl/node_modules/replace-ext": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", - "integrity": "sha512-AFBWBy9EVRTa/LhEcG8QDP3FvpwZqmvN2QFDuJswFeaVhWnZMp8q3E6Zd90SR04PlIwfGdyVjNyLPyen/ek5CQ==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index f23dcb87e3..779d86a091 100644 --- a/package.json +++ b/package.json @@ -37,8 +37,8 @@ "gulp-less": "^5.0.0", "gulp-rename": "^2.0.0", "gulp-sass": "^5.0.0", - "gulp-util": "^3.0.8", "js-yaml": "^4.1.0", + "minimist": "^1.2.8", "ncp": "^2.0.0", "optimist": "^0.6.1", "sass": "^1.62.0", diff --git a/tools/bin/util.js b/tools/bin/util.js index 285817be33..586fa57a4a 100644 --- a/tools/bin/util.js +++ b/tools/bin/util.js @@ -17,6 +17,8 @@ 'use strict'; +const { styleText } = require('node:util'); + module.exports = (function () { const fs = require('fs'); const path = require('path'); @@ -103,6 +105,18 @@ module.exports = (function () { return '# WARNING: This file is generated by ' + path.basename(scriptName); } + function logger (msg) { + const date = new Date(); + const ts = date.toLocaleTimeString('en-US', { + hour12: false, + hour: '2-digit', + minute: '2-digit', + second: '2-digit' + }); + + console.log(`[${styleText(['magenta'], ts)}] ${msg}`); + } + return { stripFrontMatter, getFrontMatterString, @@ -113,6 +127,7 @@ module.exports = (function () { srcTocfileName, genTocfileName, mergeObjects, - generatedBy + generatedBy, + logger }; })();