From 897edb38087c6d03e60f64319d0ede1c8443c317 Mon Sep 17 00:00:00 2001 From: "Khang Vo (doublevkay)" Date: Sun, 5 Mar 2023 13:18:06 +0700 Subject: [PATCH 1/2] feat: scan list of target --- .gitignore | 1 + .npmignore | 3 +- README.md | 24 +++++-- cli.js | 4 +- index.js | 48 +++++++++----- package-lock.json | 164 ++++++++++++++++++++++++++++++++++++++++++++-- package.json | 7 +- utils.js | 22 +++++-- 8 files changed, 232 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index 6ad5def..8a9c2a3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules .npmrc +logs \ No newline at end of file diff --git a/.npmignore b/.npmignore index 95c6df3..5d4584e 100644 --- a/.npmignore +++ b/.npmignore @@ -1,2 +1,3 @@ .npmrc -node_modules \ No newline at end of file +node_modules +logs \ No newline at end of file diff --git a/README.md b/README.md index d334fc9..c9e420f 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ CodeQL Agent CLI is a tool that automates the process of using CodeQL, a semanti ## Features - Automated CodeQL from detect language, create database and scan. -- Scan remote target (e.g. GitHub repository) or local target (e.g. source code folder). +- Scan remote target (e.g. GitHub repository) or local target (e.g. source code folder). Support scan list of target. - Support running on Docker which prepackaged and precompiled CodeQL for running code scanning (*under development*). - Send results to Discord webhook. @@ -65,23 +65,33 @@ codeql-agent scan -h This will display help for the tool. Here are all the switches of `scan` command supports. ```console + ____ _ ___ _ _ _ + / ___|___ __| | ___ / _ \| | / \ __ _ ___ _ __ | |_ + | | / _ \ / _` |/ _ \ | | | | / _ \ / _` |/ _ \ '_ \| __| + | |__| (_) | (_| | __/ |_| | |___ / ___ \ (_| | __/ | | | |_ + \____\___/ \__,_|\___|\__\_\_____| /_/ \_\__, |\___|_| |_|\__| + |___/ + Author: doublevkay - Version: 0.3.0 + Usage: codeql-agent scan [options] -scan a source code folder or remote repository (e.g. GitHub repository) +scan a target. Target could be source code folder, remote repository (e.g. GitHub repository) or a list of target. Arguments: - target source code folder or remote repository. + target source code folder, remote repository or list of target. Examples: codeql-agent scan src/sammple - codeql-agent scan src/sammple --use-docker + codeql-agent scan targets.txt codeql-agent scan https://github.com/OWASP/NodeGoat Options: - -l, --language language of source code. Supported languages: go, java, cpp, csharp, cpp, javascript, ruby. Omitting this option to auto-detect the language. + -l, --language language of source code. Supported languages: go, java, cpp, csharp, cpp, javascript, ruby. Omitting this option to auto-detect the + language. -o, --output output folder. Default: -codeql-results - -c, --command command to create database for compiled languages, omit if the only languages requested are Python and JavaScript. This specifies the build commands needed to invoke the compiler. If - you don't set this variable, CodeQL will attempt to detect the build system automatically, using a built-in autobuilder + -c, --command command to create database for compiled languages, omit if the only languages requested are Python and JavaScript. This specifies + the build commands needed to invoke the compiler. If you don't set this variable, CodeQL will attempt to detect the build system + automatically, using a built-in autobuilder -t, --threads number of threads to use. Pass 0 to use one threads per core on the machine. Default: 1 (default: 1) --query CodeQL query to run. Default: -security-extended.qls --format output format. Default: sarif-latest (default: "sarif-latest") diff --git a/cli.js b/cli.js index 1b1f772..39dba8f 100755 --- a/cli.js +++ b/cli.js @@ -26,8 +26,8 @@ program .version(config.version); program.command('scan') - .description('scan a source code folder or remote repository (e.g. GitHub repository)') - .argument('', 'source code folder or remote repository.\n\nExamples:\n\tcodeql-agent scan src/sammple\n\tcodeql-agent scan src/sammple --use-docker\n\tcodeql-agent scan https://github.com/OWASP/NodeGoat') + .description('scan a target. Target could be source code folder, remote repository (e.g. GitHub repository) or a list of target.') + .argument('', 'source code folder, remote repository or list of target.\n\nExamples:\n\tcodeql-agent scan src/sammple\n\tcodeql-agent scan targets.txt\n\tcodeql-agent scan https://github.com/OWASP/NodeGoat') .option('-l, --language ', 'language of source code. Supported languages: go, java, cpp, csharp, cpp, javascript, ruby. Omitting this option to auto-detect the language.',) .option('-o, --output ', 'output folder. Default: -codeql-results') .option('-c, --command ', 'command to create database for compiled languages, omit if the only languages requested are Python and JavaScript. This specifies the build commands needed to invoke the compiler. If you don\'t set this variable, CodeQL will attempt to detect the build system automatically, using a built-in autobuilder') diff --git a/index.js b/index.js index edb0dae..4542c04 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ const utils = require('./utils'); const fs = require('fs'); const config = require('./config'); const path = require('path'); +const pLimit = require('p-limit'); module.exports = { scan: scanAction @@ -10,24 +11,37 @@ module.exports = { async function scanAction(sourceTarget, options) { if (options.verbose) { defaultLogger.setLevel('verbose') } + if (options.enableFileLogging) { defaultLogger.enableFileTransport() } + if (options.discordWebhook) { bugLogger.enableDiscordTransport(options.discordWebhook) } + options.enableFileLogging = undefined + options.discordWebhook = undefined if (options.useDocker) { await utils.isCommandExist('docker', defaultLogger); defaultLogger.error('Docker is not supported yet.'); return; } - if (options.enableFileLogging) { defaultLogger.enableFileTransport() } - if (options.discordWebhook) { bugLogger.enableDiscordTransport(options.discordWebhook) } await utils.isCommandExist('codeql', defaultLogger); - // Create Database - var createDbOptions = { ...options }; - createDbOptions.output = options.dbOutput; + if (fs.existsSync(sourceTarget) && fs.statSync(sourceTarget).isFile()) { + const targets = fs.readFileSync(sourceTarget, 'utf8').split(/\r?\n/); + const limit = pLimit(1); + return await Promise.all(targets.map((target) => limit(() => scanAction(target, options)))); + } var isRemoteRepository = utils.isRemoteRepository(sourceTarget); + var sourceFolderPath = ''; if (isRemoteRepository) { defaultLogger.info(`Cloning remote repository ${sourceTarget}`) sourceFolderPath = await utils.cloneRemoteRepository(sourceTarget, defaultLogger); } else sourceFolderPath = sourceTarget; + if (!fs.existsSync(sourceFolderPath)) { + defaultLogger.error(`Source folder \`${sourceFolderPath}\` does not exist.`); + return []; + } sourceFolderPath = fs.realpathSync(sourceFolderPath); defaultLogger.info(`Creating CodeQL database for ${sourceFolderPath}...`) + + // Create Database + var createDbOptions = { ...options }; + createDbOptions.output = options.dbOutput; var { args: createDbArgs, databasePath } = await utils.setupCreateDatabaseCommandArgs(sourceFolderPath, createDbOptions, defaultLogger); defaultLogger.verbose(`Options:`); for (const key in options) { @@ -35,30 +49,23 @@ async function scanAction(sourceTarget, options) { defaultLogger.verbose(`[+] ${key}: ${element}`); } createDbExitCode = await utils.executeCommand('codeql', createDbArgs, 'Create CodeQL database', defaultLogger); - defaultLogger.info(`CodeQL database created at ${databasePath}.`) - if (isRemoteRepository && options.removeRemoteRepository) { - defaultLogger.info(`Removing remote repository ${sourceFolderPath}`) - await utils.removeFolder(sourceFolderPath, defaultLogger); - } if (options.createDbOnly) { return databasePath; } + // Scan Database const outputFolderPath = options.output ? options.output : path.resolve(`${databasePath.endsWith('-codeql-database') ? databasePath.slice(0, -16) : databasePath}-codeql-results`); if (!fs.existsSync(outputFolderPath)) { fs.mkdirSync(outputFolderPath); } const languages = await utils.getDatabaseLanguages(databasePath, defaultLogger); - if (!languages) { - defaultLogger.error('Can not detect languages. Please specify the language using --language option'); - return; - } for (const language of languages) { options.language = language; languageDatabasePath = path.resolve(`${databasePath}${path.sep}${language}`); - options.output = path.resolve(outputFolderPath, `${language}-codeql-result.sarif`) + const scanOption = { ...options }; + scanOption.output = path.resolve(outputFolderPath, `${language}-codeql-result.sarif`) defaultLogger.info(`Scanning ${language} code in ${databasePath}...`) - var { args: scanArgs } = await utils.setupScanCommandArgs(languageDatabasePath, options, defaultLogger); + var { args: scanArgs } = await utils.setupScanCommandArgs(languageDatabasePath, scanOption, defaultLogger); await utils.executeCommand('codeql', scanArgs, 'Scan CodeQL database', defaultLogger); } defaultLogger.info(`CodeQL scan results saved at ${outputFolderPath}.`) @@ -78,9 +85,14 @@ async function scanAction(sourceTarget, options) { meta: alert }); } + if (isRemoteRepository && options.removeRemoteRepository) { + defaultLogger.verbose(`Removing remote repository ${sourceFolderPath}`) + utils.removeFolder(sourceFolderPath, defaultLogger); + } if (options.removeDatabase) { - defaultLogger.info(`Removing database folder ${databasePath}`) - await utils.removeFolder(databasePath, defaultLogger); + defaultLogger.verbose(`Removing database folder ${databasePath}`) + utils.removeFolder(databasePath, defaultLogger); } return alerts; } + diff --git a/package-lock.json b/package-lock.json index 45f8b7c..7882b82 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,20 +1,23 @@ { "name": "codeql-agent", - "version": "0.2.0", + "version": "0.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "codeql-agent", - "version": "0.2.0", + "version": "0.3.0", "license": "ISC", "dependencies": { "chalk": "^4.1.2", "clear": "^0.1.0", "commander": "^10.0.0", "figlet": "^1.5.2", + "fs-extra": "^11.1.0", "linguist-js": "^2.5.4", + "p-limit": "^3.1.0", "path": "^0.12.7", + "rimraf": "^4.3.0", "which": "^3.0.0", "winston": "^3.8.2", "winston-daily-rotate-file": "^4.7.1", @@ -299,8 +302,7 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/binary-extensions": { "version": "2.2.0", @@ -618,6 +620,24 @@ "node": ">= 6" } }, + "node_modules/fs-extra": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", + "integrity": "sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -632,6 +652,23 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/glob": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-9.2.1.tgz", + "integrity": "sha512-Pxxgq3W0HyA3XUvSXcFhRSs+43Jsx0ddxcFrbjxNGkL2Ak5BAUBxLqI5G6ADDeCHLfzzXFhe0b1yYcctGmytMA==", + "dependencies": { + "fs.realpath": "^1.0.0", + "minimatch": "^7.4.1", + "minipass": "^4.2.4", + "path-scurry": "^1.6.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -644,6 +681,33 @@ "node": ">= 6" } }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.2.tgz", + "integrity": "sha512-xy4q7wou3vUoC9k1xGTXc+awNdGaGVHtFUaey8tiX4H1QRc04DZ/rmDFwNm2EBsuYEhAZ6SgMmYf3InGY6OauA==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -756,6 +820,17 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, "node_modules/kuler": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", @@ -808,6 +883,14 @@ "triple-beam": "^1.3.0" } }, + "node_modules/lru-cache": { + "version": "7.18.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.1.tgz", + "integrity": "sha512-8/HcIENyQnfUTCDizRu9rrDyG6XG/21M4X7/YEGZeD76ZJilFPAUVb/2zysFf7VVO1LEjCDFyHp8pMMvozIrvg==", + "engines": { + "node": ">=12" + } + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -845,6 +928,14 @@ "node": "*" } }, + "node_modules/minipass": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.4.tgz", + "integrity": "sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==", + "engines": { + "node": ">=8" + } + }, "node_modules/moment": { "version": "2.29.4", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", @@ -977,6 +1068,20 @@ "fn.name": "1.x.x" } }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/path": { "version": "0.12.7", "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", @@ -986,6 +1091,21 @@ "util": "^0.10.3" } }, + "node_modules/path-scurry": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.6.1.tgz", + "integrity": "sha512-OW+5s+7cw6253Q4E+8qQ/u1fVvcJQCJo/VFD8pje+dbJCF1n5ZRMV2AEHbGp+5Q7jxQIYJxkHopnj6nzdGeZLA==", + "dependencies": { + "lru-cache": "^7.14.1", + "minipass": "^4.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -1037,6 +1157,23 @@ "node": ">=8.10.0" } }, + "node_modules/rimraf": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.3.0.tgz", + "integrity": "sha512-5qVDXPbByA1qSJEWMv1qAwKsoS22vVpsL2QyxCKBw4gf6XiFo1K3uRLY6uSOOBFDwnqAZtnbILqWKKlzh8bkGg==", + "dependencies": { + "glob": "^9.2.0" + }, + "bin": { + "rimraf": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1259,6 +1396,14 @@ "node": ">=12.18" } }, + "node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/util": { "version": "0.10.4", "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", @@ -1398,6 +1543,17 @@ "engines": { "node": ">=6" } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/package.json b/package.json index 641e6de..ed8c3af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codeql-agent", - "version": "0.2.2", + "version": "0.3.0", "description": "A CodeQL tool to automatically execute code scanning.", "main": "index.js", "scripts": { @@ -35,8 +35,11 @@ "clear": "^0.1.0", "commander": "^10.0.0", "figlet": "^1.5.2", + "fs-extra": "^11.1.0", "linguist-js": "^2.5.4", + "p-limit": "^3.1.0", "path": "^0.12.7", + "rimraf": "^4.3.0", "which": "^3.0.0", "winston": "^3.8.2", "winston-daily-rotate-file": "^4.7.1", @@ -47,4 +50,4 @@ "ts-node": "^10.9.1", "typescript": "^4.9.4" } -} \ No newline at end of file +} diff --git a/utils.js b/utils.js index 31125c4..ab3f49e 100644 --- a/utils.js +++ b/utils.js @@ -84,7 +84,7 @@ async function executeCommand(commandPath, commandArgs, description, logger) { result.stderr?.on('data', function (data) { if (data.includes('A fatal error occurred')) { logger.error(`${description} failed: ${data} `); - process.exit(1); + return -1; } logger.verbose(`${description}: ${data.toString().trim()}`); }); @@ -103,7 +103,7 @@ async function executeCommand(commandPath, commandArgs, description, logger) { return exitCode; } catch (err) { logger.error(`${description} failed: ${err.stderr || err} `); - process.exit(1); + return -1; } } @@ -271,13 +271,21 @@ async function cloneRemoteRepository(target, logger) { * @param {object} logger - A logger instance * @return {void} */ -async function removeFolder(folderPath, logger) { +function removeFolder(folderPath, logger) { const fs = require('fs'); + // check if exists try { - await fs.rmSync(folderPath, { recursive: true, force: true }); - } - catch (error) { - logger.warning(`${error.message}`); + if (fs.existsSync(folderPath)) { + fs.rm(folderPath, { recursive: true, force: true, maxRetries: 10 }, (err) => { + if (err) { + logger.warn(`Failed to remove folder ${folderPath}.`); + } + }); + } + + + } catch (error) { + logger.warn(`Failed to remove folder ${folderPath}.`); } } From fbb6540c72e3e993a002a7f6c5b6e32e10036bea Mon Sep 17 00:00:00 2001 From: "Khang Vo (doublevkay)" Date: Sun, 5 Mar 2023 13:20:55 +0700 Subject: [PATCH 2/2] chore: remove unuse package --- package-lock.json | 134 +--------------------------------------------- package.json | 2 - 2 files changed, 2 insertions(+), 134 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7882b82..cfdda57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,11 +13,9 @@ "clear": "^0.1.0", "commander": "^10.0.0", "figlet": "^1.5.2", - "fs-extra": "^11.1.0", "linguist-js": "^2.5.4", "p-limit": "^3.1.0", "path": "^0.12.7", - "rimraf": "^4.3.0", "which": "^3.0.0", "winston": "^3.8.2", "winston-daily-rotate-file": "^4.7.1", @@ -302,7 +300,8 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "node_modules/binary-extensions": { "version": "2.2.0", @@ -620,24 +619,6 @@ "node": ">= 6" } }, - "node_modules/fs-extra": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", - "integrity": "sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, "node_modules/fsevents": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", @@ -652,23 +633,6 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/glob": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-9.2.1.tgz", - "integrity": "sha512-Pxxgq3W0HyA3XUvSXcFhRSs+43Jsx0ddxcFrbjxNGkL2Ak5BAUBxLqI5G6ADDeCHLfzzXFhe0b1yYcctGmytMA==", - "dependencies": { - "fs.realpath": "^1.0.0", - "minimatch": "^7.4.1", - "minipass": "^4.2.4", - "path-scurry": "^1.6.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -681,33 +645,6 @@ "node": ">= 6" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-7.4.2.tgz", - "integrity": "sha512-xy4q7wou3vUoC9k1xGTXc+awNdGaGVHtFUaey8tiX4H1QRc04DZ/rmDFwNm2EBsuYEhAZ6SgMmYf3InGY6OauA==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -820,17 +757,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/kuler": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", @@ -883,14 +809,6 @@ "triple-beam": "^1.3.0" } }, - "node_modules/lru-cache": { - "version": "7.18.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.1.tgz", - "integrity": "sha512-8/HcIENyQnfUTCDizRu9rrDyG6XG/21M4X7/YEGZeD76ZJilFPAUVb/2zysFf7VVO1LEjCDFyHp8pMMvozIrvg==", - "engines": { - "node": ">=12" - } - }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -928,14 +846,6 @@ "node": "*" } }, - "node_modules/minipass": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.4.tgz", - "integrity": "sha512-lwycX3cBMTvcejsHITUgYj6Gy6A7Nh4Q6h9NP4sTHY1ccJlC7yKzDmiShEHsJ16Jf1nKGDEaiHxiltsJEvk0nQ==", - "engines": { - "node": ">=8" - } - }, "node_modules/moment": { "version": "2.29.4", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", @@ -1091,21 +1001,6 @@ "util": "^0.10.3" } }, - "node_modules/path-scurry": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.6.1.tgz", - "integrity": "sha512-OW+5s+7cw6253Q4E+8qQ/u1fVvcJQCJo/VFD8pje+dbJCF1n5ZRMV2AEHbGp+5Q7jxQIYJxkHopnj6nzdGeZLA==", - "dependencies": { - "lru-cache": "^7.14.1", - "minipass": "^4.0.2" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -1157,23 +1052,6 @@ "node": ">=8.10.0" } }, - "node_modules/rimraf": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.3.0.tgz", - "integrity": "sha512-5qVDXPbByA1qSJEWMv1qAwKsoS22vVpsL2QyxCKBw4gf6XiFo1K3uRLY6uSOOBFDwnqAZtnbILqWKKlzh8bkGg==", - "dependencies": { - "glob": "^9.2.0" - }, - "bin": { - "rimraf": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1396,14 +1274,6 @@ "node": ">=12.18" } }, - "node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/util": { "version": "0.10.4", "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", diff --git a/package.json b/package.json index ed8c3af..d50107d 100644 --- a/package.json +++ b/package.json @@ -35,11 +35,9 @@ "clear": "^0.1.0", "commander": "^10.0.0", "figlet": "^1.5.2", - "fs-extra": "^11.1.0", "linguist-js": "^2.5.4", "p-limit": "^3.1.0", "path": "^0.12.7", - "rimraf": "^4.3.0", "which": "^3.0.0", "winston": "^3.8.2", "winston-daily-rotate-file": "^4.7.1",