@flex-development/mlly 1.0.0-alpha.6 → 1.0.0-alpha.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 (263) hide show
  1. package/CHANGELOG.md +175 -0
  2. package/README.md +1 -1
  3. package/changelog.config.ts +404 -0
  4. package/dist/enums/assert-type.d.mts +21 -0
  5. package/dist/enums/assert-type.mjs +10 -0
  6. package/dist/enums/assert-type.mjs.map +6 -0
  7. package/dist/enums/format.d.mts +17 -0
  8. package/dist/enums/format.mjs +13 -0
  9. package/dist/enums/format.mjs.map +6 -0
  10. package/dist/enums/index.d.mts +4 -1
  11. package/dist/enums/index.mjs +13 -6
  12. package/dist/enums/index.mjs.map +6 -0
  13. package/dist/enums/kind-specifier-syntax.d.mts +14 -0
  14. package/dist/enums/kind-specifier-syntax.mjs +10 -0
  15. package/dist/enums/kind-specifier-syntax.mjs.map +6 -0
  16. package/dist/enums/kind-specifier.d.mts +6 -3
  17. package/dist/enums/kind-specifier.mjs +4 -2
  18. package/dist/enums/kind-specifier.mjs.map +6 -0
  19. package/dist/enums/{kind-syntax.d.mts → kind-statement-syntax.d.mts} +4 -4
  20. package/dist/enums/kind-statement-syntax.mjs +18 -0
  21. package/dist/enums/kind-statement-syntax.mjs.map +6 -0
  22. package/dist/enums/kind-statement.mjs +1 -0
  23. package/dist/enums/kind-statement.mjs.map +6 -0
  24. package/dist/index.d.mts +1 -2
  25. package/dist/index.mjs +2 -2
  26. package/dist/index.mjs.map +6 -0
  27. package/dist/interfaces/import-assertions.d.mts +20 -0
  28. package/dist/interfaces/import-dynamic.d.mts +4 -2
  29. package/dist/interfaces/import-static.d.mts +4 -2
  30. package/dist/interfaces/index.d.mts +12 -0
  31. package/dist/interfaces/index.mjs +1 -0
  32. package/dist/interfaces/index.mjs.map +6 -0
  33. package/dist/interfaces/options-fill-module.d.mts +23 -0
  34. package/dist/interfaces/options-find-subpath.d.mts +49 -0
  35. package/dist/interfaces/options-get-format.d.mts +83 -0
  36. package/dist/interfaces/options-get-source.d.mts +63 -0
  37. package/dist/interfaces/options-parse-module-id.d.mts +33 -0
  38. package/dist/interfaces/options-parse-subpath.d.mts +31 -0
  39. package/dist/interfaces/options-resolve-alias.d.mts +26 -42
  40. package/dist/interfaces/options-resolve-module.d.mts +64 -0
  41. package/dist/interfaces/options-resolve.d.mts +7 -53
  42. package/dist/interfaces/package-scope.d.mts +25 -0
  43. package/dist/interfaces/parsed-data-url.d.mts +56 -0
  44. package/dist/interfaces/parsed-module-id.d.mts +80 -0
  45. package/dist/interfaces/parsed-subpath.d.mts +40 -0
  46. package/dist/interfaces/statement-import.d.mts +2 -2
  47. package/dist/interfaces/statement-require.d.mts +2 -2
  48. package/dist/interfaces/statement.d.mts +10 -5
  49. package/dist/internal/escape-reg-exp.d.mts +16 -0
  50. package/dist/internal/escape-reg-exp.mjs +10 -0
  51. package/dist/internal/escape-reg-exp.mjs.map +6 -0
  52. package/dist/internal/format-type-map.d.mts +17 -0
  53. package/dist/internal/format-type-map.mjs +13 -0
  54. package/dist/internal/format-type-map.mjs.map +6 -0
  55. package/dist/internal/get-specifier-kind.d.mts +17 -0
  56. package/dist/internal/get-specifier-kind.mjs +14 -0
  57. package/dist/internal/get-specifier-kind.mjs.map +6 -0
  58. package/dist/internal/get-subpaths.d.mts +25 -0
  59. package/dist/internal/get-subpaths.mjs +10 -0
  60. package/dist/internal/get-subpaths.mjs.map +6 -0
  61. package/dist/internal/is-array-index.d.mts +15 -0
  62. package/dist/internal/is-array-index.mjs +9 -0
  63. package/dist/internal/is-array-index.mjs.map +6 -0
  64. package/dist/internal/is-directory.d.mts +13 -0
  65. package/dist/internal/is-directory.mjs +16 -0
  66. package/dist/internal/is-directory.mjs.map +6 -0
  67. package/dist/internal/is-file.d.mts +13 -0
  68. package/dist/internal/is-file.mjs +16 -0
  69. package/dist/internal/is-file.mjs.map +6 -0
  70. package/dist/internal/is-function.d.mts +12 -0
  71. package/dist/internal/is-function.mjs +8 -0
  72. package/dist/internal/is-function.mjs.map +6 -0
  73. package/dist/internal/regex-encoded-sep.d.mts +13 -0
  74. package/dist/internal/regex-encoded-sep.mjs +6 -0
  75. package/dist/internal/regex-encoded-sep.mjs.map +6 -0
  76. package/dist/internal/regex-internal-specifier.d.mts +14 -0
  77. package/dist/internal/regex-internal-specifier.mjs +6 -0
  78. package/dist/internal/regex-internal-specifier.mjs.map +6 -0
  79. package/dist/internal/regex-package-name.d.mts +13 -0
  80. package/dist/internal/regex-package-name.mjs +6 -0
  81. package/dist/internal/regex-package-name.mjs.map +6 -0
  82. package/dist/internal/regex-package-path.d.mts +15 -0
  83. package/dist/internal/regex-package-path.mjs +6 -0
  84. package/dist/internal/regex-package-path.mjs.map +6 -0
  85. package/dist/internal/resolver.d.mts +130 -0
  86. package/dist/internal/resolver.mjs +486 -0
  87. package/dist/internal/resolver.mjs.map +6 -0
  88. package/dist/internal/validate-boolean.d.mts +20 -0
  89. package/dist/internal/validate-boolean.mjs +11 -0
  90. package/dist/internal/validate-boolean.mjs.map +6 -0
  91. package/dist/internal/validate-object.d.mts +23 -0
  92. package/dist/internal/validate-object.mjs +11 -0
  93. package/dist/internal/validate-object.mjs.map +6 -0
  94. package/dist/internal/validate-set.d.mts +23 -0
  95. package/dist/internal/validate-set.mjs +11 -0
  96. package/dist/internal/validate-set.mjs.map +6 -0
  97. package/dist/internal/validate-string.d.mts +20 -0
  98. package/dist/internal/validate-string.mjs +11 -0
  99. package/dist/internal/validate-string.mjs.map +6 -0
  100. package/dist/internal/validate-url-string.d.mts +22 -0
  101. package/dist/internal/validate-url-string.mjs +12 -0
  102. package/dist/internal/validate-url-string.mjs.map +6 -0
  103. package/dist/types/fn-change-ext.d.mts +28 -0
  104. package/dist/types/index.d.mts +4 -1
  105. package/dist/types/index.mjs +1 -0
  106. package/dist/types/index.mjs.map +6 -0
  107. package/dist/types/mime-type.d.mts +7 -5
  108. package/dist/types/module-id.d.mts +13 -0
  109. package/dist/types/protocol.d.mts +14 -0
  110. package/dist/types/syntax-kind-export.d.mts +3 -3
  111. package/dist/types/syntax-kind-import.d.mts +3 -3
  112. package/dist/types/syntax-kind-require.d.mts +3 -3
  113. package/dist/utils/compare-subpaths.d.mts +25 -0
  114. package/dist/utils/compare-subpaths.mjs +24 -0
  115. package/dist/utils/compare-subpaths.mjs.map +6 -0
  116. package/dist/utils/conditions.d.mts +13 -0
  117. package/dist/utils/conditions.mjs +6 -0
  118. package/dist/utils/conditions.mjs.map +6 -0
  119. package/dist/{lib → utils}/detect-syntax.d.mts +1 -1
  120. package/dist/{lib → utils}/detect-syntax.mjs +1 -0
  121. package/dist/utils/detect-syntax.mjs.map +6 -0
  122. package/dist/utils/extension-format-map.d.mts +16 -0
  123. package/dist/utils/extension-format-map.mjs +22 -0
  124. package/dist/utils/extension-format-map.mjs.map +6 -0
  125. package/dist/{lib → utils}/extract-statements.d.mts +2 -1
  126. package/dist/{lib → utils}/extract-statements.mjs +3 -0
  127. package/dist/utils/extract-statements.mjs.map +6 -0
  128. package/dist/utils/fill-modules.d.mts +23 -0
  129. package/dist/utils/fill-modules.mjs +62 -0
  130. package/dist/utils/fill-modules.mjs.map +6 -0
  131. package/dist/{lib → utils}/find-dynamic-imports.d.mts +4 -3
  132. package/dist/{lib → utils}/find-dynamic-imports.mjs +14 -4
  133. package/dist/utils/find-dynamic-imports.mjs.map +6 -0
  134. package/dist/{lib → utils}/find-exports.d.mts +4 -3
  135. package/dist/{lib → utils}/find-exports.mjs +29 -12
  136. package/dist/utils/find-exports.mjs.map +6 -0
  137. package/dist/{lib → utils}/find-requires.d.mts +4 -3
  138. package/dist/{lib → utils}/find-requires.mjs +14 -4
  139. package/dist/utils/find-requires.mjs.map +6 -0
  140. package/dist/{lib → utils}/find-static-imports.d.mts +4 -3
  141. package/dist/utils/find-static-imports.mjs +34 -0
  142. package/dist/utils/find-static-imports.mjs.map +6 -0
  143. package/dist/utils/find-subpath.d.mts +30 -0
  144. package/dist/utils/find-subpath.mjs +106 -0
  145. package/dist/utils/find-subpath.mjs.map +6 -0
  146. package/dist/utils/get-format.d.mts +24 -0
  147. package/dist/utils/get-format.mjs +111 -0
  148. package/dist/utils/get-format.mjs.map +6 -0
  149. package/dist/utils/get-source.d.mts +22 -0
  150. package/dist/utils/get-source.mjs +63 -0
  151. package/dist/utils/get-source.mjs.map +6 -0
  152. package/dist/{lib → utils}/has-cjs-syntax.d.mts +2 -1
  153. package/dist/{lib → utils}/has-cjs-syntax.mjs +3 -0
  154. package/dist/utils/has-cjs-syntax.mjs.map +6 -0
  155. package/dist/{lib → utils}/has-esm-syntax.d.mts +2 -1
  156. package/dist/{lib → utils}/has-esm-syntax.mjs +3 -0
  157. package/dist/utils/has-esm-syntax.mjs.map +6 -0
  158. package/dist/utils/index.d.mts +42 -0
  159. package/dist/utils/index.mjs +79 -0
  160. package/dist/utils/index.mjs.map +6 -0
  161. package/dist/utils/is-absolute-specifier.d.mts +19 -0
  162. package/dist/utils/is-absolute-specifier.mjs +25 -0
  163. package/dist/utils/is-absolute-specifier.mjs.map +6 -0
  164. package/dist/utils/is-bare-specifier.d.mts +19 -0
  165. package/dist/utils/is-bare-specifier.mjs +10 -0
  166. package/dist/utils/is-bare-specifier.mjs.map +6 -0
  167. package/dist/utils/is-exports-sugar.d.mts +25 -0
  168. package/dist/utils/is-exports-sugar.mjs +26 -0
  169. package/dist/utils/is-exports-sugar.mjs.map +6 -0
  170. package/dist/utils/is-relative-specifier.d.mts +20 -0
  171. package/dist/utils/is-relative-specifier.mjs +11 -0
  172. package/dist/utils/is-relative-specifier.mjs.map +6 -0
  173. package/dist/utils/lookup-package-scope.d.mts +24 -0
  174. package/dist/utils/lookup-package-scope.mjs +34 -0
  175. package/dist/utils/lookup-package-scope.mjs.map +6 -0
  176. package/dist/utils/parse-data-url.d.mts +25 -0
  177. package/dist/utils/parse-data-url.mjs +25 -0
  178. package/dist/utils/parse-data-url.mjs.map +6 -0
  179. package/dist/utils/parse-module-id.d.mts +22 -0
  180. package/dist/utils/parse-module-id.mjs +122 -0
  181. package/dist/utils/parse-module-id.mjs.map +6 -0
  182. package/dist/utils/parse-subpath.d.mts +35 -0
  183. package/dist/utils/parse-subpath.mjs +54 -0
  184. package/dist/utils/parse-subpath.mjs.map +6 -0
  185. package/dist/utils/pattern-character.d.mts +11 -0
  186. package/dist/utils/pattern-character.mjs +6 -0
  187. package/dist/utils/pattern-character.mjs.map +6 -0
  188. package/dist/utils/read-package-json.d.mts +26 -0
  189. package/dist/utils/read-package-json.mjs +43 -0
  190. package/dist/utils/read-package-json.mjs.map +6 -0
  191. package/dist/utils/resolve-alias.d.mts +20 -0
  192. package/dist/utils/resolve-alias.mjs +106 -0
  193. package/dist/utils/resolve-alias.mjs.map +6 -0
  194. package/dist/{lib → utils}/resolve-aliases.d.mts +7 -5
  195. package/dist/utils/resolve-aliases.mjs +28 -0
  196. package/dist/utils/resolve-aliases.mjs.map +6 -0
  197. package/dist/utils/resolve-extensions.d.mts +14 -0
  198. package/dist/utils/resolve-extensions.mjs +22 -0
  199. package/dist/utils/resolve-extensions.mjs.map +6 -0
  200. package/dist/utils/resolve-module.d.mts +39 -0
  201. package/dist/utils/resolve-module.mjs +64 -0
  202. package/dist/utils/resolve-module.mjs.map +6 -0
  203. package/dist/utils/resolve-modules.d.mts +25 -0
  204. package/dist/utils/resolve-modules.mjs +26 -0
  205. package/dist/utils/resolve-modules.mjs.map +6 -0
  206. package/dist/{lib → utils}/to-absolute-specifier.d.mts +6 -6
  207. package/dist/utils/to-absolute-specifier.mjs +8 -0
  208. package/dist/utils/to-absolute-specifier.mjs.map +6 -0
  209. package/dist/utils/to-bare-specifier.d.mts +42 -0
  210. package/dist/utils/to-bare-specifier.mjs +90 -0
  211. package/dist/utils/to-bare-specifier.mjs.map +6 -0
  212. package/dist/{lib → utils}/to-data-url.d.mts +6 -5
  213. package/dist/{lib → utils}/to-data-url.mjs +4 -0
  214. package/dist/utils/to-data-url.mjs.map +6 -0
  215. package/dist/utils/to-node-url.d.mts +19 -0
  216. package/dist/utils/to-node-url.mjs +10 -0
  217. package/dist/utils/to-node-url.mjs.map +6 -0
  218. package/dist/{lib → utils}/to-relative-specifier.d.mts +6 -6
  219. package/dist/{lib → utils}/to-relative-specifier.mjs +2 -1
  220. package/dist/utils/to-relative-specifier.mjs.map +6 -0
  221. package/dist/utils/to-url.d.mts +22 -0
  222. package/dist/utils/to-url.mjs +12 -0
  223. package/dist/utils/to-url.mjs.map +6 -0
  224. package/dist/utils/validate-assertions.d.mts +23 -0
  225. package/dist/utils/validate-assertions.mjs +52 -0
  226. package/dist/utils/validate-assertions.mjs.map +6 -0
  227. package/dist/utils/validate-exports.d.mts +24 -0
  228. package/dist/utils/validate-exports.mjs +72 -0
  229. package/dist/utils/validate-exports.mjs.map +6 -0
  230. package/package.json +67 -63
  231. package/changelog.config.cts +0 -204
  232. package/dist/constants.d.mts +0 -21
  233. package/dist/constants.mjs +0 -24
  234. package/dist/enums/kind-syntax.mjs +0 -17
  235. package/dist/interfaces/import-dynamic.mjs +0 -0
  236. package/dist/interfaces/import-static.mjs +0 -0
  237. package/dist/interfaces/options-resolve-alias.mjs +0 -0
  238. package/dist/interfaces/options-resolve.mjs +0 -0
  239. package/dist/interfaces/statement-export.mjs +0 -0
  240. package/dist/interfaces/statement-import.mjs +0 -0
  241. package/dist/interfaces/statement-require.mjs +0 -0
  242. package/dist/interfaces/statement.mjs +0 -0
  243. package/dist/internal/get-compiler-options.d.mts +0 -21
  244. package/dist/internal/get-compiler-options.mjs +0 -14
  245. package/dist/lib/find-static-imports.mjs +0 -25
  246. package/dist/lib/index.d.mts +0 -20
  247. package/dist/lib/index.mjs +0 -34
  248. package/dist/lib/resolve-alias.d.mts +0 -20
  249. package/dist/lib/resolve-alias.mjs +0 -41
  250. package/dist/lib/resolve-aliases.mjs +0 -34
  251. package/dist/lib/resolve-module.d.mts +0 -31
  252. package/dist/lib/resolve-module.mjs +0 -74
  253. package/dist/lib/resolve-modules.d.mts +0 -19
  254. package/dist/lib/resolve-modules.mjs +0 -30
  255. package/dist/lib/to-absolute-specifier.mjs +0 -20
  256. package/dist/lib/to-bare-specifier.d.mts +0 -28
  257. package/dist/lib/to-bare-specifier.mjs +0 -78
  258. package/dist/types/declaration.mjs +0 -0
  259. package/dist/types/mime-type.mjs +0 -0
  260. package/dist/types/module-specifier-type.mjs +0 -0
  261. package/dist/types/syntax-kind-export.mjs +0 -0
  262. package/dist/types/syntax-kind-import.mjs +0 -0
  263. package/dist/types/syntax-kind-require.mjs +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,178 @@
1
+ ## [1.0.0-alpha.7](https://github.com/flex-development/mlly/compare/1.0.0-alpha.6...1.0.0-alpha.7) (2023-01-27)
2
+
3
+
4
+ ### ⚠ BREAKING CHANGES
5
+
6
+ * **utils:** `resolveAlias` ([b4ed0b1](https://github.com/flex-development/mlly/commit/b4ed0b1c0860954c29f3224dde52803cb0198438))
7
+ * **interfaces:** [`Statement`] `specifier_kind` -> `specifier_syntax` ([734edd2](https://github.com/flex-development/mlly/commit/734edd2b87377be49906eecf5d38d5001093872d))
8
+ * **enums:** `SpecifierKind` -> `SpecifierSyntaxKind` ([1a24b13](https://github.com/flex-development/mlly/commit/1a24b13ac020d53de90abf72d427ea9f15b9eeb5))
9
+ * **enums:** `SyntaxKind` -> `StatementSyntaxKind` ([02c1456](https://github.com/flex-development/mlly/commit/02c14566eba3e7f23c260c1b9101ea39ee4b34c7))
10
+ * **utils:** `toBareSpecifier` ([b0caca0](https://github.com/flex-development/mlly/commit/b0caca069ca004f7dc9dfb443fbba43bbcf9fba1))
11
+ * **types:** `MIMEType` -> `MimeType`
12
+ * **exports:** remove subpath `"./lib/*"`
13
+
14
+ ### :package: Build
15
+
16
+ * output `.d.mts` and `.mjs` files separately ([8e05a0d](https://github.com/flex-development/mlly/commit/8e05a0d70ba6bc972947a04bcceb3dd7304bd768))
17
+ * **deps-dev:** bump deps according to `yarn upgrade-interactive` ([9f70d1a](https://github.com/flex-development/mlly/commit/9f70d1aa397ec52738584c08d209472340d8f628))
18
+ * **deps-dev:** Bump esbuild from 0.17.4 to 0.17.5 ([#73](https://github.com/flex-development/mlly/issues/73)) ([e7add8d](https://github.com/flex-development/mlly/commit/e7add8d458d2ba4b04959c6c769d0bdb8e5635bf))
19
+ * **deps-dev:** Bump eslint-plugin-jsdoc from 39.6.8 to 39.6.9 ([#72](https://github.com/flex-development/mlly/issues/72)) ([63d710f](https://github.com/flex-development/mlly/commit/63d710fd2ced0c1003724ab19bc1a08de5137f98))
20
+ * **deps-dev:** bump typescript from 4.9.4 to 5.0.0-dev.20230102 ([f8b753b](https://github.com/flex-development/mlly/commit/f8b753b086be2bbb3506e21e7ecd86d5c94fdc85))
21
+ * **deps-dev:** Bump vercel from 28.13.2 to 28.14.0 ([#71](https://github.com/flex-development/mlly/issues/71)) ([d31fa67](https://github.com/flex-development/mlly/commit/d31fa67cc0df03b42087a698ac2b14c5f05ba682))
22
+ * **deps-dev:** remove vitest patch ([5ccce0b](https://github.com/flex-development/mlly/commit/5ccce0bc4f06871594ede77238db38c11917b0fd))
23
+ * **deps-peer:** add `@types/node>=14.17.0` ([67899e3](https://github.com/flex-development/mlly/commit/67899e3a632bd048f5ec90ce2732bf87b57f873b))
24
+ * **deps:** bump @flex-development/errnode from 1.2.0 to 1.3.0 ([c95b3c8](https://github.com/flex-development/mlly/commit/c95b3c8a8343474840eab1afefb1c0e57a2a3d90))
25
+ * **deps:** bump @flex-development/import-regex from 2.0.0 to 2.0.1 ([e868cae](https://github.com/flex-development/mlly/commit/e868cae9130d68105b35d45e7c750bbf26f824ed))
26
+ * **deps:** bump @flex-development/pathe from 1.0.1 to 1.0.2 ([8954b4a](https://github.com/flex-development/mlly/commit/8954b4aed63e0523964faf1b85b9d9ac07c338bd))
27
+ * **deps:** bump @flex-development/pathe from 1.0.2 to 1.0.3 ([3910fcf](https://github.com/flex-development/mlly/commit/3910fcfb8e778cd5dd0af5a3b355a93378d5e2b8))
28
+ * **deps:** bump @flex-development/tutils from 6.0.0-alpha.7 to 6.0.0-alpha.9 ([3692fbd](https://github.com/flex-development/mlly/commit/3692fbd760e701245b99da401fcb9fd4fda8e7f6))
29
+ * **exports:** remove subpath `"./lib/*"` ([d748039](https://github.com/flex-development/mlly/commit/d74803951eaf1b71d1d3ff3680b52adf63861b8f))
30
+
31
+
32
+ ### :robot: Continuous Integration
33
+
34
+ * [[@dependabot](https://github.com/dependabot)] update ignore list for npm ecosystem ([d500b0a](https://github.com/flex-development/mlly/commit/d500b0ac3764fe27c7e9fe2218edc723f562021f))
35
+ * **deps:** bump actions/cache from 3.2.2 to 3.2.3 ([7781b0f](https://github.com/flex-development/mlly/commit/7781b0f5203e7f625947d78fb85f511a4dc8fa05)), closes [#48](https://github.com/flex-development/mlly/issues/48)
36
+ * **deps:** bump actions/checkout from 3.2.0 to 3.3.0 ([e8719e2](https://github.com/flex-development/mlly/commit/e8719e2b8c3e4631193614b46f99c0fe0f918f67)), closes [#44](https://github.com/flex-development/mlly/issues/44)
37
+ * **deps:** bump actions/setup-node from 3.5.1 to 3.6.0 ([b36ee40](https://github.com/flex-development/mlly/commit/b36ee40e2ef3cd7050fe712a7cdb89ac0701d063)), closes [#43](https://github.com/flex-development/mlly/issues/43)
38
+ * **deps:** bump actions/upload-artifact from 3.1.1 to 3.1.2 ([51db5a6](https://github.com/flex-development/mlly/commit/51db5a694c9d1aadc17b9eda4cd06f3f5e93077a)), closes [#46](https://github.com/flex-development/mlly/issues/46)
39
+ * **deps:** bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 ([47f3668](https://github.com/flex-development/mlly/commit/47f3668649292627bb50d82412789ab3bf036f92)), closes [#67](https://github.com/flex-development/mlly/issues/67)
40
+ * **workflows:** [`add-to-project`] run workflow when pr is synchronized ([06d8846](https://github.com/flex-development/mlly/commit/06d8846efdb681da4b2a2ce6c83df663f266b027))
41
+ * **workflows:** [`approve-pr`] add debug step ([e130bed](https://github.com/flex-development/mlly/commit/e130bedeab8dd640b1a8cf6debdb8e6e1f92cbfb))
42
+ * **workflows:** [`approve-pr`] refactor approval step conditional ([8afe058](https://github.com/flex-development/mlly/commit/8afe0581fb8d61bf21faa1b03b638aad84c8ff27))
43
+ * **workflows:** [`ci`] add `docs` job ([8e9f672](https://github.com/flex-development/mlly/commit/8e9f67249c1e704c3e7aa8f31297170b0b8a3346))
44
+ * **workflows:** [`ci`] add typescript matrix ([659629c](https://github.com/flex-development/mlly/commit/659629cc3b477ecb454914bc82e67080ad171515))
45
+ * **workflows:** [`ci`] make typescript matrix dynamic ([825142e](https://github.com/flex-development/mlly/commit/825142ecd92688ce01ea0d0ee0b6a662dfa29f18))
46
+ * **workflows:** [`ci`] skip workflow run for [@dependabot](https://github.com/dependabot) on `push` ([4e9c1ca](https://github.com/flex-development/mlly/commit/4e9c1cab80c2e7a8909742891eba5cd22b564be4))
47
+ * **workflows:** [`ci`] split ci job into multiple jobs ([70e6ee2](https://github.com/flex-development/mlly/commit/70e6ee20ffd7be96f4c98344d35b627f3a4fc2ec))
48
+ * **workflows:** [`ci`] update codecov config ([635adcd](https://github.com/flex-development/mlly/commit/635adcd3269b2e9ae48b3eb801376ffe5c5458f6))
49
+ * **workflows:** [`dependabot-auto`] sign lockfile fix commit ([a520d77](https://github.com/flex-development/mlly/commit/a520d778317f94800e2b08d622f045b12aa71d38))
50
+ * **workflows:** [`integrity`] update `pull_request` event activity types ([9d5569d](https://github.com/flex-development/mlly/commit/9d5569d2dabdb1c0d9f8aa652743fe7e7888a4c3))
51
+ * **workflows:** [`typescript-canary`] print typescript version ([8bcc613](https://github.com/flex-development/mlly/commit/8bcc613c2b207efffa9964b07c15ffc76a786a5a))
52
+ * **workflows:** [`typescript-canary`] run workflow daily ([22feb88](https://github.com/flex-development/mlly/commit/22feb88b8d1784a3acea5be91f814c8d7ece9b50))
53
+ * **workflows:** add `typescript-canary` ([87d8a0d](https://github.com/flex-development/mlly/commit/87d8a0d46632b95ae0bfecd08659f91a78a8407f))
54
+ * **yarn:** fix typescript matrix testing ([c021970](https://github.com/flex-development/mlly/commit/c021970fa53907c419897aa79f8028bd64d29fd5))
55
+
56
+
57
+ ### :pencil: Documentation
58
+
59
+ * [site] add `/api/enums` ([11682d3](https://github.com/flex-development/mlly/commit/11682d3aa348e5d2cfc674e2ca8f17e4d7929ae5))
60
+ * [site] fix "params" table rendering ([0915c3f](https://github.com/flex-development/mlly/commit/0915c3f6367e263fee2212ac83b4daa57d1b49c0))
61
+ * [site] fix "throws" description rendering ([1bc5801](https://github.com/flex-development/mlly/commit/1bc5801df3a0d8e19186d99219b5cd550ad4f989))
62
+ * [site] fix `@link` and `@linkcode` tag replacements ([e0e2b2f](https://github.com/flex-development/mlly/commit/e0e2b2f6e90a6ebd277b9ad4d1cddf5da57fc0b0))
63
+ * [site] show title-only "throws" sections ([2dcb01b](https://github.com/flex-development/mlly/commit/2dcb01bd3309363b28587da5e752d55d019da6b1))
64
+ * [site] update homepage ([c799a80](https://github.com/flex-development/mlly/commit/c799a809a88d1c82dd6b24c3bb925db4ad81e89f))
65
+ * [site] update vercel install command ([89f407c](https://github.com/flex-development/mlly/commit/89f407cb81b32969bf87b9f18da635438bab7943))
66
+ * **tests:** organize file overviews ([7479aa8](https://github.com/flex-development/mlly/commit/7479aa8df76d17d91d082e55bedbabdaf189be10))
67
+ * **utils:** [`resolveModule`] other differences between node.js ([ae357e8](https://github.com/flex-development/mlly/commit/ae357e8cd949db0ffbb228b34c29446be277e043))
68
+
69
+
70
+ ### :sparkles: Features
71
+
72
+ * **enums:** `AssertType` ([f4ab669](https://github.com/flex-development/mlly/commit/f4ab6691df8f102d5dadba755ccd1dc2f66df16b))
73
+ * **enums:** `Format` ([bd79b6a](https://github.com/flex-development/mlly/commit/bd79b6a059918f83b88a2ebe6789e0d68fbcb7ca))
74
+ * **enums:** `SpecifierKind` ([077a6ab](https://github.com/flex-development/mlly/commit/077a6abd2676fed01e3aa46bafeefd22d2b43ce2))
75
+ * **interfaces:** `FillModuleOptions` ([ffb0481](https://github.com/flex-development/mlly/commit/ffb04816e0788b5802a1880ace3b53fa9d90c10a))
76
+ * **interfaces:** `FindSubpathOptions` ([b5fd706](https://github.com/flex-development/mlly/commit/b5fd7067575007c00f85e17fbe9c4404d21ab941))
77
+ * **interfaces:** `GetFormatOptions` ([0e7e861](https://github.com/flex-development/mlly/commit/0e7e861770b93520967801951bdea5654f4d9922))
78
+ * **interfaces:** `GetSourceOptions` ([dae9081](https://github.com/flex-development/mlly/commit/dae9081166c2af8710faef2b737d45420dd05ce4))
79
+ * **interfaces:** `ImportAssertions` ([7a51c62](https://github.com/flex-development/mlly/commit/7a51c62d68240025402a490b94ab44f14deb2259))
80
+ * **interfaces:** `PackageScope` ([52c16ad](https://github.com/flex-development/mlly/commit/52c16ad141d1956f53d93f057254d2438ce08492))
81
+ * **interfaces:** `ParsedDataUrl` ([529b3c5](https://github.com/flex-development/mlly/commit/529b3c5093f85b03351dbdb95dbe3f9277a884fb))
82
+ * **interfaces:** `ParsedModuleId` ([194b14e](https://github.com/flex-development/mlly/commit/194b14ef0fc047190980c3b92f48b9e5c53832fb))
83
+ * **interfaces:** `ParsedSubpath` ([7bc8031](https://github.com/flex-development/mlly/commit/7bc803152d8b57116d5fa2fdaa67096e09a13f64))
84
+ * **interfaces:** `ParseModuleIdOptions` ([97ee265](https://github.com/flex-development/mlly/commit/97ee26526c89e5a42d7a64431a4a3d49127414df))
85
+ * **interfaces:** `ParseSubpathOptions` ([f5150fd](https://github.com/flex-development/mlly/commit/f5150fd322b3b96e919756d4e0a4aa0143a0ef58))
86
+ * **interfaces:** `Statement#specifier_kind` ([db39187](https://github.com/flex-development/mlly/commit/db39187d5883890fafcf1b3a9827c2ca6811e477))
87
+ * **internal:** `ENCODED_SEP_REGEX` ([22ff22f](https://github.com/flex-development/mlly/commit/22ff22f48113b9c3570ad5b982a300fe3b079734))
88
+ * **internal:** `escapeRegExp` ([f00836b](https://github.com/flex-development/mlly/commit/f00836b8a1d6ef94917ea0b39884585b1a29de31))
89
+ * **internal:** `FORMAT_TYPE_MAP` ([a442b8d](https://github.com/flex-development/mlly/commit/a442b8d3a4fccde4814a6437f9cfaf1a3e9797e4))
90
+ * **internal:** `getSpecifierKind` ([be30ba7](https://github.com/flex-development/mlly/commit/be30ba71f28f1bd677ffc251d3c578e2ffa37c62))
91
+ * **internal:** `getSubpaths` ([f9f5f37](https://github.com/flex-development/mlly/commit/f9f5f37d2703e6b2dd1d7469a5ffa92a01cba308))
92
+ * **internal:** `INTERNAL_SPECIFIER_REGEX` ([6f1b8be](https://github.com/flex-development/mlly/commit/6f1b8be5ea341c279c57176d1af8eb9effca0c7a))
93
+ * **internal:** `isArrayIndex` ([c4793a0](https://github.com/flex-development/mlly/commit/c4793a0f815aefd13f0f0fc20cab32d8dfd42dcc))
94
+ * **internal:** `isDirectory` ([ec91d08](https://github.com/flex-development/mlly/commit/ec91d08a8c4418a3c510dbc55e07d59293670bc0))
95
+ * **internal:** `isFile` ([d06b9ac](https://github.com/flex-development/mlly/commit/d06b9acae46eada86fd866b09c316d61d04ca69d))
96
+ * **internal:** `isFunction` ([e01911a](https://github.com/flex-development/mlly/commit/e01911af8417177b24bd9d42a2c05d1eb70ea3cc))
97
+ * **internal:** `PACKAGE_NAME_REGEX` ([3f43f95](https://github.com/flex-development/mlly/commit/3f43f950321006997853231a5054e878d375fdd1))
98
+ * **internal:** `PACKAGE_PATH_REGEX` ([375f356](https://github.com/flex-development/mlly/commit/375f356811b2f3537436000d23b0414aa59164d4))
99
+ * **internal:** `Resolver` ([4c4f900](https://github.com/flex-development/mlly/commit/4c4f900d918c01f05ff69f9d998c0d8510530d41))
100
+ * **internal:** `validateBoolean` ([76166af](https://github.com/flex-development/mlly/commit/76166af9edb580d7271f2a60c3b052767c4b5e54))
101
+ * **internal:** `validateObject` ([c961376](https://github.com/flex-development/mlly/commit/c961376bd3ec592adea916e49d186021859e1f12))
102
+ * **internal:** `validateSet` ([d9b6595](https://github.com/flex-development/mlly/commit/d9b6595a45ba7e2644914b2d63b0b8e149d63165))
103
+ * **internal:** `validateString` ([c66025d](https://github.com/flex-development/mlly/commit/c66025d576c4f37f44944517ff9787d9946696d0))
104
+ * **internal:** `validateURLString` ([ba49e9b](https://github.com/flex-development/mlly/commit/ba49e9b03af440d5d07393c8d1b19dacaafba3fa))
105
+ * **types:** `ChangeExtFn` ([b906e6b](https://github.com/flex-development/mlly/commit/b906e6b30c47cde9628788c9280582d693c00c6a))
106
+ * **types:** `Format` ([5cb0b1b](https://github.com/flex-development/mlly/commit/5cb0b1b074fdee44ea03e32b4128780afbe86667))
107
+ * **types:** `ModuleId` ([1f3a500](https://github.com/flex-development/mlly/commit/1f3a500b96f43ea055bccdcb6815bc8e697dc140))
108
+ * **types:** `Protocol` ([6380ea8](https://github.com/flex-development/mlly/commit/6380ea8869a9ac540a517ff6cedb8be36d6f73d4))
109
+ * **utils:** `compareSubpaths` ([66f2137](https://github.com/flex-development/mlly/commit/66f2137ef8b938a84c7d273bdc45299de14073b0))
110
+ * **utils:** `EXTENSION_FORMAT_MAP` ([d4720d7](https://github.com/flex-development/mlly/commit/d4720d703b64fe623f95cb811a006c390806e8c6))
111
+ * **utils:** `fillModules` ([7b9d1e7](https://github.com/flex-development/mlly/commit/7b9d1e7874e2f43b91f90963c26c83c7bc651e25))
112
+ * **utils:** `findSubpath` ([4fd48f6](https://github.com/flex-development/mlly/commit/4fd48f6ab8415d50214de5d10ff608152bc8c6b8))
113
+ * **utils:** `getFormat` ([a1cae6f](https://github.com/flex-development/mlly/commit/a1cae6f80c88c007d7ac4736de54454d17192d84))
114
+ * **utils:** `getSource` ([017eadb](https://github.com/flex-development/mlly/commit/017eadb7b2d58eac080dfe4865dc597671ede992))
115
+ * **utils:** `isAbsoluteSpecifier` ([4bd443c](https://github.com/flex-development/mlly/commit/4bd443ce9391fc6dcf1889edb9c3a7c6ef7768b7))
116
+ * **utils:** `isBareSpecifier` ([feda82b](https://github.com/flex-development/mlly/commit/feda82b8a088bf9b889e20f92c614d810acbe14f))
117
+ * **utils:** `isExportsSugar` ([0c9f954](https://github.com/flex-development/mlly/commit/0c9f954cf69b6dfbf821fdee8966f2b0a31de759))
118
+ * **utils:** `isRelativeSpecifier` ([92b8846](https://github.com/flex-development/mlly/commit/92b8846acefed82187afef8503bf5e7c4cbb953f))
119
+ * **utils:** `lookupPackageScope` ([46cb852](https://github.com/flex-development/mlly/commit/46cb8524c01528cf8310caab7944e6704d66ea97))
120
+ * **utils:** `parseDataURL` ([93fd382](https://github.com/flex-development/mlly/commit/93fd38292d07961425f6b394018578fb9933320e))
121
+ * **utils:** `parseModuleId` ([a315dd0](https://github.com/flex-development/mlly/commit/a315dd0aef9238fb107ea07ad27214838e144451))
122
+ * **utils:** `parseSubpath` ([8479781](https://github.com/flex-development/mlly/commit/84797816490736fc2078ff34f42b2cf1f43e31a2))
123
+ * **utils:** `PATTERN_CHARACTER` ([7a8f04b](https://github.com/flex-development/mlly/commit/7a8f04bc06a281c6357dc14f3e8af9f63678ca60))
124
+ * **utils:** `readPackageJson` ([b2f9a18](https://github.com/flex-development/mlly/commit/b2f9a180f0bce61215ac2d23d4be83a91b657f81))
125
+ * **utils:** `toNodeURL` ([a536567](https://github.com/flex-development/mlly/commit/a536567dbd177a033b5e40069009dadbfc06ab30))
126
+ * **utils:** `toURL` ([165d8b0](https://github.com/flex-development/mlly/commit/165d8b0695c85b956e06ddf8a8d0c08f7d58a9a0))
127
+ * **utils:** `validateAssertions` ([61e9769](https://github.com/flex-development/mlly/commit/61e9769ef7d9471e7c7732faa955a8c21a23b877))
128
+ * **utils:** `validateExports` ([a2b14ea](https://github.com/flex-development/mlly/commit/a2b14ea2341ea1044be71e11fffd36619e6fdb83))
129
+
130
+
131
+ ### :bug: Fixes
132
+
133
+ * **ts:** `Type '{ '.' Exports | undefined; }' is not assignable to type 'Exports | undefined'` ([de20179](https://github.com/flex-development/mlly/commit/de20179e1b9d9ec68a426814999a9304f9fa2e73))
134
+ * **ts:** missing types in build output ([a5d2226](https://github.com/flex-development/mlly/commit/a5d2226c352269795399bc14742e49c845c955f6))
135
+ * **utils:** specifier replacement ([e29520b](https://github.com/flex-development/mlly/commit/e29520bf74cbba11c567cc13257a84252777403a))
136
+
137
+
138
+ ### :house_with_garden: Housekeeping
139
+
140
+ * fix lint-staged config ([bda813d](https://github.com/flex-development/mlly/commit/bda813db0922faa93d0543e34d11e290bbd52967))
141
+ * project qa ([d3a571d](https://github.com/flex-development/mlly/commit/d3a571d38626b0cfd2affb3987bd583813bd9b35))
142
+ * update eslint config ([b1d716c](https://github.com/flex-development/mlly/commit/b1d716cb29c95734f974e703fe88f4d150827abf))
143
+ * update project architecture ([60b2c77](https://github.com/flex-development/mlly/commit/60b2c771614cc13e892a8814ad644d6095112ba4))
144
+ * update project architecture ([7d0571b](https://github.com/flex-development/mlly/commit/7d0571bb660770640963d7ec550d91b7aa6c7a0d))
145
+ * **esm:** use package in custom loader ([a6e07d0](https://github.com/flex-development/mlly/commit/a6e07d0487b2734bc1dac6bcd22c6ff2b3e09380))
146
+ * **github:** add "typescript version" input to bug report template ([d6de153](https://github.com/flex-development/mlly/commit/d6de15302d1355a7ffbb680b4059fb42a0b6a0af))
147
+ * **github:** add commit scope `utils` ([4af0c3d](https://github.com/flex-development/mlly/commit/4af0c3d3c0ca38594683586948524faa316ddaf8))
148
+ * **github:** add label `scope:utils` ([169ec14](https://github.com/flex-development/mlly/commit/169ec14abcd9735a8c00e1ce76b5c33f3e0f01cf))
149
+ * **github:** configure sponsor button ([b9e4bf5](https://github.com/flex-development/mlly/commit/b9e4bf5d5a73ce467ed1047737ff8fe9b9de9248))
150
+ * **github:** set `LINT_STAGED` before running `lint-staged` ([4c49124](https://github.com/flex-development/mlly/commit/4c49124b454e7776d7dc11b34482756bca7ef35e))
151
+ * **pkg:** update keywords ([8ddf224](https://github.com/flex-development/mlly/commit/8ddf224485aa19b8ad706f0b3b8c0bdbba3151ed))
152
+ * **tests:** update codecov config ([226b49c](https://github.com/flex-development/mlly/commit/226b49c712ae56dc3f09bd0016df0edc34608900))
153
+ * **tests:** update lint-staged integration ([9b6b530](https://github.com/flex-development/mlly/commit/9b6b53076be0e2240cf8dec3fcb08cef45527cc9))
154
+ * **vscode:** update settings ([aac433c](https://github.com/flex-development/mlly/commit/aac433c9d42d9794b2fd9303df331f8ee70b0786))
155
+
156
+
157
+ ### :zap: Refactors
158
+
159
+ * move constants to `utils` dir ([e6db385](https://github.com/flex-development/mlly/commit/e6db385058fc810e7be6bb79acac9c7e92bc7aaa))
160
+ * rename `lib` directory to `utils` ([c84a231](https://github.com/flex-development/mlly/commit/c84a23160738d322e8db7bd1b2a0927efefc1c2f))
161
+ * **enums:** `SpecifierKind` -> `SpecifierSyntaxKind` ([1a24b13](https://github.com/flex-development/mlly/commit/1a24b13ac020d53de90abf72d427ea9f15b9eeb5))
162
+ * **enums:** `SyntaxKind` -> `StatementSyntaxKind` ([02c1456](https://github.com/flex-development/mlly/commit/02c14566eba3e7f23c260c1b9101ea39ee4b34c7))
163
+ * **esm:** improve loaders compatibility ([505e211](https://github.com/flex-development/mlly/commit/505e211531ed6b216567d2b156b42637d292579f))
164
+ * **interfaces:** [`Statement`] `specifier_kind` -> `specifier_syntax` ([734edd2](https://github.com/flex-development/mlly/commit/734edd2b87377be49906eecf5d38d5001093872d))
165
+ * **internal:** [`validateString`] convert to type guard ([789f2cf](https://github.com/flex-development/mlly/commit/789f2cf7c2ecf27fed86f64640c6c7806ef257f9))
166
+ * **ts:** catch build output errors early ([7cb4c38](https://github.com/flex-development/mlly/commit/7cb4c3899387b67f9d7c9b160e091da9e9613403))
167
+ * **types:** `MIMEType` -> `MimeType` ([1df5622](https://github.com/flex-development/mlly/commit/1df56226dfdc6534b40c64d1b33e6ab57b13c901))
168
+ * **utils:** `resolveAlias` ([b4ed0b1](https://github.com/flex-development/mlly/commit/b4ed0b1c0860954c29f3224dde52803cb0198438))
169
+ * **utils:** `toBareSpecifier` ([b0caca0](https://github.com/flex-development/mlly/commit/b0caca069ca004f7dc9dfb443fbba43bbcf9fba1))
170
+
171
+
172
+ ### :white_check_mark: Testing
173
+
174
+ * **utils:** [`findStaticImports`] 100% isolated coverage ([aca9212](https://github.com/flex-development/mlly/commit/aca9212bf77bfc58b5a050d136cafd622866526f))
175
+
1
176
  ## [1.0.0-alpha.6](https://github.com/flex-development/mlly/compare/1.0.0-alpha.5...1.0.0-alpha.6) (2022-12-26)
2
177
 
3
178
 
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # mlly
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/@flex-development/mlly.svg)](https://npmjs.com/package/@flex-development/mlly)
4
- [![codecov](https://codecov.io/gh/flex-development/mlly/branch/main/graph/badge.svg?token=R2TPEBGWXB)](https://codecov.io/gh/flex-development/mlly)
4
+ [![codecov](https://codecov.io/gh/flex-development/mlly/branch/main/graph/badge.svg?token=36NUNRH6FW)](https://codecov.io/gh/flex-development/mlly)
5
5
  [![license](https://img.shields.io/github/license/flex-development/mlly.svg)](LICENSE.md)
6
6
  [![module type: esm](https://img.shields.io/badge/module%20type-esm-brightgreen)](https://github.com/voxpelli/badges-cjs-esm)
7
7
  [![conventional commits](https://img.shields.io/badge/-conventional%20commits-fe5196?logo=conventional-commits&logoColor=ffffff)](https://conventionalcommits.org/)
@@ -0,0 +1,404 @@
1
+ /**
2
+ * @file Changelog Configuration
3
+ * @module config/changelog
4
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits
5
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core
6
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer
7
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-parser
8
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/git-raw-commits
9
+ */
10
+
11
+ import pathe from '@flex-development/pathe'
12
+ import { CompareResult, isNIL } from '@flex-development/tutils'
13
+ import addStream from 'add-stream'
14
+ import conventionalChangelog from 'conventional-changelog'
15
+ import type { Options } from 'conventional-changelog-core'
16
+ import type {
17
+ CommitGroup,
18
+ GeneratedContext
19
+ } from 'conventional-changelog-writer'
20
+ import type { Commit, ICommit } from 'conventional-commits-parser'
21
+ import dateformat from 'dateformat'
22
+ import type mri from 'mri'
23
+ import {
24
+ createReadStream,
25
+ createWriteStream,
26
+ readFileSync,
27
+ type ReadStream,
28
+ type WriteStream
29
+ } from 'node:fs'
30
+ import type { Readable } from 'node:stream'
31
+ import sade from 'sade'
32
+ import semver from 'semver'
33
+ import tempfile from 'tempfile'
34
+ import pkg from './package.json' assert { type: 'json' }
35
+
36
+ /**
37
+ * CLI flags.
38
+ */
39
+ interface Flags {
40
+ /**
41
+ * Output unreleased changelog.
42
+ *
43
+ * To the set the current version, pass a string value.
44
+ *
45
+ * @example
46
+ * '1.0.0-alpha.7'
47
+ * @example
48
+ * true
49
+ *
50
+ * @default true
51
+ */
52
+ 'output-unreleased'?: boolean | string
53
+
54
+ /**
55
+ * Number of releases to be generated.
56
+ *
57
+ * If `0`, the changelog will be regenerated and the output file will be
58
+ * overwritten.
59
+ *
60
+ * @default 1
61
+ */
62
+ 'release-count'?: number
63
+
64
+ /**
65
+ * Output content to {@linkcode infile}.
66
+ *
67
+ * @default false
68
+ */
69
+ 'same-file'?: boolean
70
+
71
+ /**
72
+ * Enable verbose output.
73
+ *
74
+ * @default false
75
+ */
76
+ debug?: boolean
77
+
78
+ /**
79
+ * Read CHANGELOG from this file.
80
+ */
81
+ infile?: string
82
+
83
+ /**
84
+ * Write content to this file.
85
+ *
86
+ * **Note**: Requires {@linkcode write} to be `true`.
87
+ */
88
+ outfile?: string
89
+
90
+ /**
91
+ * Write content to file instead of {@linkcode process.stdout}.
92
+ *
93
+ * @default false
94
+ */
95
+ write?: boolean
96
+ }
97
+
98
+ sade('changelog', true)
99
+ .option('-d, --debug', 'Enable verbose output', false)
100
+ .option('-i, --infile', 'Read CHANGELOG from this file')
101
+ .option('-o, --outfile', 'Write content to this file (requires --write)')
102
+ .option('-r, --release-count', 'Number of releases to be generated', 1)
103
+ .option('-s, --same-file', 'Output content to infile', false)
104
+ .option('-u, --output-unreleased', 'Output unreleased changelog')
105
+ .option('-w, --write', 'Write content to file', false)
106
+ .action((flags: mri.Argv<Flags>): void => {
107
+ const {
108
+ 'release-count': releaseCount = 1,
109
+ debug = false,
110
+ write = false
111
+ } = flags
112
+ let {
113
+ 'output-unreleased': outputUnreleased = true,
114
+ infile,
115
+ 'same-file': samefile,
116
+ outfile
117
+ } = flags
118
+
119
+ // convert possible 'false' or 'true' to boolean value
120
+ if (outputUnreleased === 'false' || outputUnreleased === 'true') {
121
+ outputUnreleased = JSON.parse(outputUnreleased)
122
+ }
123
+
124
+ /**
125
+ * Regex used to extract a release version from a string containing
126
+ * Git tags.
127
+ *
128
+ * @const {RegExp} vgx
129
+ */
130
+ const vgx: RegExp = pkg.tagPrefix
131
+ ? new RegExp(`tag:\\s*[=]?${pkg.tagPrefix}(.+?)[,)]`, 'gi')
132
+ : /tag:\s*[=v]?(.+?)[),]/gi
133
+
134
+ /**
135
+ * Changelog content stream.
136
+ *
137
+ * @const {Readable} changelog
138
+ */
139
+ const changelog: Readable = conventionalChangelog(
140
+ {
141
+ append: false,
142
+ debug: debug ? console.debug.bind(console) : undefined,
143
+ outputUnreleased:
144
+ typeof outputUnreleased === 'boolean'
145
+ ? outputUnreleased
146
+ : typeof outputUnreleased === 'string'
147
+ ? !!outputUnreleased.trim()
148
+ : false,
149
+ pkg: { path: pathe.resolve('package.json') },
150
+ // @ts-expect-error ts(2322)
151
+ preset: {
152
+ header: '',
153
+ name: 'conventionalcommits',
154
+ releaseCommitMessageFormat: 'release: {{currentTag}}',
155
+ types: [
156
+ { section: ':package: Build', type: 'build' },
157
+ { section: ':house_with_garden: Housekeeping', type: 'chore' },
158
+ { section: ':robot: Continuous Integration', type: 'ci' },
159
+ { section: ':pencil: Documentation', type: 'docs' },
160
+ { section: ':sparkles: Features', type: 'feat' },
161
+ { section: ':bug: Fixes', type: 'fix' },
162
+ { section: ':fire: Performance Improvements', type: 'perf' },
163
+ { section: ':zap: Refactors', type: 'refactor' },
164
+ { section: ':rewind: Reverts', type: 'revert' },
165
+ { hidden: true, type: 'style' },
166
+ { section: ':white_check_mark: Testing', type: 'test' },
167
+ { hidden: true, type: 'wip' }
168
+ ]
169
+ },
170
+ releaseCount,
171
+ skipUnstable: false,
172
+ tagPrefix: pkg.tagPrefix,
173
+ /**
174
+ * Raw commit transformer.
175
+ *
176
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core#transform-1
177
+ * @see https://github.com/conventional-changelog/conventional-changelog/issues/415
178
+ *
179
+ * @param {Commit} commit - Commit object
180
+ * @param {Options.Transform.Callback} apply - Commit handler
181
+ * @return {void} Nothing when complete
182
+ */
183
+ transform(commit: Commit, apply: Options.Transform.Callback): void {
184
+ return void apply(null, {
185
+ ...commit,
186
+ committerDate: dateformat(
187
+ commit.committerDate!,
188
+ 'yyyy-mm-dd',
189
+ true
190
+ ),
191
+ mentions: commit.mentions.filter(m => m !== 'flexdevelopment'),
192
+ // @ts-expect-error ts(2322)
193
+ raw: commit,
194
+ references: commit.references.filter(ref => ref.action !== null),
195
+ shortHash: commit.hash!.slice(0, 7),
196
+ version: commit.gitTags ? vgx.exec(commit.gitTags)?.[1] : undefined
197
+ })
198
+ }
199
+ },
200
+ {},
201
+ {},
202
+ {
203
+ issuePrefixesCaseSensitive: true
204
+ },
205
+ {
206
+ /**
207
+ * Sorts commit groups in descending order by group title.
208
+ *
209
+ * GitHub emojis in titles will be ignored.
210
+ *
211
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#commitgroupssort
212
+ *
213
+ * @param {CommitGroup} a - Commit group object
214
+ * @param {CommitGroup} b - Commit group object to compare to `a`
215
+ * @return {number} Compare result
216
+ */
217
+ commitGroupsSort(a: CommitGroup, b: CommitGroup): number {
218
+ if (a.title === false) return CompareResult.GREATER_THAN
219
+ if (b.title === false) return CompareResult.LESS_THAN
220
+
221
+ /**
222
+ * Regex used to extract commit group titles without GitHub emojis.
223
+ *
224
+ * @const {RegExp} tgx - Regex used to extract commit group title
225
+ */
226
+ const tgx: RegExp = /([A-Z])\w+/
227
+
228
+ return tgx.exec(a.title)![0]!.localeCompare(tgx.exec(b.title)![0]!)
229
+ },
230
+ /**
231
+ * Sorts commits in descending order by commit header and date.
232
+ *
233
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#commitssort
234
+ *
235
+ * @param {ICommit} a - Commit object
236
+ * @param {ICommit} b - Commit object to compare to `b`
237
+ * @return {number} Compare result
238
+ */
239
+ commitsSort(a: ICommit, b: ICommit): number {
240
+ /**
241
+ * Compare result for {@linkcode b.committerDate} and
242
+ * {@linkcode a.committerDate}.
243
+ *
244
+ * @const {number} by_date
245
+ */
246
+ const by_date: number =
247
+ new Date(b.committerDate).getTime() -
248
+ new Date(a.committerDate).getTime()
249
+
250
+ return a.header && b.header
251
+ ? a.header.localeCompare(b.header) || by_date
252
+ : by_date
253
+ },
254
+ /**
255
+ * Modifies `context` before the changelog is generated.
256
+ *
257
+ * This includes:
258
+ *
259
+ * - Setting the current and previous release tags
260
+ * - Setting the release date
261
+ * - Determining patch release state
262
+ * - Determining if compare links should be generated
263
+ *
264
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core#finalizecontext
265
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#finalizecontext
266
+ *
267
+ * @param {GeneratedContext} context - Generated changelog context
268
+ * @param {Options} options - `conventional-changelog-core` options
269
+ * @param {ICommit[]} commits - Commits for release
270
+ * @param {ICommit | undefined} key - Release commit
271
+ * @return {GeneratedContext} Final changelog context
272
+ */
273
+ finalizeContext(
274
+ context: GeneratedContext,
275
+ options: Options,
276
+ commits: ICommit[],
277
+ key: ICommit | undefined
278
+ ): GeneratedContext {
279
+ const { gitSemverTags = [], isPatch, linkCompare, version } = context
280
+ let { currentTag, previousTag } = context
281
+
282
+ /**
283
+ * First commit in release.
284
+ *
285
+ * @const {ICommit | undefined} first_commit
286
+ */
287
+ const first_commit: ICommit | undefined = commits.at(0)
288
+
289
+ /**
290
+ * Last commit in release.
291
+ *
292
+ * @const {ICommit | undefined} last_commit
293
+ */
294
+ const last_commit: ICommit | undefined = commits.at(-1)
295
+
296
+ // set current and previous tags
297
+ if (key && (!currentTag || !previousTag)) {
298
+ currentTag = key.version ?? undefined
299
+
300
+ // try setting previous tag based on current tag
301
+ if (gitSemverTags.includes(currentTag ?? '')) {
302
+ const { version } = key
303
+ previousTag = gitSemverTags[gitSemverTags.indexOf(version!) + 1]
304
+ if (!previousTag) previousTag = last_commit?.hash ?? undefined
305
+ }
306
+ } else {
307
+ currentTag = /^unreleased$/i.test(version ?? '')
308
+ ? currentTag ??
309
+ (typeof outputUnreleased === 'string' && outputUnreleased
310
+ ? outputUnreleased
311
+ : first_commit?.hash ?? undefined)
312
+ : !currentTag && version
313
+ ? pkg.tagPrefix + version
314
+ : currentTag ?? version
315
+ previousTag = previousTag ?? gitSemverTags[0]
316
+ }
317
+
318
+ // set release date
319
+ context.date =
320
+ key?.committerDate ?? dateformat(new Date(), 'yyyy-mm-dd', true)
321
+
322
+ // determine patch release state
323
+ if (version && semver.valid(version)) {
324
+ context.isPatch = isPatch ?? semver.patch(version) !== 0
325
+ }
326
+
327
+ // @ts-expect-error ts(2322)
328
+ return {
329
+ ...context,
330
+ currentTag,
331
+ linkCompare: isNIL(linkCompare) && !!currentTag && !!previousTag,
332
+ previousTag,
333
+ repoUrl: pkg.repository.slice(0, -4)
334
+ }
335
+ },
336
+ headerPartial: readFileSync('templates/changelog/header.hbs', 'utf8'),
337
+ ignoreReverted: false
338
+ }
339
+ ).on('error', err => console.error(err.stack))
340
+
341
+ // override samefile if infile and outfile are the same file
342
+ if (infile && infile === outfile) samefile = true
343
+
344
+ // reset outfile if changelog should be output to infile
345
+ if (samefile) outfile = infile = infile ?? 'CHANGELOG.md'
346
+
347
+ /**
348
+ * Creates a file writer.
349
+ *
350
+ * If writing to file is disabled, {@linkcode process.stdout} will be used
351
+ * to write content to the terminal.
352
+ *
353
+ * Otherwise, {@linkcode createWriteStream} will be used to create a stream
354
+ * for {@linkcode outfile}.
355
+ *
356
+ * @see {@linkcode NodeJS.WriteStream}
357
+ * @see {@linkcode WriteStream}
358
+ * @see {@linkcode createWriteStream}
359
+ *
360
+ * @return {WriteStream | (NodeJS.WriteStream & { fd: 1 })} File writer
361
+ */
362
+ const writer = (): WriteStream | (NodeJS.WriteStream & { fd: 1 }) => {
363
+ return write && outfile ? createWriteStream(outfile) : process.stdout
364
+ }
365
+
366
+ // write changelog to infile, outfile, or stdout
367
+ switch (true) {
368
+ case infile && releaseCount !== 0:
369
+ /**
370
+ * Changelog file stream.
371
+ *
372
+ * @const {ReadStream} rs
373
+ */
374
+ const rs: ReadStream = createReadStream(infile!).on('error', () => {
375
+ if (debug) console.error('infile does not exist.')
376
+ if (samefile) changelog.pipe(writer())
377
+ })
378
+
379
+ // write changelog to infile or stdout
380
+ if (samefile) {
381
+ /**
382
+ * Absolute path to random temporary file.
383
+ *
384
+ * @const {string} tmp
385
+ */
386
+ const tmp: string = tempfile()
387
+
388
+ changelog
389
+ .pipe(addStream(rs))
390
+ .pipe(createWriteStream(tmp))
391
+ .on('finish', () => createReadStream(tmp).pipe(writer()))
392
+ } else {
393
+ changelog.pipe(addStream(rs)).pipe(writer())
394
+ }
395
+
396
+ break
397
+ default:
398
+ changelog.pipe(writer())
399
+ break
400
+ }
401
+
402
+ return void 0
403
+ })
404
+ .parse(process.argv)
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @file Enums - AssertType
3
+ * @module mlly/enums/AssertType
4
+ */
5
+ /**
6
+ * `import` assertion types.
7
+ *
8
+ * ::: info
9
+ * It's unclear whether or not the HTML spec will require assertion types for
10
+ * WebAssembly modules.
11
+ * :::
12
+ *
13
+ * @see https://github.com/WebAssembly/esm-integration/issues/42
14
+ *
15
+ * @enum {Lowercase<string>}
16
+ */
17
+ declare enum AssertType {
18
+ IMPLICIT = "javascript",
19
+ JSON = "json"
20
+ }
21
+ export default AssertType;
@@ -0,0 +1,10 @@
1
+ var AssertType = /* @__PURE__ */ ((AssertType2) => {
2
+ AssertType2["IMPLICIT"] = "javascript";
3
+ AssertType2["JSON"] = "json";
4
+ return AssertType2;
5
+ })(AssertType || {});
6
+ var assert_type_default = AssertType;
7
+ export {
8
+ assert_type_default as default
9
+ };
10
+ //# sourceMappingURL=assert-type.mjs.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/enums/assert-type.ts"],
4
+ "mappings": "AAiBA,IAAK,aAAL,kBAAKA,gBAAL;AACE,EAAAA,YAAA,cAAW;AACX,EAAAA,YAAA,UAAO;AAFJ,SAAAA;AAAA,GAAA;AAKL,IAAO,sBAAQ;",
5
+ "names": ["AssertType"]
6
+ }