@flex-development/mlly 1.0.0-alpha.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 (81) hide show
  1. package/CHANGELOG.md +149 -0
  2. package/LICENSE.md +28 -0
  3. package/README.md +17 -0
  4. package/changelog.config.cts +204 -0
  5. package/dist/constants.d.mts +19 -0
  6. package/dist/constants.mjs +24 -0
  7. package/dist/index.d.mts +8 -0
  8. package/dist/index.mjs +4 -0
  9. package/dist/interfaces/import-dynamic.d.mts +23 -0
  10. package/dist/interfaces/import-dynamic.mjs +0 -0
  11. package/dist/interfaces/import-static.d.mts +19 -0
  12. package/dist/interfaces/import-static.mjs +0 -0
  13. package/dist/interfaces/index.d.mts +12 -0
  14. package/dist/interfaces/index.mjs +0 -0
  15. package/dist/interfaces/options-resolve-alias.d.mts +69 -0
  16. package/dist/interfaces/options-resolve-alias.mjs +0 -0
  17. package/dist/interfaces/options-resolve.d.mts +60 -0
  18. package/dist/interfaces/options-resolve.mjs +0 -0
  19. package/dist/interfaces/statement-export.d.mts +31 -0
  20. package/dist/interfaces/statement-export.mjs +0 -0
  21. package/dist/interfaces/statement-import.d.mts +27 -0
  22. package/dist/interfaces/statement-import.mjs +0 -0
  23. package/dist/interfaces/statement-require.d.mts +27 -0
  24. package/dist/interfaces/statement-require.mjs +0 -0
  25. package/dist/interfaces/statement.d.mts +33 -0
  26. package/dist/interfaces/statement.mjs +0 -0
  27. package/dist/internal/compiler-options-json.d.mts +111 -0
  28. package/dist/internal/compiler-options-json.mjs +0 -0
  29. package/dist/internal/constants.d.mts +70 -0
  30. package/dist/internal/constants.mjs +18 -0
  31. package/dist/internal/get-compiler-options.d.mts +21 -0
  32. package/dist/internal/get-compiler-options.mjs +14 -0
  33. package/dist/internal/index.d.mts +7 -0
  34. package/dist/internal/index.mjs +5 -0
  35. package/dist/lib/detect-syntax.d.mts +21 -0
  36. package/dist/lib/detect-syntax.mjs +11 -0
  37. package/dist/lib/extract-statements.d.mts +21 -0
  38. package/dist/lib/extract-statements.mjs +18 -0
  39. package/dist/lib/find-dynamic-imports.d.mts +15 -0
  40. package/dist/lib/find-dynamic-imports.mjs +20 -0
  41. package/dist/lib/find-exports.d.mts +15 -0
  42. package/dist/lib/find-exports.mjs +53 -0
  43. package/dist/lib/find-requires.d.mts +17 -0
  44. package/dist/lib/find-requires.mjs +19 -0
  45. package/dist/lib/find-static-imports.d.mts +15 -0
  46. package/dist/lib/find-static-imports.mjs +20 -0
  47. package/dist/lib/has-cjs-syntax.d.mts +22 -0
  48. package/dist/lib/has-cjs-syntax.mjs +6 -0
  49. package/dist/lib/has-esm-syntax.d.mts +18 -0
  50. package/dist/lib/has-esm-syntax.mjs +6 -0
  51. package/dist/lib/index.d.mts +20 -0
  52. package/dist/lib/index.mjs +34 -0
  53. package/dist/lib/resolve-alias.d.mts +20 -0
  54. package/dist/lib/resolve-alias.mjs +41 -0
  55. package/dist/lib/resolve-aliases.d.mts +17 -0
  56. package/dist/lib/resolve-aliases.mjs +34 -0
  57. package/dist/lib/resolve-module.d.mts +31 -0
  58. package/dist/lib/resolve-module.mjs +74 -0
  59. package/dist/lib/resolve-modules.d.mts +19 -0
  60. package/dist/lib/resolve-modules.mjs +29 -0
  61. package/dist/lib/to-absolute-specifier.d.mts +22 -0
  62. package/dist/lib/to-absolute-specifier.mjs +20 -0
  63. package/dist/lib/to-bare-specifier.d.mts +28 -0
  64. package/dist/lib/to-bare-specifier.mjs +78 -0
  65. package/dist/lib/to-data-url.d.mts +29 -0
  66. package/dist/lib/to-data-url.mjs +7 -0
  67. package/dist/lib/to-relative-specifier.d.mts +22 -0
  68. package/dist/lib/to-relative-specifier.mjs +17 -0
  69. package/dist/types/declaration.d.mts +9 -0
  70. package/dist/types/declaration.mjs +0 -0
  71. package/dist/types/ext.d.mts +9 -0
  72. package/dist/types/ext.mjs +0 -0
  73. package/dist/types/index.d.mts +9 -0
  74. package/dist/types/index.mjs +0 -0
  75. package/dist/types/mime-type.d.mts +11 -0
  76. package/dist/types/mime-type.mjs +0 -0
  77. package/dist/types/specifier-type.d.mts +11 -0
  78. package/dist/types/specifier-type.mjs +0 -0
  79. package/dist/types/statement-type.d.mts +9 -0
  80. package/dist/types/statement-type.mjs +0 -0
  81. package/package.json +197 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,149 @@
1
+ ## 1.0.0-alpha.1 (2022-11-06)
2
+
3
+
4
+ ### :package: Build
5
+
6
+ * cleanup build target settings ([b809be9](https://github.com/flex-development/mlly/commit/b809be9934c6661c98bdcfd3a568e7d34c0fe445))
7
+ * remove `src` files from distribution ([0603ebe](https://github.com/flex-development/mlly/commit/0603ebefae0002c13f7d255ff2cc20cdf4057c7e))
8
+ * require node `>=14.16` ([cd0dda9](https://github.com/flex-development/mlly/commit/cd0dda9dfae0bd205875f34d8fd8f2022e36d303))
9
+ * **deps-dev:** bump @flex-development/mkbuild from 1.0.0-alpha.6 to 1.0.0-alpha.8 ([567bea8](https://github.com/flex-development/mlly/commit/567bea892e46be9cc04885e97a0d76235e68bd0c))
10
+ * **deps-dev:** bump deps according to `yarn upgrade-interactive` ([e3649d4](https://github.com/flex-development/mlly/commit/e3649d4d98a59562a0ee27800eb33d1f6cc73c03))
11
+ * **deps-dev:** bump deps according to `yarn upgrade-interactive` ([cdfc9af](https://github.com/flex-development/mlly/commit/cdfc9af3bbce508aceb0fa80d41b9de567383a14))
12
+ * **deps-dev:** bump deps according to `yarn upgrade-interactive` ([24ee68b](https://github.com/flex-development/mlly/commit/24ee68b94523fca0ea9498068efc1765eb8f0a97))
13
+ * **deps:** replace `pathe` with `upath` ([f705671](https://github.com/flex-development/mlly/commit/f705671f193a7c3a0d24e49e7769683b5876aeae))
14
+ * **docs:** [site] use flex-development/docast@48367224ce9b9aa804d872071fc7e6fc6a2f38b3 ([06324f7](https://github.com/flex-development/mlly/commit/06324f723d88320e0de86563b2b78e7d3d02618c))
15
+ * **docs:** [site] use flex-development/docast@dd4b6c3b2d4e770df99f3a2b90032f228dcd76a8 ([3de807d](https://github.com/flex-development/mlly/commit/3de807d36c5b06760c9cd8d72b98ca4b0a7233ff))
16
+ * **pkg:** remove extraneous `bin` field ([b56c209](https://github.com/flex-development/mlly/commit/b56c2098cf328b89f8e6c34862ebc63668f9e348))
17
+ * **syntax:** export `detectSyntax` ([4f3850f](https://github.com/flex-development/mlly/commit/4f3850f60fe9c4981337452d377f29cb6bcceb6d))
18
+ * **syntax:** export `hasESMSyntax` ([64a89b2](https://github.com/flex-development/mlly/commit/64a89b235e8ae23c0e63fa013c110a3ca173785a))
19
+ * **ts:** reorganize `typesVersions` ([53430fe](https://github.com/flex-development/mlly/commit/53430fe8d4e99a0792e4b64a136d8ba779d51e21))
20
+
21
+
22
+ ### :robot: Continuous Integration
23
+
24
+ * add [@dependabot](https://github.com/dependabot) config ([ca31ac5](https://github.com/flex-development/mlly/commit/ca31ac58e4fcedb5feb2a86a134503ef2819fe00))
25
+ * **deps:** bump actions/checkout from 3.0.2 to 3.1.0 ([#1](https://github.com/flex-development/mlly/issues/1)) ([a7fdf9e](https://github.com/flex-development/mlly/commit/a7fdf9e9a3d84f37e7f436a544e98692f8988cac))
26
+ * **deps:** bump actions/github-script from 6.3.1 to 6.3.2 ([#3](https://github.com/flex-development/mlly/issues/3)) ([ef9e10d](https://github.com/flex-development/mlly/commit/ef9e10d9a08699961fee8acd664fadf8f1b95729))
27
+ * **deps:** bump actions/github-script from 6.3.2 to 6.3.3 ([#5](https://github.com/flex-development/mlly/issues/5)) ([68306db](https://github.com/flex-development/mlly/commit/68306db8078fdcaa0a0a6ef80195335c5d7b825d))
28
+ * **deps:** bump actions/setup-node from 3.5.0 to 3.5.1 ([#6](https://github.com/flex-development/mlly/issues/6)) ([c303f3e](https://github.com/flex-development/mlly/commit/c303f3e592508eb73e1e7f26a64cf1d3cd5f4808))
29
+ * **deps:** Bump crazy-max/ghaction-import-gpg from 5.1.0 to 5.2.0 ([#7](https://github.com/flex-development/mlly/issues/7)) ([e87d930](https://github.com/flex-development/mlly/commit/e87d9302e3cec93872c4ccf119aba75446839291))
30
+ * **deps:** Bump dependabot/fetch-metadata from 1.3.4 to 1.3.5 ([#8](https://github.com/flex-development/mlly/issues/8)) ([9d64f86](https://github.com/flex-development/mlly/commit/9d64f8640e10c7795bda75b183a47ffcbc2c6586))
31
+ * **deps:** bump hmarr/debug-action from 2.0.1 to 2.1.0 ([#2](https://github.com/flex-development/mlly/issues/2)) ([3b25af3](https://github.com/flex-development/mlly/commit/3b25af3b01d82dbf195fe5d16686063cfb6533a5))
32
+ * **deps:** bump octokit/graphql-action from 2.2.22 to 2.2.23 ([#4](https://github.com/flex-development/mlly/issues/4)) ([93e8994](https://github.com/flex-development/mlly/commit/93e89941b7bd6c5a4539cd1770d400a216c55525))
33
+ * **workflows:** `preview` ([2936463](https://github.com/flex-development/mlly/commit/2936463896eec04a5f5025c981d74361f0ee13df))
34
+ * **workflows:** deploy docs to production on github release ([876e5b0](https://github.com/flex-development/mlly/commit/876e5b09fe5b8f076133d1bbd78bf02eed206036))
35
+ * **workflows:** ensure docs preview is deployed with all `src` updates ([74bdb73](https://github.com/flex-development/mlly/commit/74bdb73a81ebf38fa606f63245140c2c437d20e3))
36
+
37
+
38
+ ### :pencil: Documentation
39
+
40
+ * [`hasESMSyntax`] fix typo in `@return` description ([c9f6a85](https://github.com/flex-development/mlly/commit/c9f6a8571034c82a2ac801db62632f7fc7033efc))
41
+ * [site] add `/api/interfaces` ([95eebeb](https://github.com/flex-development/mlly/commit/95eebeb47adc9cbf8e0dc576dbb3211fd241d432))
42
+ * [site] add `/api/types` ([cf7f5be](https://github.com/flex-development/mlly/commit/cf7f5be2af20ee33cb6b93a2809eeaf667334d15))
43
+ * [site] add `robots.txt` generation to postbuild tasks ([ef98b86](https://github.com/flex-development/mlly/commit/ef98b86bc3e76cf52781495a52bd7b725bdf5db2))
44
+ * [site] add esm only warning to install guide ([19dbe66](https://github.com/flex-development/mlly/commit/19dbe662ef869d26d7ac0f5412445dd392116895))
45
+ * [site] add google site verification ([8cd42d6](https://github.com/flex-development/mlly/commit/8cd42d6fe457cc342ca22d7130cf5572d81b6e48))
46
+ * [site] add initial front-end checklist ([1403dc3](https://github.com/flex-development/mlly/commit/1403dc357ac8db9ee9f3308b93f7d558d48be170))
47
+ * [site] algolia search integration ([1af849d](https://github.com/flex-development/mlly/commit/1af849d7be31c618ab6742c4a9ee2cd22038999c))
48
+ * [site] configure google analytics ([3c244ec](https://github.com/flex-development/mlly/commit/3c244ec3294b2ff6bcd6afdaf6b3238155ee25a2))
49
+ * [site] fix canonical url ([aea7a10](https://github.com/flex-development/mlly/commit/aea7a105d3fa928c52fc5c8a67fc20acb0c6b266))
50
+ * [site] fix duplicate meta description ([188d914](https://github.com/flex-development/mlly/commit/188d914bbdd99683a2eeaccb2c4e0080ecba5af3))
51
+ * [site] init `/api/` ([a5084d3](https://github.com/flex-development/mlly/commit/a5084d3b1b25b6e33b570e302b91aba41c012075))
52
+ * [site] move search indexing to `buildEnd` hook ([4b71095](https://github.com/flex-development/mlly/commit/4b71095d3e8895dcfc9c8355e9c2286da2c5c6d5))
53
+ * [site] prevent tab nabbing ([1929374](https://github.com/flex-development/mlly/commit/1929374cf03a52d03216d39a43e1fd94d2f75431))
54
+ * [site] specify text directionality ([1807a41](https://github.com/flex-development/mlly/commit/1807a41f31fa1a337be2722dda5771269e121522))
55
+ * [site] update front-end checklist ([70fd41d](https://github.com/flex-development/mlly/commit/70fd41d216b6f5d2ceb8f913ea6b87f744c15877))
56
+ * [site]: add `/api/constants` ([ed2bb9f](https://github.com/flex-development/mlly/commit/ed2bb9f8d54525a0da49dff9c879a9831cccef2d))
57
+ * [site]: resolve `@link` ([6ed82f8](https://github.com/flex-development/mlly/commit/6ed82f84e248a2ea21f73559fa40dba25bd88db5))
58
+ * [site]: update `/api/` title and intro ([3e60e88](https://github.com/flex-development/mlly/commit/3e60e884b5e7f551be3621ccbb2c4dabed783f73))
59
+ * [site]: update `/api/constants` intro ([2d1d525](https://github.com/flex-development/mlly/commit/2d1d52590e7098006f4df4c58e8d75af2ebb471a))
60
+ * init docs site ([df39382](https://github.com/flex-development/mlly/commit/df39382d9472d3eb97eb0eca37fd147634a65ff3))
61
+ * merge zsh docs into contributing guide ([f2e2a6c](https://github.com/flex-development/mlly/commit/f2e2a6c64d3cd8cf3376c912236deec7cfab4f37))
62
+ * reorganize gpr install guide ([0a8ef6e](https://github.com/flex-development/mlly/commit/0a8ef6ec08490807c3727398ae402d57c4b32f3d))
63
+ * temporarily remove `detectSyntax` example ([afc41e9](https://github.com/flex-development/mlly/commit/afc41e9d16c6f869d26db44bbac7579b24f6123c))
64
+ * update descriptions and reference links ([8bd5702](https://github.com/flex-development/mlly/commit/8bd570288ef8ed66fce4bd24bf3bc84b9e113dd2))
65
+
66
+
67
+ ### :sparkles: Features
68
+
69
+ * **analyze:** `extractStatements` ([08b9124](https://github.com/flex-development/mlly/commit/08b9124a76e5c4aa182221d87dea903b3876efd4))
70
+ * **analyze:** `findDynamicImports` ([a03089a](https://github.com/flex-development/mlly/commit/a03089a6ab374adaa1c0908bf304677f11e8b8e2))
71
+ * **analyze:** `findExports` ([7a66d78](https://github.com/flex-development/mlly/commit/7a66d781caa6d5f522d4a51e345eafb16b48974e))
72
+ * **analyze:** `findRequires` ([1d58008](https://github.com/flex-development/mlly/commit/1d58008174cc0622c2b1a54ce0dbd8741553cacc))
73
+ * **analyze:** `findStaticImports` ([673294c](https://github.com/flex-development/mlly/commit/673294cae8156f26538f7f1db51efcab74678fcc))
74
+ * **interfaces:** `CompilerOptionsJson` ([39c1abf](https://github.com/flex-development/mlly/commit/39c1abf9856886566277f771eddf27d3cb6aabd6))
75
+ * **interfaces:** `DynamicImport` ([b7474a1](https://github.com/flex-development/mlly/commit/b7474a18e482bd74f9c1337c78adc3299d2b0be5))
76
+ * **interfaces:** `ExportStatement` ([4384be4](https://github.com/flex-development/mlly/commit/4384be4525b22858e4cbcc782e5a57352583fd60))
77
+ * **interfaces:** `ImportStatement` ([6a16d74](https://github.com/flex-development/mlly/commit/6a16d74c491ee2f0453b31a3ea4bf15b9ab62289))
78
+ * **interfaces:** `RequireStatement` ([0dc6d7a](https://github.com/flex-development/mlly/commit/0dc6d7a8cb6a4c00f20621a3232cd0b37476025b))
79
+ * **interfaces:** `Statement` ([ec25911](https://github.com/flex-development/mlly/commit/ec25911670d0d204d196eb0039a95948ef7174c1))
80
+ * **interfaces:** `StaticImport` ([78816b7](https://github.com/flex-development/mlly/commit/78816b748cde2eec6bbfc821370be46008e46a21))
81
+ * **lib:** `getCompilerOptions` ([08c4b84](https://github.com/flex-development/mlly/commit/08c4b8492f7640f74dc676c073a7075115846698))
82
+ * **lib:** `isBuiltin` ([b0a618b](https://github.com/flex-development/mlly/commit/b0a618bf910b5a135a0f44df06dffcc0b6747774))
83
+ * **lib:** `toDataURL` ([57647dd](https://github.com/flex-development/mlly/commit/57647dd958bc29ff578c1661c3977021034ea5aa))
84
+ * **resolve:** [`resolveModule`] `@types` detection ([bcd1de7](https://github.com/flex-development/mlly/commit/bcd1de782395a784e0536f7184072acdaef7f33e))
85
+ * **resolve:** `resolveAlias` ([4014515](https://github.com/flex-development/mlly/commit/4014515682448d909fff777d41ed114f2a5ae072))
86
+ * **resolve:** `resolveAliases` ([25895cf](https://github.com/flex-development/mlly/commit/25895cf8455d932973593193db50fa28ea882d29))
87
+ * **resolve:** `resolveModule` ([90ae6b5](https://github.com/flex-development/mlly/commit/90ae6b55f197d161023119f82d394abb1d2dd5d3))
88
+ * **resolve:** `resolveModules` ([e7394ad](https://github.com/flex-development/mlly/commit/e7394ad44ce4965ff2d14ee4a7a7d61a23a7be1e))
89
+ * **specifiers:** [`toBareSpecifier`] `@types` detection + `types` entry point support ([6991fae](https://github.com/flex-development/mlly/commit/6991fae7631aa0f2ceb0c3c120349b7d5de55e0e))
90
+ * **specifiers:** `toAbsoluteSpecifier` ([83578ac](https://github.com/flex-development/mlly/commit/83578ac87e2600ad1cb7751a260667a13aac77f4))
91
+ * **specifiers:** `toBareSpecifier` ([1407d5e](https://github.com/flex-development/mlly/commit/1407d5e059442fec95bd017aa4f8853856cd3166))
92
+ * **specifiers:** `toRelativeSpecifier` ([26b7096](https://github.com/flex-development/mlly/commit/26b70967a8d2c06b2449b79002d2ebf7a7bbb990))
93
+ * **syntax:** `detectSyntax` ([184950f](https://github.com/flex-development/mlly/commit/184950faba5ee78597b69a2e4b1219338ff56bc7))
94
+ * **syntax:** `hasCJSSyntax` ([7d64e65](https://github.com/flex-development/mlly/commit/7d64e657002e4fd6ace32775bb2c274574765781))
95
+ * **syntax:** `hasESMSyntax` ([6888620](https://github.com/flex-development/mlly/commit/688862056a14d0ddd633d74cc9708b07b6fc2922))
96
+ * **syntax:** detect dynamic imports in commonjs ([05b4d8f](https://github.com/flex-development/mlly/commit/05b4d8f69302d7d6c991bc4dd12a874b0947ca34))
97
+ * **types:** `Declaration` ([1427995](https://github.com/flex-development/mlly/commit/1427995fd8999090fd76ae59adb6ecbadf19e263))
98
+ * **types:** `Ext` ([2ccd483](https://github.com/flex-development/mlly/commit/2ccd4832690367959ba207df0378409a1d4ee2ab))
99
+ * **types:** `MIMEType` ([8ff6a94](https://github.com/flex-development/mlly/commit/8ff6a944207b32f45eddda8a7fd6ac38bf47f634))
100
+ * **types:** `SpecifierType` ([6feccb1](https://github.com/flex-development/mlly/commit/6feccb15fca8affeb51efd6ce78f4ae267056910))
101
+ * **types:** `StatementType` ([b0feb6c](https://github.com/flex-development/mlly/commit/b0feb6cbf79b5a2d5364b728a2f2a45b8c6f5a50))
102
+
103
+
104
+ ### :bug: Fixes
105
+
106
+ * **docs:** [site] sitemap urls ([95cfad6](https://github.com/flex-development/mlly/commit/95cfad6e10d047d8d9d3bf8ffa0620f50c47472d))
107
+ * **internal:** `STATIC_IMPORT_REGEX` matches `:` in ternary statements ([d2027f8](https://github.com/flex-development/mlly/commit/d2027f83515065a28992d6d91ee3e22b2062c1d1))
108
+ * **internal:** `STATIC_IMPORT_REGEX` matches `import` in module specifiers ([a58ec20](https://github.com/flex-development/mlly/commit/a58ec2055750747743bc537f32f33ad7676fdcf4))
109
+ * **resolve:** [`resolveModules`] ignore dynamic import statements with dynamic specifiers ([48c20bd](https://github.com/flex-development/mlly/commit/48c20bd4915c16914c80e198a420485b9c8a0582))
110
+ * **tests:** [`findDynamicImports`] dynamic specifier test ([ee1b01b](https://github.com/flex-development/mlly/commit/ee1b01b6c727b54fecf64b0142ef6409fe30c941))
111
+
112
+
113
+ ### :house_with_garden: Housekeeping
114
+
115
+ * add empty changelog ([7dfb431](https://github.com/flex-development/mlly/commit/7dfb431e5f7ced07d6a9a5028347016f2dd5b4c9))
116
+ * disable eslint rule `unicorn/no-unsafe-regex` ([8d24eda](https://github.com/flex-development/mlly/commit/8d24edada5a7c6edfee6d316239cd29dc076531c)), closes [sindresorhus/eslint-plugin-unicorn#153](https://github.com/sindresorhus/eslint-plugin-unicorn/issues/153)
117
+ * improve vercel integration ([1db75bc](https://github.com/flex-development/mlly/commit/1db75bc420b42652c440ec0a09742dc319c857f5))
118
+ * update editorconfig properties ([60256a8](https://github.com/flex-development/mlly/commit/60256a822ddc721781fe6d6579459fcc9e51a2ec))
119
+ * **docs:** scrap `vc dev` usage ([5ce8c0f](https://github.com/flex-development/mlly/commit/5ce8c0f0468b2def494922f8f3b58ebb60a5a19c)), closes [vercel/vercel#8121](https://github.com/vercel/vercel/issues/8121)
120
+ * **github:** add commit scope `analyze` ([f3aaee9](https://github.com/flex-development/mlly/commit/f3aaee92ddbac08744d671cb7b905dbb36dba0f6))
121
+ * **github:** add commit scope `docs` ([6111249](https://github.com/flex-development/mlly/commit/61112490c88de111f1906a4725d98abaa5c7247a))
122
+ * **github:** add commit scope `interfaces` ([15fc6d9](https://github.com/flex-development/mlly/commit/15fc6d97ff06304710b55bf67768cb14e4ba4295))
123
+ * **github:** add commit scope `internal` ([63c3470](https://github.com/flex-development/mlly/commit/63c34707f54d5c5dbeea0ef06d3eea3bd927d888))
124
+ * **github:** add commit scope `specifiers` ([a7b3eb3](https://github.com/flex-development/mlly/commit/a7b3eb32b6cced07607af5be3f7c5c1240bcf3c2))
125
+ * **github:** add commit scope `types` ([da9f588](https://github.com/flex-development/mlly/commit/da9f588beac0d8e00daa60e40739306e424a3fa7))
126
+ * **github:** add label `scope:docs` ([6a98495](https://github.com/flex-development/mlly/commit/6a98495c6f1feabe786509c4bfc5aa6cb63573cb))
127
+ * **github:** add label `scope:internal` ([daca7af](https://github.com/flex-development/mlly/commit/daca7afda87a3f1dd2d292ed5e06cde42b3d5929))
128
+ * **ts:** enforce `import type` for type-only imports ([acd84b8](https://github.com/flex-development/mlly/commit/acd84b8c004fce22da9b2ea16b5281089fb5b15d))
129
+
130
+
131
+ ### :fire: Performance Improvements
132
+
133
+ * **docs:** [site] improve speed of first search query ([0ad65db](https://github.com/flex-development/mlly/commit/0ad65db1a6f731f7452d40375359f7584266a5d1))
134
+ * **docs:** [site] use exact urls to increase speed ([55c1267](https://github.com/flex-development/mlly/commit/55c1267864fe9540c38cd8e5bc970a855cd497bf))
135
+
136
+
137
+ ### :zap: Refactors
138
+
139
+ * **docs:** [site] comments compilation ([f66861c](https://github.com/flex-development/mlly/commit/f66861c9dca4e2f17403d8bc5684c2f120d4ebaa))
140
+ * **interfaces:** `AliasResolverOptions` -> `ResolveAliasOptions` ([602d11a](https://github.com/flex-development/mlly/commit/602d11a71c6ee288e7f73454a49cfdaaa5e71cc5))
141
+ * **internal:** add internals ([7a486c7](https://github.com/flex-development/mlly/commit/7a486c7ed3c84f39b0b4b7143f92729ce7912d81))
142
+ * **lib:** move `getCompilerOptions` to `internal` ([7c5656d](https://github.com/flex-development/mlly/commit/7c5656d70bd67c18a9c126abb6e84ff838552ad8))
143
+ * **lib:** replace `isBuiltin` with `@flex-development/is-builtin` ([c868cec](https://github.com/flex-development/mlly/commit/c868cec9b5fce91014b1666b3f9aceef60acf079))
144
+ * **resolve:** [`resolveAliases`] signature ([190fb52](https://github.com/flex-development/mlly/commit/190fb5260adb4559beaf0f3666c68b1cc1a16094))
145
+ * **resolve:** [options] allow readonly arrays ([6df4a4b](https://github.com/flex-development/mlly/commit/6df4a4bb3836adef0b6f15884575edb6ce78c2a0))
146
+ * **resolve:** [options] pass original module specifier to `ext` ([4615851](https://github.com/flex-development/mlly/commit/46158510fdd0e3d8e0e60757290a655606ad836e))
147
+ * **resolve:** sort `RESOLVE_EXTENSIONS` according to priority ([0266ca9](https://github.com/flex-development/mlly/commit/0266ca9a5593d0c66e950ba1fe2c8f6df8422ff9))
148
+ * **specifiers:** [`toBareSpecifier`] improve `exports` path search ([36c4b74](https://github.com/flex-development/mlly/commit/36c4b7475c9bb6c924f5e75c8d6d215a8d23e79c))
149
+
package/LICENSE.md ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2022, Flex Development, LLC All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without modification,
6
+ are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its contributors
16
+ may be used to endorse or promote products derived from this software without
17
+ specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # mlly
2
+
3
+ [![conventional commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
4
+ [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
5
+ [![module type: esm](https://img.shields.io/badge/module%20type-esm-brightgreen)](https://github.com/voxpelli/badges-cjs-esm)
6
+ [![npm](https://img.shields.io/npm/v/@flex-development/mlly.svg)](https://npmjs.com/package/@flex-development/mlly)
7
+ [![license](https://img.shields.io/github/license/flex-development/mlly.svg)](LICENSE.md)
8
+ [![typescript](https://badgen.net/badge/-/typescript?color=2a72bc&icon=typescript&label)](https://typescriptlang.org)
9
+
10
+ > [ECMAScript module][1] utilities.
11
+
12
+ ## Getting Started
13
+
14
+ See the [docs][2] for install and usage instructions.
15
+
16
+ [1]: https://nodejs.org/api/esm.html
17
+ [2]: https://mlly.vercel.app/
@@ -0,0 +1,204 @@
1
+ /**
2
+ * @file Changelog Configuration
3
+ * @module config/changelog
4
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli
5
+ */
6
+
7
+ import type { Config } from 'conventional-changelog-cli'
8
+ import type { Options } from 'conventional-changelog-core'
9
+ import type {
10
+ CommitGroup,
11
+ GeneratedContext
12
+ } from 'conventional-changelog-writer'
13
+ import type { Commit, CommitRaw } from 'conventional-commits-parser'
14
+ import dateformat from 'dateformat'
15
+ import fs from 'node:fs'
16
+ import pkg from './package.json'
17
+
18
+ /**
19
+ * Changlog context.
20
+ *
21
+ * @extends {GeneratedContext}
22
+ */
23
+ interface Context extends GeneratedContext {
24
+ currentTag: string
25
+ linkCompare: boolean
26
+ previousTag: string
27
+ }
28
+
29
+ /**
30
+ * Changelog configuration options.
31
+ *
32
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits
33
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core
34
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer
35
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-parser
36
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/git-raw-commits
37
+ *
38
+ * @const {Config} config
39
+ */
40
+ const config: Config = {
41
+ options: {
42
+ preset: {
43
+ header: '',
44
+ name: 'conventionalcommits',
45
+ releaseCommitMessageFormat: 'release: {{currentTag}}',
46
+ types: [
47
+ { section: ':package: Build', type: 'build' },
48
+ { section: ':house_with_garden: Housekeeping', type: 'chore' },
49
+ { section: ':robot: Continuous Integration', type: 'ci' },
50
+ { section: ':pencil: Documentation', type: 'docs' },
51
+ { section: ':sparkles: Features', type: 'feat' },
52
+ { section: ':bug: Fixes', type: 'fix' },
53
+ { section: ':fire: Performance Improvements', type: 'perf' },
54
+ { section: ':zap: Refactors', type: 'refactor' },
55
+ { section: ':rewind: Reverts', type: 'revert' },
56
+ { hidden: true, type: 'style' },
57
+ { section: ':white_check_mark: Testing', type: 'test' },
58
+ { hidden: true, type: 'wip' }
59
+ ]
60
+ },
61
+ skipUnstable: false,
62
+ tagPrefix: pkg.tagPrefix,
63
+ /**
64
+ * Raw commit transformer.
65
+ *
66
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core#transform-1
67
+ *
68
+ * @param {CommitRaw} commit - Raw commit object
69
+ * @param {Options.Transform.Callback} apply - Commit handler
70
+ * @return {void} Nothing when complete
71
+ */
72
+ transform(commit: CommitRaw, apply: Options.Transform.Callback): void {
73
+ commit.committerDate = dateformat(commit.committerDate, 'yyyy-mm-dd')
74
+
75
+ if (commit.gitTags) {
76
+ /**
77
+ * Regex expression used to check {@link commit.gitTags} for the release
78
+ * {@link commit} belongs to.
79
+ *
80
+ * @const {RegExp} vgx
81
+ */
82
+ const vgx: RegExp = pkg.tagPrefix
83
+ ? new RegExp(`tag:\\s*[=]?${pkg.tagPrefix}(.+?)[,)]`, 'gi')
84
+ : /tag:\s*[=v]?(.+?)[),]/gi
85
+
86
+ commit = Object.assign({}, commit, {
87
+ version: vgx.exec(commit.gitTags)?.[1] ?? undefined
88
+ })
89
+ }
90
+
91
+ commit.notes = commit.notes.map(note => ({
92
+ ...note,
93
+ text: note.text.replace(/(\n?\n?Signed-off-by:).+/gm, '')
94
+ }))
95
+
96
+ return void apply(null, {
97
+ ...commit,
98
+ raw: commit,
99
+ shortHash: commit.hash.slice(0, 7)
100
+ })
101
+ }
102
+ },
103
+ parserOpts: {
104
+ issuePrefixesCaseSensitive: true
105
+ },
106
+ writerOpts: {
107
+ /**
108
+ * Sorts commit groups in descending order by group title.
109
+ *
110
+ * GitHub emojis in titles will be ignored.
111
+ *
112
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#commitgroupssort
113
+ *
114
+ * @param {CommitGroup} a - Commit group object
115
+ * @param {CommitGroup} b - Commit group object to compare to `a`
116
+ * @return {number} Compare result
117
+ */
118
+ commitGroupsSort(a: CommitGroup, b: CommitGroup): number {
119
+ if (a.title === false) return 1
120
+ if (b.title === false) return -1
121
+
122
+ /**
123
+ * Regex used to extract commit group titles without GitHub emojis.
124
+ *
125
+ * @const {RegExp} tgx - Regex used to extract commit group title
126
+ */
127
+ const tgx: RegExp = /([A-Z])\w+/
128
+
129
+ return tgx.exec(a.title)![0]!.localeCompare(tgx.exec(b.title)![0]!)
130
+ },
131
+ /**
132
+ * Sorts commits in descending order by commit header and date.
133
+ *
134
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#commitssort
135
+ *
136
+ * @param {Commit} a - Commit object
137
+ * @param {Commit} b - Commit object to compare to `b`
138
+ * @return {number} Compare result
139
+ */
140
+ commitsSort(a: Commit, b: Commit): number {
141
+ /**
142
+ * Compare result for {@link b.committerDate} & {@link a.committerDate}.
143
+ *
144
+ * @const {number} by_date
145
+ */
146
+ const by_date: number =
147
+ new Date(b.committerDate).getTime() -
148
+ new Date(a.committerDate).getTime()
149
+
150
+ return a.header && b.header
151
+ ? a.header.localeCompare(b.header) || by_date
152
+ : by_date
153
+ },
154
+ /**
155
+ * Modifies `context` before the changelog is generated.
156
+ *
157
+ * This includes:
158
+ *
159
+ * - Setting the release date to the current date
160
+ * - Setting the current release tag
161
+ * - Setting the previous release tag
162
+ * - Setting compare link generation
163
+ *
164
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core#finalizecontext
165
+ * @see https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#finalizecontext
166
+ *
167
+ * @param {GeneratedContext} context - Generated changelog context
168
+ * @return {Context} Final changelog context
169
+ */
170
+ finalizeContext(context: GeneratedContext): Context {
171
+ /**
172
+ * Use current date as release date instead of date of most recent commit.
173
+ *
174
+ * @see https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-writer/lib/util.js#L194-L196
175
+ */
176
+ context.date = dateformat(new Date(), 'yyyy-mm-dd')
177
+
178
+ /**
179
+ * Release tag for upcoming version.
180
+ *
181
+ * @const {string} currentTag
182
+ */
183
+ const currentTag: string = pkg.tagPrefix + pkg.version
184
+
185
+ /**
186
+ * Release tag for previous version.
187
+ *
188
+ * @const {string} previousTag
189
+ */
190
+ const previousTag: string = context.gitSemverTags[0]!
191
+
192
+ return {
193
+ ...context,
194
+ currentTag,
195
+ linkCompare: currentTag !== previousTag,
196
+ previousTag
197
+ }
198
+ },
199
+ headerPartial: fs.readFileSync('templates/changelog/header.hbs', 'utf8'),
200
+ ignoreReverted: false
201
+ }
202
+ }
203
+
204
+ module.exports = config
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @file Constants
3
+ * @module mlly/constants
4
+ */
5
+ import type { Ext } from './types/index.mjs';
6
+ /**
7
+ * Default export conditions.
8
+ *
9
+ * @see https://nodejs.org/api/packages.html#conditional-exports
10
+ *
11
+ * @const {Readonly<Set<string>>} CONDITIONS
12
+ */
13
+ export declare const CONDITIONS: Readonly<Set<string>>;
14
+ /**
15
+ * Default resolvable file extensions.
16
+ *
17
+ * @const {ReadonlyArray<Ext>} RESOLVE_EXTENSIONS
18
+ */
19
+ export declare const RESOLVE_EXTENSIONS: readonly Ext[];
@@ -0,0 +1,24 @@
1
+ const CONDITIONS = Object.freeze(
2
+ /* @__PURE__ */ new Set(["node", "import"])
3
+ );
4
+ const RESOLVE_EXTENSIONS = Object.freeze([
5
+ ".mjs",
6
+ ".mts",
7
+ ".cjs",
8
+ ".cts",
9
+ ".js",
10
+ ".ts",
11
+ ".jsx",
12
+ ".tsx",
13
+ ".css",
14
+ ".json",
15
+ ".node",
16
+ ".wasm",
17
+ ".d.mts",
18
+ ".d.cts",
19
+ ".d.ts"
20
+ ]);
21
+ export {
22
+ CONDITIONS,
23
+ RESOLVE_EXTENSIONS
24
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @file Package Entry Point
3
+ * @module mlly
4
+ */
5
+ export * from './constants.mjs';
6
+ export * from './interfaces/index.mjs';
7
+ export * from './lib/index.mjs';
8
+ export * from './types/index.mjs';
package/dist/index.mjs ADDED
@@ -0,0 +1,4 @@
1
+ export * from "./constants.mjs";
2
+ export * from "./interfaces/index.mjs";
3
+ export * from "./lib/index.mjs";
4
+ export * from "./types/index.mjs";
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @file Interfaces - DynamicImport
3
+ * @module mlly/interfaces/DynamicImport
4
+ */
5
+ import type ImportStatement from './statement-import.mjs';
6
+ /**
7
+ * Dynamic import statement object schema.
8
+ *
9
+ * @see {@link ImportStatement}
10
+ *
11
+ * @extends {ImportStatement}
12
+ */
13
+ interface DynamicImport extends ImportStatement {
14
+ /**
15
+ * Module specifier type.
16
+ */
17
+ specifier_type: 'dynamic' | 'static';
18
+ /**
19
+ * Import statement type.
20
+ */
21
+ type: 'dynamic';
22
+ }
23
+ export type { DynamicImport as default };
File without changes
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @file Interfaces - StaticImport
3
+ * @module mlly/interfaces/StaticImport
4
+ */
5
+ import type ImportStatement from './statement-import.mjs';
6
+ /**
7
+ * Static import statement object schema.
8
+ *
9
+ * @see {@link ImportStatement}
10
+ *
11
+ * @extends {ImportStatement}
12
+ */
13
+ interface StaticImport extends ImportStatement {
14
+ /**
15
+ * Import statement type.
16
+ */
17
+ type: 'default' | 'named' | 'star';
18
+ }
19
+ export type { StaticImport as default };
File without changes
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @file Interfaces
3
+ * @module mlly/interfaces
4
+ */
5
+ export type { default as DynamicImport } from './import-dynamic.mjs';
6
+ export type { default as StaticImport } from './import-static.mjs';
7
+ export type { default as ResolveOptions } from './options-resolve.mjs';
8
+ export type { default as ResolveAliasOptions } from './options-resolve-alias.mjs';
9
+ export type { default as Statement } from './statement.mjs';
10
+ export type { default as ExportStatement } from './statement-export.mjs';
11
+ export type { default as ImportStatement } from './statement-import.mjs';
12
+ export type { default as RequireStatement } from './statement-require.mjs';
File without changes
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @file Interfaces - ResolveAliasOptions
3
+ * @module mlly/interfaces/ResolveAliasOptions
4
+ */
5
+ import type { OneOrMany } from '@flex-development/tutils';
6
+ /**
7
+ * Path alias resolution options.
8
+ *
9
+ * @see https://github.com/dividab/tsconfig-paths
10
+ */
11
+ interface ResolveAliasOptions {
12
+ /**
13
+ * Base directory to resolve non-absolute module names.
14
+ *
15
+ * @see https://www.typescriptlang.org/tsconfig#baseUrl
16
+ *
17
+ * @default process.cwd()
18
+ */
19
+ baseUrl?: string;
20
+ /**
21
+ * Module extensions to probe for.
22
+ *
23
+ * **Note**: Should be sorted by priority.
24
+ *
25
+ * @default RESOLVE_EXTENSIONS
26
+ */
27
+ extensions?: string[] | readonly string[];
28
+ /**
29
+ * Checks for the existence of a file at `path`.
30
+ *
31
+ * @param {string} path - Path to check
32
+ * @return {boolean} `true` if file exists, `false` otherwise
33
+ */
34
+ fileExists?(this: void, path: string): boolean;
35
+ /**
36
+ * `package.json` fields to check when resolving modules.
37
+ *
38
+ * A nested field can be selected by passing an array of field names.
39
+ *
40
+ * @default ['main', 'module']
41
+ */
42
+ mainFields?: OneOrMany<string>[];
43
+ /**
44
+ * Absolute path to file containing path alias.
45
+ */
46
+ parent?: string;
47
+ /**
48
+ * Path mappings.
49
+ *
50
+ * **Note**: Should be relative to {@link baseUrl}.
51
+ *
52
+ * @see https://www.typescriptlang.org/tsconfig#paths
53
+ *
54
+ * @default {}
55
+ */
56
+ paths?: Record<string, string[]>;
57
+ /**
58
+ * Synchronously returns the contents of `filename`.
59
+ *
60
+ * @param {string} filename - Filename
61
+ * @return {string} Contents of `filename`
62
+ */
63
+ readFile?(this: void, filename: string): string;
64
+ /**
65
+ * Absolute path to tsconfig file.
66
+ */
67
+ tsconfig?: string;
68
+ }
69
+ export type { ResolveAliasOptions as default };
File without changes