From 8c91ba83e25edce4fa576e797296d24c567b9b15 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 22 Apr 2021 15:04:59 +0100 Subject: [PATCH 1/6] Introduce our own toolcache implementation for use by the runnner --- lib/actions-util.js | 7 + lib/actions-util.js.map | 2 +- lib/analyze.js | 3 +- lib/analyze.js.map | 2 +- lib/analyze.test.js | 1 + lib/analyze.test.js.map | 2 +- lib/codeql.js | 14 +- lib/codeql.js.map | 2 +- lib/codeql.test.js | 32 +- lib/codeql.test.js.map | 2 +- lib/init-action.js | 2 +- lib/init-action.js.map | 2 +- lib/init.js | 4 +- lib/init.js.map | 2 +- lib/logging.js | 1 + lib/logging.js.map | 2 +- lib/runner.js | 5 +- lib/runner.js.map | 2 +- lib/testing-utils.js | 7 + lib/testing-utils.js.map | 2 +- lib/toolcache.js | 261 ++++++++++++++++ lib/toolcache.js.map | 1 + lib/util.js | 16 - lib/util.js.map | 2 +- node_modules/@actions/io/LICENSE.md | 2 + node_modules/@actions/io/lib/io-util.js | 11 +- node_modules/@actions/io/lib/io-util.js.map | 2 +- node_modules/@actions/io/lib/io.d.ts | 6 + node_modules/@actions/io/lib/io.js | 112 ++++--- node_modules/@actions/io/lib/io.js.map | 2 +- node_modules/@actions/io/package.json | 12 +- package-lock.json | 6 +- package.json | 1 + queries/unguarded-action-lib.ql | 4 +- src/actions-util.ts | 7 + src/analyze.test.ts | 4 +- src/analyze.ts | 3 +- src/codeql.test.ts | 24 +- src/codeql.ts | 38 ++- src/init-action.ts | 1 + src/init.ts | 2 + src/logging.ts | 3 + src/runner.ts | 6 +- src/testing-utils.ts | 7 + src/toolcache.ts | 315 ++++++++++++++++++++ src/util.ts | 16 - 46 files changed, 806 insertions(+), 154 deletions(-) create mode 100644 lib/toolcache.js create mode 100644 lib/toolcache.js.map create mode 100644 src/toolcache.ts diff --git a/lib/actions-util.js b/lib/actions-util.js index 603f08f7f1..96e86d20cb 100644 --- a/lib/actions-util.js +++ b/lib/actions-util.js @@ -58,6 +58,13 @@ function getTemporaryDirectory() { : getRequiredEnvParam("RUNNER_TEMP"); } exports.getTemporaryDirectory = getTemporaryDirectory; +function getToolCacheDirectory() { + const value = process.env["CODEQL_ACTION_TOOL_CACHE"]; + return value !== undefined && value !== "" + ? value + : getRequiredEnvParam("RUNNER_TOOL_CACHE"); +} +exports.getToolCacheDirectory = getToolCacheDirectory; /** * Ensures all required environment variables are set in the context of a local run. */ diff --git a/lib/actions-util.js.map b/lib/actions-util.js.map index 93143a6ea7..e47aae4f0f 100644 --- a/lib/actions-util.js.map +++ b/lib/actions-util.js.map @@ -1 +1 @@ -{"version":3,"file":"actions-util.js","sourceRoot":"","sources":["../src/actions-util.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,oDAAsC;AACtC,yEAA2D;AAC3D,kEAAoD;AACpD,8CAAgC;AAEhC,kDAAoC;AACpC,gEAAkD;AAClD,iCAAuD;AAEvD;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AACjD,CAAC;AAFD,4CAEC;AAED;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,IAAY;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9C,CAAC;AAHD,4CAGC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CAAC,SAAiB;IACnD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QAC7C,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,mCAAmC,C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/analyze.js @@ -10,7 +10,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); const fs = __importStar(require("fs")); const path = __importStar(require("path")); const toolrunner = __importStar(require("@actions/exec/lib/toolrunner")); -const actionsUtil = __importStar(require("./actions-util")); const analysisPaths = __importStar(require("./analysis-paths")); const codeql_1 = require("./codeql"); const languages_1 = require("./languages"); @@ -92,7 +91,7 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag, new Date().getTime() - startTimeBuliltIn; } const startTimeCustom = new Date().getTime(); - const temporarySarifDir = actionsUtil.getTemporaryDirectory(); + const temporarySarifDir = config.tempDir; const temporarySarifFiles = []; for (let i = 0; i < queries["custom"].length; ++i) { if (queries["custom"][i].queries.length > 0) { diff --git a/lib/analyze.js.map b/lib/analyze.js.map index 72b1e22e76..eb368aacc7 100644 --- a/lib/analyze.js.map +++ b/lib/analyze.js.map @@ -1 +1 @@ -{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../src/analyze.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,yEAA2D;AAE3D,4DAA8C;AAC9C,gEAAkD;AAClD,qCAAqC;AAErC,2CAA0D;AAE1D,gEAAkD;AAClD,6CAAiD;AACjD,6CAA+B;AAE/B,MAAa,mBAAoB,SAAQ,KAAK;IAG5C,YAAY,mBAAwC,EAAE,OAAe;QACnE,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACjD,CAAC;CACF;AATD,kDASC;AA+BD,KAAK,UAAU,oBAAoB,CAAC,MAAc;IAChD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClD,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;QAC3D,+FAA+F;QAC/F,OAAO;KACR;IAED,IAAI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AC,SAAS,CAAC,CAAC;QAC3C,MAAM,MAAM,CAAC,eAAe,CAC1B,YAAY,EACZ,SAAS,EACT,UAAU,EACV,cAAc,EACd,UAAU,EACV,eAAe,EACf,WAAW,CACZ,CAAC;QAEF,MAAM,CAAC,KAAK,CACV,8BAA8B,QAAQ,gBAAgB,SAAS,GAAG,CACnE,CAAC;QACF,MAAM,CAAC,QAAQ,EAAE,CAAC;IACpB,CAAC;AACH,CAAC;AAzGD,gCAyGC;AAEM,KAAK,UAAU,UAAU,CAC9B,SAAiB,EACjB,UAAkB,EAClB,eAAuB,EACvB,WAAmB,EACnB,MAA0B,EAC1B,MAAc;IAEd,8DAA8D;IAC9D,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,0BAA0B,CAAC,CAAC;IAEzD,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE7C,MAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;IAC5C,MAAM,wBAAwB,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAE5D,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAClC,MAAM,YAAY,GAAG,MAAM,UAAU,CACnC,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,EACX,MAAM,EACN,MAAM,CACP,CAAC;IAEF,OAAO,EAAE,GAAG,YAAY,EAAE,CAAC;AAC7B,CAAC;AA3BD,gCA2BC"} \ No newline at end of file diff --git a/lib/analyze.test.js b/lib/analyze.test.js index 1da479152e..c249a4b4ca 100644 --- a/lib/analyze.test.js +++ b/lib/analyze.test.js @@ -25,6 +25,7 @@ testing_utils_1.setupTests(ava_1.default); ava_1.default("status report fields and search path setting", async (t) => { let searchPathsUsed = []; return await util.withTmpDir(async (tmpDir) => { + testing_utils_1.setupActionsVars(tmpDir, tmpDir); codeql_1.setCodeQL({ databaseAnalyze: async (_, sarifFile, searchPath) => { fs.writeFileSync(sarifFile, JSON.stringify({ diff --git a/lib/analyze.test.js.map b/lib/analyze.test.js.map index d1766cdae6..3cb0e3ed55 100644 --- a/lib/analyze.test.js.map +++ b/lib/analyze.test.js.map @@ -1 +1 @@ -{"version":3,"file":"analyze.test.js","sourceRoot":"","sources":["../src/analyze.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAyB;AAEzB,8CAAuB;AAEvB,uCAAuC;AACvC,qCAAqC;AAErC,2CAAuC;AACvC,uCAA4C;AAC5C,mDAA6C;AAC7C,6CAA+B;AAE/B,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,yEAAyE;AACzE,wEAAwE;AACxE,oDAAoD;AACpD,aAAI,CAAC,8CAA8C,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC/D,IAAI,eAAe,GAAa,EAAE,CAAC;IACnC,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QAC5C,kBAAS,CAAC;YACR,eAAe,EAAE,KAAK,EACpB,CAAC,EACD,SAAiB,EACjB,UAA8B,EAC9B,EAAE;gBACF,EAAE,CAAC,aAAa,CACd,SAAS,EACT,IAAI,CAAC,SAAS,CAAC;oBACb,IAAI,EAAE,EAAE;iBACT,CAAC,CACH,CAAC;gBACF,eAAe,CAAC,IAAI,CAAC,UAAW,CAAC,CAAC;YACpC,CAAC;SACF,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,EAAE,CAAC;QACtB,MAAM,eAAe,GAAG,EAAE,CAAC;QAC3B,MAAM,WAAW,GAAG,EAAE,CAAC;QAEvB,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,oBAAQ,CAAC,EAAE;YAC9C,eAAe,GAAG,EAAE,CAAC;YACrB,MAAM,MAAM,GAAW;gBACrB,SAAS,EAAE,CAAC,QAAQ,CAAC;gBACrB,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,EAAE;gBACf,KAAK,EAAE,EAA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AAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YACvD,CAAC,CAAC,IAAI,CACJ,0BAA0B,QAAQ,cAAc,IAAI,kBAAkB,CACvE,CAAC;YACF,CAAC,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;SACvD;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"analyze.test.js","sourceRoot":"","sources":["../src/analyze.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uCAAyB;AAEzB,8CAAuB;AAEvB,uCAAuC;AACvC,qCAAqC;AAErC,2CAAuC;AACvC,uCAA4C;AAC5C,mDAA+D;AAC/D,6CAA+B;AAE/B,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,yEAAyE;AACzE,wEAAwE;AACxE,oDAAoD;AACpD,aAAI,CAAC,8CAA8C,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC/D,IAAI,eAAe,GAAa,EAAE,CAAC;IACnC,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QAC5C,gCAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAEjC,kBAAS,CAAC;YACR,eAAe,EAAE,KAAK,EACpB,CAAC,EACD,SAAiB,EACjB,UAA8B,EAC9B,EAAE;gBACF,EAAE,CAAC,aAAa,CACd,SAAS,EACT,IAAI,CAAC,SAAS,CAAC;oBACb,IAAI,EAAE,EAAE;iBACT,CAAC,CACH,CAAC;gBACF,eAAe,CAAC,IAAI,CAAC,UAAW,CAAC,CAAC;YACpC,CAAC;SACF,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,EAAE,CAAC;QACtB,MAAM,eAAe,GAAG,EAAE,CAAC;QAC3B,MAAM,WAAW,GAAG,EAAE,CAAC;QAEvB,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC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BAAkB,GAAG,MAAM,oBAAU,CACzC,MAAM,EACN,UAAU,EACV,eAAe,EACf,WAAW,EACX,MAAM,EACN,yBAAe,CAAC,IAAI,CAAC,CACtB,CAAC;YACF,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YACvD,CAAC,CAAC,IAAI,CACJ,0BAA0B,QAAQ,cAAc,IAAI,kBAAkB,CACvE,CAAC;YACF,CAAC,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;SACvD;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/codeql.js b/lib/codeql.js index 4516874156..320b6c5179 100644 --- a/lib/codeql.js +++ b/lib/codeql.js @@ -16,7 +16,6 @@ const stream = __importStar(require("stream")); const globalutil = __importStar(require("util")); const toolrunner = __importStar(require("@actions/exec/lib/toolrunner")); const http = __importStar(require("@actions/http-client")); -const toolcache = __importStar(require("@actions/tool-cache")); const fast_deep_equal_1 = __importDefault(require("fast-deep-equal")); const query_string_1 = __importDefault(require("query-string")); const semver = __importStar(require("semver")); @@ -25,6 +24,7 @@ const actions_util_1 = require("./actions-util"); const api = __importStar(require("./api-client")); const defaults = __importStar(require("./defaults.json")); // Referenced from codeql-action-sync-tool! const error_matcher_1 = require("./error-matcher"); +const toolcache = __importStar(require("./toolcache")); const toolrunner_error_catcher_1 = require("./toolrunner-error-catcher"); const util = __importStar(require("./util")); /** @@ -156,7 +156,7 @@ async function toolcacheDownloadTool(url, headers, tempDir, logger) { await pipeline(response.message, fs.createWriteStream(dest)); return dest; } -async function setupCodeQL(codeqlURL, apiDetails, tempDir, mode, variant, logger) { +async function setupCodeQL(codeqlURL, apiDetails, tempDir, toolCacheDir, mode, variant, logger) { try { // We use the special value of 'latest' to prioritize the version in the // defaults over any pinned cached version. @@ -167,14 +167,14 @@ async function setupCodeQL(codeqlURL, apiDetails, tempDir, mode, variant, logger const codeqlURLVersion = getCodeQLURLVersion(codeqlURL || `/${CODEQL_BUNDLE_VERSION}/`); const codeqlURLSemVer = convertToSemVer(codeqlURLVersion, logger); // If we find the specified version, we always use that. - let codeqlFolder = toolcache.find("CodeQL", codeqlURLSemVer); + let codeqlFolder = toolcache.find("CodeQL", codeqlURLSemVer, mode, toolCacheDir, logger); // If we don't find the requested version, in some cases we may allow a // different version to save download time if the version hasn't been // specified explicitly (in which case we always honor it). if (!codeqlFolder && !codeqlURL && !forceLatest) { - const codeqlVersions = toolcache.findAllVersions("CodeQL"); + const codeqlVersions = toolcache.findAllVersions("CodeQL", mode, toolCacheDir, logger); if (codeqlVersions.length === 1) { - const tmpCodeqlFolder = toolcache.find("CodeQL", codeqlVersions[0]); + const tmpCodeqlFolder = toolcache.find("CodeQL", codeqlVersions[0], mode, toolCacheDir, logger); if (fs.existsSync(path.join(tmpCodeqlFolder, "pinned-version"))) { logger.debug(`CodeQL in cache overriding the default ${CODEQL_BUNDLE_VERSION}`); codeqlFolder = tmpCodeqlFolder; @@ -206,8 +206,8 @@ async function setupCodeQL(codeqlURL, apiDetails, tempDir, mode, variant, logger logger.info(`Downloading CodeQL tools from ${codeqlURL}. This may take a while.`); const codeqlPath = await toolcacheDownloadTool(codeqlURL, headers, tempDir, logger); logger.debug(`CodeQL bundle download to ${codeqlPath} complete.`); - const codeqlExtracted = await toolcache.extractTar(codeqlPath); - codeqlFolder = await toolcache.cacheDir(codeqlExtracted, "CodeQL", codeqlURLSemVer); + const codeqlExtracted = await toolcache.extractTar(codeqlPath, mode, tempDir, logger); + codeqlFolder = await toolcache.cacheDir(codeqlExtracted, "CodeQL", codeqlURLSemVer, mode, toolCacheDir, logger); } let codeqlCmd = path.join(codeqlFolder, "codeql", "codeql"); if (process.platform === "win32") { diff --git a/lib/codeql.js.map b/lib/codeql.js.map index ac5fef035b..cf9a1df4d4 100644 --- a/lib/codeql.js.map +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ql.test.js +++ b/lib/codeql.test.js @@ -30,14 +30,14 @@ const sampleGHAEApiDetails = { }; ava_1.default("download codeql bundle cache", async (t) => { await util.withTmpDir(async (tmpDir) => { - util.setupActionsVars(tmpDir, tmpDir); + testing_utils_1.setupActionsVars(tmpDir, tmpDir); const versions = ["20200601", "20200610"]; for (let i = 0; i < versions.length; i++) { const version = versions[i]; nock_1.default("https://example.com") .get(`/download/codeql-bundle-${version}/codeql-bundle.tar.gz`) .replyWithFile(200, path.join(__dirname, `/../src/testdata/codeql-bundle.tar.gz`)); - await codeql.setupCodeQL(`https://example.com/download/codeql-bundle-${version}/codeql-bundle.tar.gz`, sampleApiDetails, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); + await codeql.setupCodeQL(`https://example.com/download/codeql-bundle-${version}/codeql-bundle.tar.gz`, sampleApiDetails, tmpDir, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); t.assert(toolcache.find("CodeQL", `0.0.0-${version}`)); } const cachedVersions = toolcache.findAllVersions("CodeQL"); @@ -46,39 +46,39 @@ ava_1.default("download codeql bundle cache", async (t) => { }); ava_1.default("download codeql bundle cache explicitly requested with pinned different version cached", async (t) => { await util.withTmpDir(async (tmpDir) => { - util.setupActionsVars(tmpDir, tmpDir); + testing_utils_1.setupActionsVars(tmpDir, tmpDir); nock_1.default("https://example.com") .get(`/download/codeql-bundle-20200601/codeql-bundle.tar.gz`) .replyWithFile(200, path.join(__dirname, `/../src/testdata/codeql-bundle-pinned.tar.gz`)); - await codeql.setupCodeQL("https://example.com/download/codeql-bundle-20200601/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); + await codeql.setupCodeQL("https://example.com/download/codeql-bundle-20200601/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); t.assert(toolcache.find("CodeQL", "0.0.0-20200601")); nock_1.default("https://example.com") .get(`/download/codeql-bundle-20200610/codeql-bundle.tar.gz`) .replyWithFile(200, path.join(__dirname, `/../src/testdata/codeql-bundle.tar.gz`)); - await codeql.setupCodeQL("https://example.com/download/codeql-bundle-20200610/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); + await codeql.setupCodeQL("https://example.com/download/codeql-bundle-20200610/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); t.assert(toolcache.find("CodeQL", "0.0.0-20200610")); }); }); ava_1.default("don't download codeql bundle cache with pinned different version cached", async (t) => { await util.withTmpDir(async (tmpDir) => { - util.setupActionsVars(tmpDir, tmpDir); + testing_utils_1.setupActionsVars(tmpDir, tmpDir); nock_1.default("https://example.com") .get(`/download/codeql-bundle-20200601/codeql-bundle.tar.gz`) .replyWithFile(200, path.join(__dirname, `/../src/testdata/codeql-bundle-pinned.tar.gz`)); - await codeql.setupCodeQL("https://example.com/download/codeql-bundle-20200601/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); + await codeql.setupCodeQL("https://example.com/download/codeql-bundle-20200601/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); t.assert(toolcache.find("CodeQL", "0.0.0-20200601")); - await codeql.setupCodeQL(undefined, sampleApiDetails, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); + await codeql.setupCodeQL(undefined, sampleApiDetails, tmpDir, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); const cachedVersions = toolcache.findAllVersions("CodeQL"); t.is(cachedVersions.length, 1); }); }); ava_1.default("download codeql bundle cache with different version cached (not pinned)", async (t) => { await util.withTmpDir(async (tmpDir) => { - util.setupActionsVars(tmpDir, tmpDir); + testing_utils_1.setupActionsVars(tmpDir, tmpDir); nock_1.default("https://example.com") .get(`/download/codeql-bundle-20200601/codeql-bundle.tar.gz`) .replyWithFile(200, path.join(__dirname, `/../src/testdata/codeql-bundle.tar.gz`)); - await codeql.setupCodeQL("https://example.com/download/codeql-bundle-20200601/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); + await codeql.setupCodeQL("https://example.com/download/codeql-bundle-20200601/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); t.assert(toolcache.find("CodeQL", "0.0.0-20200601")); const platform = process.platform === "win32" ? "win64" @@ -88,18 +88,18 @@ ava_1.default("download codeql bundle cache with different version cached (not p nock_1.default("https://github.com") .get(`/github/codeql-action/releases/download/${defaults.bundleVersion}/codeql-bundle-${platform}.tar.gz`) .replyWithFile(200, path.join(__dirname, `/../src/testdata/codeql-bundle.tar.gz`)); - await codeql.setupCodeQL(undefined, sampleApiDetails, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); + await codeql.setupCodeQL(undefined, sampleApiDetails, tmpDir, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); const cachedVersions = toolcache.findAllVersions("CodeQL"); t.is(cachedVersions.length, 2); }); }); ava_1.default('download codeql bundle cache with pinned different version cached if "latest" tools specified', async (t) => { await util.withTmpDir(async (tmpDir) => { - util.setupActionsVars(tmpDir, tmpDir); + testing_utils_1.setupActionsVars(tmpDir, tmpDir); nock_1.default("https://example.com") .get(`/download/codeql-bundle-20200601/codeql-bundle.tar.gz`) .replyWithFile(200, path.join(__dirname, `/../src/testdata/codeql-bundle-pinned.tar.gz`)); - await codeql.setupCodeQL("https://example.com/download/codeql-bundle-20200601/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); + await codeql.setupCodeQL("https://example.com/download/codeql-bundle-20200601/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); t.assert(toolcache.find("CodeQL", "0.0.0-20200601")); const platform = process.platform === "win32" ? "win64" @@ -109,14 +109,14 @@ ava_1.default('download codeql bundle cache with pinned different version cached nock_1.default("https://github.com") .get(`/github/codeql-action/releases/download/${defaults.bundleVersion}/codeql-bundle-${platform}.tar.gz`) .replyWithFile(200, path.join(__dirname, `/../src/testdata/codeql-bundle.tar.gz`)); - await codeql.setupCodeQL("latest", sampleApiDetails, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); + await codeql.setupCodeQL("latest", sampleApiDetails, tmpDir, tmpDir, "runner", util.GitHubVariant.DOTCOM, logging_1.getRunnerLogger(true)); const cachedVersions = toolcache.findAllVersions("CodeQL"); t.is(cachedVersions.length, 2); }); }); ava_1.default("download codeql bundle from github ae endpoint", async (t) => { await util.withTmpDir(async (tmpDir) => { - util.setupActionsVars(tmpDir, tmpDir); + testing_utils_1.setupActionsVars(tmpDir, tmpDir); const bundleAssetID = 10; const platform = process.platform === "win32" ? "win64" @@ -137,7 +137,7 @@ ava_1.default("download codeql bundle from github ae endpoint", async (t) => { nock_1.default("https://example.githubenterprise.com") .get(`/github/codeql-action/releases/download/${defaults.bundleVersion}/${codeQLBundleName}`) .replyWithFile(200, path.join(__dirname, `/../src/testdata/codeql-bundle-pinned.tar.gz`)); - await codeql.setupCodeQL(undefined, sampleGHAEApiDetails, tmpDir, "runner", util.GitHubVariant.GHAE, logging_1.getRunnerLogger(true)); + await codeql.setupCodeQL(undefined, sampleGHAEApiDetails, tmpDir, tmpDir, "runner", util.GitHubVariant.GHAE, logging_1.getRunnerLogger(true)); const cachedVersions = toolcache.findAllVersions("CodeQL"); t.is(cachedVersions.length, 1); }); diff --git a/lib/codeql.test.js.map b/lib/codeql.test.js.map index b7a6c62465..f980ca9907 100644 --- a/lib/codeql.test.js.map +++ b/lib/codeql.test.js.map @@ -1 +1 @@ -{"version":3,"file":"codeql.test.js","sourceRoot":"","sources":["../src/codeql.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA6B;AAE7B,+DAAiD;AACjD,8CAAuB;AACvB,gDAAwB;AAExB,iDAAmC;AACnC,0DAA4C;AAC5C,uCAA4C;AAC5C,mDAA6C;AAC7C,6CAA+B;AAE/B,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,MAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,OAAO;IACb,GAAG,EAAE,oBAAoB;CAC1B,CAAC;AAEF,MAAM,oBAAoB,GAAG;IAC3B,IAAI,EAAE,OAAO;IACb,GAAG,EAAE,sCAAsC;CAC5C,CAAC;AAEF,aAAI,CAAC,8BAA8B,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC/C,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAEtC,MAAM,QAAQ,GAAG,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAE1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxC,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YAE5B,cAAI,CAAC,qBAAqB,CAAC;iBACxB,GAAG,CAAC,2BAA2B,OAAO,uBAAuB,CAAC;iBAC9D,aAAa,CACZ,GAAG,EACH,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uCAAuC,CAAC,CAC9D,CAAC;YAEJ,MAAM,MAAM,CAAC,WAAW,CACtB,8CAA8C,OAAO,uBAAuB,EAC5E,gBAAgB,EAChB,MAAM,EACN,QAAQ,EAC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,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACxD,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACzB,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AACrE,CAAC,CAAC,CAAC;AAEH,aAAI,CAAC,wCAAwC,EAAE,CAAC,CAAC,EAAE,EAAE;IACnD,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAEjE,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAEjE,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,CACZ,MAAM,CAAC,eAAe,CACpB,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAC1C,CAAC,KAAK,EAAE,KAAK,CAAC,EACd,EAAE,CACH,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/init-action.js b/lib/init-action.js index e98851dc43..0c35933010 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -67,7 +67,7 @@ async function run() { if (!(await actionsUtil.sendStatusReport(await actionsUtil.createStatusReportBase("init", "starting", startedAt, workflowErrors)))) { return; } - const initCodeQLResult = await init_1.initCodeQL(actionsUtil.getOptionalInput("tools"), apiDetails, actionsUtil.getTemporaryDirectory(), "actions", gitHubVersion.type, logger); + const initCodeQLResult = await init_1.initCodeQL(actionsUtil.getOptionalInput("tools"), apiDetails, actionsUtil.getTemporaryDirectory(), actionsUtil.getToolCacheDirectory(), "actions", gitHubVersion.type, logger); codeql = initCodeQLResult.codeql; toolsVersion = initCodeQLResult.toolsVersion; config = await init_1.initConfig(actionsUtil.getOptionalInput("languages"), actionsUtil.getOptionalInput("queries"), actionsUtil.getOptionalInput("config-file"), repository_1.parseRepositoryNwo(actionsUtil.getRequiredEnvParam("GITHUB_REPOSITORY")), actionsUtil.getTemporaryDirectory(), actionsUtil.getRequiredEnvParam("RUNNER_TOOL_CACHE"), codeql, actionsUtil.getRequiredEnvParam("GITHUB_WORKSPACE"), gitHubVersion, apiDetails, logger); diff --git a/lib/init-action.js.map b/lib/init-action.js.map index 9eaee8b6ad..a876c12e16 100644 --- a/lib/init-action.js.map +++ b/lib/init-action.js.map @@ -1 +1 @@ -{"version":3,"file":"init-action.js","sourceRoot":"","sources":["../src/init-action.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAG9C,iCAMgB;AAChB,2CAAuC;AACvC,uCAA6C;AAC7C,6CAAkD;AAClD,iCAAqE;AAsBrE,KAAK,UAAU,uBAAuB,CACpC,SAAe,EACf,MAA0B,EAC1B,YAAoB;;IAEpB,MAAM,gBAAgB,GAAG,MAAM,WAAW,CAAC,sBAAsB,CAC/D,MAAM,EACN,SAAS,EACT,SAAS,CACV,CAAC;IAEF,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7C,MAAM,iBAAiB,GAAG,WAAW,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACpE,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/D,MAAM,WA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S,CAAC,CAAC;KACjD;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,MAAM,WAAW,CAAC,gBAAgB,CAChC,MAAM,WAAW,CAAC,sBAAsB,CACtC,MAAM,EACN,SAAS,EACT,SAAS,EACT,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,KAAK,CACZ,CACF,CAAC;QACF,OAAO;KACR;IACD,MAAM,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;AACjE,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,uBAAuB,KAAK,EAAE,CAAC,CAAC;QAC/C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/lib/init.js b/lib/init.js index 4af5b8981c..8bf4f60532 100644 --- a/lib/init.js +++ b/lib/init.js @@ -16,9 +16,9 @@ const codeql_1 = require("./codeql"); const configUtils = __importStar(require("./config-utils")); const tracer_config_1 = require("./tracer-config"); const util = __importStar(require("./util")); -async function initCodeQL(codeqlURL, apiDetails, tempDir, mode, variant, logger) { +async function initCodeQL(codeqlURL, apiDetails, tempDir, toolCacheDir, mode, variant, logger) { logger.startGroup("Setup CodeQL tools"); - const { codeql, toolsVersion } = await codeql_1.setupCodeQL(codeqlURL, apiDetails, tempDir, mode, variant, logger); + const { codeql, toolsVersion } = await codeql_1.setupCodeQL(codeqlURL, apiDetails, tempDir, toolCacheDir, mode, variant, logger); await codeql.printVersion(); logger.endGroup(); return { codeql, toolsVersion }; diff --git a/lib/init.js.map b/lib/init.js.map index 4995129117..e3af91f85e 100644 --- a/lib/init.js.map +++ b/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C,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE;gBAChE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;aAC/B,CAAC,CAAC,IAAI,EAAE,CAAC;SACX;KACF;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,QAAQ,EAAE,CAAC;QAClB,MAAM,CAAC,OAAO,CACZ,+IAA+I,CAChJ,CAAC;QACF,OAAO;KACR;IACD,MAAM,CAAC,QAAQ,EAAE,CAAC;AACpB,CAAC;AAnDD,8CAmDC"} \ No newline at end of file diff --git a/lib/logging.js b/lib/logging.js index 65d45c11d5..ae85653d11 100644 --- a/lib/logging.js +++ b/lib/logging.js @@ -18,6 +18,7 @@ function getRunnerLogger(debugMode) { info: console.info, warning: console.warn, error: console.error, + isDebug: () => debugMode, startGroup: () => undefined, endGroup: () => undefined, }; diff --git a/lib/logging.js.map b/lib/logging.js.map index 23284aba0f..aaef76fb2d 100644 --- a/lib/logging.js.map +++ b/lib/logging.js.map @@ -1 +1 @@ -{"version":3,"file":"logging.js","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AAYtC,SAAgB,gBAAgB;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC;AAFD,4CAEC;AAED,SAAgB,eAAe,CAAC,SAAkB;IAChD,OAAO;QACL,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,SAAS;QAClD,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,OAAO,CAAC,IAAI;QACrB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS;QAC3B,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS;KAC1B,CAAC;AACJ,CAAC;AATD,0CASC"} \ No newline at end of file +{"version":3,"file":"logging.js","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AActC,SAAgB,gBAAgB;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC;AAFD,4CAEC;AAED,SAAgB,eAAe,CAAC,SAAkB;IAChD,OAAO;QACL,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,SAAS;QAClD,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,OAAO,CAAC,IAAI;QACrB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS;QACxB,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS;QAC3B,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS;KAC1B,CAAC;AACJ,CAAC;AAVD,0CAUC"} \ No newline at end of file diff --git a/lib/runner.js b/lib/runner.js index 1ea0cfc728..56d4e3db74 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -99,7 +99,6 @@ program try { const tempDir = getTempDir(cmd.tempDir); const toolsDir = getToolsDir(cmd.toolsDir); - util_1.setupActionsVars(tempDir, toolsDir); // Wipe the temp dir logger.info(`Cleaning temp directory ${tempDir}`); fs.rmdirSync(tempDir, { recursive: true }); @@ -117,7 +116,7 @@ program codeql = codeql_1.getCodeQL(cmd.codeqlPath); } else { - codeql = (await init_1.initCodeQL(undefined, apiDetails, tempDir, "runner", gitHubVersion.type, logger)).codeql; + codeql = (await init_1.initCodeQL(undefined, apiDetails, tempDir, toolsDir, "runner", gitHubVersion.type, logger)).codeql; } const config = await init_1.initConfig(cmd.languages, cmd.queries, cmd.configFile, repository_1.parseRepositoryNwo(cmd.repository), tempDir, toolsDir, codeql, cmd.checkoutPath || process.cwd(), gitHubVersion, apiDetails, logger); const tracerConfig = await init_1.runInit(codeql, config); @@ -179,7 +178,6 @@ program throw new Error("Config file could not be found at expected location. " + "Was the 'init' command run with the same '--temp-dir' argument as this command."); } - util_1.setupActionsVars(config.tempDir, config.toolCacheDir); importTracerEnvironment(config); let language = undefined; if (cmd.language !== undefined) { @@ -228,7 +226,6 @@ program throw new Error("Config file could not be found at expected location. " + "Was the 'init' command run with the same '--temp-dir' argument as this command."); } - util_1.setupActionsVars(config.tempDir, config.toolCacheDir); const auth = await util_1.getGitHubAuth(logger, cmd.githubAuth, cmd.githubAuthStdin); const apiDetails = { auth, diff --git a/lib/runner.js.map b/lib/runner.js.map index 9d84f1d413..9ad65c48fb 100644 --- a/lib/runner.js.map +++ b/lib/runner.js.map @@ -1 +1 @@ -{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAE7B,yCAAoC;AAEpC,uCAAuC;AACvC,2CAAuE;AACvE,qCAA6C;AAC7C,iDAAmD;AACnD,iCAA8E;AAC9E,2CAAsD;AACtD,uCAA4C;AAC5C,6CAAkD;AAClD,yDAA2C;AAC3C,iCASgB;AAEhB,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAC9B,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAEzB,SAAS,UAAU,CAAC,SAA6B;IAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE,eAAe,CAAC,CAAC;IACvE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;QAC3B,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;KAC5C;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,WAAW,CAAC,SAA6B;IAChD,MAAM,QAAQ,GAAG,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,qBAAqB,CAAC,CAAC;IAC7E,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AC,OAAO,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/testing-utils.js b/lib/testing-utils.js index 0dc40ed72a..b6739f1cd7 100644 --- a/lib/testing-utils.js +++ b/lib/testing-utils.js @@ -72,4 +72,11 @@ function setupTests(test) { }); } exports.setupTests = setupTests; +// Sets environment variables that make using some libraries designed for +// use only on actions safe to use outside of actions. +function setupActionsVars(tempDir, toolsDir) { + process.env["RUNNER_TEMP"] = tempDir; + process.env["RUNNER_TOOL_CACHE"] = toolsDir; +} +exports.setupActionsVars = setupActionsVars; //# sourceMappingURL=testing-utils.js.map \ No newline at end of file diff --git a/lib/testing-utils.js.map b/lib/testing-utils.js.map index 0689df539b..18663e77c5 100644 --- a/lib/testing-utils.js.map +++ b/lib/testing-utils.js.map @@ -1 +1 @@ -{"version":3,"file":"testing-utils.js","sourceRoot":"","sources":["../src/testing-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,kDAA0B;AAE1B,iDAAmC;AASnC,SAAS,UAAU,CAAC,OAAoB;IACtC,8CAA8C;IAC9C,gCAAgC;IAChC,2EAA2E;IAC3E,2FAA2F;IAC3F,OAAO,CACL,KAA0B,EAC1B,QAAiB,EACjB,EAA0B,EACjB,EAAE;QACX,2CAA2C;QAC3C,IAAI,EAAE,KAAK,SAAS,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;YACtD,EAAE,GAAG,QAAQ,CAAC;YACd,QAAQ,GAAG,SAAS,CAAC;SACtB;QAED,oBAAoB;QACpB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,OAAO,CAAC,UAAU,IAAI,KAAK,CAAC;SAC7B;aAAM;YACL,OAAO,CAAC,UAAU,IAAI,IAAI,WAAW,CAAC,QAAQ,IAAI,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAC1E;QAED,iDAAiD;QACjD,IAAI,EAAE,KAAK,SAAS,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE;YAChD,EAA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C;QAC7C,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;QAC7C,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE;YACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;SAC5C;QAED,uCAAuC;QACvC,eAAK,CAAC,OAAO,EAAE,CAAC;QAEhB,oCAAoC;QACpC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAvCD,gCAuCC"} \ No newline at end of file +{"version":3,"file":"testing-utils.js","sourceRoot":"","sources":["../src/testing-utils.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,kDAA0B;AAE1B,iDAAmC;AASnC,SAAS,UAAU,CAAC,OAAoB;IACtC,8CAA8C;IAC9C,gCAAgC;IAChC,2EAA2E;IAC3E,2FAA2F;IAC3F,OAAO,CACL,KAA0B,EAC1B,QAAiB,EACjB,EAA0B,EACjB,EAAE;QACX,2CAA2C;QAC3C,IAAI,EAAE,KAAK,SAAS,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;YACtD,EAAE,GAAG,QAAQ,CAAC;YACd,QAAQ,GAAG,SAAS,CAAC;SACtB;QAED,oBAAoB;QACpB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,OAAO,CAAC,UAAU,IAAI,KAAK,CAAC;SAC7B;aAAM;YACL,OAAO,CAAC,UAAU,IAAI,IAAI,WAAW,CAAC,QAAQ,IAAI,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAC1E;QAED,iDAAiD;QACjD,IAAI,EAAE,KAAK,SAAS,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE;YAChD,EAAE,EAAE,CAAC;SACN;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAED,SAAgB,UAAU,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IAAI,CAAC,CAAC,CAAC,MAAM,EAAE;YACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;SAC5C;QAED,uCAAuC;QACvC,eAAK,CAAC,OAAO,EAAE,CAAC;QAEhB,oCAAoC;QACpC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAvCD,gCAuCC;AAED,yEAAyE;AACzE,sDAAsD;AACtD,SAAgB,gBAAgB,CAAC,OAAe,EAAE,QAAgB;IAChE,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,QAAQ,CAAC;AAC9C,CAAC;AAHD,4CAGC"} \ No newline at end of file diff --git a/lib/toolcache.js b/lib/toolcache.js new file mode 100644 index 0000000000..d4832be200 --- /dev/null +++ b/lib/toolcache.js @@ -0,0 +1,261 @@ +"use strict"; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = __importStar(require("fs")); +const os = __importStar(require("os")); +const path = __importStar(require("path")); +const toolrunner = __importStar(require("@actions/exec/lib/toolrunner")); +const io = __importStar(require("@actions/io")); +const actionsToolcache = __importStar(require("@actions/tool-cache")); +const semver = __importStar(require("semver")); +/* + * This file acts as an interface to the functionality of the actions toolcache. + * That library is not safe to use outside of actions as it makes assumptions about + * the state of the filesystem and available environment variables. + * + * On actions we can just delegates to the toolcache library, however outside of + * actions we provide our own implementation. + */ +/** + * Extract a compressed tar archive. + * + * See extractTar function from node_modules/@actions/tool-cache/lib/tool-cache.d.ts + * + * @param file path to the tar + * @param mode should run the actions or runner implementation + * @param tempDir path to the temporary directory + * @param logger logger to use + * @returns path to the destination directory + */ +async function extractTar(file, mode, tempDir, logger) { + if (mode === "actions") { + return await actionsToolcache.extractTar(file); + } + else { + // Initial implementation copied from node_modules/@actions/tool-cache/lib/tool-cache.js + if (!file) { + throw new Error("parameter 'file' is required"); + } + // Create dest + const dest = createExtractFolder(tempDir); + // Determine whether GNU tar + logger.debug("Checking tar --version"); + let versionOutput = ""; + await new toolrunner.ToolRunner("tar", ["--version"], { + ignoreReturnCode: true, + silent: true, + listeners: { + stdout: (data) => (versionOutput += data.toString()), + stderr: (data) => (versionOutput += data.toString()), + }, + }).exec(); + logger.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); + // Initialize args + const args = ["xz"]; + if (logger.isDebug()) { + args.push("-v"); + } + let destArg = dest; + let fileArg = file; + if (process.platform === "win32" && isGnuTar) { + args.push("--force-local"); + destArg = dest.replace(/\\/g, "/"); + // Technically only the dest needs to have `/` but for aesthetic consistency + // convert slashes in the file arg too. + fileArg = file.replace(/\\/g, "/"); + } + if (isGnuTar) { + // Suppress warnings when using GNU tar to extract archives created by BSD tar + args.push("--warning=no-unknown-keyword"); + } + args.push("-C", destArg, "-f", fileArg); + await new toolrunner.ToolRunner(`tar`, args).exec(); + return dest; + } +} +exports.extractTar = extractTar; +/** + * Caches a directory and installs it into the tool cacheDir. + * + * Also see cacheDir function from node_modules/@actions/tool-cache/lib/tool-cache.d.ts + * + * @param sourceDir the directory to cache into tools + * @param tool tool name + * @param version version of the tool. semver format + * @param mode should run the actions or runner implementation + * @param toolCacheDir path to the tool cache directory + * @param logger logger to use + */ +async function cacheDir(sourceDir, tool, version, mode, toolCacheDir, logger) { + if (mode === "actions") { + return await actionsToolcache.cacheDir(sourceDir, tool, version); + } + else { + // Initial implementation copied from node_modules/@actions/tool-cache/lib/tool-cache.js + version = semver.clean(version) || version; + const arch = os.arch(); + logger.debug(`Caching tool ${tool} ${version} ${arch}`); + logger.debug(`source dir: ${sourceDir}`); + if (!fs.statSync(sourceDir).isDirectory()) { + throw new Error("sourceDir is not a directory"); + } + // Create the tool dir + const destPath = createToolPath(tool, version, arch, toolCacheDir, logger); + // copy each child item. do not move. move can fail on Windows + // due to anti-virus software having an open handle on a file. + for (const itemName of fs.readdirSync(sourceDir)) { + const s = path.join(sourceDir, itemName); + await io.cp(s, destPath, { recursive: true }); + } + // write .complete + completeToolPath(tool, version, arch, toolCacheDir, logger); + return destPath; + } +} +exports.cacheDir = cacheDir; +/** + * Finds the path to a tool version in the local installed tool cache. + * + * Also see find function from node_modules/@actions/tool-cache/lib/tool-cache.d.ts + * + * @param toolName name of the tool + * @param versionSpec version of the tool + * @param mode should run the actions or runner implementation + * @param toolCacheDir path to the tool cache directory + * @param logger logger to use + */ +function find(toolName, versionSpec, mode, toolCacheDir, logger) { + if (mode === "actions") { + return actionsToolcache.find(toolName, versionSpec); + } + else { + // Initial implementation copied from node_modules/@actions/tool-cache/lib/tool-cache.js + if (!toolName) { + throw new Error("toolName parameter is required"); + } + if (!versionSpec) { + throw new Error("versionSpec parameter is required"); + } + const arch = os.arch(); + // attempt to resolve an explicit version + if (!isExplicitVersion(versionSpec, logger)) { + const localVersions = findAllVersions(toolName, mode, toolCacheDir, logger); + const match = evaluateVersions(localVersions, versionSpec, logger); + versionSpec = match; + } + // check for the explicit version in the cache + let toolPath = ""; + if (versionSpec) { + versionSpec = semver.clean(versionSpec) || ""; + const cachePath = path.join(toolCacheDir, toolName, versionSpec, arch); + logger.debug(`checking cache: ${cachePath}`); + if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) { + logger.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); + toolPath = cachePath; + } + else { + logger.debug("not found"); + } + } + return toolPath; + } +} +exports.find = find; +/** + * Finds the paths to all versions of a tool that are installed in the local tool cache. + * + * Also see findAllVersions function from node_modules/@actions/tool-cache/lib/tool-cache.d.ts + * + * @param toolName name of the tool + * @param mode should run the actions or runner implementation + * @param toolCacheDir path to the tool cache directory + * @param logger logger to use + */ +function findAllVersions(toolName, mode, toolCacheDir, logger) { + if (mode === "actions") { + return actionsToolcache.findAllVersions(toolName); + } + else { + // Initial implementation copied from node_modules/@actions/tool-cache/lib/tool-cache.js + const versions = []; + const arch = os.arch(); + const toolPath = path.join(toolCacheDir, toolName); + if (fs.existsSync(toolPath)) { + const children = fs.readdirSync(toolPath); + for (const child of children) { + if (isExplicitVersion(child, logger)) { + const fullPath = path.join(toolPath, child, arch || ""); + if (fs.existsSync(fullPath) && + fs.existsSync(`${fullPath}.complete`)) { + versions.push(child); + } + } + } + } + return versions; + } +} +exports.findAllVersions = findAllVersions; +function createExtractFolder(tempDir) { + // create a temp dir + const dest = path.join(tempDir, "toolcache-temp"); + if (!fs.existsSync(dest)) { + fs.mkdirSync(dest); + } + return dest; +} +function createToolPath(tool, version, arch, toolCacheDir, logger) { + const folderPath = path.join(toolCacheDir, tool, semver.clean(version) || version, arch || ""); + logger.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + fs.rmdirSync(folderPath, { recursive: true }); + fs.rmdirSync(markerPath, { recursive: true }); + fs.mkdirSync(folderPath, { recursive: true }); + return folderPath; +} +function completeToolPath(tool, version, arch, toolCacheDir, logger) { + const folderPath = path.join(toolCacheDir, tool, semver.clean(version) || version, arch || ""); + const markerPath = `${folderPath}.complete`; + fs.writeFileSync(markerPath, ""); + logger.debug("finished caching tool"); +} +function isExplicitVersion(versionSpec, logger) { + const c = semver.clean(versionSpec) || ""; + logger.debug(`isExplicit: ${c}`); + const valid = semver.valid(c) != null; + logger.debug(`explicit? ${valid}`); + return valid; +} +function evaluateVersions(versions, versionSpec, logger) { + let version = ""; + logger.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver.gt(a, b)) { + return 1; + } + return -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; + } + } + if (version) { + logger.debug(`matched: ${version}`); + } + else { + logger.debug("match not found"); + } + return version; +} +//# sourceMappingURL=toolcache.js.map \ No newline at end of file diff --git a/lib/toolcache.js.map b/lib/toolcache.js.map new file mode 100644 index 0000000000..737a8c1b8b --- /dev/null +++ b/lib/toolcache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"toolcache.js","sourceRoot":"","sources":["../src/toolcache.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAE7B,yEAA2D;AAC3D,gDAAkC;AAClC,sEAAwD;AACxD,+CAAiC;AAKjC;;;;;;;GAOG;AAEH;;;;;;;;;;GAUG;AACI,KAAK,UAAU,UAAU,CAC9B,IAAY,EACZ,IAAU,EACV,OAAe,EACf,MAAc;IAEd,IAAI,IAAI,KAAK,SAAS,EAAE;QACtB,OAAO,MAAM,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;KAChD;SAAM;QACL,wFAAwF;QAExF,IAAI,CAAC,IAAI,EAAE;YACT,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACjD;QACD,cAAc;QACd,MAAM,IAAI,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAC1C,4BAA4B;QAC5B,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QACvC,IAAI,aAAa,GAAG,EAAE,CAAC;QACvB,MAAM,IAAI,UAAU,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE;YACpD,gBAAgB,EAAE,IAAI;YACtB,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE;gBACT,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,aAAa,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACpD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,aAAa,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;aACrD;SACF,CAAC,CAAC,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K,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IACtC,MAAM,CAAC,KAAK,CAAC,aAAa,KAAK,EAAE,CAAC,CAAC;IACnC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,gBAAgB,CACvB,QAAkB,EAClB,WAAmB,EACnB,MAAc;IAEd,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,MAAM,CAAC,KAAK,CAAC,cAAc,QAAQ,CAAC,MAAM,WAAW,CAAC,CAAC;IACvD,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAChC,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;YACnB,OAAO,CAAC,CAAC;SACV;QACD,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC,CAAC,CAAC;IACH,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QAC7C,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QAC3D,IAAI,SAAS,EAAE;YACb,OAAO,GAAG,SAAS,CAAC;YACpB,MAAM;SACP;KACF;IACD,IAAI,OAAO,EAAE;QACX,MAAM,CAAC,KAAK,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;KACrC;SAAM;QACL,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACjC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"} \ No newline at end of file diff --git a/lib/util.js b/lib/util.js index 7214a39010..0a8451ead4 100644 --- a/lib/util.js +++ b/lib/util.js @@ -320,20 +320,4 @@ async function getGitHubAuth(logger, githubAuth, fromStdIn, readable = process.s throw new Error("No GitHub authentication token was specified. Please provide a token via the GITHUB_TOKEN environment variable, or by adding the `--github-auth-stdin` flag and passing the token via standard input."); } exports.getGitHubAuth = getGitHubAuth; -// Sets environment variables that make using some libraries designed for -// use only on actions safe to use outside of actions. -// -// Obviously this is not a tremendously great thing we're doing and it -// would be better to write our own implementation of libraries to use -// outside of actions. For now this works well enough. -// -// Currently this list of libraries that is deemed to now be safe includes: -// - @actions/tool-cache -// -// Also see "queries/unguarded-action-lib.ql". -function setupActionsVars(tempDir, toolsDir) { - process.env["RUNNER_TEMP"] = tempDir; - process.env["RUNNER_TOOL_CACHE"] = toolsDir; -} -exports.setupActionsVars = setupActionsVars; //# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/lib/util.js.map b/lib/util.js.map index 9ad705482c..3d31c12627 100644 --- a/lib/util.js.map +++ b/lib/util.js.map @@ -1 +1 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAG7B,oDAAsC;AACtC,+CAAiC;AAEjC,6CAA8D;AAC9D,2EAA6D;AAS7D;;GAEG;AACU,QAAA,iBAAiB,GAAG,oBAAoB,CAAC;AAEtD;;GAEG;AACH,SAAgB,uBAAuB;IACrC,MAAM,OAAO,GAAG,6BAA6B,CAAC;IAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACzC,OAAO,EAAE,CAAC;KACX;IACD,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACxB;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,IAAI,KAAK,CACb,GAAG,OAAO,kEAAkE,CAAC,CAAC,OAAO,EAAE,CACxF,CAAC;KACH;AACH,CAAC;AAbD,0DAaC;AAED,SAAgB,UAAU;IACxB,OAAO,CACL,CAAC,CAA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AAO,CAAC,GAAG,CAAC,YAAY,CAAC;KACjC;IAED,MAAM,IAAI,KAAK,CACb,uMAAuM,CACxM,CAAC;AACJ,CAAC;AA9CD,sCA8CC;AAED,yEAAyE;AACzE,sDAAsD;AACtD,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,sDAAsD;AACtD,EAAE;AACF,2EAA2E;AAC3E,wBAAwB;AACxB,EAAE;AACF,8CAA8C;AAC9C,SAAgB,gBAAgB,CAAC,OAAe,EAAE,QAAgB;IAChE,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,QAAQ,CAAC;AAC9C,CAAC;AAHD,4CAGC"} \ No newline at end of file +{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAG7B,oDAAsC;AACtC,+CAAiC;AAEjC,6CAA8D;AAC9D,2EAA6D;AAS7D;;GAEG;AACU,QAAA,iBAAiB,GAAG,oBAAoB,CAAC;AAEtD;;GAEG;AACH,SAAgB,uBAAuB;IACrC,MAAM,OAAO,GAAG,6BAA6B,CAAC;IAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACzC,OAAO,EAAE,CAAC;KACX;IACD,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACxB;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,IAAI,KAAK,CACb,GAAG,OAAO,kEAAkE,CAAC,CAAC,OAAO,EAAE,CACxF,CAAC;KACH;AACH,CAAC;AAbD,0DAaC;AAED,SAAgB,UAAU;IACxB,OAAO,CACL,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB;QA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jC;IAED,MAAM,IAAI,KAAK,CACb,uMAAuM,CACxM,CAAC;AACJ,CAAC;AA9CD,sCA8CC"} \ No newline at end of file diff --git a/node_modules/@actions/io/LICENSE.md b/node_modules/@actions/io/LICENSE.md index e5a73f40e7..dbae2edb2c 100644 --- a/node_modules/@actions/io/LICENSE.md +++ b/node_modules/@actions/io/LICENSE.md @@ -1,3 +1,5 @@ +The MIT License (MIT) + Copyright 2019 GitHub Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/node_modules/@actions/io/lib/io-util.js b/node_modules/@actions/io/lib/io-util.js index 17b3bba58b..33b57f27fd 100644 --- a/node_modules/@actions/io/lib/io-util.js +++ b/node_modules/@actions/io/lib/io-util.js @@ -8,11 +8,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; var _a; Object.defineProperty(exports, "__esModule", { value: true }); const assert_1 = require("assert"); -const fs = require("fs"); -const path = require("path"); +const fs = __importStar(require("fs")); +const path = __importStar(require("path")); _a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; exports.IS_WINDOWS = process.platform === 'win32'; function exists(fsPath) { diff --git a/node_modules/@actions/io/lib/io-util.js.map b/node_modules/@actions/io/lib/io-util.js.map index 76cd3b9447..dccb4728c0 100644 --- a/node_modules/@actions/io/lib/io-util.js.map +++ b/node_modules/@actions/io/lib/io-util.js.map @@ -1 +1 @@ -{"version":3,"file":"io-util.js","sourceRoot":"","sources":["../src/io-util.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAyB;AACzB,yBAAwB;AACxB,6BAA4B;AAEf,gBAYE,qTAAA;AAEF,QAAA,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAA;AAEtD,SAAsB,MAAM,CAAC,MAAc;;QACzC,IAAI;YACF,MAAM,YAAI,CAAC,MAAM,CAAC,CAAA;SACnB;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACzB,OAAO,KAAK,CAAA;aACb;YAED,MAAM,GAAG,CAAA;SACV;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CAAA;AAZD,wBAYC;AAED,SAAsB,WAAW,CAC/B,MAAc,EACd,UAAmB,KAAK;;QAExB,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,YAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,aAAK,CAAC,MAAM,CAAC,CAAA;QAChE,OAAO,KAAK,CAAC,WAAW,EAAE,CAAA;IAC5B,CAAC;CAAA;AAND,kCAMC;AAED;;;GAGG;AACH,SAAgB,QAAQ,CAAC,CAAS;IAChC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAC1B,IAAI,CAAC,CAAC,EAAE;QACN,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;KAC5D;IAED,IAAI,kBAAU,EAAE;QACd,OAAO,CACL,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,8BAA8B;SACxE,CAAA,CAAC,sBAAsB;KACzB;IAED,OAAO,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC;AAbD,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,CAAC,CAC1D,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@actions/io/lib/io.d.ts b/node_modules/@actions/io/lib/io.d.ts index a4ea5a7f07..d1d9261cdc 100644 --- a/node_modules/@actions/io/lib/io.d.ts +++ b/node_modules/@actions/io/lib/io.d.ts @@ -54,3 +54,9 @@ export declare function mkdirP(fsPath: string): Promise; * @returns Promise path to tool */ export declare function which(tool: string, check?: boolean): Promise; +/** + * Returns a list of all occurrences of the given tool on the system path. + * + * @returns Promise the paths of the tool + */ +export declare function findInPath(tool: string): Promise; diff --git a/node_modules/@actions/io/lib/io.js b/node_modules/@actions/io/lib/io.js index ad5bdb926b..f354e5c6ec 100644 --- a/node_modules/@actions/io/lib/io.js +++ b/node_modules/@actions/io/lib/io.js @@ -8,11 +8,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; Object.defineProperty(exports, "__esModule", { value: true }); -const childProcess = require("child_process"); -const path = require("path"); +const childProcess = __importStar(require("child_process")); +const path = __importStar(require("path")); const util_1 = require("util"); -const ioUtil = require("./io-util"); +const ioUtil = __importStar(require("./io-util")); const exec = util_1.promisify(childProcess.exec); /** * Copies a file or folder. @@ -180,58 +187,73 @@ function which(tool, check) { throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); } } + return result; } - try { - // build the list of extensions to try - const extensions = []; - if (ioUtil.IS_WINDOWS && process.env.PATHEXT) { - for (const extension of process.env.PATHEXT.split(path.delimiter)) { - if (extension) { - extensions.push(extension); - } - } - } - // if it's rooted, return it if exists. otherwise return empty. - if (ioUtil.isRooted(tool)) { - const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); - if (filePath) { - return filePath; + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ''; + }); +} +exports.which = which; +/** + * Returns a list of all occurrences of the given tool on the system path. + * + * @returns Promise the paths of the tool + */ +function findInPath(tool) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // build the list of extensions to try + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { + for (const extension of process.env['PATHEXT'].split(path.delimiter)) { + if (extension) { + extensions.push(extension); } - return ''; } - // if any path separators, return empty - if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) { - return ''; - } - // build the list of directories - // - // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, - // it feels like we should not do this. Checking the current directory seems like more of a use - // case of a shell, and the which() function exposed by the toolkit should strive for consistency - // across platforms. - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path.delimiter)) { - if (p) { - directories.push(p); - } - } + } + // if it's rooted, return it if exists. otherwise return empty. + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; } - // return the first match - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions); - if (filePath) { - return filePath; + return []; + } + // if any path separators, return empty + if (tool.includes(path.sep)) { + return []; + } + // build the list of directories + // + // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, + // it feels like we should not do this. Checking the current directory seems like more of a use + // case of a shell, and the which() function exposed by the toolkit should strive for consistency + // across platforms. + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path.delimiter)) { + if (p) { + directories.push(p); } } - return ''; } - catch (err) { - throw new Error(`which failed with message ${err.message}`); + // find all matches + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } } + return matches; }); } -exports.which = which; +exports.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); diff --git a/node_modules/@actions/io/lib/io.js.map b/node_modules/@actions/io/lib/io.js.map index 91db963000..b7a7a64e9c 100644 --- a/node_modules/@actions/io/lib/io.js.map +++ b/node_modules/@actions/io/lib/io.js.map @@ -1 +1 @@ -{"version":3,"file":"io.js","sourceRoot":"","sources":["../src/io.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,8CAA6C;AAC7C,6BAA4B;AAC5B,+BAA8B;AAC9B,oCAAmC;AAEnC,MAAM,IAAI,GAAG,gBAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;AAoBzC;;;;;;;GAOG;AACH,SAAsB,EAAE,CACtB,MAAc,EACd,IAAY,EACZ,UAAuB,EAAE;;QAEzB,MAAM,EAAC,KAAK,EAAE,SAAS,EAAC,GAAG,eAAe,CAAC,OAAO,CAAC,CAAA;QAEnD,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QAC7E,4CAA4C;QAC5C,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE;YAC3C,OAAM;SACP;QAED,wDAAwD;QACxD,MAAM,OAAO,GACX,QAAQ,IAAI,QAAQ,CAAC,WAAW,EAAE;YAChC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACxC,CAAC,CAAC,IAAI,CAAA;QAEV,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE;YAClC,MAAM,IAAI,KAAK,CAAC,8BAA8B,MAAM,EAAE,CAAC,CAAA;SACxD;QACD,MAAM,UAAU,G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,CAAC,CAAC,CAAC,IAAI,CACtC,CAAA;SACF;aAAM,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,EAAE;YACpD,MAAM,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;SACzC;IACH,CAAC;CAAA"} \ No newline at end of file diff --git a/node_modules/@actions/io/package.json b/node_modules/@actions/io/package.json index c19c889224..4427e3227e 100644 --- a/node_modules/@actions/io/package.json +++ b/node_modules/@actions/io/package.json @@ -1,15 +1,16 @@ { "name": "@actions/io", - "version": "1.0.1", + "version": "1.1.0", "description": "Actions io lib", "keywords": [ "github", "actions", "io" ], - "homepage": "https://github.com/actions/toolkit/tree/master/packages/io", + "homepage": "https://github.com/actions/toolkit/tree/main/packages/io", "license": "MIT", "main": "lib/io.js", + "types": "lib/io.d.ts", "directories": { "lib": "lib", "test": "__tests__" @@ -22,14 +23,15 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/actions/toolkit.git" + "url": "git+https://github.com/actions/toolkit.git", + "directory": "packages/io" }, "scripts": { + "audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json", "test": "echo \"Error: run tests from root\" && exit 1", "tsc": "tsc" }, "bugs": { "url": "https://github.com/actions/toolkit/issues" - }, - "gitHead": "a2ab4bcf78e4f7080f0d45856e6eeba16f0bbc52" + } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 50d698b5c9..588977dd3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,9 +41,9 @@ } }, "@actions/io": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.1.tgz", - "integrity": "sha512-rhq+tfZukbtaus7xyUtwKfuiCRXd1hWSfmJNEpFgBQJ4woqPEpsBw04awicjwz9tyG2/MVhAEMfVn664Cri5zA==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.0.tgz", + "integrity": "sha512-PspSX7Z9zh2Fyyuf3F6BsYeXcYHfc/VJ1vwy2vouas95efHVd42M6UfBFRs+jY0uiMDXhAoUtATn9g2r1MaWBQ==" }, "@actions/tool-cache": { "version": "1.5.5", diff --git a/package.json b/package.json index 4bc81531f8..883447bceb 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "@actions/exec": "^1.0.1", "@actions/github": "^4.0.0", "@actions/http-client": "^1.0.8", + "@actions/io": "^1.1.0", "@actions/tool-cache": "^1.5.5", "@chrisgavin/safe-which": "^1.0.2", "@octokit/plugin-retry": "^3.0.3", diff --git a/queries/unguarded-action-lib.ql b/queries/unguarded-action-lib.ql index 0f28c2293f..87183f5d3c 100644 --- a/queries/unguarded-action-lib.ql +++ b/queries/unguarded-action-lib.ql @@ -16,6 +16,7 @@ bindingset[lib] predicate isSafeActionLib(string lib) { lib = "@actions/http-client" or lib = "@actions/exec" or + lib = "@actions/io" or lib.matches("@actions/exec/%") } @@ -41,7 +42,8 @@ predicate commandSetsActionsEnvVars(string commandName) { class ActionsLibImport extends ImportDeclaration { ActionsLibImport() { getImportedPath().getValue().matches("@actions/%") and - not isSafeActionLib(getImportedPath().getValue()) + not isSafeActionLib(getImportedPath().getValue()) or + getImportedPath().getValue() = "./actions-util" } string getName() { diff --git a/src/actions-util.ts b/src/actions-util.ts index 5b9f32a3f3..ba09f1ecfd 100644 --- a/src/actions-util.ts +++ b/src/actions-util.ts @@ -52,6 +52,13 @@ export function getTemporaryDirectory(): string { : getRequiredEnvParam("RUNNER_TEMP"); } +export function getToolCacheDirectory(): string { + const value = process.env["CODEQL_ACTION_TOOL_CACHE"]; + return value !== undefined && value !== "" + ? value + : getRequiredEnvParam("RUNNER_TOOL_CACHE"); +} + /** * Ensures all required environment variables are set in the context of a local run. */ diff --git a/src/analyze.test.ts b/src/analyze.test.ts index b631b35919..7f6ca09129 100644 --- a/src/analyze.test.ts +++ b/src/analyze.test.ts @@ -7,7 +7,7 @@ import { setCodeQL } from "./codeql"; import { Config } from "./config-utils"; import { Language } from "./languages"; import { getRunnerLogger } from "./logging"; -import { setupTests } from "./testing-utils"; +import { setupTests, setupActionsVars } from "./testing-utils"; import * as util from "./util"; setupTests(test); @@ -18,6 +18,8 @@ setupTests(test); test("status report fields and search path setting", async (t) => { let searchPathsUsed: string[] = []; return await util.withTmpDir(async (tmpDir) => { + setupActionsVars(tmpDir, tmpDir); + setCodeQL({ databaseAnalyze: async ( _, diff --git a/src/analyze.ts b/src/analyze.ts index fc48599f81..eef84810c6 100644 --- a/src/analyze.ts +++ b/src/analyze.ts @@ -3,7 +3,6 @@ import * as path from "path"; import * as toolrunner from "@actions/exec/lib/toolrunner"; -import * as actionsUtil from "./actions-util"; import * as analysisPaths from "./analysis-paths"; import { getCodeQL } from "./codeql"; import * as configUtils from "./config-utils"; @@ -169,7 +168,7 @@ export async function runQueries( new Date().getTime() - startTimeBuliltIn; } const startTimeCustom = new Date().getTime(); - const temporarySarifDir = actionsUtil.getTemporaryDirectory(); + const temporarySarifDir = config.tempDir; const temporarySarifFiles: string[] = []; for (let i = 0; i < queries["custom"].length; ++i) { if (queries["custom"][i].queries.length > 0) { diff --git a/src/codeql.test.ts b/src/codeql.test.ts index c919d3a707..bc7266238d 100644 --- a/src/codeql.test.ts +++ b/src/codeql.test.ts @@ -7,7 +7,7 @@ import nock from "nock"; import * as codeql from "./codeql"; import * as defaults from "./defaults.json"; import { getRunnerLogger } from "./logging"; -import { setupTests } from "./testing-utils"; +import { setupTests, setupActionsVars } from "./testing-utils"; import * as util from "./util"; setupTests(test); @@ -24,7 +24,7 @@ const sampleGHAEApiDetails = { test("download codeql bundle cache", async (t) => { await util.withTmpDir(async (tmpDir) => { - util.setupActionsVars(tmpDir, tmpDir); + setupActionsVars(tmpDir, tmpDir); const versions = ["20200601", "20200610"]; @@ -42,6 +42,7 @@ test("download codeql bundle cache", async (t) => { `https://example.com/download/codeql-bundle-${version}/codeql-bundle.tar.gz`, sampleApiDetails, tmpDir, + tmpDir, "runner", util.GitHubVariant.DOTCOM, getRunnerLogger(true) @@ -58,7 +59,7 @@ test("download codeql bundle cache", async (t) => { test("download codeql bundle cache explicitly requested with pinned different version cached", async (t) => { await util.withTmpDir(async (tmpDir) => { - util.setupActionsVars(tmpDir, tmpDir); + setupActionsVars(tmpDir, tmpDir); nock("https://example.com") .get(`/download/codeql-bundle-20200601/codeql-bundle.tar.gz`) @@ -71,6 +72,7 @@ test("download codeql bundle cache explicitly requested with pinned different ve "https://example.com/download/codeql-bundle-20200601/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, + tmpDir, "runner", util.GitHubVariant.DOTCOM, getRunnerLogger(true) @@ -89,6 +91,7 @@ test("download codeql bundle cache explicitly requested with pinned different ve "https://example.com/download/codeql-bundle-20200610/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, + tmpDir, "runner", util.GitHubVariant.DOTCOM, getRunnerLogger(true) @@ -100,7 +103,7 @@ test("download codeql bundle cache explicitly requested with pinned different ve test("don't download codeql bundle cache with pinned different version cached", async (t) => { await util.withTmpDir(async (tmpDir) => { - util.setupActionsVars(tmpDir, tmpDir); + setupActionsVars(tmpDir, tmpDir); nock("https://example.com") .get(`/download/codeql-bundle-20200601/codeql-bundle.tar.gz`) @@ -113,6 +116,7 @@ test("don't download codeql bundle cache with pinned different version cached", "https://example.com/download/codeql-bundle-20200601/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, + tmpDir, "runner", util.GitHubVariant.DOTCOM, getRunnerLogger(true) @@ -124,6 +128,7 @@ test("don't download codeql bundle cache with pinned different version cached", undefined, sampleApiDetails, tmpDir, + tmpDir, "runner", util.GitHubVariant.DOTCOM, getRunnerLogger(true) @@ -137,7 +142,7 @@ test("don't download codeql bundle cache with pinned different version cached", test("download codeql bundle cache with different version cached (not pinned)", async (t) => { await util.withTmpDir(async (tmpDir) => { - util.setupActionsVars(tmpDir, tmpDir); + setupActionsVars(tmpDir, tmpDir); nock("https://example.com") .get(`/download/codeql-bundle-20200601/codeql-bundle.tar.gz`) @@ -150,6 +155,7 @@ test("download codeql bundle cache with different version cached (not pinned)", "https://example.com/download/codeql-bundle-20200601/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, + tmpDir, "runner", util.GitHubVariant.DOTCOM, getRunnerLogger(true) @@ -176,6 +182,7 @@ test("download codeql bundle cache with different version cached (not pinned)", undefined, sampleApiDetails, tmpDir, + tmpDir, "runner", util.GitHubVariant.DOTCOM, getRunnerLogger(true) @@ -189,7 +196,7 @@ test("download codeql bundle cache with different version cached (not pinned)", test('download codeql bundle cache with pinned different version cached if "latest" tools specified', async (t) => { await util.withTmpDir(async (tmpDir) => { - util.setupActionsVars(tmpDir, tmpDir); + setupActionsVars(tmpDir, tmpDir); nock("https://example.com") .get(`/download/codeql-bundle-20200601/codeql-bundle.tar.gz`) @@ -202,6 +209,7 @@ test('download codeql bundle cache with pinned different version cached if "late "https://example.com/download/codeql-bundle-20200601/codeql-bundle.tar.gz", sampleApiDetails, tmpDir, + tmpDir, "runner", util.GitHubVariant.DOTCOM, getRunnerLogger(true) @@ -229,6 +237,7 @@ test('download codeql bundle cache with pinned different version cached if "late "latest", sampleApiDetails, tmpDir, + tmpDir, "runner", util.GitHubVariant.DOTCOM, getRunnerLogger(true) @@ -242,7 +251,7 @@ test('download codeql bundle cache with pinned different version cached if "late test("download codeql bundle from github ae endpoint", async (t) => { await util.withTmpDir(async (tmpDir) => { - util.setupActionsVars(tmpDir, tmpDir); + setupActionsVars(tmpDir, tmpDir); const bundleAssetID = 10; @@ -283,6 +292,7 @@ test("download codeql bundle from github ae endpoint", async (t) => { undefined, sampleGHAEApiDetails, tmpDir, + tmpDir, "runner", util.GitHubVariant.GHAE, getRunnerLogger(true) diff --git a/src/codeql.ts b/src/codeql.ts index a2dd37dea5..242e07dadf 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -6,7 +6,6 @@ import * as globalutil from "util"; import * as toolrunner from "@actions/exec/lib/toolrunner"; import * as http from "@actions/http-client"; import { IHeaders } from "@actions/http-client/interfaces"; -import * as toolcache from "@actions/tool-cache"; import { default as deepEqual } from "fast-deep-equal"; import { default as queryString } from "query-string"; import * as semver from "semver"; @@ -18,6 +17,7 @@ import * as defaults from "./defaults.json"; // Referenced from codeql-action-sy import { errorMatchers } from "./error-matcher"; import { Language } from "./languages"; import { Logger } from "./logging"; +import * as toolcache from "./toolcache"; import { toolrunnerErrorCatcher } from "./toolrunner-error-catcher"; import * as util from "./util"; @@ -282,6 +282,7 @@ export async function setupCodeQL( codeqlURL: string | undefined, apiDetails: api.GitHubApiDetails, tempDir: string, + toolCacheDir: string, mode: util.Mode, variant: util.GitHubVariant, logger: Logger @@ -300,15 +301,32 @@ export async function setupCodeQL( const codeqlURLSemVer = convertToSemVer(codeqlURLVersion, logger); // If we find the specified version, we always use that. - let codeqlFolder = toolcache.find("CodeQL", codeqlURLSemVer); + let codeqlFolder = toolcache.find( + "CodeQL", + codeqlURLSemVer, + mode, + toolCacheDir, + logger + ); // If we don't find the requested version, in some cases we may allow a // different version to save download time if the version hasn't been // specified explicitly (in which case we always honor it). if (!codeqlFolder && !codeqlURL && !forceLatest) { - const codeqlVersions = toolcache.findAllVersions("CodeQL"); + const codeqlVersions = toolcache.findAllVersions( + "CodeQL", + mode, + toolCacheDir, + logger + ); if (codeqlVersions.length === 1) { - const tmpCodeqlFolder = toolcache.find("CodeQL", codeqlVersions[0]); + const tmpCodeqlFolder = toolcache.find( + "CodeQL", + codeqlVersions[0], + mode, + toolCacheDir, + logger + ); if (fs.existsSync(path.join(tmpCodeqlFolder, "pinned-version"))) { logger.debug( `CodeQL in cache overriding the default ${CODEQL_BUNDLE_VERSION}` @@ -357,11 +375,19 @@ export async function setupCodeQL( ); logger.debug(`CodeQL bundle download to ${codeqlPath} complete.`); - const codeqlExtracted = await toolcache.extractTar(codeqlPath); + const codeqlExtracted = await toolcache.extractTar( + codeqlPath, + mode, + tempDir, + logger + ); codeqlFolder = await toolcache.cacheDir( codeqlExtracted, "CodeQL", - codeqlURLSemVer + codeqlURLSemVer, + mode, + toolCacheDir, + logger ); } diff --git a/src/init-action.ts b/src/init-action.ts index 197e3444e3..a7a31deae3 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -125,6 +125,7 @@ async function run() { actionsUtil.getOptionalInput("tools"), apiDetails, actionsUtil.getTemporaryDirectory(), + actionsUtil.getToolCacheDirectory(), "actions", gitHubVersion.type, logger diff --git a/src/init.ts b/src/init.ts index d5c43e48ec..f3a4999fdf 100644 --- a/src/init.ts +++ b/src/init.ts @@ -17,6 +17,7 @@ export async function initCodeQL( codeqlURL: string | undefined, apiDetails: GitHubApiDetails, tempDir: string, + toolCacheDir: string, mode: util.Mode, variant: util.GitHubVariant, logger: Logger @@ -26,6 +27,7 @@ export async function initCodeQL( codeqlURL, apiDetails, tempDir, + toolCacheDir, mode, variant, logger diff --git a/src/logging.ts b/src/logging.ts index 71c66fed7d..66e18a2442 100644 --- a/src/logging.ts +++ b/src/logging.ts @@ -6,6 +6,8 @@ export interface Logger { warning: (message: string) => void; error: (message: string) => void; + isDebug: () => boolean; + startGroup: (name: string) => void; endGroup: () => void; } @@ -20,6 +22,7 @@ export function getRunnerLogger(debugMode: boolean): Logger { info: console.info, warning: console.warn, error: console.error, + isDebug: () => debugMode, startGroup: () => undefined, endGroup: () => undefined, }; diff --git a/src/runner.ts b/src/runner.ts index d35ddc3d14..df25ef87d3 100644 --- a/src/runner.ts +++ b/src/runner.ts @@ -21,7 +21,6 @@ import { getThreadsFlag, parseGitHubUrl, getGitHubAuth, - setupActionsVars, } from "./util"; const program = new Command(); @@ -155,8 +154,6 @@ program const tempDir = getTempDir(cmd.tempDir); const toolsDir = getToolsDir(cmd.toolsDir); - setupActionsVars(tempDir, toolsDir); - // Wipe the temp dir logger.info(`Cleaning temp directory ${tempDir}`); fs.rmdirSync(tempDir, { recursive: true }); @@ -186,6 +183,7 @@ program undefined, apiDetails, tempDir, + toolsDir, "runner", gitHubVersion.type, logger @@ -297,7 +295,6 @@ program "Was the 'init' command run with the same '--temp-dir' argument as this command." ); } - setupActionsVars(config.tempDir, config.toolCacheDir); importTracerEnvironment(config); let language: Language | undefined = undefined; if (cmd.language !== undefined) { @@ -395,7 +392,6 @@ program "Was the 'init' command run with the same '--temp-dir' argument as this command." ); } - setupActionsVars(config.tempDir, config.toolCacheDir); const auth = await getGitHubAuth( logger, diff --git a/src/testing-utils.ts b/src/testing-utils.ts index 087718743c..1db7643d3d 100644 --- a/src/testing-utils.ts +++ b/src/testing-utils.ts @@ -82,3 +82,10 @@ export function setupTests(test: TestInterface) { process.env = t.context.env; }); } + +// Sets environment variables that make using some libraries designed for +// use only on actions safe to use outside of actions. +export function setupActionsVars(tempDir: string, toolsDir: string) { + process.env["RUNNER_TEMP"] = tempDir; + process.env["RUNNER_TOOL_CACHE"] = toolsDir; +} diff --git a/src/toolcache.ts b/src/toolcache.ts new file mode 100644 index 0000000000..e82cfee222 --- /dev/null +++ b/src/toolcache.ts @@ -0,0 +1,315 @@ +import * as fs from "fs"; +import * as os from "os"; +import * as path from "path"; + +import * as toolrunner from "@actions/exec/lib/toolrunner"; +import * as io from "@actions/io"; +import * as actionsToolcache from "@actions/tool-cache"; +import * as semver from "semver"; + +import { Logger } from "./logging"; +import { Mode } from "./util"; + +/* + * This file acts as an interface to the functionality of the actions toolcache. + * That library is not safe to use outside of actions as it makes assumptions about + * the state of the filesystem and available environment variables. + * + * On actions we can just delegates to the toolcache library, however outside of + * actions we provide our own implementation. + */ + +/** + * Extract a compressed tar archive. + * + * See extractTar function from node_modules/@actions/tool-cache/lib/tool-cache.d.ts + * + * @param file path to the tar + * @param mode should run the actions or runner implementation + * @param tempDir path to the temporary directory + * @param logger logger to use + * @returns path to the destination directory + */ +export async function extractTar( + file: string, + mode: Mode, + tempDir: string, + logger: Logger +): Promise { + if (mode === "actions") { + return await actionsToolcache.extractTar(file); + } else { + // Initial implementation copied from node_modules/@actions/tool-cache/lib/tool-cache.js + + if (!file) { + throw new Error("parameter 'file' is required"); + } + // Create dest + const dest = createExtractFolder(tempDir); + // Determine whether GNU tar + logger.debug("Checking tar --version"); + let versionOutput = ""; + await new toolrunner.ToolRunner("tar", ["--version"], { + ignoreReturnCode: true, + silent: true, + listeners: { + stdout: (data) => (versionOutput += data.toString()), + stderr: (data) => (versionOutput += data.toString()), + }, + }).exec(); + logger.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); + // Initialize args + const args = ["xz"]; + if (logger.isDebug()) { + args.push("-v"); + } + let destArg = dest; + let fileArg = file; + if (process.platform === "win32" && isGnuTar) { + args.push("--force-local"); + destArg = dest.replace(/\\/g, "/"); + // Technically only the dest needs to have `/` but for aesthetic consistency + // convert slashes in the file arg too. + fileArg = file.replace(/\\/g, "/"); + } + if (isGnuTar) { + // Suppress warnings when using GNU tar to extract archives created by BSD tar + args.push("--warning=no-unknown-keyword"); + } + args.push("-C", destArg, "-f", fileArg); + await new toolrunner.ToolRunner(`tar`, args).exec(); + return dest; + } +} + +/** + * Caches a directory and installs it into the tool cacheDir. + * + * Also see cacheDir function from node_modules/@actions/tool-cache/lib/tool-cache.d.ts + * + * @param sourceDir the directory to cache into tools + * @param tool tool name + * @param version version of the tool. semver format + * @param mode should run the actions or runner implementation + * @param toolCacheDir path to the tool cache directory + * @param logger logger to use + */ +export async function cacheDir( + sourceDir: string, + tool: string, + version: string, + mode: Mode, + toolCacheDir: string, + logger: Logger +): Promise { + if (mode === "actions") { + return await actionsToolcache.cacheDir(sourceDir, tool, version); + } else { + // Initial implementation copied from node_modules/@actions/tool-cache/lib/tool-cache.js + + version = semver.clean(version) || version; + const arch = os.arch(); + logger.debug(`Caching tool ${tool} ${version} ${arch}`); + logger.debug(`source dir: ${sourceDir}`); + if (!fs.statSync(sourceDir).isDirectory()) { + throw new Error("sourceDir is not a directory"); + } + // Create the tool dir + const destPath = createToolPath(tool, version, arch, toolCacheDir, logger); + // copy each child item. do not move. move can fail on Windows + // due to anti-virus software having an open handle on a file. + for (const itemName of fs.readdirSync(sourceDir)) { + const s = path.join(sourceDir, itemName); + await io.cp(s, destPath, { recursive: true }); + } + // write .complete + completeToolPath(tool, version, arch, toolCacheDir, logger); + return destPath; + } +} + +/** + * Finds the path to a tool version in the local installed tool cache. + * + * Also see find function from node_modules/@actions/tool-cache/lib/tool-cache.d.ts + * + * @param toolName name of the tool + * @param versionSpec version of the tool + * @param mode should run the actions or runner implementation + * @param toolCacheDir path to the tool cache directory + * @param logger logger to use + */ +export function find( + toolName: string, + versionSpec: string, + mode: Mode, + toolCacheDir: string, + logger: Logger +): string { + if (mode === "actions") { + return actionsToolcache.find(toolName, versionSpec); + } else { + // Initial implementation copied from node_modules/@actions/tool-cache/lib/tool-cache.js + + if (!toolName) { + throw new Error("toolName parameter is required"); + } + if (!versionSpec) { + throw new Error("versionSpec parameter is required"); + } + const arch = os.arch(); + // attempt to resolve an explicit version + if (!isExplicitVersion(versionSpec, logger)) { + const localVersions = findAllVersions( + toolName, + mode, + toolCacheDir, + logger + ); + const match = evaluateVersions(localVersions, versionSpec, logger); + versionSpec = match; + } + // check for the explicit version in the cache + let toolPath = ""; + if (versionSpec) { + versionSpec = semver.clean(versionSpec) || ""; + const cachePath = path.join(toolCacheDir, toolName, versionSpec, arch); + logger.debug(`checking cache: ${cachePath}`); + if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) { + logger.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); + toolPath = cachePath; + } else { + logger.debug("not found"); + } + } + return toolPath; + } +} + +/** + * Finds the paths to all versions of a tool that are installed in the local tool cache. + * + * Also see findAllVersions function from node_modules/@actions/tool-cache/lib/tool-cache.d.ts + * + * @param toolName name of the tool + * @param mode should run the actions or runner implementation + * @param toolCacheDir path to the tool cache directory + * @param logger logger to use + */ +export function findAllVersions( + toolName: string, + mode: Mode, + toolCacheDir: string, + logger: Logger +): string[] { + if (mode === "actions") { + return actionsToolcache.findAllVersions(toolName); + } else { + // Initial implementation copied from node_modules/@actions/tool-cache/lib/tool-cache.js + + const versions: string[] = []; + const arch = os.arch(); + const toolPath = path.join(toolCacheDir, toolName); + if (fs.existsSync(toolPath)) { + const children = fs.readdirSync(toolPath); + for (const child of children) { + if (isExplicitVersion(child, logger)) { + const fullPath = path.join(toolPath, child, arch || ""); + if ( + fs.existsSync(fullPath) && + fs.existsSync(`${fullPath}.complete`) + ) { + versions.push(child); + } + } + } + } + return versions; + } +} + +function createExtractFolder(tempDir: string): string { + // create a temp dir + const dest = path.join(tempDir, "toolcache-temp"); + if (!fs.existsSync(dest)) { + fs.mkdirSync(dest); + } + return dest; +} + +function createToolPath( + tool: string, + version: string, + arch: string, + toolCacheDir: string, + logger: Logger +): string { + const folderPath = path.join( + toolCacheDir, + tool, + semver.clean(version) || version, + arch || "" + ); + logger.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + fs.rmdirSync(folderPath, { recursive: true }); + fs.rmdirSync(markerPath, { recursive: true }); + fs.mkdirSync(folderPath, { recursive: true }); + return folderPath; +} + +function completeToolPath( + tool: string, + version: string, + arch: string, + toolCacheDir: string, + logger: Logger +) { + const folderPath = path.join( + toolCacheDir, + tool, + semver.clean(version) || version, + arch || "" + ); + const markerPath = `${folderPath}.complete`; + fs.writeFileSync(markerPath, ""); + logger.debug("finished caching tool"); +} + +function isExplicitVersion(versionSpec: string, logger: Logger) { + const c = semver.clean(versionSpec) || ""; + logger.debug(`isExplicit: ${c}`); + const valid = semver.valid(c) != null; + logger.debug(`explicit? ${valid}`); + return valid; +} + +function evaluateVersions( + versions: string[], + versionSpec: string, + logger: Logger +): string { + let version = ""; + logger.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver.gt(a, b)) { + return 1; + } + return -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; + } + } + if (version) { + logger.debug(`matched: ${version}`); + } else { + logger.debug("match not found"); + } + return version; +} diff --git a/src/util.ts b/src/util.ts index a2139626f2..852f328f7f 100644 --- a/src/util.ts +++ b/src/util.ts @@ -390,19 +390,3 @@ export async function getGitHubAuth( "No GitHub authentication token was specified. Please provide a token via the GITHUB_TOKEN environment variable, or by adding the `--github-auth-stdin` flag and passing the token via standard input." ); } - -// Sets environment variables that make using some libraries designed for -// use only on actions safe to use outside of actions. -// -// Obviously this is not a tremendously great thing we're doing and it -// would be better to write our own implementation of libraries to use -// outside of actions. For now this works well enough. -// -// Currently this list of libraries that is deemed to now be safe includes: -// - @actions/tool-cache -// -// Also see "queries/unguarded-action-lib.ql". -export function setupActionsVars(tempDir: string, toolsDir: string) { - process.env["RUNNER_TEMP"] = tempDir; - process.env["RUNNER_TOOL_CACHE"] = toolsDir; -} From c4a84a93d43771697bf9ca924c07a769b6205496 Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Thu, 22 Apr 2021 15:33:01 -0700 Subject: [PATCH 2/6] Add the github-linguist package This commit only adds a single package and all of its transitive dependencies. The github-linguist package will be used for counting lines of code as a baseline for databases we are analyzing. --- node_modules/.bin/loc | 1 + node_modules/array-uniq/index.js | 62 + node_modules/array-uniq/license | 21 + node_modules/array-uniq/package.json | 37 + node_modules/array-uniq/readme.md | 30 + node_modules/fs-extra/CHANGELOG.md | 796 ++ node_modules/fs-extra/LICENSE | 15 + node_modules/fs-extra/README.md | 242 + node_modules/fs-extra/docs/copy-sync.md | 37 + node_modules/fs-extra/docs/copy.md | 57 + node_modules/fs-extra/docs/emptyDir-sync.md | 16 + node_modules/fs-extra/docs/emptyDir.md | 30 + node_modules/fs-extra/docs/ensureDir-sync.md | 17 + node_modules/fs-extra/docs/ensureDir.md | 29 + node_modules/fs-extra/docs/ensureFile-sync.md | 17 + node_modules/fs-extra/docs/ensureFile.md | 29 + node_modules/fs-extra/docs/ensureLink-sync.md | 17 + node_modules/fs-extra/docs/ensureLink.md | 29 + .../fs-extra/docs/ensureSymlink-sync.md | 18 + node_modules/fs-extra/docs/ensureSymlink.md | 30 + node_modules/fs-extra/docs/fs-read-write.md | 39 + node_modules/fs-extra/docs/move-sync.md | 24 + node_modules/fs-extra/docs/move.md | 41 + node_modules/fs-extra/docs/outputFile-sync.md | 19 + node_modules/fs-extra/docs/outputFile.md | 34 + node_modules/fs-extra/docs/outputJson-sync.md | 25 + node_modules/fs-extra/docs/outputJson.md | 40 + node_modules/fs-extra/docs/pathExists-sync.md | 3 + node_modules/fs-extra/docs/pathExists.md | 22 + node_modules/fs-extra/docs/readJson-sync.md | 33 + node_modules/fs-extra/docs/readJson.md | 58 + node_modules/fs-extra/docs/remove-sync.md | 16 + node_modules/fs-extra/docs/remove.md | 34 + node_modules/fs-extra/docs/writeJson-sync.md | 24 + node_modules/fs-extra/docs/writeJson.md | 39 + .../fs-extra/lib/copy-sync/copy-file-sync.js | 41 + .../fs-extra/lib/copy-sync/copy-sync.js | 62 + node_modules/fs-extra/lib/copy-sync/index.js | 3 + node_modules/fs-extra/lib/copy/copy.js | 54 + node_modules/fs-extra/lib/copy/index.js | 4 + node_modules/fs-extra/lib/copy/ncp.js | 234 + node_modules/fs-extra/lib/empty/index.js | 48 + node_modules/fs-extra/lib/ensure/file.js | 49 + node_modules/fs-extra/lib/ensure/index.js | 23 + node_modules/fs-extra/lib/ensure/link.js | 61 + .../fs-extra/lib/ensure/symlink-paths.js | 99 + .../fs-extra/lib/ensure/symlink-type.js | 31 + node_modules/fs-extra/lib/ensure/symlink.js | 66 + node_modules/fs-extra/lib/fs/index.js | 107 + node_modules/fs-extra/lib/index.js | 22 + node_modules/fs-extra/lib/json/index.js | 16 + node_modules/fs-extra/lib/json/jsonfile.js | 12 + .../fs-extra/lib/json/output-json-sync.js | 18 + node_modules/fs-extra/lib/json/output-json.js | 27 + node_modules/fs-extra/lib/mkdirs/index.js | 14 + .../fs-extra/lib/mkdirs/mkdirs-sync.js | 59 + node_modules/fs-extra/lib/mkdirs/mkdirs.js | 63 + node_modules/fs-extra/lib/mkdirs/win32.js | 25 + node_modules/fs-extra/lib/move-sync/index.js | 118 + node_modules/fs-extra/lib/move/index.js | 170 + node_modules/fs-extra/lib/output/index.js | 40 + .../fs-extra/lib/path-exists/index.js | 12 + node_modules/fs-extra/lib/remove/index.js | 9 + node_modules/fs-extra/lib/remove/rimraf.js | 314 + node_modules/fs-extra/lib/util/assign.js | 16 + node_modules/fs-extra/lib/util/buffer.js | 11 + node_modules/fs-extra/lib/util/utimes.js | 72 + node_modules/fs-extra/package.json | 64 + node_modules/github-linguist/.eslintignore | 5 + node_modules/github-linguist/.eslintrc.js | 3 + .../github-linguist/.github/workflows/ci.yml | 26 + node_modules/github-linguist/.prettierrc.js | 5 + node_modules/github-linguist/README.md | 71 + node_modules/github-linguist/dist/cli.d.ts | 2 + node_modules/github-linguist/dist/cli.js | 57 + node_modules/github-linguist/dist/cli.js.map | 1 + .../github-linguist/dist/directory.d.ts | 28 + .../github-linguist/dist/directory.js | 116 + .../github-linguist/dist/directory.js.map | 1 + node_modules/github-linguist/dist/file.d.ts | 37 + node_modules/github-linguist/dist/file.js | 198 + node_modules/github-linguist/dist/file.js.map | 1 + node_modules/github-linguist/dist/index.d.ts | 5 + node_modules/github-linguist/dist/index.js | 31 + .../github-linguist/dist/index.js.map | 1 + .../github-linguist/dist/languages.d.ts | 43 + .../github-linguist/dist/languages.js | 136 + .../github-linguist/dist/languages.js.map | 1 + node_modules/github-linguist/dist/utils.d.ts | 13 + node_modules/github-linguist/dist/utils.js | 29 + .../github-linguist/dist/utils.js.map | 1 + .../node_modules/array-union/index.js | 6 + .../node_modules/array-union/license | 21 + .../node_modules/array-union/package.json | 40 + .../node_modules/array-union/readme.md | 28 + .../node_modules/commander/CHANGELOG.md | 419 + .../node_modules/commander/LICENSE | 22 + .../node_modules/commander/Readme.md | 428 ++ .../node_modules/commander/index.js | 1224 +++ .../node_modules/commander/package.json | 38 + .../node_modules/commander/typings/index.d.ts | 310 + .../node_modules/globby/index.js | 88 + .../node_modules/globby/license | 21 + .../node_modules/globby/package.json | 69 + .../node_modules/globby/readme.md | 88 + .../node_modules/pify/index.js | 68 + .../github-linguist/node_modules/pify/license | 21 + .../node_modules/pify/package.json | 48 + .../node_modules/pify/readme.md | 119 + node_modules/github-linguist/package.json | 66 + node_modules/github-linguist/src/cli.ts | 69 + node_modules/github-linguist/src/directory.ts | 127 + node_modules/github-linguist/src/file.ts | 179 + node_modules/github-linguist/src/index.ts | 29 + node_modules/github-linguist/src/justify.json | 4 + node_modules/github-linguist/src/languages.ts | 176 + node_modules/github-linguist/src/utils.ts | 25 + node_modules/github-linguist/tsconfig.json | 19 + node_modules/jsonfile/CHANGELOG.md | 145 + node_modules/jsonfile/LICENSE | 15 + node_modules/jsonfile/README.md | 168 + node_modules/jsonfile/index.js | 134 + node_modules/jsonfile/package.json | 37 + node_modules/language-map/.travis.yml | 11 + node_modules/language-map/LICENSE | 21 + node_modules/language-map/README.md | 78 + node_modules/language-map/languages.json | 6762 +++++++++++++++++ node_modules/language-map/package.json | 36 + node_modules/language-map/scripts/build | 36 + node_modules/language-map/test.js | 11 + node_modules/object-assign/index.js | 90 + node_modules/object-assign/license | 21 + node_modules/object-assign/package.json | 42 + node_modules/object-assign/readme.md | 61 + node_modules/pinkie-promise/index.js | 3 + node_modules/pinkie-promise/license | 21 + node_modules/pinkie-promise/package.json | 35 + node_modules/pinkie-promise/readme.md | 28 + node_modules/pinkie/index.js | 292 + node_modules/pinkie/license | 21 + node_modules/pinkie/package.json | 36 + node_modules/pinkie/readme.md | 83 + node_modules/slash2/index.js | 10 + node_modules/slash2/license | 9 + node_modules/slash2/package.json | 34 + node_modules/slash2/readme.md | 44 + node_modules/universalify/LICENSE | 20 + node_modules/universalify/README.md | 76 + node_modules/universalify/index.js | 25 + node_modules/universalify/package.json | 34 + package-lock.json | 133 +- package.json | 1 + 152 files changed, 17057 insertions(+), 24 deletions(-) create mode 120000 node_modules/.bin/loc create mode 100644 node_modules/array-uniq/index.js create mode 100644 node_modules/array-uniq/license create mode 100644 node_modules/array-uniq/package.json create mode 100644 node_modules/array-uniq/readme.md create mode 100644 node_modules/fs-extra/CHANGELOG.md create mode 100644 node_modules/fs-extra/LICENSE create mode 100644 node_modules/fs-extra/README.md create mode 100644 node_modules/fs-extra/docs/copy-sync.md create mode 100644 node_modules/fs-extra/docs/copy.md create mode 100644 node_modules/fs-extra/docs/emptyDir-sync.md create mode 100644 node_modules/fs-extra/docs/emptyDir.md create mode 100644 node_modules/fs-extra/docs/ensureDir-sync.md create mode 100644 node_modules/fs-extra/docs/ensureDir.md create mode 100644 node_modules/fs-extra/docs/ensureFile-sync.md create mode 100644 node_modules/fs-extra/docs/ensureFile.md create mode 100644 node_modules/fs-extra/docs/ensureLink-sync.md create mode 100644 node_modules/fs-extra/docs/ensureLink.md create mode 100644 node_modules/fs-extra/docs/ensureSymlink-sync.md create mode 100644 node_modules/fs-extra/docs/ensureSymlink.md create mode 100644 node_modules/fs-extra/docs/fs-read-write.md create mode 100644 node_modules/fs-extra/docs/move-sync.md create mode 100644 node_modules/fs-extra/docs/move.md create mode 100644 node_modules/fs-extra/docs/outputFile-sync.md create mode 100644 node_modules/fs-extra/docs/outputFile.md create mode 100644 node_modules/fs-extra/docs/outputJson-sync.md create mode 100644 node_modules/fs-extra/docs/outputJson.md create mode 100644 node_modules/fs-extra/docs/pathExists-sync.md create mode 100644 node_modules/fs-extra/docs/pathExists.md create mode 100644 node_modules/fs-extra/docs/readJson-sync.md create mode 100644 node_modules/fs-extra/docs/readJson.md create mode 100644 node_modules/fs-extra/docs/remove-sync.md create mode 100644 node_modules/fs-extra/docs/remove.md create mode 100644 node_modules/fs-extra/docs/writeJson-sync.md create mode 100644 node_modules/fs-extra/docs/writeJson.md create mode 100644 node_modules/fs-extra/lib/copy-sync/copy-file-sync.js create mode 100644 node_modules/fs-extra/lib/copy-sync/copy-sync.js create mode 100644 node_modules/fs-extra/lib/copy-sync/index.js create mode 100644 node_modules/fs-extra/lib/copy/copy.js create mode 100644 node_modules/fs-extra/lib/copy/index.js create mode 100644 node_modules/fs-extra/lib/copy/ncp.js create mode 100644 node_modules/fs-extra/lib/empty/index.js create mode 100644 node_modules/fs-extra/lib/ensure/file.js create mode 100644 node_modules/fs-extra/lib/ensure/index.js create mode 100644 node_modules/fs-extra/lib/ensure/link.js create mode 100644 node_modules/fs-extra/lib/ensure/symlink-paths.js create mode 100644 node_modules/fs-extra/lib/ensure/symlink-type.js create mode 100644 node_modules/fs-extra/lib/ensure/symlink.js create mode 100644 node_modules/fs-extra/lib/fs/index.js create mode 100644 node_modules/fs-extra/lib/index.js create mode 100644 node_modules/fs-extra/lib/json/index.js create mode 100644 node_modules/fs-extra/lib/json/jsonfile.js create mode 100644 node_modules/fs-extra/lib/json/output-json-sync.js create mode 100644 node_modules/fs-extra/lib/json/output-json.js create mode 100644 node_modules/fs-extra/lib/mkdirs/index.js create mode 100644 node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js create mode 100644 node_modules/fs-extra/lib/mkdirs/mkdirs.js create mode 100644 node_modules/fs-extra/lib/mkdirs/win32.js create mode 100644 node_modules/fs-extra/lib/move-sync/index.js create mode 100644 node_modules/fs-extra/lib/move/index.js create mode 100644 node_modules/fs-extra/lib/output/index.js create mode 100644 node_modules/fs-extra/lib/path-exists/index.js create mode 100644 node_modules/fs-extra/lib/remove/index.js create mode 100644 node_modules/fs-extra/lib/remove/rimraf.js create mode 100644 node_modules/fs-extra/lib/util/assign.js create mode 100644 node_modules/fs-extra/lib/util/buffer.js create mode 100644 node_modules/fs-extra/lib/util/utimes.js create mode 100644 node_modules/fs-extra/package.json create mode 100644 node_modules/github-linguist/.eslintignore create mode 100644 node_modules/github-linguist/.eslintrc.js create mode 100644 node_modules/github-linguist/.github/workflows/ci.yml create mode 100644 node_modules/github-linguist/.prettierrc.js create mode 100644 node_modules/github-linguist/README.md create mode 100644 node_modules/github-linguist/dist/cli.d.ts create mode 100755 node_modules/github-linguist/dist/cli.js create mode 100644 node_modules/github-linguist/dist/cli.js.map create mode 100644 node_modules/github-linguist/dist/directory.d.ts create mode 100644 node_modules/github-linguist/dist/directory.js create mode 100644 node_modules/github-linguist/dist/directory.js.map create mode 100644 node_modules/github-linguist/dist/file.d.ts create mode 100644 node_modules/github-linguist/dist/file.js create mode 100644 node_modules/github-linguist/dist/file.js.map create mode 100644 node_modules/github-linguist/dist/index.d.ts create mode 100644 node_modules/github-linguist/dist/index.js create mode 100644 node_modules/github-linguist/dist/index.js.map create mode 100644 node_modules/github-linguist/dist/languages.d.ts create mode 100644 node_modules/github-linguist/dist/languages.js create mode 100644 node_modules/github-linguist/dist/languages.js.map create mode 100644 node_modules/github-linguist/dist/utils.d.ts create mode 100644 node_modules/github-linguist/dist/utils.js create mode 100644 node_modules/github-linguist/dist/utils.js.map create mode 100644 node_modules/github-linguist/node_modules/array-union/index.js create mode 100644 node_modules/github-linguist/node_modules/array-union/license create mode 100644 node_modules/github-linguist/node_modules/array-union/package.json create mode 100644 node_modules/github-linguist/node_modules/array-union/readme.md create mode 100644 node_modules/github-linguist/node_modules/commander/CHANGELOG.md create mode 100644 node_modules/github-linguist/node_modules/commander/LICENSE create mode 100644 node_modules/github-linguist/node_modules/commander/Readme.md create mode 100644 node_modules/github-linguist/node_modules/commander/index.js create mode 100644 node_modules/github-linguist/node_modules/commander/package.json create mode 100644 node_modules/github-linguist/node_modules/commander/typings/index.d.ts create mode 100644 node_modules/github-linguist/node_modules/globby/index.js create mode 100644 node_modules/github-linguist/node_modules/globby/license create mode 100644 node_modules/github-linguist/node_modules/globby/package.json create mode 100644 node_modules/github-linguist/node_modules/globby/readme.md create mode 100644 node_modules/github-linguist/node_modules/pify/index.js create mode 100644 node_modules/github-linguist/node_modules/pify/license create mode 100644 node_modules/github-linguist/node_modules/pify/package.json create mode 100644 node_modules/github-linguist/node_modules/pify/readme.md create mode 100644 node_modules/github-linguist/package.json create mode 100644 node_modules/github-linguist/src/cli.ts create mode 100644 node_modules/github-linguist/src/directory.ts create mode 100644 node_modules/github-linguist/src/file.ts create mode 100644 node_modules/github-linguist/src/index.ts create mode 100644 node_modules/github-linguist/src/justify.json create mode 100644 node_modules/github-linguist/src/languages.ts create mode 100644 node_modules/github-linguist/src/utils.ts create mode 100644 node_modules/github-linguist/tsconfig.json create mode 100644 node_modules/jsonfile/CHANGELOG.md create mode 100644 node_modules/jsonfile/LICENSE create mode 100644 node_modules/jsonfile/README.md create mode 100644 node_modules/jsonfile/index.js create mode 100644 node_modules/jsonfile/package.json create mode 100644 node_modules/language-map/.travis.yml create mode 100644 node_modules/language-map/LICENSE create mode 100644 node_modules/language-map/README.md create mode 100644 node_modules/language-map/languages.json create mode 100644 node_modules/language-map/package.json create mode 100644 node_modules/language-map/scripts/build create mode 100644 node_modules/language-map/test.js create mode 100644 node_modules/object-assign/index.js create mode 100644 node_modules/object-assign/license create mode 100644 node_modules/object-assign/package.json create mode 100644 node_modules/object-assign/readme.md create mode 100644 node_modules/pinkie-promise/index.js create mode 100644 node_modules/pinkie-promise/license create mode 100644 node_modules/pinkie-promise/package.json create mode 100644 node_modules/pinkie-promise/readme.md create mode 100644 node_modules/pinkie/index.js create mode 100644 node_modules/pinkie/license create mode 100644 node_modules/pinkie/package.json create mode 100644 node_modules/pinkie/readme.md create mode 100644 node_modules/slash2/index.js create mode 100644 node_modules/slash2/license create mode 100644 node_modules/slash2/package.json create mode 100644 node_modules/slash2/readme.md create mode 100644 node_modules/universalify/LICENSE create mode 100644 node_modules/universalify/README.md create mode 100644 node_modules/universalify/index.js create mode 100644 node_modules/universalify/package.json diff --git a/node_modules/.bin/loc b/node_modules/.bin/loc new file mode 120000 index 0000000000..966723a58b --- /dev/null +++ b/node_modules/.bin/loc @@ -0,0 +1 @@ +../github-linguist/dist/cli.js \ No newline at end of file diff --git a/node_modules/array-uniq/index.js b/node_modules/array-uniq/index.js new file mode 100644 index 0000000000..edd09f8114 --- /dev/null +++ b/node_modules/array-uniq/index.js @@ -0,0 +1,62 @@ +'use strict'; + +// there's 3 implementations written in increasing order of efficiency + +// 1 - no Set type is defined +function uniqNoSet(arr) { + var ret = []; + + for (var i = 0; i < arr.length; i++) { + if (ret.indexOf(arr[i]) === -1) { + ret.push(arr[i]); + } + } + + return ret; +} + +// 2 - a simple Set type is defined +function uniqSet(arr) { + var seen = new Set(); + return arr.filter(function (el) { + if (!seen.has(el)) { + seen.add(el); + return true; + } + + return false; + }); +} + +// 3 - a standard Set type is defined and it has a forEach method +function uniqSetWithForEach(arr) { + var ret = []; + + (new Set(arr)).forEach(function (el) { + ret.push(el); + }); + + return ret; +} + +// V8 currently has a broken implementation +// https://github.com/joyent/node/issues/8449 +function doesForEachActuallyWork() { + var ret = false; + + (new Set([true])).forEach(function (el) { + ret = el; + }); + + return ret === true; +} + +if ('Set' in global) { + if (typeof Set.prototype.forEach === 'function' && doesForEachActuallyWork()) { + module.exports = uniqSetWithForEach; + } else { + module.exports = uniqSet; + } +} else { + module.exports = uniqNoSet; +} diff --git a/node_modules/array-uniq/license b/node_modules/array-uniq/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/node_modules/array-uniq/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/array-uniq/package.json b/node_modules/array-uniq/package.json new file mode 100644 index 0000000000..cf9a6c7421 --- /dev/null +++ b/node_modules/array-uniq/package.json @@ -0,0 +1,37 @@ +{ + "name": "array-uniq", + "version": "1.0.3", + "description": "Create an array without duplicates", + "license": "MIT", + "repository": "sindresorhus/array-uniq", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "array", + "arr", + "set", + "uniq", + "unique", + "es6", + "duplicate", + "remove" + ], + "devDependencies": { + "ava": "*", + "es6-set": "^0.1.0", + "require-uncached": "^1.0.2", + "xo": "*" + } +} \ No newline at end of file diff --git a/node_modules/array-uniq/readme.md b/node_modules/array-uniq/readme.md new file mode 100644 index 0000000000..f0bd98c4f0 --- /dev/null +++ b/node_modules/array-uniq/readme.md @@ -0,0 +1,30 @@ +# array-uniq [![Build Status](https://travis-ci.org/sindresorhus/array-uniq.svg?branch=master)](https://travis-ci.org/sindresorhus/array-uniq) + +> Create an array without duplicates + +It's already pretty fast, but will be much faster when [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) becomes available in V8 (especially with large arrays). + + +## Install + +``` +$ npm install --save array-uniq +``` + + +## Usage + +```js +const arrayUniq = require('array-uniq'); + +arrayUniq([1, 1, 2, 3, 3]); +//=> [1, 2, 3] + +arrayUniq(['foo', 'foo', 'bar', 'foo']); +//=> ['foo', 'bar'] +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/fs-extra/CHANGELOG.md b/node_modules/fs-extra/CHANGELOG.md new file mode 100644 index 0000000000..29a37b521e --- /dev/null +++ b/node_modules/fs-extra/CHANGELOG.md @@ -0,0 +1,796 @@ +4.0.3 / 2017-12-05 +------------------ + +- Fix wrong `chmod` values in `fs.remove()` [#501](https://github.com/jprichardson/node-fs-extra/pull/501) +- Fix `TypeError` on systems that don't have some `fs` operations like `lchown` [#520](https://github.com/jprichardson/node-fs-extra/pull/520) + +4.0.2 / 2017-09-12 +------------------ + +- Added `EOL` option to `writeJson*` & `outputJson*` (via upgrade to jsonfile v4) +- Added promise support to [`fs.copyFile()`](https://nodejs.org/api/fs.html#fs_fs_copyfile_src_dest_flags_callback) in Node 8.5+ +- Added `.js` extension to `main` field in `package.json` for better tooling compatibility. [#485](https://github.com/jprichardson/node-fs-extra/pull/485) + +4.0.1 / 2017-07-31 +------------------ + +### Fixed + +- Previously, `ensureFile()` & `ensureFileSync()` would do nothing if the path was a directory. Now, they error out for consistency with `ensureDir()`. [#465](https://github.com/jprichardson/node-fs-extra/issues/465), [#466](https://github.com/jprichardson/node-fs-extra/pull/466), [#470](https://github.com/jprichardson/node-fs-extra/issues/470) + +4.0.0 / 2017-07-14 +------------------ + +### Changed + +- **BREAKING:** The promisified versions of `fs.read()` & `fs.write()` now return objects. See [the docs](docs/fs-read-write.md) for details. [#436](https://github.com/jprichardson/node-fs-extra/issues/436), [#449](https://github.com/jprichardson/node-fs-extra/pull/449) +- `fs.move()` now errors out when destination is a subdirectory of source. [#458](https://github.com/jprichardson/node-fs-extra/pull/458) +- Applied upstream fixes from `rimraf` to `fs.remove()` & `fs.removeSync()`. [#459](https://github.com/jprichardson/node-fs-extra/pull/459) + +### Fixed + +- Got `fs.outputJSONSync()` working again; it was broken due to refactoring. [#428](https://github.com/jprichardson/node-fs-extra/pull/428) + +Also clarified the docs in a few places. + +3.0.1 / 2017-05-04 +------------------ + +- Fix bug in `move()` & `moveSync()` when source and destination are the same, and source does not exist. [#415](https://github.com/jprichardson/node-fs-extra/pull/415) + +3.0.0 / 2017-04-27 +------------------ + +### Added + +- **BREAKING:** Added Promise support. All asynchronous native fs methods and fs-extra methods now return a promise if the callback is not passed. [#403](https://github.com/jprichardson/node-fs-extra/pull/403) +- `pathExists()`, a replacement for the deprecated `fs.exists`. `pathExists` has a normal error-first callback signature. Also added `pathExistsSync`, an alias to `fs.existsSync`, for completeness. [#406](https://github.com/jprichardson/node-fs-extra/pull/406) + +### Removed + +- **BREAKING:** Removed support for setting the default spaces for `writeJson()`, `writeJsonSync()`, `outputJson()`, & `outputJsonSync()`. This was undocumented. [#402](https://github.com/jprichardson/node-fs-extra/pull/402) + +### Changed + +- Upgraded jsonfile dependency to v3.0.0: + - **BREAKING:** Changed behavior of `throws` option for `readJsonSync()`; now does not throw filesystem errors when `throws` is `false`. +- **BREAKING:** `writeJson()`, `writeJsonSync()`, `outputJson()`, & `outputJsonSync()` now output minified JSON by default for consistency with `JSON.stringify()`; set the `spaces` option to `2` to override this new behavior. [#402](https://github.com/jprichardson/node-fs-extra/pull/402) +- Use `Buffer.allocUnsafe()` instead of `new Buffer()` in environments that support it. [#394](https://github.com/jprichardson/node-fs-extra/pull/394) + +### Fixed + +- `removeSync()` silently failed on Windows in some cases. Now throws an `EBUSY` error. [#408](https://github.com/jprichardson/node-fs-extra/pull/408) + +2.1.2 / 2017-03-16 +------------------ + +### Fixed + +- Weird windows bug that resulted in `ensureDir()`'s callback being called twice in some cases. This bug may have also affected `remove()`. See [#392](https://github.com/jprichardson/node-fs-extra/issues/392), [#393](https://github.com/jprichardson/node-fs-extra/pull/393) + +2.1.1 / 2017-03-15 +------------------ + +### Fixed + +- Reverted [`5597bd`](https://github.com/jprichardson/node-fs-extra/commit/5597bd5b67f7d060f5f5bf26e9635be48330f5d7), this broke compatibility with Node.js versions v4+ but less than `v4.5.0`. +- Remove `Buffer.alloc()` usage in `moveSync()`. + +2.1.0 / 2017-03-15 +------------------ + +Thanks to [Mani Maghsoudlou (@manidlou)](https://github.com/manidlou) & [Jan Peer Stöcklmair (@JPeer264)](https://github.com/JPeer264) for their extraordinary help with this release! + +### Added +- `moveSync()` See [#309], [#381](https://github.com/jprichardson/node-fs-extra/pull/381). ([@manidlou](https://github.com/manidlou)) +- `copy()` and `copySync()`'s `filter` option now gets the destination path passed as the second parameter. [#366](https://github.com/jprichardson/node-fs-extra/pull/366) ([@manidlou](https://github.com/manidlou)) + +### Changed +- Use `Buffer.alloc()` instead of deprecated `new Buffer()` in `copySync()`. [#380](https://github.com/jprichardson/node-fs-extra/pull/380) ([@manidlou](https://github.com/manidlou)) +- Refactored entire codebase to use ES6 features supported by Node.js v4+ [#355](https://github.com/jprichardson/node-fs-extra/issues/355). [(@JPeer264)](https://github.com/JPeer264) +- Refactored docs. ([@manidlou](https://github.com/manidlou)) + +### Fixed + +- `move()` shouldn't error out when source and dest are the same. [#377](https://github.com/jprichardson/node-fs-extra/issues/377), [#378](https://github.com/jprichardson/node-fs-extra/pull/378) ([@jdalton](https://github.com/jdalton)) + +2.0.0 / 2017-01-16 +------------------ + +### Removed +- **BREAKING:** Removed support for Node `v0.12`. The Node foundation stopped officially supporting it +on Jan 1st, 2017. +- **BREAKING:** Remove `walk()` and `walkSync()`. `walkSync()` was only part of `fs-extra` for a little +over two months. Use [klaw](https://github.com/jprichardson/node-klaw) instead of `walk()`, in fact, `walk()` was just +an alias to klaw. For `walkSync()` use [klaw-sync](https://github.com/mawni/node-klaw-sync). See: [#338], [#339] + +### Changed +- **BREAKING:** Renamed `clobber` to `overwrite`. This affects `copy()`, `copySync()`, and `move()`. [#330], [#333] +- Moved docs, to `docs/`. [#340] + +### Fixed +- Apply filters to directories in `copySync()` like in `copy()`. [#324] +- A specific condition when disk is under heavy use, `copy()` can fail. [#326] + + +1.0.0 / 2016-11-01 +------------------ + +After five years of development, we finally have reach the 1.0.0 milestone! Big thanks goes +to [Ryan Zim](https://github.com/RyanZim) for leading the charge on this release! + +### Added +- `walkSync()` + +### Changed +- **BREAKING**: dropped Node v0.10 support. +- disabled `rimaf` globbing, wasn't used. [#280] +- deprecate `copy()/copySync()` option `filter` if it's a `RegExp`. `filter` should now be a function. +- inline `rimraf`. This is temporary and was done because `rimraf` depended upon the beefy `glob` which `fs-extra` does not use. [#300] + +### Fixed +- bug fix proper closing of file handle on `utimesMillis()` [#271] +- proper escaping of files with dollar signs [#291] +- `copySync()` failed if user didn't own file. [#199], [#301] + + +0.30.0 / 2016-04-28 +------------------- +- Brought back Node v0.10 support. I didn't realize there was still demand. Official support will end **2016-10-01**. + +0.29.0 / 2016-04-27 +------------------- +- **BREAKING**: removed support for Node v0.10. If you still want to use Node v0.10, everything should work except for `ensureLink()/ensureSymlink()`. Node v0.12 is still supported but will be dropped in the near future as well. + +0.28.0 / 2016-04-17 +------------------- +- **BREAKING**: removed `createOutputStream()`. Use https://www.npmjs.com/package/create-output-stream. See: [#192][#192] +- `mkdirs()/mkdirsSync()` check for invalid win32 path chars. See: [#209][#209], [#237][#237] +- `mkdirs()/mkdirsSync()` if drive not mounted, error. See: [#93][#93] + +0.27.0 / 2016-04-15 +------------------- +- add `dereference` option to `copySync()`. [#235][#235] + +0.26.7 / 2016-03-16 +------------------- +- fixed `copy()` if source and dest are the same. [#230][#230] + +0.26.6 / 2016-03-15 +------------------- +- fixed if `emptyDir()` does not have a callback: [#229][#229] + +0.26.5 / 2016-01-27 +------------------- +- `copy()` with two arguments (w/o callback) was broken. See: [#215][#215] + +0.26.4 / 2016-01-05 +------------------- +- `copySync()` made `preserveTimestamps` default consistent with `copy()` which is `false`. See: [#208][#208] + +0.26.3 / 2015-12-17 +------------------- +- fixed `copy()` hangup in copying blockDevice / characterDevice / `/dev/null`. See: [#193][#193] + +0.26.2 / 2015-11-02 +------------------- +- fixed `outputJson{Sync}()` spacing adherence to `fs.spaces` + +0.26.1 / 2015-11-02 +------------------- +- fixed `copySync()` when `clogger=true` and the destination is read only. See: [#190][#190] + +0.26.0 / 2015-10-25 +------------------- +- extracted the `walk()` function into its own module [`klaw`](https://github.com/jprichardson/node-klaw). + +0.25.0 / 2015-10-24 +------------------- +- now has a file walker `walk()` + +0.24.0 / 2015-08-28 +------------------- +- removed alias `delete()` and `deleteSync()`. See: [#171][#171] + +0.23.1 / 2015-08-07 +------------------- +- Better handling of errors for `move()` when moving across devices. [#170][#170] +- `ensureSymlink()` and `ensureLink()` should not throw errors if link exists. [#169][#169] + +0.23.0 / 2015-08-06 +------------------- +- added `ensureLink{Sync}()` and `ensureSymlink{Sync}()`. See: [#165][#165] + +0.22.1 / 2015-07-09 +------------------- +- Prevent calling `hasMillisResSync()` on module load. See: [#149][#149]. +Fixes regression that was introduced in `0.21.0`. + +0.22.0 / 2015-07-09 +------------------- +- preserve permissions / ownership in `copy()`. See: [#54][#54] + +0.21.0 / 2015-07-04 +------------------- +- add option to preserve timestamps in `copy()` and `copySync()`. See: [#141][#141] +- updated `graceful-fs@3.x` to `4.x`. This brings in features from `amazing-graceful-fs` (much cleaner code / less hacks) + +0.20.1 / 2015-06-23 +------------------- +- fixed regression caused by latest jsonfile update: See: https://github.com/jprichardson/node-jsonfile/issues/26 + +0.20.0 / 2015-06-19 +------------------- +- removed `jsonfile` aliases with `File` in the name, they weren't documented and probably weren't in use e.g. +this package had both `fs.readJsonFile` and `fs.readJson` that were aliases to each other, now use `fs.readJson`. +- preliminary walker created. Intentionally not documented. If you use it, it will almost certainly change and break your code. +- started moving tests inline +- upgraded to `jsonfile@2.1.0`, can now pass JSON revivers/replacers to `readJson()`, `writeJson()`, `outputJson()` + +0.19.0 / 2015-06-08 +------------------- +- `fs.copy()` had support for Node v0.8, dropped support + +0.18.4 / 2015-05-22 +------------------- +- fixed license field according to this: [#136][#136] and https://github.com/npm/npm/releases/tag/v2.10.0 + +0.18.3 / 2015-05-08 +------------------- +- bugfix: handle `EEXIST` when clobbering on some Linux systems. [#134][#134] + +0.18.2 / 2015-04-17 +------------------- +- bugfix: allow `F_OK` ([#120][#120]) + +0.18.1 / 2015-04-15 +------------------- +- improved windows support for `move()` a bit. https://github.com/jprichardson/node-fs-extra/commit/92838980f25dc2ee4ec46b43ee14d3c4a1d30c1b +- fixed a lot of tests for Windows (appveyor) + +0.18.0 / 2015-03-31 +------------------- +- added `emptyDir()` and `emptyDirSync()` + +0.17.0 / 2015-03-28 +------------------- +- `copySync` added `clobber` option (before always would clobber, now if `clobber` is `false` it throws an error if the destination exists). +**Only works with files at the moment.** +- `createOutputStream()` added. See: [#118][#118] + +0.16.5 / 2015-03-08 +------------------- +- fixed `fs.move` when `clobber` is `true` and destination is a directory, it should clobber. [#114][#114] + +0.16.4 / 2015-03-01 +------------------- +- `fs.mkdirs` fix infinite loop on Windows. See: See https://github.com/substack/node-mkdirp/pull/74 and https://github.com/substack/node-mkdirp/issues/66 + +0.16.3 / 2015-01-28 +------------------- +- reverted https://github.com/jprichardson/node-fs-extra/commit/1ee77c8a805eba5b99382a2591ff99667847c9c9 + + +0.16.2 / 2015-01-28 +------------------- +- fixed `fs.copy` for Node v0.8 (support is temporary and will be removed in the near future) + +0.16.1 / 2015-01-28 +------------------- +- if `setImmediate` is not available, fall back to `process.nextTick` + +0.16.0 / 2015-01-28 +------------------- +- bugfix `fs.move()` into itself. Closes [#104] +- bugfix `fs.move()` moving directory across device. Closes [#108] +- added coveralls support +- bugfix: nasty multiple callback `fs.copy()` bug. Closes [#98] +- misc fs.copy code cleanups + +0.15.0 / 2015-01-21 +------------------- +- dropped `ncp`, imported code in +- because of previous, now supports `io.js` +- `graceful-fs` is now a dependency + +0.14.0 / 2015-01-05 +------------------- +- changed `copy`/`copySync` from `fs.copy(src, dest, [filters], callback)` to `fs.copy(src, dest, [options], callback)` [#100][#100] +- removed mockfs tests for mkdirp (this may be temporary, but was getting in the way of other tests) + +0.13.0 / 2014-12-10 +------------------- +- removed `touch` and `touchSync` methods (they didn't handle permissions like UNIX touch) +- updated `"ncp": "^0.6.0"` to `"ncp": "^1.0.1"` +- imported `mkdirp` => `minimist` and `mkdirp` are no longer dependences, should now appease people who wanted `mkdirp` to be `--use_strict` safe. See [#59]([#59][#59]) + +0.12.0 / 2014-09-22 +------------------- +- copy symlinks in `copySync()` [#85][#85] + +0.11.1 / 2014-09-02 +------------------- +- bugfix `copySync()` preserve file permissions [#80][#80] + +0.11.0 / 2014-08-11 +------------------- +- upgraded `"ncp": "^0.5.1"` to `"ncp": "^0.6.0"` +- upgrade `jsonfile": "^1.2.0"` to `jsonfile": "^2.0.0"` => on write, json files now have `\n` at end. Also adds `options.throws` to `readJsonSync()` +see https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options for more details. + +0.10.0 / 2014-06-29 +------------------ +* bugfix: upgaded `"jsonfile": "~1.1.0"` to `"jsonfile": "^1.2.0"`, bumped minor because of `jsonfile` dep change +from `~` to `^`. [#67] + +0.9.1 / 2014-05-22 +------------------ +* removed Node.js `0.8.x` support, `0.9.0` was published moments ago and should have been done there + +0.9.0 / 2014-05-22 +------------------ +* upgraded `ncp` from `~0.4.2` to `^0.5.1`, [#58] +* upgraded `rimraf` from `~2.2.6` to `^2.2.8` +* upgraded `mkdirp` from `0.3.x` to `^0.5.0` +* added methods `ensureFile()`, `ensureFileSync()` +* added methods `ensureDir()`, `ensureDirSync()` [#31] +* added `move()` method. From: https://github.com/andrewrk/node-mv + + +0.8.1 / 2013-10-24 +------------------ +* copy failed to return an error to the callback if a file doesn't exist (ulikoehler [#38], [#39]) + +0.8.0 / 2013-10-14 +------------------ +* `filter` implemented on `copy()` and `copySync()`. (Srirangan / [#36]) + +0.7.1 / 2013-10-12 +------------------ +* `copySync()` implemented (Srirangan / [#33]) +* updated to the latest `jsonfile` version `1.1.0` which gives `options` params for the JSON methods. Closes [#32] + +0.7.0 / 2013-10-07 +------------------ +* update readme conventions +* `copy()` now works if destination directory does not exist. Closes [#29] + +0.6.4 / 2013-09-05 +------------------ +* changed `homepage` field in package.json to remove NPM warning + +0.6.3 / 2013-06-28 +------------------ +* changed JSON spacing default from `4` to `2` to follow Node conventions +* updated `jsonfile` dep +* updated `rimraf` dep + +0.6.2 / 2013-06-28 +------------------ +* added .npmignore, [#25] + +0.6.1 / 2013-05-14 +------------------ +* modified for `strict` mode, closes [#24] +* added `outputJson()/outputJsonSync()`, closes [#23] + +0.6.0 / 2013-03-18 +------------------ +* removed node 0.6 support +* added node 0.10 support +* upgraded to latest `ncp` and `rimraf`. +* optional `graceful-fs` support. Closes [#17] + + +0.5.0 / 2013-02-03 +------------------ +* Removed `readTextFile`. +* Renamed `readJSONFile` to `readJSON` and `readJson`, same with write. +* Restructured documentation a bit. Added roadmap. + +0.4.0 / 2013-01-28 +------------------ +* Set default spaces in `jsonfile` from 4 to 2. +* Updated `testutil` deps for tests. +* Renamed `touch()` to `createFile()` +* Added `outputFile()` and `outputFileSync()` +* Changed creation of testing diretories so the /tmp dir is not littered. +* Added `readTextFile()` and `readTextFileSync()`. + +0.3.2 / 2012-11-01 +------------------ +* Added `touch()` and `touchSync()` methods. + +0.3.1 / 2012-10-11 +------------------ +* Fixed some stray globals. + +0.3.0 / 2012-10-09 +------------------ +* Removed all CoffeeScript from tests. +* Renamed `mkdir` to `mkdirs`/`mkdirp`. + +0.2.1 / 2012-09-11 +------------------ +* Updated `rimraf` dep. + +0.2.0 / 2012-09-10 +------------------ +* Rewrote module into JavaScript. (Must still rewrite tests into JavaScript) +* Added all methods of [jsonfile](https://github.com/jprichardson/node-jsonfile) +* Added Travis-CI. + +0.1.3 / 2012-08-13 +------------------ +* Added method `readJSONFile`. + +0.1.2 / 2012-06-15 +------------------ +* Bug fix: `deleteSync()` didn't exist. +* Verified Node v0.8 compatibility. + +0.1.1 / 2012-06-15 +------------------ +* Fixed bug in `remove()`/`delete()` that wouldn't execute the function if a callback wasn't passed. + +0.1.0 / 2012-05-31 +------------------ +* Renamed `copyFile()` to `copy()`. `copy()` can now copy directories (recursively) too. +* Renamed `rmrf()` to `remove()`. +* `remove()` aliased with `delete()`. +* Added `mkdirp` capabilities. Named: `mkdir()`. Hides Node.js native `mkdir()`. +* Instead of exporting the native `fs` module with new functions, I now copy over the native methods to a new object and export that instead. + +0.0.4 / 2012-03-14 +------------------ +* Removed CoffeeScript dependency + +0.0.3 / 2012-01-11 +------------------ +* Added methods rmrf and rmrfSync +* Moved tests from Jasmine to Mocha + + +[#344]: https://github.com/jprichardson/node-fs-extra/issues/344 "Licence Year" +[#343]: https://github.com/jprichardson/node-fs-extra/pull/343 "Add klaw-sync link to readme" +[#342]: https://github.com/jprichardson/node-fs-extra/pull/342 "allow preserveTimestamps when use move" +[#341]: https://github.com/jprichardson/node-fs-extra/issues/341 "mkdirp(path.dirname(dest) in move() logic needs cleaning up [question]" +[#340]: https://github.com/jprichardson/node-fs-extra/pull/340 "Move docs to seperate docs folder [documentation]" +[#339]: https://github.com/jprichardson/node-fs-extra/pull/339 "Remove walk() & walkSync() [feature-walk]" +[#338]: https://github.com/jprichardson/node-fs-extra/issues/338 "Remove walk() and walkSync() [feature-walk]" +[#337]: https://github.com/jprichardson/node-fs-extra/issues/337 "copy doesn't return a yieldable value" +[#336]: https://github.com/jprichardson/node-fs-extra/pull/336 "Docs enhanced walk sync [documentation, feature-walk]" +[#335]: https://github.com/jprichardson/node-fs-extra/pull/335 "Refactor move() tests [feature-move]" +[#334]: https://github.com/jprichardson/node-fs-extra/pull/334 "Cleanup lib/move/index.js [feature-move]" +[#333]: https://github.com/jprichardson/node-fs-extra/pull/333 "Rename clobber to overwrite [feature-copy, feature-move]" +[#332]: https://github.com/jprichardson/node-fs-extra/pull/332 "BREAKING: Drop Node v0.12 & io.js support" +[#331]: https://github.com/jprichardson/node-fs-extra/issues/331 "Add support for chmodr [enhancement, future]" +[#330]: https://github.com/jprichardson/node-fs-extra/pull/330 "BREAKING: Do not error when copy destination exists & clobber: false [feature-copy]" +[#329]: https://github.com/jprichardson/node-fs-extra/issues/329 "Does .walk() scale to large directories? [question]" +[#328]: https://github.com/jprichardson/node-fs-extra/issues/328 "Copying files corrupts [feature-copy, needs-confirmed]" +[#327]: https://github.com/jprichardson/node-fs-extra/pull/327 "Use writeStream 'finish' event instead of 'close' [bug, feature-copy]" +[#326]: https://github.com/jprichardson/node-fs-extra/issues/326 "fs.copy fails with chmod error when disk under heavy use [bug, feature-copy]" +[#325]: https://github.com/jprichardson/node-fs-extra/issues/325 "ensureDir is difficult to promisify [enhancement]" +[#324]: https://github.com/jprichardson/node-fs-extra/pull/324 "copySync() should apply filter to directories like copy() [bug, feature-copy]" +[#323]: https://github.com/jprichardson/node-fs-extra/issues/323 "Support for `dest` being a directory when using `copy*()`?" +[#322]: https://github.com/jprichardson/node-fs-extra/pull/322 "Add fs-promise as fs-extra-promise alternative" +[#321]: https://github.com/jprichardson/node-fs-extra/issues/321 "fs.copy() with clobber set to false return EEXIST error [feature-copy]" +[#320]: https://github.com/jprichardson/node-fs-extra/issues/320 "fs.copySync: Error: EPERM: operation not permitted, unlink " +[#319]: https://github.com/jprichardson/node-fs-extra/issues/319 "Create directory if not exists" +[#318]: https://github.com/jprichardson/node-fs-extra/issues/318 "Support glob patterns [enhancement, future]" +[#317]: https://github.com/jprichardson/node-fs-extra/pull/317 "Adding copy sync test for src file without write perms" +[#316]: https://github.com/jprichardson/node-fs-extra/pull/316 "Remove move()'s broken limit option [feature-move]" +[#315]: https://github.com/jprichardson/node-fs-extra/pull/315 "Fix move clobber tests to work around graceful-fs bug." +[#314]: https://github.com/jprichardson/node-fs-extra/issues/314 "move() limit option [documentation, enhancement, feature-move]" +[#313]: https://github.com/jprichardson/node-fs-extra/pull/313 "Test that remove() ignores glob characters." +[#312]: https://github.com/jprichardson/node-fs-extra/pull/312 "Enhance walkSync() to return items with path and stats [feature-walk]" +[#311]: https://github.com/jprichardson/node-fs-extra/issues/311 "move() not work when dest name not provided [feature-move]" +[#310]: https://github.com/jprichardson/node-fs-extra/issues/310 "Edit walkSync to return items like what walk emits [documentation, enhancement, feature-walk]" +[#309]: https://github.com/jprichardson/node-fs-extra/issues/309 "moveSync support [enhancement, feature-move]" +[#308]: https://github.com/jprichardson/node-fs-extra/pull/308 "Fix incorrect anchor link" +[#307]: https://github.com/jprichardson/node-fs-extra/pull/307 "Fix coverage" +[#306]: https://github.com/jprichardson/node-fs-extra/pull/306 "Update devDeps, fix lint error" +[#305]: https://github.com/jprichardson/node-fs-extra/pull/305 "Re-add Coveralls" +[#304]: https://github.com/jprichardson/node-fs-extra/pull/304 "Remove path-is-absolute [enhancement]" +[#303]: https://github.com/jprichardson/node-fs-extra/pull/303 "Document copySync filter inconsistency [documentation, feature-copy]" +[#302]: https://github.com/jprichardson/node-fs-extra/pull/302 "fix(console): depreciated -> deprecated" +[#301]: https://github.com/jprichardson/node-fs-extra/pull/301 "Remove chmod call from copySync [feature-copy]" +[#300]: https://github.com/jprichardson/node-fs-extra/pull/300 "Inline Rimraf [enhancement, feature-move, feature-remove]" +[#299]: https://github.com/jprichardson/node-fs-extra/pull/299 "Warn when filter is a RegExp [feature-copy]" +[#298]: https://github.com/jprichardson/node-fs-extra/issues/298 "API Docs [documentation]" +[#297]: https://github.com/jprichardson/node-fs-extra/pull/297 "Warn about using preserveTimestamps on 32-bit node" +[#296]: https://github.com/jprichardson/node-fs-extra/pull/296 "Improve EEXIST error message for copySync [enhancement]" +[#295]: https://github.com/jprichardson/node-fs-extra/pull/295 "Depreciate using regular expressions for copy's filter option [documentation]" +[#294]: https://github.com/jprichardson/node-fs-extra/pull/294 "BREAKING: Refactor lib/copy/ncp.js [feature-copy]" +[#293]: https://github.com/jprichardson/node-fs-extra/pull/293 "Update CI configs" +[#292]: https://github.com/jprichardson/node-fs-extra/issues/292 "Rewrite lib/copy/ncp.js [enhancement, feature-copy]" +[#291]: https://github.com/jprichardson/node-fs-extra/pull/291 "Escape '$' in replacement string for async file copying" +[#290]: https://github.com/jprichardson/node-fs-extra/issues/290 "Exclude files pattern while copying using copy.config.js [question]" +[#289]: https://github.com/jprichardson/node-fs-extra/pull/289 "(Closes #271) lib/util/utimes: properly close file descriptors in the event of an error" +[#288]: https://github.com/jprichardson/node-fs-extra/pull/288 "(Closes #271) lib/util/utimes: properly close file descriptors in the event of an error" +[#287]: https://github.com/jprichardson/node-fs-extra/issues/287 "emptyDir() callback arguments are inconsistent [enhancement, feature-remove]" +[#286]: https://github.com/jprichardson/node-fs-extra/pull/286 "Added walkSync function" +[#285]: https://github.com/jprichardson/node-fs-extra/issues/285 "CITGM test failing on s390" +[#284]: https://github.com/jprichardson/node-fs-extra/issues/284 "outputFile method is missing a check to determine if existing item is a folder or not" +[#283]: https://github.com/jprichardson/node-fs-extra/pull/283 "Apply filter also on directories and symlinks for copySync()" +[#282]: https://github.com/jprichardson/node-fs-extra/pull/282 "Apply filter also on directories and symlinks for copySync()" +[#281]: https://github.com/jprichardson/node-fs-extra/issues/281 "remove function executes 'successfully' but doesn't do anything?" +[#280]: https://github.com/jprichardson/node-fs-extra/pull/280 "Disable rimraf globbing" +[#279]: https://github.com/jprichardson/node-fs-extra/issues/279 "Some code is vendored instead of included [awaiting-reply]" +[#278]: https://github.com/jprichardson/node-fs-extra/issues/278 "copy() does not preserve file/directory ownership" +[#277]: https://github.com/jprichardson/node-fs-extra/pull/277 "Mention defaults for clobber and dereference options" +[#276]: https://github.com/jprichardson/node-fs-extra/issues/276 "Cannot connect to Shared Folder [awaiting-reply]" +[#275]: https://github.com/jprichardson/node-fs-extra/issues/275 "EMFILE, too many open files on Mac OS with JSON API" +[#274]: https://github.com/jprichardson/node-fs-extra/issues/274 "Use with memory-fs? [enhancement, future]" +[#273]: https://github.com/jprichardson/node-fs-extra/pull/273 "tests: rename `remote.test.js` to `remove.test.js`" +[#272]: https://github.com/jprichardson/node-fs-extra/issues/272 "Copy clobber flag never err even when true [bug, feature-copy]" +[#271]: https://github.com/jprichardson/node-fs-extra/issues/271 "Unclosed file handle on futimes error" +[#270]: https://github.com/jprichardson/node-fs-extra/issues/270 "copy not working as desired on Windows [feature-copy, platform-windows]" +[#269]: https://github.com/jprichardson/node-fs-extra/issues/269 "Copying with preserveTimeStamps: true is inaccurate using 32bit node [feature-copy]" +[#268]: https://github.com/jprichardson/node-fs-extra/pull/268 "port fix for mkdirp issue #111" +[#267]: https://github.com/jprichardson/node-fs-extra/issues/267 "WARN deprecated wrench@1.5.9: wrench.js is deprecated!" +[#266]: https://github.com/jprichardson/node-fs-extra/issues/266 "fs-extra" +[#265]: https://github.com/jprichardson/node-fs-extra/issues/265 "Link the `fs.stat fs.exists` etc. methods for replace the `fs` module forever?" +[#264]: https://github.com/jprichardson/node-fs-extra/issues/264 "Renaming a file using move fails when a file inside is open (at least on windows) [wont-fix]" +[#263]: https://github.com/jprichardson/node-fs-extra/issues/263 "ENOSYS: function not implemented, link [needs-confirmed]" +[#262]: https://github.com/jprichardson/node-fs-extra/issues/262 "Add .exists() and .existsSync()" +[#261]: https://github.com/jprichardson/node-fs-extra/issues/261 "Cannot read property 'prototype' of undefined" +[#260]: https://github.com/jprichardson/node-fs-extra/pull/260 "use more specific path for method require" +[#259]: https://github.com/jprichardson/node-fs-extra/issues/259 "Feature Request: isEmpty" +[#258]: https://github.com/jprichardson/node-fs-extra/issues/258 "copy files does not preserve file timestamp" +[#257]: https://github.com/jprichardson/node-fs-extra/issues/257 "Copying a file on windows fails" +[#256]: https://github.com/jprichardson/node-fs-extra/pull/256 "Updated Readme " +[#255]: https://github.com/jprichardson/node-fs-extra/issues/255 "Update rimraf required version" +[#254]: https://github.com/jprichardson/node-fs-extra/issues/254 "request for readTree, readTreeSync, walkSync method" +[#253]: https://github.com/jprichardson/node-fs-extra/issues/253 "outputFile does not touch mtime when file exists" +[#252]: https://github.com/jprichardson/node-fs-extra/pull/252 "Fixing problem when copying file with no write permission" +[#251]: https://github.com/jprichardson/node-fs-extra/issues/251 "Just wanted to say thank you" +[#250]: https://github.com/jprichardson/node-fs-extra/issues/250 "`fs.remove()` not removing files (works with `rm -rf`)" +[#249]: https://github.com/jprichardson/node-fs-extra/issues/249 "Just a Question ... Remove Servers" +[#248]: https://github.com/jprichardson/node-fs-extra/issues/248 "Allow option to not preserve permissions for copy" +[#247]: https://github.com/jprichardson/node-fs-extra/issues/247 "Add TypeScript typing directly in the fs-extra package" +[#246]: https://github.com/jprichardson/node-fs-extra/issues/246 "fse.remove() && fse.removeSync() don't throw error on ENOENT file" +[#245]: https://github.com/jprichardson/node-fs-extra/issues/245 "filter for empty dir [enhancement]" +[#244]: https://github.com/jprichardson/node-fs-extra/issues/244 "copySync doesn't apply the filter to directories" +[#243]: https://github.com/jprichardson/node-fs-extra/issues/243 "Can I request fs.walk() to be synchronous?" +[#242]: https://github.com/jprichardson/node-fs-extra/issues/242 "Accidentally truncates file names ending with $$ [bug, feature-copy]" +[#241]: https://github.com/jprichardson/node-fs-extra/pull/241 "Remove link to createOutputStream" +[#240]: https://github.com/jprichardson/node-fs-extra/issues/240 "walkSync request" +[#239]: https://github.com/jprichardson/node-fs-extra/issues/239 "Depreciate regular expressions for copy's filter [documentation, feature-copy]" +[#238]: https://github.com/jprichardson/node-fs-extra/issues/238 "Can't write to files while in a worker thread." +[#237]: https://github.com/jprichardson/node-fs-extra/issues/237 ".ensureDir(..) fails silently when passed an invalid path..." +[#236]: https://github.com/jprichardson/node-fs-extra/issues/236 "[Removed] Filed under wrong repo" +[#235]: https://github.com/jprichardson/node-fs-extra/pull/235 "Adds symlink dereference option to `fse.copySync` (#191)" +[#234]: https://github.com/jprichardson/node-fs-extra/issues/234 "ensureDirSync fails silent when EACCES: permission denied on travis-ci" +[#233]: https://github.com/jprichardson/node-fs-extra/issues/233 "please make sure the first argument in callback is error object [feature-copy]" +[#232]: https://github.com/jprichardson/node-fs-extra/issues/232 "Copy a folder content to its child folder. " +[#231]: https://github.com/jprichardson/node-fs-extra/issues/231 "Adding read/write/output functions for YAML" +[#230]: https://github.com/jprichardson/node-fs-extra/pull/230 "throw error if src and dest are the same to avoid zeroing out + test" +[#229]: https://github.com/jprichardson/node-fs-extra/pull/229 "fix 'TypeError: callback is not a function' in emptyDir" +[#228]: https://github.com/jprichardson/node-fs-extra/pull/228 "Throw error when target is empty so file is not accidentally zeroed out" +[#227]: https://github.com/jprichardson/node-fs-extra/issues/227 "Uncatchable errors when there are invalid arguments [feature-move]" +[#226]: https://github.com/jprichardson/node-fs-extra/issues/226 "Moving to the current directory" +[#225]: https://github.com/jprichardson/node-fs-extra/issues/225 "EBUSY: resource busy or locked, unlink" +[#224]: https://github.com/jprichardson/node-fs-extra/issues/224 "fse.copy ENOENT error" +[#223]: https://github.com/jprichardson/node-fs-extra/issues/223 "Suspicious behavior of fs.existsSync" +[#222]: https://github.com/jprichardson/node-fs-extra/pull/222 "A clearer description of emtpyDir function" +[#221]: https://github.com/jprichardson/node-fs-extra/pull/221 "Update README.md" +[#220]: https://github.com/jprichardson/node-fs-extra/pull/220 "Non-breaking feature: add option 'passStats' to copy methods." +[#219]: https://github.com/jprichardson/node-fs-extra/pull/219 "Add closing parenthesis in copySync example" +[#218]: https://github.com/jprichardson/node-fs-extra/pull/218 "fix #187 #70 options.filter bug" +[#217]: https://github.com/jprichardson/node-fs-extra/pull/217 "fix #187 #70 options.filter bug" +[#216]: https://github.com/jprichardson/node-fs-extra/pull/216 "fix #187 #70 options.filter bug" +[#215]: https://github.com/jprichardson/node-fs-extra/pull/215 "fse.copy throws error when only src and dest provided [bug, documentation, feature-copy]" +[#214]: https://github.com/jprichardson/node-fs-extra/pull/214 "Fixing copySync anchor tag" +[#213]: https://github.com/jprichardson/node-fs-extra/issues/213 "Merge extfs with this repo" +[#212]: https://github.com/jprichardson/node-fs-extra/pull/212 "Update year to 2016 in README.md and LICENSE" +[#211]: https://github.com/jprichardson/node-fs-extra/issues/211 "Not copying all files" +[#210]: https://github.com/jprichardson/node-fs-extra/issues/210 "copy/copySync behave differently when copying a symbolic file [bug, documentation, feature-copy]" +[#209]: https://github.com/jprichardson/node-fs-extra/issues/209 "In Windows invalid directory name causes infinite loop in ensureDir(). [bug]" +[#208]: https://github.com/jprichardson/node-fs-extra/pull/208 "fix options.preserveTimestamps to false in copy-sync by default [feature-copy]" +[#207]: https://github.com/jprichardson/node-fs-extra/issues/207 "Add `compare` suite of functions" +[#206]: https://github.com/jprichardson/node-fs-extra/issues/206 "outputFileSync" +[#205]: https://github.com/jprichardson/node-fs-extra/issues/205 "fix documents about copy/copySync [documentation, feature-copy]" +[#204]: https://github.com/jprichardson/node-fs-extra/pull/204 "allow copy of block and character device files" +[#203]: https://github.com/jprichardson/node-fs-extra/issues/203 "copy method's argument options couldn't be undefined [bug, feature-copy]" +[#202]: https://github.com/jprichardson/node-fs-extra/issues/202 "why there is not a walkSync method?" +[#201]: https://github.com/jprichardson/node-fs-extra/issues/201 "clobber for directories [feature-copy, future]" +[#200]: https://github.com/jprichardson/node-fs-extra/issues/200 "'copySync' doesn't work in sync" +[#199]: https://github.com/jprichardson/node-fs-extra/issues/199 "fs.copySync fails if user does not own file [bug, feature-copy]" +[#198]: https://github.com/jprichardson/node-fs-extra/issues/198 "handle copying between identical files [feature-copy]" +[#197]: https://github.com/jprichardson/node-fs-extra/issues/197 "Missing documentation for `outputFile` `options` 3rd parameter [documentation]" +[#196]: https://github.com/jprichardson/node-fs-extra/issues/196 "copy filter: async function and/or function called with `fs.stat` result [future]" +[#195]: https://github.com/jprichardson/node-fs-extra/issues/195 "How to override with outputFile?" +[#194]: https://github.com/jprichardson/node-fs-extra/pull/194 "allow ensureFile(Sync) to provide data to be written to created file" +[#193]: https://github.com/jprichardson/node-fs-extra/issues/193 "`fs.copy` fails silently if source file is /dev/null [bug, feature-copy]" +[#192]: https://github.com/jprichardson/node-fs-extra/issues/192 "Remove fs.createOutputStream()" +[#191]: https://github.com/jprichardson/node-fs-extra/issues/191 "How to copy symlinks to target as normal folders [feature-copy]" +[#190]: https://github.com/jprichardson/node-fs-extra/pull/190 "copySync to overwrite destination file if readonly and clobber true" +[#189]: https://github.com/jprichardson/node-fs-extra/pull/189 "move.test fix to support CRLF on Windows" +[#188]: https://github.com/jprichardson/node-fs-extra/issues/188 "move.test failing on windows platform" +[#187]: https://github.com/jprichardson/node-fs-extra/issues/187 "Not filter each file, stops on first false [feature-copy]" +[#186]: https://github.com/jprichardson/node-fs-extra/issues/186 "Do you need a .size() function in this module? [future]" +[#185]: https://github.com/jprichardson/node-fs-extra/issues/185 "Doesn't work on NodeJS v4.x" +[#184]: https://github.com/jprichardson/node-fs-extra/issues/184 "CLI equivalent for fs-extra" +[#183]: https://github.com/jprichardson/node-fs-extra/issues/183 "with clobber true, copy and copySync behave differently if destination file is read only [bug, feature-copy]" +[#182]: https://github.com/jprichardson/node-fs-extra/issues/182 "ensureDir(dir, callback) second callback parameter not specified" +[#181]: https://github.com/jprichardson/node-fs-extra/issues/181 "Add ability to remove file securely [enhancement, wont-fix]" +[#180]: https://github.com/jprichardson/node-fs-extra/issues/180 "Filter option doesn't work the same way in copy and copySync [bug, feature-copy]" +[#179]: https://github.com/jprichardson/node-fs-extra/issues/179 "Include opendir" +[#178]: https://github.com/jprichardson/node-fs-extra/issues/178 "ENOTEMPTY is thrown on removeSync " +[#177]: https://github.com/jprichardson/node-fs-extra/issues/177 "fix `remove()` wildcards (introduced by rimraf) [feature-remove]" +[#176]: https://github.com/jprichardson/node-fs-extra/issues/176 "createOutputStream doesn't emit 'end' event" +[#175]: https://github.com/jprichardson/node-fs-extra/issues/175 "[Feature Request].moveSync support [feature-move, future]" +[#174]: https://github.com/jprichardson/node-fs-extra/pull/174 "Fix copy formatting and document options.filter" +[#173]: https://github.com/jprichardson/node-fs-extra/issues/173 "Feature Request: writeJson should mkdirs" +[#172]: https://github.com/jprichardson/node-fs-extra/issues/172 "rename `clobber` flags to `overwrite`" +[#171]: https://github.com/jprichardson/node-fs-extra/issues/171 "remove unnecessary aliases" +[#170]: https://github.com/jprichardson/node-fs-extra/pull/170 "More robust handling of errors moving across virtual drives" +[#169]: https://github.com/jprichardson/node-fs-extra/pull/169 "suppress ensureLink & ensureSymlink dest exists error" +[#168]: https://github.com/jprichardson/node-fs-extra/pull/168 "suppress ensurelink dest exists error" +[#167]: https://github.com/jprichardson/node-fs-extra/pull/167 "Adds basic (string, buffer) support for ensureFile content [future]" +[#166]: https://github.com/jprichardson/node-fs-extra/pull/166 "Adds basic (string, buffer) support for ensureFile content" +[#165]: https://github.com/jprichardson/node-fs-extra/pull/165 "ensure for link & symlink" +[#164]: https://github.com/jprichardson/node-fs-extra/issues/164 "Feature Request: ensureFile to take optional argument for file content" +[#163]: https://github.com/jprichardson/node-fs-extra/issues/163 "ouputJson not formatted out of the box [bug]" +[#162]: https://github.com/jprichardson/node-fs-extra/pull/162 "ensure symlink & link" +[#161]: https://github.com/jprichardson/node-fs-extra/pull/161 "ensure symlink & link" +[#160]: https://github.com/jprichardson/node-fs-extra/pull/160 "ensure symlink & link" +[#159]: https://github.com/jprichardson/node-fs-extra/pull/159 "ensure symlink & link" +[#158]: https://github.com/jprichardson/node-fs-extra/issues/158 "Feature Request: ensureLink and ensureSymlink methods" +[#157]: https://github.com/jprichardson/node-fs-extra/issues/157 "writeJson isn't formatted" +[#156]: https://github.com/jprichardson/node-fs-extra/issues/156 "Promise.promisifyAll doesn't work for some methods" +[#155]: https://github.com/jprichardson/node-fs-extra/issues/155 "Readme" +[#154]: https://github.com/jprichardson/node-fs-extra/issues/154 "/tmp/millis-test-sync" +[#153]: https://github.com/jprichardson/node-fs-extra/pull/153 "Make preserveTimes also work on read-only files. Closes #152" +[#152]: https://github.com/jprichardson/node-fs-extra/issues/152 "fs.copy fails for read-only files with preserveTimestamp=true [feature-copy]" +[#151]: https://github.com/jprichardson/node-fs-extra/issues/151 "TOC does not work correctly on npm [documentation]" +[#150]: https://github.com/jprichardson/node-fs-extra/issues/150 "Remove test file fixtures, create with code." +[#149]: https://github.com/jprichardson/node-fs-extra/issues/149 "/tmp/millis-test-sync" +[#148]: https://github.com/jprichardson/node-fs-extra/issues/148 "split out `Sync` methods in documentation" +[#147]: https://github.com/jprichardson/node-fs-extra/issues/147 "Adding rmdirIfEmpty" +[#146]: https://github.com/jprichardson/node-fs-extra/pull/146 "ensure test.js works" +[#145]: https://github.com/jprichardson/node-fs-extra/issues/145 "Add `fs.exists` and `fs.existsSync` if it doesn't exist." +[#144]: https://github.com/jprichardson/node-fs-extra/issues/144 "tests failing" +[#143]: https://github.com/jprichardson/node-fs-extra/issues/143 "update graceful-fs" +[#142]: https://github.com/jprichardson/node-fs-extra/issues/142 "PrependFile Feature" +[#141]: https://github.com/jprichardson/node-fs-extra/pull/141 "Add option to preserve timestamps" +[#140]: https://github.com/jprichardson/node-fs-extra/issues/140 "Json file reading fails with 'utf8'" +[#139]: https://github.com/jprichardson/node-fs-extra/pull/139 "Preserve file timestamp on copy. Closes #138" +[#138]: https://github.com/jprichardson/node-fs-extra/issues/138 "Preserve timestamps on copying files" +[#137]: https://github.com/jprichardson/node-fs-extra/issues/137 "outputFile/outputJson: Unexpected end of input" +[#136]: https://github.com/jprichardson/node-fs-extra/pull/136 "Update license attribute" +[#135]: https://github.com/jprichardson/node-fs-extra/issues/135 "emptyDir throws Error if no callback is provided" +[#134]: https://github.com/jprichardson/node-fs-extra/pull/134 "Handle EEXIST error when clobbering dir" +[#133]: https://github.com/jprichardson/node-fs-extra/pull/133 "Travis runs with `sudo: false`" +[#132]: https://github.com/jprichardson/node-fs-extra/pull/132 "isDirectory method" +[#131]: https://github.com/jprichardson/node-fs-extra/issues/131 "copySync is not working iojs 1.8.4 on linux [feature-copy]" +[#130]: https://github.com/jprichardson/node-fs-extra/pull/130 "Please review additional features." +[#129]: https://github.com/jprichardson/node-fs-extra/pull/129 "can you review this feature?" +[#128]: https://github.com/jprichardson/node-fs-extra/issues/128 "fsExtra.move(filepath, newPath) broken;" +[#127]: https://github.com/jprichardson/node-fs-extra/issues/127 "consider using fs.access to remove deprecated warnings for fs.exists" +[#126]: https://github.com/jprichardson/node-fs-extra/issues/126 " TypeError: Object # has no method 'access'" +[#125]: https://github.com/jprichardson/node-fs-extra/issues/125 "Question: What do the *Sync function do different from non-sync" +[#124]: https://github.com/jprichardson/node-fs-extra/issues/124 "move with clobber option 'ENOTEMPTY'" +[#123]: https://github.com/jprichardson/node-fs-extra/issues/123 "Only copy the content of a directory" +[#122]: https://github.com/jprichardson/node-fs-extra/pull/122 "Update section links in README to match current section ids." +[#121]: https://github.com/jprichardson/node-fs-extra/issues/121 "emptyDir is undefined" +[#120]: https://github.com/jprichardson/node-fs-extra/issues/120 "usage bug caused by shallow cloning methods of 'graceful-fs'" +[#119]: https://github.com/jprichardson/node-fs-extra/issues/119 "mkdirs and ensureDir never invoke callback and consume CPU indefinitely if provided a path with invalid characters on Windows" +[#118]: https://github.com/jprichardson/node-fs-extra/pull/118 "createOutputStream" +[#117]: https://github.com/jprichardson/node-fs-extra/pull/117 "Fixed issue with slash separated paths on windows" +[#116]: https://github.com/jprichardson/node-fs-extra/issues/116 "copySync can only copy directories not files [documentation, feature-copy]" +[#115]: https://github.com/jprichardson/node-fs-extra/issues/115 ".Copy & .CopySync [feature-copy]" +[#114]: https://github.com/jprichardson/node-fs-extra/issues/114 "Fails to move (rename) directory to non-empty directory even with clobber: true" +[#113]: https://github.com/jprichardson/node-fs-extra/issues/113 "fs.copy seems to callback early if the destination file already exists" +[#112]: https://github.com/jprichardson/node-fs-extra/pull/112 "Copying a file into an existing directory" +[#111]: https://github.com/jprichardson/node-fs-extra/pull/111 "Moving a file into an existing directory " +[#110]: https://github.com/jprichardson/node-fs-extra/pull/110 "Moving a file into an existing directory" +[#109]: https://github.com/jprichardson/node-fs-extra/issues/109 "fs.move across windows drives fails" +[#108]: https://github.com/jprichardson/node-fs-extra/issues/108 "fse.move directories across multiple devices doesn't work" +[#107]: https://github.com/jprichardson/node-fs-extra/pull/107 "Check if dest path is an existing dir and copy or move source in it" +[#106]: https://github.com/jprichardson/node-fs-extra/issues/106 "fse.copySync crashes while copying across devices D: [feature-copy]" +[#105]: https://github.com/jprichardson/node-fs-extra/issues/105 "fs.copy hangs on iojs" +[#104]: https://github.com/jprichardson/node-fs-extra/issues/104 "fse.move deletes folders [bug]" +[#103]: https://github.com/jprichardson/node-fs-extra/issues/103 "Error: EMFILE with copy" +[#102]: https://github.com/jprichardson/node-fs-extra/issues/102 "touch / touchSync was removed ?" +[#101]: https://github.com/jprichardson/node-fs-extra/issues/101 "fs-extra promisified" +[#100]: https://github.com/jprichardson/node-fs-extra/pull/100 "copy: options object or filter to pass to ncp" +[#99]: https://github.com/jprichardson/node-fs-extra/issues/99 "ensureDir() modes [future]" +[#98]: https://github.com/jprichardson/node-fs-extra/issues/98 "fs.copy() incorrect async behavior [bug]" +[#97]: https://github.com/jprichardson/node-fs-extra/pull/97 "use path.join; fix copySync bug" +[#96]: https://github.com/jprichardson/node-fs-extra/issues/96 "destFolderExists in copySync is always undefined." +[#95]: https://github.com/jprichardson/node-fs-extra/pull/95 "Using graceful-ncp instead of ncp" +[#94]: https://github.com/jprichardson/node-fs-extra/issues/94 "Error: EEXIST, file already exists '../mkdirp/bin/cmd.js' on fs.copySync() [enhancement, feature-copy]" +[#93]: https://github.com/jprichardson/node-fs-extra/issues/93 "Confusing error if drive not mounted [enhancement]" +[#92]: https://github.com/jprichardson/node-fs-extra/issues/92 "Problems with Bluebird" +[#91]: https://github.com/jprichardson/node-fs-extra/issues/91 "fs.copySync('/test', '/haha') is different with 'cp -r /test /haha' [enhancement]" +[#90]: https://github.com/jprichardson/node-fs-extra/issues/90 "Folder creation and file copy is Happening in 64 bit machine but not in 32 bit machine" +[#89]: https://github.com/jprichardson/node-fs-extra/issues/89 "Error: EEXIST using fs-extra's fs.copy to copy a directory on Windows" +[#88]: https://github.com/jprichardson/node-fs-extra/issues/88 "Stacking those libraries" +[#87]: https://github.com/jprichardson/node-fs-extra/issues/87 "createWriteStream + outputFile = ?" +[#86]: https://github.com/jprichardson/node-fs-extra/issues/86 "no moveSync?" +[#85]: https://github.com/jprichardson/node-fs-extra/pull/85 "Copy symlinks in copySync" +[#84]: https://github.com/jprichardson/node-fs-extra/issues/84 "Push latest version to npm ?" +[#83]: https://github.com/jprichardson/node-fs-extra/issues/83 "Prevent copying a directory into itself [feature-copy]" +[#82]: https://github.com/jprichardson/node-fs-extra/pull/82 "README updates for move" +[#81]: https://github.com/jprichardson/node-fs-extra/issues/81 "fd leak after fs.move" +[#80]: https://github.com/jprichardson/node-fs-extra/pull/80 "Preserve file mode in copySync" +[#79]: https://github.com/jprichardson/node-fs-extra/issues/79 "fs.copy only .html file empty" +[#78]: https://github.com/jprichardson/node-fs-extra/pull/78 "copySync was not applying filters to directories" +[#77]: https://github.com/jprichardson/node-fs-extra/issues/77 "Create README reference to bluebird" +[#76]: https://github.com/jprichardson/node-fs-extra/issues/76 "Create README reference to typescript" +[#75]: https://github.com/jprichardson/node-fs-extra/issues/75 "add glob as a dep? [question]" +[#74]: https://github.com/jprichardson/node-fs-extra/pull/74 "including new emptydir module" +[#73]: https://github.com/jprichardson/node-fs-extra/pull/73 "add dependency status in readme" +[#72]: https://github.com/jprichardson/node-fs-extra/pull/72 "Use svg instead of png to get better image quality" +[#71]: https://github.com/jprichardson/node-fs-extra/issues/71 "fse.copy not working on Windows 7 x64 OS, but, copySync does work" +[#70]: https://github.com/jprichardson/node-fs-extra/issues/70 "Not filter each file, stops on first false [bug]" +[#69]: https://github.com/jprichardson/node-fs-extra/issues/69 "How to check if folder exist and read the folder name" +[#68]: https://github.com/jprichardson/node-fs-extra/issues/68 "consider flag to readJsonSync (throw false) [enhancement]" +[#67]: https://github.com/jprichardson/node-fs-extra/issues/67 "docs for readJson incorrectly states that is accepts options" +[#66]: https://github.com/jprichardson/node-fs-extra/issues/66 "ENAMETOOLONG" +[#65]: https://github.com/jprichardson/node-fs-extra/issues/65 "exclude filter in fs.copy" +[#64]: https://github.com/jprichardson/node-fs-extra/issues/64 "Announce: mfs - monitor your fs-extra calls" +[#63]: https://github.com/jprichardson/node-fs-extra/issues/63 "Walk" +[#62]: https://github.com/jprichardson/node-fs-extra/issues/62 "npm install fs-extra doesn't work" +[#61]: https://github.com/jprichardson/node-fs-extra/issues/61 "No longer supports node 0.8 due to use of `^` in package.json dependencies" +[#60]: https://github.com/jprichardson/node-fs-extra/issues/60 "chmod & chown for mkdirs" +[#59]: https://github.com/jprichardson/node-fs-extra/issues/59 "Consider including mkdirp and making fs-extra '--use_strict' safe [question]" +[#58]: https://github.com/jprichardson/node-fs-extra/issues/58 "Stack trace not included in fs.copy error" +[#57]: https://github.com/jprichardson/node-fs-extra/issues/57 "Possible to include wildcards in delete?" +[#56]: https://github.com/jprichardson/node-fs-extra/issues/56 "Crash when have no access to write to destination file in copy " +[#55]: https://github.com/jprichardson/node-fs-extra/issues/55 "Is it possible to have any console output similar to Grunt copy module?" +[#54]: https://github.com/jprichardson/node-fs-extra/issues/54 "`copy` does not preserve file ownership and permissons" +[#53]: https://github.com/jprichardson/node-fs-extra/issues/53 "outputFile() - ability to write data in appending mode" +[#52]: https://github.com/jprichardson/node-fs-extra/pull/52 "This fixes (what I think) is a bug in copySync" +[#51]: https://github.com/jprichardson/node-fs-extra/pull/51 "Add a Bitdeli Badge to README" +[#50]: https://github.com/jprichardson/node-fs-extra/issues/50 "Replace mechanism in createFile" +[#49]: https://github.com/jprichardson/node-fs-extra/pull/49 "update rimraf to v2.2.6" +[#48]: https://github.com/jprichardson/node-fs-extra/issues/48 "fs.copy issue [bug]" +[#47]: https://github.com/jprichardson/node-fs-extra/issues/47 "Bug in copy - callback called on readStream 'close' - Fixed in ncp 0.5.0" +[#46]: https://github.com/jprichardson/node-fs-extra/pull/46 "update copyright year" +[#45]: https://github.com/jprichardson/node-fs-extra/pull/45 "Added note about fse.outputFile() being the one that overwrites" +[#44]: https://github.com/jprichardson/node-fs-extra/pull/44 "Proposal: Stream support" +[#43]: https://github.com/jprichardson/node-fs-extra/issues/43 "Better error reporting " +[#42]: https://github.com/jprichardson/node-fs-extra/issues/42 "Performance issue?" +[#41]: https://github.com/jprichardson/node-fs-extra/pull/41 "There does seem to be a synchronous version now" +[#40]: https://github.com/jprichardson/node-fs-extra/issues/40 "fs.copy throw unexplained error ENOENT, utime " +[#39]: https://github.com/jprichardson/node-fs-extra/pull/39 "Added regression test for copy() return callback on error" +[#38]: https://github.com/jprichardson/node-fs-extra/pull/38 "Return err in copy() fstat cb, because stat could be undefined or null" +[#37]: https://github.com/jprichardson/node-fs-extra/issues/37 "Maybe include a line reader? [enhancement, question]" +[#36]: https://github.com/jprichardson/node-fs-extra/pull/36 "`filter` parameter `fs.copy` and `fs.copySync`" +[#35]: https://github.com/jprichardson/node-fs-extra/pull/35 "`filter` parameter `fs.copy` and `fs.copySync` " +[#34]: https://github.com/jprichardson/node-fs-extra/issues/34 "update docs to include options for JSON methods [enhancement]" +[#33]: https://github.com/jprichardson/node-fs-extra/pull/33 "fs_extra.copySync" +[#32]: https://github.com/jprichardson/node-fs-extra/issues/32 "update to latest jsonfile [enhancement]" +[#31]: https://github.com/jprichardson/node-fs-extra/issues/31 "Add ensure methods [enhancement]" +[#30]: https://github.com/jprichardson/node-fs-extra/issues/30 "update package.json optional dep `graceful-fs`" +[#29]: https://github.com/jprichardson/node-fs-extra/issues/29 "Copy failing if dest directory doesn't exist. Is this intended?" +[#28]: https://github.com/jprichardson/node-fs-extra/issues/28 "homepage field must be a string url. Deleted." +[#27]: https://github.com/jprichardson/node-fs-extra/issues/27 "Update Readme" +[#26]: https://github.com/jprichardson/node-fs-extra/issues/26 "Add readdir recursive method. [enhancement]" +[#25]: https://github.com/jprichardson/node-fs-extra/pull/25 "adding an `.npmignore` file" +[#24]: https://github.com/jprichardson/node-fs-extra/issues/24 "[bug] cannot run in strict mode [bug]" +[#23]: https://github.com/jprichardson/node-fs-extra/issues/23 "`writeJSON()` should create parent directories" +[#22]: https://github.com/jprichardson/node-fs-extra/pull/22 "Add a limit option to mkdirs()" +[#21]: https://github.com/jprichardson/node-fs-extra/issues/21 "touch() in 0.10.0" +[#20]: https://github.com/jprichardson/node-fs-extra/issues/20 "fs.remove yields callback before directory is really deleted" +[#19]: https://github.com/jprichardson/node-fs-extra/issues/19 "fs.copy err is empty array" +[#18]: https://github.com/jprichardson/node-fs-extra/pull/18 "Exposed copyFile Function" +[#17]: https://github.com/jprichardson/node-fs-extra/issues/17 "Use `require('graceful-fs')` if found instead of `require('fs')`" +[#16]: https://github.com/jprichardson/node-fs-extra/pull/16 "Update README.md" +[#15]: https://github.com/jprichardson/node-fs-extra/issues/15 "Implement cp -r but sync aka copySync. [enhancement]" +[#14]: https://github.com/jprichardson/node-fs-extra/issues/14 "fs.mkdirSync is broken in 0.3.1" +[#13]: https://github.com/jprichardson/node-fs-extra/issues/13 "Thoughts on including a directory tree / file watcher? [enhancement, question]" +[#12]: https://github.com/jprichardson/node-fs-extra/issues/12 "copyFile & copyFileSync are global" +[#11]: https://github.com/jprichardson/node-fs-extra/issues/11 "Thoughts on including a file walker? [enhancement, question]" +[#10]: https://github.com/jprichardson/node-fs-extra/issues/10 "move / moveFile API [enhancement]" +[#9]: https://github.com/jprichardson/node-fs-extra/issues/9 "don't import normal fs stuff into fs-extra" +[#8]: https://github.com/jprichardson/node-fs-extra/pull/8 "Update rimraf to latest version" +[#6]: https://github.com/jprichardson/node-fs-extra/issues/6 "Remove CoffeeScript development dependency" +[#5]: https://github.com/jprichardson/node-fs-extra/issues/5 "comments on naming" +[#4]: https://github.com/jprichardson/node-fs-extra/issues/4 "version bump to 0.2" +[#3]: https://github.com/jprichardson/node-fs-extra/pull/3 "Hi! I fixed some code for you!" +[#2]: https://github.com/jprichardson/node-fs-extra/issues/2 "Merge with fs.extra and mkdirp" +[#1]: https://github.com/jprichardson/node-fs-extra/issues/1 "file-extra npm !exist" diff --git a/node_modules/fs-extra/LICENSE b/node_modules/fs-extra/LICENSE new file mode 100644 index 0000000000..93546dfb76 --- /dev/null +++ b/node_modules/fs-extra/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2011-2017 JP Richardson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files +(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/fs-extra/README.md b/node_modules/fs-extra/README.md new file mode 100644 index 0000000000..7dbb9f7e88 --- /dev/null +++ b/node_modules/fs-extra/README.md @@ -0,0 +1,242 @@ +Node.js: fs-extra +================= + +`fs-extra` adds file system methods that aren't included in the native `fs` module and adds promise support to the `fs` methods. It should be a drop in replacement for `fs`. + +[![npm Package](https://img.shields.io/npm/v/fs-extra.svg?style=flat-square)](https://www.npmjs.org/package/fs-extra) +[![build status](https://api.travis-ci.org/jprichardson/node-fs-extra.svg)](http://travis-ci.org/jprichardson/node-fs-extra) +[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-fs-extra/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-fs-extra/branch/master) +[![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra) +[![Coverage Status](https://img.shields.io/coveralls/jprichardson/node-fs-extra.svg)](https://coveralls.io/r/jprichardson/node-fs-extra) + +Standard JavaScript + + +Why? +---- + +I got tired of including `mkdirp`, `rimraf`, and `ncp` in most of my projects. + + + + +Installation +------------ + + npm install --save fs-extra + + + +Usage +----- + +`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are attached to `fs-extra`. All `fs` methods return promises if the callback isn't passed. + +You don't ever need to include the original `fs` module again: + +```js +const fs = require('fs') // this is no longer necessary +``` + +you can now do this: + +```js +const fs = require('fs-extra') +``` + +or if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want +to name your `fs` variable `fse` like so: + +```js +const fse = require('fs-extra') +``` + +you can also keep both, but it's redundant: + +```js +const fs = require('fs') +const fse = require('fs-extra') +``` + +Sync vs Async +------------- +Most methods are async by default. All async methods will return a promise if the callback isn't passed. + +Sync methods on the other hand will throw if an error occurs. + +Example: + +```js +const fs = require('fs-extra') + +// Async with promises: +fs.copy('/tmp/myfile', '/tmp/mynewfile') + .then(() => console.log('success!')) + .catch(err => console.error(err)) + +// Async with callbacks: +fs.copy('/tmp/myfile', '/tmp/mynewfile', err => { + if (err) return console.error(err) + console.log('success!') +}) + +// Sync: +try { + fs.copySync('/tmp/myfile', '/tmp/mynewfile') + console.log('success!') +} catch (err) { + console.error(err) +} +``` + + +Methods +------- + +### Async + +- [copy](docs/copy.md) +- [emptyDir](docs/emptyDir.md) +- [ensureFile](docs/ensureFile.md) +- [ensureDir](docs/ensureDir.md) +- [ensureLink](docs/ensureLink.md) +- [ensureSymlink](docs/ensureSymlink.md) +- [mkdirs](docs/ensureDir.md) +- [move](docs/move.md) +- [outputFile](docs/outputFile.md) +- [outputJson](docs/outputJson.md) +- [pathExists](docs/pathExists.md) +- [readJson](docs/readJson.md) +- [remove](docs/remove.md) +- [writeJson](docs/writeJson.md) + +### Sync + +- [copySync](docs/copy-sync.md) +- [emptyDirSync](docs/emptyDir-sync.md) +- [ensureFileSync](docs/ensureFile-sync.md) +- [ensureDirSync](docs/ensureDir-sync.md) +- [ensureLinkSync](docs/ensureLink-sync.md) +- [ensureSymlinkSync](docs/ensureSymlink-sync.md) +- [mkdirsSync](docs/ensureDir-sync.md) +- [moveSync](docs/move-sync.md) +- [outputFileSync](docs/outputFile-sync.md) +- [outputJsonSync](docs/outputJson-sync.md) +- [pathExistsSync](docs/pathExists-sync.md) +- [readJsonSync](docs/readJson-sync.md) +- [removeSync](docs/remove-sync.md) +- [writeJsonSync](docs/writeJson-sync.md) + + +**NOTE:** You can still use the native Node.js methods. They are promisified and copied over to `fs-extra`. See [notes on `fs.read()` & `fs.write()`](docs/fs-read-write.md) + +### What happened to `walk()` and `walkSync()`? + +They were removed from `fs-extra` in v2.0.0. If you need the functionality, `walk` and `walkSync` are available as separate packages, [`klaw`](https://github.com/jprichardson/node-klaw) and [`klaw-sync`](https://github.com/manidlou/node-klaw-sync). + + +Third Party +----------- + + +### TypeScript + +If you like TypeScript, you can use `fs-extra` with it: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-extra + + +### File / Directory Watching + +If you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar). + + +### Misc. + +- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls. + + + +Hacking on fs-extra +------------------- + +Wanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project +uses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you, +you're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`. + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +What's needed? +- First, take a look at existing issues. Those are probably going to be where the priority lies. +- More tests for edge cases. Specifically on different platforms. There can never be enough tests. +- Improve test coverage. See coveralls output for more info. + +Note: If you make any big changes, **you should definitely file an issue for discussion first.** + +### Running the Test Suite + +fs-extra contains hundreds of tests. + +- `npm run lint`: runs the linter ([standard](http://standardjs.com/)) +- `npm run unit`: runs the unit tests +- `npm test`: runs both the linter and the tests + + +### Windows + +If you run the tests on the Windows and receive a lot of symbolic link `EPERM` permission errors, it's +because on Windows you need elevated privilege to create symbolic links. You can add this to your Windows's +account by following the instructions here: http://superuser.com/questions/104845/permission-to-make-symbolic-links-in-windows-7 +However, I didn't have much luck doing this. + +Since I develop on Mac OS X, I use VMWare Fusion for Windows testing. I create a shared folder that I map to a drive on Windows. +I open the `Node.js command prompt` and run as `Administrator`. I then map the network drive running the following command: + + net use z: "\\vmware-host\Shared Folders" + +I can then navigate to my `fs-extra` directory and run the tests. + + +Naming +------ + +I put a lot of thought into the naming of these functions. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here: + +* https://github.com/jprichardson/node-fs-extra/issues/2 +* https://github.com/flatiron/utile/issues/11 +* https://github.com/ryanmcgrath/wrench-js/issues/29 +* https://github.com/substack/node-mkdirp/issues/17 + +First, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes. + +For example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc. + +We have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`? + +My perspective: when in doubt, err on the side of simplicity. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too. + +So, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`. + + +Credit +------ + +`fs-extra` wouldn't be possible without using the modules from the following authors: + +- [Isaac Shlueter](https://github.com/isaacs) +- [Charlie McConnel](https://github.com/avianflu) +- [James Halliday](https://github.com/substack) +- [Andrew Kelley](https://github.com/andrewrk) + + + + +License +------- + +Licensed under MIT + +Copyright (c) 2011-2017 [JP Richardson](https://github.com/jprichardson) + +[1]: http://nodejs.org/docs/latest/api/fs.html + + +[jsonfile]: https://github.com/jprichardson/node-jsonfile diff --git a/node_modules/fs-extra/docs/copy-sync.md b/node_modules/fs-extra/docs/copy-sync.md new file mode 100644 index 0000000000..8e61c2b697 --- /dev/null +++ b/node_modules/fs-extra/docs/copy-sync.md @@ -0,0 +1,37 @@ +# copySync(src, dest, [options]) + +Copy a file or directory. The directory can have contents. Like `cp -r`. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior. + - `errorOnExist` ``: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`. + - `dereference` ``: dereference symlinks, default is `false`. + - `preserveTimestamps` ``: will set last modification and access times to the ones of the original source files, default is `false`. + - `filter` ``: Function to filter copied files. Return `true` to include, `false` to exclude. This can also be a RegExp, however this is deprecated (See [issue #239](https://github.com/jprichardson/node-fs-extra/issues/239) for background). + +## Example: + +```js +const fs = require('fs-extra') + +// copy file +fs.copySync('/tmp/myfile', '/tmp/mynewfile') + +// copy directory, even if it has subdirectories or files +fs.copySync('/tmp/mydir', '/tmp/mynewdir') +``` + +**Using filter function** + +```js +const fs = require('fs-extra') + +const filterFunc = (src, dest) => { + // your logic here + // it will be copied if return true +} + +fs.copySync('/tmp/mydir', '/tmp/mynewdir', { filter: filterFunc }) +``` diff --git a/node_modules/fs-extra/docs/copy.md b/node_modules/fs-extra/docs/copy.md new file mode 100644 index 0000000000..84407261e1 --- /dev/null +++ b/node_modules/fs-extra/docs/copy.md @@ -0,0 +1,57 @@ +# copy(src, dest, [options, callback]) + +Copy a file or directory. The directory can have contents. Like `cp -r`. + +- `src` `` +- `dest` `` Note that if `src` is a file, `dest` cannot be a directory (see [issue #323](https://github.com/jprichardson/node-fs-extra/issues/323)). +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior. + - `errorOnExist` ``: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`. + - `dereference` ``: dereference symlinks, default is `false`. + - `preserveTimestamps` ``: will set last modification and access times to the ones of the original source files, default is `false`. + - `filter` ``: Function to filter copied files. Return `true` to include, `false` to exclude. This can also be a RegExp, however this is deprecated (See [issue #239](https://github.com/jprichardson/node-fs-extra/issues/239) for background). +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.copy('/tmp/myfile', '/tmp/mynewfile', err => { + if (err) return console.error(err) + + console.log('success!') +}) // copies file + +fs.copy('/tmp/mydir', '/tmp/mynewdir', err => { + if (err) return console.error(err) + + console.log('success!') +}) // copies directory, even if it has subdirectories or files + +// Promise usage: +fs.copy('/tmp/myfile', '/tmp/mynewfile') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` + +**Using filter function** + +```js +const fs = require('fs-extra') + +const filterFunc = (src, dest) => { + // your logic here + // it will be copied if return true +} + +fs.copy('/tmp/mydir', '/tmp/mynewdir', { filter: filterFunc }, err => { + if (err) return console.error(err) + + console.log('success!') +}) +``` diff --git a/node_modules/fs-extra/docs/emptyDir-sync.md b/node_modules/fs-extra/docs/emptyDir-sync.md new file mode 100644 index 0000000000..7decdbc00b --- /dev/null +++ b/node_modules/fs-extra/docs/emptyDir-sync.md @@ -0,0 +1,16 @@ +# emptyDirSync(dir) + +Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. + +**Alias:** `emptydirSync()` + +- `dir` `` + +## Example: + +```js +const fs = require('fs-extra') + +// assume this directory has a lot of files and folders +fs.emptyDirSync('/tmp/some/dir') +``` diff --git a/node_modules/fs-extra/docs/emptyDir.md b/node_modules/fs-extra/docs/emptyDir.md new file mode 100644 index 0000000000..6553e9a999 --- /dev/null +++ b/node_modules/fs-extra/docs/emptyDir.md @@ -0,0 +1,30 @@ +# emptyDir(dir, [callback]) + +Ensures that a directory is empty. Deletes directory contents if the directory is not empty. If the directory does not exist, it is created. The directory itself is not deleted. + +**Alias:** `emptydir()` + +- `dir` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +// assume this directory has a lot of files and folders +fs.emptyDir('/tmp/some/dir', err => { + if (err) return console.error(err) + + console.log('success!') +}) + +// With promises +fs.emptyDir('/tmp/some/dir') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/node_modules/fs-extra/docs/ensureDir-sync.md b/node_modules/fs-extra/docs/ensureDir-sync.md new file mode 100644 index 0000000000..8f083d278c --- /dev/null +++ b/node_modules/fs-extra/docs/ensureDir-sync.md @@ -0,0 +1,17 @@ +# ensureDirSync(dir) + +Ensures that the directory exists. If the directory structure does not exist, it is created. Like `mkdir -p`. + +**Aliases:** `mkdirsSync()`, `mkdirpSync()` + +- `dir` `` + +## Example: + +```js +const fs = require('fs-extra') + +const dir = '/tmp/this/path/does/not/exist' +fs.ensureDirSync(dir) +// dir has now been created, including the directory it is to be placed in +``` diff --git a/node_modules/fs-extra/docs/ensureDir.md b/node_modules/fs-extra/docs/ensureDir.md new file mode 100644 index 0000000000..d030d86685 --- /dev/null +++ b/node_modules/fs-extra/docs/ensureDir.md @@ -0,0 +1,29 @@ +# ensureDir(dir, [callback]) + +Ensures that the directory exists. If the directory structure does not exist, it is created. Like `mkdir -p`. + +**Aliases:** `mkdirs()`, `mkdirp()` + +- `dir` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const dir = '/tmp/this/path/does/not/exist' +fs.ensureDir(dir, err => { + console.log(err) // => null + // dir has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureDir(dir) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/node_modules/fs-extra/docs/ensureFile-sync.md b/node_modules/fs-extra/docs/ensureFile-sync.md new file mode 100644 index 0000000000..25ac39dece --- /dev/null +++ b/node_modules/fs-extra/docs/ensureFile-sync.md @@ -0,0 +1,17 @@ +# ensureFileSync(file) + +Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. + +**Alias:** `createFileSync()` + +- `file` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureFileSync(file) +// file has now been created, including the directory it is to be placed in +``` diff --git a/node_modules/fs-extra/docs/ensureFile.md b/node_modules/fs-extra/docs/ensureFile.md new file mode 100644 index 0000000000..987be6389d --- /dev/null +++ b/node_modules/fs-extra/docs/ensureFile.md @@ -0,0 +1,29 @@ +# ensureFile(file, [callback]) + +Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**. + +**Alias:** `createFile()` + +- `file` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureFile(file, err => { + console.log(err) // => null + // file has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureFile(file) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/node_modules/fs-extra/docs/ensureLink-sync.md b/node_modules/fs-extra/docs/ensureLink-sync.md new file mode 100644 index 0000000000..74769d30fd --- /dev/null +++ b/node_modules/fs-extra/docs/ensureLink-sync.md @@ -0,0 +1,17 @@ +# ensureLinkSync(srcpath, dstpath) + +Ensures that the link exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureLinkSync(srcpath, dstpath) +// link has now been created, including the directory it is to be placed in +``` diff --git a/node_modules/fs-extra/docs/ensureLink.md b/node_modules/fs-extra/docs/ensureLink.md new file mode 100644 index 0000000000..90d2a5d6c1 --- /dev/null +++ b/node_modules/fs-extra/docs/ensureLink.md @@ -0,0 +1,29 @@ +# ensureLink(srcpath, dstpath, [callback]) + +Ensures that the link exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureLink(srcpath, dstpath, err => { + console.log(err) // => null + // link has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureLink(srcpath, dstpath) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/node_modules/fs-extra/docs/ensureSymlink-sync.md b/node_modules/fs-extra/docs/ensureSymlink-sync.md new file mode 100644 index 0000000000..328d4c45d5 --- /dev/null +++ b/node_modules/fs-extra/docs/ensureSymlink-sync.md @@ -0,0 +1,18 @@ +# ensureSymlinkSync(srcpath, dstpath, [type]) + +Ensures that the symlink exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `type` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureSymlinkSync(srcpath, dstpath) +// symlink has now been created, including the directory it is to be placed in +``` diff --git a/node_modules/fs-extra/docs/ensureSymlink.md b/node_modules/fs-extra/docs/ensureSymlink.md new file mode 100644 index 0000000000..45524f19d1 --- /dev/null +++ b/node_modules/fs-extra/docs/ensureSymlink.md @@ -0,0 +1,30 @@ +# ensureSymlink(srcpath, dstpath, [type, callback]) + +Ensures that the symlink exists. If the directory structure does not exist, it is created. + +- `srcpath` `` +- `dstpath` `` +- `type` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const srcpath = '/tmp/file.txt' +const dstpath = '/tmp/this/path/does/not/exist/file.txt' +fs.ensureSymlink(srcpath, dstpath, err => { + console.log(err) // => null + // symlink has now been created, including the directory it is to be placed in +}) + +// With Promises: +fs.ensureSymlink(srcpath, dstpath) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/node_modules/fs-extra/docs/fs-read-write.md b/node_modules/fs-extra/docs/fs-read-write.md new file mode 100644 index 0000000000..805ea3c38c --- /dev/null +++ b/node_modules/fs-extra/docs/fs-read-write.md @@ -0,0 +1,39 @@ +# About `fs.read()` & `fs.write()` + +[`fs.read()`](https://nodejs.org/api/fs.html#fs_fs_read_fd_buffer_offset_length_position_callback) & [`fs.write()`](https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback) are different from other `fs` methods in that their callbacks are called with 3 arguments instead of the usual 2 arguments. + +If you're using them with callbacks, they will behave as usual. However, their promise usage is a little different. `fs-extra` promisifies these methods like [`util.promisify()`](https://nodejs.org/api/util.html#util_util_promisify_original) (only available in Node 8+) does. + +Here's the example promise usage: + +## `fs.read()` + +```js +// Basic promises +fs.read(fd, buffer, offset, length, position) + .then(results => { + console.log(results) + // { bytesRead: 20, buffer: } + }) + +// Async/await usage: +async function example () { + const { bytesRead, buffer } = await fs.read(fd, Buffer.alloc(length), offset, length, position) +} +``` + +## `fs.write()` + +```js +// Basic promises +fs.write(fd, buffer, offset, length, position) + .then(results => { + console.log(results) + // { bytesWritten: 20, buffer: } + }) + +// Async/await usage: +async function example () { + const { bytesWritten, buffer } = await fs.write(fd, Buffer.alloc(length), offset, length, position) +} +``` diff --git a/node_modules/fs-extra/docs/move-sync.md b/node_modules/fs-extra/docs/move-sync.md new file mode 100644 index 0000000000..cd701fef9b --- /dev/null +++ b/node_modules/fs-extra/docs/move-sync.md @@ -0,0 +1,24 @@ +# moveSync(src, dest, [options]) + +Moves a file or directory, even across devices. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `false`. + +## Example: + +```js +const fs = require('fs-extra') + +fs.moveSync('/tmp/somefile', '/tmp/does/not/exist/yet/somefile') +``` + +**Using `overwrite` option** + +```js +const fs = require('fs-extra') + +fs.moveSync('/tmp/somedir', '/tmp/may/already/existed/somedir', { overwrite: true }) +``` diff --git a/node_modules/fs-extra/docs/move.md b/node_modules/fs-extra/docs/move.md new file mode 100644 index 0000000000..0dd210c5b2 --- /dev/null +++ b/node_modules/fs-extra/docs/move.md @@ -0,0 +1,41 @@ +# move(src, dest, [options, callback]) + +Moves a file or directory, even across devices. + +- `src` `` +- `dest` `` +- `options` `` + - `overwrite` ``: overwrite existing file or directory, default is `false`. +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile', err => { + if (err) return console.error(err) + + console.log('success!') +}) + +fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` + +**Using `overwrite` option** + +```js +const fs = require('fs-extra') + +fs.move('/tmp/somedir', '/tmp/may/already/existed/somedir', { overwrite: true }, err => { + if (err) return console.error(err) + + console.log('success!') +}) +``` diff --git a/node_modules/fs-extra/docs/outputFile-sync.md b/node_modules/fs-extra/docs/outputFile-sync.md new file mode 100644 index 0000000000..38eee8b6bf --- /dev/null +++ b/node_modules/fs-extra/docs/outputFile-sync.md @@ -0,0 +1,19 @@ +# outputFileSync(file, data, [options]) + +Almost the same as `writeFileSync` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `file` must be a file path (a buffer or a file descriptor is not allowed). `options` are what you'd pass to [`fs.writeFileSync()`](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options). + +- `file` `` +- `data` ` | | ` +- `options` ` | ` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.outputFileSync(file, 'hello!') + +const data = fs.readFileSync(file, 'utf8') +console.log(data) // => hello! +``` diff --git a/node_modules/fs-extra/docs/outputFile.md b/node_modules/fs-extra/docs/outputFile.md new file mode 100644 index 0000000000..766787d924 --- /dev/null +++ b/node_modules/fs-extra/docs/outputFile.md @@ -0,0 +1,34 @@ +# outputFile(file, data, [options, callback]) + +Almost the same as `writeFile` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created. `file` must be a file path (a buffer or a file descriptor is not allowed). `options` are what you'd pass to [`fs.writeFile()`](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback). + +- `file` `` +- `data` ` | | ` +- `options` ` | ` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +fs.outputFile(file, 'hello!', err => { + console.log(err) // => null + + fs.readFile(file, 'utf8', (err, data) => { + if (err) return console.error(err) + console.log(data) // => hello! + }) +}) + +// With Promises: +fs.outputFile(file, 'hello!') +.then(() => fs.readFile(file, 'utf8')) +.then(data => { + console.log(data) // => hello! +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/node_modules/fs-extra/docs/outputJson-sync.md b/node_modules/fs-extra/docs/outputJson-sync.md new file mode 100644 index 0000000000..ef78f802d1 --- /dev/null +++ b/node_modules/fs-extra/docs/outputJson-sync.md @@ -0,0 +1,25 @@ +# outputJsonSync(file, object, [options]) + +Almost the same as [`writeJsonSync`](writeJson-sync.md), except that if the directory does not exist, it's created. + +**Alias:** `outputJSONSync()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFileSync` options](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options) + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.json' +fs.outputJsonSync(file, {name: 'JP'}) + +const data = fs.readJsonSync(file) +console.log(data.name) // => JP +``` diff --git a/node_modules/fs-extra/docs/outputJson.md b/node_modules/fs-extra/docs/outputJson.md new file mode 100644 index 0000000000..7156991e23 --- /dev/null +++ b/node_modules/fs-extra/docs/outputJson.md @@ -0,0 +1,40 @@ +# outputJson(file, object, [options, callback]) + +Almost the same as [`writeJson`](writeJson.md), except that if the directory does not exist, it's created. + +**Alias:** `outputJSON()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFile` options](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.json' +fs.outputJson(file, {name: 'JP'}, err => { + console.log(err) // => null + + fs.readJson(file, (err, data) => { + if (err) return console.error(err) + console.log(data.name) // => JP + }) +}) + +// With Promises: +fs.outputJson(file, {name: 'JP'}) +.then(() => fs.readJson(file)) +.then(data => { + console.log(data.name) // => JP +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/node_modules/fs-extra/docs/pathExists-sync.md b/node_modules/fs-extra/docs/pathExists-sync.md new file mode 100644 index 0000000000..3ef973c218 --- /dev/null +++ b/node_modules/fs-extra/docs/pathExists-sync.md @@ -0,0 +1,3 @@ +# pathExistsSync(file) + +An alias for [`fs.existsSync()`](https://nodejs.org/api/fs.html#fs_fs_existssync_path), created for consistency with [`pathExists()`](pathExists.md). diff --git a/node_modules/fs-extra/docs/pathExists.md b/node_modules/fs-extra/docs/pathExists.md new file mode 100644 index 0000000000..0302b09def --- /dev/null +++ b/node_modules/fs-extra/docs/pathExists.md @@ -0,0 +1,22 @@ +# pathExists(file[, callback]) + +Test whether or not the given path exists by checking with the file system. Like [`fs.exists`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback), but with a normal callback signature (err, exists). Uses `fs.access` under the hood. + +- `file` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/this/path/does/not/exist/file.txt' +// Promise usage: +fs.pathExists(file) + .then(exists => console.log(exists)) // => false +// Callback usage: +fs.pathExists(file, (err, exists) => { + console.log(err) // => null + console.log(exists) // => false +}) +``` diff --git a/node_modules/fs-extra/docs/readJson-sync.md b/node_modules/fs-extra/docs/readJson-sync.md new file mode 100644 index 0000000000..a1356379c0 --- /dev/null +++ b/node_modules/fs-extra/docs/readJson-sync.md @@ -0,0 +1,33 @@ +# readJsonSync(file, [options]) + +Reads a JSON file and then parses it into an object. `options` are the same +that you'd pass to [`jsonFile.readFileSync`](https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options). + +**Alias:** `readJSONSync()` + +- `file` `` +- `options` `` + +## Example: + +```js +const fs = require('fs-extra') + +const packageObj = fs.readJsonSync('./package.json') +console.log(packageObj.version) // => 2.0.0 +``` + +--- + +`readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/some-invalid.json' +const data = '{not valid JSON' +fs.writeFileSync(file, data) + +const obj = fs.readJsonSync(file, { throws: false }) +console.log(obj) // => null +``` diff --git a/node_modules/fs-extra/docs/readJson.md b/node_modules/fs-extra/docs/readJson.md new file mode 100644 index 0000000000..6edc329d5c --- /dev/null +++ b/node_modules/fs-extra/docs/readJson.md @@ -0,0 +1,58 @@ +# readJson(file, [options, callback]) + +Reads a JSON file and then parses it into an object. `options` are the same +that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback). + +**Alias:** `readJSON()` + +- `file` `` +- `options` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.readJson('./package.json', (err, packageObj) => { + if (err) console.error(err) + + console.log(packageObj.version) // => 0.1.3 +}) + +// Promise Usage +fs.readJson('./package.json') +.then(packageObj => { + console.log(packageObj.version) // => 0.1.3 +}) +.catch(err => { + console.error(err) +}) +``` + +--- + +`readJson()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: + +```js +const fs = require('fs-extra') + +const file = '/tmp/some-invalid.json' +const data = '{not valid JSON' +fs.writeFileSync(file, data) + +fs.readJson(file, { throws: false }, (err, obj) => { + if (err) console.error(err) + + console.log(obj) // => null +}) + +// Promise Usage +fs.readJson(file, { throws: false }) +.then(obj => { + console.log(obj) // => null +}) +.catch(err => { + console.error(err) // Not called +}) +``` diff --git a/node_modules/fs-extra/docs/remove-sync.md b/node_modules/fs-extra/docs/remove-sync.md new file mode 100644 index 0000000000..fb01fe8210 --- /dev/null +++ b/node_modules/fs-extra/docs/remove-sync.md @@ -0,0 +1,16 @@ +# removeSync(path) + +Removes a file or directory. The directory can have contents. Like `rm -rf`. + +- `path` `` + +## Example: + +```js +const fs = require('fs-extra') + +// remove file +fs.removeSync('/tmp/myfile') + +fs.removeSync('/home/jprichardson') // I just deleted my entire HOME directory. +``` diff --git a/node_modules/fs-extra/docs/remove.md b/node_modules/fs-extra/docs/remove.md new file mode 100644 index 0000000000..364029351a --- /dev/null +++ b/node_modules/fs-extra/docs/remove.md @@ -0,0 +1,34 @@ +# remove(path, [callback]) + +Removes a file or directory. The directory can have contents. Like `rm -rf`. + +- `path` `` +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +// remove file +fs.remove('/tmp/myfile', err => { + if (err) return console.error(err) + + console.log('success!') +}) + +fs.remove('/home/jprichardson', err => { + if (err) return console.error(err) + + console.log('success!') // I just deleted my entire HOME directory. +}) + +// Promise Usage +fs.remove('/tmp/myfile') +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` diff --git a/node_modules/fs-extra/docs/writeJson-sync.md b/node_modules/fs-extra/docs/writeJson-sync.md new file mode 100644 index 0000000000..c22459db8f --- /dev/null +++ b/node_modules/fs-extra/docs/writeJson-sync.md @@ -0,0 +1,24 @@ +# writeJsonSync(file, object, [options]) + +Writes an object to a JSON file. + +**Alias:** `writeJSONSync()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFileSync` options](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options) + +## Example: + +```js +const fs = require('fs-extra') + +fs.writeJsonSync('./package.json', {name: 'fs-extra'}) +``` +--- + +**See also:** [`outputJsonSync()`](outputJson-sync.md) diff --git a/node_modules/fs-extra/docs/writeJson.md b/node_modules/fs-extra/docs/writeJson.md new file mode 100644 index 0000000000..8e35271fbb --- /dev/null +++ b/node_modules/fs-extra/docs/writeJson.md @@ -0,0 +1,39 @@ +# writeJson(file, object, [options, callback]) + +Writes an object to a JSON file. + +**Alias:** `writeJSON()` + +- `file` `` +- `object` `` +- `options` `` + - `spaces` `` Number of spaces to indent; or a string to use for indentation (i.e. pass `'\t'` for tab indentation). See [the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument) for more info. + - `EOL` `` Set EOL character. Default is `\n`. + - `replacer` [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) + - Also accepts [`fs.writeFile` options](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) +- `callback` `` + +## Example: + +```js +const fs = require('fs-extra') + +fs.writeJson('./package.json', {name: 'fs-extra'}, err => { + if (err) return console.error(err) + + console.log('success!') +}) + +// With Promises +fs.writeJson('./package.json', {name: 'fs-extra'}) +.then(() => { + console.log('success!') +}) +.catch(err => { + console.error(err) +}) +``` + +--- + +**See also:** [`outputJson()`](outputJson.md) diff --git a/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js b/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js new file mode 100644 index 0000000000..102a6be698 --- /dev/null +++ b/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js @@ -0,0 +1,41 @@ +'use strict' + +const fs = require('graceful-fs') + +const BUF_LENGTH = 64 * 1024 +const _buff = require('../util/buffer')(BUF_LENGTH) + +function copyFileSync (srcFile, destFile, options) { + const overwrite = options.overwrite + const errorOnExist = options.errorOnExist + const preserveTimestamps = options.preserveTimestamps + + if (fs.existsSync(destFile)) { + if (overwrite) { + fs.unlinkSync(destFile) + } else if (errorOnExist) { + throw new Error(`${destFile} already exists`) + } else return + } + + const fdr = fs.openSync(srcFile, 'r') + const stat = fs.fstatSync(fdr) + const fdw = fs.openSync(destFile, 'w', stat.mode) + let bytesRead = 1 + let pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + if (preserveTimestamps) { + fs.futimesSync(fdw, stat.atime, stat.mtime) + } + + fs.closeSync(fdr) + fs.closeSync(fdw) +} + +module.exports = copyFileSync diff --git a/node_modules/fs-extra/lib/copy-sync/copy-sync.js b/node_modules/fs-extra/lib/copy-sync/copy-sync.js new file mode 100644 index 0000000000..9d5639c3cc --- /dev/null +++ b/node_modules/fs-extra/lib/copy-sync/copy-sync.js @@ -0,0 +1,62 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const copyFileSync = require('./copy-file-sync') +const mkdir = require('../mkdirs') + +function copySync (src, dest, options) { + if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + + options = options || {} + options.recursive = !!options.recursive + + // default to true for now + options.clobber = 'clobber' in options ? !!options.clobber : true + // overwrite falls back to clobber + options.overwrite = 'overwrite' in options ? !!options.overwrite : options.clobber + options.dereference = 'dereference' in options ? !!options.dereference : false + options.preserveTimestamps = 'preserveTimestamps' in options ? !!options.preserveTimestamps : false + + options.filter = options.filter || function () { return true } + + // Warn about using preserveTimestamps on 32-bit node: + if (options.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + const stats = (options.recursive && !options.dereference) ? fs.lstatSync(src) : fs.statSync(src) + const destFolder = path.dirname(dest) + const destFolderExists = fs.existsSync(destFolder) + let performCopy = false + + if (options.filter instanceof RegExp) { + console.warn('Warning: fs-extra: Passing a RegExp filter is deprecated, use a function') + performCopy = options.filter.test(src) + } else if (typeof options.filter === 'function') performCopy = options.filter(src, dest) + + if (stats.isFile() && performCopy) { + if (!destFolderExists) mkdir.mkdirsSync(destFolder) + copyFileSync(src, dest, { + overwrite: options.overwrite, + errorOnExist: options.errorOnExist, + preserveTimestamps: options.preserveTimestamps + }) + } else if (stats.isDirectory() && performCopy) { + if (!fs.existsSync(dest)) mkdir.mkdirsSync(dest) + const contents = fs.readdirSync(src) + contents.forEach(content => { + const opts = options + opts.recursive = true + copySync(path.join(src, content), path.join(dest, content), opts) + }) + } else if (options.recursive && stats.isSymbolicLink() && performCopy) { + const srcPath = fs.readlinkSync(src) + fs.symlinkSync(srcPath, dest) + } +} + +module.exports = copySync diff --git a/node_modules/fs-extra/lib/copy-sync/index.js b/node_modules/fs-extra/lib/copy-sync/index.js new file mode 100644 index 0000000000..ebc7e0b915 --- /dev/null +++ b/node_modules/fs-extra/lib/copy-sync/index.js @@ -0,0 +1,3 @@ +module.exports = { + copySync: require('./copy-sync') +} diff --git a/node_modules/fs-extra/lib/copy/copy.js b/node_modules/fs-extra/lib/copy/copy.js new file mode 100644 index 0000000000..309a93df0f --- /dev/null +++ b/node_modules/fs-extra/lib/copy/copy.js @@ -0,0 +1,54 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const ncp = require('./ncp') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function copy (src, dest, options, callback) { + if (typeof options === 'function' && !callback) { + callback = options + options = {} + } else if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + callback = callback || function () {} + options = options || {} + + // Warn about using preserveTimestamps on 32-bit node: + if (options.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + // don't allow src and dest to be the same + const basePath = process.cwd() + const currentPath = path.resolve(basePath, src) + const targetPath = path.resolve(basePath, dest) + if (currentPath === targetPath) return callback(new Error('Source and destination must not be the same.')) + + fs.lstat(src, (err, stats) => { + if (err) return callback(err) + + let dir = null + if (stats.isDirectory()) { + const parts = dest.split(path.sep) + parts.pop() + dir = parts.join(path.sep) + } else { + dir = path.dirname(dest) + } + + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return ncp(src, dest, options, callback) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + ncp(src, dest, options, callback) + }) + }) + }) +} + +module.exports = copy diff --git a/node_modules/fs-extra/lib/copy/index.js b/node_modules/fs-extra/lib/copy/index.js new file mode 100644 index 0000000000..a6a51da669 --- /dev/null +++ b/node_modules/fs-extra/lib/copy/index.js @@ -0,0 +1,4 @@ +const u = require('universalify').fromCallback +module.exports = { + copy: u(require('./copy')) +} diff --git a/node_modules/fs-extra/lib/copy/ncp.js b/node_modules/fs-extra/lib/copy/ncp.js new file mode 100644 index 0000000000..9670ee02ec --- /dev/null +++ b/node_modules/fs-extra/lib/copy/ncp.js @@ -0,0 +1,234 @@ +// imported from ncp (this is temporary, will rewrite) + +var fs = require('graceful-fs') +var path = require('path') +var utimes = require('../util/utimes') + +function ncp (source, dest, options, callback) { + if (!callback) { + callback = options + options = {} + } + + var basePath = process.cwd() + var currentPath = path.resolve(basePath, source) + var targetPath = path.resolve(basePath, dest) + + var filter = options.filter + var transform = options.transform + var overwrite = options.overwrite + // If overwrite is undefined, use clobber, otherwise default to true: + if (overwrite === undefined) overwrite = options.clobber + if (overwrite === undefined) overwrite = true + var errorOnExist = options.errorOnExist + var dereference = options.dereference + var preserveTimestamps = options.preserveTimestamps === true + + var started = 0 + var finished = 0 + var running = 0 + + var errored = false + + startCopy(currentPath) + + function startCopy (source) { + started++ + if (filter) { + if (filter instanceof RegExp) { + console.warn('Warning: fs-extra: Passing a RegExp filter is deprecated, use a function') + if (!filter.test(source)) { + return doneOne(true) + } + } else if (typeof filter === 'function') { + if (!filter(source, dest)) { + return doneOne(true) + } + } + } + return getStats(source) + } + + function getStats (source) { + var stat = dereference ? fs.stat : fs.lstat + running++ + stat(source, function (err, stats) { + if (err) return onError(err) + + // We need to get the mode from the stats object and preserve it. + var item = { + name: source, + mode: stats.mode, + mtime: stats.mtime, // modified time + atime: stats.atime, // access time + stats: stats // temporary + } + + if (stats.isDirectory()) { + return onDir(item) + } else if (stats.isFile() || stats.isCharacterDevice() || stats.isBlockDevice()) { + return onFile(item) + } else if (stats.isSymbolicLink()) { + // Symlinks don't really need to know about the mode. + return onLink(source) + } + }) + } + + function onFile (file) { + var target = file.name.replace(currentPath, targetPath.replace('$', '$$$$')) // escapes '$' with '$$' + isWritable(target, function (writable) { + if (writable) { + copyFile(file, target) + } else { + if (overwrite) { + rmFile(target, function () { + copyFile(file, target) + }) + } else if (errorOnExist) { + onError(new Error(target + ' already exists')) + } else { + doneOne() + } + } + }) + } + + function copyFile (file, target) { + var readStream = fs.createReadStream(file.name) + var writeStream = fs.createWriteStream(target, { mode: file.mode }) + + readStream.on('error', onError) + writeStream.on('error', onError) + + if (transform) { + transform(readStream, writeStream, file) + } else { + writeStream.on('open', function () { + readStream.pipe(writeStream) + }) + } + + writeStream.once('close', function () { + fs.chmod(target, file.mode, function (err) { + if (err) return onError(err) + if (preserveTimestamps) { + utimes.utimesMillis(target, file.atime, file.mtime, function (err) { + if (err) return onError(err) + return doneOne() + }) + } else { + doneOne() + } + }) + }) + } + + function rmFile (file, done) { + fs.unlink(file, function (err) { + if (err) return onError(err) + return done() + }) + } + + function onDir (dir) { + var target = dir.name.replace(currentPath, targetPath.replace('$', '$$$$')) // escapes '$' with '$$' + isWritable(target, function (writable) { + if (writable) { + return mkDir(dir, target) + } + copyDir(dir.name) + }) + } + + function mkDir (dir, target) { + fs.mkdir(target, dir.mode, function (err) { + if (err) return onError(err) + // despite setting mode in fs.mkdir, doesn't seem to work + // so we set it here. + fs.chmod(target, dir.mode, function (err) { + if (err) return onError(err) + copyDir(dir.name) + }) + }) + } + + function copyDir (dir) { + fs.readdir(dir, function (err, items) { + if (err) return onError(err) + items.forEach(function (item) { + startCopy(path.join(dir, item)) + }) + return doneOne() + }) + } + + function onLink (link) { + var target = link.replace(currentPath, targetPath) + fs.readlink(link, function (err, resolvedPath) { + if (err) return onError(err) + checkLink(resolvedPath, target) + }) + } + + function checkLink (resolvedPath, target) { + if (dereference) { + resolvedPath = path.resolve(basePath, resolvedPath) + } + isWritable(target, function (writable) { + if (writable) { + return makeLink(resolvedPath, target) + } + fs.readlink(target, function (err, targetDest) { + if (err) return onError(err) + + if (dereference) { + targetDest = path.resolve(basePath, targetDest) + } + if (targetDest === resolvedPath) { + return doneOne() + } + return rmFile(target, function () { + makeLink(resolvedPath, target) + }) + }) + }) + } + + function makeLink (linkPath, target) { + fs.symlink(linkPath, target, function (err) { + if (err) return onError(err) + return doneOne() + }) + } + + function isWritable (path, done) { + fs.lstat(path, function (err) { + if (err) { + if (err.code === 'ENOENT') return done(true) + return done(false) + } + return done(false) + }) + } + + function onError (err) { + // ensure callback is defined & called only once: + if (!errored && callback !== undefined) { + errored = true + return callback(err) + } + } + + function doneOne (skipped) { + if (!skipped) running-- + finished++ + if ((started === finished) && (running === 0)) { + if (callback !== undefined) { + return callback(null) + } + } + } +} + +module.exports = ncp diff --git a/node_modules/fs-extra/lib/empty/index.js b/node_modules/fs-extra/lib/empty/index.js new file mode 100644 index 0000000000..db05c1713d --- /dev/null +++ b/node_modules/fs-extra/lib/empty/index.js @@ -0,0 +1,48 @@ +'use strict' + +const u = require('universalify').fromCallback +const fs = require('fs') +const path = require('path') +const mkdir = require('../mkdirs') +const remove = require('../remove') + +const emptyDir = u(function emptyDir (dir, callback) { + callback = callback || function () {} + fs.readdir(dir, (err, items) => { + if (err) return mkdir.mkdirs(dir, callback) + + items = items.map(item => path.join(dir, item)) + + deleteItem() + + function deleteItem () { + const item = items.pop() + if (!item) return callback() + remove.remove(item, err => { + if (err) return callback(err) + deleteItem() + }) + } + }) +}) + +function emptyDirSync (dir) { + let items + try { + items = fs.readdirSync(dir) + } catch (err) { + return mkdir.mkdirsSync(dir) + } + + items.forEach(item => { + item = path.join(dir, item) + remove.removeSync(item) + }) +} + +module.exports = { + emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir, + emptydir: emptyDir +} diff --git a/node_modules/fs-extra/lib/ensure/file.js b/node_modules/fs-extra/lib/ensure/file.js new file mode 100644 index 0000000000..67eed3017c --- /dev/null +++ b/node_modules/fs-extra/lib/ensure/file.js @@ -0,0 +1,49 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('graceful-fs') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function createFile (file, callback) { + function makeFile () { + fs.writeFile(file, '', err => { + if (err) return callback(err) + callback() + }) + } + + fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err + if (!err && stats.isFile()) return callback() + const dir = path.dirname(file) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeFile() + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeFile() + }) + }) + }) +} + +function createFileSync (file) { + let stats + try { + stats = fs.statSync(file) + } catch (e) {} + if (stats && stats.isFile()) return + + const dir = path.dirname(file) + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + fs.writeFileSync(file, '') +} + +module.exports = { + createFile: u(createFile), + createFileSync +} diff --git a/node_modules/fs-extra/lib/ensure/index.js b/node_modules/fs-extra/lib/ensure/index.js new file mode 100644 index 0000000000..c1f67b7187 --- /dev/null +++ b/node_modules/fs-extra/lib/ensure/index.js @@ -0,0 +1,23 @@ +'use strict' + +const file = require('./file') +const link = require('./link') +const symlink = require('./symlink') + +module.exports = { + // file + createFile: file.createFile, + createFileSync: file.createFileSync, + ensureFile: file.createFile, + ensureFileSync: file.createFileSync, + // link + createLink: link.createLink, + createLinkSync: link.createLinkSync, + ensureLink: link.createLink, + ensureLinkSync: link.createLinkSync, + // symlink + createSymlink: symlink.createSymlink, + createSymlinkSync: symlink.createSymlinkSync, + ensureSymlink: symlink.createSymlink, + ensureSymlinkSync: symlink.createSymlinkSync +} diff --git a/node_modules/fs-extra/lib/ensure/link.js b/node_modules/fs-extra/lib/ensure/link.js new file mode 100644 index 0000000000..49fe3791f6 --- /dev/null +++ b/node_modules/fs-extra/lib/ensure/link.js @@ -0,0 +1,61 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('graceful-fs') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function createLink (srcpath, dstpath, callback) { + function makeLink (srcpath, dstpath) { + fs.link(srcpath, dstpath, err => { + if (err) return callback(err) + callback(null) + }) + } + + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureLink') + return callback(err) + } + + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeLink(srcpath, dstpath) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeLink(srcpath, dstpath) + }) + }) + }) + }) +} + +function createLinkSync (srcpath, dstpath, callback) { + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + try { + fs.lstatSync(srcpath) + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink') + throw err + } + + const dir = path.dirname(dstpath) + const dirExists = fs.existsSync(dir) + if (dirExists) return fs.linkSync(srcpath, dstpath) + mkdir.mkdirsSync(dir) + + return fs.linkSync(srcpath, dstpath) +} + +module.exports = { + createLink: u(createLink), + createLinkSync +} diff --git a/node_modules/fs-extra/lib/ensure/symlink-paths.js b/node_modules/fs-extra/lib/ensure/symlink-paths.js new file mode 100644 index 0000000000..4a6b78abf9 --- /dev/null +++ b/node_modules/fs-extra/lib/ensure/symlink-paths.js @@ -0,0 +1,99 @@ +'use strict' + +const path = require('path') +const fs = require('graceful-fs') +const pathExists = require('../path-exists').pathExists + +/** + * Function that returns two types of paths, one relative to symlink, and one + * relative to the current working directory. Checks if path is absolute or + * relative. If the path is relative, this function checks if the path is + * relative to symlink or relative to current working directory. This is an + * initiative to find a smarter `srcpath` to supply when building symlinks. + * This allows you to determine which path to use out of one of three possible + * types of source paths. The first is an absolute path. This is detected by + * `path.isAbsolute()`. When an absolute path is provided, it is checked to + * see if it exists. If it does it's used, if not an error is returned + * (callback)/ thrown (sync). The other two options for `srcpath` are a + * relative url. By default Node's `fs.symlink` works by creating a symlink + * using `dstpath` and expects the `srcpath` to be relative to the newly + * created symlink. If you provide a `srcpath` that does not exist on the file + * system it results in a broken symlink. To minimize this, the function + * checks to see if the 'relative to symlink' source file exists, and if it + * does it will use it. If it does not, it checks if there's a file that + * exists that is relative to the current working directory, if does its used. + * This preserves the expectations of the original fs.symlink spec and adds + * the ability to pass in `relative to current working direcotry` paths. + */ + +function symlinkPaths (srcpath, dstpath, callback) { + if (path.isAbsolute(srcpath)) { + return fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': srcpath + }) + }) + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + return pathExists(relativeToDst, (err, exists) => { + if (err) return callback(err) + if (exists) { + return callback(null, { + 'toCwd': relativeToDst, + 'toDst': srcpath + }) + } else { + return fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + }) + }) + } + }) + } +} + +function symlinkPathsSync (srcpath, dstpath) { + let exists + if (path.isAbsolute(srcpath)) { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('absolute srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': srcpath + } + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + exists = fs.existsSync(relativeToDst) + if (exists) { + return { + 'toCwd': relativeToDst, + 'toDst': srcpath + } + } else { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('relative srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + } + } + } +} + +module.exports = { + symlinkPaths, + symlinkPathsSync +} diff --git a/node_modules/fs-extra/lib/ensure/symlink-type.js b/node_modules/fs-extra/lib/ensure/symlink-type.js new file mode 100644 index 0000000000..4f8787c2a3 --- /dev/null +++ b/node_modules/fs-extra/lib/ensure/symlink-type.js @@ -0,0 +1,31 @@ +'use strict' + +const fs = require('graceful-fs') + +function symlinkType (srcpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + if (type) return callback(null, type) + fs.lstat(srcpath, (err, stats) => { + if (err) return callback(null, 'file') + type = (stats && stats.isDirectory()) ? 'dir' : 'file' + callback(null, type) + }) +} + +function symlinkTypeSync (srcpath, type) { + let stats + + if (type) return type + try { + stats = fs.lstatSync(srcpath) + } catch (e) { + return 'file' + } + return (stats && stats.isDirectory()) ? 'dir' : 'file' +} + +module.exports = { + symlinkType, + symlinkTypeSync +} diff --git a/node_modules/fs-extra/lib/ensure/symlink.js b/node_modules/fs-extra/lib/ensure/symlink.js new file mode 100644 index 0000000000..847c1b9d1a --- /dev/null +++ b/node_modules/fs-extra/lib/ensure/symlink.js @@ -0,0 +1,66 @@ +'use strict' + +const u = require('universalify').fromCallback +const path = require('path') +const fs = require('graceful-fs') +const _mkdirs = require('../mkdirs') +const mkdirs = _mkdirs.mkdirs +const mkdirsSync = _mkdirs.mkdirsSync + +const _symlinkPaths = require('./symlink-paths') +const symlinkPaths = _symlinkPaths.symlinkPaths +const symlinkPathsSync = _symlinkPaths.symlinkPathsSync + +const _symlinkType = require('./symlink-type') +const symlinkType = _symlinkType.symlinkType +const symlinkTypeSync = _symlinkType.symlinkTypeSync + +const pathExists = require('../path-exists').pathExists + +function createSymlink (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + symlinkPaths(srcpath, dstpath, (err, relative) => { + if (err) return callback(err) + srcpath = relative.toDst + symlinkType(relative.toCwd, type, (err, type) => { + if (err) return callback(err) + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) + mkdirs(dir, err => { + if (err) return callback(err) + fs.symlink(srcpath, dstpath, type, callback) + }) + }) + }) + }) + }) +} + +function createSymlinkSync (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + const relative = symlinkPathsSync(srcpath, dstpath) + srcpath = relative.toDst + type = symlinkTypeSync(relative.toCwd, type) + const dir = path.dirname(dstpath) + const exists = fs.existsSync(dir) + if (exists) return fs.symlinkSync(srcpath, dstpath, type) + mkdirsSync(dir) + return fs.symlinkSync(srcpath, dstpath, type) +} + +module.exports = { + createSymlink: u(createSymlink), + createSymlinkSync +} diff --git a/node_modules/fs-extra/lib/fs/index.js b/node_modules/fs-extra/lib/fs/index.js new file mode 100644 index 0000000000..1821fd0004 --- /dev/null +++ b/node_modules/fs-extra/lib/fs/index.js @@ -0,0 +1,107 @@ +// This is adapted from https://github.com/normalize/mz +// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors +const u = require('universalify').fromCallback +const fs = require('graceful-fs') + +const api = [ + 'access', + 'appendFile', + 'chmod', + 'chown', + 'close', + 'copyFile', + 'fchmod', + 'fchown', + 'fdatasync', + 'fstat', + 'fsync', + 'ftruncate', + 'futimes', + 'lchown', + 'link', + 'lstat', + 'mkdir', + 'mkdtemp', + 'open', + 'readFile', + 'readdir', + 'readlink', + 'realpath', + 'rename', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'writeFile' +].filter(key => { + // Some commands are not available on some systems. Ex: + // fs.copyFile was added in Node.js v8.5.0 + // fs.mkdtemp was added in Node.js v5.10.0 + // fs.lchown is not available on at least some Linux + return typeof fs[key] === 'function' +}) + +// Export all keys: +Object.keys(fs).forEach(key => { + exports[key] = fs[key] +}) + +// Universalify async methods: +api.forEach(method => { + exports[method] = u(fs[method]) +}) + +// We differ from mz/fs in that we still ship the old, broken, fs.exists() +// since we are a drop-in replacement for the native module +exports.exists = function (filename, callback) { + if (typeof callback === 'function') { + return fs.exists(filename, callback) + } + return new Promise(resolve => { + return fs.exists(filename, resolve) + }) +} + +// fs.read() & fs.write need special treatment due to multiple callback args + +exports.read = function (fd, buffer, offset, length, position, callback) { + if (typeof callback === 'function') { + return fs.read(fd, buffer, offset, length, position, callback) + } + return new Promise((resolve, reject) => { + fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { + if (err) return reject(err) + resolve({ bytesRead, buffer }) + }) + }) +} + +// Function signature can be +// fs.write(fd, buffer[, offset[, length[, position]]], callback) +// OR +// fs.write(fd, string[, position[, encoding]], callback) +// so we need to handle both cases +exports.write = function (fd, buffer, a, b, c, callback) { + if (typeof arguments[arguments.length - 1] === 'function') { + return fs.write(fd, buffer, a, b, c, callback) + } + + // Check for old, depricated fs.write(fd, string[, position[, encoding]], callback) + if (typeof buffer === 'string') { + return new Promise((resolve, reject) => { + fs.write(fd, buffer, a, b, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) + } + + return new Promise((resolve, reject) => { + fs.write(fd, buffer, a, b, c, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) +} diff --git a/node_modules/fs-extra/lib/index.js b/node_modules/fs-extra/lib/index.js new file mode 100644 index 0000000000..cb7dd9e650 --- /dev/null +++ b/node_modules/fs-extra/lib/index.js @@ -0,0 +1,22 @@ +'use strict' + +const assign = require('./util/assign') + +const fs = {} + +// Export graceful-fs: +assign(fs, require('./fs')) +// Export extra methods: +assign(fs, require('./copy')) +assign(fs, require('./copy-sync')) +assign(fs, require('./mkdirs')) +assign(fs, require('./remove')) +assign(fs, require('./json')) +assign(fs, require('./move')) +assign(fs, require('./move-sync')) +assign(fs, require('./empty')) +assign(fs, require('./ensure')) +assign(fs, require('./output')) +assign(fs, require('./path-exists')) + +module.exports = fs diff --git a/node_modules/fs-extra/lib/json/index.js b/node_modules/fs-extra/lib/json/index.js new file mode 100644 index 0000000000..bae68d45a5 --- /dev/null +++ b/node_modules/fs-extra/lib/json/index.js @@ -0,0 +1,16 @@ +'use strict' + +const u = require('universalify').fromCallback +const jsonFile = require('./jsonfile') + +jsonFile.outputJson = u(require('./output-json')) +jsonFile.outputJsonSync = require('./output-json-sync') +// aliases +jsonFile.outputJSON = jsonFile.outputJson +jsonFile.outputJSONSync = jsonFile.outputJsonSync +jsonFile.writeJSON = jsonFile.writeJson +jsonFile.writeJSONSync = jsonFile.writeJsonSync +jsonFile.readJSON = jsonFile.readJson +jsonFile.readJSONSync = jsonFile.readJsonSync + +module.exports = jsonFile diff --git a/node_modules/fs-extra/lib/json/jsonfile.js b/node_modules/fs-extra/lib/json/jsonfile.js new file mode 100644 index 0000000000..59cdb3e465 --- /dev/null +++ b/node_modules/fs-extra/lib/json/jsonfile.js @@ -0,0 +1,12 @@ +'use strict' + +const u = require('universalify').fromCallback +const jsonFile = require('jsonfile') + +module.exports = { + // jsonfile exports + readJson: u(jsonFile.readFile), + readJsonSync: jsonFile.readFileSync, + writeJson: u(jsonFile.writeFile), + writeJsonSync: jsonFile.writeFileSync +} diff --git a/node_modules/fs-extra/lib/json/output-json-sync.js b/node_modules/fs-extra/lib/json/output-json-sync.js new file mode 100644 index 0000000000..6f76710e37 --- /dev/null +++ b/node_modules/fs-extra/lib/json/output-json-sync.js @@ -0,0 +1,18 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const mkdir = require('../mkdirs') +const jsonFile = require('./jsonfile') + +function outputJsonSync (file, data, options) { + const dir = path.dirname(file) + + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + jsonFile.writeJsonSync(file, data, options) +} + +module.exports = outputJsonSync diff --git a/node_modules/fs-extra/lib/json/output-json.js b/node_modules/fs-extra/lib/json/output-json.js new file mode 100644 index 0000000000..d45edb89e5 --- /dev/null +++ b/node_modules/fs-extra/lib/json/output-json.js @@ -0,0 +1,27 @@ +'use strict' + +const path = require('path') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists +const jsonFile = require('./jsonfile') + +function outputJson (file, data, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + const dir = path.dirname(file) + + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return jsonFile.writeJson(file, data, options, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + jsonFile.writeJson(file, data, options, callback) + }) + }) +} + +module.exports = outputJson diff --git a/node_modules/fs-extra/lib/mkdirs/index.js b/node_modules/fs-extra/lib/mkdirs/index.js new file mode 100644 index 0000000000..29975c5b68 --- /dev/null +++ b/node_modules/fs-extra/lib/mkdirs/index.js @@ -0,0 +1,14 @@ +'use strict' +const u = require('universalify').fromCallback +const mkdirs = u(require('./mkdirs')) +const mkdirsSync = require('./mkdirs-sync') + +module.exports = { + mkdirs: mkdirs, + mkdirsSync: mkdirsSync, + // alias + mkdirp: mkdirs, + mkdirpSync: mkdirsSync, + ensureDir: mkdirs, + ensureDirSync: mkdirsSync +} diff --git a/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js b/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js new file mode 100644 index 0000000000..a3ece40670 --- /dev/null +++ b/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js @@ -0,0 +1,59 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const invalidWin32Path = require('./win32').invalidWin32Path + +const o777 = parseInt('0777', 8) + +function mkdirsSync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + let mode = opts.mode + const xfs = opts.fs || fs + + if (process.platform === 'win32' && invalidWin32Path(p)) { + const errInval = new Error(p + ' contains invalid WIN32 path characters.') + errInval.code = 'EINVAL' + throw errInval + } + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + p = path.resolve(p) + + try { + xfs.mkdirSync(p, mode) + made = made || p + } catch (err0) { + switch (err0.code) { + case 'ENOENT': + if (path.dirname(p) === p) throw err0 + made = mkdirsSync(path.dirname(p), opts, made) + mkdirsSync(p, opts, made) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + let stat + try { + stat = xfs.statSync(p) + } catch (err1) { + throw err0 + } + if (!stat.isDirectory()) throw err0 + break + } + } + + return made +} + +module.exports = mkdirsSync diff --git a/node_modules/fs-extra/lib/mkdirs/mkdirs.js b/node_modules/fs-extra/lib/mkdirs/mkdirs.js new file mode 100644 index 0000000000..18975337aa --- /dev/null +++ b/node_modules/fs-extra/lib/mkdirs/mkdirs.js @@ -0,0 +1,63 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const invalidWin32Path = require('./win32').invalidWin32Path + +const o777 = parseInt('0777', 8) + +function mkdirs (p, opts, callback, made) { + if (typeof opts === 'function') { + callback = opts + opts = {} + } else if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + if (process.platform === 'win32' && invalidWin32Path(p)) { + const errInval = new Error(p + ' contains invalid WIN32 path characters.') + errInval.code = 'EINVAL' + return callback(errInval) + } + + let mode = opts.mode + const xfs = opts.fs || fs + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + callback = callback || function () {} + p = path.resolve(p) + + xfs.mkdir(p, mode, er => { + if (!er) { + made = made || p + return callback(null, made) + } + switch (er.code) { + case 'ENOENT': + if (path.dirname(p) === p) return callback(er) + mkdirs(path.dirname(p), opts, (er, made) => { + if (er) callback(er, made) + else mkdirs(p, opts, callback, made) + }) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, (er2, stat) => { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) callback(er, made) + else callback(null, made) + }) + break + } + }) +} + +module.exports = mkdirs diff --git a/node_modules/fs-extra/lib/mkdirs/win32.js b/node_modules/fs-extra/lib/mkdirs/win32.js new file mode 100644 index 0000000000..99b3920f9c --- /dev/null +++ b/node_modules/fs-extra/lib/mkdirs/win32.js @@ -0,0 +1,25 @@ +'use strict' + +const path = require('path') + +// get drive on windows +function getRootPath (p) { + p = path.normalize(path.resolve(p)).split(path.sep) + if (p.length > 0) return p[0] + return null +} + +// http://stackoverflow.com/a/62888/10333 contains more accurate +// TODO: expand to include the rest +const INVALID_PATH_CHARS = /[<>:"|?*]/ + +function invalidWin32Path (p) { + const rp = getRootPath(p) + p = p.replace(rp, '') + return INVALID_PATH_CHARS.test(p) +} + +module.exports = { + getRootPath, + invalidWin32Path +} diff --git a/node_modules/fs-extra/lib/move-sync/index.js b/node_modules/fs-extra/lib/move-sync/index.js new file mode 100644 index 0000000000..a5e9114693 --- /dev/null +++ b/node_modules/fs-extra/lib/move-sync/index.js @@ -0,0 +1,118 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const copySync = require('../copy-sync').copySync +const removeSync = require('../remove').removeSync +const mkdirpSync = require('../mkdirs').mkdirsSync +const buffer = require('../util/buffer') + +function moveSync (src, dest, options) { + options = options || {} + const overwrite = options.overwrite || options.clobber || false + + src = path.resolve(src) + dest = path.resolve(dest) + + if (src === dest) return fs.accessSync(src) + + if (isSrcSubdir(src, dest)) throw new Error(`Cannot move '${src}' into itself '${dest}'.`) + + mkdirpSync(path.dirname(dest)) + tryRenameSync() + + function tryRenameSync () { + if (overwrite) { + try { + return fs.renameSync(src, dest) + } catch (err) { + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST' || err.code === 'EPERM') { + removeSync(dest) + options.overwrite = false // just overwriteed it, no need to do it again + return moveSync(src, dest, options) + } + + if (err.code !== 'EXDEV') throw err + return moveSyncAcrossDevice(src, dest, overwrite) + } + } else { + try { + fs.linkSync(src, dest) + return fs.unlinkSync(src) + } catch (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') { + return moveSyncAcrossDevice(src, dest, overwrite) + } + throw err + } + } + } +} + +function moveSyncAcrossDevice (src, dest, overwrite) { + const stat = fs.statSync(src) + + if (stat.isDirectory()) { + return moveDirSyncAcrossDevice(src, dest, overwrite) + } else { + return moveFileSyncAcrossDevice(src, dest, overwrite) + } +} + +function moveFileSyncAcrossDevice (src, dest, overwrite) { + const BUF_LENGTH = 64 * 1024 + const _buff = buffer(BUF_LENGTH) + + const flags = overwrite ? 'w' : 'wx' + + const fdr = fs.openSync(src, 'r') + const stat = fs.fstatSync(fdr) + const fdw = fs.openSync(dest, flags, stat.mode) + let bytesRead = 1 + let pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + fs.closeSync(fdr) + fs.closeSync(fdw) + return fs.unlinkSync(src) +} + +function moveDirSyncAcrossDevice (src, dest, overwrite) { + const options = { + overwrite: false + } + + if (overwrite) { + removeSync(dest) + tryCopySync() + } else { + tryCopySync() + } + + function tryCopySync () { + copySync(src, dest, options) + return removeSync(src) + } +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest) { + try { + return fs.statSync(src).isDirectory() && + src !== dest && + dest.indexOf(src) > -1 && + dest.split(path.dirname(src) + path.sep)[1].split(path.sep)[0] === path.basename(src) + } catch (e) { + return false + } +} + +module.exports = { + moveSync +} diff --git a/node_modules/fs-extra/lib/move/index.js b/node_modules/fs-extra/lib/move/index.js new file mode 100644 index 0000000000..eeeb30fe31 --- /dev/null +++ b/node_modules/fs-extra/lib/move/index.js @@ -0,0 +1,170 @@ +'use strict' + +// most of this code was written by Andrew Kelley +// licensed under the BSD license: see +// https://github.com/andrewrk/node-mv/blob/master/package.json + +// this needs a cleanup + +const u = require('universalify').fromCallback +const fs = require('graceful-fs') +const ncp = require('../copy/ncp') +const path = require('path') +const remove = require('../remove').remove +const mkdirp = require('../mkdirs').mkdirs + +function move (src, dest, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + const overwrite = options.overwrite || options.clobber || false + + isSrcSubdir(src, dest, (err, itIs) => { + if (err) return callback(err) + if (itIs) return callback(new Error(`Cannot move '${src}' to a subdirectory of itself, '${dest}'.`)) + mkdirp(path.dirname(dest), err => { + if (err) return callback(err) + doRename() + }) + }) + + function doRename () { + if (path.resolve(src) === path.resolve(dest)) { + fs.access(src, callback) + } else if (overwrite) { + fs.rename(src, dest, err => { + if (!err) return callback() + + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST') { + remove(dest, err => { + if (err) return callback(err) + options.overwrite = false // just overwriteed it, no need to do it again + move(src, dest, options, callback) + }) + return + } + + // weird Windows shit + if (err.code === 'EPERM') { + setTimeout(() => { + remove(dest, err => { + if (err) return callback(err) + options.overwrite = false + move(src, dest, options, callback) + }) + }, 200) + return + } + + if (err.code !== 'EXDEV') return callback(err) + moveAcrossDevice(src, dest, overwrite, callback) + }) + } else { + fs.link(src, dest, err => { + if (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') { + return moveAcrossDevice(src, dest, overwrite, callback) + } + return callback(err) + } + return fs.unlink(src, callback) + }) + } + } +} + +function moveAcrossDevice (src, dest, overwrite, callback) { + fs.stat(src, (err, stat) => { + if (err) return callback(err) + + if (stat.isDirectory()) { + moveDirAcrossDevice(src, dest, overwrite, callback) + } else { + moveFileAcrossDevice(src, dest, overwrite, callback) + } + }) +} + +function moveFileAcrossDevice (src, dest, overwrite, callback) { + const flags = overwrite ? 'w' : 'wx' + const ins = fs.createReadStream(src) + const outs = fs.createWriteStream(dest, { flags }) + + ins.on('error', err => { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + + // may want to create a directory but `out` line above + // creates an empty file for us: See #108 + // don't care about error here + fs.unlink(dest, () => { + // note: `err` here is from the input stream errror + if (err.code === 'EISDIR' || err.code === 'EPERM') { + moveDirAcrossDevice(src, dest, overwrite, callback) + } else { + callback(err) + } + }) + }) + + outs.on('error', err => { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + callback(err) + }) + + outs.once('close', onClose) + ins.pipe(outs) + + function onClose () { + fs.unlink(src, callback) + } +} + +function moveDirAcrossDevice (src, dest, overwrite, callback) { + const options = { + overwrite: false + } + + if (overwrite) { + remove(dest, err => { + if (err) return callback(err) + startNcp() + }) + } else { + startNcp() + } + + function startNcp () { + ncp(src, dest, options, err => { + if (err) return callback(err) + remove(src, callback) + }) + } +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest, cb) { + fs.stat(src, (err, st) => { + if (err) return cb(err) + if (st.isDirectory()) { + const baseDir = dest.split(path.dirname(src) + path.sep)[1] + if (baseDir) { + const destBasename = baseDir.split(path.sep)[0] + if (destBasename) return cb(null, src !== dest && dest.indexOf(src) > -1 && destBasename === path.basename(src)) + return cb(null, false) + } + return cb(null, false) + } + return cb(null, false) + }) +} + +module.exports = { + move: u(move) +} diff --git a/node_modules/fs-extra/lib/output/index.js b/node_modules/fs-extra/lib/output/index.js new file mode 100644 index 0000000000..53d5905792 --- /dev/null +++ b/node_modules/fs-extra/lib/output/index.js @@ -0,0 +1,40 @@ +'use strict' + +const u = require('universalify').fromCallback +const fs = require('graceful-fs') +const path = require('path') +const mkdir = require('../mkdirs') +const pathExists = require('../path-exists').pathExists + +function outputFile (file, data, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = 'utf8' + } + + const dir = path.dirname(file) + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return fs.writeFile(file, data, encoding, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + + fs.writeFile(file, data, encoding, callback) + }) + }) +} + +function outputFileSync (file, data, encoding) { + const dir = path.dirname(file) + if (fs.existsSync(dir)) { + return fs.writeFileSync.apply(fs, arguments) + } + mkdir.mkdirsSync(dir) + fs.writeFileSync.apply(fs, arguments) +} + +module.exports = { + outputFile: u(outputFile), + outputFileSync +} diff --git a/node_modules/fs-extra/lib/path-exists/index.js b/node_modules/fs-extra/lib/path-exists/index.js new file mode 100644 index 0000000000..ddd9bc718f --- /dev/null +++ b/node_modules/fs-extra/lib/path-exists/index.js @@ -0,0 +1,12 @@ +'use strict' +const u = require('universalify').fromPromise +const fs = require('../fs') + +function pathExists (path) { + return fs.access(path).then(() => true).catch(() => false) +} + +module.exports = { + pathExists: u(pathExists), + pathExistsSync: fs.existsSync +} diff --git a/node_modules/fs-extra/lib/remove/index.js b/node_modules/fs-extra/lib/remove/index.js new file mode 100644 index 0000000000..cee5340077 --- /dev/null +++ b/node_modules/fs-extra/lib/remove/index.js @@ -0,0 +1,9 @@ +'use strict' + +const u = require('universalify').fromCallback +const rimraf = require('./rimraf') + +module.exports = { + remove: u(rimraf), + removeSync: rimraf.sync +} diff --git a/node_modules/fs-extra/lib/remove/rimraf.js b/node_modules/fs-extra/lib/remove/rimraf.js new file mode 100644 index 0000000000..f07869457a --- /dev/null +++ b/node_modules/fs-extra/lib/remove/rimraf.js @@ -0,0 +1,314 @@ +'use strict' + +const fs = require('graceful-fs') +const path = require('path') +const assert = require('assert') + +const isWindows = (process.platform === 'win32') + +function defaults (options) { + const methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(m => { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 +} + +function rimraf (p, options, cb) { + let busyTries = 0 + + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + rimraf_(p, options, function CB (er) { + if (er) { + if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && + busyTries < options.maxBusyTries) { + busyTries++ + let time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(() => rimraf_(p, options, CB), time) + } + + // already gone + if (er.code === 'ENOENT') er = null + } + + cb(er) + }) +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, (er, st) => { + if (er && er.code === 'ENOENT') { + return cb(null) + } + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === 'EPERM' && isWindows) { + return fixWinEPERM(p, options, er, cb) + } + + if (st && st.isDirectory()) { + return rmdir(p, options, er, cb) + } + + options.unlink(p, er => { + if (er) { + if (er.code === 'ENOENT') { + return cb(null) + } + if (er.code === 'EPERM') { + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + } + if (er.code === 'EISDIR') { + return rmdir(p, options, er, cb) + } + } + return cb(er) + }) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) { + assert(er instanceof Error) + } + + options.chmod(p, 0o666, er2 => { + if (er2) { + cb(er2.code === 'ENOENT' ? null : er) + } else { + options.stat(p, (er3, stats) => { + if (er3) { + cb(er3.code === 'ENOENT' ? null : er) + } else if (stats.isDirectory()) { + rmdir(p, options, er, cb) + } else { + options.unlink(p, cb) + } + }) + } + }) +} + +function fixWinEPERMSync (p, options, er) { + let stats + + assert(p) + assert(options) + if (er) { + assert(er instanceof Error) + } + + try { + options.chmodSync(p, 0o666) + } catch (er2) { + if (er2.code === 'ENOENT') { + return + } else { + throw er + } + } + + try { + stats = options.statSync(p) + } catch (er3) { + if (er3.code === 'ENOENT') { + return + } else { + throw er + } + } + + if (stats.isDirectory()) { + rmdirSync(p, options, er) + } else { + options.unlinkSync(p) + } +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) { + assert(originalEr instanceof Error) + } + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, er => { + if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { + rmkids(p, options, cb) + } else if (er && er.code === 'ENOTDIR') { + cb(originalEr) + } else { + cb(er) + } + }) +} + +function rmkids (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, (er, files) => { + if (er) return cb(er) + + let n = files.length + let errState + + if (n === 0) return options.rmdir(p, cb) + + files.forEach(f => { + rimraf(path.join(p, f), options, er => { + if (errState) { + return + } + if (er) return cb(errState = er) + if (--n === 0) { + options.rmdir(p, cb) + } + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + let st + + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + try { + st = options.lstatSync(p) + } catch (er) { + if (er.code === 'ENOENT') { + return + } + + // Windows can EPERM on stat. Life is suffering. + if (er.code === 'EPERM' && isWindows) { + fixWinEPERMSync(p, options, er) + } + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) { + rmdirSync(p, options, null) + } else { + options.unlinkSync(p) + } + } catch (er) { + if (er.code === 'ENOENT') { + return + } else if (er.code === 'EPERM') { + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + } else if (er.code !== 'EISDIR') { + throw er + } + rmdirSync(p, options, er) + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) { + assert(originalEr instanceof Error) + } + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === 'ENOTDIR') { + throw originalEr + } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { + rmkidsSync(p, options) + } else if (er.code !== 'ENOENT') { + throw er + } + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) + + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + const retries = isWindows ? 100 : 1 + let i = 0 + do { + let threw = true + try { + const ret = options.rmdirSync(p, options) + threw = false + return ret + } finally { + if (++i < retries && threw) continue // eslint-disable-line + } + } while (true) +} + +module.exports = rimraf +rimraf.sync = rimrafSync diff --git a/node_modules/fs-extra/lib/util/assign.js b/node_modules/fs-extra/lib/util/assign.js new file mode 100644 index 0000000000..317e5ec4ab --- /dev/null +++ b/node_modules/fs-extra/lib/util/assign.js @@ -0,0 +1,16 @@ +'use strict' + +// simple mutable assign +function assign () { + const args = [].slice.call(arguments).filter(i => i) + const dest = args.shift() + args.forEach(src => { + Object.keys(src).forEach(key => { + dest[key] = src[key] + }) + }) + + return dest +} + +module.exports = assign diff --git a/node_modules/fs-extra/lib/util/buffer.js b/node_modules/fs-extra/lib/util/buffer.js new file mode 100644 index 0000000000..93af51b26c --- /dev/null +++ b/node_modules/fs-extra/lib/util/buffer.js @@ -0,0 +1,11 @@ +/* eslint-disable node/no-deprecated-api */ +module.exports = function (size) { + if (typeof Buffer.allocUnsafe === 'function') { + try { + return Buffer.allocUnsafe(size) + } catch (e) { + return new Buffer(size) + } + } + return new Buffer(size) +} diff --git a/node_modules/fs-extra/lib/util/utimes.js b/node_modules/fs-extra/lib/util/utimes.js new file mode 100644 index 0000000000..4c320993c5 --- /dev/null +++ b/node_modules/fs-extra/lib/util/utimes.js @@ -0,0 +1,72 @@ +'use strict' + +const fs = require('graceful-fs') +const os = require('os') +const path = require('path') + +// HFS, ext{2,3}, FAT do not, Node.js v0.10 does not +function hasMillisResSync () { + let tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + const d = new Date(1435410243862) + fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141') + const fd = fs.openSync(tmpfile, 'r+') + fs.futimesSync(fd, d, d) + fs.closeSync(fd) + return fs.statSync(tmpfile).mtime > 1435410243000 +} + +function hasMillisRes (callback) { + let tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + const d = new Date(1435410243862) + fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', err => { + if (err) return callback(err) + fs.open(tmpfile, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, d, d, err => { + if (err) return callback(err) + fs.close(fd, err => { + if (err) return callback(err) + fs.stat(tmpfile, (err, stats) => { + if (err) return callback(err) + callback(null, stats.mtime > 1435410243000) + }) + }) + }) + }) + }) +} + +function timeRemoveMillis (timestamp) { + if (typeof timestamp === 'number') { + return Math.floor(timestamp / 1000) * 1000 + } else if (timestamp instanceof Date) { + return new Date(Math.floor(timestamp.getTime() / 1000) * 1000) + } else { + throw new Error('fs-extra: timeRemoveMillis() unknown parameter type') + } +} + +function utimesMillis (path, atime, mtime, callback) { + // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) + fs.open(path, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, atime, mtime, futimesErr => { + fs.close(fd, closeErr => { + if (callback) callback(futimesErr || closeErr) + }) + }) + }) +} + +module.exports = { + hasMillisRes, + hasMillisResSync, + timeRemoveMillis, + utimesMillis +} diff --git a/node_modules/fs-extra/package.json b/node_modules/fs-extra/package.json new file mode 100644 index 0000000000..2ac3a13281 --- /dev/null +++ b/node_modules/fs-extra/package.json @@ -0,0 +1,64 @@ +{ + "name": "fs-extra", + "version": "4.0.3", + "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.", + "homepage": "https://github.com/jprichardson/node-fs-extra", + "repository": { + "type": "git", + "url": "https://github.com/jprichardson/node-fs-extra" + }, + "keywords": [ + "fs", + "file", + "file system", + "copy", + "directory", + "extra", + "mkdirp", + "mkdir", + "mkdirs", + "recursive", + "json", + "read", + "write", + "extra", + "delete", + "remove", + "touch", + "create", + "text", + "output", + "move" + ], + "author": "JP Richardson ", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.4.5", + "klaw": "^1.0.0", + "klaw-sync": "^1.1.2", + "minimist": "^1.1.1", + "mocha": "^3.1.2", + "proxyquire": "^1.7.10", + "read-dir-files": "^0.1.1", + "rimraf": "^2.2.8", + "secure-random": "^1.1.1", + "semver": "^5.3.0", + "standard": "^10.0.2", + "standard-markdown": "^4.0.1" + }, + "main": "./lib/index.js", + "scripts": { + "coverage": "istanbul cover -i 'lib/**' -x '**/__tests__/**' test.js", + "coveralls": "coveralls < coverage/lcov.info", + "lint": "standard && standard-markdown", + "test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha", + "test": "npm run lint && npm run unit", + "unit": "node test.js" + } +} \ No newline at end of file diff --git a/node_modules/github-linguist/.eslintignore b/node_modules/github-linguist/.eslintignore new file mode 100644 index 0000000000..b04b44c57e --- /dev/null +++ b/node_modules/github-linguist/.eslintignore @@ -0,0 +1,5 @@ +/lambda/ +/scripts +/config +.history +/test/** diff --git a/node_modules/github-linguist/.eslintrc.js b/node_modules/github-linguist/.eslintrc.js new file mode 100644 index 0000000000..4594b11a3d --- /dev/null +++ b/node_modules/github-linguist/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: [require.resolve('@umijs/fabric/dist/eslint')], +}; diff --git a/node_modules/github-linguist/.github/workflows/ci.yml b/node_modules/github-linguist/.github/workflows/ci.yml new file mode 100644 index 0000000000..165462018b --- /dev/null +++ b/node_modules/github-linguist/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: Node CI + +on: [push] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + node_version: [10.x, 12.x] + os: [ubuntu-latest, windows-latest] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node_version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node_version }} + - run: echo ${{github.ref}} + - run: yarn + - run: yarn run lint + - run: yarn run test + env: + CI: true + PROGRESS: none + NODE_ENV: test + NODE_OPTIONS: --max_old_space_size=4096 diff --git a/node_modules/github-linguist/.prettierrc.js b/node_modules/github-linguist/.prettierrc.js new file mode 100644 index 0000000000..7b597d7891 --- /dev/null +++ b/node_modules/github-linguist/.prettierrc.js @@ -0,0 +1,5 @@ +const fabric = require('@umijs/fabric'); + +module.exports = { + ...fabric.prettier, +}; diff --git a/node_modules/github-linguist/README.md b/node_modules/github-linguist/README.md new file mode 100644 index 0000000000..29b12ef835 --- /dev/null +++ b/node_modules/github-linguist/README.md @@ -0,0 +1,71 @@ +# github-linguist + +💻 Counts the number of lines of code, written in TypeScript. + +**Warning:** This package uses regular expressions to approximate the lines of code in a project. The +results are not 100% precise because the regular expressions can return mistakes in edge +cases, for example if comment tokens are present inside of multiline strings. + +## Prerequisites + +- Node.js 6+ + +## Install + +```bash +npm install github-linguist +``` + +or + +```bash +yarn add github-linguist +``` + +## Usage + +You can use `loc` in you ternimal, or as a npm package in your projects. + +### Command line mode + +Supports counting lines of code of a file or directory. + +#### 1. Lines of code in a single file + +```bash +# loc file +loc file src/index.ts +``` + +![loc file ](https://user-images.githubusercontent.com/3739221/31838697-9fdec114-b5a3-11e7-890e-795444bc9400.png) + +#### 2. Lines of code in a directory + +```bash +# loc +loc dir **/*.ts +``` + +![loc dir ](https://user-images.githubusercontent.com/3739221/31838695-9f94a340-b5a3-11e7-914a-91629d2cfa9f.png) + +### Third-party mode + +```ts +import { LocFile, LocDir } from 'github-linguist'; + +// for a file. +const file = new LocFile(filePath); +const { info } = file.getInfo(); + +// for a directory. +const dir = new LocDir({ + cwd: // root directory, or leave blank to use process.cwd() + include: // string or string[] containing path patterns to include (default include all) + exclude: // string or string[] containing path patterns to exclude (default exclude none) +}); +const { info } = dir.getInfo(); +``` + +## License + +MIT License. diff --git a/node_modules/github-linguist/dist/cli.d.ts b/node_modules/github-linguist/dist/cli.d.ts new file mode 100644 index 0000000000..b7988016da --- /dev/null +++ b/node_modules/github-linguist/dist/cli.d.ts @@ -0,0 +1,2 @@ +#!/usr/bin/env node +export {}; diff --git a/node_modules/github-linguist/dist/cli.js b/node_modules/github-linguist/dist/cli.js new file mode 100755 index 0000000000..5b8a6a85ba --- /dev/null +++ b/node_modules/github-linguist/dist/cli.js @@ -0,0 +1,57 @@ +#!/usr/bin/env node +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const chalk_1 = __importDefault(require("chalk")); +const commander_1 = __importDefault(require("commander")); +const directory_1 = require("./directory"); +const file_1 = require("./file"); +const utils_1 = require("./utils"); +commander_1.default + .version(utils_1.getVersion(), '-v') + .command('file ') + .description('count lines of code in a file') + .action(async (pathPattern) => { + try { + const info = await (new file_1.LocFile(pathPattern).getFileInfo()); + // eslint-disable-next-line no-console + console.log(chalk_1.default.cyan(` + path: \t\t${pathPattern} + language: \t${info.languages} + total lines: \t${String(info.lines.total)} + code lines: \t${String(info.lines.code)} + comment lines: \t${String(info.lines.comment)} + `)); + } + catch (e) { + console.error(e); + console.error(e.stacl); + } +}); +const formatInfo = (info, languages) => ` + \ttotal lines: \t${String(info.total)} + \tcode lines: \t${String(info.code)} + \tcomment lines: \t${String(info.comment)} + \t--------------------${Object.keys(languages) + .map((key) => { + const languageInfo = languages[key]; + return `\n\t${key.padEnd(10)} \t file count:${String(languageInfo.sum)} \ttotal:${String(languageInfo.total)} \tcomment:${String(languageInfo.comment)} \tcode:${String(languageInfo.code)}`; +}) + .join('')}`; +commander_1.default.arguments(' [env]').action(async (cmd) => { + try { + const { info, languages } = await (new directory_1.LocDir({ + include: cmd + }).loadInfo()); + // eslint-disable-next-line no-console + console.log(chalk_1.default.cyan(formatInfo(info, languages))); + } + catch (e) { + console.error(e); + console.error(e.stacl); + } +}); +commander_1.default.parse(process.argv); +//# sourceMappingURL=cli.js.map \ No newline at end of file diff --git a/node_modules/github-linguist/dist/cli.js.map b/node_modules/github-linguist/dist/cli.js.map new file mode 100644 index 0000000000..ccea18a6fa --- /dev/null +++ b/node_modules/github-linguist/dist/cli.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,kDAA0B;AA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YAAY,MAAM,CACtF,YAAY,CAAC,KAAK,CACnB,eAAe,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,YAAY,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;AACtF,CAAC,CAAC;KACD,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AAEhB,mBAAO,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACpD,IAAI;QACF,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC,IAAI,kBAAM,CAAC;YAC5C,OAAO,EAAE,GAAG;SACb,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QACf,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;KACtD;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;KACxB;AACH,CAAC,CAAC,CAAC;AAEH,mBAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/github-linguist/dist/directory.d.ts b/node_modules/github-linguist/dist/directory.d.ts new file mode 100644 index 0000000000..bfa53f68d5 --- /dev/null +++ b/node_modules/github-linguist/dist/directory.d.ts @@ -0,0 +1,28 @@ +import { LineInfo } from './file'; +export interface LocDirOptions { + cwd?: string; + include?: string[] | string; + exclude?: string[] | string; +} +export interface LocResult { + files: string[]; + info: LineInfo; + languages: { + [key: string]: LineInfo & { + sum: number; + }; + }; +} +/** + * Collect the info of a directory. + */ +export declare class LocDir { + private cwd; + private include; + private exclude; + constructor(options: LocDirOptions); + /** + * Calculate directory info. + */ + loadInfo(): Promise; +} diff --git a/node_modules/github-linguist/dist/directory.js b/node_modules/github-linguist/dist/directory.js new file mode 100644 index 0000000000..4900c3236b --- /dev/null +++ b/node_modules/github-linguist/dist/directory.js @@ -0,0 +1,116 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LocDir = void 0; +const globby_1 = __importDefault(require("globby")); +const fs_extra_1 = __importDefault(require("fs-extra")); +const path_1 = __importDefault(require("path")); +// @ts-ignore +const slash2_1 = __importDefault(require("slash2")); +const file_1 = require("./file"); +const defaultInfo = { + total: 0, + code: 0, + comment: 0, +}; +const defaultExclude = [ + // javascript + '**/*.map', + '**/yarn**', + '**/.github', + '**/node_modules/**', + '**/dist/**', + '**/*.snap', + // java + '**/target' +]; +/** + * Collect the info of a directory. + */ +class LocDir { + constructor(options) { + Object.defineProperty(this, "cwd", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "include", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "exclude", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + // ensure all excludes are globstar. Note that '**/*.ts/**' matches files + // that end in .ts because the globstar indicates 0 or more directory paths. + this.exclude = ensureArray(options.exclude) + .concat(defaultExclude) + .map(item => item.endsWith('**') ? item : `${item}/**`); + // remove all leading './' since this messes up globstar matches in the + // excludes. + this.include = ensureArray(options.include, '**') + .map(item => item.startsWith('./') ? item.substring(2) : item) + .map(item => item.endsWith('**') ? item : `${item}/**`); + this.cwd = options.cwd || process.cwd(); + } + /** + * Calculate directory info. + */ + async loadInfo() { + const paths = await globby_1.default(this.include, { + cwd: this.cwd, + ignore: this.exclude, + nodir: true + }); + const files = []; + const info = { ...defaultInfo }; + let languages = {}; + await Promise.all(paths.map(async (pathItem) => { + const fullPath = slash2_1.default(path_1.default.join(this.cwd, pathItem)); + if (!pathItem || + !(await fs_extra_1.default.pathExists(fullPath)) || + (await fs_extra_1.default.stat(fullPath)).isDirectory()) { + return; + } + const file = new file_1.LocFile(fullPath); + const fileLineInfo = await file.getFileInfo(); + const { lines } = fileLineInfo; + info.total += lines.total; + info.code += lines.code; + info.comment += lines.comment; + const language = { ...languages[fileLineInfo.languages] }; + language.code = lines.code + (language.code || 0); + language.sum = (language.sum || 0) + 1; + language.comment = lines.comment + (language.comment || 0); + language.total = lines.total + (language.total || 0); + languages = { + ...languages, + [fileLineInfo.languages]: language, + }; + files.push(fullPath); + })); + return { + files, + info, + languages, + }; + } +} +exports.LocDir = LocDir; +function ensureArray(arr, dfault) { + if (!arr) { + return dfault ? [dfault] : []; + } + return Array.isArray(arr) + ? arr + : [arr]; +} +//# sourceMappingURL=directory.js.map \ No newline at end of file diff --git a/node_modules/github-linguist/dist/directory.js.map b/node_modules/github-linguist/dist/directory.js.map new file mode 100644 index 0000000000..7b7c7f7974 --- /dev/null +++ b/node_modules/github-linguist/dist/directory.js.map @@ -0,0 +1 @@ +{"version":3,"file":"directory.js","sourceRoot":"","sources":["../src/directory.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,wDAA0B;AAC1B,gDAAwB;AACxB,aAAa;AACb,oDAA2B;AAE3B,iCAA2C;AAE3C,MAAM,WAAW,GAAa;IAC5B,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,CAAC;CACX,CAAC;AAkBF,MAAM,cAAc,GAAG;IACrB,aAAa;IACb,UAAU;IACV,WAAW;IACX,YAAY;IACZ,oBAAoB;IACpB,YAAY;IACZ,WAAW;IAEX,OAAO;IACP,WAAW;CACZ,CAAC;AAEF;;GAEG;AACH,MAAa,MAAM;IAKjB,YAAY,OAAsB;QAJlC;;;;;WAAoB;QACpB;;;;;WAA0B;QAC1B;;;;;WAA0B;QAIxB,yEAAyE;QACzE,4EAA4E;QAC5E,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC;aACxC,MAAM,CAAC,c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,IAAI;YACJ,SAAS;SACV,CAAC;IACJ,CAAC;CACF;AAvED,wBAuEC;AAED,SAAS,WAAW,CAAC,GAAuB,EAAE,MAAe;IAC3D,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/B;IACD,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACvB,CAAC,CAAC,GAAG;QACL,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACZ,CAAC"} \ No newline at end of file diff --git a/node_modules/github-linguist/dist/file.d.ts b/node_modules/github-linguist/dist/file.d.ts new file mode 100644 index 0000000000..0a84c07e3d --- /dev/null +++ b/node_modules/github-linguist/dist/file.d.ts @@ -0,0 +1,37 @@ +/** + * detect file info + */ +export interface LineInfo { + total: number; + code: number; + comment: number; +} +export interface FileInfo { + name: string; + languages: string; + size: number; + lines: LineInfo; +} +/** + * Collect language info for a single file + */ +export declare class LocFile { + private debug; + path: string; + private rawPath; + private language; + /** + * Creates an instance of LocFile. + */ + constructor(rawPath: string, debug?: boolean); + /** + * get file type through a path + */ + private getType; + private filterData; + /** + * Get file info when LocFile init + */ + getFileInfo(data?: string): Promise; + getFileInfoByContent(name: string, data: string): FileInfo; +} diff --git a/node_modules/github-linguist/dist/file.js b/node_modules/github-linguist/dist/file.js new file mode 100644 index 0000000000..d6022ca5ff --- /dev/null +++ b/node_modules/github-linguist/dist/file.js @@ -0,0 +1,198 @@ +"use strict"; +/** + * detect file info + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LocFile = void 0; +const fs = __importStar(require("fs-extra")); +const Path = __importStar(require("path")); +// @ts-ignore +const slash2_1 = __importDefault(require("slash2")); +const languages_1 = require("./languages"); +const DefaultLine = { + total: 0, + code: 0, + comment: 0, +}; +const DefaultFileInfo = { + name: '', + languages: '', + size: 0, + lines: DefaultLine, +}; +/** + * Collect language info for a single file + */ +class LocFile { + /** + * Creates an instance of LocFile. + */ + constructor(rawPath, debug = false) { + Object.defineProperty(this, "debug", { + enumerable: true, + configurable: true, + writable: true, + value: debug + }); + Object.defineProperty(this, "path", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "rawPath", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "language", { + enumerable: true, + configurable: true, + writable: true, + value: new languages_1.Languages() + }); + Object.defineProperty(this, "filterData", { + enumerable: true, + configurable: true, + writable: true, + value: (data, regexes) => { + const lines = data.split(/\n/); + let commentLength = 0; + let codeLength = lines.length; + const total = codeLength; + let inMultiLineComment = false; + lines.forEach((line) => { + let lineType = 'code'; + line = line.trim(); + if (inMultiLineComment) { + let noCode = true; + if (regexes.multiLineCommentClose.test(line)) { + // line contains the end of a multi-line comment + inMultiLineComment = false; + if (!regexes.multiLineCommentCloseEnd.test(line)) { + // the multiline comment does not end this line. + // there is real code on it. + noCode = false; + } + } + if (noCode) { + lineType = 'comm'; + commentLength += 1; + codeLength -= 1; + } + } + else if (line) { + // non-empty line + if (regexes.multiLineCommentOpen.test(line)) { + // line contains the start of a multi-line comment + // might contain some real code, but we'll let that slide + if (!regexes.multiLineCommentOpenAndClose.test(line)) { + // comment is not also closed on this line + inMultiLineComment = true; + } + if (regexes.multiLineCommentOpenStart.test(line)) { + // The comment starts the line. There is no other code on this line + commentLength += 1; + codeLength -= 1; + lineType = 'comm'; + } + } + else if (regexes.singleLineComment.test(line)) { + // line contains only a single line comment + commentLength += 1; + codeLength -= 1; + lineType = 'comm'; + } + } + else { + // empty line + codeLength -= 1; + lineType = 'empt'; + } + if (this.debug) { + console.log(lineType, line); + } + }); + return { + ...DefaultLine, + total, + code: codeLength, + comment: commentLength, + }; + } + }); + this.path = slash2_1.default(rawPath); + this.rawPath = rawPath; + } + /** + * get file type through a path + */ + getType(path) { + const fileExtension = `.${path.split('.').pop()}`; + return this.language.extensionMap[fileExtension] || ''; + } + /** + * Get file info when LocFile init + */ + async getFileInfo(data) { + if (!(await fs.pathExists(this.rawPath))) { + throw new Error(`Error: file ${this.rawPath} does not exist.`); + } + let newData = data; + const info = Object.assign({}, DefaultFileInfo); + const name = this.path.split(Path.sep).pop() || ''; + try { + const stat = await fs.stat(this.path); + if (!stat.isFile()) { + return info; + } + newData = data || await fs.readFile(this.path, 'utf-8'); + info.name = name; + info.size = (stat && stat.size) || 0; + info.languages = this.getType(this.path); + if (!info.languages) { + return info; + } + if (newData) { + const regexes = this.language.getRegexes(info.languages); + info.lines = this.filterData(newData, regexes); + } + } + catch (err) { + throw new Error('read file failed.'); + } + return info; + } + getFileInfoByContent(name, data) { + const info = Object.assign({}, DefaultFileInfo); + info.name = name; + info.languages = this.getType(name); + info.lines = this.filterData(data, this.language.getRegexes(info.languages)); + return info; + } +} +exports.LocFile = LocFile; +//# sourceMappingURL=file.js.map \ No newline at end of file diff --git a/node_modules/github-linguist/dist/file.js.map b/node_modules/github-linguist/dist/file.js.map new file mode 100644 index 0000000000..3306783c1d --- /dev/null +++ b/node_modules/github-linguist/dist/file.js.map @@ -0,0 +1 @@ +{"version":3,"file":"file.js","sourceRoot":"","sources":["../src/file.ts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IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACzC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;gBACnB,OAAO,IAAI,CAAC;aACb;YACD,IAAI,OAAO,EAAE;gBACX,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBACzD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;aAChD;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;SACtC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,oBAAoB,CAAC,IAAY,EAAE,IAAY;QACpD,MAAM,IAAI,GAAa,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC;QAC1D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA1ID,0BA0IC"} \ No newline at end of file diff --git a/node_modules/github-linguist/dist/index.d.ts b/node_modules/github-linguist/dist/index.d.ts new file mode 100644 index 0000000000..d9a27e9c16 --- /dev/null +++ b/node_modules/github-linguist/dist/index.d.ts @@ -0,0 +1,5 @@ +import { LocResult } from './directory'; +export { LocDir, LocDirOptions } from './directory'; +export { LocFile, LineInfo } from './file'; +declare const loc: (fileOrDir: string) => Promise; +export default loc; diff --git a/node_modules/github-linguist/dist/index.js b/node_modules/github-linguist/dist/index.js new file mode 100644 index 0000000000..3f8f0a9131 --- /dev/null +++ b/node_modules/github-linguist/dist/index.js @@ -0,0 +1,31 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// @ts-ignore +const slash2_1 = __importDefault(require("slash2")); +const fs_extra_1 = __importDefault(require("fs-extra")); +const directory_1 = require("./directory"); +const file_1 = require("./file"); +var directory_2 = require("./directory"); +Object.defineProperty(exports, "LocDir", { enumerable: true, get: function () { return directory_2.LocDir; } }); +var file_2 = require("./file"); +Object.defineProperty(exports, "LocFile", { enumerable: true, get: function () { return file_2.LocFile; } }); +const loc = async (fileOrDir) => { + const stat = await fs_extra_1.default.stat(slash2_1.default(fileOrDir)); + if (stat.isFile()) { + const locFile = new file_1.LocFile(slash2_1.default(fileOrDir)); + const info = await locFile.getFileInfo(); + const filePath = locFile.path; + return { + info: info.lines, + files: [filePath], + languages: { [info.languages]: { ...info.lines, sum: 1 } }, + }; + } + const locDir = new directory_1.LocDir({ cwd: slash2_1.default(fileOrDir) }); + return locDir.loadInfo(); +}; +exports.default = loc; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/github-linguist/dist/index.js.map b/node_modules/github-linguist/dist/index.js.map new file mode 100644 index 0000000000..135e3603af --- /dev/null +++ b/node_modules/github-linguist/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,aAAa;AACb,oDAA2B;AAC3B,wDAA0B;AAE1B,2CAAgD;AAChD,iCAAiC;AAEjC,yCAAoD;AAA3C,mGAAA,MAAM,OAAA;AACf,+BAA2C;AAAlC,+FAAA,OAAO,OAAA;AAEhB,MAAM,GAAG,GAAG,KAAK,EACf,SAAiB,EACG,EAAE;IACtB,MAAM,IAAI,GAAG,MAAM,kBAAE,CAAC,IAAI,CAAC,gBAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAC7C,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE;QACjB,MAAM,OAAO,GAAG,IAAI,cAAO,CAAC,gBAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QAC9C,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,WAAW,EAAE,CAAC;QACzC,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;QAC9B,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;SAC3D,CAAC;KACH;IACD,MAAM,MAAM,GAAG,IAAI,kBAAM,CAAC,EAAE,GAAG,EAAE,gBAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACrD,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC,CAAC;AAEF,kBAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/node_modules/github-linguist/dist/languages.d.ts b/node_modules/github-linguist/dist/languages.d.ts new file mode 100644 index 0000000000..fd5c5bb97d --- /dev/null +++ b/node_modules/github-linguist/dist/languages.d.ts @@ -0,0 +1,43 @@ +export interface DetectorOptions { +} +/** + * detecte program language through file extension + * + * @export + * @class LanguageDetector + */ +export declare class Languages { + extensionMap: { + [key: string]: string; + }; + /** + * Creates an instance of Detector. + */ + constructor(); + /** + * load language before detecting + */ + private loadExtensionMap; + /** + * Retrieve the regular expressions for a given language. + * This is incomplete, but covers most of the languages we + * see in the wild. + * + * @param language the language to retrieve regexes for + */ + getRegexes(language: string): Regexes; + /** + * return extension map + */ + getExtensionMap(): { + [key: string]: string; + }; +} +export interface Regexes { + singleLineComment: RegExp; + multiLineCommentOpen: RegExp; + multiLineCommentOpenStart: RegExp; + multiLineCommentClose: RegExp; + multiLineCommentCloseEnd: RegExp; + multiLineCommentOpenAndClose: RegExp; +} diff --git a/node_modules/github-linguist/dist/languages.js b/node_modules/github-linguist/dist/languages.js new file mode 100644 index 0000000000..66ad1ea4fa --- /dev/null +++ b/node_modules/github-linguist/dist/languages.js @@ -0,0 +1,136 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Languages = void 0; +const utils_1 = require("./utils"); +// tslint:disable-next-line +const languageMap = require('language-map'); +/** + * detecte program language through file extension + * + * @export + * @class LanguageDetector + */ +class Languages { + /** + * Creates an instance of Detector. + */ + constructor() { + Object.defineProperty(this, "extensionMap", { + enumerable: true, + configurable: true, + writable: true, + value: {} + }); + /** + * load language before detecting + */ + Object.defineProperty(this, "loadExtensionMap", { + enumerable: true, + configurable: true, + writable: true, + value: () => { + const extensions = {}; + Object.keys(languageMap).forEach((language) => { + const languageMode = languageMap[language]; + const languageExtensions = (languageMode && languageMode.extensions) || []; + languageExtensions.forEach((extension) => { + extensions[extension.toLowerCase()] = language.toLowerCase(); + }); + }); + return Object.assign({}, extensions, utils_1.ExtensionJustify); + } + }); + this.extensionMap = this.loadExtensionMap(); + } + /** + * Retrieve the regular expressions for a given language. + * This is incomplete, but covers most of the languages we + * see in the wild. + * + * @param language the language to retrieve regexes for + */ + getRegexes(language) { + switch (language) { + case 'html': + case 'xml': + return ALL_REGEXES.html; + case 'ruby': + return ALL_REGEXES.ruby; + case 'python': + return ALL_REGEXES.python; + default: + // not exact, but likely the best guess for any other unspecified language. + return ALL_REGEXES.c; + } + } + /** + * return extension map + */ + getExtensionMap() { + return this.extensionMap; + } +} +exports.Languages = Languages; +const ALL_REGEXES = { + c: { + // matches when // are the first two characters of a line + singleLineComment: /^\/\//, + // matches when /* exists in a line + multiLineCommentOpen: /\/\*/, + // matches when /* starts a line + multiLineCommentOpenStart: /^\/\*/, + // matches when */ exists a line + multiLineCommentClose: /\*\//, + // matches when */ ends a line + multiLineCommentCloseEnd: /\*\/$/, + // matches /* ... */ + multiLineCommentOpenAndClose: /\/\*.*\*\// + }, + python: { + // matches when # the first character of a line + singleLineComment: /^#/, + // matches when """ starts a line. This is not right, since + // a multiline string is not always a comment, but for the + // sake of simplicity, we will do that here. + multiLineCommentOpen: /"""/, + // matches when """ starts a line + multiLineCommentOpenStart: /^"""/, + // matches when """ exists in a line + multiLineCommentClose: /"""/, + // matches when """ ends a line + multiLineCommentCloseEnd: /"""$/, + // matches """ ... """ + multiLineCommentOpenAndClose: /""".*"""/ + }, + ruby: { + // matches when # the first character of a line + singleLineComment: /^#/, + // For ruby multiline comments, =begin and =end must be + // on their own lines + // matches when =begin starts a line + multiLineCommentOpen: /^=begin/, + // matches when "begin starts a line + multiLineCommentOpenStart: /^=begin/, + // matches when "end ends a line + multiLineCommentClose: /^=end/, + // matches when "end ends a line + multiLineCommentCloseEnd: /^=end$/, + // not possible in ruby + multiLineCommentOpenAndClose: /^\0$/ + }, + html: { + // There is no single line comment + singleLineComment: /^\0$/, + // matches when =begin starts a line + multiLineCommentOpen: //, + // matches when "end ends a line + multiLineCommentCloseEnd: /-->$/, + // matches + multiLineCommentOpenAndClose: // + } +}; +//# sourceMappingURL=languages.js.map \ No newline at end of file diff --git a/node_modules/github-linguist/dist/languages.js.map b/node_modules/github-linguist/dist/languages.js.map new file mode 100644 index 0000000000..e923063d6a --- /dev/null +++ b/node_modules/github-linguist/dist/languages.js.map @@ -0,0 +1 @@ +{"version":3,"file":"languages.js","sourceRoot":"","sources":["../src/languages.ts"],"names":[],"mappings":";;;AAAA,mCAA2C;AAE3C,2BAA2B;AAC3B,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAU5C;;;;;GAKG;AACH,MAAa,SAAS;IAKpB;;OAEG;IACH;QAPA;;;;mBAEI,EAAE;WAAC;QASP;;WAEG;QACH;;;;mBAA2B,GAAG,EAAE;gBAC9B,MAAM,UAAU,GAAoB,EAAE,CAAC;gBAEvC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;oBAC5C,MA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;KAC3C;IAED,MAAM,EAAE;QACN,+CAA+C;QAC/C,iBAAiB,EAAE,IAAI;QAEvB,2DAA2D;QAC3D,0DAA0D;QAC1D,4CAA4C;QAC5C,oBAAoB,EAAE,KAAK;QAE3B,iCAAiC;QACjC,yBAAyB,EAAE,MAAM;QAEjC,oCAAoC;QACpC,qBAAqB,EAAE,KAAK;QAE5B,+BAA+B;QAC/B,wBAAwB,EAAE,MAAM;QAEhC,sBAAsB;QACtB,4BAA4B,EAAE,UAAU;KACzC;IAED,IAAI,EAAE;QACJ,+CAA+C;QAC/C,iBAAiB,EAAE,IAAI;QAEvB,uDAAuD;QACvD,qBAAqB;QAErB,oCAAoC;QACpC,oBAAoB,EAAE,SAAS;QAE/B,oCAAoC;QACpC,yBAAyB,EAAE,SAAS;QAEpC,gCAAgC;QAChC,qBAAqB,EAAE,OAAO;QAE9B,gCAAgC;QAChC,wBAAwB,EAAE,QAAQ;QAElC,uBAAuB;QACvB,4BAA4B,EAAE,MAAM;KACrC;IAED,IAAI,EAAE;QACJ,kCAAkC;QAClC,iBAAiB,EAAE,MAAM;QAEzB,oCAAoC;QACpC,oBAAoB,EAAE,MAAM;QAE5B,oCAAoC;QACpC,yBAAyB,EAAE,OAAO;QAElC,gCAAgC;QAChC,qBAAqB,EAAE,KAAK;QAE5B,gCAAgC;QAChC,wBAAwB,EAAE,MAAM;QAEhC,uBAAuB;QACvB,4BAA4B,EAAE,WAAW;KAC1C;CACF,CAAC"} \ No newline at end of file diff --git a/node_modules/github-linguist/dist/utils.d.ts b/node_modules/github-linguist/dist/utils.d.ts new file mode 100644 index 0000000000..dfccfe0b04 --- /dev/null +++ b/node_modules/github-linguist/dist/utils.d.ts @@ -0,0 +1,13 @@ +/** + * Get package version. + * + * @export getVersion + * @returns {string} + */ +export declare function getVersion(): string; +export declare const ExtensionJustify: { + '.ts': string; + '.jsx': string; + '.js': string; + '.tsx': string; +}; diff --git a/node_modules/github-linguist/dist/utils.js b/node_modules/github-linguist/dist/utils.js new file mode 100644 index 0000000000..606da35e8f --- /dev/null +++ b/node_modules/github-linguist/dist/utils.js @@ -0,0 +1,29 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExtensionJustify = exports.getVersion = void 0; +const fs_1 = __importDefault(require("fs")); +const path_1 = __importDefault(require("path")); +// @ts-ignore +const slash2_1 = __importDefault(require("slash2")); +const packagePath = slash2_1.default(path_1.default.join(__dirname, '../', 'package.json')); +/** + * Get package version. + * + * @export getVersion + * @returns {string} + */ +function getVersion() { + const packageInfo = JSON.parse(fs_1.default.readFileSync(packagePath, 'utf8')); + return (packageInfo && packageInfo.version) || 'invalid version!'; +} +exports.getVersion = getVersion; +exports.ExtensionJustify = { + '.ts': 'typescript', + '.jsx': 'javascript', + '.js': 'javascript', + '.tsx': 'typescript', +}; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/github-linguist/dist/utils.js.map b/node_modules/github-linguist/dist/utils.js.map new file mode 100644 index 0000000000..d90a5cf3a3 --- /dev/null +++ b/node_modules/github-linguist/dist/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,aAAa;AACb,oDAA2B;AAE3B,MAAM,WAAW,GAAG,gBAAK,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC;AAEvE;;;;;GAKG;AACH,SAAgB,UAAU;IACxB,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAErE,OAAO,CAAC,WAAW,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,kBAAkB,CAAC;AACpE,CAAC;AAJD,gCAIC;AAEY,QAAA,gBAAgB,GAAG;IAC9B,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,YAAY;IACpB,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,YAAY;CACrB,CAAC"} \ No newline at end of file diff --git a/node_modules/github-linguist/node_modules/array-union/index.js b/node_modules/github-linguist/node_modules/array-union/index.js new file mode 100644 index 0000000000..e33f38a1eb --- /dev/null +++ b/node_modules/github-linguist/node_modules/array-union/index.js @@ -0,0 +1,6 @@ +'use strict'; +var arrayUniq = require('array-uniq'); + +module.exports = function () { + return arrayUniq([].concat.apply([], arguments)); +}; diff --git a/node_modules/github-linguist/node_modules/array-union/license b/node_modules/github-linguist/node_modules/array-union/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/node_modules/github-linguist/node_modules/array-union/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/github-linguist/node_modules/array-union/package.json b/node_modules/github-linguist/node_modules/array-union/package.json new file mode 100644 index 0000000000..d82d3a1515 --- /dev/null +++ b/node_modules/github-linguist/node_modules/array-union/package.json @@ -0,0 +1,40 @@ +{ + "name": "array-union", + "version": "1.0.2", + "description": "Create an array of unique values, in order, from the input arrays", + "license": "MIT", + "repository": "sindresorhus/array-union", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "array", + "arr", + "set", + "uniq", + "unique", + "duplicate", + "remove", + "union", + "combine", + "merge" + ], + "dependencies": { + "array-uniq": "^1.0.1" + }, + "devDependencies": { + "ava": "*", + "xo": "*" + } +} \ No newline at end of file diff --git a/node_modules/github-linguist/node_modules/array-union/readme.md b/node_modules/github-linguist/node_modules/array-union/readme.md new file mode 100644 index 0000000000..ea472dd079 --- /dev/null +++ b/node_modules/github-linguist/node_modules/array-union/readme.md @@ -0,0 +1,28 @@ +# array-union [![Build Status](https://travis-ci.org/sindresorhus/array-union.svg?branch=master)](https://travis-ci.org/sindresorhus/array-union) + +> Create an array of unique values, in order, from the input arrays + + +## Install + +``` +$ npm install --save array-union +``` + + +## Usage + +```js +const arrayUnion = require('array-union'); + +arrayUnion([1, 1, 2, 3], [2, 3]); +//=> [1, 2, 3] + +arrayUnion(['foo', 'foo', 'bar'], ['foo']); +//=> ['foo', 'bar'] +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/github-linguist/node_modules/commander/CHANGELOG.md b/node_modules/github-linguist/node_modules/commander/CHANGELOG.md new file mode 100644 index 0000000000..7dce779da8 --- /dev/null +++ b/node_modules/github-linguist/node_modules/commander/CHANGELOG.md @@ -0,0 +1,419 @@ +2.20.3 / 2019-10-11 +================== + + * Support Node.js 0.10 (Revert #1059) + * Ran "npm unpublish commander@2.20.2". There is no 2.20.2. + +2.20.1 / 2019-09-29 +================== + + * Improve executable subcommand tracking + * Update dev dependencies + +2.20.0 / 2019-04-02 +================== + + * fix: resolve symbolic links completely when hunting for subcommands (#935) + * Update index.d.ts (#930) + * Update Readme.md (#924) + * Remove --save option as it isn't required anymore (#918) + * Add link to the license file (#900) + * Added example of receiving args from options (#858) + * Added missing semicolon (#882) + * Add extension to .eslintrc (#876) + +2.19.0 / 2018-10-02 +================== + + * Removed newline after Options and Commands headers (#864) + * Bugfix - Error output (#862) + * Fix to change default value to string (#856) + +2.18.0 / 2018-09-07 +================== + + * Standardize help output (#853) + * chmod 644 travis.yml (#851) + * add support for execute typescript subcommand via ts-node (#849) + +2.17.1 / 2018-08-07 +================== + + * Fix bug in command emit (#844) + +2.17.0 / 2018-08-03 +================== + + * fixed newline output after help information (#833) + * Fix to emit the action even without command (#778) + * npm update (#823) + +2.16.0 / 2018-06-29 +================== + + * Remove Makefile and `test/run` (#821) + * Make 'npm test' run on Windows (#820) + * Add badge to display install size (#807) + * chore: cache node_modules (#814) + * chore: remove Node.js 4 (EOL), add Node.js 10 (#813) + * fixed typo in readme (#812) + * Fix types (#804) + * Update eslint to resolve vulnerabilities in lodash (#799) + * updated readme with custom event listeners. (#791) + * fix tests (#794) + +2.15.0 / 2018-03-07 +================== + + * Update downloads badge to point to graph of downloads over time instead of duplicating link to npm + * Arguments description + +2.14.1 / 2018-02-07 +================== + + * Fix typing of help function + +2.14.0 / 2018-02-05 +================== + + * only register the option:version event once + * Fixes issue #727: Passing empty string for option on command is set to undefined + * enable eqeqeq rule + * resolves #754 add linter configuration to project + * resolves #560 respect custom name for version option + * document how to override the version flag + * document using options per command + +2.13.0 / 2018-01-09 +================== + + * Do not print default for --no- + * remove trailing spaces in command help + * Update CI's Node.js to LTS and latest version + * typedefs: Command and Option types added to commander namespace + +2.12.2 / 2017-11-28 +================== + + * fix: typings are not shipped + +2.12.1 / 2017-11-23 +================== + + * Move @types/node to dev dependency + +2.12.0 / 2017-11-22 +================== + + * add attributeName() method to Option objects + * Documentation updated for options with --no prefix + * typings: `outputHelp` takes a string as the first parameter + * typings: use overloads + * feat(typings): update to match js api + * Print default value in option help + * Fix translation error + * Fail when using same command and alias (#491) + * feat(typings): add help callback + * fix bug when description is add after command with options (#662) + * Format js code + * Rename History.md to CHANGELOG.md (#668) + * feat(typings): add typings to support TypeScript (#646) + * use current node + +2.11.0 / 2017-07-03 +================== + + * Fix help section order and padding (#652) + * feature: support for signals to subcommands (#632) + * Fixed #37, --help should not display first (#447) + * Fix translation errors. (#570) + * Add package-lock.json + * Remove engines + * Upgrade package version + * Prefix events to prevent conflicts between commands and options (#494) + * Removing dependency on graceful-readlink + * Support setting name in #name function and make it chainable + * Add .vscode directory to .gitignore (Visual Studio Code metadata) + * Updated link to ruby commander in readme files + +2.10.0 / 2017-06-19 +================== + + * Update .travis.yml. drop support for older node.js versions. + * Fix require arguments in README.md + * On SemVer you do not start from 0.0.1 + * Add missing semi colon in readme + * Add save param to npm install + * node v6 travis test + * Update Readme_zh-CN.md + * Allow literal '--' to be passed-through as an argument + * Test subcommand alias help + * link build badge to master branch + * Support the alias of Git style sub-command + * added keyword commander for better search result on npm + * Fix Sub-Subcommands + * test node.js stable + * Fixes TypeError when a command has an option called `--description` + * Update README.md to make it beginner friendly and elaborate on the difference between angled and square brackets. + * Add chinese Readme file + +2.9.0 / 2015-10-13 +================== + + * Add option `isDefault` to set default subcommand #415 @Qix- + * Add callback to allow filtering or post-processing of help text #434 @djulien + * Fix `undefined` text in help information close #414 #416 @zhiyelee + +2.8.1 / 2015-04-22 +================== + + * Back out `support multiline description` Close #396 #397 + +2.8.0 / 2015-04-07 +================== + + * Add `process.execArg` support, execution args like `--harmony` will be passed to sub-commands #387 @DigitalIO @zhiyelee + * Fix bug in Git-style sub-commands #372 @zhiyelee + * Allow commands to be hidden from help #383 @tonylukasavage + * When git-style sub-commands are in use, yet none are called, display help #382 @claylo + * Add ability to specify arguments syntax for top-level command #258 @rrthomas + * Support multiline descriptions #208 @zxqfox + +2.7.1 / 2015-03-11 +================== + + * Revert #347 (fix collisions when option and first arg have same name) which causes a bug in #367. + +2.7.0 / 2015-03-09 +================== + + * Fix git-style bug when installed globally. Close #335 #349 @zhiyelee + * Fix collisions when option and first arg have same name. Close #346 #347 @tonylukasavage + * Add support for camelCase on `opts()`. Close #353 @nkzawa + * Add node.js 0.12 and io.js to travis.yml + * Allow RegEx options. #337 @palanik + * Fixes exit code when sub-command failing. Close #260 #332 @pirelenito + * git-style `bin` files in $PATH make sense. Close #196 #327 @zhiyelee + +2.6.0 / 2014-12-30 +================== + + * added `Command#allowUnknownOption` method. Close #138 #318 @doozr @zhiyelee + * Add application description to the help msg. Close #112 @dalssoft + +2.5.1 / 2014-12-15 +================== + + * fixed two bugs incurred by variadic arguments. Close #291 @Quentin01 #302 @zhiyelee + +2.5.0 / 2014-10-24 +================== + + * add support for variadic arguments. Closes #277 @whitlockjc + +2.4.0 / 2014-10-17 +================== + + * fixed a bug on executing the coercion function of subcommands option. Closes #270 + * added `Command.prototype.name` to retrieve command name. Closes #264 #266 @tonylukasavage + * added `Command.prototype.opts` to retrieve all the options as a simple object of key-value pairs. Closes #262 @tonylukasavage + * fixed a bug on subcommand name. Closes #248 @jonathandelgado + * fixed function normalize doesn’t honor option terminator. Closes #216 @abbr + +2.3.0 / 2014-07-16 +================== + + * add command alias'. Closes PR #210 + * fix: Typos. Closes #99 + * fix: Unused fs module. Closes #217 + +2.2.0 / 2014-03-29 +================== + + * add passing of previous option value + * fix: support subcommands on windows. Closes #142 + * Now the defaultValue passed as the second argument of the coercion function. + +2.1.0 / 2013-11-21 +================== + + * add: allow cflag style option params, unit test, fixes #174 + +2.0.0 / 2013-07-18 +================== + + * remove input methods (.prompt, .confirm, etc) + +1.3.2 / 2013-07-18 +================== + + * add support for sub-commands to co-exist with the original command + +1.3.1 / 2013-07-18 +================== + + * add quick .runningCommand hack so you can opt-out of other logic when running a sub command + +1.3.0 / 2013-07-09 +================== + + * add EACCES error handling + * fix sub-command --help + +1.2.0 / 2013-06-13 +================== + + * allow "-" hyphen as an option argument + * support for RegExp coercion + +1.1.1 / 2012-11-20 +================== + + * add more sub-command padding + * fix .usage() when args are present. Closes #106 + +1.1.0 / 2012-11-16 +================== + + * add git-style executable subcommand support. Closes #94 + +1.0.5 / 2012-10-09 +================== + + * fix `--name` clobbering. Closes #92 + * fix examples/help. Closes #89 + +1.0.4 / 2012-09-03 +================== + + * add `outputHelp()` method. + +1.0.3 / 2012-08-30 +================== + + * remove invalid .version() defaulting + +1.0.2 / 2012-08-24 +================== + + * add `--foo=bar` support [arv] + * fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus] + +1.0.1 / 2012-08-03 +================== + + * fix issue #56 + * fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode()) + +1.0.0 / 2012-07-05 +================== + + * add support for optional option descriptions + * add defaulting of `.version()` to package.json's version + +0.6.1 / 2012-06-01 +================== + + * Added: append (yes or no) on confirmation + * Added: allow node.js v0.7.x + +0.6.0 / 2012-04-10 +================== + + * Added `.prompt(obj, callback)` support. Closes #49 + * Added default support to .choose(). Closes #41 + * Fixed the choice example + +0.5.1 / 2011-12-20 +================== + + * Fixed `password()` for recent nodes. Closes #36 + +0.5.0 / 2011-12-04 +================== + + * Added sub-command option support [itay] + +0.4.3 / 2011-12-04 +================== + + * Fixed custom help ordering. Closes #32 + +0.4.2 / 2011-11-24 +================== + + * Added travis support + * Fixed: line-buffered input automatically trimmed. Closes #31 + +0.4.1 / 2011-11-18 +================== + + * Removed listening for "close" on --help + +0.4.0 / 2011-11-15 +================== + + * Added support for `--`. Closes #24 + +0.3.3 / 2011-11-14 +================== + + * Fixed: wait for close event when writing help info [Jerry Hamlet] + +0.3.2 / 2011-11-01 +================== + + * Fixed long flag definitions with values [felixge] + +0.3.1 / 2011-10-31 +================== + + * Changed `--version` short flag to `-V` from `-v` + * Changed `.version()` so it's configurable [felixge] + +0.3.0 / 2011-10-31 +================== + + * Added support for long flags only. Closes #18 + +0.2.1 / 2011-10-24 +================== + + * "node": ">= 0.4.x < 0.7.0". Closes #20 + +0.2.0 / 2011-09-26 +================== + + * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] + +0.1.0 / 2011-08-24 +================== + + * Added support for custom `--help` output + +0.0.5 / 2011-08-18 +================== + + * Changed: when the user enters nothing prompt for password again + * Fixed issue with passwords beginning with numbers [NuckChorris] + +0.0.4 / 2011-08-15 +================== + + * Fixed `Commander#args` + +0.0.3 / 2011-08-15 +================== + + * Added default option value support + +0.0.2 / 2011-08-15 +================== + + * Added mask support to `Command#password(str[, mask], fn)` + * Added `Command#password(str, fn)` + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/github-linguist/node_modules/commander/LICENSE b/node_modules/github-linguist/node_modules/commander/LICENSE new file mode 100644 index 0000000000..10f997ab10 --- /dev/null +++ b/node_modules/github-linguist/node_modules/commander/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2011 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/github-linguist/node_modules/commander/Readme.md b/node_modules/github-linguist/node_modules/commander/Readme.md new file mode 100644 index 0000000000..c846e7a2d2 --- /dev/null +++ b/node_modules/github-linguist/node_modules/commander/Readme.md @@ -0,0 +1,428 @@ +# Commander.js + + +[![Build Status](https://api.travis-ci.org/tj/commander.js.svg?branch=master)](http://travis-ci.org/tj/commander.js) +[![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander) +[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://npmcharts.com/compare/commander?minimal=true) +[![Install Size](https://packagephobia.now.sh/badge?p=commander)](https://packagephobia.now.sh/result?p=commander) +[![Join the chat at https://gitter.im/tj/commander.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + + The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/commander-rb/commander). + [API documentation](http://tj.github.com/commander.js/) + + +## Installation + + $ npm install commander + +## Option parsing + +Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. + +```js +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var program = require('commander'); + +program + .version('0.1.0') + .option('-p, --peppers', 'Add peppers') + .option('-P, --pineapple', 'Add pineapple') + .option('-b, --bbq-sauce', 'Add bbq sauce') + .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') + .parse(process.argv); + +console.log('you ordered a pizza with:'); +if (program.peppers) console.log(' - peppers'); +if (program.pineapple) console.log(' - pineapple'); +if (program.bbqSauce) console.log(' - bbq'); +console.log(' - %s cheese', program.cheese); +``` + +Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. + +Note that multi-word options starting with `--no` prefix negate the boolean value of the following word. For example, `--no-sauce` sets the value of `program.sauce` to false. + +```js +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var program = require('commander'); + +program + .option('--no-sauce', 'Remove sauce') + .parse(process.argv); + +console.log('you ordered a pizza'); +if (program.sauce) console.log(' with sauce'); +else console.log(' without sauce'); +``` + +To get string arguments from options you will need to use angle brackets <> for required inputs or square brackets [] for optional inputs. + +e.g. ```.option('-m --myarg [myVar]', 'my super cool description')``` + +Then to access the input if it was passed in. + +e.g. ```var myInput = program.myarg``` + +**NOTE**: If you pass a argument without using brackets the example above will return true and not the value passed in. + + +## Version option + +Calling the `version` implicitly adds the `-V` and `--version` options to the command. +When either of these options is present, the command prints the version number and exits. + + $ ./examples/pizza -V + 0.0.1 + +If you want your program to respond to the `-v` option instead of the `-V` option, simply pass custom flags to the `version` method using the same syntax as the `option` method. + +```js +program + .version('0.0.1', '-v, --version') +``` + +The version flags can be named anything, but the long option is required. + +## Command-specific options + +You can attach options to a command. + +```js +#!/usr/bin/env node + +var program = require('commander'); + +program + .command('rm ') + .option('-r, --recursive', 'Remove recursively') + .action(function (dir, cmd) { + console.log('remove ' + dir + (cmd.recursive ? ' recursively' : '')) + }) + +program.parse(process.argv) +``` + +A command's options are validated when the command is used. Any unknown options will be reported as an error. However, if an action-based command does not define an action, then the options are not validated. + +## Coercion + +```js +function range(val) { + return val.split('..').map(Number); +} + +function list(val) { + return val.split(','); +} + +function collect(val, memo) { + memo.push(val); + return memo; +} + +function increaseVerbosity(v, total) { + return total + 1; +} + +program + .version('0.1.0') + .usage('[options] ') + .option('-i, --integer ', 'An integer argument', parseInt) + .option('-f, --float ', 'A float argument', parseFloat) + .option('-r, --range ..', 'A range', range) + .option('-l, --list ', 'A list', list) + .option('-o, --optional [value]', 'An optional value') + .option('-c, --collect [value]', 'A repeatable value', collect, []) + .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0) + .parse(process.argv); + +console.log(' int: %j', program.integer); +console.log(' float: %j', program.float); +console.log(' optional: %j', program.optional); +program.range = program.range || []; +console.log(' range: %j..%j', program.range[0], program.range[1]); +console.log(' list: %j', program.list); +console.log(' collect: %j', program.collect); +console.log(' verbosity: %j', program.verbose); +console.log(' args: %j', program.args); +``` + +## Regular Expression +```js +program + .version('0.1.0') + .option('-s --size ', 'Pizza size', /^(large|medium|small)$/i, 'medium') + .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i) + .parse(process.argv); + +console.log(' size: %j', program.size); +console.log(' drink: %j', program.drink); +``` + +## Variadic arguments + + The last argument of a command can be variadic, and only the last argument. To make an argument variadic you have to + append `...` to the argument name. Here is an example: + +```js +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var program = require('commander'); + +program + .version('0.1.0') + .command('rmdir [otherDirs...]') + .action(function (dir, otherDirs) { + console.log('rmdir %s', dir); + if (otherDirs) { + otherDirs.forEach(function (oDir) { + console.log('rmdir %s', oDir); + }); + } + }); + +program.parse(process.argv); +``` + + An `Array` is used for the value of a variadic argument. This applies to `program.args` as well as the argument passed + to your action as demonstrated above. + +## Specify the argument syntax + +```js +#!/usr/bin/env node + +var program = require('commander'); + +program + .version('0.1.0') + .arguments(' [env]') + .action(function (cmd, env) { + cmdValue = cmd; + envValue = env; + }); + +program.parse(process.argv); + +if (typeof cmdValue === 'undefined') { + console.error('no command given!'); + process.exit(1); +} +console.log('command:', cmdValue); +console.log('environment:', envValue || "no environment given"); +``` +Angled brackets (e.g. ``) indicate required input. Square brackets (e.g. `[env]`) indicate optional input. + +## Git-style sub-commands + +```js +// file: ./examples/pm +var program = require('commander'); + +program + .version('0.1.0') + .command('install [name]', 'install one or more packages') + .command('search [query]', 'search with optional query') + .command('list', 'list packages installed', {isDefault: true}) + .parse(process.argv); +``` + +When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools. +The commander will try to search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`. + +Options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the subcommand from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified. + +If the program is designed to be installed globally, make sure the executables have proper modes, like `755`. + +### `--harmony` + +You can enable `--harmony` option in two ways: +* Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. Note some os version don’t support this pattern. +* Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process. + +## Automated --help + + The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: + +``` +$ ./examples/pizza --help +Usage: pizza [options] + +An application for pizzas ordering + +Options: + -h, --help output usage information + -V, --version output the version number + -p, --peppers Add peppers + -P, --pineapple Add pineapple + -b, --bbq Add bbq sauce + -c, --cheese Add the specified type of cheese [marble] + -C, --no-cheese You do not want any cheese +``` + +## Custom help + + You can display arbitrary `-h, --help` information + by listening for "--help". Commander will automatically + exit once you are done so that the remainder of your program + does not execute causing undesired behaviors, for example + in the following executable "stuff" will not output when + `--help` is used. + +```js +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var program = require('commander'); + +program + .version('0.1.0') + .option('-f, --foo', 'enable some foo') + .option('-b, --bar', 'enable some bar') + .option('-B, --baz', 'enable some baz'); + +// must be before .parse() since +// node's emit() is immediate + +program.on('--help', function(){ + console.log('') + console.log('Examples:'); + console.log(' $ custom-help --help'); + console.log(' $ custom-help -h'); +}); + +program.parse(process.argv); + +console.log('stuff'); +``` + +Yields the following help output when `node script-name.js -h` or `node script-name.js --help` are run: + +``` +Usage: custom-help [options] + +Options: + -h, --help output usage information + -V, --version output the version number + -f, --foo enable some foo + -b, --bar enable some bar + -B, --baz enable some baz + +Examples: + $ custom-help --help + $ custom-help -h +``` + +## .outputHelp(cb) + +Output help information without exiting. +Optional callback cb allows post-processing of help text before it is displayed. + +If you want to display help by default (e.g. if no command was provided), you can use something like: + +```js +var program = require('commander'); +var colors = require('colors'); + +program + .version('0.1.0') + .command('getstream [url]', 'get stream URL') + .parse(process.argv); + +if (!process.argv.slice(2).length) { + program.outputHelp(make_red); +} + +function make_red(txt) { + return colors.red(txt); //display the help text in red on the console +} +``` + +## .help(cb) + + Output help information and exit immediately. + Optional callback cb allows post-processing of help text before it is displayed. + + +## Custom event listeners + You can execute custom actions by listening to command and option events. + +```js +program.on('option:verbose', function () { + process.env.VERBOSE = this.verbose; +}); + +// error on unknown commands +program.on('command:*', function () { + console.error('Invalid command: %s\nSee --help for a list of available commands.', program.args.join(' ')); + process.exit(1); +}); +``` + +## Examples + +```js +var program = require('commander'); + +program + .version('0.1.0') + .option('-C, --chdir ', 'change the working directory') + .option('-c, --config ', 'set config path. defaults to ./deploy.conf') + .option('-T, --no-tests', 'ignore test hook'); + +program + .command('setup [env]') + .description('run setup commands for all envs') + .option("-s, --setup_mode [mode]", "Which setup mode to use") + .action(function(env, options){ + var mode = options.setup_mode || "normal"; + env = env || 'all'; + console.log('setup for %s env(s) with %s mode', env, mode); + }); + +program + .command('exec ') + .alias('ex') + .description('execute the given remote cmd') + .option("-e, --exec_mode ", "Which exec mode to use") + .action(function(cmd, options){ + console.log('exec "%s" using %s mode', cmd, options.exec_mode); + }).on('--help', function() { + console.log(''); + console.log('Examples:'); + console.log(''); + console.log(' $ deploy exec sequential'); + console.log(' $ deploy exec async'); + }); + +program + .command('*') + .action(function(env){ + console.log('deploying "%s"', env); + }); + +program.parse(process.argv); +``` + +More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory. + +## License + +[MIT](https://github.com/tj/commander.js/blob/master/LICENSE) diff --git a/node_modules/github-linguist/node_modules/commander/index.js b/node_modules/github-linguist/node_modules/commander/index.js new file mode 100644 index 0000000000..ec1d61d587 --- /dev/null +++ b/node_modules/github-linguist/node_modules/commander/index.js @@ -0,0 +1,1224 @@ +/** + * Module dependencies. + */ + +var EventEmitter = require('events').EventEmitter; +var spawn = require('child_process').spawn; +var path = require('path'); +var dirname = path.dirname; +var basename = path.basename; +var fs = require('fs'); + +/** + * Inherit `Command` from `EventEmitter.prototype`. + */ + +require('util').inherits(Command, EventEmitter); + +/** + * Expose the root command. + */ + +exports = module.exports = new Command(); + +/** + * Expose `Command`. + */ + +exports.Command = Command; + +/** + * Expose `Option`. + */ + +exports.Option = Option; + +/** + * Initialize a new `Option` with the given `flags` and `description`. + * + * @param {String} flags + * @param {String} description + * @api public + */ + +function Option(flags, description) { + this.flags = flags; + this.required = flags.indexOf('<') >= 0; + this.optional = flags.indexOf('[') >= 0; + this.bool = flags.indexOf('-no-') === -1; + flags = flags.split(/[ ,|]+/); + if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); + this.long = flags.shift(); + this.description = description || ''; +} + +/** + * Return option name. + * + * @return {String} + * @api private + */ + +Option.prototype.name = function() { + return this.long + .replace('--', '') + .replace('no-', ''); +}; + +/** + * Return option name, in a camelcase format that can be used + * as a object attribute key. + * + * @return {String} + * @api private + */ + +Option.prototype.attributeName = function() { + return camelcase(this.name()); +}; + +/** + * Check if `arg` matches the short or long flag. + * + * @param {String} arg + * @return {Boolean} + * @api private + */ + +Option.prototype.is = function(arg) { + return this.short === arg || this.long === arg; +}; + +/** + * Initialize a new `Command`. + * + * @param {String} name + * @api public + */ + +function Command(name) { + this.commands = []; + this.options = []; + this._execs = {}; + this._allowUnknownOption = false; + this._args = []; + this._name = name || ''; +} + +/** + * Add command `name`. + * + * The `.action()` callback is invoked when the + * command `name` is specified via __ARGV__, + * and the remaining arguments are applied to the + * function for access. + * + * When the `name` is "*" an un-matched command + * will be passed as the first arg, followed by + * the rest of __ARGV__ remaining. + * + * Examples: + * + * program + * .version('0.0.1') + * .option('-C, --chdir ', 'change the working directory') + * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') + * .option('-T, --no-tests', 'ignore test hook') + * + * program + * .command('setup') + * .description('run remote setup commands') + * .action(function() { + * console.log('setup'); + * }); + * + * program + * .command('exec ') + * .description('run the given remote command') + * .action(function(cmd) { + * console.log('exec "%s"', cmd); + * }); + * + * program + * .command('teardown [otherDirs...]') + * .description('run teardown commands') + * .action(function(dir, otherDirs) { + * console.log('dir "%s"', dir); + * if (otherDirs) { + * otherDirs.forEach(function (oDir) { + * console.log('dir "%s"', oDir); + * }); + * } + * }); + * + * program + * .command('*') + * .description('deploy the given env') + * .action(function(env) { + * console.log('deploying "%s"', env); + * }); + * + * program.parse(process.argv); + * + * @param {String} name + * @param {String} [desc] for git-style sub-commands + * @return {Command} the new command + * @api public + */ + +Command.prototype.command = function(name, desc, opts) { + if (typeof desc === 'object' && desc !== null) { + opts = desc; + desc = null; + } + opts = opts || {}; + var args = name.split(/ +/); + var cmd = new Command(args.shift()); + + if (desc) { + cmd.description(desc); + this.executables = true; + this._execs[cmd._name] = true; + if (opts.isDefault) this.defaultExecutable = cmd._name; + } + cmd._noHelp = !!opts.noHelp; + this.commands.push(cmd); + cmd.parseExpectedArgs(args); + cmd.parent = this; + + if (desc) return this; + return cmd; +}; + +/** + * Define argument syntax for the top-level command. + * + * @api public + */ + +Command.prototype.arguments = function(desc) { + return this.parseExpectedArgs(desc.split(/ +/)); +}; + +/** + * Add an implicit `help [cmd]` subcommand + * which invokes `--help` for the given command. + * + * @api private + */ + +Command.prototype.addImplicitHelpCommand = function() { + this.command('help [cmd]', 'display help for [cmd]'); +}; + +/** + * Parse expected `args`. + * + * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. + * + * @param {Array} args + * @return {Command} for chaining + * @api public + */ + +Command.prototype.parseExpectedArgs = function(args) { + if (!args.length) return; + var self = this; + args.forEach(function(arg) { + var argDetails = { + required: false, + name: '', + variadic: false + }; + + switch (arg[0]) { + case '<': + argDetails.required = true; + argDetails.name = arg.slice(1, -1); + break; + case '[': + argDetails.name = arg.slice(1, -1); + break; + } + + if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { + argDetails.variadic = true; + argDetails.name = argDetails.name.slice(0, -3); + } + if (argDetails.name) { + self._args.push(argDetails); + } + }); + return this; +}; + +/** + * Register callback `fn` for the command. + * + * Examples: + * + * program + * .command('help') + * .description('display verbose help') + * .action(function() { + * // output help here + * }); + * + * @param {Function} fn + * @return {Command} for chaining + * @api public + */ + +Command.prototype.action = function(fn) { + var self = this; + var listener = function(args, unknown) { + // Parse any so-far unknown options + args = args || []; + unknown = unknown || []; + + var parsed = self.parseOptions(unknown); + + // Output help if necessary + outputHelpIfNecessary(self, parsed.unknown); + + // If there are still any unknown options, then we simply + // die, unless someone asked for help, in which case we give it + // to them, and then we die. + if (parsed.unknown.length > 0) { + self.unknownOption(parsed.unknown[0]); + } + + // Leftover arguments need to be pushed back. Fixes issue #56 + if (parsed.args.length) args = parsed.args.concat(args); + + self._args.forEach(function(arg, i) { + if (arg.required && args[i] == null) { + self.missingArgument(arg.name); + } else if (arg.variadic) { + if (i !== self._args.length - 1) { + self.variadicArgNotLast(arg.name); + } + + args[i] = args.splice(i); + } + }); + + // Always append ourselves to the end of the arguments, + // to make sure we match the number of arguments the user + // expects + if (self._args.length) { + args[self._args.length] = self; + } else { + args.push(self); + } + + fn.apply(self, args); + }; + var parent = this.parent || this; + var name = parent === this ? '*' : this._name; + parent.on('command:' + name, listener); + if (this._alias) parent.on('command:' + this._alias, listener); + return this; +}; + +/** + * Define option with `flags`, `description` and optional + * coercion `fn`. + * + * The `flags` string should contain both the short and long flags, + * separated by comma, a pipe or space. The following are all valid + * all will output this way when `--help` is used. + * + * "-p, --pepper" + * "-p|--pepper" + * "-p --pepper" + * + * Examples: + * + * // simple boolean defaulting to false + * program.option('-p, --pepper', 'add pepper'); + * + * --pepper + * program.pepper + * // => Boolean + * + * // simple boolean defaulting to true + * program.option('-C, --no-cheese', 'remove cheese'); + * + * program.cheese + * // => true + * + * --no-cheese + * program.cheese + * // => false + * + * // required argument + * program.option('-C, --chdir ', 'change the working directory'); + * + * --chdir /tmp + * program.chdir + * // => "/tmp" + * + * // optional argument + * program.option('-c, --cheese [type]', 'add cheese [marble]'); + * + * @param {String} flags + * @param {String} description + * @param {Function|*} [fn] or default + * @param {*} [defaultValue] + * @return {Command} for chaining + * @api public + */ + +Command.prototype.option = function(flags, description, fn, defaultValue) { + var self = this, + option = new Option(flags, description), + oname = option.name(), + name = option.attributeName(); + + // default as 3rd arg + if (typeof fn !== 'function') { + if (fn instanceof RegExp) { + var regex = fn; + fn = function(val, def) { + var m = regex.exec(val); + return m ? m[0] : def; + }; + } else { + defaultValue = fn; + fn = null; + } + } + + // preassign default value only for --no-*, [optional], or + if (!option.bool || option.optional || option.required) { + // when --no-* we make sure default is true + if (!option.bool) defaultValue = true; + // preassign only if we have a default + if (defaultValue !== undefined) { + self[name] = defaultValue; + option.defaultValue = defaultValue; + } + } + + // register the option + this.options.push(option); + + // when it's passed assign the value + // and conditionally invoke the callback + this.on('option:' + oname, function(val) { + // coercion + if (val !== null && fn) { + val = fn(val, self[name] === undefined ? defaultValue : self[name]); + } + + // unassigned or bool + if (typeof self[name] === 'boolean' || typeof self[name] === 'undefined') { + // if no value, bool true, and we have a default, then use it! + if (val == null) { + self[name] = option.bool + ? defaultValue || true + : false; + } else { + self[name] = val; + } + } else if (val !== null) { + // reassign + self[name] = val; + } + }); + + return this; +}; + +/** + * Allow unknown options on the command line. + * + * @param {Boolean} arg if `true` or omitted, no error will be thrown + * for unknown options. + * @api public + */ +Command.prototype.allowUnknownOption = function(arg) { + this._allowUnknownOption = arguments.length === 0 || arg; + return this; +}; + +/** + * Parse `argv`, settings options and invoking commands when defined. + * + * @param {Array} argv + * @return {Command} for chaining + * @api public + */ + +Command.prototype.parse = function(argv) { + // implicit help + if (this.executables) this.addImplicitHelpCommand(); + + // store raw args + this.rawArgs = argv; + + // guess name + this._name = this._name || basename(argv[1], '.js'); + + // github-style sub-commands with no sub-command + if (this.executables && argv.length < 3 && !this.defaultExecutable) { + // this user needs help + argv.push('--help'); + } + + // process argv + var parsed = this.parseOptions(this.normalize(argv.slice(2))); + var args = this.args = parsed.args; + + var result = this.parseArgs(this.args, parsed.unknown); + + // executable sub-commands + var name = result.args[0]; + + var aliasCommand = null; + // check alias of sub commands + if (name) { + aliasCommand = this.commands.filter(function(command) { + return command.alias() === name; + })[0]; + } + + if (this._execs[name] === true) { + return this.executeSubCommand(argv, args, parsed.unknown); + } else if (aliasCommand) { + // is alias of a subCommand + args[0] = aliasCommand._name; + return this.executeSubCommand(argv, args, parsed.unknown); + } else if (this.defaultExecutable) { + // use the default subcommand + args.unshift(this.defaultExecutable); + return this.executeSubCommand(argv, args, parsed.unknown); + } + + return result; +}; + +/** + * Execute a sub-command executable. + * + * @param {Array} argv + * @param {Array} args + * @param {Array} unknown + * @api private + */ + +Command.prototype.executeSubCommand = function(argv, args, unknown) { + args = args.concat(unknown); + + if (!args.length) this.help(); + if (args[0] === 'help' && args.length === 1) this.help(); + + // --help + if (args[0] === 'help') { + args[0] = args[1]; + args[1] = '--help'; + } + + // executable + var f = argv[1]; + // name of the subcommand, link `pm-install` + var bin = basename(f, path.extname(f)) + '-' + args[0]; + + // In case of globally installed, get the base dir where executable + // subcommand file should be located at + var baseDir; + + var resolvedLink = fs.realpathSync(f); + + baseDir = dirname(resolvedLink); + + // prefer local `./` to bin in the $PATH + var localBin = path.join(baseDir, bin); + + // whether bin file is a js script with explicit `.js` or `.ts` extension + var isExplicitJS = false; + if (exists(localBin + '.js')) { + bin = localBin + '.js'; + isExplicitJS = true; + } else if (exists(localBin + '.ts')) { + bin = localBin + '.ts'; + isExplicitJS = true; + } else if (exists(localBin)) { + bin = localBin; + } + + args = args.slice(1); + + var proc; + if (process.platform !== 'win32') { + if (isExplicitJS) { + args.unshift(bin); + // add executable arguments to spawn + args = (process.execArgv || []).concat(args); + + proc = spawn(process.argv[0], args, { stdio: 'inherit', customFds: [0, 1, 2] }); + } else { + proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] }); + } + } else { + args.unshift(bin); + proc = spawn(process.execPath, args, { stdio: 'inherit' }); + } + + var signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP']; + signals.forEach(function(signal) { + process.on(signal, function() { + if (proc.killed === false && proc.exitCode === null) { + proc.kill(signal); + } + }); + }); + proc.on('close', process.exit.bind(process)); + proc.on('error', function(err) { + if (err.code === 'ENOENT') { + console.error('error: %s(1) does not exist, try --help', bin); + } else if (err.code === 'EACCES') { + console.error('error: %s(1) not executable. try chmod or run with root', bin); + } + process.exit(1); + }); + + // Store the reference to the child process + this.runningCommand = proc; +}; + +/** + * Normalize `args`, splitting joined short flags. For example + * the arg "-abc" is equivalent to "-a -b -c". + * This also normalizes equal sign and splits "--abc=def" into "--abc def". + * + * @param {Array} args + * @return {Array} + * @api private + */ + +Command.prototype.normalize = function(args) { + var ret = [], + arg, + lastOpt, + index; + + for (var i = 0, len = args.length; i < len; ++i) { + arg = args[i]; + if (i > 0) { + lastOpt = this.optionFor(args[i - 1]); + } + + if (arg === '--') { + // Honor option terminator + ret = ret.concat(args.slice(i)); + break; + } else if (lastOpt && lastOpt.required) { + ret.push(arg); + } else if (arg.length > 1 && arg[0] === '-' && arg[1] !== '-') { + arg.slice(1).split('').forEach(function(c) { + ret.push('-' + c); + }); + } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) { + ret.push(arg.slice(0, index), arg.slice(index + 1)); + } else { + ret.push(arg); + } + } + + return ret; +}; + +/** + * Parse command `args`. + * + * When listener(s) are available those + * callbacks are invoked, otherwise the "*" + * event is emitted and those actions are invoked. + * + * @param {Array} args + * @return {Command} for chaining + * @api private + */ + +Command.prototype.parseArgs = function(args, unknown) { + var name; + + if (args.length) { + name = args[0]; + if (this.listeners('command:' + name).length) { + this.emit('command:' + args.shift(), args, unknown); + } else { + this.emit('command:*', args); + } + } else { + outputHelpIfNecessary(this, unknown); + + // If there were no args and we have unknown options, + // then they are extraneous and we need to error. + if (unknown.length > 0) { + this.unknownOption(unknown[0]); + } + if (this.commands.length === 0 && + this._args.filter(function(a) { return a.required; }).length === 0) { + this.emit('command:*'); + } + } + + return this; +}; + +/** + * Return an option matching `arg` if any. + * + * @param {String} arg + * @return {Option} + * @api private + */ + +Command.prototype.optionFor = function(arg) { + for (var i = 0, len = this.options.length; i < len; ++i) { + if (this.options[i].is(arg)) { + return this.options[i]; + } + } +}; + +/** + * Parse options from `argv` returning `argv` + * void of these options. + * + * @param {Array} argv + * @return {Array} + * @api public + */ + +Command.prototype.parseOptions = function(argv) { + var args = [], + len = argv.length, + literal, + option, + arg; + + var unknownOptions = []; + + // parse options + for (var i = 0; i < len; ++i) { + arg = argv[i]; + + // literal args after -- + if (literal) { + args.push(arg); + continue; + } + + if (arg === '--') { + literal = true; + continue; + } + + // find matching Option + option = this.optionFor(arg); + + // option is defined + if (option) { + // requires arg + if (option.required) { + arg = argv[++i]; + if (arg == null) return this.optionMissingArgument(option); + this.emit('option:' + option.name(), arg); + // optional arg + } else if (option.optional) { + arg = argv[i + 1]; + if (arg == null || (arg[0] === '-' && arg !== '-')) { + arg = null; + } else { + ++i; + } + this.emit('option:' + option.name(), arg); + // bool + } else { + this.emit('option:' + option.name()); + } + continue; + } + + // looks like an option + if (arg.length > 1 && arg[0] === '-') { + unknownOptions.push(arg); + + // If the next argument looks like it might be + // an argument for this option, we pass it on. + // If it isn't, then it'll simply be ignored + if ((i + 1) < argv.length && argv[i + 1][0] !== '-') { + unknownOptions.push(argv[++i]); + } + continue; + } + + // arg + args.push(arg); + } + + return { args: args, unknown: unknownOptions }; +}; + +/** + * Return an object containing options as key-value pairs + * + * @return {Object} + * @api public + */ +Command.prototype.opts = function() { + var result = {}, + len = this.options.length; + + for (var i = 0; i < len; i++) { + var key = this.options[i].attributeName(); + result[key] = key === this._versionOptionName ? this._version : this[key]; + } + return result; +}; + +/** + * Argument `name` is missing. + * + * @param {String} name + * @api private + */ + +Command.prototype.missingArgument = function(name) { + console.error("error: missing required argument `%s'", name); + process.exit(1); +}; + +/** + * `Option` is missing an argument, but received `flag` or nothing. + * + * @param {String} option + * @param {String} flag + * @api private + */ + +Command.prototype.optionMissingArgument = function(option, flag) { + if (flag) { + console.error("error: option `%s' argument missing, got `%s'", option.flags, flag); + } else { + console.error("error: option `%s' argument missing", option.flags); + } + process.exit(1); +}; + +/** + * Unknown option `flag`. + * + * @param {String} flag + * @api private + */ + +Command.prototype.unknownOption = function(flag) { + if (this._allowUnknownOption) return; + console.error("error: unknown option `%s'", flag); + process.exit(1); +}; + +/** + * Variadic argument with `name` is not the last argument as required. + * + * @param {String} name + * @api private + */ + +Command.prototype.variadicArgNotLast = function(name) { + console.error("error: variadic arguments must be last `%s'", name); + process.exit(1); +}; + +/** + * Set the program version to `str`. + * + * This method auto-registers the "-V, --version" flag + * which will print the version number when passed. + * + * @param {String} str + * @param {String} [flags] + * @return {Command} for chaining + * @api public + */ + +Command.prototype.version = function(str, flags) { + if (arguments.length === 0) return this._version; + this._version = str; + flags = flags || '-V, --version'; + var versionOption = new Option(flags, 'output the version number'); + this._versionOptionName = versionOption.long.substr(2) || 'version'; + this.options.push(versionOption); + this.on('option:' + this._versionOptionName, function() { + process.stdout.write(str + '\n'); + process.exit(0); + }); + return this; +}; + +/** + * Set the description to `str`. + * + * @param {String} str + * @param {Object} argsDescription + * @return {String|Command} + * @api public + */ + +Command.prototype.description = function(str, argsDescription) { + if (arguments.length === 0) return this._description; + this._description = str; + this._argsDescription = argsDescription; + return this; +}; + +/** + * Set an alias for the command + * + * @param {String} alias + * @return {String|Command} + * @api public + */ + +Command.prototype.alias = function(alias) { + var command = this; + if (this.commands.length !== 0) { + command = this.commands[this.commands.length - 1]; + } + + if (arguments.length === 0) return command._alias; + + if (alias === command._name) throw new Error('Command alias can\'t be the same as its name'); + + command._alias = alias; + return this; +}; + +/** + * Set / get the command usage `str`. + * + * @param {String} str + * @return {String|Command} + * @api public + */ + +Command.prototype.usage = function(str) { + var args = this._args.map(function(arg) { + return humanReadableArgName(arg); + }); + + var usage = '[options]' + + (this.commands.length ? ' [command]' : '') + + (this._args.length ? ' ' + args.join(' ') : ''); + + if (arguments.length === 0) return this._usage || usage; + this._usage = str; + + return this; +}; + +/** + * Get or set the name of the command + * + * @param {String} str + * @return {String|Command} + * @api public + */ + +Command.prototype.name = function(str) { + if (arguments.length === 0) return this._name; + this._name = str; + return this; +}; + +/** + * Return prepared commands. + * + * @return {Array} + * @api private + */ + +Command.prototype.prepareCommands = function() { + return this.commands.filter(function(cmd) { + return !cmd._noHelp; + }).map(function(cmd) { + var args = cmd._args.map(function(arg) { + return humanReadableArgName(arg); + }).join(' '); + + return [ + cmd._name + + (cmd._alias ? '|' + cmd._alias : '') + + (cmd.options.length ? ' [options]' : '') + + (args ? ' ' + args : ''), + cmd._description + ]; + }); +}; + +/** + * Return the largest command length. + * + * @return {Number} + * @api private + */ + +Command.prototype.largestCommandLength = function() { + var commands = this.prepareCommands(); + return commands.reduce(function(max, command) { + return Math.max(max, command[0].length); + }, 0); +}; + +/** + * Return the largest option length. + * + * @return {Number} + * @api private + */ + +Command.prototype.largestOptionLength = function() { + var options = [].slice.call(this.options); + options.push({ + flags: '-h, --help' + }); + return options.reduce(function(max, option) { + return Math.max(max, option.flags.length); + }, 0); +}; + +/** + * Return the largest arg length. + * + * @return {Number} + * @api private + */ + +Command.prototype.largestArgLength = function() { + return this._args.reduce(function(max, arg) { + return Math.max(max, arg.name.length); + }, 0); +}; + +/** + * Return the pad width. + * + * @return {Number} + * @api private + */ + +Command.prototype.padWidth = function() { + var width = this.largestOptionLength(); + if (this._argsDescription && this._args.length) { + if (this.largestArgLength() > width) { + width = this.largestArgLength(); + } + } + + if (this.commands && this.commands.length) { + if (this.largestCommandLength() > width) { + width = this.largestCommandLength(); + } + } + + return width; +}; + +/** + * Return help for options. + * + * @return {String} + * @api private + */ + +Command.prototype.optionHelp = function() { + var width = this.padWidth(); + + // Append the help information + return this.options.map(function(option) { + return pad(option.flags, width) + ' ' + option.description + + ((option.bool && option.defaultValue !== undefined) ? ' (default: ' + JSON.stringify(option.defaultValue) + ')' : ''); + }).concat([pad('-h, --help', width) + ' ' + 'output usage information']) + .join('\n'); +}; + +/** + * Return command help documentation. + * + * @return {String} + * @api private + */ + +Command.prototype.commandHelp = function() { + if (!this.commands.length) return ''; + + var commands = this.prepareCommands(); + var width = this.padWidth(); + + return [ + 'Commands:', + commands.map(function(cmd) { + var desc = cmd[1] ? ' ' + cmd[1] : ''; + return (desc ? pad(cmd[0], width) : cmd[0]) + desc; + }).join('\n').replace(/^/gm, ' '), + '' + ].join('\n'); +}; + +/** + * Return program help documentation. + * + * @return {String} + * @api private + */ + +Command.prototype.helpInformation = function() { + var desc = []; + if (this._description) { + desc = [ + this._description, + '' + ]; + + var argsDescription = this._argsDescription; + if (argsDescription && this._args.length) { + var width = this.padWidth(); + desc.push('Arguments:'); + desc.push(''); + this._args.forEach(function(arg) { + desc.push(' ' + pad(arg.name, width) + ' ' + argsDescription[arg.name]); + }); + desc.push(''); + } + } + + var cmdName = this._name; + if (this._alias) { + cmdName = cmdName + '|' + this._alias; + } + var usage = [ + 'Usage: ' + cmdName + ' ' + this.usage(), + '' + ]; + + var cmds = []; + var commandHelp = this.commandHelp(); + if (commandHelp) cmds = [commandHelp]; + + var options = [ + 'Options:', + '' + this.optionHelp().replace(/^/gm, ' '), + '' + ]; + + return usage + .concat(desc) + .concat(options) + .concat(cmds) + .join('\n'); +}; + +/** + * Output help information for this command + * + * @api public + */ + +Command.prototype.outputHelp = function(cb) { + if (!cb) { + cb = function(passthru) { + return passthru; + }; + } + process.stdout.write(cb(this.helpInformation())); + this.emit('--help'); +}; + +/** + * Output help information and exit. + * + * @api public + */ + +Command.prototype.help = function(cb) { + this.outputHelp(cb); + process.exit(); +}; + +/** + * Camel-case the given `flag` + * + * @param {String} flag + * @return {String} + * @api private + */ + +function camelcase(flag) { + return flag.split('-').reduce(function(str, word) { + return str + word[0].toUpperCase() + word.slice(1); + }); +} + +/** + * Pad `str` to `width`. + * + * @param {String} str + * @param {Number} width + * @return {String} + * @api private + */ + +function pad(str, width) { + var len = Math.max(0, width - str.length); + return str + Array(len + 1).join(' '); +} + +/** + * Output help information if necessary + * + * @param {Command} command to output help for + * @param {Array} array of options to search for -h or --help + * @api private + */ + +function outputHelpIfNecessary(cmd, options) { + options = options || []; + for (var i = 0; i < options.length; i++) { + if (options[i] === '--help' || options[i] === '-h') { + cmd.outputHelp(); + process.exit(0); + } + } +} + +/** + * Takes an argument an returns its human readable equivalent for help usage. + * + * @param {Object} arg + * @return {String} + * @api private + */ + +function humanReadableArgName(arg) { + var nameOutput = arg.name + (arg.variadic === true ? '...' : ''); + + return arg.required + ? '<' + nameOutput + '>' + : '[' + nameOutput + ']'; +} + +// for versions before node v0.8 when there weren't `fs.existsSync` +function exists(file) { + try { + if (fs.statSync(file).isFile()) { + return true; + } + } catch (e) { + return false; + } +} diff --git a/node_modules/github-linguist/node_modules/commander/package.json b/node_modules/github-linguist/node_modules/commander/package.json new file mode 100644 index 0000000000..8b14f0069c --- /dev/null +++ b/node_modules/github-linguist/node_modules/commander/package.json @@ -0,0 +1,38 @@ +{ + "name": "commander", + "version": "2.20.3", + "description": "the complete solution for node.js command-line programs", + "keywords": [ + "commander", + "command", + "option", + "parser" + ], + "author": "TJ Holowaychuk ", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/tj/commander.js.git" + }, + "scripts": { + "lint": "eslint index.js", + "test": "node test/run.js && npm run test-typings", + "test-typings": "tsc -p tsconfig.json" + }, + "main": "index", + "files": [ + "index.js", + "typings/index.d.ts" + ], + "dependencies": {}, + "devDependencies": { + "@types/node": "^12.7.8", + "eslint": "^6.4.0", + "should": "^13.2.3", + "sinon": "^7.5.0", + "standard": "^14.3.1", + "ts-node": "^8.4.1", + "typescript": "^3.6.3" + }, + "typings": "typings/index.d.ts" +} \ No newline at end of file diff --git a/node_modules/github-linguist/node_modules/commander/typings/index.d.ts b/node_modules/github-linguist/node_modules/commander/typings/index.d.ts new file mode 100644 index 0000000000..bcda2771ef --- /dev/null +++ b/node_modules/github-linguist/node_modules/commander/typings/index.d.ts @@ -0,0 +1,310 @@ +// Type definitions for commander 2.11 +// Project: https://github.com/visionmedia/commander.js +// Definitions by: Alan Agius , Marcelo Dezem , vvakame , Jules Randolph +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace local { + + class Option { + flags: string; + required: boolean; + optional: boolean; + bool: boolean; + short?: string; + long: string; + description: string; + + /** + * Initialize a new `Option` with the given `flags` and `description`. + * + * @param {string} flags + * @param {string} [description] + */ + constructor(flags: string, description?: string); + } + + class Command extends NodeJS.EventEmitter { + [key: string]: any; + + args: string[]; + + /** + * Initialize a new `Command`. + * + * @param {string} [name] + */ + constructor(name?: string); + + /** + * Set the program version to `str`. + * + * This method auto-registers the "-V, --version" flag + * which will print the version number when passed. + * + * @param {string} str + * @param {string} [flags] + * @returns {Command} for chaining + */ + version(str: string, flags?: string): Command; + + /** + * Add command `name`. + * + * The `.action()` callback is invoked when the + * command `name` is specified via __ARGV__, + * and the remaining arguments are applied to the + * function for access. + * + * When the `name` is "*" an un-matched command + * will be passed as the first arg, followed by + * the rest of __ARGV__ remaining. + * + * @example + * program + * .version('0.0.1') + * .option('-C, --chdir ', 'change the working directory') + * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') + * .option('-T, --no-tests', 'ignore test hook') + * + * program + * .command('setup') + * .description('run remote setup commands') + * .action(function() { + * console.log('setup'); + * }); + * + * program + * .command('exec ') + * .description('run the given remote command') + * .action(function(cmd) { + * console.log('exec "%s"', cmd); + * }); + * + * program + * .command('teardown [otherDirs...]') + * .description('run teardown commands') + * .action(function(dir, otherDirs) { + * console.log('dir "%s"', dir); + * if (otherDirs) { + * otherDirs.forEach(function (oDir) { + * console.log('dir "%s"', oDir); + * }); + * } + * }); + * + * program + * .command('*') + * .description('deploy the given env') + * .action(function(env) { + * console.log('deploying "%s"', env); + * }); + * + * program.parse(process.argv); + * + * @param {string} name + * @param {string} [desc] for git-style sub-commands + * @param {CommandOptions} [opts] command options + * @returns {Command} the new command + */ + command(name: string, desc?: string, opts?: commander.CommandOptions): Command; + + /** + * Define argument syntax for the top-level command. + * + * @param {string} desc + * @returns {Command} for chaining + */ + arguments(desc: string): Command; + + /** + * Parse expected `args`. + * + * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. + * + * @param {string[]} args + * @returns {Command} for chaining + */ + parseExpectedArgs(args: string[]): Command; + + /** + * Register callback `fn` for the command. + * + * @example + * program + * .command('help') + * .description('display verbose help') + * .action(function() { + * // output help here + * }); + * + * @param {(...args: any[]) => void} fn + * @returns {Command} for chaining + */ + action(fn: (...args: any[]) => void): Command; + + /** + * Define option with `flags`, `description` and optional + * coercion `fn`. + * + * The `flags` string should contain both the short and long flags, + * separated by comma, a pipe or space. The following are all valid + * all will output this way when `--help` is used. + * + * "-p, --pepper" + * "-p|--pepper" + * "-p --pepper" + * + * @example + * // simple boolean defaulting to false + * program.option('-p, --pepper', 'add pepper'); + * + * --pepper + * program.pepper + * // => Boolean + * + * // simple boolean defaulting to true + * program.option('-C, --no-cheese', 'remove cheese'); + * + * program.cheese + * // => true + * + * --no-cheese + * program.cheese + * // => false + * + * // required argument + * program.option('-C, --chdir ', 'change the working directory'); + * + * --chdir /tmp + * program.chdir + * // => "/tmp" + * + * // optional argument + * program.option('-c, --cheese [type]', 'add cheese [marble]'); + * + * @param {string} flags + * @param {string} [description] + * @param {((arg1: any, arg2: any) => void) | RegExp} [fn] function or default + * @param {*} [defaultValue] + * @returns {Command} for chaining + */ + option(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command; + option(flags: string, description?: string, defaultValue?: any): Command; + + /** + * Allow unknown options on the command line. + * + * @param {boolean} [arg] if `true` or omitted, no error will be thrown for unknown options. + * @returns {Command} for chaining + */ + allowUnknownOption(arg?: boolean): Command; + + /** + * Parse `argv`, settings options and invoking commands when defined. + * + * @param {string[]} argv + * @returns {Command} for chaining + */ + parse(argv: string[]): Command; + + /** + * Parse options from `argv` returning `argv` void of these options. + * + * @param {string[]} argv + * @returns {ParseOptionsResult} + */ + parseOptions(argv: string[]): commander.ParseOptionsResult; + + /** + * Return an object containing options as key-value pairs + * + * @returns {{[key: string]: any}} + */ + opts(): { [key: string]: any }; + + /** + * Set the description to `str`. + * + * @param {string} str + * @param {{[argName: string]: string}} argsDescription + * @return {(Command | string)} + */ + description(str: string, argsDescription?: {[argName: string]: string}): Command; + description(): string; + + /** + * Set an alias for the command. + * + * @param {string} alias + * @return {(Command | string)} + */ + alias(alias: string): Command; + alias(): string; + + /** + * Set or get the command usage. + * + * @param {string} str + * @return {(Command | string)} + */ + usage(str: string): Command; + usage(): string; + + /** + * Set the name of the command. + * + * @param {string} str + * @return {Command} + */ + name(str: string): Command; + + /** + * Get the name of the command. + * + * @return {string} + */ + name(): string; + + /** + * Output help information for this command. + * + * @param {(str: string) => string} [cb] + */ + outputHelp(cb?: (str: string) => string): void; + + /** Output help information and exit. + * + * @param {(str: string) => string} [cb] + */ + help(cb?: (str: string) => string): never; + } + +} + +declare namespace commander { + + type Command = local.Command + + type Option = local.Option + + interface CommandOptions { + noHelp?: boolean; + isDefault?: boolean; + } + + interface ParseOptionsResult { + args: string[]; + unknown: string[]; + } + + interface CommanderStatic extends Command { + Command: typeof local.Command; + Option: typeof local.Option; + CommandOptions: CommandOptions; + ParseOptionsResult: ParseOptionsResult; + } + +} + +declare const commander: commander.CommanderStatic; +export = commander; diff --git a/node_modules/github-linguist/node_modules/globby/index.js b/node_modules/github-linguist/node_modules/globby/index.js new file mode 100644 index 0000000000..587a0fdd1c --- /dev/null +++ b/node_modules/github-linguist/node_modules/globby/index.js @@ -0,0 +1,88 @@ +'use strict'; +var Promise = require('pinkie-promise'); +var arrayUnion = require('array-union'); +var objectAssign = require('object-assign'); +var glob = require('glob'); +var pify = require('pify'); + +var globP = pify(glob, Promise).bind(glob); + +function isNegative(pattern) { + return pattern[0] === '!'; +} + +function isString(value) { + return typeof value === 'string'; +} + +function assertPatternsInput(patterns) { + if (!patterns.every(isString)) { + throw new TypeError('patterns must be a string or an array of strings'); + } +} + +function generateGlobTasks(patterns, opts) { + patterns = [].concat(patterns); + assertPatternsInput(patterns); + + var globTasks = []; + + opts = objectAssign({ + cache: Object.create(null), + statCache: Object.create(null), + realpathCache: Object.create(null), + symlinks: Object.create(null), + ignore: [] + }, opts); + + patterns.forEach(function (pattern, i) { + if (isNegative(pattern)) { + return; + } + + var ignore = patterns.slice(i).filter(isNegative).map(function (pattern) { + return pattern.slice(1); + }); + + globTasks.push({ + pattern: pattern, + opts: objectAssign({}, opts, { + ignore: opts.ignore.concat(ignore) + }) + }); + }); + + return globTasks; +} + +module.exports = function (patterns, opts) { + var globTasks; + + try { + globTasks = generateGlobTasks(patterns, opts); + } catch (err) { + return Promise.reject(err); + } + + return Promise.all(globTasks.map(function (task) { + return globP(task.pattern, task.opts); + })).then(function (paths) { + return arrayUnion.apply(null, paths); + }); +}; + +module.exports.sync = function (patterns, opts) { + var globTasks = generateGlobTasks(patterns, opts); + + return globTasks.reduce(function (matches, task) { + return arrayUnion(matches, glob.sync(task.pattern, task.opts)); + }, []); +}; + +module.exports.generateGlobTasks = generateGlobTasks; + +module.exports.hasMagic = function (patterns, opts) { + return [].concat(patterns).some(function (pattern) { + return glob.hasMagic(pattern, opts); + }); +}; diff --git a/node_modules/github-linguist/node_modules/globby/license b/node_modules/github-linguist/node_modules/globby/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/node_modules/github-linguist/node_modules/globby/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/github-linguist/node_modules/globby/package.json b/node_modules/github-linguist/node_modules/globby/package.json new file mode 100644 index 0000000000..12b3d364fb --- /dev/null +++ b/node_modules/github-linguist/node_modules/globby/package.json @@ -0,0 +1,69 @@ +{ + "name": "globby", + "version": "6.1.0", + "description": "Extends `glob` with support for multiple patterns and exposes a Promise API", + "license": "MIT", + "repository": "sindresorhus/globby", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "bench": "npm update glob-stream && matcha bench.js", + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "all", + "array", + "directories", + "dirs", + "expand", + "files", + "filesystem", + "filter", + "find", + "fnmatch", + "folders", + "fs", + "glob", + "globbing", + "globs", + "gulpfriendly", + "match", + "matcher", + "minimatch", + "multi", + "multiple", + "paths", + "pattern", + "patterns", + "traverse", + "util", + "utility", + "wildcard", + "wildcards", + "promise" + ], + "dependencies": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "devDependencies": { + "ava": "*", + "glob-stream": "gulpjs/glob-stream#master", + "globby": "sindresorhus/globby#master", + "matcha": "^0.7.0", + "rimraf": "^2.2.8", + "xo": "^0.16.0" + } +} \ No newline at end of file diff --git a/node_modules/github-linguist/node_modules/globby/readme.md b/node_modules/github-linguist/node_modules/globby/readme.md new file mode 100644 index 0000000000..e10a48868f --- /dev/null +++ b/node_modules/github-linguist/node_modules/globby/readme.md @@ -0,0 +1,88 @@ +# globby [![Build Status](https://travis-ci.org/sindresorhus/globby.svg?branch=master)](https://travis-ci.org/sindresorhus/globby) + +> Extends [glob](https://github.com/isaacs/node-glob) with support for multiple patterns and exposes a Promise API + + +## Install + +``` +$ npm install --save globby +``` + + +## Usage + +``` +├── unicorn +├── cake +└── rainbow +``` + +```js +const globby = require('globby'); + +globby(['*', '!cake']).then(paths => { + console.log(paths); + //=> ['unicorn', 'rainbow'] +}); +``` + + +## API + +### globby(patterns, [options]) + +Returns a Promise for an array of matching paths. + +### globby.sync(patterns, [options]) + +Returns an array of matching paths. + +### globby.generateGlobTasks(patterns, [options]) + +Returns an array of objects in the format `{ pattern: string, opts: Object }`, which can be passed as arguments to [`node-glob`](https://github.com/isaacs/node-glob). This is useful for other globbing-related packages. + +Note that you should avoid running the same tasks multiple times as they contain a file system cache. Instead, run this method each time to ensure file system changes are taken into consideration. + +### globby.hasMagic(patterns, [options]) + +Returns a `boolean` of whether there are any special glob characters in the `patterns`. + +Note that the options affect the results. If `noext: true` is set, then `+(a|b)` will not be considered a magic pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`, then that is considered magical, unless `nobrace: true` is set. + +#### patterns + +Type: `string` `Array` + +See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage). + +#### options + +Type: `Object` + +See the `node-glob` [options](https://github.com/isaacs/node-glob#options). + + +## Globbing patterns + +Just a quick overview. + +- `*` matches any number of characters, but not `/` +- `?` matches a single character, but not `/` +- `**` matches any number of characters, including `/`, as long as it's the only thing in a path part +- `{}` allows for a comma-separated list of "or" expressions +- `!` at the beginning of a pattern will negate the match + +[Various patterns and expected matches.](https://github.com/sindresorhus/multimatch/blob/master/test.js) + + +## Related + +- [multimatch](https://github.com/sindresorhus/multimatch) - Match against a list instead of the filesystem +- [glob-stream](https://github.com/wearefractal/glob-stream) - Streaming alternative +- [matcher](https://github.com/sindresorhus/matcher) - Simple wildcard matching + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/github-linguist/node_modules/pify/index.js b/node_modules/github-linguist/node_modules/pify/index.js new file mode 100644 index 0000000000..7c720ebee8 --- /dev/null +++ b/node_modules/github-linguist/node_modules/pify/index.js @@ -0,0 +1,68 @@ +'use strict'; + +var processFn = function (fn, P, opts) { + return function () { + var that = this; + var args = new Array(arguments.length); + + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + return new P(function (resolve, reject) { + args.push(function (err, result) { + if (err) { + reject(err); + } else if (opts.multiArgs) { + var results = new Array(arguments.length - 1); + + for (var i = 1; i < arguments.length; i++) { + results[i - 1] = arguments[i]; + } + + resolve(results); + } else { + resolve(result); + } + }); + + fn.apply(that, args); + }); + }; +}; + +var pify = module.exports = function (obj, P, opts) { + if (typeof P !== 'function') { + opts = P; + P = Promise; + } + + opts = opts || {}; + opts.exclude = opts.exclude || [/.+Sync$/]; + + var filter = function (key) { + var match = function (pattern) { + return typeof pattern === 'string' ? key === pattern : pattern.test(key); + }; + + return opts.include ? opts.include.some(match) : !opts.exclude.some(match); + }; + + var ret = typeof obj === 'function' ? function () { + if (opts.excludeMain) { + return obj.apply(this, arguments); + } + + return processFn(obj, P, opts).apply(this, arguments); + } : {}; + + return Object.keys(obj).reduce(function (ret, key) { + var x = obj[key]; + + ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x; + + return ret; + }, ret); +}; + +pify.all = pify; diff --git a/node_modules/github-linguist/node_modules/pify/license b/node_modules/github-linguist/node_modules/pify/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/node_modules/github-linguist/node_modules/pify/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/github-linguist/node_modules/pify/package.json b/node_modules/github-linguist/node_modules/pify/package.json new file mode 100644 index 0000000000..279aa197ff --- /dev/null +++ b/node_modules/github-linguist/node_modules/pify/package.json @@ -0,0 +1,48 @@ +{ + "name": "pify", + "version": "2.3.0", + "description": "Promisify a callback-style function", + "license": "MIT", + "repository": "sindresorhus/pify", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava && npm run optimization-test", + "optimization-test": "node --allow-natives-syntax optimization-test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "promise", + "promises", + "promisify", + "denodify", + "denodeify", + "callback", + "cb", + "node", + "then", + "thenify", + "convert", + "transform", + "wrap", + "wrapper", + "bind", + "to", + "async", + "es2015" + ], + "devDependencies": { + "ava": "*", + "pinkie-promise": "^1.0.0", + "v8-natives": "0.0.2", + "xo": "*" + } +} \ No newline at end of file diff --git a/node_modules/github-linguist/node_modules/pify/readme.md b/node_modules/github-linguist/node_modules/pify/readme.md new file mode 100644 index 0000000000..c79ca8bf64 --- /dev/null +++ b/node_modules/github-linguist/node_modules/pify/readme.md @@ -0,0 +1,119 @@ +# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify) + +> Promisify a callback-style function + + +## Install + +``` +$ npm install --save pify +``` + + +## Usage + +```js +const fs = require('fs'); +const pify = require('pify'); + +// promisify a single function + +pify(fs.readFile)('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); + +// or promisify all methods in a module + +pify(fs).readFile('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); +``` + + +## API + +### pify(input, [promiseModule], [options]) + +Returns a promise wrapped version of the supplied function or module. + +#### input + +Type: `function`, `object` + +Callback-style function or module whose methods you want to promisify. + +#### promiseModule + +Type: `function` + +Custom promise module to use instead of the native one. + +Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill. + +#### options + +##### multiArgs + +Type: `boolean` +Default: `false` + +By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. + +```js +const request = require('request'); +const pify = require('pify'); + +pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => { + const [httpResponse, body] = result; +}); +``` + +##### include + +Type: `array` of (`string`|`regex`) + +Methods in a module to promisify. Remaining methods will be left untouched. + +##### exclude + +Type: `array` of (`string`|`regex`) +Default: `[/.+Sync$/]` + +Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default. + +##### excludeMain + +Type: `boolean` +Default: `false` + +By default, if given module is a function itself, this function will be promisified. Turn this option on if you want to promisify only methods of the module. + +```js +const pify = require('pify'); + +function fn() { + return true; +} + +fn.method = (data, callback) => { + setImmediate(() => { + callback(data, null); + }); +}; + +// promisify methods but not fn() +const promiseFn = pify(fn, {excludeMain: true}); + +if (promiseFn()) { + promiseFn.method('hi').then(data => { + console.log(data); + }); +} +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/github-linguist/package.json b/node_modules/github-linguist/package.json new file mode 100644 index 0000000000..232314fb6e --- /dev/null +++ b/node_modules/github-linguist/package.json @@ -0,0 +1,66 @@ +{ + "name": "github-linguist", + "version": "2.3.0", + "description": "A tool to count lines of code in a repository powered by github-linguist langauge mappings.", + "keywords": [ + "loc", + "cloc", + "linguist", + "umijs", + "lines of code" + ], + "homepage": "https://github.com/aeisenberg/linguist#readme", + "bugs": { + "url": "https://github.com/aeisenberg/linguist/issues" + }, + "bin": { + "loc": "dist/cli.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/aeisenberg/linguist.git" + }, + "license": "MIT", + "authors": [ + "ephoton (https://github.com/ephoton)", + "chenshuai2144 (https://github.com/chenshuai2144)", + "Andrew Eisenberg (https://github.com/aeisenberg)" + ], + "main": "dist/index.js", + "typings": "dist/index.d.ts", + "directories": { + "test": "test" + }, + "scripts": { + "build": "tsc -d", + "lint": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src", + "prettier": "prettier -c --write \"**/*\"", + "prepublishOnly": "npm run build", + "test": "umi-test" + }, + "dependencies": { + "chalk": "^2.2.0", + "commander": "^2.11.0", + "fs-extra": "^4.0.3", + "globby": "^6.1.0", + "language-map": "^1.3.0", + "slash2": "^2.0.0" + }, + "devDependencies": { + "@types/chai": "^4.0.4", + "@types/chalk": "^0.4.31", + "@types/commander": "^2.11.0", + "@types/fs-extra": "^4.0.2", + "@types/globby": "^6.1.0", + "@types/jest": "^25.1.5", + "@types/mocha": "^2.2.43", + "@types/node": "^8.0.45", + "@umijs/fabric": "^2.0.7", + "chai": "^4.1.2", + "coveralls": "^3.0.0", + "eslint": "^6.8.0", + "prettier": "^2.0.2", + "typescript": "^3.8.3", + "umi-test": "^1.9.6" + } +} \ No newline at end of file diff --git a/node_modules/github-linguist/src/cli.ts b/node_modules/github-linguist/src/cli.ts new file mode 100644 index 0000000000..083085dbf3 --- /dev/null +++ b/node_modules/github-linguist/src/cli.ts @@ -0,0 +1,69 @@ +#!/usr/bin/env node + +import chalk from 'chalk'; +import program from 'commander'; +// @ts-ignore +import slash from 'slash2'; +import path from 'path'; + +import { LocDir } from './directory'; +import { LocFile, LineInfo } from './file'; +import { getVersion } from './utils'; + +program + .version(getVersion(), '-v') + .command('file ') + .description('count lines of code in a file') + .action(async (pathPattern) => { + try { + const info = await (new LocFile(pathPattern).getFileInfo()); + // eslint-disable-next-line no-console + console.log( + chalk.cyan(` + path: \t\t${pathPattern} + language: \t${info.languages} + total lines: \t${String(info.lines.total)} + code lines: \t${String(info.lines.code)} + comment lines: \t${String(info.lines.comment)} + `), + ); + } catch (e) { + console.error(e); + console.error(e.stacl); + } + }); + +const formatInfo = ( + info: LineInfo, + languages: { + [key: string]: LineInfo & { + sum: number; + }; + }, +) => ` + \ttotal lines: \t${String(info.total)} + \tcode lines: \t${String(info.code)} + \tcomment lines: \t${String(info.comment)} + \t--------------------${Object.keys(languages) + .map((key) => { + const languageInfo = languages[key]; + return `\n\t${key.padEnd(10)} \t file count:${String(languageInfo.sum)} \ttotal:${String( + languageInfo.total, + )} \tcomment:${String(languageInfo.comment)} \tcode:${String(languageInfo.code)}`; + }) + .join('')}`; + +program.arguments(' [env]').action(async (cmd) => { + try { + const { info, languages } = await (new LocDir({ + include: cmd + }).loadInfo()); + // eslint-disable-next-line no-console + console.log(chalk.cyan(formatInfo(info, languages))); + } catch (e) { + console.error(e); + console.error(e.stacl); + } +}); + +program.parse(process.argv); diff --git a/node_modules/github-linguist/src/directory.ts b/node_modules/github-linguist/src/directory.ts new file mode 100644 index 0000000000..315d283931 --- /dev/null +++ b/node_modules/github-linguist/src/directory.ts @@ -0,0 +1,127 @@ +import globby from 'globby'; +import fs from 'fs-extra'; +import path from 'path'; +// @ts-ignore +import slash from 'slash2'; + +import { LineInfo, LocFile } from './file'; + +const defaultInfo: LineInfo = { + total: 0, + code: 0, + comment: 0, +}; + +export interface LocDirOptions { + cwd?: string; + include?: string[] | string; + exclude?: string[] | string; +} + +export interface LocResult { + files: string[]; + info: LineInfo; + languages: { + [key: string]: LineInfo & { + sum: number; + }; + }; +} + +const defaultExclude = [ + // javascript + '**/*.map', + '**/yarn**', + '**/.github', + '**/node_modules/**', + '**/dist/**', + '**/*.snap', + + // java + '**/target' +]; + +/** + * Collect the info of a directory. + */ +export class LocDir { + private cwd: string; + private include: string[]; + private exclude: string[]; + + constructor(options: LocDirOptions) { + + // ensure all excludes are globstar. Note that '**/*.ts/**' matches files + // that end in .ts because the globstar indicates 0 or more directory paths. + this.exclude = ensureArray(options.exclude) + .concat(defaultExclude) + .map(item => item.endsWith('**') ? item : `${item}/**`); + + // remove all leading './' since this messes up globstar matches in the + // excludes. + this.include = ensureArray(options.include, '**') + .map(item => item.startsWith('./') ? item.substring(2) : item) + .map(item => item.endsWith('**') ? item : `${item}/**`); + this.cwd = options.cwd || process.cwd(); + } + + /** + * Calculate directory info. + */ + async loadInfo(): Promise { + const paths = await globby(this.include, { + cwd: this.cwd, + ignore: this.exclude, + nodir: true + }); + const files: string[] = []; + const info: LineInfo = { ...defaultInfo }; + let languages: { + [key: string]: LineInfo & { + sum: number; + }; + } = {}; + + await Promise.all(paths.map(async (pathItem) => { + const fullPath = slash(path.join(this.cwd, pathItem)); + if ( + !pathItem || + !(await fs.pathExists(fullPath)) || + (await fs.stat(fullPath)).isDirectory() + ) { + return; + } + const file = new LocFile(fullPath); + const fileLineInfo = await file.getFileInfo(); + const { lines } = fileLineInfo; + info.total += lines.total; + info.code += lines.code; + info.comment += lines.comment; + const language = { ...languages[fileLineInfo.languages] }; + language.code = lines.code + (language.code || 0); + language.sum = (language.sum || 0) + 1; + language.comment = lines.comment + (language.comment || 0); + language.total = lines.total + (language.total || 0); + languages = { + ...languages, + [fileLineInfo.languages]: language, + }; + files.push(fullPath); + })); + + return { + files, + info, + languages, + }; + } +} + +function ensureArray(arr?: string[] | string, dfault?: string) { + if (!arr) { + return dfault ? [dfault] : []; + } + return Array.isArray(arr) + ? arr + : [arr]; +} diff --git a/node_modules/github-linguist/src/file.ts b/node_modules/github-linguist/src/file.ts new file mode 100644 index 0000000000..0c3c2e1d27 --- /dev/null +++ b/node_modules/github-linguist/src/file.ts @@ -0,0 +1,179 @@ +/** + * detect file info + */ + +import * as fs from 'fs-extra'; +import * as Path from 'path'; +// @ts-ignore +import slash from 'slash2'; + +import { Languages, Regexes } from './languages'; + +export interface LineInfo { + total: number; + code: number; + comment: number; +} + +export interface FileInfo { + name: string; + languages: string; + size: number; + lines: LineInfo; +} + +const DefaultLine: LineInfo = { + total: 0, + code: 0, + comment: 0, +}; + +const DefaultFileInfo: FileInfo = { + name: '', + languages: '', + size: 0, + lines: DefaultLine, +}; + +/** + * Collect language info for a single file + */ +export class LocFile { + public path: string; + private rawPath: string; + + private language = new Languages(); + + /** + * Creates an instance of LocFile. + */ + constructor(rawPath: string, private debug = false) { + this.path = slash(rawPath); + this.rawPath = rawPath; + } + + /** + * get file type through a path + */ + private getType(path: string): string { + const fileExtension = `.${path.split('.').pop()}`; + return this.language.extensionMap[fileExtension] || ''; + } + + private filterData = (data: string, regexes: Regexes): LineInfo => { + const lines = data.split(/\n/); + let commentLength = 0; + let codeLength = lines.length; + const total = codeLength; + + let inMultiLineComment = false; + lines.forEach((line) => { + + let lineType = 'code'; + line = line.trim(); + + if (inMultiLineComment) { + + let noCode = true; + if (regexes.multiLineCommentClose.test(line)) { + // line contains the end of a multi-line comment + inMultiLineComment = false; + if (!regexes.multiLineCommentCloseEnd.test(line)) { + // the multiline comment does not end this line. + // there is real code on it. + noCode = false; + } + } + + if (noCode) { + lineType = 'comm'; + commentLength += 1; + codeLength -= 1; + } + + } else if (line) { + + // non-empty line + if (regexes.multiLineCommentOpen.test(line)) { + // line contains the start of a multi-line comment + // might contain some real code, but we'll let that slide + + if (!regexes.multiLineCommentOpenAndClose.test(line)) { + // comment is not also closed on this line + inMultiLineComment = true; + } + + if (regexes.multiLineCommentOpenStart.test(line)) { + // The comment starts the line. There is no other code on this line + commentLength += 1; + codeLength -= 1; + lineType = 'comm'; + } + + } else if (regexes.singleLineComment.test(line)) { + // line contains only a single line comment + commentLength += 1; + codeLength -= 1; + lineType = 'comm'; + } + + } else { + // empty line + codeLength -= 1; + lineType = 'empt'; + } + + if (this.debug) { + console.log(lineType, line) + } + }); + + return { + ...DefaultLine, + total, + code: codeLength, + comment: commentLength, + }; + }; + + /** + * Get file info when LocFile init + */ + public async getFileInfo(data?: string): Promise { + if (!(await fs.pathExists(this.rawPath))) { + throw new Error(`Error: file ${this.rawPath} does not exist.`); + } + + let newData = data; + const info: FileInfo = Object.assign({}, DefaultFileInfo); + const name = this.path.split(Path.sep).pop() || ''; + try { + const stat = await fs.stat(this.path); + if (!stat.isFile()) { + return info; + } + newData = data || await fs.readFile(this.path, 'utf-8'); + info.name = name; + info.size = (stat && stat.size) || 0; + info.languages = this.getType(this.path); + if (!info.languages) { + return info; + } + if (newData) { + const regexes = this.language.getRegexes(info.languages); + info.lines = this.filterData(newData, regexes); + } + } catch (err) { + throw new Error('read file failed.'); + } + return info; + } + + public getFileInfoByContent(name: string, data: string): FileInfo { + const info: FileInfo = Object.assign({}, DefaultFileInfo); + info.name = name; + info.languages = this.getType(name); + info.lines = this.filterData(data, this.language.getRegexes(info.languages)); + return info; + } +} diff --git a/node_modules/github-linguist/src/index.ts b/node_modules/github-linguist/src/index.ts new file mode 100644 index 0000000000..8e5674da97 --- /dev/null +++ b/node_modules/github-linguist/src/index.ts @@ -0,0 +1,29 @@ +// @ts-ignore +import slash from 'slash2'; +import fs from 'fs-extra'; + +import { LocDir, LocResult } from './directory'; +import { LocFile } from './file'; + +export { LocDir, LocDirOptions } from './directory'; +export { LocFile, LineInfo } from './file'; + +const loc = async ( + fileOrDir: string, +): Promise => { + const stat = await fs.stat(slash(fileOrDir)); + if (stat.isFile()) { + const locFile = new LocFile(slash(fileOrDir)); + const info = await locFile.getFileInfo(); + const filePath = locFile.path; + return { + info: info.lines, + files: [filePath], + languages: { [info.languages]: { ...info.lines, sum: 1 } }, + }; + } + const locDir = new LocDir({ cwd: slash(fileOrDir) }); + return locDir.loadInfo(); +}; + +export default loc; diff --git a/node_modules/github-linguist/src/justify.json b/node_modules/github-linguist/src/justify.json new file mode 100644 index 0000000000..12f5e47d04 --- /dev/null +++ b/node_modules/github-linguist/src/justify.json @@ -0,0 +1,4 @@ +{ + ".ts": "typescript", + ".tsx": "tsx" +} diff --git a/node_modules/github-linguist/src/languages.ts b/node_modules/github-linguist/src/languages.ts new file mode 100644 index 0000000000..bbd108f970 --- /dev/null +++ b/node_modules/github-linguist/src/languages.ts @@ -0,0 +1,176 @@ +import { ExtensionJustify } from './utils'; + +// tslint:disable-next-line +const languageMap = require('language-map'); +// tslint:disable-next-line +// const lang = require('language-classifier'); + +interface ExtensionsTypes { + [key: string]: string; +} + +export interface DetectorOptions {} + +/** + * detecte program language through file extension + * + * @export + * @class LanguageDetector + */ +export class Languages { + extensionMap: { + [key: string]: string; + } = {}; + + /** + * Creates an instance of Detector. + */ + constructor() { + this.extensionMap = this.loadExtensionMap(); + } + + /** + * load language before detecting + */ + private loadExtensionMap = () => { + const extensions: ExtensionsTypes = {}; + + Object.keys(languageMap).forEach((language) => { + const languageMode = languageMap[language]; + const languageExtensions = (languageMode && languageMode.extensions) || []; + languageExtensions.forEach((extension: string) => { + extensions[extension.toLowerCase()] = language.toLowerCase(); + }); + }); + + return Object.assign({}, extensions, ExtensionJustify); + } + + /** + * Retrieve the regular expressions for a given language. + * This is incomplete, but covers most of the languages we + * see in the wild. + * + * @param language the language to retrieve regexes for + */ + public getRegexes(language: string): Regexes { + switch(language) { + case 'html': + case 'xml': + return ALL_REGEXES.html; + + case 'ruby': + return ALL_REGEXES.ruby; + + case 'python': + return ALL_REGEXES.python; + + default: + // not exact, but likely the best guess for any other unspecified language. + return ALL_REGEXES.c; + } + } + + /** + * return extension map + */ + public getExtensionMap() { + return this.extensionMap; + } +} + +export interface Regexes { + singleLineComment: RegExp; + multiLineCommentOpen: RegExp; + multiLineCommentOpenStart: RegExp; + multiLineCommentClose: RegExp; + multiLineCommentCloseEnd: RegExp; + multiLineCommentOpenAndClose: RegExp; +} + +const ALL_REGEXES: Record = { + c: { + // matches when // are the first two characters of a line + singleLineComment: /^\/\//, + + // matches when /* exists in a line + multiLineCommentOpen: /\/\*/, + + // matches when /* starts a line + multiLineCommentOpenStart: /^\/\*/, + + // matches when */ exists a line + multiLineCommentClose: /\*\//, + + // matches when */ ends a line + multiLineCommentCloseEnd: /\*\/$/, + + // matches /* ... */ + multiLineCommentOpenAndClose: /\/\*.*\*\// + }, + + python: { + // matches when # the first character of a line + singleLineComment: /^#/, + + // matches when """ starts a line. This is not right, since + // a multiline string is not always a comment, but for the + // sake of simplicity, we will do that here. + multiLineCommentOpen: /"""/, + + // matches when """ starts a line + multiLineCommentOpenStart: /^"""/, + + // matches when """ exists in a line + multiLineCommentClose: /"""/, + + // matches when """ ends a line + multiLineCommentCloseEnd: /"""$/, + + // matches """ ... """ + multiLineCommentOpenAndClose: /""".*"""/ + }, + + ruby: { + // matches when # the first character of a line + singleLineComment: /^#/, + + // For ruby multiline comments, =begin and =end must be + // on their own lines + + // matches when =begin starts a line + multiLineCommentOpen: /^=begin/, + + // matches when "begin starts a line + multiLineCommentOpenStart: /^=begin/, + + // matches when "end ends a line + multiLineCommentClose: /^=end/, + + // matches when "end ends a line + multiLineCommentCloseEnd: /^=end$/, + + // not possible in ruby + multiLineCommentOpenAndClose: /^\0$/ + }, + + html: { + // There is no single line comment + singleLineComment: /^\0$/, + + // matches when =begin starts a line + multiLineCommentOpen: //, + + // matches when "end ends a line + multiLineCommentCloseEnd: /-->$/, + + // matches + multiLineCommentOpenAndClose: // + } +}; diff --git a/node_modules/github-linguist/src/utils.ts b/node_modules/github-linguist/src/utils.ts new file mode 100644 index 0000000000..d89ed9e23e --- /dev/null +++ b/node_modules/github-linguist/src/utils.ts @@ -0,0 +1,25 @@ +import fs from 'fs'; +import path from 'path'; +// @ts-ignore +import slash from 'slash2'; + +const packagePath = slash(path.join(__dirname, '../', 'package.json')); + +/** + * Get package version. + * + * @export getVersion + * @returns {string} + */ +export function getVersion(): string { + const packageInfo = JSON.parse(fs.readFileSync(packagePath, 'utf8')); + + return (packageInfo && packageInfo.version) || 'invalid version!'; +} + +export const ExtensionJustify = { + '.ts': 'typescript', + '.jsx': 'javascript', + '.js': 'javascript', + '.tsx': 'typescript', +}; diff --git a/node_modules/github-linguist/tsconfig.json b/node_modules/github-linguist/tsconfig.json new file mode 100644 index 0000000000..1cce1d1ccd --- /dev/null +++ b/node_modules/github-linguist/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "target": "es2018", + "noImplicitAny": true, + "moduleResolution": "node", + "outDir": "dist", + "baseUrl": ".", + "useDefineForClassFields": true, + "skipLibCheck": true, + "sourceMap": true, + "paths": { + "*": ["node_modules/*", "src/types/*"] + } + }, + "include": ["src/**/*"] +} diff --git a/node_modules/jsonfile/CHANGELOG.md b/node_modules/jsonfile/CHANGELOG.md new file mode 100644 index 0000000000..7718857abd --- /dev/null +++ b/node_modules/jsonfile/CHANGELOG.md @@ -0,0 +1,145 @@ +4.0.0 / 2017-07-12 +------------------ + +- **BREAKING:** Remove global `spaces` option. +- **BREAKING:** Drop support for Node 0.10, 0.12, and io.js. +- Remove undocumented `passParsingErrors` option. +- Added `EOL` override option to `writeFile` when using `spaces`. [#89] + +3.0.1 / 2017-07-05 +------------------ + +- Fixed bug in `writeFile` when there was a serialization error & no callback was passed. In previous versions, an empty file would be written; now no file is written. + +3.0.0 / 2017-04-25 +------------------ + +- Changed behavior of `throws` option for `readFileSync`; now does not throw filesystem errors when `throws` is `false` + +2.4.0 / 2016-09-15 +------------------ +### Changed +- added optional support for `graceful-fs` [#62] + +2.3.1 / 2016-05-13 +------------------ +- fix to support BOM. [#45][#45] + +2.3.0 / 2016-04-16 +------------------ +- add `throws` to `readFile()`. See [#39][#39] +- add support for any arbitrary `fs` module. Useful with [mock-fs](https://www.npmjs.com/package/mock-fs) + +2.2.3 / 2015-10-14 +------------------ +- include file name in parse error. See: https://github.com/jprichardson/node-jsonfile/pull/34 + +2.2.2 / 2015-09-16 +------------------ +- split out tests into separate files +- fixed `throws` when set to `true` in `readFileSync()`. See: https://github.com/jprichardson/node-jsonfile/pull/33 + +2.2.1 / 2015-06-25 +------------------ +- fixed regression when passing in string as encoding for options in `writeFile()` and `writeFileSync()`. See: https://github.com/jprichardson/node-jsonfile/issues/28 + +2.2.0 / 2015-06-25 +------------------ +- added `options.spaces` to `writeFile()` and `writeFileSync()` + +2.1.2 / 2015-06-22 +------------------ +- fixed if passed `readFileSync(file, 'utf8')`. See: https://github.com/jprichardson/node-jsonfile/issues/25 + +2.1.1 / 2015-06-19 +------------------ +- fixed regressions if `null` is passed for options. See: https://github.com/jprichardson/node-jsonfile/issues/24 + +2.1.0 / 2015-06-19 +------------------ +- cleanup: JavaScript Standard Style, rename files, dropped terst for assert +- methods now support JSON revivers/replacers + +2.0.1 / 2015-05-24 +------------------ +- update license attribute https://github.com/jprichardson/node-jsonfile/pull/21 + +2.0.0 / 2014-07-28 +------------------ +* added `\n` to end of file on write. [#14](https://github.com/jprichardson/node-jsonfile/pull/14) +* added `options.throws` to `readFileSync()` +* dropped support for Node v0.8 + +1.2.0 / 2014-06-29 +------------------ +* removed semicolons +* bugfix: passed `options` to `fs.readFile` and `fs.readFileSync`. This technically changes behavior, but +changes it according to docs. [#12][#12] + +1.1.1 / 2013-11-11 +------------------ +* fixed catching of callback bug (ffissore / #5) + +1.1.0 / 2013-10-11 +------------------ +* added `options` param to methods, (seanodell / #4) + +1.0.1 / 2013-09-05 +------------------ +* removed `homepage` field from package.json to remove NPM warning + +1.0.0 / 2013-06-28 +------------------ +* added `.npmignore`, #1 +* changed spacing default from `4` to `2` to follow Node conventions + +0.0.1 / 2012-09-10 +------------------ +* Initial release. + +[#89]: https://github.com/jprichardson/node-jsonfile/pull/89 +[#45]: https://github.com/jprichardson/node-jsonfile/issues/45 "Reading of UTF8-encoded (w/ BOM) files fails" +[#44]: https://github.com/jprichardson/node-jsonfile/issues/44 "Extra characters in written file" +[#43]: https://github.com/jprichardson/node-jsonfile/issues/43 "Prettyfy json when written to file" +[#42]: https://github.com/jprichardson/node-jsonfile/pull/42 "Moved fs.readFileSync within the try/catch" +[#41]: https://github.com/jprichardson/node-jsonfile/issues/41 "Linux: Hidden file not working" +[#40]: https://github.com/jprichardson/node-jsonfile/issues/40 "autocreate folder doesn't work from Path-value" +[#39]: https://github.com/jprichardson/node-jsonfile/pull/39 "Add `throws` option for readFile (async)" +[#38]: https://github.com/jprichardson/node-jsonfile/pull/38 "Update README.md writeFile[Sync] signature" +[#37]: https://github.com/jprichardson/node-jsonfile/pull/37 "support append file" +[#36]: https://github.com/jprichardson/node-jsonfile/pull/36 "Add typescript definition file." +[#35]: https://github.com/jprichardson/node-jsonfile/pull/35 "Add typescript definition file." +[#34]: https://github.com/jprichardson/node-jsonfile/pull/34 "readFile JSON parse error includes filename" +[#33]: https://github.com/jprichardson/node-jsonfile/pull/33 "fix throw->throws typo in readFileSync()" +[#32]: https://github.com/jprichardson/node-jsonfile/issues/32 "readFile & readFileSync can possible have strip-comments as an option?" +[#31]: https://github.com/jprichardson/node-jsonfile/pull/31 "[Modify] Support string include is unicode escape string" +[#30]: https://github.com/jprichardson/node-jsonfile/issues/30 "How to use Jsonfile package in Meteor.js App?" +[#29]: https://github.com/jprichardson/node-jsonfile/issues/29 "writefile callback if no error?" +[#28]: https://github.com/jprichardson/node-jsonfile/issues/28 "writeFile options argument broken " +[#27]: https://github.com/jprichardson/node-jsonfile/pull/27 "Use svg instead of png to get better image quality" +[#26]: https://github.com/jprichardson/node-jsonfile/issues/26 "Breaking change to fs-extra" +[#25]: https://github.com/jprichardson/node-jsonfile/issues/25 "support string encoding param for read methods" +[#24]: https://github.com/jprichardson/node-jsonfile/issues/24 "readFile: Passing in null options with a callback throws an error" +[#23]: https://github.com/jprichardson/node-jsonfile/pull/23 "Add appendFile and appendFileSync" +[#22]: https://github.com/jprichardson/node-jsonfile/issues/22 "Default value for spaces in readme.md is outdated" +[#21]: https://github.com/jprichardson/node-jsonfile/pull/21 "Update license attribute" +[#20]: https://github.com/jprichardson/node-jsonfile/issues/20 "Add simple caching functionallity" +[#19]: https://github.com/jprichardson/node-jsonfile/pull/19 "Add appendFileSync method" +[#18]: https://github.com/jprichardson/node-jsonfile/issues/18 "Add updateFile and updateFileSync methods" +[#17]: https://github.com/jprichardson/node-jsonfile/issues/17 "seem read & write sync has sequentially problem" +[#16]: https://github.com/jprichardson/node-jsonfile/pull/16 "export spaces defaulted to null" +[#15]: https://github.com/jprichardson/node-jsonfile/issues/15 "`jsonfile.spaces` should default to `null`" +[#14]: https://github.com/jprichardson/node-jsonfile/pull/14 "Add EOL at EOF" +[#13]: https://github.com/jprichardson/node-jsonfile/issues/13 "Add a final newline" +[#12]: https://github.com/jprichardson/node-jsonfile/issues/12 "readFile doesn't accept options" +[#11]: https://github.com/jprichardson/node-jsonfile/pull/11 "Added try,catch to readFileSync" +[#10]: https://github.com/jprichardson/node-jsonfile/issues/10 "No output or error from writeFile" +[#9]: https://github.com/jprichardson/node-jsonfile/pull/9 "Change 'js' to 'jf' in example." +[#8]: https://github.com/jprichardson/node-jsonfile/pull/8 "Updated forgotten module.exports to me." +[#7]: https://github.com/jprichardson/node-jsonfile/pull/7 "Add file name in error message" +[#6]: https://github.com/jprichardson/node-jsonfile/pull/6 "Use graceful-fs when possible" +[#5]: https://github.com/jprichardson/node-jsonfile/pull/5 "Jsonfile doesn't behave nicely when used inside a test suite." +[#4]: https://github.com/jprichardson/node-jsonfile/pull/4 "Added options parameter to writeFile and writeFileSync" +[#3]: https://github.com/jprichardson/node-jsonfile/issues/3 "test2" +[#2]: https://github.com/jprichardson/node-jsonfile/issues/2 "homepage field must be a string url. Deleted." +[#1]: https://github.com/jprichardson/node-jsonfile/pull/1 "adding an `.npmignore` file" diff --git a/node_modules/jsonfile/LICENSE b/node_modules/jsonfile/LICENSE new file mode 100644 index 0000000000..cb7e807b9b --- /dev/null +++ b/node_modules/jsonfile/LICENSE @@ -0,0 +1,15 @@ +(The MIT License) + +Copyright (c) 2012-2015, JP Richardson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files +(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jsonfile/README.md b/node_modules/jsonfile/README.md new file mode 100644 index 0000000000..721685c928 --- /dev/null +++ b/node_modules/jsonfile/README.md @@ -0,0 +1,168 @@ +Node.js - jsonfile +================ + +Easily read/write JSON files. + +[![npm Package](https://img.shields.io/npm/v/jsonfile.svg?style=flat-square)](https://www.npmjs.org/package/jsonfile) +[![build status](https://secure.travis-ci.org/jprichardson/node-jsonfile.svg)](http://travis-ci.org/jprichardson/node-jsonfile) +[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-jsonfile/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-jsonfile/branch/master) + +Standard JavaScript + +Why? +---- + +Writing `JSON.stringify()` and then `fs.writeFile()` and `JSON.parse()` with `fs.readFile()` enclosed in `try/catch` blocks became annoying. + + + +Installation +------------ + + npm install --save jsonfile + + + +API +--- + +### readFile(filename, [options], callback) + +`options` (`object`, default `undefined`): Pass in any `fs.readFile` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). + - `throws` (`boolean`, default: `true`). If `JSON.parse` throws an error, pass this error to the callback. + If `false`, returns `null` for the object. + + +```js +var jsonfile = require('jsonfile') +var file = '/tmp/data.json' +jsonfile.readFile(file, function(err, obj) { + console.dir(obj) +}) +``` + + +### readFileSync(filename, [options]) + +`options` (`object`, default `undefined`): Pass in any `fs.readFileSync` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). +- `throws` (`boolean`, default: `true`). If an error is encountered reading or parsing the file, throw the error. If `false`, returns `null` for the object. + +```js +var jsonfile = require('jsonfile') +var file = '/tmp/data.json' + +console.dir(jsonfile.readFileSync(file)) +``` + + +### writeFile(filename, obj, [options], callback) + +`options`: Pass in any `fs.writeFile` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string. + + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, function (err) { + console.error(err) +}) +``` + +**formatting with spaces:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, {spaces: 2}, function(err) { + console.error(err) +}) +``` + +**overriding EOL:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, {spaces: 2, EOL: '\r\n'}, function(err) { + console.error(err) +}) +``` + +**appending to an existing JSON file:** + +You can use `fs.writeFile` option `{flag: 'a'}` to achieve this. + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/mayAlreadyExistedData.json' +var obj = {name: 'JP'} + +jsonfile.writeFile(file, obj, {flag: 'a'}, function (err) { + console.error(err) +}) +``` + +### writeFileSync(filename, obj, [options]) + +`options`: Pass in any `fs.writeFileSync` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string. + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj) +``` + +**formatting with spaces:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj, {spaces: 2}) +``` + +**overriding EOL:** + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/data.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj, {spaces: 2, EOL: '\r\n'}) +``` + +**appending to an existing JSON file:** + +You can use `fs.writeFileSync` option `{flag: 'a'}` to achieve this. + +```js +var jsonfile = require('jsonfile') + +var file = '/tmp/mayAlreadyExistedData.json' +var obj = {name: 'JP'} + +jsonfile.writeFileSync(file, obj, {flag: 'a'}) +``` + +License +------- + +(MIT License) + +Copyright 2012-2016, JP Richardson diff --git a/node_modules/jsonfile/index.js b/node_modules/jsonfile/index.js new file mode 100644 index 0000000000..d1e5827ca9 --- /dev/null +++ b/node_modules/jsonfile/index.js @@ -0,0 +1,134 @@ +var _fs +try { + _fs = require('graceful-fs') +} catch (_) { + _fs = require('fs') +} + +function readFile (file, options, callback) { + if (callback == null) { + callback = options + options = {} + } + + if (typeof options === 'string') { + options = {encoding: options} + } + + options = options || {} + var fs = options.fs || _fs + + var shouldThrow = true + if ('throws' in options) { + shouldThrow = options.throws + } + + fs.readFile(file, options, function (err, data) { + if (err) return callback(err) + + data = stripBom(data) + + var obj + try { + obj = JSON.parse(data, options ? options.reviver : null) + } catch (err2) { + if (shouldThrow) { + err2.message = file + ': ' + err2.message + return callback(err2) + } else { + return callback(null, null) + } + } + + callback(null, obj) + }) +} + +function readFileSync (file, options) { + options = options || {} + if (typeof options === 'string') { + options = {encoding: options} + } + + var fs = options.fs || _fs + + var shouldThrow = true + if ('throws' in options) { + shouldThrow = options.throws + } + + try { + var content = fs.readFileSync(file, options) + content = stripBom(content) + return JSON.parse(content, options.reviver) + } catch (err) { + if (shouldThrow) { + err.message = file + ': ' + err.message + throw err + } else { + return null + } + } +} + +function stringify (obj, options) { + var spaces + var EOL = '\n' + if (typeof options === 'object' && options !== null) { + if (options.spaces) { + spaces = options.spaces + } + if (options.EOL) { + EOL = options.EOL + } + } + + var str = JSON.stringify(obj, options ? options.replacer : null, spaces) + + return str.replace(/\n/g, EOL) + EOL +} + +function writeFile (file, obj, options, callback) { + if (callback == null) { + callback = options + options = {} + } + options = options || {} + var fs = options.fs || _fs + + var str = '' + try { + str = stringify(obj, options) + } catch (err) { + // Need to return whether a callback was passed or not + if (callback) callback(err, null) + return + } + + fs.writeFile(file, str, options, callback) +} + +function writeFileSync (file, obj, options) { + options = options || {} + var fs = options.fs || _fs + + var str = stringify(obj, options) + // not sure if fs.writeFileSync returns anything, but just in case + return fs.writeFileSync(file, str, options) +} + +function stripBom (content) { + // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified + if (Buffer.isBuffer(content)) content = content.toString('utf8') + content = content.replace(/^\uFEFF/, '') + return content +} + +var jsonfile = { + readFile: readFile, + readFileSync: readFileSync, + writeFile: writeFile, + writeFileSync: writeFileSync +} + +module.exports = jsonfile diff --git a/node_modules/jsonfile/package.json b/node_modules/jsonfile/package.json new file mode 100644 index 0000000000..48cacce476 --- /dev/null +++ b/node_modules/jsonfile/package.json @@ -0,0 +1,37 @@ +{ + "name": "jsonfile", + "version": "4.0.0", + "description": "Easily read/write JSON files.", + "repository": { + "type": "git", + "url": "git@github.com:jprichardson/node-jsonfile.git" + }, + "keywords": [ + "read", + "write", + "file", + "json", + "fs", + "fs-extra" + ], + "author": "JP Richardson ", + "license": "MIT", + "dependencies": {}, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + }, + "devDependencies": { + "mocha": "2.x", + "rimraf": "^2.4.0", + "standard": "^10.0.3" + }, + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "lint": "standard", + "test": "npm run lint && npm run unit", + "unit": "mocha" + } +} \ No newline at end of file diff --git a/node_modules/language-map/.travis.yml b/node_modules/language-map/.travis.yml new file mode 100644 index 0000000000..c075309862 --- /dev/null +++ b/node_modules/language-map/.travis.yml @@ -0,0 +1,11 @@ +language: node_js + +notifications: + email: + on_success: never + on_failure: change + +node_js: + - "0.10" + +after_script: "npm install coveralls@2 && cat ./coverage/lcov.info | coveralls" diff --git a/node_modules/language-map/LICENSE b/node_modules/language-map/LICENSE new file mode 100644 index 0000000000..983fbe8aec --- /dev/null +++ b/node_modules/language-map/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/language-map/README.md b/node_modules/language-map/README.md new file mode 100644 index 0000000000..511392ca6c --- /dev/null +++ b/node_modules/language-map/README.md @@ -0,0 +1,78 @@ +# Language Map + +[![NPM version][npm-image]][npm-url] +[![NPM downloads][downloads-image]][downloads-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] + +JSON map of programming languages to meta data. Converted from GitHub's [Linguist YAML file](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml). + +**Useful Properties:** + +* `type` - Either data, programming, markup, or undefined +* `aliases` - An array of additional lowercased aliases +* `filenames` - An array of filenames associated with the language +* `extensions` - An array of associated extensions +* `interpreters` - An array of associated interpreters + +**GitHub Specific Properties:** + +* `wrap` - Boolean flag to enable line wrapping +* `color` - CSS hex color to represent the language +* `group` - Associated language grouping +* `aceMode` - A string name of the ace mode +* `searchable` - Boolean flag to enable searching +* `searchTerm` - Deprecated: Some languages maybe indexed under a different alias + +## Installation + +``` +npm install language-map --save +``` + +## Usage + +```javascript +var map = require('language-map') + +console.log(map["JavaScript"]) +//=> { type: 'programming', aceMode: 'javascript', color: '#f15501', ... } +``` + +## License + +MIT + +``` +Copyright (c) 2011-2014 GitHub, Inc. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. +``` + +[npm-image]: https://img.shields.io/npm/v/language-map.svg?style=flat +[npm-url]: https://npmjs.org/package/language-map +[downloads-image]: https://img.shields.io/npm/dm/language-map.svg?style=flat +[downloads-url]: https://npmjs.org/package/language-map +[travis-image]: https://img.shields.io/travis/blakeembrey/language-map.svg?style=flat +[travis-url]: https://travis-ci.org/blakeembrey/language-map +[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/language-map.svg?style=flat +[coveralls-url]: https://coveralls.io/r/blakeembrey/language-map?branch=master diff --git a/node_modules/language-map/languages.json b/node_modules/language-map/languages.json new file mode 100644 index 0000000000..c073146f4b --- /dev/null +++ b/node_modules/language-map/languages.json @@ -0,0 +1,6762 @@ +{ + "1C Enterprise": { + "type": "programming", + "color": "#814CCC", + "extensions": [ + ".bsl", + ".os" + ], + "tmScope": "source.bsl", + "aceMode": "text", + "languageId": 0 + }, + "ABAP": { + "type": "programming", + "color": "#E8274B", + "extensions": [ + ".abap" + ], + "aceMode": "abap", + "languageId": 1 + }, + "ABNF": { + "type": "data", + "aceMode": "text", + "extensions": [ + ".abnf" + ], + "tmScope": "source.abnf", + "languageId": 429 + }, + "AGS Script": { + "type": "programming", + "color": "#B9D9FF", + "aliases": [ + "ags" + ], + "extensions": [ + ".asc", + ".ash" + ], + "tmScope": "source.c++", + "aceMode": "c_cpp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-c++src", + "languageId": 2 + }, + "AMPL": { + "type": "programming", + "color": "#E6EFBB", + "extensions": [ + ".ampl", + ".mod" + ], + "tmScope": "source.ampl", + "aceMode": "text", + "languageId": 3 + }, + "ANTLR": { + "type": "programming", + "color": "#9DC3FF", + "extensions": [ + ".g4" + ], + "aceMode": "text", + "languageId": 4 + }, + "API Blueprint": { + "type": "markup", + "color": "#2ACCA8", + "aceMode": "markdown", + "extensions": [ + ".apib" + ], + "tmScope": "text.html.markdown.source.gfm.apib", + "languageId": 5 + }, + "APL": { + "type": "programming", + "color": "#5A8164", + "extensions": [ + ".apl", + ".dyalog" + ], + "interpreters": [ + "apl", + "aplx", + "dyalog" + ], + "tmScope": "source.apl", + "aceMode": "text", + "codemirrorMode": "apl", + "codemirrorMimeType": "text/apl", + "languageId": 6 + }, + "ASN.1": { + "type": "data", + "extensions": [ + ".asn", + ".asn1" + ], + "tmScope": "source.asn", + "aceMode": "text", + "codemirrorMode": "asn.1", + "codemirrorMimeType": "text/x-ttcn-asn", + "languageId": 7 + }, + "ASP": { + "type": "programming", + "color": "#6a40fd", + "tmScope": "text.html.asp", + "aliases": [ + "aspx", + "aspx-vb" + ], + "extensions": [ + ".asp", + ".asax", + ".ascx", + ".ashx", + ".asmx", + ".aspx", + ".axd" + ], + "aceMode": "text", + "codemirrorMode": "htmlembedded", + "codemirrorMimeType": "application/x-aspx", + "languageId": 8 + }, + "ATS": { + "type": "programming", + "color": "#1ac620", + "aliases": [ + "ats2" + ], + "extensions": [ + ".dats", + ".hats", + ".sats" + ], + "tmScope": "source.ats", + "aceMode": "ocaml", + "languageId": 9 + }, + "ActionScript": { + "type": "programming", + "tmScope": "source.actionscript.3", + "color": "#882B0F", + "aliases": [ + "actionscript 3", + "actionscript3", + "as3" + ], + "extensions": [ + ".as" + ], + "aceMode": "actionscript", + "languageId": 10 + }, + "Ada": { + "type": "programming", + "color": "#02f88c", + "extensions": [ + ".adb", + ".ada", + ".ads" + ], + "aliases": [ + "ada95", + "ada2005" + ], + "aceMode": "ada", + "languageId": 11 + }, + "Adobe Font Metrics": { + "type": "data", + "tmScope": "source.afm", + "extensions": [ + ".afm" + ], + "aliases": [ + "acfm", + "adobe composite font metrics", + "adobe multiple font metrics", + "amfm" + ], + "aceMode": "text", + "languageId": 147198098 + }, + "Agda": { + "type": "programming", + "color": "#315665", + "extensions": [ + ".agda" + ], + "aceMode": "text", + "languageId": 12 + }, + "Alloy": { + "type": "programming", + "color": "#64C800", + "extensions": [ + ".als" + ], + "aceMode": "text", + "languageId": 13 + }, + "Alpine Abuild": { + "type": "programming", + "group": "Shell", + "aliases": [ + "abuild", + "apkbuild" + ], + "filenames": [ + "APKBUILD" + ], + "tmScope": "source.shell", + "aceMode": "sh", + "codemirrorMode": "shell", + "codemirrorMimeType": "text/x-sh", + "languageId": 14 + }, + "AngelScript": { + "type": "programming", + "color": "#C7D7DC", + "extensions": [ + ".as", + ".angelscript" + ], + "tmScope": "source.angelscript", + "aceMode": "text", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-c++src", + "languageId": 389477596 + }, + "Ant Build System": { + "type": "data", + "tmScope": "text.xml.ant", + "filenames": [ + "ant.xml", + "build.xml" + ], + "aceMode": "xml", + "codemirrorMode": "xml", + "codemirrorMimeType": "application/xml", + "languageId": 15 + }, + "ApacheConf": { + "type": "data", + "aliases": [ + "aconf", + "apache" + ], + "extensions": [ + ".apacheconf", + ".vhost" + ], + "filenames": [ + ".htaccess", + "apache2.conf", + "httpd.conf" + ], + "tmScope": "source.apache-config", + "aceMode": "apache_conf", + "languageId": 16 + }, + "Apex": { + "type": "programming", + "extensions": [ + ".cls" + ], + "tmScope": "source.java", + "aceMode": "java", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-java", + "languageId": 17 + }, + "Apollo Guidance Computer": { + "type": "programming", + "group": "Assembly", + "extensions": [ + ".agc" + ], + "tmScope": "source.agc", + "aceMode": "assembly_x86", + "languageId": 18 + }, + "AppleScript": { + "type": "programming", + "aliases": [ + "osascript" + ], + "extensions": [ + ".applescript", + ".scpt" + ], + "interpreters": [ + "osascript" + ], + "aceMode": "applescript", + "color": "#101F1F", + "languageId": 19 + }, + "Arc": { + "type": "programming", + "color": "#aa2afe", + "extensions": [ + ".arc" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 20 + }, + "AsciiDoc": { + "type": "prose", + "aceMode": "asciidoc", + "wrap": true, + "extensions": [ + ".asciidoc", + ".adoc", + ".asc" + ], + "tmScope": "text.html.asciidoc", + "languageId": 22 + }, + "AspectJ": { + "type": "programming", + "color": "#a957b0", + "extensions": [ + ".aj" + ], + "tmScope": "source.aspectj", + "aceMode": "text", + "languageId": 23 + }, + "Assembly": { + "type": "programming", + "color": "#6E4C13", + "aliases": [ + "asm", + "nasm" + ], + "extensions": [ + ".asm", + ".a51", + ".inc", + ".nasm" + ], + "tmScope": "source.assembly", + "aceMode": "assembly_x86", + "languageId": 24 + }, + "Augeas": { + "type": "programming", + "extensions": [ + ".aug" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 25 + }, + "AutoHotkey": { + "type": "programming", + "color": "#6594b9", + "aliases": [ + "ahk" + ], + "extensions": [ + ".ahk", + ".ahkl" + ], + "tmScope": "source.ahk", + "aceMode": "autohotkey", + "languageId": 26 + }, + "AutoIt": { + "type": "programming", + "color": "#1C3552", + "aliases": [ + "au3", + "AutoIt3", + "AutoItScript" + ], + "extensions": [ + ".au3" + ], + "tmScope": "source.autoit", + "aceMode": "autohotkey", + "languageId": 27 + }, + "Awk": { + "type": "programming", + "extensions": [ + ".awk", + ".auk", + ".gawk", + ".mawk", + ".nawk" + ], + "interpreters": [ + "awk", + "gawk", + "mawk", + "nawk" + ], + "aceMode": "text", + "languageId": 28 + }, + "Ballerina": { + "type": "programming", + "extensions": [ + ".bal" + ], + "tmScope": "source.ballerina", + "aceMode": "text", + "color": "#FF5000", + "languageId": 720859680 + }, + "Batchfile": { + "type": "programming", + "aliases": [ + "bat", + "batch", + "dosbatch", + "winbatch" + ], + "extensions": [ + ".bat", + ".cmd" + ], + "tmScope": "source.batchfile", + "aceMode": "batchfile", + "color": "#C1F12E", + "languageId": 29 + }, + "Befunge": { + "type": "programming", + "extensions": [ + ".befunge" + ], + "aceMode": "text", + "languageId": 30 + }, + "Bison": { + "type": "programming", + "group": "Yacc", + "tmScope": "source.bison", + "extensions": [ + ".bison" + ], + "aceMode": "text", + "languageId": 31 + }, + "BitBake": { + "type": "programming", + "tmScope": "none", + "extensions": [ + ".bb" + ], + "aceMode": "text", + "languageId": 32 + }, + "Blade": { + "type": "markup", + "group": "HTML", + "extensions": [ + ".blade", + ".blade.php" + ], + "tmScope": "text.html.php.blade", + "aceMode": "text", + "languageId": 33 + }, + "BlitzBasic": { + "type": "programming", + "aliases": [ + "b3d", + "blitz3d", + "blitzplus", + "bplus" + ], + "extensions": [ + ".bb", + ".decls" + ], + "tmScope": "source.blitzmax", + "aceMode": "text", + "languageId": 34 + }, + "BlitzMax": { + "type": "programming", + "color": "#cd6400", + "extensions": [ + ".bmx" + ], + "aliases": [ + "bmax" + ], + "aceMode": "text", + "languageId": 35 + }, + "Bluespec": { + "type": "programming", + "extensions": [ + ".bsv" + ], + "tmScope": "source.bsv", + "aceMode": "verilog", + "languageId": 36 + }, + "Boo": { + "type": "programming", + "color": "#d4bec1", + "extensions": [ + ".boo" + ], + "aceMode": "text", + "tmScope": "source.boo", + "languageId": 37 + }, + "Brainfuck": { + "type": "programming", + "color": "#2F2530", + "extensions": [ + ".b", + ".bf" + ], + "tmScope": "source.bf", + "aceMode": "text", + "codemirrorMode": "brainfuck", + "codemirrorMimeType": "text/x-brainfuck", + "languageId": 38 + }, + "Brightscript": { + "type": "programming", + "extensions": [ + ".brs" + ], + "tmScope": "source.brightscript", + "aceMode": "text", + "languageId": 39 + }, + "Bro": { + "type": "programming", + "extensions": [ + ".bro" + ], + "aceMode": "text", + "languageId": 40 + }, + "C": { + "type": "programming", + "color": "#555555", + "extensions": [ + ".c", + ".cats", + ".h", + ".idc" + ], + "interpreters": [ + "tcc" + ], + "aceMode": "c_cpp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-csrc", + "languageId": 41 + }, + "C#": { + "type": "programming", + "aceMode": "csharp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-csharp", + "tmScope": "source.cs", + "color": "#178600", + "aliases": [ + "csharp" + ], + "extensions": [ + ".cs", + ".cake", + ".cshtml", + ".csx" + ], + "languageId": 42 + }, + "C++": { + "type": "programming", + "aceMode": "c_cpp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-c++src", + "color": "#f34b7d", + "aliases": [ + "cpp" + ], + "extensions": [ + ".cpp", + ".c++", + ".cc", + ".cp", + ".cxx", + ".h", + ".h++", + ".hh", + ".hpp", + ".hxx", + ".inc", + ".inl", + ".ino", + ".ipp", + ".re", + ".tcc", + ".tpp" + ], + "languageId": 43 + }, + "C-ObjDump": { + "type": "data", + "extensions": [ + ".c-objdump" + ], + "tmScope": "objdump.x86asm", + "aceMode": "assembly_x86", + "languageId": 44 + }, + "C2hs Haskell": { + "type": "programming", + "group": "Haskell", + "aliases": [ + "c2hs" + ], + "extensions": [ + ".chs" + ], + "tmScope": "source.haskell", + "aceMode": "haskell", + "codemirrorMode": "haskell", + "codemirrorMimeType": "text/x-haskell", + "languageId": 45 + }, + "CLIPS": { + "type": "programming", + "extensions": [ + ".clp" + ], + "tmScope": "source.clips", + "aceMode": "text", + "languageId": 46 + }, + "CMake": { + "type": "programming", + "extensions": [ + ".cmake", + ".cmake.in" + ], + "filenames": [ + "CMakeLists.txt" + ], + "aceMode": "text", + "codemirrorMode": "cmake", + "codemirrorMimeType": "text/x-cmake", + "languageId": 47 + }, + "COBOL": { + "type": "programming", + "extensions": [ + ".cob", + ".cbl", + ".ccp", + ".cobol", + ".cpy" + ], + "aceMode": "cobol", + "codemirrorMode": "cobol", + "codemirrorMimeType": "text/x-cobol", + "languageId": 48 + }, + "COLLADA": { + "type": "data", + "extensions": [ + ".dae" + ], + "tmScope": "text.xml", + "aceMode": "xml", + "codemirrorMode": "xml", + "codemirrorMimeType": "text/xml", + "languageId": 49 + }, + "CSON": { + "type": "data", + "group": "CoffeeScript", + "tmScope": "source.coffee", + "aceMode": "coffee", + "codemirrorMode": "coffeescript", + "codemirrorMimeType": "text/x-coffeescript", + "searchable": false, + "extensions": [ + ".cson" + ], + "languageId": 424 + }, + "CSS": { + "type": "markup", + "tmScope": "source.css", + "aceMode": "css", + "codemirrorMode": "css", + "codemirrorMimeType": "text/css", + "color": "#563d7c", + "extensions": [ + ".css" + ], + "languageId": 50 + }, + "CSV": { + "type": "data", + "aceMode": "text", + "tmScope": "none", + "extensions": [ + ".csv" + ], + "languageId": 51 + }, + "CWeb": { + "type": "programming", + "extensions": [ + ".w" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 657332628 + }, + "Cap'n Proto": { + "type": "programming", + "tmScope": "source.capnp", + "extensions": [ + ".capnp" + ], + "aceMode": "text", + "languageId": 52 + }, + "CartoCSS": { + "type": "programming", + "aliases": [ + "Carto" + ], + "extensions": [ + ".mss" + ], + "aceMode": "text", + "tmScope": "source.css.mss", + "languageId": 53 + }, + "Ceylon": { + "type": "programming", + "color": "#dfa535", + "extensions": [ + ".ceylon" + ], + "tmScope": "source.ceylon", + "aceMode": "text", + "languageId": 54 + }, + "Chapel": { + "type": "programming", + "color": "#8dc63f", + "aliases": [ + "chpl" + ], + "extensions": [ + ".chpl" + ], + "aceMode": "text", + "languageId": 55 + }, + "Charity": { + "type": "programming", + "extensions": [ + ".ch" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 56 + }, + "ChucK": { + "type": "programming", + "extensions": [ + ".ck" + ], + "tmScope": "source.java", + "aceMode": "java", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-java", + "languageId": 57 + }, + "Cirru": { + "type": "programming", + "color": "#ccccff", + "aceMode": "cirru", + "extensions": [ + ".cirru" + ], + "languageId": 58 + }, + "Clarion": { + "type": "programming", + "color": "#db901e", + "aceMode": "text", + "extensions": [ + ".clw" + ], + "tmScope": "source.clarion", + "languageId": 59 + }, + "Clean": { + "type": "programming", + "color": "#3F85AF", + "extensions": [ + ".icl", + ".dcl" + ], + "tmScope": "source.clean", + "aceMode": "text", + "languageId": 60 + }, + "Click": { + "type": "programming", + "color": "#E4E6F3", + "extensions": [ + ".click" + ], + "tmScope": "source.click", + "aceMode": "text", + "languageId": 61 + }, + "Clojure": { + "type": "programming", + "aceMode": "clojure", + "codemirrorMode": "clojure", + "codemirrorMimeType": "text/x-clojure", + "color": "#db5855", + "extensions": [ + ".clj", + ".boot", + ".cl2", + ".cljc", + ".cljs", + ".cljs.hl", + ".cljscm", + ".cljx", + ".hic" + ], + "filenames": [ + "riemann.config" + ], + "languageId": 62 + }, + "Closure Templates": { + "type": "markup", + "group": "HTML", + "aceMode": "soy_template", + "codemirrorMode": "soy", + "codemirrorMimeType": "text/x-soy", + "aliases": [ + "soy" + ], + "extensions": [ + ".soy" + ], + "tmScope": "text.html.soy", + "languageId": 357046146 + }, + "Cloud Firestore Security Rules": { + "type": "data", + "aceMode": "less", + "codemirrorMode": "css", + "codemirrorMimeType": "text/css", + "tmScope": "source.firestore", + "filenames": [ + "firestore.rules" + ], + "languageId": 407996372 + }, + "CoNLL-U": { + "type": "data", + "extensions": [ + ".conllu", + ".conll" + ], + "tmScope": "text.conllu", + "aceMode": "text", + "aliases": [ + "CoNLL", + "CoNLL-X" + ], + "languageId": 421026389 + }, + "CoffeeScript": { + "type": "programming", + "tmScope": "source.coffee", + "aceMode": "coffee", + "codemirrorMode": "coffeescript", + "codemirrorMimeType": "text/x-coffeescript", + "color": "#244776", + "aliases": [ + "coffee", + "coffee-script" + ], + "extensions": [ + ".coffee", + "._coffee", + ".cake", + ".cjsx", + ".iced" + ], + "filenames": [ + "Cakefile" + ], + "interpreters": [ + "coffee" + ], + "languageId": 63 + }, + "ColdFusion": { + "type": "programming", + "aceMode": "coldfusion", + "color": "#ed2cd6", + "aliases": [ + "cfm", + "cfml", + "coldfusion html" + ], + "extensions": [ + ".cfm", + ".cfml" + ], + "tmScope": "text.html.cfm", + "languageId": 64 + }, + "ColdFusion CFC": { + "type": "programming", + "group": "ColdFusion", + "aceMode": "coldfusion", + "aliases": [ + "cfc" + ], + "extensions": [ + ".cfc" + ], + "tmScope": "source.cfscript", + "languageId": 65 + }, + "Common Lisp": { + "type": "programming", + "tmScope": "source.lisp", + "color": "#3fb68b", + "aliases": [ + "lisp" + ], + "extensions": [ + ".lisp", + ".asd", + ".cl", + ".l", + ".lsp", + ".ny", + ".podsl", + ".sexp" + ], + "interpreters": [ + "lisp", + "sbcl", + "ccl", + "clisp", + "ecl" + ], + "aceMode": "lisp", + "codemirrorMode": "commonlisp", + "codemirrorMimeType": "text/x-common-lisp", + "languageId": 66 + }, + "Common Workflow Language": { + "aliases": [ + "cwl" + ], + "type": "programming", + "aceMode": "yaml", + "codemirrorMode": "yaml", + "codemirrorMimeType": "text/x-yaml", + "extensions": [ + ".cwl" + ], + "interpreters": [ + "cwl-runner" + ], + "color": "#B5314C", + "tmScope": "source.cwl", + "languageId": 988547172 + }, + "Component Pascal": { + "type": "programming", + "color": "#B0CE4E", + "extensions": [ + ".cp", + ".cps" + ], + "tmScope": "source.pascal", + "aliases": [ + "delphi", + "objectpascal" + ], + "aceMode": "pascal", + "codemirrorMode": "pascal", + "codemirrorMimeType": "text/x-pascal", + "languageId": 67 + }, + "Cool": { + "type": "programming", + "extensions": [ + ".cl" + ], + "tmScope": "source.cool", + "aceMode": "text", + "languageId": 68 + }, + "Coq": { + "type": "programming", + "extensions": [ + ".coq", + ".v" + ], + "aceMode": "text", + "languageId": 69 + }, + "Cpp-ObjDump": { + "type": "data", + "extensions": [ + ".cppobjdump", + ".c++-objdump", + ".c++objdump", + ".cpp-objdump", + ".cxx-objdump" + ], + "tmScope": "objdump.x86asm", + "aliases": [ + "c++-objdump" + ], + "aceMode": "assembly_x86", + "languageId": 70 + }, + "Creole": { + "type": "prose", + "wrap": true, + "extensions": [ + ".creole" + ], + "tmScope": "text.html.creole", + "aceMode": "text", + "languageId": 71 + }, + "Crystal": { + "type": "programming", + "color": "#776791", + "extensions": [ + ".cr" + ], + "aceMode": "ruby", + "codemirrorMode": "crystal", + "codemirrorMimeType": "text/x-crystal", + "tmScope": "source.crystal", + "interpreters": [ + "crystal" + ], + "languageId": 72 + }, + "Csound": { + "type": "programming", + "aliases": [ + "csound-orc" + ], + "extensions": [ + ".orc", + ".udo" + ], + "tmScope": "source.csound", + "aceMode": "csound_orchestra", + "languageId": 73 + }, + "Csound Document": { + "type": "programming", + "aliases": [ + "csound-csd" + ], + "extensions": [ + ".csd" + ], + "tmScope": "source.csound-document", + "aceMode": "csound_document", + "languageId": 74 + }, + "Csound Score": { + "type": "programming", + "aliases": [ + "csound-sco" + ], + "extensions": [ + ".sco" + ], + "tmScope": "source.csound-score", + "aceMode": "csound_score", + "languageId": 75 + }, + "Cuda": { + "type": "programming", + "extensions": [ + ".cu", + ".cuh" + ], + "tmScope": "source.cuda-c++", + "aceMode": "c_cpp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-c++src", + "color": "#3A4E3A", + "languageId": 77 + }, + "Cycript": { + "type": "programming", + "extensions": [ + ".cy" + ], + "tmScope": "source.js", + "aceMode": "javascript", + "codemirrorMode": "javascript", + "codemirrorMimeType": "text/javascript", + "languageId": 78 + }, + "Cython": { + "type": "programming", + "group": "Python", + "extensions": [ + ".pyx", + ".pxd", + ".pxi" + ], + "aliases": [ + "pyrex" + ], + "aceMode": "text", + "codemirrorMode": "python", + "codemirrorMimeType": "text/x-cython", + "languageId": 79 + }, + "D": { + "type": "programming", + "color": "#ba595e", + "extensions": [ + ".d", + ".di" + ], + "aceMode": "d", + "codemirrorMode": "d", + "codemirrorMimeType": "text/x-d", + "languageId": 80 + }, + "D-ObjDump": { + "type": "data", + "extensions": [ + ".d-objdump" + ], + "tmScope": "objdump.x86asm", + "aceMode": "assembly_x86", + "languageId": 81 + }, + "DIGITAL Command Language": { + "type": "programming", + "aliases": [ + "dcl" + ], + "extensions": [ + ".com" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 82 + }, + "DM": { + "type": "programming", + "color": "#447265", + "extensions": [ + ".dm" + ], + "aliases": [ + "byond" + ], + "tmScope": "source.dm", + "aceMode": "c_cpp", + "languageId": 83 + }, + "DNS Zone": { + "type": "data", + "extensions": [ + ".zone", + ".arpa" + ], + "tmScope": "text.zone_file", + "aceMode": "text", + "languageId": 84 + }, + "DTrace": { + "type": "programming", + "aliases": [ + "dtrace-script" + ], + "extensions": [ + ".d" + ], + "interpreters": [ + "dtrace" + ], + "tmScope": "source.c", + "aceMode": "c_cpp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-csrc", + "languageId": 85 + }, + "Darcs Patch": { + "type": "data", + "aliases": [ + "dpatch" + ], + "extensions": [ + ".darcspatch", + ".dpatch" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 86 + }, + "Dart": { + "type": "programming", + "color": "#00B4AB", + "extensions": [ + ".dart" + ], + "interpreters": [ + "dart" + ], + "aceMode": "dart", + "codemirrorMode": "dart", + "codemirrorMimeType": "application/dart", + "languageId": 87 + }, + "DataWeave": { + "type": "programming", + "color": "#003a52", + "extensions": [ + ".dwl" + ], + "aceMode": "text", + "tmScope": "source.data-weave", + "languageId": 974514097 + }, + "Diff": { + "type": "data", + "extensions": [ + ".diff", + ".patch" + ], + "aliases": [ + "udiff" + ], + "tmScope": "source.diff", + "aceMode": "diff", + "codemirrorMode": "diff", + "codemirrorMimeType": "text/x-diff", + "languageId": 88 + }, + "Dockerfile": { + "type": "programming", + "color": "#0db7ed", + "tmScope": "source.dockerfile", + "extensions": [ + ".dockerfile" + ], + "filenames": [ + "Dockerfile" + ], + "aceMode": "dockerfile", + "codemirrorMode": "dockerfile", + "codemirrorMimeType": "text/x-dockerfile", + "languageId": 89 + }, + "Dogescript": { + "type": "programming", + "color": "#cca760", + "extensions": [ + ".djs" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 90 + }, + "Dylan": { + "type": "programming", + "color": "#6c616e", + "extensions": [ + ".dylan", + ".dyl", + ".intr", + ".lid" + ], + "aceMode": "text", + "codemirrorMode": "dylan", + "codemirrorMimeType": "text/x-dylan", + "languageId": 91 + }, + "E": { + "type": "programming", + "color": "#ccce35", + "extensions": [ + ".E" + ], + "interpreters": [ + "rune" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 92 + }, + "EBNF": { + "type": "data", + "extensions": [ + ".ebnf" + ], + "tmScope": "source.ebnf", + "aceMode": "text", + "codemirrorMode": "ebnf", + "codemirrorMimeType": "text/x-ebnf", + "languageId": 430 + }, + "ECL": { + "type": "programming", + "color": "#8a1267", + "extensions": [ + ".ecl", + ".eclxml" + ], + "tmScope": "none", + "aceMode": "text", + "codemirrorMode": "ecl", + "codemirrorMimeType": "text/x-ecl", + "languageId": 93 + }, + "ECLiPSe": { + "type": "programming", + "group": "prolog", + "extensions": [ + ".ecl" + ], + "tmScope": "source.prolog.eclipse", + "aceMode": "prolog", + "languageId": 94 + }, + "EJS": { + "type": "markup", + "group": "HTML", + "extensions": [ + ".ejs" + ], + "tmScope": "text.html.js", + "aceMode": "ejs", + "languageId": 95 + }, + "EML": { + "type": "data", + "extensions": [ + ".eml", + ".mbox" + ], + "tmScope": "text.eml.basic", + "aceMode": "text", + "languageId": 529653389 + }, + "EQ": { + "type": "programming", + "color": "#a78649", + "extensions": [ + ".eq" + ], + "tmScope": "source.cs", + "aceMode": "csharp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-csharp", + "languageId": 96 + }, + "Eagle": { + "type": "data", + "extensions": [ + ".sch", + ".brd" + ], + "tmScope": "text.xml", + "aceMode": "xml", + "codemirrorMode": "xml", + "codemirrorMimeType": "text/xml", + "languageId": 97 + }, + "Easybuild": { + "type": "data", + "group": "Python", + "aceMode": "python", + "codemirrorMode": "python", + "codemirrorMimeType": "text/x-python", + "tmScope": "source.python", + "extensions": [ + ".eb" + ], + "languageId": 342840477 + }, + "Ecere Projects": { + "type": "data", + "group": "JavaScript", + "extensions": [ + ".epj" + ], + "tmScope": "source.json", + "aceMode": "json", + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/json", + "languageId": 98 + }, + "Edje Data Collection": { + "type": "data", + "extensions": [ + ".edc" + ], + "tmScope": "source.json", + "aceMode": "json", + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/json", + "languageId": 342840478 + }, + "Eiffel": { + "type": "programming", + "color": "#946d57", + "extensions": [ + ".e" + ], + "aceMode": "eiffel", + "codemirrorMode": "eiffel", + "codemirrorMimeType": "text/x-eiffel", + "languageId": 99 + }, + "Elixir": { + "type": "programming", + "color": "#6e4a7e", + "extensions": [ + ".ex", + ".exs" + ], + "aceMode": "elixir", + "filenames": [ + "mix.lock" + ], + "interpreters": [ + "elixir" + ], + "languageId": 100 + }, + "Elm": { + "type": "programming", + "color": "#60B5CC", + "extensions": [ + ".elm" + ], + "tmScope": "source.elm", + "aceMode": "elm", + "codemirrorMode": "elm", + "codemirrorMimeType": "text/x-elm", + "languageId": 101 + }, + "Emacs Lisp": { + "type": "programming", + "tmScope": "source.emacs.lisp", + "color": "#c065db", + "aliases": [ + "elisp", + "emacs" + ], + "filenames": [ + ".abbrev_defs", + ".emacs", + ".emacs.desktop", + ".gnus", + ".spacemacs", + ".viper", + "Cask", + "Project.ede", + "_emacs", + "abbrev_defs" + ], + "extensions": [ + ".el", + ".emacs", + ".emacs.desktop" + ], + "aceMode": "lisp", + "codemirrorMode": "commonlisp", + "codemirrorMimeType": "text/x-common-lisp", + "languageId": 102 + }, + "EmberScript": { + "type": "programming", + "color": "#FFF4F3", + "extensions": [ + ".em", + ".emberscript" + ], + "tmScope": "source.coffee", + "aceMode": "coffee", + "codemirrorMode": "coffeescript", + "codemirrorMimeType": "text/x-coffeescript", + "languageId": 103 + }, + "Erlang": { + "type": "programming", + "color": "#B83998", + "extensions": [ + ".erl", + ".app.src", + ".es", + ".escript", + ".hrl", + ".xrl", + ".yrl" + ], + "filenames": [ + "Emakefile", + "rebar.config", + "rebar.config.lock", + "rebar.lock" + ], + "aceMode": "erlang", + "codemirrorMode": "erlang", + "codemirrorMimeType": "text/x-erlang", + "interpreters": [ + "escript" + ], + "languageId": 104 + }, + "F#": { + "type": "programming", + "color": "#b845fc", + "aliases": [ + "fsharp" + ], + "extensions": [ + ".fs", + ".fsi", + ".fsx" + ], + "tmScope": "source.fsharp", + "aceMode": "text", + "codemirrorMode": "mllike", + "codemirrorMimeType": "text/x-fsharp", + "languageId": 105 + }, + "F*": { + "type": "programming", + "color": "#572e30", + "aliases": [ + "fstar" + ], + "extensions": [ + ".fst" + ], + "tmScope": "source.fstar", + "aceMode": "text", + "languageId": 336943375 + }, + "FIGlet Font": { + "type": "data", + "aliases": [ + "FIGfont" + ], + "extensions": [ + ".flf" + ], + "tmScope": "source.figfont", + "aceMode": "text", + "languageId": 686129783 + }, + "FLUX": { + "type": "programming", + "color": "#88ccff", + "extensions": [ + ".fx", + ".flux" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 106 + }, + "Factor": { + "type": "programming", + "color": "#636746", + "extensions": [ + ".factor" + ], + "filenames": [ + ".factor-boot-rc", + ".factor-rc" + ], + "aceMode": "text", + "codemirrorMode": "factor", + "codemirrorMimeType": "text/x-factor", + "languageId": 108 + }, + "Fancy": { + "type": "programming", + "color": "#7b9db4", + "extensions": [ + ".fy", + ".fancypack" + ], + "filenames": [ + "Fakefile" + ], + "aceMode": "text", + "languageId": 109 + }, + "Fantom": { + "type": "programming", + "color": "#14253c", + "extensions": [ + ".fan" + ], + "tmScope": "source.fan", + "aceMode": "text", + "languageId": 110 + }, + "Filebench WML": { + "type": "programming", + "extensions": [ + ".f" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 111 + }, + "Filterscript": { + "type": "programming", + "group": "RenderScript", + "extensions": [ + ".fs" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 112 + }, + "Formatted": { + "type": "data", + "extensions": [ + ".for", + ".eam.fs" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 113 + }, + "Forth": { + "type": "programming", + "color": "#341708", + "extensions": [ + ".fth", + ".4th", + ".f", + ".for", + ".forth", + ".fr", + ".frt", + ".fs" + ], + "aceMode": "forth", + "codemirrorMode": "forth", + "codemirrorMimeType": "text/x-forth", + "languageId": 114 + }, + "Fortran": { + "type": "programming", + "color": "#4d41b1", + "extensions": [ + ".f90", + ".f", + ".f03", + ".f08", + ".f77", + ".f95", + ".for", + ".fpp" + ], + "tmScope": "source.fortran.modern", + "aceMode": "text", + "codemirrorMode": "fortran", + "codemirrorMimeType": "text/x-fortran", + "languageId": 107 + }, + "FreeMarker": { + "type": "programming", + "color": "#0050b2", + "aliases": [ + "ftl" + ], + "extensions": [ + ".ftl" + ], + "tmScope": "text.html.ftl", + "aceMode": "ftl", + "languageId": 115 + }, + "Frege": { + "type": "programming", + "color": "#00cafe", + "extensions": [ + ".fr" + ], + "tmScope": "source.haskell", + "aceMode": "haskell", + "languageId": 116 + }, + "G-code": { + "type": "data", + "extensions": [ + ".g", + ".gco", + ".gcode" + ], + "tmScope": "source.gcode", + "aceMode": "gcode", + "languageId": 117 + }, + "GAMS": { + "type": "programming", + "extensions": [ + ".gms" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 118 + }, + "GAP": { + "type": "programming", + "extensions": [ + ".g", + ".gap", + ".gd", + ".gi", + ".tst" + ], + "tmScope": "source.gap", + "aceMode": "text", + "languageId": 119 + }, + "GCC Machine Description": { + "type": "programming", + "extensions": [ + ".md" + ], + "tmScope": "source.lisp", + "aceMode": "lisp", + "codemirrorMode": "commonlisp", + "codemirrorMimeType": "text/x-common-lisp", + "languageId": 121 + }, + "GDB": { + "type": "programming", + "extensions": [ + ".gdb", + ".gdbinit" + ], + "tmScope": "source.gdb", + "aceMode": "text", + "languageId": 122 + }, + "GDScript": { + "type": "programming", + "color": "#355570", + "extensions": [ + ".gd" + ], + "tmScope": "source.gdscript", + "aceMode": "text", + "languageId": 123 + }, + "GLSL": { + "type": "programming", + "extensions": [ + ".glsl", + ".fp", + ".frag", + ".frg", + ".fs", + ".fsh", + ".fshader", + ".geo", + ".geom", + ".glslv", + ".gshader", + ".shader", + ".tesc", + ".tese", + ".vert", + ".vrx", + ".vsh", + ".vshader" + ], + "aceMode": "glsl", + "languageId": 124 + }, + "GN": { + "type": "data", + "extensions": [ + ".gn", + ".gni" + ], + "interpreters": [ + "gn" + ], + "filenames": [ + ".gn" + ], + "tmScope": "source.gn", + "aceMode": "python", + "codemirrorMode": "python", + "codemirrorMimeType": "text/x-python", + "languageId": 302957008 + }, + "Game Maker Language": { + "type": "programming", + "color": "#71b417", + "extensions": [ + ".gml" + ], + "tmScope": "source.c++", + "aceMode": "c_cpp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-c++src", + "languageId": 125 + }, + "Genie": { + "type": "programming", + "aceMode": "text", + "extensions": [ + ".gs" + ], + "color": "#fb855d", + "tmScope": "none", + "languageId": 792408528 + }, + "Genshi": { + "type": "programming", + "extensions": [ + ".kid" + ], + "tmScope": "text.xml.genshi", + "aliases": [ + "xml+genshi", + "xml+kid" + ], + "aceMode": "xml", + "codemirrorMode": "xml", + "codemirrorMimeType": "text/xml", + "languageId": 126 + }, + "Gentoo Ebuild": { + "type": "programming", + "group": "Shell", + "extensions": [ + ".ebuild" + ], + "tmScope": "source.shell", + "aceMode": "sh", + "codemirrorMode": "shell", + "codemirrorMimeType": "text/x-sh", + "languageId": 127 + }, + "Gentoo Eclass": { + "type": "programming", + "group": "Shell", + "extensions": [ + ".eclass" + ], + "tmScope": "source.shell", + "aceMode": "sh", + "codemirrorMode": "shell", + "codemirrorMimeType": "text/x-sh", + "languageId": 128 + }, + "Gerber Image": { + "type": "data", + "aliases": [ + "rs-274x" + ], + "extensions": [ + ".gbr", + ".gbl", + ".gbo", + ".gbp", + ".gbs", + ".gko", + ".gpb", + ".gpt", + ".gtl", + ".gto", + ".gtp", + ".gts" + ], + "interpreters": [ + "gerbv", + "gerbview" + ], + "tmScope": "source.gerber", + "aceMode": "text", + "languageId": 404627610 + }, + "Gettext Catalog": { + "type": "prose", + "searchable": false, + "aliases": [ + "pot" + ], + "extensions": [ + ".po", + ".pot" + ], + "tmScope": "source.po", + "aceMode": "text", + "languageId": 129 + }, + "Gherkin": { + "type": "programming", + "extensions": [ + ".feature" + ], + "tmScope": "text.gherkin.feature", + "aliases": [ + "cucumber" + ], + "aceMode": "text", + "color": "#5B2063", + "languageId": 76 + }, + "Glyph": { + "type": "programming", + "color": "#c1ac7f", + "extensions": [ + ".glf" + ], + "tmScope": "source.tcl", + "aceMode": "tcl", + "codemirrorMode": "tcl", + "codemirrorMimeType": "text/x-tcl", + "languageId": 130 + }, + "Glyph Bitmap Distribution Format": { + "type": "data", + "extensions": [ + ".bdf" + ], + "tmScope": "source.bdf", + "aceMode": "text", + "languageId": 997665271 + }, + "Gnuplot": { + "type": "programming", + "color": "#f0a9f0", + "extensions": [ + ".gp", + ".gnu", + ".gnuplot", + ".plot", + ".plt" + ], + "interpreters": [ + "gnuplot" + ], + "aceMode": "text", + "languageId": 131 + }, + "Go": { + "type": "programming", + "color": "#375eab", + "aliases": [ + "golang" + ], + "extensions": [ + ".go" + ], + "aceMode": "golang", + "codemirrorMode": "go", + "codemirrorMimeType": "text/x-go", + "languageId": 132 + }, + "Golo": { + "type": "programming", + "color": "#88562A", + "extensions": [ + ".golo" + ], + "tmScope": "source.golo", + "aceMode": "text", + "languageId": 133 + }, + "Gosu": { + "type": "programming", + "color": "#82937f", + "extensions": [ + ".gs", + ".gst", + ".gsx", + ".vark" + ], + "tmScope": "source.gosu.2", + "aceMode": "text", + "languageId": 134 + }, + "Grace": { + "type": "programming", + "extensions": [ + ".grace" + ], + "tmScope": "source.grace", + "aceMode": "text", + "languageId": 135 + }, + "Gradle": { + "type": "data", + "extensions": [ + ".gradle" + ], + "tmScope": "source.groovy.gradle", + "aceMode": "text", + "languageId": 136 + }, + "Grammatical Framework": { + "type": "programming", + "aliases": [ + "gf" + ], + "wrap": false, + "extensions": [ + ".gf" + ], + "searchable": true, + "color": "#79aa7a", + "tmScope": "source.haskell", + "aceMode": "haskell", + "codemirrorMode": "haskell", + "codemirrorMimeType": "text/x-haskell", + "languageId": 137 + }, + "Graph Modeling Language": { + "type": "data", + "extensions": [ + ".gml" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 138 + }, + "GraphQL": { + "type": "data", + "extensions": [ + ".graphql", + ".gql" + ], + "tmScope": "source.graphql", + "aceMode": "text", + "languageId": 139 + }, + "Graphviz (DOT)": { + "type": "data", + "tmScope": "source.dot", + "extensions": [ + ".dot", + ".gv" + ], + "aceMode": "text", + "languageId": 140 + }, + "Groovy": { + "type": "programming", + "aceMode": "groovy", + "codemirrorMode": "groovy", + "codemirrorMimeType": "text/x-groovy", + "color": "#e69f56", + "extensions": [ + ".groovy", + ".grt", + ".gtpl", + ".gvy" + ], + "interpreters": [ + "groovy" + ], + "filenames": [ + "Jenkinsfile" + ], + "languageId": 142 + }, + "Groovy Server Pages": { + "type": "programming", + "group": "Groovy", + "aliases": [ + "gsp", + "java server page" + ], + "extensions": [ + ".gsp" + ], + "tmScope": "text.html.jsp", + "aceMode": "jsp", + "codemirrorMode": "htmlembedded", + "codemirrorMimeType": "application/x-jsp", + "languageId": 143 + }, + "HCL": { + "type": "programming", + "extensions": [ + ".hcl", + ".tf", + ".tfvars" + ], + "aceMode": "ruby", + "codemirrorMode": "ruby", + "codemirrorMimeType": "text/x-ruby", + "tmScope": "source.terraform", + "languageId": 144 + }, + "HLSL": { + "type": "programming", + "extensions": [ + ".hlsl", + ".cginc", + ".fx", + ".fxh", + ".hlsli" + ], + "aceMode": "text", + "tmScope": "source.hlsl", + "languageId": 145 + }, + "HTML": { + "type": "markup", + "tmScope": "text.html.basic", + "aceMode": "html", + "codemirrorMode": "htmlmixed", + "codemirrorMimeType": "text/html", + "color": "#e34c26", + "aliases": [ + "xhtml" + ], + "extensions": [ + ".html", + ".htm", + ".html.hl", + ".inc", + ".st", + ".xht", + ".xhtml" + ], + "languageId": 146 + }, + "HTML+Django": { + "type": "markup", + "tmScope": "text.html.django", + "group": "HTML", + "extensions": [ + ".jinja", + ".jinja2", + ".mustache", + ".njk" + ], + "aliases": [ + "django", + "html+django/jinja", + "html+jinja", + "htmldjango", + "njk", + "nunjucks" + ], + "aceMode": "django", + "codemirrorMode": "django", + "codemirrorMimeType": "text/x-django", + "languageId": 147 + }, + "HTML+ECR": { + "type": "markup", + "tmScope": "text.html.ecr", + "group": "HTML", + "aliases": [ + "ecr" + ], + "extensions": [ + ".ecr" + ], + "aceMode": "text", + "codemirrorMode": "htmlmixed", + "codemirrorMimeType": "text/html", + "languageId": 148 + }, + "HTML+EEX": { + "type": "markup", + "tmScope": "text.html.elixir", + "group": "HTML", + "aliases": [ + "eex" + ], + "extensions": [ + ".eex" + ], + "aceMode": "text", + "codemirrorMode": "htmlmixed", + "codemirrorMimeType": "text/html", + "languageId": 149 + }, + "HTML+ERB": { + "type": "markup", + "tmScope": "text.html.erb", + "group": "HTML", + "aliases": [ + "erb" + ], + "extensions": [ + ".erb", + ".erb.deface" + ], + "aceMode": "text", + "codemirrorMode": "htmlembedded", + "codemirrorMimeType": "application/x-erb", + "languageId": 150 + }, + "HTML+PHP": { + "type": "markup", + "tmScope": "text.html.php", + "group": "HTML", + "extensions": [ + ".phtml" + ], + "aceMode": "php", + "codemirrorMode": "php", + "codemirrorMimeType": "application/x-httpd-php", + "languageId": 151 + }, + "HTTP": { + "type": "data", + "extensions": [ + ".http" + ], + "tmScope": "source.httpspec", + "aceMode": "text", + "codemirrorMode": "http", + "codemirrorMimeType": "message/http", + "languageId": 152 + }, + "HXML": { + "type": "data", + "aceMode": "text", + "extensions": [ + ".hxml" + ], + "tmScope": "source.hxml", + "languageId": 786683730 + }, + "Hack": { + "type": "programming", + "aceMode": "php", + "codemirrorMode": "php", + "codemirrorMimeType": "application/x-httpd-php", + "extensions": [ + ".hh", + ".php" + ], + "tmScope": "text.html.php", + "color": "#878787", + "languageId": 153 + }, + "Haml": { + "group": "HTML", + "type": "markup", + "extensions": [ + ".haml", + ".haml.deface" + ], + "aceMode": "haml", + "codemirrorMode": "haml", + "codemirrorMimeType": "text/x-haml", + "languageId": 154 + }, + "Handlebars": { + "type": "markup", + "group": "HTML", + "aliases": [ + "hbs", + "htmlbars" + ], + "extensions": [ + ".handlebars", + ".hbs" + ], + "tmScope": "text.html.handlebars", + "aceMode": "handlebars", + "languageId": 155 + }, + "Harbour": { + "type": "programming", + "color": "#0e60e3", + "extensions": [ + ".hb" + ], + "tmScope": "source.harbour", + "aceMode": "text", + "languageId": 156 + }, + "Haskell": { + "type": "programming", + "color": "#5e5086", + "extensions": [ + ".hs", + ".hsc" + ], + "interpreters": [ + "runhaskell" + ], + "aceMode": "haskell", + "codemirrorMode": "haskell", + "codemirrorMimeType": "text/x-haskell", + "languageId": 157 + }, + "Haxe": { + "type": "programming", + "aceMode": "haxe", + "codemirrorMode": "haxe", + "codemirrorMimeType": "text/x-haxe", + "color": "#df7900", + "extensions": [ + ".hx", + ".hxsl" + ], + "tmScope": "source.hx", + "languageId": 158 + }, + "HiveQL": { + "type": "programming", + "extensions": [ + ".q" + ], + "color": "#dce200", + "tmScope": "source.hql", + "aceMode": "sql", + "languageId": 931814087 + }, + "Hy": { + "type": "programming", + "aceMode": "text", + "color": "#7790B2", + "extensions": [ + ".hy" + ], + "interpreters": [ + "hy" + ], + "aliases": [ + "hylang" + ], + "tmScope": "source.hy", + "languageId": 159 + }, + "HyPhy": { + "type": "programming", + "aceMode": "text", + "extensions": [ + ".bf" + ], + "tmScope": "none", + "languageId": 160 + }, + "IDL": { + "type": "programming", + "color": "#a3522f", + "extensions": [ + ".pro", + ".dlm" + ], + "aceMode": "text", + "codemirrorMode": "idl", + "codemirrorMimeType": "text/x-idl", + "languageId": 161 + }, + "IGOR Pro": { + "type": "programming", + "extensions": [ + ".ipf" + ], + "aliases": [ + "igor", + "igorpro" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 162 + }, + "INI": { + "type": "data", + "extensions": [ + ".ini", + ".cfg", + ".lektorproject", + ".prefs", + ".pro", + ".properties" + ], + "filenames": [ + ".editorconfig", + ".gitconfig", + "buildozer.spec" + ], + "tmScope": "source.ini", + "aliases": [ + "dosini" + ], + "aceMode": "ini", + "codemirrorMode": "properties", + "codemirrorMimeType": "text/x-properties", + "languageId": 163 + }, + "IRC log": { + "type": "data", + "aliases": [ + "irc", + "irc logs" + ], + "extensions": [ + ".irclog", + ".weechatlog" + ], + "tmScope": "none", + "aceMode": "text", + "codemirrorMode": "mirc", + "codemirrorMimeType": "text/mirc", + "languageId": 164 + }, + "Idris": { + "type": "programming", + "color": "#b30000", + "extensions": [ + ".idr", + ".lidr" + ], + "aceMode": "text", + "tmScope": "source.idris", + "languageId": 165 + }, + "Inform 7": { + "type": "programming", + "wrap": true, + "extensions": [ + ".ni", + ".i7x" + ], + "tmScope": "source.inform7", + "aliases": [ + "i7", + "inform7" + ], + "aceMode": "text", + "languageId": 166 + }, + "Inno Setup": { + "type": "programming", + "extensions": [ + ".iss" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 167 + }, + "Io": { + "type": "programming", + "color": "#a9188d", + "extensions": [ + ".io" + ], + "interpreters": [ + "io" + ], + "aceMode": "io", + "languageId": 168 + }, + "Ioke": { + "type": "programming", + "color": "#078193", + "extensions": [ + ".ik" + ], + "interpreters": [ + "ioke" + ], + "aceMode": "text", + "languageId": 169 + }, + "Isabelle": { + "type": "programming", + "color": "#FEFE00", + "extensions": [ + ".thy" + ], + "tmScope": "source.isabelle.theory", + "aceMode": "text", + "languageId": 170 + }, + "Isabelle ROOT": { + "type": "programming", + "group": "Isabelle", + "filenames": [ + "ROOT" + ], + "tmScope": "source.isabelle.root", + "aceMode": "text", + "languageId": 171 + }, + "J": { + "type": "programming", + "color": "#9EEDFF", + "extensions": [ + ".ijs" + ], + "interpreters": [ + "jconsole" + ], + "tmScope": "source.j", + "aceMode": "text", + "languageId": 172 + }, + "JFlex": { + "type": "programming", + "group": "Lex", + "extensions": [ + ".flex", + ".jflex" + ], + "tmScope": "source.jflex", + "aceMode": "text", + "languageId": 173 + }, + "JSON": { + "type": "data", + "tmScope": "source.json", + "group": "JavaScript", + "aceMode": "json", + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/json", + "searchable": false, + "extensions": [ + ".json", + ".avsc", + ".geojson", + ".gltf", + ".JSON-tmLanguage", + ".jsonl", + ".tfstate", + ".tfstate.backup", + ".topojson", + ".webapp", + ".webmanifest", + ".yy", + ".yyp" + ], + "filenames": [ + ".arcconfig", + ".htmlhintrc", + ".tern-config", + ".tern-project", + "composer.lock", + "mcmod.info" + ], + "languageId": 174 + }, + "JSON with Comments": { + "type": "data", + "group": "JSON", + "tmScope": "source.js", + "aceMode": "javascript", + "codemirrorMode": "javascript", + "codemirrorMimeType": "text/javascript", + "aliases": [ + "jsonc" + ], + "extensions": [ + ".sublime-build", + ".sublime-commands", + ".sublime-completions", + ".sublime-keymap", + ".sublime-macro", + ".sublime-menu", + ".sublime-mousemap", + ".sublime-project", + ".sublime-settings", + ".sublime-theme", + ".sublime-workspace", + ".sublime_metrics", + ".sublime_session" + ], + "filenames": [ + ".babelrc", + ".eslintrc.json", + ".jscsrc", + ".jshintrc", + ".jslintrc", + "tsconfig.json" + ], + "languageId": 423 + }, + "JSON5": { + "type": "data", + "extensions": [ + ".json5" + ], + "tmScope": "source.js", + "aceMode": "javascript", + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/json", + "languageId": 175 + }, + "JSONLD": { + "type": "data", + "group": "JavaScript", + "aceMode": "javascript", + "extensions": [ + ".jsonld" + ], + "tmScope": "source.js", + "languageId": 176 + }, + "JSONiq": { + "color": "#40d47e", + "type": "programming", + "aceMode": "jsoniq", + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/json", + "extensions": [ + ".jq" + ], + "tmScope": "source.jq", + "languageId": 177 + }, + "JSX": { + "type": "programming", + "group": "JavaScript", + "extensions": [ + ".jsx" + ], + "tmScope": "source.js.jsx", + "aceMode": "javascript", + "codemirrorMode": "jsx", + "codemirrorMimeType": "text/jsx", + "languageId": 178 + }, + "Jasmin": { + "type": "programming", + "aceMode": "java", + "extensions": [ + ".j" + ], + "tmScope": "source.jasmin", + "languageId": 180 + }, + "Java": { + "type": "programming", + "aceMode": "java", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-java", + "color": "#b07219", + "extensions": [ + ".java" + ], + "languageId": 181 + }, + "Java Properties": { + "type": "data", + "extensions": [ + ".properties" + ], + "tmScope": "source.java-properties", + "aceMode": "properties", + "codemirrorMode": "properties", + "codemirrorMimeType": "text/x-properties", + "languageId": 519377561 + }, + "Java Server Pages": { + "type": "programming", + "group": "Java", + "aliases": [ + "jsp" + ], + "extensions": [ + ".jsp" + ], + "tmScope": "text.html.jsp", + "aceMode": "jsp", + "codemirrorMode": "htmlembedded", + "codemirrorMimeType": "application/x-jsp", + "languageId": 182 + }, + "JavaScript": { + "type": "programming", + "tmScope": "source.js", + "aceMode": "javascript", + "codemirrorMode": "javascript", + "codemirrorMimeType": "text/javascript", + "color": "#f1e05a", + "aliases": [ + "js", + "node" + ], + "extensions": [ + ".js", + "._js", + ".bones", + ".es", + ".es6", + ".frag", + ".gs", + ".jake", + ".jsb", + ".jscad", + ".jsfl", + ".jsm", + ".jss", + ".mjs", + ".njs", + ".pac", + ".sjs", + ".ssjs", + ".xsjs", + ".xsjslib" + ], + "filenames": [ + "Jakefile" + ], + "interpreters": [ + "node" + ], + "languageId": 183 + }, + "Jison": { + "type": "programming", + "group": "Yacc", + "extensions": [ + ".jison" + ], + "tmScope": "source.jison", + "aceMode": "text", + "languageId": 284531423 + }, + "Jison Lex": { + "type": "programming", + "group": "Lex", + "extensions": [ + ".jisonlex" + ], + "tmScope": "source.jisonlex", + "aceMode": "text", + "languageId": 406395330 + }, + "Jolie": { + "type": "programming", + "extensions": [ + ".ol", + ".iol" + ], + "interpreters": [ + "jolie" + ], + "color": "#843179", + "aceMode": "text", + "tmScope": "source.jolie", + "languageId": 998078858 + }, + "Julia": { + "type": "programming", + "extensions": [ + ".jl" + ], + "interpreters": [ + "julia" + ], + "color": "#a270ba", + "aceMode": "julia", + "codemirrorMode": "julia", + "codemirrorMimeType": "text/x-julia", + "languageId": 184 + }, + "Jupyter Notebook": { + "type": "markup", + "aceMode": "json", + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/json", + "tmScope": "source.json", + "color": "#DA5B0B", + "extensions": [ + ".ipynb" + ], + "filenames": [ + "Notebook" + ], + "aliases": [ + "IPython Notebook" + ], + "languageId": 185 + }, + "KRL": { + "type": "programming", + "color": "#28430A", + "extensions": [ + ".krl" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 186 + }, + "KiCad Layout": { + "type": "data", + "aliases": [ + "pcbnew" + ], + "extensions": [ + ".kicad_pcb", + ".kicad_mod", + ".kicad_wks" + ], + "filenames": [ + "fp-lib-table" + ], + "tmScope": "source.pcb.sexp", + "aceMode": "lisp", + "codemirrorMode": "commonlisp", + "codemirrorMimeType": "text/x-common-lisp", + "languageId": 187 + }, + "KiCad Legacy Layout": { + "type": "data", + "extensions": [ + ".brd" + ], + "tmScope": "source.pcb.board", + "aceMode": "text", + "languageId": 140848857 + }, + "KiCad Schematic": { + "type": "data", + "aliases": [ + "eeschema schematic" + ], + "extensions": [ + ".sch" + ], + "tmScope": "source.pcb.schematic", + "aceMode": "text", + "languageId": 622447435 + }, + "Kit": { + "type": "markup", + "aceMode": "html", + "codemirrorMode": "htmlmixed", + "codemirrorMimeType": "text/html", + "extensions": [ + ".kit" + ], + "tmScope": "text.html.basic", + "languageId": 188 + }, + "Kotlin": { + "type": "programming", + "color": "#F18E33", + "extensions": [ + ".kt", + ".ktm", + ".kts" + ], + "tmScope": "source.kotlin", + "aceMode": "text", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-kotlin", + "languageId": 189 + }, + "LFE": { + "type": "programming", + "color": "#4C3023", + "extensions": [ + ".lfe" + ], + "tmScope": "source.lisp", + "aceMode": "lisp", + "codemirrorMode": "commonlisp", + "codemirrorMimeType": "text/x-common-lisp", + "languageId": 190 + }, + "LLVM": { + "type": "programming", + "extensions": [ + ".ll" + ], + "aceMode": "text", + "color": "#185619", + "languageId": 191 + }, + "LOLCODE": { + "type": "programming", + "extensions": [ + ".lol" + ], + "color": "#cc9900", + "tmScope": "none", + "aceMode": "text", + "languageId": 192 + }, + "LSL": { + "type": "programming", + "aceMode": "lsl", + "extensions": [ + ".lsl", + ".lslp" + ], + "interpreters": [ + "lsl" + ], + "color": "#3d9970", + "languageId": 193 + }, + "LabVIEW": { + "type": "programming", + "extensions": [ + ".lvproj" + ], + "tmScope": "text.xml", + "aceMode": "xml", + "codemirrorMode": "xml", + "codemirrorMimeType": "text/xml", + "languageId": 194 + }, + "Lasso": { + "type": "programming", + "color": "#999999", + "extensions": [ + ".lasso", + ".las", + ".lasso8", + ".lasso9", + ".ldml" + ], + "tmScope": "file.lasso", + "aliases": [ + "lassoscript" + ], + "aceMode": "text", + "languageId": 195 + }, + "Latte": { + "type": "markup", + "group": "HTML", + "extensions": [ + ".latte" + ], + "tmScope": "text.html.smarty", + "aceMode": "smarty", + "codemirrorMode": "smarty", + "codemirrorMimeType": "text/x-smarty", + "languageId": 196 + }, + "Lean": { + "type": "programming", + "extensions": [ + ".lean", + ".hlean" + ], + "aceMode": "text", + "languageId": 197 + }, + "Less": { + "type": "markup", + "group": "CSS", + "extensions": [ + ".less" + ], + "tmScope": "source.css.less", + "aceMode": "less", + "codemirrorMode": "css", + "codemirrorMimeType": "text/css", + "languageId": 198 + }, + "Lex": { + "type": "programming", + "color": "#DBCA00", + "aliases": [ + "flex" + ], + "extensions": [ + ".l", + ".lex" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 199 + }, + "LilyPond": { + "type": "programming", + "extensions": [ + ".ly", + ".ily" + ], + "aceMode": "text", + "languageId": 200 + }, + "Limbo": { + "type": "programming", + "extensions": [ + ".b", + ".m" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 201 + }, + "Linker Script": { + "type": "data", + "extensions": [ + ".ld", + ".lds", + ".x" + ], + "filenames": [ + "ld.script" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 202 + }, + "Linux Kernel Module": { + "type": "data", + "extensions": [ + ".mod" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 203 + }, + "Liquid": { + "type": "markup", + "extensions": [ + ".liquid" + ], + "tmScope": "text.html.liquid", + "aceMode": "liquid", + "languageId": 204 + }, + "Literate Agda": { + "type": "programming", + "group": "Agda", + "extensions": [ + ".lagda" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 205 + }, + "Literate CoffeeScript": { + "type": "programming", + "tmScope": "source.litcoffee", + "group": "CoffeeScript", + "aceMode": "text", + "wrap": true, + "aliases": [ + "litcoffee" + ], + "extensions": [ + ".litcoffee" + ], + "languageId": 206 + }, + "Literate Haskell": { + "type": "programming", + "group": "Haskell", + "aliases": [ + "lhaskell", + "lhs" + ], + "extensions": [ + ".lhs" + ], + "tmScope": "text.tex.latex.haskell", + "aceMode": "text", + "codemirrorMode": "haskell-literate", + "codemirrorMimeType": "text/x-literate-haskell", + "languageId": 207 + }, + "LiveScript": { + "type": "programming", + "color": "#499886", + "aliases": [ + "live-script", + "ls" + ], + "extensions": [ + ".ls", + "._ls" + ], + "filenames": [ + "Slakefile" + ], + "aceMode": "livescript", + "codemirrorMode": "livescript", + "codemirrorMimeType": "text/x-livescript", + "languageId": 208 + }, + "Logos": { + "type": "programming", + "extensions": [ + ".xm", + ".x", + ".xi" + ], + "aceMode": "text", + "tmScope": "source.logos", + "languageId": 209 + }, + "Logtalk": { + "type": "programming", + "extensions": [ + ".lgt", + ".logtalk" + ], + "aceMode": "text", + "languageId": 210 + }, + "LookML": { + "type": "programming", + "aceMode": "yaml", + "codemirrorMode": "yaml", + "codemirrorMimeType": "text/x-yaml", + "color": "#652B81", + "extensions": [ + ".lookml", + ".model.lkml", + ".view.lkml" + ], + "tmScope": "source.yaml", + "languageId": 211 + }, + "LoomScript": { + "type": "programming", + "extensions": [ + ".ls" + ], + "tmScope": "source.loomscript", + "aceMode": "text", + "languageId": 212 + }, + "Lua": { + "type": "programming", + "aceMode": "lua", + "codemirrorMode": "lua", + "codemirrorMimeType": "text/x-lua", + "color": "#000080", + "extensions": [ + ".lua", + ".fcgi", + ".nse", + ".p8", + ".pd_lua", + ".rbxs", + ".wlua" + ], + "interpreters": [ + "lua" + ], + "languageId": 213 + }, + "M": { + "type": "programming", + "aliases": [ + "mumps" + ], + "extensions": [ + ".mumps", + ".m" + ], + "aceMode": "text", + "codemirrorMode": "mumps", + "codemirrorMimeType": "text/x-mumps", + "languageId": 214, + "tmScope": "none" + }, + "M4": { + "type": "programming", + "extensions": [ + ".m4" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 215 + }, + "M4Sugar": { + "type": "programming", + "group": "M4", + "aliases": [ + "autoconf" + ], + "extensions": [ + ".m4" + ], + "filenames": [ + "configure.ac" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 216 + }, + "MAXScript": { + "type": "programming", + "color": "#00a6a6", + "extensions": [ + ".ms", + ".mcr" + ], + "tmScope": "source.maxscript", + "aceMode": "text", + "languageId": 217 + }, + "MQL4": { + "type": "programming", + "color": "#62A8D6", + "extensions": [ + ".mq4", + ".mqh" + ], + "tmScope": "source.mql5", + "aceMode": "c_cpp", + "languageId": 426 + }, + "MQL5": { + "type": "programming", + "color": "#4A76B8", + "extensions": [ + ".mq5", + ".mqh" + ], + "tmScope": "source.mql5", + "aceMode": "c_cpp", + "languageId": 427 + }, + "MTML": { + "type": "markup", + "color": "#b7e1f4", + "extensions": [ + ".mtml" + ], + "tmScope": "text.html.basic", + "aceMode": "html", + "codemirrorMode": "htmlmixed", + "codemirrorMimeType": "text/html", + "languageId": 218 + }, + "MUF": { + "type": "programming", + "group": "Forth", + "extensions": [ + ".muf", + ".m" + ], + "tmScope": "none", + "aceMode": "forth", + "codemirrorMode": "forth", + "codemirrorMimeType": "text/x-forth", + "languageId": 219 + }, + "Makefile": { + "type": "programming", + "color": "#427819", + "aliases": [ + "bsdmake", + "make", + "mf" + ], + "extensions": [ + ".mak", + ".d", + ".make", + ".mk", + ".mkfile" + ], + "filenames": [ + "BSDmakefile", + "GNUmakefile", + "Kbuild", + "Makefile", + "Makefile.am", + "Makefile.boot", + "Makefile.frag", + "Makefile.in", + "Makefile.inc", + "Makefile.wat", + "makefile", + "makefile.sco", + "mkfile" + ], + "interpreters": [ + "make" + ], + "aceMode": "makefile", + "codemirrorMode": "cmake", + "codemirrorMimeType": "text/x-cmake", + "languageId": 220 + }, + "Mako": { + "type": "programming", + "extensions": [ + ".mako", + ".mao" + ], + "tmScope": "text.html.mako", + "aceMode": "text", + "languageId": 221 + }, + "Markdown": { + "type": "prose", + "aliases": [ + "pandoc" + ], + "aceMode": "markdown", + "codemirrorMode": "gfm", + "codemirrorMimeType": "text/x-gfm", + "wrap": true, + "extensions": [ + ".md", + ".markdown", + ".mdown", + ".mdwn", + ".mkd", + ".mkdn", + ".mkdown", + ".ronn", + ".workbook" + ], + "filenames": [ + "contents.lr" + ], + "tmScope": "source.gfm", + "languageId": 222 + }, + "Marko": { + "group": "HTML", + "type": "markup", + "tmScope": "text.marko", + "extensions": [ + ".marko" + ], + "aliases": [ + "markojs" + ], + "aceMode": "text", + "codemirrorMode": "htmlmixed", + "codemirrorMimeType": "text/html", + "languageId": 932782397 + }, + "Mask": { + "type": "markup", + "color": "#f97732", + "aceMode": "mask", + "extensions": [ + ".mask" + ], + "tmScope": "source.mask", + "languageId": 223 + }, + "Mathematica": { + "type": "programming", + "extensions": [ + ".mathematica", + ".cdf", + ".m", + ".ma", + ".mt", + ".nb", + ".nbp", + ".wl", + ".wlt" + ], + "aliases": [ + "mma" + ], + "aceMode": "text", + "codemirrorMode": "mathematica", + "codemirrorMimeType": "text/x-mathematica", + "languageId": 224 + }, + "Matlab": { + "type": "programming", + "color": "#e16737", + "aliases": [ + "octave" + ], + "extensions": [ + ".matlab", + ".m" + ], + "aceMode": "matlab", + "codemirrorMode": "octave", + "codemirrorMimeType": "text/x-octave", + "languageId": 225 + }, + "Maven POM": { + "type": "data", + "tmScope": "text.xml.pom", + "filenames": [ + "pom.xml" + ], + "aceMode": "xml", + "codemirrorMode": "xml", + "codemirrorMimeType": "text/xml", + "languageId": 226 + }, + "Max": { + "type": "programming", + "color": "#c4a79c", + "aliases": [ + "max/msp", + "maxmsp" + ], + "extensions": [ + ".maxpat", + ".maxhelp", + ".maxproj", + ".mxt", + ".pat" + ], + "tmScope": "source.json", + "aceMode": "json", + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/json", + "languageId": 227 + }, + "MediaWiki": { + "type": "prose", + "wrap": true, + "extensions": [ + ".mediawiki", + ".wiki" + ], + "tmScope": "text.html.mediawiki", + "aceMode": "text", + "languageId": 228 + }, + "Mercury": { + "type": "programming", + "color": "#ff2b2b", + "aceMode": "prolog", + "interpreters": [ + "mmi" + ], + "extensions": [ + ".m", + ".moo" + ], + "tmScope": "source.mercury", + "languageId": 229 + }, + "Meson": { + "type": "programming", + "color": "#007800", + "filenames": [ + "meson.build", + "meson_options.txt" + ], + "tmScope": "source.meson", + "aceMode": "text", + "languageId": 799141244 + }, + "Metal": { + "type": "programming", + "color": "#8f14e9", + "extensions": [ + ".metal" + ], + "tmScope": "source.c++", + "aceMode": "c_cpp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-c++src", + "languageId": 230 + }, + "MiniD": { + "type": "programming", + "searchable": false, + "extensions": [ + ".minid" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 231 + }, + "Mirah": { + "type": "programming", + "color": "#c7a938", + "extensions": [ + ".druby", + ".duby", + ".mirah" + ], + "tmScope": "source.ruby", + "aceMode": "ruby", + "codemirrorMode": "ruby", + "codemirrorMimeType": "text/x-ruby", + "languageId": 232 + }, + "Modelica": { + "type": "programming", + "extensions": [ + ".mo" + ], + "tmScope": "source.modelica", + "aceMode": "text", + "codemirrorMode": "modelica", + "codemirrorMimeType": "text/x-modelica", + "languageId": 233 + }, + "Modula-2": { + "type": "programming", + "extensions": [ + ".mod" + ], + "tmScope": "source.modula2", + "aceMode": "text", + "languageId": 234 + }, + "Modula-3": { + "type": "programming", + "extensions": [ + ".i3", + ".ig", + ".m3", + ".mg" + ], + "color": "#223388", + "aceMode": "text", + "tmScope": "source.modula-3", + "languageId": 564743864 + }, + "Module Management System": { + "type": "programming", + "extensions": [ + ".mms", + ".mmk" + ], + "filenames": [ + "descrip.mmk", + "descrip.mms" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 235 + }, + "Monkey": { + "type": "programming", + "extensions": [ + ".monkey", + ".monkey2" + ], + "aceMode": "text", + "tmScope": "source.monkey", + "languageId": 236 + }, + "Moocode": { + "type": "programming", + "extensions": [ + ".moo" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 237 + }, + "MoonScript": { + "type": "programming", + "extensions": [ + ".moon" + ], + "interpreters": [ + "moon" + ], + "aceMode": "text", + "languageId": 238 + }, + "Myghty": { + "type": "programming", + "extensions": [ + ".myt" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 239 + }, + "NCL": { + "type": "programming", + "color": "#28431f", + "extensions": [ + ".ncl" + ], + "tmScope": "source.ncl", + "aceMode": "text", + "languageId": 240 + }, + "NL": { + "type": "data", + "extensions": [ + ".nl" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 241 + }, + "NSIS": { + "type": "programming", + "extensions": [ + ".nsi", + ".nsh" + ], + "aceMode": "text", + "codemirrorMode": "nsis", + "codemirrorMimeType": "text/x-nsis", + "languageId": 242 + }, + "Nearley": { + "type": "programming", + "aceMode": "text", + "color": "#990000", + "extensions": [ + ".ne", + ".nearley" + ], + "tmScope": "source.ne", + "languageId": 521429430 + }, + "Nemerle": { + "type": "programming", + "color": "#3d3c6e", + "extensions": [ + ".n" + ], + "aceMode": "text", + "languageId": 243 + }, + "NetLinx": { + "type": "programming", + "color": "#0aa0ff", + "extensions": [ + ".axs", + ".axi" + ], + "tmScope": "source.netlinx", + "aceMode": "text", + "languageId": 244 + }, + "NetLinx+ERB": { + "type": "programming", + "color": "#747faa", + "extensions": [ + ".axs.erb", + ".axi.erb" + ], + "tmScope": "source.netlinx.erb", + "aceMode": "text", + "languageId": 245 + }, + "NetLogo": { + "type": "programming", + "color": "#ff6375", + "extensions": [ + ".nlogo" + ], + "tmScope": "source.lisp", + "aceMode": "lisp", + "codemirrorMode": "commonlisp", + "codemirrorMimeType": "text/x-common-lisp", + "languageId": 246 + }, + "NewLisp": { + "type": "programming", + "color": "#87AED7", + "extensions": [ + ".nl", + ".lisp", + ".lsp" + ], + "interpreters": [ + "newlisp" + ], + "tmScope": "source.lisp", + "aceMode": "lisp", + "codemirrorMode": "commonlisp", + "codemirrorMimeType": "text/x-common-lisp", + "languageId": 247 + }, + "Nextflow": { + "type": "programming", + "aceMode": "groovy", + "tmScope": "source.nextflow", + "color": "#3ac486", + "extensions": [ + ".nf" + ], + "filenames": [ + "nextflow.config" + ], + "interpreters": [ + "nextflow" + ], + "languageId": 506780613 + }, + "Nginx": { + "type": "data", + "extensions": [ + ".nginxconf", + ".vhost" + ], + "filenames": [ + "nginx.conf" + ], + "tmScope": "source.nginx", + "aliases": [ + "nginx configuration file" + ], + "aceMode": "text", + "codemirrorMode": "nginx", + "codemirrorMimeType": "text/x-nginx-conf", + "languageId": 248 + }, + "Nim": { + "type": "programming", + "color": "#37775b", + "extensions": [ + ".nim", + ".nimrod" + ], + "aceMode": "text", + "tmScope": "source.nim", + "languageId": 249 + }, + "Ninja": { + "type": "data", + "tmScope": "source.ninja", + "extensions": [ + ".ninja" + ], + "aceMode": "text", + "languageId": 250 + }, + "Nit": { + "type": "programming", + "color": "#009917", + "extensions": [ + ".nit" + ], + "tmScope": "source.nit", + "aceMode": "text", + "languageId": 251 + }, + "Nix": { + "type": "programming", + "color": "#7e7eff", + "extensions": [ + ".nix" + ], + "aliases": [ + "nixos" + ], + "tmScope": "source.nix", + "aceMode": "nix", + "languageId": 252 + }, + "Nu": { + "type": "programming", + "color": "#c9df40", + "aliases": [ + "nush" + ], + "extensions": [ + ".nu" + ], + "filenames": [ + "Nukefile" + ], + "tmScope": "source.nu", + "aceMode": "scheme", + "codemirrorMode": "scheme", + "codemirrorMimeType": "text/x-scheme", + "interpreters": [ + "nush" + ], + "languageId": 253 + }, + "NumPy": { + "type": "programming", + "group": "Python", + "extensions": [ + ".numpy", + ".numpyw", + ".numsc" + ], + "tmScope": "none", + "aceMode": "text", + "codemirrorMode": "python", + "codemirrorMimeType": "text/x-python", + "languageId": 254 + }, + "OCaml": { + "type": "programming", + "aceMode": "ocaml", + "codemirrorMode": "mllike", + "codemirrorMimeType": "text/x-ocaml", + "color": "#3be133", + "extensions": [ + ".ml", + ".eliom", + ".eliomi", + ".ml4", + ".mli", + ".mll", + ".mly" + ], + "interpreters": [ + "ocaml", + "ocamlrun", + "ocamlscript" + ], + "tmScope": "source.ocaml", + "languageId": 255 + }, + "ObjDump": { + "type": "data", + "extensions": [ + ".objdump" + ], + "tmScope": "objdump.x86asm", + "aceMode": "assembly_x86", + "languageId": 256 + }, + "Objective-C": { + "type": "programming", + "tmScope": "source.objc", + "color": "#438eff", + "aliases": [ + "obj-c", + "objc", + "objectivec" + ], + "extensions": [ + ".m", + ".h" + ], + "aceMode": "objectivec", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-objectivec", + "languageId": 257 + }, + "Objective-C++": { + "type": "programming", + "tmScope": "source.objc++", + "color": "#6866fb", + "aliases": [ + "obj-c++", + "objc++", + "objectivec++" + ], + "extensions": [ + ".mm" + ], + "aceMode": "objectivec", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-objectivec", + "languageId": 258 + }, + "Objective-J": { + "type": "programming", + "color": "#ff0c5a", + "aliases": [ + "obj-j", + "objectivej", + "objj" + ], + "extensions": [ + ".j", + ".sj" + ], + "tmScope": "source.js.objj", + "aceMode": "text", + "languageId": 259 + }, + "Omgrofl": { + "type": "programming", + "extensions": [ + ".omgrofl" + ], + "color": "#cabbff", + "tmScope": "none", + "aceMode": "text", + "languageId": 260 + }, + "Opa": { + "type": "programming", + "extensions": [ + ".opa" + ], + "aceMode": "text", + "languageId": 261 + }, + "Opal": { + "type": "programming", + "color": "#f7ede0", + "extensions": [ + ".opal" + ], + "tmScope": "source.opal", + "aceMode": "text", + "languageId": 262 + }, + "OpenCL": { + "type": "programming", + "group": "C", + "extensions": [ + ".cl", + ".opencl" + ], + "tmScope": "source.c", + "aceMode": "c_cpp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-csrc", + "languageId": 263 + }, + "OpenEdge ABL": { + "type": "programming", + "aliases": [ + "progress", + "openedge", + "abl" + ], + "extensions": [ + ".p", + ".cls", + ".w" + ], + "tmScope": "source.abl", + "aceMode": "text", + "languageId": 264 + }, + "OpenRC runscript": { + "type": "programming", + "group": "Shell", + "aliases": [ + "openrc" + ], + "interpreters": [ + "openrc-run" + ], + "tmScope": "source.shell", + "aceMode": "sh", + "codemirrorMode": "shell", + "codemirrorMimeType": "text/x-sh", + "languageId": 265 + }, + "OpenSCAD": { + "type": "programming", + "extensions": [ + ".scad" + ], + "tmScope": "source.scad", + "aceMode": "scad", + "languageId": 266 + }, + "OpenType Feature File": { + "type": "data", + "aliases": [ + "AFDKO" + ], + "extensions": [ + ".fea" + ], + "tmScope": "source.opentype", + "aceMode": "text", + "languageId": 374317347 + }, + "Org": { + "type": "prose", + "wrap": true, + "extensions": [ + ".org" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 267 + }, + "Ox": { + "type": "programming", + "extensions": [ + ".ox", + ".oxh", + ".oxo" + ], + "tmScope": "source.ox", + "aceMode": "text", + "languageId": 268 + }, + "Oxygene": { + "type": "programming", + "color": "#cdd0e3", + "extensions": [ + ".oxygene" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 269 + }, + "Oz": { + "type": "programming", + "color": "#fab738", + "extensions": [ + ".oz" + ], + "tmScope": "source.oz", + "aceMode": "text", + "codemirrorMode": "oz", + "codemirrorMimeType": "text/x-oz", + "languageId": 270 + }, + "P4": { + "type": "programming", + "color": "#7055b5", + "extensions": [ + ".p4" + ], + "tmScope": "source.p4", + "aceMode": "text", + "languageId": 348895984 + }, + "PAWN": { + "type": "programming", + "color": "#dbb284", + "extensions": [ + ".pwn", + ".inc" + ], + "tmScope": "source.pawn", + "aceMode": "text", + "languageId": 271 + }, + "PHP": { + "type": "programming", + "tmScope": "text.html.php", + "aceMode": "php", + "codemirrorMode": "php", + "codemirrorMimeType": "application/x-httpd-php", + "color": "#4F5D95", + "extensions": [ + ".php", + ".aw", + ".ctp", + ".fcgi", + ".inc", + ".php3", + ".php4", + ".php5", + ".phps", + ".phpt" + ], + "filenames": [ + ".php", + ".php_cs", + ".php_cs.dist", + "Phakefile" + ], + "interpreters": [ + "php" + ], + "aliases": [ + "inc" + ], + "languageId": 272 + }, + "PLSQL": { + "type": "programming", + "aceMode": "sql", + "codemirrorMode": "sql", + "codemirrorMimeType": "text/x-plsql", + "tmScope": "none", + "color": "#dad8d8", + "extensions": [ + ".pls", + ".bdy", + ".ddl", + ".fnc", + ".pck", + ".pkb", + ".pks", + ".plb", + ".plsql", + ".prc", + ".spc", + ".sql", + ".tpb", + ".tps", + ".trg", + ".vw" + ], + "languageId": 273 + }, + "PLpgSQL": { + "type": "programming", + "aceMode": "pgsql", + "codemirrorMode": "sql", + "codemirrorMimeType": "text/x-sql", + "tmScope": "source.sql", + "extensions": [ + ".sql" + ], + "languageId": 274 + }, + "POV-Ray SDL": { + "type": "programming", + "aliases": [ + "pov-ray", + "povray" + ], + "extensions": [ + ".pov", + ".inc" + ], + "aceMode": "text", + "languageId": 275 + }, + "Pan": { + "type": "programming", + "color": "#cc0000", + "extensions": [ + ".pan" + ], + "tmScope": "source.pan", + "aceMode": "text", + "languageId": 276 + }, + "Papyrus": { + "type": "programming", + "color": "#6600cc", + "extensions": [ + ".psc" + ], + "tmScope": "source.papyrus.skyrim", + "aceMode": "text", + "languageId": 277 + }, + "Parrot": { + "type": "programming", + "color": "#f3ca0a", + "extensions": [ + ".parrot" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 278 + }, + "Parrot Assembly": { + "group": "Parrot", + "type": "programming", + "aliases": [ + "pasm" + ], + "extensions": [ + ".pasm" + ], + "interpreters": [ + "parrot" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 279 + }, + "Parrot Internal Representation": { + "group": "Parrot", + "tmScope": "source.parrot.pir", + "type": "programming", + "aliases": [ + "pir" + ], + "extensions": [ + ".pir" + ], + "interpreters": [ + "parrot" + ], + "aceMode": "text", + "languageId": 280 + }, + "Pascal": { + "type": "programming", + "color": "#E3F171", + "extensions": [ + ".pas", + ".dfm", + ".dpr", + ".inc", + ".lpr", + ".pascal", + ".pp" + ], + "interpreters": [ + "instantfpc" + ], + "aceMode": "pascal", + "codemirrorMode": "pascal", + "codemirrorMimeType": "text/x-pascal", + "languageId": 281 + }, + "Pep8": { + "type": "programming", + "color": "#C76F5B", + "extensions": [ + ".pep" + ], + "aceMode": "text", + "tmScope": "source.pep8", + "languageId": 840372442 + }, + "Perl": { + "type": "programming", + "tmScope": "source.perl", + "aceMode": "perl", + "codemirrorMode": "perl", + "codemirrorMimeType": "text/x-perl", + "color": "#0298c3", + "extensions": [ + ".pl", + ".al", + ".cgi", + ".fcgi", + ".perl", + ".ph", + ".plx", + ".pm", + ".psgi", + ".t" + ], + "filenames": [ + "Makefile.PL", + "Rexfile", + "ack", + "cpanfile" + ], + "interpreters": [ + "cperl", + "perl" + ], + "aliases": [ + "cperl" + ], + "languageId": 282 + }, + "Perl 6": { + "type": "programming", + "color": "#0000fb", + "extensions": [ + ".6pl", + ".6pm", + ".nqp", + ".p6", + ".p6l", + ".p6m", + ".pl", + ".pl6", + ".pm", + ".pm6", + ".t" + ], + "interpreters": [ + "perl6" + ], + "aliases": [ + "perl6" + ], + "tmScope": "source.perl6fe", + "aceMode": "perl", + "codemirrorMode": "perl", + "codemirrorMimeType": "text/x-perl", + "languageId": 283 + }, + "Pic": { + "type": "markup", + "group": "Roff", + "tmScope": "source.pic", + "extensions": [ + ".pic", + ".chem" + ], + "aceMode": "text", + "codemirrorMode": "troff", + "codemirrorMimeType": "text/troff", + "languageId": 425 + }, + "Pickle": { + "type": "data", + "extensions": [ + ".pkl" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 284 + }, + "PicoLisp": { + "type": "programming", + "extensions": [ + ".l" + ], + "interpreters": [ + "picolisp", + "pil" + ], + "tmScope": "source.lisp", + "aceMode": "lisp", + "languageId": 285 + }, + "PigLatin": { + "type": "programming", + "color": "#fcd7de", + "extensions": [ + ".pig" + ], + "tmScope": "source.pig_latin", + "aceMode": "text", + "languageId": 286 + }, + "Pike": { + "type": "programming", + "color": "#005390", + "extensions": [ + ".pike", + ".pmod" + ], + "interpreters": [ + "pike" + ], + "aceMode": "text", + "languageId": 287 + }, + "Pod": { + "type": "prose", + "aceMode": "perl", + "codemirrorMode": "perl", + "codemirrorMimeType": "text/x-perl", + "wrap": true, + "extensions": [ + ".pod" + ], + "interpreters": [ + "perl" + ], + "tmScope": "none", + "languageId": 288 + }, + "PogoScript": { + "type": "programming", + "color": "#d80074", + "extensions": [ + ".pogo" + ], + "tmScope": "source.pogoscript", + "aceMode": "text", + "languageId": 289 + }, + "Pony": { + "type": "programming", + "extensions": [ + ".pony" + ], + "tmScope": "source.pony", + "aceMode": "text", + "languageId": 290 + }, + "PostCSS": { + "type": "markup", + "tmScope": "source.postcss", + "group": "CSS", + "extensions": [ + ".pcss" + ], + "aceMode": "text", + "languageId": 262764437 + }, + "PostScript": { + "type": "markup", + "color": "#da291c", + "extensions": [ + ".ps", + ".eps", + ".pfa" + ], + "tmScope": "source.postscript", + "aliases": [ + "postscr" + ], + "aceMode": "text", + "languageId": 291 + }, + "PowerBuilder": { + "type": "programming", + "color": "#8f0f8d", + "extensions": [ + ".pbt", + ".sra", + ".sru", + ".srw" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 292 + }, + "PowerShell": { + "type": "programming", + "color": "#012456", + "aceMode": "powershell", + "codemirrorMode": "powershell", + "codemirrorMimeType": "application/x-powershell", + "aliases": [ + "posh", + "pwsh" + ], + "extensions": [ + ".ps1", + ".psd1", + ".psm1" + ], + "interpreters": [ + "pwsh" + ], + "languageId": 293 + }, + "Processing": { + "type": "programming", + "color": "#0096D8", + "extensions": [ + ".pde" + ], + "aceMode": "text", + "languageId": 294 + }, + "Prolog": { + "type": "programming", + "color": "#74283c", + "extensions": [ + ".pl", + ".pro", + ".prolog", + ".yap" + ], + "interpreters": [ + "swipl", + "yap" + ], + "tmScope": "source.prolog", + "aceMode": "prolog", + "languageId": 295 + }, + "Propeller Spin": { + "type": "programming", + "color": "#7fa2a7", + "extensions": [ + ".spin" + ], + "tmScope": "source.spin", + "aceMode": "text", + "languageId": 296 + }, + "Protocol Buffer": { + "type": "data", + "aliases": [ + "protobuf", + "Protocol Buffers" + ], + "extensions": [ + ".proto" + ], + "tmScope": "source.protobuf", + "aceMode": "protobuf", + "codemirrorMode": "protobuf", + "codemirrorMimeType": "text/x-protobuf", + "languageId": 297 + }, + "Public Key": { + "type": "data", + "extensions": [ + ".asc", + ".pub" + ], + "tmScope": "none", + "aceMode": "text", + "codemirrorMode": "asciiarmor", + "codemirrorMimeType": "application/pgp", + "languageId": 298 + }, + "Pug": { + "group": "HTML", + "type": "markup", + "extensions": [ + ".jade", + ".pug" + ], + "tmScope": "text.jade", + "aceMode": "jade", + "codemirrorMode": "pug", + "codemirrorMimeType": "text/x-pug", + "languageId": 179 + }, + "Puppet": { + "type": "programming", + "color": "#302B6D", + "extensions": [ + ".pp" + ], + "filenames": [ + "Modulefile" + ], + "aceMode": "text", + "codemirrorMode": "puppet", + "codemirrorMimeType": "text/x-puppet", + "tmScope": "source.puppet", + "languageId": 299 + }, + "Pure Data": { + "type": "data", + "extensions": [ + ".pd" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 300 + }, + "PureBasic": { + "type": "programming", + "color": "#5a6986", + "extensions": [ + ".pb", + ".pbi" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 301 + }, + "PureScript": { + "type": "programming", + "color": "#1D222D", + "extensions": [ + ".purs" + ], + "tmScope": "source.purescript", + "aceMode": "haskell", + "codemirrorMode": "haskell", + "codemirrorMimeType": "text/x-haskell", + "languageId": 302 + }, + "Python": { + "type": "programming", + "aceMode": "python", + "codemirrorMode": "python", + "codemirrorMimeType": "text/x-python", + "color": "#3572A5", + "extensions": [ + ".py", + ".bzl", + ".cgi", + ".fcgi", + ".gyp", + ".gypi", + ".lmi", + ".py3", + ".pyde", + ".pyi", + ".pyp", + ".pyt", + ".pyw", + ".rpy", + ".spec", + ".tac", + ".wsgi", + ".xpy" + ], + "filenames": [ + ".gclient", + "BUCK", + "BUILD", + "BUILD.bazel", + "SConscript", + "SConstruct", + "Snakefile", + "WORKSPACE", + "wscript" + ], + "interpreters": [ + "python", + "python2", + "python3" + ], + "aliases": [ + "rusthon", + "python3" + ], + "languageId": 303 + }, + "Python console": { + "type": "programming", + "group": "Python", + "searchable": false, + "aliases": [ + "pycon" + ], + "tmScope": "text.python.console", + "aceMode": "text", + "languageId": 428 + }, + "Python traceback": { + "type": "data", + "group": "Python", + "searchable": false, + "extensions": [ + ".pytb" + ], + "tmScope": "text.python.traceback", + "aceMode": "text", + "languageId": 304 + }, + "QML": { + "type": "programming", + "color": "#44a51c", + "extensions": [ + ".qml", + ".qbs" + ], + "tmScope": "source.qml", + "aceMode": "text", + "languageId": 305 + }, + "QMake": { + "type": "programming", + "extensions": [ + ".pro", + ".pri" + ], + "interpreters": [ + "qmake" + ], + "aceMode": "text", + "languageId": 306 + }, + "Quake": { + "type": "programming", + "filenames": [ + "m3makefile", + "m3overrides" + ], + "color": "#882233", + "aceMode": "text", + "tmScope": "source.quake", + "languageId": 375265331 + }, + "R": { + "type": "programming", + "color": "#198CE7", + "aliases": [ + "R", + "Rscript", + "splus" + ], + "extensions": [ + ".r", + ".rd", + ".rsx" + ], + "filenames": [ + ".Rprofile", + "expr-dist" + ], + "interpreters": [ + "Rscript" + ], + "aceMode": "r", + "codemirrorMode": "r", + "codemirrorMimeType": "text/x-rsrc", + "languageId": 307 + }, + "RAML": { + "type": "markup", + "aceMode": "yaml", + "codemirrorMode": "yaml", + "codemirrorMimeType": "text/x-yaml", + "tmScope": "source.yaml", + "color": "#77d9fb", + "extensions": [ + ".raml" + ], + "languageId": 308 + }, + "RDoc": { + "type": "prose", + "aceMode": "rdoc", + "wrap": true, + "extensions": [ + ".rdoc" + ], + "tmScope": "text.rdoc", + "languageId": 309 + }, + "REALbasic": { + "type": "programming", + "extensions": [ + ".rbbas", + ".rbfrm", + ".rbmnu", + ".rbres", + ".rbtbar", + ".rbuistate" + ], + "tmScope": "source.vbnet", + "aceMode": "text", + "languageId": 310 + }, + "REXX": { + "type": "programming", + "aliases": [ + "arexx" + ], + "extensions": [ + ".rexx", + ".pprx", + ".rex" + ], + "interpreters": [ + "regina", + "rexx" + ], + "tmScope": "source.rexx", + "aceMode": "text", + "languageId": 311 + }, + "RHTML": { + "type": "markup", + "group": "HTML", + "extensions": [ + ".rhtml" + ], + "tmScope": "text.html.erb", + "aliases": [ + "html+ruby" + ], + "aceMode": "rhtml", + "codemirrorMode": "htmlembedded", + "codemirrorMimeType": "application/x-erb", + "languageId": 312 + }, + "RMarkdown": { + "type": "prose", + "wrap": true, + "aceMode": "markdown", + "codemirrorMode": "gfm", + "codemirrorMimeType": "text/x-gfm", + "extensions": [ + ".rmd" + ], + "tmScope": "source.gfm", + "languageId": 313 + }, + "RPC": { + "type": "programming", + "aliases": [ + "rpcgen", + "oncrpc", + "xdr" + ], + "aceMode": "c_cpp", + "extensions": [ + ".x" + ], + "tmScope": "source.c", + "languageId": 1031374237 + }, + "RPM Spec": { + "type": "data", + "tmScope": "source.rpm-spec", + "extensions": [ + ".spec" + ], + "aliases": [ + "specfile" + ], + "aceMode": "text", + "codemirrorMode": "rpm", + "codemirrorMimeType": "text/x-rpm-spec", + "languageId": 314 + }, + "RUNOFF": { + "type": "markup", + "color": "#665a4e", + "extensions": [ + ".rnh", + ".rno" + ], + "tmScope": "text.runoff", + "aceMode": "text", + "languageId": 315 + }, + "Racket": { + "type": "programming", + "color": "#22228f", + "extensions": [ + ".rkt", + ".rktd", + ".rktl", + ".scrbl" + ], + "interpreters": [ + "racket" + ], + "tmScope": "source.racket", + "aceMode": "lisp", + "languageId": 316 + }, + "Ragel": { + "type": "programming", + "color": "#9d5200", + "extensions": [ + ".rl" + ], + "aliases": [ + "ragel-rb", + "ragel-ruby" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 317 + }, + "Rascal": { + "type": "programming", + "color": "#fffaa0", + "extensions": [ + ".rsc" + ], + "tmScope": "source.rascal", + "aceMode": "text", + "languageId": 173616037 + }, + "Raw token data": { + "type": "data", + "aliases": [ + "raw" + ], + "extensions": [ + ".raw" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 318 + }, + "Reason": { + "type": "programming", + "group": "OCaml", + "aceMode": "rust", + "codemirrorMode": "rust", + "codemirrorMimeType": "text/x-rustsrc", + "extensions": [ + ".re", + ".rei" + ], + "interpreters": [ + "ocaml" + ], + "tmScope": "source.reason", + "languageId": 869538413 + }, + "Rebol": { + "type": "programming", + "color": "#358a5b", + "extensions": [ + ".reb", + ".r", + ".r2", + ".r3", + ".rebol" + ], + "aceMode": "text", + "tmScope": "source.rebol", + "languageId": 319 + }, + "Red": { + "type": "programming", + "color": "#f50000", + "extensions": [ + ".red", + ".reds" + ], + "aliases": [ + "red/system" + ], + "tmScope": "source.red", + "aceMode": "text", + "languageId": 320 + }, + "Redcode": { + "type": "programming", + "extensions": [ + ".cw" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 321 + }, + "Regular Expression": { + "type": "data", + "extensions": [ + ".regexp", + ".regex" + ], + "aliases": [ + "regexp", + "regex" + ], + "aceMode": "text", + "tmScope": "source.regexp", + "languageId": 363378884 + }, + "Ren'Py": { + "type": "programming", + "aliases": [ + "renpy" + ], + "color": "#ff7f7f", + "extensions": [ + ".rpy" + ], + "tmScope": "source.renpy", + "aceMode": "python", + "languageId": 322 + }, + "RenderScript": { + "type": "programming", + "extensions": [ + ".rs", + ".rsh" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 323 + }, + "Ring": { + "type": "programming", + "color": "#2D54CB", + "extensions": [ + ".ring" + ], + "tmScope": "source.ring", + "aceMode": "text", + "languageId": 431 + }, + "RobotFramework": { + "type": "programming", + "extensions": [ + ".robot" + ], + "tmScope": "text.robot", + "aceMode": "text", + "languageId": 324 + }, + "Roff": { + "type": "markup", + "color": "#ecdebe", + "extensions": [ + ".roff", + ".1", + ".1in", + ".1m", + ".1x", + ".2", + ".3", + ".3in", + ".3m", + ".3qt", + ".3x", + ".4", + ".5", + ".6", + ".7", + ".8", + ".9", + ".l", + ".man", + ".mdoc", + ".me", + ".ms", + ".n", + ".nr", + ".rno", + ".tmac" + ], + "filenames": [ + "mmn", + "mmt" + ], + "tmScope": "text.roff", + "aliases": [ + "groff", + "man", + "manpage", + "man page", + "man-page", + "mdoc", + "nroff", + "troff" + ], + "aceMode": "text", + "codemirrorMode": "troff", + "codemirrorMimeType": "text/troff", + "languageId": 141 + }, + "Rouge": { + "type": "programming", + "aceMode": "clojure", + "codemirrorMode": "clojure", + "codemirrorMimeType": "text/x-clojure", + "color": "#cc0088", + "extensions": [ + ".rg" + ], + "tmScope": "source.clojure", + "languageId": 325 + }, + "Ruby": { + "type": "programming", + "aceMode": "ruby", + "codemirrorMode": "ruby", + "codemirrorMimeType": "text/x-ruby", + "color": "#701516", + "aliases": [ + "jruby", + "macruby", + "rake", + "rb", + "rbx" + ], + "extensions": [ + ".rb", + ".builder", + ".eye", + ".fcgi", + ".gemspec", + ".god", + ".jbuilder", + ".mspec", + ".pluginspec", + ".podspec", + ".rabl", + ".rake", + ".rbuild", + ".rbw", + ".rbx", + ".ru", + ".ruby", + ".spec", + ".thor", + ".watchr" + ], + "interpreters": [ + "ruby", + "macruby", + "rake", + "jruby", + "rbx" + ], + "filenames": [ + ".irbrc", + ".pryrc", + "Appraisals", + "Berksfile", + "Brewfile", + "Buildfile", + "Capfile", + "Dangerfile", + "Deliverfile", + "Fastfile", + "Gemfile", + "Gemfile.lock", + "Guardfile", + "Jarfile", + "Mavenfile", + "Podfile", + "Puppetfile", + "Rakefile", + "Snapfile", + "Thorfile", + "Vagrantfile", + "buildfile" + ], + "languageId": 326 + }, + "Rust": { + "type": "programming", + "color": "#dea584", + "extensions": [ + ".rs", + ".rs.in" + ], + "aceMode": "rust", + "codemirrorMode": "rust", + "codemirrorMimeType": "text/x-rustsrc", + "languageId": 327 + }, + "SAS": { + "type": "programming", + "color": "#B34936", + "extensions": [ + ".sas" + ], + "tmScope": "source.sas", + "aceMode": "text", + "codemirrorMode": "sas", + "codemirrorMimeType": "text/x-sas", + "languageId": 328 + }, + "SCSS": { + "type": "markup", + "tmScope": "source.scss", + "group": "CSS", + "aceMode": "scss", + "codemirrorMode": "css", + "codemirrorMimeType": "text/x-scss", + "extensions": [ + ".scss" + ], + "languageId": 329 + }, + "SMT": { + "type": "programming", + "extensions": [ + ".smt2", + ".smt" + ], + "interpreters": [ + "boolector", + "cvc4", + "mathsat5", + "opensmt", + "smtinterpol", + "smt-rat", + "stp", + "verit", + "yices2", + "z3" + ], + "tmScope": "source.smt", + "aceMode": "text", + "languageId": 330 + }, + "SPARQL": { + "type": "data", + "tmScope": "source.sparql", + "aceMode": "text", + "codemirrorMode": "sparql", + "codemirrorMimeType": "application/sparql-query", + "extensions": [ + ".sparql", + ".rq" + ], + "languageId": 331 + }, + "SQF": { + "type": "programming", + "color": "#3F3F3F", + "extensions": [ + ".sqf", + ".hqf" + ], + "tmScope": "source.sqf", + "aceMode": "text", + "languageId": 332 + }, + "SQL": { + "type": "data", + "tmScope": "source.sql", + "aceMode": "sql", + "codemirrorMode": "sql", + "codemirrorMimeType": "text/x-sql", + "extensions": [ + ".sql", + ".cql", + ".ddl", + ".inc", + ".mysql", + ".prc", + ".tab", + ".udf", + ".viw" + ], + "languageId": 333 + }, + "SQLPL": { + "type": "programming", + "aceMode": "sql", + "codemirrorMode": "sql", + "codemirrorMimeType": "text/x-sql", + "tmScope": "source.sql", + "extensions": [ + ".sql", + ".db2" + ], + "languageId": 334 + }, + "SRecode Template": { + "type": "markup", + "color": "#348a34", + "tmScope": "source.lisp", + "aceMode": "lisp", + "codemirrorMode": "commonlisp", + "codemirrorMimeType": "text/x-common-lisp", + "extensions": [ + ".srt" + ], + "languageId": 335 + }, + "STON": { + "type": "data", + "group": "Smalltalk", + "extensions": [ + ".ston" + ], + "tmScope": "source.smalltalk", + "aceMode": "text", + "languageId": 336 + }, + "SVG": { + "type": "data", + "extensions": [ + ".svg" + ], + "tmScope": "text.xml", + "aceMode": "xml", + "codemirrorMode": "xml", + "codemirrorMimeType": "text/xml", + "languageId": 337 + }, + "Sage": { + "type": "programming", + "group": "Python", + "extensions": [ + ".sage", + ".sagews" + ], + "tmScope": "source.python", + "aceMode": "python", + "codemirrorMode": "python", + "codemirrorMimeType": "text/x-python", + "languageId": 338 + }, + "SaltStack": { + "type": "programming", + "color": "#646464", + "aliases": [ + "saltstate", + "salt" + ], + "extensions": [ + ".sls" + ], + "tmScope": "source.yaml.salt", + "aceMode": "yaml", + "codemirrorMode": "yaml", + "codemirrorMimeType": "text/x-yaml", + "languageId": 339 + }, + "Sass": { + "type": "markup", + "tmScope": "source.sass", + "group": "CSS", + "extensions": [ + ".sass" + ], + "aceMode": "sass", + "codemirrorMode": "sass", + "codemirrorMimeType": "text/x-sass", + "languageId": 340 + }, + "Scala": { + "type": "programming", + "aceMode": "scala", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-scala", + "color": "#c22d40", + "extensions": [ + ".scala", + ".kojo", + ".sbt", + ".sc" + ], + "interpreters": [ + "scala" + ], + "languageId": 341 + }, + "Scaml": { + "group": "HTML", + "type": "markup", + "extensions": [ + ".scaml" + ], + "tmScope": "source.scaml", + "aceMode": "text", + "languageId": 342 + }, + "Scheme": { + "type": "programming", + "color": "#1e4aec", + "extensions": [ + ".scm", + ".sch", + ".sld", + ".sls", + ".sps", + ".ss" + ], + "interpreters": [ + "guile", + "bigloo", + "chicken", + "csi", + "gosh", + "r6rs" + ], + "aceMode": "scheme", + "codemirrorMode": "scheme", + "codemirrorMimeType": "text/x-scheme", + "languageId": 343 + }, + "Scilab": { + "type": "programming", + "extensions": [ + ".sci", + ".sce", + ".tst" + ], + "aceMode": "text", + "languageId": 344 + }, + "Self": { + "type": "programming", + "color": "#0579aa", + "extensions": [ + ".self" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 345 + }, + "ShaderLab": { + "type": "programming", + "extensions": [ + ".shader" + ], + "aceMode": "text", + "tmScope": "source.shaderlab", + "languageId": 664257356 + }, + "Shell": { + "type": "programming", + "color": "#89e051", + "aliases": [ + "sh", + "shell-script", + "bash", + "zsh" + ], + "extensions": [ + ".sh", + ".bash", + ".bats", + ".cgi", + ".command", + ".fcgi", + ".ksh", + ".sh.in", + ".tmux", + ".tool", + ".zsh" + ], + "filenames": [ + ".bash_history", + ".bash_logout", + ".bash_profile", + ".bashrc", + ".cshrc", + ".login", + ".profile", + ".zlogin", + ".zlogout", + ".zprofile", + ".zshenv", + ".zshrc", + "9fs", + "PKGBUILD", + "bash_logout", + "bash_profile", + "bashrc", + "cshrc", + "gradlew", + "login", + "man", + "profile", + "zlogin", + "zlogout", + "zprofile", + "zshenv", + "zshrc" + ], + "interpreters": [ + "ash", + "bash", + "dash", + "ksh", + "mksh", + "pdksh", + "rc", + "sh", + "zsh" + ], + "aceMode": "sh", + "codemirrorMode": "shell", + "codemirrorMimeType": "text/x-sh", + "languageId": 346 + }, + "ShellSession": { + "type": "programming", + "extensions": [ + ".sh-session" + ], + "aliases": [ + "bash session", + "console" + ], + "tmScope": "text.shell-session", + "aceMode": "sh", + "codemirrorMode": "shell", + "codemirrorMimeType": "text/x-sh", + "languageId": 347 + }, + "Shen": { + "type": "programming", + "color": "#120F14", + "extensions": [ + ".shen" + ], + "tmScope": "source.shen", + "aceMode": "text", + "languageId": 348 + }, + "Slash": { + "type": "programming", + "color": "#007eff", + "extensions": [ + ".sl" + ], + "tmScope": "text.html.slash", + "aceMode": "text", + "languageId": 349 + }, + "Slice": { + "type": "programming", + "color": "#003fa2", + "tmScope": "source.slice", + "aceMode": "text", + "extensions": [ + ".ice" + ], + "languageId": 894641667 + }, + "Slim": { + "group": "HTML", + "type": "markup", + "extensions": [ + ".slim" + ], + "tmScope": "text.slim", + "aceMode": "text", + "codemirrorMode": "slim", + "codemirrorMimeType": "text/x-slim", + "languageId": 350 + }, + "Smali": { + "type": "programming", + "extensions": [ + ".smali" + ], + "aceMode": "text", + "tmScope": "source.smali", + "languageId": 351 + }, + "Smalltalk": { + "type": "programming", + "color": "#596706", + "extensions": [ + ".st", + ".cs" + ], + "aliases": [ + "squeak" + ], + "aceMode": "text", + "codemirrorMode": "smalltalk", + "codemirrorMimeType": "text/x-stsrc", + "languageId": 352 + }, + "Smarty": { + "type": "programming", + "extensions": [ + ".tpl" + ], + "aceMode": "smarty", + "codemirrorMode": "smarty", + "codemirrorMimeType": "text/x-smarty", + "tmScope": "text.html.smarty", + "languageId": 353 + }, + "Solidity": { + "type": "programming", + "color": "#AA6746", + "aceMode": "text", + "tmScope": "source.solidity", + "languageId": 237469032 + }, + "SourcePawn": { + "type": "programming", + "color": "#5c7611", + "aliases": [ + "sourcemod" + ], + "extensions": [ + ".sp", + ".inc", + ".sma" + ], + "tmScope": "source.sp", + "aceMode": "text", + "languageId": 354 + }, + "Spline Font Database": { + "type": "data", + "extensions": [ + ".sfd" + ], + "tmScope": "text.sfd", + "aceMode": "yaml", + "languageId": 767169629 + }, + "Squirrel": { + "type": "programming", + "color": "#800000", + "extensions": [ + ".nut" + ], + "tmScope": "source.c++", + "aceMode": "c_cpp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-c++src", + "languageId": 355 + }, + "Stan": { + "type": "programming", + "color": "#b2011d", + "extensions": [ + ".stan" + ], + "aceMode": "text", + "tmScope": "source.stan", + "languageId": 356 + }, + "Standard ML": { + "type": "programming", + "color": "#dc566d", + "aliases": [ + "sml" + ], + "extensions": [ + ".ML", + ".fun", + ".sig", + ".sml" + ], + "tmScope": "source.ml", + "aceMode": "text", + "codemirrorMode": "mllike", + "codemirrorMimeType": "text/x-ocaml", + "languageId": 357 + }, + "Stata": { + "type": "programming", + "extensions": [ + ".do", + ".ado", + ".doh", + ".ihlp", + ".mata", + ".matah", + ".sthlp" + ], + "aceMode": "text", + "languageId": 358 + }, + "Stylus": { + "type": "markup", + "group": "CSS", + "extensions": [ + ".styl" + ], + "tmScope": "source.stylus", + "aceMode": "stylus", + "languageId": 359 + }, + "SubRip Text": { + "type": "data", + "extensions": [ + ".srt" + ], + "aceMode": "text", + "tmScope": "text.srt", + "languageId": 360 + }, + "SugarSS": { + "type": "markup", + "tmScope": "source.css.postcss.sugarss", + "group": "CSS", + "extensions": [ + ".sss" + ], + "aceMode": "text", + "languageId": 826404698 + }, + "SuperCollider": { + "type": "programming", + "color": "#46390b", + "extensions": [ + ".sc", + ".scd" + ], + "interpreters": [ + "sclang", + "scsynth" + ], + "tmScope": "source.supercollider", + "aceMode": "text", + "languageId": 361 + }, + "Swift": { + "type": "programming", + "color": "#ffac45", + "extensions": [ + ".swift" + ], + "aceMode": "text", + "codemirrorMode": "swift", + "codemirrorMimeType": "text/x-swift", + "languageId": 362 + }, + "SystemVerilog": { + "type": "programming", + "color": "#DAE1C2", + "extensions": [ + ".sv", + ".svh", + ".vh" + ], + "aceMode": "verilog", + "codemirrorMode": "verilog", + "codemirrorMimeType": "text/x-systemverilog", + "languageId": 363 + }, + "TI Program": { + "type": "programming", + "aceMode": "text", + "color": "#A0AA87", + "extensions": [ + ".8xp", + ".8xk", + ".8xk.txt", + ".8xp.txt" + ], + "languageId": 422, + "tmScope": "none" + }, + "TLA": { + "type": "programming", + "extensions": [ + ".tla" + ], + "tmScope": "source.tla", + "aceMode": "text", + "languageId": 364 + }, + "TOML": { + "type": "data", + "extensions": [ + ".toml" + ], + "filenames": [ + "Cargo.lock", + "Gopkg.lock" + ], + "tmScope": "source.toml", + "aceMode": "toml", + "codemirrorMode": "toml", + "codemirrorMimeType": "text/x-toml", + "languageId": 365 + }, + "TXL": { + "type": "programming", + "extensions": [ + ".txl" + ], + "tmScope": "source.txl", + "aceMode": "text", + "languageId": 366 + }, + "Tcl": { + "type": "programming", + "color": "#e4cc98", + "extensions": [ + ".tcl", + ".adp", + ".tm" + ], + "filenames": [ + "owh", + "starfield" + ], + "interpreters": [ + "tclsh", + "wish" + ], + "aceMode": "tcl", + "codemirrorMode": "tcl", + "codemirrorMimeType": "text/x-tcl", + "languageId": 367 + }, + "Tcsh": { + "type": "programming", + "group": "Shell", + "extensions": [ + ".tcsh", + ".csh" + ], + "tmScope": "source.shell", + "aceMode": "sh", + "codemirrorMode": "shell", + "codemirrorMimeType": "text/x-sh", + "languageId": 368 + }, + "TeX": { + "type": "markup", + "color": "#3D6117", + "aceMode": "tex", + "codemirrorMode": "stex", + "codemirrorMimeType": "text/x-stex", + "wrap": true, + "aliases": [ + "latex" + ], + "extensions": [ + ".tex", + ".aux", + ".bbx", + ".bib", + ".cbx", + ".cls", + ".dtx", + ".ins", + ".lbx", + ".ltx", + ".mkii", + ".mkiv", + ".mkvi", + ".sty", + ".toc" + ], + "languageId": 369 + }, + "Tea": { + "type": "markup", + "extensions": [ + ".tea" + ], + "tmScope": "source.tea", + "aceMode": "text", + "languageId": 370 + }, + "Terra": { + "type": "programming", + "extensions": [ + ".t" + ], + "color": "#00004c", + "aceMode": "lua", + "codemirrorMode": "lua", + "codemirrorMimeType": "text/x-lua", + "interpreters": [ + "lua" + ], + "languageId": 371 + }, + "Text": { + "type": "prose", + "wrap": true, + "aliases": [ + "fundamental" + ], + "extensions": [ + ".txt", + ".fr", + ".nb", + ".ncl", + ".no" + ], + "filenames": [ + "COPYING", + "COPYING.regex", + "COPYRIGHT.regex", + "FONTLOG", + "INSTALL", + "INSTALL.mysql", + "LICENSE", + "LICENSE.mysql", + "NEWS", + "README.1ST", + "README.me", + "README.mysql", + "click.me", + "delete.me", + "keep.me", + "read.me", + "readme.1st", + "test.me" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 372 + }, + "Textile": { + "type": "prose", + "aceMode": "textile", + "codemirrorMode": "textile", + "codemirrorMimeType": "text/x-textile", + "wrap": true, + "extensions": [ + ".textile" + ], + "tmScope": "none", + "languageId": 373 + }, + "Thrift": { + "type": "programming", + "tmScope": "source.thrift", + "extensions": [ + ".thrift" + ], + "aceMode": "text", + "languageId": 374 + }, + "Turing": { + "type": "programming", + "color": "#cf142b", + "extensions": [ + ".t", + ".tu" + ], + "tmScope": "source.turing", + "aceMode": "text", + "languageId": 375 + }, + "Turtle": { + "type": "data", + "extensions": [ + ".ttl" + ], + "tmScope": "source.turtle", + "aceMode": "text", + "codemirrorMode": "turtle", + "codemirrorMimeType": "text/turtle", + "languageId": 376 + }, + "Twig": { + "type": "markup", + "group": "HTML", + "extensions": [ + ".twig" + ], + "tmScope": "text.html.twig", + "aceMode": "twig", + "codemirrorMode": "twig", + "codemirrorMimeType": "text/x-twig", + "languageId": 377 + }, + "Type Language": { + "type": "data", + "aliases": [ + "tl" + ], + "extensions": [ + ".tl" + ], + "tmScope": "source.tl", + "aceMode": "text", + "languageId": 632765617 + }, + "TypeScript": { + "type": "programming", + "color": "#2b7489", + "aliases": [ + "ts" + ], + "interpreters": [ + "node" + ], + "extensions": [ + ".ts", + ".tsx" + ], + "tmScope": "source.ts", + "aceMode": "typescript", + "codemirrorMode": "javascript", + "codemirrorMimeType": "application/typescript", + "languageId": 378 + }, + "Unified Parallel C": { + "type": "programming", + "group": "C", + "aceMode": "c_cpp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-csrc", + "extensions": [ + ".upc" + ], + "tmScope": "source.c", + "languageId": 379 + }, + "Unity3D Asset": { + "type": "data", + "aceMode": "yaml", + "codemirrorMode": "yaml", + "codemirrorMimeType": "text/x-yaml", + "extensions": [ + ".anim", + ".asset", + ".mat", + ".meta", + ".prefab", + ".unity" + ], + "tmScope": "source.yaml", + "languageId": 380 + }, + "Unix Assembly": { + "type": "programming", + "group": "Assembly", + "extensions": [ + ".s", + ".ms" + ], + "tmScope": "source.x86", + "aceMode": "assembly_x86", + "languageId": 120 + }, + "Uno": { + "type": "programming", + "extensions": [ + ".uno" + ], + "aceMode": "csharp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-csharp", + "tmScope": "source.cs", + "languageId": 381 + }, + "UnrealScript": { + "type": "programming", + "color": "#a54c4d", + "extensions": [ + ".uc" + ], + "tmScope": "source.java", + "aceMode": "java", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-java", + "languageId": 382 + }, + "UrWeb": { + "type": "programming", + "aliases": [ + "Ur/Web", + "Ur" + ], + "extensions": [ + ".ur", + ".urs" + ], + "tmScope": "source.ur", + "aceMode": "text", + "languageId": 383 + }, + "VCL": { + "type": "programming", + "color": "#148AA8", + "extensions": [ + ".vcl" + ], + "tmScope": "source.varnish.vcl", + "aceMode": "text", + "languageId": 384 + }, + "VHDL": { + "type": "programming", + "color": "#adb2cb", + "extensions": [ + ".vhdl", + ".vhd", + ".vhf", + ".vhi", + ".vho", + ".vhs", + ".vht", + ".vhw" + ], + "aceMode": "vhdl", + "codemirrorMode": "vhdl", + "codemirrorMimeType": "text/x-vhdl", + "languageId": 385 + }, + "Vala": { + "type": "programming", + "color": "#fbe5cd", + "extensions": [ + ".vala", + ".vapi" + ], + "aceMode": "vala", + "languageId": 386 + }, + "Verilog": { + "type": "programming", + "color": "#b2b7f8", + "extensions": [ + ".v", + ".veo" + ], + "aceMode": "verilog", + "codemirrorMode": "verilog", + "codemirrorMimeType": "text/x-verilog", + "languageId": 387 + }, + "Vim script": { + "type": "programming", + "color": "#199f4b", + "tmScope": "source.viml", + "aliases": [ + "vim", + "viml", + "nvim" + ], + "extensions": [ + ".vim" + ], + "filenames": [ + ".gvimrc", + ".nvimrc", + ".vimrc", + "_vimrc", + "gvimrc", + "nvimrc", + "vimrc" + ], + "aceMode": "text", + "languageId": 388 + }, + "Visual Basic": { + "type": "programming", + "color": "#945db7", + "extensions": [ + ".vb", + ".bas", + ".cls", + ".frm", + ".frx", + ".vba", + ".vbhtml", + ".vbs" + ], + "tmScope": "source.vbnet", + "aliases": [ + "vb.net", + "vbnet" + ], + "aceMode": "text", + "codemirrorMode": "vb", + "codemirrorMimeType": "text/x-vb", + "languageId": 389 + }, + "Volt": { + "type": "programming", + "color": "#1F1F1F", + "extensions": [ + ".volt" + ], + "tmScope": "source.d", + "aceMode": "d", + "codemirrorMode": "d", + "codemirrorMimeType": "text/x-d", + "languageId": 390 + }, + "Vue": { + "type": "markup", + "color": "#2c3e50", + "extensions": [ + ".vue" + ], + "tmScope": "text.html.vue", + "aceMode": "html", + "languageId": 391 + }, + "Wavefront Material": { + "type": "data", + "extensions": [ + ".mtl" + ], + "tmScope": "source.wavefront.mtl", + "aceMode": "text", + "languageId": 392 + }, + "Wavefront Object": { + "type": "data", + "extensions": [ + ".obj" + ], + "tmScope": "source.wavefront.obj", + "aceMode": "text", + "languageId": 393 + }, + "Web Ontology Language": { + "type": "data", + "extensions": [ + ".owl" + ], + "tmScope": "text.xml", + "aceMode": "xml", + "languageId": 394 + }, + "WebAssembly": { + "type": "programming", + "color": "#04133b", + "extensions": [ + ".wast", + ".wat" + ], + "aliases": [ + "wast", + "wasm" + ], + "tmScope": "source.webassembly", + "aceMode": "lisp", + "codemirrorMode": "commonlisp", + "codemirrorMimeType": "text/x-common-lisp", + "languageId": 956556503 + }, + "WebIDL": { + "type": "programming", + "extensions": [ + ".webidl" + ], + "tmScope": "source.webidl", + "aceMode": "text", + "codemirrorMode": "webidl", + "codemirrorMimeType": "text/x-webidl", + "languageId": 395 + }, + "Windows Registry Entries": { + "type": "data", + "extensions": [ + ".reg" + ], + "tmScope": "source.reg", + "aceMode": "ini", + "codemirrorMode": "properties", + "codemirrorMimeType": "text/x-properties", + "languageId": 969674868 + }, + "World of Warcraft Addon Data": { + "type": "data", + "extensions": [ + ".toc" + ], + "tmScope": "source.toc", + "aceMode": "text", + "languageId": 396 + }, + "X BitMap": { + "type": "data", + "group": "C", + "aliases": [ + "xbm" + ], + "extensions": [ + ".xbm" + ], + "aceMode": "c_cpp", + "tmScope": "source.c", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-csrc", + "languageId": 782911107 + }, + "X Font Directory Index": { + "type": "data", + "filenames": [ + "encodings.dir", + "fonts.alias", + "fonts.dir", + "fonts.scale" + ], + "tmScope": "source.fontdir", + "aceMode": "text", + "languageId": 208700028 + }, + "X PixMap": { + "type": "data", + "group": "C", + "aliases": [ + "xpm" + ], + "extensions": [ + ".xpm", + ".pm" + ], + "aceMode": "c_cpp", + "tmScope": "source.c", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-csrc", + "languageId": 781846279 + }, + "X10": { + "type": "programming", + "aliases": [ + "xten" + ], + "aceMode": "text", + "extensions": [ + ".x10" + ], + "color": "#4B6BEF", + "tmScope": "source.x10", + "languageId": 397 + }, + "XC": { + "type": "programming", + "color": "#99DA07", + "extensions": [ + ".xc" + ], + "tmScope": "source.xc", + "aceMode": "c_cpp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-csrc", + "languageId": 398 + }, + "XCompose": { + "type": "data", + "filenames": [ + ".XCompose", + "XCompose", + "xcompose" + ], + "tmScope": "config.xcompose", + "aceMode": "text", + "languageId": 225167241 + }, + "XML": { + "type": "data", + "aceMode": "xml", + "codemirrorMode": "xml", + "codemirrorMimeType": "text/xml", + "aliases": [ + "rss", + "xsd", + "wsdl" + ], + "extensions": [ + ".xml", + ".adml", + ".admx", + ".ant", + ".axml", + ".builds", + ".ccproj", + ".ccxml", + ".clixml", + ".cproject", + ".cscfg", + ".csdef", + ".csl", + ".csproj", + ".ct", + ".depproj", + ".dita", + ".ditamap", + ".ditaval", + ".dll.config", + ".dotsettings", + ".filters", + ".fsproj", + ".fxml", + ".glade", + ".gml", + ".gmx", + ".grxml", + ".iml", + ".ivy", + ".jelly", + ".jsproj", + ".kml", + ".launch", + ".mdpolicy", + ".mjml", + ".mm", + ".mod", + ".mxml", + ".natvis", + ".ncl", + ".ndproj", + ".nproj", + ".nuspec", + ".odd", + ".osm", + ".pkgproj", + ".plist", + ".pluginspec", + ".proj", + ".props", + ".ps1xml", + ".psc1", + ".pt", + ".rdf", + ".resx", + ".rss", + ".sch", + ".scxml", + ".sfproj", + ".shproj", + ".srdf", + ".storyboard", + ".stTheme", + ".sublime-snippet", + ".targets", + ".tmCommand", + ".tml", + ".tmLanguage", + ".tmPreferences", + ".tmSnippet", + ".tmTheme", + ".ts", + ".tsx", + ".ui", + ".urdf", + ".ux", + ".vbproj", + ".vcxproj", + ".vsixmanifest", + ".vssettings", + ".vstemplate", + ".vxml", + ".wixproj", + ".wsdl", + ".wsf", + ".wxi", + ".wxl", + ".wxs", + ".x3d", + ".xacro", + ".xaml", + ".xib", + ".xlf", + ".xliff", + ".xmi", + ".xml.dist", + ".xproj", + ".xsd", + ".xspec", + ".xul", + ".zcml" + ], + "filenames": [ + ".classpath", + ".cproject", + ".project", + "App.config", + "NuGet.config", + "Settings.StyleCop", + "Web.Debug.config", + "Web.Release.config", + "Web.config", + "packages.config" + ], + "languageId": 399 + }, + "XPages": { + "type": "data", + "extensions": [ + ".xsp-config", + ".xsp.metadata" + ], + "tmScope": "text.xml", + "aceMode": "xml", + "codemirrorMode": "xml", + "codemirrorMimeType": "text/xml", + "languageId": 400 + }, + "XProc": { + "type": "programming", + "extensions": [ + ".xpl", + ".xproc" + ], + "tmScope": "text.xml", + "aceMode": "xml", + "codemirrorMode": "xml", + "codemirrorMimeType": "text/xml", + "languageId": 401 + }, + "XQuery": { + "type": "programming", + "color": "#5232e7", + "extensions": [ + ".xquery", + ".xq", + ".xql", + ".xqm", + ".xqy" + ], + "aceMode": "xquery", + "codemirrorMode": "xquery", + "codemirrorMimeType": "application/xquery", + "tmScope": "source.xq", + "languageId": 402 + }, + "XS": { + "type": "programming", + "extensions": [ + ".xs" + ], + "tmScope": "source.c", + "aceMode": "c_cpp", + "codemirrorMode": "clike", + "codemirrorMimeType": "text/x-csrc", + "languageId": 403 + }, + "XSLT": { + "type": "programming", + "aliases": [ + "xsl" + ], + "extensions": [ + ".xslt", + ".xsl" + ], + "tmScope": "text.xml.xsl", + "aceMode": "xml", + "codemirrorMode": "xml", + "codemirrorMimeType": "text/xml", + "color": "#EB8CEB", + "languageId": 404 + }, + "Xojo": { + "type": "programming", + "extensions": [ + ".xojo_code", + ".xojo_menu", + ".xojo_report", + ".xojo_script", + ".xojo_toolbar", + ".xojo_window" + ], + "tmScope": "source.vbnet", + "aceMode": "text", + "languageId": 405 + }, + "Xtend": { + "type": "programming", + "extensions": [ + ".xtend" + ], + "aceMode": "text", + "languageId": 406 + }, + "YAML": { + "type": "data", + "tmScope": "source.yaml", + "aliases": [ + "yml" + ], + "extensions": [ + ".yml", + ".mir", + ".reek", + ".rviz", + ".sublime-syntax", + ".syntax", + ".yaml", + ".yaml-tmlanguage", + ".yml.mysql" + ], + "filenames": [ + ".clang-format", + ".clang-tidy", + ".gemrc", + "glide.lock" + ], + "aceMode": "yaml", + "codemirrorMode": "yaml", + "codemirrorMimeType": "text/x-yaml", + "languageId": 407 + }, + "YANG": { + "type": "data", + "extensions": [ + ".yang" + ], + "tmScope": "source.yang", + "aceMode": "text", + "languageId": 408 + }, + "YARA": { + "type": "programming", + "color": "#220000", + "aceMode": "text", + "extensions": [ + ".yar", + ".yara" + ], + "tmScope": "source.yara", + "languageId": 805122868 + }, + "YASnippet": { + "type": "markup", + "aliases": [ + "snippet", + "yas" + ], + "color": "#32AB90", + "extensions": [ + ".yasnippet" + ], + "tmScope": "source.yasnippet", + "aceMode": "text", + "languageId": 378760102 + }, + "Yacc": { + "type": "programming", + "extensions": [ + ".y", + ".yacc", + ".yy" + ], + "tmScope": "source.bison", + "aceMode": "text", + "color": "#4B6C4B", + "languageId": 409 + }, + "Zephir": { + "type": "programming", + "color": "#118f9e", + "extensions": [ + ".zep" + ], + "tmScope": "source.php.zephir", + "aceMode": "php", + "languageId": 410 + }, + "Zimpl": { + "type": "programming", + "extensions": [ + ".zimpl", + ".zmpl", + ".zpl" + ], + "tmScope": "none", + "aceMode": "text", + "languageId": 411 + }, + "desktop": { + "type": "data", + "extensions": [ + ".desktop", + ".desktop.in" + ], + "tmScope": "source.desktop", + "aceMode": "text", + "languageId": 412 + }, + "eC": { + "type": "programming", + "color": "#913960", + "extensions": [ + ".ec", + ".eh" + ], + "tmScope": "source.c.ec", + "aceMode": "text", + "languageId": 413 + }, + "edn": { + "type": "data", + "aceMode": "clojure", + "codemirrorMode": "clojure", + "codemirrorMimeType": "text/x-clojure", + "extensions": [ + ".edn" + ], + "tmScope": "source.clojure", + "languageId": 414 + }, + "fish": { + "type": "programming", + "group": "Shell", + "interpreters": [ + "fish" + ], + "extensions": [ + ".fish" + ], + "tmScope": "source.fish", + "aceMode": "text", + "languageId": 415 + }, + "mupad": { + "type": "programming", + "extensions": [ + ".mu" + ], + "aceMode": "text", + "languageId": 416 + }, + "nesC": { + "type": "programming", + "color": "#94B0C7", + "extensions": [ + ".nc" + ], + "aceMode": "text", + "tmScope": "source.nesc", + "languageId": 417 + }, + "ooc": { + "type": "programming", + "color": "#b0b77e", + "extensions": [ + ".ooc" + ], + "aceMode": "text", + "languageId": 418 + }, + "q": { + "type": "programming", + "extensions": [ + ".q" + ], + "tmScope": "source.q", + "aceMode": "text", + "color": "#0040cd", + "languageId": 970539067 + }, + "reStructuredText": { + "type": "prose", + "wrap": true, + "aliases": [ + "rst" + ], + "extensions": [ + ".rst", + ".rest", + ".rest.txt", + ".rst.txt" + ], + "aceMode": "text", + "codemirrorMode": "rst", + "codemirrorMimeType": "text/x-rst", + "languageId": 419 + }, + "sed": { + "type": "programming", + "color": "#64b970", + "extensions": [ + ".sed" + ], + "interpreters": [ + "gsed", + "minised", + "sed", + "ssed" + ], + "aceMode": "text", + "tmScope": "source.sed", + "languageId": 847830017 + }, + "wdl": { + "type": "programming", + "color": "#42f1f4", + "extensions": [ + ".wdl" + ], + "tmScope": "source.wdl", + "aceMode": "text", + "languageId": 374521672 + }, + "wisp": { + "type": "programming", + "aceMode": "clojure", + "codemirrorMode": "clojure", + "codemirrorMimeType": "text/x-clojure", + "color": "#7582D1", + "extensions": [ + ".wisp" + ], + "tmScope": "source.clojure", + "languageId": 420 + }, + "xBase": { + "type": "programming", + "color": "#403a40", + "aliases": [ + "advpl", + "clipper", + "foxpro" + ], + "extensions": [ + ".prg", + ".ch", + ".prw" + ], + "tmScope": "source.harbour", + "aceMode": "text", + "languageId": 421 + } +} \ No newline at end of file diff --git a/node_modules/language-map/package.json b/node_modules/language-map/package.json new file mode 100644 index 0000000000..84bdc1fb51 --- /dev/null +++ b/node_modules/language-map/package.json @@ -0,0 +1,36 @@ +{ + "name": "language-map", + "version": "1.4.0", + "description": "GitHub's Linguist YAML language map provided as JSON", + "main": "languages.json", + "scripts": { + "test": "istanbul cover node_modules/mocha/bin/_mocha -- -R spec --bail", + "build": "node scripts/build" + }, + "repository": { + "type": "git", + "url": "git://github.com/blakeembrey/language-map.git" + }, + "keywords": [ + "language", + "map", + "linguist" + ], + "author": { + "name": "Blake Embrey", + "email": "hello@blakeembrey.com", + "url": "http://blakeembrey.me" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/blakeembrey/language-map/issues" + }, + "homepage": "https://github.com/blakeembrey/language-map", + "devDependencies": { + "camel-case": "^3.0.0", + "istanbul": "^0.4.5", + "js-yaml": "^3.0.2", + "mocha": "^5.2.0", + "request": "^2.34.0" + } +} \ No newline at end of file diff --git a/node_modules/language-map/scripts/build b/node_modules/language-map/scripts/build new file mode 100644 index 0000000000..74e0b91970 --- /dev/null +++ b/node_modules/language-map/scripts/build @@ -0,0 +1,36 @@ +#!/usr/bin/env node + +var fs = require('fs'); +var yaml = require('js-yaml'); +var path = require('path'); +var request = require('request'); +var camelize = require('camel-case'); +var path = path.join(__dirname, '..', 'languages.json'); + +/** + * Sanitize the languages JSON object. + * + * @param {Object} obj + * @return {Object} + */ +var sanitizeYaml = function (obj) { + Object.keys(obj).forEach(function (language) { + Object.keys(obj[language]).forEach(function (key) { + var value = obj[language][key]; + + delete obj[language][key]; + obj[language][camelize(key)] = value; + }); + }); + + return obj; +}; + +/** + * Make a request to the YAML file hosted by GitHub and convert to JSON. + */ +request('https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml', function (err, res, body) { + var languages = sanitizeYaml(yaml.safeLoad(body)); + + fs.writeFileSync(path, JSON.stringify(languages, null, 2)); +}); diff --git a/node_modules/language-map/test.js b/node_modules/language-map/test.js new file mode 100644 index 0000000000..a14434cf00 --- /dev/null +++ b/node_modules/language-map/test.js @@ -0,0 +1,11 @@ +var map = require('./'); +var assert = require('assert'); + +describe('language map', function () { + describe('module', function () { + it('should export an object with languages as the keys', function () { + assert.ok(map['Python'].extensions.indexOf('.py') > -1); + assert.ok(map['JavaScript'].extensions.indexOf('.js') > -1); + }); + }); +}); diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js new file mode 100644 index 0000000000..0930cf8890 --- /dev/null +++ b/node_modules/object-assign/index.js @@ -0,0 +1,90 @@ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; diff --git a/node_modules/object-assign/license b/node_modules/object-assign/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/node_modules/object-assign/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/object-assign/package.json b/node_modules/object-assign/package.json new file mode 100644 index 0000000000..3aa7326260 --- /dev/null +++ b/node_modules/object-assign/package.json @@ -0,0 +1,42 @@ +{ + "name": "object-assign", + "version": "4.1.1", + "description": "ES2015 `Object.assign()` ponyfill", + "license": "MIT", + "repository": "sindresorhus/object-assign", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava", + "bench": "matcha bench.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "object", + "assign", + "extend", + "properties", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "prollyfill", + "polyfill", + "shim", + "browser" + ], + "devDependencies": { + "ava": "^0.16.0", + "lodash": "^4.16.4", + "matcha": "^0.7.0", + "xo": "^0.16.0" + } +} \ No newline at end of file diff --git a/node_modules/object-assign/readme.md b/node_modules/object-assign/readme.md new file mode 100644 index 0000000000..1be09d35c7 --- /dev/null +++ b/node_modules/object-assign/readme.md @@ -0,0 +1,61 @@ +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) + +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) + + +## Use the built-in + +Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), +support `Object.assign()` :tada:. If you target only those environments, then by all +means, use `Object.assign()` instead of this package. + + +## Install + +``` +$ npm install --save object-assign +``` + + +## Usage + +```js +const objectAssign = require('object-assign'); + +objectAssign({foo: 0}, {bar: 1}); +//=> {foo: 0, bar: 1} + +// multiple sources +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); +//=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} +``` + + +## API + +### objectAssign(target, [source, ...]) + +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. + + +## Resources + +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) + + +## Related + +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/pinkie-promise/index.js b/node_modules/pinkie-promise/index.js new file mode 100644 index 0000000000..777377a1f7 --- /dev/null +++ b/node_modules/pinkie-promise/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = typeof Promise === 'function' ? Promise : require('pinkie'); diff --git a/node_modules/pinkie-promise/license b/node_modules/pinkie-promise/license new file mode 100644 index 0000000000..1aeb74fd25 --- /dev/null +++ b/node_modules/pinkie-promise/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/pinkie-promise/package.json b/node_modules/pinkie-promise/package.json new file mode 100644 index 0000000000..189af4d7f4 --- /dev/null +++ b/node_modules/pinkie-promise/package.json @@ -0,0 +1,35 @@ +{ + "name": "pinkie-promise", + "version": "2.0.1", + "description": "ES2015 Promise ponyfill", + "license": "MIT", + "repository": "floatdrop/pinkie-promise", + "author": { + "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", + "url": "github.com/floatdrop" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "promise", + "promises", + "es2015", + "es6", + "polyfill", + "ponyfill" + ], + "dependencies": { + "pinkie": "^2.0.0" + }, + "devDependencies": { + "mocha": "*" + } +} \ No newline at end of file diff --git a/node_modules/pinkie-promise/readme.md b/node_modules/pinkie-promise/readme.md new file mode 100644 index 0000000000..78477f4297 --- /dev/null +++ b/node_modules/pinkie-promise/readme.md @@ -0,0 +1,28 @@ +# pinkie-promise [![Build Status](https://travis-ci.org/floatdrop/pinkie-promise.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie-promise) + +> [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) ponyfill + +Module exports global Promise object (if available) or [`pinkie`](http://github.com/floatdrop/pinkie) Promise polyfill. + +## Install + +``` +$ npm install --save pinkie-promise +``` + +## Usage + +```js +var Promise = require('pinkie-promise'); + +new Promise(function (resolve) { resolve('unicorns'); }); +//=> Promise { 'unicorns' } +``` + +## Related + +- [pify](https://github.com/sindresorhus/pify) - Promisify a callback-style function + +## License + +MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/node_modules/pinkie/index.js b/node_modules/pinkie/index.js new file mode 100644 index 0000000000..14ce1bfe3d --- /dev/null +++ b/node_modules/pinkie/index.js @@ -0,0 +1,292 @@ +'use strict'; + +var PENDING = 'pending'; +var SETTLED = 'settled'; +var FULFILLED = 'fulfilled'; +var REJECTED = 'rejected'; +var NOOP = function () {}; +var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function'; + +var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate; +var asyncQueue = []; +var asyncTimer; + +function asyncFlush() { + // run promise callbacks + for (var i = 0; i < asyncQueue.length; i++) { + asyncQueue[i][0](asyncQueue[i][1]); + } + + // reset async asyncQueue + asyncQueue = []; + asyncTimer = false; +} + +function asyncCall(callback, arg) { + asyncQueue.push([callback, arg]); + + if (!asyncTimer) { + asyncTimer = true; + asyncSetTimer(asyncFlush, 0); + } +} + +function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + + function rejectPromise(reason) { + reject(promise, reason); + } + + try { + resolver(resolvePromise, rejectPromise); + } catch (e) { + rejectPromise(e); + } +} + +function invokeCallback(subscriber) { + var owner = subscriber.owner; + var settled = owner._state; + var value = owner._data; + var callback = subscriber[settled]; + var promise = subscriber.then; + + if (typeof callback === 'function') { + settled = FULFILLED; + try { + value = callback(value); + } catch (e) { + reject(promise, e); + } + } + + if (!handleThenable(promise, value)) { + if (settled === FULFILLED) { + resolve(promise, value); + } + + if (settled === REJECTED) { + reject(promise, value); + } + } +} + +function handleThenable(promise, value) { + var resolved; + + try { + if (promise === value) { + throw new TypeError('A promises callback cannot return that same promise.'); + } + + if (value && (typeof value === 'function' || typeof value === 'object')) { + // then should be retrieved only once + var then = value.then; + + if (typeof then === 'function') { + then.call(value, function (val) { + if (!resolved) { + resolved = true; + + if (value === val) { + fulfill(promise, val); + } else { + resolve(promise, val); + } + } + }, function (reason) { + if (!resolved) { + resolved = true; + + reject(promise, reason); + } + }); + + return true; + } + } + } catch (e) { + if (!resolved) { + reject(promise, e); + } + + return true; + } + + return false; +} + +function resolve(promise, value) { + if (promise === value || !handleThenable(promise, value)) { + fulfill(promise, value); + } +} + +function fulfill(promise, value) { + if (promise._state === PENDING) { + promise._state = SETTLED; + promise._data = value; + + asyncCall(publishFulfillment, promise); + } +} + +function reject(promise, reason) { + if (promise._state === PENDING) { + promise._state = SETTLED; + promise._data = reason; + + asyncCall(publishRejection, promise); + } +} + +function publish(promise) { + promise._then = promise._then.forEach(invokeCallback); +} + +function publishFulfillment(promise) { + promise._state = FULFILLED; + publish(promise); +} + +function publishRejection(promise) { + promise._state = REJECTED; + publish(promise); + if (!promise._handled && isNode) { + global.process.emit('unhandledRejection', promise._data, promise); + } +} + +function notifyRejectionHandled(promise) { + global.process.emit('rejectionHandled', promise); +} + +/** + * @class + */ +function Promise(resolver) { + if (typeof resolver !== 'function') { + throw new TypeError('Promise resolver ' + resolver + ' is not a function'); + } + + if (this instanceof Promise === false) { + throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); + } + + this._then = []; + + invokeResolver(resolver, this); +} + +Promise.prototype = { + constructor: Promise, + + _state: PENDING, + _then: null, + _data: undefined, + _handled: false, + + then: function (onFulfillment, onRejection) { + var subscriber = { + owner: this, + then: new this.constructor(NOOP), + fulfilled: onFulfillment, + rejected: onRejection + }; + + if ((onRejection || onFulfillment) && !this._handled) { + this._handled = true; + if (this._state === REJECTED && isNode) { + asyncCall(notifyRejectionHandled, this); + } + } + + if (this._state === FULFILLED || this._state === REJECTED) { + // already resolved, call callback async + asyncCall(invokeCallback, subscriber); + } else { + // subscribe + this._then.push(subscriber); + } + + return subscriber.then; + }, + + catch: function (onRejection) { + return this.then(null, onRejection); + } +}; + +Promise.all = function (promises) { + if (!Array.isArray(promises)) { + throw new TypeError('You must pass an array to Promise.all().'); + } + + return new Promise(function (resolve, reject) { + var results = []; + var remaining = 0; + + function resolver(index) { + remaining++; + return function (value) { + results[index] = value; + if (!--remaining) { + resolve(results); + } + }; + } + + for (var i = 0, promise; i < promises.length; i++) { + promise = promises[i]; + + if (promise && typeof promise.then === 'function') { + promise.then(resolver(i), reject); + } else { + results[i] = promise; + } + } + + if (!remaining) { + resolve(results); + } + }); +}; + +Promise.race = function (promises) { + if (!Array.isArray(promises)) { + throw new TypeError('You must pass an array to Promise.race().'); + } + + return new Promise(function (resolve, reject) { + for (var i = 0, promise; i < promises.length; i++) { + promise = promises[i]; + + if (promise && typeof promise.then === 'function') { + promise.then(resolve, reject); + } else { + resolve(promise); + } + } + }); +}; + +Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + + return new Promise(function (resolve) { + resolve(value); + }); +}; + +Promise.reject = function (reason) { + return new Promise(function (resolve, reject) { + reject(reason); + }); +}; + +module.exports = Promise; diff --git a/node_modules/pinkie/license b/node_modules/pinkie/license new file mode 100644 index 0000000000..1aeb74fd25 --- /dev/null +++ b/node_modules/pinkie/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/pinkie/package.json b/node_modules/pinkie/package.json new file mode 100644 index 0000000000..75775a3e3b --- /dev/null +++ b/node_modules/pinkie/package.json @@ -0,0 +1,36 @@ +{ + "name": "pinkie", + "version": "2.0.4", + "description": "Itty bitty little widdle twinkie pinkie ES2015 Promise implementation", + "license": "MIT", + "repository": "floatdrop/pinkie", + "author": { + "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", + "url": "github.com/floatdrop" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && nyc mocha", + "coverage": "nyc report --reporter=text-lcov | coveralls" + }, + "files": [ + "index.js" + ], + "keywords": [ + "promise", + "promises", + "es2015", + "es6" + ], + "devDependencies": { + "core-assert": "^0.1.1", + "coveralls": "^2.11.4", + "mocha": "*", + "nyc": "^3.2.2", + "promises-aplus-tests": "*", + "xo": "^0.10.1" + } +} \ No newline at end of file diff --git a/node_modules/pinkie/readme.md b/node_modules/pinkie/readme.md new file mode 100644 index 0000000000..1565f95889 --- /dev/null +++ b/node_modules/pinkie/readme.md @@ -0,0 +1,83 @@ +

+
+ pinkie +
+
+

+ +> Itty bitty little widdle twinkie pinkie [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation + +[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie) [![Coverage Status](https://coveralls.io/repos/floatdrop/pinkie/badge.svg?branch=master&service=github)](https://coveralls.io/github/floatdrop/pinkie?branch=master) + +There are [tons of Promise implementations](https://github.com/promises-aplus/promises-spec/blob/master/implementations.md#standalone) out there, but all of them focus on browser compatibility and are often bloated with functionality. + +This module is an exact Promise specification polyfill (like [native-promise-only](https://github.com/getify/native-promise-only)), but in Node.js land (it should be browserify-able though). + + +## Install + +``` +$ npm install --save pinkie +``` + + +## Usage + +```js +var fs = require('fs'); +var Promise = require('pinkie'); + +new Promise(function (resolve, reject) { + fs.readFile('foo.json', 'utf8', function (err, data) { + if (err) { + reject(err); + return; + } + + resolve(data); + }); +}); +//=> Promise +``` + + +### API + +`pinkie` exports bare [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation and polyfills [Node.js rejection events](https://nodejs.org/api/process.html#process_event_unhandledrejection). In case you forgot: + +#### new Promise(executor) + +Returns new instance of `Promise`. + +##### executor + +*Required* +Type: `function` + +Function with two arguments `resolve` and `reject`. The first argument fulfills the promise, the second argument rejects it. + +#### pinkie.all(promises) + +Returns a promise that resolves when all of the promises in the `promises` Array argument have resolved. + +#### pinkie.race(promises) + +Returns a promise that resolves or rejects as soon as one of the promises in the `promises` Array resolves or rejects, with the value or reason from that promise. + +#### pinkie.reject(reason) + +Returns a Promise object that is rejected with the given `reason`. + +#### pinkie.resolve(value) + +Returns a Promise object that is resolved with the given `value`. If the `value` is a thenable (i.e. has a then method), the returned promise will "follow" that thenable, adopting its eventual state; otherwise the returned promise will be fulfilled with the `value`. + + +## Related + +- [pinkie-promise](https://github.com/floatdrop/pinkie-promise) - Returns the native Promise or this module + + +## License + +MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/node_modules/slash2/index.js b/node_modules/slash2/index.js new file mode 100644 index 0000000000..431cfd939a --- /dev/null +++ b/node_modules/slash2/index.js @@ -0,0 +1,10 @@ +'use strict'; +module.exports = input => { + const isExtendedLengthPath = /^\\\\\?\\/.test(input); + + if (isExtendedLengthPath) { + return input; + } + + return input.replace(/\\/g, '/'); +}; diff --git a/node_modules/slash2/license b/node_modules/slash2/license new file mode 100644 index 0000000000..e7af2f7710 --- /dev/null +++ b/node_modules/slash2/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/slash2/package.json b/node_modules/slash2/package.json new file mode 100644 index 0000000000..fedaeabfa4 --- /dev/null +++ b/node_modules/slash2/package.json @@ -0,0 +1,34 @@ +{ + "name": "slash2", + "version": "2.0.0", + "description": "Convert Windows backslash paths to slash paths", + "license": "MIT", + "repository": "sorrycc/slash2", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "path", + "seperator", + "sep", + "slash", + "backslash", + "windows", + "win" + ], + "devDependencies": { + "ava": "*", + "xo": "*" + } +} \ No newline at end of file diff --git a/node_modules/slash2/readme.md b/node_modules/slash2/readme.md new file mode 100644 index 0000000000..5e2fedbc96 --- /dev/null +++ b/node_modules/slash2/readme.md @@ -0,0 +1,44 @@ +# slash [![Build Status](https://travis-ci.org/sindresorhus/slash.svg?branch=master)](https://travis-ci.org/sindresorhus/slash) + +> Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar` + +[Forward-slash paths can be used in Windows](http://superuser.com/a/176395/6877) as long as they're not extended-length paths and don't contain any non-ascii characters. + +This was created since the `path` methods in Node outputs `\\` paths on Windows. + + +## Install + +``` +$ npm install slash +``` + + +## Usage + +```js +const path = require('path'); +const slash = require('slash'); + +const str = path.join('foo', 'bar'); +// Unix => foo/bar +// Windows => foo\\bar + +slash(str); +// Unix => foo/bar +// Windows => foo/bar +``` + + +## API + +### slash(path) + +Type: `string` + +Accepts a Windows backslash path and returns a slash path. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/universalify/LICENSE b/node_modules/universalify/LICENSE new file mode 100644 index 0000000000..514e84e648 --- /dev/null +++ b/node_modules/universalify/LICENSE @@ -0,0 +1,20 @@ +(The MIT License) + +Copyright (c) 2017, Ryan Zimmerman + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the 'Software'), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/universalify/README.md b/node_modules/universalify/README.md new file mode 100644 index 0000000000..487067bfd5 --- /dev/null +++ b/node_modules/universalify/README.md @@ -0,0 +1,76 @@ +# universalify + +[![Travis branch](https://img.shields.io/travis/RyanZim/universalify/master.svg)](https://travis-ci.org/RyanZim/universalify) +![Coveralls github branch](https://img.shields.io/coveralls/github/RyanZim/universalify/master.svg) +![npm](https://img.shields.io/npm/dm/universalify.svg) +![npm](https://img.shields.io/npm/l/universalify.svg) + +Make a callback- or promise-based function support both promises and callbacks. + +Uses the native promise implementation. + +## Installation + +```bash +npm install universalify +``` + +## API + +### `universalify.fromCallback(fn)` + +Takes a callback-based function to universalify, and returns the universalified function. + +Function must take a callback as the last parameter that will be called with the signature `(error, result)`. `universalify` does not support calling the callback with more than three arguments, and does not ensure that the callback is only called once. + +```js +function callbackFn (n, cb) { + setTimeout(() => cb(null, n), 15) +} + +const fn = universalify.fromCallback(callbackFn) + +// Works with Promises: +fn('Hello World!') +.then(result => console.log(result)) // -> Hello World! +.catch(error => console.error(error)) + +// Works with Callbacks: +fn('Hi!', (error, result) => { + if (error) return console.error(error) + console.log(result) + // -> Hi! +}) +``` + +### `universalify.fromPromise(fn)` + +Takes a promise-based function to universalify, and returns the universalified function. + +Function must return a valid JS promise. `universalify` does not ensure that a valid promise is returned. + +```js +function promiseFn (n) { + return new Promise(resolve => { + setTimeout(() => resolve(n), 15) + }) +} + +const fn = universalify.fromPromise(promiseFn) + +// Works with Promises: +fn('Hello World!') +.then(result => console.log(result)) // -> Hello World! +.catch(error => console.error(error)) + +// Works with Callbacks: +fn('Hi!', (error, result) => { + if (error) return console.error(error) + console.log(result) + // -> Hi! +}) +``` + +## License + +MIT diff --git a/node_modules/universalify/index.js b/node_modules/universalify/index.js new file mode 100644 index 0000000000..0c9ba393cf --- /dev/null +++ b/node_modules/universalify/index.js @@ -0,0 +1,25 @@ +'use strict' + +exports.fromCallback = function (fn) { + return Object.defineProperty(function () { + if (typeof arguments[arguments.length - 1] === 'function') fn.apply(this, arguments) + else { + return new Promise((resolve, reject) => { + arguments[arguments.length] = (err, res) => { + if (err) return reject(err) + resolve(res) + } + arguments.length++ + fn.apply(this, arguments) + }) + } + }, 'name', { value: fn.name }) +} + +exports.fromPromise = function (fn) { + return Object.defineProperty(function () { + const cb = arguments[arguments.length - 1] + if (typeof cb !== 'function') return fn.apply(this, arguments) + else fn.apply(this, arguments).then(r => cb(null, r), cb) + }, 'name', { value: fn.name }) +} diff --git a/node_modules/universalify/package.json b/node_modules/universalify/package.json new file mode 100644 index 0000000000..21f0e6cc0e --- /dev/null +++ b/node_modules/universalify/package.json @@ -0,0 +1,34 @@ +{ + "name": "universalify", + "version": "0.1.2", + "description": "Make a callback- or promise-based function support both promises and callbacks.", + "keywords": [ + "callback", + "native", + "promise" + ], + "homepage": "https://github.com/RyanZim/universalify#readme", + "bugs": "https://github.com/RyanZim/universalify/issues", + "license": "MIT", + "author": "Ryan Zimmerman ", + "files": [ + "index.js" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/RyanZim/universalify.git" + }, + "scripts": { + "test": "standard && nyc tape test/*.js | colortape" + }, + "devDependencies": { + "colortape": "^0.1.2", + "coveralls": "^3.0.1", + "nyc": "^10.2.0", + "standard": "^10.0.1", + "tape": "^4.6.3" + }, + "engines": { + "node": ">= 4.0.0" + } +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 50d698b5c9..f3561633dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -669,7 +669,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "requires": { "color-convert": "^1.9.0" } @@ -705,6 +704,11 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=" + }, "array.prototype.flat": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", @@ -882,8 +886,7 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "before-after-hook": { "version": "2.1.0", @@ -985,7 +988,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1054,7 +1056,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -1200,7 +1201,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "requires": { "color-name": "1.1.3" } @@ -1208,8 +1208,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "commander": { "version": "6.0.0", @@ -1225,8 +1224,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "concordance": { "version": "4.0.0", @@ -1560,8 +1558,7 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { "version": "7.9.0", @@ -2205,11 +2202,20 @@ "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" }, + "fs-extra": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "2.1.2", @@ -2251,11 +2257,55 @@ "pump": "^3.0.0" } }, + "github-linguist": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/github-linguist/-/github-linguist-2.3.0.tgz", + "integrity": "sha512-pDskxid9R1/VHsgEwbaht8+oxnFjfvFJRg0nemV/kMyDjeh6Z3/s8WAlG1OO59XhmRF4qvOHK9ai8gfIgQ0GUQ==", + "requires": { + "chalk": "^2.2.0", + "commander": "^2.11.0", + "fs-extra": "^4.0.3", + "globby": "^6.1.0", + "language-map": "^1.3.0", + "slash2": "^2.0.0" + }, + "dependencies": { + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "requires": { + "array-uniq": "^1.0.1" + } + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + } + } + }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -2328,8 +2378,7 @@ "graceful-fs": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", - "dev": true + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" }, "has": { "version": "1.0.3", @@ -2343,8 +2392,7 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "has-symbols": { "version": "1.0.1", @@ -2432,7 +2480,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -2711,6 +2758,14 @@ "minimist": "^1.2.0" } }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, "jsonschema": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.2.6.tgz", @@ -2731,6 +2786,11 @@ "json-buffer": "3.0.0" } }, + "language-map": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/language-map/-/language-map-1.4.0.tgz", + "integrity": "sha512-5XHMCqKQ/14VXwJTKZX7MZwsVyTrR0bwCsRBwrBq3nP4w7liMJiR0ixXgI29EF/T1/U6be8cYK2y0ibWW9kx2w==" + }, "latest-version": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", @@ -2990,7 +3050,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -3084,6 +3143,11 @@ "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", "dev": true }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", @@ -3349,8 +3413,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-parse": { "version": "1.0.6", @@ -3385,6 +3448,19 @@ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "^2.0.0" + } + }, "pkg-conf": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-3.1.0.tgz", @@ -3895,6 +3971,11 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, + "slash2": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash2/-/slash2-2.0.0.tgz", + "integrity": "sha512-7ElvBydJPi3MHU/KEOblFSbO/skl4Z69jKkFCpYIYVOMSIZsKi4gYU43HGeZPmjxCXrHekoDAAewphPQNnsqtA==" + }, "slice-ansi": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", @@ -4098,7 +4179,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "requires": { "has-flag": "^3.0.0" } @@ -4279,6 +4359,11 @@ "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + }, "update-notifier": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.0.tgz", diff --git a/package.json b/package.json index 4bc81531f8..532ee6c4c0 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "fast-deep-equal": "^3.1.3", "file-url": "^3.0.0", "fs": "0.0.1-security", + "github-linguist": "^2.3.0", "js-yaml": "^3.13.1", "jsonschema": "1.2.6", "long": "^4.0.0", From ce467e7e36259c7a5874cdc6176123d24d49f441 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 23 Apr 2021 09:59:23 +0100 Subject: [PATCH 3/6] use safeWhich --- lib/toolcache.js | 3 ++- lib/toolcache.js.map | 2 +- src/toolcache.ts | 21 +++++++++++++-------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/lib/toolcache.js b/lib/toolcache.js index d4832be200..cef91cb137 100644 --- a/lib/toolcache.js +++ b/lib/toolcache.js @@ -13,6 +13,7 @@ const path = __importStar(require("path")); const toolrunner = __importStar(require("@actions/exec/lib/toolrunner")); const io = __importStar(require("@actions/io")); const actionsToolcache = __importStar(require("@actions/tool-cache")); +const safeWhich = __importStar(require("@chrisgavin/safe-which")); const semver = __importStar(require("semver")); /* * This file acts as an interface to the functionality of the actions toolcache. @@ -47,7 +48,7 @@ async function extractTar(file, mode, tempDir, logger) { // Determine whether GNU tar logger.debug("Checking tar --version"); let versionOutput = ""; - await new toolrunner.ToolRunner("tar", ["--version"], { + await new toolrunner.ToolRunner(await safeWhich.safeWhich("tar"), ["--version"], { ignoreReturnCode: true, silent: true, listeners: { diff --git a/lib/toolcache.js.map b/lib/toolcache.js.map index 737a8c1b8b..6ef9e61ee0 100644 --- a/lib/toolcache.js.map +++ b/lib/toolcache.js.map @@ -1 +1 @@ -{"version":3,"file":"toolcache.js","sourceRoot":"","sources":["../src/toolcache.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAE7B,yEAA2D;AAC3D,gDAAkC;AAClC,sEAAwD;AACxD,+CAAiC;AAKjC;;;;;;;GAOG;AAEH;;;;;;;;;;GAUG;AACI,KAAK,UAAU,UAAU,CAC9B,IAAY,EACZ,IAAU,EACV,OAAe,EACf,MAAc;IAEd,IAAI,IAAI,KAAK,SAAS,EAAE;QACtB,OAAO,MAAM,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;KAChD;SAAM;QACL,wFAAwF;QAExF,IAAI,CAAC,IAAI,EAAE;YACT,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACjD;QACD,cAAc;QACd,MAAM,IAAI,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAC1C,4BAA4B;QAC5B,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QACvC,IAAI,aAAa,GAAG,EAAE,CAAC;QACvB,MAAM,IAAI,UAAU,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE;YACpD,gBAAgB,EAAE,IAAI;YACtB,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE;gBACT,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,aAAa,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACpD,MAAM,EAAE,CAAC,I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IAEd,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,MAAM,CAAC,KAAK,CAAC,cAAc,QAAQ,CAAC,MAAM,WAAW,CAAC,CAAC;IACvD,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAChC,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;YACnB,OAAO,CAAC,CAAC;SACV;QACD,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC,CAAC,CAAC;IACH,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QAC7C,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QAC3D,IAAI,SAAS,EAAE;YACb,OAAO,GAAG,SAAS,CAAC;YACpB,MAAM;SACP;KACF;IACD,IAAI,OAAO,EAAE;QACX,MAAM,CAAC,KAAK,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;KACrC;SAAM;QACL,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACjC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"} \ No newline at end of file diff --git a/src/toolcache.ts b/src/toolcache.ts index e82cfee222..0d6bdc2e92 100644 --- a/src/toolcache.ts +++ b/src/toolcache.ts @@ -5,6 +5,7 @@ import * as path from "path"; import * as toolrunner from "@actions/exec/lib/toolrunner"; import * as io from "@actions/io"; import * as actionsToolcache from "@actions/tool-cache"; +import * as safeWhich from "@chrisgavin/safe-which"; import * as semver from "semver"; import { Logger } from "./logging"; @@ -49,14 +50,18 @@ export async function extractTar( // Determine whether GNU tar logger.debug("Checking tar --version"); let versionOutput = ""; - await new toolrunner.ToolRunner("tar", ["--version"], { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => (versionOutput += data.toString()), - stderr: (data) => (versionOutput += data.toString()), - }, - }).exec(); + await new toolrunner.ToolRunner( + await safeWhich.safeWhich("tar"), + ["--version"], + { + ignoreReturnCode: true, + silent: true, + listeners: { + stdout: (data) => (versionOutput += data.toString()), + stderr: (data) => (versionOutput += data.toString()), + }, + } + ).exec(); logger.debug(versionOutput.trim()); const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); // Initialize args From 8207018b75d3c166a2f8e59a36eb91bb8c18a6bd Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 23 Apr 2021 10:01:28 +0100 Subject: [PATCH 4/6] make query more robust --- queries/unguarded-action-lib.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queries/unguarded-action-lib.ql b/queries/unguarded-action-lib.ql index 87183f5d3c..faa26d250f 100644 --- a/queries/unguarded-action-lib.ql +++ b/queries/unguarded-action-lib.ql @@ -43,7 +43,7 @@ class ActionsLibImport extends ImportDeclaration { ActionsLibImport() { getImportedPath().getValue().matches("@actions/%") and not isSafeActionLib(getImportedPath().getValue()) or - getImportedPath().getValue() = "./actions-util" + getImportedPath().getValue().matches("/actions-util$") } string getName() { From 27bf3a208dfdd22e8822c5f7634e2004c24a32b0 Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 23 Apr 2021 10:01:50 +0100 Subject: [PATCH 5/6] fix typo --- lib/toolcache.js | 2 +- src/toolcache.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/toolcache.js b/lib/toolcache.js index cef91cb137..623b94a8a2 100644 --- a/lib/toolcache.js +++ b/lib/toolcache.js @@ -20,7 +20,7 @@ const semver = __importStar(require("semver")); * That library is not safe to use outside of actions as it makes assumptions about * the state of the filesystem and available environment variables. * - * On actions we can just delegates to the toolcache library, however outside of + * On actions we can just delegate to the toolcache library, however outside of * actions we provide our own implementation. */ /** diff --git a/src/toolcache.ts b/src/toolcache.ts index 0d6bdc2e92..a82b7007c4 100644 --- a/src/toolcache.ts +++ b/src/toolcache.ts @@ -16,7 +16,7 @@ import { Mode } from "./util"; * That library is not safe to use outside of actions as it makes assumptions about * the state of the filesystem and available environment variables. * - * On actions we can just delegates to the toolcache library, however outside of + * On actions we can just delegate to the toolcache library, however outside of * actions we provide our own implementation. */ From e2d70d6a0b08051d6c9545484e559009a781f8a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Apr 2021 18:01:34 +0000 Subject: [PATCH 6/6] Bump ssri from 6.0.1 to 6.0.2 in /runner Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2. - [Release notes](https://github.com/npm/ssri/releases) - [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md) - [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2) Signed-off-by: dependabot[bot] --- runner/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runner/package-lock.json b/runner/package-lock.json index 99f088d4a2..6599262e05 100644 --- a/runner/package-lock.json +++ b/runner/package-lock.json @@ -3595,9 +3595,9 @@ } }, "ssri": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", - "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", + "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==", "dev": true, "requires": { "figgy-pudding": "^3.5.1"