diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index e9475cb..0000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,78 +0,0 @@ -name: ci -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - - test_node: - runs-on: ubuntu-latest - if: ${{ !github.event.created }} - strategy: - matrix: - node: [ '13', '12', '11', '10', '8' ] - name: Test with Node v${{ matrix.node }} - steps: - - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - run: npm ci - - run: npm run build - - run: npm run test - - - trigger_publish: - name: '(Maybe) Trigger ''publish'' (if newer version)' - runs-on: ubuntu-latest - env: - PAT: ${{secrets.PAT}} - if: github.event_name == 'push' && github.event.head_commit.author.name != 'ts_ci' - needs: test_node - steps: - - - name: Get version on branch 'latest' - id: v_latest - uses: garronej/github_actions_toolkit@master - with: - action_name: get_package_json_version - owner: ${{github.repository_owner}} - repo: ${{github.event.repository.name}} - branch: latest - compare_to_version: '0.0.0' - - - - name: Get version on master - id: v_master - uses: garronej/github_actions_toolkit@master - with: - action_name: get_package_json_version - owner: ${{github.repository_owner}} - repo: ${{github.event.repository.name}} - branch: ${{ github.sha }} - compare_to_version: ${{steps.v_latest.outputs.version || '0.0.0'}} - - - name: Trigger publish.yaml workflow if package.json version updated ( and secrets.PAT is set ). - if: ${{ !!env.PAT && steps.v_master.outputs.compare_result == '1' }} - uses: garronej/github_actions_toolkit@master - env: - GITHUB_TOKEN: ${{ secrets.PAT }} - with: - action_name: dispatch_event - owner: ${{github.repository_owner}} - repo: ${{github.event.repository.name}} - event_type: publish - client_payload_json: | - ${{ - format( - '{{"from_version":"{0}","to_version":"{1}","repo":"{2}"}}', - steps.v_latest.outputs.version, - steps.v_master.outputs.version, - github.event.repository.name - ) - }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml deleted file mode 100644 index b7c4cbe..0000000 --- a/.github/workflows/publish.yaml +++ /dev/null @@ -1,105 +0,0 @@ -on: - repository_dispatch: - types: publish - -jobs: - update_changelog_and_sync_package_lock_version: - name: Update CHANGELOG.md and make sure package.json and package-lock.json versions matches. - runs-on: ubuntu-latest - steps: - - name: Synchronize package.json and package-lock.json version if needed. - uses: garronej/github_actions_toolkit@master - env: - GITHUB_TOKEN: ${{ secrets.PAT }} - with: - action_name: sync_package_and_package_lock_version - owner: ${{github.repository_owner}} - repo: ${{github.event.client_payload.repo}} - branch: master - commit_author_email: ts_ci@github.com - - name: Update CHANGELOG.md - if: ${{ !!github.event.client_payload.from_version }} - uses: garronej/github_actions_toolkit@master - env: - GITHUB_TOKEN: ${{ secrets.PAT }} - with: - action_name: update_changelog - owner: ${{github.repository_owner}} - repo: ${{github.event.client_payload.repo}} - branch_behind: latest - branch_ahead: master - commit_author_email: ts_ci@github.com - exclude_commit_from_author_names_json: '["ts_ci"]' - - publish_npm: - runs-on: ubuntu-latest - needs: update_changelog_and_sync_package_lock_version - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - ref: 'master' - - name: 'Remove GH Actions workflows, useless on latest branch' - run: rm -r .github - - name: Remove branch 'latest' - continue-on-error: true - run: | - git branch -d latest || true - git push origin :latest - - name: Create the new 'latest' branch - run: | - git branch latest - git checkout latest - git push origin latest - - uses: actions/setup-node@v1 - - run: npm ci - - - run: npm run enable_short_import_path - env: - DRY_RUN: "0" - - name: (DEBUG) Show how the files have been moved to enable short import - run: ls -lR - - name: Publishing on NPM - run: | - if [ "$NPM_TOKEN" = "" ]; then - echo "Can't publish on NPM, You must first create a secret called NPM_TOKEN that contains your NPM auth token. https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets" - false - fi - echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc - npm publish - rm .npmrc - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Commit changes - env: - COMMIT_MESSAGE: ${{steps.id_rcm.outputs.message}} - run: | - git config --local user.email "ts_ci@github.com" - git config --local user.name "ts_ci" - git add -A - git commit -am "Enabling shorter import paths [automatic]" - - run: git push origin latest - - name: Release body - id: id_rb - run: | - if [ "$FROM_VERSION" = "" ]; then - echo "::set-output name=body::🚀" - else - echo "::set-output name=body::📋 [CHANGELOG](https://github.com/$OWNER/$REPO/blob/$REF/CHANGELOG.md)" - fi - env: - FROM_VERSION: ${{ github.event.client_payload.from_version }} - OWNER: ${{github.repository_owner}} - REPO: ${{github.event.client_payload.repo}} - REF: ${{github.event.client_payload.to_version}} - - name: Create Release - uses: garronej/create-release@master - env: - GITHUB_TOKEN: ${{ secrets.PAT }} - with: - tag_name: ${{ github.event.client_payload.to_version }} - release_name: Release ${{ github.event.client_payload.to_version }} - branch: latest - draft: false - prerelease: false - body: ${{ steps.id_rb.outputs.body }} \ No newline at end of file diff --git a/bin/denoify.d.ts b/bin/denoify.d.ts new file mode 100644 index 0000000..b798801 --- /dev/null +++ b/bin/denoify.d.ts @@ -0,0 +1,2 @@ +#!/usr/bin/env node +export {}; diff --git a/bin/denoify.js b/bin/denoify.js new file mode 100755 index 0000000..40dc0f0 --- /dev/null +++ b/bin/denoify.js @@ -0,0 +1,19 @@ +#!/usr/bin/env node +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const commanderStatic = require("commander"); +const denoify_1 = require("../lib/denoify"); +process.once("unhandledRejection", error => { throw error; }); +commanderStatic + .description(` + For NPM module authors that would like to support Deno but do not want to write and maintain a port. + See https://github.com/garronej/denoify for instructions. + `) + .option("-p, --project [projectPath]", `Default: './' -- Denoify the project given to a folder with a 'package.json' and 'tsconfig.json'.`) + .option("--src [srcDirPath]", `Default: '[projectPath]/src' | '[projectPath]/lib' -- Path to the directory containing the source .ts files. If the provided path is not absolute it is assumed relative to [projectPath]`); +commanderStatic.parse(process.argv); +denoify_1.denoify({ + "projectPath": commanderStatic["projectPath"], + "srcDirPath": commanderStatic["srcDirPath"] +}); +//# sourceMappingURL=denoify.js.map \ No newline at end of file diff --git a/bin/denoify.js.map b/bin/denoify.js.map new file mode 100644 index 0000000..b9f7714 --- /dev/null +++ b/bin/denoify.js.map @@ -0,0 +1 @@ +{"version":3,"file":"denoify.js","sourceRoot":"","sources":["../src/bin/denoify.ts"],"names":[],"mappings":";;;AAEA,6CAA6C;AAC7C,4CAAyC;AAEzC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAAE,GAAG,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9D,eAAe;KACV,WAAW,CAAC;;;KAGZ,CAAC;KACD,MAAM,CAAC,6BAA6B,EAAE,mGAAmG,CAAC;KAC1I,MAAM,CAAC,oBAAoB,EAAE,2LAA2L,CAAC,CACzN;AAEL,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAEpC,iBAAO,CAAC;IACJ,aAAa,EAAE,eAAe,CAAC,aAAa,CAAC;IAC7C,YAAY,EAAE,eAAe,CAAC,YAAY,CAAC;CAC9C,CAAC,CAAC"} \ No newline at end of file diff --git a/bin/enableShortDenoImportPath.d.ts b/bin/enableShortDenoImportPath.d.ts new file mode 100644 index 0000000..b798801 --- /dev/null +++ b/bin/enableShortDenoImportPath.d.ts @@ -0,0 +1,2 @@ +#!/usr/bin/env node +export {}; diff --git a/bin/enableShortDenoImportPath.js b/bin/enableShortDenoImportPath.js new file mode 100755 index 0000000..387993e --- /dev/null +++ b/bin/enableShortDenoImportPath.js @@ -0,0 +1,57 @@ +#!/usr/bin/env node +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const modTsFile_1 = require("../lib/modTsFile"); +const pathDepth_1 = require("../tools/pathDepth"); +const moveContentUpOneLevel_1 = require("../tools/moveContentUpOneLevel"); +const exec_1 = require("../tools/exec"); +const getIsDryRun_1 = require("../lib/getIsDryRun"); +const removeFromGitignore_1 = require("../tools/removeFromGitignore"); +const fs = require("fs"); +/** + * To disable dry run mode DRY_RUN=1 env variable must be set. + * This function Change change the working directory. + * */ +async function run(params) { + const { isDryRun } = params; + const { exec } = exec_1.execFactory({ isDryRun }); + const { moveContentUpOneLevel } = moveContentUpOneLevel_1.moveContentUpOneLevelFactory({ isDryRun }); + process.chdir(params.pathToTargetModule); + const { srcDirPath, denoDistPath, tsconfigOutDir } = modTsFile_1.modTsFile.parseMetadata({ "projectPath": "." }); + if (pathDepth_1.pathDepth(tsconfigOutDir) != 1) { + throw new Error("tsconfig out dir must be a directory at the root of the project for this script to work"); + } + modTsFile_1.modTsFile.create({ + "tsFilePath": path.relative(tsconfigOutDir, // ./dist + JSON.parse(fs.readFileSync("package.json").toString("utf8")).main // ./dist/lib/index.js + .replace(/\.js$/i, ".ts")), + "projectPath": ".", + isDryRun + }); + await exec(`rm -r ${srcDirPath}`); + await exec(`rm -r ${tsconfigOutDir}`); + await moveContentUpOneLevel({ "dirPath": denoDistPath }); + const { fixedGitignoreRaw } = removeFromGitignore_1.removeFromGitignore({ + "pathToTargetModule": ".", + "fileOrDirPathsToAccept": [ + "./mod.ts", + // NOTE: This files must not be included + // but we add them so that dry run and real run be consistent + denoDistPath, tsconfigOutDir + ] + }); + if (!fixedGitignoreRaw) { + return; + } + console.log(`\n${isDryRun ? "(dry)" : ""} .gitignore:\n\n${fixedGitignoreRaw}`); + if (!isDryRun) { + fs.writeFileSync(".gitignore", Buffer.from(fixedGitignoreRaw, "utf8")); + } +} +if (require.main === module) { + process.once("unhandledRejection", error => { throw error; }); + const { isDryRun } = getIsDryRun_1.getIsDryRun(); + run({ "pathToTargetModule": ".", isDryRun }); +} +//# sourceMappingURL=enableShortDenoImportPath.js.map \ No newline at end of file diff --git a/bin/enableShortDenoImportPath.js.map b/bin/enableShortDenoImportPath.js.map new file mode 100644 index 0000000..ee91f31 --- /dev/null +++ b/bin/enableShortDenoImportPath.js.map @@ -0,0 +1 @@ +{"version":3,"file":"enableShortDenoImportPath.js","sourceRoot":"","sources":["../src/bin/enableShortDenoImportPath.ts"],"names":[],"mappings":";;;AAEA,6BAA6B;AAC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;QAC9C,oBAAoB,EAAE,GAAG;QACzB,wBAAwB,EAAE;YACtB,UAAU;YACV,yCAAyC;YACzC,6DAA6D;YAC7D,YAAY,EAAE,cAAc;SAC/B;KACJ,CAAC,CAAC;IAEH,IAAI,CAAC,iBAAiB,EAAE;QACpB,OAAO;KACV;IAED,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAA,CAAC,CAAA,OAAO,CAAA,CAAC,CAAA,EAAE,mBAAmB,iBAAiB,EAAE,CAAC,CAAC;IAE5E,IAAI,CAAC,QAAQ,EAAE;QAEX,EAAE,CAAC,aAAa,CACZ,YAAY,EACZ,MAAM,CAAC,IAAI,CAAC,iBAAiB,EAAC,MAAM,CAAC,CACxC,CAAC;KAEL;AAEL,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE;IAEzB,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAAE,GAAG,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9D,MAAM,EAAE,QAAQ,EAAE,GAAG,yBAAW,EAAE,CAAC;IAEnC,GAAG,CAAC,EAAE,oBAAoB,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;CAEhD"} \ No newline at end of file diff --git a/bin/enableShortNpmImportPath.d.ts b/bin/enableShortNpmImportPath.d.ts new file mode 100644 index 0000000..b798801 --- /dev/null +++ b/bin/enableShortNpmImportPath.d.ts @@ -0,0 +1,2 @@ +#!/usr/bin/env node +export {}; diff --git a/bin/enableShortNpmImportPath.js b/bin/enableShortNpmImportPath.js new file mode 100755 index 0000000..fd40491 --- /dev/null +++ b/bin/enableShortNpmImportPath.js @@ -0,0 +1,171 @@ +#!/usr/bin/env node +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const globProxy_1 = require("../tools/globProxy"); +const modTsFile_1 = require("../lib/modTsFile"); +const pathDepth_1 = require("../tools/pathDepth"); +const moveContentUpOneLevel_1 = require("../tools/moveContentUpOneLevel"); +const exec_1 = require("../tools/exec"); +const getIsDryRun_1 = require("../lib/getIsDryRun"); +const crawl_1 = require("../tools/crawl"); +const fs = require("fs"); +const commentJson = require("comment-json"); +/** + * To disable dry run mode DRY_RUN=1 env variable must be set. + * This function Change change the working directory. + * */ +async function run(params) { + var _a; + const { isDryRun } = params; + const { exec } = exec_1.execFactory({ isDryRun }); + const { moveContentUpOneLevel } = moveContentUpOneLevel_1.moveContentUpOneLevelFactory({ isDryRun }); + process.chdir(params.pathToTargetModule); + if (fs.existsSync(".npmignore")) { + throw new Error(".npmignore not supported, please use package.json 'files' instead"); + } + const packageJsonRaw = fs.readFileSync("package.json") + .toString("utf8"); + const packageJsonParsed = JSON.parse(packageJsonRaw); + const packageJsonFilesResolved = await (() => { + const pathWithWildcards = packageJsonParsed + .files; + if (!pathWithWildcards) { + return undefined; + } + const { globProxy } = globProxy_1.globProxyFactory({ "cwdAndRood": "." }); + const flat = [ + (prev, curr) => [...prev, ...curr], + [] + ]; + return Promise.all(pathWithWildcards + .map(pathWithWildcard => globProxy({ pathWithWildcard }))).then(arrOfArr => arrOfArr + .reduce(...flat) + .map(fileOrDirPath => !fs.lstatSync(fileOrDirPath).isDirectory() ? + [fileOrDirPath] + : + crawl_1.crawl(fileOrDirPath) + .map(filePath => path.join(fileOrDirPath, filePath))) + .reduce(...flat)); + })(); + const { srcDirPath, denoDistPath, tsconfigOutDir } = fs.existsSync("./mod.ts") ? + modTsFile_1.modTsFile.parseMetadata({ "projectPath": "." }) + : + { + "srcDirPath": "./src", + "denoDistPath": undefined, + "tsconfigOutDir": commentJson.parse(fs.readFileSync("./tsconfig.json") + .toString("utf8"))["compilerOptions"]["outDir"] + }; + if (pathDepth_1.pathDepth(tsconfigOutDir) != 1) { + throw new Error("For this script to work tsconfig out dir must be a directory at the root of the project"); + } + if (!!denoDistPath) { + await exec(`rm -r ${denoDistPath}`); + } + const moveSourceFiles = "types" in packageJsonParsed ? + !packageJsonParsed["types"].match(/\.d\.ts$/i) + : + false; + console.log(moveSourceFiles ? + "Putting .ts files alongside .js files" : + "Leaving .ts file in the src/ directory"); + const beforeMovedFilePaths = await (async () => { + const moveAndReplace = (dirPath) => moveContentUpOneLevel({ dirPath }) + .then(({ beforeMovedFilePaths }) => beforeMovedFilePaths.map(filePath => path.join(dirPath, filePath))); + return [ + ...(await moveAndReplace(tsconfigOutDir)), + ...(moveSourceFiles ? await moveAndReplace(srcDirPath) : []) + ]; + })(); + const getAfterMovedFilePath = (params) => { + const beforeMovedFilePath = beforeMovedFilePaths.find(beforeMovedFilePath => path.relative(beforeMovedFilePath, params.beforeMovedFilePath) === ""); + if (beforeMovedFilePath === undefined) { + //NOTE: In case the path would be absolute. + return path.relative(".", params.beforeMovedFilePath); + } + const afterMovedFilePath = beforeMovedFilePath + .replace(/^\.\//, "") + .split(path.sep) + .filter((...[, index]) => index !== 0) + .join(path.sep); + return afterMovedFilePath; + }; + beforeMovedFilePaths + .filter(beforeMovedFilePath => /\.js\.map$/.test(beforeMovedFilePath)) + .forEach(beforeMovedSourceMapFilePath => { + const afterMovedSourceMapFilePath = getAfterMovedFilePath({ + "beforeMovedFilePath": beforeMovedSourceMapFilePath + }); + const sourceMapParsed = JSON.parse(fs.readFileSync(isDryRun ? + beforeMovedSourceMapFilePath : + afterMovedSourceMapFilePath).toString("utf8")); + const sources = sourceMapParsed.sources + .map(filePath => path.relative(path.dirname(afterMovedSourceMapFilePath), getAfterMovedFilePath({ + "beforeMovedFilePath": path.join(path.dirname(beforeMovedSourceMapFilePath), filePath) + }))); + console.log([ + `${isDryRun ? "(dry) " : ""}Editing ${path.basename(beforeMovedSourceMapFilePath)}:`, + JSON.stringify({ "sources": sourceMapParsed.sources }), + `-> ${JSON.stringify({ sources })}` + ].join(" ")); + walk: { + if (isDryRun) { + break walk; + } + fs.writeFileSync(afterMovedSourceMapFilePath, Buffer.from(JSON.stringify({ + ...sourceMapParsed, + sources + }), "utf8")); + } + }); + walk: { + const newPackageJsonRaw = JSON.stringify({ + ...packageJsonParsed, + ...("main" in packageJsonParsed ? { + "main": getAfterMovedFilePath({ + "beforeMovedFilePath": packageJsonParsed["main"] + }) + } : {}), + ...("types" in packageJsonParsed ? { + "types": getAfterMovedFilePath({ + "beforeMovedFilePath": packageJsonParsed["types"] + }) + } : {}), + ...("bin" in packageJsonParsed ? { + "bin": (() => { + const out = {}; + Object.keys(packageJsonParsed.bin) + .map(binName => [binName, packageJsonParsed.bin[binName]]) + .forEach(([binName, beforeMovedBinFilePath]) => out[binName] = getAfterMovedFilePath({ + "beforeMovedFilePath": beforeMovedBinFilePath + })); + return out; + })() + } : {}), + ...(!!packageJsonFilesResolved ? { + "files": packageJsonFilesResolved + .map(beforeMovedFilesFilePath => getAfterMovedFilePath({ + "beforeMovedFilePath": beforeMovedFilesFilePath + })) + } : {}), + "scripts": undefined + }, null, ((_a = packageJsonRaw + .replace(/\t/g, " ") + .match(/^(\s*)\"name\"/m)) !== null && _a !== void 0 ? _a : [{ "length": 2 }])[1].length) + packageJsonRaw.match(/}([\r\n]*)$/)[1]; + console.log(`${isDryRun ? "(dry)" : ""} package.json:\n${newPackageJsonRaw}`); + if (isDryRun) { + break walk; + } + fs.writeFileSync("package.json", Buffer.from(newPackageJsonRaw, "utf8")); + } +} +if (require.main === module) { + process.once("unhandledRejection", error => { throw error; }); + const { isDryRun } = getIsDryRun_1.getIsDryRun(); + run({ + "pathToTargetModule": ".", + isDryRun + }); +} +//# sourceMappingURL=enableShortNpmImportPath.js.map \ No newline at end of file diff --git a/bin/enableShortNpmImportPath.js.map b/bin/enableShortNpmImportPath.js.map new file mode 100644 index 0000000..7c0b2c1 --- /dev/null +++ b/bin/enableShortNpmImportPath.js.map @@ -0,0 +1 @@ +{"version":3,"file":"enableShortNpmImportPath.js","sourceRoot":"","sources":["../src/bin/enableShortNpmImportPath.ts"],"names":[],"mappings":";;;AAEA,6BAA6B;AAC7B,kDAAsD;AACtD,gDAA6C;AAC7C,kDAA+C;AAC/C,0EA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AC;gBAC7B,OAAO,EACH,wBAAwB;qBACnB,GAAG,CAAC,wBAAwB,CAAC,EAAE,CAAC,qBAAqB,CAAC;oBACnD,qBAAqB,EAAE,wBAAwB;iBAClD,CAAC,CAAC;aACd,CAAC,CAAC,CAAC,EAAE,CAAC;YACP,SAAS,EAAE,SAAS;SACvB,EACD,IAAI,EACJ,OAAC,cAAc;aACV,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;aACtB,KAAK,CAAC,iBAAiB,CAAC,mCAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAChE,GAAG,cAAc,CAAC,KAAK,CAAC,aAAa,CAAE,CAAC,CAAC,CAAC,CAAC;QAE5C,OAAO,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,mBAAmB,iBAAiB,EAAE,CAAC,CAAC;QAE9E,IAAI,QAAQ,EAAE;YACV,MAAM,IAAI,CAAC;SACd;QAED,EAAE,CAAC,aAAa,CACZ,cAAc,EACd,MAAM,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CACzC,CAAC;KAEL;AAGL,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE;IACzB,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,EAAE,GAAG,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9D,MAAM,EAAE,QAAQ,EAAE,GAAG,yBAAW,EAAE,CAAC;IAEnC,GAAG,CAAC;QACA,oBAAoB,EAAE,GAAG;QACzB,QAAQ;KACX,CAAC,CAAC;CACN"} \ No newline at end of file diff --git a/lib/Scheme.d.ts b/lib/Scheme.d.ts new file mode 100644 index 0000000..ced6e63 --- /dev/null +++ b/lib/Scheme.d.ts @@ -0,0 +1,81 @@ +export declare type Scheme = Scheme.GitHub | Scheme.Url; +export declare namespace Scheme { + /** + * Parsed from "github:userOrOrg/repositoryName#branch" found in + * package.json: + * "dependencies": { + * "module_name": "github:userOrOrg/repositoryName#branch" + * } + * + * The 'github:' prefix is not mandatory. + * #branch is not mandatory ( if not specified NPM will resolve the + * default branch, branch that is not necessary master ) + * + */ + type GitHub = { + type: "github"; + userOrOrg: string; + repositoryName: string; + branch?: string; + }; + namespace GitHub { + function matchStr(strScheme: string): boolean; + function parse(strScheme: string): GitHub; + function buildUrl(scheme: GitHub, params: { + pathToFile?: string; + branch?: string; + }): string; + } + type Url = Url.GitHub | Url.DenoLand; + namespace Url { + type Common = { + type: "url"; + baseUrlWithoutBranch: string; + pathToIndex: string; + branch: string; + }; + export type GitHub = Common & { + urlType: "github"; + }; + export namespace GitHub { + function matchStr(strScheme: string): boolean; + function parse(strScheme: string): GitHub; + function buildUrl(scheme: Url.GitHub, params: { + pathToFile?: string; + branch?: string; + }): string; + } + export type DenoLand = Common & { + urlType: "deno.land"; + }; + export namespace DenoLand { + function matchStr(strScheme: string): boolean; + function parse(strScheme: string): DenoLand; + function buildUrl(scheme: Url.DenoLand, params: { + pathToFile?: string; + branch?: string; + }): string; + } + export function matchStr(strScheme: string): boolean; + export function parse(strScheme: string): Scheme; + export function buildUrl(scheme: Url, params: { + pathToFile?: string; + branch?: string; + }): string; + export {}; + } + function parse(strScheme: string): Scheme; + function buildUrl(scheme: Scheme, params: { + pathToFile?: string; + branch?: string; + }): string; + function resolveVersion(scheme: Scheme, params: { + version: string; + }): Promise<{ + couldConnect: true; + scheme: Scheme; + notTheExactVersionWarning: string | undefined; + } | { + couldConnect: false; + }>; +} diff --git a/lib/Scheme.js b/lib/Scheme.js new file mode 100644 index 0000000..a04ab12 --- /dev/null +++ b/lib/Scheme.js @@ -0,0 +1,189 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Scheme = void 0; +const is404_1 = require("../tools/is404"); +const urlJoin_1 = require("../tools/urlJoin"); +var Scheme; +(function (Scheme) { + let GitHub; + (function (GitHub) { + function matchStr(strScheme) { + return /^(?:github:)?[^\/]+\/[^\/]+$/.test(strScheme); + } + GitHub.matchStr = matchStr; + //NOTE: async because need to fetch for the default branch + function parse(strScheme + // KSXGitHub/simple-js-yaml-port-for-deno or + // github:KSXGitHub/simple-js-yaml-port-for-deno or + // KSXGitHub/simple-js-yaml-port-for-deno#3.12.1 or + // github:KSXGitHub/simple-js-yaml-port-for-deno#3.12.1 or + ) { + const match = strScheme + .match(/^(?:github:\s*)?([^\/]*)\/([^\/]+)$/i); + const [repositoryName, branch] = match[2].split("#"); + return { + "type": "github", + "userOrOrg": match[1], + repositoryName, + branch + }; + } + GitHub.parse = parse; + function buildUrl(scheme, params) { + var _a, _b, _c; + return urlJoin_1.urlJoin("https://raw.githubusercontent.com", scheme.userOrOrg, scheme.repositoryName, (_b = (_a = params.branch) !== null && _a !== void 0 ? _a : scheme.branch) !== null && _b !== void 0 ? _b : "master", (_c = params.pathToFile) !== null && _c !== void 0 ? _c : "mod.ts"); + } + GitHub.buildUrl = buildUrl; + })(GitHub = Scheme.GitHub || (Scheme.GitHub = {})); + let Url; + (function (Url) { + let GitHub; + (function (GitHub) { + function matchStr(strScheme) { + return /^https?:\/\/raw\.github(?:usercontent)?\.com/.test(strScheme); + } + GitHub.matchStr = matchStr; + function parse(strScheme) { + const match = strScheme.match(/^(https?:\/\/raw\.github(?:usercontent)?\.com\/[^\/]+\/[^\/]+\/)([^\/]+)\/(.*)$/); + return { + "type": "url", + "urlType": "github", + "baseUrlWithoutBranch": match[1] + .replace(/^https?:\/\/raw\.github(?:usercontent)?/, "https://raw.githubusercontent") + .replace(/\/$/, ""), + "branch": match[2], + "pathToIndex": match[3] + }; + } + GitHub.parse = parse; + function buildUrl(scheme, params) { + var _a, _b, _c; + return urlJoin_1.urlJoin(scheme.baseUrlWithoutBranch.replace(/\/$/, ""), (_b = (_a = params.branch) !== null && _a !== void 0 ? _a : scheme.branch) !== null && _b !== void 0 ? _b : "master", (_c = params.pathToFile) !== null && _c !== void 0 ? _c : scheme.pathToIndex); + } + GitHub.buildUrl = buildUrl; + })(GitHub = Url.GitHub || (Url.GitHub = {})); + let DenoLand; + (function (DenoLand) { + function matchStr(strScheme) { + return /^https?:\/\/deno\.land\/(?:(?:std)|(?:x))[\/|@]/.test(strScheme); + } + DenoLand.matchStr = matchStr; + function parse(strScheme) { + const match = /^https?:\/\/deno\.land\/std/.test(strScheme) ? + strScheme.match(/^(https?:\/\/deno\.land\/std)([@\/].*)$/) : + strScheme.match(/^(https?:\/\/deno\.land\/x\/[^@\/]+)([@\/].*)$/); + // https://deno.land/std@master/node/querystring.ts + // [1]: https://deno.land/std + // [2]: @master/node/querystring.ts + // https://deno.land/std/node/querystring.ts + // [1]: https://deno.land/std + // [2]: /node/querystring.ts + //https://deno.land/x/foo@1.2.3/mod.js + // [1]: https://deno.land/x/foo + // [2]: @1.2.3/mod.js + //https://deno.land/x/foo/mod.js + // [1]: https://deno.land/x/foo + // [2]: /mod.js + const { branch, pathToIndex } = match[2].startsWith("@") ? (() => { + const [, branch, // 1.2.3 + pathToIndex // mod.js + ] = match[2].match(/^@([^\/]+)\/(.*)$/); + return { branch, pathToIndex }; + })() : ({ + "branch": undefined, + "pathToIndex": match[2].replace(/^\//, "") // mod.js + }); + return { + "type": "url", + "urlType": "deno.land", + "baseUrlWithoutBranch": match[1], + "branch": branch !== null && branch !== void 0 ? branch : "master", + pathToIndex + }; + } + DenoLand.parse = parse; + function buildUrl(scheme, params) { + var _a, _b; + const branch = (_a = params.branch) !== null && _a !== void 0 ? _a : scheme.branch; + return urlJoin_1.urlJoin([ + scheme.baseUrlWithoutBranch.replace(/\/$/, ""), + branch !== "master" ? `@${branch}` : "" + ].join(""), (_b = params.pathToFile) !== null && _b !== void 0 ? _b : scheme.pathToIndex); + } + DenoLand.buildUrl = buildUrl; + })(DenoLand = Url.DenoLand || (Url.DenoLand = {})); + function matchStr(strScheme) { + return (GitHub.matchStr(strScheme) || + DenoLand.matchStr(strScheme)); + } + Url.matchStr = matchStr; + function parse(strScheme) { + if (GitHub.matchStr(strScheme)) { + return GitHub.parse(strScheme); + } + if (DenoLand.matchStr(strScheme)) { + return DenoLand.parse(strScheme); + } + throw new Error(`${strScheme} scheme not supported`); + } + Url.parse = parse; + function buildUrl(scheme, params) { + switch (scheme.urlType) { + case "deno.land": return DenoLand.buildUrl(scheme, params); + case "github": return GitHub.buildUrl(scheme, params); + } + } + Url.buildUrl = buildUrl; + })(Url = Scheme.Url || (Scheme.Url = {})); + function parse(strScheme) { + if (GitHub.matchStr(strScheme)) { + return GitHub.parse(strScheme); + } + if (Url.matchStr(strScheme)) { + return Url.parse(strScheme); + } + throw new Error(`${strScheme} scheme not supported by Denoify`); + } + Scheme.parse = parse; + function buildUrl(scheme, params) { + switch (scheme.type) { + case "github": return GitHub.buildUrl(scheme, params); + case "url": return Url.buildUrl(scheme, params); + } + } + Scheme.buildUrl = buildUrl; + async function resolveVersion(scheme, params) { + const { version } = params; + const urls404 = []; + for (const branch of [ + ...["", "v"].map(prefix => `${prefix}${version}`), + ...(!!scheme.branch ? [scheme.branch] : []), + "master" + ]) { + const url = buildUrl(scheme, { branch }); + if (await is404_1.is404(url)) { + urls404.push(url); + continue; + } + const notTheExactVersionWarning = ((branch !== null && branch !== void 0 ? branch : "").search(version) < 0) ? [ + `WARNING: Specific version ${version} could not be found\n`, + ...urls404.map(url => `GET ${url} 404\n`), + `Falling back to ${branch !== null && branch !== void 0 ? branch : "master"} branch\n`, + `This mean that the Node and the Deno distribution of your module `, + `will not run the same version of this dependency.`, + ].join("") : undefined; + const schemeOut = { + ...scheme, + ...(!!branch ? { branch } : {}) + }; + return { + "couldConnect": true, + "scheme": schemeOut, + notTheExactVersionWarning + }; + } + return { "couldConnect": false }; + } + Scheme.resolveVersion = resolveVersion; +})(Scheme = exports.Scheme || (exports.Scheme = {})); +//# sourceMappingURL=Scheme.js.map \ No newline at end of file diff --git a/lib/Scheme.js.map b/lib/Scheme.js.map new file mode 100644 index 0000000..9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CAAC,CAAC;YAEzC,IAAI,MAAM,aAAK,CAAC,GAAG,CAAC,EAAE;gBAClB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAClB,SAAS;aACZ;YAED,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBACrE,6BAA6B,OAAO,uBAAuB;gBAC3D,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,GAAG,QAAQ,CAAC;gBACzC,mBAAmB,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,QAAQ,WAAW;gBAChD,mEAAmE;gBACnE,mDAAmD;aACtD,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAGvB,MAAM,SAAS,GAAG;gBACd,GAAG,MAAM;gBACT,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAClC,CAAC;YAEF,OAAO;gBACH,cAAc,EAAE,IAAI;gBACpB,QAAQ,EAAE,SAAS;gBACnB,yBAAyB;aAC5B,CAAC;SAEL;QAED,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;IAErC,CAAC;IApDqB,qBAAc,iBAoDnC,CAAA;AAGL,CAAC,EA7UgB,MAAM,GAAN,cAAM,KAAN,cAAM,QA6UtB"} \ No newline at end of file diff --git a/lib/denoify.d.ts b/lib/denoify.d.ts new file mode 100644 index 0000000..19fe602 --- /dev/null +++ b/lib/denoify.d.ts @@ -0,0 +1,4 @@ +export declare function denoify(params: { + projectPath: string; + srcDirPath?: string; +}): Promise; diff --git a/lib/denoify.js b/lib/denoify.js new file mode 100644 index 0000000..91d9dbd --- /dev/null +++ b/lib/denoify.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.denoify = void 0; +const denoifySingleFile_1 = require("./denoifySingleFile"); +const transformCodebase_1 = require("./transformCodebase"); +const resolve_1 = require("./resolve"); +const fs = require("fs"); +const path = require("path"); +const commentJson = require("comment-json"); +const denoifyImportArgument_1 = require("./denoifyImportArgument"); +const modTsFile_1 = require("./modTsFile"); +const isInsideOrIsDir_1 = require("../tools/isInsideOrIsDir"); +async function denoify(params) { + var _a; + process.chdir((_a = params.projectPath) !== null && _a !== void 0 ? _a : "."); + const srcDirPath = !!params.srcDirPath ? + params.srcDirPath : + ["src", "lib"].find(sourceDirPath => fs.existsSync(sourceDirPath)); + if (!srcDirPath) { + throw new Error("No src directory found"); + } + const packageJsonParsed = JSON.parse(fs.readFileSync("package.json") + .toString("utf8")); + const tsconfigOutDir = commentJson.parse(fs.readFileSync("./tsconfig.json") + .toString("utf8"))["compilerOptions"]["outDir"]; // ./dist + if (!tsconfigOutDir) { + throw new Error("tsconfig.json must specify an outDir"); + } + if (!isInsideOrIsDir_1.isInsideOrIsDir({ + "dirPath": tsconfigOutDir, + "fileOrDirPath": packageJsonParsed.main + })) { + throw new Error(`The package.json main should point to a file inside ${tsconfigOutDir}`); + } + const { denoifySingleFile } = denoifySingleFile_1.denoifySingleFileFactory((() => { + const { denoifyImportArgument } = denoifyImportArgument_1.denoifyImportArgumentFactory((() => { + var _a, _b, _c; + const { resolve } = resolve_1.resolveFactory({ + "projectPath": ".", + "userProvidedPorts": (_a = packageJsonParsed["denoPorts"]) !== null && _a !== void 0 ? _a : {}, + "dependencies": (_b = packageJsonParsed["dependencies"]) !== null && _b !== void 0 ? _b : {}, + "devDependencies": (_c = packageJsonParsed["devDependencies"]) !== null && _c !== void 0 ? _c : {}, + "log": console.log + }); + return { resolve }; + })()); + return { denoifyImportArgument }; + })()); + const denoDistPath = path.join(path.dirname(tsconfigOutDir), `deno_${path.basename(tsconfigOutDir)}`); // ./deno_dist + await transformCodebase_1.transformCodebase({ + srcDirPath, + "destDirPath": denoDistPath, + "transformSourceCodeString": ({ extension, sourceCode, fileDirPath }) => /^\.?ts$/i.test(extension) || /^\.?js$/i.test(extension) ? + denoifySingleFile({ sourceCode, fileDirPath }) + : + Promise.resolve(sourceCode) + }); + modTsFile_1.modTsFile.create({ + "projectPath": ".", + "tsFilePath": path.join(denoDistPath, path.relative(tsconfigOutDir, packageJsonParsed.main // ./dist/lib/index.js + ) // ./lib/index.js + ) // ./deno_dist/lib/index.js + .replace(/\.js$/i, ".ts"), + "metadata": { srcDirPath, denoDistPath, tsconfigOutDir }, + "isDryRun": false + }); +} +exports.denoify = denoify; +//# sourceMappingURL=denoify.js.map \ No newline at end of file diff --git a/lib/denoify.js.map b/lib/denoify.js.map new file mode 100644 index 0000000..b545899 --- /dev/null +++ b/lib/denoify.js.map @@ -0,0 +1 @@ +{"version":3,"file":"denoify.js","sourceRoot":"","sources":["../src/lib/denoify.ts"],"names":[],"mappings":";;;AACA,2DAA+D;AAC/D,2DAAwD;AACxD,uCAA2C;AAC3C,yBAAyB;AACzB,6BAA6B;AAC7B,4CAA4C;AAC5C,mEAAuE;AACvE,2CAAwC;AACxC,8DAA2D;AAEpD,KAAK,UAAU,OAAO,CACzB,MAGC;;IAGD,OAAO,CAAC,KAAK,OAAC,MAAM,CAAC,WAAW,mCAAI,GAAG,CAAC,CAAC;IAEzC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACpC,MAAM,CAAC,UAAU,CAAC,CAAC;QACnB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CACjE;IAEL,IAAI,CAAC,UAAU,EAAE;QACb,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;KAC7C;IAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAChC,EAAE,CAAC,YAAY,CAAC,cAAc,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AC,cAAc,CAAC,EAAE,CAC1C,CAAC,CAAC,cAAc;IAEjB,MAAM,qCAAiB,CAAC;QACpB,UAAU;QACV,aAAa,EAAE,YAAY;QAC3B,2BAA2B,EAAE,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,EAAE,CACpE,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;YACtD,iBAAiB,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;YAC9C,CAAC;gBACD,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;KACtC,CAAC,CAAC;IAEH,qBAAS,CAAC,MAAM,CAAC;QACb,aAAa,EAAE,GAAG;QAClB,YAAY,EAAE,IAAI,CAAC,IAAI,CACnB,YAAY,EACZ,IAAI,CAAC,QAAQ,CACT,cAAc,EACd,iBAAiB,CAAC,IAAI,CAAC,sBAAsB;SAChD,CAAC,iBAAiB;SACtB,CAAC,2BAA2B;aACxB,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC;QAC7B,UAAU,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE;QACxD,UAAU,EAAE,KAAK;KACpB,CAAC,CAAC;AAGP,CAAC;AA/FD,0BA+FC"} \ No newline at end of file diff --git a/lib/denoifyImportArgument.d.ts b/lib/denoifyImportArgument.d.ts new file mode 100644 index 0000000..3036f0a --- /dev/null +++ b/lib/denoifyImportArgument.d.ts @@ -0,0 +1,24 @@ +import type { Result as ResolveResult } from "./resolve"; +/** + * examples: + * "evt" -> "https://deno.land/x/evt@.../mod.ts" + * "evt/dist/tools/typeSafety" -> "https://deno.land/x/evt@.../deno_dist/tools/typeSafety/index.ts" + * "./interfaces" -> "./interfaces/index.ts" + */ +export declare function denoifyImportArgumentFactory(params: { + resolve(params: { + nodeModuleName: string; + }): Promise; +}): { + denoifyImportArgument: (params: { + /** Path of the file in which the import was */ + fileDirPath: string; + /** e.g: + * "evt" + * "evt/dist/tools/typeSafety" + * "evt/dist/tools/typeSafety/assert" + * ... + */ + importArgument: string; + }) => Promise; +}; diff --git a/lib/denoifyImportArgument.js b/lib/denoifyImportArgument.js new file mode 100644 index 0000000..a23ec43 --- /dev/null +++ b/lib/denoifyImportArgument.js @@ -0,0 +1,95 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.denoifyImportArgumentFactory = void 0; +const path = require("path"); +const addCache_1 = require("../tools/addCache"); +const Scheme_1 = require("./Scheme"); +const fs = require("fs"); +const is404_1 = require("../tools/is404"); +/** + * examples: + * "evt" -> "https://deno.land/x/evt@.../mod.ts" + * "evt/dist/tools/typeSafety" -> "https://deno.land/x/evt@.../deno_dist/tools/typeSafety/index.ts" + * "./interfaces" -> "./interfaces/index.ts" + */ +function denoifyImportArgumentFactory(params) { + const resolve = addCache_1.addCache(params.resolve); + async function denoifyImportArgument(params) { + const { fileDirPath } = params; + const importStr = params + .importArgument // ./interfaces/ + .replace(/\/+$/, "/index") // ./interfaces/index + ; + if (importStr.startsWith(".")) { + if (/\.json$/i.test(importStr)) { + return importStr; + } + if (fs.existsSync(path.join(fileDirPath, `${importStr}.ts`))) { + return `${importStr}.ts`; + } + const out = path.join(importStr, "index.ts"); + return out.startsWith(".") ? out : `./${out}`; + } + const { nodeModuleName, specificImportPath } = (() => { + const [nodeModuleName, ...rest] = importStr.split("/"); + return { + nodeModuleName, + "specificImportPath": rest.join("/") + }; + })(); + const resolveResult = await resolve({ nodeModuleName }); + if (resolveResult.type === "NON-FATAL UNMET DEPENDENCY") { + return `${importStr} DENOIFY: DEPENDENCY UNMET (${resolveResult.kind})`; + } + if (!specificImportPath) { + const out = Scheme_1.Scheme.buildUrl(resolveResult.scheme, {}); + if (await is404_1.is404(out)) { + throw new Error(`${out} 404 not found !`); + } + return out; + } + for (const tsconfigOutDir of [ + (() => { + switch (resolveResult.type) { + case "DENOIFIED MODULE": return resolveResult.tsconfigOutDir; + case "HANDMADE PORT": return "dist"; + } + })(), + undefined + ]) { + let out = Scheme_1.Scheme.buildUrl(resolveResult.scheme, { + "pathToFile": (tsconfigOutDir === undefined ? + specificImportPath + : + path.join(path.join(path.dirname(tsconfigOutDir), // . + `deno_${path.basename(tsconfigOutDir)}` //deno_dist + ), // deno_dist + path.relative(tsconfigOutDir, specificImportPath // dest/tools/typeSafety + ) // tools/typeSafety + ) // deno_dist/tool/typeSafety + ) + ".ts" // deno_dist/tool/typeSafety.ts + }); + walk: { + if (await is404_1.is404(out)) { + break walk; + } + return out; + } + out = out + .replace(/\.ts$/, "/index.ts"); + walk: { + if (await is404_1.is404(out)) { + break walk; + } + return out; + } + } + throw new Error([ + `Problem resolving ${importStr} in ${fileDirPath} with`, + `${JSON.stringify(resolveResult.scheme)} 404 not found.` + ].join(" ")); + } + return { denoifyImportArgument }; +} +exports.denoifyImportArgumentFactory = denoifyImportArgumentFactory; +//# sourceMappingURL=denoifyImportArgument.js.map \ No newline at end of file diff --git a/lib/denoifyImportArgument.js.map b/lib/denoifyImportArgument.js.map new file mode 100644 index 0000000..b65d980 --- /dev/null +++ b/lib/denoifyImportArgument.js.map @@ -0,0 +1 @@ +{"version":3,"file":"denoifyImportArgument.js","sourceRoot":"","sources":["../src/lib/denoifyImportArgument.ts"],"names":[],"mappings":";;;AACA,6BAA6B;AAC7B,gDAA6C;AAC7C,qCAAkC;AAClC,yBAAyB;AACzB,0CAAuC;AAGvC;;;;;GAKG;AACH,SAAgB,4BAA4B,CACxC,MAEC;IAGD,MAAM,OAAO,GAAG,mBAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEzC,KAAK,UAAU,qBAAqB,CAChC,MAUC;QAGD,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAC/B,MAAM,SAAS,GAAG,MAAM;aACnB,cAAc,CAAC,gBAAgB;aAC/B,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,qBAAqB;SAC/C;QAEL,IAAI,SAAS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AiB;SAC3D,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAEjB,CAAC;IAED,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAErC,CAAC;AA9ID,oEA8IC"} \ No newline at end of file diff --git a/lib/denoifySingleFile.d.ts b/lib/denoifySingleFile.d.ts new file mode 100644 index 0000000..ed44035 --- /dev/null +++ b/lib/denoifySingleFile.d.ts @@ -0,0 +1,9 @@ +import type { denoifyImportArgumentFactory } from "./denoifyImportArgument"; +export declare function denoifySingleFileFactory(params: { + denoifyImportArgument: ReturnType["denoifyImportArgument"]; +}): { + denoifySingleFile: (params: { + fileDirPath: string; + sourceCode: string; + }) => Promise; +}; diff --git a/lib/denoifySingleFile.js b/lib/denoifySingleFile.js new file mode 100644 index 0000000..8100a0f --- /dev/null +++ b/lib/denoifySingleFile.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.denoifySingleFileFactory = void 0; +const replaceAsync_1 = require("../tools/replaceAsync"); +function denoifySingleFileFactory(params) { + const { denoifyImportArgument } = params; + /** Returns source code with deno imports replaced */ + async function denoifySingleFile(params) { + const { fileDirPath, sourceCode } = params; + let modifiedSourceCode = sourceCode; + if (usesBuiltIn("__filename", sourceCode)) { + modifiedSourceCode = [ + `const __filename = (()=>{`, + ` const {url: urlStr}= import.meta;`, + ` const url= new URL(urlStr);`, + ` return url.protocol === "file:" ? url.pathname : urlStr;`, + `})();`, + '', + modifiedSourceCode + ].join("\n"); + } + if (usesBuiltIn("__dirname", sourceCode)) { + modifiedSourceCode = [ + `const __dirname = (()=>{`, + ` const {url: urlStr}= import.meta;`, + ` const url= new URL(urlStr);`, + ` const __filename = url.protocol === "file:" ? url.pathname : urlStr;`, + ` return __filename.replace(/[/][^/]*$/, '');`, + `})();`, + ``, + modifiedSourceCode + ].join("\n"); + } + for (const quoteSymbol of [`"`, `'`]) { + const strRegExpInQuote = `${quoteSymbol}[^${quoteSymbol}]+${quoteSymbol}`; + const replacerAsync = (() => { + const regExpReplaceInQuote = new RegExp(`^([^${quoteSymbol}]*${quoteSymbol})([^${quoteSymbol}]+)(${quoteSymbol}[^${quoteSymbol}]*)$`, "m"); + return async (substring) => { + const [, before, importArgument, after] = substring.match(regExpReplaceInQuote); + return `${before}${await denoifyImportArgument({ fileDirPath, importArgument })}${after}`; + }; + })(); + for (const regExpStr of [ + `export\\s+\\*\\s+from\\s*${strRegExpInQuote}`, + `(?:import|export)(?:\\s+type)?\\s*\\*\\s*as\\s+[^\\s]+\\s+from\\s*${strRegExpInQuote}`, + `(?:import|export)(?:\\s+type)?\\s*{[^}]*}\\s*from\\s*${strRegExpInQuote}`, + `import(?:\\s+type)?\\s+[^\\*{][^\\s]*\\s+from\\s*${strRegExpInQuote}`, + `import\\s*${strRegExpInQuote}`, + `[^a-zA-Z\._0-9$]import\\s*\\(\\s*${strRegExpInQuote}\\s*\\)`, + ]) { + modifiedSourceCode = await replaceAsync_1.replaceAsync(modifiedSourceCode, new RegExp(regExpStr, "mg"), replacerAsync); + } + } + return modifiedSourceCode; + } + return { denoifySingleFile }; +} +exports.denoifySingleFileFactory = denoifySingleFileFactory; +//TODO: Improve! +function usesBuiltIn(builtIn, sourceCode) { + return sourceCode.indexOf(builtIn) >= 0; +} +//# sourceMappingURL=denoifySingleFile.js.map \ No newline at end of file diff --git a/lib/denoifySingleFile.js.map b/lib/denoifySingleFile.js.map new file mode 100644 index 0000000..517e33c --- /dev/null +++ b/lib/denoifySingleFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"denoifySingleFile.js","sourceRoot":"","sources":["../src/lib/denoifySingleFile.ts"],"names":[],"mappings":";;;AACA,wDAAqD;AAGrD,SAAgB,wBAAwB,CACpC,MAEC;IAGD,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;IAEzC,qDAAqD;IACrD,KAAK,UAAU,iBAAiB,CAC5B,MAGC;QAGD,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,C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AqE,gBAAgB,EAAE;gBACvF,wDAAwD,gBAAgB,EAAE;gBAC1E,oDAAoD,gBAAgB,EAAE;gBACtE,aAAa,gBAAgB,EAAE;gBAC/B,oCAAoC,gBAAgB,SAAS;aAChE,EAAE;gBAEC,kBAAkB,GAAG,MAAM,2BAAY,CACnC,kBAAkB,EAClB,IAAI,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,EAC3B,aAAa,CAChB,CAAC;aAEL;SAEJ;QAED,OAAO,kBAAkB,CAAC;IAE9B,CAAC;IAGD,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAGjC,CAAC;AAnGD,4DAmGC;AAED,gBAAgB;AAChB,SAAS,WAAW,CACZ,OAA0D,EAC1D,UAAkB;IAGtB,OAAO,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5C,CAAC"} \ No newline at end of file diff --git a/lib/getIsDryRun.d.ts b/lib/getIsDryRun.d.ts new file mode 100644 index 0000000..6cba9b0 --- /dev/null +++ b/lib/getIsDryRun.d.ts @@ -0,0 +1,3 @@ +export declare function getIsDryRun(): { + isDryRun: boolean; +}; diff --git a/lib/getIsDryRun.js b/lib/getIsDryRun.js new file mode 100644 index 0000000..07b2a04 --- /dev/null +++ b/lib/getIsDryRun.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getIsDryRun = void 0; +function getIsDryRun() { + const isDryRun = !(process.env["DRY_RUN"] === "0"); + if (isDryRun) { + console.log([ + "Executing the script in dry mode, no operation will be actually performed.", + "To disable dry mode set DRY_RUN environnement variable to '0'", + "" + ].join("\n")); + } + return { isDryRun }; +} +exports.getIsDryRun = getIsDryRun; +//# sourceMappingURL=getIsDryRun.js.map \ No newline at end of file diff --git a/lib/getIsDryRun.js.map b/lib/getIsDryRun.js.map new file mode 100644 index 0000000..9f8dec8 --- /dev/null +++ b/lib/getIsDryRun.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getIsDryRun.js","sourceRoot":"","sources":["../src/lib/getIsDryRun.ts"],"names":[],"mappings":";;;AACA,SAAgB,WAAW;IAEvB,MAAM,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAA;IAElD,IAAI,QAAQ,EAAE;QACV,OAAO,CAAC,GAAG,CAAC;YACR,4EAA4E;YAC5E,+DAA+D;YAC/D,EAAE;SACL,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;KACjB;IAED,OAAO,EAAE,QAAQ,EAAE,CAAC;AAExB,CAAC;AAdD,kCAcC"} \ No newline at end of file diff --git a/lib/getTsconfigOutDirIfDenoified.d.ts b/lib/getTsconfigOutDirIfDenoified.d.ts new file mode 100644 index 0000000..a1bab98 --- /dev/null +++ b/lib/getTsconfigOutDirIfDenoified.d.ts @@ -0,0 +1,6 @@ +import { Scheme } from "./Scheme"; +export declare const getTsconfigOutDirIfDenoified: (params: { + scheme: Scheme; +}) => Promise<{ + tsconfigOutDir: string | undefined; +}>; diff --git a/lib/getTsconfigOutDirIfDenoified.js b/lib/getTsconfigOutDirIfDenoified.js new file mode 100644 index 0000000..27c6bb7 --- /dev/null +++ b/lib/getTsconfigOutDirIfDenoified.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getTsconfigOutDirIfDenoified = void 0; +const Scheme_1 = require("./Scheme"); +const commentJson = require("comment-json"); +const node_fetch_1 = require("node-fetch"); +exports.getTsconfigOutDirIfDenoified = (() => { + async function isDenoified(params) { + const { scheme } = params; + const urlToIndex = Scheme_1.Scheme.buildUrl(scheme, {}); + let modTsRaw; + try { + modTsRaw = await node_fetch_1.default(urlToIndex) + .then(res => res.text()); + } + catch (_a) { + return false; + } + if (!modTsRaw.match(/denoify/i)) { + return false; + } + return true; + } + /** Asserts denoified module */ + async function getTsconfigOutDir(params) { + const { scheme } = params; + return { + "tsconfigOutDir": commentJson.parse(await node_fetch_1.default(Scheme_1.Scheme.buildUrl(scheme, { "pathToFile": "tsconfig.json" })).then(res => res.text()))["compilerOptions"]["outDir"] + }; + } + async function getTsconfigOutDirIfDenoified(params) { + const { scheme } = params; + if (!(await isDenoified({ scheme }))) { + return { "tsconfigOutDir": undefined }; + } + return getTsconfigOutDir({ scheme }); + } + return { getTsconfigOutDirIfDenoified }; +})().getTsconfigOutDirIfDenoified; +//# sourceMappingURL=getTsconfigOutDirIfDenoified.js.map \ No newline at end of file diff --git a/lib/getTsconfigOutDirIfDenoified.js.map b/lib/getTsconfigOutDirIfDenoified.js.map new file mode 100644 index 0000000..cd473f4 --- /dev/null +++ b/lib/getTsconfigOutDirIfDenoified.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getTsconfigOutDirIfDenoified.js","sourceRoot":"","sources":["../src/lib/getTsconfigOutDirIfDenoified.ts"],"names":[],"mappings":";;;AACA,qCAAkC;AAClC,4CAA4C;AAC5C,2CAA+B;AAEhB,oCAA4B,GAAK,CAAC,GAAG,EAAE;IAElD,KAAK,UAAU,WAAW,CACtB,MAA2B;QAG3B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAE1B,MAAM,UAAU,GAAG,eAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAE/C,IAAI,QAAgB,CAAC;QAErB,IAAI;YAEA,QAAQ,GAAG,MAAM,oBAAK,CAAC,UAAU,CAAC;iBAC7B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CACvB;SAGR;QAAC,WAAK;YAGH,OAAO,KAAK,CAAC;SAEhB;QAGD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;YAG7B,OAAO,KAAK,CAAC;SAChB;QAGD,OAAO,IAAI,CAAC;IAEhB,CAAC;IAED,+BAA+B;IAC/B,KAAK,UAAU,iBAAiB,CAC5B,MAA0B;QAG1B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAE1B,OAAO;YACH,gBAAgB,EAAE,WAAW,CAAC,KAAK,CAC/B,MAAM,oBAAK,CACP,eAAM,CAAC,QAAQ,CACX,MAAM,EACN,EAAE,YAAY,EAAE,eAAe,EAAE,CACpC,CACJ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAC5B,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC;SACjC,CAAC;IAEN,CAAC;IAED,KAAK,UAAU,4BAA4B,CACvC,MAA2B;QAG3B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAE1B,IAAI,CAAC,CAAC,MAAM,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE;YAClC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,CAAC;SAC1C;QAED,OAAO,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAEzC,CAAC;IAED,OAAO,EAAE,4BAA4B,EAAE,CAAC;AAG5C,CAAC,CAAC,EAAE,8BAAC"} \ No newline at end of file diff --git a/lib/modTsFile.d.ts b/lib/modTsFile.d.ts new file mode 100644 index 0000000..e32e345 --- /dev/null +++ b/lib/modTsFile.d.ts @@ -0,0 +1,18 @@ +export declare namespace modTsFile { + type Metadata = { + srcDirPath: string; + denoDistPath: string; + tsconfigOutDir: string; + }; + /** create [projectPath]/mod.ts file */ + function create(params: { + projectPath: string; + tsFilePath: string; + metadata?: Metadata; + isDryRun: boolean; + }): void; + /** Assert has been created with metadata */ + function parseMetadata(params: { + projectPath: string; + }): Metadata; +} diff --git a/lib/modTsFile.js b/lib/modTsFile.js new file mode 100644 index 0000000..ecbdc9e --- /dev/null +++ b/lib/modTsFile.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.modTsFile = void 0; +const fs = require("fs"); +const path = require("path"); +var modTsFile; +(function (modTsFile) { + /** create [projectPath]/mod.ts file */ + function create(params) { + const { projectPath, tsFilePath, isDryRun } = params; + const modTsRaw = [ + `//Automatically generated by denoify.`, + ` It is important not to edit this file.\n`, + ("metadata" in params) ? `// #${JSON.stringify(params.metadata)}#\n\n` : "", + `export * from "${tsFilePath.startsWith("./") ? "" : "./"}${tsFilePath}";` + ].join(""); + if (!isDryRun) { + fs.writeFileSync(path.join(projectPath, "mod.ts"), Buffer.from(modTsRaw, "utf8")); + } + else { + console.log(`(dry) mod.ts\n\n${modTsRaw}\n`); + } + } + modTsFile.create = create; + /** Assert has been created with metadata */ + function parseMetadata(params) { + const { projectPath } = params; + const [, metadataJson] = fs.readFileSync(path.join(projectPath, "mod.ts")) + .toString("utf8") + .split("#"); + if (!metadataJson) { + throw new Error("No metadata in mod.ts"); + } + return JSON.parse(metadataJson); + } + modTsFile.parseMetadata = parseMetadata; +})(modTsFile = exports.modTsFile || (exports.modTsFile = {})); +//# sourceMappingURL=modTsFile.js.map \ No newline at end of file diff --git a/lib/modTsFile.js.map b/lib/modTsFile.js.map new file mode 100644 index 0000000..85071d2 --- /dev/null +++ b/lib/modTsFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"modTsFile.js","sourceRoot":"","sources":["../src/lib/modTsFile.ts"],"names":[],"mappings":";;;AACA,yBAAyB;AACzB,6BAA6B;AAE7B,IAAiB,SAAS,CA6DzB;AA7DD,WAAiB,SAAS;IAQtB,uCAAuC;IACvC,SAAgB,MAAM,CAAC,MAKtB;QAEG,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAErD,MAAM,QAAQ,GAAG;YACb,uCAAuC;YACvC,2CAA2C;YAC3C,CAAC,UAAU,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAC3E,kBAAkB,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,UAAU,IAAI;SAC7E,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEX,IAAI,CAAC,QAAQ,EAAE;YAEX,EAAE,CAAC,aAAa,CACZ,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,EAChC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAChC,CAAC;SAEL;aAAI;YAED,OAAO,CAAC,GAAG,CAAC,mBAAmB,QAAQ,IAAI,CAAC,CAAC;SAEhD;IAEL,CAAC;IA7Be,gBAAM,SA6BrB,CAAA;IAED,4CAA4C;IAC5C,SAAgB,aAAa,CACzB,MAEC;QAGD,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;QAE/B,MAAM,CAAC,EAAE,YAAY,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;aACrE,QAAQ,CAAC,MAAM,CAAC;aAChB,KAAK,CAAC,GAAG,CAAC,CAAA;QAEf,IAAI,CAAC,YAAY,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;SAC5C;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAEpC,CAAC;IAlBe,uBAAa,gBAkB5B,CAAA;AAEL,CAAC,EA7DgB,SAAS,GAAT,iBAAS,KAAT,iBAAS,QA6DzB"} \ No newline at end of file diff --git a/lib/resolve.d.ts b/lib/resolve.d.ts new file mode 100644 index 0000000..ddd88b8 --- /dev/null +++ b/lib/resolve.d.ts @@ -0,0 +1,193 @@ +import { Scheme } from "./Scheme"; +export declare type Result = { + type: "HANDMADE PORT"; + scheme: Scheme; +} | { + type: "DENOIFIED MODULE"; + scheme: Scheme; + tsconfigOutDir: string; +} | { + type: "NON-FATAL UNMET DEPENDENCY"; + kind: "DEV DEPENDENCY" | "BUILTIN"; +}; +/** + * + * Example 1: + * + * Context: + * - package.json "dependencies" has an entry { "js-yaml": "~3.12.0" } + * - There is no entry "js-yaml" in package.json "denoPorts" + * - The version field in "./node_modules/js-yaml/package.json" is "3.12.1" + * + * Resolve is called with: + * nodeModuleName: "js-yaml" + * + * -> + * + * The resolution goes as follow: + * - The entry "js-yaml" in package.json is not a "github:xxx" scheme. Skip + * - We use "./node_modules/js-yaml/package.json" repository field to lookup + * the github repo hosting the module: KSXGitHub/simple-js-yaml-port-for-deno. + * We found out that it is not a denoified module ( there is not a "./mod.ts" file + * containing the work "denoify"). Skip + * - There is no entry "js-yaml" in package.json "denoPorts". Skip + * - There is an entry { "js-yaml": "https://deno.land/x/js_yaml_port/js-yaml.js" } + * in knownPort.json, GET https://deno.land/x/js_yaml_port@3.12.1/js-yaml.js is not a 404. Done + * + * { + * "type": "HANDMADE PORT", + * "scheme": { + * "type": "url", + * "urlType": "deno.land", + * "baseUrlWithoutBranch": "https://deno.land/x/js_yaml_port", + * "branch": "3.12.1", + * "pathToIndex": "js-yaml.js" + * } + * } + * + * + * If the version field in "./node_modules/js-yaml/package.json" was "3.12.2" + * as GET https://deno.land/x/js_yaml_port@3.12.2/js-yaml.js gives a 404 + * ( KSXGitHub/simple-js-yaml-port-for-deno as no "v3.12.2" or "3.12.2" branch ) + * the result would have been the same without the "branch" property in the "scheme" and + * a warning would have been printed to the console. + * + * Example 2: + * + * Context: + * - package.json "dependencies" has no entry for "fs" + * - There is no entry "fs" in package.json "denoPorts" + * + * Resolve is called with: + * nodeModuleName: "fs" + * + * -> + * + * The resolution goes as follow: + * - "fs" is not present in "dependencies" nor "devDependencies" of package.json, assuming node builtin. + * - There is no entry for "fs" in package.json "denoPorts". Skip + * - There is an entry { "fs": "https://deno.land/std/node/fs.ts" } in known port. Done + * + * { + * "type": "HANDMADE PORT", + * "scheme": { + * "type": "url", + * "urlType": "deno.land", + * "baseUrlWithoutBranch": "https://deno.land/std", + * "pathToIndex": "node/fs.ts" + * } + * } + * + * Example 3: + * + * Context: + * - package.json "dependencies" has an entry { "ts-md5": "~1.2.7" } + * - There is no entry "ts-md5" in package.json "denoPorts" + * - The version field in "./node_modules/js-yaml/package.json" is "1.2.7" + * + * Resolve is called with: + * nodeModuleName: "ts-md5" + * + * -> + * + * The resolution goes as follow: + * - The entry "ts-md5" in package.json is not a "github:xxx" scheme. Skip + * - We use "./node_modules/ts-md5/package.json" repository field to lookup + * the github repo hosting the module: cotag/ts-md5. + * We found out that it is not a denoified module. Skip + * - There is no entry "ts-md5" in package.json "denoPorts". Skip + * - There is an entry { "ts-md5": "garronej/ts-md5" } + * in knownPort.json, GET https://raw.githubusercontent.com/garronej/ts-md5/v1.2.7/mod.ts is not a 404 + * and contain the word denoify. Done + * + * We lookup the "outDir" in https://raw.githubusercontent.com/garronej/ts-md5/v1.2.7/tsconfig.json, + * we need it so import "ts-md5/dist/md5_worker" can be replaced by "ts-md5/deno_dist/md5_worker.ts" later on. + * + * { + * "type": "DENOIFIED MODULE", + * "scheme": { + * "type": "github", + * "userOrOrg": "garronej", + * "repositoryName": "ts-md5", + * "branch": "v1.2.7" + * }, + * "tsconfigOutDir": "dist" + * } + * + * Example 4: + * + * Context: + * - package.json "dependencies" has an entry { "ts-md5": "garronej/ts-md5#1.2.7" } + * + * Resolve is called with: + * nodeModuleName: "ts-md5" + * + * -> + * + * The resolution goes as follow: + * - The entry "js-yaml" in package.json ("garronej/ts-md5") is a "github:xxx" scheme. + * GET https://raw.githubusercontent.com/garronej/ts-md5/v1.2.7/mod.ts is not a 404 and the file + * contains the word "denoify". Done + * + * We lookup the "outDir" in https://raw.githubusercontent.com/garronej/ts-md5/v1.2.7/tsconfig.json, + * + * { + * "type": "DENOIFIED MODULE", + * "scheme": { + * "type": "github", + * "userOrOrg": "garronej", + * "repositoryName": "ts-md5", + * "branch": "v1.2.7" + * }, + * "tsconfigOutDir": "dist" + * } + * + * Example 5: + * + * Context: + * - package.json "dependencies" has an entry { "run-exclusive": "^2.1.0" } + * - The version field in "./node_modules/run-exclusive/package.json" is "2.1.12". + * + * Resolve is called with: + * nodeModuleName: "run-exclusive" + * + * -> + * + * The resolution goes as follow: + * - The entry "run-exclusive" in package.json is not a "github:xxx" scheme. Skip + * - We use "./node_modules/ts-md5/package.json" repository field to lookup + * the github repo hosting the module: garronej/run-exclusive. + * https://raw.githubusercontent.com/garronej/ts-md5/2.1.12/mod.ts is not a 404 + * and contain the word "denoify". Done + * + * We lookup the "outDir" in https://raw.githubusercontent.com/garronej/run-exclusive/v2.1.12/tsconfig.json, + * + * { + * "type": "DENOIFIED MODULE", + * "scheme": { + * "type": "github", + * "userOrOrg": "garronej", + * "repositoryName": "run-exclusive", + * "branch": "2.1.12" + * }, + * "tsconfigOutDir": "dist" + * } + * + */ +export declare function resolveFactory(params: { + projectPath: string; + userProvidedPorts: { + [nodeModuleName: string]: string; + }; + dependencies: { + [nodeModuleName: string]: string; + }; + devDependencies: { + [nodeModuleName: string]: string; + }; + log: typeof console.log; +}): { + resolve: (params: { + nodeModuleName: string; + }) => Promise; +}; diff --git a/lib/resolve.js b/lib/resolve.js new file mode 100644 index 0000000..3ad16fb --- /dev/null +++ b/lib/resolve.js @@ -0,0 +1,309 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveFactory = void 0; +const st = require("scripting-tools"); +const path = require("path"); +const typeSafety_1 = require("evt/tools/typeSafety"); +const Scheme_1 = require("./Scheme"); +const getTsconfigOutDirIfDenoified_1 = require("./getTsconfigOutDirIfDenoified"); +const commentJson = require("comment-json"); +const getProjectRoot_1 = require("../tools/getProjectRoot"); +const fs = require("fs"); +const knownPorts = (() => { + const { third_party, builtins } = commentJson.parse(fs.readFileSync(path.join(getProjectRoot_1.getProjectRoot(), "known-ports.jsonc")).toString("utf8")); + return { + ...third_party, + ...builtins + }; +})(); +/** + * + * Example 1: + * + * Context: + * - package.json "dependencies" has an entry { "js-yaml": "~3.12.0" } + * - There is no entry "js-yaml" in package.json "denoPorts" + * - The version field in "./node_modules/js-yaml/package.json" is "3.12.1" + * + * Resolve is called with: + * nodeModuleName: "js-yaml" + * + * -> + * + * The resolution goes as follow: + * - The entry "js-yaml" in package.json is not a "github:xxx" scheme. Skip + * - We use "./node_modules/js-yaml/package.json" repository field to lookup + * the github repo hosting the module: KSXGitHub/simple-js-yaml-port-for-deno. + * We found out that it is not a denoified module ( there is not a "./mod.ts" file + * containing the work "denoify"). Skip + * - There is no entry "js-yaml" in package.json "denoPorts". Skip + * - There is an entry { "js-yaml": "https://deno.land/x/js_yaml_port/js-yaml.js" } + * in knownPort.json, GET https://deno.land/x/js_yaml_port@3.12.1/js-yaml.js is not a 404. Done + * + * { + * "type": "HANDMADE PORT", + * "scheme": { + * "type": "url", + * "urlType": "deno.land", + * "baseUrlWithoutBranch": "https://deno.land/x/js_yaml_port", + * "branch": "3.12.1", + * "pathToIndex": "js-yaml.js" + * } + * } + * + * + * If the version field in "./node_modules/js-yaml/package.json" was "3.12.2" + * as GET https://deno.land/x/js_yaml_port@3.12.2/js-yaml.js gives a 404 + * ( KSXGitHub/simple-js-yaml-port-for-deno as no "v3.12.2" or "3.12.2" branch ) + * the result would have been the same without the "branch" property in the "scheme" and + * a warning would have been printed to the console. + * + * Example 2: + * + * Context: + * - package.json "dependencies" has no entry for "fs" + * - There is no entry "fs" in package.json "denoPorts" + * + * Resolve is called with: + * nodeModuleName: "fs" + * + * -> + * + * The resolution goes as follow: + * - "fs" is not present in "dependencies" nor "devDependencies" of package.json, assuming node builtin. + * - There is no entry for "fs" in package.json "denoPorts". Skip + * - There is an entry { "fs": "https://deno.land/std/node/fs.ts" } in known port. Done + * + * { + * "type": "HANDMADE PORT", + * "scheme": { + * "type": "url", + * "urlType": "deno.land", + * "baseUrlWithoutBranch": "https://deno.land/std", + * "pathToIndex": "node/fs.ts" + * } + * } + * + * Example 3: + * + * Context: + * - package.json "dependencies" has an entry { "ts-md5": "~1.2.7" } + * - There is no entry "ts-md5" in package.json "denoPorts" + * - The version field in "./node_modules/js-yaml/package.json" is "1.2.7" + * + * Resolve is called with: + * nodeModuleName: "ts-md5" + * + * -> + * + * The resolution goes as follow: + * - The entry "ts-md5" in package.json is not a "github:xxx" scheme. Skip + * - We use "./node_modules/ts-md5/package.json" repository field to lookup + * the github repo hosting the module: cotag/ts-md5. + * We found out that it is not a denoified module. Skip + * - There is no entry "ts-md5" in package.json "denoPorts". Skip + * - There is an entry { "ts-md5": "garronej/ts-md5" } + * in knownPort.json, GET https://raw.githubusercontent.com/garronej/ts-md5/v1.2.7/mod.ts is not a 404 + * and contain the word denoify. Done + * + * We lookup the "outDir" in https://raw.githubusercontent.com/garronej/ts-md5/v1.2.7/tsconfig.json, + * we need it so import "ts-md5/dist/md5_worker" can be replaced by "ts-md5/deno_dist/md5_worker.ts" later on. + * + * { + * "type": "DENOIFIED MODULE", + * "scheme": { + * "type": "github", + * "userOrOrg": "garronej", + * "repositoryName": "ts-md5", + * "branch": "v1.2.7" + * }, + * "tsconfigOutDir": "dist" + * } + * + * Example 4: + * + * Context: + * - package.json "dependencies" has an entry { "ts-md5": "garronej/ts-md5#1.2.7" } + * + * Resolve is called with: + * nodeModuleName: "ts-md5" + * + * -> + * + * The resolution goes as follow: + * - The entry "js-yaml" in package.json ("garronej/ts-md5") is a "github:xxx" scheme. + * GET https://raw.githubusercontent.com/garronej/ts-md5/v1.2.7/mod.ts is not a 404 and the file + * contains the word "denoify". Done + * + * We lookup the "outDir" in https://raw.githubusercontent.com/garronej/ts-md5/v1.2.7/tsconfig.json, + * + * { + * "type": "DENOIFIED MODULE", + * "scheme": { + * "type": "github", + * "userOrOrg": "garronej", + * "repositoryName": "ts-md5", + * "branch": "v1.2.7" + * }, + * "tsconfigOutDir": "dist" + * } + * + * Example 5: + * + * Context: + * - package.json "dependencies" has an entry { "run-exclusive": "^2.1.0" } + * - The version field in "./node_modules/run-exclusive/package.json" is "2.1.12". + * + * Resolve is called with: + * nodeModuleName: "run-exclusive" + * + * -> + * + * The resolution goes as follow: + * - The entry "run-exclusive" in package.json is not a "github:xxx" scheme. Skip + * - We use "./node_modules/ts-md5/package.json" repository field to lookup + * the github repo hosting the module: garronej/run-exclusive. + * https://raw.githubusercontent.com/garronej/ts-md5/2.1.12/mod.ts is not a 404 + * and contain the word "denoify". Done + * + * We lookup the "outDir" in https://raw.githubusercontent.com/garronej/run-exclusive/v2.1.12/tsconfig.json, + * + * { + * "type": "DENOIFIED MODULE", + * "scheme": { + * "type": "github", + * "userOrOrg": "garronej", + * "repositoryName": "run-exclusive", + * "branch": "2.1.12" + * }, + * "tsconfigOutDir": "dist" + * } + * + */ +function resolveFactory(params) { + const { log } = params; + const { denoPorts } = (() => { + const denoPorts = {}; + [knownPorts, params.userProvidedPorts].forEach(record => Object.keys(record).forEach(nodeModuleName => denoPorts[nodeModuleName] = record[nodeModuleName])); + return { denoPorts }; + })(); + const allDependencies = { + ...params.dependencies, + ...params.devDependencies + }; + const devDependenciesNames = Object.keys(params.devDependencies); + const getTargetModulePath = (nodeModuleName) => st.find_module_path(nodeModuleName, params.projectPath); + const isInUserProvidedPort = (nodeModuleName) => nodeModuleName in params.userProvidedPorts; + async function resolve(params) { + const { nodeModuleName //js-yaml + } = params; + if (!(nodeModuleName in allDependencies)) { + if (!(nodeModuleName in denoPorts)) { + return { + "type": "NON-FATAL UNMET DEPENDENCY", + "kind": "BUILTIN" + }; + } + const scheme = Scheme_1.Scheme.parse(denoPorts[nodeModuleName]); + const { tsconfigOutDir } = await getTsconfigOutDirIfDenoified_1.getTsconfigOutDirIfDenoified({ scheme }); + return !!tsconfigOutDir ? { + "type": "DENOIFIED MODULE", + scheme, + tsconfigOutDir + } : { + "type": "HANDMADE PORT", + scheme + }; + } + let repo = undefined; + walk: { + let scheme; + //TODO: Refactor + if (Scheme_1.Scheme.GitHub.matchStr(allDependencies[nodeModuleName])) { + // allDependencies[nodeModuleName] === "github:garronej/ts-md5#1.2.7" + scheme = await Scheme_1.Scheme.GitHub.parse(allDependencies[nodeModuleName]); + } + else { + // allDependencies[nodeModuleName] === "^1.2.3" + break walk; + } + typeSafety_1.assert(scheme.type === "github"); + repo = scheme; + } + const { version, // 3.13.1 (version installed) + repository: repositoryEntryOfPackageJson } = JSON.parse(fs.readFileSync(path.join(getTargetModulePath(nodeModuleName), // node_modules/js-yaml + "package.json")).toString("utf8")); + repo = !!repo ? repo : (() => { + const repositoryUrl = repositoryEntryOfPackageJson === null || repositoryEntryOfPackageJson === void 0 ? void 0 : repositoryEntryOfPackageJson["url"]; + if (!repositoryUrl) { + return undefined; + } + const [repositoryName, userOrOrg] = repositoryUrl + .replace(/\.git$/i, "") + .split("/") + .filter((s) => !!s) + .reverse(); + if (!repositoryName || !userOrOrg) { + return undefined; + } + return { repositoryName, userOrOrg }; + })(); + walk: { + if (repo === undefined) { + break walk; + } + const { repositoryName, userOrOrg } = repo; + const resolveResult = await Scheme_1.Scheme.resolveVersion(Scheme_1.Scheme.parse(`github:${userOrOrg}/${repositoryName}`), { version }); + if (!resolveResult.couldConnect) { + break walk; + } + const { scheme, notTheExactVersionWarning } = resolveResult; + const { tsconfigOutDir } = await getTsconfigOutDirIfDenoified_1.getTsconfigOutDirIfDenoified({ scheme }); + if (!tsconfigOutDir) { + break walk; + } + if (notTheExactVersionWarning) { + log(notTheExactVersionWarning); + } + if (isInUserProvidedPort(nodeModuleName)) { + log(`NOTE: ${nodeModuleName} is a denoified module, there is no need for an entry for in package.json denoPorts`); + } + return typeSafety_1.id({ + "type": "DENOIFIED MODULE", + scheme, + tsconfigOutDir + }); + } + walk: { + if (!(nodeModuleName in denoPorts)) { + break walk; + } + const resolveResult = await Scheme_1.Scheme.resolveVersion(Scheme_1.Scheme.parse(denoPorts[nodeModuleName]), { version }); + if (!resolveResult.couldConnect) { + log([ + `WARNING: Even if the port ${denoPorts[nodeModuleName]}`, + `was specified for ${nodeModuleName} we couldn't connect to the repo` + ]); + break walk; + } + const { scheme, notTheExactVersionWarning } = resolveResult; + if (!!notTheExactVersionWarning) { + log(notTheExactVersionWarning); + } + return { + "type": "HANDMADE PORT", + scheme + }; + } + if (devDependenciesNames.includes(nodeModuleName)) { + return { + "type": "NON-FATAL UNMET DEPENDENCY", + "kind": "DEV DEPENDENCY" + }; + } + throw new Error(`You need to provide a deno port for ${nodeModuleName}`); + } + return { resolve }; +} +exports.resolveFactory = resolveFactory; +//# sourceMappingURL=resolve.js.map \ No newline at end of file diff --git a/lib/resolve.js.map b/lib/resolve.js.map new file mode 100644 index 0000000..aaf7195 --- /dev/null +++ b/lib/resolve.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../src/lib/resolve.ts"],"names":[],"mappings":";;;AACA,sCAAsC;AACtC,6BAA6B;AAC7B,qDAAkD;AAClD,qCAAkC;AAClC,iFAA8E;AAC9E,4CAA4C;AAC5C,4DAAyD;AACzD,yBAAyB;AAEzB,MAAM,UAAU,GAA0C,CAAC,GAAG,EAAE;IAE5D,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAC3B,WAAW,CAAC,KAAK,CACb,EAAE,CAAC,YAAY,CACX,IAAI,CAAC,IAAI,CAAC,+BAAc,EAAE,EAAE,mBAAmB,CAAC,CACnD,CAAC,QAAQ,CAAC,MAAM,CAAC,CACrB,CAAC;IAEN,OAAO;QACH,GAAG,WAAW;QACd,GAAG,QAAQ;KACd,CAAC;AAEN,CAAC,CAAC,EAAE,CAAC;AAeL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmKG;AACH,SAAgB,cAAc,CAC1B,MAMC;IAGD,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAEvB,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,GAAG,EAAE;QAExB,MAAM,SAAS,GAA0C,EAAE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,cAAc,CAC7C,eAAM,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,EACvC,EAAE,OAAO,EAAE,CACd,CAAC;YAEF,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE;gBAC7B,GAAG,CAAC;oBACA,6BAA6B,SAAS,CAAC,cAAc,CAAC,EAAE;oBACxD,qBAAqB,cAAc,kCAAkC;iBACxE,CAAC,CAAC;gBACH,MAAM,IAAI,CAAC;aACd;YAGD,MAAM,EAAE,MAAM,EAAE,yBAAyB,EAAE,GAAG,aAAa,CAAC;YAE5D,IAAI,CAAC,CAAC,yBAAyB,EAAE;gBAC7B,GAAG,CAAC,yBAAyB,CAAC,CAAC;aAClC;YAED,OAAO;gBACH,MAAM,EAAE,eAAe;gBACvB,MAAM;aACT,CAAA;SAEJ;QAGD,IAAI,oBAAoB,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE;YAC/C,OAAO;gBACH,MAAM,EAAE,4BAA4B;gBACpC,MAAM,EAAE,gBAAgB;aAC3B,CAAC;SACL;QAED,MAAM,IAAI,KAAK,CAAC,uCAAuC,cAAc,EAAE,CAAC,CAAC;IAE7E,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,CAAC;AAEvB,CAAC;AAtOD,wCAsOC"} \ No newline at end of file diff --git a/lib/transformCodebase.d.ts b/lib/transformCodebase.d.ts new file mode 100644 index 0000000..69cf5d0 --- /dev/null +++ b/lib/transformCodebase.d.ts @@ -0,0 +1,11 @@ +/** Apply a transformation function to every file of directory */ +export declare function transformCodebase(params: { + srcDirPath: string; + destDirPath: string; + transformSourceCodeString: (params: { + /** e.g: .ts */ + extension: string; + sourceCode: string; + fileDirPath: string; + }) => Promise; +}): Promise; diff --git a/lib/transformCodebase.js b/lib/transformCodebase.js new file mode 100644 index 0000000..06bb5e0 --- /dev/null +++ b/lib/transformCodebase.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.transformCodebase = void 0; +const st = require("scripting-tools"); +const fs = require("fs"); +const path = require("path"); +const crawl_1 = require("../tools/crawl"); +/** Apply a transformation function to every file of directory */ +async function transformCodebase(params) { + const { srcDirPath, destDirPath, transformSourceCodeString } = params; + for (const file_relative_path of crawl_1.crawl(srcDirPath)) { + st.fs_move("COPY", srcDirPath, destDirPath, file_relative_path); + const file_path = path.join(destDirPath, file_relative_path); + fs.writeFileSync(file_path, Buffer.from(await transformSourceCodeString({ + "extension": path.extname(file_path).substr(1).toLowerCase(), + "sourceCode": fs.readFileSync(file_path).toString("utf8"), + "fileDirPath": path.dirname(path.join(srcDirPath, file_relative_path)) + }), "utf8")); + } +} +exports.transformCodebase = transformCodebase; +//# sourceMappingURL=transformCodebase.js.map \ No newline at end of file diff --git a/lib/transformCodebase.js.map b/lib/transformCodebase.js.map new file mode 100644 index 0000000..8e2ebf9 --- /dev/null +++ b/lib/transformCodebase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transformCodebase.js","sourceRoot":"","sources":["../src/lib/transformCodebase.ts"],"names":[],"mappings":";;;AAEA,sCAAsC;AACtC,yBAAyB;AACzB,6BAA6B;AAC7B,0CAAuC;AAIvC,iEAAiE;AAC1D,KAAK,UAAU,iBAAiB,CACnC,MASC;IAGD,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,yBAAyB,EAAE,GAAG,MAAM,CAAC;IAEtE,KAAK,MAAM,kBAAkB,IAAI,aAAK,CAAC,UAAU,CAAC,EAAE;QAEhD,EAAE,CAAC,OAAO,CACN,MAAM,EACN,UAAU,EACV,WAAW,EACX,kBAAkB,CACrB,CAAC;QAEF,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAE7D,EAAE,CAAC,aAAa,CACZ,SAAS,EACT,MAAM,CAAC,IAAI,CACP,MAAM,yBAAyB,CAAC;YAC5B,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;YAC5D,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;YACzD,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;SACzE,CAAC,EACF,MAAM,CACT,CACJ,CAAC;KAEL;AAGL,CAAC;AAzCD,8CAyCC"} \ No newline at end of file diff --git a/package.json b/package.json index 5114f13..732edcb 100755 --- a/package.json +++ b/package.json @@ -6,17 +6,10 @@ "type": "git", "url": "git://github.com/garronej/denoify" }, - "scripts": { - "tsc": "npx tsc", - "grant-exec-perms": "chmod +x ./dist/bin/*.js", - "build": "npm run tsc && npm run grant-exec-perms", - "test": "node ./dist/test", - "enable_short_import_path": "npm run build && node ./dist/bin/enableShortNpmImportPath.js" - }, "bin": { - "denoify": "./dist/bin/denoify.js", - "denoify_enable_short_npm_import_path": "./dist/bin/enableShortNpmImportPath.js", - "denoify_enable_short_deno_import_path": "./dist/bin/enableShortDenoImportPath.js" + "denoify": "bin/denoify.js", + "denoify_enable_short_npm_import_path": "bin/enableShortNpmImportPath.js", + "denoify_enable_short_deno_import_path": "bin/enableShortDenoImportPath.js" }, "author": "u/garronej", "license": "MIT", @@ -39,13 +32,103 @@ "CommonJs" ], "files": [ - "/known-ports.jsonc", - "/dist/lib/", - "/dist/tools/", - "/dist/bin/", - "/src/lib/", - "/src/tools/", - "/src/bin/" + "known-ports.jsonc", + "lib/Scheme.d.ts", + "lib/Scheme.js", + "lib/Scheme.js.map", + "lib/denoify.d.ts", + "lib/denoify.js", + "lib/denoify.js.map", + "lib/denoifyImportArgument.d.ts", + "lib/denoifyImportArgument.js", + "lib/denoifyImportArgument.js.map", + "lib/denoifySingleFile.d.ts", + "lib/denoifySingleFile.js", + "lib/denoifySingleFile.js.map", + "lib/getIsDryRun.d.ts", + "lib/getIsDryRun.js", + "lib/getIsDryRun.js.map", + "lib/getTsconfigOutDirIfDenoified.d.ts", + "lib/getTsconfigOutDirIfDenoified.js", + "lib/getTsconfigOutDirIfDenoified.js.map", + "lib/modTsFile.d.ts", + "lib/modTsFile.js", + "lib/modTsFile.js.map", + "lib/resolve.d.ts", + "lib/resolve.js", + "lib/resolve.js.map", + "lib/transformCodebase.d.ts", + "lib/transformCodebase.js", + "lib/transformCodebase.js.map", + "tools/addCache.d.ts", + "tools/addCache.js", + "tools/addCache.js.map", + "tools/crawl.d.ts", + "tools/crawl.js", + "tools/crawl.js.map", + "tools/exec.d.ts", + "tools/exec.js", + "tools/exec.js.map", + "tools/getProjectRoot.d.ts", + "tools/getProjectRoot.js", + "tools/getProjectRoot.js.map", + "tools/globProxy.d.ts", + "tools/globProxy.js", + "tools/globProxy.js.map", + "tools/is404.d.ts", + "tools/is404.js", + "tools/is404.js.map", + "tools/isInsideOrIsDir.d.ts", + "tools/isInsideOrIsDir.js", + "tools/isInsideOrIsDir.js.map", + "tools/moveContentUpOneLevel.d.ts", + "tools/moveContentUpOneLevel.js", + "tools/moveContentUpOneLevel.js.map", + "tools/pathDepth.d.ts", + "tools/pathDepth.js", + "tools/pathDepth.js.map", + "tools/removeFromGitignore.d.ts", + "tools/removeFromGitignore.js", + "tools/removeFromGitignore.js.map", + "tools/replaceAsync.d.ts", + "tools/replaceAsync.js", + "tools/replaceAsync.js.map", + "tools/urlJoin.d.ts", + "tools/urlJoin.js", + "tools/urlJoin.js.map", + "bin/denoify.d.ts", + "bin/denoify.js", + "bin/denoify.js.map", + "bin/enableShortDenoImportPath.d.ts", + "bin/enableShortDenoImportPath.js", + "bin/enableShortDenoImportPath.js.map", + "bin/enableShortNpmImportPath.d.ts", + "bin/enableShortNpmImportPath.js", + "bin/enableShortNpmImportPath.js.map", + "src/lib/Scheme.ts", + "src/lib/denoify.ts", + "src/lib/denoifyImportArgument.ts", + "src/lib/denoifySingleFile.ts", + "src/lib/getIsDryRun.ts", + "src/lib/getTsconfigOutDirIfDenoified.ts", + "src/lib/modTsFile.ts", + "src/lib/resolve.ts", + "src/lib/transformCodebase.ts", + "src/tools/addCache.ts", + "src/tools/crawl.ts", + "src/tools/exec.ts", + "src/tools/getProjectRoot.ts", + "src/tools/globProxy.ts", + "src/tools/is404.ts", + "src/tools/isInsideOrIsDir.ts", + "src/tools/moveContentUpOneLevel.ts", + "src/tools/pathDepth.ts", + "src/tools/removeFromGitignore.ts", + "src/tools/replaceAsync.ts", + "src/tools/urlJoin.ts", + "src/bin/denoify.ts", + "src/bin/enableShortDenoImportPath.ts", + "src/bin/enableShortNpmImportPath.ts" ], "devDependencies": { "@types/glob": "^7.1.1", diff --git a/test/denoifyImportArgument.d.ts b/test/denoifyImportArgument.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/test/denoifyImportArgument.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/test/denoifyImportArgument.js b/test/denoifyImportArgument.js new file mode 100644 index 0000000..f2357cd --- /dev/null +++ b/test/denoifyImportArgument.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const denoifyImportArgument_1 = require("../lib/denoifyImportArgument"); +console.log(`TODO: ${denoifyImportArgument_1.denoifyImportArgumentFactory.name}`); +//# sourceMappingURL=denoifyImportArgument.js.map \ No newline at end of file diff --git a/test/denoifyImportArgument.js.map b/test/denoifyImportArgument.js.map new file mode 100644 index 0000000..14e2352 --- /dev/null +++ b/test/denoifyImportArgument.js.map @@ -0,0 +1 @@ +{"version":3,"file":"denoifyImportArgument.js","sourceRoot":"","sources":["../src/test/denoifyImportArgument.ts"],"names":[],"mappings":";;AACA,wEAA4E;AAE5E,OAAO,CAAC,GAAG,CAAC,SAAS,oDAA4B,CAAC,IAAI,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/test/denoifySingleFile.d.ts b/test/denoifySingleFile.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/test/denoifySingleFile.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/test/denoifySingleFile.js b/test/denoifySingleFile.js new file mode 100644 index 0000000..9f88d84 --- /dev/null +++ b/test/denoifySingleFile.js @@ -0,0 +1,76 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const denoifySingleFile_1 = require("../lib/denoifySingleFile"); +const typeSafety_1 = require("evt/tools/typeSafety"); +{ + const sourceCode = ` +import + + * as _ + +from + +"xxx"; import * as foobar from "xxx" import * as d from "xxx"; +const ok = 3; +import { } from "xxx"; +import * as baz from "xxx"; +import * as foo from 'xxx'; +import type * as foo from 'xxx'; +import type { Cat } from 'xxx'; +import "xxx"; + +const dd = import("xxx"); +const dd = import ( "xxx" ); + +`; + const str = "foo bar"; + const { denoifySingleFile } = denoifySingleFile_1.denoifySingleFileFactory({ + "denoifyImportArgument": ({ importArgument, fileDirPath }) => { + typeSafety_1.assert(fileDirPath === str); + typeSafety_1.assert(importArgument === "xxx"); + return Promise.resolve("yyy"); + } + }); + (async () => { + const modifiedSourceCode = await denoifySingleFile({ + sourceCode, + "fileDirPath": str + }); + typeSafety_1.assert(modifiedSourceCode === sourceCode.replace(/xxx/g, "yyy")); + console.log("PASS"); + })(); +} +{ + const sourceCode = ` +console.log(__dirname,__filename); +`; + const expected = ` +const __dirname = (()=>{ + const {url: urlStr}= import.meta; + const url= new URL(urlStr); + const __filename = url.protocol === "file:" ? url.pathname : urlStr; + return __filename.replace(/[/][^/]*$/, ''); +})(); + +const __filename = (()=>{ + const {url: urlStr}= import.meta; + const url= new URL(urlStr); + return url.protocol === "file:" ? url.pathname : urlStr; +})(); + + +console.log(__dirname,__filename); +`.replace(/^\n/, ""); + const { denoifySingleFile } = denoifySingleFile_1.denoifySingleFileFactory({ + "denoifyImportArgument": () => { throw new Error("never"); } + }); + (async () => { + const modifiedSourceCode = await denoifySingleFile({ + sourceCode, + "fileDirPath": "whatever" + }); + typeSafety_1.assert(modifiedSourceCode === expected, "message"); + console.log("PASS"); + })(); +} +//# sourceMappingURL=denoifySingleFile.js.map \ No newline at end of file diff --git a/test/denoifySingleFile.js.map b/test/denoifySingleFile.js.map new file mode 100644 index 0000000..dd94bf7 --- /dev/null +++ b/test/denoifySingleFile.js.map @@ -0,0 +1 @@ +{"version":3,"file":"denoifySingleFile.js","sourceRoot":"","sources":["../src/test/denoifySingleFile.ts"],"names":[],"mappings":";;AACA,gEAAoE;AACpE,qDAA8C;AAE9C;IAEA,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;CAmBlB,CAAC;IAEF,MAAM,GAAG,GAAG,SAAS,CAAC;IAEtB,MAAM,EAAE,iBAAiB,EAAE,GAAG,4CAAwB,CAAC;QACnD,uBAAuB,EAAE,CAAC,EAAE,cAAc,EAAE,WAAW,EAAE,EAAE,EAAE;YAEzD,mBAAM,CAAC,WAAW,KAAK,GAAG,CAAC,CAAC;YAC5B,mBAAM,CAAC,cAAc,KAAK,KAAK,CAAC,CAAC;YAEjC,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAElC,CAAC;KACJ,CAAC,CAAC;IAGH,CAAC,KAAK,IAAI,EAAE;QAER,MAAM,kBAAkB,GAAG,MAAM,iBAAiB,CAAC;YAC/C,UAAU;YACV,aAAa,EAAE,GAAG;SACrB,CAAC,CAAC;QAEH,mBAAM,CAAC,kBAAkB,KAAK,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;QAEjE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAExB,CAAC,CAAC,EAAE,CAAC;CAEJ;AAGD;IAEI,MAAM,UAAU,GAAG;;CAEtB,CAAC;IAEE,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;CAgBpB,CAAC,OAAO,CAAC,KAAK,EAAC,EAAE,CAAC,CAAC;IAEhB,MAAM,EAAE,iBAAiB,EAAE,GAAG,4CAAwB,CAAC;QACnD,uBAAuB,EAAE,GAAG,EAAE,GAAG,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;KAC/D,CAAC,CAAC;IAEH,CAAC,KAAK,IAAI,EAAE;QAER,MAAM,kBAAkB,GAAG,MAAM,iBAAiB,CAAC;YAC/C,UAAU;YACV,aAAa,EAAE,UAAU;SAC5B,CAAC,CAAC;QAEH,mBAAM,CAAC,kBAAkB,KAAK,QAAQ,EAAE,SAAS,CAAC,CAAC;QAEnD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAExB,CAAC,CAAC,EAAE,CAAC;CAER"} \ No newline at end of file diff --git a/test/index.d.ts b/test/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/test/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/test/index.js b/test/index.js new file mode 100644 index 0000000..7c6186a --- /dev/null +++ b/test/index.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const child_process = require("child_process"); +const path = require("path"); +const Deferred_1 = require("evt/tools/Deferred"); +const names = [ + "scheme", + "resolve", + "denoifyImportArgument", + "denoifySingleFile" +]; +(async () => { + if (!!process.env.FORK) { + process.once("unhandledRejection", error => { throw error; }); + require(process.env.FORK); + return; + } + for (const name of names) { + console.log(`Running: ${name}`); + const dExitCode = new Deferred_1.Deferred(); + child_process.fork(__filename, undefined, { "env": { "FORK": path.join(__dirname, name) } }) + .on("message", console.log) + .once("exit", code => dExitCode.resolve(code !== null && code !== void 0 ? code : 1)); + const exitCode = await dExitCode.pr; + if (exitCode !== 0) { + console.log(`${name} exited with error code: ${exitCode}`); + process.exit(exitCode); + } + console.log("\n"); + } +})(); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/test/index.js.map b/test/index.js.map new file mode 100644 index 0000000..1c8af1e --- /dev/null +++ b/test/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/test/index.ts"],"names":[],"mappings":";;AACA,+CAA+C;AAC/C,6BAA6B;AAC7B,iDAA8C;AAE9C,MAAM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..cb0ff5c --- /dev/null +++ b/test/resolve.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/test/resolve.js b/test/resolve.js new file mode 100644 index 0000000..0e4b641 --- /dev/null +++ b/test/resolve.js @@ -0,0 +1,147 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const resolve_1 = require("../lib/resolve"); +const path = require("path"); +const inDepth = require("evt/tools/inDepth"); +const typeSafety_1 = require("evt/tools/typeSafety"); +(async () => { + console.log("NOTE: This test require an internet connection"); + { + let std_out = ""; + const { resolve } = resolve_1.resolveFactory({ + "projectPath": path.join(__dirname, "..", "..", "res", "test_resolve_1"), + "dependencies": { + "js-yaml": "~3.13.0" + }, + "devDependencies": {}, + "userProvidedPorts": {}, + "log": (...args) => std_out += args.join(" ") + }); + typeSafety_1.assert(inDepth.same(await resolve({ "nodeModuleName": "js-yaml" }), { + type: 'HANDMADE PORT', + scheme: { + type: 'url', + urlType: 'deno.land', + baseUrlWithoutBranch: 'https://deno.land/x/js_yaml_port', + branch: '3.13.1', + pathToIndex: 'js-yaml.js' + } + })); + typeSafety_1.assert(std_out === ""); + } + { + let std_out = ""; + const { resolve } = resolve_1.resolveFactory({ + "projectPath": path.join(__dirname, "..", "..", "res", "test_resolve_2"), + "dependencies": { + "js-yaml": "~3.13.0" + }, + "devDependencies": {}, + "userProvidedPorts": {}, + "log": (...args) => std_out += args.join(" ") + }); + typeSafety_1.assert(inDepth.same(await resolve({ "nodeModuleName": "js-yaml" }), { + type: 'HANDMADE PORT', + scheme: { + type: 'url', + urlType: 'deno.land', + baseUrlWithoutBranch: 'https://deno.land/x/js_yaml_port', + branch: "master", + pathToIndex: 'js-yaml.js' + } + })); + const expected_std_out = `WARNING: Specific version 3.13.0 could not be found +GET https://deno.land/x/js_yaml_port@3.13.0/js-yaml.js 404 +GET https://deno.land/x/js_yaml_port@v3.13.0/js-yaml.js 404 +Falling back to master branch +This mean that the Node and the Deno distribution of your module will not run the same version of this dependency.`; + typeSafety_1.assert(std_out === expected_std_out); + } + { + let std_out = ""; + const { resolve } = resolve_1.resolveFactory({ + "projectPath": path.join(__dirname, "..", "..", "res", "test_resolve_3"), + "dependencies": { "ts-md5": "1.2.7" }, + "devDependencies": {}, + "userProvidedPorts": {}, + "log": (...args) => std_out += args.join(" ") + }); + typeSafety_1.assert(inDepth.same(await resolve({ "nodeModuleName": "ts-md5" }), { + type: 'HANDMADE PORT', + scheme: { + type: 'github', + userOrOrg: 'garronej', + repositoryName: 'ts-md5', + branch: '1.2.7' + } + })); + typeSafety_1.assert(std_out === ""); + } + { + let std_out = ""; + const { resolve } = resolve_1.resolveFactory({ + "projectPath": path.join(__dirname, "..", "..", "res", "test_resolve_4"), + "dependencies": { "my-dummy-npm-and-deno-module": "0.2.0" }, + "devDependencies": {}, + "userProvidedPorts": {}, + "log": (...args) => std_out += args.join(" ") + }); + typeSafety_1.assert(inDepth.same(await resolve({ "nodeModuleName": "my-dummy-npm-and-deno-module" }), { + type: 'DENOIFIED MODULE', + scheme: { + type: 'github', + userOrOrg: 'garronej', + repositoryName: 'my_dummy_npm_and_deno_module', + branch: "0.2.0" + }, + tsconfigOutDir: './dist' + })); + typeSafety_1.assert(std_out === ""); + } + { + let std_out = ""; + const { resolve } = resolve_1.resolveFactory({ + "projectPath": path.join(__dirname, "..", "..", "res", "test_resolve_5"), + "dependencies": { "ts-md5": "garronej/ts-md5#1.2.7" }, + "devDependencies": {}, + "userProvidedPorts": {}, + "log": (...args) => std_out += args.join(" ") + }); + typeSafety_1.assert(inDepth.same(await resolve({ "nodeModuleName": "ts-md5" }), { + type: 'DENOIFIED MODULE', + scheme: { + type: 'github', + userOrOrg: 'garronej', + repositoryName: 'ts-md5', + branch: '1.2.7' + }, + tsconfigOutDir: './dist' + })); + typeSafety_1.assert(std_out === ""); + } + { + let std_out = ""; + const { resolve } = resolve_1.resolveFactory({ + "projectPath": path.join(__dirname, "..", "..", "res", "test_resolve_6"), + "dependencies": { + "minimal-polyfills": "~2.0.0" + }, + "devDependencies": {}, + "userProvidedPorts": {}, + "log": (...args) => std_out += args.join(" ") + }); + typeSafety_1.assert(inDepth.same(await resolve({ "nodeModuleName": "minimal-polyfills" }), { + type: 'DENOIFIED MODULE', + scheme: { + type: 'github', + userOrOrg: 'garronej', + repositoryName: 'minimal_polyfills', + branch: '2.0.1' + }, + tsconfigOutDir: './dist' + })); + typeSafety_1.assert(std_out === ""); + } + console.log("PASS"); +})(); +//# sourceMappingURL=resolve.js.map \ No newline at end of file diff --git a/test/resolve.js.map b/test/resolve.js.map new file mode 100644 index 0000000..ace10d9 --- /dev/null +++ b/test/resolve.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../src/test/resolve.ts"],"names":[],"mappings":";;AACA,4CAAgD;AAChD,6BAA6B;AAC7B,6CAA6C;AAC7C,qDAA8C;AAG9C,CAAC,KAAK,IAAI,EAAE;IAER,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IAG9D;QAEI,IAAI,OAAO,GAAG,EAAE,CAAC;QAEjB,MAAM,EAAE,OAAO,EAAE,GAAG,wBAAc,CAAC;YAC/B,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,gBAAgB,CAAC;YACxE,cAAc,EAAE;gBACZ,SAAS,EAAE,SAAS;aACvB;YACD,iBAAiB,EAAE,EAAE;YACrB,mBAAmB,EAAE,EAAE;YACvB,KAAK,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;SACvD,CAAC,CAAC;QAGH,mBAAM,CAAC,OAAO,CAAC,IAAI,CACf,MAAM,OAAO,CAAC,EAAE,gBAAgB,EAAE,SAAS,EAAE,CAAC,EAC9C;YACI,IAAI,EAAE,eAAe;YACrB,MAAM,EACN;gBACI,IAAI,EAAE,KAAK;gBACX,OAAO,EAAE,WAAW;gBACpB,oBAAoB,E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I,CAAC,GAAG,CAAC;SACvD,CAAC,CAAC;QAGH,mBAAM,CAAC,OAAO,CAAC,IAAI,CACf,MAAM,OAAO,CAAC,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,CAAC,EACxD;YACI,IAAI,EAAE,kBAAkB;YACxB,MAAM,EACN;gBACI,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,UAAU;gBACrB,cAAc,EAAE,mBAAmB;gBACnC,MAAM,EAAE,OAAO;aAClB;YACD,cAAc,EAAE,QAAQ;SAC3B,CACJ,CAAC,CAAC;QAEH,mBAAM,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC;KAE1B;IAED,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAExB,CAAC,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/test/scheme.d.ts b/test/scheme.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/test/scheme.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/test/scheme.js b/test/scheme.js new file mode 100644 index 0000000..df0ae20 --- /dev/null +++ b/test/scheme.js @@ -0,0 +1,195 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const Scheme_1 = require("../lib/Scheme"); +const inDepth = require("evt/tools/inDepth"); +const typeSafety_1 = require("evt/tools/typeSafety"); +(async () => { + console.log("NOTE: This test require an internet connection"); + { + const expectedScheme = { + "type": "github", + "userOrOrg": "garronej", + "repositoryName": "ts-md5", + "branch": undefined + }; + for (const prefix of ["", "github:"]) { + typeSafety_1.assert(inDepth.same(Scheme_1.Scheme.parse(`${prefix}garronej/ts-md5`), expectedScheme)); + typeSafety_1.assert(inDepth.same(Scheme_1.Scheme.parse(`${prefix}garronej/ts-md5#1.2.7`), { + ...expectedScheme, + "branch": "1.2.7" + })); + } + typeSafety_1.assert(Scheme_1.Scheme.buildUrl(expectedScheme, {}) + === + "https://raw.githubusercontent.com/garronej/ts-md5/master/mod.ts"); + typeSafety_1.assert(Scheme_1.Scheme.buildUrl(expectedScheme, { + "branch": "1.2.7", + "pathToFile": "deno_dist/parallel_hasher.ts" + }) + === + "https://raw.githubusercontent.com/garronej/ts-md5/1.2.7/deno_dist/parallel_hasher.ts"); + { + const version = "1.2.7"; + typeSafety_1.assert(inDepth.same(await Scheme_1.Scheme.resolveVersion(expectedScheme, { version }), { + "couldConnect": true, + "scheme": { + ...expectedScheme, + "branch": version + }, + "notTheExactVersionWarning": undefined + })); + } + typeSafety_1.assert(inDepth.same(await Scheme_1.Scheme.resolveVersion(expectedScheme, { "version": "1.0.0" }).then(resolveVersionResult => { + typeSafety_1.assert(resolveVersionResult.couldConnect); + typeSafety_1.assert(!!resolveVersionResult.notTheExactVersionWarning); + return resolveVersionResult.scheme; + }), { ...expectedScheme, "branch": "master" })); + typeSafety_1.assert(inDepth.same(await Scheme_1.Scheme.resolveVersion(expectedScheme, { "version": "master" }), { + "couldConnect": true, + "scheme": { + ...expectedScheme, + "branch": "master" + }, + "notTheExactVersionWarning": undefined + })); + } + { + const expectedScheme = { + "type": "url", + "urlType": "deno.land", + "baseUrlWithoutBranch": "https://deno.land/x/evt", + "pathToIndex": "mod.ts", + "branch": "master" + }; + const inputUrl = "https://deno.land/x/evt/mod.ts"; + typeSafety_1.assert(inDepth.same(Scheme_1.Scheme.parse(inputUrl), expectedScheme)); + for (const branch of ["master", "1.7.0"]) { + typeSafety_1.assert(inDepth.same(Scheme_1.Scheme.parse(`https://deno.land/x/evt@${branch}/mod.ts`), { + ...expectedScheme, + branch + })); + } + typeSafety_1.assert(Scheme_1.Scheme.buildUrl(expectedScheme, {}) + === + inputUrl); + { + const branch = "1.7.0"; + const pathToFile = "tools/typeSafety/assert.ts"; + typeSafety_1.assert(Scheme_1.Scheme.buildUrl(expectedScheme, { + branch, + pathToFile + }) + === + `https://deno.land/x/evt@${branch}/${pathToFile}`); + } + { + const version = "1.6.8"; + typeSafety_1.assert(inDepth.same(await Scheme_1.Scheme.resolveVersion(expectedScheme, { version }), { + "couldConnect": true, + "scheme": { + ...expectedScheme, + "branch": `v${version}` + }, + "notTheExactVersionWarning": undefined + })); + } + typeSafety_1.assert(inDepth.same(await Scheme_1.Scheme.resolveVersion(expectedScheme, { "version": "0.0.1" }).then(resolveVersionResult => { + typeSafety_1.assert(resolveVersionResult.couldConnect); + typeSafety_1.assert(!!resolveVersionResult.notTheExactVersionWarning); + return resolveVersionResult.scheme; + }), expectedScheme)); + } + { + const expectedScheme = { + "type": "url", + "urlType": "github", + "baseUrlWithoutBranch": "https://raw.githubusercontent.com/garronej/my_dummy_npm_and_deno_module", + "branch": "0.2.0", + "pathToIndex": "mod.ts" + }; + const inputUrl = "https://raw.githubusercontent.com/garronej/my_dummy_npm_and_deno_module/0.2.0/mod.ts"; + typeSafety_1.assert(inDepth.same(Scheme_1.Scheme.parse(inputUrl), expectedScheme)); + typeSafety_1.assert(inDepth.same(Scheme_1.Scheme.parse(inputUrl.replace("githubusercontent", "github")), expectedScheme)); + typeSafety_1.assert(inDepth.same(Scheme_1.Scheme.parse(inputUrl.replace("0.2.0", "master")), { + ...expectedScheme, + "branch": "master" + })); + typeSafety_1.assert(Scheme_1.Scheme.buildUrl(expectedScheme, {}) + === + inputUrl); + { + const branch = "master"; + const pathToFile = "deno_dist/lib/Cat.ts"; + typeSafety_1.assert(Scheme_1.Scheme.buildUrl(expectedScheme, { + branch, + pathToFile + }) + === + inputUrl + .replace("0.2.0", branch) + .replace("mod.ts", pathToFile)); + } + { + const version = "0.2.0"; + typeSafety_1.assert(inDepth.same(await Scheme_1.Scheme.resolveVersion(expectedScheme, { version }), { + "couldConnect": true, + "scheme": { + ...expectedScheme, + "branch": version + }, + "notTheExactVersionWarning": undefined + })); + } + typeSafety_1.assert(inDepth.same(await Scheme_1.Scheme.resolveVersion(expectedScheme, { "version": "0.0.33" }).then(resolveVersionResult => { + typeSafety_1.assert(resolveVersionResult.couldConnect); + typeSafety_1.assert(!!resolveVersionResult.notTheExactVersionWarning); + return resolveVersionResult.scheme; + }), expectedScheme)); + } + //Legacy tests + typeSafety_1.assert(inDepth.same(Scheme_1.Scheme.parse("https://deno.land/x/js_yaml_port/js-yaml.js"), { + "type": "url", + "urlType": "deno.land", + "baseUrlWithoutBranch": "https://deno.land/x/js_yaml_port", + "branch": "master", + "pathToIndex": "js-yaml.js" + })); + typeSafety_1.assert(inDepth.same(Scheme_1.Scheme.parse("https://deno.land/std@master/node/events.ts"), { + "type": "url", + "urlType": "deno.land", + "baseUrlWithoutBranch": "https://deno.land/std", + "branch": "master", + "pathToIndex": "node/events.ts" + })); + typeSafety_1.assert(inDepth.same(Scheme_1.Scheme.parse("https://deno.land/x/foo@1.2.3/mod.js"), { + "type": "url", + "urlType": "deno.land", + "baseUrlWithoutBranch": "https://deno.land/x/foo", + "branch": "1.2.3", + "pathToIndex": "mod.js" + })); + { + const expected = { + "type": "url", + "urlType": "github", + "baseUrlWithoutBranch": "https://raw.githubusercontent.com/KSXGitHub/simple-js-yaml-port-for-deno", + "branch": "3.12.1", + "pathToIndex": "js-yaml.js" + }; + typeSafety_1.assert(inDepth.same(Scheme_1.Scheme.parse("https://raw.githubusercontent.com/KSXGitHub/simple-js-yaml-port-for-deno/3.12.1/js-yaml.js"), expected)); + typeSafety_1.assert(inDepth.same(Scheme_1.Scheme.parse("https://raw.githubusercontent.com/KSXGitHub/simple-js-yaml-port-for-deno/3.12.1/js-yaml.js"), expected)); + } + { + const expected = { + "type": "url", + "urlType": "github", + "baseUrlWithoutBranch": "https://raw.githubusercontent.com/garronej/deno", + "branch": "master", + "pathToIndex": "std/node/util.ts" + }; + typeSafety_1.assert(inDepth.same(Scheme_1.Scheme.parse("https://raw.githubusercontent.com/garronej/deno/master/std/node/util.ts"), expected)); + typeSafety_1.assert(inDepth.same(Scheme_1.Scheme.parse("https://raw.githubusercontent.com/garronej/deno/master/std/node/util.ts"), expected)); + } + console.log("PASS"); +})(); +//# sourceMappingURL=scheme.js.map \ No newline at end of file diff --git a/test/scheme.js.map b/test/scheme.js.map new file mode 100644 index 0000000..55dda31 --- /dev/null +++ b/test/scheme.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scheme.js","sourceRoot":"","sources":["../src/test/scheme.ts"],"names":[],"mappings":";;AACA,0CAAuC;AAEvC,6CAA6C;AAC7C,qDAA8C;AAE9C,CAAC,KAAK,IAAI,EAAE;IAER,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;IAE9D;QAEI,MAAM,cAAc,GAAkB;YAClC,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE,UAAU;YACvB,gBAAgB,EAAE,QAAQ;YAC1B,QAAQ,EAAE,SAAS;SACb,CAAC;QAEX,KAAK,MAAM,MAAM,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,EAAE;YAElC,mBAAM,CACF,OAAO,CAAC,IAAI,CACR,eAAM,CAAC,KAAK,CAAC,GAAG,MAAM,iBAAiB,CAAC,EACxC,cAAc,CACjB,CACJ,CAAC;YAEF,mBAAM,CACF,OAAO,CAAC,IAAI,CACR,eAAM,CAAC,KAAK,CAAC,GAAG,MAAM,uBAAuB,CAAC,EAC9C;gBACI,GAAG,cAAc;gBACjB,QAAQ,EAAE,OAAO;aACpB,CACJ,CACJ,CAAC;SAEL;QAGD,mBAAM,CACF,eAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,EAAE,CAAC;;gBAEnC,iEAAiE,CACpE,CAAC;QAEF,mBAAM,CACF,eAAM,CAAC,QAAQ,CAAC,cAAc,EAC1B;YACI,QAAQ,EAAE,OAAO;YACjB,YAAY,EAAE,8BAA8B;SAC/C,CACJ;;gBAED,sFAAsF,CACzF,CAAC;QAGF;YAEI,MAAM,OAAO,GAAG,OAAO,CAAC;YAExB,mBAAM,CACF,OAAO,CAAC,IAAI,CACR,MAAM,eAAM,CAAC,cAAc,CACvB,cAAc,EACd,EAAE,OAAO,EAAE,CACd,EACD;gBACI,cAAc,EAAE,IAAI;gBACpB,QAAQ,EAAE;oBACN,GAAG,cAAc;oBACjB,QAAQ,EAAE,O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AAM,CACF,OAAO,CAAC,IAAI,CACR,eAAM,CAAC,KAAK,CAAC,4FAA4F,CAAC,EAC1G,QAAQ,CACX,CACJ,CAAC;QAEF,mBAAM,CACF,OAAO,CAAC,IAAI,CACR,eAAM,CAAC,KAAK,CAAC,4FAA4F,CAAC,EAC1G,QAAQ,CACX,CACJ,CAAC;KAEL;IAED;QAEI,MAAM,QAAQ,GAAG;YACb,MAAM,EAAE,KAAK;YACb,SAAS,EAAE,QAAQ;YACnB,sBAAsB,EAAE,iDAAiD;YACzE,QAAQ,EAAE,QAAQ;YAClB,aAAa,EAAE,kBAAkB;SAC3B,CAAC;QAEX,mBAAM,CACF,OAAO,CAAC,IAAI,CACR,eAAM,CAAC,KAAK,CAAC,yEAAyE,CAAC,EACvF,QAAQ,CACX,CACJ,CAAC;QAEF,mBAAM,CACF,OAAO,CAAC,IAAI,CACR,eAAM,CAAC,KAAK,CAAC,yEAAyE,CAAC,EACvF,QAAQ,CACX,CACJ,CAAC;KAEL;IAED,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAGxB,CAAC,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/addCache.d.ts b/tools/addCache.d.ts new file mode 100644 index 0000000..f103c95 --- /dev/null +++ b/tools/addCache.d.ts @@ -0,0 +1,2 @@ +/** Save results of anterior calls */ +export declare function addCache Promise>(f: T): T; diff --git a/tools/addCache.js b/tools/addCache.js new file mode 100644 index 0000000..3df488b --- /dev/null +++ b/tools/addCache.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.addCache = void 0; +/** Save results of anterior calls */ +function addCache(f) { + const previousResults = new Map(); + return (async function callee(...args) { + const key = JSON.stringify(args); + if (previousResults.has(key)) { + return previousResults.get(key); + } + previousResults.set(key, await f(...args)); + return callee(...args); + }); +} +exports.addCache = addCache; +//# sourceMappingURL=addCache.js.map \ No newline at end of file diff --git a/tools/addCache.js.map b/tools/addCache.js.map new file mode 100644 index 0000000..124987c --- /dev/null +++ b/tools/addCache.js.map @@ -0,0 +1 @@ +{"version":3,"file":"addCache.js","sourceRoot":"","sources":["../src/tools/addCache.ts"],"names":[],"mappings":";;;AACA,qCAAqC;AACrC,SAAgB,QAAQ,CAA6C,CAAI;IAErE,MAAM,eAAe,GAAG,IAAI,GAAG,EAAyB,CAAC;IAEzD,OAAO,CAAC,KAAK,UAAU,MAAM,CAAC,GAAG,IAAmB;QAEhD,MAAM,GAAG,GAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAEhC,IAAI,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAC1B,OAAO,eAAe,CAAC,GAAG,CAAC,GAAG,CAAQ,CAAC;SAC1C;QAED,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QAE3C,OAAO,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IAE3B,CAAC,CAAiB,CAAC;AAEvB,CAAC;AAlBD,4BAkBC"} \ No newline at end of file diff --git a/tools/crawl.d.ts b/tools/crawl.d.ts new file mode 100644 index 0000000..a17223a --- /dev/null +++ b/tools/crawl.d.ts @@ -0,0 +1,2 @@ +/** List all files in a given directory return paths relative to the dir_path */ +export declare const crawl: (dir_path: string) => string[]; diff --git a/tools/crawl.js b/tools/crawl.js new file mode 100644 index 0000000..e12d5e6 --- /dev/null +++ b/tools/crawl.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.crawl = void 0; +const fs = require("fs"); +const path = require("path"); +/** List all files in a given directory return paths relative to the dir_path */ +exports.crawl = (() => { + const crawlRec = (dir_path, paths) => { + for (const file_name of fs.readdirSync(dir_path)) { + const file_path = path.join(dir_path, file_name); + if (fs.lstatSync(file_path).isDirectory()) { + crawlRec(file_path, paths); + continue; + } + paths.push(file_path); + } + }; + return function crawl(dir_path) { + const paths = []; + crawlRec(dir_path, paths); + return paths.map(file_path => path.relative(dir_path, file_path)); + }; +})(); +//# sourceMappingURL=crawl.js.map \ No newline at end of file diff --git a/tools/crawl.js.map b/tools/crawl.js.map new file mode 100644 index 0000000..0e5581d --- /dev/null +++ b/tools/crawl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"crawl.js","sourceRoot":"","sources":["../src/tools/crawl.ts"],"names":[],"mappings":";;;AACA,yBAAyB;AACzB,6BAA6B;AAE7B,gFAAgF;AACnE,QAAA,KAAK,GAAG,CAAC,GAAG,EAAE;IAEvB,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAAE,KAAe,EAAE,EAAE;QAEnD,KAAK,MAAM,SAAS,IAAI,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE;YAE9C,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;YAEjD,IAAI,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,EAAE;gBAEvC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;gBAE3B,SAAS;aAEZ;YAED,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAEzB;IAEL,CAAC,CAAC;IAEF,OAAO,SAAS,KAAK,CAAC,QAAgB;QAElC,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAE1B,OAAO,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;IAEtE,CAAC,CAAA;AAEL,CAAC,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tools/exec.d.ts b/tools/exec.d.ts new file mode 100644 index 0000000..41467d2 --- /dev/null +++ b/tools/exec.d.ts @@ -0,0 +1,5 @@ +export declare function execFactory(params: { + isDryRun: boolean; +}): { + exec: (cmd: string) => Promise; +}; diff --git a/tools/exec.js b/tools/exec.js new file mode 100644 index 0000000..c8af5f8 --- /dev/null +++ b/tools/exec.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.execFactory = void 0; +const st = require("scripting-tools"); +function execFactory(params) { + const { isDryRun } = params; + const exec = !isDryRun ? + (async (cmd) => { + console.log(`$ ${cmd}`); + await st.exec(cmd); + }) + : + (cmd => { + console.log(`(dry)$ ${cmd}`); + return Promise.resolve(); + }); + return { exec }; +} +exports.execFactory = execFactory; +//# sourceMappingURL=exec.js.map \ No newline at end of file diff --git a/tools/exec.js.map b/tools/exec.js.map new file mode 100644 index 0000000..57ae0f8 --- /dev/null +++ b/tools/exec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"exec.js","sourceRoot":"","sources":["../src/tools/exec.ts"],"names":[],"mappings":";;;AACA,sCAAsC;AAEtC,SAAgB,WAAW,CACvB,MAEC;IAGD,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAE5B,MAAM,IAAI,GACN,CAAC,QAAQ,CAAC,CAAC;QACP,CAAC,KAAK,EAAC,GAAG,EAAC,EAAE;YACT,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;YACxB,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC,CAAC;QACF,CAAC;YACD,CAAC,GAAG,CAAC,EAAE;gBACH,OAAO,CAAC,GAAG,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC;gBAC7B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;YAC7B,CAAC,CAAC,CACL;IAEL,OAAO,EAAE,IAAI,EAAE,CAAC;AAGpB,CAAC;AAxBD,kCAwBC"} \ No newline at end of file diff --git a/tools/getProjectRoot.d.ts b/tools/getProjectRoot.d.ts new file mode 100644 index 0000000..7927ee7 --- /dev/null +++ b/tools/getProjectRoot.d.ts @@ -0,0 +1 @@ +export declare function getProjectRoot(): string; diff --git a/tools/getProjectRoot.js b/tools/getProjectRoot.js new file mode 100644 index 0000000..abc01af --- /dev/null +++ b/tools/getProjectRoot.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getProjectRoot = void 0; +const fs = require("fs"); +const path = require("path"); +function getProjectRootRec(dirPath) { + if (fs.existsSync(path.join(dirPath, "package.json"))) { + return dirPath; + } + return getProjectRootRec(path.join(dirPath, "..")); +} +let result = undefined; +function getProjectRoot() { + if (result !== undefined) { + return result; + } + return result = getProjectRootRec(__dirname); +} +exports.getProjectRoot = getProjectRoot; +//# sourceMappingURL=getProjectRoot.js.map \ No newline at end of file diff --git a/tools/getProjectRoot.js.map b/tools/getProjectRoot.js.map new file mode 100644 index 0000000..9552a45 --- /dev/null +++ b/tools/getProjectRoot.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getProjectRoot.js","sourceRoot":"","sources":["../src/tools/getProjectRoot.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,6BAA6B;AAE7B,SAAS,iBAAiB,CAAC,OAAe;IACtC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,EAAE;QACnD,OAAO,OAAO,CAAC;KAClB;IACD,OAAO,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;AACtD,CAAC;AAED,IAAI,MAAM,GAAuB,SAAS,CAAC;AAE3C,SAAgB,cAAc;IAE1B,IAAI,MAAM,KAAK,SAAS,EAAE;QACtB,OAAO,MAAM,CAAC;KACjB;IAED,OAAO,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;AAEjD,CAAC;AARD,wCAQC"} \ No newline at end of file diff --git a/tools/globProxy.d.ts b/tools/globProxy.d.ts new file mode 100644 index 0000000..b97921b --- /dev/null +++ b/tools/globProxy.d.ts @@ -0,0 +1,7 @@ +export declare function globProxyFactory(params: { + cwdAndRood: string; +}): { + globProxy: (params: { + pathWithWildcard: string; + }) => Promise; +}; diff --git a/tools/globProxy.js b/tools/globProxy.js new file mode 100644 index 0000000..0af6551 --- /dev/null +++ b/tools/globProxy.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.globProxyFactory = void 0; +const glob = require("glob"); +function globProxyFactory(params) { + const { cwdAndRood } = params; + function globProxy(params) { + const { pathWithWildcard } = params; + return new Promise((resolve, reject) => glob(pathWithWildcard, { + "cwd": cwdAndRood, + "root": cwdAndRood, + "dot": true + }, (er, files) => { + if (!!er) { + reject(er); + return; + } + resolve(files); + })); + } + return { globProxy }; +} +exports.globProxyFactory = globProxyFactory; +//# sourceMappingURL=globProxy.js.map \ No newline at end of file diff --git a/tools/globProxy.js.map b/tools/globProxy.js.map new file mode 100644 index 0000000..f53696d --- /dev/null +++ b/tools/globProxy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"globProxy.js","sourceRoot":"","sources":["../src/tools/globProxy.ts"],"names":[],"mappings":";;;AACA,6BAA6B;AAE7B,SAAgB,gBAAgB,CAC5B,MAEC;IAGD,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IAE9B,SAAS,SAAS,CACd,MAEC;QAED,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,OAAO,CACd,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAChB,IAAI,CACA,gBAAgB,EAChB;YACI,KAAK,EAAE,UAAU;YACjB,MAAM,EAAE,UAAU;YAClB,KAAK,EAAE,IAAI;SACd,EACD,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;YACV,IAAI,CAAC,CAAC,EAAE,EAAE;gBACN,MAAM,CAAC,EAAE,CAAC,CAAC;gBACX,OAAO;aACV;YACD,OAAO,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC,CACJ,CACR,CAAC;IAEN,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,CAAC;AAEzB,CAAC;AArCD,4CAqCC"} \ No newline at end of file diff --git a/tools/is404.d.ts b/tools/is404.d.ts new file mode 100644 index 0000000..26eff57 --- /dev/null +++ b/tools/is404.d.ts @@ -0,0 +1 @@ +export declare function is404(url: string): Promise; diff --git a/tools/is404.js b/tools/is404.js new file mode 100644 index 0000000..1605d1a --- /dev/null +++ b/tools/is404.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.is404 = void 0; +const node_fetch_1 = require("node-fetch"); +function is404(url) { + return node_fetch_1.default(url).then(({ status }) => status === 404); +} +exports.is404 = is404; +//# sourceMappingURL=is404.js.map \ No newline at end of file diff --git a/tools/is404.js.map b/tools/is404.js.map new file mode 100644 index 0000000..31ce9ca --- /dev/null +++ b/tools/is404.js.map @@ -0,0 +1 @@ +{"version":3,"file":"is404.js","sourceRoot":"","sources":["../src/tools/is404.ts"],"names":[],"mappings":";;;AACA,2CAA+B;AAE/B,SAAgB,KAAK,CAAC,GAAW;IAC7B,OAAO,oBAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC;AAC3D,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tools/isInsideOrIsDir.d.ts b/tools/isInsideOrIsDir.d.ts new file mode 100644 index 0000000..ba7cfdd --- /dev/null +++ b/tools/isInsideOrIsDir.d.ts @@ -0,0 +1,4 @@ +export declare function isInsideOrIsDir(params: { + dirPath: string; + fileOrDirPath: string; +}): boolean; diff --git a/tools/isInsideOrIsDir.js b/tools/isInsideOrIsDir.js new file mode 100644 index 0000000..deb7a7f --- /dev/null +++ b/tools/isInsideOrIsDir.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isInsideOrIsDir = void 0; +const path = require("path"); +function isInsideOrIsDir(params) { + const { dirPath, fileOrDirPath } = params; + const relative = path.relative(dirPath, fileOrDirPath); + if (relative === "") { + return true; + } + return !relative.startsWith(".."); +} +exports.isInsideOrIsDir = isInsideOrIsDir; +//# sourceMappingURL=isInsideOrIsDir.js.map \ No newline at end of file diff --git a/tools/isInsideOrIsDir.js.map b/tools/isInsideOrIsDir.js.map new file mode 100644 index 0000000..822552b --- /dev/null +++ b/tools/isInsideOrIsDir.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isInsideOrIsDir.js","sourceRoot":"","sources":["../src/tools/isInsideOrIsDir.ts"],"names":[],"mappings":";;;AACA,6BAA6B;AAE7B,SAAgB,eAAe,CAC3B,MAGC;IAGD,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;IAE1C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAEvD,IAAI,QAAQ,KAAK,EAAE,EAAE;QACjB,OAAO,IAAI,CAAC;KACf;IAED,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAEtC,CAAC;AAjBD,0CAiBC"} \ No newline at end of file diff --git a/tools/moveContentUpOneLevel.d.ts b/tools/moveContentUpOneLevel.d.ts new file mode 100644 index 0000000..bbdef08 --- /dev/null +++ b/tools/moveContentUpOneLevel.d.ts @@ -0,0 +1,9 @@ +export declare function moveContentUpOneLevelFactory(params: { + isDryRun: boolean; +}): { + moveContentUpOneLevel: (params: { + dirPath: string; + }) => Promise<{ + beforeMovedFilePaths: string[]; + }>; +}; diff --git a/tools/moveContentUpOneLevel.js b/tools/moveContentUpOneLevel.js new file mode 100644 index 0000000..73afe64 --- /dev/null +++ b/tools/moveContentUpOneLevel.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.moveContentUpOneLevelFactory = void 0; +const path = require("path"); +const exec_1 = require("./exec"); +const st = require("scripting-tools"); +const crawl_1 = require("./crawl"); +function moveContentUpOneLevelFactory(params) { + const { isDryRun } = params; + const { exec } = exec_1.execFactory({ isDryRun }); + async function moveContentUpOneLevel(params) { + const dirPath = params.dirPath.replace(/\/$/, ""); + const upDirPath = path.join(dirPath, ".."); + const beforeMovedFilePaths = crawl_1.crawl(dirPath); + for (const beforeMovedFilePath of beforeMovedFilePaths) { + console.log([ + `${isDryRun ? "(dry) " : ""}Moving`, + path.join(dirPath, beforeMovedFilePath), + `to ${path.join(upDirPath, beforeMovedFilePath)}` + ].join(" ")); + walk: { + if (isDryRun) { + break walk; + } + st.fs_move("MOVE", dirPath, upDirPath, beforeMovedFilePath); + } + } + await exec(`rm -r ${dirPath}`); + return { beforeMovedFilePaths }; + } + return { moveContentUpOneLevel }; +} +exports.moveContentUpOneLevelFactory = moveContentUpOneLevelFactory; +//# sourceMappingURL=moveContentUpOneLevel.js.map \ No newline at end of file diff --git a/tools/moveContentUpOneLevel.js.map b/tools/moveContentUpOneLevel.js.map new file mode 100644 index 0000000..5fe3ab1 --- /dev/null +++ b/tools/moveContentUpOneLevel.js.map @@ -0,0 +1 @@ +{"version":3,"file":"moveContentUpOneLevel.js","sourceRoot":"","sources":["../src/tools/moveContentUpOneLevel.ts"],"names":[],"mappings":";;;AACA,6BAA6B;AAC7B,iCAAqC;AACrC,sCAAsC;AACtC,mCAAgC;AAEhC,SAAgB,4BAA4B,CACxC,MAEC;IAGD,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAE5B,MAAM,EAAE,IAAI,EAAE,GAAG,kBAAW,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IAE3C,KAAK,UAAU,qBAAqB,CAAC,MAEpC;QAIG,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAElD,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAE3C,MAAM,oBAAoB,GAAG,aAAK,CAAC,OAAO,CAAC,CAAC;QAE5C,KAAK,MAAM,mBAAmB,IAAI,oBAAoB,EAAE;YAEpD,OAAO,CAAC,GAAG,CAAC;gBACR,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ;gBACnC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,mBAAmB,CAAC;gBACvC,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAAC,EAAE;aACpD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAEb,IAAI,EAAE;gBAEF,IAAI,QAAQ,EAAE;oBACV,MAAM,IAAI,CAAC;iBACd;gBAED,EAAE,CAAC,OAAO,CACN,MAAM,EACN,OAAO,EACP,SAAS,EACT,mBAAmB,CACtB,CAAC;aAEL;SAEJ;QAED,MAAM,IAAI,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;QAE/B,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAEpC,CAAC;IAED,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAErC,CAAC;AAvDD,oEAuDC"} \ No newline at end of file diff --git a/tools/pathDepth.d.ts b/tools/pathDepth.d.ts new file mode 100644 index 0000000..0eb7511 --- /dev/null +++ b/tools/pathDepth.d.ts @@ -0,0 +1 @@ +export declare const pathDepth: (targetPath: string) => number; diff --git a/tools/pathDepth.js b/tools/pathDepth.js new file mode 100644 index 0000000..bd8d2b6 --- /dev/null +++ b/tools/pathDepth.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.pathDepth = void 0; +exports.pathDepth = require("path-depth"); +//# sourceMappingURL=pathDepth.js.map \ No newline at end of file diff --git a/tools/pathDepth.js.map b/tools/pathDepth.js.map new file mode 100644 index 0000000..5ec3677 --- /dev/null +++ b/tools/pathDepth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pathDepth.js","sourceRoot":"","sources":["../src/tools/pathDepth.ts"],"names":[],"mappings":";;;AACa,QAAA,SAAS,GAAmC,OAAO,CAAC,YAAY,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/removeFromGitignore.d.ts b/tools/removeFromGitignore.d.ts new file mode 100644 index 0000000..e45b916 --- /dev/null +++ b/tools/removeFromGitignore.d.ts @@ -0,0 +1,6 @@ +export declare function removeFromGitignore(params: { + pathToTargetModule: string; + fileOrDirPathsToAccept: string[]; +}): { + fixedGitignoreRaw: string | undefined; +}; diff --git a/tools/removeFromGitignore.js b/tools/removeFromGitignore.js new file mode 100644 index 0000000..d85b285 --- /dev/null +++ b/tools/removeFromGitignore.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.removeFromGitignore = void 0; +const isInsideOrIsDir_1 = require("./isInsideOrIsDir"); +const fs = require("fs"); +const crawl_1 = require("./crawl"); +const path = require("path"); +const gitignoreParser = require("gitignore-parser"); +function removeFromGitignore(params) { + const { fileOrDirPathsToAccept, pathToTargetModule } = params; + if (!fs.existsSync(path.join(pathToTargetModule, ".gitignore"))) { + console.log("No .gitignore file"); + return { "fixedGitignoreRaw": undefined }; + } + const gitignore = gitignoreParser.compile(fs.readFileSync(path.join(pathToTargetModule, ".gitignore")) + .toString("utf8")); + let fixedGitignoreRaw = crawl_1.crawl(pathToTargetModule) + .filter(filePath => { + for (const fileOrDirPathToAccept of fileOrDirPathsToAccept) { + if (fs.existsSync(fileOrDirPathToAccept) ? + fs.lstatSync(fileOrDirPathToAccept).isDirectory() + : + (fileOrDirPathToAccept.endsWith("/") || + !fileOrDirPathToAccept.match(/\.[^\.]{1,6}$/))) { + if (isInsideOrIsDir_1.isInsideOrIsDir({ + "dirPath": fileOrDirPathToAccept, + "fileOrDirPath": filePath + })) { + return false; + } + } + if (path.relative(fileOrDirPathToAccept, filePath) === "") { + return false; + } + } + return gitignore.denies(filePath); + }) + .map(filePath => "/" + filePath.replace(/^\.\//, "")) + .join("\n"); + //NOTE: Optimization: if node_modules is excluded do not list every files, just exclude /node_modules + if (gitignore.denies("node_modules") && + !fileOrDirPathsToAccept + .map(fileOrDirPath => isInsideOrIsDir_1.isInsideOrIsDir({ "dirPath": "node_modules", fileOrDirPath })).includes(true)) { + fixedGitignoreRaw = fixedGitignoreRaw + .split("\n") + .filter(line => !line.startsWith("/node_modules")) + .join("\n") + + "\n/node_modules\n"; + } + return { fixedGitignoreRaw }; +} +exports.removeFromGitignore = removeFromGitignore; +//# sourceMappingURL=removeFromGitignore.js.map \ No newline at end of file diff --git a/tools/removeFromGitignore.js.map b/tools/removeFromGitignore.js.map new file mode 100644 index 0000000..92fb6cf --- /dev/null +++ b/tools/removeFromGitignore.js.map @@ -0,0 +1 @@ +{"version":3,"file":"removeFromGitignore.js","sourceRoot":"","sources":["../src/tools/removeFromGitignore.ts"],"names":[],"mappings":";;;AACA,uDAAoD;AACpD,yBAAyB;AACzB,mCAAgC;AAChC,6BAA6B;AAC7B,MAAM,eAAe,GAKjB,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEhC,SAAgB,mBAAmB,CAC/B,MAGC;IAGD,MAAM,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,GAAG,MAAM,CAAC;IAE9D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC,EAAE;QAC7D,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAClC,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,CAAC;KAC7C;IAED,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CACrC,EAAE,CAAC,YAAY,CACX,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAC9C;SACI,QAAQ,CAAC,MAAM,CAAC,CACxB,CAAC;IAEF,IAAI,iBAAiB,GACjB,aAAK,CAAC,kBAAkB,CAAC;SACpB,MAAM,CAAC,QAAQ,CAAC,EAAE;QAEf,KAAK,MAAM,qBAAqB,I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A9ED,kDA8EC"} \ No newline at end of file diff --git a/tools/replaceAsync.d.ts b/tools/replaceAsync.d.ts new file mode 100644 index 0000000..2b5ab8f --- /dev/null +++ b/tools/replaceAsync.d.ts @@ -0,0 +1,2 @@ +/** Equivalent of String.prototype.replace but with async replacer is async */ +export declare function replaceAsync(str: string, regex: RegExp, replacerAsync: (str: string, ...args: any[]) => Promise): Promise; diff --git a/tools/replaceAsync.js b/tools/replaceAsync.js new file mode 100644 index 0000000..9842cf7 --- /dev/null +++ b/tools/replaceAsync.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.replaceAsync = void 0; +/** Equivalent of String.prototype.replace but with async replacer is async */ +async function replaceAsync(str, regex, replacerAsync) { + const promises = []; + str.replace(regex, (match, ...args) => { + const promise = replacerAsync(match, ...args); + promises.push(promise); + return ""; + }); + const data = await Promise.all(promises); + return str.replace(regex, () => data.shift()); +} +exports.replaceAsync = replaceAsync; +//# sourceMappingURL=replaceAsync.js.map \ No newline at end of file diff --git a/tools/replaceAsync.js.map b/tools/replaceAsync.js.map new file mode 100644 index 0000000..e395699 --- /dev/null +++ b/tools/replaceAsync.js.map @@ -0,0 +1 @@ +{"version":3,"file":"replaceAsync.js","sourceRoot":"","sources":["../src/tools/replaceAsync.ts"],"names":[],"mappings":";;;AACA,8EAA8E;AACvE,KAAK,UAAU,YAAY,CAC9B,GAAW,EACX,KAAa,EACb,aAA+D;IAG/D,MAAM,QAAQ,GAAsB,EAAE,CAAC;IAEvC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE;QAClC,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;QAC9C,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,OAAO,EAAE,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAEzC,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAG,CAAC,CAAC;AAEnD,CAAC;AAlBD,oCAkBC"} \ No newline at end of file diff --git a/tools/urlJoin.d.ts b/tools/urlJoin.d.ts new file mode 100644 index 0000000..25b997a --- /dev/null +++ b/tools/urlJoin.d.ts @@ -0,0 +1 @@ +export declare const urlJoin: typeof import("path").join; diff --git a/tools/urlJoin.js b/tools/urlJoin.js new file mode 100644 index 0000000..34c1b45 --- /dev/null +++ b/tools/urlJoin.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.urlJoin = void 0; +exports.urlJoin = require("url-join"); +//# sourceMappingURL=urlJoin.js.map \ No newline at end of file diff --git a/tools/urlJoin.js.map b/tools/urlJoin.js.map new file mode 100644 index 0000000..0314404 --- /dev/null +++ b/tools/urlJoin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"urlJoin.js","sourceRoot":"","sources":["../src/tools/urlJoin.ts"],"names":[],"mappings":";;;AACa,QAAA,OAAO,GAA+B,OAAO,CAAC,UAAU,CAAC,CAAC"} \ No newline at end of file diff --git a/tsconfig.tsbuildinfo b/tsconfig.tsbuildinfo new file mode 100644 index 0000000..2aa5fd1 --- /dev/null +++ b/tsconfig.tsbuildinfo @@ -0,0 +1,2061 @@ +{ + "program": { + "fileInfos": { + "../node_modules/typescript/lib/lib.es5.d.ts": { + "version": "70ae6416528e68c2ee7b62892200d2ca631759943d4429f8b779b947ff1e124d", + "signature": "70ae6416528e68c2ee7b62892200d2ca631759943d4429f8b779b947ff1e124d", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2015.d.ts": { + "version": "dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6", + "signature": "dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6", + "affectsGlobalScope": false + }, + "../node_modules/typescript/lib/lib.es2016.d.ts": { + "version": "7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467", + "signature": "7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467", + "affectsGlobalScope": false + }, + "../node_modules/typescript/lib/lib.es2017.d.ts": { + "version": "8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9", + "signature": "8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9", + "affectsGlobalScope": false + }, + "../node_modules/typescript/lib/lib.es2018.d.ts": { + "version": "5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06", + "signature": "5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06", + "affectsGlobalScope": false + }, + "../node_modules/typescript/lib/lib.es2015.core.d.ts": { + "version": "63e0cc12d0f77394094bd19e84464f9840af0071e5b9358ced30511efef1d8d2", + "signature": "63e0cc12d0f77394094bd19e84464f9840af0071e5b9358ced30511efef1d8d2", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2015.collection.d.ts": { + "version": "43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c", + "signature": "43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2015.generator.d.ts": { + "version": "cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a", + "signature": "cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2015.iterable.d.ts": { + "version": "42f5e41e5893da663dbf0394268f54f1da4b43dc0ddd2ea4bf471fe5361d6faf", + "signature": "42f5e41e5893da663dbf0394268f54f1da4b43dc0ddd2ea4bf471fe5361d6faf", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2015.promise.d.ts": { + "version": "0b7a905675e6cb4211c128f0a3aa47d414b275180a299a9aad5d3ec298abbfc4", + "signature": "0b7a905675e6cb4211c128f0a3aa47d414b275180a299a9aad5d3ec298abbfc4", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2015.proxy.d.ts": { + "version": "dfff68b3c34338f6b307a25d4566de15eed7973b0dc5d69f9fde2bcac1c25315", + "signature": "dfff68b3c34338f6b307a25d4566de15eed7973b0dc5d69f9fde2bcac1c25315", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2015.reflect.d.ts": { + "version": "cb609802a8698aa28b9c56331d4b53f590ca3c1c3a255350304ae3d06017779d", + "signature": "cb609802a8698aa28b9c56331d4b53f590ca3c1c3a255350304ae3d06017779d", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2015.symbol.d.ts": { + "version": "3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93", + "signature": "3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts": { + "version": "4670208dd7da9d6c774ab1b75c1527a810388c7989c4905de6aaea8561cb9dce", + "signature": "4670208dd7da9d6c774ab1b75c1527a810388c7989c4905de6aaea8561cb9dce", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2016.array.include.d.ts": { + "version": "3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006", + "signature": "3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2017.object.d.ts": { + "version": "17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a", + "signature": "17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts": { + "version": "d0db416bccdb33975548baf09a42ee8c47eace1aac7907351a000f1e568e7232", + "signature": "d0db416bccdb33975548baf09a42ee8c47eace1aac7907351a000f1e568e7232", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2017.string.d.ts": { + "version": "6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577", + "signature": "6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2017.intl.d.ts": { + "version": "12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d", + "signature": "12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts": { + "version": "b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e", + "signature": "b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts": { + "version": "0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a", + "signature": "0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts": { + "version": "a40c4d82bf13fcded295ac29f354eb7d40249613c15e07b53f2fc75e45e16359", + "signature": "a40c4d82bf13fcded295ac29f354eb7d40249613c15e07b53f2fc75e45e16359", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2018.intl.d.ts": { + "version": "df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e", + "signature": "df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2018.promise.d.ts": { + "version": "bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c", + "signature": "bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2018.regexp.d.ts": { + "version": "c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8", + "signature": "c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.es2020.bigint.d.ts": { + "version": "4f435f794b7853c55e2ae7cff6206025802aa79232d2867544178f2ca8ff5eaa", + "signature": "4f435f794b7853c55e2ae7cff6206025802aa79232d2867544178f2ca8ff5eaa", + "affectsGlobalScope": true + }, + "../node_modules/typescript/lib/lib.esnext.intl.d.ts": { + "version": "89bf2b7a601b73ea4311eda9c41f86a58994fec1bee3b87c4a14d68d9adcdcbd", + "signature": "89bf2b7a601b73ea4311eda9c41f86a58994fec1bee3b87c4a14d68d9adcdcbd", + "affectsGlobalScope": true + }, + "../node_modules/@types/node/globals.d.ts": { + "version": "da55f3fbb4189aec7caf4da308901f7b9d1e916337d9dfbdbcd162a46a835bdd", + "signature": "da55f3fbb4189aec7caf4da308901f7b9d1e916337d9dfbdbcd162a46a835bdd", + "affectsGlobalScope": true + }, + "../node_modules/@types/node/async_hooks.d.ts": { + "version": "138476cfdccbb9e2c7e06602bc216af843a56c4f3469a79106bc660ba94bd66a", + "signature": "138476cfdccbb9e2c7e06602bc216af843a56c4f3469a79106bc660ba94bd66a", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/buffer.d.ts": { + "version": "fe892fea1e75a442fffb4a604d7eeb451e858787a9f2f01c4e83bf12a3b5048d", + "signature": "fe892fea1e75a442fffb4a604d7eeb451e858787a9f2f01c4e83bf12a3b5048d", + "affectsGlobalScope": false + }, + "../node_modules/@types/events/index.d.ts": { + "version": "400db42c3a46984118bff14260d60cec580057dc1ab4c2d7310beb643e4f5935", + "signature": "400db42c3a46984118bff14260d60cec580057dc1ab4c2d7310beb643e4f5935", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/child_process.d.ts": { + "version": "3814f4b4c648f278aefda68889f8912ef9928ba6fc12bf6dd85a6a680b660e00", + "signature": "3814f4b4c648f278aefda68889f8912ef9928ba6fc12bf6dd85a6a680b660e00", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/cluster.d.ts": { + "version": "fcd718b2feb2820a9844536a1a2fbc77a3da90820e02894d40f879a789f46560", + "signature": "fcd718b2feb2820a9844536a1a2fbc77a3da90820e02894d40f879a789f46560", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/console.d.ts": { + "version": "525c8fc510d9632d2a0a9de2d41c3ac1cdd79ff44d3b45c6d81cacabb683528d", + "signature": "525c8fc510d9632d2a0a9de2d41c3ac1cdd79ff44d3b45c6d81cacabb683528d", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/constants.d.ts": { + "version": "ece75b9bfc916f9ccc4e8a9ddee1dda5c987804fbe3b60a01fc120fae731c2ce", + "signature": "ece75b9bfc916f9ccc4e8a9ddee1dda5c987804fbe3b60a01fc120fae731c2ce", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/crypto.d.ts": { + "version": "d70cf14b7dd281408be0a7a239ae92b5e26178ac269da5ed39daf86564d5af4b", + "signature": "d70cf14b7dd281408be0a7a239ae92b5e26178ac269da5ed39daf86564d5af4b", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/dgram.d.ts": { + "version": "3d1cb0eaae19fa89fe381bba6d5a149d1bf34efc0134220879f57e2061732a6d", + "signature": "3d1cb0eaae19fa89fe381bba6d5a149d1bf34efc0134220879f57e2061732a6d", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/dns.d.ts": { + "version": "05e732266b5a36789fd9eb846b1f45fec1b6e318b740e3f20fc22fd95f9ebf31", + "signature": "05e732266b5a36789fd9eb846b1f45fec1b6e318b740e3f20fc22fd95f9ebf31", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/domain.d.ts": { + "version": "ae3487bdb9b50c1d8bbeb6b55c8b2b9aa79bbc46d7afbc3483169ad8750c4304", + "signature": "ae3487bdb9b50c1d8bbeb6b55c8b2b9aa79bbc46d7afbc3483169ad8750c4304", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/events.d.ts": { + "version": "c53b63229a0b7e9d64347c4fc975dd52a9e9a81f9be099f5a21220e2a1276d28", + "signature": "c53b63229a0b7e9d64347c4fc975dd52a9e9a81f9be099f5a21220e2a1276d28", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/fs.d.ts": { + "version": "1733741cf2adc5926ac58c66004268cdc3d34b2ff6250f5114db14253ea02ce1", + "signature": "1733741cf2adc5926ac58c66004268cdc3d34b2ff6250f5114db14253ea02ce1", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/http.d.ts": { + "version": "067b49f94020b2ac9b0e83aaffab4312956c0261d6f7e38f4a7cce5399f35416", + "signature": "067b49f94020b2ac9b0e83aaffab4312956c0261d6f7e38f4a7cce5399f35416", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/http2.d.ts": { + "version": "c9212c26733f9b1ef963a10f6b72da02b31eb1b107cfc4b26279fcdc621e9201", + "signature": "c9212c26733f9b1ef963a10f6b72da02b31eb1b107cfc4b26279fcdc621e9201", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/https.d.ts": { + "version": "152af7c23ec219f632afa2d861abc65993f56cd39a4f3a4018515dbc05950a74", + "signature": "152af7c23ec219f632afa2d861abc65993f56cd39a4f3a4018515dbc05950a74", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/inspector.d.ts": { + "version": "3a0bdc4c5b6f84a1abb5356d7a7fa1f96ac6c5b5646eec3ef2b33c1ed095e155", + "signature": "3a0bdc4c5b6f84a1abb5356d7a7fa1f96ac6c5b5646eec3ef2b33c1ed095e155", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/module.d.ts": { + "version": "03394bf8deb8781b490ae9266a843fbdf00647947d79e25fcbf1d89a9e9c8a66", + "signature": "03394bf8deb8781b490ae9266a843fbdf00647947d79e25fcbf1d89a9e9c8a66", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/net.d.ts": { + "version": "56a15cc211894d79aa44cbb46c276bfd3f10458a61bff2dec99114db8a7e71e3", + "signature": "56a15cc211894d79aa44cbb46c276bfd3f10458a61bff2dec99114db8a7e71e3", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/os.d.ts": { + "version": "1a5366b0d4d0153955fd85777c72d35979dabc0537649da6eade09007c0d080a", + "signature": "1a5366b0d4d0153955fd85777c72d35979dabc0537649da6eade09007c0d080a", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/path.d.ts": { + "version": "61c84c3b0eb6e60196d15ae5e21793a1d4241c547f0bdd0529ffae838d1a073c", + "signature": "61c84c3b0eb6e60196d15ae5e21793a1d4241c547f0bdd0529ffae838d1a073c", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/perf_hooks.d.ts": { + "version": "981192e57b0e159c977f1d8e8b8576e9d6b4e013b902e9c0d4b178cb47e2dc86", + "signature": "981192e57b0e159c977f1d8e8b8576e9d6b4e013b902e9c0d4b178cb47e2dc86", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/process.d.ts": { + "version": "3a8848a9c307429b861402cc69bc472ffe0c05b86474fc158723169161e16389", + "signature": "3a8848a9c307429b861402cc69bc472ffe0c05b86474fc158723169161e16389", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/punycode.d.ts": { + "version": "eeb0d1ad28e70773ac57ae9fe939c3bad6af2525a463c28f9ec31b5953de6735", + "signature": "eeb0d1ad28e70773ac57ae9fe939c3bad6af2525a463c28f9ec31b5953de6735", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/querystring.d.ts": { + "version": "8969e0b4d22ca77ad011c8fc4a25ec5d515bdfae4ecbd22608ed0d5c38829c1e", + "signature": "8969e0b4d22ca77ad011c8fc4a25ec5d515bdfae4ecbd22608ed0d5c38829c1e", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/readline.d.ts": { + "version": "81ef2751228318b1c7c6b35ccae2ea39ef275add30319e746bfd4658208a0519", + "signature": "81ef2751228318b1c7c6b35ccae2ea39ef275add30319e746bfd4658208a0519", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/repl.d.ts": { + "version": "d0b0b533dc34ff7ffd019665fdc2b2aeae717bc1347e17a5bdc4d6572b5c109a", + "signature": "d0b0b533dc34ff7ffd019665fdc2b2aeae717bc1347e17a5bdc4d6572b5c109a", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/stream.d.ts": { + "version": "9bfc0868808314fc72ca0d8a43842dec476f822fd52789945cf31c30a649e06d", + "signature": "9bfc0868808314fc72ca0d8a43842dec476f822fd52789945cf31c30a649e06d", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/string_decoder.d.ts": { + "version": "17e157df6125098a1a34eb4d201ee4ac03bbe97e471ab5627bb2c40fce555948", + "signature": "17e157df6125098a1a34eb4d201ee4ac03bbe97e471ab5627bb2c40fce555948", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/timers.d.ts": { + "version": "b40652bf8ce4a18133b31349086523b219724dca8df3448c1a0742528e7ad5b9", + "signature": "b40652bf8ce4a18133b31349086523b219724dca8df3448c1a0742528e7ad5b9", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/tls.d.ts": { + "version": "39dec06488aa1c05aa22bde1e2d96a3beda1ae565d7429bcc8053a26e83a6a56", + "signature": "39dec06488aa1c05aa22bde1e2d96a3beda1ae565d7429bcc8053a26e83a6a56", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/trace_events.d.ts": { + "version": "978aecd2e6bc2ac094e9a35eda98ff8586713857b3655e7c98ca5ed8f7d50662", + "signature": "978aecd2e6bc2ac094e9a35eda98ff8586713857b3655e7c98ca5ed8f7d50662", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/tty.d.ts": { + "version": "a185b8e0d7a4ae078a79339d63e98177813aac39256f69f788eaf5c360aa756f", + "signature": "a185b8e0d7a4ae078a79339d63e98177813aac39256f69f788eaf5c360aa756f", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/url.d.ts": { + "version": "fc8078ae641decbc5c0ddaa864fdb5c78194554568d334db769e80a4781a79b7", + "signature": "fc8078ae641decbc5c0ddaa864fdb5c78194554568d334db769e80a4781a79b7", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/util.d.ts": { + "version": "bfe1881838ba7c651b20165e17f942689dbe6e14b26d24268990e40aef68ce37", + "signature": "bfe1881838ba7c651b20165e17f942689dbe6e14b26d24268990e40aef68ce37", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/v8.d.ts": { + "version": "e880a08fbb0d9ee2f733f9183f4d1bdb75bc9e0e64060a8a1fc30540791fcded", + "signature": "e880a08fbb0d9ee2f733f9183f4d1bdb75bc9e0e64060a8a1fc30540791fcded", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/vm.d.ts": { + "version": "80a2bcde37ee49bbc4ddcc627710ea2f60321b24adbe949a585fc29586bcdcd3", + "signature": "80a2bcde37ee49bbc4ddcc627710ea2f60321b24adbe949a585fc29586bcdcd3", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/worker_threads.d.ts": { + "version": "e761c833140e3ab6f9deab37fe034154f3eb15547dce61395d9b0b1f130f3fa3", + "signature": "e761c833140e3ab6f9deab37fe034154f3eb15547dce61395d9b0b1f130f3fa3", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/zlib.d.ts": { + "version": "58257a0147702ab415ed18164557a0feb9c5d1351792ea293a876e6b7ed0c559", + "signature": "58257a0147702ab415ed18164557a0feb9c5d1351792ea293a876e6b7ed0c559", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/base.d.ts": { + "version": "5ff4ecfd544d596de3c8011a6d44c59443c85e1f99065095e556b15237eb39ac", + "signature": "5ff4ecfd544d596de3c8011a6d44c59443c85e1f99065095e556b15237eb39ac", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/ts3.2/util.d.ts": { + "version": "4f54f0a9dd3b644c99ec32b32f8804d5978bc854799b228ae9c467bf3c84c64c", + "signature": "4f54f0a9dd3b644c99ec32b32f8804d5978bc854799b228ae9c467bf3c84c64c", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/ts3.2/globals.d.ts": { + "version": "ce6b191c382ee19f23678b8c364484627bcf424e8f408357a2f5530fb8d52a45", + "signature": "ce6b191c382ee19f23678b8c364484627bcf424e8f408357a2f5530fb8d52a45", + "affectsGlobalScope": true + }, + "../node_modules/@types/node/ts3.2/base.d.ts": { + "version": "6f44b710b2fa277aab791d53f5b72991fbc1c93313bfc78e519764ac2a9b7f0f", + "signature": "6f44b710b2fa277aab791d53f5b72991fbc1c93313bfc78e519764ac2a9b7f0f", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/ts3.7/assert.d.ts": { + "version": "53729e4ea004f63dbe9e935dba015b6e20b3473d68757463949716bf5705bd89", + "signature": "53729e4ea004f63dbe9e935dba015b6e20b3473d68757463949716bf5705bd89", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/ts3.7/base.d.ts": { + "version": "b03474e5359472103e86fca6071bf55dc2a955119559a036bdca268c2a68c418", + "signature": "b03474e5359472103e86fca6071bf55dc2a955119559a036bdca268c2a68c418", + "affectsGlobalScope": false + }, + "../node_modules/@types/node/ts3.7/index.d.ts": { + "version": "d522314e80ed71b57e3c2939d3c9594eaae63a4adf028559e6574f6b270b0fee", + "signature": "d522314e80ed71b57e3c2939d3c9594eaae63a4adf028559e6574f6b270b0fee", + "affectsGlobalScope": false + }, + "../node_modules/commander/typings/index.d.ts": { + "version": "963c2fb402e1667a9d588caf625c4f9fab19d96f27f36ab99706ff00200e86d7", + "signature": "963c2fb402e1667a9d588caf625c4f9fab19d96f27f36ab99706ff00200e86d7", + "affectsGlobalScope": false + }, + "../src/tools/replaceAsync.ts": { + "version": "470b17a3353feec3255da85225b54629aa6eb798c1ab31fbb75eed8bdeb26b6d", + "signature": "3c738d28597bac680c2fd99456249649cb0508f3d56f8a610dbb3abe716eb8a1", + "affectsGlobalScope": false + }, + "../src/tools/addCache.ts": { + "version": "2c59fadd152abefb17566baec5b78fedff6f40822e46ddc56af3e0cb25b5b7be", + "signature": "303589b87156b6cf44f11fddd8b906b8af98c0303b2fb4534e2d0401d2cf3cca", + "affectsGlobalScope": false + }, + "../node_modules/form-data/index.d.ts": { + "version": "cbb7029e32a6a72178cda8baa9129b1ee6d1d779a35e46c780e38b4909d42a89", + "signature": "cbb7029e32a6a72178cda8baa9129b1ee6d1d779a35e46c780e38b4909d42a89", + "affectsGlobalScope": false + }, + "../node_modules/@types/node-fetch/externals.d.ts": { + "version": "972f1e91dab93b182624a17eeed02f683b8cb3fefbda7b689cc84570029d5f73", + "signature": "972f1e91dab93b182624a17eeed02f683b8cb3fefbda7b689cc84570029d5f73", + "affectsGlobalScope": false + }, + "../node_modules/@types/node-fetch/index.d.ts": { + "version": "f51382950fa81e3a54e9fd9f343fe583cfbb221f15a51936e12411699347effe", + "signature": "f51382950fa81e3a54e9fd9f343fe583cfbb221f15a51936e12411699347effe", + "affectsGlobalScope": false + }, + "../src/tools/is404.ts": { + "version": "0191f068e33b2d36d9bfc489e80485e7bf0d52f61163ed318881355d49758a14", + "signature": "96499ae432f1183768a87861f1ea9f0f0b288aaaaca75ec1b95b148eae12a379", + "affectsGlobalScope": false + }, + "../node_modules/@types/url-join/index.d.ts": { + "version": "316b72d88430ef387c7ce7fd9ae20f7eb9c298d801ce333c51816daf846b1ea4", + "signature": "316b72d88430ef387c7ce7fd9ae20f7eb9c298d801ce333c51816daf846b1ea4", + "affectsGlobalScope": false + }, + "../src/tools/urlJoin.ts": { + "version": "d09acf92e9d0b870ace13c1010c664f88d745f206dd025d3d4f62d80a7414398", + "signature": "f49d7e8e041c68b674a912ff7de990b86ba6b5111009e1464b592f947468107a", + "affectsGlobalScope": false + }, + "../src/lib/Scheme.ts": { + "version": "633a5da4bd47f747f07246921a2e136ad79767d8d2d60a38b3e1298d32abbb1b", + "signature": "9056cf5cacc8a3993e5805f5de3c062e6d57fe13e82117c696708591635f08e7", + "affectsGlobalScope": false + }, + "../node_modules/scripting-tools/dist/lib/get_caller_file_path.d.ts": { + "version": "e64648c5d646fde7e056578ade957887b730713df1723afdfb40a4ddcf235f8c", + "signature": "e64648c5d646fde7e056578ade957887b730713df1723afdfb40a4ddcf235f8c", + "affectsGlobalScope": false + }, + "../node_modules/scripting-tools/dist/lib/index.d.ts": { + "version": "dc50fd008223d44fc750cff976056781a0844c58a581ae48fac5f3793c5ca4e5", + "signature": "dc50fd008223d44fc750cff976056781a0844c58a581ae48fac5f3793c5ca4e5", + "affectsGlobalScope": false + }, + "../node_modules/evt/tools/typeSafety/assert.d.ts": { + "version": "ffe7d2a49bdd384d8f7f8c5d5202d1b6b190f0cc80e535e41bc96f7587f82f5b", + "signature": "ffe7d2a49bdd384d8f7f8c5d5202d1b6b190f0cc80e535e41bc96f7587f82f5b", + "affectsGlobalScope": false + }, + "../node_modules/evt/tools/typeSafety/AsyncReturnType.d.ts": { + "version": "4f542cc3b606d4217cf0b22e86d1b02d17fa428d9e71ca192626dfb141a3768b", + "signature": "4f542cc3b606d4217cf0b22e86d1b02d17fa428d9e71ca192626dfb141a3768b", + "affectsGlobalScope": false + }, + "../node_modules/evt/tools/typeSafety/exclude.d.ts": { + "version": "b2cd98707f4b57d1045434e86cf21315a50af70f8768079ac71a70f11210919f", + "signature": "b2cd98707f4b57d1045434e86cf21315a50af70f8768079ac71a70f11210919f", + "affectsGlobalScope": false + }, + "../node_modules/evt/tools/typeSafety/id.d.ts": { + "version": "80c302efbb4683fb75afb30e1a5f319ed6ebd84ff02327cadcfe2d53b559eeb7", + "signature": "80c302efbb4683fb75afb30e1a5f319ed6ebd84ff02327cadcfe2d53b559eeb7", + "affectsGlobalScope": false + }, + "../node_modules/evt/tools/typeSafety/matchVoid.d.ts": { + "version": "549f3bd8b575c5345ecafc490b17e3d356ce0b50fae87ffb795f9732920012b6", + "signature": "549f3bd8b575c5345ecafc490b17e3d356ce0b50fae87ffb795f9732920012b6", + "affectsGlobalScope": false + }, + "../node_modules/evt/tools/typeSafety/objectKeys.d.ts": { + "version": "4da2684f4596bd222840b428282b011560505fd93efb2de24709418ec33ad614", + "signature": "4da2684f4596bd222840b428282b011560505fd93efb2de24709418ec33ad614", + "affectsGlobalScope": false + }, + "../node_modules/evt/tools/typeSafety/typeGuard.d.ts": { + "version": "a422f83992eacfad8753c4b68f60cc8b65726f0dad038105031764a1d1636f50", + "signature": "a422f83992eacfad8753c4b68f60cc8b65726f0dad038105031764a1d1636f50", + "affectsGlobalScope": false + }, + "../node_modules/evt/tools/typeSafety/UnpackPromise.d.ts": { + "version": "c8a96f4e65100dc133ee9feaf486b9a52212f354bd44db6a2080a9267d8bb704", + "signature": "c8a96f4e65100dc133ee9feaf486b9a52212f354bd44db6a2080a9267d8bb704", + "affectsGlobalScope": false + }, + "../node_modules/evt/tools/typeSafety/UnpackTypeGuard.d.ts": { + "version": "fa2905239c92187e357130fc3114eefa64c9e6f48ae29fb0eb10674d99923bb2", + "signature": "fa2905239c92187e357130fc3114eefa64c9e6f48ae29fb0eb10674d99923bb2", + "affectsGlobalScope": false + }, + "../node_modules/evt/tools/typeSafety/index.d.ts": { + "version": "4d4d9f19b33d8603ee90ed1fbdaf6bdf6b8497c9c041796e1c547467f1818e04", + "signature": "4d4d9f19b33d8603ee90ed1fbdaf6bdf6b8497c9c041796e1c547467f1818e04", + "affectsGlobalScope": false + }, + "../node_modules/comment-json/index.d.ts": { + "version": "1c25550641cdbd7f581a6968cfcc38d885f33c9605f27de7a4f6f95c449fbba8", + "signature": "1c25550641cdbd7f581a6968cfcc38d885f33c9605f27de7a4f6f95c449fbba8", + "affectsGlobalScope": false + }, + "../src/lib/getTsconfigOutDirIfDenoified.ts": { + "version": "b14542fa450914bed0a1f0d8fe59660d1a946a1937dec981261e36a7e081ce35", + "signature": "fdfd2293a9b35212da80c998e709e221bb875530ede182993e0f9ced8ee1fdd2", + "affectsGlobalScope": false + }, + "../src/tools/getProjectRoot.ts": { + "version": "8e4b8b24a883c0447f21f522b7c72feafeb7c83eee634831885f1bf9c6739c15", + "signature": "200426c8d87ae866a7eb0e9ce577ebd7b9437df0f4d166965840e01e96144eff", + "affectsGlobalScope": false + }, + "../src/lib/resolve.ts": { + "version": "4cf0fca7ea35e365099dc6e07a60877da953d49c032fbc23d8cb50a1fa402014", + "signature": "ddcf6daff4b574a1ddc3fdac5a6d5206e4fe091b763e6fa8e0e8eda881c809b0", + "affectsGlobalScope": false + }, + "../src/lib/denoifyImportArgument.ts": { + "version": "3382aa84c444090828dc24078dd0fe17985d698242eda73483d1d43ba89c4012", + "signature": "8f4f28a958b92b270645966b7f149f61fa0eb9e8e1654d579a66cd6184784631", + "affectsGlobalScope": false + }, + "../src/lib/denoifySingleFile.ts": { + "version": "062cebe12b57dd6951cef6c4106825a3bc9900395249a862a74016e25541585a", + "signature": "b108679c6c6306a9112cd2a6f7335439140f7b21b376a427dbd20bf1dea39464", + "affectsGlobalScope": false + }, + "../src/tools/crawl.ts": { + "version": "db3163ca8bc4b07546bf6f7a9d1605c574b57b7ded14ce2716c9489b79801a59", + "signature": "5059ddaf08e8e94b7165b334b7eeacf2011e7a97d3ff28c35eff113dfbd01e8f", + "affectsGlobalScope": false + }, + "../src/lib/transformCodebase.ts": { + "version": "f74e2780649520653a8281d72272228c816b666e412d6ee0e5ee45048d6bdf88", + "signature": "12a2cf1414629badee9c795e33221a35804572eadd1db31d4044594cf1bc2558", + "affectsGlobalScope": false + }, + "../src/lib/modTsFile.ts": { + "version": "ef99d05acb3af5535ea77d97aebab633c7ee2bf3cdd1333bce551bb56c80ddff", + "signature": "2ecec7e4357b3b6535ae3950e25c3e3c3480129441984a6f7bb7293981f144be", + "affectsGlobalScope": false + }, + "../src/tools/isInsideOrIsDir.ts": { + "version": "63fc673cbc7cb1e2fa8beea56049825801d14a920257ac111bbd4eecc621150e", + "signature": "81d4a8a16e1612663cb89402e110f14cdb026eb38669c466743a86000534fcf0", + "affectsGlobalScope": false + }, + "../src/lib/denoify.ts": { + "version": "0e975d949b4d8885da31aa70d06dcc7f769fa0766170c9256f1cc5ce4abe68b3", + "signature": "b83b7ea30e244740efcbc37bb704e0504bff084dbe92143c3e01abbf72005eac", + "affectsGlobalScope": false + }, + "../src/bin/denoify.ts": { + "version": "ac5d560175cbfced1999eeaabfc4c94def8209fad06cc0562d81753a6f633b87", + "signature": "43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012", + "affectsGlobalScope": false + }, + "../src/tools/pathDepth.ts": { + "version": "af72cdc0ce96822838470eea327b84a2dd3f6ca12482c2473ff62f05935057cc", + "signature": "1b61044692a80215569b7746ca4ed423edf1683022ab334f600102bae1b76ff4", + "affectsGlobalScope": false + }, + "../src/tools/exec.ts": { + "version": "13a5cebefc7cb3982714da88f4c18e013026ecd3628d01a9bbd7017125422269", + "signature": "4f1147f029630c254d1c02c4b05773392079a745fed20e33a418da6b3e1db227", + "affectsGlobalScope": false + }, + "../src/tools/moveContentUpOneLevel.ts": { + "version": "453cf19d929b61a0e1af5ef4e65c03e59319aebc3b6c45ae164daf555519cad3", + "signature": "d0c23abca9162a48b2ef8ef08e350a4a348d40fbd48fe9427e9b6903ef764987", + "affectsGlobalScope": false + }, + "../src/lib/getIsDryRun.ts": { + "version": "04da4543e8e1f1d4cd94bed9c5b8803624b0f7b29797ecb066836e031eae38cb", + "signature": "784859885828a77c17dc81a3018a7821705cf830cd838515a022d58bc2e13d06", + "affectsGlobalScope": false + }, + "../src/tools/removeFromGitignore.ts": { + "version": "f62a12cc8c544a997bb5bbe767925f3e0ffcab14eed7a65071859c8a26b7789c", + "signature": "f8dfe1036786236e71e2ffd62898023004c3bf6816948061458c9f9567a3e935", + "affectsGlobalScope": false + }, + "../src/bin/enableShortDenoImportPath.ts": { + "version": "4d592dc5e984d8119e773fde0f71146e6352e6ec12f856cc2ba4b0e3fe72547f", + "signature": "43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012", + "affectsGlobalScope": false + }, + "../node_modules/@types/minimatch/index.d.ts": { + "version": "1d1e6bd176eee5970968423d7e215bfd66828b6db8d54d17afec05a831322633", + "signature": "1d1e6bd176eee5970968423d7e215bfd66828b6db8d54d17afec05a831322633", + "affectsGlobalScope": false + }, + "../node_modules/@types/glob/index.d.ts": { + "version": "d852d6282c8dc8156d26d6bda83ab4bde51fee05ba2fe0ecdc165ddda009d3ee", + "signature": "d852d6282c8dc8156d26d6bda83ab4bde51fee05ba2fe0ecdc165ddda009d3ee", + "affectsGlobalScope": false + }, + "../src/tools/globProxy.ts": { + "version": "e96bddb97d53478300ef8ccc9cc11439160e85ca390ab919e66eeeb4c60b8fce", + "signature": "5fffca1d6ae5e3c212d797ec1cfda5e1ca44b2d016ceedb7cc51eb1bde33df7d", + "affectsGlobalScope": false + }, + "../src/bin/enableShortNpmImportPath.ts": { + "version": "f23a6ac0cdaa91e1ad5bf1f4cbf145d95ca9b2bed199512b568d649527270709", + "signature": "43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012", + "affectsGlobalScope": false + }, + "../src/test/denoifyImportArgument.ts": { + "version": "ef8295db62ab3c6117d537aff559387ed8abb2eaa48f5ba51aaa072b0e9011f2", + "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881", + "affectsGlobalScope": false + }, + "../src/test/denoifySingleFile.ts": { + "version": "8d0e6357f156605c0190deebf758a93763ad264b8de5f845e7ae2fcb3ac51ad2", + "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881", + "affectsGlobalScope": false + }, + "../node_modules/evt/tools/Deferred.d.ts": { + "version": "fc633779ce49c0ea733d4a282d99462bb6c672c37db33584bafe130e792d55d6", + "signature": "fc633779ce49c0ea733d4a282d99462bb6c672c37db33584bafe130e792d55d6", + "affectsGlobalScope": false + }, + "../src/test/index.ts": { + "version": "b3a03f6f6b76f93b81c743f28b22610b9e46d1bb2a6ec277a83f5e8f9983fd4c", + "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881", + "affectsGlobalScope": false + }, + "../node_modules/minimal-polyfills/Object.is.ts": { + "version": "e90029a06fb86dd63e5f6b799d87702b7abe2397a220b78f1cfcce35b922f15a", + "affectsGlobalScope": true + }, + "../node_modules/evt/tools/inDepth/same.d.ts": { + "version": "7e062925029f9b753515d9f6e0169e0cecc986925ffe8702bf0f0d141b2dde90", + "signature": "7e062925029f9b753515d9f6e0169e0cecc986925ffe8702bf0f0d141b2dde90", + "affectsGlobalScope": false + }, + "../node_modules/evt/tools/inDepth/copy.d.ts": { + "version": "2700018e8191f31c9cc2b7d01132511e709a0da799f4cc9e29461749c61c2dce", + "signature": "2700018e8191f31c9cc2b7d01132511e709a0da799f4cc9e29461749c61c2dce", + "affectsGlobalScope": false + }, + "../node_modules/evt/tools/inDepth/index.d.ts": { + "version": "9798c9e1b71dd8acc29e20a08bd5437737e12ce4546f5444bad3be792933468d", + "signature": "9798c9e1b71dd8acc29e20a08bd5437737e12ce4546f5444bad3be792933468d", + "affectsGlobalScope": false + }, + "../src/test/resolve.ts": { + "version": "e6bc0b5199f10c54f537574f3732693212a8f237c9997038b73933cf76008edb", + "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881", + "affectsGlobalScope": false + }, + "../src/test/scheme.ts": { + "version": "0d43206a477347133f3103300bafcac5bca31ca91a656dc378709d7eea32593b", + "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881", + "affectsGlobalScope": false + }, + "../node_modules/@types/comment-json/index.d.ts": { + "version": "c401118ea6c6daa9f196013b0622c602d4faec565bb1cc6ca751d2a8fc295498", + "signature": "c401118ea6c6daa9f196013b0622c602d4faec565bb1cc6ca751d2a8fc295498", + "affectsGlobalScope": false + }, + "../node_modules/@types/js-yaml/index.d.ts": { + "version": "35076b65eb3d849fba353635aeb0ae7f26c5a9c69503a9ed09228e92445c90cb", + "signature": "35076b65eb3d849fba353635aeb0ae7f26c5a9c69503a9ed09228e92445c90cb", + "affectsGlobalScope": false + } + }, + "options": { + "module": 1, + "target": 5, + "lib": [ + "lib.es2018.d.ts" + ], + "declaration": true, + "outDir": "./", + "sourceMap": true, + "newLine": 1, + "noUnusedLocals": true, + "noUnusedParameters": true, + "incremental": true, + "strict": true, + "configFilePath": "../tsconfig.json" + }, + "referencedMap": { + "../node_modules/@types/comment-json/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/events/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/glob/index.d.ts": [ + "../node_modules/@types/minimatch/index.d.ts", + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/index.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/js-yaml/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/minimatch/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node-fetch/externals.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node-fetch/index.d.ts": [ + "../node_modules/@types/node-fetch/externals.d.ts", + "../node_modules/@types/node/http.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/index.d.ts", + "../node_modules/@types/node/url.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/form-data/index.d.ts" + ], + "../node_modules/@types/node/async_hooks.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/base.d.ts": [ + "../node_modules/@types/node/async_hooks.d.ts", + "../node_modules/@types/node/buffer.d.ts", + "../node_modules/@types/node/child_process.d.ts", + "../node_modules/@types/node/cluster.d.ts", + "../node_modules/@types/node/console.d.ts", + "../node_modules/@types/node/constants.d.ts", + "../node_modules/@types/node/crypto.d.ts", + "../node_modules/@types/node/dgram.d.ts", + "../node_modules/@types/node/dns.d.ts", + "../node_modules/@types/node/domain.d.ts", + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/globals.d.ts", + "../node_modules/@types/node/http.d.ts", + "../node_modules/@types/node/http2.d.ts", + "../node_modules/@types/node/https.d.ts", + "../node_modules/@types/node/inspector.d.ts", + "../node_modules/@types/node/module.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/os.d.ts", + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/perf_hooks.d.ts", + "../node_modules/@types/node/process.d.ts", + "../node_modules/@types/node/punycode.d.ts", + "../node_modules/@types/node/querystring.d.ts", + "../node_modules/@types/node/readline.d.ts", + "../node_modules/@types/node/repl.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/string_decoder.d.ts", + "../node_modules/@types/node/timers.d.ts", + "../node_modules/@types/node/tls.d.ts", + "../node_modules/@types/node/trace_events.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/tty.d.ts", + "../node_modules/@types/node/url.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/@types/node/v8.d.ts", + "../node_modules/@types/node/vm.d.ts", + "../node_modules/@types/node/worker_threads.d.ts", + "../node_modules/@types/node/zlib.d.ts" + ], + "../node_modules/@types/node/buffer.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/child_process.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/cluster.d.ts": [ + "../node_modules/@types/node/child_process.d.ts", + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/console.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/constants.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/crypto.d.ts": [ + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/dgram.d.ts": [ + "../node_modules/@types/node/dns.d.ts", + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/dns.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/domain.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/events.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/fs.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/url.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/globals.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/http.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/url.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/http2.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/http.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/tls.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/url.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/https.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/http.d.ts", + "../node_modules/@types/node/tls.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/url.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/inspector.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/module.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/net.d.ts": [ + "../node_modules/@types/node/dns.d.ts", + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/os.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/path.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/perf_hooks.d.ts": [ + "../node_modules/@types/node/async_hooks.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/process.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/punycode.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/querystring.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/readline.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/repl.d.ts": [ + "../node_modules/@types/node/readline.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/@types/node/vm.d.ts" + ], + "../node_modules/@types/node/stream.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/string_decoder.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/timers.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/tls.d.ts": [ + "../node_modules/@types/node/crypto.d.ts", + "../node_modules/@types/node/dns.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/trace_events.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/ts3.2/base.d.ts": [ + "../node_modules/@types/node/base.d.ts", + "../node_modules/@types/node/ts3.2/globals.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/ts3.2/globals.d.ts": [ + "../node_modules/@types/node/globals.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/ts3.2/util.d.ts": [ + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/ts3.7/assert.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/ts3.7/base.d.ts": [ + "../node_modules/@types/node/ts3.2/base.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/assert.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/ts3.7/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/base.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/tty.d.ts": [ + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/url.d.ts": [ + "../node_modules/@types/node/querystring.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/util.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../node_modules/@types/node/v8.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/vm.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/worker_threads.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/zlib.d.ts": [ + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/url-join/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/commander/typings/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/index.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/comment-json/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/Deferred.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/inDepth/copy.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/inDepth/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/evt/tools/inDepth/copy.d.ts", + "../node_modules/evt/tools/inDepth/same.d.ts" + ], + "../node_modules/evt/tools/inDepth/same.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/AsyncReturnType.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/UnpackPromise.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/UnpackTypeGuard.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/assert.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/exclude.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/id.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/evt/tools/typeSafety/AsyncReturnType.d.ts", + "../node_modules/evt/tools/typeSafety/UnpackPromise.d.ts", + "../node_modules/evt/tools/typeSafety/UnpackTypeGuard.d.ts", + "../node_modules/evt/tools/typeSafety/assert.d.ts", + "../node_modules/evt/tools/typeSafety/exclude.d.ts", + "../node_modules/evt/tools/typeSafety/id.d.ts", + "../node_modules/evt/tools/typeSafety/matchVoid.d.ts", + "../node_modules/evt/tools/typeSafety/objectKeys.d.ts", + "../node_modules/evt/tools/typeSafety/typeGuard.d.ts" + ], + "../node_modules/evt/tools/typeSafety/matchVoid.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/objectKeys.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/typeGuard.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/form-data/index.d.ts": [ + "../node_modules/@types/node/http.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/index.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/minimal-polyfills/Object.is.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/scripting-tools/dist/lib/get_caller_file_path.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/scripting-tools/dist/lib/index.d.ts": [ + "../node_modules/@types/node/child_process.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/index.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/scripting-tools/dist/lib/get_caller_file_path.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.collection.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.core.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.generator.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.iterable.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.promise.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.proxy.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.reflect.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.symbol.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2016.array.include.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2016.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2017.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2017.intl.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2017.object.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2017.string.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2018.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2018.intl.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2018.promise.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2018.regexp.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2020.bigint.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es5.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.esnext.intl.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../src/bin/denoify.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/commander/typings/index.d.ts", + "../src/lib/denoify.ts" + ], + "../src/bin/enableShortDenoImportPath.ts": [ + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../src/lib/getIsDryRun.ts", + "../src/lib/modTsFile.ts", + "../src/tools/exec.ts", + "../src/tools/moveContentUpOneLevel.ts", + "../src/tools/pathDepth.ts", + "../src/tools/removeFromGitignore.ts" + ], + "../src/bin/enableShortNpmImportPath.ts": [ + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/comment-json/index.d.ts", + "../src/lib/getIsDryRun.ts", + "../src/lib/modTsFile.ts", + "../src/tools/crawl.ts", + "../src/tools/exec.ts", + "../src/tools/globProxy.ts", + "../src/tools/moveContentUpOneLevel.ts", + "../src/tools/pathDepth.ts" + ], + "../src/lib/Scheme.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../src/tools/is404.ts", + "../src/tools/urlJoin.ts" + ], + "../src/lib/denoify.ts": [ + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/comment-json/index.d.ts", + "../src/lib/denoifyImportArgument.ts", + "../src/lib/denoifySingleFile.ts", + "../src/lib/modTsFile.ts", + "../src/lib/resolve.ts", + "../src/lib/transformCodebase.ts", + "../src/tools/isInsideOrIsDir.ts" + ], + "../src/lib/denoifyImportArgument.ts": [ + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../src/lib/Scheme.ts", + "../src/lib/resolve.ts", + "../src/tools/addCache.ts", + "../src/tools/is404.ts" + ], + "../src/lib/denoifySingleFile.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../src/lib/denoifyImportArgument.ts", + "../src/tools/replaceAsync.ts" + ], + "../src/lib/getIsDryRun.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../src/lib/getTsconfigOutDirIfDenoified.ts": [ + "../node_modules/@types/node-fetch/index.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/comment-json/index.d.ts", + "../src/lib/Scheme.ts" + ], + "../src/lib/modTsFile.ts": [ + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../src/lib/resolve.ts": [ + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/comment-json/index.d.ts", + "../node_modules/evt/tools/typeSafety/index.d.ts", + "../node_modules/scripting-tools/dist/lib/index.d.ts", + "../src/lib/Scheme.ts", + "../src/lib/getTsconfigOutDirIfDenoified.ts", + "../src/tools/getProjectRoot.ts" + ], + "../src/lib/transformCodebase.ts": [ + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/scripting-tools/dist/lib/index.d.ts", + "../src/tools/crawl.ts" + ], + "../src/test/denoifyImportArgument.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../src/lib/denoifyImportArgument.ts" + ], + "../src/test/denoifySingleFile.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/evt/tools/typeSafety/index.d.ts", + "../src/lib/denoifySingleFile.ts" + ], + "../src/test/index.ts": [ + "../node_modules/@types/node/child_process.d.ts", + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/evt/tools/Deferred.d.ts" + ], + "../src/test/resolve.ts": [ + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/evt/tools/inDepth/index.d.ts", + "../node_modules/evt/tools/typeSafety/index.d.ts", + "../src/lib/resolve.ts" + ], + "../src/test/scheme.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/evt/tools/inDepth/index.d.ts", + "../node_modules/evt/tools/typeSafety/index.d.ts", + "../src/lib/Scheme.ts" + ], + "../src/tools/addCache.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../src/tools/crawl.ts": [ + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../src/tools/exec.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/scripting-tools/dist/lib/index.d.ts" + ], + "../src/tools/getProjectRoot.ts": [ + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../src/tools/globProxy.ts": [ + "../node_modules/@types/glob/index.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../src/tools/is404.ts": [ + "../node_modules/@types/node-fetch/index.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../src/tools/isInsideOrIsDir.ts": [ + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../src/tools/moveContentUpOneLevel.ts": [ + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/scripting-tools/dist/lib/index.d.ts", + "../src/tools/crawl.ts", + "../src/tools/exec.ts" + ], + "../src/tools/pathDepth.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../src/tools/removeFromGitignore.ts": [ + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../src/tools/crawl.ts", + "../src/tools/isInsideOrIsDir.ts" + ], + "../src/tools/replaceAsync.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../src/tools/urlJoin.ts": [ + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ] + }, + "exportedModulesMap": { + "../node_modules/@types/comment-json/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/events/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/glob/index.d.ts": [ + "../node_modules/@types/minimatch/index.d.ts", + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/index.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/js-yaml/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/minimatch/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node-fetch/externals.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node-fetch/index.d.ts": [ + "../node_modules/@types/node-fetch/externals.d.ts", + "../node_modules/@types/node/http.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/index.d.ts", + "../node_modules/@types/node/url.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/form-data/index.d.ts" + ], + "../node_modules/@types/node/async_hooks.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/base.d.ts": [ + "../node_modules/@types/node/async_hooks.d.ts", + "../node_modules/@types/node/buffer.d.ts", + "../node_modules/@types/node/child_process.d.ts", + "../node_modules/@types/node/cluster.d.ts", + "../node_modules/@types/node/console.d.ts", + "../node_modules/@types/node/constants.d.ts", + "../node_modules/@types/node/crypto.d.ts", + "../node_modules/@types/node/dgram.d.ts", + "../node_modules/@types/node/dns.d.ts", + "../node_modules/@types/node/domain.d.ts", + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/globals.d.ts", + "../node_modules/@types/node/http.d.ts", + "../node_modules/@types/node/http2.d.ts", + "../node_modules/@types/node/https.d.ts", + "../node_modules/@types/node/inspector.d.ts", + "../node_modules/@types/node/module.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/os.d.ts", + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/perf_hooks.d.ts", + "../node_modules/@types/node/process.d.ts", + "../node_modules/@types/node/punycode.d.ts", + "../node_modules/@types/node/querystring.d.ts", + "../node_modules/@types/node/readline.d.ts", + "../node_modules/@types/node/repl.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/string_decoder.d.ts", + "../node_modules/@types/node/timers.d.ts", + "../node_modules/@types/node/tls.d.ts", + "../node_modules/@types/node/trace_events.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/tty.d.ts", + "../node_modules/@types/node/url.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/@types/node/v8.d.ts", + "../node_modules/@types/node/vm.d.ts", + "../node_modules/@types/node/worker_threads.d.ts", + "../node_modules/@types/node/zlib.d.ts" + ], + "../node_modules/@types/node/buffer.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/child_process.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/cluster.d.ts": [ + "../node_modules/@types/node/child_process.d.ts", + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/console.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/constants.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/crypto.d.ts": [ + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/dgram.d.ts": [ + "../node_modules/@types/node/dns.d.ts", + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/dns.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/domain.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/events.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/fs.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/url.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/globals.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/http.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/url.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/http2.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/http.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/tls.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/url.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/https.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/http.d.ts", + "../node_modules/@types/node/tls.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/url.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/inspector.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/module.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/net.d.ts": [ + "../node_modules/@types/node/dns.d.ts", + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/os.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/path.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/perf_hooks.d.ts": [ + "../node_modules/@types/node/async_hooks.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/process.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/punycode.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/querystring.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/readline.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/repl.d.ts": [ + "../node_modules/@types/node/readline.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/@types/node/vm.d.ts" + ], + "../node_modules/@types/node/stream.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/string_decoder.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/timers.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/tls.d.ts": [ + "../node_modules/@types/node/crypto.d.ts", + "../node_modules/@types/node/dns.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/trace_events.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/ts3.2/base.d.ts": [ + "../node_modules/@types/node/base.d.ts", + "../node_modules/@types/node/ts3.2/globals.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/ts3.2/globals.d.ts": [ + "../node_modules/@types/node/globals.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/ts3.2/util.d.ts": [ + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/ts3.7/assert.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/ts3.7/base.d.ts": [ + "../node_modules/@types/node/ts3.2/base.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/assert.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/ts3.7/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/base.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/tty.d.ts": [ + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/url.d.ts": [ + "../node_modules/@types/node/querystring.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/util.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts" + ], + "../node_modules/@types/node/v8.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/vm.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/worker_threads.d.ts": [ + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/node/zlib.d.ts": [ + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/@types/url-join/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/commander/typings/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/index.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/comment-json/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/Deferred.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/inDepth/copy.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/inDepth/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/evt/tools/inDepth/copy.d.ts", + "../node_modules/evt/tools/inDepth/same.d.ts" + ], + "../node_modules/evt/tools/inDepth/same.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/AsyncReturnType.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/UnpackPromise.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/UnpackTypeGuard.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/assert.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/exclude.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/id.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/index.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/evt/tools/typeSafety/AsyncReturnType.d.ts", + "../node_modules/evt/tools/typeSafety/UnpackPromise.d.ts", + "../node_modules/evt/tools/typeSafety/UnpackTypeGuard.d.ts", + "../node_modules/evt/tools/typeSafety/assert.d.ts", + "../node_modules/evt/tools/typeSafety/exclude.d.ts", + "../node_modules/evt/tools/typeSafety/id.d.ts", + "../node_modules/evt/tools/typeSafety/matchVoid.d.ts", + "../node_modules/evt/tools/typeSafety/objectKeys.d.ts", + "../node_modules/evt/tools/typeSafety/typeGuard.d.ts" + ], + "../node_modules/evt/tools/typeSafety/matchVoid.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/objectKeys.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/evt/tools/typeSafety/typeGuard.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/form-data/index.d.ts": [ + "../node_modules/@types/node/http.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/index.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/scripting-tools/dist/lib/get_caller_file_path.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/scripting-tools/dist/lib/index.d.ts": [ + "../node_modules/@types/node/child_process.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/index.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/scripting-tools/dist/lib/get_caller_file_path.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.collection.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.core.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.generator.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.iterable.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.promise.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.proxy.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.reflect.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.symbol.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2016.array.include.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2016.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2017.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2017.intl.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2017.object.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2017.string.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2018.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2018.intl.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2018.promise.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2018.regexp.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es2020.bigint.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.es5.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../node_modules/typescript/lib/lib.esnext.intl.d.ts": [ + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/util.d.ts" + ], + "../src/lib/denoifyImportArgument.ts": [ + "../src/lib/resolve.ts" + ], + "../src/lib/denoifySingleFile.ts": [ + "../src/lib/denoifyImportArgument.ts" + ], + "../src/lib/getTsconfigOutDirIfDenoified.ts": [ + "../src/lib/Scheme.ts" + ], + "../src/lib/resolve.ts": [ + "../src/lib/Scheme.ts" + ], + "../src/tools/urlJoin.ts": [ + "../node_modules/@types/node/path.d.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + "../node_modules/@types/comment-json/index.d.ts", + "../node_modules/@types/events/index.d.ts", + "../node_modules/@types/glob/index.d.ts", + "../node_modules/@types/js-yaml/index.d.ts", + "../node_modules/@types/minimatch/index.d.ts", + "../node_modules/@types/node-fetch/externals.d.ts", + "../node_modules/@types/node-fetch/index.d.ts", + "../node_modules/@types/node/async_hooks.d.ts", + "../node_modules/@types/node/base.d.ts", + "../node_modules/@types/node/buffer.d.ts", + "../node_modules/@types/node/child_process.d.ts", + "../node_modules/@types/node/cluster.d.ts", + "../node_modules/@types/node/console.d.ts", + "../node_modules/@types/node/constants.d.ts", + "../node_modules/@types/node/crypto.d.ts", + "../node_modules/@types/node/dgram.d.ts", + "../node_modules/@types/node/dns.d.ts", + "../node_modules/@types/node/domain.d.ts", + "../node_modules/@types/node/events.d.ts", + "../node_modules/@types/node/fs.d.ts", + "../node_modules/@types/node/globals.d.ts", + "../node_modules/@types/node/http.d.ts", + "../node_modules/@types/node/http2.d.ts", + "../node_modules/@types/node/https.d.ts", + "../node_modules/@types/node/inspector.d.ts", + "../node_modules/@types/node/module.d.ts", + "../node_modules/@types/node/net.d.ts", + "../node_modules/@types/node/os.d.ts", + "../node_modules/@types/node/path.d.ts", + "../node_modules/@types/node/perf_hooks.d.ts", + "../node_modules/@types/node/process.d.ts", + "../node_modules/@types/node/punycode.d.ts", + "../node_modules/@types/node/querystring.d.ts", + "../node_modules/@types/node/readline.d.ts", + "../node_modules/@types/node/repl.d.ts", + "../node_modules/@types/node/stream.d.ts", + "../node_modules/@types/node/string_decoder.d.ts", + "../node_modules/@types/node/timers.d.ts", + "../node_modules/@types/node/tls.d.ts", + "../node_modules/@types/node/trace_events.d.ts", + "../node_modules/@types/node/ts3.2/base.d.ts", + "../node_modules/@types/node/ts3.2/globals.d.ts", + "../node_modules/@types/node/ts3.2/util.d.ts", + "../node_modules/@types/node/ts3.7/assert.d.ts", + "../node_modules/@types/node/ts3.7/base.d.ts", + "../node_modules/@types/node/ts3.7/index.d.ts", + "../node_modules/@types/node/tty.d.ts", + "../node_modules/@types/node/url.d.ts", + "../node_modules/@types/node/util.d.ts", + "../node_modules/@types/node/v8.d.ts", + "../node_modules/@types/node/vm.d.ts", + "../node_modules/@types/node/worker_threads.d.ts", + "../node_modules/@types/node/zlib.d.ts", + "../node_modules/@types/url-join/index.d.ts", + "../node_modules/commander/typings/index.d.ts", + "../node_modules/comment-json/index.d.ts", + "../node_modules/evt/tools/Deferred.d.ts", + "../node_modules/evt/tools/inDepth/copy.d.ts", + "../node_modules/evt/tools/inDepth/index.d.ts", + "../node_modules/evt/tools/inDepth/same.d.ts", + "../node_modules/evt/tools/typeSafety/AsyncReturnType.d.ts", + "../node_modules/evt/tools/typeSafety/UnpackPromise.d.ts", + "../node_modules/evt/tools/typeSafety/UnpackTypeGuard.d.ts", + "../node_modules/evt/tools/typeSafety/assert.d.ts", + "../node_modules/evt/tools/typeSafety/exclude.d.ts", + "../node_modules/evt/tools/typeSafety/id.d.ts", + "../node_modules/evt/tools/typeSafety/index.d.ts", + "../node_modules/evt/tools/typeSafety/matchVoid.d.ts", + "../node_modules/evt/tools/typeSafety/objectKeys.d.ts", + "../node_modules/evt/tools/typeSafety/typeGuard.d.ts", + "../node_modules/form-data/index.d.ts", + "../node_modules/minimal-polyfills/Object.is.ts", + "../node_modules/scripting-tools/dist/lib/get_caller_file_path.d.ts", + "../node_modules/scripting-tools/dist/lib/index.d.ts", + "../node_modules/typescript/lib/lib.es2015.collection.d.ts", + "../node_modules/typescript/lib/lib.es2015.core.d.ts", + "../node_modules/typescript/lib/lib.es2015.d.ts", + "../node_modules/typescript/lib/lib.es2015.generator.d.ts", + "../node_modules/typescript/lib/lib.es2015.iterable.d.ts", + "../node_modules/typescript/lib/lib.es2015.promise.d.ts", + "../node_modules/typescript/lib/lib.es2015.proxy.d.ts", + "../node_modules/typescript/lib/lib.es2015.reflect.d.ts", + "../node_modules/typescript/lib/lib.es2015.symbol.d.ts", + "../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts", + "../node_modules/typescript/lib/lib.es2016.array.include.d.ts", + "../node_modules/typescript/lib/lib.es2016.d.ts", + "../node_modules/typescript/lib/lib.es2017.d.ts", + "../node_modules/typescript/lib/lib.es2017.intl.d.ts", + "../node_modules/typescript/lib/lib.es2017.object.d.ts", + "../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts", + "../node_modules/typescript/lib/lib.es2017.string.d.ts", + "../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts", + "../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts", + "../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts", + "../node_modules/typescript/lib/lib.es2018.d.ts", + "../node_modules/typescript/lib/lib.es2018.intl.d.ts", + "../node_modules/typescript/lib/lib.es2018.promise.d.ts", + "../node_modules/typescript/lib/lib.es2018.regexp.d.ts", + "../node_modules/typescript/lib/lib.es2020.bigint.d.ts", + "../node_modules/typescript/lib/lib.es5.d.ts", + "../node_modules/typescript/lib/lib.esnext.intl.d.ts", + "../src/bin/denoify.ts", + "../src/bin/enableShortDenoImportPath.ts", + "../src/bin/enableShortNpmImportPath.ts", + "../src/lib/Scheme.ts", + "../src/lib/denoify.ts", + "../src/lib/denoifyImportArgument.ts", + "../src/lib/denoifySingleFile.ts", + "../src/lib/getIsDryRun.ts", + "../src/lib/getTsconfigOutDirIfDenoified.ts", + "../src/lib/modTsFile.ts", + "../src/lib/resolve.ts", + "../src/lib/transformCodebase.ts", + "../src/test/denoifyImportArgument.ts", + "../src/test/denoifySingleFile.ts", + "../src/test/index.ts", + "../src/test/resolve.ts", + "../src/test/scheme.ts", + "../src/tools/addCache.ts", + "../src/tools/crawl.ts", + "../src/tools/exec.ts", + "../src/tools/getProjectRoot.ts", + "../src/tools/globProxy.ts", + "../src/tools/is404.ts", + "../src/tools/isInsideOrIsDir.ts", + "../src/tools/moveContentUpOneLevel.ts", + "../src/tools/pathDepth.ts", + "../src/tools/removeFromGitignore.ts", + "../src/tools/replaceAsync.ts", + "../src/tools/urlJoin.ts" + ] + }, + "version": "3.9.3" +} \ No newline at end of file