@esportsplus/typescript 0.8.5 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (506) hide show
  1. package/bin/tsc +2 -5
  2. package/bin/tsc-alias +2 -5
  3. package/package.json +2 -4
  4. package/node_modules/.package-lock.json +0 -481
  5. package/node_modules/@nodelib/fs.scandir/LICENSE +0 -21
  6. package/node_modules/@nodelib/fs.scandir/README.md +0 -171
  7. package/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +0 -20
  8. package/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +0 -19
  9. package/node_modules/@nodelib/fs.scandir/out/constants.d.ts +0 -4
  10. package/node_modules/@nodelib/fs.scandir/out/constants.js +0 -17
  11. package/node_modules/@nodelib/fs.scandir/out/index.d.ts +0 -12
  12. package/node_modules/@nodelib/fs.scandir/out/index.js +0 -26
  13. package/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +0 -7
  14. package/node_modules/@nodelib/fs.scandir/out/providers/async.js +0 -104
  15. package/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +0 -1
  16. package/node_modules/@nodelib/fs.scandir/out/providers/common.js +0 -13
  17. package/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +0 -5
  18. package/node_modules/@nodelib/fs.scandir/out/providers/sync.js +0 -54
  19. package/node_modules/@nodelib/fs.scandir/out/settings.d.ts +0 -20
  20. package/node_modules/@nodelib/fs.scandir/out/settings.js +0 -24
  21. package/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +0 -20
  22. package/node_modules/@nodelib/fs.scandir/out/types/index.js +0 -2
  23. package/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +0 -2
  24. package/node_modules/@nodelib/fs.scandir/out/utils/fs.js +0 -19
  25. package/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +0 -2
  26. package/node_modules/@nodelib/fs.scandir/out/utils/index.js +0 -5
  27. package/node_modules/@nodelib/fs.scandir/package.json +0 -44
  28. package/node_modules/@nodelib/fs.stat/LICENSE +0 -21
  29. package/node_modules/@nodelib/fs.stat/README.md +0 -126
  30. package/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +0 -13
  31. package/node_modules/@nodelib/fs.stat/out/adapters/fs.js +0 -17
  32. package/node_modules/@nodelib/fs.stat/out/index.d.ts +0 -12
  33. package/node_modules/@nodelib/fs.stat/out/index.js +0 -26
  34. package/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +0 -4
  35. package/node_modules/@nodelib/fs.stat/out/providers/async.js +0 -36
  36. package/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +0 -3
  37. package/node_modules/@nodelib/fs.stat/out/providers/sync.js +0 -23
  38. package/node_modules/@nodelib/fs.stat/out/settings.d.ts +0 -16
  39. package/node_modules/@nodelib/fs.stat/out/settings.js +0 -16
  40. package/node_modules/@nodelib/fs.stat/out/types/index.d.ts +0 -4
  41. package/node_modules/@nodelib/fs.stat/out/types/index.js +0 -2
  42. package/node_modules/@nodelib/fs.stat/package.json +0 -37
  43. package/node_modules/@nodelib/fs.walk/LICENSE +0 -21
  44. package/node_modules/@nodelib/fs.walk/README.md +0 -215
  45. package/node_modules/@nodelib/fs.walk/out/index.d.ts +0 -14
  46. package/node_modules/@nodelib/fs.walk/out/index.js +0 -34
  47. package/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +0 -12
  48. package/node_modules/@nodelib/fs.walk/out/providers/async.js +0 -30
  49. package/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +0 -4
  50. package/node_modules/@nodelib/fs.walk/out/providers/index.js +0 -9
  51. package/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +0 -12
  52. package/node_modules/@nodelib/fs.walk/out/providers/stream.js +0 -34
  53. package/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +0 -10
  54. package/node_modules/@nodelib/fs.walk/out/providers/sync.js +0 -14
  55. package/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +0 -30
  56. package/node_modules/@nodelib/fs.walk/out/readers/async.js +0 -97
  57. package/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +0 -7
  58. package/node_modules/@nodelib/fs.walk/out/readers/common.js +0 -31
  59. package/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +0 -6
  60. package/node_modules/@nodelib/fs.walk/out/readers/reader.js +0 -11
  61. package/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +0 -15
  62. package/node_modules/@nodelib/fs.walk/out/readers/sync.js +0 -59
  63. package/node_modules/@nodelib/fs.walk/out/settings.d.ts +0 -30
  64. package/node_modules/@nodelib/fs.walk/out/settings.js +0 -26
  65. package/node_modules/@nodelib/fs.walk/out/types/index.d.ts +0 -8
  66. package/node_modules/@nodelib/fs.walk/out/types/index.js +0 -2
  67. package/node_modules/@nodelib/fs.walk/package.json +0 -44
  68. package/node_modules/anymatch/LICENSE +0 -15
  69. package/node_modules/anymatch/README.md +0 -87
  70. package/node_modules/anymatch/index.d.ts +0 -20
  71. package/node_modules/anymatch/index.js +0 -104
  72. package/node_modules/anymatch/package.json +0 -48
  73. package/node_modules/array-union/index.d.ts +0 -25
  74. package/node_modules/array-union/index.js +0 -5
  75. package/node_modules/array-union/license +0 -9
  76. package/node_modules/array-union/package.json +0 -38
  77. package/node_modules/array-union/readme.md +0 -34
  78. package/node_modules/binary-extensions/binary-extensions.json +0 -263
  79. package/node_modules/binary-extensions/binary-extensions.json.d.ts +0 -3
  80. package/node_modules/binary-extensions/index.d.ts +0 -14
  81. package/node_modules/binary-extensions/index.js +0 -1
  82. package/node_modules/binary-extensions/license +0 -10
  83. package/node_modules/binary-extensions/package.json +0 -40
  84. package/node_modules/binary-extensions/readme.md +0 -25
  85. package/node_modules/braces/LICENSE +0 -21
  86. package/node_modules/braces/README.md +0 -586
  87. package/node_modules/braces/index.js +0 -170
  88. package/node_modules/braces/lib/compile.js +0 -60
  89. package/node_modules/braces/lib/constants.js +0 -57
  90. package/node_modules/braces/lib/expand.js +0 -113
  91. package/node_modules/braces/lib/parse.js +0 -331
  92. package/node_modules/braces/lib/stringify.js +0 -32
  93. package/node_modules/braces/lib/utils.js +0 -122
  94. package/node_modules/braces/package.json +0 -77
  95. package/node_modules/chokidar/LICENSE +0 -21
  96. package/node_modules/chokidar/README.md +0 -308
  97. package/node_modules/chokidar/index.js +0 -973
  98. package/node_modules/chokidar/lib/constants.js +0 -66
  99. package/node_modules/chokidar/lib/fsevents-handler.js +0 -526
  100. package/node_modules/chokidar/lib/nodefs-handler.js +0 -654
  101. package/node_modules/chokidar/package.json +0 -70
  102. package/node_modules/chokidar/types/index.d.ts +0 -192
  103. package/node_modules/commander/LICENSE +0 -22
  104. package/node_modules/commander/Readme.md +0 -1129
  105. package/node_modules/commander/esm.mjs +0 -16
  106. package/node_modules/commander/index.js +0 -27
  107. package/node_modules/commander/lib/argument.js +0 -147
  108. package/node_modules/commander/lib/command.js +0 -2179
  109. package/node_modules/commander/lib/error.js +0 -45
  110. package/node_modules/commander/lib/help.js +0 -461
  111. package/node_modules/commander/lib/option.js +0 -326
  112. package/node_modules/commander/lib/suggestSimilar.js +0 -100
  113. package/node_modules/commander/package-support.json +0 -16
  114. package/node_modules/commander/package.json +0 -80
  115. package/node_modules/commander/typings/index.d.ts +0 -891
  116. package/node_modules/dir-glob/index.js +0 -75
  117. package/node_modules/dir-glob/license +0 -9
  118. package/node_modules/dir-glob/package.json +0 -38
  119. package/node_modules/dir-glob/readme.md +0 -76
  120. package/node_modules/fast-glob/LICENSE +0 -21
  121. package/node_modules/fast-glob/README.md +0 -830
  122. package/node_modules/fast-glob/out/index.d.ts +0 -40
  123. package/node_modules/fast-glob/out/index.js +0 -102
  124. package/node_modules/fast-glob/out/managers/tasks.d.ts +0 -22
  125. package/node_modules/fast-glob/out/managers/tasks.js +0 -110
  126. package/node_modules/fast-glob/out/providers/async.d.ts +0 -9
  127. package/node_modules/fast-glob/out/providers/async.js +0 -23
  128. package/node_modules/fast-glob/out/providers/filters/deep.d.ts +0 -16
  129. package/node_modules/fast-glob/out/providers/filters/deep.js +0 -62
  130. package/node_modules/fast-glob/out/providers/filters/entry.d.ts +0 -17
  131. package/node_modules/fast-glob/out/providers/filters/entry.js +0 -85
  132. package/node_modules/fast-glob/out/providers/filters/error.d.ts +0 -8
  133. package/node_modules/fast-glob/out/providers/filters/error.js +0 -15
  134. package/node_modules/fast-glob/out/providers/matchers/matcher.d.ts +0 -33
  135. package/node_modules/fast-glob/out/providers/matchers/matcher.js +0 -45
  136. package/node_modules/fast-glob/out/providers/matchers/partial.d.ts +0 -4
  137. package/node_modules/fast-glob/out/providers/matchers/partial.js +0 -38
  138. package/node_modules/fast-glob/out/providers/provider.d.ts +0 -19
  139. package/node_modules/fast-glob/out/providers/provider.js +0 -48
  140. package/node_modules/fast-glob/out/providers/stream.d.ts +0 -11
  141. package/node_modules/fast-glob/out/providers/stream.js +0 -31
  142. package/node_modules/fast-glob/out/providers/sync.d.ts +0 -9
  143. package/node_modules/fast-glob/out/providers/sync.js +0 -23
  144. package/node_modules/fast-glob/out/providers/transformers/entry.d.ts +0 -8
  145. package/node_modules/fast-glob/out/providers/transformers/entry.js +0 -26
  146. package/node_modules/fast-glob/out/readers/async.d.ts +0 -10
  147. package/node_modules/fast-glob/out/readers/async.js +0 -35
  148. package/node_modules/fast-glob/out/readers/reader.d.ts +0 -15
  149. package/node_modules/fast-glob/out/readers/reader.js +0 -33
  150. package/node_modules/fast-glob/out/readers/stream.d.ts +0 -14
  151. package/node_modules/fast-glob/out/readers/stream.js +0 -55
  152. package/node_modules/fast-glob/out/readers/sync.d.ts +0 -12
  153. package/node_modules/fast-glob/out/readers/sync.js +0 -43
  154. package/node_modules/fast-glob/out/settings.d.ts +0 -164
  155. package/node_modules/fast-glob/out/settings.js +0 -59
  156. package/node_modules/fast-glob/out/types/index.d.ts +0 -31
  157. package/node_modules/fast-glob/out/types/index.js +0 -2
  158. package/node_modules/fast-glob/out/utils/array.d.ts +0 -2
  159. package/node_modules/fast-glob/out/utils/array.js +0 -22
  160. package/node_modules/fast-glob/out/utils/errno.d.ts +0 -2
  161. package/node_modules/fast-glob/out/utils/errno.js +0 -7
  162. package/node_modules/fast-glob/out/utils/fs.d.ts +0 -4
  163. package/node_modules/fast-glob/out/utils/fs.js +0 -19
  164. package/node_modules/fast-glob/out/utils/index.d.ts +0 -8
  165. package/node_modules/fast-glob/out/utils/index.js +0 -17
  166. package/node_modules/fast-glob/out/utils/path.d.ts +0 -13
  167. package/node_modules/fast-glob/out/utils/path.js +0 -68
  168. package/node_modules/fast-glob/out/utils/pattern.d.ts +0 -49
  169. package/node_modules/fast-glob/out/utils/pattern.js +0 -206
  170. package/node_modules/fast-glob/out/utils/stream.d.ts +0 -4
  171. package/node_modules/fast-glob/out/utils/stream.js +0 -17
  172. package/node_modules/fast-glob/out/utils/string.d.ts +0 -2
  173. package/node_modules/fast-glob/out/utils/string.js +0 -11
  174. package/node_modules/fast-glob/package.json +0 -81
  175. package/node_modules/fastq/.github/dependabot.yml +0 -11
  176. package/node_modules/fastq/.github/workflows/ci.yml +0 -75
  177. package/node_modules/fastq/LICENSE +0 -13
  178. package/node_modules/fastq/README.md +0 -312
  179. package/node_modules/fastq/SECURITY.md +0 -15
  180. package/node_modules/fastq/bench.js +0 -66
  181. package/node_modules/fastq/example.js +0 -14
  182. package/node_modules/fastq/example.mjs +0 -11
  183. package/node_modules/fastq/index.d.ts +0 -57
  184. package/node_modules/fastq/package.json +0 -53
  185. package/node_modules/fastq/queue.js +0 -311
  186. package/node_modules/fastq/test/example.ts +0 -83
  187. package/node_modules/fastq/test/promise.js +0 -291
  188. package/node_modules/fastq/test/test.js +0 -653
  189. package/node_modules/fastq/test/tsconfig.json +0 -11
  190. package/node_modules/fill-range/LICENSE +0 -21
  191. package/node_modules/fill-range/README.md +0 -237
  192. package/node_modules/fill-range/index.js +0 -248
  193. package/node_modules/fill-range/package.json +0 -74
  194. package/node_modules/get-tsconfig/LICENSE +0 -21
  195. package/node_modules/get-tsconfig/README.md +0 -235
  196. package/node_modules/get-tsconfig/dist/index.cjs +0 -7
  197. package/node_modules/get-tsconfig/dist/index.d.cts +0 -1439
  198. package/node_modules/get-tsconfig/dist/index.d.mts +0 -1439
  199. package/node_modules/get-tsconfig/dist/index.mjs +0 -7
  200. package/node_modules/get-tsconfig/package.json +0 -46
  201. package/node_modules/glob-parent/CHANGELOG.md +0 -110
  202. package/node_modules/glob-parent/LICENSE +0 -15
  203. package/node_modules/glob-parent/README.md +0 -137
  204. package/node_modules/glob-parent/index.js +0 -42
  205. package/node_modules/glob-parent/package.json +0 -48
  206. package/node_modules/globby/gitignore.js +0 -120
  207. package/node_modules/globby/index.d.ts +0 -186
  208. package/node_modules/globby/index.js +0 -181
  209. package/node_modules/globby/license +0 -9
  210. package/node_modules/globby/package.json +0 -82
  211. package/node_modules/globby/readme.md +0 -170
  212. package/node_modules/globby/stream-utils.js +0 -46
  213. package/node_modules/ignore/LICENSE-MIT +0 -21
  214. package/node_modules/ignore/README.md +0 -412
  215. package/node_modules/ignore/index.d.ts +0 -61
  216. package/node_modules/ignore/index.js +0 -636
  217. package/node_modules/ignore/legacy.js +0 -559
  218. package/node_modules/ignore/package.json +0 -74
  219. package/node_modules/is-binary-path/index.d.ts +0 -17
  220. package/node_modules/is-binary-path/index.js +0 -7
  221. package/node_modules/is-binary-path/license +0 -9
  222. package/node_modules/is-binary-path/package.json +0 -40
  223. package/node_modules/is-binary-path/readme.md +0 -34
  224. package/node_modules/is-extglob/LICENSE +0 -21
  225. package/node_modules/is-extglob/README.md +0 -107
  226. package/node_modules/is-extglob/index.js +0 -20
  227. package/node_modules/is-extglob/package.json +0 -69
  228. package/node_modules/is-glob/LICENSE +0 -21
  229. package/node_modules/is-glob/README.md +0 -206
  230. package/node_modules/is-glob/index.js +0 -150
  231. package/node_modules/is-glob/package.json +0 -81
  232. package/node_modules/is-number/LICENSE +0 -21
  233. package/node_modules/is-number/README.md +0 -187
  234. package/node_modules/is-number/index.js +0 -18
  235. package/node_modules/is-number/package.json +0 -82
  236. package/node_modules/merge2/LICENSE +0 -21
  237. package/node_modules/merge2/README.md +0 -144
  238. package/node_modules/merge2/index.js +0 -144
  239. package/node_modules/merge2/package.json +0 -43
  240. package/node_modules/micromatch/LICENSE +0 -21
  241. package/node_modules/micromatch/README.md +0 -1024
  242. package/node_modules/micromatch/index.js +0 -474
  243. package/node_modules/micromatch/package.json +0 -119
  244. package/node_modules/mylas/LICENSE +0 -21
  245. package/node_modules/mylas/README.md +0 -39
  246. package/node_modules/mylas/build/chunk-3EDNT3AM.js +0 -1
  247. package/node_modules/mylas/build/chunk-M3H36CX2.js +0 -3
  248. package/node_modules/mylas/build/index.d.ts +0 -22
  249. package/node_modules/mylas/build/index.js +0 -1
  250. package/node_modules/mylas/build/interfaces.d.ts +0 -201
  251. package/node_modules/mylas/build/register.d.ts +0 -9
  252. package/node_modules/mylas/build/register.js +0 -1
  253. package/node_modules/mylas/build/worker.js +0 -1
  254. package/node_modules/mylas/package.json +0 -65
  255. package/node_modules/normalize-path/LICENSE +0 -21
  256. package/node_modules/normalize-path/README.md +0 -127
  257. package/node_modules/normalize-path/index.js +0 -35
  258. package/node_modules/normalize-path/package.json +0 -77
  259. package/node_modules/path-type/index.d.ts +0 -51
  260. package/node_modules/path-type/index.js +0 -43
  261. package/node_modules/path-type/license +0 -9
  262. package/node_modules/path-type/package.json +0 -45
  263. package/node_modules/path-type/readme.md +0 -72
  264. package/node_modules/picomatch/CHANGELOG.md +0 -136
  265. package/node_modules/picomatch/LICENSE +0 -21
  266. package/node_modules/picomatch/README.md +0 -708
  267. package/node_modules/picomatch/index.js +0 -3
  268. package/node_modules/picomatch/lib/constants.js +0 -179
  269. package/node_modules/picomatch/lib/parse.js +0 -1091
  270. package/node_modules/picomatch/lib/picomatch.js +0 -342
  271. package/node_modules/picomatch/lib/scan.js +0 -391
  272. package/node_modules/picomatch/lib/utils.js +0 -64
  273. package/node_modules/picomatch/package.json +0 -81
  274. package/node_modules/plimit-lit/LICENSE +0 -21
  275. package/node_modules/plimit-lit/README.md +0 -99
  276. package/node_modules/plimit-lit/dist/index.d.ts +0 -6
  277. package/node_modules/plimit-lit/dist/plimit-lit.cjs +0 -91
  278. package/node_modules/plimit-lit/dist/plimit-lit.modern.js +0 -91
  279. package/node_modules/plimit-lit/dist/plimit-lit.module.js +0 -91
  280. package/node_modules/plimit-lit/package.json +0 -55
  281. package/node_modules/queue-lit/LICENSE +0 -21
  282. package/node_modules/queue-lit/README.md +0 -93
  283. package/node_modules/queue-lit/dist/index.d.ts +0 -34
  284. package/node_modules/queue-lit/dist/queue-lit.cjs +0 -110
  285. package/node_modules/queue-lit/dist/queue-lit.modern.js +0 -110
  286. package/node_modules/queue-lit/dist/queue-lit.module.js +0 -110
  287. package/node_modules/queue-lit/package.json +0 -53
  288. package/node_modules/queue-microtask/LICENSE +0 -20
  289. package/node_modules/queue-microtask/README.md +0 -90
  290. package/node_modules/queue-microtask/index.d.ts +0 -2
  291. package/node_modules/queue-microtask/index.js +0 -9
  292. package/node_modules/queue-microtask/package.json +0 -55
  293. package/node_modules/readdirp/LICENSE +0 -21
  294. package/node_modules/readdirp/README.md +0 -122
  295. package/node_modules/readdirp/index.d.ts +0 -43
  296. package/node_modules/readdirp/index.js +0 -287
  297. package/node_modules/readdirp/package.json +0 -122
  298. package/node_modules/resolve-pkg-maps/LICENSE +0 -21
  299. package/node_modules/resolve-pkg-maps/README.md +0 -216
  300. package/node_modules/resolve-pkg-maps/dist/index.cjs +0 -1
  301. package/node_modules/resolve-pkg-maps/dist/index.d.cts +0 -11
  302. package/node_modules/resolve-pkg-maps/dist/index.d.mts +0 -11
  303. package/node_modules/resolve-pkg-maps/dist/index.mjs +0 -1
  304. package/node_modules/resolve-pkg-maps/package.json +0 -42
  305. package/node_modules/reusify/.github/dependabot.yml +0 -7
  306. package/node_modules/reusify/.github/workflows/ci.yml +0 -96
  307. package/node_modules/reusify/LICENSE +0 -22
  308. package/node_modules/reusify/README.md +0 -139
  309. package/node_modules/reusify/SECURITY.md +0 -15
  310. package/node_modules/reusify/benchmarks/createNoCodeFunction.js +0 -30
  311. package/node_modules/reusify/benchmarks/fib.js +0 -13
  312. package/node_modules/reusify/benchmarks/reuseNoCodeFunction.js +0 -38
  313. package/node_modules/reusify/eslint.config.js +0 -14
  314. package/node_modules/reusify/package.json +0 -50
  315. package/node_modules/reusify/reusify.d.ts +0 -14
  316. package/node_modules/reusify/reusify.js +0 -33
  317. package/node_modules/reusify/test.js +0 -66
  318. package/node_modules/reusify/tsconfig.json +0 -11
  319. package/node_modules/run-parallel/LICENSE +0 -20
  320. package/node_modules/run-parallel/README.md +0 -85
  321. package/node_modules/run-parallel/index.js +0 -51
  322. package/node_modules/run-parallel/package.json +0 -58
  323. package/node_modules/slash/index.d.ts +0 -25
  324. package/node_modules/slash/index.js +0 -11
  325. package/node_modules/slash/license +0 -9
  326. package/node_modules/slash/package.json +0 -35
  327. package/node_modules/slash/readme.md +0 -44
  328. package/node_modules/to-regex-range/LICENSE +0 -21
  329. package/node_modules/to-regex-range/README.md +0 -305
  330. package/node_modules/to-regex-range/index.js +0 -288
  331. package/node_modules/to-regex-range/package.json +0 -88
  332. package/node_modules/tsc-alias/LICENSE +0 -21
  333. package/node_modules/tsc-alias/README.md +0 -184
  334. package/node_modules/tsc-alias/dist/bin/index.d.ts +0 -2
  335. package/node_modules/tsc-alias/dist/bin/index.js +0 -39
  336. package/node_modules/tsc-alias/dist/bin/index.js.map +0 -1
  337. package/node_modules/tsc-alias/dist/helpers/config.d.ts +0 -5
  338. package/node_modules/tsc-alias/dist/helpers/config.js +0 -181
  339. package/node_modules/tsc-alias/dist/helpers/config.js.map +0 -1
  340. package/node_modules/tsc-alias/dist/helpers/index.d.ts +0 -3
  341. package/node_modules/tsc-alias/dist/helpers/index.js +0 -20
  342. package/node_modules/tsc-alias/dist/helpers/index.js.map +0 -1
  343. package/node_modules/tsc-alias/dist/helpers/path.d.ts +0 -3
  344. package/node_modules/tsc-alias/dist/helpers/path.js +0 -73
  345. package/node_modules/tsc-alias/dist/helpers/path.js.map +0 -1
  346. package/node_modules/tsc-alias/dist/helpers/replacers.d.ts +0 -4
  347. package/node_modules/tsc-alias/dist/helpers/replacers.js +0 -150
  348. package/node_modules/tsc-alias/dist/helpers/replacers.js.map +0 -1
  349. package/node_modules/tsc-alias/dist/index.d.ts +0 -8
  350. package/node_modules/tsc-alias/dist/index.js +0 -74
  351. package/node_modules/tsc-alias/dist/index.js.map +0 -1
  352. package/node_modules/tsc-alias/dist/interfaces.d.ts +0 -87
  353. package/node_modules/tsc-alias/dist/interfaces.js +0 -3
  354. package/node_modules/tsc-alias/dist/interfaces.js.map +0 -1
  355. package/node_modules/tsc-alias/dist/replacers/base-url.replacer.d.ts +0 -2
  356. package/node_modules/tsc-alias/dist/replacers/base-url.replacer.js +0 -33
  357. package/node_modules/tsc-alias/dist/replacers/base-url.replacer.js.map +0 -1
  358. package/node_modules/tsc-alias/dist/replacers/default.replacer.d.ts +0 -2
  359. package/node_modules/tsc-alias/dist/replacers/default.replacer.js +0 -67
  360. package/node_modules/tsc-alias/dist/replacers/default.replacer.js.map +0 -1
  361. package/node_modules/tsc-alias/dist/utils/import-path-resolver.d.ts +0 -19
  362. package/node_modules/tsc-alias/dist/utils/import-path-resolver.js +0 -87
  363. package/node_modules/tsc-alias/dist/utils/import-path-resolver.js.map +0 -1
  364. package/node_modules/tsc-alias/dist/utils/index.d.ts +0 -4
  365. package/node_modules/tsc-alias/dist/utils/index.js +0 -21
  366. package/node_modules/tsc-alias/dist/utils/index.js.map +0 -1
  367. package/node_modules/tsc-alias/dist/utils/output.d.ts +0 -11
  368. package/node_modules/tsc-alias/dist/utils/output.js +0 -44
  369. package/node_modules/tsc-alias/dist/utils/output.js.map +0 -1
  370. package/node_modules/tsc-alias/dist/utils/path-cache.d.ts +0 -12
  371. package/node_modules/tsc-alias/dist/utils/path-cache.js +0 -74
  372. package/node_modules/tsc-alias/dist/utils/path-cache.js.map +0 -1
  373. package/node_modules/tsc-alias/dist/utils/trie.d.ts +0 -9
  374. package/node_modules/tsc-alias/dist/utils/trie.js +0 -81
  375. package/node_modules/tsc-alias/dist/utils/trie.js.map +0 -1
  376. package/node_modules/tsc-alias/package.json +0 -66
  377. package/node_modules/typescript/LICENSE.txt +0 -55
  378. package/node_modules/typescript/README.md +0 -50
  379. package/node_modules/typescript/SECURITY.md +0 -41
  380. package/node_modules/typescript/ThirdPartyNoticeText.txt +0 -193
  381. package/node_modules/typescript/bin/tsc +0 -2
  382. package/node_modules/typescript/bin/tsserver +0 -2
  383. package/node_modules/typescript/lib/_tsc.js +0 -132810
  384. package/node_modules/typescript/lib/_tsserver.js +0 -659
  385. package/node_modules/typescript/lib/_typingsInstaller.js +0 -222
  386. package/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -2105
  387. package/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -2105
  388. package/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -2105
  389. package/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -2105
  390. package/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -2105
  391. package/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -2105
  392. package/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -2105
  393. package/node_modules/typescript/lib/lib.d.ts +0 -22
  394. package/node_modules/typescript/lib/lib.decorators.d.ts +0 -384
  395. package/node_modules/typescript/lib/lib.decorators.legacy.d.ts +0 -22
  396. package/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +0 -41
  397. package/node_modules/typescript/lib/lib.dom.d.ts +0 -29610
  398. package/node_modules/typescript/lib/lib.dom.iterable.d.ts +0 -493
  399. package/node_modules/typescript/lib/lib.es2015.collection.d.ts +0 -147
  400. package/node_modules/typescript/lib/lib.es2015.core.d.ts +0 -597
  401. package/node_modules/typescript/lib/lib.es2015.d.ts +0 -28
  402. package/node_modules/typescript/lib/lib.es2015.generator.d.ts +0 -77
  403. package/node_modules/typescript/lib/lib.es2015.iterable.d.ts +0 -605
  404. package/node_modules/typescript/lib/lib.es2015.promise.d.ts +0 -81
  405. package/node_modules/typescript/lib/lib.es2015.proxy.d.ts +0 -128
  406. package/node_modules/typescript/lib/lib.es2015.reflect.d.ts +0 -144
  407. package/node_modules/typescript/lib/lib.es2015.symbol.d.ts +0 -46
  408. package/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -326
  409. package/node_modules/typescript/lib/lib.es2016.array.include.d.ts +0 -116
  410. package/node_modules/typescript/lib/lib.es2016.d.ts +0 -21
  411. package/node_modules/typescript/lib/lib.es2016.full.d.ts +0 -23
  412. package/node_modules/typescript/lib/lib.es2016.intl.d.ts +0 -31
  413. package/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +0 -21
  414. package/node_modules/typescript/lib/lib.es2017.d.ts +0 -26
  415. package/node_modules/typescript/lib/lib.es2017.date.d.ts +0 -31
  416. package/node_modules/typescript/lib/lib.es2017.full.d.ts +0 -23
  417. package/node_modules/typescript/lib/lib.es2017.intl.d.ts +0 -44
  418. package/node_modules/typescript/lib/lib.es2017.object.d.ts +0 -49
  419. package/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +0 -135
  420. package/node_modules/typescript/lib/lib.es2017.string.d.ts +0 -45
  421. package/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +0 -53
  422. package/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -77
  423. package/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +0 -53
  424. package/node_modules/typescript/lib/lib.es2018.d.ts +0 -24
  425. package/node_modules/typescript/lib/lib.es2018.full.d.ts +0 -24
  426. package/node_modules/typescript/lib/lib.es2018.intl.d.ts +0 -83
  427. package/node_modules/typescript/lib/lib.es2018.promise.d.ts +0 -30
  428. package/node_modules/typescript/lib/lib.es2018.regexp.d.ts +0 -37
  429. package/node_modules/typescript/lib/lib.es2019.array.d.ts +0 -79
  430. package/node_modules/typescript/lib/lib.es2019.d.ts +0 -24
  431. package/node_modules/typescript/lib/lib.es2019.full.d.ts +0 -24
  432. package/node_modules/typescript/lib/lib.es2019.intl.d.ts +0 -23
  433. package/node_modules/typescript/lib/lib.es2019.object.d.ts +0 -33
  434. package/node_modules/typescript/lib/lib.es2019.string.d.ts +0 -37
  435. package/node_modules/typescript/lib/lib.es2019.symbol.d.ts +0 -24
  436. package/node_modules/typescript/lib/lib.es2020.bigint.d.ts +0 -765
  437. package/node_modules/typescript/lib/lib.es2020.d.ts +0 -27
  438. package/node_modules/typescript/lib/lib.es2020.date.d.ts +0 -42
  439. package/node_modules/typescript/lib/lib.es2020.full.d.ts +0 -24
  440. package/node_modules/typescript/lib/lib.es2020.intl.d.ts +0 -474
  441. package/node_modules/typescript/lib/lib.es2020.number.d.ts +0 -28
  442. package/node_modules/typescript/lib/lib.es2020.promise.d.ts +0 -47
  443. package/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +0 -99
  444. package/node_modules/typescript/lib/lib.es2020.string.d.ts +0 -44
  445. package/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -41
  446. package/node_modules/typescript/lib/lib.es2021.d.ts +0 -23
  447. package/node_modules/typescript/lib/lib.es2021.full.d.ts +0 -24
  448. package/node_modules/typescript/lib/lib.es2021.intl.d.ts +0 -166
  449. package/node_modules/typescript/lib/lib.es2021.promise.d.ts +0 -48
  450. package/node_modules/typescript/lib/lib.es2021.string.d.ts +0 -33
  451. package/node_modules/typescript/lib/lib.es2021.weakref.d.ts +0 -78
  452. package/node_modules/typescript/lib/lib.es2022.array.d.ts +0 -121
  453. package/node_modules/typescript/lib/lib.es2022.d.ts +0 -25
  454. package/node_modules/typescript/lib/lib.es2022.error.d.ts +0 -75
  455. package/node_modules/typescript/lib/lib.es2022.full.d.ts +0 -24
  456. package/node_modules/typescript/lib/lib.es2022.intl.d.ts +0 -121
  457. package/node_modules/typescript/lib/lib.es2022.object.d.ts +0 -26
  458. package/node_modules/typescript/lib/lib.es2022.regexp.d.ts +0 -39
  459. package/node_modules/typescript/lib/lib.es2022.string.d.ts +0 -25
  460. package/node_modules/typescript/lib/lib.es2023.array.d.ts +0 -924
  461. package/node_modules/typescript/lib/lib.es2023.collection.d.ts +0 -21
  462. package/node_modules/typescript/lib/lib.es2023.d.ts +0 -22
  463. package/node_modules/typescript/lib/lib.es2023.full.d.ts +0 -24
  464. package/node_modules/typescript/lib/lib.es2023.intl.d.ts +0 -56
  465. package/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +0 -65
  466. package/node_modules/typescript/lib/lib.es2024.collection.d.ts +0 -29
  467. package/node_modules/typescript/lib/lib.es2024.d.ts +0 -26
  468. package/node_modules/typescript/lib/lib.es2024.full.d.ts +0 -24
  469. package/node_modules/typescript/lib/lib.es2024.object.d.ts +0 -29
  470. package/node_modules/typescript/lib/lib.es2024.promise.d.ts +0 -35
  471. package/node_modules/typescript/lib/lib.es2024.regexp.d.ts +0 -25
  472. package/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +0 -68
  473. package/node_modules/typescript/lib/lib.es2024.string.d.ts +0 -29
  474. package/node_modules/typescript/lib/lib.es5.d.ts +0 -4594
  475. package/node_modules/typescript/lib/lib.es6.d.ts +0 -23
  476. package/node_modules/typescript/lib/lib.esnext.array.d.ts +0 -35
  477. package/node_modules/typescript/lib/lib.esnext.collection.d.ts +0 -96
  478. package/node_modules/typescript/lib/lib.esnext.d.ts +0 -27
  479. package/node_modules/typescript/lib/lib.esnext.decorators.d.ts +0 -28
  480. package/node_modules/typescript/lib/lib.esnext.disposable.d.ts +0 -193
  481. package/node_modules/typescript/lib/lib.esnext.float16.d.ts +0 -443
  482. package/node_modules/typescript/lib/lib.esnext.full.d.ts +0 -24
  483. package/node_modules/typescript/lib/lib.esnext.intl.d.ts +0 -21
  484. package/node_modules/typescript/lib/lib.esnext.iterator.d.ts +0 -148
  485. package/node_modules/typescript/lib/lib.esnext.promise.d.ts +0 -34
  486. package/node_modules/typescript/lib/lib.scripthost.d.ts +0 -322
  487. package/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +0 -41
  488. package/node_modules/typescript/lib/lib.webworker.d.ts +0 -9894
  489. package/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +0 -23
  490. package/node_modules/typescript/lib/lib.webworker.iterable.d.ts +0 -287
  491. package/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -2105
  492. package/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -2105
  493. package/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -2105
  494. package/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -2105
  495. package/node_modules/typescript/lib/tsc.js +0 -8
  496. package/node_modules/typescript/lib/tsserver.js +0 -8
  497. package/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -17
  498. package/node_modules/typescript/lib/tsserverlibrary.js +0 -21
  499. package/node_modules/typescript/lib/typesMap.json +0 -497
  500. package/node_modules/typescript/lib/typescript.d.ts +0 -11399
  501. package/node_modules/typescript/lib/typescript.js +0 -199120
  502. package/node_modules/typescript/lib/typingsInstaller.js +0 -8
  503. package/node_modules/typescript/lib/watchGuard.js +0 -53
  504. package/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -2105
  505. package/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -2105
  506. package/node_modules/typescript/package.json +0 -120
@@ -1,87 +0,0 @@
1
- import { PathCache, TrieNode } from './utils';
2
- export interface ITSCAliasConfig {
3
- replacers?: ReplacerOptions;
4
- resolveFullPaths?: boolean;
5
- verbose?: boolean;
6
- fileExtensions?: Partial<FileExtensions>;
7
- }
8
- export type PathLike = {
9
- [key: string]: string[];
10
- };
11
- export type StringReplacer = (importStatement: string) => string;
12
- export interface FileExtensions {
13
- inputGlob: string;
14
- outputCheck: string[];
15
- }
16
- export interface ITSConfig {
17
- baseUrl?: string;
18
- outDir?: string;
19
- declarationDir?: string;
20
- paths?: PathLike;
21
- replacers?: ReplacerOptions;
22
- resolveFullPaths?: boolean;
23
- verbose?: boolean;
24
- fileExtensions?: Partial<FileExtensions>;
25
- }
26
- export interface IProjectConfig {
27
- configFile: string;
28
- baseUrl: string;
29
- outDir: string;
30
- configDir: string;
31
- outPath: string;
32
- confDirParentFolderName: string;
33
- hasExtraModule: boolean;
34
- configDirInOutPath: string;
35
- relConfDirPathInOutPath: string;
36
- pathCache: PathCache;
37
- inputGlob: string;
38
- }
39
- export interface IConfig extends IProjectConfig {
40
- output: IOutput;
41
- aliasTrie: TrieNode<Alias>;
42
- replacers: AliasReplacer[];
43
- }
44
- export interface ReplaceTscAliasPathsOptions {
45
- configFile?: string;
46
- outDir?: string;
47
- declarationDir?: string;
48
- watch?: boolean;
49
- verbose?: boolean;
50
- debug?: boolean;
51
- resolveFullPaths?: boolean;
52
- resolveFullExtension?: '.js' | '.mjs' | '.cjs';
53
- replacers?: string[];
54
- output?: IOutput;
55
- aliasTrie?: TrieNode<Alias>;
56
- fileExtensions?: Partial<FileExtensions>;
57
- }
58
- export interface Alias {
59
- shouldPrefixMatchWildly: boolean;
60
- prefix: string;
61
- paths: AliasPath[];
62
- }
63
- export interface AliasPath {
64
- basePath: string;
65
- path: string;
66
- isExtra: boolean;
67
- }
68
- export interface AliasReplacerArguments {
69
- orig: string;
70
- file: string;
71
- config: IConfig;
72
- }
73
- export type AliasReplacer = (args: AliasReplacerArguments) => string;
74
- export interface ReplacerOptions {
75
- [key: string]: {
76
- enabled: boolean;
77
- file?: string;
78
- };
79
- }
80
- export interface IOutput {
81
- verbose: boolean;
82
- debug: (message: string, obj?: unknown) => void;
83
- info(message: string): void;
84
- error(message: string, exitProcess?: boolean): void;
85
- clear(): void;
86
- assert(claim: unknown, message: string): void;
87
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=interfaces.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import { PathCache, TrieNode } from './utils';\n\nexport interface ITSCAliasConfig {\n replacers?: ReplacerOptions;\n resolveFullPaths?: boolean;\n verbose?: boolean;\n fileExtensions?: Partial<FileExtensions>;\n}\n\nexport type PathLike = {\n [key: string]: string[];\n};\n\nexport type StringReplacer = (importStatement: string) => string;\n\nexport interface FileExtensions {\n inputGlob: string;\n outputCheck: string[];\n}\n\nexport interface ITSConfig {\n baseUrl?: string;\n outDir?: string;\n declarationDir?: string;\n paths?: PathLike;\n replacers?: ReplacerOptions;\n resolveFullPaths?: boolean;\n verbose?: boolean;\n fileExtensions?: Partial<FileExtensions>;\n}\n\nexport interface IProjectConfig {\n configFile: string;\n baseUrl: string;\n outDir: string;\n configDir: string;\n outPath: string;\n confDirParentFolderName: string;\n hasExtraModule: boolean;\n configDirInOutPath: string;\n relConfDirPathInOutPath: string;\n pathCache: PathCache;\n inputGlob: string;\n}\n\nexport interface IConfig extends IProjectConfig {\n output: IOutput;\n aliasTrie: TrieNode<Alias>;\n replacers: AliasReplacer[];\n}\n\nexport interface ReplaceTscAliasPathsOptions {\n configFile?: string;\n outDir?: string;\n declarationDir?: string;\n watch?: boolean;\n verbose?: boolean;\n debug?: boolean;\n resolveFullPaths?: boolean;\n resolveFullExtension?: '.js' | '.mjs' | '.cjs';\n replacers?: string[];\n output?: IOutput;\n aliasTrie?: TrieNode<Alias>;\n fileExtensions?: Partial<FileExtensions>;\n}\n\nexport interface Alias {\n shouldPrefixMatchWildly: boolean;\n prefix: string;\n paths: AliasPath[];\n}\n\nexport interface AliasPath {\n basePath: string;\n path: string;\n isExtra: boolean;\n}\n\nexport interface AliasReplacerArguments {\n orig: string;\n file: string;\n config: IConfig;\n}\n\nexport type AliasReplacer = (args: AliasReplacerArguments) => string;\n\nexport interface ReplacerOptions {\n [key: string]: {\n enabled: boolean;\n file?: string;\n };\n}\n\nexport interface IOutput {\n /**\n * verbose value sets if the output should act verbose.\n */\n verbose: boolean;\n /**\n * debug logs a message on the debug level.\n * @param {string} message message to log.\n */\n debug: (message: string, obj?: unknown) => void;\n /**\n * info logs a message on the info level.\n * @param {string} message message to log.\n */\n info(message: string): void;\n /**\n * error logs a message on the error level and may exit the process.\n * @param {string} message message to log.\n * @param {boolean} exitProcess if process should exit after this error.\n */\n error(message: string, exitProcess?: boolean): void;\n /**\n * clear clears the displayed logs.\n */\n clear(): void;\n /**\n * assert claim an assertion when it fails an error is logged\n * and the process exited.\n * @param {unknown} claim assertion that is being claimed.\n * @param {string} message message to log when claim fails.\n */\n assert(claim: unknown, message: string): void;\n}\n"]}
@@ -1,2 +0,0 @@
1
- import { AliasReplacerArguments } from '../interfaces';
2
- export default function replaceBaseUrlImport({ orig, file, config }: AliasReplacerArguments): string;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const normalizePath = require("normalize-path");
4
- const path_1 = require("path");
5
- const utils_1 = require("../utils");
6
- function replaceBaseUrlImport({ orig, file, config }) {
7
- var _a, _b;
8
- const requiredModule = (_b = (_a = orig.match((0, utils_1.newStringRegex)())) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.path;
9
- config.output.debug('base-url replacer - requiredModule: ', requiredModule);
10
- config.output.assert(typeof requiredModule == 'string', `Unexpected import statement pattern ${orig}`);
11
- if (requiredModule.startsWith('.')) {
12
- config.output.debug('base-url replacer - already resolved');
13
- return orig;
14
- }
15
- if (config.pathCache.existsResolvedAlias(`${config.outPath}/${requiredModule}`)) {
16
- let relativePath = normalizePath((0, path_1.relative)((0, path_1.dirname)(file), config.pathCache
17
- .getAbsoluteAliasPath(config.outPath, '')
18
- .replace('---', '')));
19
- if (!relativePath.startsWith('.')) {
20
- relativePath = './' + relativePath;
21
- }
22
- config.output.debug('base-url replacer - relativePath: ', relativePath);
23
- const index = orig.indexOf(requiredModule);
24
- const newImportScript = orig.substring(0, index) + relativePath + '/' + orig.substring(index);
25
- config.output.debug('base-url replacer - newImportScript: ', newImportScript);
26
- const modulePath = newImportScript.match((0, utils_1.newStringRegex)()).groups.path;
27
- config.output.debug('base-url replacer - modulePath: ', modulePath);
28
- return newImportScript.replace(modulePath, normalizePath(modulePath));
29
- }
30
- return orig;
31
- }
32
- exports.default = replaceBaseUrlImport;
33
- //# sourceMappingURL=base-url.replacer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-url.replacer.js","sourceRoot":"","sources":["../../src/replacers/base-url.replacer.ts"],"names":[],"mappings":";;AAQA,gDAAiD;AACjD,+BAAyC;AAEzC,oCAA0C;AAE1C,SAAwB,oBAAoB,CAAC,EAC3C,IAAI,EACJ,IAAI,EACJ,MAAM,EACiB;;IACvB,MAAM,cAAc,GAAG,MAAA,MAAA,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAc,GAAE,CAAC,0CAAE,MAAM,0CAAE,IAAI,CAAC;IAClE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,sCAAsC,EAAE,cAAc,CAAC,CAAC;IAC5E,MAAM,CAAC,MAAM,CAAC,MAAM,CAClB,OAAO,cAAc,IAAI,QAAQ,EACjC,uCAAuC,IAAI,EAAE,CAC9C,CAAC;IAGF,IAAI,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAClC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC;KACb;IAGD,IACE,MAAM,CAAC,SAAS,CAAC,mBAAmB,CAAC,GAAG,MAAM,CAAC,OAAO,IAAI,cAAc,EAAE,CAAC,EAC3E;QACA,IAAI,YAAY,GAAW,aAAa,CACtC,IAAA,eAAQ,EACN,IAAA,cAAO,EAAC,IAAI,CAAC,EACb,MAAM,CAAC,SAAS;aACb,oBAAoB,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;aACxC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CACtB,CACF,CAAC;QACF,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACjC,YAAY,GAAG,IAAI,GAAG,YAAY,CAAC;SACpC;QACD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,oCAAoC,EAAE,YAAY,CAAC,CAAC;QAExE,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAC3C,MAAM,eAAe,GACnB,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,GAAG,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACxE,MAAM,CAAC,MAAM,CAAC,KAAK,CACjB,uCAAuC,EACvC,eAAe,CAChB,CAAC;QAEF,MAAM,UAAU,GAAG,eAAe,CAAC,KAAK,CAAC,IAAA,sBAAc,GAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;QACvE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,kCAAkC,EAAE,UAAU,CAAC,CAAC;QACpE,OAAO,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;KACvE;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAhDD,uCAgDC","sourcesContent":["/**\n * @file\n *\n * The baseUrl replacer replaces the import statement\n * with the baseUrl + import statement location.\n */\n\n/** */\nimport normalizePath = require('normalize-path');\nimport { dirname, relative } from 'path';\nimport { AliasReplacerArguments } from '../interfaces';\nimport { newStringRegex } from '../utils';\n\nexport default function replaceBaseUrlImport({\n orig,\n file,\n config\n}: AliasReplacerArguments): string {\n const requiredModule = orig.match(newStringRegex())?.groups?.path;\n config.output.debug('base-url replacer - requiredModule: ', requiredModule);\n config.output.assert(\n typeof requiredModule == 'string',\n `Unexpected import statement pattern ${orig}`\n );\n\n // Check if import is already resolved.\n if (requiredModule.startsWith('.')) {\n config.output.debug('base-url replacer - already resolved');\n return orig;\n }\n\n // If there are files matching the target, resolve the path.\n if (\n config.pathCache.existsResolvedAlias(`${config.outPath}/${requiredModule}`)\n ) {\n let relativePath: string = normalizePath(\n relative(\n dirname(file),\n config.pathCache\n .getAbsoluteAliasPath(config.outPath, '')\n .replace('---', '')\n )\n );\n if (!relativePath.startsWith('.')) {\n relativePath = './' + relativePath;\n }\n config.output.debug('base-url replacer - relativePath: ', relativePath);\n\n const index = orig.indexOf(requiredModule);\n const newImportScript =\n orig.substring(0, index) + relativePath + '/' + orig.substring(index);\n config.output.debug(\n 'base-url replacer - newImportScript: ',\n newImportScript\n );\n\n const modulePath = newImportScript.match(newStringRegex()).groups.path;\n config.output.debug('base-url replacer - modulePath: ', modulePath);\n return newImportScript.replace(modulePath, normalizePath(modulePath));\n }\n return orig;\n}\n"]}
@@ -1,2 +0,0 @@
1
- import { AliasReplacerArguments } from '../interfaces';
2
- export default function replaceImportStatement({ orig, file, config }: AliasReplacerArguments): string;
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const normalizePath = require("normalize-path");
4
- const path_1 = require("path");
5
- const utils_1 = require("../utils");
6
- function escapeSpecialChars(str) {
7
- return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
8
- }
9
- function getAliasPrefixRegExp(alias) {
10
- return new RegExp(`(?:^${escapeSpecialChars(alias.prefix)})|(?:\\.(js|ts|json)$)`, 'g');
11
- }
12
- function removeAliasPrefix(requiredModule, alias) {
13
- return requiredModule.replace(getAliasPrefixRegExp(alias), '');
14
- }
15
- function replaceImportStatement({ orig, file, config }) {
16
- var _a, _b;
17
- const requiredModule = (_b = (_a = orig.match((0, utils_1.newStringRegex)())) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.path;
18
- config.output.debug('default replacer - requiredModule: ', requiredModule);
19
- config.output.assert(typeof requiredModule == 'string', `Unexpected import statement pattern ${orig}`);
20
- const alias = config.aliasTrie.search(requiredModule);
21
- config.output.debug('default replacer - alias: ', alias);
22
- if (!alias)
23
- return orig;
24
- const isAlias = alias.shouldPrefixMatchWildly
25
- ?
26
- requiredModule.startsWith(alias.prefix) && requiredModule !== alias.prefix
27
- :
28
- requiredModule === alias.prefix ||
29
- requiredModule.startsWith(alias.prefix + '/');
30
- if (isAlias) {
31
- for (let i = 0; i < alias.paths.length; i++) {
32
- let absoluteAliasPath = config.pathCache.getAbsoluteAliasPath(alias.paths[i].basePath, alias.paths[i].path);
33
- config.output.debug('default replacer - absoluteAliasPath: ', absoluteAliasPath);
34
- if (absoluteAliasPath.startsWith('---')) {
35
- if (i === alias.paths.length - 1) {
36
- absoluteAliasPath = absoluteAliasPath.replace('---', '');
37
- }
38
- else {
39
- continue;
40
- }
41
- }
42
- if (!config.pathCache.existsResolvedAlias(alias.prefix.length == requiredModule.length
43
- ? normalizePath(absoluteAliasPath)
44
- : normalizePath(`${absoluteAliasPath}/${removeAliasPrefix(requiredModule, alias)}`))) {
45
- config.output.debug('default replacer - Invalid path');
46
- continue;
47
- }
48
- let relativeAliasPath = normalizePath((0, path_1.relative)((0, path_1.dirname)(file), absoluteAliasPath));
49
- if (!relativeAliasPath.startsWith('.')) {
50
- relativeAliasPath = './' + relativeAliasPath;
51
- }
52
- config.output.debug('default replacer - relativeAliasPath: ', relativeAliasPath);
53
- const index = orig.indexOf(alias.prefix);
54
- const newImportScript = orig.substring(0, index) +
55
- relativeAliasPath +
56
- '/' +
57
- orig.substring(index + alias.prefix.length);
58
- config.output.debug('default replacer - newImportScript: ', newImportScript);
59
- const modulePath = newImportScript.match((0, utils_1.newStringRegex)()).groups.path;
60
- config.output.debug('default replacer - modulePath: ', modulePath);
61
- return newImportScript.replace(modulePath, normalizePath(modulePath));
62
- }
63
- }
64
- return orig;
65
- }
66
- exports.default = replaceImportStatement;
67
- //# sourceMappingURL=default.replacer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"default.replacer.js","sourceRoot":"","sources":["../../src/replacers/default.replacer.ts"],"names":[],"mappings":";;AAQA,gDAAiD;AACjD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AG,IAAI,GAAG,iBAAiB,CAAC;aAC9C;YACD,MAAM,CAAC,MAAM,CAAC,KAAK,CACjB,wCAAwC,EACxC,iBAAiB,CAClB,CAAC;YAEF,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACzC,MAAM,eAAe,GACnB,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC;gBACxB,iBAAiB;gBACjB,GAAG;gBACH,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC9C,MAAM,CAAC,MAAM,CAAC,KAAK,CACjB,sCAAsC,EACtC,eAAe,CAChB,CAAC;YAEF,MAAM,UAAU,GAAG,eAAe,CAAC,KAAK,CAAC,IAAA,sBAAc,GAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;YACvE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,EAAE,UAAU,CAAC,CAAC;YAEnE,OAAO,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;SACvE;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AA9FD,yCA8FC","sourcesContent":["/**\n * @file\n *\n * The default replacer replaces the alias in an import statement\n * with the proper aliased location.\n */\n\n/** */\nimport normalizePath = require('normalize-path');\nimport { dirname, relative } from 'path';\nimport { Alias, AliasReplacerArguments } from '../interfaces';\nimport { newStringRegex } from '../utils';\n\nfunction escapeSpecialChars(str: string) {\n return str.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n}\n\nfunction getAliasPrefixRegExp(alias: Alias) {\n return new RegExp(\n `(?:^${escapeSpecialChars(alias.prefix)})|(?:\\\\.(js|ts|json)$)`,\n 'g'\n );\n}\n\nfunction removeAliasPrefix(requiredModule: string, alias: Alias) {\n return requiredModule.replace(getAliasPrefixRegExp(alias), '');\n}\n\nexport default function replaceImportStatement({\n orig,\n file,\n config\n}: AliasReplacerArguments) {\n const requiredModule = orig.match(newStringRegex())?.groups?.path;\n config.output.debug('default replacer - requiredModule: ', requiredModule);\n config.output.assert(\n typeof requiredModule == 'string',\n `Unexpected import statement pattern ${orig}`\n );\n // Lookup which alias should be used for this given requiredModule.\n const alias = config.aliasTrie.search(requiredModule);\n config.output.debug('default replacer - alias: ', alias);\n // If an alias isn't found the original.\n if (!alias) return orig;\n\n const isAlias = alias.shouldPrefixMatchWildly\n ? // if the alias is like alias*\n // beware that typescript expects requiredModule be more than just alias\n requiredModule.startsWith(alias.prefix) && requiredModule !== alias.prefix\n : // need to be a bit more careful if the alias doesn't ended with a *\n // in this case the statement must be like either\n // require('alias') or require('alias/path');\n // but not require('aliaspath');\n requiredModule === alias.prefix ||\n requiredModule.startsWith(alias.prefix + '/');\n\n if (isAlias) {\n for (let i = 0; i < alias.paths.length; i++) {\n let absoluteAliasPath = config.pathCache.getAbsoluteAliasPath(\n alias.paths[i].basePath,\n alias.paths[i].path\n );\n config.output.debug(\n 'default replacer - absoluteAliasPath: ',\n absoluteAliasPath\n );\n\n if (absoluteAliasPath.startsWith('---')) {\n if (i === alias.paths.length - 1) {\n absoluteAliasPath = absoluteAliasPath.replace('---', '');\n } else {\n continue;\n }\n }\n\n // Check if path is valid.\n if (\n !config.pathCache.existsResolvedAlias(\n alias.prefix.length == requiredModule.length\n ? normalizePath(absoluteAliasPath)\n : normalizePath(\n `${absoluteAliasPath}/${removeAliasPrefix(\n requiredModule,\n alias\n )}`\n )\n )\n ) {\n config.output.debug('default replacer - Invalid path');\n continue;\n }\n\n let relativeAliasPath: string = normalizePath(\n relative(dirname(file), absoluteAliasPath)\n );\n\n if (!relativeAliasPath.startsWith('.')) {\n relativeAliasPath = './' + relativeAliasPath;\n }\n config.output.debug(\n 'default replacer - relativeAliasPath: ',\n relativeAliasPath\n );\n\n const index = orig.indexOf(alias.prefix);\n const newImportScript =\n orig.substring(0, index) +\n relativeAliasPath +\n '/' +\n orig.substring(index + alias.prefix.length);\n config.output.debug(\n 'default replacer - newImportScript: ',\n newImportScript\n );\n\n const modulePath = newImportScript.match(newStringRegex()).groups.path;\n config.output.debug('default replacer - modulePath: ', modulePath);\n\n return newImportScript.replace(modulePath, normalizePath(modulePath));\n }\n }\n return orig;\n}\n"]}
@@ -1,19 +0,0 @@
1
- import { StringReplacer } from '../interfaces';
2
- declare class ImportPathResolver {
3
- source: string;
4
- readonly sourcePath: string;
5
- constructor(source: string, sourcePath: string);
6
- get sourceDir(): string;
7
- replaceSourceImportPaths(replacer: StringReplacer): this;
8
- resolveFullImportPaths(ext?: string): this;
9
- private resolveFullPath;
10
- static newStringRegex(): RegExp;
11
- static newImportStatementRegex(flags?: string): RegExp;
12
- static resolveFullImportPaths(code: string, path: string, ext?: string): string;
13
- static replaceSourceImportPaths(code: string, path: string, replacer: StringReplacer): string;
14
- }
15
- export declare const resolveFullImportPaths: typeof ImportPathResolver.resolveFullImportPaths;
16
- export declare const newImportStatementRegex: typeof ImportPathResolver.newImportStatementRegex;
17
- export declare const replaceSourceImportPaths: typeof ImportPathResolver.replaceSourceImportPaths;
18
- export declare const newStringRegex: typeof ImportPathResolver.newStringRegex;
19
- export {};
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newStringRegex = exports.replaceSourceImportPaths = exports.newImportStatementRegex = exports.resolveFullImportPaths = void 0;
4
- const normalizePath = require("normalize-path");
5
- const fs_1 = require("fs");
6
- const path_1 = require("path");
7
- const anyQuote = `["']`;
8
- const pathStringContent = `[^"'\r\n]+`;
9
- const importString = `(?:${anyQuote}${pathStringContent}${anyQuote})`;
10
- const funcStyle = `(?:\\b(?:import|require)\\s*\\(\\s*(\\/\\*.*\\*\\/\\s*)?${importString}\\s*\\))`;
11
- const globalStyle = `(?:\\bimport\\s+${importString})`;
12
- const globalMinimizedStyle = `(?:\\bimport${importString})`;
13
- const fromStyle = `(?:\\bfrom\\s+${importString})`;
14
- const fromMinimizedStyle = `(?:\\bfrom${importString})`;
15
- const moduleStyle = `(?:\\bmodule\\s+${importString})`;
16
- const importRegexString = `(?:${[
17
- funcStyle,
18
- globalStyle,
19
- globalMinimizedStyle,
20
- fromStyle,
21
- fromMinimizedStyle,
22
- moduleStyle
23
- ].join(`|`)})`;
24
- class ImportPathResolver {
25
- constructor(source, sourcePath) {
26
- this.source = source;
27
- this.sourcePath = sourcePath;
28
- }
29
- get sourceDir() {
30
- return (0, path_1.dirname)(this.sourcePath);
31
- }
32
- replaceSourceImportPaths(replacer) {
33
- this.source = this.source.replace(ImportPathResolver.newImportStatementRegex('g'), replacer);
34
- return this;
35
- }
36
- resolveFullImportPaths(ext = '.js') {
37
- this.replaceSourceImportPaths((importStatement) => {
38
- const importPathMatch = importStatement.match((0, exports.newStringRegex)());
39
- if (!importPathMatch) {
40
- return importStatement;
41
- }
42
- const { path, pathWithQuotes } = importPathMatch.groups;
43
- const fullPath = normalizePath(this.resolveFullPath(path, ext));
44
- return importStatement.replace(pathWithQuotes, pathWithQuotes.replace(path, fullPath));
45
- });
46
- return this;
47
- }
48
- resolveFullPath(importPath, ext = '.js') {
49
- if (!importPath.startsWith('.') ||
50
- importPath.match(new RegExp(`\${ext}$`))) {
51
- return importPath;
52
- }
53
- if (!importPath.match(/[/\\]$/)) {
54
- const asFilePath = `${importPath}${ext}`;
55
- if ((0, fs_1.existsSync)((0, path_1.resolve)(this.sourceDir, asFilePath))) {
56
- return asFilePath;
57
- }
58
- }
59
- let asFilePath = (0, path_1.join)(importPath, 'index' + ext);
60
- if ((importPath.startsWith('./') || importPath === '.') &&
61
- !asFilePath.startsWith('./')) {
62
- asFilePath = './' + asFilePath;
63
- }
64
- return (0, fs_1.existsSync)((0, path_1.resolve)(this.sourceDir, asFilePath))
65
- ? asFilePath
66
- : importPath;
67
- }
68
- static newStringRegex() {
69
- return new RegExp(`(?<pathWithQuotes>${anyQuote}(?<path>${pathStringContent})${anyQuote})`);
70
- }
71
- static newImportStatementRegex(flags = '') {
72
- return new RegExp(importRegexString, flags);
73
- }
74
- static resolveFullImportPaths(code, path, ext = '.js') {
75
- return new ImportPathResolver(code, path).resolveFullImportPaths(ext)
76
- .source;
77
- }
78
- static replaceSourceImportPaths(code, path, replacer) {
79
- return new ImportPathResolver(code, path).replaceSourceImportPaths(replacer)
80
- .source;
81
- }
82
- }
83
- exports.resolveFullImportPaths = ImportPathResolver.resolveFullImportPaths;
84
- exports.newImportStatementRegex = ImportPathResolver.newImportStatementRegex;
85
- exports.replaceSourceImportPaths = ImportPathResolver.replaceSourceImportPaths;
86
- exports.newStringRegex = ImportPathResolver.newStringRegex;
87
- //# sourceMappingURL=import-path-resolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"import-path-resolver.js","sourceRoot":"","sources":["../../src/utils/import-path-resolver.ts"],"names":[],"mappings":";;;AA2BA,gDAAiD;AACjD,2BAAgC;AAChC,+BAA8C;AAG9C,MAAM,QAAQ,GAAG,MAAM,CAAC;AACxB,MAAM,iBAAiB,GAAG,YAAY,CAAC;AACvC,MAAM,YAAY,GAAG,MAAM,QAAQ,GAAG,iBAAiB,GAAG,QAAQ,GAAG,CAAC;AAKtE,MAAM,SAAS,GAAG,2DAA2D,YAAY,UAAU,CAAC;AACpG,MAAM,WAAW,GAAG,mBAAmB,YAAY,GAAG,CAAC;AACvD,MAAM,oBAAoB,GAAG,eAAe,YAAY,GAAG,CAAC;AAC5D,MAAM,SAAS,GAAG,iBAAiB,YAAY,GAAG,CAAC;AACnD,MAAM,kBAAkB,GAAG,aAAa,YAAY,GAAG,CAAC;AACxD,MAAM,WAAW,GAAG,mBAAmB,YAAY,GAAG,CAAC;AAEvD,MAAM,iBAAiB,GAAG,MAAM;IAC9B,SAAS;IACT,WAAW;IACX,oBAAoB;IACpB,SAAS;IACT,kBAAkB;IAClB,WAAW;CACZ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AAEf,MAAM,kBAAkB;IACtB,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AAC;CACF;AAIY,QAAA,sBAAsB,GAAG,kBAAkB,CAAC,sBAAsB,CAAC;AACnE,QAAA,uBAAuB,GAClC,kBAAkB,CAAC,uBAAuB,CAAC;AAChC,QAAA,wBAAwB,GACnC,kBAAkB,CAAC,wBAAwB,CAAC;AACjC,QAAA,cAAc,GAAG,kBAAkB,CAAC,cAAc,CAAC","sourcesContent":["/**\n * @file\n *\n * Import statements come in a lot of flavors, so having a single\n * regex that can capture all of those with minimal side effects\n * is trickly. In this file this regex is constructed from multiple parts.\n *\n * Using a named captured group (supported in ES2018/Node 10+)\n * to allow arbitrary complexity of the regex without worrying\n * about messing up indexing.\n *\n * Meant to match ESM/CommonJS import patterns.\n *\n * ⚠ Can match content of strings and comments!\n *\n * @example\n * // Examples of import statements that must be matched\n * // (Note that there could be newlines between tokens.)\n * const module = require('some/path')\n * import module from 'some/path'\n * import \"some/path\"\n * import theDefault, {namedExport} from 'some/path'\n * const asyncImport = await import('some/path')\n * export * from 'some/path';\n */\n\n/** */\nimport normalizePath = require('normalize-path');\nimport { existsSync } from 'fs';\nimport { dirname, join, resolve } from 'path';\nimport { StringReplacer } from '../interfaces';\n\nconst anyQuote = `[\"']`;\nconst pathStringContent = `[^\"'\\r\\n]+`;\nconst importString = `(?:${anyQuote}${pathStringContent}${anyQuote})`;\n\n// Separate patterns for each style of import statement,\n// wrapped in non-capturing groups,\n// so that they can be strung together in one big pattern.\nconst funcStyle = `(?:\\\\b(?:import|require)\\\\s*\\\\(\\\\s*(\\\\/\\\\*.*\\\\*\\\\/\\\\s*)?${importString}\\\\s*\\\\))`;\nconst globalStyle = `(?:\\\\bimport\\\\s+${importString})`;\nconst globalMinimizedStyle = `(?:\\\\bimport${importString})`;\nconst fromStyle = `(?:\\\\bfrom\\\\s+${importString})`;\nconst fromMinimizedStyle = `(?:\\\\bfrom${importString})`;\nconst moduleStyle = `(?:\\\\bmodule\\\\s+${importString})`;\n\nconst importRegexString = `(?:${[\n funcStyle,\n globalStyle,\n globalMinimizedStyle,\n fromStyle,\n fromMinimizedStyle,\n moduleStyle\n].join(`|`)})`;\n\nclass ImportPathResolver {\n constructor(public source: string, readonly sourcePath: string) {}\n\n get sourceDir() {\n return dirname(this.sourcePath);\n }\n\n /**\n * Replace all source import paths, using a replacer\n * function (a la `String.prototype.replace(globalRegex,replacer)`)\n */\n replaceSourceImportPaths(replacer: StringReplacer) {\n this.source = this.source.replace(\n ImportPathResolver.newImportStatementRegex('g'),\n replacer\n );\n return this;\n }\n\n /**\n * For a JavaScript code string, find all local import paths\n * and resolve them to full filenames (including the .js extension).\n * If no matching file is found for a path, leave it alone.\n */\n resolveFullImportPaths(ext = '.js') {\n this.replaceSourceImportPaths((importStatement) => {\n // Find substring that is just quotes\n const importPathMatch = importStatement.match(newStringRegex());\n if (!importPathMatch) {\n return importStatement;\n }\n const { path, pathWithQuotes } = importPathMatch.groups;\n const fullPath = normalizePath(this.resolveFullPath(path, ext));\n return importStatement.replace(\n pathWithQuotes,\n pathWithQuotes.replace(path, fullPath)\n );\n });\n return this;\n }\n\n /**\n * Given an import path, resolve the full path (including extension).\n * If no corresponding file can be found, return the original path.\n */\n private resolveFullPath(importPath: string, ext = '.js') {\n // If bare import or already a full path import\n if (\n !importPath.startsWith('.') ||\n importPath.match(new RegExp(`\\${ext}$`))\n ) {\n return importPath;\n }\n // Try adding the extension (if not obviously a directory)\n if (!importPath.match(/[/\\\\]$/)) {\n const asFilePath = `${importPath}${ext}`;\n if (existsSync(resolve(this.sourceDir, asFilePath))) {\n return asFilePath;\n }\n }\n // Assume the path is a folder; try adding index.js\n let asFilePath = join(importPath, 'index' + ext);\n if (\n (importPath.startsWith('./') || importPath === '.') &&\n !asFilePath.startsWith('./')\n ) {\n asFilePath = './' + asFilePath;\n }\n return existsSync(resolve(this.sourceDir, asFilePath))\n ? asFilePath\n : importPath;\n }\n\n static newStringRegex() {\n return new RegExp(\n `(?<pathWithQuotes>${anyQuote}(?<path>${pathStringContent})${anyQuote})`\n );\n }\n\n static newImportStatementRegex(flags = '') {\n return new RegExp(importRegexString, flags);\n }\n\n static resolveFullImportPaths(code: string, path: string, ext = '.js') {\n return new ImportPathResolver(code, path).resolveFullImportPaths(ext)\n .source;\n }\n\n static replaceSourceImportPaths(\n code: string,\n path: string,\n replacer: StringReplacer\n ) {\n return new ImportPathResolver(code, path).replaceSourceImportPaths(replacer)\n .source;\n }\n}\n\n// Export aliases for the static functions\n// to make usage more friendly.\nexport const resolveFullImportPaths = ImportPathResolver.resolveFullImportPaths;\nexport const newImportStatementRegex =\n ImportPathResolver.newImportStatementRegex;\nexport const replaceSourceImportPaths =\n ImportPathResolver.replaceSourceImportPaths;\nexport const newStringRegex = ImportPathResolver.newStringRegex;\n"]}
@@ -1,4 +0,0 @@
1
- export * from './import-path-resolver';
2
- export * from './output';
3
- export * from './path-cache';
4
- export * from './trie';
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./import-path-resolver"), exports);
18
- __exportStar(require("./output"), exports);
19
- __exportStar(require("./path-cache"), exports);
20
- __exportStar(require("./trie"), exports);
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,2CAAyB;AACzB,+CAA6B;AAC7B,yCAAuB","sourcesContent":["export * from './import-path-resolver';\nexport * from './output';\nexport * from './path-cache';\nexport * from './trie';\n"]}
@@ -1,11 +0,0 @@
1
- import { IOutput } from '../interfaces';
2
- export declare class Output implements IOutput {
3
- private verb;
4
- debug: (message: string, obj?: unknown) => void;
5
- constructor(verb?: boolean, debugMode?: boolean);
6
- set verbose(value: boolean);
7
- info(message: string): void;
8
- error(message: string, exitProcess?: boolean): void;
9
- clear(): void;
10
- assert(claim: unknown, message: string): void;
11
- }
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Output = void 0;
4
- const util_1 = require("util");
5
- class Output {
6
- constructor(verb = false, debugMode = false) {
7
- this.verb = verb;
8
- this.debug = (message, obj) => { };
9
- if (debugMode) {
10
- this.debug = (message, obj) => {
11
- console.debug(`tsc-alias debug: ${message} ${obj
12
- ? (0, util_1.inspect)(obj, {
13
- showHidden: true,
14
- depth: Infinity,
15
- colors: true
16
- })
17
- : ''}`);
18
- };
19
- }
20
- }
21
- set verbose(value) {
22
- if (value) {
23
- this.verb = value;
24
- }
25
- }
26
- info(message) {
27
- if (!this.verb)
28
- return;
29
- console.log(`tsc-alias info: ${message}`);
30
- }
31
- error(message, exitProcess = false) {
32
- console.error(`\x1b[41mtsc-alias error:\x1b[0m \x1b[31m${message}\x1b[0m`);
33
- if (exitProcess)
34
- process.exit(1);
35
- }
36
- clear() {
37
- console.clear();
38
- }
39
- assert(claim, message) {
40
- claim || this.error(message, true);
41
- }
42
- }
43
- exports.Output = Output;
44
- //# sourceMappingURL=output.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":";;;AAUA,+BAA+B;AAE/B,MAAa,MAAM;IAIjB,YAAoB,OAAO,KAAK,EAAE,SAAS,GAAG,KAAK;QAA/B,SAAI,GAAJ,IAAI,CAAQ;QAFhC,UAAK,GAAG,CAAC,OAAe,EAAE,GAAa,EAAE,EAAE,GAAE,CAAC,CAAC;QAG7C,IAAI,SAAS,EAAE;YAEb,IAAI,CAAC,KAAK,GAAG,CAAC,OAAe,EAAE,GAAa,EAAE,EAAE;gBAC9C,OAAO,CAAC,KAAK,CACX,oBAAoB,OAAO,IACzB,GAAG;oBACD,CAAC,CAAC,IAAA,cAAO,EAAC,GAAG,EAAE;wBACX,UAAU,EAAE,IAAI;wBAChB,KAAK,EAAE,QAAQ;wBACf,MAAM,EAAE,IAAI;qBACb,CAAC;oBACJ,CAAC,CAAC,EACN,EAAE,CACH,CAAC;YACJ,CAAC,CAAC;SACH;IACH,CAAC;IAED,IAAW,OAAO,CAAC,KAAc;QAC/B,IAAI,KAAK,EAAE;YACT,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;SACnB;IACH,CAAC;IAED,IAAI,CAAC,OAAe;QAClB,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAO;QACvB,OAAO,CAAC,GAAG,CAAC,mBAAmB,OAAO,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,WAAW,GAAG,KAAK;QACxC,OAAO,CAAC,KAAK,CAEX,2CAA2C,OAAO,SAAS,CAC5D,CAAC;QAEF,IAAI,WAAW;YAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IAED,KAAK;QACH,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,KAAc,EAAE,OAAe;QACpC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;CACF;AAlDD,wBAkDC","sourcesContent":["/**\n * @file\n *\n * Keeping formatting consistent in large projects is difficult.\n * That's why this output class exists, it is used to standardize\n * logging and assertions.\n */\n\n/** */\nimport { IOutput } from '../interfaces';\nimport { inspect } from 'util';\n\nexport class Output implements IOutput {\n // Default empty\n debug = (message: string, obj?: unknown) => {};\n\n constructor(private verb = false, debugMode = false) {\n if (debugMode) {\n // When in debug mode. Add debug function.\n this.debug = (message: string, obj?: unknown) => {\n console.debug(\n `tsc-alias debug: ${message} ${\n obj\n ? inspect(obj, {\n showHidden: true,\n depth: Infinity,\n colors: true\n })\n : ''\n }`\n );\n };\n }\n }\n\n public set verbose(value: boolean) {\n if (value) {\n this.verb = value;\n }\n }\n\n info(message: string) {\n if (!this.verb) return;\n console.log(`tsc-alias info: ${message}`);\n }\n\n error(message: string, exitProcess = false) {\n console.error(\n //[BgRed]tsc-alias error:[Reset] [FgRed_]${message}[Reset]\n `\\x1b[41mtsc-alias error:\\x1b[0m \\x1b[31m${message}\\x1b[0m`\n );\n\n if (exitProcess) process.exit(1);\n }\n\n clear() {\n console.clear();\n }\n\n assert(claim: unknown, message: string) {\n claim || this.error(message, true);\n }\n}\n"]}
@@ -1,12 +0,0 @@
1
- export declare class PathCache {
2
- useCache: boolean;
3
- existsCache: Map<string, boolean>;
4
- absoluteCache: Map<string, string>;
5
- fileExtensions: string[];
6
- constructor(useCache: boolean, fileExtensions?: string[]);
7
- existsResolvedAlias(path: string): boolean;
8
- getAbsoluteAliasPath(basePath: string, aliasPath: string): string;
9
- private getCacheKey;
10
- private getAAP;
11
- private exists;
12
- }
@@ -1,74 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PathCache = void 0;
4
- const fs_1 = require("fs");
5
- const path_1 = require("path");
6
- class PathCache {
7
- constructor(useCache, fileExtensions) {
8
- this.fileExtensions = fileExtensions || [
9
- 'js',
10
- 'json',
11
- 'jsx',
12
- 'cjs',
13
- 'mjs',
14
- 'd.ts',
15
- 'd.tsx',
16
- 'd.cts',
17
- 'd.mts'
18
- ];
19
- this.useCache = useCache;
20
- if (useCache) {
21
- this.existsCache = new Map();
22
- this.absoluteCache = new Map();
23
- }
24
- }
25
- existsResolvedAlias(path) {
26
- if (!this.useCache)
27
- return this.exists(path);
28
- if (this.existsCache.has(path)) {
29
- return this.existsCache.get(path);
30
- }
31
- else {
32
- const result = this.exists(path);
33
- this.existsCache.set(path, result);
34
- return result;
35
- }
36
- }
37
- getAbsoluteAliasPath(basePath, aliasPath) {
38
- const request = { basePath, aliasPath };
39
- if (!this.useCache)
40
- return this.getAAP(request);
41
- if (this.absoluteCache.has(this.getCacheKey(request))) {
42
- return this.absoluteCache.get(this.getCacheKey(request));
43
- }
44
- else {
45
- const result = this.getAAP(request);
46
- this.absoluteCache.set(this.getCacheKey(request), result);
47
- return result;
48
- }
49
- }
50
- getCacheKey({ basePath, aliasPath }) {
51
- return `${basePath}___${aliasPath}`;
52
- }
53
- getAAP({ basePath, aliasPath }) {
54
- const aliasPathParts = aliasPath
55
- .split('/')
56
- .filter((part) => !part.match(/^\.$|^\s*$/));
57
- let aliasPathPart = aliasPathParts.shift() || '';
58
- let pathExists = false;
59
- while (!(pathExists = this.exists((0, path_1.join)(basePath, aliasPathPart))) &&
60
- aliasPathParts.length) {
61
- aliasPathPart = aliasPathParts.shift();
62
- }
63
- if (pathExists) {
64
- return (0, path_1.join)(basePath, aliasPathPart, aliasPathParts.join('/'));
65
- }
66
- return '---' + (0, path_1.join)(basePath, aliasPathParts.join('/'));
67
- }
68
- exists(path) {
69
- return ((0, fs_1.existsSync)(path) ||
70
- this.fileExtensions.some((extension) => (0, fs_1.existsSync)(`${path}.${extension}`)));
71
- }
72
- }
73
- exports.PathCache = PathCache;
74
- //# sourceMappingURL=path-cache.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"path-cache.js","sourceRoot":"","sources":["../../src/utils/path-cache.ts"],"names":[],"mappings":";;;AAQA,2BAAgC;AAChC,+BAA4B;AAE5B,MAAa,SAAS;IAMpB,YAAY,QAAiB,EAAE,cAAyB;QACtD,IAAI,CAAC,cAAc,GAAG,cAAc,IAAI;YACtC,IAAI;YACJ,MAAM;YACN,KAAK;YACL,KAAK;YACL,KAAK;YACL,MAAM;Y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asPath.\n */\n\n/** */\nimport { existsSync } from 'fs';\nimport { join } from 'path';\n\nexport class PathCache {\n useCache: boolean;\n existsCache: Map<string, boolean>;\n absoluteCache: Map<string, string>;\n fileExtensions: string[];\n\n constructor(useCache: boolean, fileExtensions?: string[]) {\n this.fileExtensions = fileExtensions || [\n 'js',\n 'json',\n 'jsx',\n 'cjs',\n 'mjs',\n 'd.ts',\n 'd.tsx',\n 'd.cts',\n 'd.mts'\n ];\n this.useCache = useCache;\n if (useCache) {\n this.existsCache = new Map();\n this.absoluteCache = new Map();\n }\n }\n\n /**\n * existsResolvedAlias checks if file exists, uses cache when possible.\n * @param {string} path the filepath to check.\n * @returns {boolean} result of check.\n */\n public existsResolvedAlias(path: string): boolean {\n if (!this.useCache) return this.exists(path);\n if (this.existsCache.has(path)) {\n return this.existsCache.get(path);\n } else {\n const result = this.exists(path);\n this.existsCache.set(path, result);\n return result;\n }\n }\n\n /**\n * getAbsoluteAliasPath finds the absolute alias path, uses cache when possible.\n * @param {string} basePath the basepath of the alias.\n * @param {string} aliasPath the aliaspath of the alias.\n * @returns {string} the absolute alias path.\n */\n public getAbsoluteAliasPath(basePath: string, aliasPath: string): string {\n const request = { basePath, aliasPath };\n if (!this.useCache) return this.getAAP(request);\n if (this.absoluteCache.has(this.getCacheKey(request))) {\n return this.absoluteCache.get(this.getCacheKey(request));\n } else {\n const result = this.getAAP(request);\n this.absoluteCache.set(this.getCacheKey(request), result);\n return result;\n }\n }\n\n private getCacheKey({\n basePath,\n aliasPath\n }: {\n basePath: string;\n aliasPath: string;\n }): string {\n return `${basePath}___${aliasPath}`;\n }\n\n /**\n * getAAP finds the absolute alias path.\n * @param {string} basePath the basepath of the alias.\n * @param {string} aliasPath the aliaspath of the alias.\n * @returns {string} the absolute alias path.\n */\n private getAAP({\n basePath,\n aliasPath\n }: {\n basePath: string;\n aliasPath: string;\n }): string {\n const aliasPathParts = aliasPath\n .split('/')\n .filter((part) => !part.match(/^\\.$|^\\s*$/));\n\n let aliasPathPart = aliasPathParts.shift() || '';\n\n let pathExists = false;\n\n while (\n !(pathExists = this.exists(join(basePath, aliasPathPart))) &&\n aliasPathParts.length\n ) {\n aliasPathPart = aliasPathParts.shift();\n }\n\n if (pathExists) {\n return join(basePath, aliasPathPart, aliasPathParts.join('/'));\n }\n\n return '---' + join(basePath, aliasPathParts.join('/'));\n }\n\n /**\n * exists checks if file exists.\n * @param path the filepath to check.\n * @returns {boolean} result of check.\n */\n private exists(path: string): boolean {\n return (\n existsSync(path) ||\n this.fileExtensions.some((extension) =>\n existsSync(`${path}.${extension}`)\n )\n );\n }\n}\n"]}
@@ -1,9 +0,0 @@
1
- import { Alias, IProjectConfig, PathLike } from '../interfaces';
2
- export declare class TrieNode<T> {
3
- private children;
4
- data: T | null;
5
- constructor();
6
- add(name: string, data: T): void;
7
- search(name: string): T | null;
8
- static buildAliasTrie(config: IProjectConfig, paths?: PathLike): TrieNode<Alias>;
9
- }