From 5e9227d8df34e0457f48e2d03e617fc782265d13 Mon Sep 17 00:00:00 2001 From: BART! Date: Thu, 11 Nov 2021 17:02:20 +0100 Subject: [PATCH 01/18] chore(ng13): ng13 compatibility --- src/utils/donate.ts | 4 ++-- src/utils/fs-helpers.ts | 2 +- tsconfig.json | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/utils/donate.ts b/src/utils/donate.ts index 720d96f1..22aeb95d 100644 --- a/src/utils/donate.ts +++ b/src/utils/donate.ts @@ -1,6 +1,6 @@ import { yellow } from 'colorette'; -import * as boxen from 'boxen'; -import * as terminalLink from 'terminal-link'; +import boxen from 'boxen'; +import terminalLink from 'terminal-link'; const url = 'https://donate.biesbjerg.com'; const link = terminalLink(url, url); diff --git a/src/utils/fs-helpers.ts b/src/utils/fs-helpers.ts index 8536fe98..22cbf83e 100644 --- a/src/utils/fs-helpers.ts +++ b/src/utils/fs-helpers.ts @@ -1,6 +1,6 @@ import * as os from 'os'; import * as fs from 'fs'; -import * as braces from 'braces'; +import braces from 'braces'; declare module 'braces' { interface Options { diff --git a/tsconfig.json b/tsconfig.json index 18743b08..4b817b03 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,9 @@ "lib": [ "es2019" ], - "module": "commonjs", + "module": "UMD", + "esModuleInterop": true, + "moduleResolution": "node", "outDir": "dist", "sourceMap": true, "typeRoots" : [ From 3fc4ea0cb042076ff13e152fd787f209f17613d9 Mon Sep 17 00:00:00 2001 From: Nick van Raaij Date: Fri, 12 Nov 2021 11:36:46 +0100 Subject: [PATCH 02/18] version update --- package-lock.json | 3090 ++++++++++++++++++++++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 3079 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 219ab10a..eb82f8cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,3075 @@ { "name": "@biesbjerg/ngx-translate-extract", - "version": "7.0.3", - "lockfileVersion": 1, + "version": "7.0.4", + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "@biesbjerg/ngx-translate-extract", + "version": "7.0.4", + "license": "MIT", + "dependencies": { + "@phenomnomnominal/tsquery": "^4.1.1", + "boxen": "^5.0.1", + "colorette": "^1.2.2", + "flat": "^5.0.2", + "gettext-parser": "^4.0.4", + "glob": "^7.1.6", + "mkdirp": "^1.0.4", + "path": "^0.12.7", + "terminal-link": "^2.1.1", + "yargs": "^16.2.0" + }, + "bin": { + "ngx-translate-extract": "bin/cli.js" + }, + "devDependencies": { + "@angular/compiler": "^11.2.9", + "@types/braces": "^3.0.0", + "@types/chai": "^4.2.16", + "@types/flat": "^5.0.1", + "@types/gettext-parser": "4.0.0", + "@types/glob": "^7.1.3", + "@types/mkdirp": "^1.0.1", + "@types/mocha": "^8.2.2", + "@types/node": "^14.14.37", + "@types/yargs": "^16.0.1", + "braces": "^3.0.2", + "chai": "^4.3.4", + "husky": "^6.0.0", + "lint-staged": "^10.5.4", + "mocha": "^8.3.2", + "prettier": "^2.2.1", + "rimraf": "^3.0.2", + "ts-node": "^9.1.1", + "tslint": "^6.1.3", + "tslint-config-prettier": "^1.18.0", + "tslint-eslint-rules": "^5.4.0", + "tslint-etc": "^1.13.9", + "typescript": "^4.2.4" + }, + "engines": { + "node": ">=11.15.0" + }, + "peerDependencies": { + "@angular/compiler": ">=8.0.0", + "typescript": ">=3.0.0" + } + }, + "node_modules/@angular/compiler": { + "version": "11.2.9", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-11.2.9.tgz", + "integrity": "sha512-EelccCc6Xgrz6UzoJU5EqrRc0CGDHS82cheiBP3lSDfjG6borD9al4DN5lfphp+FCmTpLY33wQ3jqhPwC02FMQ==", + "dev": true, + "dependencies": { + "tslib": "^2.0.0" + } + }, + "node_modules/@angular/compiler/node_modules/tslib": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", + "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==", + "dev": true + }, + "node_modules/@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.10.4" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "node_modules/@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "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" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "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", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "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" + } + }, + "node_modules/@babel/highlight/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 + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "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" + } + }, + "node_modules/@babel/highlight/node_modules/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, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@phenomnomnominal/tsquery": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-4.1.1.tgz", + "integrity": "sha512-jjMmK1tnZbm1Jq5a7fBliM4gQwjxMU7TFoRNwIyzwlO+eHPRCFv/Nv+H/Gi1jc3WR7QURG8D5d0Tn12YGrUqBQ==", + "dependencies": { + "esquery": "^1.0.1" + }, + "peerDependencies": { + "typescript": "^3 || ^4" + } + }, + "node_modules/@types/braces": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/braces/-/braces-3.0.0.tgz", + "integrity": "sha512-TbH79tcyi9FHwbyboOKeRachRq63mSuWYXOflsNO9ZyE5ClQ/JaozNKl+aWUq87qPNsXasXxi2AbgfwIJ+8GQw==", + "dev": true + }, + "node_modules/@types/chai": { + "version": "4.2.16", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.16.tgz", + "integrity": "sha512-vI5iOAsez9+roLS3M3+Xx7w+WRuDtSmF8bQkrbcIJ2sC1PcDgVoA0WGpa+bIrJ+y8zqY2oi//fUctkxtIcXJCw==", + "dev": true + }, + "node_modules/@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==" + }, + "node_modules/@types/flat": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@types/flat/-/flat-5.0.1.tgz", + "integrity": "sha512-ykRODHi9G9exJdTZvQggsqCUtB7jqiwLHcXCjNMb7zgWx6Lc2bydIUYBG1+It6VXZVFaeROv6HqPjDCAsoPG3w==", + "dev": true + }, + "node_modules/@types/gettext-parser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/gettext-parser/-/gettext-parser-4.0.0.tgz", + "integrity": "sha512-I/wvhr+l5M7IwBF1ADBfNQ6qGfUg85UTjj/AZWn09Y+POqyLe1cfbdJSMWzCobiJ3EJNY23MQCbP6jxQT81OTQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==", + "dev": true, + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "node_modules/@types/mkdirp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-1.0.1.tgz", + "integrity": "sha512-HkGSK7CGAXncr8Qn/0VqNtExEE+PHMWb+qlR1faHMao7ng6P3tAaoWWBMdva0gL5h4zprjIO89GJOLXsMcDm1Q==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/mocha": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.2.tgz", + "integrity": "sha512-Lwh0lzzqT5Pqh6z61P3c3P5nm6fzQK/MMHl9UKeneAeInVflBSz1O2EkX6gM6xfJd7FBXBY5purtLx7fUiZ7Hw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "14.14.37", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", + "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==", + "dev": true + }, + "node_modules/@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, + "node_modules/@types/yargs": { + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.1.tgz", + "integrity": "sha512-x4HABGLyzr5hKUzBC9dvjciOTm11WVH1NWonNjGgxapnTHu5SWUqyqn0zQ6Re0yQU0lsQ6ztLCoMAKDGZflyxA==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "20.2.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.0.tgz", + "integrity": "sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA==", + "dev": true + }, + "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", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-align": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", + "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", + "dependencies": { + "string-width": "^3.0.0" + } + }, + "node_modules/ansi-align/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==", + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/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, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dependencies": { + "type-fest": "^0.11.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "engines": { + "node": ">=8" + }, + "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", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dependencies": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/argparse": { + "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" + } + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/boxen": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.0.1.tgz", + "integrity": "sha512-49VBlw+PrWEF51aCmy7QIteYPIFZxSpvqBdP/2itCPPlJ49kj9zg/XPRFrdkne2W+CfwXUls8exMvu1RysZpKA==", + "dependencies": { + "ansi-align": "^3.0.0", + "camelcase": "^6.2.0", + "chalk": "^4.1.0", + "cli-boxes": "^2.2.1", + "string-width": "^4.2.0", + "type-fest": "^0.20.2", + "widest-line": "^3.1.0", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/boxen/node_modules/camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "node_modules/buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "node_modules/builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/callsites": { + "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" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", + "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "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/check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/chokidar": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", + "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.5.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.1" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cli-boxes": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "dependencies": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/cliui/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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/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/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/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/colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==" + }, + "node_modules/commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "node_modules/content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cosmiconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", + "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", + "dev": true, + "dependencies": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "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==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, + "node_modules/deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/doctrine": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-0.7.2.tgz", + "integrity": "sha1-fLhgNZujvpDgQLJrcpzkv6ZUxSM=", + "dev": true, + "dependencies": { + "esutils": "^1.1.6", + "isarray": "0.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/doctrine/node_modules/esutils": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.1.6.tgz", + "integrity": "sha1-wBzKqa5LiXxtDD4hCuUvPHqEQ3U=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "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==" + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.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==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/error-ex": { + "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" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "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" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "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/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", + "dev": true + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gettext-parser": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-4.0.4.tgz", + "integrity": "sha512-VDZEeOIYd0veZXt5iAn0SS3I0Fz14fJw+59avRNa7VIslEDriRLxcfrBd/xeQyOcm6nyS4uuufxm2iw88qirAg==", + "dependencies": { + "content-type": "^1.0.4", + "encoding": "^0.1.13", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.1" + } + }, + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true, + "engines": { + "node": ">=4.x" + } + }, + "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/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, + "node_modules/human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true, + "engines": { + "node": ">=8.12.0" + } + }, + "node_modules/husky": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/husky/-/husky-6.0.0.tgz", + "integrity": "sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ==", + "dev": true, + "bin": { + "husky": "lib/bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", + "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/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, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "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/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/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, + "engines": { + "node": ">=0.10.0" + } + }, + "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=", + "engines": { + "node": ">=4" + } + }, + "node_modules/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, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "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 + }, + "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 + }, + "node_modules/js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "node_modules/lint-staged": { + "version": "10.5.4", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.5.4.tgz", + "integrity": "sha512-EechC3DdFic/TdOPgj/RB3FicqE6932LTHCUm0Y2fsD9KGlLB+RwJl2q1IYBIvEsKzDOgn0D4gll+YxG5RsrKg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "cli-truncate": "^2.1.0", + "commander": "^6.2.0", + "cosmiconfig": "^7.0.0", + "debug": "^4.2.0", + "dedent": "^0.7.0", + "enquirer": "^2.3.6", + "execa": "^4.1.0", + "listr2": "^3.2.2", + "log-symbols": "^4.0.0", + "micromatch": "^4.0.2", + "normalize-path": "^3.0.0", + "please-upgrade-node": "^3.2.0", + "string-argv": "0.3.1", + "stringify-object": "^3.3.0" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/lint-staged/node_modules/chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "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/listr2": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.6.2.tgz", + "integrity": "sha512-B2vlu7Zx/2OAMVUovJ7Tv1kQ2v2oXd0nZKzkSAcRCej269d8gkS/gupDEdNl23KQ3ZjVD8hQmifrrBFbx8F9LA==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "cli-truncate": "^2.1.0", + "figures": "^3.2.0", + "indent-string": "^4.0.0", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "rxjs": "^6.6.7", + "through": "^2.3.8", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "enquirer": ">= 2.3.0 < 3" + } + }, + "node_modules/listr2/node_modules/chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "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/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "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/log-update": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", + "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/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/log-update/node_modules/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, + "engines": { + "node": ">=8" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/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/log-update/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "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/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/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.3.2.tgz", + "integrity": "sha512-UdmISwr/5w+uXLPKspgoV7/RXZwKRTiTjJ2/AC5ZiEztIoOYdfKb19+9jNmEInzx5pBsCyJQzarAxqIGBNYJhg==", + "dev": true, + "dependencies": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.1", + "debug": "4.3.1", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.6", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.0.0", + "log-symbols": "4.0.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.1.20", + "serialize-javascript": "5.0.1", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.1.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 10.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "node_modules/mocha/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/mocha/node_modules/chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "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/mocha/node_modules/chalk/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" + } + }, + "node_modules/mocha/node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/mocha/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==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/js-yaml": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", + "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/mocha/node_modules/log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nanoid": { + "version": "3.1.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", + "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dependencies": { + "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/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "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" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path": { + "version": "0.12.7", + "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", + "integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=", + "dependencies": { + "process": "^0.11.1", + "util": "^0.10.3" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "engines": { + "node": ">=0.10.0" + } + }, + "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==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "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/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/picomatch": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", + "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "dependencies": { + "semver-compare": "^1.0.0" + } + }, + "node_modules/prettier": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", + "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "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", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "node_modules/resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "dependencies": { + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/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, + "engines": { + "node": ">=4" + } + }, + "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/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "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", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "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/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "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" + } + }, + "node_modules/semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, + "node_modules/serialize-javascript": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "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==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "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==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "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/slice-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi/node_modules/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, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "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 + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true, + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/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==" + }, + "node_modules/string-width/node_modules/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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/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/stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dev": true, + "dependencies": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/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, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.1.0.tgz", + "integrity": "sha512-zoE5/e+dnEijk6ASB6/qrK+oYdm2do1hjoLWrqUC/8WEIW1gbxFcKuBof7sW8ArN6e+AYvsE8HBGiVRWL/F5CA==", + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/terminal-link": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", + "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "dependencies": { + "ansi-escapes": "^4.2.1", + "supports-hyperlinks": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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 + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-node": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", + "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", + "dev": true, + "dependencies": { + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "typescript": ">=2.7" + } + }, + "node_modules/tslib": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", + "dev": true + }, + "node_modules/tslint": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", + "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", + "deprecated": "TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^4.0.1", + "glob": "^7.1.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.3", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.13.0", + "tsutils": "^2.29.0" + }, + "bin": { + "tslint": "bin/tslint" + }, + "engines": { + "node": ">=4.8.0" + }, + "peerDependencies": { + "typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 4.0.0-dev" + } + }, + "node_modules/tslint-config-prettier": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz", + "integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==", + "dev": true, + "bin": { + "tslint-config-prettier-check": "bin/check.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/tslint-eslint-rules": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/tslint-eslint-rules/-/tslint-eslint-rules-5.4.0.tgz", + "integrity": "sha512-WlSXE+J2vY/VPgIcqQuijMQiel+UtmXS+4nvK4ZzlDiqBfXse8FAvkNnTcYhnQyOTW5KFM+uRRGXxYhFpuBc6w==", + "dev": true, + "dependencies": { + "doctrine": "0.7.2", + "tslib": "1.9.0", + "tsutils": "^3.0.0" + }, + "peerDependencies": { + "tslint": "^5.0.0", + "typescript": "^2.2.0 || ^3.0.0" + } + }, + "node_modules/tslint-eslint-rules/node_modules/tslib": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz", + "integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==", + "dev": true + }, + "node_modules/tslint-eslint-rules/node_modules/tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "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/tslint-etc": { + "version": "1.13.9", + "resolved": "https://registry.npmjs.org/tslint-etc/-/tslint-etc-1.13.9.tgz", + "integrity": "sha512-plelxI+RH0w1irVPxOX7REqnwaAM1FJcgoe12UU1Ft3zIvGx9VX4BNf9jRLAt2wd00TJPpCb0ACumaDoCXp7hA==", + "dev": true, + "dependencies": { + "@phenomnomnominal/tsquery": "^4.0.0", + "tslib": "^2.0.0", + "tsutils": "^3.0.0", + "tsutils-etc": "^1.0.0" + }, + "peerDependencies": { + "tslint": "^5.0.0 || ^6.0.0", + "typescript": "^2.3.0 || ^3.0.0 || ^4.0.0" + } + }, + "node_modules/tslint-etc/node_modules/tslib": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", + "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==", + "dev": true + }, + "node_modules/tslint-etc/node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "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/tslint-etc/node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tslint/node_modules/ansi-styles": { + "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" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/tslint/node_modules/chalk": { + "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", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/tslint/node_modules/color-convert": { + "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" + } + }, + "node_modules/tslint/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 + }, + "node_modules/tslint/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/tslint/node_modules/has-flag": { + "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" + } + }, + "node_modules/tslint/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/tslint/node_modules/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, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "peerDependencies": { + "typescript": ">=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev" + } + }, + "node_modules/tsutils-etc": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/tsutils-etc/-/tsutils-etc-1.3.2.tgz", + "integrity": "sha512-hAQoELuJxKiJ7nISOuTFI+OKcwtbBTfQh47DquqG4R0bDvhfK6vXvykoKTNpBBS1n67vGvGPqEtnR9zE6dfWdg==", + "dev": true, + "dependencies": { + "@types/yargs": "^15.0.5", + "yargs": "^15.4.1" + }, + "bin": { + "ts-flags": "bin/ts-flags", + "ts-kind": "bin/ts-kind" + }, + "peerDependencies": { + "tsutils": "^3.0.0" + } + }, + "node_modules/tsutils-etc/node_modules/@types/yargs": { + "version": "15.0.13", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.13.tgz", + "integrity": "sha512-kQ5JNTrbDv3Rp5X2n/iUu37IJBDU2gsZ5R/g1/KHOOEc5IKfUFjXT6DENPGduh08I/pamwtEq4oul7gUqKTQDQ==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/tsutils-etc/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/tsutils-etc/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/tsutils-etc/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tsutils-etc/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tsutils-etc/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tsutils-etc/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/tsutils-etc/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tsutils-etc/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/tsutils-etc/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tsutils-etc/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "node_modules/tsutils-etc/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tsutils-etc/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "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": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dependencies": { + "inherits": "2.0.3" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "node_modules/util/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "node_modules/wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "dependencies": { + "string-width": "^1.0.2 || 2" + } + }, + "node_modules/wide-align/node_modules/ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/wide-align/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/wide-align/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "dependencies": { + "string-width": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/workerpool": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", + "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/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/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, "dependencies": { "@angular/compiler": { "version": "11.2.9", @@ -1638,6 +4705,14 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, "string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", @@ -1679,14 +4754,6 @@ } } }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - }, "stringify-object": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", @@ -2097,8 +5164,7 @@ "typescript": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", - "dev": true + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==" }, "util": { "version": "0.10.4", diff --git a/package.json b/package.json index c84d3f61..12e10542 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@biesbjerg/ngx-translate-extract", - "version": "7.0.4", + "version": "7.1.0", "description": "Extract strings from projects using ngx-translate", "main": "dist/index.js", "typings": "dist/index.d.ts", From 0dd49c09605a7129c39cc11fe242f6a80e3aaf75 Mon Sep 17 00:00:00 2001 From: Nick van Raaij Date: Fri, 12 Nov 2021 11:41:01 +0100 Subject: [PATCH 03/18] updated target/module --- tsconfig.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 4b817b03..cbaecc45 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,11 +7,13 @@ "noImplicitUseStrict": true, "removeComments": true, "declaration": true, - "target": "es2019", + "target": "es6", "lib": [ - "es2019" + "es2019", + "es2020", + "DOM" ], - "module": "UMD", + "module": "ES2020", "esModuleInterop": true, "moduleResolution": "node", "outDir": "dist", From 7c4018a5b73333986820f8a5fdbe1fc6403dda59 Mon Sep 17 00:00:00 2001 From: Nick van Raaij Date: Fri, 12 Nov 2021 11:50:13 +0100 Subject: [PATCH 04/18] fix testing with module --- package.json | 3 ++- tsconfig.spec.json | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tsconfig.spec.json diff --git a/package.json b/package.json index 12e10542..9aa4ab47 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "bin/", "dist/" ], + "type": "module", "bin": { "ngx-translate-extract": "bin/cli.js" }, @@ -16,7 +17,7 @@ "watch": "npm run clean && tsc --watch", "clean": "rimraf ./dist", "lint": "tslint --force './src/**/*.ts'", - "test": "mocha -r ts-node/register tests/**/*.spec.ts" + "test": "env TS_NODE_PROJECT=\"tsconfig.spec.json\" mocha -r ts-node/register tests/**/*.spec.ts" }, "husky": { "hooks": { diff --git a/tsconfig.spec.json b/tsconfig.spec.json new file mode 100644 index 00000000..6658affe --- /dev/null +++ b/tsconfig.spec.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "target": "es2015", + "declaration": false, + "noImplicitAny": false, + "removeComments": true, + "inlineSourceMap": true, + "moduleResolution": "node" + }, + "include": ["tests/**/*.ts", "src/**/*.ts"] +} \ No newline at end of file From 5278496935d6b69a091fdab8cee6bec9968edfa5 Mon Sep 17 00:00:00 2001 From: Nick van Raaij Date: Mon, 15 Nov 2021 12:21:43 +0100 Subject: [PATCH 05/18] fix incompatibility --- bin/cli.js | 2 +- package-lock.json | 573 ++++++++++++++++----------------------------- package.json | 13 +- tsconfig.json | 7 +- tsconfig.spec.json | 7 +- 5 files changed, 219 insertions(+), 383 deletions(-) mode change 100755 => 100644 bin/cli.js diff --git a/bin/cli.js b/bin/cli.js old mode 100755 new mode 100644 index 6fa9f730..305f09a7 --- a/bin/cli.js +++ b/bin/cli.js @@ -1,3 +1,3 @@ #! /usr/bin/env node -require('../dist/cli/cli'); +require('../dist/cli/cli.js'); diff --git a/package-lock.json b/package-lock.json index eb82f8cf..2962c47a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "@biesbjerg/ngx-translate-extract", - "version": "7.0.4", + "name": "@misternick/ngx-translate-extract", + "version": "7.1.36", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "@biesbjerg/ngx-translate-extract", - "version": "7.0.4", + "name": "@misternick/ngx-translate-extract", + "version": "7.1.36", "license": "MIT", "dependencies": { "@phenomnomnominal/tsquery": "^4.1.1", @@ -24,7 +24,7 @@ "ngx-translate-extract": "bin/cli.js" }, "devDependencies": { - "@angular/compiler": "^11.2.9", + "@angular/compiler": "~12.2.13", "@types/braces": "^3.0.0", "@types/chai": "^4.2.16", "@types/flat": "^5.0.1", @@ -38,7 +38,7 @@ "chai": "^4.3.4", "husky": "^6.0.0", "lint-staged": "^10.5.4", - "mocha": "^8.3.2", + "mocha": "^9.1.3", "prettier": "^2.2.1", "rimraf": "^3.0.2", "ts-node": "^9.1.1", @@ -52,17 +52,20 @@ "node": ">=11.15.0" }, "peerDependencies": { - "@angular/compiler": ">=8.0.0", + "@angular/compiler": ">=12.0.0", "typescript": ">=3.0.0" } }, "node_modules/@angular/compiler": { - "version": "11.2.9", - "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-11.2.9.tgz", - "integrity": "sha512-EelccCc6Xgrz6UzoJU5EqrRc0CGDHS82cheiBP3lSDfjG6borD9al4DN5lfphp+FCmTpLY33wQ3jqhPwC02FMQ==", + "version": "12.2.13", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-12.2.13.tgz", + "integrity": "sha512-L0saTTJJtxldjhaGIL6b1BCfodPOEz4Wrev3pEUK5UcODooj5HLiE/aO6jiNb8M4XTbdqByKyqvZyWzGHeexVQ==", "dev": true, "dependencies": { - "tslib": "^2.0.0" + "tslib": "^2.2.0" + }, + "engines": { + "node": "^12.14.1 || >=14.0.0" } }, "node_modules/@angular/compiler/node_modules/tslib": { @@ -72,29 +75,38 @@ "dev": true }, "node_modules/@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", + "integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.10.4" + "@babel/highlight": "^7.16.0" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", - "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==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } }, "node_modules/@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz", + "integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.10.4", + "@babel/helper-validator-identifier": "^7.15.7", "chalk": "^2.0.0", "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" } }, "node_modules/@babel/highlight/node_modules/ansi-styles": { @@ -527,9 +539,9 @@ } }, "node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "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" @@ -551,24 +563,24 @@ } }, "node_modules/chokidar": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", - "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", "dev": true, "dependencies": { - "anymatch": "~3.1.1", + "anymatch": "~3.1.2", "braces": "~3.0.2", - "glob-parent": "~5.1.0", + "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" + "readdirp": "~3.6.0" }, "engines": { "node": ">= 8.10.0" }, "optionalDependencies": { - "fsevents": "~2.3.1" + "fsevents": "~2.3.2" } }, "node_modules/clean-stack": { @@ -728,9 +740,9 @@ } }, "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -990,6 +1002,12 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "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 + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -1040,9 +1058,9 @@ } }, "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1079,6 +1097,18 @@ "node": ">=4.x" } }, + "node_modules/has": { + "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" + }, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1185,6 +1215,18 @@ "node": ">=8" } }, + "node_modules/is-core-module": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", + "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -1203,9 +1245,9 @@ } }, "node_modules/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==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { "is-extglob": "^2.1.1" @@ -1343,22 +1385,6 @@ "url": "https://opencollective.com/lint-staged" } }, - "node_modules/lint-staged/node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "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/listr2": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.6.2.tgz", @@ -1382,22 +1408,6 @@ "enquirer": ">= 2.3.0 < 3" } }, - "node_modules/listr2/node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "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/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -1429,22 +1439,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/log-symbols/node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "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/log-update": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", @@ -1587,33 +1581,32 @@ } }, "node_modules/mocha": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.3.2.tgz", - "integrity": "sha512-UdmISwr/5w+uXLPKspgoV7/RXZwKRTiTjJ2/AC5ZiEztIoOYdfKb19+9jNmEInzx5pBsCyJQzarAxqIGBNYJhg==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz", + "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==", "dev": true, "dependencies": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.5.1", - "debug": "4.3.1", + "chokidar": "3.5.2", + "debug": "4.3.2", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.1.6", + "glob": "7.1.7", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "4.0.0", - "log-symbols": "4.0.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", "minimatch": "3.0.4", "ms": "2.1.3", - "nanoid": "3.1.20", - "serialize-javascript": "5.0.1", + "nanoid": "3.1.25", + "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", "which": "2.0.2", - "wide-align": "1.1.3", - "workerpool": "6.1.0", + "workerpool": "6.1.5", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" @@ -1623,7 +1616,7 @@ "mocha": "bin/mocha" }, "engines": { - "node": ">= 10.12.0" + "node": ">= 12.0.0" }, "funding": { "type": "opencollective", @@ -1636,34 +1629,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "node_modules/mocha/node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "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/mocha/node_modules/chalk/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" - } - }, "node_modules/mocha/node_modules/diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", @@ -1686,9 +1651,9 @@ } }, "node_modules/mocha/node_modules/js-yaml": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", - "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { "argparse": "^2.0.1" @@ -1697,18 +1662,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/mocha/node_modules/log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", - "dev": true, - "dependencies": { - "chalk": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/mocha/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -1737,9 +1690,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", - "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" @@ -2009,9 +1962,9 @@ } }, "node_modules/readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "dependencies": { "picomatch": "^2.2.1" @@ -2035,11 +1988,12 @@ "dev": true }, "node_modules/resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "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" }, "funding": { @@ -2135,9 +2089,9 @@ "dev": true }, "node_modules/serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "dependencies": { "randombytes": "^2.1.0" @@ -2879,49 +2833,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "node_modules/wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "dependencies": { - "string-width": "^1.0.2 || 2" - } - }, - "node_modules/wide-align/node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/wide-align/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/wide-align/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -2934,9 +2845,9 @@ } }, "node_modules/workerpool": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", - "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", + "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==", "dev": true }, "node_modules/wrap-ansi": { @@ -3072,12 +2983,12 @@ }, "dependencies": { "@angular/compiler": { - "version": "11.2.9", - "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-11.2.9.tgz", - "integrity": "sha512-EelccCc6Xgrz6UzoJU5EqrRc0CGDHS82cheiBP3lSDfjG6borD9al4DN5lfphp+FCmTpLY33wQ3jqhPwC02FMQ==", + "version": "12.2.13", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-12.2.13.tgz", + "integrity": "sha512-L0saTTJJtxldjhaGIL6b1BCfodPOEz4Wrev3pEUK5UcODooj5HLiE/aO6jiNb8M4XTbdqByKyqvZyWzGHeexVQ==", "dev": true, "requires": { - "tslib": "^2.0.0" + "tslib": "^2.2.0" }, "dependencies": { "tslib": { @@ -3089,27 +3000,27 @@ } }, "@babel/code-frame": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", + "integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==", "dev": true, "requires": { - "@babel/highlight": "^7.10.4" + "@babel/highlight": "^7.16.0" } }, "@babel/helper-validator-identifier": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "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==", "dev": true }, "@babel/highlight": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz", + "integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.4", + "@babel/helper-validator-identifier": "^7.15.7", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -3468,9 +3379,9 @@ } }, "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "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" @@ -3483,19 +3394,19 @@ "dev": true }, "chokidar": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", - "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", "dev": true, "requires": { - "anymatch": "~3.1.1", + "anymatch": "~3.1.2", "braces": "~3.0.2", - "fsevents": "~2.3.1", - "glob-parent": "~5.1.0", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" + "readdirp": "~3.6.0" } }, "clean-stack": { @@ -3618,9 +3529,9 @@ } }, "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "requires": { "ms": "2.1.2" @@ -3803,6 +3714,12 @@ "dev": true, "optional": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -3841,9 +3758,9 @@ } }, "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3868,6 +3785,15 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, + "has": { + "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" + } + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -3944,6 +3870,15 @@ "binary-extensions": "^2.0.0" } }, + "is-core-module": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", + "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -3956,9 +3891,9 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, "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==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -4061,18 +3996,6 @@ "please-upgrade-node": "^3.2.0", "string-argv": "0.3.1", "stringify-object": "^3.3.0" - }, - "dependencies": { - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - } } }, "listr2": { @@ -4090,18 +4013,6 @@ "rxjs": "^6.6.7", "through": "^2.3.8", "wrap-ansi": "^7.0.0" - }, - "dependencies": { - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - } } }, "locate-path": { @@ -4121,18 +4032,6 @@ "requires": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" - }, - "dependencies": { - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - } } }, "log-update": { @@ -4240,33 +4139,32 @@ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" }, "mocha": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.3.2.tgz", - "integrity": "sha512-UdmISwr/5w+uXLPKspgoV7/RXZwKRTiTjJ2/AC5ZiEztIoOYdfKb19+9jNmEInzx5pBsCyJQzarAxqIGBNYJhg==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz", + "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.5.1", - "debug": "4.3.1", + "chokidar": "3.5.2", + "debug": "4.3.2", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.1.6", + "glob": "7.1.7", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "4.0.0", - "log-symbols": "4.0.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", "minimatch": "3.0.4", "ms": "2.1.3", - "nanoid": "3.1.20", - "serialize-javascript": "5.0.1", + "nanoid": "3.1.25", + "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", "which": "2.0.2", - "wide-align": "1.1.3", - "workerpool": "6.1.0", + "workerpool": "6.1.5", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" @@ -4278,27 +4176,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "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, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", @@ -4312,23 +4189,14 @@ "dev": true }, "js-yaml": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", - "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { "argparse": "^2.0.1" } }, - "log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", - "dev": true, - "requires": { - "chalk": "^4.0.0" - } - }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -4353,9 +4221,9 @@ "dev": true }, "nanoid": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", - "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", "dev": true }, "normalize-path": { @@ -4544,9 +4412,9 @@ } }, "readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "requires": { "picomatch": "^2.2.1" @@ -4564,11 +4432,12 @@ "dev": true }, "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "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" } }, @@ -4629,9 +4498,9 @@ "dev": true }, "serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -5201,42 +5070,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "requires": { - "string-width": "^1.0.2 || 2" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, "widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -5246,9 +5079,9 @@ } }, "workerpool": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", - "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", + "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==", "dev": true }, "wrap-ansi": { diff --git a/package.json b/package.json index 9aa4ab47..cba4146b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@biesbjerg/ngx-translate-extract", - "version": "7.1.0", + "name": "@misternick/ngx-translate-extract", + "version": "7.1.38", "description": "Extract strings from projects using ngx-translate", "main": "dist/index.js", "typings": "dist/index.d.ts", @@ -8,7 +8,6 @@ "bin/", "dist/" ], - "type": "module", "bin": { "ngx-translate-extract": "bin/cli.js" }, @@ -38,7 +37,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/biesbjerg/ngx-translate-extract.git" + "url": "https://github.com/venraij/ngx-translate-extract.git" }, "keywords": [ "angular", @@ -62,7 +61,7 @@ }, "config": {}, "devDependencies": { - "@angular/compiler": "^11.2.9", + "@angular/compiler": "~12.2.13", "@types/braces": "^3.0.0", "@types/chai": "^4.2.16", "@types/flat": "^5.0.1", @@ -76,7 +75,7 @@ "chai": "^4.3.4", "husky": "^6.0.0", "lint-staged": "^10.5.4", - "mocha": "^8.3.2", + "mocha": "^9.1.3", "prettier": "^2.2.1", "rimraf": "^3.0.2", "ts-node": "^9.1.1", @@ -87,7 +86,7 @@ "typescript": "^4.2.4" }, "peerDependencies": { - "@angular/compiler": ">=8.0.0", + "@angular/compiler": ">=12.0.0", "typescript": ">=3.0.0" }, "dependencies": { diff --git a/tsconfig.json b/tsconfig.json index cbaecc45..350414de 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,13 +7,12 @@ "noImplicitUseStrict": true, "removeComments": true, "declaration": true, - "target": "es6", + "target": "esnext", "lib": [ "es2019", - "es2020", "DOM" ], - "module": "ES2020", + "module": "commonjs", "esModuleInterop": true, "moduleResolution": "node", "outDir": "dist", @@ -23,7 +22,7 @@ ] }, "include": [ - "src/**/*.ts" + "src/**/*.ts", ], "exclude": [] } diff --git a/tsconfig.spec.json b/tsconfig.spec.json index 6658affe..b96dc170 100644 --- a/tsconfig.spec.json +++ b/tsconfig.spec.json @@ -7,7 +7,12 @@ "noImplicitAny": false, "removeComments": true, "inlineSourceMap": true, - "moduleResolution": "node" + "moduleResolution": "node", + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noImplicitUseStrict": true, }, "include": ["tests/**/*.ts", "src/**/*.ts"] } \ No newline at end of file From 6b15ebf204c6e308c3698f215bd656f0995faedf Mon Sep 17 00:00:00 2001 From: Nick van Raaij Date: Mon, 15 Nov 2021 12:30:18 +0100 Subject: [PATCH 06/18] fix package json --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cba4146b..8975e5b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@misternick/ngx-translate-extract", - "version": "7.1.38", + "name": "@biesbjerg/ngx-translate-extract", + "version": "7.1.0", "description": "Extract strings from projects using ngx-translate", "main": "dist/index.js", "typings": "dist/index.d.ts", @@ -37,7 +37,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/venraij/ngx-translate-extract.git" + "url": "https://github.com/biesbjerg/ngx-translate-extract.git" }, "keywords": [ "angular", From 56457c7becdfe8b33ab65d2f675dc7166d9cc43f Mon Sep 17 00:00:00 2001 From: Nick van Raaij Date: Mon, 15 Nov 2021 12:34:45 +0100 Subject: [PATCH 07/18] testing workflow --- .github/workflows/node.js.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 00000000..e43a6a42 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,31 @@ +# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x, 14.x, 16.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build --if-present + - run: npm run test \ No newline at end of file From 2af42baa15612ce1860d7ecbb4813449bab837ba Mon Sep 17 00:00:00 2001 From: Tiberiu Zuld Date: Mon, 15 Nov 2021 17:40:10 +0200 Subject: [PATCH 08/18] make changes for angular 13 --- .gitignore | 1 - bin/cli.js | 2 +- dist/cli/cli.d.ts | 1 + dist/cli/cli.js | 147 ++++++++++++++++++ dist/cli/tasks/extract.task.d.ts | 29 ++++ dist/cli/tasks/extract.task.js | 142 +++++++++++++++++ dist/cli/tasks/task.interface.d.ts | 3 + dist/cli/tasks/task.interface.js | 2 + dist/compilers/compiler.factory.d.ts | 4 + dist/compilers/compiler.factory.js | 18 +++ dist/compilers/compiler.interface.d.ts | 6 + dist/compilers/compiler.interface.js | 2 + dist/compilers/json.compiler.d.ts | 10 ++ dist/compilers/json.compiler.js | 27 ++++ dist/compilers/namespaced-json.compiler.d.ts | 9 ++ dist/compilers/namespaced-json.compiler.js | 24 +++ dist/compilers/po.compiler.d.ts | 9 ++ dist/compilers/po.compiler.js | 47 ++++++ dist/index.d.ts | 19 +++ dist/index.js | 20 +++ dist/parsers/directive.parser.d.ts | 18 +++ dist/parsers/directive.parser.js | 106 +++++++++++++ dist/parsers/marker.parser.d.ts | 5 + dist/parsers/marker.parser.js | 26 ++++ dist/parsers/parser.interface.d.ts | 4 + dist/parsers/parser.interface.js | 2 + dist/parsers/pipe.parser.d.ts | 13 ++ dist/parsers/pipe.parser.js | 108 +++++++++++++ dist/parsers/service.parser.d.ts | 8 + dist/parsers/service.parser.js | 46 ++++++ .../key-as-default-value.post-processor.d.ts | 6 + .../key-as-default-value.post-processor.js | 7 + .../null-as-default-value.post-processor.d.ts | 6 + .../null-as-default-value.post-processor.js | 7 + .../post-processor.interface.d.ts | 5 + .../post-processor.interface.js | 2 + .../purge-obsolete-keys.post-processor.d.ts | 6 + .../purge-obsolete-keys.post-processor.js | 7 + .../sort-by-key.post-processor.d.ts | 6 + .../sort-by-key.post-processor.js | 7 + ...tring-as-default-value.post-processor.d.ts | 12 ++ .../string-as-default-value.post-processor.js | 11 ++ dist/utils/ast-helpers.d.ts | 13 ++ dist/utils/ast-helpers.js | 126 +++++++++++++++ dist/utils/donate.d.ts | 1 + dist/utils/donate.js | 16 ++ dist/utils/fs-helpers.d.ts | 8 + dist/utils/fs-helpers.js | 26 ++++ dist/utils/translation.collection.d.ts | 21 +++ dist/utils/translation.collection.js | 73 +++++++++ dist/utils/utils.d.ts | 3 + dist/utils/utils.js | 15 ++ package-lock.json | 126 ++++++++------- package.json | 14 +- src/cli/cli.ts | 39 ++--- src/cli/tasks/extract.task.ts | 15 +- src/compilers/compiler.factory.ts | 8 +- src/compilers/compiler.interface.ts | 2 +- src/compilers/json.compiler.ts | 9 +- src/compilers/namespaced-json.compiler.ts | 9 +- src/compilers/po.compiler.ts | 7 +- src/index.ts | 38 ++--- src/parsers/directive.parser.ts | 6 +- src/parsers/marker.parser.ts | 6 +- src/parsers/parser.interface.ts | 2 +- src/parsers/pipe.parser.ts | 10 +- src/parsers/service.parser.ts | 6 +- .../key-as-default-value.post-processor.ts | 4 +- .../null-as-default-value.post-processor.ts | 4 +- .../post-processor.interface.ts | 2 +- .../purge-obsolete-keys.post-processor.ts | 4 +- .../sort-by-key.post-processor.ts | 4 +- .../string-as-default-value.post-processor.ts | 4 +- src/utils/ast-helpers.ts | 8 +- tsconfig.json | 3 +- 75 files changed, 1413 insertions(+), 159 deletions(-) create mode 100644 dist/cli/cli.d.ts create mode 100644 dist/cli/cli.js create mode 100644 dist/cli/tasks/extract.task.d.ts create mode 100644 dist/cli/tasks/extract.task.js create mode 100644 dist/cli/tasks/task.interface.d.ts create mode 100644 dist/cli/tasks/task.interface.js create mode 100644 dist/compilers/compiler.factory.d.ts create mode 100644 dist/compilers/compiler.factory.js create mode 100644 dist/compilers/compiler.interface.d.ts create mode 100644 dist/compilers/compiler.interface.js create mode 100644 dist/compilers/json.compiler.d.ts create mode 100644 dist/compilers/json.compiler.js create mode 100644 dist/compilers/namespaced-json.compiler.d.ts create mode 100644 dist/compilers/namespaced-json.compiler.js create mode 100644 dist/compilers/po.compiler.d.ts create mode 100644 dist/compilers/po.compiler.js create mode 100644 dist/index.d.ts create mode 100644 dist/index.js create mode 100644 dist/parsers/directive.parser.d.ts create mode 100644 dist/parsers/directive.parser.js create mode 100644 dist/parsers/marker.parser.d.ts create mode 100644 dist/parsers/marker.parser.js create mode 100644 dist/parsers/parser.interface.d.ts create mode 100644 dist/parsers/parser.interface.js create mode 100644 dist/parsers/pipe.parser.d.ts create mode 100644 dist/parsers/pipe.parser.js create mode 100644 dist/parsers/service.parser.d.ts create mode 100644 dist/parsers/service.parser.js create mode 100644 dist/post-processors/key-as-default-value.post-processor.d.ts create mode 100644 dist/post-processors/key-as-default-value.post-processor.js create mode 100644 dist/post-processors/null-as-default-value.post-processor.d.ts create mode 100644 dist/post-processors/null-as-default-value.post-processor.js create mode 100644 dist/post-processors/post-processor.interface.d.ts create mode 100644 dist/post-processors/post-processor.interface.js create mode 100644 dist/post-processors/purge-obsolete-keys.post-processor.d.ts create mode 100644 dist/post-processors/purge-obsolete-keys.post-processor.js create mode 100644 dist/post-processors/sort-by-key.post-processor.d.ts create mode 100644 dist/post-processors/sort-by-key.post-processor.js create mode 100644 dist/post-processors/string-as-default-value.post-processor.d.ts create mode 100644 dist/post-processors/string-as-default-value.post-processor.js create mode 100644 dist/utils/ast-helpers.d.ts create mode 100644 dist/utils/ast-helpers.js create mode 100644 dist/utils/donate.d.ts create mode 100644 dist/utils/donate.js create mode 100644 dist/utils/fs-helpers.d.ts create mode 100644 dist/utils/fs-helpers.js create mode 100644 dist/utils/translation.collection.d.ts create mode 100644 dist/utils/translation.collection.js create mode 100644 dist/utils/utils.d.ts create mode 100644 dist/utils/utils.js diff --git a/.gitignore b/.gitignore index 0abdb435..938bd247 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ npm-debug.log* .DS_Store # Compiled files -dist src/**/*.js tests/**/*.js diff --git a/bin/cli.js b/bin/cli.js index 305f09a7..c5b93522 100644 --- a/bin/cli.js +++ b/bin/cli.js @@ -1,3 +1,3 @@ #! /usr/bin/env node -require('../dist/cli/cli.js'); +import('../dist/cli/cli.js'); diff --git a/dist/cli/cli.d.ts b/dist/cli/cli.d.ts new file mode 100644 index 00000000..d2b943ad --- /dev/null +++ b/dist/cli/cli.d.ts @@ -0,0 +1 @@ +export declare const cli: any; diff --git a/dist/cli/cli.js b/dist/cli/cli.js new file mode 100644 index 00000000..02b3b02b --- /dev/null +++ b/dist/cli/cli.js @@ -0,0 +1,147 @@ +import yargs from 'yargs'; +import { red, green } from 'colorette'; +import { ExtractTask } from './tasks/extract.task.js'; +import { PipeParser } from '../parsers/pipe.parser.js'; +import { DirectiveParser } from '../parsers/directive.parser.js'; +import { ServiceParser } from '../parsers/service.parser.js'; +import { MarkerParser } from '../parsers/marker.parser.js'; +import { SortByKeyPostProcessor } from '../post-processors/sort-by-key.post-processor.js'; +import { KeyAsDefaultValuePostProcessor } from '../post-processors/key-as-default-value.post-processor.js'; +import { NullAsDefaultValuePostProcessor } from '../post-processors/null-as-default-value.post-processor.js'; +import { StringAsDefaultValuePostProcessor } from '../post-processors/string-as-default-value.post-processor.js'; +import { PurgeObsoleteKeysPostProcessor } from '../post-processors/purge-obsolete-keys.post-processor.js'; +import { CompilerFactory } from '../compilers/compiler.factory.js'; +import { normalizePaths } from '../utils/fs-helpers.js'; +import { donateMessage } from '../utils/donate.js'; +const y = yargs().option('patterns', { + alias: 'p', + describe: 'Default patterns', + type: 'array', + default: ['/**/*.html', '/**/*.ts'], + hidden: true +}); +const parsed = y.parse(); +export const cli = y + .usage('Extract strings from files for translation.\nUsage: $0 [options]') + .version(process.env.npm_package_version) + .alias('version', 'v') + .help('help') + .alias('help', 'h') + .option('input', { + alias: 'i', + describe: 'Paths you would like to extract strings from. You can use path expansion, glob patterns and multiple paths', + default: [process.env.PWD], + type: 'array', + normalize: true, + required: true +}) + .coerce('input', (input) => { + const paths = normalizePaths(input, parsed.patterns); + return paths; +}) + .option('output', { + alias: 'o', + describe: 'Paths where you would like to save extracted strings. You can use path expansion, glob patterns and multiple paths', + type: 'array', + normalize: true, + required: true +}) + .coerce('output', (output) => { + const paths = normalizePaths(output, parsed.patterns); + return paths; +}) + .option('format', { + alias: 'f', + describe: 'Format', + default: 'json', + type: 'string', + choices: ['json', 'namespaced-json', 'pot'] +}) + .option('format-indentation', { + alias: 'fi', + describe: 'Format indentation (JSON/Namedspaced JSON)', + default: '\t', + type: 'string' +}) + .option('replace', { + alias: 'r', + describe: 'Replace the contents of output file if it exists (Merges by default)', + type: 'boolean' +}) + .option('sort', { + alias: 's', + describe: 'Sort strings in alphabetical order', + type: 'boolean' +}) + .option('clean', { + alias: 'c', + describe: 'Remove obsolete strings after merge', + type: 'boolean' +}) + .option('key-as-default-value', { + alias: 'k', + describe: 'Use key as default value', + type: 'boolean', + conflicts: ['null-as-default-value', 'string-as-default-value'] +}) + .option('null-as-default-value', { + alias: 'n', + describe: 'Use null as default value', + type: 'boolean', + conflicts: ['key-as-default-value', 'string-as-default-value'] +}) + .option('string-as-default-value', { + alias: 'd', + describe: 'Use string as default value', + type: 'string', + conflicts: ['null-as-default-value', 'key-as-default-value'] +}) + .group(['format', 'format-indentation', 'sort', 'clean', 'replace'], 'Output') + .group(['key-as-default-value', 'null-as-default-value', 'string-as-default-value'], 'Extracted key value (defaults to empty string)') + .conflicts('key-as-default-value', 'null-as-default-value') + .example(`$0 -i ./src-a/ -i ./src-b/ -o strings.json`, 'Extract (ts, html) from multiple paths') + .example(`$0 -i './{src-a,src-b}/' -o strings.json`, 'Extract (ts, html) from multiple paths using brace expansion') + .example(`$0 -i ./src/ -o ./i18n/da.json -o ./i18n/en.json`, 'Extract (ts, html) and save to da.json and en.json') + .example(`$0 -i ./src/ -o './i18n/{en,da}.json'`, 'Extract (ts, html) and save to da.json and en.json using brace expansion') + .example(`$0 -i './src/**/*.{ts,tsx,html}' -o strings.json`, 'Extract from ts, tsx and html') + .example(`$0 -i './src/**/!(*.spec).{ts,html}' -o strings.json`, 'Extract from ts, html, excluding files with ".spec" in filename') + .wrap(110) + .exitProcess(true) + .parse(process.argv); +const extractTask = new ExtractTask(cli.input, cli.output, { + replace: cli.replace +}); +const parsers = [new PipeParser(), new DirectiveParser(), new ServiceParser(), new MarkerParser()]; +extractTask.setParsers(parsers); +const postProcessors = []; +if (cli.clean) { + postProcessors.push(new PurgeObsoleteKeysPostProcessor()); +} +if (cli.keyAsDefaultValue) { + postProcessors.push(new KeyAsDefaultValuePostProcessor()); +} +else if (cli.nullAsDefaultValue) { + postProcessors.push(new NullAsDefaultValuePostProcessor()); +} +else if (cli.stringAsDefaultValue) { + postProcessors.push(new StringAsDefaultValuePostProcessor({ defaultValue: cli.stringAsDefaultValue })); +} +if (cli.sort) { + postProcessors.push(new SortByKeyPostProcessor()); +} +extractTask.setPostProcessors(postProcessors); +const compiler = CompilerFactory.create(cli.format, { + indentation: cli.formatIndentation +}); +extractTask.setCompiler(compiler); +try { + extractTask.execute(); + console.log(green('\nDone.\n')); + console.log(donateMessage); + process.exit(0); +} +catch (e) { + console.log(red(`\nAn error occurred: ${e}\n`)); + process.exit(1); +} +//# sourceMappingURL=cli.js.map \ No newline at end of file diff --git a/dist/cli/tasks/extract.task.d.ts b/dist/cli/tasks/extract.task.d.ts new file mode 100644 index 00000000..b8c1d670 --- /dev/null +++ b/dist/cli/tasks/extract.task.d.ts @@ -0,0 +1,29 @@ +import { TranslationCollection } from '../../utils/translation.collection.js'; +import { TaskInterface } from './task.interface.js'; +import { ParserInterface } from '../../parsers/parser.interface.js'; +import { PostProcessorInterface } from '../../post-processors/post-processor.interface.js'; +import { CompilerInterface } from '../../compilers/compiler.interface.js'; +export interface ExtractTaskOptionsInterface { + replace?: boolean; +} +export declare class ExtractTask implements TaskInterface { + protected inputs: string[]; + protected outputs: string[]; + protected options: ExtractTaskOptionsInterface; + protected parsers: ParserInterface[]; + protected postProcessors: PostProcessorInterface[]; + protected compiler: CompilerInterface; + constructor(inputs: string[], outputs: string[], options?: ExtractTaskOptionsInterface); + execute(): void; + setParsers(parsers: ParserInterface[]): this; + setPostProcessors(postProcessors: PostProcessorInterface[]): this; + setCompiler(compiler: CompilerInterface): this; + protected extract(): TranslationCollection; + protected process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection; + protected save(output: string, collection: TranslationCollection): void; + protected getFiles(pattern: string): string[]; + protected out(...args: any[]): void; + protected printEnabledParsers(): void; + protected printEnabledPostProcessors(): void; + protected printEnabledCompiler(): void; +} diff --git a/dist/cli/tasks/extract.task.js b/dist/cli/tasks/extract.task.js new file mode 100644 index 00000000..23f06c60 --- /dev/null +++ b/dist/cli/tasks/extract.task.js @@ -0,0 +1,142 @@ +import { TranslationCollection } from '../../utils/translation.collection.js'; +import { cyan, green, bold, dim, red } from 'colorette'; +import pkg from 'glob'; +const { sync } = pkg; +import * as fs from 'fs'; +import * as path from 'path'; +import * as mkdirp from 'mkdirp'; +export class ExtractTask { + inputs; + outputs; + options = { + replace: false + }; + parsers = []; + postProcessors = []; + compiler; + constructor(inputs, outputs, options) { + this.inputs = inputs; + this.outputs = outputs; + this.inputs = inputs.map((input) => path.resolve(input)); + this.outputs = outputs.map((output) => path.resolve(output)); + this.options = { ...this.options, ...options }; + } + execute() { + if (!this.compiler) { + throw new Error('No compiler configured'); + } + this.printEnabledParsers(); + this.printEnabledPostProcessors(); + this.printEnabledCompiler(); + this.out(bold('Extracting:')); + const extracted = this.extract(); + this.out(green(`\nFound %d strings.\n`), extracted.count()); + this.out(bold('Saving:')); + this.outputs.forEach((output) => { + let dir = output; + let filename = `strings.${this.compiler.extension}`; + if (!fs.existsSync(output) || !fs.statSync(output).isDirectory()) { + dir = path.dirname(output); + filename = path.basename(output); + } + const outputPath = path.join(dir, filename); + let existing = new TranslationCollection(); + if (!this.options.replace && fs.existsSync(outputPath)) { + try { + existing = this.compiler.parse(fs.readFileSync(outputPath, 'utf-8')); + } + catch (e) { + this.out(`%s %s`, dim(`- ${outputPath}`), red(`[ERROR]`)); + throw e; + } + } + const draft = extracted.union(existing); + const final = this.process(draft, extracted, existing); + try { + let event = 'CREATED'; + if (fs.existsSync(outputPath)) { + this.options.replace ? (event = 'REPLACED') : (event = 'MERGED'); + } + this.save(outputPath, final); + this.out(`%s %s`, dim(`- ${outputPath}`), green(`[${event}]`)); + } + catch (e) { + this.out(`%s %s`, dim(`- ${outputPath}`), red(`[ERROR]`)); + throw e; + } + }); + } + setParsers(parsers) { + this.parsers = parsers; + return this; + } + setPostProcessors(postProcessors) { + this.postProcessors = postProcessors; + return this; + } + setCompiler(compiler) { + this.compiler = compiler; + return this; + } + extract() { + let collection = new TranslationCollection(); + this.inputs.forEach((pattern) => { + this.getFiles(pattern).forEach((filePath) => { + this.out(dim('- %s'), filePath); + const contents = fs.readFileSync(filePath, 'utf-8'); + this.parsers.forEach((parser) => { + const extracted = parser.extract(contents, filePath); + if (extracted instanceof TranslationCollection) { + collection = collection.union(extracted); + } + }); + }); + }); + return collection; + } + process(draft, extracted, existing) { + this.postProcessors.forEach((postProcessor) => { + draft = postProcessor.process(draft, extracted, existing); + }); + return draft; + } + save(output, collection) { + const dir = path.dirname(output); + if (!fs.existsSync(dir)) { + mkdirp.sync(dir); + } + fs.writeFileSync(output, this.compiler.compile(collection)); + } + getFiles(pattern) { + return sync(pattern).filter((filePath) => fs.statSync(filePath).isFile()); + } + out(...args) { + console.log.apply(this, arguments); + } + printEnabledParsers() { + this.out(cyan('Enabled parsers:')); + if (this.parsers.length) { + this.out(cyan(dim(this.parsers.map((parser) => `- ${parser.constructor.name}`).join('\n')))); + } + else { + this.out(cyan(dim('(none)'))); + } + this.out(); + } + printEnabledPostProcessors() { + this.out(cyan('Enabled post processors:')); + if (this.postProcessors.length) { + this.out(cyan(dim(this.postProcessors.map((postProcessor) => `- ${postProcessor.constructor.name}`).join('\n')))); + } + else { + this.out(cyan(dim('(none)'))); + } + this.out(); + } + printEnabledCompiler() { + this.out(cyan('Compiler:')); + this.out(cyan(dim(`- ${this.compiler.constructor.name}`))); + this.out(); + } +} +//# sourceMappingURL=extract.task.js.map \ No newline at end of file diff --git a/dist/cli/tasks/task.interface.d.ts b/dist/cli/tasks/task.interface.d.ts new file mode 100644 index 00000000..5e1fad7e --- /dev/null +++ b/dist/cli/tasks/task.interface.d.ts @@ -0,0 +1,3 @@ +export interface TaskInterface { + execute(): void; +} diff --git a/dist/cli/tasks/task.interface.js b/dist/cli/tasks/task.interface.js new file mode 100644 index 00000000..9b184e8d --- /dev/null +++ b/dist/cli/tasks/task.interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=task.interface.js.map \ No newline at end of file diff --git a/dist/compilers/compiler.factory.d.ts b/dist/compilers/compiler.factory.d.ts new file mode 100644 index 00000000..8c69bf8e --- /dev/null +++ b/dist/compilers/compiler.factory.d.ts @@ -0,0 +1,4 @@ +import { CompilerInterface } from '../compilers/compiler.interface.js'; +export declare class CompilerFactory { + static create(format: string, options?: {}): CompilerInterface; +} diff --git a/dist/compilers/compiler.factory.js b/dist/compilers/compiler.factory.js new file mode 100644 index 00000000..aa12737d --- /dev/null +++ b/dist/compilers/compiler.factory.js @@ -0,0 +1,18 @@ +import { JsonCompiler } from '../compilers/json.compiler.js'; +import { NamespacedJsonCompiler } from '../compilers/namespaced-json.compiler.js'; +import { PoCompiler } from '../compilers/po.compiler.js'; +export class CompilerFactory { + static create(format, options) { + switch (format) { + case 'pot': + return new PoCompiler(options); + case 'json': + return new JsonCompiler(options); + case 'namespaced-json': + return new NamespacedJsonCompiler(options); + default: + throw new Error(`Unknown format: ${format}`); + } + } +} +//# sourceMappingURL=compiler.factory.js.map \ No newline at end of file diff --git a/dist/compilers/compiler.interface.d.ts b/dist/compilers/compiler.interface.d.ts new file mode 100644 index 00000000..078c663b --- /dev/null +++ b/dist/compilers/compiler.interface.d.ts @@ -0,0 +1,6 @@ +import { TranslationCollection } from '../utils/translation.collection.js'; +export interface CompilerInterface { + extension: string; + compile(collection: TranslationCollection): string; + parse(contents: string): TranslationCollection; +} diff --git a/dist/compilers/compiler.interface.js b/dist/compilers/compiler.interface.js new file mode 100644 index 00000000..8ab82e4e --- /dev/null +++ b/dist/compilers/compiler.interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=compiler.interface.js.map \ No newline at end of file diff --git a/dist/compilers/json.compiler.d.ts b/dist/compilers/json.compiler.d.ts new file mode 100644 index 00000000..ecc6a769 --- /dev/null +++ b/dist/compilers/json.compiler.d.ts @@ -0,0 +1,10 @@ +import { CompilerInterface } from './compiler.interface.js'; +import { TranslationCollection } from '../utils/translation.collection.js'; +export declare class JsonCompiler implements CompilerInterface { + indentation: string; + extension: string; + constructor(options?: any); + compile(collection: TranslationCollection): string; + parse(contents: string): TranslationCollection; + protected isNamespacedJsonFormat(values: any): boolean; +} diff --git a/dist/compilers/json.compiler.js b/dist/compilers/json.compiler.js new file mode 100644 index 00000000..3ca86957 --- /dev/null +++ b/dist/compilers/json.compiler.js @@ -0,0 +1,27 @@ +import { TranslationCollection } from '../utils/translation.collection.js'; +import { stripBOM } from '../utils/utils.js'; +import pkg from 'flat'; +const { flatten } = pkg; +export class JsonCompiler { + indentation = '\t'; + extension = 'json'; + constructor(options) { + if (options && typeof options.indentation !== 'undefined') { + this.indentation = options.indentation; + } + } + compile(collection) { + return JSON.stringify(collection.values, null, this.indentation); + } + parse(contents) { + let values = JSON.parse(stripBOM(contents)); + if (this.isNamespacedJsonFormat(values)) { + values = flatten(values); + } + return new TranslationCollection(values); + } + isNamespacedJsonFormat(values) { + return Object.keys(values).some((key) => typeof values[key] === 'object'); + } +} +//# sourceMappingURL=json.compiler.js.map \ No newline at end of file diff --git a/dist/compilers/namespaced-json.compiler.d.ts b/dist/compilers/namespaced-json.compiler.d.ts new file mode 100644 index 00000000..c6ba59e0 --- /dev/null +++ b/dist/compilers/namespaced-json.compiler.d.ts @@ -0,0 +1,9 @@ +import { CompilerInterface } from './compiler.interface.js'; +import { TranslationCollection } from '../utils/translation.collection.js'; +export declare class NamespacedJsonCompiler implements CompilerInterface { + indentation: string; + extension: string; + constructor(options?: any); + compile(collection: TranslationCollection): string; + parse(contents: string): TranslationCollection; +} diff --git a/dist/compilers/namespaced-json.compiler.js b/dist/compilers/namespaced-json.compiler.js new file mode 100644 index 00000000..446e01a9 --- /dev/null +++ b/dist/compilers/namespaced-json.compiler.js @@ -0,0 +1,24 @@ +import { TranslationCollection } from '../utils/translation.collection.js'; +import { stripBOM } from '../utils/utils.js'; +import pkg from 'flat'; +const { flatten, unflatten } = pkg; +export class NamespacedJsonCompiler { + indentation = '\t'; + extension = 'json'; + constructor(options) { + if (options && typeof options.indentation !== 'undefined') { + this.indentation = options.indentation; + } + } + compile(collection) { + const values = unflatten(collection.values, { + object: true + }); + return JSON.stringify(values, null, this.indentation); + } + parse(contents) { + const values = flatten(JSON.parse(stripBOM(contents))); + return new TranslationCollection(values); + } +} +//# sourceMappingURL=namespaced-json.compiler.js.map \ No newline at end of file diff --git a/dist/compilers/po.compiler.d.ts b/dist/compilers/po.compiler.d.ts new file mode 100644 index 00000000..891c2ce2 --- /dev/null +++ b/dist/compilers/po.compiler.d.ts @@ -0,0 +1,9 @@ +import { CompilerInterface } from './compiler.interface.js'; +import { TranslationCollection } from '../utils/translation.collection.js'; +export declare class PoCompiler implements CompilerInterface { + extension: string; + domain: string; + constructor(options?: any); + compile(collection: TranslationCollection): string; + parse(contents: string): TranslationCollection; +} diff --git a/dist/compilers/po.compiler.js b/dist/compilers/po.compiler.js new file mode 100644 index 00000000..b57a771e --- /dev/null +++ b/dist/compilers/po.compiler.js @@ -0,0 +1,47 @@ +import { TranslationCollection } from '../utils/translation.collection.js'; +import pkg from 'gettext-parser'; +const { po } = pkg; +export class PoCompiler { + extension = 'po'; + domain = ''; + constructor(options) { } + compile(collection) { + const data = { + charset: 'utf-8', + headers: { + 'mime-version': '1.0', + 'content-type': 'text/plain; charset=utf-8', + 'content-transfer-encoding': '8bit' + }, + translations: { + [this.domain]: Object.keys(collection.values).reduce((translations, key) => { + return { + ...translations, + [key]: { + msgid: key, + msgstr: collection.get(key) + } + }; + }, {}) + } + }; + return po.compile(data).toString('utf8'); + } + parse(contents) { + const collection = new TranslationCollection(); + const parsedPo = po.parse(contents, 'utf8'); + if (!parsedPo.translations.hasOwnProperty(this.domain)) { + return collection; + } + const values = Object.keys(parsedPo.translations[this.domain]) + .filter((key) => key.length > 0) + .reduce((result, key) => { + return { + ...result, + [key]: parsedPo.translations[this.domain][key].msgstr.pop() + }; + }, {}); + return new TranslationCollection(values); + } +} +//# sourceMappingURL=po.compiler.js.map \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 00000000..60ac036f --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,19 @@ +export * from './utils/translation.collection.js'; +export * from './utils/utils.js'; +export * from './cli/cli.js'; +export * from './cli/tasks/task.interface.js'; +export * from './cli/tasks/extract.task.js'; +export * from './parsers/parser.interface.js'; +export * from './parsers/directive.parser.js'; +export * from './parsers/pipe.parser.js'; +export * from './parsers/service.parser.js'; +export * from './parsers/marker.parser.js'; +export * from './compilers/compiler.interface.js'; +export * from './compilers/compiler.factory.js'; +export * from './compilers/json.compiler.js'; +export * from './compilers/namespaced-json.compiler.js'; +export * from './compilers/po.compiler.js'; +export * from './post-processors/post-processor.interface.js'; +export * from './post-processors/key-as-default-value.post-processor.js'; +export * from './post-processors/purge-obsolete-keys.post-processor.js'; +export * from './post-processors/sort-by-key.post-processor.js'; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 00000000..a8ed0697 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,20 @@ +export * from './utils/translation.collection.js'; +export * from './utils/utils.js'; +export * from './cli/cli.js'; +export * from './cli/tasks/task.interface.js'; +export * from './cli/tasks/extract.task.js'; +export * from './parsers/parser.interface.js'; +export * from './parsers/directive.parser.js'; +export * from './parsers/pipe.parser.js'; +export * from './parsers/service.parser.js'; +export * from './parsers/marker.parser.js'; +export * from './compilers/compiler.interface.js'; +export * from './compilers/compiler.factory.js'; +export * from './compilers/json.compiler.js'; +export * from './compilers/namespaced-json.compiler.js'; +export * from './compilers/po.compiler.js'; +export * from './post-processors/post-processor.interface.js'; +export * from './post-processors/key-as-default-value.post-processor.js'; +export * from './post-processors/purge-obsolete-keys.post-processor.js'; +export * from './post-processors/sort-by-key.post-processor.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/parsers/directive.parser.d.ts b/dist/parsers/directive.parser.d.ts new file mode 100644 index 00000000..3559b925 --- /dev/null +++ b/dist/parsers/directive.parser.d.ts @@ -0,0 +1,18 @@ +import { TmplAstNode as Node, TmplAstElement as Element, TmplAstText as Text, TmplAstTemplate as Template, TmplAstTextAttribute as TextAttribute, TmplAstBoundAttribute as BoundAttribute, AST, LiteralPrimitive } from '@angular/compiler'; +import { ParserInterface } from './parser.interface.js'; +import { TranslationCollection } from '../utils/translation.collection.js'; +declare type ElementLike = Element | Template; +export declare class DirectiveParser implements ParserInterface { + extract(source: string, filePath: string): TranslationCollection | null; + protected getElementsWithTranslateAttribute(nodes: Node[]): ElementLike[]; + protected getTextNodes(element: ElementLike): Text[]; + protected hasAttribute(element: ElementLike, name: string): boolean; + protected getAttribute(element: ElementLike, name: string): TextAttribute; + protected hasBoundAttribute(element: ElementLike, name: string): boolean; + protected getBoundAttribute(element: ElementLike, name: string): BoundAttribute; + protected getLiteralPrimitives(exp: AST): LiteralPrimitive[]; + protected isElementLike(node: Node): node is ElementLike; + protected isText(node: Node): node is Text; + protected parseTemplate(template: string, path: string): Node[]; +} +export {}; diff --git a/dist/parsers/directive.parser.js b/dist/parsers/directive.parser.js new file mode 100644 index 00000000..e6f20afb --- /dev/null +++ b/dist/parsers/directive.parser.js @@ -0,0 +1,106 @@ +import { parseTemplate, TmplAstElement as Element, TmplAstText as Text, TmplAstTemplate as Template, ASTWithSource, LiteralPrimitive, Conditional, Binary, BindingPipe, Interpolation, LiteralArray, LiteralMap } from '@angular/compiler'; +import { TranslationCollection } from '../utils/translation.collection.js'; +import { isPathAngularComponent, extractComponentInlineTemplate } from '../utils/utils.js'; +const TRANSLATE_ATTR_NAME = 'translate'; +export class DirectiveParser { + extract(source, filePath) { + let collection = new TranslationCollection(); + if (filePath && isPathAngularComponent(filePath)) { + source = extractComponentInlineTemplate(source); + } + const nodes = this.parseTemplate(source, filePath); + const elements = this.getElementsWithTranslateAttribute(nodes); + elements.forEach((element) => { + const attribute = this.getAttribute(element, TRANSLATE_ATTR_NAME); + if (attribute?.value) { + collection = collection.add(attribute.value); + return; + } + const boundAttribute = this.getBoundAttribute(element, TRANSLATE_ATTR_NAME); + if (boundAttribute?.value) { + this.getLiteralPrimitives(boundAttribute.value).forEach((literalPrimitive) => { + collection = collection.add(literalPrimitive.value); + }); + return; + } + const textNodes = this.getTextNodes(element); + textNodes.forEach((textNode) => { + collection = collection.add(textNode.value.trim()); + }); + }); + return collection; + } + getElementsWithTranslateAttribute(nodes) { + let elements = []; + nodes.filter(this.isElementLike).forEach((element) => { + if (this.hasAttribute(element, TRANSLATE_ATTR_NAME)) { + elements = [...elements, element]; + } + if (this.hasBoundAttribute(element, TRANSLATE_ATTR_NAME)) { + elements = [...elements, element]; + } + const childElements = this.getElementsWithTranslateAttribute(element.children); + if (childElements.length) { + elements = [...elements, ...childElements]; + } + }); + return elements; + } + getTextNodes(element) { + return element.children.filter(this.isText); + } + hasAttribute(element, name) { + return this.getAttribute(element, name) !== undefined; + } + getAttribute(element, name) { + return element.attributes.find((attribute) => attribute.name === name); + } + hasBoundAttribute(element, name) { + return this.getBoundAttribute(element, name) !== undefined; + } + getBoundAttribute(element, name) { + return element.inputs.find((input) => input.name === name); + } + getLiteralPrimitives(exp) { + if (exp instanceof LiteralPrimitive) { + return [exp]; + } + let visit = []; + if (exp instanceof Interpolation) { + visit = exp.expressions; + } + else if (exp instanceof LiteralArray) { + visit = exp.expressions; + } + else if (exp instanceof LiteralMap) { + visit = exp.values; + } + else if (exp instanceof BindingPipe) { + visit = [exp.exp]; + } + else if (exp instanceof Conditional) { + visit = [exp.trueExp, exp.falseExp]; + } + else if (exp instanceof Binary) { + visit = [exp.left, exp.right]; + } + else if (exp instanceof ASTWithSource) { + visit = [exp.ast]; + } + let results = []; + visit.forEach((child) => { + results = [...results, ...this.getLiteralPrimitives(child)]; + }); + return results; + } + isElementLike(node) { + return node instanceof Element || node instanceof Template; + } + isText(node) { + return node instanceof Text; + } + parseTemplate(template, path) { + return parseTemplate(template, path).nodes; + } +} +//# sourceMappingURL=directive.parser.js.map \ No newline at end of file diff --git a/dist/parsers/marker.parser.d.ts b/dist/parsers/marker.parser.d.ts new file mode 100644 index 00000000..ea8043e5 --- /dev/null +++ b/dist/parsers/marker.parser.d.ts @@ -0,0 +1,5 @@ +import { ParserInterface } from './parser.interface.js'; +import { TranslationCollection } from '../utils/translation.collection.js'; +export declare class MarkerParser implements ParserInterface { + extract(source: string, filePath: string): TranslationCollection | null; +} diff --git a/dist/parsers/marker.parser.js b/dist/parsers/marker.parser.js new file mode 100644 index 00000000..519f0ede --- /dev/null +++ b/dist/parsers/marker.parser.js @@ -0,0 +1,26 @@ +import { tsquery } from '@phenomnomnominal/tsquery'; +import { TranslationCollection } from '../utils/translation.collection.js'; +import { getNamedImportAlias, findFunctionCallExpressions, getStringsFromExpression } from '../utils/ast-helpers.js'; +const MARKER_MODULE_NAME = '@biesbjerg/ngx-translate-extract-marker'; +const MARKER_IMPORT_NAME = 'marker'; +export class MarkerParser { + extract(source, filePath) { + const sourceFile = tsquery.ast(source, filePath); + const markerImportName = getNamedImportAlias(sourceFile, MARKER_MODULE_NAME, MARKER_IMPORT_NAME); + if (!markerImportName) { + return null; + } + let collection = new TranslationCollection(); + const callExpressions = findFunctionCallExpressions(sourceFile, markerImportName); + callExpressions.forEach((callExpression) => { + const [firstArg] = callExpression.arguments; + if (!firstArg) { + return; + } + const strings = getStringsFromExpression(firstArg); + collection = collection.addKeys(strings); + }); + return collection; + } +} +//# sourceMappingURL=marker.parser.js.map \ No newline at end of file diff --git a/dist/parsers/parser.interface.d.ts b/dist/parsers/parser.interface.d.ts new file mode 100644 index 00000000..f958fd5a --- /dev/null +++ b/dist/parsers/parser.interface.d.ts @@ -0,0 +1,4 @@ +import { TranslationCollection } from '../utils/translation.collection.js'; +export interface ParserInterface { + extract(source: string, filePath: string): TranslationCollection | null; +} diff --git a/dist/parsers/parser.interface.js b/dist/parsers/parser.interface.js new file mode 100644 index 00000000..883cae22 --- /dev/null +++ b/dist/parsers/parser.interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=parser.interface.js.map \ No newline at end of file diff --git a/dist/parsers/pipe.parser.d.ts b/dist/parsers/pipe.parser.d.ts new file mode 100644 index 00000000..78c8a520 --- /dev/null +++ b/dist/parsers/pipe.parser.d.ts @@ -0,0 +1,13 @@ +import { AST, TmplAstNode, BindingPipe, LiteralPrimitive, Conditional } from '@angular/compiler'; +import { ParserInterface } from './parser.interface.js'; +import { TranslationCollection } from '../utils/translation.collection.js'; +export declare class PipeParser implements ParserInterface { + extract(source: string, filePath: string): TranslationCollection | null; + protected findPipesInNode(node: any): BindingPipe[]; + protected parseTranslationKeysFromPipe(pipeContent: BindingPipe | LiteralPrimitive | Conditional): string[]; + protected getTranslatablesFromAst(ast: AST): BindingPipe[]; + protected getTranslatablesFromAsts(asts: AST[]): BindingPipe[]; + protected flatten(array: T[][]): T[]; + protected expressionIsOrHasBindingPipe(exp: any): exp is BindingPipe; + protected parseTemplate(template: string, path: string): TmplAstNode[]; +} diff --git a/dist/parsers/pipe.parser.js b/dist/parsers/pipe.parser.js new file mode 100644 index 00000000..555047b8 --- /dev/null +++ b/dist/parsers/pipe.parser.js @@ -0,0 +1,108 @@ +import { parseTemplate, BindingPipe, LiteralPrimitive, Conditional, Binary, LiteralMap, LiteralArray, Interpolation, Call } from '@angular/compiler'; +import { TranslationCollection } from '../utils/translation.collection.js'; +import { isPathAngularComponent, extractComponentInlineTemplate } from '../utils/utils.js'; +const TRANSLATE_PIPE_NAME = 'translate'; +export class PipeParser { + extract(source, filePath) { + if (filePath && isPathAngularComponent(filePath)) { + source = extractComponentInlineTemplate(source); + } + let collection = new TranslationCollection(); + const nodes = this.parseTemplate(source, filePath); + const pipes = nodes.map((node) => this.findPipesInNode(node)).flat(); + pipes.forEach((pipe) => { + this.parseTranslationKeysFromPipe(pipe).forEach((key) => { + collection = collection.add(key); + }); + }); + return collection; + } + findPipesInNode(node) { + let ret = []; + if (node?.children) { + ret = node.children.reduce((result, childNode) => { + const children = this.findPipesInNode(childNode); + return result.concat(children); + }, [ret]); + } + if (node?.value?.ast) { + ret.push(...this.getTranslatablesFromAst(node.value.ast)); + } + if (node?.attributes) { + const translateableAttributes = node.attributes.filter((attr) => { + return attr.name === TRANSLATE_PIPE_NAME; + }); + ret = [...ret, ...translateableAttributes]; + } + if (node?.inputs) { + node.inputs.forEach((input) => { + if (input?.value?.ast) { + ret.push(...this.getTranslatablesFromAst(input.value.ast)); + } + }); + } + return ret; + } + parseTranslationKeysFromPipe(pipeContent) { + const ret = []; + if (pipeContent instanceof LiteralPrimitive) { + ret.push(pipeContent.value); + } + else if (pipeContent instanceof Conditional) { + const trueExp = pipeContent.trueExp; + ret.push(...this.parseTranslationKeysFromPipe(trueExp)); + const falseExp = pipeContent.falseExp; + ret.push(...this.parseTranslationKeysFromPipe(falseExp)); + } + else if (pipeContent instanceof BindingPipe) { + ret.push(...this.parseTranslationKeysFromPipe(pipeContent.exp)); + } + return ret; + } + getTranslatablesFromAst(ast) { + if (this.expressionIsOrHasBindingPipe(ast)) { + return [ast]; + } + if (ast instanceof Interpolation) { + return this.getTranslatablesFromAsts(ast.expressions); + } + if (ast instanceof Conditional) { + return this.getTranslatablesFromAsts([ast.trueExp, ast.falseExp]); + } + if (ast instanceof Binary) { + return this.getTranslatablesFromAsts([ast.left, ast.right]); + } + if (ast instanceof BindingPipe) { + return this.getTranslatablesFromAst(ast.exp); + } + if (ast instanceof LiteralMap) { + return this.getTranslatablesFromAsts(ast.values); + } + if (ast instanceof LiteralArray) { + return this.getTranslatablesFromAsts(ast.expressions); + } + if (ast instanceof Call) { + return this.getTranslatablesFromAsts(ast.args); + } + return []; + } + getTranslatablesFromAsts(asts) { + return this.flatten(asts.map((ast) => this.getTranslatablesFromAst(ast))); + } + flatten(array) { + return [].concat(...array); + } + expressionIsOrHasBindingPipe(exp) { + if (exp.name && exp.name === TRANSLATE_PIPE_NAME) { + return true; + } + if (exp.exp && exp.exp instanceof BindingPipe) { + return this.expressionIsOrHasBindingPipe(exp.exp); + } + return false; + } + parseTemplate(template, path) { + return parseTemplate(template, path).nodes; + } +} +//# sourceMappingURL=pipe.parser.js.map \ No newline at end of file diff --git a/dist/parsers/service.parser.d.ts b/dist/parsers/service.parser.d.ts new file mode 100644 index 00000000..149a7431 --- /dev/null +++ b/dist/parsers/service.parser.d.ts @@ -0,0 +1,8 @@ +import { ClassDeclaration, CallExpression } from 'typescript'; +import { ParserInterface } from './parser.interface.js'; +import { TranslationCollection } from '../utils/translation.collection.js'; +export declare class ServiceParser implements ParserInterface { + extract(source: string, filePath: string): TranslationCollection | null; + protected findConstructorParamCallExpressions(classDeclaration: ClassDeclaration): CallExpression[]; + protected findPropertyCallExpressions(classDeclaration: ClassDeclaration): CallExpression[]; +} diff --git a/dist/parsers/service.parser.js b/dist/parsers/service.parser.js new file mode 100644 index 00000000..35209142 --- /dev/null +++ b/dist/parsers/service.parser.js @@ -0,0 +1,46 @@ +import { tsquery } from '@phenomnomnominal/tsquery'; +import { TranslationCollection } from '../utils/translation.collection.js'; +import { findClassDeclarations, findClassPropertyByType, findPropertyCallExpressions, findMethodCallExpressions, getStringsFromExpression, findMethodParameterByType, findConstructorDeclaration } from '../utils/ast-helpers.js'; +const TRANSLATE_SERVICE_TYPE_REFERENCE = 'TranslateService'; +const TRANSLATE_SERVICE_METHOD_NAMES = ['get', 'instant', 'stream']; +export class ServiceParser { + extract(source, filePath) { + const sourceFile = tsquery.ast(source, filePath); + const classDeclarations = findClassDeclarations(sourceFile); + if (!classDeclarations) { + return null; + } + let collection = new TranslationCollection(); + classDeclarations.forEach((classDeclaration) => { + const callExpressions = [ + ...this.findConstructorParamCallExpressions(classDeclaration), + ...this.findPropertyCallExpressions(classDeclaration) + ]; + callExpressions.forEach((callExpression) => { + const [firstArg] = callExpression.arguments; + if (!firstArg) { + return; + } + const strings = getStringsFromExpression(firstArg); + collection = collection.addKeys(strings); + }); + }); + return collection; + } + findConstructorParamCallExpressions(classDeclaration) { + const constructorDeclaration = findConstructorDeclaration(classDeclaration); + if (!constructorDeclaration) { + return []; + } + const paramName = findMethodParameterByType(constructorDeclaration, TRANSLATE_SERVICE_TYPE_REFERENCE); + return findMethodCallExpressions(constructorDeclaration, paramName, TRANSLATE_SERVICE_METHOD_NAMES); + } + findPropertyCallExpressions(classDeclaration) { + const propName = findClassPropertyByType(classDeclaration, TRANSLATE_SERVICE_TYPE_REFERENCE); + if (!propName) { + return []; + } + return findPropertyCallExpressions(classDeclaration, propName, TRANSLATE_SERVICE_METHOD_NAMES); + } +} +//# sourceMappingURL=service.parser.js.map \ No newline at end of file diff --git a/dist/post-processors/key-as-default-value.post-processor.d.ts b/dist/post-processors/key-as-default-value.post-processor.d.ts new file mode 100644 index 00000000..1d4b8db2 --- /dev/null +++ b/dist/post-processors/key-as-default-value.post-processor.d.ts @@ -0,0 +1,6 @@ +import { TranslationCollection } from '../utils/translation.collection.js'; +import { PostProcessorInterface } from './post-processor.interface.js'; +export declare class KeyAsDefaultValuePostProcessor implements PostProcessorInterface { + name: string; + process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection; +} diff --git a/dist/post-processors/key-as-default-value.post-processor.js b/dist/post-processors/key-as-default-value.post-processor.js new file mode 100644 index 00000000..f8143b14 --- /dev/null +++ b/dist/post-processors/key-as-default-value.post-processor.js @@ -0,0 +1,7 @@ +export class KeyAsDefaultValuePostProcessor { + name = 'KeyAsDefaultValue'; + process(draft, extracted, existing) { + return draft.map((key, val) => (val === '' ? key : val)); + } +} +//# sourceMappingURL=key-as-default-value.post-processor.js.map \ No newline at end of file diff --git a/dist/post-processors/null-as-default-value.post-processor.d.ts b/dist/post-processors/null-as-default-value.post-processor.d.ts new file mode 100644 index 00000000..a4fec4fc --- /dev/null +++ b/dist/post-processors/null-as-default-value.post-processor.d.ts @@ -0,0 +1,6 @@ +import { TranslationCollection } from '../utils/translation.collection.js'; +import { PostProcessorInterface } from './post-processor.interface.js'; +export declare class NullAsDefaultValuePostProcessor implements PostProcessorInterface { + name: string; + process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection; +} diff --git a/dist/post-processors/null-as-default-value.post-processor.js b/dist/post-processors/null-as-default-value.post-processor.js new file mode 100644 index 00000000..c2f797c7 --- /dev/null +++ b/dist/post-processors/null-as-default-value.post-processor.js @@ -0,0 +1,7 @@ +export class NullAsDefaultValuePostProcessor { + name = 'NullAsDefaultValue'; + process(draft, extracted, existing) { + return draft.map((key, val) => (existing.get(key) === undefined ? null : val)); + } +} +//# sourceMappingURL=null-as-default-value.post-processor.js.map \ No newline at end of file diff --git a/dist/post-processors/post-processor.interface.d.ts b/dist/post-processors/post-processor.interface.d.ts new file mode 100644 index 00000000..4ee831cc --- /dev/null +++ b/dist/post-processors/post-processor.interface.d.ts @@ -0,0 +1,5 @@ +import { TranslationCollection } from '../utils/translation.collection.js'; +export interface PostProcessorInterface { + name: string; + process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection; +} diff --git a/dist/post-processors/post-processor.interface.js b/dist/post-processors/post-processor.interface.js new file mode 100644 index 00000000..6b1662d0 --- /dev/null +++ b/dist/post-processors/post-processor.interface.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=post-processor.interface.js.map \ No newline at end of file diff --git a/dist/post-processors/purge-obsolete-keys.post-processor.d.ts b/dist/post-processors/purge-obsolete-keys.post-processor.d.ts new file mode 100644 index 00000000..237d0d7a --- /dev/null +++ b/dist/post-processors/purge-obsolete-keys.post-processor.d.ts @@ -0,0 +1,6 @@ +import { TranslationCollection } from '../utils/translation.collection.js'; +import { PostProcessorInterface } from './post-processor.interface.js'; +export declare class PurgeObsoleteKeysPostProcessor implements PostProcessorInterface { + name: string; + process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection; +} diff --git a/dist/post-processors/purge-obsolete-keys.post-processor.js b/dist/post-processors/purge-obsolete-keys.post-processor.js new file mode 100644 index 00000000..4fee0b51 --- /dev/null +++ b/dist/post-processors/purge-obsolete-keys.post-processor.js @@ -0,0 +1,7 @@ +export class PurgeObsoleteKeysPostProcessor { + name = 'PurgeObsoleteKeys'; + process(draft, extracted, existing) { + return draft.intersect(extracted); + } +} +//# sourceMappingURL=purge-obsolete-keys.post-processor.js.map \ No newline at end of file diff --git a/dist/post-processors/sort-by-key.post-processor.d.ts b/dist/post-processors/sort-by-key.post-processor.d.ts new file mode 100644 index 00000000..78343218 --- /dev/null +++ b/dist/post-processors/sort-by-key.post-processor.d.ts @@ -0,0 +1,6 @@ +import { TranslationCollection } from '../utils/translation.collection.js'; +import { PostProcessorInterface } from './post-processor.interface.js'; +export declare class SortByKeyPostProcessor implements PostProcessorInterface { + name: string; + process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection; +} diff --git a/dist/post-processors/sort-by-key.post-processor.js b/dist/post-processors/sort-by-key.post-processor.js new file mode 100644 index 00000000..6a02b4bf --- /dev/null +++ b/dist/post-processors/sort-by-key.post-processor.js @@ -0,0 +1,7 @@ +export class SortByKeyPostProcessor { + name = 'SortByKey'; + process(draft, extracted, existing) { + return draft.sort(); + } +} +//# sourceMappingURL=sort-by-key.post-processor.js.map \ No newline at end of file diff --git a/dist/post-processors/string-as-default-value.post-processor.d.ts b/dist/post-processors/string-as-default-value.post-processor.d.ts new file mode 100644 index 00000000..c49c05ab --- /dev/null +++ b/dist/post-processors/string-as-default-value.post-processor.d.ts @@ -0,0 +1,12 @@ +import { TranslationCollection } from '../utils/translation.collection.js'; +import { PostProcessorInterface } from './post-processor.interface.js'; +interface Options { + defaultValue: string; +} +export declare class StringAsDefaultValuePostProcessor implements PostProcessorInterface { + protected options: Options; + name: string; + constructor(options: Options); + process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection; +} +export {}; diff --git a/dist/post-processors/string-as-default-value.post-processor.js b/dist/post-processors/string-as-default-value.post-processor.js new file mode 100644 index 00000000..80c38301 --- /dev/null +++ b/dist/post-processors/string-as-default-value.post-processor.js @@ -0,0 +1,11 @@ +export class StringAsDefaultValuePostProcessor { + options; + name = 'StringAsDefaultValue'; + constructor(options) { + this.options = options; + } + process(draft, extracted, existing) { + return draft.map((key, val) => (existing.get(key) === undefined ? this.options.defaultValue : val)); + } +} +//# sourceMappingURL=string-as-default-value.post-processor.js.map \ No newline at end of file diff --git a/dist/utils/ast-helpers.d.ts b/dist/utils/ast-helpers.d.ts new file mode 100644 index 00000000..bd0612ee --- /dev/null +++ b/dist/utils/ast-helpers.d.ts @@ -0,0 +1,13 @@ +import { Node, NamedImports, ClassDeclaration, ConstructorDeclaration, CallExpression, Expression } from 'typescript'; +export declare function getNamedImports(node: Node, moduleName: string): NamedImports[]; +export declare function getNamedImportAlias(node: Node, moduleName: string, importName: string): string | null; +export declare function findClassDeclarations(node: Node): ClassDeclaration[]; +export declare function findClassPropertyByType(node: ClassDeclaration, type: string): string | null; +export declare function findConstructorDeclaration(node: ClassDeclaration): ConstructorDeclaration; +export declare function findMethodParameterByType(node: Node, type: string): string | null; +export declare function findMethodCallExpressions(node: Node, propName: string, fnName: string | string[]): CallExpression[]; +export declare function findClassPropertyConstructorParameterByType(node: ClassDeclaration, type: string): string | null; +export declare function findClassPropertyDeclarationByType(node: ClassDeclaration, type: string): string | null; +export declare function findFunctionCallExpressions(node: Node, fnName: string | string[]): CallExpression[]; +export declare function findPropertyCallExpressions(node: Node, prop: string, fnName: string | string[]): CallExpression[]; +export declare function getStringsFromExpression(expression: Expression): string[]; diff --git a/dist/utils/ast-helpers.js b/dist/utils/ast-helpers.js new file mode 100644 index 00000000..4c76b4c5 --- /dev/null +++ b/dist/utils/ast-helpers.js @@ -0,0 +1,126 @@ +import { tsquery } from '@phenomnomnominal/tsquery'; +import pkg from 'typescript'; +const { SyntaxKind, isStringLiteralLike, isArrayLiteralExpression, isBinaryExpression, isConditionalExpression } = pkg; +export function getNamedImports(node, moduleName) { + const query = `ImportDeclaration[moduleSpecifier.text="${moduleName}"] NamedImports`; + return tsquery(node, query); +} +export function getNamedImportAlias(node, moduleName, importName) { + const [namedImportNode] = getNamedImports(node, moduleName); + if (!namedImportNode) { + return null; + } + const query = `ImportSpecifier:has(Identifier[name="${importName}"]) > Identifier`; + const identifiers = tsquery(namedImportNode, query); + if (identifiers.length === 1) { + return identifiers[0].text; + } + if (identifiers.length > 1) { + return identifiers[identifiers.length - 1].text; + } + return null; +} +export function findClassDeclarations(node) { + const query = 'ClassDeclaration'; + return tsquery(node, query); +} +export function findClassPropertyByType(node, type) { + return findClassPropertyConstructorParameterByType(node, type) || findClassPropertyDeclarationByType(node, type); +} +export function findConstructorDeclaration(node) { + const query = `Constructor`; + const [result] = tsquery(node, query); + return result; +} +export function findMethodParameterByType(node, type) { + const query = `Parameter:has(TypeReference > Identifier[name="${type}"]) > Identifier`; + const [result] = tsquery(node, query); + if (result) { + return result.text; + } + return null; +} +export function findMethodCallExpressions(node, propName, fnName) { + if (Array.isArray(fnName)) { + fnName = fnName.join('|'); + } + const query = `CallExpression > PropertyAccessExpression:has(Identifier[name=/^(${fnName})$/]):has(PropertyAccessExpression:has(Identifier[name="${propName}"]):not(:has(ThisKeyword)))`; + const nodes = tsquery(node, query).map((n) => n.parent); + return nodes; +} +export function findClassPropertyConstructorParameterByType(node, type) { + const query = `Constructor Parameter:has(TypeReference > Identifier[name="${type}"]):has(PublicKeyword,ProtectedKeyword,PrivateKeyword) > Identifier`; + const [result] = tsquery(node, query); + if (result) { + return result.text; + } + return null; +} +export function findClassPropertyDeclarationByType(node, type) { + const query = `PropertyDeclaration:has(TypeReference > Identifier[name="${type}"]) > Identifier`; + const [result] = tsquery(node, query); + if (result) { + return result.text; + } + return null; +} +export function findFunctionCallExpressions(node, fnName) { + if (Array.isArray(fnName)) { + fnName = fnName.join('|'); + } + const query = `CallExpression:has(Identifier[name="${fnName}"]):not(:has(PropertyAccessExpression))`; + const nodes = tsquery(node, query); + return nodes; +} +export function findPropertyCallExpressions(node, prop, fnName) { + if (Array.isArray(fnName)) { + fnName = fnName.join('|'); + } + const query = `CallExpression > PropertyAccessExpression:has(Identifier[name=/^(${fnName})$/]):has(PropertyAccessExpression:has(Identifier[name="${prop}"]):has(ThisKeyword))`; + const nodes = tsquery(node, query).map((n) => n.parent); + return nodes; +} +export function getStringsFromExpression(expression) { + if (isStringLiteralLike(expression)) { + return [expression.text]; + } + if (isArrayLiteralExpression(expression)) { + return expression.elements.reduce((result, element) => { + const strings = getStringsFromExpression(element); + return [...result, ...strings]; + }, []); + } + if (isBinaryExpression(expression)) { + const [left] = getStringsFromExpression(expression.left); + const [right] = getStringsFromExpression(expression.right); + if (expression.operatorToken.kind === SyntaxKind.PlusToken) { + if (typeof left === 'string' && typeof right === 'string') { + return [left + right]; + } + } + if (expression.operatorToken.kind === SyntaxKind.BarBarToken) { + const result = []; + if (typeof left === 'string') { + result.push(left); + } + if (typeof right === 'string') { + result.push(right); + } + return result; + } + } + if (isConditionalExpression(expression)) { + const [whenTrue] = getStringsFromExpression(expression.whenTrue); + const [whenFalse] = getStringsFromExpression(expression.whenFalse); + const result = []; + if (typeof whenTrue === 'string') { + result.push(whenTrue); + } + if (typeof whenFalse === 'string') { + result.push(whenFalse); + } + return result; + } + return []; +} +//# sourceMappingURL=ast-helpers.js.map \ No newline at end of file diff --git a/dist/utils/donate.d.ts b/dist/utils/donate.d.ts new file mode 100644 index 00000000..5bab0aed --- /dev/null +++ b/dist/utils/donate.d.ts @@ -0,0 +1 @@ +export declare const donateMessage: string; diff --git a/dist/utils/donate.js b/dist/utils/donate.js new file mode 100644 index 00000000..4bfe4915 --- /dev/null +++ b/dist/utils/donate.js @@ -0,0 +1,16 @@ +import { yellow } from 'colorette'; +import boxen from 'boxen'; +import terminalLink from 'terminal-link'; +const url = 'https://donate.biesbjerg.com'; +const link = terminalLink(url, url); +const message = ` +If this tool saves you or your company time, please consider making a +donation to support my work and the continued maintainence and development: + +${yellow(link)}`; +export const donateMessage = boxen(message.trim(), { + padding: 1, + margin: 0, + dimBorder: true +}); +//# sourceMappingURL=donate.js.map \ No newline at end of file diff --git a/dist/utils/fs-helpers.d.ts b/dist/utils/fs-helpers.d.ts new file mode 100644 index 00000000..9ca29b78 --- /dev/null +++ b/dist/utils/fs-helpers.d.ts @@ -0,0 +1,8 @@ +declare module 'braces' { + interface Options { + keepEscaping?: boolean; + } +} +export declare function normalizeHomeDir(path: string): string; +export declare function expandPattern(pattern: string): string[]; +export declare function normalizePaths(patterns: string[], defaultPatterns?: string[]): string[]; diff --git a/dist/utils/fs-helpers.js b/dist/utils/fs-helpers.js new file mode 100644 index 00000000..2d4f593f --- /dev/null +++ b/dist/utils/fs-helpers.js @@ -0,0 +1,26 @@ +import * as os from 'os'; +import * as fs from 'fs'; +import braces from 'braces'; +export function normalizeHomeDir(path) { + if (path.substring(0, 1) === '~') { + return `${os.homedir()}/${path.substring(1)}`; + } + return path; +} +export function expandPattern(pattern) { + return braces(pattern, { expand: true, keepEscaping: true }); +} +export function normalizePaths(patterns, defaultPatterns = []) { + return patterns + .map((pattern) => expandPattern(pattern) + .map((path) => { + path = normalizeHomeDir(path); + if (fs.existsSync(path) && fs.statSync(path).isDirectory()) { + return defaultPatterns.map((defaultPattern) => path + defaultPattern); + } + return path; + }) + .flat()) + .flat(); +} +//# sourceMappingURL=fs-helpers.js.map \ No newline at end of file diff --git a/dist/utils/translation.collection.d.ts b/dist/utils/translation.collection.d.ts new file mode 100644 index 00000000..6a2ed114 --- /dev/null +++ b/dist/utils/translation.collection.d.ts @@ -0,0 +1,21 @@ +export interface TranslationType { + [key: string]: string; +} +export declare class TranslationCollection { + values: TranslationType; + constructor(values?: TranslationType); + add(key: string, val?: string): TranslationCollection; + addKeys(keys: string[]): TranslationCollection; + remove(key: string): TranslationCollection; + forEach(callback: (key?: string, val?: string) => void): TranslationCollection; + filter(callback: (key?: string, val?: string) => boolean): TranslationCollection; + map(callback: (key?: string, val?: string) => string): TranslationCollection; + union(collection: TranslationCollection): TranslationCollection; + intersect(collection: TranslationCollection): TranslationCollection; + has(key: string): boolean; + get(key: string): string; + keys(): string[]; + count(): number; + isEmpty(): boolean; + sort(compareFn?: (a: string, b: string) => number): TranslationCollection; +} diff --git a/dist/utils/translation.collection.js b/dist/utils/translation.collection.js new file mode 100644 index 00000000..6e4097ac --- /dev/null +++ b/dist/utils/translation.collection.js @@ -0,0 +1,73 @@ +export class TranslationCollection { + values = {}; + constructor(values = {}) { + this.values = values; + } + add(key, val = '') { + return new TranslationCollection({ ...this.values, [key]: val }); + } + addKeys(keys) { + const values = keys.reduce((results, key) => { + return { ...results, [key]: '' }; + }, {}); + return new TranslationCollection({ ...this.values, ...values }); + } + remove(key) { + return this.filter((k) => key !== k); + } + forEach(callback) { + Object.keys(this.values).forEach((key) => callback.call(this, key, this.values[key])); + return this; + } + filter(callback) { + const values = {}; + this.forEach((key, val) => { + if (callback.call(this, key, val)) { + values[key] = val; + } + }); + return new TranslationCollection(values); + } + map(callback) { + const values = {}; + this.forEach((key, val) => { + values[key] = callback.call(this, key, val); + }); + return new TranslationCollection(values); + } + union(collection) { + return new TranslationCollection({ ...this.values, ...collection.values }); + } + intersect(collection) { + const values = {}; + this.filter((key) => collection.has(key)).forEach((key, val) => { + values[key] = val; + }); + return new TranslationCollection(values); + } + has(key) { + return this.values.hasOwnProperty(key); + } + get(key) { + return this.values[key]; + } + keys() { + return Object.keys(this.values); + } + count() { + return Object.keys(this.values).length; + } + isEmpty() { + return Object.keys(this.values).length === 0; + } + sort(compareFn) { + const values = {}; + this.keys() + .sort(compareFn) + .forEach((key) => { + values[key] = this.get(key); + }); + return new TranslationCollection(values); + } +} +//# sourceMappingURL=translation.collection.js.map \ No newline at end of file diff --git a/dist/utils/utils.d.ts b/dist/utils/utils.d.ts new file mode 100644 index 00000000..f5f2b004 --- /dev/null +++ b/dist/utils/utils.d.ts @@ -0,0 +1,3 @@ +export declare function isPathAngularComponent(path: string): boolean; +export declare function extractComponentInlineTemplate(contents: string): string; +export declare function stripBOM(contents: string): string; diff --git a/dist/utils/utils.js b/dist/utils/utils.js new file mode 100644 index 00000000..29f927cf --- /dev/null +++ b/dist/utils/utils.js @@ -0,0 +1,15 @@ +export function isPathAngularComponent(path) { + return /\.ts|js$/i.test(path); +} +export function extractComponentInlineTemplate(contents) { + const regExp = /template\s*:\s*(["'`])([^\1]*?)\1/; + const match = regExp.exec(contents); + if (match !== null) { + return match[2]; + } + return ''; +} +export function stripBOM(contents) { + return contents.trim(); +} +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 2962c47a..89bcd923 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "@misternick/ngx-translate-extract", - "version": "7.1.36", + "name": "@biesbjerg/ngx-translate-extract", + "version": "7.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "@misternick/ngx-translate-extract", - "version": "7.1.36", + "name": "@biesbjerg/ngx-translate-extract", + "version": "7.1.0", "license": "MIT", "dependencies": { "@phenomnomnominal/tsquery": "^4.1.1", @@ -18,13 +18,13 @@ "mkdirp": "^1.0.4", "path": "^0.12.7", "terminal-link": "^2.1.1", - "yargs": "^16.2.0" + "yargs": "^17.2.1" }, "bin": { "ngx-translate-extract": "bin/cli.js" }, "devDependencies": { - "@angular/compiler": "~12.2.13", + "@angular/compiler": "~13.0.1", "@types/braces": "^3.0.0", "@types/chai": "^4.2.16", "@types/flat": "^5.0.1", @@ -33,7 +33,6 @@ "@types/mkdirp": "^1.0.1", "@types/mocha": "^8.2.2", "@types/node": "^14.14.37", - "@types/yargs": "^16.0.1", "braces": "^3.0.2", "chai": "^4.3.4", "husky": "^6.0.0", @@ -46,32 +45,32 @@ "tslint-config-prettier": "^1.18.0", "tslint-eslint-rules": "^5.4.0", "tslint-etc": "^1.13.9", - "typescript": "^4.2.4" + "typescript": "^4.4.4" }, "engines": { "node": ">=11.15.0" }, "peerDependencies": { - "@angular/compiler": ">=12.0.0", - "typescript": ">=3.0.0" + "@angular/compiler": ">=13.0.0", + "typescript": ">=4.4.0" } }, "node_modules/@angular/compiler": { - "version": "12.2.13", - "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-12.2.13.tgz", - "integrity": "sha512-L0saTTJJtxldjhaGIL6b1BCfodPOEz4Wrev3pEUK5UcODooj5HLiE/aO6jiNb8M4XTbdqByKyqvZyWzGHeexVQ==", + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-13.0.1.tgz", + "integrity": "sha512-ruGAKIlgZmz3/y/juXj7jLoqgu+fDvGeWkqIxhDtNHrhn9u9cwK+2BZFL4BJ1Y6DIaHGLtBQXdo7kR3n71Gncw==", "dev": true, "dependencies": { - "tslib": "^2.2.0" + "tslib": "^2.3.0" }, "engines": { - "node": "^12.14.1 || >=14.0.0" + "node": "^12.20.0 || ^14.15.0 || >=16.10.0" } }, "node_modules/@angular/compiler/node_modules/tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", "dev": true }, "node_modules/@babel/code-frame": { @@ -257,15 +256,6 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, - "node_modules/@types/yargs": { - "version": "16.0.1", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.1.tgz", - "integrity": "sha512-x4HABGLyzr5hKUzBC9dvjciOTm11WVH1NWonNjGgxapnTHu5SWUqyqn0zQ6Re0yQU0lsQ6ztLCoMAKDGZflyxA==", - "dev": true, - "dependencies": { - "@types/yargs-parser": "*" - } - }, "node_modules/@types/yargs-parser": { "version": "20.2.0", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.0.tgz", @@ -1683,6 +1673,24 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/mocha/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -2783,9 +2791,9 @@ } }, "node_modules/typescript": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -2908,9 +2916,9 @@ } }, "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.2.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.2.1.tgz", + "integrity": "sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q==", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -2921,7 +2929,7 @@ "yargs-parser": "^20.2.2" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-parser": { @@ -2983,18 +2991,18 @@ }, "dependencies": { "@angular/compiler": { - "version": "12.2.13", - "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-12.2.13.tgz", - "integrity": "sha512-L0saTTJJtxldjhaGIL6b1BCfodPOEz4Wrev3pEUK5UcODooj5HLiE/aO6jiNb8M4XTbdqByKyqvZyWzGHeexVQ==", + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-13.0.1.tgz", + "integrity": "sha512-ruGAKIlgZmz3/y/juXj7jLoqgu+fDvGeWkqIxhDtNHrhn9u9cwK+2BZFL4BJ1Y6DIaHGLtBQXdo7kR3n71Gncw==", "dev": true, "requires": { - "tslib": "^2.2.0" + "tslib": "^2.3.0" }, "dependencies": { "tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", "dev": true } } @@ -3160,15 +3168,6 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, - "@types/yargs": { - "version": "16.0.1", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.1.tgz", - "integrity": "sha512-x4HABGLyzr5hKUzBC9dvjciOTm11WVH1NWonNjGgxapnTHu5SWUqyqn0zQ6Re0yQU0lsQ6ztLCoMAKDGZflyxA==", - "dev": true, - "requires": { - "@types/yargs-parser": "*" - } - }, "@types/yargs-parser": { "version": "20.2.0", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.0.tgz", @@ -4211,6 +4210,21 @@ "requires": { "has-flag": "^4.0.0" } + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } } } }, @@ -5031,9 +5045,9 @@ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" }, "typescript": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==" + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==" }, "util": { "version": "0.10.4", @@ -5126,9 +5140,9 @@ "dev": true }, "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.2.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.2.1.tgz", + "integrity": "sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q==", "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", diff --git a/package.json b/package.json index 8975e5b5..765e589a 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "useTabs": true, "singleQuote": true }, + "type": "module", "lint-staged": { "{src,tests}/**/*.{ts}": [ "tslint --project tsconfig.json -c tslint.commit.json --fix", @@ -61,7 +62,7 @@ }, "config": {}, "devDependencies": { - "@angular/compiler": "~12.2.13", + "@angular/compiler": "~13.0.1", "@types/braces": "^3.0.0", "@types/chai": "^4.2.16", "@types/flat": "^5.0.1", @@ -70,7 +71,6 @@ "@types/mkdirp": "^1.0.1", "@types/mocha": "^8.2.2", "@types/node": "^14.14.37", - "@types/yargs": "^16.0.1", "braces": "^3.0.2", "chai": "^4.3.4", "husky": "^6.0.0", @@ -83,11 +83,11 @@ "tslint-config-prettier": "^1.18.0", "tslint-eslint-rules": "^5.4.0", "tslint-etc": "^1.13.9", - "typescript": "^4.2.4" + "typescript": "^4.4.4" }, "peerDependencies": { - "@angular/compiler": ">=12.0.0", - "typescript": ">=3.0.0" + "@angular/compiler": ">=13.0.0", + "typescript": ">=4.4.0" }, "dependencies": { "@phenomnomnominal/tsquery": "^4.1.1", @@ -99,6 +99,6 @@ "mkdirp": "^1.0.4", "path": "^0.12.7", "terminal-link": "^2.1.1", - "yargs": "^16.2.0" + "yargs": "^17.2.1" } -} \ No newline at end of file +} diff --git a/src/cli/cli.ts b/src/cli/cli.ts index d3df4b37..7047d474 100755 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -1,25 +1,26 @@ -import * as yargs from 'yargs'; +// @ts-ignore +import yargs from 'yargs'; import { red, green } from 'colorette'; -import { ExtractTask } from './tasks/extract.task'; -import { ParserInterface } from '../parsers/parser.interface'; -import { PipeParser } from '../parsers/pipe.parser'; -import { DirectiveParser } from '../parsers/directive.parser'; -import { ServiceParser } from '../parsers/service.parser'; -import { MarkerParser } from '../parsers/marker.parser'; -import { PostProcessorInterface } from '../post-processors/post-processor.interface'; -import { SortByKeyPostProcessor } from '../post-processors/sort-by-key.post-processor'; -import { KeyAsDefaultValuePostProcessor } from '../post-processors/key-as-default-value.post-processor'; -import { NullAsDefaultValuePostProcessor } from '../post-processors/null-as-default-value.post-processor'; -import { StringAsDefaultValuePostProcessor } from '../post-processors/string-as-default-value.post-processor'; -import { PurgeObsoleteKeysPostProcessor } from '../post-processors/purge-obsolete-keys.post-processor'; -import { CompilerInterface } from '../compilers/compiler.interface'; -import { CompilerFactory } from '../compilers/compiler.factory'; -import { normalizePaths } from '../utils/fs-helpers'; -import { donateMessage } from '../utils/donate'; +import { ExtractTask } from './tasks/extract.task.js'; +import { ParserInterface } from '../parsers/parser.interface.js'; +import { PipeParser } from '../parsers/pipe.parser.js'; +import { DirectiveParser } from '../parsers/directive.parser.js'; +import { ServiceParser } from '../parsers/service.parser.js'; +import { MarkerParser } from '../parsers/marker.parser.js'; +import { PostProcessorInterface } from '../post-processors/post-processor.interface.js'; +import { SortByKeyPostProcessor } from '../post-processors/sort-by-key.post-processor.js'; +import { KeyAsDefaultValuePostProcessor } from '../post-processors/key-as-default-value.post-processor.js'; +import { NullAsDefaultValuePostProcessor } from '../post-processors/null-as-default-value.post-processor.js'; +import { StringAsDefaultValuePostProcessor } from '../post-processors/string-as-default-value.post-processor.js'; +import { PurgeObsoleteKeysPostProcessor } from '../post-processors/purge-obsolete-keys.post-processor.js'; +import { CompilerInterface } from '../compilers/compiler.interface.js'; +import { CompilerFactory } from '../compilers/compiler.factory.js'; +import { normalizePaths } from '../utils/fs-helpers.js'; +import { donateMessage } from '../utils/donate.js'; // First parsing pass to be able to access pattern argument for use input/output arguments -const y = yargs.option('patterns', { +const y = yargs().option('patterns', { alias: 'p', describe: 'Default patterns', type: 'array', @@ -31,7 +32,7 @@ const parsed = y.parse(); export const cli = y .usage('Extract strings from files for translation.\nUsage: $0 [options]') - .version(require(__dirname + '/../../package.json').version) + .version(process.env.npm_package_version) .alias('version', 'v') .help('help') .alias('help', 'h') diff --git a/src/cli/tasks/extract.task.ts b/src/cli/tasks/extract.task.ts index 9c03c0ac..3418c8ef 100644 --- a/src/cli/tasks/extract.task.ts +++ b/src/cli/tasks/extract.task.ts @@ -1,11 +1,12 @@ -import { TranslationCollection } from '../../utils/translation.collection'; -import { TaskInterface } from './task.interface'; -import { ParserInterface } from '../../parsers/parser.interface'; -import { PostProcessorInterface } from '../../post-processors/post-processor.interface'; -import { CompilerInterface } from '../../compilers/compiler.interface'; +import { TranslationCollection } from '../../utils/translation.collection.js'; +import { TaskInterface } from './task.interface.js'; +import { ParserInterface } from '../../parsers/parser.interface.js'; +import { PostProcessorInterface } from '../../post-processors/post-processor.interface.js'; +import { CompilerInterface } from '../../compilers/compiler.interface.js'; import { cyan, green, bold, dim, red } from 'colorette'; -import * as glob from 'glob'; +import pkg from 'glob'; +const { sync } = pkg; import * as fs from 'fs'; import * as path from 'path'; import * as mkdirp from 'mkdirp'; @@ -146,7 +147,7 @@ export class ExtractTask implements TaskInterface { * Get all files matching pattern */ protected getFiles(pattern: string): string[] { - return glob.sync(pattern).filter((filePath) => fs.statSync(filePath).isFile()); + return sync(pattern).filter((filePath) => fs.statSync(filePath).isFile()); } protected out(...args: any[]): void { diff --git a/src/compilers/compiler.factory.ts b/src/compilers/compiler.factory.ts index 2cc9d680..78a3b9c4 100644 --- a/src/compilers/compiler.factory.ts +++ b/src/compilers/compiler.factory.ts @@ -1,7 +1,7 @@ -import { CompilerInterface } from '../compilers/compiler.interface'; -import { JsonCompiler } from '../compilers/json.compiler'; -import { NamespacedJsonCompiler } from '../compilers/namespaced-json.compiler'; -import { PoCompiler } from '../compilers/po.compiler'; +import { CompilerInterface } from '../compilers/compiler.interface.js'; +import { JsonCompiler } from '../compilers/json.compiler.js'; +import { NamespacedJsonCompiler } from '../compilers/namespaced-json.compiler.js'; +import { PoCompiler } from '../compilers/po.compiler.js'; export class CompilerFactory { public static create(format: string, options?: {}): CompilerInterface { diff --git a/src/compilers/compiler.interface.ts b/src/compilers/compiler.interface.ts index 89753c96..ec2e283e 100644 --- a/src/compilers/compiler.interface.ts +++ b/src/compilers/compiler.interface.ts @@ -1,4 +1,4 @@ -import { TranslationCollection } from '../utils/translation.collection'; +import { TranslationCollection } from '../utils/translation.collection.js'; export interface CompilerInterface { extension: string; diff --git a/src/compilers/json.compiler.ts b/src/compilers/json.compiler.ts index d24adfb2..be47444d 100644 --- a/src/compilers/json.compiler.ts +++ b/src/compilers/json.compiler.ts @@ -1,8 +1,9 @@ -import { CompilerInterface } from './compiler.interface'; -import { TranslationCollection } from '../utils/translation.collection'; -import { stripBOM } from '../utils/utils'; +import { CompilerInterface } from './compiler.interface.js'; +import { TranslationCollection } from '../utils/translation.collection.js'; +import { stripBOM } from '../utils/utils.js'; -import { flatten } from 'flat'; +import pkg from 'flat'; +const { flatten } = pkg; export class JsonCompiler implements CompilerInterface { public indentation: string = '\t'; diff --git a/src/compilers/namespaced-json.compiler.ts b/src/compilers/namespaced-json.compiler.ts index c4fa943d..cd260cd2 100644 --- a/src/compilers/namespaced-json.compiler.ts +++ b/src/compilers/namespaced-json.compiler.ts @@ -1,8 +1,9 @@ -import { CompilerInterface } from './compiler.interface'; -import { TranslationCollection } from '../utils/translation.collection'; -import { stripBOM } from '../utils/utils'; +import { CompilerInterface } from './compiler.interface.js'; +import { TranslationCollection } from '../utils/translation.collection.js'; +import { stripBOM } from '../utils/utils.js'; -import { flatten, unflatten } from 'flat'; +import pkg from 'flat'; +const { flatten, unflatten } = pkg; export class NamespacedJsonCompiler implements CompilerInterface { public indentation: string = '\t'; diff --git a/src/compilers/po.compiler.ts b/src/compilers/po.compiler.ts index af6d2831..a25994bf 100644 --- a/src/compilers/po.compiler.ts +++ b/src/compilers/po.compiler.ts @@ -1,7 +1,8 @@ -import { CompilerInterface } from './compiler.interface'; -import { TranslationCollection, TranslationType } from '../utils/translation.collection'; +import { CompilerInterface } from './compiler.interface.js'; +import { TranslationCollection, TranslationType } from '../utils/translation.collection.js'; -import { po } from 'gettext-parser'; +import pkg from 'gettext-parser'; +const { po } = pkg; export class PoCompiler implements CompilerInterface { public extension: string = 'po'; diff --git a/src/index.ts b/src/index.ts index 3e8133bb..4c7fc814 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,23 +1,23 @@ -export * from './utils/translation.collection'; -export * from './utils/utils'; +export * from './utils/translation.collection.js'; +export * from './utils/utils.js'; -export * from './cli/cli'; -export * from './cli/tasks/task.interface'; -export * from './cli/tasks/extract.task'; +export * from './cli/cli.js'; +export * from './cli/tasks/task.interface.js'; +export * from './cli/tasks/extract.task.js'; -export * from './parsers/parser.interface'; -export * from './parsers/directive.parser'; -export * from './parsers/pipe.parser'; -export * from './parsers/service.parser'; -export * from './parsers/marker.parser'; +export * from './parsers/parser.interface.js'; +export * from './parsers/directive.parser.js'; +export * from './parsers/pipe.parser.js'; +export * from './parsers/service.parser.js'; +export * from './parsers/marker.parser.js'; -export * from './compilers/compiler.interface'; -export * from './compilers/compiler.factory'; -export * from './compilers/json.compiler'; -export * from './compilers/namespaced-json.compiler'; -export * from './compilers/po.compiler'; +export * from './compilers/compiler.interface.js'; +export * from './compilers/compiler.factory.js'; +export * from './compilers/json.compiler.js'; +export * from './compilers/namespaced-json.compiler.js'; +export * from './compilers/po.compiler.js'; -export * from './post-processors/post-processor.interface'; -export * from './post-processors/key-as-default-value.post-processor'; -export * from './post-processors/purge-obsolete-keys.post-processor'; -export * from './post-processors/sort-by-key.post-processor'; +export * from './post-processors/post-processor.interface.js'; +export * from './post-processors/key-as-default-value.post-processor.js'; +export * from './post-processors/purge-obsolete-keys.post-processor.js'; +export * from './post-processors/sort-by-key.post-processor.js'; diff --git a/src/parsers/directive.parser.ts b/src/parsers/directive.parser.ts index d910b728..64b619ad 100644 --- a/src/parsers/directive.parser.ts +++ b/src/parsers/directive.parser.ts @@ -17,9 +17,9 @@ import { LiteralMap } from '@angular/compiler'; -import { ParserInterface } from './parser.interface'; -import { TranslationCollection } from '../utils/translation.collection'; -import { isPathAngularComponent, extractComponentInlineTemplate } from '../utils/utils'; +import { ParserInterface } from './parser.interface.js'; +import { TranslationCollection } from '../utils/translation.collection.js'; +import { isPathAngularComponent, extractComponentInlineTemplate } from '../utils/utils.js'; const TRANSLATE_ATTR_NAME = 'translate'; type ElementLike = Element | Template; diff --git a/src/parsers/marker.parser.ts b/src/parsers/marker.parser.ts index 32c498c1..24a3aa85 100644 --- a/src/parsers/marker.parser.ts +++ b/src/parsers/marker.parser.ts @@ -1,8 +1,8 @@ import { tsquery } from '@phenomnomnominal/tsquery'; -import { ParserInterface } from './parser.interface'; -import { TranslationCollection } from '../utils/translation.collection'; -import { getNamedImportAlias, findFunctionCallExpressions, getStringsFromExpression } from '../utils/ast-helpers'; +import { ParserInterface } from './parser.interface.js'; +import { TranslationCollection } from '../utils/translation.collection.js'; +import { getNamedImportAlias, findFunctionCallExpressions, getStringsFromExpression } from '../utils/ast-helpers.js'; const MARKER_MODULE_NAME = '@biesbjerg/ngx-translate-extract-marker'; const MARKER_IMPORT_NAME = 'marker'; diff --git a/src/parsers/parser.interface.ts b/src/parsers/parser.interface.ts index 75c0357d..5d8c882b 100644 --- a/src/parsers/parser.interface.ts +++ b/src/parsers/parser.interface.ts @@ -1,4 +1,4 @@ -import { TranslationCollection } from '../utils/translation.collection'; +import { TranslationCollection } from '../utils/translation.collection.js'; export interface ParserInterface { extract(source: string, filePath: string): TranslationCollection | null; diff --git a/src/parsers/pipe.parser.ts b/src/parsers/pipe.parser.ts index fb1dfb23..7196c756 100644 --- a/src/parsers/pipe.parser.ts +++ b/src/parsers/pipe.parser.ts @@ -10,12 +10,12 @@ import { LiteralMap, LiteralArray, Interpolation, - MethodCall + Call } from '@angular/compiler'; -import { ParserInterface } from './parser.interface'; -import { TranslationCollection } from '../utils/translation.collection'; -import { isPathAngularComponent, extractComponentInlineTemplate } from '../utils/utils'; +import { ParserInterface } from './parser.interface.js'; +import { TranslationCollection } from '../utils/translation.collection.js'; +import { isPathAngularComponent, extractComponentInlineTemplate } from '../utils/utils.js'; const TRANSLATE_PIPE_NAME = 'translate'; @@ -132,7 +132,7 @@ export class PipeParser implements ParserInterface { return this.getTranslatablesFromAsts(ast.expressions); } - if (ast instanceof MethodCall) { + if (ast instanceof Call) { return this.getTranslatablesFromAsts(ast.args); } diff --git a/src/parsers/service.parser.ts b/src/parsers/service.parser.ts index d444a0f3..7fda3187 100644 --- a/src/parsers/service.parser.ts +++ b/src/parsers/service.parser.ts @@ -1,8 +1,8 @@ import { ClassDeclaration, CallExpression } from 'typescript'; import { tsquery } from '@phenomnomnominal/tsquery'; -import { ParserInterface } from './parser.interface'; -import { TranslationCollection } from '../utils/translation.collection'; +import { ParserInterface } from './parser.interface.js'; +import { TranslationCollection } from '../utils/translation.collection.js'; import { findClassDeclarations, findClassPropertyByType, @@ -11,7 +11,7 @@ import { getStringsFromExpression, findMethodParameterByType, findConstructorDeclaration -} from '../utils/ast-helpers'; +} from '../utils/ast-helpers.js'; const TRANSLATE_SERVICE_TYPE_REFERENCE = 'TranslateService'; const TRANSLATE_SERVICE_METHOD_NAMES = ['get', 'instant', 'stream']; diff --git a/src/post-processors/key-as-default-value.post-processor.ts b/src/post-processors/key-as-default-value.post-processor.ts index 54f10403..2b188a31 100644 --- a/src/post-processors/key-as-default-value.post-processor.ts +++ b/src/post-processors/key-as-default-value.post-processor.ts @@ -1,5 +1,5 @@ -import { TranslationCollection } from '../utils/translation.collection'; -import { PostProcessorInterface } from './post-processor.interface'; +import { TranslationCollection } from '../utils/translation.collection.js'; +import { PostProcessorInterface } from './post-processor.interface.js'; export class KeyAsDefaultValuePostProcessor implements PostProcessorInterface { public name: string = 'KeyAsDefaultValue'; diff --git a/src/post-processors/null-as-default-value.post-processor.ts b/src/post-processors/null-as-default-value.post-processor.ts index f2927e63..a2d43262 100644 --- a/src/post-processors/null-as-default-value.post-processor.ts +++ b/src/post-processors/null-as-default-value.post-processor.ts @@ -1,5 +1,5 @@ -import { TranslationCollection } from '../utils/translation.collection'; -import { PostProcessorInterface } from './post-processor.interface'; +import { TranslationCollection } from '../utils/translation.collection.js'; +import { PostProcessorInterface } from './post-processor.interface.js'; export class NullAsDefaultValuePostProcessor implements PostProcessorInterface { public name: string = 'NullAsDefaultValue'; diff --git a/src/post-processors/post-processor.interface.ts b/src/post-processors/post-processor.interface.ts index b725074d..076038d6 100644 --- a/src/post-processors/post-processor.interface.ts +++ b/src/post-processors/post-processor.interface.ts @@ -1,4 +1,4 @@ -import { TranslationCollection } from '../utils/translation.collection'; +import { TranslationCollection } from '../utils/translation.collection.js'; export interface PostProcessorInterface { name: string; diff --git a/src/post-processors/purge-obsolete-keys.post-processor.ts b/src/post-processors/purge-obsolete-keys.post-processor.ts index 559ece0c..9cde92f1 100644 --- a/src/post-processors/purge-obsolete-keys.post-processor.ts +++ b/src/post-processors/purge-obsolete-keys.post-processor.ts @@ -1,5 +1,5 @@ -import { TranslationCollection } from '../utils/translation.collection'; -import { PostProcessorInterface } from './post-processor.interface'; +import { TranslationCollection } from '../utils/translation.collection.js'; +import { PostProcessorInterface } from './post-processor.interface.js'; export class PurgeObsoleteKeysPostProcessor implements PostProcessorInterface { public name: string = 'PurgeObsoleteKeys'; diff --git a/src/post-processors/sort-by-key.post-processor.ts b/src/post-processors/sort-by-key.post-processor.ts index df4f50a8..459a12de 100644 --- a/src/post-processors/sort-by-key.post-processor.ts +++ b/src/post-processors/sort-by-key.post-processor.ts @@ -1,5 +1,5 @@ -import { TranslationCollection } from '../utils/translation.collection'; -import { PostProcessorInterface } from './post-processor.interface'; +import { TranslationCollection } from '../utils/translation.collection.js'; +import { PostProcessorInterface } from './post-processor.interface.js'; export class SortByKeyPostProcessor implements PostProcessorInterface { public name: string = 'SortByKey'; diff --git a/src/post-processors/string-as-default-value.post-processor.ts b/src/post-processors/string-as-default-value.post-processor.ts index f92d1e4a..ee3e922d 100644 --- a/src/post-processors/string-as-default-value.post-processor.ts +++ b/src/post-processors/string-as-default-value.post-processor.ts @@ -1,5 +1,5 @@ -import { TranslationCollection } from '../utils/translation.collection'; -import { PostProcessorInterface } from './post-processor.interface'; +import { TranslationCollection } from '../utils/translation.collection.js'; +import { PostProcessorInterface } from './post-processor.interface.js'; interface Options { defaultValue: string; diff --git a/src/utils/ast-helpers.ts b/src/utils/ast-helpers.ts index 6e5cd231..278b522c 100644 --- a/src/utils/ast-helpers.ts +++ b/src/utils/ast-helpers.ts @@ -1,20 +1,18 @@ import { tsquery } from '@phenomnomnominal/tsquery'; import { - SyntaxKind, Node, NamedImports, Identifier, ClassDeclaration, ConstructorDeclaration, - isStringLiteralLike, - isArrayLiteralExpression, CallExpression, Expression, - isBinaryExpression, - isConditionalExpression, PropertyAccessExpression } from 'typescript'; +import pkg from 'typescript'; +const { SyntaxKind, isStringLiteralLike, isArrayLiteralExpression, isBinaryExpression, isConditionalExpression } = pkg; + export function getNamedImports(node: Node, moduleName: string): NamedImports[] { const query = `ImportDeclaration[moduleSpecifier.text="${moduleName}"] NamedImports`; return tsquery(node, query); diff --git a/tsconfig.json b/tsconfig.json index 350414de..bde174fb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,5 @@ { "compilerOptions": { - "allowSyntheticDefaultImports": true, "noImplicitAny": true, "noImplicitReturns": true, "noImplicitThis": true, @@ -12,7 +11,7 @@ "es2019", "DOM" ], - "module": "commonjs", + "module": "ES2020", "esModuleInterop": true, "moduleResolution": "node", "outDir": "dist", From e87de05d21c167c013b2e409c3807abfde01de3d Mon Sep 17 00:00:00 2001 From: Tiberiu Zuld Date: Mon, 15 Nov 2021 17:42:29 +0200 Subject: [PATCH 09/18] update branches to build --- .github/workflows/node.js.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index e43a6a42..1cf7a486 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -5,7 +5,7 @@ name: Node.js CI on: push: - branches: [ master ] + branches: [ master , ng13 ] pull_request: branches: [ master ] @@ -28,4 +28,4 @@ jobs: cache: 'npm' - run: npm ci - run: npm run build --if-present - - run: npm run test \ No newline at end of file + - run: npm run test From 9b3eb47da7cc304daf916b4d530b47a53070786e Mon Sep 17 00:00:00 2001 From: Tiberiu Zuld Date: Mon, 15 Nov 2021 17:45:53 +0200 Subject: [PATCH 10/18] add file extensions --- tests/compilers/namespaced-json.compiler.spec.ts | 4 ++-- tests/compilers/po.compiler.spec.ts | 4 ++-- tests/parsers/directive.parser.spec.ts | 2 +- tests/parsers/marker.parser.spec.ts | 2 +- tests/parsers/pipe.parser.spec.ts | 2 +- tests/parsers/service.parser.spec.ts | 2 +- tests/parsers/utils.spec.ts | 2 +- .../key-as-default-value.post-processor.spec.ts | 6 +++--- .../null-as-default-value.post-processor.spec.ts | 6 +++--- .../purge-obsolete-keys.post-processor.spec.ts | 6 +++--- tests/post-processors/sort-by-key.post-processor.spec.ts | 6 +++--- .../string-as-default-value.post-processor.spec.ts | 6 +++--- tests/utils/translation.collection.spec.ts | 2 +- 13 files changed, 25 insertions(+), 25 deletions(-) diff --git a/tests/compilers/namespaced-json.compiler.spec.ts b/tests/compilers/namespaced-json.compiler.spec.ts index 48a61556..a760468f 100644 --- a/tests/compilers/namespaced-json.compiler.spec.ts +++ b/tests/compilers/namespaced-json.compiler.spec.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import { TranslationCollection } from '../../src/utils/translation.collection'; -import { NamespacedJsonCompiler } from '../../src/compilers/namespaced-json.compiler'; +import { TranslationCollection } from '../../src/utils/translation.collection.js'; +import { NamespacedJsonCompiler } from '../../src/compilers/namespaced-json.compiler.js'; describe('NamespacedJsonCompiler', () => { let compiler: NamespacedJsonCompiler; diff --git a/tests/compilers/po.compiler.spec.ts b/tests/compilers/po.compiler.spec.ts index 8d0fd298..f910d594 100644 --- a/tests/compilers/po.compiler.spec.ts +++ b/tests/compilers/po.compiler.spec.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; -import { TranslationCollection } from '../../src/utils/translation.collection'; -import { PoCompiler } from '../../src/compilers/po.compiler'; +import { TranslationCollection } from '../../src/utils/translation.collection.js'; +import { PoCompiler } from '../../src/compilers/po.compiler.js'; describe('PoCompiler', () => { let compiler: PoCompiler; diff --git a/tests/parsers/directive.parser.spec.ts b/tests/parsers/directive.parser.spec.ts index 7d7b11d0..7df3f5d9 100644 --- a/tests/parsers/directive.parser.spec.ts +++ b/tests/parsers/directive.parser.spec.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { DirectiveParser } from '../../src/parsers/directive.parser'; +import { DirectiveParser } from '../../src/parsers/directive.parser.js'; describe('DirectiveParser', () => { const templateFilename: string = 'test.template.html'; diff --git a/tests/parsers/marker.parser.spec.ts b/tests/parsers/marker.parser.spec.ts index 918ebe2f..c5dfdb43 100644 --- a/tests/parsers/marker.parser.spec.ts +++ b/tests/parsers/marker.parser.spec.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { MarkerParser } from '../../src/parsers/marker.parser'; +import { MarkerParser } from '../../src/parsers/marker.parser.js'; describe('MarkerParser', () => { const componentFilename: string = 'test.component.ts'; diff --git a/tests/parsers/pipe.parser.spec.ts b/tests/parsers/pipe.parser.spec.ts index 861ab041..d9b66c52 100644 --- a/tests/parsers/pipe.parser.spec.ts +++ b/tests/parsers/pipe.parser.spec.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { PipeParser } from '../../src/parsers/pipe.parser'; +import { PipeParser } from '../../src/parsers/pipe.parser.js'; describe('PipeParser', () => { const templateFilename: string = 'test.template.html'; diff --git a/tests/parsers/service.parser.spec.ts b/tests/parsers/service.parser.spec.ts index 7eba5ffb..314f5e28 100644 --- a/tests/parsers/service.parser.spec.ts +++ b/tests/parsers/service.parser.spec.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { ServiceParser } from '../../src/parsers/service.parser'; +import { ServiceParser } from '../../src/parsers/service.parser.js'; describe('ServiceParser', () => { const componentFilename: string = 'test.component.ts'; diff --git a/tests/parsers/utils.spec.ts b/tests/parsers/utils.spec.ts index f0377d72..0554e0d5 100644 --- a/tests/parsers/utils.spec.ts +++ b/tests/parsers/utils.spec.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { isPathAngularComponent, extractComponentInlineTemplate } from '../../src/utils/utils'; +import { isPathAngularComponent, extractComponentInlineTemplate } from '../../src/utils/utils.js'; describe('Utils', () => { it('should recognize js extension as angular component', () => { diff --git a/tests/post-processors/key-as-default-value.post-processor.spec.ts b/tests/post-processors/key-as-default-value.post-processor.spec.ts index 5a3ca62b..9afd44e1 100644 --- a/tests/post-processors/key-as-default-value.post-processor.spec.ts +++ b/tests/post-processors/key-as-default-value.post-processor.spec.ts @@ -1,8 +1,8 @@ import { expect } from 'chai'; -import { PostProcessorInterface } from '../../src/post-processors/post-processor.interface'; -import { KeyAsDefaultValuePostProcessor } from '../../src/post-processors/key-as-default-value.post-processor'; -import { TranslationCollection } from '../../src/utils/translation.collection'; +import { PostProcessorInterface } from '../../src/post-processors/post-processor.interface.js'; +import { KeyAsDefaultValuePostProcessor } from '../../src/post-processors/key-as-default-value.post-processor.js'; +import { TranslationCollection } from '../../src/utils/translation.collection.js'; describe('KeyAsDefaultValuePostProcessor', () => { let processor: PostProcessorInterface; diff --git a/tests/post-processors/null-as-default-value.post-processor.spec.ts b/tests/post-processors/null-as-default-value.post-processor.spec.ts index b9e988ff..3f13bb74 100644 --- a/tests/post-processors/null-as-default-value.post-processor.spec.ts +++ b/tests/post-processors/null-as-default-value.post-processor.spec.ts @@ -1,8 +1,8 @@ import { expect } from 'chai'; -import { PostProcessorInterface } from '../../src/post-processors/post-processor.interface'; -import { NullAsDefaultValuePostProcessor } from '../../src/post-processors/null-as-default-value.post-processor'; -import { TranslationCollection } from '../../src/utils/translation.collection'; +import { PostProcessorInterface } from '../../src/post-processors/post-processor.interface.js'; +import { NullAsDefaultValuePostProcessor } from '../../src/post-processors/null-as-default-value.post-processor.js'; +import { TranslationCollection } from '../../src/utils/translation.collection.js'; describe('NullAsDefaultValuePostProcessor', () => { let processor: PostProcessorInterface; diff --git a/tests/post-processors/purge-obsolete-keys.post-processor.spec.ts b/tests/post-processors/purge-obsolete-keys.post-processor.spec.ts index 898b1b85..eef3f6a6 100644 --- a/tests/post-processors/purge-obsolete-keys.post-processor.spec.ts +++ b/tests/post-processors/purge-obsolete-keys.post-processor.spec.ts @@ -1,8 +1,8 @@ import { expect } from 'chai'; -import { PostProcessorInterface } from '../../src/post-processors/post-processor.interface'; -import { PurgeObsoleteKeysPostProcessor } from '../../src/post-processors/purge-obsolete-keys.post-processor'; -import { TranslationCollection } from '../../src/utils/translation.collection'; +import { PostProcessorInterface } from '../../src/post-processors/post-processor.interface.js'; +import { PurgeObsoleteKeysPostProcessor } from '../../src/post-processors/purge-obsolete-keys.post-processor.js'; +import { TranslationCollection } from '../../src/utils/translation.collection.js'; describe('PurgeObsoleteKeysPostProcessor', () => { let postProcessor: PostProcessorInterface; diff --git a/tests/post-processors/sort-by-key.post-processor.spec.ts b/tests/post-processors/sort-by-key.post-processor.spec.ts index b1a33ea9..411a6133 100644 --- a/tests/post-processors/sort-by-key.post-processor.spec.ts +++ b/tests/post-processors/sort-by-key.post-processor.spec.ts @@ -1,8 +1,8 @@ import { expect } from 'chai'; -import { PostProcessorInterface } from '../../src/post-processors/post-processor.interface'; -import { SortByKeyPostProcessor } from '../../src/post-processors/sort-by-key.post-processor'; -import { TranslationCollection } from '../../src/utils/translation.collection'; +import { PostProcessorInterface } from '../../src/post-processors/post-processor.interface.js'; +import { SortByKeyPostProcessor } from '../../src/post-processors/sort-by-key.post-processor.js'; +import { TranslationCollection } from '../../src/utils/translation.collection.js'; describe('SortByKeyPostProcessor', () => { let processor: PostProcessorInterface; diff --git a/tests/post-processors/string-as-default-value.post-processor.spec.ts b/tests/post-processors/string-as-default-value.post-processor.spec.ts index c88ac71c..8b79b581 100644 --- a/tests/post-processors/string-as-default-value.post-processor.spec.ts +++ b/tests/post-processors/string-as-default-value.post-processor.spec.ts @@ -1,8 +1,8 @@ import { expect } from 'chai'; -import { PostProcessorInterface } from '../../src/post-processors/post-processor.interface'; -import { StringAsDefaultValuePostProcessor } from '../../src/post-processors/string-as-default-value.post-processor'; -import { TranslationCollection } from '../../src/utils/translation.collection'; +import { PostProcessorInterface } from '../../src/post-processors/post-processor.interface.js'; +import { StringAsDefaultValuePostProcessor } from '../../src/post-processors/string-as-default-value.post-processor.js'; +import { TranslationCollection } from '../../src/utils/translation.collection.js'; describe('StringAsDefaultValuePostProcessor', () => { let processor: PostProcessorInterface; diff --git a/tests/utils/translation.collection.spec.ts b/tests/utils/translation.collection.spec.ts index 05e1e321..a61af6bd 100644 --- a/tests/utils/translation.collection.spec.ts +++ b/tests/utils/translation.collection.spec.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import { TranslationCollection } from '../../src/utils/translation.collection'; +import { TranslationCollection } from '../../src/utils/translation.collection.js'; describe('StringCollection', () => { let collection: TranslationCollection; From 789a817e45c2ad54b89bc9d2d9630bf636c59d43 Mon Sep 17 00:00:00 2001 From: Tiberiu Zuld Date: Mon, 15 Nov 2021 17:47:17 +0200 Subject: [PATCH 11/18] remove node12 from tests --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 1cf7a486..cb674ede 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: [14.x, 16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: From 0d0fdc2d57f65dc4b8ff05f89356120c3ee606b9 Mon Sep 17 00:00:00 2001 From: Tiberiu Zuld Date: Mon, 15 Nov 2021 18:09:09 +0200 Subject: [PATCH 12/18] run tests as esm --- tsconfig.spec.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tsconfig.spec.json b/tsconfig.spec.json index b96dc170..8bd6b91b 100644 --- a/tsconfig.spec.json +++ b/tsconfig.spec.json @@ -1,8 +1,8 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "commonjs", - "target": "es2015", + "module": "es2020", + "target": "es2020", "declaration": false, "noImplicitAny": false, "removeComments": true, @@ -15,4 +15,4 @@ "noImplicitUseStrict": true, }, "include": ["tests/**/*.ts", "src/**/*.ts"] -} \ No newline at end of file +} From 773ad50d52d4a080d6242699f13b67c4af9c0d1d Mon Sep 17 00:00:00 2001 From: Tiberiu Zuld Date: Mon, 15 Nov 2021 18:13:03 +0200 Subject: [PATCH 13/18] update ts-node --- package-lock.json | 217 +++++++++++++++++++++++++++++++++------------- package.json | 2 +- 2 files changed, 156 insertions(+), 63 deletions(-) diff --git a/package-lock.json b/package-lock.json index 89bcd923..82431b13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,7 +40,7 @@ "mocha": "^9.1.3", "prettier": "^2.2.1", "rimraf": "^3.0.2", - "ts-node": "^9.1.1", + "ts-node": "^10.4.0", "tslint": "^6.1.3", "tslint-config-prettier": "^1.18.0", "tslint-eslint-rules": "^5.4.0", @@ -170,6 +170,27 @@ "node": ">=4" } }, + "node_modules/@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-consumer": "0.8.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@phenomnomnominal/tsquery": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-4.1.1.tgz", @@ -181,6 +202,30 @@ "typescript": "^3 || ^4" } }, + "node_modules/@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true + }, "node_modules/@types/braces": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/braces/-/braces-3.0.0.tgz", @@ -268,6 +313,27 @@ "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", "dev": true }, + "node_modules/acorn": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", @@ -478,12 +544,6 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, "node_modules/builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -2161,25 +2221,6 @@ "node": ">=8" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -2351,29 +2392,44 @@ } }, "node_modules/ts-node": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", - "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", - "dev": true, - "dependencies": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", + "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", "arg": "^4.1.0", "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.17", "yn": "3.1.1" }, "bin": { "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js", "ts-script": "dist/bin-script-deprecated.js" }, - "engines": { - "node": ">=10.0.0" - }, "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } } }, "node_modules/tslib": { @@ -2794,6 +2850,7 @@ "version": "4.4.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -3085,6 +3142,21 @@ } } }, + "@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "dev": true + }, + "@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "dev": true, + "requires": { + "@cspotcode/source-map-consumer": "0.8.0" + } + }, "@phenomnomnominal/tsquery": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-4.1.1.tgz", @@ -3093,6 +3165,30 @@ "esquery": "^1.0.1" } }, + "@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", + "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true + }, "@types/braces": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/braces/-/braces-3.0.0.tgz", @@ -3180,6 +3276,18 @@ "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", "dev": true }, + "acorn": { + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", + "dev": true + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + }, "aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", @@ -3339,12 +3447,6 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -4566,22 +4668,6 @@ } } }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -4710,16 +4796,22 @@ } }, "ts-node": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", - "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", + "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", "dev": true, "requires": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", "arg": "^4.1.0", "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.17", "yn": "3.1.1" } }, @@ -5047,7 +5139,8 @@ "typescript": { "version": "4.4.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", - "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==" + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "dev": true }, "util": { "version": "0.10.4", diff --git a/package.json b/package.json index 765e589a..f1d334e2 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "mocha": "^9.1.3", "prettier": "^2.2.1", "rimraf": "^3.0.2", - "ts-node": "^9.1.1", + "ts-node": "^10.4.0", "tslint": "^6.1.3", "tslint-config-prettier": "^1.18.0", "tslint-eslint-rules": "^5.4.0", From ff25770c31d2a469a9c2fdf91d6fcb763d3045d0 Mon Sep 17 00:00:00 2001 From: Tiberiu Zuld Date: Mon, 15 Nov 2021 18:30:50 +0200 Subject: [PATCH 14/18] fix tests --- .mocharc.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .mocharc.json diff --git a/.mocharc.json b/.mocharc.json new file mode 100644 index 00000000..797ffe3c --- /dev/null +++ b/.mocharc.json @@ -0,0 +1,5 @@ +{ + "extension": ["ts"], + "node-option": ["experimental-specifier-resolution=node", "loader=ts-node/esm"], + "spec": ["test/**/*.test.ts"] +} From 454488a0b82e3edc015be03351329bf0587d326b Mon Sep 17 00:00:00 2001 From: Tiberiu Zuld Date: Mon, 15 Nov 2021 18:32:59 +0200 Subject: [PATCH 15/18] fix tests --- .mocharc.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.mocharc.json b/.mocharc.json index 797ffe3c..b9ce697b 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -1,5 +1,5 @@ { "extension": ["ts"], "node-option": ["experimental-specifier-resolution=node", "loader=ts-node/esm"], - "spec": ["test/**/*.test.ts"] + "spec": ["test/**/*.spec.ts"] } diff --git a/package.json b/package.json index f1d334e2..444f6705 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "watch": "npm run clean && tsc --watch", "clean": "rimraf ./dist", "lint": "tslint --force './src/**/*.ts'", - "test": "env TS_NODE_PROJECT=\"tsconfig.spec.json\" mocha -r ts-node/register tests/**/*.spec.ts" + "test": "env TS_NODE_PROJECT=\"tsconfig.spec.json\" mocha" }, "husky": { "hooks": { From 4297d6cafabae01dce66f83fa4616ef27b6c4f84 Mon Sep 17 00:00:00 2001 From: Tiberiu Zuld Date: Mon, 15 Nov 2021 18:34:25 +0200 Subject: [PATCH 16/18] fix tests --- .github/workflows/node.js.yml | 2 +- .mocharc.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index cb674ede..1cf7a486 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [14.x, 16.x] + node-version: [12.x, 14.x, 16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: diff --git a/.mocharc.json b/.mocharc.json index b9ce697b..8e388585 100644 --- a/.mocharc.json +++ b/.mocharc.json @@ -1,5 +1,5 @@ { "extension": ["ts"], "node-option": ["experimental-specifier-resolution=node", "loader=ts-node/esm"], - "spec": ["test/**/*.spec.ts"] + "spec": ["tests/**/*.spec.ts"] } From 0fb45c80ff2917ebe2762a6b8905a910ab9abe46 Mon Sep 17 00:00:00 2001 From: Tiberiu Zuld Date: Mon, 15 Nov 2021 18:36:42 +0200 Subject: [PATCH 17/18] fix tests --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 1cf7a486..cb674ede 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: [14.x, 16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: From 508f0d276b95a170af9ba6684255e4598dd1c404 Mon Sep 17 00:00:00 2001 From: Tiberiu Zuld Date: Mon, 15 Nov 2021 19:12:50 +0200 Subject: [PATCH 18/18] fix errors when exp can be null in expressionIsOrHasBindingPipe remove dist folder --- .gitignore | 1 + dist/cli/cli.d.ts | 1 - dist/cli/cli.js | 147 ------------------ dist/cli/tasks/extract.task.d.ts | 29 ---- dist/cli/tasks/extract.task.js | 142 ----------------- dist/cli/tasks/task.interface.d.ts | 3 - dist/cli/tasks/task.interface.js | 2 - dist/compilers/compiler.factory.d.ts | 4 - dist/compilers/compiler.factory.js | 18 --- dist/compilers/compiler.interface.d.ts | 6 - dist/compilers/compiler.interface.js | 2 - dist/compilers/json.compiler.d.ts | 10 -- dist/compilers/json.compiler.js | 27 ---- dist/compilers/namespaced-json.compiler.d.ts | 9 -- dist/compilers/namespaced-json.compiler.js | 24 --- dist/compilers/po.compiler.d.ts | 9 -- dist/compilers/po.compiler.js | 47 ------ dist/index.d.ts | 19 --- dist/index.js | 20 --- dist/parsers/directive.parser.d.ts | 18 --- dist/parsers/directive.parser.js | 106 ------------- dist/parsers/marker.parser.d.ts | 5 - dist/parsers/marker.parser.js | 26 ---- dist/parsers/parser.interface.d.ts | 4 - dist/parsers/parser.interface.js | 2 - dist/parsers/pipe.parser.d.ts | 13 -- dist/parsers/pipe.parser.js | 108 ------------- dist/parsers/service.parser.d.ts | 8 - dist/parsers/service.parser.js | 46 ------ .../key-as-default-value.post-processor.d.ts | 6 - .../key-as-default-value.post-processor.js | 7 - .../null-as-default-value.post-processor.d.ts | 6 - .../null-as-default-value.post-processor.js | 7 - .../post-processor.interface.d.ts | 5 - .../post-processor.interface.js | 2 - .../purge-obsolete-keys.post-processor.d.ts | 6 - .../purge-obsolete-keys.post-processor.js | 7 - .../sort-by-key.post-processor.d.ts | 6 - .../sort-by-key.post-processor.js | 7 - ...tring-as-default-value.post-processor.d.ts | 12 -- .../string-as-default-value.post-processor.js | 11 -- dist/utils/ast-helpers.d.ts | 13 -- dist/utils/ast-helpers.js | 126 --------------- dist/utils/donate.d.ts | 1 - dist/utils/donate.js | 16 -- dist/utils/fs-helpers.d.ts | 8 - dist/utils/fs-helpers.js | 26 ---- dist/utils/translation.collection.d.ts | 21 --- dist/utils/translation.collection.js | 73 --------- dist/utils/utils.d.ts | 3 - dist/utils/utils.js | 15 -- src/parsers/pipe.parser.ts | 6 +- 52 files changed, 4 insertions(+), 1242 deletions(-) delete mode 100644 dist/cli/cli.d.ts delete mode 100644 dist/cli/cli.js delete mode 100644 dist/cli/tasks/extract.task.d.ts delete mode 100644 dist/cli/tasks/extract.task.js delete mode 100644 dist/cli/tasks/task.interface.d.ts delete mode 100644 dist/cli/tasks/task.interface.js delete mode 100644 dist/compilers/compiler.factory.d.ts delete mode 100644 dist/compilers/compiler.factory.js delete mode 100644 dist/compilers/compiler.interface.d.ts delete mode 100644 dist/compilers/compiler.interface.js delete mode 100644 dist/compilers/json.compiler.d.ts delete mode 100644 dist/compilers/json.compiler.js delete mode 100644 dist/compilers/namespaced-json.compiler.d.ts delete mode 100644 dist/compilers/namespaced-json.compiler.js delete mode 100644 dist/compilers/po.compiler.d.ts delete mode 100644 dist/compilers/po.compiler.js delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/parsers/directive.parser.d.ts delete mode 100644 dist/parsers/directive.parser.js delete mode 100644 dist/parsers/marker.parser.d.ts delete mode 100644 dist/parsers/marker.parser.js delete mode 100644 dist/parsers/parser.interface.d.ts delete mode 100644 dist/parsers/parser.interface.js delete mode 100644 dist/parsers/pipe.parser.d.ts delete mode 100644 dist/parsers/pipe.parser.js delete mode 100644 dist/parsers/service.parser.d.ts delete mode 100644 dist/parsers/service.parser.js delete mode 100644 dist/post-processors/key-as-default-value.post-processor.d.ts delete mode 100644 dist/post-processors/key-as-default-value.post-processor.js delete mode 100644 dist/post-processors/null-as-default-value.post-processor.d.ts delete mode 100644 dist/post-processors/null-as-default-value.post-processor.js delete mode 100644 dist/post-processors/post-processor.interface.d.ts delete mode 100644 dist/post-processors/post-processor.interface.js delete mode 100644 dist/post-processors/purge-obsolete-keys.post-processor.d.ts delete mode 100644 dist/post-processors/purge-obsolete-keys.post-processor.js delete mode 100644 dist/post-processors/sort-by-key.post-processor.d.ts delete mode 100644 dist/post-processors/sort-by-key.post-processor.js delete mode 100644 dist/post-processors/string-as-default-value.post-processor.d.ts delete mode 100644 dist/post-processors/string-as-default-value.post-processor.js delete mode 100644 dist/utils/ast-helpers.d.ts delete mode 100644 dist/utils/ast-helpers.js delete mode 100644 dist/utils/donate.d.ts delete mode 100644 dist/utils/donate.js delete mode 100644 dist/utils/fs-helpers.d.ts delete mode 100644 dist/utils/fs-helpers.js delete mode 100644 dist/utils/translation.collection.d.ts delete mode 100644 dist/utils/translation.collection.js delete mode 100644 dist/utils/utils.d.ts delete mode 100644 dist/utils/utils.js diff --git a/.gitignore b/.gitignore index 938bd247..0abdb435 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ npm-debug.log* .DS_Store # Compiled files +dist src/**/*.js tests/**/*.js diff --git a/dist/cli/cli.d.ts b/dist/cli/cli.d.ts deleted file mode 100644 index d2b943ad..00000000 --- a/dist/cli/cli.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const cli: any; diff --git a/dist/cli/cli.js b/dist/cli/cli.js deleted file mode 100644 index 02b3b02b..00000000 --- a/dist/cli/cli.js +++ /dev/null @@ -1,147 +0,0 @@ -import yargs from 'yargs'; -import { red, green } from 'colorette'; -import { ExtractTask } from './tasks/extract.task.js'; -import { PipeParser } from '../parsers/pipe.parser.js'; -import { DirectiveParser } from '../parsers/directive.parser.js'; -import { ServiceParser } from '../parsers/service.parser.js'; -import { MarkerParser } from '../parsers/marker.parser.js'; -import { SortByKeyPostProcessor } from '../post-processors/sort-by-key.post-processor.js'; -import { KeyAsDefaultValuePostProcessor } from '../post-processors/key-as-default-value.post-processor.js'; -import { NullAsDefaultValuePostProcessor } from '../post-processors/null-as-default-value.post-processor.js'; -import { StringAsDefaultValuePostProcessor } from '../post-processors/string-as-default-value.post-processor.js'; -import { PurgeObsoleteKeysPostProcessor } from '../post-processors/purge-obsolete-keys.post-processor.js'; -import { CompilerFactory } from '../compilers/compiler.factory.js'; -import { normalizePaths } from '../utils/fs-helpers.js'; -import { donateMessage } from '../utils/donate.js'; -const y = yargs().option('patterns', { - alias: 'p', - describe: 'Default patterns', - type: 'array', - default: ['/**/*.html', '/**/*.ts'], - hidden: true -}); -const parsed = y.parse(); -export const cli = y - .usage('Extract strings from files for translation.\nUsage: $0 [options]') - .version(process.env.npm_package_version) - .alias('version', 'v') - .help('help') - .alias('help', 'h') - .option('input', { - alias: 'i', - describe: 'Paths you would like to extract strings from. You can use path expansion, glob patterns and multiple paths', - default: [process.env.PWD], - type: 'array', - normalize: true, - required: true -}) - .coerce('input', (input) => { - const paths = normalizePaths(input, parsed.patterns); - return paths; -}) - .option('output', { - alias: 'o', - describe: 'Paths where you would like to save extracted strings. You can use path expansion, glob patterns and multiple paths', - type: 'array', - normalize: true, - required: true -}) - .coerce('output', (output) => { - const paths = normalizePaths(output, parsed.patterns); - return paths; -}) - .option('format', { - alias: 'f', - describe: 'Format', - default: 'json', - type: 'string', - choices: ['json', 'namespaced-json', 'pot'] -}) - .option('format-indentation', { - alias: 'fi', - describe: 'Format indentation (JSON/Namedspaced JSON)', - default: '\t', - type: 'string' -}) - .option('replace', { - alias: 'r', - describe: 'Replace the contents of output file if it exists (Merges by default)', - type: 'boolean' -}) - .option('sort', { - alias: 's', - describe: 'Sort strings in alphabetical order', - type: 'boolean' -}) - .option('clean', { - alias: 'c', - describe: 'Remove obsolete strings after merge', - type: 'boolean' -}) - .option('key-as-default-value', { - alias: 'k', - describe: 'Use key as default value', - type: 'boolean', - conflicts: ['null-as-default-value', 'string-as-default-value'] -}) - .option('null-as-default-value', { - alias: 'n', - describe: 'Use null as default value', - type: 'boolean', - conflicts: ['key-as-default-value', 'string-as-default-value'] -}) - .option('string-as-default-value', { - alias: 'd', - describe: 'Use string as default value', - type: 'string', - conflicts: ['null-as-default-value', 'key-as-default-value'] -}) - .group(['format', 'format-indentation', 'sort', 'clean', 'replace'], 'Output') - .group(['key-as-default-value', 'null-as-default-value', 'string-as-default-value'], 'Extracted key value (defaults to empty string)') - .conflicts('key-as-default-value', 'null-as-default-value') - .example(`$0 -i ./src-a/ -i ./src-b/ -o strings.json`, 'Extract (ts, html) from multiple paths') - .example(`$0 -i './{src-a,src-b}/' -o strings.json`, 'Extract (ts, html) from multiple paths using brace expansion') - .example(`$0 -i ./src/ -o ./i18n/da.json -o ./i18n/en.json`, 'Extract (ts, html) and save to da.json and en.json') - .example(`$0 -i ./src/ -o './i18n/{en,da}.json'`, 'Extract (ts, html) and save to da.json and en.json using brace expansion') - .example(`$0 -i './src/**/*.{ts,tsx,html}' -o strings.json`, 'Extract from ts, tsx and html') - .example(`$0 -i './src/**/!(*.spec).{ts,html}' -o strings.json`, 'Extract from ts, html, excluding files with ".spec" in filename') - .wrap(110) - .exitProcess(true) - .parse(process.argv); -const extractTask = new ExtractTask(cli.input, cli.output, { - replace: cli.replace -}); -const parsers = [new PipeParser(), new DirectiveParser(), new ServiceParser(), new MarkerParser()]; -extractTask.setParsers(parsers); -const postProcessors = []; -if (cli.clean) { - postProcessors.push(new PurgeObsoleteKeysPostProcessor()); -} -if (cli.keyAsDefaultValue) { - postProcessors.push(new KeyAsDefaultValuePostProcessor()); -} -else if (cli.nullAsDefaultValue) { - postProcessors.push(new NullAsDefaultValuePostProcessor()); -} -else if (cli.stringAsDefaultValue) { - postProcessors.push(new StringAsDefaultValuePostProcessor({ defaultValue: cli.stringAsDefaultValue })); -} -if (cli.sort) { - postProcessors.push(new SortByKeyPostProcessor()); -} -extractTask.setPostProcessors(postProcessors); -const compiler = CompilerFactory.create(cli.format, { - indentation: cli.formatIndentation -}); -extractTask.setCompiler(compiler); -try { - extractTask.execute(); - console.log(green('\nDone.\n')); - console.log(donateMessage); - process.exit(0); -} -catch (e) { - console.log(red(`\nAn error occurred: ${e}\n`)); - process.exit(1); -} -//# sourceMappingURL=cli.js.map \ No newline at end of file diff --git a/dist/cli/tasks/extract.task.d.ts b/dist/cli/tasks/extract.task.d.ts deleted file mode 100644 index b8c1d670..00000000 --- a/dist/cli/tasks/extract.task.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { TranslationCollection } from '../../utils/translation.collection.js'; -import { TaskInterface } from './task.interface.js'; -import { ParserInterface } from '../../parsers/parser.interface.js'; -import { PostProcessorInterface } from '../../post-processors/post-processor.interface.js'; -import { CompilerInterface } from '../../compilers/compiler.interface.js'; -export interface ExtractTaskOptionsInterface { - replace?: boolean; -} -export declare class ExtractTask implements TaskInterface { - protected inputs: string[]; - protected outputs: string[]; - protected options: ExtractTaskOptionsInterface; - protected parsers: ParserInterface[]; - protected postProcessors: PostProcessorInterface[]; - protected compiler: CompilerInterface; - constructor(inputs: string[], outputs: string[], options?: ExtractTaskOptionsInterface); - execute(): void; - setParsers(parsers: ParserInterface[]): this; - setPostProcessors(postProcessors: PostProcessorInterface[]): this; - setCompiler(compiler: CompilerInterface): this; - protected extract(): TranslationCollection; - protected process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection; - protected save(output: string, collection: TranslationCollection): void; - protected getFiles(pattern: string): string[]; - protected out(...args: any[]): void; - protected printEnabledParsers(): void; - protected printEnabledPostProcessors(): void; - protected printEnabledCompiler(): void; -} diff --git a/dist/cli/tasks/extract.task.js b/dist/cli/tasks/extract.task.js deleted file mode 100644 index 23f06c60..00000000 --- a/dist/cli/tasks/extract.task.js +++ /dev/null @@ -1,142 +0,0 @@ -import { TranslationCollection } from '../../utils/translation.collection.js'; -import { cyan, green, bold, dim, red } from 'colorette'; -import pkg from 'glob'; -const { sync } = pkg; -import * as fs from 'fs'; -import * as path from 'path'; -import * as mkdirp from 'mkdirp'; -export class ExtractTask { - inputs; - outputs; - options = { - replace: false - }; - parsers = []; - postProcessors = []; - compiler; - constructor(inputs, outputs, options) { - this.inputs = inputs; - this.outputs = outputs; - this.inputs = inputs.map((input) => path.resolve(input)); - this.outputs = outputs.map((output) => path.resolve(output)); - this.options = { ...this.options, ...options }; - } - execute() { - if (!this.compiler) { - throw new Error('No compiler configured'); - } - this.printEnabledParsers(); - this.printEnabledPostProcessors(); - this.printEnabledCompiler(); - this.out(bold('Extracting:')); - const extracted = this.extract(); - this.out(green(`\nFound %d strings.\n`), extracted.count()); - this.out(bold('Saving:')); - this.outputs.forEach((output) => { - let dir = output; - let filename = `strings.${this.compiler.extension}`; - if (!fs.existsSync(output) || !fs.statSync(output).isDirectory()) { - dir = path.dirname(output); - filename = path.basename(output); - } - const outputPath = path.join(dir, filename); - let existing = new TranslationCollection(); - if (!this.options.replace && fs.existsSync(outputPath)) { - try { - existing = this.compiler.parse(fs.readFileSync(outputPath, 'utf-8')); - } - catch (e) { - this.out(`%s %s`, dim(`- ${outputPath}`), red(`[ERROR]`)); - throw e; - } - } - const draft = extracted.union(existing); - const final = this.process(draft, extracted, existing); - try { - let event = 'CREATED'; - if (fs.existsSync(outputPath)) { - this.options.replace ? (event = 'REPLACED') : (event = 'MERGED'); - } - this.save(outputPath, final); - this.out(`%s %s`, dim(`- ${outputPath}`), green(`[${event}]`)); - } - catch (e) { - this.out(`%s %s`, dim(`- ${outputPath}`), red(`[ERROR]`)); - throw e; - } - }); - } - setParsers(parsers) { - this.parsers = parsers; - return this; - } - setPostProcessors(postProcessors) { - this.postProcessors = postProcessors; - return this; - } - setCompiler(compiler) { - this.compiler = compiler; - return this; - } - extract() { - let collection = new TranslationCollection(); - this.inputs.forEach((pattern) => { - this.getFiles(pattern).forEach((filePath) => { - this.out(dim('- %s'), filePath); - const contents = fs.readFileSync(filePath, 'utf-8'); - this.parsers.forEach((parser) => { - const extracted = parser.extract(contents, filePath); - if (extracted instanceof TranslationCollection) { - collection = collection.union(extracted); - } - }); - }); - }); - return collection; - } - process(draft, extracted, existing) { - this.postProcessors.forEach((postProcessor) => { - draft = postProcessor.process(draft, extracted, existing); - }); - return draft; - } - save(output, collection) { - const dir = path.dirname(output); - if (!fs.existsSync(dir)) { - mkdirp.sync(dir); - } - fs.writeFileSync(output, this.compiler.compile(collection)); - } - getFiles(pattern) { - return sync(pattern).filter((filePath) => fs.statSync(filePath).isFile()); - } - out(...args) { - console.log.apply(this, arguments); - } - printEnabledParsers() { - this.out(cyan('Enabled parsers:')); - if (this.parsers.length) { - this.out(cyan(dim(this.parsers.map((parser) => `- ${parser.constructor.name}`).join('\n')))); - } - else { - this.out(cyan(dim('(none)'))); - } - this.out(); - } - printEnabledPostProcessors() { - this.out(cyan('Enabled post processors:')); - if (this.postProcessors.length) { - this.out(cyan(dim(this.postProcessors.map((postProcessor) => `- ${postProcessor.constructor.name}`).join('\n')))); - } - else { - this.out(cyan(dim('(none)'))); - } - this.out(); - } - printEnabledCompiler() { - this.out(cyan('Compiler:')); - this.out(cyan(dim(`- ${this.compiler.constructor.name}`))); - this.out(); - } -} -//# sourceMappingURL=extract.task.js.map \ No newline at end of file diff --git a/dist/cli/tasks/task.interface.d.ts b/dist/cli/tasks/task.interface.d.ts deleted file mode 100644 index 5e1fad7e..00000000 --- a/dist/cli/tasks/task.interface.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface TaskInterface { - execute(): void; -} diff --git a/dist/cli/tasks/task.interface.js b/dist/cli/tasks/task.interface.js deleted file mode 100644 index 9b184e8d..00000000 --- a/dist/cli/tasks/task.interface.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=task.interface.js.map \ No newline at end of file diff --git a/dist/compilers/compiler.factory.d.ts b/dist/compilers/compiler.factory.d.ts deleted file mode 100644 index 8c69bf8e..00000000 --- a/dist/compilers/compiler.factory.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CompilerInterface } from '../compilers/compiler.interface.js'; -export declare class CompilerFactory { - static create(format: string, options?: {}): CompilerInterface; -} diff --git a/dist/compilers/compiler.factory.js b/dist/compilers/compiler.factory.js deleted file mode 100644 index aa12737d..00000000 --- a/dist/compilers/compiler.factory.js +++ /dev/null @@ -1,18 +0,0 @@ -import { JsonCompiler } from '../compilers/json.compiler.js'; -import { NamespacedJsonCompiler } from '../compilers/namespaced-json.compiler.js'; -import { PoCompiler } from '../compilers/po.compiler.js'; -export class CompilerFactory { - static create(format, options) { - switch (format) { - case 'pot': - return new PoCompiler(options); - case 'json': - return new JsonCompiler(options); - case 'namespaced-json': - return new NamespacedJsonCompiler(options); - default: - throw new Error(`Unknown format: ${format}`); - } - } -} -//# sourceMappingURL=compiler.factory.js.map \ No newline at end of file diff --git a/dist/compilers/compiler.interface.d.ts b/dist/compilers/compiler.interface.d.ts deleted file mode 100644 index 078c663b..00000000 --- a/dist/compilers/compiler.interface.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { TranslationCollection } from '../utils/translation.collection.js'; -export interface CompilerInterface { - extension: string; - compile(collection: TranslationCollection): string; - parse(contents: string): TranslationCollection; -} diff --git a/dist/compilers/compiler.interface.js b/dist/compilers/compiler.interface.js deleted file mode 100644 index 8ab82e4e..00000000 --- a/dist/compilers/compiler.interface.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=compiler.interface.js.map \ No newline at end of file diff --git a/dist/compilers/json.compiler.d.ts b/dist/compilers/json.compiler.d.ts deleted file mode 100644 index ecc6a769..00000000 --- a/dist/compilers/json.compiler.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { CompilerInterface } from './compiler.interface.js'; -import { TranslationCollection } from '../utils/translation.collection.js'; -export declare class JsonCompiler implements CompilerInterface { - indentation: string; - extension: string; - constructor(options?: any); - compile(collection: TranslationCollection): string; - parse(contents: string): TranslationCollection; - protected isNamespacedJsonFormat(values: any): boolean; -} diff --git a/dist/compilers/json.compiler.js b/dist/compilers/json.compiler.js deleted file mode 100644 index 3ca86957..00000000 --- a/dist/compilers/json.compiler.js +++ /dev/null @@ -1,27 +0,0 @@ -import { TranslationCollection } from '../utils/translation.collection.js'; -import { stripBOM } from '../utils/utils.js'; -import pkg from 'flat'; -const { flatten } = pkg; -export class JsonCompiler { - indentation = '\t'; - extension = 'json'; - constructor(options) { - if (options && typeof options.indentation !== 'undefined') { - this.indentation = options.indentation; - } - } - compile(collection) { - return JSON.stringify(collection.values, null, this.indentation); - } - parse(contents) { - let values = JSON.parse(stripBOM(contents)); - if (this.isNamespacedJsonFormat(values)) { - values = flatten(values); - } - return new TranslationCollection(values); - } - isNamespacedJsonFormat(values) { - return Object.keys(values).some((key) => typeof values[key] === 'object'); - } -} -//# sourceMappingURL=json.compiler.js.map \ No newline at end of file diff --git a/dist/compilers/namespaced-json.compiler.d.ts b/dist/compilers/namespaced-json.compiler.d.ts deleted file mode 100644 index c6ba59e0..00000000 --- a/dist/compilers/namespaced-json.compiler.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { CompilerInterface } from './compiler.interface.js'; -import { TranslationCollection } from '../utils/translation.collection.js'; -export declare class NamespacedJsonCompiler implements CompilerInterface { - indentation: string; - extension: string; - constructor(options?: any); - compile(collection: TranslationCollection): string; - parse(contents: string): TranslationCollection; -} diff --git a/dist/compilers/namespaced-json.compiler.js b/dist/compilers/namespaced-json.compiler.js deleted file mode 100644 index 446e01a9..00000000 --- a/dist/compilers/namespaced-json.compiler.js +++ /dev/null @@ -1,24 +0,0 @@ -import { TranslationCollection } from '../utils/translation.collection.js'; -import { stripBOM } from '../utils/utils.js'; -import pkg from 'flat'; -const { flatten, unflatten } = pkg; -export class NamespacedJsonCompiler { - indentation = '\t'; - extension = 'json'; - constructor(options) { - if (options && typeof options.indentation !== 'undefined') { - this.indentation = options.indentation; - } - } - compile(collection) { - const values = unflatten(collection.values, { - object: true - }); - return JSON.stringify(values, null, this.indentation); - } - parse(contents) { - const values = flatten(JSON.parse(stripBOM(contents))); - return new TranslationCollection(values); - } -} -//# sourceMappingURL=namespaced-json.compiler.js.map \ No newline at end of file diff --git a/dist/compilers/po.compiler.d.ts b/dist/compilers/po.compiler.d.ts deleted file mode 100644 index 891c2ce2..00000000 --- a/dist/compilers/po.compiler.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { CompilerInterface } from './compiler.interface.js'; -import { TranslationCollection } from '../utils/translation.collection.js'; -export declare class PoCompiler implements CompilerInterface { - extension: string; - domain: string; - constructor(options?: any); - compile(collection: TranslationCollection): string; - parse(contents: string): TranslationCollection; -} diff --git a/dist/compilers/po.compiler.js b/dist/compilers/po.compiler.js deleted file mode 100644 index b57a771e..00000000 --- a/dist/compilers/po.compiler.js +++ /dev/null @@ -1,47 +0,0 @@ -import { TranslationCollection } from '../utils/translation.collection.js'; -import pkg from 'gettext-parser'; -const { po } = pkg; -export class PoCompiler { - extension = 'po'; - domain = ''; - constructor(options) { } - compile(collection) { - const data = { - charset: 'utf-8', - headers: { - 'mime-version': '1.0', - 'content-type': 'text/plain; charset=utf-8', - 'content-transfer-encoding': '8bit' - }, - translations: { - [this.domain]: Object.keys(collection.values).reduce((translations, key) => { - return { - ...translations, - [key]: { - msgid: key, - msgstr: collection.get(key) - } - }; - }, {}) - } - }; - return po.compile(data).toString('utf8'); - } - parse(contents) { - const collection = new TranslationCollection(); - const parsedPo = po.parse(contents, 'utf8'); - if (!parsedPo.translations.hasOwnProperty(this.domain)) { - return collection; - } - const values = Object.keys(parsedPo.translations[this.domain]) - .filter((key) => key.length > 0) - .reduce((result, key) => { - return { - ...result, - [key]: parsedPo.translations[this.domain][key].msgstr.pop() - }; - }, {}); - return new TranslationCollection(values); - } -} -//# sourceMappingURL=po.compiler.js.map \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 60ac036f..00000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export * from './utils/translation.collection.js'; -export * from './utils/utils.js'; -export * from './cli/cli.js'; -export * from './cli/tasks/task.interface.js'; -export * from './cli/tasks/extract.task.js'; -export * from './parsers/parser.interface.js'; -export * from './parsers/directive.parser.js'; -export * from './parsers/pipe.parser.js'; -export * from './parsers/service.parser.js'; -export * from './parsers/marker.parser.js'; -export * from './compilers/compiler.interface.js'; -export * from './compilers/compiler.factory.js'; -export * from './compilers/json.compiler.js'; -export * from './compilers/namespaced-json.compiler.js'; -export * from './compilers/po.compiler.js'; -export * from './post-processors/post-processor.interface.js'; -export * from './post-processors/key-as-default-value.post-processor.js'; -export * from './post-processors/purge-obsolete-keys.post-processor.js'; -export * from './post-processors/sort-by-key.post-processor.js'; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index a8ed0697..00000000 --- a/dist/index.js +++ /dev/null @@ -1,20 +0,0 @@ -export * from './utils/translation.collection.js'; -export * from './utils/utils.js'; -export * from './cli/cli.js'; -export * from './cli/tasks/task.interface.js'; -export * from './cli/tasks/extract.task.js'; -export * from './parsers/parser.interface.js'; -export * from './parsers/directive.parser.js'; -export * from './parsers/pipe.parser.js'; -export * from './parsers/service.parser.js'; -export * from './parsers/marker.parser.js'; -export * from './compilers/compiler.interface.js'; -export * from './compilers/compiler.factory.js'; -export * from './compilers/json.compiler.js'; -export * from './compilers/namespaced-json.compiler.js'; -export * from './compilers/po.compiler.js'; -export * from './post-processors/post-processor.interface.js'; -export * from './post-processors/key-as-default-value.post-processor.js'; -export * from './post-processors/purge-obsolete-keys.post-processor.js'; -export * from './post-processors/sort-by-key.post-processor.js'; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/parsers/directive.parser.d.ts b/dist/parsers/directive.parser.d.ts deleted file mode 100644 index 3559b925..00000000 --- a/dist/parsers/directive.parser.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { TmplAstNode as Node, TmplAstElement as Element, TmplAstText as Text, TmplAstTemplate as Template, TmplAstTextAttribute as TextAttribute, TmplAstBoundAttribute as BoundAttribute, AST, LiteralPrimitive } from '@angular/compiler'; -import { ParserInterface } from './parser.interface.js'; -import { TranslationCollection } from '../utils/translation.collection.js'; -declare type ElementLike = Element | Template; -export declare class DirectiveParser implements ParserInterface { - extract(source: string, filePath: string): TranslationCollection | null; - protected getElementsWithTranslateAttribute(nodes: Node[]): ElementLike[]; - protected getTextNodes(element: ElementLike): Text[]; - protected hasAttribute(element: ElementLike, name: string): boolean; - protected getAttribute(element: ElementLike, name: string): TextAttribute; - protected hasBoundAttribute(element: ElementLike, name: string): boolean; - protected getBoundAttribute(element: ElementLike, name: string): BoundAttribute; - protected getLiteralPrimitives(exp: AST): LiteralPrimitive[]; - protected isElementLike(node: Node): node is ElementLike; - protected isText(node: Node): node is Text; - protected parseTemplate(template: string, path: string): Node[]; -} -export {}; diff --git a/dist/parsers/directive.parser.js b/dist/parsers/directive.parser.js deleted file mode 100644 index e6f20afb..00000000 --- a/dist/parsers/directive.parser.js +++ /dev/null @@ -1,106 +0,0 @@ -import { parseTemplate, TmplAstElement as Element, TmplAstText as Text, TmplAstTemplate as Template, ASTWithSource, LiteralPrimitive, Conditional, Binary, BindingPipe, Interpolation, LiteralArray, LiteralMap } from '@angular/compiler'; -import { TranslationCollection } from '../utils/translation.collection.js'; -import { isPathAngularComponent, extractComponentInlineTemplate } from '../utils/utils.js'; -const TRANSLATE_ATTR_NAME = 'translate'; -export class DirectiveParser { - extract(source, filePath) { - let collection = new TranslationCollection(); - if (filePath && isPathAngularComponent(filePath)) { - source = extractComponentInlineTemplate(source); - } - const nodes = this.parseTemplate(source, filePath); - const elements = this.getElementsWithTranslateAttribute(nodes); - elements.forEach((element) => { - const attribute = this.getAttribute(element, TRANSLATE_ATTR_NAME); - if (attribute?.value) { - collection = collection.add(attribute.value); - return; - } - const boundAttribute = this.getBoundAttribute(element, TRANSLATE_ATTR_NAME); - if (boundAttribute?.value) { - this.getLiteralPrimitives(boundAttribute.value).forEach((literalPrimitive) => { - collection = collection.add(literalPrimitive.value); - }); - return; - } - const textNodes = this.getTextNodes(element); - textNodes.forEach((textNode) => { - collection = collection.add(textNode.value.trim()); - }); - }); - return collection; - } - getElementsWithTranslateAttribute(nodes) { - let elements = []; - nodes.filter(this.isElementLike).forEach((element) => { - if (this.hasAttribute(element, TRANSLATE_ATTR_NAME)) { - elements = [...elements, element]; - } - if (this.hasBoundAttribute(element, TRANSLATE_ATTR_NAME)) { - elements = [...elements, element]; - } - const childElements = this.getElementsWithTranslateAttribute(element.children); - if (childElements.length) { - elements = [...elements, ...childElements]; - } - }); - return elements; - } - getTextNodes(element) { - return element.children.filter(this.isText); - } - hasAttribute(element, name) { - return this.getAttribute(element, name) !== undefined; - } - getAttribute(element, name) { - return element.attributes.find((attribute) => attribute.name === name); - } - hasBoundAttribute(element, name) { - return this.getBoundAttribute(element, name) !== undefined; - } - getBoundAttribute(element, name) { - return element.inputs.find((input) => input.name === name); - } - getLiteralPrimitives(exp) { - if (exp instanceof LiteralPrimitive) { - return [exp]; - } - let visit = []; - if (exp instanceof Interpolation) { - visit = exp.expressions; - } - else if (exp instanceof LiteralArray) { - visit = exp.expressions; - } - else if (exp instanceof LiteralMap) { - visit = exp.values; - } - else if (exp instanceof BindingPipe) { - visit = [exp.exp]; - } - else if (exp instanceof Conditional) { - visit = [exp.trueExp, exp.falseExp]; - } - else if (exp instanceof Binary) { - visit = [exp.left, exp.right]; - } - else if (exp instanceof ASTWithSource) { - visit = [exp.ast]; - } - let results = []; - visit.forEach((child) => { - results = [...results, ...this.getLiteralPrimitives(child)]; - }); - return results; - } - isElementLike(node) { - return node instanceof Element || node instanceof Template; - } - isText(node) { - return node instanceof Text; - } - parseTemplate(template, path) { - return parseTemplate(template, path).nodes; - } -} -//# sourceMappingURL=directive.parser.js.map \ No newline at end of file diff --git a/dist/parsers/marker.parser.d.ts b/dist/parsers/marker.parser.d.ts deleted file mode 100644 index ea8043e5..00000000 --- a/dist/parsers/marker.parser.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { ParserInterface } from './parser.interface.js'; -import { TranslationCollection } from '../utils/translation.collection.js'; -export declare class MarkerParser implements ParserInterface { - extract(source: string, filePath: string): TranslationCollection | null; -} diff --git a/dist/parsers/marker.parser.js b/dist/parsers/marker.parser.js deleted file mode 100644 index 519f0ede..00000000 --- a/dist/parsers/marker.parser.js +++ /dev/null @@ -1,26 +0,0 @@ -import { tsquery } from '@phenomnomnominal/tsquery'; -import { TranslationCollection } from '../utils/translation.collection.js'; -import { getNamedImportAlias, findFunctionCallExpressions, getStringsFromExpression } from '../utils/ast-helpers.js'; -const MARKER_MODULE_NAME = '@biesbjerg/ngx-translate-extract-marker'; -const MARKER_IMPORT_NAME = 'marker'; -export class MarkerParser { - extract(source, filePath) { - const sourceFile = tsquery.ast(source, filePath); - const markerImportName = getNamedImportAlias(sourceFile, MARKER_MODULE_NAME, MARKER_IMPORT_NAME); - if (!markerImportName) { - return null; - } - let collection = new TranslationCollection(); - const callExpressions = findFunctionCallExpressions(sourceFile, markerImportName); - callExpressions.forEach((callExpression) => { - const [firstArg] = callExpression.arguments; - if (!firstArg) { - return; - } - const strings = getStringsFromExpression(firstArg); - collection = collection.addKeys(strings); - }); - return collection; - } -} -//# sourceMappingURL=marker.parser.js.map \ No newline at end of file diff --git a/dist/parsers/parser.interface.d.ts b/dist/parsers/parser.interface.d.ts deleted file mode 100644 index f958fd5a..00000000 --- a/dist/parsers/parser.interface.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { TranslationCollection } from '../utils/translation.collection.js'; -export interface ParserInterface { - extract(source: string, filePath: string): TranslationCollection | null; -} diff --git a/dist/parsers/parser.interface.js b/dist/parsers/parser.interface.js deleted file mode 100644 index 883cae22..00000000 --- a/dist/parsers/parser.interface.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=parser.interface.js.map \ No newline at end of file diff --git a/dist/parsers/pipe.parser.d.ts b/dist/parsers/pipe.parser.d.ts deleted file mode 100644 index 78c8a520..00000000 --- a/dist/parsers/pipe.parser.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AST, TmplAstNode, BindingPipe, LiteralPrimitive, Conditional } from '@angular/compiler'; -import { ParserInterface } from './parser.interface.js'; -import { TranslationCollection } from '../utils/translation.collection.js'; -export declare class PipeParser implements ParserInterface { - extract(source: string, filePath: string): TranslationCollection | null; - protected findPipesInNode(node: any): BindingPipe[]; - protected parseTranslationKeysFromPipe(pipeContent: BindingPipe | LiteralPrimitive | Conditional): string[]; - protected getTranslatablesFromAst(ast: AST): BindingPipe[]; - protected getTranslatablesFromAsts(asts: AST[]): BindingPipe[]; - protected flatten(array: T[][]): T[]; - protected expressionIsOrHasBindingPipe(exp: any): exp is BindingPipe; - protected parseTemplate(template: string, path: string): TmplAstNode[]; -} diff --git a/dist/parsers/pipe.parser.js b/dist/parsers/pipe.parser.js deleted file mode 100644 index 555047b8..00000000 --- a/dist/parsers/pipe.parser.js +++ /dev/null @@ -1,108 +0,0 @@ -import { parseTemplate, BindingPipe, LiteralPrimitive, Conditional, Binary, LiteralMap, LiteralArray, Interpolation, Call } from '@angular/compiler'; -import { TranslationCollection } from '../utils/translation.collection.js'; -import { isPathAngularComponent, extractComponentInlineTemplate } from '../utils/utils.js'; -const TRANSLATE_PIPE_NAME = 'translate'; -export class PipeParser { - extract(source, filePath) { - if (filePath && isPathAngularComponent(filePath)) { - source = extractComponentInlineTemplate(source); - } - let collection = new TranslationCollection(); - const nodes = this.parseTemplate(source, filePath); - const pipes = nodes.map((node) => this.findPipesInNode(node)).flat(); - pipes.forEach((pipe) => { - this.parseTranslationKeysFromPipe(pipe).forEach((key) => { - collection = collection.add(key); - }); - }); - return collection; - } - findPipesInNode(node) { - let ret = []; - if (node?.children) { - ret = node.children.reduce((result, childNode) => { - const children = this.findPipesInNode(childNode); - return result.concat(children); - }, [ret]); - } - if (node?.value?.ast) { - ret.push(...this.getTranslatablesFromAst(node.value.ast)); - } - if (node?.attributes) { - const translateableAttributes = node.attributes.filter((attr) => { - return attr.name === TRANSLATE_PIPE_NAME; - }); - ret = [...ret, ...translateableAttributes]; - } - if (node?.inputs) { - node.inputs.forEach((input) => { - if (input?.value?.ast) { - ret.push(...this.getTranslatablesFromAst(input.value.ast)); - } - }); - } - return ret; - } - parseTranslationKeysFromPipe(pipeContent) { - const ret = []; - if (pipeContent instanceof LiteralPrimitive) { - ret.push(pipeContent.value); - } - else if (pipeContent instanceof Conditional) { - const trueExp = pipeContent.trueExp; - ret.push(...this.parseTranslationKeysFromPipe(trueExp)); - const falseExp = pipeContent.falseExp; - ret.push(...this.parseTranslationKeysFromPipe(falseExp)); - } - else if (pipeContent instanceof BindingPipe) { - ret.push(...this.parseTranslationKeysFromPipe(pipeContent.exp)); - } - return ret; - } - getTranslatablesFromAst(ast) { - if (this.expressionIsOrHasBindingPipe(ast)) { - return [ast]; - } - if (ast instanceof Interpolation) { - return this.getTranslatablesFromAsts(ast.expressions); - } - if (ast instanceof Conditional) { - return this.getTranslatablesFromAsts([ast.trueExp, ast.falseExp]); - } - if (ast instanceof Binary) { - return this.getTranslatablesFromAsts([ast.left, ast.right]); - } - if (ast instanceof BindingPipe) { - return this.getTranslatablesFromAst(ast.exp); - } - if (ast instanceof LiteralMap) { - return this.getTranslatablesFromAsts(ast.values); - } - if (ast instanceof LiteralArray) { - return this.getTranslatablesFromAsts(ast.expressions); - } - if (ast instanceof Call) { - return this.getTranslatablesFromAsts(ast.args); - } - return []; - } - getTranslatablesFromAsts(asts) { - return this.flatten(asts.map((ast) => this.getTranslatablesFromAst(ast))); - } - flatten(array) { - return [].concat(...array); - } - expressionIsOrHasBindingPipe(exp) { - if (exp.name && exp.name === TRANSLATE_PIPE_NAME) { - return true; - } - if (exp.exp && exp.exp instanceof BindingPipe) { - return this.expressionIsOrHasBindingPipe(exp.exp); - } - return false; - } - parseTemplate(template, path) { - return parseTemplate(template, path).nodes; - } -} -//# sourceMappingURL=pipe.parser.js.map \ No newline at end of file diff --git a/dist/parsers/service.parser.d.ts b/dist/parsers/service.parser.d.ts deleted file mode 100644 index 149a7431..00000000 --- a/dist/parsers/service.parser.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ClassDeclaration, CallExpression } from 'typescript'; -import { ParserInterface } from './parser.interface.js'; -import { TranslationCollection } from '../utils/translation.collection.js'; -export declare class ServiceParser implements ParserInterface { - extract(source: string, filePath: string): TranslationCollection | null; - protected findConstructorParamCallExpressions(classDeclaration: ClassDeclaration): CallExpression[]; - protected findPropertyCallExpressions(classDeclaration: ClassDeclaration): CallExpression[]; -} diff --git a/dist/parsers/service.parser.js b/dist/parsers/service.parser.js deleted file mode 100644 index 35209142..00000000 --- a/dist/parsers/service.parser.js +++ /dev/null @@ -1,46 +0,0 @@ -import { tsquery } from '@phenomnomnominal/tsquery'; -import { TranslationCollection } from '../utils/translation.collection.js'; -import { findClassDeclarations, findClassPropertyByType, findPropertyCallExpressions, findMethodCallExpressions, getStringsFromExpression, findMethodParameterByType, findConstructorDeclaration } from '../utils/ast-helpers.js'; -const TRANSLATE_SERVICE_TYPE_REFERENCE = 'TranslateService'; -const TRANSLATE_SERVICE_METHOD_NAMES = ['get', 'instant', 'stream']; -export class ServiceParser { - extract(source, filePath) { - const sourceFile = tsquery.ast(source, filePath); - const classDeclarations = findClassDeclarations(sourceFile); - if (!classDeclarations) { - return null; - } - let collection = new TranslationCollection(); - classDeclarations.forEach((classDeclaration) => { - const callExpressions = [ - ...this.findConstructorParamCallExpressions(classDeclaration), - ...this.findPropertyCallExpressions(classDeclaration) - ]; - callExpressions.forEach((callExpression) => { - const [firstArg] = callExpression.arguments; - if (!firstArg) { - return; - } - const strings = getStringsFromExpression(firstArg); - collection = collection.addKeys(strings); - }); - }); - return collection; - } - findConstructorParamCallExpressions(classDeclaration) { - const constructorDeclaration = findConstructorDeclaration(classDeclaration); - if (!constructorDeclaration) { - return []; - } - const paramName = findMethodParameterByType(constructorDeclaration, TRANSLATE_SERVICE_TYPE_REFERENCE); - return findMethodCallExpressions(constructorDeclaration, paramName, TRANSLATE_SERVICE_METHOD_NAMES); - } - findPropertyCallExpressions(classDeclaration) { - const propName = findClassPropertyByType(classDeclaration, TRANSLATE_SERVICE_TYPE_REFERENCE); - if (!propName) { - return []; - } - return findPropertyCallExpressions(classDeclaration, propName, TRANSLATE_SERVICE_METHOD_NAMES); - } -} -//# sourceMappingURL=service.parser.js.map \ No newline at end of file diff --git a/dist/post-processors/key-as-default-value.post-processor.d.ts b/dist/post-processors/key-as-default-value.post-processor.d.ts deleted file mode 100644 index 1d4b8db2..00000000 --- a/dist/post-processors/key-as-default-value.post-processor.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { TranslationCollection } from '../utils/translation.collection.js'; -import { PostProcessorInterface } from './post-processor.interface.js'; -export declare class KeyAsDefaultValuePostProcessor implements PostProcessorInterface { - name: string; - process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection; -} diff --git a/dist/post-processors/key-as-default-value.post-processor.js b/dist/post-processors/key-as-default-value.post-processor.js deleted file mode 100644 index f8143b14..00000000 --- a/dist/post-processors/key-as-default-value.post-processor.js +++ /dev/null @@ -1,7 +0,0 @@ -export class KeyAsDefaultValuePostProcessor { - name = 'KeyAsDefaultValue'; - process(draft, extracted, existing) { - return draft.map((key, val) => (val === '' ? key : val)); - } -} -//# sourceMappingURL=key-as-default-value.post-processor.js.map \ No newline at end of file diff --git a/dist/post-processors/null-as-default-value.post-processor.d.ts b/dist/post-processors/null-as-default-value.post-processor.d.ts deleted file mode 100644 index a4fec4fc..00000000 --- a/dist/post-processors/null-as-default-value.post-processor.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { TranslationCollection } from '../utils/translation.collection.js'; -import { PostProcessorInterface } from './post-processor.interface.js'; -export declare class NullAsDefaultValuePostProcessor implements PostProcessorInterface { - name: string; - process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection; -} diff --git a/dist/post-processors/null-as-default-value.post-processor.js b/dist/post-processors/null-as-default-value.post-processor.js deleted file mode 100644 index c2f797c7..00000000 --- a/dist/post-processors/null-as-default-value.post-processor.js +++ /dev/null @@ -1,7 +0,0 @@ -export class NullAsDefaultValuePostProcessor { - name = 'NullAsDefaultValue'; - process(draft, extracted, existing) { - return draft.map((key, val) => (existing.get(key) === undefined ? null : val)); - } -} -//# sourceMappingURL=null-as-default-value.post-processor.js.map \ No newline at end of file diff --git a/dist/post-processors/post-processor.interface.d.ts b/dist/post-processors/post-processor.interface.d.ts deleted file mode 100644 index 4ee831cc..00000000 --- a/dist/post-processors/post-processor.interface.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { TranslationCollection } from '../utils/translation.collection.js'; -export interface PostProcessorInterface { - name: string; - process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection; -} diff --git a/dist/post-processors/post-processor.interface.js b/dist/post-processors/post-processor.interface.js deleted file mode 100644 index 6b1662d0..00000000 --- a/dist/post-processors/post-processor.interface.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=post-processor.interface.js.map \ No newline at end of file diff --git a/dist/post-processors/purge-obsolete-keys.post-processor.d.ts b/dist/post-processors/purge-obsolete-keys.post-processor.d.ts deleted file mode 100644 index 237d0d7a..00000000 --- a/dist/post-processors/purge-obsolete-keys.post-processor.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { TranslationCollection } from '../utils/translation.collection.js'; -import { PostProcessorInterface } from './post-processor.interface.js'; -export declare class PurgeObsoleteKeysPostProcessor implements PostProcessorInterface { - name: string; - process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection; -} diff --git a/dist/post-processors/purge-obsolete-keys.post-processor.js b/dist/post-processors/purge-obsolete-keys.post-processor.js deleted file mode 100644 index 4fee0b51..00000000 --- a/dist/post-processors/purge-obsolete-keys.post-processor.js +++ /dev/null @@ -1,7 +0,0 @@ -export class PurgeObsoleteKeysPostProcessor { - name = 'PurgeObsoleteKeys'; - process(draft, extracted, existing) { - return draft.intersect(extracted); - } -} -//# sourceMappingURL=purge-obsolete-keys.post-processor.js.map \ No newline at end of file diff --git a/dist/post-processors/sort-by-key.post-processor.d.ts b/dist/post-processors/sort-by-key.post-processor.d.ts deleted file mode 100644 index 78343218..00000000 --- a/dist/post-processors/sort-by-key.post-processor.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { TranslationCollection } from '../utils/translation.collection.js'; -import { PostProcessorInterface } from './post-processor.interface.js'; -export declare class SortByKeyPostProcessor implements PostProcessorInterface { - name: string; - process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection; -} diff --git a/dist/post-processors/sort-by-key.post-processor.js b/dist/post-processors/sort-by-key.post-processor.js deleted file mode 100644 index 6a02b4bf..00000000 --- a/dist/post-processors/sort-by-key.post-processor.js +++ /dev/null @@ -1,7 +0,0 @@ -export class SortByKeyPostProcessor { - name = 'SortByKey'; - process(draft, extracted, existing) { - return draft.sort(); - } -} -//# sourceMappingURL=sort-by-key.post-processor.js.map \ No newline at end of file diff --git a/dist/post-processors/string-as-default-value.post-processor.d.ts b/dist/post-processors/string-as-default-value.post-processor.d.ts deleted file mode 100644 index c49c05ab..00000000 --- a/dist/post-processors/string-as-default-value.post-processor.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { TranslationCollection } from '../utils/translation.collection.js'; -import { PostProcessorInterface } from './post-processor.interface.js'; -interface Options { - defaultValue: string; -} -export declare class StringAsDefaultValuePostProcessor implements PostProcessorInterface { - protected options: Options; - name: string; - constructor(options: Options); - process(draft: TranslationCollection, extracted: TranslationCollection, existing: TranslationCollection): TranslationCollection; -} -export {}; diff --git a/dist/post-processors/string-as-default-value.post-processor.js b/dist/post-processors/string-as-default-value.post-processor.js deleted file mode 100644 index 80c38301..00000000 --- a/dist/post-processors/string-as-default-value.post-processor.js +++ /dev/null @@ -1,11 +0,0 @@ -export class StringAsDefaultValuePostProcessor { - options; - name = 'StringAsDefaultValue'; - constructor(options) { - this.options = options; - } - process(draft, extracted, existing) { - return draft.map((key, val) => (existing.get(key) === undefined ? this.options.defaultValue : val)); - } -} -//# sourceMappingURL=string-as-default-value.post-processor.js.map \ No newline at end of file diff --git a/dist/utils/ast-helpers.d.ts b/dist/utils/ast-helpers.d.ts deleted file mode 100644 index bd0612ee..00000000 --- a/dist/utils/ast-helpers.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Node, NamedImports, ClassDeclaration, ConstructorDeclaration, CallExpression, Expression } from 'typescript'; -export declare function getNamedImports(node: Node, moduleName: string): NamedImports[]; -export declare function getNamedImportAlias(node: Node, moduleName: string, importName: string): string | null; -export declare function findClassDeclarations(node: Node): ClassDeclaration[]; -export declare function findClassPropertyByType(node: ClassDeclaration, type: string): string | null; -export declare function findConstructorDeclaration(node: ClassDeclaration): ConstructorDeclaration; -export declare function findMethodParameterByType(node: Node, type: string): string | null; -export declare function findMethodCallExpressions(node: Node, propName: string, fnName: string | string[]): CallExpression[]; -export declare function findClassPropertyConstructorParameterByType(node: ClassDeclaration, type: string): string | null; -export declare function findClassPropertyDeclarationByType(node: ClassDeclaration, type: string): string | null; -export declare function findFunctionCallExpressions(node: Node, fnName: string | string[]): CallExpression[]; -export declare function findPropertyCallExpressions(node: Node, prop: string, fnName: string | string[]): CallExpression[]; -export declare function getStringsFromExpression(expression: Expression): string[]; diff --git a/dist/utils/ast-helpers.js b/dist/utils/ast-helpers.js deleted file mode 100644 index 4c76b4c5..00000000 --- a/dist/utils/ast-helpers.js +++ /dev/null @@ -1,126 +0,0 @@ -import { tsquery } from '@phenomnomnominal/tsquery'; -import pkg from 'typescript'; -const { SyntaxKind, isStringLiteralLike, isArrayLiteralExpression, isBinaryExpression, isConditionalExpression } = pkg; -export function getNamedImports(node, moduleName) { - const query = `ImportDeclaration[moduleSpecifier.text="${moduleName}"] NamedImports`; - return tsquery(node, query); -} -export function getNamedImportAlias(node, moduleName, importName) { - const [namedImportNode] = getNamedImports(node, moduleName); - if (!namedImportNode) { - return null; - } - const query = `ImportSpecifier:has(Identifier[name="${importName}"]) > Identifier`; - const identifiers = tsquery(namedImportNode, query); - if (identifiers.length === 1) { - return identifiers[0].text; - } - if (identifiers.length > 1) { - return identifiers[identifiers.length - 1].text; - } - return null; -} -export function findClassDeclarations(node) { - const query = 'ClassDeclaration'; - return tsquery(node, query); -} -export function findClassPropertyByType(node, type) { - return findClassPropertyConstructorParameterByType(node, type) || findClassPropertyDeclarationByType(node, type); -} -export function findConstructorDeclaration(node) { - const query = `Constructor`; - const [result] = tsquery(node, query); - return result; -} -export function findMethodParameterByType(node, type) { - const query = `Parameter:has(TypeReference > Identifier[name="${type}"]) > Identifier`; - const [result] = tsquery(node, query); - if (result) { - return result.text; - } - return null; -} -export function findMethodCallExpressions(node, propName, fnName) { - if (Array.isArray(fnName)) { - fnName = fnName.join('|'); - } - const query = `CallExpression > PropertyAccessExpression:has(Identifier[name=/^(${fnName})$/]):has(PropertyAccessExpression:has(Identifier[name="${propName}"]):not(:has(ThisKeyword)))`; - const nodes = tsquery(node, query).map((n) => n.parent); - return nodes; -} -export function findClassPropertyConstructorParameterByType(node, type) { - const query = `Constructor Parameter:has(TypeReference > Identifier[name="${type}"]):has(PublicKeyword,ProtectedKeyword,PrivateKeyword) > Identifier`; - const [result] = tsquery(node, query); - if (result) { - return result.text; - } - return null; -} -export function findClassPropertyDeclarationByType(node, type) { - const query = `PropertyDeclaration:has(TypeReference > Identifier[name="${type}"]) > Identifier`; - const [result] = tsquery(node, query); - if (result) { - return result.text; - } - return null; -} -export function findFunctionCallExpressions(node, fnName) { - if (Array.isArray(fnName)) { - fnName = fnName.join('|'); - } - const query = `CallExpression:has(Identifier[name="${fnName}"]):not(:has(PropertyAccessExpression))`; - const nodes = tsquery(node, query); - return nodes; -} -export function findPropertyCallExpressions(node, prop, fnName) { - if (Array.isArray(fnName)) { - fnName = fnName.join('|'); - } - const query = `CallExpression > PropertyAccessExpression:has(Identifier[name=/^(${fnName})$/]):has(PropertyAccessExpression:has(Identifier[name="${prop}"]):has(ThisKeyword))`; - const nodes = tsquery(node, query).map((n) => n.parent); - return nodes; -} -export function getStringsFromExpression(expression) { - if (isStringLiteralLike(expression)) { - return [expression.text]; - } - if (isArrayLiteralExpression(expression)) { - return expression.elements.reduce((result, element) => { - const strings = getStringsFromExpression(element); - return [...result, ...strings]; - }, []); - } - if (isBinaryExpression(expression)) { - const [left] = getStringsFromExpression(expression.left); - const [right] = getStringsFromExpression(expression.right); - if (expression.operatorToken.kind === SyntaxKind.PlusToken) { - if (typeof left === 'string' && typeof right === 'string') { - return [left + right]; - } - } - if (expression.operatorToken.kind === SyntaxKind.BarBarToken) { - const result = []; - if (typeof left === 'string') { - result.push(left); - } - if (typeof right === 'string') { - result.push(right); - } - return result; - } - } - if (isConditionalExpression(expression)) { - const [whenTrue] = getStringsFromExpression(expression.whenTrue); - const [whenFalse] = getStringsFromExpression(expression.whenFalse); - const result = []; - if (typeof whenTrue === 'string') { - result.push(whenTrue); - } - if (typeof whenFalse === 'string') { - result.push(whenFalse); - } - return result; - } - return []; -} -//# sourceMappingURL=ast-helpers.js.map \ No newline at end of file diff --git a/dist/utils/donate.d.ts b/dist/utils/donate.d.ts deleted file mode 100644 index 5bab0aed..00000000 --- a/dist/utils/donate.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const donateMessage: string; diff --git a/dist/utils/donate.js b/dist/utils/donate.js deleted file mode 100644 index 4bfe4915..00000000 --- a/dist/utils/donate.js +++ /dev/null @@ -1,16 +0,0 @@ -import { yellow } from 'colorette'; -import boxen from 'boxen'; -import terminalLink from 'terminal-link'; -const url = 'https://donate.biesbjerg.com'; -const link = terminalLink(url, url); -const message = ` -If this tool saves you or your company time, please consider making a -donation to support my work and the continued maintainence and development: - -${yellow(link)}`; -export const donateMessage = boxen(message.trim(), { - padding: 1, - margin: 0, - dimBorder: true -}); -//# sourceMappingURL=donate.js.map \ No newline at end of file diff --git a/dist/utils/fs-helpers.d.ts b/dist/utils/fs-helpers.d.ts deleted file mode 100644 index 9ca29b78..00000000 --- a/dist/utils/fs-helpers.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare module 'braces' { - interface Options { - keepEscaping?: boolean; - } -} -export declare function normalizeHomeDir(path: string): string; -export declare function expandPattern(pattern: string): string[]; -export declare function normalizePaths(patterns: string[], defaultPatterns?: string[]): string[]; diff --git a/dist/utils/fs-helpers.js b/dist/utils/fs-helpers.js deleted file mode 100644 index 2d4f593f..00000000 --- a/dist/utils/fs-helpers.js +++ /dev/null @@ -1,26 +0,0 @@ -import * as os from 'os'; -import * as fs from 'fs'; -import braces from 'braces'; -export function normalizeHomeDir(path) { - if (path.substring(0, 1) === '~') { - return `${os.homedir()}/${path.substring(1)}`; - } - return path; -} -export function expandPattern(pattern) { - return braces(pattern, { expand: true, keepEscaping: true }); -} -export function normalizePaths(patterns, defaultPatterns = []) { - return patterns - .map((pattern) => expandPattern(pattern) - .map((path) => { - path = normalizeHomeDir(path); - if (fs.existsSync(path) && fs.statSync(path).isDirectory()) { - return defaultPatterns.map((defaultPattern) => path + defaultPattern); - } - return path; - }) - .flat()) - .flat(); -} -//# sourceMappingURL=fs-helpers.js.map \ No newline at end of file diff --git a/dist/utils/translation.collection.d.ts b/dist/utils/translation.collection.d.ts deleted file mode 100644 index 6a2ed114..00000000 --- a/dist/utils/translation.collection.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -export interface TranslationType { - [key: string]: string; -} -export declare class TranslationCollection { - values: TranslationType; - constructor(values?: TranslationType); - add(key: string, val?: string): TranslationCollection; - addKeys(keys: string[]): TranslationCollection; - remove(key: string): TranslationCollection; - forEach(callback: (key?: string, val?: string) => void): TranslationCollection; - filter(callback: (key?: string, val?: string) => boolean): TranslationCollection; - map(callback: (key?: string, val?: string) => string): TranslationCollection; - union(collection: TranslationCollection): TranslationCollection; - intersect(collection: TranslationCollection): TranslationCollection; - has(key: string): boolean; - get(key: string): string; - keys(): string[]; - count(): number; - isEmpty(): boolean; - sort(compareFn?: (a: string, b: string) => number): TranslationCollection; -} diff --git a/dist/utils/translation.collection.js b/dist/utils/translation.collection.js deleted file mode 100644 index 6e4097ac..00000000 --- a/dist/utils/translation.collection.js +++ /dev/null @@ -1,73 +0,0 @@ -export class TranslationCollection { - values = {}; - constructor(values = {}) { - this.values = values; - } - add(key, val = '') { - return new TranslationCollection({ ...this.values, [key]: val }); - } - addKeys(keys) { - const values = keys.reduce((results, key) => { - return { ...results, [key]: '' }; - }, {}); - return new TranslationCollection({ ...this.values, ...values }); - } - remove(key) { - return this.filter((k) => key !== k); - } - forEach(callback) { - Object.keys(this.values).forEach((key) => callback.call(this, key, this.values[key])); - return this; - } - filter(callback) { - const values = {}; - this.forEach((key, val) => { - if (callback.call(this, key, val)) { - values[key] = val; - } - }); - return new TranslationCollection(values); - } - map(callback) { - const values = {}; - this.forEach((key, val) => { - values[key] = callback.call(this, key, val); - }); - return new TranslationCollection(values); - } - union(collection) { - return new TranslationCollection({ ...this.values, ...collection.values }); - } - intersect(collection) { - const values = {}; - this.filter((key) => collection.has(key)).forEach((key, val) => { - values[key] = val; - }); - return new TranslationCollection(values); - } - has(key) { - return this.values.hasOwnProperty(key); - } - get(key) { - return this.values[key]; - } - keys() { - return Object.keys(this.values); - } - count() { - return Object.keys(this.values).length; - } - isEmpty() { - return Object.keys(this.values).length === 0; - } - sort(compareFn) { - const values = {}; - this.keys() - .sort(compareFn) - .forEach((key) => { - values[key] = this.get(key); - }); - return new TranslationCollection(values); - } -} -//# sourceMappingURL=translation.collection.js.map \ No newline at end of file diff --git a/dist/utils/utils.d.ts b/dist/utils/utils.d.ts deleted file mode 100644 index f5f2b004..00000000 --- a/dist/utils/utils.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare function isPathAngularComponent(path: string): boolean; -export declare function extractComponentInlineTemplate(contents: string): string; -export declare function stripBOM(contents: string): string; diff --git a/dist/utils/utils.js b/dist/utils/utils.js deleted file mode 100644 index 29f927cf..00000000 --- a/dist/utils/utils.js +++ /dev/null @@ -1,15 +0,0 @@ -export function isPathAngularComponent(path) { - return /\.ts|js$/i.test(path); -} -export function extractComponentInlineTemplate(contents) { - const regExp = /template\s*:\s*(["'`])([^\1]*?)\1/; - const match = regExp.exec(contents); - if (match !== null) { - return match[2]; - } - return ''; -} -export function stripBOM(contents) { - return contents.trim(); -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/src/parsers/pipe.parser.ts b/src/parsers/pipe.parser.ts index 7196c756..b02cf7bf 100644 --- a/src/parsers/pipe.parser.ts +++ b/src/parsers/pipe.parser.ts @@ -148,11 +148,11 @@ export class PipeParser implements ParserInterface { } protected expressionIsOrHasBindingPipe(exp: any): exp is BindingPipe { - if (exp.name && exp.name === TRANSLATE_PIPE_NAME) { + if (exp && exp.name && exp.name === TRANSLATE_PIPE_NAME) { return true; } - if (exp.exp && exp.exp instanceof BindingPipe) { - return this.expressionIsOrHasBindingPipe(exp.exp); + if (exp && exp.exp && exp.exp instanceof BindingPipe) { + return this.expressionIsOrHasBindingPipe(exp?.exp); } return false; }