@flex-development/mlly 1.0.0-alpha.8 → 1.0.0-beta.1

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 (332) hide show
  1. package/CHANGELOG.md +1128 -355
  2. package/README.md +1540 -12
  3. package/dist/index.d.mts +3 -4
  4. package/dist/index.mjs +5 -5
  5. package/dist/interfaces/aliases.d.mts +21 -0
  6. package/dist/interfaces/condition-map.d.mts +24 -0
  7. package/dist/interfaces/file-system.d.mts +29 -0
  8. package/dist/interfaces/get-source-context.d.mts +44 -0
  9. package/dist/interfaces/get-source-options.d.mts +48 -0
  10. package/dist/interfaces/index.d.mts +18 -21
  11. package/dist/interfaces/is-directory.d.mts +17 -0
  12. package/dist/interfaces/is-file.d.mts +17 -0
  13. package/dist/interfaces/main-field-map.d.mts +22 -0
  14. package/dist/interfaces/module-format-map.d.mts +26 -0
  15. package/dist/interfaces/pattern-key-comparison-map.d.mts +31 -0
  16. package/dist/interfaces/protocol-map.d.mts +44 -0
  17. package/dist/interfaces/read-file.d.mts +24 -0
  18. package/dist/interfaces/realpath.d.mts +26 -0
  19. package/dist/interfaces/resolve-alias-options.d.mts +43 -0
  20. package/dist/interfaces/resolve-module-options.d.mts +79 -0
  21. package/dist/interfaces/stat.d.mts +24 -0
  22. package/dist/interfaces/stats.d.mts +23 -0
  23. package/dist/internal/chain-or-call.mjs +34 -0
  24. package/dist/internal/chars.mjs +17 -0
  25. package/dist/internal/check-invalid-segments.mjs +49 -0
  26. package/dist/internal/constant.mjs +23 -0
  27. package/dist/internal/fs.browser.mjs +42 -0
  28. package/dist/internal/fs.node.mjs +16 -0
  29. package/dist/internal/identity.mjs +23 -0
  30. package/dist/internal/invalid-package-target.mjs +36 -0
  31. package/dist/internal/invalid-subpath.mjs +37 -0
  32. package/dist/internal/is-promise.mjs +26 -0
  33. package/dist/internal/process.browser.mjs +8 -0
  34. package/dist/lib/can-parse-url.d.mts +23 -0
  35. package/dist/lib/can-parse-url.mjs +31 -0
  36. package/dist/lib/cwd.d.mts +14 -0
  37. package/dist/lib/cwd.mjs +17 -0
  38. package/dist/lib/default-conditions.d.mts +15 -0
  39. package/dist/lib/default-conditions.mjs +14 -0
  40. package/dist/lib/default-extensions.d.mts +14 -0
  41. package/dist/lib/default-extensions.mjs +29 -0
  42. package/dist/lib/default-main-fields.d.mts +14 -0
  43. package/dist/lib/default-main-fields.mjs +13 -0
  44. package/dist/lib/extension-format-map.d.mts +16 -0
  45. package/dist/lib/extension-format-map.mjs +31 -0
  46. package/dist/lib/formats.d.mts +21 -0
  47. package/dist/lib/formats.mjs +22 -0
  48. package/dist/lib/get-source.d.mts +46 -0
  49. package/dist/lib/get-source.mjs +156 -0
  50. package/dist/lib/index.d.mts +41 -0
  51. package/dist/lib/index.mjs +41 -0
  52. package/dist/lib/is-absolute-specifier.d.mts +23 -0
  53. package/dist/lib/is-absolute-specifier.mjs +34 -0
  54. package/dist/lib/is-array-index.d.mts +19 -0
  55. package/dist/lib/is-array-index.mjs +28 -0
  56. package/dist/lib/is-bare-specifier.d.mts +23 -0
  57. package/dist/lib/is-bare-specifier.mjs +33 -0
  58. package/dist/lib/is-directory.d.mts +27 -0
  59. package/dist/lib/is-directory.mjs +54 -0
  60. package/dist/lib/is-file.d.mts +27 -0
  61. package/dist/lib/is-file.mjs +54 -0
  62. package/dist/lib/is-imports-subpath.d.mts +26 -0
  63. package/dist/lib/is-imports-subpath.mjs +28 -0
  64. package/dist/lib/is-module-id.d.mts +23 -0
  65. package/dist/lib/is-module-id.mjs +24 -0
  66. package/dist/lib/is-relative-specifier.d.mts +23 -0
  67. package/dist/lib/is-relative-specifier.mjs +36 -0
  68. package/dist/lib/lookup-package-scope.d.mts +49 -0
  69. package/dist/lib/lookup-package-scope.mjs +102 -0
  70. package/dist/lib/pattern-key-compare.d.mts +28 -0
  71. package/dist/lib/pattern-key-compare.mjs +71 -0
  72. package/dist/lib/pattern-match.d.mts +22 -0
  73. package/dist/lib/pattern-match.mjs +85 -0
  74. package/dist/lib/read-package-json.d.mts +63 -0
  75. package/dist/lib/read-package-json.mjs +115 -0
  76. package/dist/lib/resolve-alias.d.mts +21 -0
  77. package/dist/lib/resolve-alias.mjs +102 -0
  78. package/dist/lib/resolve-module.d.mts +43 -0
  79. package/dist/lib/resolve-module.mjs +186 -0
  80. package/dist/lib/resolver.d.mts +346 -0
  81. package/dist/lib/resolver.mjs +1015 -0
  82. package/dist/lib/root.d.mts +11 -0
  83. package/dist/lib/root.mjs +12 -0
  84. package/dist/lib/to-relative-specifier.d.mts +27 -0
  85. package/dist/lib/to-relative-specifier.mjs +63 -0
  86. package/dist/lib/to-url.d.mts +26 -0
  87. package/dist/lib/to-url.mjs +34 -0
  88. package/dist/types/awaitable.d.mts +12 -0
  89. package/dist/types/change-ext-fn.d.mts +29 -0
  90. package/dist/types/condition.d.mts +13 -0
  91. package/dist/types/dot.d.mts +9 -0
  92. package/dist/types/empty-array.d.mts +9 -0
  93. package/dist/types/empty-object.d.mts +19 -0
  94. package/dist/types/empty-string.d.mts +9 -0
  95. package/dist/types/ext.d.mts +12 -0
  96. package/dist/types/get-source-handler.d.mts +22 -0
  97. package/dist/types/get-source-handlers.d.mts +15 -0
  98. package/dist/types/index.d.mts +19 -10
  99. package/dist/types/list.d.mts +12 -0
  100. package/dist/types/main-field.d.mts +13 -0
  101. package/dist/types/module-format.d.mts +13 -0
  102. package/dist/types/module-id.d.mts +3 -4
  103. package/dist/types/numeric.d.mts +9 -0
  104. package/dist/types/pattern-key-comparison.d.mts +14 -0
  105. package/dist/types/pattern-match.d.mts +10 -0
  106. package/dist/types/protocol.d.mts +6 -7
  107. package/package.json +151 -154
  108. package/changelog.config.ts +0 -404
  109. package/dist/enums/assert-type.d.mts +0 -21
  110. package/dist/enums/assert-type.mjs +0 -10
  111. package/dist/enums/assert-type.mjs.map +0 -6
  112. package/dist/enums/format.d.mts +0 -17
  113. package/dist/enums/format.mjs +0 -13
  114. package/dist/enums/format.mjs.map +0 -6
  115. package/dist/enums/index.d.mts +0 -10
  116. package/dist/enums/index.mjs +0 -15
  117. package/dist/enums/index.mjs.map +0 -6
  118. package/dist/enums/kind-specifier-syntax.d.mts +0 -14
  119. package/dist/enums/kind-specifier-syntax.mjs +0 -10
  120. package/dist/enums/kind-specifier-syntax.mjs.map +0 -6
  121. package/dist/enums/kind-specifier.d.mts +0 -17
  122. package/dist/enums/kind-specifier.mjs +0 -11
  123. package/dist/enums/kind-specifier.mjs.map +0 -6
  124. package/dist/enums/kind-statement-syntax.d.mts +0 -22
  125. package/dist/enums/kind-statement-syntax.mjs +0 -18
  126. package/dist/enums/kind-statement-syntax.mjs.map +0 -6
  127. package/dist/enums/kind-statement.d.mts +0 -15
  128. package/dist/enums/kind-statement.mjs +0 -11
  129. package/dist/enums/kind-statement.mjs.map +0 -6
  130. package/dist/index.mjs.map +0 -6
  131. package/dist/interfaces/import-assertions.d.mts +0 -20
  132. package/dist/interfaces/import-dynamic.d.mts +0 -43
  133. package/dist/interfaces/import-static.d.mts +0 -37
  134. package/dist/interfaces/index.mjs +0 -1
  135. package/dist/interfaces/index.mjs.map +0 -6
  136. package/dist/interfaces/options-fill-module.d.mts +0 -23
  137. package/dist/interfaces/options-find-subpath.d.mts +0 -49
  138. package/dist/interfaces/options-get-format.d.mts +0 -83
  139. package/dist/interfaces/options-get-source.d.mts +0 -63
  140. package/dist/interfaces/options-parse-module-id.d.mts +0 -33
  141. package/dist/interfaces/options-parse-subpath.d.mts +0 -31
  142. package/dist/interfaces/options-resolve-alias.d.mts +0 -53
  143. package/dist/interfaces/options-resolve-module.d.mts +0 -64
  144. package/dist/interfaces/options-resolve.d.mts +0 -15
  145. package/dist/interfaces/package-scope.d.mts +0 -25
  146. package/dist/interfaces/parsed-data-url.d.mts +0 -56
  147. package/dist/interfaces/parsed-module-id.d.mts +0 -80
  148. package/dist/interfaces/parsed-subpath.d.mts +0 -40
  149. package/dist/interfaces/statement-export.d.mts +0 -44
  150. package/dist/interfaces/statement-import.d.mts +0 -38
  151. package/dist/interfaces/statement-require.d.mts +0 -38
  152. package/dist/interfaces/statement.d.mts +0 -49
  153. package/dist/internal/escape-reg-exp.d.mts +0 -16
  154. package/dist/internal/escape-reg-exp.mjs +0 -10
  155. package/dist/internal/escape-reg-exp.mjs.map +0 -6
  156. package/dist/internal/format-type-map.d.mts +0 -17
  157. package/dist/internal/format-type-map.mjs +0 -13
  158. package/dist/internal/format-type-map.mjs.map +0 -6
  159. package/dist/internal/get-specifier-kind.d.mts +0 -17
  160. package/dist/internal/get-specifier-kind.mjs +0 -14
  161. package/dist/internal/get-specifier-kind.mjs.map +0 -6
  162. package/dist/internal/get-subpaths.d.mts +0 -25
  163. package/dist/internal/get-subpaths.mjs +0 -10
  164. package/dist/internal/get-subpaths.mjs.map +0 -6
  165. package/dist/internal/is-array-index.d.mts +0 -15
  166. package/dist/internal/is-array-index.mjs +0 -9
  167. package/dist/internal/is-array-index.mjs.map +0 -6
  168. package/dist/internal/is-directory.d.mts +0 -13
  169. package/dist/internal/is-directory.mjs +0 -16
  170. package/dist/internal/is-directory.mjs.map +0 -6
  171. package/dist/internal/is-file.d.mts +0 -13
  172. package/dist/internal/is-file.mjs +0 -16
  173. package/dist/internal/is-file.mjs.map +0 -6
  174. package/dist/internal/is-function.d.mts +0 -12
  175. package/dist/internal/is-function.mjs +0 -8
  176. package/dist/internal/is-function.mjs.map +0 -6
  177. package/dist/internal/regex-encoded-sep.d.mts +0 -13
  178. package/dist/internal/regex-encoded-sep.mjs +0 -6
  179. package/dist/internal/regex-encoded-sep.mjs.map +0 -6
  180. package/dist/internal/regex-internal-specifier.d.mts +0 -14
  181. package/dist/internal/regex-internal-specifier.mjs +0 -6
  182. package/dist/internal/regex-internal-specifier.mjs.map +0 -6
  183. package/dist/internal/regex-package-name.d.mts +0 -13
  184. package/dist/internal/regex-package-name.mjs +0 -6
  185. package/dist/internal/regex-package-name.mjs.map +0 -6
  186. package/dist/internal/regex-package-path.d.mts +0 -15
  187. package/dist/internal/regex-package-path.mjs +0 -6
  188. package/dist/internal/regex-package-path.mjs.map +0 -6
  189. package/dist/internal/resolver.d.mts +0 -130
  190. package/dist/internal/resolver.mjs +0 -486
  191. package/dist/internal/resolver.mjs.map +0 -6
  192. package/dist/internal/validate-boolean.d.mts +0 -20
  193. package/dist/internal/validate-boolean.mjs +0 -11
  194. package/dist/internal/validate-boolean.mjs.map +0 -6
  195. package/dist/internal/validate-object.d.mts +0 -23
  196. package/dist/internal/validate-object.mjs +0 -11
  197. package/dist/internal/validate-object.mjs.map +0 -6
  198. package/dist/internal/validate-set.d.mts +0 -23
  199. package/dist/internal/validate-set.mjs +0 -11
  200. package/dist/internal/validate-set.mjs.map +0 -6
  201. package/dist/internal/validate-string.d.mts +0 -20
  202. package/dist/internal/validate-string.mjs +0 -11
  203. package/dist/internal/validate-string.mjs.map +0 -6
  204. package/dist/internal/validate-url-string.d.mts +0 -22
  205. package/dist/internal/validate-url-string.mjs +0 -12
  206. package/dist/internal/validate-url-string.mjs.map +0 -6
  207. package/dist/types/declaration.d.mts +0 -9
  208. package/dist/types/fn-change-ext.d.mts +0 -28
  209. package/dist/types/index.mjs +0 -1
  210. package/dist/types/index.mjs.map +0 -6
  211. package/dist/types/mime-type.d.mts +0 -13
  212. package/dist/types/module-specifier-type.d.mts +0 -11
  213. package/dist/types/syntax-kind-export.d.mts +0 -12
  214. package/dist/types/syntax-kind-import.d.mts +0 -12
  215. package/dist/types/syntax-kind-require.d.mts +0 -12
  216. package/dist/utils/compare-subpaths.d.mts +0 -25
  217. package/dist/utils/compare-subpaths.mjs +0 -24
  218. package/dist/utils/compare-subpaths.mjs.map +0 -6
  219. package/dist/utils/conditions.d.mts +0 -13
  220. package/dist/utils/conditions.mjs +0 -6
  221. package/dist/utils/conditions.mjs.map +0 -6
  222. package/dist/utils/detect-syntax.d.mts +0 -21
  223. package/dist/utils/detect-syntax.mjs +0 -12
  224. package/dist/utils/detect-syntax.mjs.map +0 -6
  225. package/dist/utils/extension-format-map.d.mts +0 -16
  226. package/dist/utils/extension-format-map.mjs +0 -22
  227. package/dist/utils/extension-format-map.mjs.map +0 -6
  228. package/dist/utils/extract-statements.d.mts +0 -21
  229. package/dist/utils/extract-statements.mjs +0 -21
  230. package/dist/utils/extract-statements.mjs.map +0 -6
  231. package/dist/utils/fill-modules.d.mts +0 -23
  232. package/dist/utils/fill-modules.mjs +0 -62
  233. package/dist/utils/fill-modules.mjs.map +0 -6
  234. package/dist/utils/find-dynamic-imports.d.mts +0 -18
  235. package/dist/utils/find-dynamic-imports.mjs +0 -39
  236. package/dist/utils/find-dynamic-imports.mjs.map +0 -6
  237. package/dist/utils/find-exports.d.mts +0 -21
  238. package/dist/utils/find-exports.mjs +0 -95
  239. package/dist/utils/find-exports.mjs.map +0 -6
  240. package/dist/utils/find-requires.d.mts +0 -18
  241. package/dist/utils/find-requires.mjs +0 -32
  242. package/dist/utils/find-requires.mjs.map +0 -6
  243. package/dist/utils/find-static-imports.d.mts +0 -18
  244. package/dist/utils/find-static-imports.mjs +0 -34
  245. package/dist/utils/find-static-imports.mjs.map +0 -6
  246. package/dist/utils/find-subpath.d.mts +0 -30
  247. package/dist/utils/find-subpath.mjs +0 -106
  248. package/dist/utils/find-subpath.mjs.map +0 -6
  249. package/dist/utils/get-format.d.mts +0 -24
  250. package/dist/utils/get-format.mjs +0 -111
  251. package/dist/utils/get-format.mjs.map +0 -6
  252. package/dist/utils/get-source.d.mts +0 -22
  253. package/dist/utils/get-source.mjs +0 -63
  254. package/dist/utils/get-source.mjs.map +0 -6
  255. package/dist/utils/has-cjs-syntax.d.mts +0 -25
  256. package/dist/utils/has-cjs-syntax.mjs +0 -11
  257. package/dist/utils/has-cjs-syntax.mjs.map +0 -6
  258. package/dist/utils/has-esm-syntax.d.mts +0 -21
  259. package/dist/utils/has-esm-syntax.mjs +0 -11
  260. package/dist/utils/has-esm-syntax.mjs.map +0 -6
  261. package/dist/utils/index.d.mts +0 -42
  262. package/dist/utils/index.mjs +0 -79
  263. package/dist/utils/index.mjs.map +0 -6
  264. package/dist/utils/is-absolute-specifier.d.mts +0 -19
  265. package/dist/utils/is-absolute-specifier.mjs +0 -25
  266. package/dist/utils/is-absolute-specifier.mjs.map +0 -6
  267. package/dist/utils/is-bare-specifier.d.mts +0 -19
  268. package/dist/utils/is-bare-specifier.mjs +0 -10
  269. package/dist/utils/is-bare-specifier.mjs.map +0 -6
  270. package/dist/utils/is-exports-sugar.d.mts +0 -25
  271. package/dist/utils/is-exports-sugar.mjs +0 -26
  272. package/dist/utils/is-exports-sugar.mjs.map +0 -6
  273. package/dist/utils/is-relative-specifier.d.mts +0 -20
  274. package/dist/utils/is-relative-specifier.mjs +0 -11
  275. package/dist/utils/is-relative-specifier.mjs.map +0 -6
  276. package/dist/utils/lookup-package-scope.d.mts +0 -24
  277. package/dist/utils/lookup-package-scope.mjs +0 -34
  278. package/dist/utils/lookup-package-scope.mjs.map +0 -6
  279. package/dist/utils/parse-data-url.d.mts +0 -25
  280. package/dist/utils/parse-data-url.mjs +0 -25
  281. package/dist/utils/parse-data-url.mjs.map +0 -6
  282. package/dist/utils/parse-module-id.d.mts +0 -22
  283. package/dist/utils/parse-module-id.mjs +0 -122
  284. package/dist/utils/parse-module-id.mjs.map +0 -6
  285. package/dist/utils/parse-subpath.d.mts +0 -35
  286. package/dist/utils/parse-subpath.mjs +0 -54
  287. package/dist/utils/parse-subpath.mjs.map +0 -6
  288. package/dist/utils/pattern-character.d.mts +0 -11
  289. package/dist/utils/pattern-character.mjs +0 -6
  290. package/dist/utils/pattern-character.mjs.map +0 -6
  291. package/dist/utils/read-package-json.d.mts +0 -26
  292. package/dist/utils/read-package-json.mjs +0 -43
  293. package/dist/utils/read-package-json.mjs.map +0 -6
  294. package/dist/utils/resolve-alias.d.mts +0 -20
  295. package/dist/utils/resolve-alias.mjs +0 -106
  296. package/dist/utils/resolve-alias.mjs.map +0 -6
  297. package/dist/utils/resolve-aliases.d.mts +0 -19
  298. package/dist/utils/resolve-aliases.mjs +0 -28
  299. package/dist/utils/resolve-aliases.mjs.map +0 -6
  300. package/dist/utils/resolve-extensions.d.mts +0 -14
  301. package/dist/utils/resolve-extensions.mjs +0 -22
  302. package/dist/utils/resolve-extensions.mjs.map +0 -6
  303. package/dist/utils/resolve-module.d.mts +0 -39
  304. package/dist/utils/resolve-module.mjs +0 -64
  305. package/dist/utils/resolve-module.mjs.map +0 -6
  306. package/dist/utils/resolve-modules.d.mts +0 -25
  307. package/dist/utils/resolve-modules.mjs +0 -26
  308. package/dist/utils/resolve-modules.mjs.map +0 -6
  309. package/dist/utils/to-absolute-specifier.d.mts +0 -22
  310. package/dist/utils/to-absolute-specifier.mjs +0 -8
  311. package/dist/utils/to-absolute-specifier.mjs.map +0 -6
  312. package/dist/utils/to-bare-specifier.d.mts +0 -42
  313. package/dist/utils/to-bare-specifier.mjs +0 -90
  314. package/dist/utils/to-bare-specifier.mjs.map +0 -6
  315. package/dist/utils/to-data-url.d.mts +0 -30
  316. package/dist/utils/to-data-url.mjs +0 -11
  317. package/dist/utils/to-data-url.mjs.map +0 -6
  318. package/dist/utils/to-node-url.d.mts +0 -19
  319. package/dist/utils/to-node-url.mjs +0 -10
  320. package/dist/utils/to-node-url.mjs.map +0 -6
  321. package/dist/utils/to-relative-specifier.d.mts +0 -22
  322. package/dist/utils/to-relative-specifier.mjs +0 -21
  323. package/dist/utils/to-relative-specifier.mjs.map +0 -6
  324. package/dist/utils/to-url.d.mts +0 -22
  325. package/dist/utils/to-url.mjs +0 -12
  326. package/dist/utils/to-url.mjs.map +0 -6
  327. package/dist/utils/validate-assertions.d.mts +0 -23
  328. package/dist/utils/validate-assertions.mjs +0 -52
  329. package/dist/utils/validate-assertions.mjs.map +0 -6
  330. package/dist/utils/validate-exports.d.mts +0 -24
  331. package/dist/utils/validate-exports.mjs +0 -72
  332. package/dist/utils/validate-exports.mjs.map +0 -6
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/enums/kind-statement.ts"],
4
- "mappings": "AAUA,IAAK,gBAAL,kBAAKA,mBAAL;AACE,EAAAA,eAAA,YAAS;AACT,EAAAA,eAAA,YAAS;AACT,EAAAA,eAAA,aAAU;AAHP,SAAAA;AAAA,GAAA;AAML,IAAO,yBAAQ;",
5
- "names": ["StatementKind"]
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.ts"],
4
- "mappings": "AAKA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
5
- "names": []
6
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * @file Interfaces - ImportAssertions
3
- * @module mlly/interfaces/ImportAssertions
4
- */
5
- import type { AssertType } from '../enums/index.mjs';
6
- import type { LiteralUnion } from '@flex-development/tutils';
7
- /**
8
- * `import` assertions schema.
9
- *
10
- * @see {@linkcode AssertType}
11
- * @see https://github.com/tc39/proposal-import-assertions
12
- */
13
- interface ImportAssertions {
14
- [key: string]: string;
15
- /**
16
- * Assertion type.
17
- */
18
- type?: LiteralUnion<AssertType, string>;
19
- }
20
- export type { ImportAssertions as default };
@@ -1,43 +0,0 @@
1
- /**
2
- * @file Interfaces - DynamicImport
3
- * @module mlly/interfaces/DynamicImport
4
- */
5
- import type { StatementSyntaxKind } from '../enums/index.mjs';
6
- import type { SyntaxKindImport } from '../types/index.mjs';
7
- import type { EmptyString, LiteralUnion } from '@flex-development/tutils';
8
- import type ImportStatement from './statement-import.mjs';
9
- /**
10
- * Dynamic import statement object.
11
- *
12
- * @see {@linkcode ImportStatement}
13
- * @see {@linkcode StatementSyntaxKind}
14
- * @see {@linkcode SyntaxKindImport}
15
- * @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/import
16
- *
17
- * @extends {ImportStatement}
18
- */
19
- interface DynamicImport extends ImportStatement {
20
- /**
21
- * Import expression.
22
- *
23
- * @example
24
- * 'import("foo.json")'
25
- * @example
26
- * 'import(foo)'
27
- */
28
- expression: LiteralUnion<EmptyString, string>;
29
- /**
30
- * Options bag.
31
- *
32
- * @see https://github.com/tc39/proposal-import-assertions#dynamic-import
33
- *
34
- * @example
35
- * '{ assert: { type: "json" } }'
36
- */
37
- options: LiteralUnion<EmptyString, string>;
38
- /**
39
- * Statement syntax kind.
40
- */
41
- syntax: Extract<SyntaxKindImport, StatementSyntaxKind.DYNAMIC>;
42
- }
43
- export type { DynamicImport as default };
@@ -1,37 +0,0 @@
1
- /**
2
- * @file Interfaces - StaticImport
3
- * @module mlly/interfaces/StaticImport
4
- */
5
- import type { StatementSyntaxKind } from '../enums/index.mjs';
6
- import type { SyntaxKindImport } from '../types/index.mjs';
7
- import type { EmptyString, LiteralUnion } from '@flex-development/tutils';
8
- import type ImportStatement from './statement-import.mjs';
9
- /**
10
- * Static import statement object.
11
- *
12
- * @see {@linkcode ImportStatement}
13
- * @see {@linkcode StatementSyntaxKind}
14
- * @see {@linkcode SyntaxKindImport}
15
- *
16
- * @extends {ImportStatement}
17
- */
18
- interface StaticImport extends ImportStatement {
19
- /**
20
- * Assertion options.
21
- *
22
- * @see https://github.com/tc39/proposal-import-assertions#import-statements
23
- *
24
- * @example
25
- * '{ type: "json" }'
26
- */
27
- assertion: LiteralUnion<EmptyString, string>;
28
- /**
29
- * Statement syntax kind.
30
- */
31
- syntax: Extract<SyntaxKindImport, StatementSyntaxKind.DEFAULT | StatementSyntaxKind.DEFAULT_WITH_NAMED | StatementSyntaxKind.DEFAULT_WITH_NAMESPACE | StatementSyntaxKind.NAMED | StatementSyntaxKind.NAMESPACE | StatementSyntaxKind.SIDE_EFFECT>;
32
- /**
33
- * Type-only import statement check.
34
- */
35
- type: boolean;
36
- }
37
- export type { StaticImport as default };
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index.mjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "mappings": "",
5
- "names": []
6
- }
@@ -1,23 +0,0 @@
1
- /**
2
- * @file Interfaces - FillModuleOptions
3
- * @module mlly/interfaces/FillModuleOptions
4
- */
5
- import type { ChangeExtFn } from '../types/index.mjs';
6
- import type ResolveModuleOptions from './options-resolve-module.mjs';
7
- /**
8
- * Options for fully specifying modules.
9
- *
10
- * @see {@linkcode ChangeExtFn}
11
- * @see {@linkcode ResolveModuleOptions}
12
- * @see https://nodejs.org/api/esm.html#mandatory-file-extensions
13
- *
14
- * @extends {ResolveModuleOptions}
15
- */
16
- interface FillModuleOptions extends ResolveModuleOptions {
17
- /**
18
- * File extension to add to absolute and relative specifiers or a function
19
- * that returns a file extension.
20
- */
21
- ext: ChangeExtFn<string> | string;
22
- }
23
- export type { FillModuleOptions as default };
@@ -1,49 +0,0 @@
1
- /**
2
- * @file Interfaces - FindSubpathOptions
3
- * @module mlly/interfaces/FindSubpathOptions
4
- */
5
- import type { ModuleId } from '../types/index.mjs';
6
- /**
7
- * Subpath search options.
8
- *
9
- * @see {@linkcode ModuleId}
10
- */
11
- interface FindSubpathOptions {
12
- /**
13
- * Export condition to apply.
14
- *
15
- * @see https://nodejs.org/api/packages.html#conditional-exports
16
- *
17
- * @default 'default'
18
- */
19
- condition?: string | undefined;
20
- /**
21
- * Export conditions.
22
- *
23
- * **Note**: Should be sorted by priority.
24
- *
25
- * @see https://nodejs.org/api/packages.html#conditional-exports
26
- *
27
- * @default CONDITIONS
28
- */
29
- conditions?: Set<string> | undefined;
30
- /**
31
- * URL of directory containing relevant `package.json` file.
32
- */
33
- dir: ModuleId;
34
- /**
35
- * Package [`imports`][1] hint.
36
- *
37
- * [1]: https://nodejs.org/api/packages.html#imports
38
- *
39
- * @default false
40
- */
41
- internal?: boolean | undefined;
42
- /**
43
- * URL of module to resolve from.
44
- *
45
- * **Note**: Used for error reporting only.
46
- */
47
- parent: ModuleId;
48
- }
49
- export type { FindSubpathOptions as default };
@@ -1,83 +0,0 @@
1
- /**
2
- * @file Interfaces - GetFormatOptions
3
- * @module mlly/interfaces/GetFormatOptions
4
- */
5
- import type { Format } from '../enums/index.mjs';
6
- import type { ModuleId } from '../types/index.mjs';
7
- import type { Ext } from '@flex-development/pathe';
8
- import type { EmptyString } from '@flex-development/tutils';
9
- import type { RequestInit } from 'node-fetch';
10
- /**
11
- * Module format retrieval options.
12
- *
13
- * @see {@linkcode Ext}
14
- * @see {@linkcode Format}
15
- * @see {@linkcode ModuleId}
16
- * @see {@linkcode RequestInit}
17
- */
18
- interface GetFormatOptions {
19
- /**
20
- * Base URL to resolve module id against if module id is not absolute.
21
- *
22
- * @see {@linkcode ModuleId}
23
- *
24
- * @default undefined
25
- */
26
- base?: ModuleId | undefined;
27
- /**
28
- * Enable support for JSON modules.
29
- *
30
- * @see https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_json_modules
31
- *
32
- * @default true
33
- */
34
- experimental_json_modules?: boolean | undefined;
35
- /**
36
- * Enable support for network based modules.
37
- *
38
- * **Note**: Requires [`node-fetch`][1].
39
- *
40
- * [1]: https://github.com/node-fetch/node-fetch
41
- *
42
- * @see https://nodejs.org/docs/latest-v16.x/api/esm.html#https-and-http-imports
43
- *
44
- * @default false
45
- */
46
- experimental_network_imports?: boolean | undefined;
47
- /**
48
- * Enable support for WebAssembly modules.
49
- *
50
- * @see https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_wasm_modules
51
- *
52
- * @default false
53
- */
54
- experimental_wasm_modules?: boolean | undefined;
55
- /**
56
- * Map file extensions to module formats.
57
- *
58
- * @default EXTENSION_FORMAT_MAP
59
- */
60
- extension_format_map?: Map<EmptyString | Ext, Format> | undefined;
61
- /**
62
- * Return `undefined` when module format is not found, rather than `null`.
63
- *
64
- * An explicit `undefined` return value indicates [`load`][1] hooks should
65
- * re-run module format checks.
66
- *
67
- * [1]: https://nodejs.org/docs/latest-v16.x/api/esm.html#loadurl-context-nextload
68
- *
69
- * @default false
70
- */
71
- ignore_errors?: boolean | undefined;
72
- /**
73
- * Request options for network based modules.
74
- *
75
- * Only applicable if {@linkcode experimental_network_imports} is enabled.
76
- *
77
- * @see {@linkcode RequestInit}
78
- *
79
- * @default undefined
80
- */
81
- req?: RequestInit | undefined;
82
- }
83
- export type { GetFormatOptions as default };
@@ -1,63 +0,0 @@
1
- /**
2
- * @file Interfaces - GetSourceOptions
3
- * @module mlly/interfaces/GetSourceOptions
4
- */
5
- import type { Format } from '../enums/index.mjs';
6
- import type { ModuleId } from '../types/index.mjs';
7
- import type { RequestInit } from 'node-fetch';
8
- /**
9
- * Source code retrieval options.
10
- *
11
- * @see {@linkcode Format}
12
- * @see {@linkcode ModuleId}
13
- * @see {@linkcode RequestInit}
14
- */
15
- interface GetSourceOptions {
16
- /**
17
- * Base URL to resolve module id against if module id is not absolute.
18
- *
19
- * @see {@linkcode ModuleId}
20
- *
21
- * @default undefined
22
- */
23
- base?: ModuleId | undefined;
24
- /**
25
- * Enable support for network based modules.
26
- *
27
- * **Note**: Requires [`node-fetch`][1].
28
- *
29
- * [1]: https://github.com/node-fetch/node-fetch
30
- *
31
- * @see https://nodejs.org/docs/latest-v16.x/api/esm.html#https-and-http-imports
32
- *
33
- * @default false
34
- */
35
- experimental_network_imports?: boolean | undefined;
36
- /**
37
- * Module format hint.
38
- *
39
- * @see {@linkcode Format}
40
- *
41
- * @default undefined
42
- */
43
- format?: Format | Lowercase<keyof typeof Format> | undefined;
44
- /**
45
- * Ignore [`ERR_UNSUPPORTED_ESM_URL_SCHEME`][1] if thrown.
46
- *
47
- * [1]: https://nodejs.org/api/errors.html#err_unsupported_esm_url_scheme
48
- *
49
- * @default false
50
- */
51
- ignore_errors?: boolean | undefined;
52
- /**
53
- * Request options for network based modules.
54
- *
55
- * Only applicable if {@linkcode experimental_network_imports} is enabled.
56
- *
57
- * @see {@linkcode RequestInit}
58
- *
59
- * @default undefined
60
- */
61
- req?: RequestInit | undefined;
62
- }
63
- export type { GetSourceOptions as default };
@@ -1,33 +0,0 @@
1
- /**
2
- * @file Interfaces - ParseModuleIdOptions
3
- * @module mlly/interfaces/ParseModuleIdOptions
4
- */
5
- import type { ModuleId } from '../types/index.mjs';
6
- /**
7
- * Module id parsing options.
8
- *
9
- * @see {@linkcode ModuleId}
10
- */
11
- interface ParseModuleIdOptions {
12
- /**
13
- * Ensure module id is a valid internal specifier, syntactically.
14
- *
15
- * @see https://nodejs.org/api/packages.html#subpath-imports
16
- *
17
- * @default id instanceof URL ? false : id.startsWith('#')
18
- */
19
- internal?: boolean | undefined;
20
- /**
21
- * URL of module to resolve from.
22
- *
23
- * **Note**: Used for error reporting only.
24
- *
25
- * @default undefined
26
- */
27
- parent?: ModuleId | undefined;
28
- /**
29
- * Ensure module id begins with a valid package name.
30
- */
31
- pkgname?: boolean | undefined;
32
- }
33
- export type { ParseModuleIdOptions as default };
@@ -1,31 +0,0 @@
1
- /**
2
- * @file Interfaces - ParseSubpathOptions
3
- * @module mlly/interfaces/ParseSubpathOptions
4
- */
5
- import type { ModuleId } from '../types/index.mjs';
6
- /**
7
- * Subpath parsing options.
8
- *
9
- * @see {@linkcode ModuleId}
10
- */
11
- interface ParseSubpathOptions {
12
- /**
13
- * URL of directory containing relevant `package.json` file.
14
- */
15
- dir: ModuleId;
16
- /**
17
- * Package [`imports`][1] hint.
18
- *
19
- * [1]: https://nodejs.org/api/packages.html#imports
20
- *
21
- * @default specifier.startsWith('#')
22
- */
23
- internal?: boolean | undefined;
24
- /**
25
- * URL of module to resolve from.
26
- *
27
- * **Note**: Used for error reporting only.
28
- */
29
- parent: ModuleId;
30
- }
31
- export type { ParseSubpathOptions as default };
@@ -1,53 +0,0 @@
1
- /**
2
- * @file Interfaces - ResolveAliasOptions
3
- * @module mlly/interfaces/ResolveAliasOptions
4
- */
5
- import type { ModuleId } from '../types/index.mjs';
6
- import type { MapLike, OneOrMany } from '@flex-development/tutils';
7
- import type ResolveModuleOptions from './options-resolve-module.mjs';
8
- /**
9
- * Path alias resolution options.
10
- *
11
- * @see {@linkcode ModuleId}
12
- *
13
- * @extends {ResolveModuleOptions}
14
- */
15
- interface ResolveAliasOptions extends ResolveModuleOptions {
16
- /**
17
- * Return resolved module URL as absolute specifier (a [`file:` URL][1]).
18
- *
19
- * If `false`, return resolved module URL as bare or relative specifier.
20
- *
21
- * [1]: https://nodejs.org/api/esm.html#file-urls
22
- *
23
- * @see https://nodejs.org/api/esm.html#terminology
24
- *
25
- * @default true
26
- */
27
- absolute?: boolean | undefined;
28
- /**
29
- * Path mappings.
30
- *
31
- * **Note**: Paths should be relative to {@linkcode cwd}.
32
- *
33
- * @default {}
34
- */
35
- aliases?: MapLike<OneOrMany<string>> | undefined;
36
- /**
37
- * Directory to resolve non-absolute modules from.
38
- *
39
- * @default pathToFileURL('.')
40
- */
41
- cwd?: ModuleId | undefined;
42
- /**
43
- * Id of module to resolve from.
44
- *
45
- * **Note**: Should be an absolute path or [`file:` URL][1].
46
- *
47
- * [1]: https://nodejs.org/api/esm.html#file-urls
48
- *
49
- * @default import.meta.url
50
- */
51
- parent?: ModuleId | undefined;
52
- }
53
- export type { ResolveAliasOptions as default };
@@ -1,64 +0,0 @@
1
- /**
2
- * @file Interfaces - ResolveModuleOptions
3
- * @module mlly/interfaces/ResolveModuleOptions
4
- */
5
- import type { ChangeExtFn, ModuleId } from '../types/index.mjs';
6
- import type { Nilable } from '@flex-development/tutils';
7
- /**
8
- * Module resolution options.
9
- *
10
- * @see {@linkcode ChangeExtFn}
11
- * @see {@linkcode ModuleId}
12
- */
13
- interface ResolveModuleOptions {
14
- /**
15
- * Export condition to apply.
16
- *
17
- * @see https://nodejs.org/api/packages.html#conditional-exports
18
- *
19
- * @default 'default'
20
- */
21
- condition?: string | undefined;
22
- /**
23
- * Export conditions.
24
- *
25
- * **Note**: Should be sorted by priority.
26
- *
27
- * @see https://nodejs.org/api/packages.html#conditional-exports
28
- *
29
- * @default CONDITIONS
30
- */
31
- conditions?: Set<string> | string[] | undefined;
32
- /**
33
- * Replacement file extension or function that returns a file extension.
34
- *
35
- * An empty string (`''`) will remove a file extension; `null` or `undefined`
36
- * will skip extension replacement.
37
- *
38
- * @default undefined
39
- */
40
- ext?: ChangeExtFn | Nilable<string>;
41
- /**
42
- * Module extensions to probe for.
43
- *
44
- * **Note**: Should be sorted by priority.
45
- *
46
- * @default RESOLVE_EXTENSIONS
47
- */
48
- extensions?: Set<string> | string[] | undefined;
49
- /**
50
- * URL of module to resolve from.
51
- *
52
- * @see {@linkcode ModuleId}
53
- *
54
- * @default import.meta.url
55
- */
56
- parent?: ModuleId | undefined;
57
- /**
58
- * Keep symlinks instead of resolving them.
59
- *
60
- * @default false
61
- */
62
- preserveSymlinks?: boolean | undefined;
63
- }
64
- export type { ResolveModuleOptions as default };
@@ -1,15 +0,0 @@
1
- /**
2
- * @file Interfaces - ResolveOptions
3
- * @module mlly/interfaces/ResolveOptions
4
- */
5
- import type ResolveModuleOptions from './options-resolve-module.mjs';
6
- /**
7
- * Resolution options.
8
- *
9
- * @see {@linkcode ResolveModuleOptions}
10
- *
11
- * @extends {ResolveModuleOptions}
12
- */
13
- interface ResolveOptions extends ResolveModuleOptions {
14
- }
15
- export type { ResolveOptions as default };
@@ -1,25 +0,0 @@
1
- /**
2
- * @file Interfaces - PackageScope
3
- * @module mlly/interfaces/PackageScope
4
- */
5
- import type { PackageJson } from '@flex-development/pkg-types';
6
- /**
7
- * Object representing a package scope.
8
- *
9
- * @see {@linkcode PackageJson}
10
- */
11
- interface PackageScope {
12
- /**
13
- * URL of directory containing `package.json` file.
14
- */
15
- dir: string;
16
- /**
17
- * URL of `package.json` file.
18
- */
19
- pkg: string;
20
- /**
21
- * `package.json` object.
22
- */
23
- pkgjson: PackageJson;
24
- }
25
- export type { PackageScope as default };
@@ -1,56 +0,0 @@
1
- /**
2
- * @file Interfaces - ParsedDataUrl
3
- * @module mlly/interfaces/ParsedDataUrl
4
- */
5
- /// <reference types="node" />
6
- import type { MimeType, Protocol } from '../types/index.mjs';
7
- import type { EmptyString, LiteralUnion } from '@flex-development/tutils';
8
- import type { URL } from 'node:url';
9
- /**
10
- * Object representing a [`data:` URL][1].
11
- *
12
- * [1]: https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URLs
13
- *
14
- * @see {@linkcode Protocol}
15
- * @see {@linkcode MimeType}
16
- * @see https://nodejs.org/api/esm.html#data-imports
17
- */
18
- interface ParsedDataUrl {
19
- /**
20
- * [base64][1] encoding check.
21
- *
22
- * [1]: https://developer.mozilla.org/docs/Glossary/Base64
23
- */
24
- base64: boolean;
25
- /**
26
- * Data portion of URL.
27
- *
28
- * If {@linkcode base64} is `true`, `data` is base64-encoded.
29
- */
30
- data: LiteralUnion<EmptyString, string>;
31
- /**
32
- * Serialized `data:` URL.
33
- *
34
- * @see https://nodejs.org/api/url.html#urlhref
35
- */
36
- href: URL['href'];
37
- /**
38
- * MIME type.
39
- *
40
- * @see https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types
41
- */
42
- mime: LiteralUnion<MimeType, string>;
43
- /**
44
- * Path portion of URL.
45
- *
46
- * @see https://nodejs.org/api/url.html#urlpathname
47
- */
48
- pathname: URL['pathname'];
49
- /**
50
- * Protocol portion of URL.
51
- *
52
- * @see https://nodejs.org/api/url.html#urlprotocol
53
- */
54
- protocol: Extract<Protocol, 'data:'>;
55
- }
56
- export type { ParsedDataUrl as default };