From cd477c734561e0b7c966fe62c9c193322dff9f7c Mon Sep 17 00:00:00 2001 From: danyill Date: Sun, 26 Sep 2021 20:07:53 +1300 Subject: [PATCH] Enforce code style via linter (part of #446) (#448) * Add ESLint autofixed files * Convert tabs to 2 spaces * Solve the easy linting issues * Add a few more, ignore linting on folders with 'test' * Fix typos, more linter happiness, add rule to disallow semicolons * Quote eslint properly, solve some more issues * And some more linting goodness * Update package-lock.json * Some more linting happiness * Replace Thenable by Promise * Run CI on pull requests * Fix null/undefined check conditions for PDF export Co-authored-by: Guillaume Grossetie --- .eslintignore | 4 + .eslintrc.js | 12 +- .github/workflows/ci.yml | 12 +- package-lock.json | 2961 ++++++++++--------- package.json | 15 +- src-preview/activeLineMarker.ts | 48 +- src-preview/csp.ts | 106 +- src-preview/events.ts | 9 +- src-preview/index.ts | 172 +- src-preview/loading.ts | 68 +- src-preview/messaging.ts | 18 +- src-preview/pre.ts | 16 +- src-preview/scroll-sync.ts | 131 +- src-preview/settings.ts | 36 +- src-preview/strings.ts | 10 +- src/asciidocEngine.ts | 106 +- src/asciidocExtensions.ts | 127 +- src/commandManager.ts | 50 +- src/commands/exportAsPDF.ts | 340 +-- src/commands/index.ts | 22 +- src/commands/moveCursorToPosition.ts | 24 +- src/commands/openDocumentLink.ts | 141 +- src/commands/pasteImage.ts | 13 +- src/commands/refreshPreview.ts | 18 +- src/commands/saveDocbook.ts | 59 +- src/commands/saveHTML.ts | 55 +- src/commands/showPreview.ts | 92 +- src/commands/showPreviewSecuritySelector.ts | 41 +- src/commands/showSource.ts | 28 +- src/commands/toggleLock.ts | 18 +- src/extension.ts | 126 +- src/features/attributeCompleter.ts | 15 +- src/features/documentLinkProvider.ts | 256 +- src/features/documentSymbolProvider.ts | 89 +- src/features/foldingProvider.ts | 94 +- src/features/preview.ts | 517 ++-- src/features/previewConfig.ts | 187 +- src/features/previewContentProvider.ts | 187 +- src/features/previewManager.ts | 171 +- src/features/workspaceSymbolProvider.ts | 269 +- src/highlightjs-adapter.ts | 9 +- src/image-paste.ts | 327 +- src/logger.ts | 62 +- src/providers/asciidoc.provider.ts | 58 +- src/providers/bibtex.provider.ts | 56 +- src/providers/createCompletionItem.ts | 8 +- src/providers/createContext.ts | 22 +- src/providers/xref.provider.ts | 56 +- src/security.ts | 267 +- src/slugify.ts | 26 +- src/tableOfContentsProvider.ts | 129 +- src/test/documentLinkProvider.test.ts | 133 +- src/test/documentSymbolProvider.test.ts | 116 +- src/test/engine.ts | 26 +- src/test/foldingProvider.test.ts | 183 +- src/test/inMemoryDocument.ts | 118 +- src/test/index.ts | 14 +- src/test/runTest.ts | 34 +- src/test/suite/index.ts | 56 +- src/test/tableOfContentsProvider.test.ts | 132 +- src/test/workspaceSymbolProvider.test.ts | 172 +- src/text-parser.ts | 348 ++- src/typings/markdown-it-named-headers.d.ts | 4 - src/util/dispose.ts | 9 +- src/util/file.ts | 52 +- src/util/includeAutoCompletion.ts | 49 +- src/util/lazy.ts | 48 +- src/util/links.ts | 12 +- src/util/topmostLineMonitor.ts | 94 +- test/extension.test.ts | 8 +- test/index.ts | 12 +- tsconfig.json | 7 +- 72 files changed, 4660 insertions(+), 4650 deletions(-) create mode 100644 .eslintignore delete mode 100644 src/typings/markdown-it-named-headers.d.ts diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..9ff926ec --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +*/test/* +/test/* +.eslintrc.js +/dist/* \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index f3b9e607..6eb63531 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,9 +6,9 @@ module.exports = { "tsconfigRootDir": __dirname, "sourceType": "module" }, + "plugins": ["@typescript-eslint"], "extends": [ - // "eslint:recommended", - // "plugin:@typescript-eslint/recommended", + "standard" ], "rules": { "arrow-parens": ["error", "always"], @@ -25,6 +25,10 @@ module.exports = { "ignoreTemplateLiterals": true }], //"indent": ["error", 4], - "spaced-comment": "off" + "semi": ["error", "never"], + "spaced-comment": "off", + // https://github.com/typescript-eslint/typescript-eslint/issues/2621 + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }], } -}; \ No newline at end of file +}; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f142cdf..e876a481 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,12 @@ name: Lint and Compile -on: [push] +on: + push: + branches: + - master + pull_request: + branches: + - '*' jobs: build: @@ -10,9 +16,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: Use Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: - node-version: '12.x' + node-version: '14' - run: npm ci - run: npm run lint - run: npm run compile diff --git a/package-lock.json b/package-lock.json index bc04e3a4..4877a271 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "requires": true, "packages": { "": { + "name": "asciidoctor-vscode", "version": "0.0.0", "license": "MIT", "dependencies": { @@ -13,6 +14,7 @@ "@orcid/bibtex-parse-js": "^0.0.25", "@types/vscode": "^1.31.0", "asciidoctor-kroki": "^0.13.0", + "eslint-config-standard": "^16.0.3", "file-url": "^3.0.0", "follow-redirects": "^1.10.0", "https-proxy-agent": "^4.0.0", @@ -26,16 +28,18 @@ "@types/lodash.throttle": "^4.1.3", "@types/mocha": "^5.2.5", "@types/node": "^8.10.25", - "@typescript-eslint/eslint-plugin": "^2.32.0", - "@typescript-eslint/parser": "^2.32.0", - "eslint": "^6.8.0", + "@typescript-eslint/eslint-plugin": "^4.31.1", + "@typescript-eslint/parser": "^4.31.1", + "eslint": "^7.32.0", "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.0", "json-schema": "^0.2.5", "lodash.throttle": "^4.1.1", "mocha-junit-reporter": "^1.23.3", "mocha-multi-reporters": "^1.1.7", "ts-loader": "^4.0.1", - "typescript": "^3.9.5", + "typescript": "^3.9.10", "vsce": "^1.77.0", "vscode-test": "^1.4.0", "webpack": "^4.41.5", @@ -72,22 +76,17 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", - "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", - "dev": true, + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", "dependencies": { - "@babel/highlight": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" + "@babel/highlight": "^7.10.4" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", - "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==", - "dev": true, + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", + "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", "engines": { "node": ">=6.9.0" } @@ -96,7 +95,6 @@ "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", - "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.14.5", "chalk": "^2.0.0", @@ -106,6 +104,78 @@ "node": ">=6.9.0" } }, + "node_modules/@eslint/eslintrc": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", + "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==" + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@orcid/bibtex-parse-js": { "version": "0.0.25", "resolved": "https://registry.npmjs.org/@orcid/bibtex-parse-js/-/bibtex-parse-js-0.0.25.tgz", @@ -120,12 +190,6 @@ "node": ">= 6" } }, - "node_modules/@types/eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", - "dev": true - }, "node_modules/@types/highlight.js": { "version": "9.1.10", "resolved": "https://registry.npmjs.org/@types/highlight.js/-/highlight.js-9.1.10.tgz", @@ -171,26 +235,29 @@ "integrity": "sha512-Zg38rusx2nU6gy6QdF7v4iqgxNfxzlBlDhrRCjOiPQp+sfaNrp3f9J6OHIhpGNN1oOAca4+9Hq0+8u3jwzPMlQ==" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz", - "integrity": "sha512-4zY3Z88rEE99+CNvTbXSyovv2z9PNOVffTWD2W8QF5s2prBQtwN2zadqERcrHpcR7O/+KMI3fcTAmUUhK/iQcQ==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.1.tgz", + "integrity": "sha512-UDqhWmd5i0TvPLmbK5xY3UZB0zEGseF+DHPghZ37Sb83Qd3p8ujhvAtkU4OF46Ka5Pm5kWvFIx0cCTBFKo0alA==", "dev": true, "dependencies": { - "@typescript-eslint/experimental-utils": "2.34.0", + "@typescript-eslint/experimental-utils": "4.31.1", + "@typescript-eslint/scope-manager": "4.31.1", + "debug": "^4.3.1", "functional-red-black-tree": "^1.0.1", - "regexpp": "^3.0.0", - "tsutils": "^3.17.1" + "regexpp": "^3.1.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^10.12.0 || >=12.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^2.0.0", - "eslint": "^5.0.0 || ^6.0.0" + "@typescript-eslint/parser": "^4.0.0", + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -214,18 +281,20 @@ } }, "node_modules/@typescript-eslint/experimental-utils": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz", - "integrity": "sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.1.tgz", + "integrity": "sha512-NtoPsqmcSsWty0mcL5nTZXMf7Ei0Xr2MT8jWjXMVgRK0/1qeQ2jZzLFUh4QtyJ4+/lPUyMw5cSfeeME+Zrtp9Q==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.34.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" + "@types/json-schema": "^7.0.7", + "@typescript-eslint/scope-manager": "4.31.1", + "@typescript-eslint/types": "4.31.1", + "@typescript-eslint/typescript-estree": "4.31.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^10.12.0 || >=12.0.0" }, "funding": { "type": "opencollective", @@ -236,25 +305,25 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.34.0.tgz", - "integrity": "sha512-03ilO0ucSD0EPTw2X4PntSIRFtDPWjrVq7C3/Z3VQHRC7+13YB55rcJI3Jt+YgeHbjUdJPcPa7b23rXCBokuyA==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.1.tgz", + "integrity": "sha512-dnVZDB6FhpIby6yVbHkwTKkn2ypjVIfAR9nh+kYsA/ZL0JlTsd22BiDjouotisY3Irmd3OW1qlk9EI5R8GrvRQ==", "dev": true, "dependencies": { - "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.34.0", - "@typescript-eslint/typescript-estree": "2.34.0", - "eslint-visitor-keys": "^1.1.0" + "@typescript-eslint/scope-manager": "4.31.1", + "@typescript-eslint/types": "4.31.1", + "@typescript-eslint/typescript-estree": "4.31.1", + "debug": "^4.3.1" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^10.12.0 || >=12.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0" + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -262,22 +331,52 @@ } } }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.1.tgz", + "integrity": "sha512-N1Uhn6SqNtU2XpFSkD4oA+F0PfKdWHyr4bTX0xTj8NRx1314gBDRL1LUuZd5+L3oP+wo6hCbZpaa1in6SwMcVQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "4.31.1", + "@typescript-eslint/visitor-keys": "4.31.1" + }, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.1.tgz", + "integrity": "sha512-kixltt51ZJGKENNW88IY5MYqTBA8FR0Md8QdGbJD2pKZ+D5IvxjTYDNtJPDxFBiXmka2aJsITdB1BtO1fsgmsQ==", + "dev": true, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz", - "integrity": "sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.1.tgz", + "integrity": "sha512-EGHkbsUvjFrvRnusk6yFGqrqMBTue5E5ROnS5puj3laGQPasVUgwhrxfcgkdHNFECHAewpvELE1Gjv0XO3mdWg==", "dev": true, "dependencies": { - "debug": "^4.1.1", - "eslint-visitor-keys": "^1.1.0", - "glob": "^7.1.6", + "@typescript-eslint/types": "4.31.1", + "@typescript-eslint/visitor-keys": "4.31.1", + "debug": "^4.3.1", + "globby": "^11.0.3", "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^10.12.0 || >=12.0.0" }, "funding": { "type": "opencollective", @@ -304,6 +403,23 @@ "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.1.tgz", + "integrity": "sha512-PCncP8hEqKw6SOJY+3St4LVtoZpPPn+Zlpm7KW5xnviMhdqcsBty4Lsg4J/VECpJjw1CkROaZhH4B8M1OfnXTQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "4.31.1", + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@ungap/promise-all-settled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", @@ -502,7 +618,6 @@ "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, "bin": { "acorn": "bin/acorn" }, @@ -514,7 +629,6 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -531,7 +645,6 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -565,39 +678,10 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "peer": true, "engines": { "node": ">=6" } }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", @@ -611,7 +695,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -642,7 +725,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "dependencies": { "sprintf-js": "~1.0.2" } @@ -678,7 +760,6 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", @@ -693,6 +774,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", @@ -706,7 +796,6 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", - "dev": true, "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3", @@ -826,12 +915,11 @@ } }, "node_modules/astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true, + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/async-each": { @@ -1249,7 +1337,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -1262,7 +1349,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, "engines": { "node": ">=6" } @@ -1296,7 +1382,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -1306,12 +1391,6 @@ "node": ">=4" } }, - "node_modules/chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, "node_modules/charenc": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", @@ -1508,27 +1587,6 @@ "node": ">=0.10.0" } }, - "node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "dependencies": { - "restore-cursor": "^3.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -1581,7 +1639,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -1589,8 +1646,7 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "node_modules/commander": { "version": "6.2.1", @@ -1858,16 +1914,14 @@ } }, "node_modules/deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "node_modules/define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, "dependencies": { "object-keys": "^1.0.12" }, @@ -1940,11 +1994,31 @@ "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", "dev": true }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dir-glob/node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, "dependencies": { "esutils": "^2.0.2" }, @@ -2062,8 +2136,7 @@ "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/emojis-list": { "version": "3.0.0", @@ -2097,6 +2170,17 @@ "node": ">=6.9.0" } }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/entities": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", @@ -2122,7 +2206,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, "dependencies": { "is-arrayish": "^0.2.1" } @@ -2131,7 +2214,6 @@ "version": "1.18.5", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.5.tgz", "integrity": "sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", @@ -2162,7 +2244,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, "dependencies": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -2189,52 +2270,53 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, "engines": { "node": ">=0.8.0" } }, "node_modules/eslint": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", - "dev": true, + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", "dependencies": { - "@babel/code-frame": "^7.0.0", + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", "ajv": "^6.10.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.3", - "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.2", - "esquery": "^1.0.1", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^7.0.0", "is-glob": "^4.0.0", "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.14", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.3", + "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", - "table": "^5.2.3", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, @@ -2242,17 +2324,41 @@ "eslint": "bin/eslint.js" }, "engines": { - "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + "node": "^10.12.0 || >=12.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-standard": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-16.0.3.tgz", + "integrity": "sha512-x4fmJL5hGqNJKGHSjnLdgA6U6h1YW/G2dW9fA+cyVur4SK6lyue8+UgNKWlZtUDTXvgKDD/Oa3GQjmB5kjtVvg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peerDependencies": { + "eslint": "^7.12.1", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1 || ^5.0.0" + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", - "dev": true, "dependencies": { "debug": "^3.2.7", "resolve": "^1.20.0" @@ -2262,7 +2368,6 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, "dependencies": { "ms": "^2.1.1" } @@ -2271,7 +2376,6 @@ "version": "2.6.2", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.2.tgz", "integrity": "sha512-QG8pcgThYOuqxupd06oYTZoNOGaUdTY1PqK+oS6ElF6vs4pBdk/aYxFVQQXzcrAqp9m7cl7lb2ubazX+g16k2Q==", - "dev": true, "dependencies": { "debug": "^3.2.7", "pkg-dir": "^2.0.0" @@ -2284,16 +2388,54 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, "dependencies": { "ms": "^2.1.1" } }, + "node_modules/eslint-plugin-es": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", + "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", + "dependencies": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=4.19.1" + } + }, + "node_modules/eslint-plugin-es/node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint-plugin-es/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "engines": { + "node": ">=4" + } + }, "node_modules/eslint-plugin-import": { "version": "2.24.1", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.24.1.tgz", "integrity": "sha512-KSFWhNxPH8OGJwpRJJs+Z7I0a13E2iFQZJIvSnCu6KUs4qmgAm3xN9GYBCSoiGWmwA7gERZPXqYQjcoCROnYhQ==", - "dev": true, "dependencies": { "array-includes": "^3.1.3", "array.prototype.flat": "^1.2.4", @@ -2322,7 +2464,6 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, "dependencies": { "ms": "2.0.0" } @@ -2331,7 +2472,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, "dependencies": { "esutils": "^2.0.2" }, @@ -2342,27 +2482,31 @@ "node_modules/eslint-plugin-import/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, + "node_modules/eslint-plugin-node": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", + "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "eslint-plugin-es": "^3.0.0", + "eslint-utils": "^2.0.0", + "ignore": "^5.1.1", + "minimatch": "^3.0.4", + "resolve": "^1.10.1", + "semver": "^6.1.0" }, "engines": { - "node": ">=8.0.0" + "node": ">=8.10.0" + }, + "peerDependencies": { + "eslint": ">=5.16.0" } }, - "node_modules/eslint-utils": { + "node_modules/eslint-plugin-node/node_modules/eslint-utils": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", - "dev": true, "dependencies": { "eslint-visitor-keys": "^1.1.0" }, @@ -2373,76 +2517,274 @@ "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/eslint-visitor-keys": { + "node_modules/eslint-plugin-node/node_modules/eslint-visitor-keys": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, "engines": { "node": ">=4" } }, - "node_modules/eslint/node_modules/eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "node_modules/eslint-plugin-node/node_modules/ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint-plugin-node/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-promise": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-5.1.0.tgz", + "integrity": "sha512-NGmI6BH5L12pl7ScQHbg7tvtk4wPxxj8yPHH47NvSmMtFneC077PSeY3huFj06ZWZvtbfxSPt3RuOQD5XcR4ng==", + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "peerDependencies": { + "eslint": "^7.0.0" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/eslint/node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dependencies": { "eslint-visitor-keys": "^1.1.0" }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/eslint/node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, + "node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dependencies": { - "minimist": "^1.2.5" + "shebang-regex": "^3.0.0" }, - "bin": { - "mkdirp": "bin/cmd.js" + "engines": { + "node": ">=8" } }, - "node_modules/eslint/node_modules/regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", - "dev": true, + "node_modules/eslint/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "engines": { - "node": ">=6.5.0" + "node": ">=8" } }, - "node_modules/eslint/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, + "node_modules/eslint/node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, "bin": { - "semver": "bin/semver.js" + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" } }, "node_modules/espree": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", - "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", - "dev": true, + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "dependencies": { - "acorn": "^7.1.1", - "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" }, "engines": { - "node": ">=6.0.0" + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "engines": { + "node": ">=4" } }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -2455,7 +2797,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, "dependencies": { "estraverse": "^5.1.0" }, @@ -2467,7 +2808,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, "engines": { "node": ">=4.0" } @@ -2476,7 +2816,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -2488,7 +2827,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, "engines": { "node": ">=4.0" } @@ -2497,7 +2835,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, "engines": { "node": ">=4.0" } @@ -2506,7 +2843,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -2692,32 +3028,6 @@ "node": ">=0.10.0" } }, - "node_modules/external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dev": true, - "dependencies": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/external-editor/node_modules/tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", @@ -2773,20 +3083,55 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-glob": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fast-glob/node_modules/micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "dependencies": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + }, + "engines": { + "node": ">=8.6" + } }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + }, + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } }, "node_modules/fd-slicer": { "version": "1.1.0", @@ -2803,31 +3148,15 @@ "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", "dev": true }, - "node_modules/figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^1.0.5" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", - "dev": true, + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dependencies": { - "flat-cache": "^2.0.1" + "flat-cache": "^3.0.4" }, "engines": { - "node": ">=4" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/file-uri-to-path": { @@ -2948,7 +3277,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, "dependencies": { "locate-path": "^2.0.0" }, @@ -2982,24 +3310,35 @@ } }, "node_modules/flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", - "dev": true, + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dependencies": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" + "flatted": "^3.1.0", + "rimraf": "^3.0.2" }, "engines": { - "node": ">=4" + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flat-cache/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", - "dev": true + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz", + "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==" }, "node_modules/flush-write-stream": { "version": "1.1.1", @@ -3122,14 +3461,12 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "node_modules/functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, "node_modules/get-caller-file": { "version": "2.0.5", @@ -3144,7 +3481,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -3186,7 +3522,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -3221,12 +3556,11 @@ } }, "node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.11.0.tgz", + "integrity": "sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g==", "dependencies": { - "type-fest": "^0.8.1" + "type-fest": "^0.20.2" }, "engines": { "node": ">=8" @@ -3235,11 +3569,39 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globby": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby/node_modules/ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/graceful-fs": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", - "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", - "dev": true + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==" }, "node_modules/growl": { "version": "1.10.5", @@ -3255,7 +3617,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -3267,7 +3628,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3276,7 +3636,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, "engines": { "node": ">=4" } @@ -3285,7 +3644,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -3297,7 +3655,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -3445,8 +3802,7 @@ "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" }, "node_modules/htmlparser2": { "version": "6.1.0", @@ -3511,18 +3867,6 @@ "node": ">= 6.0.0" } }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -3553,7 +3897,6 @@ "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, "engines": { "node": ">= 4" } @@ -3562,7 +3905,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -3667,7 +4009,6 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, "engines": { "node": ">=0.8.19" } @@ -3684,140 +4025,24 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dependencies": { "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, - "node_modules/inquirer": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", - "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", - "dev": true, - "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.19", - "mute-stream": "0.0.8", - "run-async": "^2.4.0", - "rxjs": "^6.6.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/inquirer/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/inquirer/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/inquirer/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/inquirer/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/inquirer/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/inquirer/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/inquirer/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/inquirer/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "wrappy": "1" } }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, "node_modules/internal-slot": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", - "dev": true, "dependencies": { "get-intrinsic": "^1.1.0", "has": "^1.0.3", @@ -3851,14 +4076,12 @@ "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, "dependencies": { "has-bigints": "^1.0.1" }, @@ -3882,7 +4105,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -3904,7 +4126,6 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -3916,7 +4137,6 @@ "version": "2.6.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz", "integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==", - "dev": true, "dependencies": { "has": "^1.0.3" }, @@ -3940,7 +4160,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -3981,7 +4200,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -3990,7 +4208,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "engines": { "node": ">=8" } @@ -3999,7 +4216,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -4011,7 +4227,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -4032,7 +4247,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", - "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -4069,7 +4283,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -4085,7 +4298,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -4100,7 +4312,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -4151,8 +4362,7 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "node_modules/isobject": { "version": "3.0.1", @@ -4166,14 +4376,12 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -4185,8 +4393,7 @@ "node_modules/json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" }, "node_modules/json-schema": { "version": "0.2.5", @@ -4197,14 +4404,12 @@ "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" }, "node_modules/json5": { "version": "2.2.0", @@ -4239,13 +4444,12 @@ } }, "node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" }, "engines": { "node": ">= 0.8.0" @@ -4270,7 +4474,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, "dependencies": { "graceful-fs": "^4.1.2", "parse-json": "^4.0.0", @@ -4320,7 +4523,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, "dependencies": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" @@ -4335,12 +4537,27 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, "node_modules/lodash.throttle": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=", "dev": true }, + "node_modules/lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=" + }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -4438,7 +4655,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -4561,6 +4777,15 @@ "node": ">=4.3.0 <5.0.0 || >=5.10" } }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -4722,15 +4947,6 @@ "node": ">=4" } }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -5201,8 +5417,7 @@ "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" }, "node_modules/neo-async": { "version": "2.6.2", @@ -5257,7 +5472,6 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, "dependencies": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -5269,7 +5483,6 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, "bin": { "semver": "bin/semver" } @@ -5393,7 +5606,6 @@ "version": "1.11.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5402,7 +5614,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, "engines": { "node": ">= 0.4" } @@ -5423,7 +5634,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "dev": true, "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3", @@ -5453,7 +5663,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.4.tgz", "integrity": "sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", @@ -5474,33 +5683,17 @@ "wrappy": "1" } }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" }, "engines": { "node": ">= 0.8.0" @@ -5544,7 +5737,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, "dependencies": { "p-try": "^1.0.0" }, @@ -5556,7 +5748,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, "dependencies": { "p-limit": "^1.1.0" }, @@ -5568,7 +5759,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true, "engines": { "node": ">=4" } @@ -5593,7 +5783,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, "dependencies": { "callsites": "^3.0.0" }, @@ -5618,7 +5807,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, "dependencies": { "error-ex": "^1.3.1", "json-parse-better-errors": "^1.0.1" @@ -5695,7 +5883,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, "engines": { "node": ">=4" } @@ -5720,14 +5907,12 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-type": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, "dependencies": { "pify": "^3.0.0" }, @@ -5773,7 +5958,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true, "engines": { "node": ">=4" } @@ -5782,7 +5966,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, "dependencies": { "find-up": "^2.1.0" }, @@ -5794,7 +5977,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", - "dev": true, "dependencies": { "find-up": "^2.1.0" }, @@ -5812,10 +5994,9 @@ } }, "node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true, + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "engines": { "node": ">= 0.8.0" } @@ -5839,7 +6020,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, "engines": { "node": ">=0.4.0" } @@ -5911,7 +6091,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, "engines": { "node": ">=6" } @@ -5950,6 +6129,26 @@ "node": ">=0.4.x" } }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -5985,7 +6184,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, "dependencies": { "load-json-file": "^4.0.0", "normalize-package-data": "^2.3.2", @@ -5999,7 +6197,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, "dependencies": { "find-up": "^2.0.0", "read-pkg": "^3.0.0" @@ -6058,7 +6255,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, "engines": { "node": ">=8" }, @@ -6100,6 +6296,14 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -6110,7 +6314,6 @@ "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, "dependencies": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" @@ -6187,7 +6390,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, "engines": { "node": ">=4" } @@ -6199,19 +6401,6 @@ "deprecated": "https://github.com/lydell/resolve-url#deprecated", "dev": true }, - "node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -6221,6 +6410,16 @@ "node": ">=0.12" } }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, "node_modules/rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", @@ -6242,13 +6441,27 @@ "inherits": "^2.0.1" } }, - "node_modules/run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, - "engines": { - "node": ">=0.12.0" + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" } }, "node_modules/run-queue": { @@ -6265,18 +6478,6 @@ "resolved": "https://registry.npmjs.org/rusha/-/rusha-0.8.14.tgz", "integrity": "sha512-cLgakCUf6PedEu15t8kbsjnwIFFR2D4RfL+W3iWFJ4iac7z4B0ZI8fxy4R3J956kAI68HclCFGL8MPoUVC3qVA==" }, - "node_modules/rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "dev": true, - "dependencies": { - "tslib": "^1.9.0" - }, - "engines": { - "npm": ">=2.0.0" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -6330,7 +6531,6 @@ "version": "7.3.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -6437,7 +6637,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -6447,35 +6646,61 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } }, "node_modules/slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", - "dev": true, + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dependencies": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, + "node_modules/slice-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, "node_modules/snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -6721,7 +6946,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -6730,14 +6954,12 @@ "node_modules/spdx-exceptions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" }, "node_modules/spdx-expression-parse": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -6746,8 +6968,7 @@ "node_modules/spdx-license-ids": { "version": "3.0.10", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz", - "integrity": "sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA==", - "dev": true + "integrity": "sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA==" }, "node_modules/split-string": { "version": "3.1.0", @@ -6764,8 +6985,7 @@ "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "node_modules/ssri": { "version": "6.0.2", @@ -6930,7 +7150,6 @@ "version": "4.2.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -6944,7 +7163,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true, "engines": { "node": ">=8" } @@ -6953,7 +7171,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.0" }, @@ -6965,7 +7182,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" @@ -6978,7 +7194,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" @@ -7003,7 +7218,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true, "engines": { "node": ">=4" } @@ -7012,7 +7226,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, "engines": { "node": ">=8" }, @@ -7024,7 +7237,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -7033,47 +7245,58 @@ } }, "node_modules/table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", - "dev": true, - "dependencies": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", + "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==", + "dependencies": { + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=6.0.0" + "node": ">=10.0.0" } }, - "node_modules/table/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true + "node_modules/table/node_modules/ajv": { + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", + "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } }, - "node_modules/table/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, + "node_modules/table/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/table/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, + "node_modules/table/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/table/node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "ansi-regex": "^5.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/tapable": { @@ -7161,14 +7384,7 @@ "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" }, "node_modules/through2": { "version": "2.0.5", @@ -7298,7 +7514,6 @@ "version": "3.10.1", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.10.1.tgz", "integrity": "sha512-rETidPDgCpltxF7MjBZlAFPUHv5aHH2MymyPvh+vEyWAED4Eb/WeMbsnD/JDr4OKPOA1TssDHgIcpTN5Kh0p6Q==", - "dev": true, "dependencies": { "json5": "^2.2.0", "minimist": "^1.2.0", @@ -7327,24 +7542,25 @@ } }, "node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dependencies": { - "prelude-ls": "~1.1.2" + "prelude-ls": "^1.2.1" }, "engines": { "node": ">= 0.8.0" } }, "node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/typed-rest-client": { @@ -7388,7 +7604,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", - "dev": true, "dependencies": { "function-bind": "^1.1.1", "has-bigints": "^1.0.1", @@ -7536,7 +7751,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, "dependencies": { "punycode": "^2.1.0" } @@ -7603,14 +7817,12 @@ "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==" }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -8338,7 +8550,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -8417,7 +8628,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -8520,30 +8730,6 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, - "node_modules/write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "dependencies": { - "mkdirp": "^0.5.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/write/node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, "node_modules/xml": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", @@ -8568,8 +8754,7 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yargs": { "version": "16.2.0", @@ -8676,31 +8861,85 @@ "requires": {} }, "@babel/code-frame": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", - "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", - "dev": true, + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", "requires": { - "@babel/highlight": "^7.14.5" + "@babel/highlight": "^7.10.4" } }, "@babel/helper-validator-identifier": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", - "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==", - "dev": true + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", + "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==" }, "@babel/highlight": { "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", - "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.14.5", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, + "@eslint/eslintrc": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + } + }, + "@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", + "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==" + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, "@orcid/bibtex-parse-js": { "version": "0.0.25", "resolved": "https://registry.npmjs.org/@orcid/bibtex-parse-js/-/bibtex-parse-js-0.0.25.tgz", @@ -8712,12 +8951,6 @@ "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", "dev": true }, - "@types/eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", - "dev": true - }, "@types/highlight.js": { "version": "9.1.10", "resolved": "https://registry.npmjs.org/@types/highlight.js/-/highlight.js-9.1.10.tgz", @@ -8763,15 +8996,18 @@ "integrity": "sha512-Zg38rusx2nU6gy6QdF7v4iqgxNfxzlBlDhrRCjOiPQp+sfaNrp3f9J6OHIhpGNN1oOAca4+9Hq0+8u3jwzPMlQ==" }, "@typescript-eslint/eslint-plugin": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.34.0.tgz", - "integrity": "sha512-4zY3Z88rEE99+CNvTbXSyovv2z9PNOVffTWD2W8QF5s2prBQtwN2zadqERcrHpcR7O/+KMI3fcTAmUUhK/iQcQ==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.1.tgz", + "integrity": "sha512-UDqhWmd5i0TvPLmbK5xY3UZB0zEGseF+DHPghZ37Sb83Qd3p8ujhvAtkU4OF46Ka5Pm5kWvFIx0cCTBFKo0alA==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "2.34.0", + "@typescript-eslint/experimental-utils": "4.31.1", + "@typescript-eslint/scope-manager": "4.31.1", + "debug": "^4.3.1", "functional-red-black-tree": "^1.0.1", - "regexpp": "^3.0.0", - "tsutils": "^3.17.1" + "regexpp": "^3.1.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "dependencies": { "tsutils": { @@ -8786,42 +9022,60 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz", - "integrity": "sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.1.tgz", + "integrity": "sha512-NtoPsqmcSsWty0mcL5nTZXMf7Ei0Xr2MT8jWjXMVgRK0/1qeQ2jZzLFUh4QtyJ4+/lPUyMw5cSfeeME+Zrtp9Q==", "dev": true, "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.34.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" + "@types/json-schema": "^7.0.7", + "@typescript-eslint/scope-manager": "4.31.1", + "@typescript-eslint/types": "4.31.1", + "@typescript-eslint/typescript-estree": "4.31.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" } }, "@typescript-eslint/parser": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.34.0.tgz", - "integrity": "sha512-03ilO0ucSD0EPTw2X4PntSIRFtDPWjrVq7C3/Z3VQHRC7+13YB55rcJI3Jt+YgeHbjUdJPcPa7b23rXCBokuyA==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.1.tgz", + "integrity": "sha512-dnVZDB6FhpIby6yVbHkwTKkn2ypjVIfAR9nh+kYsA/ZL0JlTsd22BiDjouotisY3Irmd3OW1qlk9EI5R8GrvRQ==", "dev": true, "requires": { - "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.34.0", - "@typescript-eslint/typescript-estree": "2.34.0", - "eslint-visitor-keys": "^1.1.0" + "@typescript-eslint/scope-manager": "4.31.1", + "@typescript-eslint/types": "4.31.1", + "@typescript-eslint/typescript-estree": "4.31.1", + "debug": "^4.3.1" + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.1.tgz", + "integrity": "sha512-N1Uhn6SqNtU2XpFSkD4oA+F0PfKdWHyr4bTX0xTj8NRx1314gBDRL1LUuZd5+L3oP+wo6hCbZpaa1in6SwMcVQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.31.1", + "@typescript-eslint/visitor-keys": "4.31.1" } }, + "@typescript-eslint/types": { + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.1.tgz", + "integrity": "sha512-kixltt51ZJGKENNW88IY5MYqTBA8FR0Md8QdGbJD2pKZ+D5IvxjTYDNtJPDxFBiXmka2aJsITdB1BtO1fsgmsQ==", + "dev": true + }, "@typescript-eslint/typescript-estree": { - "version": "2.34.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz", - "integrity": "sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.1.tgz", + "integrity": "sha512-EGHkbsUvjFrvRnusk6yFGqrqMBTue5E5ROnS5puj3laGQPasVUgwhrxfcgkdHNFECHAewpvELE1Gjv0XO3mdWg==", "dev": true, "requires": { - "debug": "^4.1.1", - "eslint-visitor-keys": "^1.1.0", - "glob": "^7.1.6", + "@typescript-eslint/types": "4.31.1", + "@typescript-eslint/visitor-keys": "4.31.1", + "debug": "^4.3.1", + "globby": "^11.0.3", "is-glob": "^4.0.1", - "lodash": "^4.17.15", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "dependencies": { "tsutils": { @@ -8835,6 +9089,16 @@ } } }, + "@typescript-eslint/visitor-keys": { + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.1.tgz", + "integrity": "sha512-PCncP8hEqKw6SOJY+3St4LVtoZpPPn+Zlpm7KW5xnviMhdqcsBty4Lsg4J/VECpJjw1CkROaZhH4B8M1OfnXTQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.31.1", + "eslint-visitor-keys": "^2.0.0" + } + }, "@ungap/promise-all-settled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", @@ -9032,14 +9296,12 @@ "acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==" }, "acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, "requires": {} }, "agent-base": { @@ -9051,7 +9313,6 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -9076,26 +9337,7 @@ "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "peer": true - }, - "ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, - "requires": { - "type-fest": "^0.21.3" - }, - "dependencies": { - "type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true - } - } + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" }, "ansi-regex": { "version": "4.1.0", @@ -9107,7 +9349,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "requires": { "color-convert": "^1.9.0" } @@ -9132,7 +9373,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "requires": { "sprintf-js": "~1.0.2" } @@ -9159,7 +9399,6 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==", - "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", @@ -9168,6 +9407,12 @@ "is-string": "^1.0.5" } }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", @@ -9178,7 +9423,6 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz", "integrity": "sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg==", - "dev": true, "requires": { "call-bind": "^1.0.0", "define-properties": "^1.1.3", @@ -9282,10 +9526,9 @@ "dev": true }, "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==" }, "async-each": { "version": "1.0.3", @@ -9651,7 +9894,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, "requires": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -9660,8 +9902,7 @@ "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" }, "camelcase": { "version": "6.2.0", @@ -9683,19 +9924,12 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, "charenc": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", @@ -9856,21 +10090,6 @@ } } }, - "cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "requires": { - "restore-cursor": "^3.1.0" - } - }, - "cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", - "dev": true - }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -9916,7 +10135,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "requires": { "color-name": "1.1.3" } @@ -9924,8 +10142,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "commander": { "version": "6.2.1", @@ -10149,16 +10366,14 @@ "dev": true }, "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, "requires": { "object-keys": "^1.0.12" } @@ -10221,11 +10436,27 @@ } } }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + }, + "dependencies": { + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + } + } + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, "requires": { "esutils": "^2.0.2" } @@ -10320,8 +10551,7 @@ "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "emojis-list": { "version": "3.0.0", @@ -10349,6 +10579,14 @@ "tapable": "^1.0.0" } }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "requires": { + "ansi-colors": "^4.1.1" + } + }, "entities": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", @@ -10368,7 +10606,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, "requires": { "is-arrayish": "^0.2.1" } @@ -10377,7 +10614,6 @@ "version": "1.18.5", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.5.tgz", "integrity": "sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA==", - "dev": true, "requires": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", @@ -10402,7 +10638,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, "requires": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -10419,91 +10654,179 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", - "dev": true, + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", "requires": { - "@babel/code-frame": "^7.0.0", + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", "ajv": "^6.10.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.3", - "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.2", - "esquery": "^1.0.1", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^7.0.0", "is-glob": "^4.0.0", "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.14", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.3", + "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", - "table": "^5.2.3", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + }, "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", - "dev": true, + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "requires": { "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" + } } }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "requires": { - "minimist": "^1.2.5" + "shebang-regex": "^3.0.0" } }, - "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", - "dev": true + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } } } }, + "eslint-config-standard": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-16.0.3.tgz", + "integrity": "sha512-x4fmJL5hGqNJKGHSjnLdgA6U6h1YW/G2dW9fA+cyVur4SK6lyue8+UgNKWlZtUDTXvgKDD/Oa3GQjmB5kjtVvg==", + "requires": {} + }, "eslint-import-resolver-node": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", - "dev": true, "requires": { "debug": "^3.2.7", "resolve": "^1.20.0" @@ -10513,7 +10836,6 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, "requires": { "ms": "^2.1.1" } @@ -10524,20 +10846,42 @@ "version": "2.6.2", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.2.tgz", "integrity": "sha512-QG8pcgThYOuqxupd06oYTZoNOGaUdTY1PqK+oS6ElF6vs4pBdk/aYxFVQQXzcrAqp9m7cl7lb2ubazX+g16k2Q==", - "dev": true, "requires": { "debug": "^3.2.7", "pkg-dir": "^2.0.0" }, "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "eslint-plugin-es": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", + "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", + "requires": { + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "requires": { - "ms": "^2.1.1" + "eslint-visitor-keys": "^1.1.0" } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" } } }, @@ -10545,7 +10889,6 @@ "version": "2.24.1", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.24.1.tgz", "integrity": "sha512-KSFWhNxPH8OGJwpRJJs+Z7I0a13E2iFQZJIvSnCu6KUs4qmgAm3xN9GYBCSoiGWmwA7gERZPXqYQjcoCROnYhQ==", - "dev": true, "requires": { "array-includes": "^3.1.3", "array.prototype.flat": "^1.2.4", @@ -10568,7 +10911,6 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, "requires": { "ms": "2.0.0" } @@ -10577,7 +10919,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, "requires": { "esutils": "^2.0.2" } @@ -10585,58 +10926,103 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "eslint-plugin-node": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", + "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", + "requires": { + "eslint-plugin-es": "^3.0.0", + "eslint-utils": "^2.0.0", + "ignore": "^5.1.1", + "minimatch": "^3.0.4", + "resolve": "^1.10.1", + "semver": "^6.1.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" } } }, + "eslint-plugin-promise": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-5.1.0.tgz", + "integrity": "sha512-NGmI6BH5L12pl7ScQHbg7tvtk4wPxxj8yPHH47NvSmMtFneC077PSeY3huFj06ZWZvtbfxSPt3RuOQD5XcR4ng==", + "requires": {} + }, "eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, "requires": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } }, "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "requires": { - "eslint-visitor-keys": "^1.1.0" + "eslint-visitor-keys": "^2.0.0" } }, "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==" }, "espree": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", - "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", - "dev": true, + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "requires": { - "acorn": "^7.1.1", - "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==" + } } }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "esquery": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, "requires": { "estraverse": "^5.1.0" }, @@ -10644,8 +11030,7 @@ "estraverse": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" } } }, @@ -10653,7 +11038,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, "requires": { "estraverse": "^5.2.0" }, @@ -10661,22 +11045,19 @@ "estraverse": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" } } }, "estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" }, "events": { "version": "3.3.0", @@ -10826,28 +11207,6 @@ "is-extendable": "^1.0.1" } }, - "external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dev": true, - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "dependencies": { - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - } - } - }, "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", @@ -10893,20 +11252,51 @@ "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fast-glob": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "dependencies": { + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + } + } }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } }, "fd-slicer": { "version": "1.1.0", @@ -10923,22 +11313,12 @@ "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", "dev": true }, - "figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, "file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", - "dev": true, + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "requires": { - "flat-cache": "^2.0.1" + "flat-cache": "^3.0.4" } }, "file-uri-to-path": { @@ -11031,7 +11411,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, "requires": { "locate-path": "^2.0.0" } @@ -11056,21 +11435,28 @@ "peer": true }, "flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", - "dev": true, + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "requires": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "requires": { + "glob": "^7.1.3" + } + } } }, "flatted": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", - "dev": true + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz", + "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==" }, "flush-write-stream": { "version": "1.1.1", @@ -11162,14 +11548,12 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" }, "get-caller-file": { "version": "2.0.5", @@ -11181,7 +11565,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -11211,7 +11594,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "requires": { "is-glob": "^4.0.1" } @@ -11237,19 +11619,39 @@ } }, "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.11.0.tgz", + "integrity": "sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g==", + "requires": { + "type-fest": "^0.20.2" + } + }, + "globby": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", "dev": true, "requires": { - "type-fest": "^0.8.1" + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, + "dependencies": { + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + } } }, "graceful-fs": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", - "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", - "dev": true + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==" }, "growl": { "version": "1.10.5", @@ -11262,7 +11664,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -11270,26 +11671,22 @@ "has-bigints": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", - "dev": true + "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==" }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "has-symbols": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", - "dev": true + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==" }, "has-tostringtag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, "requires": { "has-symbols": "^1.0.2" } @@ -11410,8 +11807,7 @@ "hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" }, "htmlparser2": { "version": "6.1.0", @@ -11462,15 +11858,6 @@ "debug": "4" } }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -11486,14 +11873,12 @@ "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" }, "import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -11551,142 +11936,53 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - } - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, - "inquirer": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", - "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", - "dev": true, - "requires": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.19", - "mute-stream": "0.0.8", - "run-async": "^2.4.0", - "rxjs": "^6.6.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "find-up": "^3.0.0" } } } }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, "internal-slot": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", - "dev": true, "requires": { "get-intrinsic": "^1.1.0", "has": "^1.0.3", @@ -11711,14 +12007,12 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, "is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, "requires": { "has-bigints": "^1.0.1" } @@ -11736,7 +12030,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -11751,14 +12044,12 @@ "is-callable": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", - "dev": true + "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==" }, "is-core-module": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz", "integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==", - "dev": true, "requires": { "has": "^1.0.3" } @@ -11776,7 +12067,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, "requires": { "has-tostringtag": "^1.0.0" } @@ -11804,20 +12094,17 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, "is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -11825,8 +12112,7 @@ "is-negative-zero": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", - "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", - "dev": true + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==" }, "is-number": { "version": "7.0.0", @@ -11838,7 +12124,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", - "dev": true, "requires": { "has-tostringtag": "^1.0.0" } @@ -11863,7 +12148,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -11873,7 +12157,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, "requires": { "has-tostringtag": "^1.0.0" } @@ -11882,7 +12165,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, "requires": { "has-symbols": "^1.0.2" } @@ -11915,8 +12197,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { "version": "3.0.1", @@ -11927,14 +12208,12 @@ "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -11943,8 +12222,7 @@ "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" }, "json-schema": { "version": "0.2.5", @@ -11955,14 +12233,12 @@ "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" }, "json5": { "version": "2.2.0", @@ -11985,13 +12261,12 @@ "dev": true }, "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" } }, "linkify-it": { @@ -12013,7 +12288,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, "requires": { "graceful-fs": "^4.1.2", "parse-json": "^4.0.0", @@ -12053,7 +12327,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, "requires": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" @@ -12065,12 +12338,27 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, "lodash.throttle": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=", "dev": true }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=" + }, "log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -12143,7 +12431,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "requires": { "yallist": "^4.0.0" } @@ -12246,6 +12533,12 @@ "readable-stream": "^2.0.1" } }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -12381,12 +12674,6 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -12747,8 +13034,7 @@ "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" }, "neo-async": { "version": "2.6.2", @@ -12805,7 +13091,6 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, "requires": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -12816,8 +13101,7 @@ "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" } } }, @@ -12913,14 +13197,12 @@ "object-inspect": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", - "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", - "dev": true + "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==" }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" }, "object-visit": { "version": "1.0.1", @@ -12935,7 +13217,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "dev": true, "requires": { "call-bind": "^1.0.0", "define-properties": "^1.1.3", @@ -12956,7 +13237,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.4.tgz", "integrity": "sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg==", - "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", @@ -12971,27 +13251,17 @@ "wrappy": "1" } }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" } }, "os-browserify": { @@ -13026,7 +13296,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, "requires": { "p-try": "^1.0.0" } @@ -13035,7 +13304,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, "requires": { "p-limit": "^1.1.0" } @@ -13043,8 +13311,7 @@ "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" }, "pako": { "version": "2.0.4", @@ -13066,7 +13333,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, "requires": { "callsites": "^3.0.0" } @@ -13088,7 +13354,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, "requires": { "error-ex": "^1.3.1", "json-parse-better-errors": "^1.0.1" @@ -13154,8 +13419,7 @@ "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" }, "path-is-absolute": { "version": "1.0.1", @@ -13171,14 +13435,12 @@ "path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "path-type": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, "requires": { "pify": "^3.0.0" } @@ -13211,14 +13473,12 @@ "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" }, "pkg-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, "requires": { "find-up": "^2.1.0" } @@ -13227,7 +13487,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", - "dev": true, "requires": { "find-up": "^2.1.0" } @@ -13239,10 +13498,9 @@ "dev": true }, "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" }, "process": { "version": "0.11.10", @@ -13259,8 +13517,7 @@ "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" }, "promise-inflight": { "version": "1.0.1", @@ -13332,8 +13589,7 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, "qs": { "version": "6.10.1", @@ -13356,6 +13612,12 @@ "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", "dev": true }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -13388,7 +13650,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, "requires": { "load-json-file": "^4.0.0", "normalize-package-data": "^2.3.2", @@ -13399,7 +13660,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, "requires": { "find-up": "^2.0.0", "read-pkg": "^3.0.0" @@ -13450,8 +13710,7 @@ "regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==" }, "remove-trailing-separator": { "version": "1.1.0", @@ -13478,6 +13737,11 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -13488,7 +13752,6 @@ "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, "requires": { "is-core-module": "^2.2.0", "path-parse": "^1.0.6" @@ -13550,8 +13813,7 @@ "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" }, "resolve-url": { "version": "0.2.1", @@ -13559,22 +13821,18 @@ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, - "restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "requires": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", @@ -13593,11 +13851,14 @@ "inherits": "^2.0.1" } }, - "run-async": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", - "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", - "dev": true + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } }, "run-queue": { "version": "1.0.3", @@ -13613,15 +13874,6 @@ "resolved": "https://registry.npmjs.org/rusha/-/rusha-0.8.14.tgz", "integrity": "sha512-cLgakCUf6PedEu15t8kbsjnwIFFR2D4RfL+W3iWFJ4iac7z4B0ZI8fxy4R3J956kAI68HclCFGL8MPoUVC3qVA==" }, - "rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -13658,7 +13910,6 @@ "version": "7.3.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, "requires": { "lru-cache": "^6.0.0" } @@ -13743,35 +13994,48 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, "requires": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", "object-inspect": "^1.9.0" } }, - "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", - "dev": true, + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" }, "dependencies": { - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" } } }, @@ -13984,7 +14248,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -13993,14 +14256,12 @@ "spdx-exceptions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" }, "spdx-expression-parse": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, "requires": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -14009,8 +14270,7 @@ "spdx-license-ids": { "version": "3.0.10", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz", - "integrity": "sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA==", - "dev": true + "integrity": "sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA==" }, "split-string": { "version": "3.1.0", @@ -14024,8 +14284,7 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "ssri": { "version": "6.0.2", @@ -14174,7 +14433,6 @@ "version": "4.2.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -14184,14 +14442,12 @@ "ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" }, "strip-ansi": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, "requires": { "ansi-regex": "^5.0.0" } @@ -14202,7 +14458,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", - "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" @@ -14212,7 +14467,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", - "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" @@ -14230,57 +14484,61 @@ "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "requires": { "has-flag": "^3.0.0" } }, "table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", - "dev": true, - "requires": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", + "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==", + "requires": { + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" }, "dependencies": { - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true + "ajv": { + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", + "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "ansi-regex": "^5.0.0" } } } @@ -14353,14 +14611,7 @@ "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" }, "through2": { "version": "2.0.5", @@ -14467,7 +14718,6 @@ "version": "3.10.1", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.10.1.tgz", "integrity": "sha512-rETidPDgCpltxF7MjBZlAFPUHv5aHH2MymyPvh+vEyWAED4Eb/WeMbsnD/JDr4OKPOA1TssDHgIcpTN5Kh0p6Q==", - "dev": true, "requires": { "json5": "^2.2.0", "minimist": "^1.2.0", @@ -14493,19 +14743,17 @@ "dev": true }, "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "requires": { - "prelude-ls": "~1.1.2" + "prelude-ls": "^1.2.1" } }, "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" }, "typed-rest-client": { "version": "1.8.5", @@ -14540,7 +14788,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", - "dev": true, "requires": { "function-bind": "^1.1.1", "has-bigints": "^1.0.1", @@ -14666,7 +14913,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, "requires": { "punycode": "^2.1.0" } @@ -14733,14 +14979,12 @@ "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==" }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, "requires": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -15321,7 +15565,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, "requires": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -15386,8 +15629,7 @@ "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" }, "worker-farm": { "version": "1.7.0", @@ -15468,26 +15710,6 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, - "write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - }, - "dependencies": { - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - } - } - }, "xml": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", @@ -15509,8 +15731,7 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "yargs": { "version": "16.2.0", diff --git a/package.json b/package.json index d89c0f60..810153b2 100644 --- a/package.json +++ b/package.json @@ -462,8 +462,8 @@ "deploy": "vsce publish -p", "prune-branches": "git remote prune origin", "clean": "git clean -fdX", - "lint": "eslint src/**/*.ts src-preview/**/*.ts test/**/*.ts --format unix", - "lint:fix": "eslint --fix src/**/*.ts src-preview/**/*.ts test/**/*.ts --format unix", + "lint": "eslint 'src/**/*.ts' 'src-preview/**/*.ts' --format unix ", + "lint:fix": "eslint --fix 'src/**/*.ts' 'src-preview/**/*.ts' --format unix", "test": "node ./node_modules/vscode/bin/test" }, "devDependencies": { @@ -471,16 +471,18 @@ "@types/lodash.throttle": "^4.1.3", "@types/mocha": "^5.2.5", "@types/node": "^8.10.25", - "@typescript-eslint/eslint-plugin": "^2.32.0", - "@typescript-eslint/parser": "^2.32.0", - "eslint": "^6.8.0", + "@typescript-eslint/eslint-plugin": "^4.31.1", + "@typescript-eslint/parser": "^4.31.1", + "eslint": "^7.32.0", "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.0", "json-schema": "^0.2.5", "lodash.throttle": "^4.1.1", "mocha-junit-reporter": "^1.23.3", "mocha-multi-reporters": "^1.1.7", "ts-loader": "^4.0.1", - "typescript": "^3.9.5", + "typescript": "^3.9.10", "vsce": "^1.77.0", "vscode-test": "^1.4.0", "webpack": "^4.41.5", @@ -492,6 +494,7 @@ "@orcid/bibtex-parse-js": "^0.0.25", "@types/vscode": "^1.31.0", "asciidoctor-kroki": "^0.13.0", + "eslint-config-standard": "^16.0.3", "file-url": "^3.0.0", "follow-redirects": "^1.10.0", "https-proxy-agent": "^4.0.0", diff --git a/src-preview/activeLineMarker.ts b/src-preview/activeLineMarker.ts index 70876d10..00502c60 100644 --- a/src-preview/activeLineMarker.ts +++ b/src-preview/activeLineMarker.ts @@ -1,33 +1,33 @@ /*--------------------------------------------------------------------------------------------- * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getElementsForSourceLine } from './scroll-sync'; +import { getElementsForSourceLine } from './scroll-sync' export class ActiveLineMarker { - private _current: any; + private _current: any; - onDidChangeTextEditorSelection(line: number) { - const { previous } = getElementsForSourceLine(line); - this._update(previous && previous.element); - } + onDidChangeTextEditorSelection (line: number) { + const { previous } = getElementsForSourceLine(line) + this._update(previous && previous.element) + } - _update(before: HTMLElement | undefined) { - this._unmarkActiveElement(this._current); - this._markActiveElement(before); - this._current = before; - } + _update (before: HTMLElement | undefined) { + this._unmarkActiveElement(this._current) + this._markActiveElement(before) + this._current = before + } - _unmarkActiveElement(element: HTMLElement | undefined) { - if (!element) { - return; - } - element.className = element.className.replace(/\bcode-active-line\b/g, ''); - } + _unmarkActiveElement (element: HTMLElement | undefined) { + if (!element) { + return + } + element.className = element.className.replace(/\bcode-active-line\b/g, '') + } - _markActiveElement(element: HTMLElement | undefined) { - if (!element) { - return; - } - element.className += ' code-active-line'; - } -} \ No newline at end of file + _markActiveElement (element: HTMLElement | undefined) { + if (!element) { + return + } + element.className += ' code-active-line' + } +} diff --git a/src-preview/csp.ts b/src-preview/csp.ts index 9332b2cd..86eaf487 100644 --- a/src-preview/csp.ts +++ b/src-preview/csp.ts @@ -2,62 +2,62 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { MessagePoster } from './messaging'; -import { getSettings } from './settings'; -import { getStrings } from './strings'; +import { MessagePoster } from './messaging' +import { getSettings } from './settings' +import { getStrings } from './strings' /** * Shows an alert when there is a content security policy violation. */ export class CspAlerter { - private didShow = false; - private didHaveCspWarning = false; - - private messaging?: MessagePoster; - - constructor() { - document.addEventListener('securitypolicyviolation', () => { - this.onCspWarning(); - }); - - window.addEventListener('message', (event) => { - if (event && event.data && event.data.name === 'vscode-did-block-svg') { - this.onCspWarning(); - } - }); - } - - public setPoster(poster: MessagePoster) { - this.messaging = poster; - if (this.didHaveCspWarning) { - this.showCspWarning(); - } - } - - private onCspWarning() { - this.didHaveCspWarning = true; - this.showCspWarning(); - } - - private showCspWarning() { - const strings = getStrings(); - const settings = getSettings(); - - if (this.didShow || settings.disableSecurityWarnings || !this.messaging) { - return; - } - this.didShow = true; - - const notification = document.createElement('a'); - notification.innerText = strings.cspAlertMessageText; - notification.setAttribute('id', 'code-csp-warning'); - notification.setAttribute('title', strings.cspAlertMessageTitle); - - notification.setAttribute('role', 'button'); - notification.setAttribute('aria-label', strings.cspAlertMessageLabel); - notification.onclick = () => { - this.messaging!.postMessage('showPreviewSecuritySelector', { source: settings.source }); - }; - document.body.appendChild(notification); - } + private didShow = false; + private didHaveCspWarning = false; + + private messaging?: MessagePoster; + + constructor () { + document.addEventListener('securitypolicyviolation', () => { + this.onCspWarning() + }) + + window.addEventListener('message', (event) => { + if (event && event.data && event.data.name === 'vscode-did-block-svg') { + this.onCspWarning() + } + }) + } + + public setPoster (poster: MessagePoster) { + this.messaging = poster + if (this.didHaveCspWarning) { + this.showCspWarning() + } + } + + private onCspWarning () { + this.didHaveCspWarning = true + this.showCspWarning() + } + + private showCspWarning () { + const strings = getStrings() + const settings = getSettings() + + if (this.didShow || settings.disableSecurityWarnings || !this.messaging) { + return + } + this.didShow = true + + const notification = document.createElement('a') + notification.innerText = strings.cspAlertMessageText + notification.setAttribute('id', 'code-csp-warning') + notification.setAttribute('title', strings.cspAlertMessageTitle) + + notification.setAttribute('role', 'button') + notification.setAttribute('aria-label', strings.cspAlertMessageLabel) + notification.onclick = () => { + this.messaging!.postMessage('showPreviewSecuritySelector', { source: settings.source }) + } + document.body.appendChild(notification) + } } diff --git a/src-preview/events.ts b/src-preview/events.ts index 30b32531..53d64576 100644 --- a/src-preview/events.ts +++ b/src-preview/events.ts @@ -2,12 +2,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -export function onceDocumentLoaded(f: () => void) { +export function onceDocumentLoaded (f: () => void) { // @ts-ignore TS2367 if (document.readyState === 'loading' || document.readyState === 'uninitialized') { - document.addEventListener('DOMContentLoaded', f); + document.addEventListener('DOMContentLoaded', f) } else { - f(); + f() } -} \ No newline at end of file +} diff --git a/src-preview/index.ts b/src-preview/index.ts index fc013128..643926e1 100644 --- a/src-preview/index.ts +++ b/src-preview/index.ts @@ -2,157 +2,157 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ActiveLineMarker } from './activeLineMarker'; -import { onceDocumentLoaded } from './events'; -import { createPosterForVsCode } from './messaging'; -import { getEditorLineNumberForPageOffset, scrollToRevealSourceLine } from './scroll-sync'; -import { getSettings, getData } from './settings'; +import { ActiveLineMarker } from './activeLineMarker' +import { onceDocumentLoaded } from './events' +import { createPosterForVsCode } from './messaging' +import { getEditorLineNumberForPageOffset, scrollToRevealSourceLine } from './scroll-sync' +import { getSettings, getData } from './settings' import throttle = require('lodash.throttle'); -declare var acquireVsCodeApi: any; +declare let acquireVsCodeApi: any -var scrollDisabled = true; -const marker = new ActiveLineMarker(); -const settings = getSettings(); +let scrollDisabled = true +const marker = new ActiveLineMarker() +const settings = getSettings() -const vscode = acquireVsCodeApi(); +const vscode = acquireVsCodeApi() // Set VS Code state -const state = getData('data-state'); -vscode.setState(state); +const state = getData('data-state') +vscode.setState(state) -const messaging = createPosterForVsCode(vscode); +const messaging = createPosterForVsCode(vscode) -window.cspAlerter.setPoster(messaging); -window.styleLoadingMonitor.setPoster(messaging); +window.cspAlerter.setPoster(messaging) +window.styleLoadingMonitor.setPoster(messaging) window.onload = () => { - updateImageSizes(); -}; + updateImageSizes() +} onceDocumentLoaded(() => { if (settings.scrollPreviewWithEditor) { setTimeout(() => { - const initialLine = +settings.line; + const initialLine = +settings.line if (!isNaN(initialLine)) { - scrollDisabled = true; - scrollToRevealSourceLine(initialLine); + scrollDisabled = true + scrollToRevealSourceLine(initialLine) } - }, 0); + }, 0) } -}); +}) const onUpdateView = (() => { const doScroll = throttle((line: number) => { - scrollDisabled = true; - scrollToRevealSourceLine(line); - }, 50); + scrollDisabled = true + scrollToRevealSourceLine(line) + }, 50) return (line: number, settings: any) => { if (!isNaN(line)) { - settings.line = line; - doScroll(line); + settings.line = line + doScroll(line) } - }; -})(); + } +})() -let updateImageSizes = throttle(() => { - const imageInfo: { id: string, height: number, width: number }[] = []; - let images = document.getElementsByTagName('img'); +const updateImageSizes = throttle(() => { + const imageInfo: { id: string, height: number, width: number }[] = [] + const images = document.getElementsByTagName('img') if (images) { - let i; + let i for (i = 0; i < images.length; i++) { - const img = images[i]; + const img = images[i] if (img.classList.contains('loading')) { - img.classList.remove('loading'); + img.classList.remove('loading') } imageInfo.push({ id: img.id, height: img.height, width: img.width, - }); + }) } - messaging.postMessage('cacheImageSizes', imageInfo); + messaging.postMessage('cacheImageSizes', imageInfo) } -}, 50); +}, 50) window.addEventListener('resize', () => { - scrollDisabled = true; - updateImageSizes(); -}, true); + scrollDisabled = true + updateImageSizes() +}, true) window.addEventListener('message', (event) => { if (event.data.source !== settings.source) { - return; + return } //console.log("GOT MESSAGE", event.data); switch (event.data.type) { - case 'onDidChangeTextEditorSelection': - marker.onDidChangeTextEditorSelection(event.data.line); - break; + case 'onDidChangeTextEditorSelection': + marker.onDidChangeTextEditorSelection(event.data.line) + break - case 'updateView': - onUpdateView(event.data.line, settings); - break; + case 'updateView': + onUpdateView(event.data.line, settings) + break } -}, false); +}, false) document.addEventListener('dblclick', (event) => { if (!settings.doubleClickToSwitchToEditor) { - return; + return } // Ignore clicks on links for (let node = event.target as HTMLElement; node; node = node.parentNode as HTMLElement) { if (node.tagName === 'A') { - return; + return } } - const offset = event.pageY; - const line = getEditorLineNumberForPageOffset(offset); + const offset = event.pageY + const line = getEditorLineNumberForPageOffset(offset) if (typeof line === 'number' && !isNaN(line)) { - messaging.postMessage('didClick', { line: Math.floor(line) }); + messaging.postMessage('didClick', { line: Math.floor(line) }) } -}); +}) -const passThroughLinkSchemes = ['http:', 'https:', 'mailto:', 'vscode:', 'vscode-insiders:']; +const passThroughLinkSchemes = ['http:', 'https:', 'mailto:', 'vscode:', 'vscode-insiders:'] document.addEventListener('click', (event) => { if (!event) { - return; + return } - let node: any = event.target; + let node: any = event.target while (node) { if (node.tagName && node.tagName === 'A' && node.href) { - if (node.getAttribute('href').startsWith('#')) { - const fragment = node.href.split('#')[1]; - if (fragment) { - location.hash = "#" + decodeURI(fragment); + // if (node.getAttribute('href').startsWith('#')) { + // // const fragment = node.href.split('#')[1] + // // if (fragment) { + // // location.hash = '#' + decodeURI(fragment) + // // } + // } + // Like VSCode Markdown extension, pass through some known schemes + let hrefText = node.getAttribute('data-href') + if (!hrefText) { + // Pass through known schemes + if (passThroughLinkSchemes.some((scheme) => node.href.startsWith(scheme))) { + return } + hrefText = node.getAttribute('href') + } + + // If original link doesn't look like a url, delegate back to VS Code to resolve + if (!/^[a-z-]+:/i.test(hrefText)) { + messaging.postMessage('clickLink', { href: hrefText }) + event.preventDefault() + event.stopPropagation() + return } - // Like VSCode Markdown extension, pass through some known schemes - let hrefText = node.getAttribute('data-href'); - if (!hrefText) { - // Pass through known schemes - if (passThroughLinkSchemes.some((scheme) => node.href.startsWith(scheme))) { - return; - } - hrefText = node.getAttribute('href'); - } - - // If original link doesn't look like a url, delegate back to VS Code to resolve - if (!/^[a-z\-]+:/i.test(hrefText)) { - messaging.postMessage('clickLink', { href: hrefText }); - event.preventDefault(); - event.stopPropagation(); - return; - } // Like how VSCode Markdown, pass link to backend and let it resolve it // if (node.href.startsWith('file://') || node.href.startsWith('vscode-resource:')) { // const [path, fragment] = node.href.replace(/^(file:\/\/|vscode-resource:)/i, '').split('#'); @@ -161,21 +161,21 @@ document.addEventListener('click', (event) => { // event.stopPropagation(); // break; // } - break; + break } - node = node.parentNode; + node = node.parentNode } -}, true); +}, true) if (settings.scrollEditorWithPreview) { window.addEventListener('scroll', throttle(() => { if (scrollDisabled) { - scrollDisabled = false; + scrollDisabled = false } else { - const line = getEditorLineNumberForPageOffset(window.scrollY); + const line = getEditorLineNumberForPageOffset(window.scrollY) if (typeof line === 'number' && !isNaN(line)) { - messaging.postMessage('revealLine', { line }); + messaging.postMessage('revealLine', { line }) } } - }, 50)); + }, 50)) } diff --git a/src-preview/loading.ts b/src-preview/loading.ts index 0c67ab95..c942f565 100644 --- a/src-preview/loading.ts +++ b/src-preview/loading.ts @@ -1,44 +1,44 @@ /*--------------------------------------------------------------------------------------------- * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { MessagePoster } from './messaging'; +import { MessagePoster } from './messaging' export class StyleLoadingMonitor { - private unloadedStyles: string[] = []; - private finishedLoading: boolean = false; + private unloadedStyles: string[] = []; + private finishedLoading: boolean = false; - private poster?: MessagePoster; + private poster?: MessagePoster; - constructor() { - const onStyleLoadError = (event: any) => { - const source = event.target.dataset.source; - this.unloadedStyles.push(source); - }; + constructor () { + const onStyleLoadError = (event: any) => { + const source = event.target.dataset.source + this.unloadedStyles.push(source) + } - window.addEventListener('DOMContentLoaded', () => { - // @ts-ignore TS2488 - for (const link of document.getElementsByClassName('code-user-style') as HTMLCollectionOf) { - if (link.dataset.source) { - link.onerror = onStyleLoadError; - } - } - }); + window.addEventListener('DOMContentLoaded', () => { + // @ts-ignore TS2488 + for (const link of document.getElementsByClassName('code-user-style') as HTMLCollectionOf) { + if (link.dataset.source) { + link.onerror = onStyleLoadError + } + } + }) - window.addEventListener('load', () => { - if (!this.unloadedStyles.length) { - return; - } - this.finishedLoading = true; - if (this.poster) { - this.poster.postMessage('previewStyleLoadError', { unloadedStyles: this.unloadedStyles }); - } - }); - } + window.addEventListener('load', () => { + if (!this.unloadedStyles.length) { + return + } + this.finishedLoading = true + if (this.poster) { + this.poster.postMessage('previewStyleLoadError', { unloadedStyles: this.unloadedStyles }) + } + }) + } - public setPoster(poster: MessagePoster): void { - this.poster = poster; - if (this.finishedLoading) { - poster.postMessage('previewStyleLoadError', { unloadedStyles: this.unloadedStyles }); - } - } -} \ No newline at end of file + public setPoster (poster: MessagePoster): void { + this.poster = poster + if (this.finishedLoading) { + poster.postMessage('previewStyleLoadError', { unloadedStyles: this.unloadedStyles }) + } + } +} diff --git a/src-preview/messaging.ts b/src-preview/messaging.ts index bb896562..ea8c2b11 100644 --- a/src-preview/messaging.ts +++ b/src-preview/messaging.ts @@ -2,23 +2,23 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getSettings } from './settings'; +import { getSettings } from './settings' export interface MessagePoster { - /** - * Post a message to the asciidoc extension - */ - postMessage(type: string, body: object): void; + /** + * Post a message to the asciidoc extension + */ + postMessage(type: string, body: object): void; } export const createPosterForVsCode = (vscode: any) => { return new class implements MessagePoster { - postMessage(type: string, body: object): void { + postMessage (type: string, body: object): void { vscode.postMessage({ type, source: getSettings().source, body, - }); + }) } - }; -}; + }() +} diff --git a/src-preview/pre.ts b/src-preview/pre.ts index af132a4a..8bfb40bc 100644 --- a/src-preview/pre.ts +++ b/src-preview/pre.ts @@ -2,15 +2,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CspAlerter } from './csp'; -import { StyleLoadingMonitor } from './loading'; +import { CspAlerter } from './csp' +import { StyleLoadingMonitor } from './loading' declare global { - interface Window { - cspAlerter: CspAlerter; - styleLoadingMonitor: StyleLoadingMonitor; - } + interface Window { + cspAlerter: CspAlerter; + styleLoadingMonitor: StyleLoadingMonitor; + } } -window.cspAlerter = new CspAlerter(); -window.styleLoadingMonitor = new StyleLoadingMonitor(); \ No newline at end of file +window.cspAlerter = new CspAlerter() +window.styleLoadingMonitor = new StyleLoadingMonitor() diff --git a/src-preview/scroll-sync.ts b/src-preview/scroll-sync.ts index 397634cb..c5e39689 100644 --- a/src-preview/scroll-sync.ts +++ b/src-preview/scroll-sync.ts @@ -2,42 +2,39 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { getSettings } from './settings'; +import { getSettings } from './settings' - -function clamp(min: number, max: number, value: number) { - return Math.min(max, Math.max(min, value)); +function clamp (min: number, max: number, value: number) { + return Math.min(max, Math.max(min, value)) } -function clampLine(line: number) { - return clamp(0, getSettings().lineCount - 1, line); +function clampLine (line: number) { + return clamp(0, getSettings().lineCount - 1, line) } - export interface CodeLineElement { - element: HTMLElement; - line: number; + element: HTMLElement; + line: number; } const getCodeLineElements = (() => { - let elements: CodeLineElement[]; + let elements: CodeLineElement[] return () => { if (!elements) { elements = Array.prototype.map.call( document.querySelectorAll('div[class^="data-line-"], div[class*=" data-line-"]'), //document.getElementsByClassName('code-line'), (element: any) => { - const num = element.className.split(' ').pop().match(/data-line-(\d+)/)[1]; - const line = parseInt(num); + const num = element.className.split(' ').pop().match(/data-line-(\d+)/)[1] + const line = parseInt(num) //const line = +element.getAttribute('data-line'); - return { element, line }; + return { element, line } }) - .filter((x: any) => !isNaN(x.line)) as CodeLineElement[]; + .filter((x: any) => !isNaN(x.line)) as CodeLineElement[] } - return elements; - }; -})(); - + return elements + } +})() /** * Find the html elements that map to a specific target line in the editor. @@ -45,86 +42,82 @@ const getCodeLineElements = (() => { * If an exact match, returns a single element. If the line is between elements, * returns the element prior to and the element after the given line. */ -export function getElementsForSourceLine(targetLine: number): { previous: CodeLineElement; next?: CodeLineElement; } { - const lineNumber = Math.floor(targetLine); - const lines = getCodeLineElements(); - let previous = lines[0] || null; +export function getElementsForSourceLine (targetLine: number): { previous: CodeLineElement; next?: CodeLineElement; } { + const lineNumber = Math.floor(targetLine) + const lines = getCodeLineElements() + let previous = lines[0] || null for (const entry of lines) { if (entry.line === lineNumber) { - return { previous: entry, next: undefined }; + return { previous: entry, next: undefined } + } else if (entry.line > lineNumber) { + return { previous, next: entry } } - else if (entry.line > lineNumber) { - return { previous, next: entry }; - } - previous = entry; + previous = entry } - return { previous }; + return { previous } } /** * Find the html elements that are at a specific pixel offset on the page. */ -export function getLineElementsAtPageOffset(offset: number): { previous: CodeLineElement; next?: CodeLineElement; } { - const lines = getCodeLineElements(); - const position = offset - window.scrollY; - let lo = -1; - let hi = lines.length - 1; +export function getLineElementsAtPageOffset (offset: number): { previous: CodeLineElement; next?: CodeLineElement; } { + const lines = getCodeLineElements() + const position = offset - window.scrollY + let lo = -1 + let hi = lines.length - 1 while (lo + 1 < hi) { - const mid = Math.floor((lo + hi) / 2); - const bounds = lines[mid].element.getBoundingClientRect(); + const mid = Math.floor((lo + hi) / 2) + const bounds = lines[mid].element.getBoundingClientRect() if (bounds.top + bounds.height >= position) { - hi = mid; - } - else { - lo = mid; + hi = mid + } else { + lo = mid } } - const hiElement = lines[hi]; - const hiBounds = hiElement.element.getBoundingClientRect(); + const hiElement = lines[hi] + const hiBounds = hiElement.element.getBoundingClientRect() if (hi >= 1 && hiBounds.top > position) { - const loElement = lines[lo]; - return { previous: loElement, next: hiElement }; + const loElement = lines[lo] + return { previous: loElement, next: hiElement } } - return { previous: hiElement }; + return { previous: hiElement } } /** * Attempt to reveal the element for a source line in the editor. */ -export function scrollToRevealSourceLine(line: number) { - const { previous, next } = getElementsForSourceLine(line); +export function scrollToRevealSourceLine (line: number) { + const { previous, next } = getElementsForSourceLine(line) if (previous && getSettings().scrollPreviewWithEditor) { - let scrollTo = 0; - const rect = previous.element.getBoundingClientRect(); - const previousTop = rect.top; + let scrollTo = 0 + const rect = previous.element.getBoundingClientRect() + const previousTop = rect.top if (next && next.line !== previous.line) { // Between two elements. Go to percentage offset between them. - const betweenProgress = (line - previous.line) / (next.line - previous.line); - const elementOffset = next.element.getBoundingClientRect().top - previousTop; - scrollTo = previousTop + betweenProgress * elementOffset; + const betweenProgress = (line - previous.line) / (next.line - previous.line) + const elementOffset = next.element.getBoundingClientRect().top - previousTop + scrollTo = previousTop + betweenProgress * elementOffset + } else { + scrollTo = previousTop } - else { - scrollTo = previousTop; - } - window.scroll(0, Math.max(1, window.scrollY + scrollTo)); + window.scroll(0, Math.max(1, window.scrollY + scrollTo)) } } -export function getEditorLineNumberForPageOffset(offset: number) { - const { previous, next } = getLineElementsAtPageOffset(offset); +export function getEditorLineNumberForPageOffset (offset: number) { + const { previous, next } = getLineElementsAtPageOffset(offset) if (previous) { - const previousBounds = previous.element.getBoundingClientRect(); - const offsetFromPrevious = (offset - window.scrollY - previousBounds.top); + const previousBounds = previous.element.getBoundingClientRect() + const offsetFromPrevious = (offset - window.scrollY - previousBounds.top) if (next) { - const progressBetweenElements = offsetFromPrevious / (next.element.getBoundingClientRect().top - previousBounds.top); - const line = previous.line + progressBetweenElements * (next.line - previous.line); - return clampLine(line); - } - else { - const progressWithinElement = offsetFromPrevious / (previousBounds.height); - const line = previous.line + progressWithinElement; - return clampLine(line); + const progressBetweenElements = offsetFromPrevious / (next.element.getBoundingClientRect().top - previousBounds.top) + const line = previous.line + progressBetweenElements * (next.line - previous.line) + return clampLine(line) + } else { + const progressWithinElement = offsetFromPrevious / (previousBounds.height) + const line = previous.line + progressWithinElement + return clampLine(line) } } - return null; + return null } diff --git a/src-preview/settings.ts b/src-preview/settings.ts index 887e0160..94c760a1 100644 --- a/src-preview/settings.ts +++ b/src-preview/settings.ts @@ -3,38 +3,38 @@ *--------------------------------------------------------------------------------------------*/ export interface PreviewSettings { - source: string; - line: number; - lineCount: number; - scrollPreviewWithEditor?: boolean; - scrollEditorWithPreview: boolean; - disableSecurityWarnings: boolean; - doubleClickToSwitchToEditor: boolean; + source: string; + line: number; + lineCount: number; + scrollPreviewWithEditor?: boolean; + scrollEditorWithPreview: boolean; + disableSecurityWarnings: boolean; + doubleClickToSwitchToEditor: boolean; } -let cachedSettings: PreviewSettings | undefined = undefined; +let cachedSettings: PreviewSettings | undefined -export function getData(key: string): PreviewSettings { - const element = document.getElementById('vscode-asciidoc-preview-data'); +export function getData (key: string): PreviewSettings { + const element = document.getElementById('vscode-asciidoc-preview-data') if (element) { - const data = element.getAttribute(key); + const data = element.getAttribute(key) if (data) { - return JSON.parse(data); + return JSON.parse(data) } } - throw new Error(`Could not load data for ${key}`); + throw new Error(`Could not load data for ${key}`) } -export function getSettings(): PreviewSettings { +export function getSettings (): PreviewSettings { if (cachedSettings) { - return cachedSettings; + return cachedSettings } - cachedSettings = getData('data-settings'); + cachedSettings = getData('data-settings') if (cachedSettings) { - return cachedSettings; + return cachedSettings } - throw new Error('Could not load settings'); + throw new Error('Could not load settings') } diff --git a/src-preview/strings.ts b/src-preview/strings.ts index ad78608a..373036ff 100644 --- a/src-preview/strings.ts +++ b/src-preview/strings.ts @@ -2,13 +2,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -export function getStrings(): { [key: string]: string } { - const store = document.getElementById('vscode-asciidoc-preview-data'); +export function getStrings (): { [key: string]: string } { + const store = document.getElementById('vscode-asciidoc-preview-data') if (store) { - const data = store.getAttribute('data-strings'); + const data = store.getAttribute('data-strings') if (data) { - return JSON.parse(data); + return JSON.parse(data) } } - throw new Error('Could not load strings'); + throw new Error('Could not load strings') } diff --git a/src/asciidocEngine.ts b/src/asciidocEngine.ts index 574ab8cf..44cfdba2 100644 --- a/src/asciidocEngine.ts +++ b/src/asciidocEngine.ts @@ -2,71 +2,71 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { AsciidocContributions } from './asciidocExtensions'; -import { Slugifier } from './slugify'; -import { getUriForLinkWithKnownExternalScheme } from './util/links'; +import * as vscode from 'vscode' +import { AsciidocContributions } from './asciidocExtensions' +import { Slugifier } from './slugify' import { AsciidocParser } from './text-parser' -const FrontMatterRegex = /^---\s*[^]*?(-{3}|\.{3})\s*/; +const FrontMatterRegex = /^---\s*[^]*?(-{3}|\.{3})\s*/ export class AsciidocEngine { private ad?: AsciidocParser; - private firstLine?: number; + private firstLine?: number; - private currentDocument?: vscode.Uri; + private currentDocument?: vscode.Uri; - public constructor( - private readonly extensionPreviewResourceProvider: AsciidocContributions, - private readonly slugifier: Slugifier, - private readonly errorCollection: vscode.DiagnosticCollection = null - ) { } + public constructor ( + private readonly extensionPreviewResourceProvider: AsciidocContributions, + private readonly slugifier: Slugifier, + private readonly errorCollection: vscode.DiagnosticCollection = null + ) { + this.extensionPreviewResourceProvider = extensionPreviewResourceProvider + this.slugifier = slugifier + this.errorCollection = errorCollection + } + private async getEngine (resource: vscode.Uri): Promise { + if (!this.ad) { + this.ad = new AsciidocParser(resource.fsPath, this.errorCollection) + } - private async getEngine(resource: vscode.Uri): Promise { - if (!this.ad) { - this.ad = new AsciidocParser(resource.fsPath, this.errorCollection); - } + return this.ad + } - const config = vscode.workspace.getConfiguration('asciidoc', resource); - return this.ad; - } + private stripFrontmatter (text: string): { text: string, offset: number } { + let offset = 0 + const frontMatterMatch = FrontMatterRegex.exec(text) + if (frontMatterMatch) { + const frontMatter = frontMatterMatch[0] + offset = frontMatter.split(/\r\n|\n|\r/g).length - 1 + text = text.substr(frontMatter.length) + } + return { text, offset } + } - private stripFrontmatter(text: string): { text: string, offset: number } { - let offset = 0; - const frontMatterMatch = FrontMatterRegex.exec(text); - if (frontMatterMatch) { - const frontMatter = frontMatterMatch[0]; - offset = frontMatter.split(/\r\n|\n|\r/g).length - 1; - text = text.substr(frontMatter.length); - } - return { text, offset }; - } + public async render (document: vscode.Uri, stripFrontmatter: boolean, text: string, + forHTML: boolean = false, backend: string = 'html5'): Promise { + let offset = 0 + if (stripFrontmatter) { + const asciidocContent = this.stripFrontmatter(text) + offset = asciidocContent.offset + text = asciidocContent.text + } - public async render(document: vscode.Uri, stripFrontmatter: boolean, text: string, - forHTML: boolean = false, backend: string = 'html5'): Promise { - let offset = 0; - if (stripFrontmatter) { - const asciidocContent = this.stripFrontmatter(text); - offset = asciidocContent.offset; - text = asciidocContent.text; - } - - this.currentDocument = document; - this.firstLine = offset; - const engine = await this.getEngine(document); - const doc = await vscode.workspace.openTextDocument(document); - let ascii_doc = engine.parseText(text, doc, forHTML, backend) - return ascii_doc; - } - - public async parse(document: vscode.Uri, source: string): Promise { - this.currentDocument = document; - const engine = await this.getEngine(document); - const doc = await vscode.workspace.openTextDocument(document); - let ascii_doc = await engine.parseText(source, doc); - return engine.document - } + this.currentDocument = document + this.firstLine = offset + const engine = await this.getEngine(document) + const doc = await vscode.workspace.openTextDocument(document) + const asciiDoc = engine.parseText(text, doc, forHTML, backend) + return asciiDoc + } + public async parse (document: vscode.Uri, source: string): Promise { + this.currentDocument = document + const engine = await this.getEngine(document) + const doc = await vscode.workspace.openTextDocument(document) + await engine.parseText(source, doc) + return engine.document + } } diff --git a/src/asciidocExtensions.ts b/src/asciidocExtensions.ts index 06495900..d201f9ba 100644 --- a/src/asciidocExtensions.ts +++ b/src/asciidocExtensions.ts @@ -2,91 +2,72 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import * as path from 'path'; - -const resolveExtensionResource = (extension: vscode.Extension, resourcePath: string): vscode.Uri => { - return vscode.Uri.file(path.join(extension.extensionPath, resourcePath)) - .with({ scheme: 'vscode-resource' }); -}; - -const resolveExtensionResources = (extension: vscode.Extension, resourcePaths: any): vscode.Uri[] => { - const result: vscode.Uri[] = []; - if (Array.isArray(resourcePaths)) { - for (const resource of resourcePaths) { - try { - result.push(resolveExtensionResource(extension, resource)); - } catch (e) { - // noop - } - } - } - return result; -}; +import * as vscode from 'vscode' export interface AsciidocContributions { - readonly extensionPath: string; - readonly previewScripts: vscode.Uri[]; - readonly previewStylesEditor: vscode.Uri[]; - readonly previewStylesDefault: vscode.Uri[]; - readonly asciidocItPlugins: Thenable<(md: any) => any>[]; - readonly previewResourceRoots: vscode.Uri[]; + readonly extensionPath: string; + readonly previewScripts: vscode.Uri[]; + readonly previewStylesEditor: vscode.Uri[]; + readonly previewStylesDefault: vscode.Uri[]; + readonly asciidocItPlugins: Promise<(md: any) => any>[]; + readonly previewResourceRoots: vscode.Uri[]; } class AsciidocExtensionContributions implements AsciidocContributions { - private readonly _scripts: vscode.Uri[] = []; - private readonly _stylesEditor: vscode.Uri[] = []; - private readonly _stylesDefault: vscode.Uri[] = []; - private readonly _previewResourceRoots: vscode.Uri[] = []; - private readonly _plugins: Thenable<(md: any) => any>[] = []; - - private _loaded = false; - - public constructor( - public readonly extensionPath: string - ) { } - - public get previewScripts(): vscode.Uri[] { - this.ensureLoaded(); - return this._scripts; - } + private readonly _scripts: vscode.Uri[] = []; + private readonly _stylesEditor: vscode.Uri[] = []; + private readonly _stylesDefault: vscode.Uri[] = []; + private readonly _previewResourceRoots: vscode.Uri[] = []; + private readonly _plugins: Promise<(md: any) => any>[] = []; + + private _loaded = false; + + public constructor ( + public readonly extensionPath: string + ) { + this.extensionPath = extensionPath + } - public get previewStylesEditor(): vscode.Uri[] { - this.ensureLoaded(); - return this._stylesEditor; - } + public get previewScripts (): vscode.Uri[] { + this.ensureLoaded() + return this._scripts + } - public get previewStylesDefault(): vscode.Uri[] { - this.ensureLoaded(); - return this._stylesDefault; - } + public get previewStylesEditor (): vscode.Uri[] { + this.ensureLoaded() + return this._stylesEditor + } - public get previewResourceRoots(): vscode.Uri[] { - this.ensureLoaded(); - return this._previewResourceRoots; - } + public get previewStylesDefault (): vscode.Uri[] { + this.ensureLoaded() + return this._stylesDefault + } - public get asciidocItPlugins(): Thenable<(md: any) => any>[] { - this.ensureLoaded(); - return this._plugins; - } + public get previewResourceRoots (): vscode.Uri[] { + this.ensureLoaded() + return this._previewResourceRoots + } - private ensureLoaded() { - if (this._loaded) { - return; - } + public get asciidocItPlugins (): Promise<(md: any) => any>[] { + this.ensureLoaded() + return this._plugins + } - this._loaded = true; - for (const extension of vscode.extensions.all) { - const contributes = extension.packageJSON && extension.packageJSON.contributes; - if (!contributes) { - continue; - } - } - } + private ensureLoaded () { + if (this._loaded) { + return + } + this._loaded = true + for (const extension of vscode.extensions.all) { + const contributes = extension.packageJSON && extension.packageJSON.contributes + if (!contributes) { + continue + } + } + } } -export function getAsciidocExtensionContributions(context: vscode.ExtensionContext): AsciidocContributions { - return new AsciidocExtensionContributions(context.extensionPath); +export function getAsciidocExtensionContributions (context: vscode.ExtensionContext): AsciidocContributions { + return new AsciidocExtensionContributions(context.extensionPath) } diff --git a/src/commandManager.ts b/src/commandManager.ts index 06115384..efa3640c 100644 --- a/src/commandManager.ts +++ b/src/commandManager.ts @@ -2,34 +2,34 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; +import * as vscode from 'vscode' export interface Command { - readonly id: string; + readonly id: string; - execute(...args: any[]): void; + execute(...args: any[]): void; } export class CommandManager { - private readonly commands = new Map(); - - public dispose() { - for (const registration of this.commands.values()) { - registration.dispose(); - } - this.commands.clear(); - } - - public register(command: T): T { - this.registerCommand(command.id, command.execute, command); - return command; - } - - private registerCommand(id: string, impl: (...args: any[]) => void, thisArg?: any) { - if (this.commands.has(id)) { - return; - } - - this.commands.set(id, vscode.commands.registerCommand(id, impl, thisArg)); - } -} \ No newline at end of file + private readonly commands = new Map(); + + public dispose () { + for (const registration of this.commands.values()) { + registration.dispose() + } + this.commands.clear() + } + + public register (command: T): T { + this.registerCommand(command.id, command.execute, command) + return command + } + + private registerCommand (id: string, impl: (...args: any[]) => void, thisArg?: any) { + if (this.commands.has(id)) { + return + } + + this.commands.set(id, vscode.commands.registerCommand(id, impl, thisArg)) + } +} diff --git a/src/commands/exportAsPDF.ts b/src/commands/exportAsPDF.ts index 7be2e668..1442ca0e 100644 --- a/src/commands/exportAsPDF.ts +++ b/src/commands/exportAsPDF.ts @@ -1,134 +1,118 @@ import * as vscode from 'vscode' import * as fs from 'fs' import * as path from 'path' -import { exec } from "child_process" -import * as zlib from 'zlib'; +import { exec, spawn } from 'child_process' +import * as zlib from 'zlib' import { https } from 'follow-redirects' -import { isNullOrUndefined } from 'util' -import { spawn } from "child_process"; -import { AsciidocParser } from '../text-parser'; -import { Command } from '../commandManager'; -import { AsciidocEngine } from '../asciidocEngine'; -import * as tmp from "tmp"; +import { AsciidocParser } from '../text-parser' +import { Command } from '../commandManager' +import { AsciidocEngine } from '../asciidocEngine' +import * as tmp from 'tmp' -import HttpsProxyAgent = require('https-proxy-agent'); import url = require('url'); -import { Logger } from '../logger'; +import { Logger } from '../logger' -export class ExportAsPDF implements Command -{ - public readonly id = 'asciidoc.exportAsPDF'; +export class ExportAsPDF implements Command { + public readonly id = 'asciidoc.exportAsPDF' - constructor( - private readonly engine: AsciidocEngine, - private readonly logger: Logger - ) { } + constructor (private readonly engine: AsciidocEngine, private readonly logger: Logger) { + this.engine = engine + this.logger = logger + } - public async execute() - { + public async execute () { const editor = vscode.window.activeTextEditor - if (isNullOrUndefined(editor)) - return + if (editor === null || editor === undefined) { return } const doc = editor.document - const source_name = path.parse(path.resolve(doc.fileName)) - const pdf_filename = vscode.Uri.file(path.join(source_name.root, source_name.dir, source_name.name + '.pdf')) + const sourceName = path.parse(path.resolve(doc.fileName)) + const pdfFilename = vscode.Uri.file(path.join(sourceName.root, sourceName.dir, sourceName.name + '.pdf')) const text = doc.getText() - if (vscode.workspace.getConfiguration('asciidoc', null).get('use_asciidoctorpdf')) - { - var docPath = path.parse(path.resolve(doc.fileName)) - var pdfPath = '' + if (vscode.workspace.getConfiguration('asciidoc', null).get('use_asciidoctorpdf')) { + const docPath = path.parse(path.resolve(doc.fileName)) + let pdfPath = '' - var pdfUri = await vscode.window.showSaveDialog({ defaultUri: pdf_filename }) - if (!isNullOrUndefined(pdfUri)) - { + const pdfUri = await vscode.window.showSaveDialog({ defaultUri: pdfFilename }) + if (!(pdfUri === null || pdfUri === undefined)) { pdfPath = pdfUri.fsPath - } else - { + } else { console.error(`ERROR: invalid pdfUri "${pdfUri}"`) return } - let asciidoctorpdf_command = vscode.workspace + const asciidoctorPDFCommand = vscode.workspace .getConfiguration('asciidoc', null) - .get('asciidoctorpdf_command', 'asciidoctor-pdf') + .get('asciidoctorPDFCommand', 'asciidoctor-pdf') - var adocpdf_cmd_array = asciidoctorpdf_command + const adocPDFCmdArray = asciidoctorPDFCommand .split(/(\s+)/) .filter(function (e) { return e.trim().length > 0 }) - var adocpdf_cmd = adocpdf_cmd_array[0] + const adocPDFCmd = adocPDFCmdArray[0] - var adocpdf_cmd_args = adocpdf_cmd_array.slice(1) - adocpdf_cmd_args.push.apply(adocpdf_cmd_args, ['-q', - '-B', '"' + docPath.dir.replace('"', '\\"') + '"', - '-o', '"' + pdfPath.replace('"', '\\"') + '"', '-', - ]) + const adocPDFCmdArgs = adocPDFCmdArray.slice(1) + adocPDFCmdArgs.push('-q', '-B', '"' + docPath.dir.replace('"', '\\"') + '"', + '-o', '"' + pdfPath.replace('"', '\\"') + '"', '-') - var options = { shell: true, cwd: docPath.dir } + const options = { shell: true, cwd: docPath.dir } - var asciidoctorpdf = spawn(adocpdf_cmd, adocpdf_cmd_args, options) + const asciidoctorPDF = spawn(adocPDFCmd, adocPDFCmdArgs, options) - asciidoctorpdf.stderr.on('data', (data) => - { + asciidoctorPDF.stderr.on('data', (data) => { let errorMessage = data.toString() - errorMessage += "\n" - errorMessage += "command: " + adocpdf_cmd + " " + adocpdf_cmd_args.join(" ") - errorMessage += "\n" - errorMessage += "If the asciidoctor-pdf binary is not in your PATH, you can set the full path." - errorMessage += "Go to `File -> Preferences -> User settings` and adjust the asciidoc.asciidoctorpdf_command" + errorMessage += '\n' + errorMessage += 'command: ' + adocPDFCmd + ' ' + adocPDFCmdArgs.join(' ') + errorMessage += '\n' + errorMessage += 'If the asciidoctor-pdf binary is not in your PATH, you can set the full path.' + errorMessage += 'Go to `File -> Preferences -> User settings` and adjust the asciidoc.asciidoctorPDFCommand' console.error(errorMessage) vscode.window.showErrorMessage(errorMessage) }) - asciidoctorpdf.on('close', (code) => - { - offer_open(pdfPath) + // eslint-disable-next-line @typescript-eslint/no-unused-vars + asciidoctorPDF.on('close', (code) => { + offerOpen(pdfPath) }) - asciidoctorpdf.stdin.write(text) - asciidoctorpdf.stdin.end() - } - else - { - let wkhtmltopdf_path = vscode.workspace + asciidoctorPDF.stdin.write(text) + asciidoctorPDF.stdin.end() + } else { + const wkHTMLtoPDFPath = vscode.workspace .getConfiguration('asciidoc') - .get('wkhtmltopdf_path', ''); + .get('wkHTMLtoPDFPath', '') - let parser = new AsciidocParser(path.resolve(doc.fileName)) + const parser = new AsciidocParser(path.resolve(doc.fileName)) //const body = await parser.parseText() const body = await this.engine.render(doc.uri, true, text, false, 'html5') - const ext_path = vscode.extensions.getExtension('asciidoctor.asciidoctor-vscode').extensionPath; - const html = body; - const showtitlepage = parser.getAttribute("showtitlepage") - const author = parser.getAttribute("author") - const email = parser.getAttribute("email") - const doctitle: string | undefined = parser.getAttribute("doctitle"); - const titlepagelogo: string | undefined = parser.getAttribute("titlepagelogo"); - const footer_center: string | undefined = parser.getAttribute("footer-center"); - let cover: string | undefined = undefined; - let img_html: string = ''; - if (!isNullOrUndefined(showtitlepage)) - { - if (!isNullOrUndefined(titlepagelogo)) - { - const image_url = titlepagelogo.startsWith('http') ? titlepagelogo : path.join(source_name.dir, titlepagelogo) - img_html = isNullOrUndefined(titlepagelogo) ? "" : `` + const extPath = vscode.extensions.getExtension('asciidoctor.asciidoctor-vscode').extensionPath + const html = body + const showTitlePage = parser.getAttribute('showTitlePage') + const author = parser.getAttribute('author') + const email = parser.getAttribute('email') + const doctitle: string | undefined = parser.getAttribute('doctitle') + const titlePageLogo: string | undefined = parser.getAttribute('titlePageLogo') + const footerCenter: string | undefined = parser.getAttribute('footer-center') + let cover: string | undefined + let imageHTML: string = '' + if (!(showTitlePage === null)) { + if (!(titlePageLogo === null)) { + const imageURL = titlePageLogo.startsWith('http') ? titlePageLogo : path.join(sourceName.dir, titlePageLogo) + imageHTML = (titlePageLogo === null) ? '' : `` } - var tmpobj = tmp.fileSync({ postfix: '.html' }); - let html = `\ + const tmpobj = tmp.fileSync({ postfix: '.html' }) + const html = `\ - +
- ${img_html} + ${imageHTML}

${doctitle}

${author} <${email}>

@@ -136,179 +120,145 @@ export class ExportAsPDF implements Command
- `; + ` fs.writeFileSync(tmpobj.name, html, 'utf-8') - cover = `cover ${tmpobj.name}`; + cover = `cover ${tmpobj.name}` } const platform = process.platform - const ext = platform == "win32" ? '.exe' : '' - const arch = process.arch; - var binary_path = path.resolve(path.join(__dirname, 'wkhtmltopdf-' + platform + '-' + arch + ext)) + const ext = platform === 'win32' ? '.exe' : '' + const arch = process.arch + let binaryPath = path.resolve(path.join(__dirname, 'wkhtmltopdf-' + platform + '-' + arch + ext)) - if (wkhtmltopdf_path != '') - binary_path = wkhtmltopdf_path; + if (wkHTMLtoPDFPath !== '') { binaryPath = wkHTMLtoPDFPath } - if (!fs.existsSync(binary_path)) - { - var label = await vscode.window.showInformationMessage("This feature requires wkhtmltopdf\ndo you want to download", "Download") - if (label != "Download") - return - var error_msg = null + if (!fs.existsSync(binaryPath)) { + const label = await vscode.window.showInformationMessage('This feature requires wkhtmltopdf\ndo you want to download', 'Download') + if (label !== 'Download') { return } await vscode.window.withProgress({ location: vscode.ProgressLocation.Window, - title: "Downloading wkhtmltopdf", + title: 'Downloading wkhtmltopdf', // cancellable: true - }, async (progress) => - { - progress.report({ message: 'Downloading wkhtmltopdf...' }); - const download_url = `https://github.com/joaompinto/wkhtmltopdf/releases/download/v0.0.1/wkhtmltopdf-${platform}-${arch}${ext}.gz` - this.logger.log("Downloading " + download_url) - await download_file(download_url, binary_path + ".gz", progress).then(() => - { + }, async (progress) => { + progress.report({ message: 'Downloading wkhtmltopdf...' }) + const downloadURL = `https://github.com/joaompinto/wkhtmltopdf/releases/download/v0.0.1/wkhtmltopdf-${platform}-${arch}${ext}.gz` + this.logger.log('Downloading ' + downloadURL) + await downloadFile(downloadURL, binaryPath + '.gz', progress).then(() => { progress.report({ message: 'Unzipping wkhtmltopdf...' }) const ungzip = zlib.createGunzip() - const inp = fs.createReadStream(binary_path + ".gz") - const out = fs.createWriteStream(binary_path) + const inp = fs.createReadStream(binaryPath + '.gz') + const out = fs.createWriteStream(binaryPath) inp.pipe(ungzip).pipe(out) - fs.chmodSync(binary_path, 0x755) - }).catch(async (reason) => - { - binary_path = null; - console.error("Error downloading", download_url, " ", reason) - await vscode.window.showErrorMessage("Error installing wkhtmltopdf, " + reason.toString()) - return + fs.chmodSync(binaryPath, 0x755) + }).catch(async (reason) => { + binaryPath = null + console.error('Error downloading', downloadURL, ' ', reason) + await vscode.window.showErrorMessage('Error installing wkhtmltopdf, ' + reason.toString()) }) }) - if (isNullOrUndefined(binary_path)) - return; + if (binaryPath === null || binaryPath === undefined) { return } } - var save_filename = await vscode.window.showSaveDialog({ defaultUri: pdf_filename }) - if (!isNullOrUndefined(save_filename)) - { - await html2pdf(html, binary_path, cover, footer_center, save_filename.fsPath) - .then((result) => { offer_open(result) }) - .catch((reason) => - { - console.error("Got error", reason) - vscode.window.showErrorMessage("Error converting to PDF, " + reason.toString()); + const saveFilename = await vscode.window.showSaveDialog({ defaultUri: pdfFilename }) + if (!(saveFilename === null || saveFilename === undefined)) { + await html2pdf(html, binaryPath, cover, footerCenter, saveFilename.fsPath) + .then((result) => { offerOpen(result) }) + .catch((reason) => { + console.error('Got error', reason) + vscode.window.showErrorMessage('Error converting to PDF, ' + reason.toString()) }) } } } } -async function download_file(download_url: string, filename: string, progress) -{ - - return new Promise((resolve, reject) => - { - var download_options = url.parse(download_url); - var wstream = fs.createWriteStream(filename) - var totalDownloaded = 0; +async function downloadFile (downloadURL: string, filename: string, progress) { + return new Promise((resolve, reject) => { + const downloadOptions = url.parse(downloadURL) + const wstream = fs.createWriteStream(filename) + let totalDownloaded = 0 // Proxy support needs to be reworked // var proxy = process.env.http_proxy || vscode.workspace.getConfiguration("http", null)["proxy"].trim(); // var proxyStrictSSL = vscode.workspace.getConfiguration("http", null)["proxyStrictSSL"]; // if (proxy != '') // { // var agent = new HttpsProxyAgent(proxy); - // download_options.agent = agent - // download_options.rejectUnauthorized = proxyStrictSSL + // downloadOptions.agent = agent + // downloadOptions.rejectUnauthorized = proxyStrictSSL // } - https.get(download_options, (resp) => - { - const contentSize = resp.headers['content-length']; - if (resp.statusCode != 200) - { + https.get(downloadOptions, (resp) => { + const contentSize = resp.headers['content-length'] + if (resp.statusCode !== 200) { wstream.end() fs.unlinkSync(filename) - return reject("http error" + resp.statusCode) + return reject(new Error('http error' + resp.statusCode)) } // A chunk of data has been recieved. - resp.on('data', (chunk) => - { + resp.on('data', (chunk) => { totalDownloaded += chunk.length - progress.report({ message: "Downloading wkhtmltopdf ... " + ((totalDownloaded / contentSize) * 100.).toFixed(0) + "%" }) + progress.report({ message: 'Downloading wkhtmltopdf ... ' + ((totalDownloaded / contentSize) * 100.0).toFixed(0) + '%' }) wstream.write(chunk) - }); + }) // The whole response has been received. Print out the result. - resp.on('end', () => - { + resp.on('end', () => { wstream.end() resolve() - }); - - }).on("error", (err) => - { - console.error("Error: " + err.message); + }) + }).on('error', (err) => { + console.error('Error: ' + err.message) reject(err.message) - }); + }) }) } -function offer_open(destination) -{ - +function offerOpen (destination) { // Saving the JSON that represents the document to a temporary JSON-file. - vscode.window.showInformationMessage(("Successfully converted to " + path.basename(destination)), "Open File").then((label: string) => - { - if (label == "Open File") - { - switch (process.platform) - { + vscode.window.showInformationMessage(('Successfully converted to ' + path.basename(destination)), 'Open File').then((label: string) => { + if (label === 'Open File') { + switch (process.platform) { // Use backticks for unix systems to run the open command directly // This avoids having to wrap the command AND path in quotes which // breaks if there is a single quote (') in the path case 'win32': - exec(`"${destination.replace('"', '\\"')}"`); - break; + exec(`"${destination.replace('"', '\\"')}"`) + break case 'darwin': - exec(`\`open "${destination.replace('"', '\\"')}" ; exit\``); - break; + exec(`\`open "${destination.replace('"', '\\"')}" ; exit\``) + break case 'linux': - exec(`\`xdg-open "${destination.replace('"', '\\"')}" ; exit\``); - break; + exec(`\`xdg-open "${destination.replace('"', '\\"')}" ; exit\``) + break default: - vscode.window.showWarningMessage("Output type is not supported"); - break; + vscode.window.showWarningMessage('Output type is not supported') + break } } }) } -export async function html2pdf(html: string, binary_path: string, cover: string, footer_center: string, filename: string) -{ - let documentPath = path.dirname(filename); +export async function html2pdf (html: string, binaryPath: string, cover: string, footerCenter: string, filename: string) { + const documentPath = path.dirname(filename) - return new Promise((resolve, reject) => - { - var options = { cwdir: documentPath, stdio: ['pipe', 'ignore', "pipe"] } - let cmd_arguments = ['--encoding', ' utf-8', '--javascript-delay', '1000']; - if (!isNullOrUndefined(footer_center)) - { - cmd_arguments = cmd_arguments.concat(['--footer-center', footer_center]) + return new Promise((resolve, reject) => { + const options = { cwdir: documentPath, stdio: ['pipe', 'ignore', 'pipe'] } + let cmdArguments = ['--encoding', ' utf-8', '--javascript-delay', '1000'] + if (footerCenter !== null) { + cmdArguments = cmdArguments.concat(['--footer-center', footerCenter]) } - if (!isNullOrUndefined(cover)) - { - cmd_arguments = cmd_arguments.concat(cover.split(" ")) + if (cover !== null && cover !== undefined) { + cmdArguments = cmdArguments.concat(cover.split(' ')) } - cmd_arguments = cmd_arguments.concat(['-', filename]); - var command = spawn(binary_path, cmd_arguments, options) - var error_data = ''; - command.stdin.write(html); - command.stdin.end(); - command.stderr.on('data', (data) => - { - error_data += data; + cmdArguments = cmdArguments.concat(['-', filename]) + const command = spawn(binaryPath, cmdArguments, options) + let errorData = '' + command.stdin.write(html) + command.stdin.end() + command.stderr.on('data', (data) => { + errorData += data }) - command.on('close', (code) => - { - if (code == 0) - resolve(filename) - else - reject(error_data) + command.on('close', (code) => { + if (code === 0) { resolve(filename) } else { reject(errorData) } }) - }); + }) } diff --git a/src/commands/index.ts b/src/commands/index.ts index 1cfc3452..3c690ccb 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -2,14 +2,14 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -export { OpenDocumentLinkCommand } from './openDocumentLink'; -export { ShowPreviewCommand, ShowPreviewToSideCommand, ShowLockedPreviewToSideCommand } from './showPreview'; -export { ShowSourceCommand } from './showSource'; -export { RefreshPreviewCommand } from './refreshPreview'; -export { ShowPreviewSecuritySelectorCommand } from './showPreviewSecuritySelector'; -export { MoveCursorToPositionCommand } from './moveCursorToPosition'; -export { ToggleLockCommand } from './toggleLock'; -export { ExportAsPDF } from './exportAsPDF'; -export { PasteImage} from './pasteImage'; -export { SaveHTML } from './saveHTML'; -export { SaveDocbook } from './saveDocbook'; +export { OpenDocumentLinkCommand } from './openDocumentLink' +export { ShowPreviewCommand, ShowPreviewToSideCommand, ShowLockedPreviewToSideCommand } from './showPreview' +export { ShowSourceCommand } from './showSource' +export { RefreshPreviewCommand } from './refreshPreview' +export { ShowPreviewSecuritySelectorCommand } from './showPreviewSecuritySelector' +export { MoveCursorToPositionCommand } from './moveCursorToPosition' +export { ToggleLockCommand } from './toggleLock' +export { ExportAsPDF } from './exportAsPDF' +export { PasteImage } from './pasteImage' +export { SaveHTML } from './saveHTML' +export { SaveDocbook } from './saveDocbook' diff --git a/src/commands/moveCursorToPosition.ts b/src/commands/moveCursorToPosition.ts index 66fbc894..a88be855 100644 --- a/src/commands/moveCursorToPosition.ts +++ b/src/commands/moveCursorToPosition.ts @@ -2,20 +2,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; +import * as vscode from 'vscode' -import { Command } from '../commandManager'; +import { Command } from '../commandManager' export class MoveCursorToPositionCommand implements Command { - public readonly id = '_asciidoc.moveCursorToPosition'; + public readonly id = '_asciidoc.moveCursorToPosition'; - public execute(line: number, character: number) { - if (!vscode.window.activeTextEditor) { - return; - } - const position = new vscode.Position(line, character); - const selection = new vscode.Selection(position, position); - vscode.window.activeTextEditor.revealRange(selection); - vscode.window.activeTextEditor.selection = selection; - } + public execute (line: number, character: number) { + if (!vscode.window.activeTextEditor) { + return + } + const position = new vscode.Position(line, character) + const selection = new vscode.Selection(position, position) + vscode.window.activeTextEditor.revealRange(selection) + vscode.window.activeTextEditor.selection = selection + } } diff --git a/src/commands/openDocumentLink.ts b/src/commands/openDocumentLink.ts index fc0f8b0f..7a4e9c54 100644 --- a/src/commands/openDocumentLink.ts +++ b/src/commands/openDocumentLink.ts @@ -2,84 +2,81 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { extname } from 'path'; - -import { Command } from '../commandManager'; -import { AsciidocEngine } from '../asciidocEngine'; -import { TableOfContentsProvider } from '../tableOfContentsProvider'; -import { isAsciidocFile } from '../util/file'; +import * as vscode from 'vscode' +import { extname } from 'path' +import { Command } from '../commandManager' +import { AsciidocEngine } from '../asciidocEngine' +import { TableOfContentsProvider } from '../tableOfContentsProvider' +import { isAsciidocFile } from '../util/file' export interface OpenDocumentLinkArgs { - path: string; - fragment: string; + path: string + fragment: string } export class OpenDocumentLinkCommand implements Command { - private static readonly id = '_asciidoc.openDocumentLink'; - public readonly id = OpenDocumentLinkCommand.id; + private static readonly id = '_asciidoc.openDocumentLink' + public readonly id = OpenDocumentLinkCommand.id - public static createCommandUri( - path: string, - fragment: string - ): vscode.Uri { - return vscode.Uri.parse(`command:${OpenDocumentLinkCommand.id}?${encodeURIComponent(JSON.stringify({ path, fragment }))}`); - } + public constructor (private readonly engine: AsciidocEngine) { + this.engine = engine + } - public constructor( - private readonly engine: AsciidocEngine - ) { } + public static createCommandUri ( + path: string, + fragment: string + ): vscode.Uri { + return vscode.Uri.parse(`command:${OpenDocumentLinkCommand.id}?${encodeURIComponent(JSON.stringify({ path, fragment }))}`) + } - public execute(args: OpenDocumentLinkArgs) { - const p = decodeURIComponent(args.path); - return this.tryOpen(p, args).catch(() => { - if (extname(p) === '') { - return this.tryOpen(p + '.md', args); - } - const resource = vscode.Uri.file(p); - return Promise.resolve(void 0) - .then(() => vscode.commands.executeCommand('vscode.open', resource)) - .then(() => void 0); - }); - } + public execute (args: OpenDocumentLinkArgs) { + const p = decodeURIComponent(args.path) + return this.tryOpen(p, args).catch(async () => { + if (extname(p) === '') { + return this.tryOpen(p + '.md', args) + } + const resource = vscode.Uri.file(p) + await vscode.commands.executeCommand('vscode.open', resource) + return undefined + }) + } - private async tryOpen(path: string, args: OpenDocumentLinkArgs) { - const resource = vscode.Uri.file(path); - if (vscode.window.activeTextEditor && isAsciidocFile(vscode.window.activeTextEditor.document) - && vscode.window.activeTextEditor.document.uri.fsPath === resource.fsPath) { - return this.tryRevealLine(vscode.window.activeTextEditor, args.fragment); - } else { - return vscode.workspace.openTextDocument(resource) - .then(vscode.window.showTextDocument) - .then((editor) => this.tryRevealLine(editor, args.fragment)); - } - } + private async tryOpen (path: string, args: OpenDocumentLinkArgs) { + const resource = vscode.Uri.file(path) + if (vscode.window.activeTextEditor && isAsciidocFile(vscode.window.activeTextEditor.document) && + vscode.window.activeTextEditor.document.uri.fsPath === resource.fsPath) { + return this.tryRevealLine(vscode.window.activeTextEditor, args.fragment) + } else { + return vscode.workspace.openTextDocument(resource) + .then(vscode.window.showTextDocument) + .then((editor) => this.tryRevealLine(editor, args.fragment)) + } + } - private async tryRevealLine(editor: vscode.TextEditor, fragment?: string) { - if (editor && fragment) { - const toc = new TableOfContentsProvider(this.engine, editor.document); - const entry = await toc.lookup(fragment); - if (entry) { - return editor.revealRange(new vscode.Range(entry.line, 0, entry.line, 0), vscode.TextEditorRevealType.AtTop); - } - const lineNumberFragment = fragment.match(/^L(\d+)$/i); - if (lineNumberFragment) { - const line = +lineNumberFragment[1] - 1; - if (!isNaN(line)) { - return editor.revealRange(new vscode.Range(line, 0, line, 0), vscode.TextEditorRevealType.AtTop); - } - } - } - } + private async tryRevealLine (editor: vscode.TextEditor, fragment?: string) { + if (editor && fragment) { + const toc = new TableOfContentsProvider(this.engine, editor.document) + const entry = await toc.lookup(fragment) + if (entry) { + return editor.revealRange(new vscode.Range(entry.line, 0, entry.line, 0), vscode.TextEditorRevealType.AtTop) + } + const lineNumberFragment = fragment.match(/^L(\d+)$/i) + if (lineNumberFragment) { + const line = +lineNumberFragment[1] - 1 + if (!isNaN(line)) { + return editor.revealRange(new vscode.Range(line, 0, line, 0), vscode.TextEditorRevealType.AtTop) + } + } + } + } } - -export async function resolveLinkToAsciidocFile(path: string): Promise { +export async function resolveLinkToAsciidocFile (path: string): Promise { try { - const standardLink = await tryResolveLinkToAsciidocFile(path); + const standardLink = await tryResolveLinkToAsciidocFile(path) if (standardLink) { - return standardLink; + return standardLink } } catch { // Noop @@ -87,23 +84,23 @@ export async function resolveLinkToAsciidocFile(path: string): Promise { - const resource = vscode.Uri.file(path); +async function tryResolveLinkToAsciidocFile (path: string): Promise { + const resource = vscode.Uri.file(path) - let document: vscode.TextDocument; + let document: vscode.TextDocument try { - document = await vscode.workspace.openTextDocument(resource); + document = await vscode.workspace.openTextDocument(resource) } catch { - return undefined; + return undefined } if (isAsciidocFile(document)) { - return document.uri; + return document.uri } - return undefined; + return undefined } diff --git a/src/commands/pasteImage.ts b/src/commands/pasteImage.ts index ccaaf829..1edba65a 100644 --- a/src/commands/pasteImage.ts +++ b/src/commands/pasteImage.ts @@ -1,16 +1,15 @@ -import { Command } from '../commandManager'; -import { window } from 'vscode'; -import * as path from 'path'; -import { Import } from '../image-paste'; +import { Command } from '../commandManager' +import { window } from 'vscode' +import { Import } from '../image-paste' export class PasteImage implements Command { public readonly id = 'asciidoc.pasteImage'; - public execute() { + public execute () { try { - Import.Image.importFromClipboard(undefined); + Import.Image.importFromClipboard(undefined) } catch (e) { - window.showErrorMessage(e); + window.showErrorMessage(e) } } } diff --git a/src/commands/refreshPreview.ts b/src/commands/refreshPreview.ts index b892d046..fdb6079b 100644 --- a/src/commands/refreshPreview.ts +++ b/src/commands/refreshPreview.ts @@ -2,17 +2,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Command } from '../commandManager'; -import { AsciidocPreviewManager } from '../features/previewManager'; +import { Command } from '../commandManager' +import { AsciidocPreviewManager } from '../features/previewManager' export class RefreshPreviewCommand implements Command { - public readonly id = 'asciidoc.preview.refresh'; + public readonly id = 'asciidoc.preview.refresh' - public constructor( - private readonly webviewManager: AsciidocPreviewManager - ) { } + public constructor (private readonly webviewManager: AsciidocPreviewManager) { + this.webviewManager = webviewManager + } - public execute() { - this.webviewManager.refresh(); - } + public execute () { + this.webviewManager.refresh() + } } diff --git a/src/commands/saveDocbook.ts b/src/commands/saveDocbook.ts index 8308af97..6eea1ea4 100644 --- a/src/commands/saveDocbook.ts +++ b/src/commands/saveDocbook.ts @@ -1,22 +1,20 @@ import * as vscode from 'vscode' import * as fs from 'fs' import * as path from 'path' -import { exec } from "child_process" -import { isNullOrUndefined } from 'util' +import { exec } from 'child_process' import { Command } from '../commandManager' import { AsciidocEngine } from '../asciidocEngine' export class SaveDocbook implements Command { public readonly id = 'asciidoc.saveDocbook' - constructor( - private readonly engine: AsciidocEngine - ) { } + constructor (private readonly engine: AsciidocEngine) { + this.engine = engine + } - public async execute() { + public async execute () { const editor = vscode.window.activeTextEditor - if(isNullOrUndefined(editor)) - return + if (editor === null || editor === undefined) { return } const doc = editor.document const text = doc.getText() @@ -25,44 +23,43 @@ export class SaveDocbook implements Command { let fsPath if (doc.isUntitled) { - fsPath = path.join(docPath.dir, "untitled.xml") + fsPath = path.join(docPath.dir, 'untitled.xml') } else { - fsPath = path.join(docPath.dir, docPath.name+".xml") + fsPath = path.join(docPath.dir, docPath.name + '.xml') } - const config = vscode.workspace.getConfiguration('asciidoc', doc.uri); - const docbookVersion = config.get('saveDocbook.docbookVersion', 'docbook5'); + const config = vscode.workspace.getConfiguration('asciidoc', doc.uri) + const docbookVersion = config.get('saveDocbook.docbookVersion', 'docbook5') const output = await this.engine.render(doc.uri, true, text, true, docbookVersion) - fs.writeFile(fsPath, output, function(err) { - if(err) { - vscode.window.showErrorMessage('Error writing file ' + fsPath + "\n" + err.toString()) + fs.writeFile(fsPath, output, function (err) { + if (err) { + vscode.window.showErrorMessage('Error writing file ' + fsPath + '\n' + err.toString()) return } vscode.window.showInformationMessage('Successfully converted to ', fsPath) .then((selection) => { if (selection === fsPath) { - switch (process.platform) - { + switch (process.platform) { // Use backticks for unix systems to run the open command directly // This avoids having to wrap the command AND path in quotes which // breaks if there is a single quote (') in the path - case 'win32': - exec(`"${fsPath.replace('"', '\\"')}"`); - break; - case 'darwin': - exec(`\`open "${fsPath.replace('"', '\\"')}" ; exit\``); - break; - case 'linux': - exec(`\`xdg-open "${fsPath.replace('"', '\\"')}" ; exit\``); - break; - default: - vscode.window.showWarningMessage("Output type is not supported"); - break; + case 'win32': + exec(`"${fsPath.replace('"', '\\"')}"`) + break + case 'darwin': + exec(`\`open "${fsPath.replace('"', '\\"')}" ; exit\``) + break + case 'linux': + exec(`\`xdg-open "${fsPath.replace('"', '\\"')}" ; exit\``) + break + default: + vscode.window.showWarningMessage('Output type is not supported') + break } } - }); - }); + }) + }) } } diff --git a/src/commands/saveHTML.ts b/src/commands/saveHTML.ts index 73d71436..d029f3fa 100644 --- a/src/commands/saveHTML.ts +++ b/src/commands/saveHTML.ts @@ -1,22 +1,20 @@ import * as vscode from 'vscode' import * as fs from 'fs' import * as path from 'path' -import { exec } from "child_process" -import { isNullOrUndefined } from 'util' +import { exec } from 'child_process' import { Command } from '../commandManager' import { AsciidocEngine } from '../asciidocEngine' export class SaveHTML implements Command { public readonly id = 'asciidoc.saveHTML' - constructor( - private readonly engine: AsciidocEngine - ) { } + constructor (private readonly engine: AsciidocEngine) { + this.engine = engine + } - public async execute() { + public async execute () { const editor = vscode.window.activeTextEditor - if(isNullOrUndefined(editor)) - return + if (editor === null || editor === undefined) { return } const doc = editor.document const text = doc.getText() @@ -25,41 +23,40 @@ export class SaveHTML implements Command { let htmlPath if (doc.isUntitled) { - htmlPath = path.join(docPath.dir, "untitled.html") + htmlPath = path.join(docPath.dir, 'untitled.html') } else { - htmlPath = path.join(docPath.dir, docPath.name+".html") + htmlPath = path.join(docPath.dir, docPath.name + '.html') } const html = await this.engine.render(doc.uri, true, text, true, 'html5') - fs.writeFile(htmlPath, html, function(err) { - if(err) { - vscode.window.showErrorMessage('Error writing file ' + htmlPath + "\n" + err.toString()) + fs.writeFile(htmlPath, html, function (err) { + if (err) { + vscode.window.showErrorMessage('Error writing file ' + htmlPath + '\n' + err.toString()) return } vscode.window.showInformationMessage('Successfully converted to ', htmlPath) .then((selection) => { if (selection === htmlPath) { - switch (process.platform) - { + switch (process.platform) { // Use backticks for unix systems to run the open command directly // This avoids having to wrap the command AND path in quotes which // breaks if there is a single quote (') in the path - case 'win32': - exec(`"${htmlPath.replace('"', '\\"')}"`); - break; - case 'darwin': - exec(`\`open "${htmlPath.replace('"', '\\"')}" ; exit\``); - break; - case 'linux': - exec(`\`xdg-open "${htmlPath.replace('"', '\\"')}" ; exit\``); - break; - default: - vscode. window.showWarningMessage("Output type is not supported"); - break; + case 'win32': + exec(`"${htmlPath.replace('"', '\\"')}"`) + break + case 'darwin': + exec(`\`open "${htmlPath.replace('"', '\\"')}" ; exit\``) + break + case 'linux': + exec(`\`xdg-open "${htmlPath.replace('"', '\\"')}" ; exit\``) + break + default: + vscode.window.showWarningMessage('Output type is not supported') + break } } - }); - }); + }) + }) } } diff --git a/src/commands/showPreview.ts b/src/commands/showPreview.ts index 5f4095fe..c992691e 100644 --- a/src/commands/showPreview.ts +++ b/src/commands/showPreview.ts @@ -2,92 +2,90 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; +import * as vscode from 'vscode' -import { Command } from '../commandManager'; -import { AsciidocPreviewManager } from '../features/previewManager'; -import { PreviewSettings } from '../features/preview'; +import { Command } from '../commandManager' +import { AsciidocPreviewManager } from '../features/previewManager' +import { PreviewSettings } from '../features/preview' interface ShowPreviewSettings { - readonly sideBySide?: boolean; - readonly locked?: boolean; + readonly sideBySide?: boolean; + readonly locked?: boolean; } -async function showPreview( +async function showPreview ( webviewManager: AsciidocPreviewManager, uri: vscode.Uri | undefined, previewSettings: ShowPreviewSettings ): Promise { - let resource = uri; + let resource = uri if (!(resource instanceof vscode.Uri)) { if (vscode.window.activeTextEditor) { // we are relaxed and don't check for asciidoc files - resource = vscode.window.activeTextEditor.document.uri; + resource = vscode.window.activeTextEditor.document.uri } } if (!(resource instanceof vscode.Uri)) { if (!vscode.window.activeTextEditor) { // this is most likely toggling the preview - return vscode.commands.executeCommand('asciidoc.showSource'); + return vscode.commands.executeCommand('asciidoc.showSource') } // nothing found that could be shown or toggled - return; + return } - const resourceColumn = (vscode.window.activeTextEditor && vscode.window.activeTextEditor.viewColumn) || vscode.ViewColumn.One; + const resourceColumn = (vscode.window.activeTextEditor && vscode.window.activeTextEditor.viewColumn) || vscode.ViewColumn.One webviewManager.preview(resource, { resourceColumn: resourceColumn, previewColumn: previewSettings.sideBySide ? resourceColumn + 1 : resourceColumn, locked: !!previewSettings.locked, - }); - + }) } export class ShowPreviewCommand implements Command { - public readonly id = 'asciidoc.showPreview'; + public readonly id = 'asciidoc.showPreview'; - public constructor( - private readonly webviewManager: AsciidocPreviewManager - ) { } + constructor (private readonly webviewManager: AsciidocPreviewManager) { + this.webviewManager = webviewManager + } - public execute(mainUri?: vscode.Uri, allUris?: vscode.Uri[], previewSettings?: PreviewSettings) { - for (const uri of Array.isArray(allUris) ? allUris : [mainUri]) { - showPreview(this.webviewManager, uri, { - sideBySide: false, - locked: previewSettings && previewSettings.locked, - }); - } - } + public execute (mainUri?: vscode.Uri, allUris?: vscode.Uri[], previewSettings?: PreviewSettings) { + for (const uri of Array.isArray(allUris) ? allUris : [mainUri]) { + showPreview(this.webviewManager, uri, { + sideBySide: false, + locked: previewSettings && previewSettings.locked, + }) + } + } } export class ShowPreviewToSideCommand implements Command { - public readonly id = 'asciidoc.showPreviewToSide'; + public readonly id = 'asciidoc.showPreviewToSide'; - public constructor( - private readonly webviewManager: AsciidocPreviewManager - ) { } + constructor (private readonly webviewManager: AsciidocPreviewManager) { + this.webviewManager = webviewManager + } - public execute(uri?: vscode.Uri, previewSettings?: PreviewSettings) { - showPreview(this.webviewManager, uri, { - sideBySide: true, - locked: previewSettings && previewSettings.locked, - }); - } + public execute (uri?: vscode.Uri, previewSettings?: PreviewSettings) { + showPreview(this.webviewManager, uri, { + sideBySide: true, + locked: previewSettings && previewSettings.locked, + }) + } } - export class ShowLockedPreviewToSideCommand implements Command { - public readonly id = 'asciidoc.showLockedPreviewToSide'; + public readonly id = 'asciidoc.showLockedPreviewToSide'; - public constructor( - private readonly webviewManager: AsciidocPreviewManager - ) { } + constructor (private readonly webviewManager: AsciidocPreviewManager) { + this.webviewManager = webviewManager + } - public execute(uri?: vscode.Uri) { - showPreview(this.webviewManager, uri, { - sideBySide: true, - locked: true, - }); - } + public execute (uri?: vscode.Uri) { + showPreview(this.webviewManager, uri, { + sideBySide: true, + locked: true, + }) + } } diff --git a/src/commands/showPreviewSecuritySelector.ts b/src/commands/showPreviewSecuritySelector.ts index 9b96a65a..7d337ac3 100644 --- a/src/commands/showPreviewSecuritySelector.ts +++ b/src/commands/showPreviewSecuritySelector.ts @@ -2,28 +2,29 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { Command } from '../commandManager'; -import { PreviewSecuritySelector } from '../security'; -import { isAsciidocFile } from '../util/file'; -import { AsciidocPreviewManager } from '../features/previewManager'; +import * as vscode from 'vscode' +import { Command } from '../commandManager' +import { PreviewSecuritySelector } from '../security' +import { isAsciidocFile } from '../util/file' +import { AsciidocPreviewManager } from '../features/previewManager' export class ShowPreviewSecuritySelectorCommand implements Command { - public readonly id = 'asciidoc.showPreviewSecuritySelector'; + public readonly id = 'asciidoc.showPreviewSecuritySelector' - public constructor( - private readonly previewSecuritySelector: PreviewSecuritySelector, - private readonly previewManager: AsciidocPreviewManager - ) { } + constructor (private readonly previewSecuritySelector: PreviewSecuritySelector, + private readonly previewManager: AsciidocPreviewManager) { + this.previewManager = previewManager + this.previewSecuritySelector = previewSecuritySelector + } - public execute(resource: string | undefined) { - if (this.previewManager.activePreviewResource) { - this.previewSecuritySelector.showSecutitySelectorForResource(this.previewManager.activePreviewResource); - } else if (resource) { - const source = vscode.Uri.parse(resource); - this.previewSecuritySelector.showSecutitySelectorForResource(source.query ? vscode.Uri.parse(source.query) : source); - } else if (vscode.window.activeTextEditor && isAsciidocFile(vscode.window.activeTextEditor.document)) { - this.previewSecuritySelector.showSecutitySelectorForResource(vscode.window.activeTextEditor.document.uri); - } - } + public execute (resource: string | undefined) { + if (this.previewManager.activePreviewResource) { + this.previewSecuritySelector.showSecuritySelectorForResource(this.previewManager.activePreviewResource) + } else if (resource) { + const source = vscode.Uri.parse(resource) + this.previewSecuritySelector.showSecuritySelectorForResource(source.query ? vscode.Uri.parse(source.query) : source) + } else if (vscode.window.activeTextEditor && isAsciidocFile(vscode.window.activeTextEditor.document)) { + this.previewSecuritySelector.showSecuritySelectorForResource(vscode.window.activeTextEditor.document.uri) + } + } } diff --git a/src/commands/showSource.ts b/src/commands/showSource.ts index 1b6dcdbd..37b669ff 100644 --- a/src/commands/showSource.ts +++ b/src/commands/showSource.ts @@ -2,22 +2,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { Command } from '../commandManager'; -import { AsciidocPreviewManager } from '../features/previewManager'; +import * as vscode from 'vscode' +import { Command } from '../commandManager' +import { AsciidocPreviewManager } from '../features/previewManager' export class ShowSourceCommand implements Command { - public readonly id = 'asciidoc.showSource'; + public readonly id = 'asciidoc.showSource'; - public constructor( - private readonly previewManager: AsciidocPreviewManager - ) { } + constructor (private readonly previewManager: AsciidocPreviewManager) { + this.previewManager = previewManager + } - public execute() { - if (this.previewManager.activePreviewResource) { - return vscode.workspace.openTextDocument(this.previewManager.activePreviewResource) - .then((document) => vscode.window.showTextDocument(document)); - } - return undefined; - } + public execute () { + if (this.previewManager.activePreviewResource) { + return vscode.workspace.openTextDocument(this.previewManager.activePreviewResource) + .then((document) => vscode.window.showTextDocument(document)) + } + return undefined + } } diff --git a/src/commands/toggleLock.ts b/src/commands/toggleLock.ts index 71972b91..00ff9a7d 100644 --- a/src/commands/toggleLock.ts +++ b/src/commands/toggleLock.ts @@ -2,17 +2,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Command } from '../commandManager'; -import { AsciidocPreviewManager } from '../features/previewManager'; +import { Command } from '../commandManager' +import { AsciidocPreviewManager } from '../features/previewManager' export class ToggleLockCommand implements Command { - public readonly id = 'asciidoc.preview.toggleLock'; + public readonly id = 'asciidoc.preview.toggleLock' - public constructor( - private readonly previewManager: AsciidocPreviewManager - ) { } + public constructor (private readonly previewManager: AsciidocPreviewManager) { + this.previewManager = previewManager + } - public execute() { - this.previewManager.toggleLock(); - } + public execute () { + this.previewManager.toggleLock() + } } diff --git a/src/extension.ts b/src/extension.ts index 7647b2c6..3c2269f8 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -2,86 +2,80 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { CommandManager } from './commandManager'; -import * as commands from './commands/index'; -import LinkProvider from './features/documentLinkProvider'; -import AdocDocumentSymbolProvider from './features/documentSymbolProvider'; +import * as vscode from 'vscode' +import { CommandManager } from './commandManager' +import * as commands from './commands/index' +import LinkProvider from './features/documentLinkProvider' +import AdocDocumentSymbolProvider from './features/documentSymbolProvider' // import AsciidocFoldingProvider from './features/foldingProvider'; -import { AsciidocContentProvider } from './features/previewContentProvider'; -import { AsciidocPreviewManager } from './features/previewManager'; -import AsciidocWorkspaceSymbolProvider from './features/workspaceSymbolProvider'; -import { Logger } from './logger'; -import { AsciidocEngine } from './asciidocEngine'; -import { getAsciidocExtensionContributions } from './asciidocExtensions'; -import { ExtensionContentSecurityPolicyArbiter, PreviewSecuritySelector } from './security'; -import { githubSlugifier } from './slugify'; -import { AttributeCompleter } from './features/attributeCompleter'; -import { AsciidocFileIncludeAutoCompletionMonitor } from './util/includeAutoCompletion'; +import { AsciidocContentProvider } from './features/previewContentProvider' +import { AsciidocPreviewManager } from './features/previewManager' +import AsciidocWorkspaceSymbolProvider from './features/workspaceSymbolProvider' +import { Logger } from './logger' +import { AsciidocEngine } from './asciidocEngine' +import { getAsciidocExtensionContributions } from './asciidocExtensions' +import { ExtensionContentSecurityPolicyArbiter, PreviewSecuritySelector } from './security' +import { githubSlugifier } from './slugify' +import { AttributeCompleter } from './features/attributeCompleter' +import { AsciidocFileIncludeAutoCompletionMonitor } from './util/includeAutoCompletion' +export function activate (context: vscode.ExtensionContext) { + const contributions = getAsciidocExtensionContributions(context) -export function activate(context: vscode.ExtensionContext) -{ + const cspArbiter = new ExtensionContentSecurityPolicyArbiter(context.globalState, context.workspaceState) - const contributions = getAsciidocExtensionContributions(context); + const errorCollection = vscode.languages.createDiagnosticCollection('asciidoc') - const cspArbiter = new ExtensionContentSecurityPolicyArbiter(context.globalState, context.workspaceState); - - const errorCollection = vscode.languages.createDiagnosticCollection('asciidoc'); - - const engine = new AsciidocEngine(contributions, githubSlugifier, errorCollection); - const logger = new Logger(); - logger.log("Extension was started"); + const engine = new AsciidocEngine(contributions, githubSlugifier, errorCollection) + const logger = new Logger() + logger.log('Extension was started') const selector: vscode.DocumentSelector = [ { language: 'asciidoc', scheme: 'file' }, { language: 'asciidoc', scheme: 'untitled' }, - ]; + ] - const contentProvider = new AsciidocContentProvider(engine, context, cspArbiter, contributions, logger); - const symbolProvider = new AdocDocumentSymbolProvider(engine, null, null, null, null); - const previewManager = new AsciidocPreviewManager(contentProvider, logger, contributions); - context.subscriptions.push(previewManager); - const includeAutoCompletionMonitor = new AsciidocFileIncludeAutoCompletionMonitor(); - context.subscriptions.push(includeAutoCompletionMonitor); + const contentProvider = new AsciidocContentProvider(engine, context, cspArbiter, contributions, logger) + const symbolProvider = new AdocDocumentSymbolProvider(engine, null) + const previewManager = new AsciidocPreviewManager(contentProvider, logger, contributions) + context.subscriptions.push(previewManager) + const includeAutoCompletionMonitor = new AsciidocFileIncludeAutoCompletionMonitor() + context.subscriptions.push(includeAutoCompletionMonitor) - context.subscriptions.push(vscode.languages.registerDocumentSymbolProvider(selector, symbolProvider)); - context.subscriptions.push(vscode.languages.registerDocumentLinkProvider(selector, new LinkProvider())); + context.subscriptions.push(vscode.languages.registerDocumentSymbolProvider(selector, symbolProvider)) + context.subscriptions.push(vscode.languages.registerDocumentLinkProvider(selector, new LinkProvider())) // context.subscriptions.push(vscode.languages.registerFoldingRangeProvider(selector, new AsciidocFoldingProvider(engine))); - context.subscriptions.push(vscode.languages.registerWorkspaceSymbolProvider(new AsciidocWorkspaceSymbolProvider(symbolProvider))); - context.subscriptions.push(vscode.languages.registerCompletionItemProvider(selector, new AttributeCompleter(), '{')); - const previewSecuritySelector = new PreviewSecuritySelector(cspArbiter, previewManager); + context.subscriptions.push(vscode.languages.registerWorkspaceSymbolProvider(new AsciidocWorkspaceSymbolProvider(symbolProvider))) + context.subscriptions.push(vscode.languages.registerCompletionItemProvider(selector, new AttributeCompleter(), '{')) + const previewSecuritySelector = new PreviewSecuritySelector(cspArbiter, previewManager) - const commandManager = new CommandManager(); - context.subscriptions.push(commandManager); - commandManager.register(new commands.ShowPreviewCommand(previewManager)); - commandManager.register(new commands.ShowPreviewToSideCommand(previewManager)); - commandManager.register(new commands.ShowLockedPreviewToSideCommand(previewManager)); - commandManager.register(new commands.ShowSourceCommand(previewManager)); - commandManager.register(new commands.RefreshPreviewCommand(previewManager)); - commandManager.register(new commands.MoveCursorToPositionCommand()); - commandManager.register(new commands.ShowPreviewSecuritySelectorCommand(previewSecuritySelector, previewManager)); - commandManager.register(new commands.OpenDocumentLinkCommand(engine)); - commandManager.register(new commands.ExportAsPDF(engine, logger)); - commandManager.register(new commands.PasteImage()); - commandManager.register(new commands.ToggleLockCommand(previewManager)); - commandManager.register(new commands.ShowPreviewCommand(previewManager)); - commandManager.register(new commands.SaveHTML(engine)); - commandManager.register(new commands.SaveDocbook(engine)); + const commandManager = new CommandManager() + context.subscriptions.push(commandManager) + commandManager.register(new commands.ShowPreviewCommand(previewManager)) + commandManager.register(new commands.ShowPreviewToSideCommand(previewManager)) + commandManager.register(new commands.ShowLockedPreviewToSideCommand(previewManager)) + commandManager.register(new commands.ShowSourceCommand(previewManager)) + commandManager.register(new commands.RefreshPreviewCommand(previewManager)) + commandManager.register(new commands.MoveCursorToPositionCommand()) + commandManager.register(new commands.ShowPreviewSecuritySelectorCommand(previewSecuritySelector, previewManager)) + commandManager.register(new commands.OpenDocumentLinkCommand(engine)) + commandManager.register(new commands.ExportAsPDF(engine, logger)) + commandManager.register(new commands.PasteImage()) + commandManager.register(new commands.ToggleLockCommand(previewManager)) + commandManager.register(new commands.ShowPreviewCommand(previewManager)) + commandManager.register(new commands.SaveHTML(engine)) + commandManager.register(new commands.SaveDocbook(engine)) - context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => - { - logger.updateConfiguration(); - previewManager.updateConfiguration(); - })); + context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => { + logger.updateConfiguration() + previewManager.updateConfiguration() + })) - context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor((editor) => - { - errorCollection.clear(); - })); + context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor(() => { + errorCollection.clear() + })) - context.subscriptions.push(vscode.workspace.onDidSaveTextDocument(() => - { - previewManager.refresh(true); - })); + context.subscriptions.push(vscode.workspace.onDidSaveTextDocument(() => { + previewManager.refresh(true) + })) } diff --git a/src/features/attributeCompleter.ts b/src/features/attributeCompleter.ts index 37951e6b..5ede192f 100644 --- a/src/features/attributeCompleter.ts +++ b/src/features/attributeCompleter.ts @@ -1,23 +1,20 @@ -import * as vscode from 'vscode'; +import * as vscode from 'vscode' -import { AsciidocParser } from '../text-parser'; +import { AsciidocParser } from '../text-parser' export class AttributeCompleter { - - provideCompletionItems(document: vscode.TextDocument, position: vscode.Position) { - + provideCompletionItems (document: vscode.TextDocument, _position: vscode.Position) { const adoc = new AsciidocParser(document.uri.fsPath) adoc.parseText(document.getText(), document) const attributes = adoc.document.getAttributes() - let attribs = [] - + const attribs = [] + for (const key in attributes) { - let attrib = new vscode.CompletionItem(key, vscode.CompletionItemKind.Variable) + const attrib = new vscode.CompletionItem(key, vscode.CompletionItemKind.Variable) attrib.detail = attributes[key].toString() attribs.push(attrib) } return attribs - } } diff --git a/src/features/documentLinkProvider.ts b/src/features/documentLinkProvider.ts index 5d79a616..76935bbf 100644 --- a/src/features/documentLinkProvider.ts +++ b/src/features/documentLinkProvider.ts @@ -2,160 +2,160 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as path from 'path'; -import * as vscode from 'vscode'; -import { OpenDocumentLinkCommand } from '../commands/openDocumentLink'; -import { getUriForLinkWithKnownExternalScheme } from '../util/links'; +import * as path from 'path' +import * as vscode from 'vscode' +import { OpenDocumentLinkCommand } from '../commands/openDocumentLink' +import { getUriForLinkWithKnownExternalScheme } from '../util/links' -function normalizeLink( +function normalizeLink ( document: vscode.TextDocument, link: string, base: string ): vscode.Uri { - const externalSchemeUri = getUriForLinkWithKnownExternalScheme(link); + const externalSchemeUri = getUriForLinkWithKnownExternalScheme(link) if (externalSchemeUri) { - return externalSchemeUri; + return externalSchemeUri } // Assume it must be an relative or absolute file path // Use a fake scheme to avoid parse warnings - const tempUri = vscode.Uri.parse(`vscode-resource:${link}`); + const tempUri = vscode.Uri.parse(`vscode-resource:${link}`) - let resourcePath = tempUri.path; + let resourcePath = tempUri.path if (!tempUri.path) { - resourcePath = document.uri.path; + resourcePath = document.uri.path } else if (tempUri.path[0] === '/') { - const root = vscode.workspace.getWorkspaceFolder(document.uri); + const root = vscode.workspace.getWorkspaceFolder(document.uri) if (root) { - resourcePath = path.join(root.uri.fsPath, tempUri.path); + resourcePath = path.join(root.uri.fsPath, tempUri.path) } } else { - resourcePath = path.join(base, tempUri.path); + resourcePath = path.join(base, tempUri.path) } - return OpenDocumentLinkCommand.createCommandUri(resourcePath, tempUri.fragment); + return OpenDocumentLinkCommand.createCommandUri(resourcePath, tempUri.fragment) } -function matchAll( +function matchAll ( pattern: RegExp, text: string ): Array { - const out: RegExpMatchArray[] = []; - pattern.lastIndex = 0; - let match: RegExpMatchArray | null; + const out: RegExpMatchArray[] = [] + pattern.lastIndex = 0 + let match: RegExpMatchArray | null while ((match = pattern.exec(text))) { - out.push(match); + out.push(match) } - return out; + return out } export default class LinkProvider implements vscode.DocumentLinkProvider { - private readonly linkPattern = /(\[[^\]]*\]\(\s*)((([^\s\(\)]|\(\S*?\))+))\s*(".*?")?\)/g; - private readonly referenceLinkPattern = /(\[([^\]]+)\]\[\s*?)([^\s\]]*?)\]/g; - private readonly definitionPattern = /^([\t ]*\[([^\]]+)\]:\s*)(\S+)/gm; - - public provideDocumentLinks( - document: vscode.TextDocument, - _token: vscode.CancellationToken - ): vscode.DocumentLink[] { - const base = path.dirname(document.uri.fsPath); - const text = document.getText(); - - return this.providerInlineLinks(text, document, base) - .concat(this.provideReferenceLinks(text, document, base)); - } - - private providerInlineLinks( - text: string, - document: vscode.TextDocument, - base: string - ): vscode.DocumentLink[] { - const results: vscode.DocumentLink[] = []; - for (const match of matchAll(this.linkPattern, text)) { - const pre = match[1]; - const link = match[2]; - const offset = (match.index || 0) + pre.length; - const linkStart = document.positionAt(offset); - const linkEnd = document.positionAt(offset + link.length); - try { - results.push(new vscode.DocumentLink( - new vscode.Range(linkStart, linkEnd), - normalizeLink(document, link, base))); - } catch (e) { - // noop - } - } - - return results; - } - - private provideReferenceLinks( - text: string, - document: vscode.TextDocument, - base: string - ): vscode.DocumentLink[] { - const results: vscode.DocumentLink[] = []; - - const definitions = this.getDefinitions(text, document); - for (const match of matchAll(this.referenceLinkPattern, text)) { - let linkStart: vscode.Position; - let linkEnd: vscode.Position; - let reference = match[3]; - if (reference) { // [text][ref] - const pre = match[1]; - const offset = (match.index || 0) + pre.length; - linkStart = document.positionAt(offset); - linkEnd = document.positionAt(offset + reference.length); - } else if (match[2]) { // [ref][] - reference = match[2]; - const offset = (match.index || 0) + 1; - linkStart = document.positionAt(offset); - linkEnd = document.positionAt(offset + match[2].length); - } else { - continue; - } - - try { - const link = definitions.get(reference); - if (link) { - results.push(new vscode.DocumentLink( - new vscode.Range(linkStart, linkEnd), - vscode.Uri.parse(`command:_asciidoc.moveCursorToPosition?${encodeURIComponent(JSON.stringify([link.linkRange.start.line, link.linkRange.start.character]))}`))); - } - } catch (e) { - // noop - } - } - - for (const definition of Array.from(definitions.values())) { - try { - results.push(new vscode.DocumentLink( - definition.linkRange, - normalizeLink(document, definition.link, base))); - } catch (e) { - // noop - } - } - - return results; - } - - private getDefinitions(text: string, document: vscode.TextDocument) { - const out = new Map(); - for (const match of matchAll(this.definitionPattern, text)) { - const pre = match[1]; - const reference = match[2]; - const link = match[3].trim(); - - const offset = (match.index || 0) + pre.length; - const linkStart = document.positionAt(offset); - const linkEnd = document.positionAt(offset + link.length); - - out.set(reference, { - link: link, - linkRange: new vscode.Range(linkStart, linkEnd), - }); - } - return out; - } + private readonly linkPattern = /(\[[^\]]*\]\(\s*)((([^\s()]|\(\S*?\))+))\s*(".*?")?\)/g; + private readonly referenceLinkPattern = /(\[([^\]]+)\]\[\s*?)([^\s\]]*?)\]/g; + private readonly definitionPattern = /^([\t ]*\[([^\]]+)\]:\s*)(\S+)/gm; + + public provideDocumentLinks ( + document: vscode.TextDocument, + _token: vscode.CancellationToken + ): vscode.DocumentLink[] { + const base = path.dirname(document.uri.fsPath) + const text = document.getText() + + return this.providerInlineLinks(text, document, base) + .concat(this.provideReferenceLinks(text, document, base)) + } + + private providerInlineLinks ( + text: string, + document: vscode.TextDocument, + base: string + ): vscode.DocumentLink[] { + const results: vscode.DocumentLink[] = [] + for (const match of matchAll(this.linkPattern, text)) { + const pre = match[1] + const link = match[2] + const offset = (match.index || 0) + pre.length + const linkStart = document.positionAt(offset) + const linkEnd = document.positionAt(offset + link.length) + try { + results.push(new vscode.DocumentLink( + new vscode.Range(linkStart, linkEnd), + normalizeLink(document, link, base))) + } catch (e) { + // noop + } + } + + return results + } + + private provideReferenceLinks ( + text: string, + document: vscode.TextDocument, + base: string + ): vscode.DocumentLink[] { + const results: vscode.DocumentLink[] = [] + + const definitions = this.getDefinitions(text, document) + for (const match of matchAll(this.referenceLinkPattern, text)) { + let linkStart: vscode.Position + let linkEnd: vscode.Position + let reference = match[3] + if (reference) { // [text][ref] + const pre = match[1] + const offset = (match.index || 0) + pre.length + linkStart = document.positionAt(offset) + linkEnd = document.positionAt(offset + reference.length) + } else if (match[2]) { // [ref][] + reference = match[2] + const offset = (match.index || 0) + 1 + linkStart = document.positionAt(offset) + linkEnd = document.positionAt(offset + match[2].length) + } else { + continue + } + + try { + const link = definitions.get(reference) + if (link) { + results.push(new vscode.DocumentLink( + new vscode.Range(linkStart, linkEnd), + vscode.Uri.parse(`command:_asciidoc.moveCursorToPosition?${encodeURIComponent(JSON.stringify([link.linkRange.start.line, link.linkRange.start.character]))}`))) + } + } catch (e) { + // noop + } + } + + for (const definition of Array.from(definitions.values())) { + try { + results.push(new vscode.DocumentLink( + definition.linkRange, + normalizeLink(document, definition.link, base))) + } catch (e) { + // noop + } + } + + return results + } + + private getDefinitions (text: string, document: vscode.TextDocument) { + const out = new Map() + for (const match of matchAll(this.definitionPattern, text)) { + const pre = match[1] + const reference = match[2] + const link = match[3].trim() + + const offset = (match.index || 0) + pre.length + const linkStart = document.positionAt(offset) + const linkEnd = document.positionAt(offset + link.length) + + out.set(reference, { + link: link, + linkRange: new vscode.Range(linkStart, linkEnd), + }) + } + return out + } } diff --git a/src/features/documentSymbolProvider.ts b/src/features/documentSymbolProvider.ts index 4ed6fe3a..09fedc36 100644 --- a/src/features/documentSymbolProvider.ts +++ b/src/features/documentSymbolProvider.ts @@ -2,90 +2,85 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { AsciidocEngine } from '../asciidocEngine'; -import { TableOfContentsProvider, SkinnyTextDocument, TocEntry } from '../tableOfContentsProvider'; +import * as vscode from 'vscode' +import { AsciidocEngine } from '../asciidocEngine' +import { TableOfContentsProvider, SkinnyTextDocument, TocEntry } from '../tableOfContentsProvider' interface AsciidocSymbol { - readonly level: number; - readonly parent: AsciidocSymbol | undefined; - readonly children: vscode.DocumentSymbol[]; + readonly level: number; + readonly parent: AsciidocSymbol | undefined; + readonly children: vscode.DocumentSymbol[]; } export default class AdocDocumentSymbolProvider implements vscode.DocumentSymbolProvider { - - constructor( - private readonly engine: AsciidocEngine, - private root: AsciidocSymbol = { - level: -Infinity, - children: [], - parent: undefined, - }, - private lastSymbolCall: number, - private lastRunTime: number = 1000, - private RunTimeFactor: number = 1.5 - ) { } - - public async provideDocumentSymbolInformation(document: SkinnyTextDocument): Promise { - const toc = await new TableOfContentsProvider(this.engine, document).getToc(); - return toc.map((entry) => this.toSymbolInformation(entry)); + private lastSymbolCall: number + private lastRunTime: number = 1000 + private RunTimeFactor: number = 1.5 + + constructor (private readonly engine: AsciidocEngine, private root: AsciidocSymbol = { + level: -Infinity, + children: [], + parent: undefined, + }) { + this.engine = engine + this.root = root } - public async provideDocumentSymbols(document: SkinnyTextDocument): Promise { - - const nextOKRunTime = this.lastSymbolCall + Math.max(this.lastRunTime * this.RunTimeFactor, 2000); - const startTime = (new Date()).getTime(); + public async provideDocumentSymbolInformation (document: SkinnyTextDocument): Promise { + const toc = await new TableOfContentsProvider(this.engine, document).getToc() + return toc.map((entry) => this.toSymbolInformation(entry)) + } - if (this.lastSymbolCall == undefined || startTime > nextOKRunTime) { + public async provideDocumentSymbols (document: SkinnyTextDocument): Promise { + const nextOKRunTime = this.lastSymbolCall + Math.max(this.lastRunTime * this.RunTimeFactor, 2000) + const startTime = (new Date()).getTime() - const toc = await new TableOfContentsProvider(this.engine, document).getToc(); + if (this.lastSymbolCall === undefined || startTime > nextOKRunTime) { + const toc = await new TableOfContentsProvider(this.engine, document).getToc() this.root = { level: -Infinity, children: [], parent: undefined, } - this.buildTree(this.root, toc); - - this.lastSymbolCall = (new Date).getTime(); - this.lastRunTime = this.lastSymbolCall - startTime; + this.buildTree(this.root, toc) + this.lastSymbolCall = (new Date()).getTime() + this.lastRunTime = this.lastSymbolCall - startTime } - return this.root.children; + return this.root.children } - private buildTree(parent: AsciidocSymbol, entries: TocEntry[]) { + private buildTree (parent: AsciidocSymbol, entries: TocEntry[]) { if (!entries.length) { - return; + return } - const entry = entries[0]; - const symbol = this.toDocumentSymbol(entry); - symbol.children = []; + const entry = entries[0] + const symbol = this.toDocumentSymbol(entry) + symbol.children = [] while (parent && entry.level <= parent.level) { - parent = parent.parent!; + parent = parent.parent! } - parent.children.push(symbol); - this.buildTree({ level: entry.level, children: symbol.children, parent }, entries.slice(1)); + parent.children.push(symbol) + this.buildTree({ level: entry.level, children: symbol.children, parent }, entries.slice(1)) } - - private toSymbolInformation(entry: TocEntry): vscode.SymbolInformation { + private toSymbolInformation (entry: TocEntry): vscode.SymbolInformation { return new vscode.SymbolInformation( entry.text, vscode.SymbolKind.String, '', - entry.location); + entry.location) } - private toDocumentSymbol(entry: TocEntry) { + private toDocumentSymbol (entry: TocEntry) { return new vscode.DocumentSymbol( entry.text, '', vscode.SymbolKind.String, entry.location.range, - entry.location.range); + entry.location.range) } - } diff --git a/src/features/foldingProvider.ts b/src/features/foldingProvider.ts index 2149b58b..9f0aa516 100644 --- a/src/features/foldingProvider.ts +++ b/src/features/foldingProvider.ts @@ -2,95 +2,93 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { AsciidocEngine } from '../asciidocEngine'; -import { TableOfContentsProvider } from '../tableOfContentsProvider'; +import * as vscode from 'vscode' +import { AsciidocEngine } from '../asciidocEngine' +import { TableOfContentsProvider } from '../tableOfContentsProvider' -const rangeLimit = 5000; +const rangeLimit = 5000 export default class AsciidocFoldingProvider implements vscode.FoldingRangeProvider { + constructor (private readonly engine: AsciidocEngine) { + this.engine = engine + } - constructor( - private readonly engine: AsciidocEngine - ) { } - - private async getRegions(document: vscode.TextDocument): Promise { - - const isStartRegion = (t: string) => /^\s*/.test(t); - const isEndRegion = (t: string) => /^\s*/.test(t); + private async getRegions (document: vscode.TextDocument): Promise { + const isStartRegion = (t: string) => /^\s*/.test(t) + const isEndRegion = (t: string) => /^\s*/.test(t) const isRegionMarker = (token: any) => token.type === 'html_block' && - (isStartRegion(token.content) || isEndRegion(token.content)); + (isStartRegion(token.content) || isEndRegion(token.content)) - - const tokens = await this.engine.parse(document.uri, document.getText()); + const tokens = await this.engine.parse(document.uri, document.getText()) const regionMarkers = tokens.filter(isRegionMarker) - .map((token) => ({ line: token.map[0], isStart: isStartRegion(token.content) })); + .map((token) => ({ line: token.map[0], isStart: isStartRegion(token.content) })) - const nestingStack: { line: number, isStart: boolean }[] = []; + const nestingStack: { line: number, isStart: boolean }[] = [] return regionMarkers .map((marker) => { if (marker.isStart) { - nestingStack.push(marker); + nestingStack.push(marker) } else if (nestingStack.length && nestingStack[nestingStack.length - 1].isStart) { - return new vscode.FoldingRange(nestingStack.pop()!.line, marker.line, vscode.FoldingRangeKind.Region); + return new vscode.FoldingRange(nestingStack.pop()!.line, marker.line, vscode.FoldingRangeKind.Region) } else { // noop: invalid nesting (i.e. [end, start] or [start, end, end]) } - return null; + return null }) - .filter((region: vscode.FoldingRange | null): region is vscode.FoldingRange => !!region); + .filter((region: vscode.FoldingRange | null): region is vscode.FoldingRange => !!region) } - public async provideFoldingRanges( + public async provideFoldingRanges ( document: vscode.TextDocument, + // eslint-disable-next-line @typescript-eslint/no-unused-vars _: vscode.FoldingContext, + // eslint-disable-next-line @typescript-eslint/no-unused-vars _token: vscode.CancellationToken ): Promise { const foldables = await Promise.all([ this.getRegions(document), this.getHeaderFoldingRanges(document), - this.getBlockFoldingRanges(document)]); - return [].concat.apply([], foldables).slice(0, rangeLimit); + this.getBlockFoldingRanges(document)]) + return [].concat.apply([], foldables).slice(0, rangeLimit) } - private async getHeaderFoldingRanges(document: vscode.TextDocument) { - const tocProvider = new TableOfContentsProvider(this.engine, document); - const toc = await tocProvider.getToc(); + private async getHeaderFoldingRanges (document: vscode.TextDocument) { + const tocProvider = new TableOfContentsProvider(this.engine, document) + const toc = await tocProvider.getToc() return toc.map((entry) => { - let endLine = entry.location.range.end.line; + let endLine = entry.location.range.end.line if (document.lineAt(endLine).isEmptyOrWhitespace && endLine >= entry.line + 1) { - endLine = endLine - 1; + endLine = endLine - 1 } - return new vscode.FoldingRange(entry.line, endLine); - }); + return new vscode.FoldingRange(entry.line, endLine) + }) } - private async getBlockFoldingRanges(document: vscode.TextDocument): Promise { - + private async getBlockFoldingRanges (document: vscode.TextDocument): Promise { const isFoldableToken = (token: any) => { switch (token.type) { - case 'fence': - case 'list_item_open': - return token.map[1] > token.map[0]; + case 'fence': + case 'list_item_open': + return token.map[1] > token.map[0] - case 'html_block': - return token.map[1] > token.map[0] + 1; + case 'html_block': + return token.map[1] > token.map[0] + 1 - default: - return false; + default: + return false } - }; + } - const tokens = await this.engine.parse(document.uri, document.getText()); - const multiLineListItems = tokens.filter(isFoldableToken); + const tokens = await this.engine.parse(document.uri, document.getText()) + const multiLineListItems = tokens.filter(isFoldableToken) return multiLineListItems.map((listItem) => { - const start = listItem.map[0]; - let end = listItem.map[1] - 1; + const start = listItem.map[0] + let end = listItem.map[1] - 1 if (document.lineAt(end).isEmptyOrWhitespace && end >= start + 1) { - end = end - 1; + end = end - 1 } - return new vscode.FoldingRange(start, end); - }); + return new vscode.FoldingRange(start, end) + }) } } diff --git a/src/features/preview.ts b/src/features/preview.ts index e23f5690..d8b90000 100644 --- a/src/features/preview.ts +++ b/src/features/preview.ts @@ -2,24 +2,22 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import * as path from 'path'; - -import { Logger } from '../logger'; -import { AsciidocContentProvider } from './previewContentProvider'; -import { disposeAll } from '../util/dispose'; - -import * as nls from 'vscode-nls'; -import { getVisibleLine, AsciidocFileTopmostLineMonitor } from '../util/topmostLineMonitor'; -import { AsciidocPreviewConfigurationManager } from './previewConfig'; -import { AsciidocContributions } from '../asciidocExtensions'; -import { isAsciidocFile } from '../util/file'; -import { resolveLinkToAsciidocFile } from '../commands/openDocumentLink'; -const localize = nls.loadMessageBundle(); - -export class AsciidocPreview -{ - +import * as vscode from 'vscode' +import * as path from 'path' + +import { Logger } from '../logger' +import { AsciidocContentProvider } from './previewContentProvider' +import { disposeAll } from '../util/dispose' + +import * as nls from 'vscode-nls' +import { getVisibleLine, AsciidocFileTopmostLineMonitor } from '../util/topmostLineMonitor' +import { AsciidocPreviewConfigurationManager } from './previewConfig' +import { AsciidocContributions } from '../asciidocExtensions' +import { isAsciidocFile } from '../util/file' +import { resolveLinkToAsciidocFile } from '../commands/openDocumentLink' +const localize = nls.loadMessageBundle() + +export class AsciidocPreview { public static viewType = 'asciidoc.preview'; private _resource: vscode.Uri; @@ -38,8 +36,7 @@ export class AsciidocPreview private config: vscode.WorkspaceConfiguration; private refreshInterval: number; - - public static async revive( + public static async revive ( webview: vscode.WebviewPanel, state: any, contentProvider: AsciidocContentProvider, @@ -47,11 +44,10 @@ export class AsciidocPreview logger: Logger, topmostLineMonitor: AsciidocFileTopmostLineMonitor, contributions: AsciidocContributions - ): Promise - { - const resource = vscode.Uri.parse(state.resource); - const locked = state.locked; - const line = state.line; + ): Promise { + const resource = vscode.Uri.parse(state.resource) + const locked = state.locked + const line = state.line const preview = new AsciidocPreview( webview, @@ -61,19 +57,18 @@ export class AsciidocPreview previewConfigurations, logger, topmostLineMonitor, - contributions); + contributions) - preview.editor.webview.options = AsciidocPreview.getWebviewOptions(resource, contributions); + preview.editor.webview.options = AsciidocPreview.getWebviewOptions(resource, contributions) - if (!isNaN(line)) - { - preview.line = line; + if (!isNaN(line)) { + preview.line = line } - await preview.doUpdate(); - return preview; + await preview.doUpdate() + return preview } - public static create( + public static create ( resource: vscode.Uri, previewColumn: vscode.ViewColumn, locked: boolean, @@ -82,15 +77,14 @@ export class AsciidocPreview logger: Logger, topmostLineMonitor: AsciidocFileTopmostLineMonitor, contributions: AsciidocContributions - ): AsciidocPreview - { + ): AsciidocPreview { const webview = vscode.window.createWebviewPanel( AsciidocPreview.viewType, AsciidocPreview.getPreviewTitle(resource, locked), previewColumn, { - enableFindWidget: true, - ...AsciidocPreview.getWebviewOptions(resource, contributions), - }); + enableFindWidget: true, + ...AsciidocPreview.getWebviewOptions(resource, contributions), + }) return new AsciidocPreview( webview, @@ -100,10 +94,10 @@ export class AsciidocPreview previewConfigurations, logger, topmostLineMonitor, - contributions); + contributions) } - private constructor( + private constructor ( webview: vscode.WebviewPanel, resource: vscode.Uri, locked: boolean, @@ -112,94 +106,80 @@ export class AsciidocPreview private readonly _logger: Logger, topmostLineMonitor: AsciidocFileTopmostLineMonitor, private readonly _contributions: AsciidocContributions - ) - { - this._resource = resource; - this._locked = locked; - this.editor = webview; + ) { + this._resource = resource + this._locked = locked + this.editor = webview this.config = vscode.workspace.getConfiguration('asciidoc', this.resource) - this.refreshInterval = this.config.get('preview.refreshInterval'); - - this.editor.onDidDispose(() => - { - this.dispose(); - }, null, this.disposables); - - this.editor.onDidChangeViewState((e) => - { - this._onDidChangeViewStateEmitter.fire(e); - }, null, this.disposables); - - this.editor.webview.onDidReceiveMessage((e) => - { - if (e.source !== this._resource.toString()) - { - return; + this.refreshInterval = this.config.get('preview.refreshInterval') + + this.editor.onDidDispose(() => { + this.dispose() + }, null, this.disposables) + + this.editor.onDidChangeViewState((e) => { + this._onDidChangeViewStateEmitter.fire(e) + }, null, this.disposables) + + this.editor.webview.onDidReceiveMessage((e) => { + if (e.source !== this._resource.toString()) { + return } - switch (e.type) - { + switch (e.type) { case 'cacheImageSizes': - this.onCacheImageSizes(e.body); - break; + this.onCacheImageSizes(e.body) + break case 'revealLine': - this.onDidScrollPreview(e.body.line); - break; + this.onDidScrollPreview(e.body.line) + break case 'didClick': - this.onDidClickPreview(e.body.line); - break; + this.onDidClickPreview(e.body.line) + break case 'clickLink': - this.onDidClickPreviewLink(e.body.href); - break; + this.onDidClickPreviewLink(e.body.href) + break case 'showPreviewSecuritySelector': - vscode.commands.executeCommand('asciidoc.showPreviewSecuritySelector', e.body.source); - break; + vscode.commands.executeCommand('asciidoc.showPreviewSecuritySelector', e.body.source) + break case 'previewStyleLoadError': - vscode.window.showWarningMessage(localize('onPreviewStyleLoadError', "Could not load 'asciidoc.styles': {0}", e.body.unloadedStyles.join(', '))); - break; + vscode.window.showWarningMessage(localize('onPreviewStyleLoadError', "Could not load 'asciidoc.styles': {0}", e.body.unloadedStyles.join(', '))) + break } - }, null, this.disposables); + }, null, this.disposables) - vscode.workspace.onDidChangeTextDocument((event) => - { - if (this.isPreviewOf(event.document.uri)) - { - this.refresh(); + vscode.workspace.onDidChangeTextDocument((event) => { + if (this.isPreviewOf(event.document.uri)) { + this.refresh() } - }, null, this.disposables); + }, null, this.disposables) - topmostLineMonitor.onDidChangeTopmostLine((event) => - { - if (this.isPreviewOf(event.resource)) - { - this.updateForView(event.resource, event.line); + topmostLineMonitor.onDidChangeTopmostLine((event) => { + if (this.isPreviewOf(event.resource)) { + this.updateForView(event.resource, event.line) } - }, null, this.disposables); + }, null, this.disposables) - vscode.window.onDidChangeTextEditorSelection((event) => - { - if (this.isPreviewOf(event.textEditor.document.uri)) - { + vscode.window.onDidChangeTextEditorSelection((event) => { + if (this.isPreviewOf(event.textEditor.document.uri)) { this.postMessage({ type: 'onDidChangeTextEditorSelection', line: event.selections[0].active.line, source: this.resource.toString(), - }); + }) } - }, null, this.disposables); + }, null, this.disposables) - vscode.window.onDidChangeActiveTextEditor((editor) => - { - if (editor && isAsciidocFile(editor.document) && !this._locked) - { - this.update(editor.document.uri); + vscode.window.onDidChangeActiveTextEditor((editor) => { + if (editor && isAsciidocFile(editor.document) && !this._locked) { + this.update(editor.document.uri) } - }, null, this.disposables); + }, null, this.disposables) } private readonly _onDisposeEmitter = new vscode.EventEmitter(); @@ -208,317 +188,266 @@ export class AsciidocPreview private readonly _onDidChangeViewStateEmitter = new vscode.EventEmitter(); public readonly onDidChangeViewState = this._onDidChangeViewStateEmitter.event; - public get resource(): vscode.Uri - { - return this._resource; + public get resource (): vscode.Uri { + return this._resource } - public get state() - { + public get state () { return { resource: this.resource.toString(), locked: this._locked, line: this.line, imageInfo: this.imageInfo, - }; + } } - public dispose() - { - if (this._disposed) - { - return; + public dispose () { + if (this._disposed) { + return } - this._disposed = true; - this._onDisposeEmitter.fire(); + this._disposed = true + this._onDisposeEmitter.fire() - this._onDisposeEmitter.dispose(); - this._onDidChangeViewStateEmitter.dispose(); - this.editor.dispose(); + this._onDisposeEmitter.dispose() + this._onDidChangeViewStateEmitter.dispose() + this.editor.dispose() - disposeAll(this.disposables); + disposeAll(this.disposables) } // This method is invoked evrytime there is a document update - public update(resource: vscode.Uri) - { - - const editor = vscode.window.activeTextEditor; - if (editor && editor.document.uri.fsPath === resource.fsPath) - { - this.line = getVisibleLine(editor); + public update (resource: vscode.Uri) { + const editor = vscode.window.activeTextEditor + if (editor && editor.document.uri.fsPath === resource.fsPath) { + this.line = getVisibleLine(editor) } // If we have changed resources, cancel any pending updates - const isResourceChange = resource.fsPath !== this._resource.fsPath; - if (isResourceChange) - { - clearTimeout(this.throttleTimer); - this.throttleTimer = undefined; + const isResourceChange = resource.fsPath !== this._resource.fsPath + if (isResourceChange) { + clearTimeout(this.throttleTimer) + this.throttleTimer = undefined } - this._resource = resource; + this._resource = resource // Schedule update if none is pending - if (!this.throttleTimer) - { - if (isResourceChange || this.firstUpdate || this.forceUpdate) - { - this.doUpdate(); - } else - { - if(this.refreshInterval > 0) - this.throttleTimer = setTimeout(() => this.doUpdate(), this.refreshInterval); + if (!this.throttleTimer) { + if (isResourceChange || this.firstUpdate || this.forceUpdate) { + this.doUpdate() + } else { + if (this.refreshInterval > 0) { this.throttleTimer = setTimeout(() => this.doUpdate(), this.refreshInterval) } } } - this.firstUpdate = false; + this.firstUpdate = false } - public refresh(forceUpdate: boolean = false) - { - this.forceUpdate = forceUpdate; - this.update(this._resource); + public refresh (forceUpdate: boolean = false) { + this.forceUpdate = forceUpdate + this.update(this._resource) } - public updateConfiguration() - { - if (this._previewConfigurations.hasConfigurationChanged(this._resource)) - { + public updateConfiguration () { + if (this._previewConfigurations.hasConfigurationChanged(this._resource)) { this.config = vscode.workspace.getConfiguration('asciidoc', this.resource) - this.refreshInterval = this.config.get('preview.refreshInterval'); - this.refresh(); + this.refreshInterval = this.config.get('preview.refreshInterval') + this.refresh() } } - public get position(): vscode.ViewColumn | undefined - { - return this.editor.viewColumn; + public get position (): vscode.ViewColumn | undefined { + return this.editor.viewColumn } - public matchesResource( + public matchesResource ( otherResource: vscode.Uri, otherPosition: vscode.ViewColumn | undefined, otherLocked: boolean - ): boolean - { - if (this.position !== otherPosition) - { - return false; + ): boolean { + if (this.position !== otherPosition) { + return false } - if (this._locked) - { - return otherLocked && this.isPreviewOf(otherResource); - } else - { - return !otherLocked; + if (this._locked) { + return otherLocked && this.isPreviewOf(otherResource) + } else { + return !otherLocked } } - public matches(otherPreview: AsciidocPreview): boolean - { - return this.matchesResource(otherPreview._resource, otherPreview.position, otherPreview._locked); + public matches (otherPreview: AsciidocPreview): boolean { + return this.matchesResource(otherPreview._resource, otherPreview.position, otherPreview._locked) } - public reveal(viewColumn: vscode.ViewColumn) - { - this.editor.reveal(viewColumn); + public reveal (viewColumn: vscode.ViewColumn) { + this.editor.reveal(viewColumn) } - public toggleLock() - { - this._locked = !this._locked; - this.editor.title = AsciidocPreview.getPreviewTitle(this._resource, this._locked); + public toggleLock () { + this._locked = !this._locked + this.editor.title = AsciidocPreview.getPreviewTitle(this._resource, this._locked) } - private get iconPath() - { - const root = path.join(this._contributions.extensionPath, 'media'); + private get iconPath () { + const root = path.join(this._contributions.extensionPath, 'media') return { light: vscode.Uri.file(path.join(root, 'Preview.svg')), dark: vscode.Uri.file(path.join(root, 'Preview_inverse.svg')), - }; + } } - private isPreviewOf(resource: vscode.Uri): boolean - { - return this._resource.fsPath === resource.fsPath; + private isPreviewOf (resource: vscode.Uri): boolean { + return this._resource.fsPath === resource.fsPath } - private static getPreviewTitle(resource: vscode.Uri, locked: boolean): string - { + private static getPreviewTitle (resource: vscode.Uri, locked: boolean): string { return locked ? localize('lockedPreviewTitle', '[Preview] {0}', path.basename(resource.fsPath)) - : localize('previewTitle', 'Preview {0}', path.basename(resource.fsPath)); + : localize('previewTitle', 'Preview {0}', path.basename(resource.fsPath)) } - private updateForView(resource: vscode.Uri, topLine: number | undefined) - { - - if (!this.isPreviewOf(resource)) - { - return; + private updateForView (resource: vscode.Uri, topLine: number | undefined) { + if (!this.isPreviewOf(resource)) { + return } - if (this.isScrolling) - { - this.isScrolling = false; - return; + if (this.isScrolling) { + this.isScrolling = false + return } - if (typeof topLine === 'number') - { - this.line = topLine; + if (typeof topLine === 'number') { + this.line = topLine this.postMessage({ type: 'updateView', line: topLine, source: resource.toString(), - }); + }) } } - private postMessage(msg: any) - { - if (!this._disposed) - { - this.editor.webview.postMessage(msg); + private postMessage (msg: any) { + if (!this._disposed) { + this.editor.webview.postMessage(msg) } } // Do the preview content update - private async doUpdate(): Promise - { - this._logger.log("Updating the preview content"); - - const resource = this._resource; - - clearTimeout(this.throttleTimer); - this.throttleTimer = undefined; - - const document = await vscode.workspace.openTextDocument(resource); - if (!this.forceUpdate && this.currentVersion - && this.currentVersion.resource.fsPath === resource.fsPath - && this.currentVersion.version === document.version) - { - if (this.line) - { - this.updateForView(resource, this.line); + private async doUpdate (): Promise { + this._logger.log('Updating the preview content') + + const resource = this._resource + + clearTimeout(this.throttleTimer) + this.throttleTimer = undefined + + const document = await vscode.workspace.openTextDocument(resource) + if (!this.forceUpdate && this.currentVersion && + this.currentVersion.resource.fsPath === resource.fsPath && + this.currentVersion.version === document.version) { + if (this.line) { + this.updateForView(resource, this.line) } - return; + return } - this.forceUpdate = false; + this.forceUpdate = false - this.currentVersion = { resource, version: document.version }; + this.currentVersion = { resource, version: document.version } - const content = await this._contentProvider.providePreviewHTML(document, this._previewConfigurations, this.line, this.state); - if (this._resource === resource) - { - this.editor.title = AsciidocPreview.getPreviewTitle(this._resource, this._locked); - this.editor.iconPath = this.iconPath; - this.editor.webview.options = AsciidocPreview.getWebviewOptions(resource, this._contributions); - this.editor.webview.html = content; + const content = await this._contentProvider.providePreviewHTML(document, this._previewConfigurations, this.line, this.state) + if (this._resource === resource) { + this.editor.title = AsciidocPreview.getPreviewTitle(this._resource, this._locked) + this.editor.iconPath = this.iconPath + this.editor.webview.options = AsciidocPreview.getWebviewOptions(resource, this._contributions) + this.editor.webview.html = content } } - private static getWebviewOptions( + private static getWebviewOptions ( resource: vscode.Uri, contributions: AsciidocContributions - ): vscode.WebviewOptions - { + ): vscode.WebviewOptions { return { enableScripts: true, enableCommandUris: true, localResourceRoots: AsciidocPreview.getLocalResourceRoots(resource, contributions), - }; + } } - private static getLocalResourceRoots( + private static getLocalResourceRoots ( resource: vscode.Uri, contributions: AsciidocContributions - ): vscode.Uri[] - { - let baseRoots: vscode.Uri[] = [vscode.Uri.file(path.join(contributions.extensionPath, 'media')), - vscode.Uri.file(path.join(contributions.extensionPath, 'dist'))]; - const folder = vscode.workspace.getWorkspaceFolder(resource); - if (folder) - { - return baseRoots.concat(folder.uri); + ): vscode.Uri[] { + const baseRoots: vscode.Uri[] = [vscode.Uri.file(path.join(contributions.extensionPath, 'media')), + vscode.Uri.file(path.join(contributions.extensionPath, 'dist'))] + const folder = vscode.workspace.getWorkspaceFolder(resource) + if (folder) { + return baseRoots.concat(folder.uri) } - if (!resource.scheme || resource.scheme === 'file') - { - return baseRoots.concat(vscode.Uri.file(path.dirname(resource.fsPath))); + if (!resource.scheme || resource.scheme === 'file') { + return baseRoots.concat(vscode.Uri.file(path.dirname(resource.fsPath))) } - return baseRoots; + return baseRoots } - private onDidScrollPreview(line: number) - { - this.line = line; - for (const editor of vscode.window.visibleTextEditors) - { - if (!this.isPreviewOf(editor.document.uri)) - { - continue; + private onDidScrollPreview (line: number) { + this.line = line + for (const editor of vscode.window.visibleTextEditors) { + if (!this.isPreviewOf(editor.document.uri)) { + continue } - this.isScrolling = true; - const sourceLine = Math.floor(line); - const fraction = line - sourceLine; - const text = editor.document.lineAt(sourceLine).text; - const start = Math.floor(fraction * text.length); + this.isScrolling = true + const sourceLine = Math.floor(line) + const fraction = line - sourceLine + const text = editor.document.lineAt(sourceLine).text + const start = Math.floor(fraction * text.length) editor.revealRange( new vscode.Range(sourceLine, start, sourceLine + 1, 0), - vscode.TextEditorRevealType.AtTop); + vscode.TextEditorRevealType.AtTop) } } - private async onDidClickPreview(line: number): Promise - { - for (const visibleEditor of vscode.window.visibleTextEditors) - { - if (this.isPreviewOf(visibleEditor.document.uri)) - { - const editor = await vscode.window.showTextDocument(visibleEditor.document, visibleEditor.viewColumn); - const position = new vscode.Position(line, 0); - editor.selection = new vscode.Selection(position, position); - return; + private async onDidClickPreview (line: number): Promise { + for (const visibleEditor of vscode.window.visibleTextEditors) { + if (this.isPreviewOf(visibleEditor.document.uri)) { + const editor = await vscode.window.showTextDocument(visibleEditor.document, visibleEditor.viewColumn) + const position = new vscode.Position(line, 0) + editor.selection = new vscode.Selection(position, position) + return } } - vscode.workspace.openTextDocument(this._resource).then(vscode.window.showTextDocument); + vscode.workspace.openTextDocument(this._resource).then(vscode.window.showTextDocument) } - private async onDidClickPreviewLink(href: string) - { - let [hrefPath, fragment] = decodeURIComponent(href).split('#'); + private async onDidClickPreviewLink (href: string) { + let [hrefPath, fragment] = decodeURIComponent(href).split('#') // From Markdown plugin if (hrefPath[0] !== '/') { - hrefPath = path.join(path.dirname(this.resource.fsPath), hrefPath); - } else { - // Handle any normalized file paths - hrefPath = vscode.Uri.parse(hrefPath.replace('/file', '')).fsPath; - } - const openLinks = this.config.get('preview.openAsciidocLinks', 'inPreview'); - if (openLinks === 'inPreview') - { - const asciidocLink = await resolveLinkToAsciidocFile(hrefPath); - if (asciidocLink) - { - this.update(asciidocLink); - return; + hrefPath = path.join(path.dirname(this.resource.fsPath), hrefPath) + } else { + // Handle any normalized file paths + hrefPath = vscode.Uri.parse(hrefPath.replace('/file', '')).fsPath + } + const openLinks = this.config.get('preview.openAsciidocLinks', 'inPreview') + if (openLinks === 'inPreview') { + const asciidocLink = await resolveLinkToAsciidocFile(hrefPath) + if (asciidocLink) { + this.update(asciidocLink) + return } } - vscode.commands.executeCommand('_asciidoc.openDocumentLink', { path, fragment }); + vscode.commands.executeCommand('_asciidoc.openDocumentLink', { path, fragment }) } - private async onCacheImageSizes(imageInfo: { id: string, width: number, height: number }[]) - { - this.imageInfo = imageInfo; + private async onCacheImageSizes (imageInfo: { id: string, width: number, height: number }[]) { + this.imageInfo = imageInfo } } diff --git a/src/features/previewConfig.ts b/src/features/previewConfig.ts index 65f61640..105d46db 100644 --- a/src/features/previewConfig.ts +++ b/src/features/previewConfig.ts @@ -2,103 +2,106 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; +import * as vscode from 'vscode' export class AsciidocPreviewConfiguration { - public static getForResource(resource: vscode.Uri) { - return new AsciidocPreviewConfiguration(resource); + public static getForResource (resource: vscode.Uri) { + return new AsciidocPreviewConfiguration(resource) } - public readonly scrollBeyondLastLine: boolean; - public readonly wordWrap: boolean; - public readonly previewFrontMatter: string; - public readonly lineBreaks: boolean; - public readonly doubleClickToSwitchToEditor: boolean; - public readonly scrollEditorWithPreview: boolean; - public readonly scrollPreviewWithEditor: boolean; - public readonly markEditorSelection: boolean; - - public readonly lineHeight: number; - public readonly fontSize: number; - public readonly fontFamily: string | undefined; - public readonly styles: string[]; - - private constructor(resource: vscode.Uri) { - const editorConfig = vscode.workspace.getConfiguration('editor', resource); - const asciidocConfig = vscode.workspace.getConfiguration('asciidoc', resource); - const asciidocEditorConfig = vscode.workspace.getConfiguration('[asciidoc]', resource); - - this.scrollBeyondLastLine = editorConfig.get('scrollBeyondLastLine', false); - - this.wordWrap = editorConfig.get('wordWrap', 'off') !== 'off'; - if (asciidocEditorConfig && asciidocEditorConfig['editor.wordWrap']) { - this.wordWrap = asciidocEditorConfig['editor.wordWrap'] !== 'off'; - } - - this.previewFrontMatter = asciidocConfig.get('previewFrontMatter', 'hide'); - this.scrollPreviewWithEditor = !!asciidocConfig.get('preview.scrollPreviewWithEditor', true); - this.scrollEditorWithPreview = !!asciidocConfig.get('preview.scrollEditorWithPreview', true); - this.lineBreaks = !!asciidocConfig.get('preview.breaks', false); - this.doubleClickToSwitchToEditor = !!asciidocConfig.get('preview.doubleClickToSwitchToEditor', true); - this.markEditorSelection = !!asciidocConfig.get('preview.markEditorSelection', true); - - this.fontFamily = asciidocConfig.get('preview.fontFamily', undefined); - this.fontSize = Math.max(8, +asciidocConfig.get('preview.fontSize', NaN)); - this.lineHeight = Math.max(0.6, +asciidocConfig.get('preview.lineHeight', NaN)); - - this.styles = asciidocConfig.get('styles', []); - this.refreshInterval = Math.max(0.6, +asciidocConfig.get('preview.refreshInterval', NaN)); - } - - public isEqualTo(otherConfig: AsciidocPreviewConfiguration) { - for (let key in this) { - if (this.hasOwnProperty(key) && key !== 'styles') { - if (this[key] !== otherConfig[key]) { - return false; - } - } - } - - // Check styles - if (this.styles.length !== otherConfig.styles.length) { - return false; - } - for (let i = 0; i < this.styles.length; ++i) { - if (this.styles[i] !== otherConfig.styles[i]) { - return false; - } - } - - return true; - } - - [key: string]: any; + public readonly scrollBeyondLastLine: boolean; + public readonly wordWrap: boolean; + public readonly previewFrontMatter: string; + public readonly lineBreaks: boolean; + public readonly doubleClickToSwitchToEditor: boolean; + public readonly scrollEditorWithPreview: boolean; + public readonly scrollPreviewWithEditor: boolean; + public readonly markEditorSelection: boolean; + + public readonly lineHeight: number; + public readonly fontSize: number; + public readonly fontFamily: string | undefined; + public readonly styles: string[]; + public readonly refreshInterval: number; + + private constructor (resource: vscode.Uri) { + const editorConfig = vscode.workspace.getConfiguration('editor', resource) + const asciidocConfig = vscode.workspace.getConfiguration('asciidoc', resource) + const asciidocEditorConfig = vscode.workspace.getConfiguration('[asciidoc]', resource) + + this.scrollBeyondLastLine = editorConfig.get('scrollBeyondLastLine', false) + + this.wordWrap = editorConfig.get('wordWrap', 'off') !== 'off' + if (asciidocEditorConfig && asciidocEditorConfig['editor.wordWrap']) { + this.wordWrap = asciidocEditorConfig['editor.wordWrap'] !== 'off' + } + + this.previewFrontMatter = asciidocConfig.get('previewFrontMatter', 'hide') + this.scrollPreviewWithEditor = !!asciidocConfig.get('preview.scrollPreviewWithEditor', true) + this.scrollEditorWithPreview = !!asciidocConfig.get('preview.scrollEditorWithPreview', true) + this.lineBreaks = !!asciidocConfig.get('preview.breaks', false) + this.doubleClickToSwitchToEditor = !!asciidocConfig.get('preview.doubleClickToSwitchToEditor', true) + this.markEditorSelection = !!asciidocConfig.get('preview.markEditorSelection', true) + + this.fontFamily = asciidocConfig.get('preview.fontFamily', undefined) + this.fontSize = Math.max(8, +asciidocConfig.get('preview.fontSize', NaN)) + this.lineHeight = Math.max(0.6, +asciidocConfig.get('preview.lineHeight', NaN)) + + this.styles = asciidocConfig.get('styles', []) + this.refreshInterval = Math.max(0.6, +asciidocConfig.get('preview.refreshInterval', NaN)) + } + + public isEqualTo (otherConfig: AsciidocPreviewConfiguration) { + // eslint-disable-next-line prefer-const + for (let key in this) { + if (Object.prototype.hasOwnProperty.call(this, key) && key !== 'styles') { + if (this[key] !== otherConfig[key]) { + return false + } + } + } + + // Check styles + if (this.styles.length !== otherConfig.styles.length) { + return false + } + for (let i = 0; i < this.styles.length; ++i) { + if (this.styles[i] !== otherConfig.styles[i]) { + return false + } + } + + return true + } + + // eslint-disable-next-line no-undef + [key: string]: any; } export class AsciidocPreviewConfigurationManager { - private readonly previewConfigurationsForWorkspaces = new Map(); - - public loadAndCacheConfiguration( - resource: vscode.Uri - ): AsciidocPreviewConfiguration { - const config = AsciidocPreviewConfiguration.getForResource(resource); - this.previewConfigurationsForWorkspaces.set(this.getKey(resource), config); - return config; - } - - public hasConfigurationChanged( - resource: vscode.Uri - ): boolean { - const key = this.getKey(resource); - const currentConfig = this.previewConfigurationsForWorkspaces.get(key); - const newConfig = AsciidocPreviewConfiguration.getForResource(resource); - return (!currentConfig || !currentConfig.isEqualTo(newConfig)); - } - - private getKey( - resource: vscode.Uri - ): string { - const folder = vscode.workspace.getWorkspaceFolder(resource); - return folder ? folder.uri.toString() : ''; - } + private readonly previewConfigurationsForWorkspaces = new Map(); + + public loadAndCacheConfiguration ( + resource: vscode.Uri + ): AsciidocPreviewConfiguration { + const config = AsciidocPreviewConfiguration.getForResource(resource) + this.previewConfigurationsForWorkspaces.set(this.getKey(resource), config) + return config + } + + public hasConfigurationChanged ( + resource: vscode.Uri + ): boolean { + const key = this.getKey(resource) + const currentConfig = this.previewConfigurationsForWorkspaces.get(key) + const newConfig = AsciidocPreviewConfiguration.getForResource(resource) + return (!currentConfig || !currentConfig.isEqualTo(newConfig)) + } + + private getKey ( + resource: vscode.Uri + ): string { + const folder = vscode.workspace.getWorkspaceFolder(resource) + return folder ? folder.uri.toString() : '' + } } diff --git a/src/features/previewContentProvider.ts b/src/features/previewContentProvider.ts index db1d4442..b27bf013 100644 --- a/src/features/previewContentProvider.ts +++ b/src/features/previewContentProvider.ts @@ -2,17 +2,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import * as path from 'path'; -import { AsciidocEngine } from '../asciidocEngine'; +import * as vscode from 'vscode' +import * as path from 'path' +import { AsciidocEngine } from '../asciidocEngine' -import * as nls from 'vscode-nls'; -const localize = nls.loadMessageBundle(); +import * as nls from 'vscode-nls' -import { Logger } from '../logger'; -import { ContentSecurityPolicyArbiter, AsciidocPreviewSecurityLevel } from '../security'; -import { AsciidocPreviewConfigurationManager, AsciidocPreviewConfiguration } from './previewConfig'; -import { AsciidocContributions } from '../asciidocExtensions'; +import { Logger } from '../logger' +import { ContentSecurityPolicyArbiter, AsciidocPreviewSecurityLevel } from '../security' +import { AsciidocPreviewConfigurationManager, AsciidocPreviewConfiguration } from './previewConfig' +import { AsciidocContributions } from '../asciidocExtensions' +const localize = nls.loadMessageBundle() /** * Strings used inside the asciidoc preview. @@ -32,25 +32,30 @@ const previewStrings = { cspAlertMessageLabel: localize( 'preview.securityMessage.label', 'Content Disabled Security Warning'), -}; +} export class AsciidocContentProvider { - constructor( - private readonly engine: AsciidocEngine, - private readonly context: vscode.ExtensionContext, - private readonly cspArbiter: ContentSecurityPolicyArbiter, - private readonly contributions: AsciidocContributions, - private readonly logger: Logger - ) { } - - public async providePreviewHTML( + constructor ( + private readonly engine: AsciidocEngine, + private readonly context: vscode.ExtensionContext, + private readonly cspArbiter: ContentSecurityPolicyArbiter, + private readonly contributions: AsciidocContributions, + private readonly logger: Logger) { + this.engine = engine + this.context = context + this.cspArbiter = cspArbiter + this.contributions = contributions + this.logger = logger + } + + public async providePreviewHTML ( asciidocDocument: vscode.TextDocument, previewConfigurations: AsciidocPreviewConfigurationManager, initialLine: number | undefined = undefined, state?: any ): Promise { - const sourceUri = asciidocDocument.uri; - const config = previewConfigurations.loadAndCacheConfiguration(sourceUri); + const sourceUri = asciidocDocument.uri + const config = previewConfigurations.loadAndCacheConfiguration(sourceUri) const initialData = { source: sourceUri.toString(), line: initialLine, @@ -59,143 +64,143 @@ export class AsciidocContentProvider { scrollEditorWithPreview: config.scrollEditorWithPreview, doubleClickToSwitchToEditor: config.doubleClickToSwitchToEditor, disableSecurityWarnings: this.cspArbiter.shouldDisableSecurityWarnings(), - }; + } // Content Security Policy - const nonce = new Date().getTime() + '' + new Date().getMilliseconds(); - const csp = this.getCspForResource(sourceUri, nonce); - const body = await this.engine.render(sourceUri, config.previewFrontMatter === 'hide', asciidocDocument.getText()); - const bodyClassesRegex = // + const nonce = new Date().getTime() + '' + new Date().getMilliseconds() + const csp = this.getCspForResource(sourceUri, nonce) + const body = await this.engine.render(sourceUri, config.previewFrontMatter === 'hide', asciidocDocument.getText()) + const bodyClassesRegex = // const bodyClasses = body.match(bodyClassesRegex) - const bodyClassesVal = bodyClasses === null ? '' : bodyClasses[1]; + const bodyClassesVal = bodyClasses === null ? '' : bodyClasses[1] this.logger.log(`Using CSS ${this.getStyles(sourceUri, nonce, config, state)}`) return ` - - - - ${csp} - - - ${this.getStyles(sourceUri, nonce, config, state)} - - - - ${body} -
- - - `; + + + + ${csp} + + + ${this.getStyles(sourceUri, nonce, config, state)} + + + + ${body} +
+ + + ` } - private extensionScriptPath(mediaFile: string): string { + private extensionScriptPath (mediaFile: string): string { return vscode.Uri.file(this.context.asAbsolutePath(path.join('dist', mediaFile))) .with({ scheme: 'vscode-resource' }) - .toString(); + .toString() } - private fixHref(resource: vscode.Uri, href: string): string { + private fixHref (resource: vscode.Uri, href: string): string { if (!href) { - return href; + return href } // Use href if it is already an URL - const hrefUri = vscode.Uri.parse(href); + const hrefUri = vscode.Uri.parse(href) if (['http', 'https'].indexOf(hrefUri.scheme) >= 0) { - return hrefUri.toString(); + return hrefUri.toString() } // Use href as file URI if it is absolute if (path.isAbsolute(href) || hrefUri.scheme === 'file') { return vscode.Uri.file(href) .with({ scheme: 'vscode-resource' }) - .toString(); + .toString() } // Use a workspace relative path if there is a workspace - let root = vscode.workspace.getWorkspaceFolder(resource); + const root = vscode.workspace.getWorkspaceFolder(resource) if (root) { return vscode.Uri.file(path.join(root.uri.fsPath, href)) .with({ scheme: 'vscode-resource' }) - .toString(); + .toString() } // Otherwise look relative to the asciidoc file return vscode.Uri.file(path.join(path.dirname(resource.fsPath), href)) .with({ scheme: 'vscode-resource' }) - .toString(); + .toString() } - private computeCustomStyleSheetIncludes(resource: vscode.Uri, config: AsciidocPreviewConfiguration): string { + private computeCustomStyleSheetIncludes (resource: vscode.Uri, config: AsciidocPreviewConfiguration): string { if (Array.isArray(config.styles)) { return config.styles.map((style) => { - return ``; - }).join('\n'); + return `` + }).join('\n') } - return ''; + return '' } - private getSettingsOverrideStyles(nonce: string, config: AsciidocPreviewConfiguration): string { + private getSettingsOverrideStyles (nonce: string, config: AsciidocPreviewConfiguration): string { return ``; + body { + ${config.fontFamily ? `font-family: ${config.fontFamily};` : ''} + ${isNaN(config.fontSize) ? '' : `font-size: ${config.fontSize}px;`} + ${isNaN(config.lineHeight) ? '' : `line-height: ${config.lineHeight};`} + } + ` } - private getImageStabilizerStyles(state?: any) { - let ret = '\n'; + ret += '\n' - return ret; + return ret } - private getStyles(resource: vscode.Uri, nonce: string, config: AsciidocPreviewConfiguration, state?: any): string { + private getStyles (resource: vscode.Uri, nonce: string, config: AsciidocPreviewConfiguration, state?: any): string { const useEditorStyle = vscode.workspace.getConfiguration('asciidoc', null).get('preview.useEditorStyle') - var baseStyles; + let baseStyles if (useEditorStyle) { baseStyles = this.contributions.previewStylesEditor .map((resource) => ``) - .join('\n'); + .join('\n') } else { baseStyles = this.contributions.previewStylesDefault .map((resource) => ``) - .join('\n'); + .join('\n') } return `${baseStyles} - ${this.getSettingsOverrideStyles(nonce, config)} - ${this.computeCustomStyleSheetIncludes(resource, config)} - ${this.getImageStabilizerStyles(state)}`; + ${this.getSettingsOverrideStyles(nonce, config)} + ${this.computeCustomStyleSheetIncludes(resource, config)} + ${this.getImageStabilizerStyles(state)}` } - private getCspForResource(resource: vscode.Uri, nonce: string): string { + private getCspForResource (resource: vscode.Uri, nonce: string): string { switch (this.cspArbiter.getSecurityLevelForResource(resource)) { - case AsciidocPreviewSecurityLevel.AllowInsecureContent: - return ``; + case AsciidocPreviewSecurityLevel.AllowInsecureContent: + return `` - case AsciidocPreviewSecurityLevel.AllowInsecureLocalContent: - return ``; + case AsciidocPreviewSecurityLevel.AllowInsecureLocalContent: + return `` - case AsciidocPreviewSecurityLevel.AllowScriptsAndAllContent: - return ''; + case AsciidocPreviewSecurityLevel.AllowScriptsAndAllContent: + return '' - case AsciidocPreviewSecurityLevel.Strict: - default: - return ``; + case AsciidocPreviewSecurityLevel.Strict: + default: + return `` } } } diff --git a/src/features/previewManager.ts b/src/features/previewManager.ts index 2fcb2d45..4639f1f1 100644 --- a/src/features/previewManager.ts +++ b/src/features/previewManager.ts @@ -2,18 +2,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { Logger } from '../logger'; -import { AsciidocContributions } from '../asciidocExtensions'; -import { disposeAll } from '../util/dispose'; -import { AsciidocFileTopmostLineMonitor } from '../util/topmostLineMonitor'; -import { AsciidocPreview, PreviewSettings } from './preview'; -import { AsciidocPreviewConfigurationManager } from './previewConfig'; -import { AsciidocContentProvider } from './previewContentProvider'; - - -export class AsciidocPreviewManager implements vscode.WebviewPanelSerializer -{ +import * as vscode from 'vscode' +import { Logger } from '../logger' +import { AsciidocContributions } from '../asciidocExtensions' +import { disposeAll } from '../util/dispose' +import { AsciidocFileTopmostLineMonitor } from '../util/topmostLineMonitor' +import { AsciidocPreview, PreviewSettings } from './preview' +import { AsciidocPreviewConfigurationManager } from './previewConfig' +import { AsciidocContentProvider } from './previewContentProvider' + +export class AsciidocPreviewManager implements vscode.WebviewPanelSerializer { private static readonly asciidocPreviewActiveContextKey = 'asciidocPreviewFocus'; private readonly _topmostLineMonitor = new AsciidocFileTopmostLineMonitor(); @@ -22,82 +20,67 @@ export class AsciidocPreviewManager implements vscode.WebviewPanelSerializer private _activePreview: AsciidocPreview | undefined = undefined; private readonly _disposables: vscode.Disposable[] = []; - public constructor( + public constructor ( private readonly _contentProvider: AsciidocContentProvider, private readonly _logger: Logger, private readonly _contributions: AsciidocContributions - ) - { - this._disposables.push(vscode.window.registerWebviewPanelSerializer(AsciidocPreview.viewType, this)); + ) { + this._disposables.push(vscode.window.registerWebviewPanelSerializer(AsciidocPreview.viewType, this)) } - public dispose(): void - { - disposeAll(this._disposables); - disposeAll(this._previews); + public dispose (): void { + disposeAll(this._disposables) + disposeAll(this._previews) } - public refresh(forceUpdate: boolean = false) - { - for (const preview of this._previews) - { - preview.refresh(forceUpdate); + public refresh (forceUpdate: boolean = false) { + for (const preview of this._previews) { + preview.refresh(forceUpdate) } } - public updateConfiguration() - { - for (const preview of this._previews) - { - preview.updateConfiguration(); + public updateConfiguration () { + for (const preview of this._previews) { + preview.updateConfiguration() } } - public preview( + public preview ( resource: vscode.Uri, previewSettings: PreviewSettings - ): void - { - let preview = this.getExistingPreview(resource, previewSettings); - if (preview) - { - preview.reveal(previewSettings.previewColumn); - } else - { - preview = this.createNewPreview(resource, previewSettings); + ): void { + let preview = this.getExistingPreview(resource, previewSettings) + if (preview) { + preview.reveal(previewSettings.previewColumn) + } else { + preview = this.createNewPreview(resource, previewSettings) } - preview.update(resource); + preview.update(resource) } - public get activePreviewResource() - { - return this._activePreview && this._activePreview.resource; + public get activePreviewResource () { + return this._activePreview && this._activePreview.resource } - public toggleLock() - { - const preview = this._activePreview; - if (preview) - { - preview.toggleLock(); + public toggleLock () { + const preview = this._activePreview + if (preview) { + preview.toggleLock() // Close any previews that are now redundant, such as having two dynamic previews in the same editor group - for (const otherPreview of this._previews) - { - if (otherPreview !== preview && preview.matches(otherPreview)) - { - otherPreview.dispose(); + for (const otherPreview of this._previews) { + if (otherPreview !== preview && preview.matches(otherPreview)) { + otherPreview.dispose() } } } } - public async deserializeWebviewPanel( + public async deserializeWebviewPanel ( webview: vscode.WebviewPanel, state: any - ): Promise - { + ): Promise { const preview = await AsciidocPreview.revive( webview, state, @@ -105,25 +88,23 @@ export class AsciidocPreviewManager implements vscode.WebviewPanelSerializer this._previewConfigurations, this._logger, this._topmostLineMonitor, - this._contributions); + this._contributions) - this.registerPreview(preview); + this.registerPreview(preview) } - private getExistingPreview( + private getExistingPreview ( resource: vscode.Uri, previewSettings: PreviewSettings - ): AsciidocPreview | undefined - { + ): AsciidocPreview | undefined { return this._previews.find((preview) => - preview.matchesResource(resource, previewSettings.previewColumn, previewSettings.locked)); + preview.matchesResource(resource, previewSettings.previewColumn, previewSettings.locked)) } - private createNewPreview( + private createNewPreview ( resource: vscode.Uri, previewSettings: PreviewSettings - ): AsciidocPreview - { + ): AsciidocPreview { const preview = AsciidocPreview.create( resource, previewSettings.previewColumn, @@ -132,47 +113,41 @@ export class AsciidocPreviewManager implements vscode.WebviewPanelSerializer this._previewConfigurations, this._logger, this._topmostLineMonitor, - this._contributions); + this._contributions) - this.setPreviewActiveContext(true); - this._activePreview = preview; - return this.registerPreview(preview); + this.setPreviewActiveContext(true) + this._activePreview = preview + return this.registerPreview(preview) } - private registerPreview( + private registerPreview ( preview: AsciidocPreview - ): AsciidocPreview - { - this._previews.push(preview); - - preview.onDispose(() => - { - const existing = this._previews.indexOf(preview); - if (existing === -1) - { - return; + ): AsciidocPreview { + this._previews.push(preview) + + preview.onDispose(() => { + const existing = this._previews.indexOf(preview) + if (existing === -1) { + return } - this._previews.splice(existing, 1); - if (this._activePreview === preview) - { - this.setPreviewActiveContext(false); - this._activePreview = undefined; + this._previews.splice(existing, 1) + if (this._activePreview === preview) { + this.setPreviewActiveContext(false) + this._activePreview = undefined } - }); + }) - preview.onDidChangeViewState(({ webviewPanel }) => - { - disposeAll(this._previews.filter((otherPreview) => preview !== otherPreview && preview!.matches(otherPreview))); - this.setPreviewActiveContext(webviewPanel.active); - this._activePreview = webviewPanel.active ? preview : undefined; - }); + preview.onDidChangeViewState(({ webviewPanel }) => { + disposeAll(this._previews.filter((otherPreview) => preview !== otherPreview && preview!.matches(otherPreview))) + this.setPreviewActiveContext(webviewPanel.active) + this._activePreview = webviewPanel.active ? preview : undefined + }) - return preview; + return preview } - private setPreviewActiveContext(value: boolean) - { - vscode.commands.executeCommand('setContext', AsciidocPreviewManager.asciidocPreviewActiveContextKey, value); + private setPreviewActiveContext (value: boolean) { + vscode.commands.executeCommand('setContext', AsciidocPreviewManager.asciidocPreviewActiveContextKey, value) } } diff --git a/src/features/workspaceSymbolProvider.ts b/src/features/workspaceSymbolProvider.ts index ddc3802a..cc49f756 100644 --- a/src/features/workspaceSymbolProvider.ts +++ b/src/features/workspaceSymbolProvider.ts @@ -2,148 +2,147 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { disposeAll } from '../util/dispose'; -import { isAsciidocFile } from '../util/file'; -import { Lazy, lazy } from '../util/lazy'; -import AdocDocumentSymbolProvider from './documentSymbolProvider'; -import { SkinnyTextDocument } from '../tableOfContentsProvider'; +import * as vscode from 'vscode' +import { disposeAll } from '../util/dispose' +import { isAsciidocFile } from '../util/file' +import { Lazy, lazy } from '../util/lazy' +import AdocDocumentSymbolProvider from './documentSymbolProvider' +import { SkinnyTextDocument } from '../tableOfContentsProvider' export interface WorkspaceAsciidocDocumentProvider { - getAllAsciidocDocuments(): Thenable>; + getAllAsciidocDocuments(): Promise>; - readonly onDidChangeAsciidocDocument: vscode.Event; - readonly onDidCreateAsciidocDocument: vscode.Event; - readonly onDidDeleteAsciidocDocument: vscode.Event; + readonly onDidChangeAsciidocDocument: vscode.Event; + readonly onDidCreateAsciidocDocument: vscode.Event; + readonly onDidDeleteAsciidocDocument: vscode.Event; } class VSCodeWorkspaceAsciidocDocumentProvider implements WorkspaceAsciidocDocumentProvider { - - private readonly _onDidChangeAsciidocDocumentEmitter = new vscode.EventEmitter(); - private readonly _onDidCreateAsciidocDocumentEmitter = new vscode.EventEmitter(); - private readonly _onDidDeleteAsciidocDocumentEmitter = new vscode.EventEmitter(); - - private _watcher: vscode.FileSystemWatcher | undefined; - private _disposables: vscode.Disposable[] = []; - - public dispose() { - this._onDidChangeAsciidocDocumentEmitter.dispose(); - this._onDidDeleteAsciidocDocumentEmitter.dispose(); - - if (this._watcher) { - this._watcher.dispose(); - } - - disposeAll(this._disposables); - } - - async getAllAsciidocDocuments() { - const resources = await vscode.workspace.findFiles('**/*.md', '**/node_modules/**'); - const docs = await Promise.all(resources.map((doc) => this.getAsciidocDocument(doc))); - return docs.filter((doc) => !!doc) as SkinnyTextDocument[]; - } - - public get onDidChangeAsciidocDocument() { - this.ensureWatcher(); - return this._onDidChangeAsciidocDocumentEmitter.event; - } - - public get onDidCreateAsciidocDocument() { - this.ensureWatcher(); - return this._onDidCreateAsciidocDocumentEmitter.event; - } - - public get onDidDeleteAsciidocDocument() { - this.ensureWatcher(); - return this._onDidDeleteAsciidocDocumentEmitter.event; - } - - private ensureWatcher(): void { - if (this._watcher) { - return; - } - - this._watcher = vscode.workspace.createFileSystemWatcher('**/*.md'); - - this._watcher.onDidChange(async (resource) => { - const document = await this.getAsciidocDocument(resource); - if (document) { - this._onDidChangeAsciidocDocumentEmitter.fire(document); - } - }, null, this._disposables); - - this._watcher.onDidCreate(async (resource) => { - const document = await this.getAsciidocDocument(resource); - if (document) { - this._onDidCreateAsciidocDocumentEmitter.fire(document); - } - }, null, this._disposables); - - this._watcher.onDidDelete(async (resource) => { - this._onDidDeleteAsciidocDocumentEmitter.fire(resource); - }, null, this._disposables); - - vscode.workspace.onDidChangeTextDocument((e) => { - if (isAsciidocFile(e.document)) { - this._onDidChangeAsciidocDocumentEmitter.fire(e.document); - } - }, null, this._disposables); - } - - private async getAsciidocDocument(resource: vscode.Uri): Promise { - const doc = await vscode.workspace.openTextDocument(resource); - return doc && isAsciidocFile(doc) ? doc : undefined; - } + private readonly _onDidChangeAsciidocDocumentEmitter = new vscode.EventEmitter(); + private readonly _onDidCreateAsciidocDocumentEmitter = new vscode.EventEmitter(); + private readonly _onDidDeleteAsciidocDocumentEmitter = new vscode.EventEmitter(); + + private _watcher: vscode.FileSystemWatcher | undefined; + private _disposables: vscode.Disposable[] = []; + + public dispose () { + this._onDidChangeAsciidocDocumentEmitter.dispose() + this._onDidDeleteAsciidocDocumentEmitter.dispose() + + if (this._watcher) { + this._watcher.dispose() + } + + disposeAll(this._disposables) + } + + async getAllAsciidocDocuments () { + const resources = await vscode.workspace.findFiles('**/*.md', '**/node_modules/**') + const docs = await Promise.all(resources.map((doc) => this.getAsciidocDocument(doc))) + return docs.filter((doc) => !!doc) as SkinnyTextDocument[] + } + + public get onDidChangeAsciidocDocument () { + this.ensureWatcher() + return this._onDidChangeAsciidocDocumentEmitter.event + } + + public get onDidCreateAsciidocDocument () { + this.ensureWatcher() + return this._onDidCreateAsciidocDocumentEmitter.event + } + + public get onDidDeleteAsciidocDocument () { + this.ensureWatcher() + return this._onDidDeleteAsciidocDocumentEmitter.event + } + + private ensureWatcher (): void { + if (this._watcher) { + return + } + + this._watcher = vscode.workspace.createFileSystemWatcher('**/*.md') + + this._watcher.onDidChange(async (resource) => { + const document = await this.getAsciidocDocument(resource) + if (document) { + this._onDidChangeAsciidocDocumentEmitter.fire(document) + } + }, null, this._disposables) + + this._watcher.onDidCreate(async (resource) => { + const document = await this.getAsciidocDocument(resource) + if (document) { + this._onDidCreateAsciidocDocumentEmitter.fire(document) + } + }, null, this._disposables) + + this._watcher.onDidDelete(async (resource) => { + this._onDidDeleteAsciidocDocumentEmitter.fire(resource) + }, null, this._disposables) + + vscode.workspace.onDidChangeTextDocument((e) => { + if (isAsciidocFile(e.document)) { + this._onDidChangeAsciidocDocumentEmitter.fire(e.document) + } + }, null, this._disposables) + } + + private async getAsciidocDocument (resource: vscode.Uri): Promise { + const doc = await vscode.workspace.openTextDocument(resource) + return doc && isAsciidocFile(doc) ? doc : undefined + } } - export default class AsciidocWorkspaceSymbolProvider implements vscode.WorkspaceSymbolProvider { - private _symbolCache = new Map>>(); - private _symbolCachePopulated: boolean = false; - private _disposables: vscode.Disposable[] = []; - - public constructor( - private _symbolProvider: AdocDocumentSymbolProvider, - private _workspaceAsciidocDocumentProvider: WorkspaceAsciidocDocumentProvider = new VSCodeWorkspaceAsciidocDocumentProvider() - ) { } - - public async provideWorkspaceSymbols(query: string): Promise { - if (!this._symbolCachePopulated) { - await this.populateSymbolCache(); - this._symbolCachePopulated = true; - - this._workspaceAsciidocDocumentProvider.onDidChangeAsciidocDocument(this.onDidChangeDocument, this, this._disposables); - this._workspaceAsciidocDocumentProvider.onDidCreateAsciidocDocument(this.onDidChangeDocument, this, this._disposables); - this._workspaceAsciidocDocumentProvider.onDidDeleteAsciidocDocument(this.onDidDeleteDocument, this, this._disposables); - } - - const allSymbolsSets = await Promise.all(Array.from(this._symbolCache.values()).map((x) => x.value)); - const allSymbols: vscode.SymbolInformation[] = Array.prototype.concat.apply([], allSymbolsSets); - return allSymbols.filter((symbolInformation) => symbolInformation.name.toLowerCase().indexOf(query.toLowerCase()) !== -1); - } - - public async populateSymbolCache(): Promise { - const asciidocDocumentUris = await this._workspaceAsciidocDocumentProvider.getAllAsciidocDocuments(); - for (const document of asciidocDocumentUris) { - this._symbolCache.set(document.uri.fsPath, this.getSymbols(document)); - } - } - - public dispose(): void { - disposeAll(this._disposables); - } - - private getSymbols(document: SkinnyTextDocument): Lazy> { - return lazy(async () => { - return this._symbolProvider.provideDocumentSymbolInformation(document); - }); - } - - private onDidChangeDocument(document: SkinnyTextDocument) { - this._symbolCache.set(document.uri.fsPath, this.getSymbols(document)); - } - - private onDidDeleteDocument(resource: vscode.Uri) { - this._symbolCache.delete(resource.fsPath); - } + private _symbolCache = new Map>>(); + private _symbolCachePopulated: boolean = false + private _disposables: vscode.Disposable[] = [] + + public constructor (private _symbolProvider: AdocDocumentSymbolProvider, + private _workspaceAsciidocDocumentProvider: WorkspaceAsciidocDocumentProvider = new VSCodeWorkspaceAsciidocDocumentProvider()) { + this._symbolProvider = _symbolProvider + this._workspaceAsciidocDocumentProvider = _workspaceAsciidocDocumentProvider + } + + public async provideWorkspaceSymbols (query: string): Promise { + if (!this._symbolCachePopulated) { + await this.populateSymbolCache() + this._symbolCachePopulated = true + + this._workspaceAsciidocDocumentProvider.onDidChangeAsciidocDocument(this.onDidChangeDocument, this, this._disposables) + this._workspaceAsciidocDocumentProvider.onDidCreateAsciidocDocument(this.onDidChangeDocument, this, this._disposables) + this._workspaceAsciidocDocumentProvider.onDidDeleteAsciidocDocument(this.onDidDeleteDocument, this, this._disposables) + } + + const allSymbolsSets = await Promise.all(Array.from(this._symbolCache.values()).map((x) => x.value)) + const allSymbols: vscode.SymbolInformation[] = Array.prototype.concat.apply([], allSymbolsSets) + return allSymbols.filter((symbolInformation) => symbolInformation.name.toLowerCase().indexOf(query.toLowerCase()) !== -1) + } + + public async populateSymbolCache (): Promise { + const asciidocDocumentUris = await this._workspaceAsciidocDocumentProvider.getAllAsciidocDocuments() + for (const document of asciidocDocumentUris) { + this._symbolCache.set(document.uri.fsPath, this.getSymbols(document)) + } + } + + public dispose (): void { + disposeAll(this._disposables) + } + + private getSymbols (document: SkinnyTextDocument): Lazy> { + return lazy(async () => { + return this._symbolProvider.provideDocumentSymbolInformation(document) + }) + } + + private onDidChangeDocument (document: SkinnyTextDocument) { + this._symbolCache.set(document.uri.fsPath, this.getSymbols(document)) + } + + private onDidDeleteDocument (resource: vscode.Uri) { + this._symbolCache.delete(resource.fsPath) + } } diff --git a/src/highlightjs-adapter.ts b/src/highlightjs-adapter.ts index a2c33f1a..5b1a33fc 100644 --- a/src/highlightjs-adapter.ts +++ b/src/highlightjs-adapter.ts @@ -1,6 +1,6 @@ // from https://github.com/cdnjs/SRIs/blob/master/highlight.js/9.18.3.json import * as sri from './highlightjs-sri-9.18.3.json' -const {Opal} = require('asciidoctor-opal-runtime') +const { Opal } = require('asciidoctor-opal-runtime') module.exports.register = (asciidoctor) => { const HighlightjsSyntaxHighlighter = asciidoctor.SyntaxHighlighter.for('highlight.js') @@ -8,8 +8,9 @@ module.exports.register = (asciidoctor) => { customHighlightJsAdapter.$register_for('highlight.js', 'highlightjs') let $docinfo const baseUrl = 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.3' - Opal.def(customHighlightJsAdapter, '$docinfo', $docinfo = function $$docinfo(location, doc, opts) { - const self = this; + Opal.def(customHighlightJsAdapter, '$docinfo', $docinfo = function $$docinfo (location, doc, _opts) { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const self = this if (location === 'head') { const theme = doc.$attr('highlightjs-theme', 'github') const integrityValue = sri[`styles/${theme}.min.css`] @@ -32,5 +33,5 @@ if (!hljs.initHighlighting.called) { ;[].slice.call(document.querySelectorAll("pre.highlight > code")).forEach(function (el) { hljs.highlightBlock(el) }) } ` - }, $docinfo.$$arity = 3); + }, $docinfo.$$arity = 3) } diff --git a/src/image-paste.ts b/src/image-paste.ts index 59392e92..840c9707 100644 --- a/src/image-paste.ts +++ b/src/image-paste.ts @@ -1,33 +1,32 @@ -import * as path from 'path'; -import * as vscode from 'vscode'; -import { spawn } from 'child_process'; -import * as moment from 'moment'; -import * as fs from 'fs'; +import * as path from 'path' +import * as vscode from 'vscode' +import { spawn } from 'child_process' +import * as moment from 'moment' +import * as fs from 'fs' -import { AsciidocParser } from './text-parser'; +import { AsciidocParser } from './text-parser' export namespace Import { - export class Configuration { - DocumentDirectory: string = ''; - ImagesDirectory: string; - ImageFilename: string; - - selectionRole: SelectionRole = SelectionRole.Filename; - encoding: FilenameEncoding = FilenameEncoding.URIEncoding; - mode: SelectionMode = SelectionMode.Replace; - } /** * What part of the image macro should the selection be used for. * * e.g. image::filename[alt-text] */ - enum SelectionRole { + enum SelectionRole { Filename, AltText, None } + /** + * Controls how the image filename should be encoded, if at all. + */ + enum FilenameEncoding { + None, + URIEncoding + } + /** * Controls if the selection is to be replaced with the image macro, or the * image macro is to be inserted at the selection-cursor. @@ -40,12 +39,14 @@ export namespace Import { Replace } - /** - * Controls how the image filename should be encoded, if at all. - */ - enum FilenameEncoding { - None, - URIEncoding + export class Configuration { + DocumentDirectory: string = ''; + ImagesDirectory: string; + ImageFilename: string; + + selectionRole: SelectionRole = SelectionRole.Filename; + encoding: FilenameEncoding = FilenameEncoding.URIEncoding; + mode: SelectionMode = SelectionMode.Replace; } enum SelectionContext { @@ -63,12 +64,12 @@ export namespace Import { * Saves an image from the clipboard. * @param filename the filename of the image file */ - static saveImageFromClipboard(filename: string) { + static saveImageFromClipboard (filename: string) { const platform = process.platform if (platform === 'win32') { - const script = path.join(__dirname, '../../res/pc.ps1'); - let promise = new Promise((resolve, reject) => { - let child = spawn('powershell', [ + const script = path.join(__dirname, '../../res/pc.ps1') + const promise = new Promise((resolve, reject) => { + const child = spawn('powershell', [ '-noprofile', '-noninteractive', '-nologo', @@ -80,103 +81,104 @@ export namespace Import { '-file', `${script}`, `${filename}`, - ]); + ]) - child.stdout.once('data', (e) => resolve(e.toString())); + child.stdout.once('data', (e) => resolve(e.toString())) child.stderr.once('data', (e) => { - let exception = e.toString().trim(); + const exception = e.toString().trim() if ( - exception == + exception === 'Exception calling "Open" with "2" argument(s): "Could not find a part of the path' - ) - reject(new ScriptArgumentError('bad path exception')); - else if (exception == 'no image') - reject(new ScriptArgumentError('no image exception')); - else if (exception == 'no filename') - reject(new ScriptArgumentError('no filename exception')); - }); - child.once('error', (e) => reject(e)); - }); - return promise; + ) { + reject(new ScriptArgumentError('bad path exception')) + } else if (exception === 'no image') { + reject(new ScriptArgumentError('no image exception')) + } else if (exception === 'no filename') { + reject(new ScriptArgumentError('no filename exception')) + } + }) + child.once('error', (e) => reject(e)) + }) + return promise } else if (platform === 'darwin') { // Mac - let scriptPath = path.join(__dirname, '../../res/mac.applescript') - let promise = new Promise((resolve, reject) => { - let child = spawn('osascript', [scriptPath, filename]) - child.stdout.once('data', (e) => resolve(e.toString())); + const scriptPath = path.join(__dirname, '../../res/mac.applescript') + const promise = new Promise((resolve, reject) => { + const child = spawn('osascript', [scriptPath, filename]) + child.stdout.once('data', (e) => resolve(e.toString())) child.stderr.once('data', (e) => { console.log(`stderr: ${e}`) const exception = e.toString().trim() - if (exception == 'no image' ) { + if (exception === 'no image') { reject(new ScriptArgumentError('no image exception')) } else { reject(exception) } - }); + }) }) return promise } else { // Linux const scriptPath = path.join(__dirname, '../../res/linux.sh') - let promise = new Promise((resolve, reject) => { - let child = spawn(`"${scriptPath}"`, [`"${filename}"`], {shell: true}) - child.stdout.once('data', (e) => resolve(e.toString())); + const promise = new Promise((resolve, reject) => { + const child = spawn(`"${scriptPath}"`, [`"${filename}"`], { shell: true }) + child.stdout.once('data', (e) => resolve(e.toString())) child.stderr.once('data', (e) => { const exception = e.toString().trim() - if (exception == 'no xclip' ) { + if (exception === 'no xclip') { reject(new ScriptArgumentError('no xclip')) - } else if (exception == 'no image') { + } else if (exception === 'no image') { reject(new ScriptArgumentError('no image exception')) } else { reject(exception) } - }); + }) }) return promise } } - static async importFromClipboard(config: Configuration) { - config = config || new Configuration(); + static async importFromClipboard (config: Configuration) { + config = config || new Configuration() - const editor = vscode.window.activeTextEditor; + const editor = vscode.window.activeTextEditor let filename = moment() .format('d-M-YYYY-HH-mm-ss-A.png') - .toString(); //default filename - let alttext = ''; //todo:... - let directory = this.get_current_imagesdir(); + .toString() //default filename + let alttext = '' //todo:... + const directory = this.getCurrentImagesDir() // confirm directory is local--asciidoctor allows external URIs. test for // protocol (http, ftp, etc) to determine this - let remote = /'^(?:[a-z]+:)?\\/i.test(directory); + const remote = /'^(?:[a-z]+:)?\\/i.test(directory) if (remote) { vscode.window.showWarningMessage( 'Cannot determine save location for image because `imagesdir` attribute references a remote location.' - ); - return; + ) + return } // grab the selected text & update either the alt-attribute or filename // corresponding to the selection role. - const selectedText = editor.document.getText(editor.selection); + const selectedText = editor.document.getText(editor.selection) if (!editor.selection.isEmpty) { switch (config.selectionRole) { - case SelectionRole.AltText: - alttext = selectedText; - break; - case SelectionRole.Filename: - filename = selectedText + '.png'; - break; + case SelectionRole.AltText: + alttext = selectedText + break + case SelectionRole.Filename: + filename = selectedText + '.png' + break } } switch (config.encoding) { - case FilenameEncoding.URIEncoding: - filename = encodeURIComponent(filename); - break; + case FilenameEncoding.URIEncoding: + filename = encodeURIComponent(filename) + break } try { @@ -188,115 +190,116 @@ export namespace Import { return } - await this.saveImageFromClipboard(path.join(docDir, directory, filename)); + await this.saveImageFromClipboard(path.join(docDir, directory, filename)) } catch (error) { if (error instanceof ScriptArgumentError) { - if (error.message == 'bad path exception') { - let folder = path.join(vscode.workspace.rootPath, directory); + if (error.message === 'bad path exception') { + const folder = path.join(vscode.workspace.rootPath, directory) vscode.window .showErrorMessage( `The imagesdir folder was not found (${folder}).`, 'Create Folder & Retry' ) .then(async (value) => { - if (value == 'Create Folder & Retry') { - fs.mkdirSync(folder); - this.importFromClipboard(config); // try again + if (value === 'Create Folder & Retry') { + fs.mkdirSync(folder) + this.importFromClipboard(config) // try again } - }); - } else if (error.message == 'no image exception') + }) + } else if (error.message === 'no image exception') { vscode.window.showInformationMessage( 'An image was not found on the clipboard.' - ); - else if (error.message == 'no filename exception') - vscode.window.showErrorMessage('Missing image filename argument.'); - else if (error.message == 'no xclip') - vscode.window.showErrorMessage('To use this feature you must install xclip'); - } else - vscode.window.showErrorMessage(error.toString()); - return; + ) + } else if (error.message === 'no filename exception') { + vscode.window.showErrorMessage('Missing image filename argument.') + } else if (error.message === 'no xclip') { + vscode.window.showErrorMessage('To use this feature you must install xclip') + } + } else { vscode.window.showErrorMessage(error.toString()) } + return } - let is_inline = Image.predict( + const isInline = Image.predict( config.mode, Image.modifiedLines(editor), editor.selection.anchor.character, selectedText - ); - let macro = `image${is_inline ? ':' : '::'}${filename}[${alttext}]`; + ) + let macro = `image${isInline ? ':' : '::'}${filename}[${alttext}]` - macro = Image.padMacro(config, editor, macro); + macro = Image.padMacro(config, editor, macro) editor.edit((edit) => { switch (config.mode) { - case SelectionMode.Insert: - edit.insert(editor.selection.active, macro); - break; - case SelectionMode.Replace: - edit.replace(editor.selection, macro); - break; + case SelectionMode.Insert: + edit.insert(editor.selection.active, macro) + break + case SelectionMode.Replace: + edit.replace(editor.selection, macro) + break } - }); + }) } // todo: tag functionl - private static padMacro( + private static padMacro ( config: Configuration, editor: vscode.TextEditor, macro: string ) { - let { first, second } = - config.mode == SelectionMode.Replace + const { first, second } = + config.mode === SelectionMode.Replace ? editor.selection.active.isAfter(editor.selection.anchor) ? { - first: editor.selection.anchor, - second: editor.selection.active, - } + first: editor.selection.anchor, + second: editor.selection.active, + } : { - first: editor.selection.active, - second: editor.selection.anchor, - } - : { first: editor.selection.active, second: editor.selection.active }; - let selection = editor.document.getText( + first: editor.selection.active, + second: editor.selection.anchor, + } + : { first: editor.selection.active, second: editor.selection.active } + const selection = editor.document.getText( new vscode.Range( first.translate(0, first.character > 0 ? -1 : 0), second.translate(0, 1) ) - ); - let padHead = first.character != 0 && !/^\s/.test(selection); - let padTail = !/\s$/.test(selection); + ) + const padHead = first.character !== 0 && !/^\s/.test(selection) + const padTail = !/\s$/.test(selection) - macro = `${padHead ? ' ' : ''}${macro}${padTail ? ' ' : ''}`; - return macro; + macro = `${padHead ? ' ' : ''}${macro}${padTail ? ' ' : ''}` + return macro } /** * Returns the lines that will be effected by the current editor selection */ - private static modifiedLines(editor: vscode.TextEditor) { + private static modifiedLines (editor: vscode.TextEditor) { const affectedLines = new vscode.Range( editor.selection.start.line, 0, editor.selection.end.line + 1, 0 - ); - const affectedText = editor.document.getText(affectedLines); - return affectedText; + ) + const affectedText = editor.document.getText(affectedLines) + return affectedText } /** * Determines if the resulting image-macro is an inline-image or * block-image. */ - private static predict( + private static predict ( selectionMode: SelectionMode, affectedText: string, index: number, + // eslint-disable-next-line @typescript-eslint/no-unused-vars selectedText: string ) { // does the macro start at the beginning of the line and end in only // whitespace. - return !(index === 0 && /^\s+$/.test(affectedText) || /^\s+$|^\S+$/.test(affectedText)) + return !((index === 0 && /^\s+$/.test(affectedText)) || /^\s+$|^\S+$/.test(affectedText)) } /** @@ -306,21 +309,21 @@ export namespace Import { * Reads the _nearest_ `:imagesdir:` attribute that appears _before_ the current selection * or cursor location, failing that figures it out from the API by converting the document and reading the attribute */ - static get_current_imagesdir() { - const text = vscode.window.activeTextEditor.document.getText(); + static getCurrentImagesDir () { + const text = vscode.window.activeTextEditor.document.getText() - const imagesdir = /^[\t\f]*?:imagesdir:\s+(.+?)\s+$/gim; - let matches = imagesdir.exec(text); + const imagesdir = /^[\t\f]*?:imagesdir:\s+(.+?)\s+$/gim + let matches = imagesdir.exec(text) - const index = vscode.window.activeTextEditor.selection.start; - const cursor_index = vscode.window.activeTextEditor.document.offsetAt( + const index = vscode.window.activeTextEditor.selection.start + const cursorIndex = vscode.window.activeTextEditor.document.offsetAt( index - ); + ) - let dir = ''; - while (matches && matches.index < cursor_index) { - dir = matches[1] || ''; - matches = imagesdir.exec(text); + let dir = '' + while (matches && matches.index < cursorIndex) { + dir = matches[1] || '' + matches = imagesdir.exec(text) } if (dir === '') { @@ -337,83 +340,71 @@ export namespace Import { * Checks if the given editor is a valid condidate _file_ for pasting images into. * @param editor vscode editor to check. */ - public static is_candidate_file(document: vscode.TextDocument): boolean { - return document.uri.scheme === 'file'; + public static isCandidateFile (document: vscode.TextDocument): boolean { + return document.uri.scheme === 'file' } /** * Checks if the given selected text is a valid _filename_ for an image. * @param selection Selected text to check. */ - public static is_candidate_selection(selection: string): boolean { - return encodeURIComponent(selection) === selection; + public static isCandidateSelection (selection: string): boolean { + return encodeURIComponent(selection) === selection } /** * Checks if the current selection is an `inline` element of the document. */ - public static isInline( + public static isInline ( document: vscode.TextDocument, selection: vscode.Selection ): boolean { - const line = document.lineAt(selection.start).text; - const selected_text = document.getText(selection); - const selected_text_is_block = new RegExp(`^${selected_text}\\w*$`); + const line = document.lineAt(selection.start).text + const selectedText = document.getText(selection) + const selectedTextIsBlock = new RegExp(`^${selectedText}\\w*$`) - return selection.isSingleLine && !selected_text_is_block.test(line); + return selection.isSingleLine && !selectedTextIsBlock.test(line) } /** * Determines the context of the selection in the document. */ - public static getSelectionContext( + public static getSelectionContext ( document: vscode.TextDocument, selection: vscode.Selection ): SelectionContext { - const line = document.lineAt(selection.start).text; - const selected_text = document.getText(selection); - const selected_text_is_block = new RegExp(`^${selected_text}\\w*$`); + // const line = document.lineAt(selection.start).text + const selectedText = document.getText(selection) + const selectedTextIsBlock = new RegExp(`^${selectedText}\\w*$`) if (!selection.isSingleLine) { - return SelectionContext.Other; - } else if (selected_text_is_block) { - return SelectionContext.Block; + return SelectionContext.Other + } else if (selectedTextIsBlock) { + return SelectionContext.Block } else { - return SelectionContext.Inline; + return SelectionContext.Inline } } - static validate(required: { + static validate (required: { editor: vscode.TextEditor; selection: string; }): boolean { - if (!this.is_candidate_file(required.editor.document)) { - return false; + if (!this.isCandidateFile(required.editor.document)) { + return false } - return true; + return true } - static isValidFilename( + static isValidFilename ( selection: string ): { result: boolean; value?: string } { - if (!this.is_candidate_selection(selection)) { - return { result: false, value: encodeURIComponent(selection) }; + if (!this.isCandidateSelection(selection)) { + return { result: false, value: encodeURIComponent(selection) } } - return { result: true, value: selection }; - } - } - - function encodeFilename(config: Configuration, filename: string) { - switch (config.encoding) { - case FilenameEncoding.None: - break; - case FilenameEncoding.URIEncoding: - filename = encodeURIComponent(filename); - break; - default: - return filename; + return { result: true, value: selection } } } } diff --git a/src/logger.ts b/src/logger.ts index d5259514..a5951581 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -2,78 +2,78 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { lazy } from './util/lazy'; +import * as vscode from 'vscode' +import { lazy } from './util/lazy' -enum Trace { +enum TraceType { Off, Verbose } namespace Trace { - export function fromString(value: string): Trace { - value = value.toLowerCase(); + export function fromString (value: string): TraceType { + value = value.toLowerCase() switch (value) { - case 'off': - return Trace.Off; - case 'verbose': - return Trace.Verbose; - default: - return Trace.Off; + case 'off': + return TraceType.Off + case 'verbose': + return TraceType.Verbose + default: + return TraceType.Off } } } -function isString(value: any): value is string { - return Object.prototype.toString.call(value) === '[object String]'; +function isString (value: any): value is string { + return Object.prototype.toString.call(value) === '[object String]' } export class Logger { - private trace?: Trace; + private trace?: TraceType; private readonly outputChannel = lazy(() => vscode.window.createOutputChannel('Asciidoc') ); - constructor() { - this.updateConfiguration(); + constructor () { + this.updateConfiguration() } - public log(message: string, data?: any): void { - if (this.trace === Trace.Verbose) { - this.appendLine(`[Log - ${new Date().toLocaleTimeString()}] ${message}`); + public log (message: string, data?: any): void { + if (this.trace === TraceType.Verbose) { + this.appendLine(`[Log - ${new Date().toLocaleTimeString()}] ${message}`) if (data) { - this.appendLine(Logger.data2String(data)); + this.appendLine(Logger.data2String(data)) } } } - public updateConfiguration() { - this.trace = this.readTrace(); + public updateConfiguration () { + this.trace = this.readTrace() } - private appendLine(value: string) { - return this.outputChannel.value.appendLine(value); + private appendLine (value: string) { + return this.outputChannel.value.appendLine(value) } - private readTrace(): Trace { + private readTrace (): TraceType { return Trace.fromString( vscode.workspace .getConfiguration(null, null) .get('asciidoc.trace', 'off') - ); + ) } - private static data2String(data: any): string { + private static data2String (data: any): string { if (data instanceof Error) { if (isString(data.stack)) { - return data.stack; + return data.stack } - return (data as Error).message; + return (data as Error).message } if (isString(data)) { - return data; + return data } - return JSON.stringify(data, undefined, 2); + return JSON.stringify(data, undefined, 2) } } diff --git a/src/providers/asciidoc.provider.ts b/src/providers/asciidoc.provider.ts index b1c7854f..8bd6c6a4 100644 --- a/src/providers/asciidoc.provider.ts +++ b/src/providers/asciidoc.provider.ts @@ -1,66 +1,66 @@ -import * as vscode from "vscode"; -import * as path from "path"; -import { createContext, Context } from "./createContext"; +import * as vscode from 'vscode' +import * as path from 'path' +import { createContext, Context } from './createContext' -import { createPathCompletionItem } from "./createCompletionItem"; +import { createPathCompletionItem } from './createCompletionItem' import { getPathOfFolderToLookupFiles, getChildrenOfPath, sortFilesAndDirectories, -} from "../util/file"; +} from '../util/file' export const AsciidocProvider = { provideCompletionItems, -}; +} -export async function provideCompletionItems( +export async function provideCompletionItems ( document: vscode.TextDocument, position: vscode.Position ): Promise { - const context = createContext(document, position); + const context = createContext(document, position) return shouldProvide(context) ? provide(context) - : Promise.resolve([]); + : Promise.resolve([]) } /** * Checks if we should provide any CompletionItems * @param context */ -function shouldProvide(context: Context): boolean { - return /(include\:\:|image\:\:|image\:)\S*/gi.test(context.textFullLine) +function shouldProvide (context: Context): boolean { + return /(include::|image::|image:)\S*/gi.test(context.textFullLine) } /** * Provide Completion Items */ -async function provide( +async function provide ( context: Context ): Promise { - const documentText = context.document.getText(); - const pathExtractedFromIncludeString = context.textFullLine.replace('include::', '').replace('image::', '').replace('image:', ''); - let entryDir = pathExtractedFromIncludeString.substr(0, pathExtractedFromIncludeString.lastIndexOf("/")); + const documentText = context.document.getText() + const pathExtractedFromIncludeString = context.textFullLine.replace('include::', '').replace('image::', '').replace('image:', '') + let entryDir = pathExtractedFromIncludeString.substr(0, pathExtractedFromIncludeString.lastIndexOf('/')) // use path defined in a variable used if (entryDir.startsWith('{')) { const variableName = entryDir.replace('{', '').replace('}', '') - const match = documentText.match(new RegExp(`:${variableName}:.*`, 'g')); + const match = documentText.match(new RegExp(`:${variableName}:.*`, 'g')) if (match && match[0]) { - entryDir = match[0].replace(`:${variableName}: `, ''); + entryDir = match[0].replace(`:${variableName}: `, '') } } - const workspace = vscode.workspace.getWorkspaceFolder(context.document.uri); - const rootPath = workspace?.uri.fsPath; + const workspace = vscode.workspace.getWorkspaceFolder(context.document.uri) + const rootPath = workspace?.uri.fsPath const searchPath = getPathOfFolderToLookupFiles( context.document.uri.fsPath, path.join(rootPath, entryDir) - ); + ) - const childrenOfPath = await getChildrenOfPath(searchPath); + const childrenOfPath = await getChildrenOfPath(searchPath) - const items = sortFilesAndDirectories(childrenOfPath); + const items = sortFilesAndDirectories(childrenOfPath) const levelUpCompletionItem: vscode.CompletionItem = { label: '..', @@ -71,11 +71,11 @@ async function provide( let variablePathSubstitutions = [] // TODO: prevent editor.autoClosingBrackets at this point until finished inserting - const editorConfig = vscode.workspace.getConfiguration('editor'); - const doAutoCloseBrackets = editorConfig.get('autoClosingBrackets') === 'always'; + const editorConfig = vscode.workspace.getConfiguration('editor') + const doAutoCloseBrackets = editorConfig.get('autoClosingBrackets') === 'always' if (globalVariableDefinitions) { variablePathSubstitutions = globalVariableDefinitions.map((variableDef) => { - const label = variableDef.match(/:\S+:/g)[0].replace(/\:/g, ''); + const label = variableDef.match(/:\S+:/g)[0].replace(/:/g, '') return { label: `{${label}}`, kind: vscode.CompletionItemKind.Variable, @@ -89,7 +89,7 @@ async function provide( levelUpCompletionItem, ...variablePathSubstitutions, ...items.map((child) => { - const result = createPathCompletionItem(child); + const result = createPathCompletionItem(child) result.insertText = result.kind === vscode.CompletionItemKind.File ? child.file + '[]' : child.file if (result.kind === vscode.CompletionItemKind.Folder) { result.command = { @@ -98,7 +98,7 @@ async function provide( arguments: [{ text: '/' }], } } - return result; + return result }), - ]; -} \ No newline at end of file + ] +} diff --git a/src/providers/bibtex.provider.ts b/src/providers/bibtex.provider.ts index 91d2f34a..f20a14ca 100644 --- a/src/providers/bibtex.provider.ts +++ b/src/providers/bibtex.provider.ts @@ -1,67 +1,67 @@ -import * as vscode from "vscode"; -import { createContext, Context } from "./createContext"; -import { readdirSync, readFileSync } from "fs"; -const bibtexParse = require("@orcid/bibtex-parse-js"); +import * as vscode from 'vscode' +import { createContext, Context } from './createContext' +import { readFileSync } from 'fs' +const bibtexParse = require('@orcid/bibtex-parse-js') export const BibtexProvider = { provideCompletionItems, -}; +} -export async function provideCompletionItems( +export async function provideCompletionItems ( document: vscode.TextDocument, position: vscode.Position ): Promise { - const context = createContext(document, position); + const context = createContext(document, position) - return shouldProvide(context) ? provide(context) : Promise.resolve([]); + return shouldProvide(context) ? provide(context) : Promise.resolve([]) } /** * Checks if we should provide any CompletionItems * @param context */ -function shouldProvide(context: Context): boolean { - const keyword = "citenp:"; +function shouldProvide (context: Context): boolean { + const keyword = 'citenp:' // Check if cursor is after citenp: const occurence = context.textFullLine.indexOf( keyword, context.position.character - keyword.length - ); - return occurence === context.position.character - keyword.length; + ) + return occurence === context.position.character - keyword.length } -async function getCitationKeys(): Promise { - const files = await vscode.workspace.findFiles("*.bib"); +async function getCitationKeys (): Promise { + const files = await vscode.workspace.findFiles('*.bib') const filesContent = files.map((file) => - readFileSync(file.path).toString("utf-8") - ); - const bibtexJson = filesContent.map((content) => bibtexParse.toJSON(content)); - const flatMap = (f, xs) => xs.reduce((r, x) => r.concat(f(x)), []); + readFileSync(file.path).toString('utf-8') + ) + const bibtexJson = filesContent.map((content) => bibtexParse.toJSON(content)) + const flatMap = (f, xs) => xs.reduce((r, x) => r.concat(f(x)), []) return flatMap( (jsons) => jsons.map((entries) => entries.citationKey), bibtexJson - ); + ) } /** * Provide Completion Items */ -async function provide(context: Context): Promise { - const { textFullLine, position } = context; - const indexOfNextWhiteSpace = textFullLine.includes(" ", position.character) - ? textFullLine.indexOf(" ", position.character) - : textFullLine.length; +async function provide (context: Context): Promise { + const { textFullLine, position } = context + const indexOfNextWhiteSpace = textFullLine.includes(' ', position.character) + ? textFullLine.indexOf(' ', position.character) + : textFullLine.length //Find the text between citenp: and the next whitespace character const bibtexSearch = textFullLine.substring( - textFullLine.lastIndexOf(":", position.character + 1) + 1, + textFullLine.lastIndexOf(':', position.character + 1) + 1, indexOfNextWhiteSpace - ); - const citationKeys = await getCitationKeys(); + ) + const citationKeys = await getCitationKeys() return citationKeys .filter((citationKeys) => citationKeys.match(bibtexSearch)) .map((citationKey) => ({ label: `[${citationKey}]`, kind: vscode.CompletionItemKind.Reference, - })); + })) } diff --git a/src/providers/createCompletionItem.ts b/src/providers/createCompletionItem.ts index a14932f0..4cabeb2d 100644 --- a/src/providers/createCompletionItem.ts +++ b/src/providers/createCompletionItem.ts @@ -1,12 +1,12 @@ -import * as vscode from "vscode"; -import { FileInfo } from "../util/file"; +import * as vscode from 'vscode' +import { FileInfo } from '../util/file' -export function createPathCompletionItem( +export function createPathCompletionItem ( fileInfo: FileInfo ): vscode.CompletionItem { return { label: fileInfo.file, kind: fileInfo.isFile ? vscode.CompletionItemKind.File : vscode.CompletionItemKind.Folder, sortText: fileInfo.file, - }; + } } diff --git a/src/providers/createContext.ts b/src/providers/createContext.ts index 62a5dcac..4491ef07 100644 --- a/src/providers/createContext.ts +++ b/src/providers/createContext.ts @@ -1,4 +1,4 @@ -import * as vscode from "vscode"; +import * as vscode from 'vscode' export interface Context { textFullLine: string; @@ -7,31 +7,31 @@ export interface Context { position: vscode.Position; } -export function createContext( +export function createContext ( document: vscode.TextDocument, position: vscode.Position ): Context { - const textFullLine = document.getText(document.lineAt(position).range); - const documentExtension = extractExtension(document); + const textFullLine = document.getText(document.lineAt(position).range) + const documentExtension = extractExtension(document) return { textFullLine, document, documentExtension, position, - }; + } } -export function extractExtension(document: vscode.TextDocument) { +export function extractExtension (document: vscode.TextDocument) { if (document.isUntitled) { - return undefined; + return undefined } - const fragments = document.fileName.split("."); - const extension = fragments[fragments.length - 1]; + const fragments = document.fileName.split('.') + const extension = fragments[fragments.length - 1] if (!extension || extension.length > 3) { - return undefined; + return undefined } - return extension; + return extension } diff --git a/src/providers/xref.provider.ts b/src/providers/xref.provider.ts index 4e4a58c6..943727be 100644 --- a/src/providers/xref.provider.ts +++ b/src/providers/xref.provider.ts @@ -1,65 +1,65 @@ -import { readFileSync } from "fs"; -import * as vscode from "vscode"; -import { createContext, Context } from "./createContext"; +import { readFileSync } from 'fs' +import * as vscode from 'vscode' +import { createContext, Context } from './createContext' export const xrefProvider = { provideCompletionItems, -}; +} -export async function provideCompletionItems( +export async function provideCompletionItems ( document: vscode.TextDocument, position: vscode.Position ): Promise { - const context = createContext(document, position); + const context = createContext(document, position) - return shouldProvide(context) ? provide(context) : Promise.resolve([]); + return shouldProvide(context) ? provide(context) : Promise.resolve([]) } /** * Checks if we should provide any CompletionItems * @param context */ -function shouldProvide(context: Context): boolean { - const keyword = "xref:"; +function shouldProvide (context: Context): boolean { + const keyword = 'xref:' // Check if cursor is after citenp: const occurence = context.textFullLine.indexOf( keyword, context.position.character - keyword.length - ); - return occurence === context.position.character - keyword.length; + ) + return occurence === context.position.character - keyword.length } -async function getLabels(): Promise { - const regex = new RegExp("\\[\\[(\\w+)\\]\\]", "g"); - const labels = await vscode.workspace.findFiles("**/*.adoc").then((files) => +async function getLabels (): Promise { + const regex = /\\[\\[(\\w+)\\]\\]/g + const labels = await vscode.workspace.findFiles('**/*.adoc').then((files) => files - .map((uri) => readFileSync(uri.path).toString("utf-8")) - .join("\n") + .map((uri) => readFileSync(uri.path).toString('utf-8')) + .join('\n') .match(regex) - .map((result) => result.replace("[[", "").replace("]]", "")) - ); - return labels; + .map((result) => result.replace('[[', '').replace(']]', '')) + ) + return labels } /** * Provide Completion Items */ -async function provide(context: Context): Promise { - const { textFullLine, position } = context; - const indexOfNextWhiteSpace = textFullLine.includes(" ", position.character) - ? textFullLine.indexOf(" ", position.character) - : textFullLine.length; +async function provide (context: Context): Promise { + const { textFullLine, position } = context + const indexOfNextWhiteSpace = textFullLine.includes(' ', position.character) + ? textFullLine.indexOf(' ', position.character) + : textFullLine.length //Find the text between citenp: and the next whitespace character const search = textFullLine.substring( - textFullLine.lastIndexOf(":", position.character + 1) + 1, + textFullLine.lastIndexOf(':', position.character + 1) + 1, indexOfNextWhiteSpace - ); - const xrefLabels = await getLabels(); + ) + const xrefLabels = await getLabels() return xrefLabels .filter((label) => label.match(search)) .map((label) => ({ label: `${label}[]`, kind: vscode.CompletionItemKind.Reference, - })); + })) } diff --git a/src/security.ts b/src/security.ts index 1fd385de..b751f53b 100644 --- a/src/security.ts +++ b/src/security.ts @@ -2,156 +2,159 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; +import * as vscode from 'vscode' -import { AsciidocPreviewManager } from './features/previewManager'; +import { AsciidocPreviewManager } from './features/previewManager' -import * as nls from 'vscode-nls'; +import * as nls from 'vscode-nls' -const localize = nls.loadMessageBundle(); +const localize = nls.loadMessageBundle() export const enum AsciidocPreviewSecurityLevel { - Strict = 0, - AllowInsecureContent = 1, - AllowScriptsAndAllContent = 2, - AllowInsecureLocalContent = 3 + Strict = 0, + AllowInsecureContent = 1, + AllowScriptsAndAllContent = 2, + AllowInsecureLocalContent = 3 } export interface ContentSecurityPolicyArbiter { - getSecurityLevelForResource(resource: vscode.Uri): AsciidocPreviewSecurityLevel; + getSecurityLevelForResource(resource: vscode.Uri): AsciidocPreviewSecurityLevel; - setSecurityLevelForResource(resource: vscode.Uri, level: AsciidocPreviewSecurityLevel): Thenable; + setSecurityLevelForResource(resource: vscode.Uri, level: AsciidocPreviewSecurityLevel): Promise; - shouldAllowSvgsForResource(resource: vscode.Uri): void; + shouldAllowSvgsForResource(resource: vscode.Uri): void; - shouldDisableSecurityWarnings(): boolean; + shouldDisableSecurityWarnings(): boolean; - setShouldDisableSecurityWarning(shouldShow: boolean): Thenable; + setShouldDisableSecurityWarning(shouldShow: boolean): Promise; } export class ExtensionContentSecurityPolicyArbiter implements ContentSecurityPolicyArbiter { - private readonly old_trusted_workspace_key = 'trusted_preview_workspace:'; - private readonly security_level_key = 'preview_security_level:'; - private readonly should_disable_security_warning_key = 'preview_should_show_security_warning:'; - - constructor( - private readonly globalState: vscode.Memento, - private readonly workspaceState: vscode.Memento - ) { } - - public getSecurityLevelForResource(resource: vscode.Uri): AsciidocPreviewSecurityLevel { - // Use new security level setting first - const level = this.globalState.get(this.security_level_key + this.getRoot(resource), undefined); - if (typeof level !== 'undefined') { - return level; - } - - // Fallback to old trusted workspace setting - if (this.globalState.get(this.old_trusted_workspace_key + this.getRoot(resource), false)) { - return AsciidocPreviewSecurityLevel.AllowScriptsAndAllContent; - } - return AsciidocPreviewSecurityLevel.Strict; - } - - public setSecurityLevelForResource(resource: vscode.Uri, level: AsciidocPreviewSecurityLevel): Thenable { - return this.globalState.update(this.security_level_key + this.getRoot(resource), level); - } - - public shouldAllowSvgsForResource(resource: vscode.Uri) { - const securityLevel = this.getSecurityLevelForResource(resource); - return securityLevel === AsciidocPreviewSecurityLevel.AllowInsecureContent || securityLevel === AsciidocPreviewSecurityLevel.AllowScriptsAndAllContent; - } - - public shouldDisableSecurityWarnings(): boolean { - return this.workspaceState.get(this.should_disable_security_warning_key, false); - } - - public setShouldDisableSecurityWarning(disabled: boolean): Thenable { - return this.workspaceState.update(this.should_disable_security_warning_key, disabled); - } - - private getRoot(resource: vscode.Uri): vscode.Uri { - if (vscode.workspace.workspaceFolders) { - const folderForResource = vscode.workspace.getWorkspaceFolder(resource); - if (folderForResource) { - return folderForResource.uri; - } - - if (vscode.workspace.workspaceFolders.length) { - return vscode.workspace.workspaceFolders[0].uri; - } - } - - return resource; - } + private readonly oldTrustedWorkspaceKey = 'trusted_preview_workspace:' + private readonly securityLevelKey = 'preview_security_level:' + private readonly shouldDisableSecurityWarningKey = 'preview_should_show_security_warning:' + + constructor ( + private readonly globalState: vscode.Memento, + private readonly workspaceState: vscode.Memento + ) { + this.globalState = globalState + this.workspaceState = workspaceState + } + + public getSecurityLevelForResource (resource: vscode.Uri): AsciidocPreviewSecurityLevel { + // Use new security level setting first + const level = this.globalState.get(this.securityLevelKey + this.getRoot(resource), undefined) + if (typeof level !== 'undefined') { + return level + } + + // Fallback to old trusted workspace setting + if (this.globalState.get(this.oldTrustedWorkspaceKey + this.getRoot(resource), false)) { + return AsciidocPreviewSecurityLevel.AllowScriptsAndAllContent + } + return AsciidocPreviewSecurityLevel.Strict + } + + public async setSecurityLevelForResource (resource: vscode.Uri, level: AsciidocPreviewSecurityLevel): Promise { + return this.globalState.update(this.securityLevelKey + this.getRoot(resource), level) + } + + public shouldAllowSvgsForResource (resource: vscode.Uri) { + const securityLevel = this.getSecurityLevelForResource(resource) + return securityLevel === AsciidocPreviewSecurityLevel.AllowInsecureContent || securityLevel === AsciidocPreviewSecurityLevel.AllowScriptsAndAllContent + } + + public shouldDisableSecurityWarnings (): boolean { + return this.workspaceState.get(this.shouldDisableSecurityWarningKey, false) + } + + public async setShouldDisableSecurityWarning (disabled: boolean): Promise { + return this.workspaceState.update(this.shouldDisableSecurityWarningKey, disabled) + } + + private getRoot (resource: vscode.Uri): vscode.Uri { + if (vscode.workspace.workspaceFolders) { + const folderForResource = vscode.workspace.getWorkspaceFolder(resource) + if (folderForResource) { + return folderForResource.uri + } + + if (vscode.workspace.workspaceFolders.length) { + return vscode.workspace.workspaceFolders[0].uri + } + } + + return resource + } } export class PreviewSecuritySelector { + public constructor (private readonly cspArbiter: ContentSecurityPolicyArbiter, + private readonly webviewManager: AsciidocPreviewManager + ) { + this.cspArbiter = cspArbiter + this.webviewManager = webviewManager + } - public constructor( - private readonly cspArbiter: ContentSecurityPolicyArbiter, - private readonly webviewManager: AsciidocPreviewManager - ) { } - - public async showSecutitySelectorForResource(resource: vscode.Uri): Promise { - interface PreviewSecurityPickItem extends vscode.QuickPickItem { - readonly type: 'moreinfo' | 'toggle' | AsciidocPreviewSecurityLevel; - } - - function markActiveWhen(when: boolean): string { - return when ? '• ' : ''; - } - - const currentSecurityLevel = this.cspArbiter.getSecurityLevelForResource(resource); - const selection = await vscode.window.showQuickPick( - [ - { - type: AsciidocPreviewSecurityLevel.Strict, - label: markActiveWhen(currentSecurityLevel === AsciidocPreviewSecurityLevel.Strict) + localize('strict.title', 'Strict'), - description: localize('strict.description', 'Only load secure content'), - }, { - type: AsciidocPreviewSecurityLevel.AllowInsecureLocalContent, - label: markActiveWhen(currentSecurityLevel === AsciidocPreviewSecurityLevel.AllowInsecureLocalContent) + localize('insecureLocalContent.title', 'Allow insecure local content'), - description: localize('insecureLocalContent.description', 'Enable loading content over http served from localhost'), - }, { - type: AsciidocPreviewSecurityLevel.AllowInsecureContent, - label: markActiveWhen(currentSecurityLevel === AsciidocPreviewSecurityLevel.AllowInsecureContent) + localize('insecureContent.title', 'Allow insecure content'), - description: localize('insecureContent.description', 'Enable loading content over http'), - }, { - type: AsciidocPreviewSecurityLevel.AllowScriptsAndAllContent, - label: markActiveWhen(currentSecurityLevel === AsciidocPreviewSecurityLevel.AllowScriptsAndAllContent) + localize('disable.title', 'Disable'), - description: localize('disable.description', 'Allow all content and script execution. Not recommended'), - }, { - type: 'moreinfo', - label: localize('moreInfo.title', 'More Information'), - description: '', - }, { - type: 'toggle', - label: this.cspArbiter.shouldDisableSecurityWarnings() - ? localize('enableSecurityWarning.title', "Enable preview security warnings in this workspace") - : localize('disableSecurityWarning.title', "Disable preview security warning in this workspace"), - description: localize('toggleSecurityWarning.description', 'Does not affect the content security level'), - }, - ], { - placeHolder: localize( - 'preview.showPreviewSecuritySelector.title', - 'Select security settings for Asciidoc previews in this workspace'), - }); - if (!selection) { - return; - } - - if (selection.type === 'moreinfo') { - vscode.commands.executeCommand('vscode.open', vscode.Uri.parse('https://go.microsoft.com/fwlink/?linkid=854414')); - return; - } - - if (selection.type === 'toggle') { - this.cspArbiter.setShouldDisableSecurityWarning(!this.cspArbiter.shouldDisableSecurityWarnings()); - return; - } else { - await this.cspArbiter.setSecurityLevelForResource(resource, selection.type); - } - this.webviewManager.refresh(); + public async showSecuritySelectorForResource (resource: vscode.Uri): Promise { + interface PreviewSecurityPickItem extends vscode.QuickPickItem { + readonly type: 'moreinfo' | 'toggle' | AsciidocPreviewSecurityLevel; + } + + function markActiveWhen (when: boolean): string { + return when ? '• ' : '' + } + + const currentSecurityLevel = this.cspArbiter.getSecurityLevelForResource(resource) + const selection = await vscode.window.showQuickPick( + [ + { + type: AsciidocPreviewSecurityLevel.Strict, + label: markActiveWhen(currentSecurityLevel === AsciidocPreviewSecurityLevel.Strict) + localize('strict.title', 'Strict'), + description: localize('strict.description', 'Only load secure content'), + }, { + type: AsciidocPreviewSecurityLevel.AllowInsecureLocalContent, + label: markActiveWhen(currentSecurityLevel === AsciidocPreviewSecurityLevel.AllowInsecureLocalContent) + localize('insecureLocalContent.title', 'Allow insecure local content'), + description: localize('insecureLocalContent.description', 'Enable loading content over http served from localhost'), + }, { + type: AsciidocPreviewSecurityLevel.AllowInsecureContent, + label: markActiveWhen(currentSecurityLevel === AsciidocPreviewSecurityLevel.AllowInsecureContent) + localize('insecureContent.title', 'Allow insecure content'), + description: localize('insecureContent.description', 'Enable loading content over http'), + }, { + type: AsciidocPreviewSecurityLevel.AllowScriptsAndAllContent, + label: markActiveWhen(currentSecurityLevel === AsciidocPreviewSecurityLevel.AllowScriptsAndAllContent) + localize('disable.title', 'Disable'), + description: localize('disable.description', 'Allow all content and script execution. Not recommended'), + }, { + type: 'moreinfo', + label: localize('moreInfo.title', 'More Information'), + description: '', + }, { + type: 'toggle', + label: this.cspArbiter.shouldDisableSecurityWarnings() + ? localize('enableSecurityWarning.title', 'Enable preview security warnings in this workspace') + : localize('disableSecurityWarning.title', 'Disable preview security warning in this workspace'), + description: localize('toggleSecurityWarning.description', 'Does not affect the content security level'), + }, + ], { + placeHolder: localize( + 'preview.showPreviewSecuritySelector.title', + 'Select security settings for Asciidoc previews in this workspace'), + }) + if (!selection) { + return + } + + if (selection.type === 'moreinfo') { + vscode.commands.executeCommand('vscode.open', vscode.Uri.parse('https://go.microsoft.com/fwlink/?linkid=854414')) + return + } + + if (selection.type === 'toggle') { + await this.cspArbiter.setShouldDisableSecurityWarning(!this.cspArbiter.shouldDisableSecurityWarnings()) + return + } + await this.cspArbiter.setSecurityLevelForResource(resource, selection.type) + this.webviewManager.refresh() } } diff --git a/src/slugify.ts b/src/slugify.ts index e7b83d65..ef932191 100644 --- a/src/slugify.ts +++ b/src/slugify.ts @@ -3,29 +3,29 @@ *--------------------------------------------------------------------------------------------*/ export class Slug { - public constructor( - public readonly value: string - ) { } + constructor (public readonly value: string) { + this.value = value + } - public equals(other: Slug): boolean { - return this.value === other.value; + public equals (other: Slug): boolean { + return this.value === other.value } } export interface Slugifier { - fromHeading(heading: string): Slug; + fromHeading(heading: string): Slug; } export const githubSlugifier: Slugifier = new class implements Slugifier { - fromHeading(heading: string): Slug { + fromHeading (heading: string): Slug { const slugifiedHeading = encodeURI( heading.trim() .toLowerCase() .replace(/\s+/g, '-') // Replace whitespace with - - .replace(/[\]\[\!\'\#\$\%\&\'\(\)\*\+\,\.\/\:\;\<\=\>\?\@\\\^\_\{\|\}\~\`。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}]/g, '') // Remove known punctuators - .replace(/^\-+/, '') // Remove leading - - .replace(/\-+$/, '') // Remove trailing - - ); - return new Slug(slugifiedHeading); + .replace(/[\][!'#$%&'()*+,./:;<=>?@\\^_{|}~`。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}]/g, '') // Remove known punctuators + .replace(/^-+/, '') // Remove leading - + .replace(/-+$/, '') // Remove trailing - + ) + return new Slug(slugifiedHeading) } -}; +}() diff --git a/src/tableOfContentsProvider.ts b/src/tableOfContentsProvider.ts index 6f3f7cc4..b51b2109 100644 --- a/src/tableOfContentsProvider.ts +++ b/src/tableOfContentsProvider.ts @@ -2,83 +2,82 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { AsciidocEngine } from './asciidocEngine'; -import { Slug, githubSlugifier } from './slugify'; +import * as vscode from 'vscode' +import { AsciidocEngine } from './asciidocEngine' +import { Slug, githubSlugifier } from './slugify' export interface TocEntry { - readonly slug: Slug; - readonly text: string; - readonly level: number; - readonly line: number; - readonly location: vscode.Location; + readonly slug: Slug; + readonly text: string; + readonly level: number; + readonly line: number; + readonly location: vscode.Location; } export interface SkinnyTextDocument { - readonly uri: vscode.Uri; - readonly lineCount: number; - getText(): string; - lineAt(line: number): vscode.TextLine; + readonly uri: vscode.Uri; + readonly lineCount: number; + getText(): string; + lineAt(line: number): vscode.TextLine; } export class TableOfContentsProvider { - private toc?: TocEntry[]; + private toc?: TocEntry[]; - public constructor( - private engine: AsciidocEngine, - private document: SkinnyTextDocument - ) { } + public constructor (private engine: AsciidocEngine, private document: SkinnyTextDocument) { + this.engine = engine + this.document = document + } - public async getToc(): Promise { - if (!this.toc) { - try { - this.toc = await this.buildToc(this.document); - } catch (e) { - this.toc = []; - } - } - return this.toc; - } + public async getToc (): Promise { + if (!this.toc) { + try { + this.toc = await this.buildToc(this.document) + } catch (e) { + this.toc = [] + } + } + return this.toc + } - public async lookup(fragment: string): Promise { - const toc = await this.getToc(); - const slug = githubSlugifier.fromHeading(fragment); - return toc.find((entry) => entry.slug.equals(slug)); - } + public async lookup (fragment: string): Promise { + const toc = await this.getToc() + const slug = githubSlugifier.fromHeading(fragment) + return toc.find((entry) => entry.slug.equals(slug)) + } - private async buildToc(document: SkinnyTextDocument): Promise { - let toc: TocEntry[] = []; - const adoc = await this.engine.parse(document.uri, document.getText()); - - adoc.findBy({ 'context': 'section' }, function (section) { - toc.push({ - slug: section.getId(), - text: section.getTitle(), - level: section.getLevel(), - line: section.getLineNumber()-1, - location: new vscode.Location(document.uri, - new vscode.Position(section.getLineNumber()-1, 1)), - }) - }) + private async buildToc (document: SkinnyTextDocument): Promise { + const toc: TocEntry[] = [] + const adoc = await this.engine.parse(document.uri, document.getText()) - // Get full range of section - return toc.map((entry, startIndex): TocEntry => { - let end: number | undefined = undefined; - for (let i = startIndex + 1; i < toc.length; ++i) { - if (toc[i].level <= entry.level) { - end = toc[i].line - 1; - break; - } - } - const endLine = typeof end === 'number' ? end : document.lineCount - 1; - return { - ...entry, - location: new vscode.Location(document.uri, - new vscode.Range( - entry.location.range.start, - new vscode.Position(endLine, document.lineAt(endLine).range.end.character))), - }; - }); - } + adoc.findBy({ context: 'section' }, function (section) { + toc.push({ + slug: section.getId(), + text: section.getTitle(), + level: section.getLevel(), + line: section.getLineNumber() - 1, + location: new vscode.Location(document.uri, + new vscode.Position(section.getLineNumber() - 1, 1)), + }) + }) + // Get full range of section + return toc.map((entry, startIndex): TocEntry => { + let end: number | undefined + for (let i = startIndex + 1; i < toc.length; ++i) { + if (toc[i].level <= entry.level) { + end = toc[i].line - 1 + break + } + } + const endLine = typeof end === 'number' ? end : document.lineCount - 1 + return { + ...entry, + location: new vscode.Location(document.uri, + new vscode.Range( + entry.location.range.start, + new vscode.Position(endLine, document.lineAt(endLine).range.end.character))), + } + }) + } } diff --git a/src/test/documentLinkProvider.test.ts b/src/test/documentLinkProvider.test.ts index fffd2e90..4cfad435 100644 --- a/src/test/documentLinkProvider.test.ts +++ b/src/test/documentLinkProvider.test.ts @@ -2,106 +2,101 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as assert from 'assert'; -import 'mocha'; -import * as vscode from 'vscode'; -import LinkProvider from '../features/documentLinkProvider'; -import { InMemoryDocument } from './inMemoryDocument'; +import * as assert from 'assert' +import 'mocha' +import * as vscode from 'vscode' +import LinkProvider from '../features/documentLinkProvider' +import { InMemoryDocument } from './inMemoryDocument' - -const testFileName = vscode.Uri.file('test.md'); +const testFileName = vscode.Uri.file('test.md') const noopToken = new class implements vscode.CancellationToken { - private _onCancellationRequestedEmitter = new vscode.EventEmitter(); - public onCancellationRequested = this._onCancellationRequestedEmitter.event; + private _onCancellationRequestedEmitter = new vscode.EventEmitter(); + public onCancellationRequested = this._onCancellationRequestedEmitter.event; - get isCancellationRequested() { return false; } -}; + get isCancellationRequested () { return false } +}() -function getLinksForFile(fileContents: string) { - const doc = new InMemoryDocument(testFileName, fileContents); - const provider = new LinkProvider(); - return provider.provideDocumentLinks(doc, noopToken); +function getLinksForFile (fileContents: string) { + const doc = new InMemoryDocument(testFileName, fileContents) + const provider = new LinkProvider() + return provider.provideDocumentLinks(doc, noopToken) } -function assertRangeEqual(expected: vscode.Range, actual: vscode.Range) { - assert.strictEqual(expected.start.line, actual.start.line); - assert.strictEqual(expected.start.character, actual.start.character); - assert.strictEqual(expected.end.line, actual.end.line); - assert.strictEqual(expected.end.character, actual.end.character); +function assertRangeEqual (expected: vscode.Range, actual: vscode.Range) { + assert.strictEqual(expected.start.line, actual.start.line) + assert.strictEqual(expected.start.character, actual.start.character) + assert.strictEqual(expected.end.line, actual.end.line) + assert.strictEqual(expected.end.character, actual.end.character) } suite('asciidoc.DocumentLinkProvider', () => { test('Should not return anything for empty document', () => { - const links = getLinksForFile(''); - assert.strictEqual(links.length, 0); - }); + const links = getLinksForFile('') + assert.strictEqual(links.length, 0) + }) test('Should not return anything for simple document without links', () => { - const links = getLinksForFile('# a\nfdasfdfsafsa'); - assert.strictEqual(links.length, 0); - }); + const links = getLinksForFile('# a\nfdasfdfsafsa') + assert.strictEqual(links.length, 0) + }) test('Should detect basic http links', () => { - const links = getLinksForFile('a [b](https://example.com) c'); - assert.strictEqual(links.length, 1); - const [link] = links; - assertRangeEqual(link.range, new vscode.Range(0, 6, 0, 25)); - }); + const links = getLinksForFile('a [b](https://example.com) c') + assert.strictEqual(links.length, 1) + const [link] = links + assertRangeEqual(link.range, new vscode.Range(0, 6, 0, 25)) + }) test('Should detect basic workspace links', () => { { - const links = getLinksForFile('a [b](./file) c'); - assert.strictEqual(links.length, 1); - const [link] = links; - assertRangeEqual(link.range, new vscode.Range(0, 6, 0, 12)); + const links = getLinksForFile('a [b](./file) c') + assert.strictEqual(links.length, 1) + const [link] = links + assertRangeEqual(link.range, new vscode.Range(0, 6, 0, 12)) } { - const links = getLinksForFile('a [b](file.png) c'); - assert.strictEqual(links.length, 1); - const [link] = links; - assertRangeEqual(link.range, new vscode.Range(0, 6, 0, 14)); + const links = getLinksForFile('a [b](file.png) c') + assert.strictEqual(links.length, 1) + const [link] = links + assertRangeEqual(link.range, new vscode.Range(0, 6, 0, 14)) } - }); + }) test('Should detect links with title', () => { - const links = getLinksForFile('a [b](https://example.com "abc") c'); - assert.strictEqual(links.length, 1); - const [link] = links; - assertRangeEqual(link.range, new vscode.Range(0, 6, 0, 25)); - }); - + const links = getLinksForFile('a [b](https://example.com "abc") c') + assert.strictEqual(links.length, 1) + const [link] = links + assertRangeEqual(link.range, new vscode.Range(0, 6, 0, 25)) + }) test('Should handle links with balanced parens', () => { { - const links = getLinksForFile('a [b](https://example.com/a()c) c'); - assert.strictEqual(links.length, 1); - const [link] = links; - assertRangeEqual(link.range, new vscode.Range(0, 6, 0, 30)); + const links = getLinksForFile('a [b](https://example.com/a()c) c') + assert.strictEqual(links.length, 1) + const [link] = links + assertRangeEqual(link.range, new vscode.Range(0, 6, 0, 30)) } { - const links = getLinksForFile('a [b](https://example.com/a(b)c) c'); - assert.strictEqual(links.length, 1); - const [link] = links; - assertRangeEqual(link.range, new vscode.Range(0, 6, 0, 31)); - + const links = getLinksForFile('a [b](https://example.com/a(b)c) c') + assert.strictEqual(links.length, 1) + const [link] = links + assertRangeEqual(link.range, new vscode.Range(0, 6, 0, 31)) } { // #49011 - const links = getLinksForFile('[A link](http://ThisUrlhasParens/A_link(in_parens))'); - assert.strictEqual(links.length, 1); - const [link] = links; - assertRangeEqual(link.range, new vscode.Range(0, 9, 0, 50)); + const links = getLinksForFile('[A link](http://ThisUrlhasParens/A_link(in_parens))') + assert.strictEqual(links.length, 1) + const [link] = links + assertRangeEqual(link.range, new vscode.Range(0, 9, 0, 50)) } - }); + }) test('Should handle two links without space', () => { - const links = getLinksForFile('a ([test](test)[test2](test2)) c'); - assert.strictEqual(links.length, 2); - const [link1, link2] = links; - assertRangeEqual(link1.range, new vscode.Range(0, 10, 0, 14)); - assertRangeEqual(link2.range, new vscode.Range(0, 23, 0, 28)); - }); -}); - - + const links = getLinksForFile('a ([test](test)[test2](test2)) c') + assert.strictEqual(links.length, 2) + const [link1, link2] = links + assertRangeEqual(link1.range, new vscode.Range(0, 10, 0, 14)) + assertRangeEqual(link2.range, new vscode.Range(0, 23, 0, 28)) + }) +}) diff --git a/src/test/documentSymbolProvider.test.ts b/src/test/documentSymbolProvider.test.ts index f0f4c639..5b45f87f 100644 --- a/src/test/documentSymbolProvider.test.ts +++ b/src/test/documentSymbolProvider.test.ts @@ -2,83 +2,79 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as assert from 'assert'; -import 'mocha'; -import * as vscode from 'vscode'; -import SymbolProvider from '../features/documentSymbolProvider'; -import { InMemoryDocument } from './inMemoryDocument'; -import { createNewAsciidocEngine } from './engine'; - - -const testFileName = vscode.Uri.file('test.md'); - - -function getSymbolsForFile(fileContents: string) { - const doc = new InMemoryDocument(testFileName, fileContents); - const provider = new SymbolProvider(createNewAsciidocEngine(), null, null, null, null); - return provider.provideDocumentSymbols(doc); +import * as assert from 'assert' +import 'mocha' +import * as vscode from 'vscode' +import SymbolProvider from '../features/documentSymbolProvider' +import { InMemoryDocument } from './inMemoryDocument' +import { createNewAsciidocEngine } from './engine' + +const testFileName = vscode.Uri.file('test.md') + +function getSymbolsForFile (fileContents: string) { + const doc = new InMemoryDocument(testFileName, fileContents) + const provider = new SymbolProvider(createNewAsciidocEngine(), null) + return provider.provideDocumentSymbols(doc) } - suite('asciidoc.DocumentSymbolProvider', () => { test('Should not return anything for empty document', async () => { - const symbols = await getSymbolsForFile(''); - assert.strictEqual(symbols.length, 0); - }); + const symbols = await getSymbolsForFile('') + assert.strictEqual(symbols.length, 0) + }) test('Should not return anything for document with no headers', async () => { - const symbols = await getSymbolsForFile('a\na'); - assert.strictEqual(symbols.length, 0); - }); + const symbols = await getSymbolsForFile('a\na') + assert.strictEqual(symbols.length, 0) + }) test('Should not return anything for document with # but no real headers', async () => { - const symbols = await getSymbolsForFile('a#a\na#'); - assert.strictEqual(symbols.length, 0); - }); + const symbols = await getSymbolsForFile('a#a\na#') + assert.strictEqual(symbols.length, 0) + }) test('Should return single symbol for single header', async () => { - const symbols = await getSymbolsForFile('# h'); - assert.strictEqual(symbols.length, 1); - assert.strictEqual(symbols[0].name, '# h'); - }); + const symbols = await getSymbolsForFile('# h') + assert.strictEqual(symbols.length, 1) + assert.strictEqual(symbols[0].name, '# h') + }) test('Should not care about symbol level for single header', async () => { - const symbols = await getSymbolsForFile('### h'); - assert.strictEqual(symbols.length, 1); - assert.strictEqual(symbols[0].name, '### h'); - }); + const symbols = await getSymbolsForFile('### h') + assert.strictEqual(symbols.length, 1) + assert.strictEqual(symbols[0].name, '### h') + }) test('Should put symbols of same level in flat list', async () => { - const symbols = await getSymbolsForFile('## h\n## h2'); - assert.strictEqual(symbols.length, 2); - assert.strictEqual(symbols[0].name, '## h'); - assert.strictEqual(symbols[1].name, '## h2'); - }); + const symbols = await getSymbolsForFile('## h\n## h2') + assert.strictEqual(symbols.length, 2) + assert.strictEqual(symbols[0].name, '## h') + assert.strictEqual(symbols[1].name, '## h2') + }) test('Should nest symbol of level - 1 under parent', async () => { - - const symbols = await getSymbolsForFile('# h\n## h2\n## h3'); - assert.strictEqual(symbols.length, 1); - assert.strictEqual(symbols[0].name, '# h'); - assert.strictEqual(symbols[0].children.length, 2); - assert.strictEqual(symbols[0].children[0].name, '## h2'); - assert.strictEqual(symbols[0].children[1].name, '## h3'); - }); + const symbols = await getSymbolsForFile('# h\n## h2\n## h3') + assert.strictEqual(symbols.length, 1) + assert.strictEqual(symbols[0].name, '# h') + assert.strictEqual(symbols[0].children.length, 2) + assert.strictEqual(symbols[0].children[0].name, '## h2') + assert.strictEqual(symbols[0].children[1].name, '## h3') + }) test('Should nest symbol of level - n under parent', async () => { - const symbols = await getSymbolsForFile('# h\n#### h2'); - assert.strictEqual(symbols.length, 1); - assert.strictEqual(symbols[0].name, '# h'); - assert.strictEqual(symbols[0].children.length, 1); - assert.strictEqual(symbols[0].children[0].name, '#### h2'); - }); + const symbols = await getSymbolsForFile('# h\n#### h2') + assert.strictEqual(symbols.length, 1) + assert.strictEqual(symbols[0].name, '# h') + assert.strictEqual(symbols[0].children.length, 1) + assert.strictEqual(symbols[0].children[0].name, '#### h2') + }) test('Should flatten children where lower level occurs first', async () => { - const symbols = await getSymbolsForFile('# h\n### h2\n## h3'); - assert.strictEqual(symbols.length, 1); - assert.strictEqual(symbols[0].name, '# h'); - assert.strictEqual(symbols[0].children.length, 2); - assert.strictEqual(symbols[0].children[0].name, '### h2'); - assert.strictEqual(symbols[0].children[1].name, '## h3'); - }); -}); + const symbols = await getSymbolsForFile('# h\n### h2\n## h3') + assert.strictEqual(symbols.length, 1) + assert.strictEqual(symbols[0].name, '# h') + assert.strictEqual(symbols[0].children.length, 2) + assert.strictEqual(symbols[0].children[0].name, '### h2') + assert.strictEqual(symbols[0].children[1].name, '## h3') + }) +}) diff --git a/src/test/engine.ts b/src/test/engine.ts index fa5723c3..93b024f5 100644 --- a/src/test/engine.ts +++ b/src/test/engine.ts @@ -2,20 +2,20 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { AsciidocEngine } from '../asciidocEngine'; -import { AsciidocContributions } from '../asciidocExtensions'; -import { githubSlugifier } from '../slugify'; +import * as vscode from 'vscode' +import { AsciidocEngine } from '../asciidocEngine' +import { AsciidocContributions } from '../asciidocExtensions' +import { githubSlugifier } from '../slugify' const emptyContributions = new class implements AsciidocContributions { - readonly extensionPath = ''; - readonly previewScripts: vscode.Uri[] = []; - readonly previewStylesEditor: vscode.Uri[] = []; - readonly previewStylesDefault: vscode.Uri[] = []; - readonly previewResourceRoots: vscode.Uri[] = []; - readonly asciidocItPlugins: Promise<(md: any) => any>[] = []; -}; + readonly extensionPath = ''; + readonly previewScripts: vscode.Uri[] = []; + readonly previewStylesEditor: vscode.Uri[] = []; + readonly previewStylesDefault: vscode.Uri[] = []; + readonly previewResourceRoots: vscode.Uri[] = []; + readonly asciidocItPlugins: Promise<(md: any) => any>[] = []; +}() -export function createNewAsciidocEngine(): AsciidocEngine { - return new AsciidocEngine(emptyContributions, githubSlugifier); +export function createNewAsciidocEngine (): AsciidocEngine { + return new AsciidocEngine(emptyContributions, githubSlugifier) } diff --git a/src/test/foldingProvider.test.ts b/src/test/foldingProvider.test.ts index b55fbcc8..8f2d2f79 100644 --- a/src/test/foldingProvider.test.ts +++ b/src/test/foldingProvider.test.ts @@ -2,40 +2,40 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as assert from 'assert'; -import * as vscode from 'vscode'; -import 'mocha'; +import * as assert from 'assert' +import * as vscode from 'vscode' +import 'mocha' -import AsciidocFoldingProvider from '../features/foldingProvider'; -import { InMemoryDocument } from './inMemoryDocument'; -import { createNewAsciidocEngine } from './engine'; +import AsciidocFoldingProvider from '../features/foldingProvider' +import { InMemoryDocument } from './inMemoryDocument' +import { createNewAsciidocEngine } from './engine' -const testFileName = vscode.Uri.file('test.md'); +const testFileName = vscode.Uri.file('test.md') suite('asciidoc.FoldingProvider', () => { test('Should not return anything for empty document', async () => { - const folds = await getFoldsForDocument(``); - assert.strictEqual(folds.length, 0); - }); + const folds = await getFoldsForDocument('') + assert.strictEqual(folds.length, 0) + }) test('Should not return anything for document without headers', async () => { const folds = await getFoldsForDocument(`a **b** afas a#b -a`); - assert.strictEqual(folds.length, 0); - }); +a`) + assert.strictEqual(folds.length, 0) + }) test('Should fold from header to end of document', async () => { const folds = await getFoldsForDocument(`a # b c -d`); - assert.strictEqual(folds.length, 1); - const firstFold = folds[0]; - assert.strictEqual(firstFold.start, 1); - assert.strictEqual(firstFold.end, 3); - }); +d`) + assert.strictEqual(folds.length, 1) + const firstFold = folds[0] + assert.strictEqual(firstFold.start, 1) + assert.strictEqual(firstFold.end, 3) + }) test('Should leave single newline before next header', async () => { const folds = await getFoldsForDocument(` @@ -43,12 +43,12 @@ d`); x # b -y`); - assert.strictEqual(folds.length, 2); - const firstFold = folds[0]; - assert.strictEqual(firstFold.start, 1); - assert.strictEqual(firstFold.end, 3); - }); +y`) + assert.strictEqual(folds.length, 2) + const firstFold = folds[0] + assert.strictEqual(firstFold.start, 1) + assert.strictEqual(firstFold.end, 3) + }) test('Should collapse multuple newlines to single newline before next header', async () => { const folds = await getFoldsForDocument(` @@ -58,24 +58,24 @@ x # b -y`); - assert.strictEqual(folds.length, 2); - const firstFold = folds[0]; - assert.strictEqual(firstFold.start, 1); - assert.strictEqual(firstFold.end, 5); - }); +y`) + assert.strictEqual(folds.length, 2) + const firstFold = folds[0] + assert.strictEqual(firstFold.start, 1) + assert.strictEqual(firstFold.end, 5) + }) test('Should not collapse if there is no newline before next header', async () => { const folds = await getFoldsForDocument(` # a x # b -y`); - assert.strictEqual(folds.length, 2); - const firstFold = folds[0]; - assert.strictEqual(firstFold.start, 1); - assert.strictEqual(firstFold.end, 2); - }); +y`) + assert.strictEqual(folds.length, 2) + const firstFold = folds[0] + assert.strictEqual(firstFold.start, 1) + assert.strictEqual(firstFold.end, 2) + }) test('Should fold nested markers', async () => { const folds = await getFoldsForDocument(`a @@ -90,60 +90,60 @@ b.b b -a`); - assert.strictEqual(folds.length, 3); - const [outer, first, second] = folds.sort((a, b) => a.start - b.start); - - assert.strictEqual(outer.start, 1); - assert.strictEqual(outer.end, 11); - assert.strictEqual(first.start, 3); - assert.strictEqual(first.end, 5); - assert.strictEqual(second.start, 7); - assert.strictEqual(second.end, 9); - }); +a`) + assert.strictEqual(folds.length, 3) + const [outer, first, second] = folds.sort((a, b) => a.start - b.start) + + assert.strictEqual(outer.start, 1) + assert.strictEqual(outer.end, 11) + assert.strictEqual(first.start, 3) + assert.strictEqual(first.end, 5) + assert.strictEqual(second.start, 7) + assert.strictEqual(second.end, 9) + }) test('Should fold from list to end of document', async () => { const folds = await getFoldsForDocument(`a - b c -d`); - assert.strictEqual(folds.length, 1); - const firstFold = folds[0]; - assert.strictEqual(firstFold.start, 1); - assert.strictEqual(firstFold.end, 3); - }); +d`) + assert.strictEqual(folds.length, 1) + const firstFold = folds[0] + assert.strictEqual(firstFold.start, 1) + assert.strictEqual(firstFold.end, 3) + }) test('lists folds should span multiple lines of content', async () => { const folds = await getFoldsForDocument(`a -- This list item\n spans multiple\n lines.`); - assert.strictEqual(folds.length, 1); - const firstFold = folds[0]; - assert.strictEqual(firstFold.start, 1); - assert.strictEqual(firstFold.end, 3); - }); +- This list item\n spans multiple\n lines.`) + assert.strictEqual(folds.length, 1) + const firstFold = folds[0] + assert.strictEqual(firstFold.start, 1) + assert.strictEqual(firstFold.end, 3) + }) test('List should leave single blankline before new element', async () => { const folds = await getFoldsForDocument(`- a a -b`); - assert.strictEqual(folds.length, 1); - const firstFold = folds[0]; - assert.strictEqual(firstFold.start, 0); - assert.strictEqual(firstFold.end, 3); - }); +b`) + assert.strictEqual(folds.length, 1) + const firstFold = folds[0] + assert.strictEqual(firstFold.start, 0) + assert.strictEqual(firstFold.end, 3) + }) test('Should fold fenced code blocks', async () => { const folds = await getFoldsForDocument(`~~~ts a ~~~ -b`); - assert.strictEqual(folds.length, 1); - const firstFold = folds[0]; - assert.strictEqual(firstFold.start, 0); - assert.strictEqual(firstFold.end, 2); - }); +b`) + assert.strictEqual(folds.length, 1) + const firstFold = folds[0] + assert.strictEqual(firstFold.start, 0) + assert.strictEqual(firstFold.end, 2) + }) test('Should fold fenced code blocks with yaml front matter', async () => { const folds = await getFoldsForDocument(`--- @@ -157,28 +157,27 @@ a a a b -a`); - assert.strictEqual(folds.length, 1); - const firstFold = folds[0]; - assert.strictEqual(firstFold.start, 4); - assert.strictEqual(firstFold.end, 6); - }); +a`) + assert.strictEqual(folds.length, 1) + const firstFold = folds[0] + assert.strictEqual(firstFold.start, 4) + assert.strictEqual(firstFold.end, 6) + }) test('Should fold html blocks', async () => { const folds = await getFoldsForDocument(`x
- fa -
`); - assert.strictEqual(folds.length, 1); - const firstFold = folds[0]; - assert.strictEqual(firstFold.start, 1); - assert.strictEqual(firstFold.end, 3); - }); -}); - - -async function getFoldsForDocument(contents: string) { - const doc = new InMemoryDocument(testFileName, contents); - const provider = new AsciidocFoldingProvider(createNewAsciidocEngine()); - return await provider.provideFoldingRanges(doc, {}, new vscode.CancellationTokenSource().token); + fa +
`) + assert.strictEqual(folds.length, 1) + const firstFold = folds[0] + assert.strictEqual(firstFold.start, 1) + assert.strictEqual(firstFold.end, 3) + }) +}) + +async function getFoldsForDocument (contents: string) { + const doc = new InMemoryDocument(testFileName, contents) + const provider = new AsciidocFoldingProvider(createNewAsciidocEngine()) + return await provider.provideFoldingRanges(doc, {}, new vscode.CancellationTokenSource().token) } diff --git a/src/test/inMemoryDocument.ts b/src/test/inMemoryDocument.ts index cc40650c..0349584c 100644 --- a/src/test/inMemoryDocument.ts +++ b/src/test/inMemoryDocument.ts @@ -2,67 +2,73 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; +import * as vscode from 'vscode' export class InMemoryDocument implements vscode.TextDocument { - private readonly _lines: string[]; + private readonly _lines: string[]; - constructor( - public readonly uri: vscode.Uri, - private readonly _contents: string - ) { - this._lines = this._contents.split(/\n/g); - } + constructor ( + public readonly uri: vscode.Uri, + private readonly _contents: string + ) { + this._lines = this._contents.split(/\n/g) + } + isUntitled: boolean = false; + languageId: string = ''; + version: number = 1; + isDirty: boolean = false; + isClosed: boolean = false; + eol: vscode.EndOfLine = vscode.EndOfLine.LF; - isUntitled: boolean = false; - languageId: string = ''; - version: number = 1; - isDirty: boolean = false; - isClosed: boolean = false; - eol: vscode.EndOfLine = vscode.EndOfLine.LF; + get fileName (): string { + return this.uri.fsPath + } - get fileName(): string { - return this.uri.fsPath; - } + get lineCount (): number { + return this._lines.length + } - get lineCount(): number { - return this._lines.length; - } + lineAt (line: any): vscode.TextLine { + return { + lineNumber: line, + text: this._lines[line], + range: new vscode.Range(0, 0, 0, 0), + firstNonWhitespaceCharacterIndex: 0, + rangeIncludingLineBreak: new vscode.Range(0, 0, 0, 0), + isEmptyOrWhitespace: false, + } + } - lineAt(line: any): vscode.TextLine { - return { - lineNumber: line, - text: this._lines[line], - range: new vscode.Range(0, 0, 0, 0), - firstNonWhitespaceCharacterIndex: 0, - rangeIncludingLineBreak: new vscode.Range(0, 0, 0, 0), - isEmptyOrWhitespace: false, - }; - } - offsetAt(_position: vscode.Position): never { - throw new Error('Method not implemented.'); - } - positionAt(offset: number): vscode.Position { - const before = this._contents.slice(0, offset); - const newLines = before.match(/\n/g); - const line = newLines ? newLines.length : 0; - const preCharacters = before.match(/(\n|^).*$/g); - return new vscode.Position(line, preCharacters ? preCharacters[0].length : 0); - } - getText(_range?: vscode.Range | undefined): string { - return this._contents; - } - getWordRangeAtPosition(_position: vscode.Position, _regex?: RegExp | undefined): never { - throw new Error('Method not implemented.'); - } - validateRange(_range: vscode.Range): never { - throw new Error('Method not implemented.'); - } - validatePosition(_position: vscode.Position): never { - throw new Error('Method not implemented.'); - } - save(): never { - throw new Error('Method not implemented.'); - } -} \ No newline at end of file + offsetAt (_position: vscode.Position): never { + throw new Error('Method not implemented.') + } + + positionAt (offset: number): vscode.Position { + const before = this._contents.slice(0, offset) + const newLines = before.match(/\n/g) + const line = newLines ? newLines.length : 0 + const preCharacters = before.match(/(\n|^).*$/g) + return new vscode.Position(line, preCharacters ? preCharacters[0].length : 0) + } + + getText (_range?: vscode.Range | undefined): string { + return this._contents + } + + getWordRangeAtPosition (_position: vscode.Position, _regex?: RegExp | undefined): never { + throw new Error('Method not implemented.') + } + + validateRange (_range: vscode.Range): never { + throw new Error('Method not implemented.') + } + + validatePosition (_position: vscode.Position): never { + throw new Error('Method not implemented.') + } + + save (): never { + throw new Error('Method not implemented.') + } +} diff --git a/src/test/index.ts b/src/test/index.ts index 0d7c4730..e7e8bd2f 100644 --- a/src/test/index.ts +++ b/src/test/index.ts @@ -2,28 +2,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -const path = require('path'); -const testRunner = require('vscode/lib/testrunner'); +const path = require('path') +const testRunner = require('vscode/lib/testrunner') -const suite = 'Integration Asciidoc Tests'; +const suite = 'Integration Asciidoc Tests' const options: any = { ui: 'tdd', useColors: true, timeout: 60000, -}; +} if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) { - options.reporter = 'mocha-multi-reporters'; + options.reporter = 'mocha-multi-reporters' options.reporterOptions = { reporterEnabled: 'spec, mocha-junit-reporter', mochaJunitReporterReporterOptions: { testsuitesTitle: `${suite} ${process.platform}`, mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`), }, - }; + } } -testRunner.configure(options); +testRunner.configure(options) export = testRunner; diff --git a/src/test/runTest.ts b/src/test/runTest.ts index a3e10548..1bc0c958 100644 --- a/src/test/runTest.ts +++ b/src/test/runTest.ts @@ -1,23 +1,23 @@ -import * as path from 'path'; +import * as path from 'path' -import { runTests } from 'vscode-test'; +import { runTests } from 'vscode-test' -async function main() { - try { - // The folder containing the Extension Manifest package.json - // Passed to `--extensionDevelopmentPath` - const extensionDevelopmentPath = path.resolve(__dirname, '../../'); +async function main () { + try { + // The folder containing the Extension Manifest package.json + // Passed to `--extensionDevelopmentPath` + const extensionDevelopmentPath = path.resolve(__dirname, '../../') - // The path to the extension test script - // Passed to --extensionTestsPath - const extensionTestsPath = path.resolve(__dirname, './suite/index'); + // The path to the extension test script + // Passed to --extensionTestsPath + const extensionTestsPath = path.resolve(__dirname, './suite/index') - // Download VS Code, unzip it and run the integration test - await runTests({ extensionDevelopmentPath, extensionTestsPath }); - } catch (err) { - console.error('Failed to run tests'); - process.exit(1); - } + // Download VS Code, unzip it and run the integration test + await runTests({ extensionDevelopmentPath, extensionTestsPath }) + } catch (err) { + console.error('Failed to run tests') + process.exit(1) + } } -main(); +main() diff --git a/src/test/suite/index.ts b/src/test/suite/index.ts index 5ca2e56e..852e541f 100644 --- a/src/test/suite/index.ts +++ b/src/test/suite/index.ts @@ -3,36 +3,36 @@ import * as Mocha from 'mocha'; import * as glob from 'glob'; export function run(): Promise { - // Create the mocha test - const mocha = new Mocha({ - ui: 'tdd' - }); - mocha.useColors(true); + // Create the mocha test + const mocha = new Mocha({ + ui: 'tdd' + }); + mocha.useColors(true); - const testsRoot = path.resolve(__dirname, '..'); + const testsRoot = path.resolve(__dirname, '..'); - return new Promise((c, e) => { - glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { - if (err) { - return e(err); - } + return new Promise((c, e) => { + glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { + if (err) { + return e(err); + } - // Add files to the test suite - files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); + // Add files to the test suite + files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); - try { - // Run the mocha test - mocha.run(failures => { - if (failures > 0) { - e(new Error(`${failures} tests failed.`)); - } else { - c(); - } - }); - } catch (err) { - console.error(err); - e(err); - } - }); - }); + try { + // Run the mocha test + mocha.run(failures => { + if (failures > 0) { + e(new Error(`${failures} tests failed.`)); + } else { + c(); + } + }); + } catch (err) { + console.error(err); + e(err); + } + }); + }); } diff --git a/src/test/tableOfContentsProvider.test.ts b/src/test/tableOfContentsProvider.test.ts index c9588260..6d0f8199 100644 --- a/src/test/tableOfContentsProvider.test.ts +++ b/src/test/tableOfContentsProvider.test.ts @@ -2,91 +2,91 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as assert from 'assert'; -import * as vscode from 'vscode'; -import 'mocha'; +import * as assert from 'assert' +import * as vscode from 'vscode' +import 'mocha' -import { TableOfContentsProvider } from '../tableOfContentsProvider'; -import { InMemoryDocument } from './inMemoryDocument'; -import { createNewAsciidocEngine } from './engine'; +import { TableOfContentsProvider } from '../tableOfContentsProvider' +import { InMemoryDocument } from './inMemoryDocument' +import { createNewAsciidocEngine } from './engine' -const testFileName = vscode.Uri.file('test.md'); +const testFileName = vscode.Uri.file('test.md') suite('asciidoc.TableOfContentsProvider', () => { test('Lookup should not return anything for empty document', async () => { - const doc = new InMemoryDocument(testFileName, ''); - const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc); + const doc = new InMemoryDocument(testFileName, '') + const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc) - assert.strictEqual(await provider.lookup(''), undefined); - assert.strictEqual(await provider.lookup('foo'), undefined); - }); + assert.strictEqual(await provider.lookup(''), undefined) + assert.strictEqual(await provider.lookup('foo'), undefined) + }) test('Lookup should not return anything for document with no headers', async () => { - const doc = new InMemoryDocument(testFileName, 'a *b*\nc'); - const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc); + const doc = new InMemoryDocument(testFileName, 'a *b*\nc') + const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc) - assert.strictEqual(await provider.lookup(''), undefined); - assert.strictEqual(await provider.lookup('foo'), undefined); - assert.strictEqual(await provider.lookup('a'), undefined); - assert.strictEqual(await provider.lookup('b'), undefined); - }); + assert.strictEqual(await provider.lookup(''), undefined) + assert.strictEqual(await provider.lookup('foo'), undefined) + assert.strictEqual(await provider.lookup('a'), undefined) + assert.strictEqual(await provider.lookup('b'), undefined) + }) test('Lookup should return basic #header', async () => { - const doc = new InMemoryDocument(testFileName, `# a\nx\n# c`); - const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc); + const doc = new InMemoryDocument(testFileName, '# a\nx\n# c') + const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc) { - const entry = await provider.lookup('a'); - assert.ok(entry); - assert.strictEqual(entry!.line, 0); + const entry = await provider.lookup('a') + assert.ok(entry) + assert.strictEqual(entry!.line, 0) } { - assert.strictEqual(await provider.lookup('x'), undefined); + assert.strictEqual(await provider.lookup('x'), undefined) } { - const entry = await provider.lookup('c'); - assert.ok(entry); - assert.strictEqual(entry!.line, 2); + const entry = await provider.lookup('c') + assert.ok(entry) + assert.strictEqual(entry!.line, 2) } - }); + }) test('Lookups should be case in-sensitive', async () => { - const doc = new InMemoryDocument(testFileName, `# fOo\n`); - const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc); + const doc = new InMemoryDocument(testFileName, '# fOo\n') + const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc) - assert.strictEqual((await provider.lookup('fOo'))!.line, 0); - assert.strictEqual((await provider.lookup('foo'))!.line, 0); - assert.strictEqual((await provider.lookup('FOO'))!.line, 0); - }); + assert.strictEqual((await provider.lookup('fOo'))!.line, 0) + assert.strictEqual((await provider.lookup('foo'))!.line, 0) + assert.strictEqual((await provider.lookup('FOO'))!.line, 0) + }) test('Lookups should ignore leading and trailing white-space, and collapse internal whitespace', async () => { - const doc = new InMemoryDocument(testFileName, `# f o o \n`); - const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc); + const doc = new InMemoryDocument(testFileName, '# f o o \n') + const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc) - assert.strictEqual((await provider.lookup('f o o'))!.line, 0); - assert.strictEqual((await provider.lookup(' f o o'))!.line, 0); - assert.strictEqual((await provider.lookup(' f o o '))!.line, 0); - assert.strictEqual((await provider.lookup('f o o'))!.line, 0); - assert.strictEqual((await provider.lookup('f o o'))!.line, 0); + assert.strictEqual((await provider.lookup('f o o'))!.line, 0) + assert.strictEqual((await provider.lookup(' f o o'))!.line, 0) + assert.strictEqual((await provider.lookup(' f o o '))!.line, 0) + assert.strictEqual((await provider.lookup('f o o'))!.line, 0) + assert.strictEqual((await provider.lookup('f o o'))!.line, 0) - assert.strictEqual(await provider.lookup('f'), undefined); - assert.strictEqual(await provider.lookup('foo'), undefined); - assert.strictEqual(await provider.lookup('fo o'), undefined); - }); + assert.strictEqual(await provider.lookup('f'), undefined) + assert.strictEqual(await provider.lookup('foo'), undefined) + assert.strictEqual(await provider.lookup('fo o'), undefined) + }) test('should handle special characters #44779', async () => { - const doc = new InMemoryDocument(testFileName, `# Indentação\n`); - const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc); + const doc = new InMemoryDocument(testFileName, '# Indentação\n') + const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc) - assert.strictEqual((await provider.lookup('indentação'))!.line, 0); - }); + assert.strictEqual((await provider.lookup('indentação'))!.line, 0) + }) test('should handle special characters 2, #48482', async () => { - const doc = new InMemoryDocument(testFileName, `# Инструкция - Делай Раз, Делай Два\n`); - const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc); + const doc = new InMemoryDocument(testFileName, '# Инструкция - Делай Раз, Делай Два\n') + const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc) - assert.strictEqual((await provider.lookup('инструкция---делай-раз-делай-два'))!.line, 0); - }); + assert.strictEqual((await provider.lookup('инструкция---делай-раз-делай-два'))!.line, 0) + }) test('should handle special characters 3, #37079', async () => { const doc = new InMemoryDocument(testFileName, `## Header 2 @@ -94,15 +94,15 @@ suite('asciidoc.TableOfContentsProvider', () => { ## Заголовок 2 ### Заголовок 3 ### Заголовок Header 3 -## Заголовок`); - - const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc); - - assert.strictEqual((await provider.lookup('header-2'))!.line, 0); - assert.strictEqual((await provider.lookup('header-3'))!.line, 1); - assert.strictEqual((await provider.lookup('Заголовок-2'))!.line, 2); - assert.strictEqual((await provider.lookup('Заголовок-3'))!.line, 3); - assert.strictEqual((await provider.lookup('Заголовок-header-3'))!.line, 4); - assert.strictEqual((await provider.lookup('Заголовок'))!.line, 5); - }); -}); +## Заголовок`) + + const provider = new TableOfContentsProvider(createNewAsciidocEngine(), doc) + + assert.strictEqual((await provider.lookup('header-2'))!.line, 0) + assert.strictEqual((await provider.lookup('header-3'))!.line, 1) + assert.strictEqual((await provider.lookup('Заголовок-2'))!.line, 2) + assert.strictEqual((await provider.lookup('Заголовок-3'))!.line, 3) + assert.strictEqual((await provider.lookup('Заголовок-header-3'))!.line, 4) + assert.strictEqual((await provider.lookup('Заголовок'))!.line, 5) + }) +}) diff --git a/src/test/workspaceSymbolProvider.test.ts b/src/test/workspaceSymbolProvider.test.ts index 8a3869be..32ae142e 100644 --- a/src/test/workspaceSymbolProvider.test.ts +++ b/src/test/workspaceSymbolProvider.test.ts @@ -2,140 +2,138 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as assert from 'assert'; -import 'mocha'; -import * as vscode from 'vscode'; -import AdocDocumentSymbolProvider from '../features/documentSymbolProvider'; -import AsciidocWorkspaceSymbolProvider, { WorkspaceAsciidocDocumentProvider } from '../features/workspaceSymbolProvider'; -import { createNewAsciidocEngine } from './engine'; -import { InMemoryDocument } from './inMemoryDocument'; +import * as assert from 'assert' +import 'mocha' +import * as vscode from 'vscode' +import AdocDocumentSymbolProvider from '../features/documentSymbolProvider' +import AsciidocWorkspaceSymbolProvider, { WorkspaceAsciidocDocumentProvider } from '../features/workspaceSymbolProvider' +import { createNewAsciidocEngine } from './engine' +import { InMemoryDocument } from './inMemoryDocument' - -const symbolProvider = new AdocDocumentSymbolProvider(createNewAsciidocEngine(), null, null, null, null); +const symbolProvider = new AdocDocumentSymbolProvider(createNewAsciidocEngine(), null) suite('asciidoc.WorkspaceSymbolProvider', () => { test('Should not return anything for empty workspace', async () => { - const provider = new AsciidocWorkspaceSymbolProvider(symbolProvider, new InMemoryWorkspaceAsciidocDocumentProvider([])); + const provider = new AsciidocWorkspaceSymbolProvider(symbolProvider, new InMemoryWorkspaceAsciidocDocumentProvider([])) - assert.deepEqual(await provider.provideWorkspaceSymbols(''), []); - }); + assert.deepEqual(await provider.provideWorkspaceSymbols(''), []) + }) test('Should return symbols from workspace with one asciidoc file', async () => { - const testFileName = vscode.Uri.file('test.md'); + const testFileName = vscode.Uri.file('test.md') const provider = new AsciidocWorkspaceSymbolProvider(symbolProvider, new InMemoryWorkspaceAsciidocDocumentProvider([ - new InMemoryDocument(testFileName, `# header1\nabc\n## header2`), - ])); + new InMemoryDocument(testFileName, '# header1\nabc\n## header2'), + ])) - const symbols = await provider.provideWorkspaceSymbols(''); - assert.strictEqual(symbols.length, 2); - assert.strictEqual(symbols[0].name, '# header1'); - assert.strictEqual(symbols[1].name, '## header2'); - }); + const symbols = await provider.provideWorkspaceSymbols('') + assert.strictEqual(symbols.length, 2) + assert.strictEqual(symbols[0].name, '# header1') + assert.strictEqual(symbols[1].name, '## header2') + }) test('Should return all content basic workspace', async () => { - const fileNameCount = 10; - const files: vscode.TextDocument[] = []; + const fileNameCount = 10 + const files: vscode.TextDocument[] = [] for (let i = 0; i < fileNameCount; ++i) { - const testFileName = vscode.Uri.parse(`test${i}.md`); - files.push(new InMemoryDocument(testFileName, `# common\nabc\n## header${i}`)); + const testFileName = vscode.Uri.parse(`test${i}.md`) + files.push(new InMemoryDocument(testFileName, `# common\nabc\n## header${i}`)) } - const provider = new AsciidocWorkspaceSymbolProvider(symbolProvider, new InMemoryWorkspaceAsciidocDocumentProvider(files)); + const provider = new AsciidocWorkspaceSymbolProvider(symbolProvider, new InMemoryWorkspaceAsciidocDocumentProvider(files)) - const symbols = await provider.provideWorkspaceSymbols(''); - assert.strictEqual(symbols.length, fileNameCount * 2); - }); + const symbols = await provider.provideWorkspaceSymbols('') + assert.strictEqual(symbols.length, fileNameCount * 2) + }) test('Should update results when asciidoc file changes symbols', async () => { - const testFileName = vscode.Uri.file('test.md'); + const testFileName = vscode.Uri.file('test.md') const workspaceFileProvider = new InMemoryWorkspaceAsciidocDocumentProvider([ - new InMemoryDocument(testFileName, `# header1`), - ]); + new InMemoryDocument(testFileName, '# header1'), + ]) - const provider = new AsciidocWorkspaceSymbolProvider(symbolProvider, workspaceFileProvider); + const provider = new AsciidocWorkspaceSymbolProvider(symbolProvider, workspaceFileProvider) - assert.strictEqual((await provider.provideWorkspaceSymbols('')).length, 1); + assert.strictEqual((await provider.provideWorkspaceSymbols('')).length, 1) // Update file - workspaceFileProvider.updateDocument(new InMemoryDocument(testFileName, `# new header\nabc\n## header2`)); - const newSymbols = await provider.provideWorkspaceSymbols(''); - assert.strictEqual(newSymbols.length, 2); - assert.strictEqual(newSymbols[0].name, '# new header'); - assert.strictEqual(newSymbols[1].name, '## header2'); - }); + workspaceFileProvider.updateDocument(new InMemoryDocument(testFileName, '# new header\nabc\n## header2')) + const newSymbols = await provider.provideWorkspaceSymbols('') + assert.strictEqual(newSymbols.length, 2) + assert.strictEqual(newSymbols[0].name, '# new header') + assert.strictEqual(newSymbols[1].name, '## header2') + }) test('Should remove results when file is deleted', async () => { - const testFileName = vscode.Uri.file('test.md'); + const testFileName = vscode.Uri.file('test.md') const workspaceFileProvider = new InMemoryWorkspaceAsciidocDocumentProvider([ - new InMemoryDocument(testFileName, `# header1`), - ]); + new InMemoryDocument(testFileName, '# header1'), + ]) - const provider = new AsciidocWorkspaceSymbolProvider(symbolProvider, workspaceFileProvider); - assert.strictEqual((await provider.provideWorkspaceSymbols('')).length, 1); + const provider = new AsciidocWorkspaceSymbolProvider(symbolProvider, workspaceFileProvider) + assert.strictEqual((await provider.provideWorkspaceSymbols('')).length, 1) // delete file - workspaceFileProvider.deleteDocument(testFileName); - const newSymbols = await provider.provideWorkspaceSymbols(''); - assert.strictEqual(newSymbols.length, 0); - }); + workspaceFileProvider.deleteDocument(testFileName) + const newSymbols = await provider.provideWorkspaceSymbols('') + assert.strictEqual(newSymbols.length, 0) + }) test('Should update results when asciidoc file is created', async () => { - const testFileName = vscode.Uri.file('test.md'); + const testFileName = vscode.Uri.file('test.md') const workspaceFileProvider = new InMemoryWorkspaceAsciidocDocumentProvider([ - new InMemoryDocument(testFileName, `# header1`), - ]); + new InMemoryDocument(testFileName, '# header1'), + ]) - const provider = new AsciidocWorkspaceSymbolProvider(symbolProvider, workspaceFileProvider); - assert.strictEqual((await provider.provideWorkspaceSymbols('')).length, 1); + const provider = new AsciidocWorkspaceSymbolProvider(symbolProvider, workspaceFileProvider) + assert.strictEqual((await provider.provideWorkspaceSymbols('')).length, 1) // Creat file - workspaceFileProvider.createDocument(new InMemoryDocument(vscode.Uri.file('test2.md'), `# new header\nabc\n## header2`)); - const newSymbols = await provider.provideWorkspaceSymbols(''); - assert.strictEqual(newSymbols.length, 3); - }); -}); - + workspaceFileProvider.createDocument(new InMemoryDocument(vscode.Uri.file('test2.md'), '# new header\nabc\n## header2')) + const newSymbols = await provider.provideWorkspaceSymbols('') + assert.strictEqual(newSymbols.length, 3) + }) +}) class InMemoryWorkspaceAsciidocDocumentProvider implements WorkspaceAsciidocDocumentProvider { - private readonly _documents = new Map(); + private readonly _documents = new Map(); - constructor(documents: vscode.TextDocument[]) { - for (const doc of documents) { - this._documents.set(doc.fileName, doc); - } - } + constructor (documents: vscode.TextDocument[]) { + for (const doc of documents) { + this._documents.set(doc.fileName, doc) + } + } - async getAllAsciidocDocuments() { - return Array.from(this._documents.values()); - } + async getAllAsciidocDocuments () { + return Array.from(this._documents.values()) + } - private readonly _onDidChangeAsciidocDocumentEmitter = new vscode.EventEmitter(); - public onDidChangeAsciidocDocument = this._onDidChangeAsciidocDocumentEmitter.event; + private readonly _onDidChangeAsciidocDocumentEmitter = new vscode.EventEmitter(); + public onDidChangeAsciidocDocument = this._onDidChangeAsciidocDocumentEmitter.event; - private readonly _onDidCreateAsciidocDocumentEmitter = new vscode.EventEmitter(); - public onDidCreateAsciidocDocument = this._onDidCreateAsciidocDocumentEmitter.event; + private readonly _onDidCreateAsciidocDocumentEmitter = new vscode.EventEmitter(); + public onDidCreateAsciidocDocument = this._onDidCreateAsciidocDocumentEmitter.event; - private readonly _onDidDeleteAsciidocDocumentEmitter = new vscode.EventEmitter(); - public onDidDeleteAsciidocDocument = this._onDidDeleteAsciidocDocumentEmitter.event; + private readonly _onDidDeleteAsciidocDocumentEmitter = new vscode.EventEmitter(); + public onDidDeleteAsciidocDocument = this._onDidDeleteAsciidocDocumentEmitter.event; - public updateDocument(document: vscode.TextDocument) { - this._documents.set(document.fileName, document); - this._onDidChangeAsciidocDocumentEmitter.fire(document); - } + public updateDocument (document: vscode.TextDocument) { + this._documents.set(document.fileName, document) + this._onDidChangeAsciidocDocumentEmitter.fire(document) + } - public createDocument(document: vscode.TextDocument) { - assert.ok(!this._documents.has(document.uri.fsPath)); + public createDocument (document: vscode.TextDocument) { + assert.ok(!this._documents.has(document.uri.fsPath)) - this._documents.set(document.uri.fsPath, document); - this._onDidCreateAsciidocDocumentEmitter.fire(document); - } + this._documents.set(document.uri.fsPath, document) + this._onDidCreateAsciidocDocumentEmitter.fire(document) + } - public deleteDocument(resource: vscode.Uri) { - this._documents.delete(resource.fsPath); - this._onDidDeleteAsciidocDocumentEmitter.fire(resource); - } + public deleteDocument (resource: vscode.Uri) { + this._documents.delete(resource.fsPath) + this._onDidDeleteAsciidocDocumentEmitter.fire(resource) + } } diff --git a/src/text-parser.ts b/src/text-parser.ts index 0af353f5..03c05b69 100644 --- a/src/text-parser.ts +++ b/src/text-parser.ts @@ -1,9 +1,6 @@ -import * as vscode from 'vscode'; -import * as path from "path"; -import { spawn } from "child_process"; -import { isNullOrUndefined } from 'util'; - -const fileUrl = require('file-url'); +import * as vscode from 'vscode' +import * as path from 'path' +import { spawn } from 'child_process' const asciidoctor = require('@asciidoctor/core')() const docbook = require('@asciidoctor/docbook-converter') @@ -11,312 +8,297 @@ const kroki = require('asciidoctor-kroki') const highlightjsAdapter = require('./highlightjs-adapter') highlightjsAdapter.register(asciidoctor) -const use_kroki = vscode.workspace.getConfiguration('asciidoc', null).get('use_kroki'); -if (use_kroki) { - kroki.register(asciidoctor.Extensions); +const useKroki = vscode.workspace.getConfiguration('asciidoc', null).get('use_kroki') +if (useKroki) { + kroki.register(asciidoctor.Extensions) } export class AsciidocParser { - public html: string = ''; - public document = null; - private ext_path = vscode.extensions.getExtension('asciidoctor.asciidoctor-vscode').extensionPath; - private stylesdir = path.join(this.ext_path, 'media') - - constructor(private readonly filename: string, private errorCollection: vscode.DiagnosticCollection = null) { + public html: string = '' + public document = null + private extPath = vscode.extensions.getExtension('asciidoctor.asciidoctor-vscode').extensionPath + private stylesdir = path.join(this.extPath, 'media') + + constructor (private readonly filename: string, private errorCollection: vscode.DiagnosticCollection = null) { + this.filename = filename + this.errorCollection = errorCollection } - public getAttribute(name: string) { - return isNullOrUndefined(this.document) ? null : this.document.getAttribute(name); + public getAttribute (name: string) { + return (this.document == null) ? null : this.document.getAttribute(name) } - public async getMediaDir(text) { - const match = text.match(new RegExp("^\\s*:mediadir:")); - return match; + public async getMediaDir (text) { + const match = text.match(/^\\s*:mediadir:/) + return match } - private async convert_using_javascript(text: string, doc: vscode.TextDocument, forHTMLSave: boolean, backend: string) { + private async convertUsingJavascript (text: string, doc: vscode.TextDocument, forHTMLSave: boolean, backend: string) { return new Promise((resolve) => { - const documentPath = path.dirname(path.resolve(doc.fileName)); + const documentPath = path.dirname(path.resolve(doc.fileName)) const workspacePath = vscode.workspace.workspaceFolders - const contains_style = !isNullOrUndefined(text.match(new RegExp("^\\s*:(stylesheet|stylesdir):", "img"))); - const use_editor_stylesheet = vscode.workspace.getConfiguration('asciidoc', null).get('preview.useEditorStyle', false); - const preview_attributes = vscode.workspace.getConfiguration('asciidoc', null).get('preview.attributes', {}); - const preview_style = vscode.workspace.getConfiguration('asciidoc', null).get('preview.style', ""); - const useWorkspaceAsBaseDir = vscode.workspace.getConfiguration('asciidoc', null).get('useWorkspaceRoot'); - const enableErrorDiagnostics = vscode.workspace.getConfiguration('asciidoc', null).get('enableErrorDiagnostics'); - - let base_dir = documentPath; + const containsStyle = !(text.match(/'^\\s*:(stylesheet|stylesdir)/img) == null) + const useEditorStylesheet = vscode.workspace.getConfiguration('asciidoc', null).get('preview.useEditorStyle', false) + const previewAttributes = vscode.workspace.getConfiguration('asciidoc', null).get('preview.attributes', {}) + const previewStyle = vscode.workspace.getConfiguration('asciidoc', null).get('preview.style', '') + const useWorkspaceAsBaseDir = vscode.workspace.getConfiguration('asciidoc', null).get('useWorkspaceRoot') + const enableErrorDiagnostics = vscode.workspace.getConfiguration('asciidoc', null).get('enableErrorDiagnostics') + + let baseDir = documentPath if (useWorkspaceAsBaseDir && typeof vscode.workspace.rootPath !== 'undefined') { - base_dir = vscode.workspace.rootPath; + baseDir = vscode.workspace.rootPath } - if(this.errorCollection) { - this.errorCollection.clear(); + if (this.errorCollection) { + this.errorCollection.clear() } - const memoryLogger = asciidoctor.MemoryLogger.create(); - asciidoctor.LoggerManager.setLogger(memoryLogger); + const memoryLogger = asciidoctor.MemoryLogger.create() + asciidoctor.LoggerManager.setLogger(memoryLogger) - var attributes = {}; + let attributes = {} - if (contains_style) { - attributes = { 'copycss': true } - } else if (preview_style != "") { - var stylesdir: string, stylesheet: string + if (containsStyle) { + attributes = { copycss: true } + } else if (previewStyle !== '') { + let stylesdir: string, stylesheet: string - if (path.isAbsolute(preview_style)) { - stylesdir = path.dirname(preview_style) - stylesheet = path.basename(preview_style) + if (path.isAbsolute(previewStyle)) { + stylesdir = path.dirname(previewStyle) + stylesheet = path.basename(previewStyle) } else { - if (workspacePath == undefined) { + if (workspacePath === undefined) { stylesdir = documentPath - } else if (workspacePath.length > 0) { + } else if (workspacePath.length > 0) { stylesdir = workspacePath[0].uri.path } - stylesdir = path.dirname(path.join(stylesdir, preview_style)) - stylesheet = path.basename(preview_style) + stylesdir = path.dirname(path.join(stylesdir, previewStyle)) + stylesheet = path.basename(previewStyle) } - attributes = { 'copycss': true, 'stylesdir': stylesdir, 'stylesheet': stylesheet } - } else if (use_editor_stylesheet && !forHTMLSave) { - attributes = { 'copycss': true, 'stylesdir': this.stylesdir, 'stylesheet': 'asciidoctor-editor.css' } + attributes = { copycss: true, stylesdir: stylesdir, stylesheet: stylesheet } + } else if (useEditorStylesheet && !forHTMLSave) { + attributes = { copycss: true, stylesdir: this.stylesdir, stylesheet: 'asciidoctor-editor.css' } } else { // TODO: decide whether to use the included css or let ascidoctor.js decide // attributes = { 'copycss': true, 'stylesdir': this.stylesdir, 'stylesheet': 'asciidoctor-default.css@' } } - Object.keys(preview_attributes).forEach((key) => { - if (typeof preview_attributes[key] === "string") { - attributes[key] = preview_attributes[key] - if(workspacePath !== undefined) { - attributes[key] = attributes[key].replace("${workspaceFolder}", workspacePath[0].uri.path); + // TODO: Check -- Not clear that this code is functional + Object.keys(previewAttributes).forEach((key) => { + if (typeof previewAttributes[key] === 'string') { + attributes[key] = previewAttributes[key] + if (workspacePath !== undefined) { + // eslint-disable-next-line no-template-curly-in-string + attributes[key] = attributes[key].replace('${workspaceFolder}', workspacePath[0].uri.path) } } }) attributes['env-vscode'] = '' - if (backend.startsWith('docbook')) - docbook.register() + if (backend.startsWith('docbook')) { docbook.register() } const options = { safe: 'unsafe', attributes: attributes, header_footer: true, to_file: false, - base_dir: base_dir, + baseDir: baseDir, sourcemap: true, backend: backend, } try { - let ascii_doc = asciidoctor.load(text, options); - this.document = ascii_doc; - const blocksWithLineNumber = ascii_doc.findBy(function (b) { return typeof b.getLineNumber() !== 'undefined'; }); + const asciiDoc = asciidoctor.load(text, options) + this.document = asciiDoc + const blocksWithLineNumber = asciiDoc.findBy(function (b) { return typeof b.getLineNumber() !== 'undefined' }) + // eslint-disable-next-line @typescript-eslint/no-unused-vars blocksWithLineNumber.forEach(function (block, key, myArray) { - block.addRole("data-line-" + block.getLineNumber()); + block.addRole('data-line-' + block.getLineNumber()) }) - let resultHTML = ascii_doc.convert(options); + const resultHTML = asciiDoc.convert(options) //let result = this.fixLinks(resultHTML); if (enableErrorDiagnostics) { - let diagnostics = []; + const diagnostics = [] memoryLogger.getMessages().forEach((error) => { //console.log(error); //Error from asciidoctor.js let errorMessage = error.getText() - let sourceLine = 0; - let relatedFile = null; - let relatedLine = 0; - let diagnosticSource = "asciidoctor.js"; + let sourceLine = 0 + let relatedFile = null + const diagnosticSource = 'asciidoctor.js' // allocate to line 0 in the absence of information - let sourceRange = doc.lineAt(0).range; - const location = error.getSourceLocation(); + let sourceRange = doc.lineAt(0).range + const location = error.getSourceLocation() if (location) { //There is a source location - if (location.getPath() == "") { //error is within the file we are parsing - sourceLine = location.getLineNumber() - 1; - sourceRange = doc.lineAt(sourceLine).range; + if (location.getPath() === '') { //error is within the file we are parsing + sourceLine = location.getLineNumber() - 1 + sourceRange = doc.lineAt(sourceLine).range } else { //error is coming from an included file - relatedFile = error.getSourceLocation(); - relatedLine = sourceLine - 1; + relatedFile = error.getSourceLocation() // try to find the include responsible from the info provided by asciidoctor.js - sourceLine = doc.getText().split('\n').indexOf(doc.getText().split('\n').find((str) => str.startsWith("include") && str.includes(error.message.source_location.path))); - if (sourceLine!=-1) { - sourceRange = doc.lineAt(sourceLine).range; + sourceLine = doc.getText().split('\n').indexOf(doc.getText().split('\n').find((str) => str.startsWith('include') && str.includes(error.message.source_location.path))) + if (sourceLine !== -1) { + sourceRange = doc.lineAt(sourceLine).range } } } else { // generic error (e.g. :source-highlighter: coderay) - errorMessage = error.message; + errorMessage = error.message } - let severity = vscode.DiagnosticSeverity.Information; - if (error.severity=="WARN") { + let severity = vscode.DiagnosticSeverity.Information + if (error.severity === 'WARN') { severity = vscode.DiagnosticSeverity.Warning - } else if (error.severity=="ERROR") { + } else if (error.severity === 'ERROR') { severity = vscode.DiagnosticSeverity.Error - } else if (error.severity=="DEBUG") { + } else if (error.severity === 'DEBUG') { severity = vscode.DiagnosticSeverity.Information } - let diagnosticRelated = null; - if(relatedFile) { + let diagnosticRelated = null + if (relatedFile) { diagnosticRelated = [ new vscode.DiagnosticRelatedInformation( new vscode.Location(vscode.Uri.file(relatedFile.file), - new vscode.Position(0,0) + new vscode.Position(0, 0) ), errorMessage ), ] - errorMessage = "There was an error in an included file"; + errorMessage = 'There was an error in an included file' } - var diagnosticError = new vscode.Diagnostic(sourceRange, errorMessage, severity); - diagnosticError.source = diagnosticSource; + const diagnosticError = new vscode.Diagnostic(sourceRange, errorMessage, severity) + diagnosticError.source = diagnosticSource if (diagnosticRelated) { - diagnosticError.relatedInformation = diagnosticRelated; + diagnosticError.relatedInformation = diagnosticRelated } - diagnostics.push(diagnosticError); - }); - if(this.errorCollection) { - this.errorCollection.set(vscode.Uri.parse(doc.fileName), diagnostics); + diagnostics.push(diagnosticError) + }) + if (this.errorCollection) { + this.errorCollection.set(vscode.Uri.parse(doc.fileName), diagnostics) } } - resolve(resultHTML); - } - catch(e) { + resolve(resultHTML) + } catch (e) { vscode.window.showErrorMessage(e.toString()) } }) } - private async convert_using_application(text: string, doc: vscode.TextDocument, forHTMLSave: boolean, backend: string) { - const documentPath = path.dirname(doc.fileName).replace('"', '\\"'); + private async convertUsingApplication (text: string, doc: vscode.TextDocument, forHTMLSave: boolean, backend: string) { + const documentPath = path.dirname(doc.fileName).replace('"', '\\"') const workspacePath = vscode.workspace.workspaceFolders - const contains_style = !isNullOrUndefined(text.match(new RegExp("^\\s*:(stylesheet|stylesdir):", "img"))); - const use_editor_stylesheet = vscode.workspace.getConfiguration('asciidoc', null).get('preview.useEditorStyle', false); - const preview_attributes = vscode.workspace.getConfiguration('asciidoc', null).get('preview.attributes', {}); - const preview_style = vscode.workspace.getConfiguration('asciidoc', null).get('preview.style', ""); - const useWorkspaceAsBaseDir = vscode.workspace.getConfiguration('asciidoc', null).get('useWorkspaceRoot'); - this.document = null; - - let base_dir = documentPath; + const containsStyle = !(text.match(/'^\\s*:(stylesheet|stylesdir):/img) == null) + const useEditorStylesheet = vscode.workspace.getConfiguration('asciidoc', null).get('preview.useEditorStyle', false) + const previewAttributes = vscode.workspace.getConfiguration('asciidoc', null).get('preview.attributes', {}) + const previewStyle = vscode.workspace.getConfiguration('asciidoc', null).get('preview.style', '') + const useWorkspaceAsBaseDir = vscode.workspace.getConfiguration('asciidoc', null).get('useWorkspaceRoot') + this.document = null + + let baseDir = documentPath if (useWorkspaceAsBaseDir && typeof vscode.workspace.rootPath !== 'undefined') { - base_dir = vscode.workspace.rootPath.replace('"', '\\"'); + baseDir = vscode.workspace.rootPath.replace('"', '\\"') } return new Promise((resolve) => { - let asciidoctor_command = vscode.workspace.getConfiguration('asciidoc', null).get('asciidoctor_command', 'asciidoctor'); - var RUBYOPT = process.env['RUBYOPT'] + const asciidoctorCommand = vscode.workspace.getConfiguration('asciidoc', null).get('asciidoctor_command', 'asciidoctor') + let RUBYOPT = process.env.RUBYOPT if (RUBYOPT) { - var prevOpt + let prevOpt RUBYOPT = RUBYOPT.split(' ').reduce((acc, opt) => { - acc.push(prevOpt == '-E' ? (prevOpt = 'UTF-8:UTF-8') : (prevOpt = opt)) + acc.push(prevOpt === '-E' ? (prevOpt = 'UTF-8:UTF-8') : (prevOpt = opt)) return acc }, []).join(' ') } else { RUBYOPT = '-E UTF-8:UTF-8' } - var options = { shell: true, cwd: path.dirname(this.filename), env: { ...process.env, RUBYOPT } } + const options = { shell: true, cwd: path.dirname(this.filename), env: { ...process.env, RUBYOPT } } - var adoc_cmd_array = asciidoctor_command.split(/(\s+)/).filter( function(e) { return e.trim().length > 0; } ) ; - var adoc_cmd = adoc_cmd_array[0] - var adoc_cmd_args = adoc_cmd_array.slice(1) - if (contains_style) { + const adocCmdArray = asciidoctorCommand.split(/(\s+)/).filter(function (e) { return e.trim().length > 0 }) + const adocCmd = adocCmdArray[0] + const adocCmdArgs = adocCmdArray.slice(1) + if (containsStyle) { ; // Used an empty if to make it easier to use elses later - } else if (preview_style != "") { - var stylesdir: string, stylesheet: string + } else if (previewStyle !== '') { + let stylesdir: string, stylesheet: string - if (path.isAbsolute(preview_style)) { - stylesdir = path.dirname(preview_style) - stylesheet = path.basename(preview_style) + if (path.isAbsolute(previewStyle)) { + stylesdir = path.dirname(previewStyle) + stylesheet = path.basename(previewStyle) } else { - if (workspacePath == undefined) { + if (workspacePath === undefined) { stylesdir = documentPath - } else if (workspacePath.length > 0) { + } else if (workspacePath.length > 0) { stylesdir = workspacePath[0].uri.path } - stylesdir = path.dirname(path.join(stylesdir, preview_style)) - stylesheet = path.basename(preview_style) + stylesdir = path.dirname(path.join(stylesdir, previewStyle)) + stylesheet = path.basename(previewStyle) } - adoc_cmd_args.push.apply(adoc_cmd_args, ['-a', `stylesdir=${stylesdir}`]) - adoc_cmd_args.push.apply(adoc_cmd_args, ['-a', `stylesheet=${stylesheet}`]) - } else if (use_editor_stylesheet && !forHTMLSave) { - adoc_cmd_args.push.apply(adoc_cmd_args, ['-a', `stylesdir=${this.stylesdir}@`]) - adoc_cmd_args.push.apply(adoc_cmd_args, ['-a', 'stylesheet=asciidoctor-editor.css@']) + adocCmdArgs.push('-a', `stylesdir=${stylesdir}`) + adocCmdArgs.push('-a', `stylesheet=${stylesheet}`) + } else if (useEditorStylesheet && !forHTMLSave) { + adocCmdArgs.push('-a', `stylesdir=${this.stylesdir}@`) + adocCmdArgs.push('-a', 'stylesheet=asciidoctor-editor.css@') } else { // TODO: decide whether to use the included css or let ascidoctor decide // adoc_cmd_args.push.apply(adoc_cmd_args, ['-a', `stylesdir=${this.stylesdir}@`]) // adoc_cmd_args.push.apply(adoc_cmd_args, ['-a', 'stylesheet=asciidoctor-default.css@']) } - adoc_cmd_args.push.apply(adoc_cmd_args, ['-b', backend]) + adocCmdArgs.push('-b', backend) - Object.keys(preview_attributes).forEach((key) => { - if (typeof preview_attributes[key] === "string") { - var value: string = preview_attributes[key] - if(workspacePath !== undefined) { - value = value.replace("${workspaceFolder}", workspacePath[0].uri.path); + Object.keys(previewAttributes).forEach((key) => { + if (typeof previewAttributes[key] === 'string') { + let value: string = previewAttributes[key] + if (workspacePath !== undefined) { + // eslint-disable-next-line no-template-curly-in-string + value = value.replace('${workspaceFolder}', workspacePath[0].uri.path) } if (value.endsWith('!')) { - adoc_cmd_args.push.apply(adoc_cmd_args, ['-a', `${value}`]) + adocCmdArgs.push('-a', `${value}`) } else { - adoc_cmd_args.push.apply(adoc_cmd_args, ['-a', `${key}=${value}`]) + adocCmdArgs.push('-a', `${key}=${value}`) } } }) - adoc_cmd_args.push.apply(adoc_cmd_args, ['-a', 'env-vscode']) + adocCmdArgs.push('-a', 'env-vscode') - adoc_cmd_args.push.apply(adoc_cmd_args, ['-q', '-B', '"' + base_dir + '"', '-o', '-', '-']) - var asciidoctor = spawn(adoc_cmd, adoc_cmd_args, options); + adocCmdArgs.push('-q', '-B', '"' + baseDir + '"', '-o', '-', '-') + const asciidoctor = spawn(adocCmd, adocCmdArgs, options) asciidoctor.stderr.on('data', (data) => { - let errorMessage = data.toString(); - console.error(errorMessage); - errorMessage += errorMessage.replace("\n", '

'); - errorMessage += "

" - errorMessage += "command: " + adoc_cmd + " " + adoc_cmd_args.join(" ") - errorMessage += "

" - errorMessage += "If the asciidoctor binary is not in your PATH, you can set the full path.
" - errorMessage += "Go to `File -> Preferences -> User settings` and adjust the asciidoc.asciidoctor_command
" - resolve(errorMessage); + let errorMessage = data.toString() + console.error(errorMessage) + errorMessage += errorMessage.replace('\n', '

') + errorMessage += '

' + errorMessage += 'command: ' + adocCmd + ' ' + adocCmdArgs.join(' ') + errorMessage += '

' + errorMessage += 'If the asciidoctor binary is not in your PATH, you can set the full path.
' + errorMessage += 'Go to `File -> Preferences -> User settings` and adjust the asciidoc.asciidoctor_command
' + resolve(errorMessage) }) - var result_data = new Buffer(''); + let resultData = Buffer.from('') /* with large outputs we can receive multiple calls */ asciidoctor.stdout.on('data', (data) => { - result_data = Buffer.concat([result_data, data as Buffer]); - }); - asciidoctor.on('close', (code) => { + resultData = Buffer.concat([resultData, data as Buffer]) + }) + asciidoctor.on('close', (_code) => { //var result = this.fixLinks(result_data.toString()); - resolve(result_data.toString()); + resolve(resultData.toString()) }) - asciidoctor.stdin.write(text); - asciidoctor.stdin.end(); - }); - } - - private fixLinks(html: string): string { - let result = html.replace( - new RegExp("((?:src|href)=[\'\"])(?!(?:http:|https:|ftp:|#))(.*?)([\'\"])", "gmi"), - (subString: string, p1: string, p2: string, p3: string): string => { - return [ - p1, - fileUrl(path.join( - path.dirname(this.filename), - p2 - )), - p3, - ].join(""); - } - ); - return result; + asciidoctor.stdin.write(text) + asciidoctor.stdin.end() + }) } - public async parseText(text: string, doc: vscode.TextDocument, forHTMLSave: boolean = false, backend: string = 'html'): Promise { - const use_asciidoctor_js = vscode.workspace.getConfiguration('asciidoc', null).get('use_asciidoctor_js'); - if (use_asciidoctor_js) - return this.convert_using_javascript(text, doc, forHTMLSave, backend) - else - return this.convert_using_application(text, doc, forHTMLSave, backend) + public async parseText (text: string, doc: vscode.TextDocument, forHTMLSave: boolean = false, backend: string = 'html'): Promise { + const useAsciidoctorJS = vscode.workspace.getConfiguration('asciidoc', null).get('use_asciidoctor_js') + if (useAsciidoctorJS) { + return this.convertUsingJavascript(text, doc, forHTMLSave, backend) + } else { + return this.convertUsingApplication(text, doc, forHTMLSave, backend) + } } - } diff --git a/src/typings/markdown-it-named-headers.d.ts b/src/typings/markdown-it-named-headers.d.ts deleted file mode 100644 index 4eafa369..00000000 --- a/src/typings/markdown-it-named-headers.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -declare module 'asciidoc-it-named-headers' { } diff --git a/src/util/dispose.ts b/src/util/dispose.ts index 85c621c1..12d90170 100644 --- a/src/util/dispose.ts +++ b/src/util/dispose.ts @@ -2,14 +2,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; +import * as vscode from 'vscode' -export function disposeAll(disposables: vscode.Disposable[]) { +export function disposeAll (disposables: vscode.Disposable[]) { while (disposables.length) { - const item = disposables.pop(); + const item = disposables.pop() if (item) { - item.dispose(); + item.dispose() } } } - diff --git a/src/util/file.ts b/src/util/file.ts index d89de2d0..b6379b99 100644 --- a/src/util/file.ts +++ b/src/util/file.ts @@ -2,24 +2,24 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import * as path from "path"; -import { join } from "path"; -import { readdir, statSync } from "fs"; -const { promisify } = require("util"); -const readdirAsync = promisify(readdir); +import * as vscode from 'vscode' +import * as path from 'path' +import { join } from 'path' +import { readdir, statSync } from 'fs' +const { promisify } = require('util') +const readdirAsync = promisify(readdir) -export function isAsciidocFile(document: vscode.TextDocument) { - return document.languageId === 'asciidoc'; +export function isAsciidocFile (document: vscode.TextDocument) { + return document.languageId === 'asciidoc' } export class FileInfo { file: string; isFile: boolean; - constructor(path: string, file: string) { - this.file = file; - this.isFile = statSync(join(path, file)).isFile(); + constructor (path: string, file: string) { + this.file = file + this.isFile = statSync(join(path, file)).isFile() } } @@ -27,38 +27,38 @@ export class FileInfo { * @param fileName {string} current filename the look up is done. Absolute path * @param text {string} text in import string. e.g. './src/' */ -export function getPathOfFolderToLookupFiles( +export function getPathOfFolderToLookupFiles ( fileName: string, text: string | undefined, rootPath?: string ): string { - const normalizedText = path.normalize(text || ""); + const normalizedText = path.normalize(text || '') - const isPathAbsolute = normalizedText.startsWith(path.sep); + const isPathAbsolute = normalizedText.startsWith(path.sep) - let rootFolder = path.dirname(fileName); - let pathEntered = normalizedText; + let rootFolder = path.dirname(fileName) + const pathEntered = normalizedText if (isPathAbsolute) { - rootFolder = rootPath || ""; + rootFolder = rootPath || '' } - return path.join(rootFolder, pathEntered); + return path.join(rootFolder, pathEntered) } -export async function getChildrenOfPath(path: string) { +export async function getChildrenOfPath (path: string) { try { - const files: string[] = await readdirAsync(path); + const files: string[] = await readdirAsync(path) const filesDbg = files - .map((f) => new FileInfo(path, f)); - return filesDbg; + .map((f) => new FileInfo(path, f)) + return filesDbg } catch (error) { - return []; + return [] } } export const sortFilesAndDirectories = (filesAndDirs: FileInfo[]): FileInfo[] => { - const dirs = filesAndDirs.filter((f) => f.isFile !== true); - const files = filesAndDirs.filter((f) => f.isFile === true); + const dirs = filesAndDirs.filter((f) => f.isFile !== true) + const files = filesAndDirs.filter((f) => f.isFile === true) return [...dirs, ...files] -}; \ No newline at end of file +} diff --git a/src/util/includeAutoCompletion.ts b/src/util/includeAutoCompletion.ts index 63949098..5274d4fe 100644 --- a/src/util/includeAutoCompletion.ts +++ b/src/util/includeAutoCompletion.ts @@ -1,54 +1,53 @@ -import * as vscode from "vscode"; -import { AsciidocProvider } from "../providers/asciidoc.provider"; -import { BibtexProvider } from "../providers/bibtex.provider"; -import { xrefProvider } from "../providers/xref.provider"; -import { disposeAll } from "../util/dispose"; +import * as vscode from 'vscode' +import { AsciidocProvider } from '../providers/asciidoc.provider' +import { BibtexProvider } from '../providers/bibtex.provider' +import { xrefProvider } from '../providers/xref.provider' +import { disposeAll } from '../util/dispose' export class AsciidocFileIncludeAutoCompletionMonitor { private readonly disposables: vscode.Disposable[] = []; - constructor() { - vscode.languages.registerReferenceProvider; - + constructor () { const disposable = vscode.languages.registerCompletionItemProvider( { - language: "asciidoc", - scheme: "file", + language: 'asciidoc', + scheme: 'file', }, AsciidocProvider, - ...[":", "/"] - ); + ...[':', '/'] + ) const bibtexDisposable = vscode.languages.registerCompletionItemProvider( { - language: "asciidoc", - scheme: "file", + language: 'asciidoc', + scheme: 'file', }, BibtexProvider, - ...[":", "/"] - ); + ...[':', '/'] + ) const xrefDisposable = vscode.languages.registerCompletionItemProvider( { - language: "asciidoc", - scheme: "file", + language: 'asciidoc', + scheme: 'file', }, xrefProvider, - ...[":", "/"] - ); + ...[':', '/'] + ) - this.disposables.push(disposable); - this.disposables.push(bibtexDisposable); - this.disposables.push(xrefDisposable); + this.disposables.push(disposable) + this.disposables.push(bibtexDisposable) + this.disposables.push(xrefDisposable) } - dispose() { - disposeAll(this.disposables); + dispose () { + disposeAll(this.disposables) } private readonly _onDidIncludeAutoCompletionEmitter = new vscode.EventEmitter<{ resource: vscode.Uri; line: number; }>(); + public readonly onDidIncludeAutoCompletionEmitter = this ._onDidIncludeAutoCompletionEmitter.event; } diff --git a/src/util/lazy.ts b/src/util/lazy.ts index c39aaf0c..ea0178b6 100644 --- a/src/util/lazy.ts +++ b/src/util/lazy.ts @@ -3,36 +3,36 @@ *--------------------------------------------------------------------------------------------*/ export interface Lazy { - readonly value: T; - readonly hasValue: boolean; - map(f: (x: T) => R): Lazy; + readonly value: T; + readonly hasValue: boolean; + map(f: (x: T) => R): Lazy; } class LazyValue implements Lazy { - private _hasValue: boolean = false; - private _value?: T; + private _hasValue: boolean = false; + private _value?: T; - constructor( - private readonly _getValue: () => T - ) { } + constructor (private readonly _getValue: () => T) { + this._getValue = _getValue + } - get value(): T { - if (!this._hasValue) { - this._hasValue = true; - this._value = this._getValue(); - } - return this._value!; - } + get value (): T { + if (!this._hasValue) { + this._hasValue = true + this._value = this._getValue() + } + return this._value! + } - get hasValue(): boolean { - return this._hasValue; - } + get hasValue (): boolean { + return this._hasValue + } - public map(f: (x: T) => R): Lazy { - return new LazyValue(() => f(this.value)); - } + public map (f: (x: T) => R): Lazy { + return new LazyValue(() => f(this.value)) + } } -export function lazy(getValue: () => T): Lazy { - return new LazyValue(getValue); -} \ No newline at end of file +export function lazy (getValue: () => T): Lazy { + return new LazyValue(getValue) +} diff --git a/src/util/links.ts b/src/util/links.ts index 4dd65c20..43e0c454 100644 --- a/src/util/links.ts +++ b/src/util/links.ts @@ -2,16 +2,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; +import * as vscode from 'vscode' -const knownSchemes = ['http:', 'https:', 'file:', 'mailto:']; +const knownSchemes = ['http:', 'https:', 'file:', 'mailto:'] -export function getUriForLinkWithKnownExternalScheme( +export function getUriForLinkWithKnownExternalScheme ( link: string ): vscode.Uri | undefined { if (knownSchemes.some((knownScheme) => link.toLowerCase().startsWith(knownScheme))) { - return vscode.Uri.parse(link); + return vscode.Uri.parse(link) } - return undefined; -} \ No newline at end of file + return undefined +} diff --git a/src/util/topmostLineMonitor.ts b/src/util/topmostLineMonitor.ts index 6e93e4bc..7c69ebac 100644 --- a/src/util/topmostLineMonitor.ts +++ b/src/util/topmostLineMonitor.ts @@ -2,55 +2,55 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { disposeAll } from '../util/dispose'; -import { isAsciidocFile } from './file'; +import * as vscode from 'vscode' +import { disposeAll } from '../util/dispose' +import { isAsciidocFile } from './file' export class AsciidocFileTopmostLineMonitor { - private readonly disposables: vscode.Disposable[] = []; + private readonly disposables: vscode.Disposable[] = []; - private readonly pendingUpdates = new Map(); + private readonly pendingUpdates = new Map(); - private readonly throttle = 50; + private readonly throttle = 50; - constructor() { - vscode.window.onDidChangeTextEditorVisibleRanges((event) => { - if (isAsciidocFile(event.textEditor.document)) { - const line = getVisibleLine(event.textEditor); - if (typeof line === 'number') { - this.updateLine(event.textEditor.document.uri, line); - } - } - }, null, this.disposables); - } + constructor () { + vscode.window.onDidChangeTextEditorVisibleRanges((event) => { + if (isAsciidocFile(event.textEditor.document)) { + const line = getVisibleLine(event.textEditor) + if (typeof line === 'number') { + this.updateLine(event.textEditor.document.uri, line) + } + } + }, null, this.disposables) + } - dispose() { - disposeAll(this.disposables); - } + dispose () { + disposeAll(this.disposables) + } - private readonly _onDidChangeTopmostLineEmitter = new vscode.EventEmitter<{ resource: vscode.Uri, line: number }>(); - public readonly onDidChangeTopmostLine = this._onDidChangeTopmostLineEmitter.event; + private readonly _onDidChangeTopmostLineEmitter = new vscode.EventEmitter<{ resource: vscode.Uri, line: number }>(); + public readonly onDidChangeTopmostLine = this._onDidChangeTopmostLineEmitter.event; - private updateLine( - resource: vscode.Uri, - line: number - ) { - const key = resource.toString(); - if (!this.pendingUpdates.has(key)) { - // schedule update - setTimeout(() => { - if (this.pendingUpdates.has(key)) { - this._onDidChangeTopmostLineEmitter.fire({ - resource, - line: this.pendingUpdates.get(key) as number, - }); - this.pendingUpdates.delete(key); - } - }, this.throttle); - } + private updateLine ( + resource: vscode.Uri, + line: number + ) { + const key = resource.toString() + if (!this.pendingUpdates.has(key)) { + // schedule update + setTimeout(() => { + if (this.pendingUpdates.has(key)) { + this._onDidChangeTopmostLineEmitter.fire({ + resource, + line: this.pendingUpdates.get(key) as number, + }) + this.pendingUpdates.delete(key) + } + }, this.throttle) + } - this.pendingUpdates.set(key, line); - } + this.pendingUpdates.set(key, line) + } } /** @@ -59,16 +59,16 @@ export class AsciidocFileTopmostLineMonitor { * Returns a fractional line number based the visible character within the line. * Floor to get real line number */ -export function getVisibleLine( +export function getVisibleLine ( editor: vscode.TextEditor ): number | undefined { if (!editor.visibleRanges.length) { - return undefined; + return undefined } - const firstVisiblePosition = editor.visibleRanges[0].start; - const lineNumber = firstVisiblePosition.line; - const line = editor.document.lineAt(lineNumber); - const progress = firstVisiblePosition.character / (line.text.length + 2); - return lineNumber + progress; + const firstVisiblePosition = editor.visibleRanges[0].start + const lineNumber = firstVisiblePosition.line + const line = editor.document.lineAt(lineNumber) + const progress = firstVisiblePosition.character / (line.text.length + 2) + return lineNumber + progress } diff --git a/test/extension.test.ts b/test/extension.test.ts index 0524356f..3e731d9b 100644 --- a/test/extension.test.ts +++ b/test/extension.test.ts @@ -1,12 +1,12 @@ -// +// // Note: This example test is leveraging the Mocha test framework. // Please refer to their documentation on https://mochajs.org/ for help. // // The module 'assert' provides assertion methods from node -import * as assert from "assert"; +import * as assert from 'assert' // You can import and use all API from the 'vscode' module // as well as import your extension to test it -import * as vscode from "vscode"; -import * as myExtension from "../src/extension"; +import * as vscode from 'vscode' +import * as myExtension from '../src/extension' diff --git a/test/index.ts b/test/index.ts index b90dc21c..5a922ac7 100644 --- a/test/index.ts +++ b/test/index.ts @@ -1,22 +1,22 @@ -// -// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING +// +// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING // // This file is providing the test runner to use when running extension tests. // By default the test runner in use is Mocha based. -// +// // You can provide your own test runner if you want to override it by exporting // a function run(testRoot: string, clb: (error:Error) => void) that the extension // host can call to run the tests. The test runner is expected to use console.log // to report the results back to the caller. When the tests are finished, return // a possible error to the callback or null if none. -var testRunner = require('vscode/lib/testrunner'); +const testRunner = require('vscode/lib/testrunner') // You can directly control Mocha options by uncommenting the following lines // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info testRunner.configure({ ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) useColors: true, // colored output from test results -}); +}) -module.exports = testRunner; \ No newline at end of file +module.exports = testRunner diff --git a/tsconfig.json b/tsconfig.json index 3228a296..69d6aead 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,13 +5,14 @@ "target": "es6", "outDir": "dist", "lib": [ - "es6", "dom" + "es6", + "dom" ], "sourceMap": true, - "rootDir": ".", + "rootDir": "." }, "exclude": [ "node_modules", - ".vscode-test", + ".vscode-test" ] }