├── .gitignore ├── .npmrc ├── LICENSE ├── README.md ├── README.v2.md ├── package.json ├── pnpm-lock.yaml ├── rr-scripts.ts ├── src ├── load.interfaces.ts ├── main.ts ├── modules │ ├── comment-parser │ │ ├── get-ts-import-comment-config.ts │ │ └── index.ts │ ├── compiler │ │ ├── compile.ts │ │ ├── index.ts │ │ └── transpile.ts │ └── cross-platform │ │ ├── get-js-after-cache-path.ts │ │ └── index.ts ├── providers │ ├── compile │ │ ├── get-cache-dir.ts │ │ ├── get-config.ts │ │ ├── index.ts │ │ └── load.ts │ ├── providers.ts │ └── transpile │ │ ├── get-cache-dir.ts │ │ ├── get-config.ts │ │ ├── index.ts │ │ └── load.ts └── utils │ ├── check-if-file-exists.ts │ ├── index.ts │ └── is-file-newer.ts ├── tests ├── allow-configuration-with-comments.ts ├── assets │ ├── allow-configuration-with-comments │ │ ├── allow-configuration-with-comments-compile.ts │ │ ├── allow-configuration-with-comments-transpile.ts │ │ └── get-other-variable.ts │ ├── import-in-import │ │ └── import-in-import.ts │ ├── library-using │ │ └── library-using.ts │ └── process-cwd-collision │ │ ├── example0.ts │ │ ├── example1.ts │ │ ├── example2.ts │ │ ├── example3.ts │ │ ├── example4.ts │ │ └── example5.ts ├── import-in-import.ts ├── import-without-cache.ts ├── library-using.ts └── nonexistent-typescript-file.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies. 2 | /node_modules 3 | /npm-debug.log 4 | 5 | # Distributables. 6 | /dist 7 | /dist-* 8 | 9 | # Operating systems. 10 | .DS_Store 11 | Thumbs.db 12 | /tsconfig.tsbuildinfo 13 | 14 | # Custom. 15 | /.cache 16 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | # Settings. 2 | recursive-install=false 3 | 4 | save-prefix= 5 | use-node-version=18.15.0 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Artur Kurowski 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 |

ts-import

3 |
Importing TypeScript files dynamically into JavaScript requires additional compilation step, which is troublesome to write for many. Popular `typescript-require` package seems to be obsolete and doesn't allow much customization. Typed alternative to https://github.com/theblacksmith/typescript-require written in TypeScript.
4 |

5 | 6 | [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/radarsu) 7 | 8 | ## Table of contents 9 | 10 | - [Table of contents](#table-of-contents) 11 | - [Features](#features) 12 | - [Install](#install) 13 | - [Usage](#usage) 14 | - [allowConfigurationWithComments](#allowconfigurationwithcomments) 15 | 16 | ## Features 17 | 18 | - **Asynchronous and synchronous version** - uses **import** for async and **require** for sync. 19 | - **Caches JavaScript** files into directory inside **.cache/ts-import**. 20 | - **Fast** - I've benchmarked ways to compare detecting file changes with **fs** module and checking mtimeMs turned out to be fastest (https://jsperf.com/fs-stat-mtime-vs-mtimems). Also, compilation in versions 3+ is approximately 10x faster than in version 2. 21 | - **Few dependencies** - uses only `comment-parser` and my tiny utility package `options-defaults`. 22 | - **Highly flexible and configurable** - all compilerOptions are available under transpileOptions parameter. 23 | - **No interference** - doesn't interfere with native import, require etc. changing their behavior or impacting their performance. 24 | 25 | ## Install 26 | 27 | `npm i ts-import@4` - CJS 28 | `npm i ts-import@5` - ESM 29 | 30 | ## Usage 31 | 32 | ```ts 33 | import * as tsImport from 'ts-import'; 34 | 35 | const main = async () => { 36 | const filePath = `/home/user/file.ts`; 37 | const asyncResult = await tsImport.load(filePath, { 38 | // allowConfigurationWithComments: false, 39 | }); 40 | 41 | // Only available in version 4. 42 | const syncResult = tsImport.loadSync(filePath); 43 | }; 44 | 45 | void main(); 46 | ``` 47 | 48 | ### allowConfigurationWithComments 49 | 50 | You can define if file should be imported in the default `transpile` mode or `compile` mode by placing a comment on top of the specific file. 51 | 52 | Compile mode is slower, but allows the specified file to be part of a complex program - it can import other files etc. 53 | 54 | ```ts 55 | /** 56 | * @tsImport 57 | * { "mode": "compile" } 58 | */ 59 | 60 | import { getOtherVariable } from './get-other-variable'; 61 | 62 | const result = getOtherVariable(); 63 | 64 | export { result }; 65 | ``` -------------------------------------------------------------------------------- /README.v2.md: -------------------------------------------------------------------------------- 1 |

2 |

ts-import

3 |
Importing TypeScript files dynamically into JavaScript requires additional compilation step, which is troublesome to write for many. Popular **typescript-require** package seems to be obsolete and doesn't allow much customization. Typed alternative to https://github.com/theblacksmith/typescript-require written in TypeScript.
4 |

5 | 6 | ## Table of contents 7 | 8 | 1. [Getting Started](#getting-started) 9 | 10 | 2. [Usage](#usage) 11 | 12 | 3. [Features](#features) 13 | 14 | 15 | 16 | ## Getting Started 17 | `npm i ts-import` 18 | 19 | 20 | ## Usage 21 | ```ts 22 | import { tsImport } from 'ts-import'; 23 | 24 | const bootstrap = async () => { 25 | const filePath = `/home/user/file.ts`; 26 | const compiled = await tsImport.compile(filePath); 27 | }; 28 | 29 | bootstrap(); 30 | ``` 31 | 32 | 33 | ## Features 34 | - **Asynchronous** - uses **import** over **require**. 35 | - **Caches JavaScript** files into directory inside **node_modules/ts-import/cache** (pretty much like **typescript-require**). Removing node_modules removes cache as well. 36 | - **Compiler class** - allows making multiple instances of compiler with different configurations and overriding default settings to all of them (i.e. logger) via static "defaults" property: `Compiler.defaults = { ...customDefaults }`. **tsImport** object is a default instance of Compiler class suitable for majority of use-cases. 37 | - **Fast** - I've benchmarked ways to compare detecting file changes with **fs** module and checking mtimeMs turned out to be fastest (https://jsperf.com/fs-stat-mtime-vs-mtimems). 38 | - **Highly flexible and configurable** - all **tsc** flags are available for customization. By default uses: `--module commonjs`, `--target es2015`, `--downlevelIteration`, `--emitDecoratorMetadata`, `--experimentalDecorators`, `--resolveJsonModule`. 39 | - **No interference** - doesn't interfere with native import, require etc. changing their behavior or impacting their performance. 40 | - **Only 1 dependency** - uses only 1 package maintained by myself (which has 0 dependencies). 41 | 42 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ts-import", 3 | "version": "5.0.0-beta.1", 4 | "description": "Import (compile and cache on the fly) TypeScript files dynamically with ease.", 5 | "license": "MIT", 6 | "keywords": [ 7 | "compile", 8 | "dynamic", 9 | "import", 10 | "require", 11 | "typescript" 12 | ], 13 | "files": [ 14 | "dist" 15 | ], 16 | "author": "Artur Kurowski ", 17 | "homepage": "https://github.com/radarsu/ts-import#readme", 18 | "main": "dist/main.js", 19 | "types": "dist/main.d.ts", 20 | "type": "module", 21 | "dependencies": { 22 | "comment-parser": "1.3.1", 23 | "options-defaults": "workspace:2.0.40", 24 | "tslib": "2.5.0" 25 | }, 26 | "devDependencies": { 27 | "@radrat/cli": "3.0.0-beta.9", 28 | "@types/node": "18.15.11", 29 | "ava": "5.2.0", 30 | "typescript": "5.0.4" 31 | }, 32 | "peerDependencies": { 33 | "typescript": "5" 34 | }, 35 | "engines": { 36 | "node": ">=18" 37 | }, 38 | "ava": { 39 | "extensions": { 40 | "ts": "module" 41 | }, 42 | "files": [ 43 | "tests/**/*", 44 | "!tests/assets" 45 | ], 46 | "nodeArguments": [ 47 | "--loader=ts-node/esm" 48 | ] 49 | } 50 | } -------------------------------------------------------------------------------- /pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | lockfileVersion: '9.0' 2 | 3 | settings: 4 | autoInstallPeers: true 5 | excludeLinksFromLockfile: false 6 | 7 | importers: 8 | 9 | .: 10 | dependencies: 11 | comment-parser: 12 | specifier: 1.3.1 13 | version: 1.3.1 14 | options-defaults: 15 | specifier: workspace:2.0.40 16 | version: link:../../any/options-defaults 17 | tslib: 18 | specifier: 2.5.0 19 | version: 2.5.0 20 | devDependencies: 21 | '@radrat/cli': 22 | specifier: 3.0.0-beta.9 23 | version: 3.0.0-beta.9 24 | '@types/node': 25 | specifier: 18.15.11 26 | version: 18.15.11 27 | ava: 28 | specifier: 5.2.0 29 | version: 5.2.0 30 | typescript: 31 | specifier: 5.0.4 32 | version: 5.0.4 33 | 34 | packages: 35 | 36 | '@nodelib/fs.scandir@2.1.5': 37 | resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} 38 | engines: {node: '>= 8'} 39 | 40 | '@nodelib/fs.stat@2.0.5': 41 | resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} 42 | engines: {node: '>= 8'} 43 | 44 | '@nodelib/fs.walk@1.2.8': 45 | resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} 46 | engines: {node: '>= 8'} 47 | 48 | '@radrat/cli-toolkit@0.0.34': 49 | resolution: {integrity: sha512-qvpqhh7htsNlUeEOCPQDH1pmf4OM2qfAqY+8KWwI+2/8ZqJl0Rr+X8jY33Yj4S+JI/b+84uRQqFuhAQjX53lmQ==} 50 | 51 | '@radrat/cli@3.0.0-beta.9': 52 | resolution: {integrity: sha512-Drhi1xycO9hWaTek7Vn+DYp2r5CANy74eXCwf1/32BI4W98rIJBEEKhbfTxVOxpRdNOUiskmNcvmNF3m5PU/aw==} 53 | hasBin: true 54 | 55 | '@radrat/node-logger@0.0.0': 56 | resolution: {integrity: sha512-pJmmVEbAKtlzUeYKZWW2Fsm04YvqjvEV7V6mo5eWayxDSRzYwyEKt6QQeykJthgqAjk7up8/q6Dg3FJ/sgFJ3g==} 57 | 58 | '@types/node@18.15.11': 59 | resolution: {integrity: sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==} 60 | 61 | acorn-walk@8.3.4: 62 | resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} 63 | engines: {node: '>=0.4.0'} 64 | 65 | acorn@8.14.0: 66 | resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} 67 | engines: {node: '>=0.4.0'} 68 | hasBin: true 69 | 70 | aggregate-error@4.0.1: 71 | resolution: {integrity: sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==} 72 | engines: {node: '>=12'} 73 | 74 | ansi-colors@4.1.3: 75 | resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} 76 | engines: {node: '>=6'} 77 | 78 | ansi-regex@5.0.1: 79 | resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} 80 | engines: {node: '>=8'} 81 | 82 | ansi-regex@6.1.0: 83 | resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} 84 | engines: {node: '>=12'} 85 | 86 | ansi-styles@4.3.0: 87 | resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} 88 | engines: {node: '>=8'} 89 | 90 | ansi-styles@6.2.1: 91 | resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} 92 | engines: {node: '>=12'} 93 | 94 | anymatch@3.1.3: 95 | resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} 96 | engines: {node: '>= 8'} 97 | 98 | argparse@1.0.10: 99 | resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} 100 | 101 | array-find-index@1.0.2: 102 | resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} 103 | engines: {node: '>=0.10.0'} 104 | 105 | arrgv@1.0.2: 106 | resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} 107 | engines: {node: '>=8.0.0'} 108 | 109 | arrify@3.0.0: 110 | resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==} 111 | engines: {node: '>=12'} 112 | 113 | async@3.2.6: 114 | resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} 115 | 116 | ava@5.2.0: 117 | resolution: {integrity: sha512-W8yxFXJr/P68JP55eMpQIa6AiXhCX3VeuajM8nolyWNExcMDD6rnIWKTjw0B/+GkFHBIaN6Jd0LtcMThcoqVfg==} 118 | engines: {node: '>=14.19 <15 || >=16.15 <17 || >=18'} 119 | hasBin: true 120 | peerDependencies: 121 | '@ava/typescript': '*' 122 | peerDependenciesMeta: 123 | '@ava/typescript': 124 | optional: true 125 | 126 | balanced-match@1.0.2: 127 | resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} 128 | 129 | binary-extensions@2.3.0: 130 | resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} 131 | engines: {node: '>=8'} 132 | 133 | blueimp-md5@2.19.0: 134 | resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} 135 | 136 | brace-expansion@1.1.11: 137 | resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} 138 | 139 | brace-expansion@2.0.1: 140 | resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} 141 | 142 | braces@3.0.3: 143 | resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} 144 | engines: {node: '>=8'} 145 | 146 | callsites@4.2.0: 147 | resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} 148 | engines: {node: '>=12.20'} 149 | 150 | cbor@8.1.0: 151 | resolution: {integrity: sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==} 152 | engines: {node: '>=12.19'} 153 | 154 | chalk@4.1.2: 155 | resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} 156 | engines: {node: '>=10'} 157 | 158 | chalk@5.4.1: 159 | resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==} 160 | engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} 161 | 162 | chokidar@3.6.0: 163 | resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} 164 | engines: {node: '>= 8.10.0'} 165 | 166 | chunkd@2.0.1: 167 | resolution: {integrity: sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==} 168 | 169 | ci-info@3.9.0: 170 | resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} 171 | engines: {node: '>=8'} 172 | 173 | ci-parallel-vars@1.0.1: 174 | resolution: {integrity: sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==} 175 | 176 | clean-stack@4.2.0: 177 | resolution: {integrity: sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==} 178 | engines: {node: '>=12'} 179 | 180 | clean-yaml-object@0.1.0: 181 | resolution: {integrity: sha512-3yONmlN9CSAkzNwnRCiJQ7Q2xK5mWuEfL3PuTZcAUzhObbXsfsnMptJzXwz93nc5zn9V9TwCVMmV7w4xsm43dw==} 182 | engines: {node: '>=0.10.0'} 183 | 184 | cli-truncate@3.1.0: 185 | resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==} 186 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 187 | 188 | cliui@8.0.1: 189 | resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} 190 | engines: {node: '>=12'} 191 | 192 | code-excerpt@4.0.0: 193 | resolution: {integrity: sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==} 194 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 195 | 196 | color-convert@2.0.1: 197 | resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} 198 | engines: {node: '>=7.0.0'} 199 | 200 | color-name@1.1.4: 201 | resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} 202 | 203 | comment-parser@1.3.1: 204 | resolution: {integrity: sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA==} 205 | engines: {node: '>= 12.0.0'} 206 | 207 | common-path-prefix@3.0.0: 208 | resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} 209 | 210 | concat-map@0.0.1: 211 | resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} 212 | 213 | concordance@5.0.4: 214 | resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} 215 | engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} 216 | 217 | convert-to-spaces@2.0.1: 218 | resolution: {integrity: sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==} 219 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 220 | 221 | currently-unhandled@0.4.1: 222 | resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} 223 | engines: {node: '>=0.10.0'} 224 | 225 | date-time@3.1.0: 226 | resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} 227 | engines: {node: '>=6'} 228 | 229 | debug@4.4.0: 230 | resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} 231 | engines: {node: '>=6.0'} 232 | peerDependencies: 233 | supports-color: '*' 234 | peerDependenciesMeta: 235 | supports-color: 236 | optional: true 237 | 238 | del@7.1.0: 239 | resolution: {integrity: sha512-v2KyNk7efxhlyHpjEvfyxaAihKKK0nWCuf6ZtqZcFFpQRG0bJ12Qsr0RpvsICMjAAZ8DOVCxrlqpxISlMHC4Kg==} 240 | engines: {node: '>=14.16'} 241 | 242 | dir-glob@3.0.1: 243 | resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} 244 | engines: {node: '>=8'} 245 | 246 | eastasianwidth@0.2.0: 247 | resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} 248 | 249 | ejs@3.1.8: 250 | resolution: {integrity: sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==} 251 | engines: {node: '>=0.10.0'} 252 | hasBin: true 253 | 254 | emittery@1.1.0: 255 | resolution: {integrity: sha512-rsX7ktqARv/6UQDgMaLfIqUWAEzzbCQiVh7V9rhDXp6c37yoJcks12NVD+XPkgl4AEavmNhVfrhGoqYwIsMYYA==} 256 | engines: {node: '>=14.16'} 257 | 258 | emoji-regex@8.0.0: 259 | resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} 260 | 261 | emoji-regex@9.2.2: 262 | resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} 263 | 264 | enquirer@2.3.6: 265 | resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} 266 | engines: {node: '>=8.6'} 267 | 268 | escalade@3.2.0: 269 | resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} 270 | engines: {node: '>=6'} 271 | 272 | escape-string-regexp@2.0.0: 273 | resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} 274 | engines: {node: '>=8'} 275 | 276 | escape-string-regexp@5.0.0: 277 | resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} 278 | engines: {node: '>=12'} 279 | 280 | esprima@4.0.1: 281 | resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} 282 | engines: {node: '>=4'} 283 | hasBin: true 284 | 285 | esutils@2.0.3: 286 | resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} 287 | engines: {node: '>=0.10.0'} 288 | 289 | fast-diff@1.3.0: 290 | resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} 291 | 292 | fast-glob@3.2.12: 293 | resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} 294 | engines: {node: '>=8.6.0'} 295 | 296 | fast-glob@3.3.3: 297 | resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} 298 | engines: {node: '>=8.6.0'} 299 | 300 | fastq@1.19.0: 301 | resolution: {integrity: sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==} 302 | 303 | figures@5.0.0: 304 | resolution: {integrity: sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==} 305 | engines: {node: '>=14'} 306 | 307 | filelist@1.0.4: 308 | resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} 309 | 310 | fill-range@7.1.1: 311 | resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} 312 | engines: {node: '>=8'} 313 | 314 | find-up@5.0.0: 315 | resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} 316 | engines: {node: '>=10'} 317 | 318 | find-up@6.3.0: 319 | resolution: {integrity: sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==} 320 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 321 | 322 | fs.realpath@1.0.0: 323 | resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} 324 | 325 | fsevents@2.3.3: 326 | resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} 327 | engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} 328 | os: [darwin] 329 | 330 | get-caller-file@2.0.5: 331 | resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} 332 | engines: {node: 6.* || 8.* || >= 10.*} 333 | 334 | glob-parent@5.1.2: 335 | resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} 336 | engines: {node: '>= 6'} 337 | 338 | glob@7.2.3: 339 | resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} 340 | deprecated: Glob versions prior to v9 are no longer supported 341 | 342 | globby@13.2.2: 343 | resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} 344 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 345 | 346 | graceful-fs@4.2.11: 347 | resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} 348 | 349 | has-flag@4.0.0: 350 | resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} 351 | engines: {node: '>=8'} 352 | 353 | ignore-by-default@2.1.0: 354 | resolution: {integrity: sha512-yiWd4GVmJp0Q6ghmM2B/V3oZGRmjrKLXvHR3TE1nfoXsmoggllfZUQe74EN0fJdPFZu2NIvNdrMMLm3OsV7Ohw==} 355 | engines: {node: '>=10 <11 || >=12 <13 || >=14'} 356 | 357 | ignore@5.3.2: 358 | resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} 359 | engines: {node: '>= 4'} 360 | 361 | imurmurhash@0.1.4: 362 | resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} 363 | engines: {node: '>=0.8.19'} 364 | 365 | indent-string@5.0.0: 366 | resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} 367 | engines: {node: '>=12'} 368 | 369 | inflight@1.0.6: 370 | resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} 371 | deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. 372 | 373 | inherits@2.0.4: 374 | resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} 375 | 376 | irregular-plurals@3.5.0: 377 | resolution: {integrity: sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==} 378 | engines: {node: '>=8'} 379 | 380 | is-binary-path@2.1.0: 381 | resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} 382 | engines: {node: '>=8'} 383 | 384 | is-error@2.2.2: 385 | resolution: {integrity: sha512-IOQqts/aHWbiisY5DuPJQ0gcbvaLFCa7fBa9xoLfxBZvQ+ZI/Zh9xoI7Gk+G64N0FdK4AbibytHht2tWgpJWLg==} 386 | 387 | is-extglob@2.1.1: 388 | resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} 389 | engines: {node: '>=0.10.0'} 390 | 391 | is-fullwidth-code-point@3.0.0: 392 | resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} 393 | engines: {node: '>=8'} 394 | 395 | is-fullwidth-code-point@4.0.0: 396 | resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} 397 | engines: {node: '>=12'} 398 | 399 | is-glob@4.0.3: 400 | resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} 401 | engines: {node: '>=0.10.0'} 402 | 403 | is-number@7.0.0: 404 | resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} 405 | engines: {node: '>=0.12.0'} 406 | 407 | is-path-cwd@3.0.0: 408 | resolution: {integrity: sha512-kyiNFFLU0Ampr6SDZitD/DwUo4Zs1nSdnygUBqsu3LooL00Qvb5j+UnvApUn/TTj1J3OuE6BTdQ5rudKmU2ZaA==} 409 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 410 | 411 | is-path-inside@4.0.0: 412 | resolution: {integrity: sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==} 413 | engines: {node: '>=12'} 414 | 415 | is-plain-object@5.0.0: 416 | resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} 417 | engines: {node: '>=0.10.0'} 418 | 419 | is-promise@4.0.0: 420 | resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} 421 | 422 | is-unicode-supported@1.3.0: 423 | resolution: {integrity: sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==} 424 | engines: {node: '>=12'} 425 | 426 | jake@10.9.2: 427 | resolution: {integrity: sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==} 428 | engines: {node: '>=10'} 429 | hasBin: true 430 | 431 | js-string-escape@1.0.1: 432 | resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} 433 | engines: {node: '>= 0.8'} 434 | 435 | js-yaml@3.14.1: 436 | resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} 437 | hasBin: true 438 | 439 | load-json-file@7.0.1: 440 | resolution: {integrity: sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==} 441 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 442 | 443 | locate-path@6.0.0: 444 | resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} 445 | engines: {node: '>=10'} 446 | 447 | locate-path@7.2.0: 448 | resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} 449 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 450 | 451 | lodash@4.17.21: 452 | resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} 453 | 454 | map-age-cleaner@0.1.3: 455 | resolution: {integrity: sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==} 456 | engines: {node: '>=6'} 457 | 458 | matcher@5.0.0: 459 | resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} 460 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 461 | 462 | md5-hex@3.0.1: 463 | resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} 464 | engines: {node: '>=8'} 465 | 466 | mem@9.0.2: 467 | resolution: {integrity: sha512-F2t4YIv9XQUBHt6AOJ0y7lSmP1+cY7Fm1DRh9GClTGzKST7UWLMx6ly9WZdLH/G/ppM5RL4MlQfRT71ri9t19A==} 468 | engines: {node: '>=12.20'} 469 | 470 | merge2@1.4.1: 471 | resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} 472 | engines: {node: '>= 8'} 473 | 474 | micromatch@4.0.5: 475 | resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} 476 | engines: {node: '>=8.6'} 477 | 478 | micromatch@4.0.8: 479 | resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} 480 | engines: {node: '>=8.6'} 481 | 482 | mimic-fn@4.0.0: 483 | resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} 484 | engines: {node: '>=12'} 485 | 486 | minimatch@3.1.2: 487 | resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} 488 | 489 | minimatch@5.1.6: 490 | resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} 491 | engines: {node: '>=10'} 492 | 493 | minimist@1.2.7: 494 | resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} 495 | 496 | ms@2.1.3: 497 | resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} 498 | 499 | nofilter@3.1.0: 500 | resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} 501 | engines: {node: '>=12.19'} 502 | 503 | normalize-path@3.0.0: 504 | resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} 505 | engines: {node: '>=0.10.0'} 506 | 507 | once@1.4.0: 508 | resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} 509 | 510 | options-defaults@2.0.40: 511 | resolution: {integrity: sha512-a0oW0AMaP/Uqk1gU7s3unE83wzs/MACy3wsCnNREn4wqp4KCcxRdulRjf0d2FeIxENbGJ4EBGtHTQ6J30XB6Cw==} 512 | 513 | p-defer@1.0.0: 514 | resolution: {integrity: sha512-wB3wfAxZpk2AzOfUMJNL+d36xothRSyj8EXOa4f6GMqYDN9BJaaSISbsk+wS9abmnebVw95C2Kb5t85UmpCxuw==} 515 | engines: {node: '>=4'} 516 | 517 | p-event@5.0.1: 518 | resolution: {integrity: sha512-dd589iCQ7m1L0bmC5NLlVYfy3TbBEsMUfWx9PyAgPeIcFZ/E2yaTZ4Rz4MiBmmJShviiftHVXOqfnfzJ6kyMrQ==} 519 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 520 | 521 | p-limit@3.1.0: 522 | resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} 523 | engines: {node: '>=10'} 524 | 525 | p-limit@4.0.0: 526 | resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} 527 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 528 | 529 | p-locate@5.0.0: 530 | resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} 531 | engines: {node: '>=10'} 532 | 533 | p-locate@6.0.0: 534 | resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} 535 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 536 | 537 | p-map@5.5.0: 538 | resolution: {integrity: sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==} 539 | engines: {node: '>=12'} 540 | 541 | p-timeout@5.1.0: 542 | resolution: {integrity: sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==} 543 | engines: {node: '>=12'} 544 | 545 | parse-ms@3.0.0: 546 | resolution: {integrity: sha512-Tpb8Z7r7XbbtBTrM9UhpkzzaMrqA2VXMT3YChzYltwV3P3pM6t8wl7TvpMnSTosz1aQAdVib7kdoys7vYOPerw==} 547 | engines: {node: '>=12'} 548 | 549 | path-exists@4.0.0: 550 | resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} 551 | engines: {node: '>=8'} 552 | 553 | path-exists@5.0.0: 554 | resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==} 555 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 556 | 557 | path-is-absolute@1.0.1: 558 | resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} 559 | engines: {node: '>=0.10.0'} 560 | 561 | path-type@4.0.0: 562 | resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} 563 | engines: {node: '>=8'} 564 | 565 | picomatch@2.3.1: 566 | resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} 567 | engines: {node: '>=8.6'} 568 | 569 | pkg-conf@4.0.0: 570 | resolution: {integrity: sha512-7dmgi4UY4qk+4mj5Cd8v/GExPo0K+SlY+hulOSdfZ/T6jVH6//y7NtzZo5WrfhDBxuQ0jCa7fLZmNaNh7EWL/w==} 571 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 572 | 573 | plur@5.1.0: 574 | resolution: {integrity: sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==} 575 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 576 | 577 | pretty-ms@8.0.0: 578 | resolution: {integrity: sha512-ASJqOugUF1bbzI35STMBUpZqdfYKlJugy6JBziGi2EE+AL5JPJGSzvpeVXojxrr0ViUYoToUjb5kjSEGf7Y83Q==} 579 | engines: {node: '>=14.16'} 580 | 581 | queue-microtask@1.2.3: 582 | resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} 583 | 584 | readdirp@3.6.0: 585 | resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} 586 | engines: {node: '>=8.10.0'} 587 | 588 | require-directory@2.1.1: 589 | resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} 590 | engines: {node: '>=0.10.0'} 591 | 592 | resolve-cwd@3.0.0: 593 | resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} 594 | engines: {node: '>=8'} 595 | 596 | resolve-from@5.0.0: 597 | resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} 598 | engines: {node: '>=8'} 599 | 600 | reusify@1.0.4: 601 | resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} 602 | engines: {iojs: '>=1.0.0', node: '>=0.10.0'} 603 | 604 | rimraf@3.0.2: 605 | resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} 606 | deprecated: Rimraf versions prior to v4 are no longer supported 607 | hasBin: true 608 | 609 | run-parallel@1.2.0: 610 | resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} 611 | 612 | semver@7.7.1: 613 | resolution: {integrity: sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==} 614 | engines: {node: '>=10'} 615 | hasBin: true 616 | 617 | serialize-error@7.0.1: 618 | resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==} 619 | engines: {node: '>=10'} 620 | 621 | signal-exit@4.1.0: 622 | resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} 623 | engines: {node: '>=14'} 624 | 625 | slash@3.0.0: 626 | resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} 627 | engines: {node: '>=8'} 628 | 629 | slash@4.0.0: 630 | resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} 631 | engines: {node: '>=12'} 632 | 633 | slice-ansi@5.0.0: 634 | resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} 635 | engines: {node: '>=12'} 636 | 637 | sprintf-js@1.0.3: 638 | resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} 639 | 640 | stack-utils@2.0.6: 641 | resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} 642 | engines: {node: '>=10'} 643 | 644 | string-width@4.2.3: 645 | resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} 646 | engines: {node: '>=8'} 647 | 648 | string-width@5.1.2: 649 | resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} 650 | engines: {node: '>=12'} 651 | 652 | strip-ansi@6.0.1: 653 | resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} 654 | engines: {node: '>=8'} 655 | 656 | strip-ansi@7.1.0: 657 | resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} 658 | engines: {node: '>=12'} 659 | 660 | supertap@3.0.1: 661 | resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} 662 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 663 | 664 | supports-color@7.2.0: 665 | resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} 666 | engines: {node: '>=8'} 667 | 668 | temp-dir@3.0.0: 669 | resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} 670 | engines: {node: '>=14.16'} 671 | 672 | time-zone@1.0.0: 673 | resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} 674 | engines: {node: '>=4'} 675 | 676 | to-regex-range@5.0.1: 677 | resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} 678 | engines: {node: '>=8.0'} 679 | 680 | ts-import@4.0.0-beta.9: 681 | resolution: {integrity: sha512-cek9R08mkphoC/UDvh2/gbRGfMfTkMjpPlgHGDC0D+EZ+O21h60WwGX37ykJPmYbaH1IvzGZuMa+2OdWOFjy6g==} 682 | engines: {node: '>=14.14.0'} 683 | peerDependencies: 684 | typescript: '4' 685 | 686 | tslib@2.4.0: 687 | resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} 688 | 689 | tslib@2.4.1: 690 | resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} 691 | 692 | tslib@2.5.0: 693 | resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} 694 | 695 | type-fest@0.13.1: 696 | resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} 697 | engines: {node: '>=10'} 698 | 699 | types-package-json@2.0.39: 700 | resolution: {integrity: sha512-c8ua5W1Uu6x7LAwtwSGCl46cHmj+r2eAA+lXR1CluIZotu9V03ZHcGB9wKRZE2oIAX5IzMP/rxDV9g9ikCg9Nw==} 701 | 702 | typescript@4.9.3: 703 | resolution: {integrity: sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==} 704 | engines: {node: '>=4.2.0'} 705 | hasBin: true 706 | 707 | typescript@5.0.4: 708 | resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} 709 | engines: {node: '>=12.20'} 710 | hasBin: true 711 | 712 | well-known-symbols@2.0.0: 713 | resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} 714 | engines: {node: '>=6'} 715 | 716 | wrap-ansi@7.0.0: 717 | resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} 718 | engines: {node: '>=10'} 719 | 720 | wrappy@1.0.2: 721 | resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} 722 | 723 | write-file-atomic@5.0.1: 724 | resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==} 725 | engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} 726 | 727 | y18n@5.0.8: 728 | resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} 729 | engines: {node: '>=10'} 730 | 731 | yargs-parser@21.1.1: 732 | resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} 733 | engines: {node: '>=12'} 734 | 735 | yargs@17.7.2: 736 | resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} 737 | engines: {node: '>=12'} 738 | 739 | yocto-queue@0.1.0: 740 | resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} 741 | engines: {node: '>=10'} 742 | 743 | yocto-queue@1.1.1: 744 | resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} 745 | engines: {node: '>=12.20'} 746 | 747 | snapshots: 748 | 749 | '@nodelib/fs.scandir@2.1.5': 750 | dependencies: 751 | '@nodelib/fs.stat': 2.0.5 752 | run-parallel: 1.2.0 753 | 754 | '@nodelib/fs.stat@2.0.5': {} 755 | 756 | '@nodelib/fs.walk@1.2.8': 757 | dependencies: 758 | '@nodelib/fs.scandir': 2.1.5 759 | fastq: 1.19.0 760 | 761 | '@radrat/cli-toolkit@0.0.34': 762 | dependencies: 763 | chalk: 4.1.2 764 | minimist: 1.2.7 765 | options-defaults: 2.0.40 766 | tslib: 2.4.1 767 | 768 | '@radrat/cli@3.0.0-beta.9': 769 | dependencies: 770 | '@radrat/cli-toolkit': 0.0.34 771 | '@radrat/node-logger': 0.0.0 772 | chalk: 4.1.2 773 | ejs: 3.1.8 774 | enquirer: 2.3.6 775 | fast-glob: 3.2.12 776 | find-up: 5.0.0 777 | lodash: 4.17.21 778 | micromatch: 4.0.5 779 | options-defaults: 2.0.40 780 | p-limit: 3.1.0 781 | ts-import: 4.0.0-beta.9(typescript@4.9.3) 782 | tslib: 2.4.1 783 | types-package-json: 2.0.39 784 | typescript: 4.9.3 785 | 786 | '@radrat/node-logger@0.0.0': 787 | dependencies: 788 | chalk: 4.1.2 789 | options-defaults: 2.0.40 790 | tslib: 2.4.0 791 | 792 | '@types/node@18.15.11': {} 793 | 794 | acorn-walk@8.3.4: 795 | dependencies: 796 | acorn: 8.14.0 797 | 798 | acorn@8.14.0: {} 799 | 800 | aggregate-error@4.0.1: 801 | dependencies: 802 | clean-stack: 4.2.0 803 | indent-string: 5.0.0 804 | 805 | ansi-colors@4.1.3: {} 806 | 807 | ansi-regex@5.0.1: {} 808 | 809 | ansi-regex@6.1.0: {} 810 | 811 | ansi-styles@4.3.0: 812 | dependencies: 813 | color-convert: 2.0.1 814 | 815 | ansi-styles@6.2.1: {} 816 | 817 | anymatch@3.1.3: 818 | dependencies: 819 | normalize-path: 3.0.0 820 | picomatch: 2.3.1 821 | 822 | argparse@1.0.10: 823 | dependencies: 824 | sprintf-js: 1.0.3 825 | 826 | array-find-index@1.0.2: {} 827 | 828 | arrgv@1.0.2: {} 829 | 830 | arrify@3.0.0: {} 831 | 832 | async@3.2.6: {} 833 | 834 | ava@5.2.0: 835 | dependencies: 836 | acorn: 8.14.0 837 | acorn-walk: 8.3.4 838 | ansi-styles: 6.2.1 839 | arrgv: 1.0.2 840 | arrify: 3.0.0 841 | callsites: 4.2.0 842 | cbor: 8.1.0 843 | chalk: 5.4.1 844 | chokidar: 3.6.0 845 | chunkd: 2.0.1 846 | ci-info: 3.9.0 847 | ci-parallel-vars: 1.0.1 848 | clean-yaml-object: 0.1.0 849 | cli-truncate: 3.1.0 850 | code-excerpt: 4.0.0 851 | common-path-prefix: 3.0.0 852 | concordance: 5.0.4 853 | currently-unhandled: 0.4.1 854 | debug: 4.4.0 855 | del: 7.1.0 856 | emittery: 1.1.0 857 | figures: 5.0.0 858 | globby: 13.2.2 859 | ignore-by-default: 2.1.0 860 | indent-string: 5.0.0 861 | is-error: 2.2.2 862 | is-plain-object: 5.0.0 863 | is-promise: 4.0.0 864 | matcher: 5.0.0 865 | mem: 9.0.2 866 | ms: 2.1.3 867 | p-event: 5.0.1 868 | p-map: 5.5.0 869 | picomatch: 2.3.1 870 | pkg-conf: 4.0.0 871 | plur: 5.1.0 872 | pretty-ms: 8.0.0 873 | resolve-cwd: 3.0.0 874 | slash: 3.0.0 875 | stack-utils: 2.0.6 876 | strip-ansi: 7.1.0 877 | supertap: 3.0.1 878 | temp-dir: 3.0.0 879 | write-file-atomic: 5.0.1 880 | yargs: 17.7.2 881 | transitivePeerDependencies: 882 | - supports-color 883 | 884 | balanced-match@1.0.2: {} 885 | 886 | binary-extensions@2.3.0: {} 887 | 888 | blueimp-md5@2.19.0: {} 889 | 890 | brace-expansion@1.1.11: 891 | dependencies: 892 | balanced-match: 1.0.2 893 | concat-map: 0.0.1 894 | 895 | brace-expansion@2.0.1: 896 | dependencies: 897 | balanced-match: 1.0.2 898 | 899 | braces@3.0.3: 900 | dependencies: 901 | fill-range: 7.1.1 902 | 903 | callsites@4.2.0: {} 904 | 905 | cbor@8.1.0: 906 | dependencies: 907 | nofilter: 3.1.0 908 | 909 | chalk@4.1.2: 910 | dependencies: 911 | ansi-styles: 4.3.0 912 | supports-color: 7.2.0 913 | 914 | chalk@5.4.1: {} 915 | 916 | chokidar@3.6.0: 917 | dependencies: 918 | anymatch: 3.1.3 919 | braces: 3.0.3 920 | glob-parent: 5.1.2 921 | is-binary-path: 2.1.0 922 | is-glob: 4.0.3 923 | normalize-path: 3.0.0 924 | readdirp: 3.6.0 925 | optionalDependencies: 926 | fsevents: 2.3.3 927 | 928 | chunkd@2.0.1: {} 929 | 930 | ci-info@3.9.0: {} 931 | 932 | ci-parallel-vars@1.0.1: {} 933 | 934 | clean-stack@4.2.0: 935 | dependencies: 936 | escape-string-regexp: 5.0.0 937 | 938 | clean-yaml-object@0.1.0: {} 939 | 940 | cli-truncate@3.1.0: 941 | dependencies: 942 | slice-ansi: 5.0.0 943 | string-width: 5.1.2 944 | 945 | cliui@8.0.1: 946 | dependencies: 947 | string-width: 4.2.3 948 | strip-ansi: 6.0.1 949 | wrap-ansi: 7.0.0 950 | 951 | code-excerpt@4.0.0: 952 | dependencies: 953 | convert-to-spaces: 2.0.1 954 | 955 | color-convert@2.0.1: 956 | dependencies: 957 | color-name: 1.1.4 958 | 959 | color-name@1.1.4: {} 960 | 961 | comment-parser@1.3.1: {} 962 | 963 | common-path-prefix@3.0.0: {} 964 | 965 | concat-map@0.0.1: {} 966 | 967 | concordance@5.0.4: 968 | dependencies: 969 | date-time: 3.1.0 970 | esutils: 2.0.3 971 | fast-diff: 1.3.0 972 | js-string-escape: 1.0.1 973 | lodash: 4.17.21 974 | md5-hex: 3.0.1 975 | semver: 7.7.1 976 | well-known-symbols: 2.0.0 977 | 978 | convert-to-spaces@2.0.1: {} 979 | 980 | currently-unhandled@0.4.1: 981 | dependencies: 982 | array-find-index: 1.0.2 983 | 984 | date-time@3.1.0: 985 | dependencies: 986 | time-zone: 1.0.0 987 | 988 | debug@4.4.0: 989 | dependencies: 990 | ms: 2.1.3 991 | 992 | del@7.1.0: 993 | dependencies: 994 | globby: 13.2.2 995 | graceful-fs: 4.2.11 996 | is-glob: 4.0.3 997 | is-path-cwd: 3.0.0 998 | is-path-inside: 4.0.0 999 | p-map: 5.5.0 1000 | rimraf: 3.0.2 1001 | slash: 4.0.0 1002 | 1003 | dir-glob@3.0.1: 1004 | dependencies: 1005 | path-type: 4.0.0 1006 | 1007 | eastasianwidth@0.2.0: {} 1008 | 1009 | ejs@3.1.8: 1010 | dependencies: 1011 | jake: 10.9.2 1012 | 1013 | emittery@1.1.0: {} 1014 | 1015 | emoji-regex@8.0.0: {} 1016 | 1017 | emoji-regex@9.2.2: {} 1018 | 1019 | enquirer@2.3.6: 1020 | dependencies: 1021 | ansi-colors: 4.1.3 1022 | 1023 | escalade@3.2.0: {} 1024 | 1025 | escape-string-regexp@2.0.0: {} 1026 | 1027 | escape-string-regexp@5.0.0: {} 1028 | 1029 | esprima@4.0.1: {} 1030 | 1031 | esutils@2.0.3: {} 1032 | 1033 | fast-diff@1.3.0: {} 1034 | 1035 | fast-glob@3.2.12: 1036 | dependencies: 1037 | '@nodelib/fs.stat': 2.0.5 1038 | '@nodelib/fs.walk': 1.2.8 1039 | glob-parent: 5.1.2 1040 | merge2: 1.4.1 1041 | micromatch: 4.0.5 1042 | 1043 | fast-glob@3.3.3: 1044 | dependencies: 1045 | '@nodelib/fs.stat': 2.0.5 1046 | '@nodelib/fs.walk': 1.2.8 1047 | glob-parent: 5.1.2 1048 | merge2: 1.4.1 1049 | micromatch: 4.0.8 1050 | 1051 | fastq@1.19.0: 1052 | dependencies: 1053 | reusify: 1.0.4 1054 | 1055 | figures@5.0.0: 1056 | dependencies: 1057 | escape-string-regexp: 5.0.0 1058 | is-unicode-supported: 1.3.0 1059 | 1060 | filelist@1.0.4: 1061 | dependencies: 1062 | minimatch: 5.1.6 1063 | 1064 | fill-range@7.1.1: 1065 | dependencies: 1066 | to-regex-range: 5.0.1 1067 | 1068 | find-up@5.0.0: 1069 | dependencies: 1070 | locate-path: 6.0.0 1071 | path-exists: 4.0.0 1072 | 1073 | find-up@6.3.0: 1074 | dependencies: 1075 | locate-path: 7.2.0 1076 | path-exists: 5.0.0 1077 | 1078 | fs.realpath@1.0.0: {} 1079 | 1080 | fsevents@2.3.3: 1081 | optional: true 1082 | 1083 | get-caller-file@2.0.5: {} 1084 | 1085 | glob-parent@5.1.2: 1086 | dependencies: 1087 | is-glob: 4.0.3 1088 | 1089 | glob@7.2.3: 1090 | dependencies: 1091 | fs.realpath: 1.0.0 1092 | inflight: 1.0.6 1093 | inherits: 2.0.4 1094 | minimatch: 3.1.2 1095 | once: 1.4.0 1096 | path-is-absolute: 1.0.1 1097 | 1098 | globby@13.2.2: 1099 | dependencies: 1100 | dir-glob: 3.0.1 1101 | fast-glob: 3.3.3 1102 | ignore: 5.3.2 1103 | merge2: 1.4.1 1104 | slash: 4.0.0 1105 | 1106 | graceful-fs@4.2.11: {} 1107 | 1108 | has-flag@4.0.0: {} 1109 | 1110 | ignore-by-default@2.1.0: {} 1111 | 1112 | ignore@5.3.2: {} 1113 | 1114 | imurmurhash@0.1.4: {} 1115 | 1116 | indent-string@5.0.0: {} 1117 | 1118 | inflight@1.0.6: 1119 | dependencies: 1120 | once: 1.4.0 1121 | wrappy: 1.0.2 1122 | 1123 | inherits@2.0.4: {} 1124 | 1125 | irregular-plurals@3.5.0: {} 1126 | 1127 | is-binary-path@2.1.0: 1128 | dependencies: 1129 | binary-extensions: 2.3.0 1130 | 1131 | is-error@2.2.2: {} 1132 | 1133 | is-extglob@2.1.1: {} 1134 | 1135 | is-fullwidth-code-point@3.0.0: {} 1136 | 1137 | is-fullwidth-code-point@4.0.0: {} 1138 | 1139 | is-glob@4.0.3: 1140 | dependencies: 1141 | is-extglob: 2.1.1 1142 | 1143 | is-number@7.0.0: {} 1144 | 1145 | is-path-cwd@3.0.0: {} 1146 | 1147 | is-path-inside@4.0.0: {} 1148 | 1149 | is-plain-object@5.0.0: {} 1150 | 1151 | is-promise@4.0.0: {} 1152 | 1153 | is-unicode-supported@1.3.0: {} 1154 | 1155 | jake@10.9.2: 1156 | dependencies: 1157 | async: 3.2.6 1158 | chalk: 4.1.2 1159 | filelist: 1.0.4 1160 | minimatch: 3.1.2 1161 | 1162 | js-string-escape@1.0.1: {} 1163 | 1164 | js-yaml@3.14.1: 1165 | dependencies: 1166 | argparse: 1.0.10 1167 | esprima: 4.0.1 1168 | 1169 | load-json-file@7.0.1: {} 1170 | 1171 | locate-path@6.0.0: 1172 | dependencies: 1173 | p-locate: 5.0.0 1174 | 1175 | locate-path@7.2.0: 1176 | dependencies: 1177 | p-locate: 6.0.0 1178 | 1179 | lodash@4.17.21: {} 1180 | 1181 | map-age-cleaner@0.1.3: 1182 | dependencies: 1183 | p-defer: 1.0.0 1184 | 1185 | matcher@5.0.0: 1186 | dependencies: 1187 | escape-string-regexp: 5.0.0 1188 | 1189 | md5-hex@3.0.1: 1190 | dependencies: 1191 | blueimp-md5: 2.19.0 1192 | 1193 | mem@9.0.2: 1194 | dependencies: 1195 | map-age-cleaner: 0.1.3 1196 | mimic-fn: 4.0.0 1197 | 1198 | merge2@1.4.1: {} 1199 | 1200 | micromatch@4.0.5: 1201 | dependencies: 1202 | braces: 3.0.3 1203 | picomatch: 2.3.1 1204 | 1205 | micromatch@4.0.8: 1206 | dependencies: 1207 | braces: 3.0.3 1208 | picomatch: 2.3.1 1209 | 1210 | mimic-fn@4.0.0: {} 1211 | 1212 | minimatch@3.1.2: 1213 | dependencies: 1214 | brace-expansion: 1.1.11 1215 | 1216 | minimatch@5.1.6: 1217 | dependencies: 1218 | brace-expansion: 2.0.1 1219 | 1220 | minimist@1.2.7: {} 1221 | 1222 | ms@2.1.3: {} 1223 | 1224 | nofilter@3.1.0: {} 1225 | 1226 | normalize-path@3.0.0: {} 1227 | 1228 | once@1.4.0: 1229 | dependencies: 1230 | wrappy: 1.0.2 1231 | 1232 | options-defaults@2.0.40: {} 1233 | 1234 | p-defer@1.0.0: {} 1235 | 1236 | p-event@5.0.1: 1237 | dependencies: 1238 | p-timeout: 5.1.0 1239 | 1240 | p-limit@3.1.0: 1241 | dependencies: 1242 | yocto-queue: 0.1.0 1243 | 1244 | p-limit@4.0.0: 1245 | dependencies: 1246 | yocto-queue: 1.1.1 1247 | 1248 | p-locate@5.0.0: 1249 | dependencies: 1250 | p-limit: 3.1.0 1251 | 1252 | p-locate@6.0.0: 1253 | dependencies: 1254 | p-limit: 4.0.0 1255 | 1256 | p-map@5.5.0: 1257 | dependencies: 1258 | aggregate-error: 4.0.1 1259 | 1260 | p-timeout@5.1.0: {} 1261 | 1262 | parse-ms@3.0.0: {} 1263 | 1264 | path-exists@4.0.0: {} 1265 | 1266 | path-exists@5.0.0: {} 1267 | 1268 | path-is-absolute@1.0.1: {} 1269 | 1270 | path-type@4.0.0: {} 1271 | 1272 | picomatch@2.3.1: {} 1273 | 1274 | pkg-conf@4.0.0: 1275 | dependencies: 1276 | find-up: 6.3.0 1277 | load-json-file: 7.0.1 1278 | 1279 | plur@5.1.0: 1280 | dependencies: 1281 | irregular-plurals: 3.5.0 1282 | 1283 | pretty-ms@8.0.0: 1284 | dependencies: 1285 | parse-ms: 3.0.0 1286 | 1287 | queue-microtask@1.2.3: {} 1288 | 1289 | readdirp@3.6.0: 1290 | dependencies: 1291 | picomatch: 2.3.1 1292 | 1293 | require-directory@2.1.1: {} 1294 | 1295 | resolve-cwd@3.0.0: 1296 | dependencies: 1297 | resolve-from: 5.0.0 1298 | 1299 | resolve-from@5.0.0: {} 1300 | 1301 | reusify@1.0.4: {} 1302 | 1303 | rimraf@3.0.2: 1304 | dependencies: 1305 | glob: 7.2.3 1306 | 1307 | run-parallel@1.2.0: 1308 | dependencies: 1309 | queue-microtask: 1.2.3 1310 | 1311 | semver@7.7.1: {} 1312 | 1313 | serialize-error@7.0.1: 1314 | dependencies: 1315 | type-fest: 0.13.1 1316 | 1317 | signal-exit@4.1.0: {} 1318 | 1319 | slash@3.0.0: {} 1320 | 1321 | slash@4.0.0: {} 1322 | 1323 | slice-ansi@5.0.0: 1324 | dependencies: 1325 | ansi-styles: 6.2.1 1326 | is-fullwidth-code-point: 4.0.0 1327 | 1328 | sprintf-js@1.0.3: {} 1329 | 1330 | stack-utils@2.0.6: 1331 | dependencies: 1332 | escape-string-regexp: 2.0.0 1333 | 1334 | string-width@4.2.3: 1335 | dependencies: 1336 | emoji-regex: 8.0.0 1337 | is-fullwidth-code-point: 3.0.0 1338 | strip-ansi: 6.0.1 1339 | 1340 | string-width@5.1.2: 1341 | dependencies: 1342 | eastasianwidth: 0.2.0 1343 | emoji-regex: 9.2.2 1344 | strip-ansi: 7.1.0 1345 | 1346 | strip-ansi@6.0.1: 1347 | dependencies: 1348 | ansi-regex: 5.0.1 1349 | 1350 | strip-ansi@7.1.0: 1351 | dependencies: 1352 | ansi-regex: 6.1.0 1353 | 1354 | supertap@3.0.1: 1355 | dependencies: 1356 | indent-string: 5.0.0 1357 | js-yaml: 3.14.1 1358 | serialize-error: 7.0.1 1359 | strip-ansi: 7.1.0 1360 | 1361 | supports-color@7.2.0: 1362 | dependencies: 1363 | has-flag: 4.0.0 1364 | 1365 | temp-dir@3.0.0: {} 1366 | 1367 | time-zone@1.0.0: {} 1368 | 1369 | to-regex-range@5.0.1: 1370 | dependencies: 1371 | is-number: 7.0.0 1372 | 1373 | ts-import@4.0.0-beta.9(typescript@4.9.3): 1374 | dependencies: 1375 | comment-parser: 1.3.1 1376 | options-defaults: 2.0.40 1377 | tslib: 2.4.1 1378 | typescript: 4.9.3 1379 | 1380 | tslib@2.4.0: {} 1381 | 1382 | tslib@2.4.1: {} 1383 | 1384 | tslib@2.5.0: {} 1385 | 1386 | type-fest@0.13.1: {} 1387 | 1388 | types-package-json@2.0.39: {} 1389 | 1390 | typescript@4.9.3: {} 1391 | 1392 | typescript@5.0.4: {} 1393 | 1394 | well-known-symbols@2.0.0: {} 1395 | 1396 | wrap-ansi@7.0.0: 1397 | dependencies: 1398 | ansi-styles: 4.3.0 1399 | string-width: 4.2.3 1400 | strip-ansi: 6.0.1 1401 | 1402 | wrappy@1.0.2: {} 1403 | 1404 | write-file-atomic@5.0.1: 1405 | dependencies: 1406 | imurmurhash: 0.1.4 1407 | signal-exit: 4.1.0 1408 | 1409 | y18n@5.0.8: {} 1410 | 1411 | yargs-parser@21.1.1: {} 1412 | 1413 | yargs@17.7.2: 1414 | dependencies: 1415 | cliui: 8.0.1 1416 | escalade: 3.2.0 1417 | get-caller-file: 2.0.5 1418 | require-directory: 2.1.1 1419 | string-width: 4.2.3 1420 | y18n: 5.0.8 1421 | yargs-parser: 21.1.1 1422 | 1423 | yocto-queue@0.1.0: {} 1424 | 1425 | yocto-queue@1.1.1: {} 1426 | -------------------------------------------------------------------------------- /rr-scripts.ts: -------------------------------------------------------------------------------- 1 | import type { Scripts } from '@radrat/cli'; 2 | 3 | const scripts: Scripts = async (cli) => { 4 | await cli.run({ 5 | name: `build`, 6 | command: [`rm -rf ./dist`, `pnpm exec tsc`].join(` && `), 7 | }); 8 | 9 | // Run tests. 10 | await cli.run({ 11 | name: `test`, 12 | command: [`rm -rf ./.cache`, `pnpm exec ava`].join(` && `), 13 | }); 14 | 15 | await cli.run({ 16 | name: `test.watch`, 17 | command: [`rm -rf ./.cache`, `pnpm exec ava --watch`].join(` && `), 18 | }); 19 | 20 | await cli.run({ 21 | name: `publish`, 22 | command: [ 23 | `pnpm exec rr build`, 24 | `pnpm publish --access=public`, 25 | `git init --initial-branch=main`, 26 | `git remote add origin https://github.com/radarsu/${cli.context.packageJson.name}`, 27 | `git add .`, 28 | `git commit -m 'feat: ${cli.context.packageJson.version}'`, 29 | `git push origin main --force`, 30 | `rm -rf ./.git`, 31 | ].join(` && `), 32 | }); 33 | }; 34 | 35 | export default scripts; 36 | -------------------------------------------------------------------------------- /src/load.interfaces.ts: -------------------------------------------------------------------------------- 1 | import * as tsc from 'typescript'; 2 | 3 | type RecursivePartial = { 4 | [P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial[] : T[P] extends object ? RecursivePartial : T[P]; 5 | }; 6 | 7 | export enum LoadMode { 8 | Transpile = `transpile`, 9 | Compile = `compile`, 10 | } 11 | 12 | export interface LoadTranspileOptions { 13 | mode: LoadMode.Transpile; 14 | allowConfigurationWithComments?: boolean; 15 | compiledJsExtension?: string; 16 | useCache?: boolean; 17 | transpileOptions: { 18 | cache: { 19 | dir: string; 20 | // invalidateOnChanges: boolean; 21 | }; 22 | transpileOptions: tsc.TranspileOptions; 23 | }; 24 | } 25 | 26 | export interface LoadCompileOptions { 27 | mode: LoadMode.Compile; 28 | allowConfigurationWithComments?: boolean; 29 | compiledJsExtension?: string; 30 | useCache?: boolean; 31 | compileOptions: { 32 | // cache: { 33 | // invalidateOnChanges: boolean; 34 | // }; 35 | compilerOptions: tsc.CompilerOptions; 36 | }; 37 | } 38 | 39 | export type LoadOptions = RecursivePartial; 40 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import * as commentParser from './modules/comment-parser/index.js'; 2 | import * as crossPlatform from './modules/cross-platform/index.js'; 3 | import * as path from 'node:path'; 4 | import * as url from 'node:url'; 5 | import * as utils from './utils/index.js'; 6 | 7 | import { LoadMode, LoadOptions } from './load.interfaces.js'; 8 | 9 | import { defaults } from 'options-defaults'; 10 | import { providersMap } from './providers/providers.js'; 11 | 12 | export const load = async (tsRelativePath: string, options?: LoadOptions) => { 13 | if (options?.allowConfigurationWithComments) { 14 | const commentConfig = await commentParser.getTsImportCommentConfig(tsRelativePath); 15 | options = defaults(options, commentConfig); 16 | } 17 | 18 | const loadConfig = defaults({ 19 | // Default options. 20 | mode: LoadMode.Transpile, 21 | allowConfigurationWithComments: false, 22 | useCache: true, 23 | compiledJsExtension: `.mjs`, 24 | }, options); 25 | 26 | const provider = providersMap[loadConfig.mode]; 27 | const config = provider.getConfig(loadConfig); 28 | 29 | const cwd = process.cwd(); 30 | const cacheDir = provider.getCacheDir(config); 31 | 32 | const tsPath = path.resolve(cwd, tsRelativePath); 33 | const jsAfterCachePath = crossPlatform.getJsAfterCachePath(tsPath); 34 | const jsPath = path.join(cacheDir, jsAfterCachePath).replace(/\.[^/.]+$/u, loadConfig.compiledJsExtension); 35 | 36 | if (loadConfig.useCache) { 37 | const [tsFileExists, jsFileExists] = await Promise.all([ 38 | utils.checkIfFileExists(tsPath), 39 | utils.checkIfFileExists(jsPath).catch(() => { 40 | // * Ignore non-existent cache. 41 | }), 42 | ]); 43 | 44 | // Load from cache. 45 | if (jsFileExists && !utils.isFileNewer(tsFileExists, jsFileExists)) { 46 | const fileUrl = url.pathToFileURL(jsPath).href; 47 | const loaded = await import(fileUrl); 48 | return loaded; 49 | } 50 | } 51 | 52 | await provider.load({ 53 | tsPath, 54 | jsPath, 55 | ...config, 56 | }); 57 | 58 | const fileUrl = url.pathToFileURL(jsPath).href; 59 | const loaded = await import(fileUrl); 60 | return loaded; 61 | }; 62 | 63 | export * from './load.interfaces.js'; 64 | -------------------------------------------------------------------------------- /src/modules/comment-parser/get-ts-import-comment-config.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'node:fs'; 2 | /* @ts-ignore */ 3 | const commentParser = await import('comment-parser'); 4 | 5 | export const getTsImportCommentConfig = async (tsRelativePath: string) => { 6 | const tsContent = await fs.promises.readFile(tsRelativePath, `utf-8`); 7 | const comments = commentParser.parse(tsContent); 8 | const commentConfig = comments 9 | .map((comment: any) => { 10 | const metadataTags = comment.tags.filter((tag: any) => { 11 | return tag.tag === `tsImport`; 12 | }); 13 | 14 | const metadataJsons = metadataTags.map((metadataTag: any) => { 15 | return JSON.parse(metadataTag.description); 16 | }); 17 | 18 | return metadataJsons; 19 | }) 20 | .flat(); 21 | 22 | return commentConfig[0]; 23 | }; 24 | 25 | export const getTsImportCommentConfigSync = (tsRelativePath: string) => { 26 | const tsContent = fs.readFileSync(tsRelativePath, `utf-8`); 27 | const comments = commentParser.parse(tsContent); 28 | const commentConfig = comments 29 | .map((comment: any) => { 30 | const metadataTags = comment.tags.filter((tag: any) => { 31 | return tag.tag === `tsImport`; 32 | }); 33 | 34 | const metadataJsons = metadataTags.map((metadataTag: any) => { 35 | return JSON.parse(metadataTag.description); 36 | }); 37 | 38 | return metadataJsons; 39 | }) 40 | .flat(); 41 | 42 | return commentConfig[0]; 43 | }; 44 | -------------------------------------------------------------------------------- /src/modules/comment-parser/index.ts: -------------------------------------------------------------------------------- 1 | export * from './get-ts-import-comment-config.js'; 2 | -------------------------------------------------------------------------------- /src/modules/compiler/compile.ts: -------------------------------------------------------------------------------- 1 | import tsc from 'typescript'; 2 | 3 | export interface CompileOptions { 4 | tsPath: string; 5 | jsPath: string; 6 | compilerOptions: tsc.CompilerOptions; 7 | } 8 | 9 | export const compile = (options: CompileOptions) => { 10 | const program = tsc.createProgram({ 11 | rootNames: [options.tsPath], 12 | options: options.compilerOptions, 13 | }); 14 | 15 | program.emit(); 16 | }; 17 | -------------------------------------------------------------------------------- /src/modules/compiler/index.ts: -------------------------------------------------------------------------------- 1 | export * from './compile.js'; 2 | export * from './transpile.js'; 3 | -------------------------------------------------------------------------------- /src/modules/compiler/transpile.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'node:fs'; 2 | import * as path from 'node:path'; 3 | 4 | import tsc from 'typescript'; 5 | 6 | export interface TranspileOptions { 7 | tsPath: string; 8 | jsPath: string; 9 | transpileOptions: tsc.TranspileOptions; 10 | } 11 | 12 | export const transpile = async (options: TranspileOptions) => { 13 | const ts = await fs.promises.readFile(options.tsPath); 14 | const tsTranspiled = tsc.transpileModule(ts.toString(), options.transpileOptions); 15 | 16 | await fs.promises.mkdir(path.dirname(options.jsPath), { 17 | recursive: true, 18 | }); 19 | 20 | await fs.promises.writeFile(options.jsPath, tsTranspiled.outputText); 21 | }; 22 | 23 | export const transpileSync = (options: TranspileOptions) => { 24 | const ts = fs.readFileSync(options.tsPath); 25 | const tsTranspiled = tsc.transpileModule(ts.toString(), options.transpileOptions); 26 | 27 | fs.mkdirSync(path.dirname(options.jsPath), { 28 | recursive: true, 29 | }); 30 | 31 | fs.writeFileSync(options.jsPath, tsTranspiled.outputText); 32 | }; 33 | -------------------------------------------------------------------------------- /src/modules/cross-platform/get-js-after-cache-path.ts: -------------------------------------------------------------------------------- 1 | export const getJsAfterCachePath = (tsPath: string) => { 2 | let jsAfterCachePath = tsPath; 3 | 4 | if (process.platform === `win32`) { 5 | jsAfterCachePath = tsPath.split(`:`)[1]!; 6 | } 7 | 8 | return jsAfterCachePath; 9 | }; 10 | -------------------------------------------------------------------------------- /src/modules/cross-platform/index.ts: -------------------------------------------------------------------------------- 1 | export * from './get-js-after-cache-path.js'; 2 | -------------------------------------------------------------------------------- /src/providers/compile/get-cache-dir.ts: -------------------------------------------------------------------------------- 1 | import { LoadCompileOptions } from '../../load.interfaces.js'; 2 | 3 | export const getCacheDir = (options: LoadCompileOptions[`compileOptions`]) => { 4 | return options.compilerOptions.outDir; 5 | }; 6 | -------------------------------------------------------------------------------- /src/providers/compile/get-config.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'node:path'; 2 | 3 | import { LoadCompileOptions } from '../../load.interfaces.js'; 4 | import { defaults } from 'options-defaults'; 5 | import tsc from 'typescript'; 6 | 7 | const getDefaultCompilerOptions = () => { 8 | const cwd = process.cwd(); 9 | const defaultsForPlatform: tsc.CompilerOptions & { outDir: string } = { 10 | outDir: path.join(cwd, `.cache`, `ts-import`), 11 | }; 12 | 13 | if (process.platform === `win32`) { 14 | const driveLetter = cwd.charAt(0); 15 | defaultsForPlatform.outDir = path.join(defaultsForPlatform.outDir, driveLetter); 16 | defaultsForPlatform.rootDir = `${driveLetter}:/`; 17 | } else { 18 | defaultsForPlatform.rootDir = `/`; 19 | } 20 | 21 | return defaultsForPlatform; 22 | }; 23 | 24 | export const getConfig = (options: LoadCompileOptions) => { 25 | const defaultCompileOptions: LoadCompileOptions['compileOptions'] & { compilerOptions: { outDir: string } } = { 26 | // invalidateOnChanges: boolean; 27 | compilerOptions: { 28 | ...getDefaultCompilerOptions(), 29 | downlevelIteration: true, 30 | emitDecoratorMetadata: true, 31 | experimentalDecorators: true, 32 | module: tsc.ModuleKind.ES2020, 33 | moduleResolution: tsc.ModuleResolutionKind.Node16, 34 | resolveJsonModule: true, 35 | skipLibCheck: true, 36 | target: tsc.ScriptTarget.ES2020, 37 | }, 38 | }; 39 | 40 | const compileOptions = defaults(defaultCompileOptions, options); 41 | return compileOptions; 42 | }; 43 | -------------------------------------------------------------------------------- /src/providers/compile/index.ts: -------------------------------------------------------------------------------- 1 | export * from './get-cache-dir.js'; 2 | export * from './get-config.js'; 3 | export * from './load.js'; 4 | -------------------------------------------------------------------------------- /src/providers/compile/load.ts: -------------------------------------------------------------------------------- 1 | import * as compiler from '../../modules/compiler/index.js'; 2 | import * as fs from 'node:fs'; 3 | 4 | export const load = async (options: compiler.CompileOptions) => { 5 | compiler.compile(options); 6 | 7 | const jsWithNormalExtensionPath = options.jsPath.replace(/\.[^/.]+$/u, `.js`); 8 | await fs.promises.rename(jsWithNormalExtensionPath, options.jsPath); 9 | }; 10 | -------------------------------------------------------------------------------- /src/providers/providers.ts: -------------------------------------------------------------------------------- 1 | import * as compileProviders from './compile/index.js'; 2 | import * as compiler from '../modules/compiler/index.js'; 3 | import * as transpileProviders from './transpile/index.js'; 4 | 5 | import { LoadCompileOptions, LoadMode, LoadOptions, LoadTranspileOptions } from '../load.interfaces.js'; 6 | 7 | export interface Providers { 8 | getCacheDir: (options: LoadCompileOptions[`compileOptions`] | LoadTranspileOptions[`transpileOptions`]) => string; 9 | getConfig: (options: Partial) => LoadCompileOptions['compileOptions'] | LoadTranspileOptions['transpileOptions']; 10 | load: (options: compiler.CompileOptions | compiler.TranspileOptions) => Promise; 11 | } 12 | 13 | export const providersMap = { 14 | compile: compileProviders, 15 | transpile: transpileProviders, 16 | } as Record; 17 | -------------------------------------------------------------------------------- /src/providers/transpile/get-cache-dir.ts: -------------------------------------------------------------------------------- 1 | import { LoadTranspileOptions } from '../../load.interfaces.js'; 2 | 3 | export const getCacheDir = (options: LoadTranspileOptions[`transpileOptions`]) => { 4 | return options.cache.dir; 5 | }; 6 | -------------------------------------------------------------------------------- /src/providers/transpile/get-config.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'node:path'; 2 | 3 | import { LoadTranspileOptions } from '../../load.interfaces.js'; 4 | import { defaults } from 'options-defaults'; 5 | import tsc from 'typescript'; 6 | 7 | export const getConfig = (options: LoadTranspileOptions) => { 8 | const cwd = process.cwd(); 9 | const defaultTranspileOptions: LoadTranspileOptions['transpileOptions'] = { 10 | cache: { 11 | // invalidateOnChanges: boolean; 12 | dir: path.join(cwd, `.cache`, `ts-import`), 13 | }, 14 | transpileOptions: { 15 | compilerOptions: { 16 | module: tsc.ModuleKind.ES2020, 17 | moduleResolution: tsc.ModuleResolutionKind.Node16, 18 | target: tsc.ScriptTarget.ES2020, 19 | }, 20 | }, 21 | }; 22 | 23 | if (process.platform === `win32`) { 24 | const driveLetter = cwd.charAt(0); 25 | defaultTranspileOptions.cache.dir = path.join(defaultTranspileOptions.cache.dir, driveLetter); 26 | } 27 | 28 | const transpileOptions = defaults(defaultTranspileOptions, options.transpileOptions); 29 | return transpileOptions; 30 | }; 31 | -------------------------------------------------------------------------------- /src/providers/transpile/index.ts: -------------------------------------------------------------------------------- 1 | export * from './get-cache-dir.js'; 2 | export * from './get-config.js'; 3 | export * from './load.js'; 4 | -------------------------------------------------------------------------------- /src/providers/transpile/load.ts: -------------------------------------------------------------------------------- 1 | import * as compiler from '../../modules/compiler/index.js'; 2 | 3 | export const load = async (options: compiler.TranspileOptions) => { 4 | return compiler.transpile(options); 5 | }; 6 | -------------------------------------------------------------------------------- /src/utils/check-if-file-exists.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'node:fs'; 2 | 3 | export const checkIfFileExists = async (filePath: string) => { 4 | return fs.promises.stat(filePath); 5 | }; 6 | 7 | export const checkIfFileExistsSync = (filePath: string) => { 8 | return fs.statSync(filePath); 9 | }; 10 | -------------------------------------------------------------------------------- /src/utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from './check-if-file-exists.js'; 2 | export * from './is-file-newer.js'; 3 | -------------------------------------------------------------------------------- /src/utils/is-file-newer.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'node:fs'; 2 | 3 | export const isFileNewer = (file1: fs.Stats, file2: fs.Stats) => { 4 | return file1.mtimeMs > file2.mtimeMs; 5 | }; 6 | -------------------------------------------------------------------------------- /tests/allow-configuration-with-comments.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable id-length */ 2 | import * as tsImport from '../src/main.js'; 3 | 4 | import { dirname } from 'node:path'; 5 | import { fileURLToPath } from 'node:url'; 6 | import test from 'ava'; 7 | 8 | const filePath = fileURLToPath(import.meta.url); 9 | const directoryPath = dirname(filePath); 10 | 11 | test(`allow-configuration-with-comments-compile`, async (t) => { 12 | const loaded = await tsImport.load(`${directoryPath}/assets/allow-configuration-with-comments/allow-configuration-with-comments-transpile.ts`, { 13 | allowConfigurationWithComments: true, 14 | }); 15 | 16 | t.truthy(loaded.result); 17 | }); 18 | 19 | test(`allow-configuration-with-comments-transpile`, async (t) => { 20 | const loaded = await tsImport.load(`${directoryPath}/assets/allow-configuration-with-comments/allow-configuration-with-comments-compile.ts`, { 21 | allowConfigurationWithComments: true, 22 | }); 23 | 24 | t.truthy(loaded.result); 25 | }); 26 | -------------------------------------------------------------------------------- /tests/assets/allow-configuration-with-comments/allow-configuration-with-comments-compile.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @tsImport 3 | * { "mode": "compile" } 4 | */ 5 | 6 | import { getOtherVariable } from './get-other-variable.js'; 7 | 8 | const result = getOtherVariable(); 9 | 10 | export { result }; 11 | -------------------------------------------------------------------------------- /tests/assets/allow-configuration-with-comments/allow-configuration-with-comments-transpile.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @tsImport 3 | * { "mode": "transpile" } 4 | */ 5 | 6 | const result = true; 7 | 8 | export { result }; 9 | -------------------------------------------------------------------------------- /tests/assets/allow-configuration-with-comments/get-other-variable.ts: -------------------------------------------------------------------------------- 1 | export const getOtherVariable = () => { 2 | return true; 3 | }; 4 | -------------------------------------------------------------------------------- /tests/assets/import-in-import/import-in-import.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'node:path'; 2 | import * as tsImport from '../../../src/main.js'; 3 | 4 | const result = true; 5 | 6 | const importPath = path.resolve(process.cwd(), `tests/assets/library-using/library-using.ts`); 7 | 8 | const library = await tsImport.load(importPath); 9 | 10 | export { result }; 11 | -------------------------------------------------------------------------------- /tests/assets/library-using/library-using.ts: -------------------------------------------------------------------------------- 1 | 2 | const defaults = await import(`options-defaults`); 3 | 4 | const result = true; 5 | 6 | export { result }; 7 | -------------------------------------------------------------------------------- /tests/assets/process-cwd-collision/example0.ts: -------------------------------------------------------------------------------- 1 | console.log(process.cwd()); 2 | 3 | export const example0 = `test0`; 4 | -------------------------------------------------------------------------------- /tests/assets/process-cwd-collision/example1.ts: -------------------------------------------------------------------------------- 1 | console.log(process.cwd()); 2 | 3 | export const example1 = `test1`; 4 | -------------------------------------------------------------------------------- /tests/assets/process-cwd-collision/example2.ts: -------------------------------------------------------------------------------- 1 | console.log(process.cwd()); 2 | 3 | export const example2 = `test2`; 4 | -------------------------------------------------------------------------------- /tests/assets/process-cwd-collision/example3.ts: -------------------------------------------------------------------------------- 1 | console.log(process.cwd()); 2 | 3 | export const example3 = `test3`; 4 | -------------------------------------------------------------------------------- /tests/assets/process-cwd-collision/example4.ts: -------------------------------------------------------------------------------- 1 | console.log(process.cwd()); 2 | 3 | export const example4 = `test4`; 4 | -------------------------------------------------------------------------------- /tests/assets/process-cwd-collision/example5.ts: -------------------------------------------------------------------------------- 1 | console.log(process.cwd()); 2 | 3 | export const example5 = `test5`; 4 | -------------------------------------------------------------------------------- /tests/import-in-import.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable id-length */ 2 | import * as tsImport from '../src/main.js'; 3 | 4 | import { dirname } from 'node:path'; 5 | import { fileURLToPath } from 'node:url'; 6 | import test from 'ava'; 7 | 8 | const filePath = fileURLToPath(import.meta.url); 9 | const directoryPath = dirname(filePath); 10 | 11 | test(`import-in-import`, async (t) => { 12 | const loaded = await tsImport.load(`${directoryPath}/assets/import-in-import/import-in-import.ts`, { 13 | mode: tsImport.LoadMode.Compile, 14 | }); 15 | 16 | t.truthy(loaded.result); 17 | }); 18 | -------------------------------------------------------------------------------- /tests/import-without-cache.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable id-length */ 2 | import * as tsImport from '../src/main.js'; 3 | 4 | import { dirname } from 'node:path'; 5 | import { fileURLToPath } from 'node:url'; 6 | import test from 'ava'; 7 | 8 | const filePath = fileURLToPath(import.meta.url); 9 | const directoryPath = dirname(filePath); 10 | 11 | test(`import-without-cache`, async (t) => { 12 | const loaded = await tsImport.load(`${directoryPath}/assets/library-using/library-using.ts`, { 13 | useCache: false, 14 | }); 15 | 16 | t.truthy(loaded.result); 17 | }); 18 | -------------------------------------------------------------------------------- /tests/library-using.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable id-length */ 2 | import * as tsImport from '../src/main.js'; 3 | 4 | import { dirname } from 'node:path'; 5 | import { fileURLToPath } from 'node:url'; 6 | import test from 'ava'; 7 | 8 | const filePath = fileURLToPath(import.meta.url); 9 | const directoryPath = dirname(filePath); 10 | 11 | test(`library-using`, async (t) => { 12 | const loaded = await tsImport.load(`${directoryPath}/assets/library-using/library-using.ts`); 13 | 14 | t.truthy(loaded.result); 15 | }); 16 | -------------------------------------------------------------------------------- /tests/nonexistent-typescript-file.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable id-length */ 2 | import * as tsImport from '../src/main.js'; 3 | 4 | import { dirname } from 'node:path'; 5 | import { fileURLToPath } from 'node:url'; 6 | import test from 'ava'; 7 | 8 | const filePath = fileURLToPath(import.meta.url); 9 | const directoryPath = dirname(filePath); 10 | 11 | test(`nonexistent-typescript-file`, async (t) => { 12 | const loading = tsImport.load(`${directoryPath}/assets/file-that-does-not-exist.ts`); 13 | 14 | await t.throwsAsync(loading); 15 | }); 16 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "emitDecoratorMetadata": true, 5 | "exactOptionalPropertyTypes": true, 6 | "experimentalDecorators": true, 7 | "importHelpers": true, 8 | "incremental": true, 9 | "module": "Node16", 10 | "moduleResolution": "Node16", 11 | "noFallthroughCasesInSwitch": true, 12 | "noImplicitOverride": true, 13 | "noImplicitReturns": true, 14 | "noUncheckedIndexedAccess": true, 15 | "outDir": "./dist", 16 | "removeComments": true, 17 | "sourceMap": true, 18 | "strict": true, 19 | "target": "ES2020", 20 | "skipLibCheck": true 21 | }, 22 | "ts-node": { 23 | "esm": true 24 | }, 25 | "exclude": ["./dist", "./node_modules", "rr-scripts.ts", "tests"] 26 | } 27 | --------------------------------------------------------------------------------