@flex-development/mlly 1.0.0-alpha.15 → 1.0.0-alpha.16

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 (239) hide show
  1. package/CHANGELOG.md +181 -0
  2. package/README.md +1 -0
  3. package/dist/enums/assert-type.mjs +1 -7
  4. package/dist/enums/format.mjs +1 -10
  5. package/dist/enums/index.mjs +0 -1
  6. package/dist/enums/kind-specifier-syntax.mjs +1 -7
  7. package/dist/enums/kind-specifier.mjs +1 -8
  8. package/dist/enums/kind-statement-syntax.mjs +1 -15
  9. package/dist/enums/kind-statement.mjs +1 -8
  10. package/dist/index.mjs.map +5 -2
  11. package/dist/interfaces/import-dynamic.d.mts +1 -3
  12. package/dist/interfaces/import-static.d.mts +1 -3
  13. package/dist/interfaces/index.mjs +0 -1
  14. package/dist/interfaces/options-find-subpath.d.mts +4 -3
  15. package/dist/interfaces/options-get-format.d.mts +7 -7
  16. package/dist/interfaces/options-get-source.d.mts +5 -4
  17. package/dist/interfaces/options-parse-module-id.d.mts +4 -3
  18. package/dist/interfaces/options-parse-subpath.d.mts +4 -3
  19. package/dist/interfaces/options-resolve-alias.d.mts +5 -5
  20. package/dist/interfaces/options-resolve-module.d.mts +6 -6
  21. package/dist/internal/dequote.d.mts +14 -0
  22. package/dist/internal/dequote.mjs +6 -0
  23. package/dist/internal/format-type-map.d.mts +2 -0
  24. package/dist/internal/format-type-map.mjs +0 -1
  25. package/dist/internal/get-specifier-kind.d.mts +2 -0
  26. package/dist/internal/get-specifier-kind.mjs +3 -7
  27. package/dist/internal/get-subpaths.d.mts +5 -2
  28. package/dist/internal/get-subpaths.mjs +2 -5
  29. package/dist/internal/regex-encoded-sep.d.mts +2 -0
  30. package/dist/internal/regex-encoded-sep.mjs +0 -1
  31. package/dist/internal/regex-internal-specifier.d.mts +2 -0
  32. package/dist/internal/regex-internal-specifier.mjs +0 -1
  33. package/dist/internal/regex-invalid-segment.d.mts +2 -0
  34. package/dist/internal/regex-invalid-segment.mjs +4 -7
  35. package/dist/internal/regex-package-name.d.mts +2 -0
  36. package/dist/internal/regex-package-name.mjs +0 -1
  37. package/dist/internal/regex-package-path.d.mts +2 -0
  38. package/dist/internal/regex-package-path.mjs +0 -1
  39. package/dist/internal/resolver.d.mts +5 -3
  40. package/dist/internal/resolver.mjs +115 -130
  41. package/dist/internal/validate-array-set.d.mts +7 -5
  42. package/dist/internal/validate-array-set.mjs +5 -5
  43. package/dist/internal/validate-boolean.d.mts +4 -2
  44. package/dist/internal/validate-boolean.mjs +3 -3
  45. package/dist/internal/validate-map.d.mts +10 -7
  46. package/dist/internal/validate-map.mjs +5 -5
  47. package/dist/internal/validate-object.d.mts +9 -9
  48. package/dist/internal/validate-object.mjs +3 -3
  49. package/dist/internal/validate-set.d.mts +7 -5
  50. package/dist/internal/validate-set.mjs +5 -5
  51. package/dist/internal/validate-string.d.mts +5 -2
  52. package/dist/internal/validate-string.mjs +3 -3
  53. package/dist/internal/validate-url-string.d.mts +4 -2
  54. package/dist/internal/validate-url-string.mjs +3 -3
  55. package/dist/types/fn-change-ext.d.mts +7 -4
  56. package/dist/types/index.mjs +0 -1
  57. package/dist/utils/compare-subpaths.mjs +5 -10
  58. package/dist/utils/compare-subpaths.mjs.map +6 -3
  59. package/dist/utils/conditions.mjs.map +5 -2
  60. package/dist/utils/detect-syntax.mjs +1 -2
  61. package/dist/utils/detect-syntax.mjs.map +6 -3
  62. package/dist/utils/extension-format-map.mjs.map +5 -2
  63. package/dist/utils/extract-statements.mjs +6 -7
  64. package/dist/utils/extract-statements.mjs.map +6 -3
  65. package/dist/utils/fill-modules.mjs +43 -46
  66. package/dist/utils/fill-modules.mjs.map +9 -4
  67. package/dist/utils/find-dynamic-imports.mjs +23 -26
  68. package/dist/utils/find-dynamic-imports.mjs.map +9 -4
  69. package/dist/utils/find-exports.mjs +15 -20
  70. package/dist/utils/find-exports.mjs.map +9 -4
  71. package/dist/utils/find-requires.mjs +5 -5
  72. package/dist/utils/find-requires.mjs.map +9 -4
  73. package/dist/utils/find-static-imports.mjs +17 -21
  74. package/dist/utils/find-static-imports.mjs.map +9 -4
  75. package/dist/utils/find-subpath.d.mts +3 -3
  76. package/dist/utils/find-subpath.mjs +52 -74
  77. package/dist/utils/find-subpath.mjs.map +10 -4
  78. package/dist/utils/get-format.mjs +18 -33
  79. package/dist/utils/get-format.mjs.map +9 -4
  80. package/dist/utils/get-source.d.mts +3 -2
  81. package/dist/utils/get-source.mjs +10 -19
  82. package/dist/utils/get-source.mjs.map +6 -3
  83. package/dist/utils/has-cjs-syntax.mjs.map +5 -2
  84. package/dist/utils/has-esm-syntax.mjs.map +5 -2
  85. package/dist/utils/index.d.mts +2 -0
  86. package/dist/utils/index.mjs +46 -42
  87. package/dist/utils/index.mjs.map +9 -4
  88. package/dist/utils/is-absolute-specifier.mjs +5 -6
  89. package/dist/utils/is-absolute-specifier.mjs.map +6 -3
  90. package/dist/utils/is-bare-specifier.mjs +2 -4
  91. package/dist/utils/is-bare-specifier.mjs.map +6 -3
  92. package/dist/utils/is-directory.mjs +14 -0
  93. package/dist/utils/is-directory.mjs.map +9 -0
  94. package/dist/utils/is-exports-sugar.d.mts +3 -2
  95. package/dist/utils/is-exports-sugar.mjs +16 -13
  96. package/dist/utils/is-exports-sugar.mjs.map +6 -3
  97. package/dist/utils/is-file.mjs +14 -0
  98. package/dist/utils/is-file.mjs.map +9 -0
  99. package/dist/utils/is-relative-specifier.d.mts +0 -1
  100. package/dist/utils/is-relative-specifier.mjs +2 -4
  101. package/dist/utils/is-relative-specifier.mjs.map +6 -3
  102. package/dist/utils/lookup-package-scope.d.mts +1 -1
  103. package/dist/utils/lookup-package-scope.mjs +4 -8
  104. package/dist/utils/lookup-package-scope.mjs.map +6 -3
  105. package/dist/utils/parse-data-url.mjs +4 -4
  106. package/dist/utils/parse-data-url.mjs.map +6 -3
  107. package/dist/utils/parse-module-id.mjs +22 -24
  108. package/dist/utils/parse-module-id.mjs.map +10 -4
  109. package/dist/utils/parse-subpath.d.mts +3 -2
  110. package/dist/utils/parse-subpath.mjs +40 -55
  111. package/dist/utils/parse-subpath.mjs.map +9 -4
  112. package/dist/utils/pattern-character.mjs.map +5 -2
  113. package/dist/utils/read-package-json.mjs +12 -9
  114. package/dist/utils/read-package-json.mjs.map +6 -3
  115. package/dist/utils/resolve-alias.mjs +28 -34
  116. package/dist/utils/resolve-alias.mjs.map +10 -4
  117. package/dist/utils/resolve-aliases.mjs +15 -17
  118. package/dist/utils/resolve-aliases.mjs.map +6 -3
  119. package/dist/utils/resolve-extensions.mjs.map +5 -2
  120. package/dist/utils/resolve-module.mjs +10 -26
  121. package/dist/utils/resolve-module.mjs.map +6 -3
  122. package/dist/utils/resolve-modules.mjs +12 -15
  123. package/dist/utils/resolve-modules.mjs.map +6 -3
  124. package/dist/utils/to-absolute-specifier.mjs.map +5 -2
  125. package/dist/utils/to-bare-specifier.mjs +18 -38
  126. package/dist/utils/to-bare-specifier.mjs.map +6 -3
  127. package/dist/utils/to-data-url.mjs +1 -5
  128. package/dist/utils/to-data-url.mjs.map +6 -3
  129. package/dist/utils/to-node-url.mjs +1 -4
  130. package/dist/utils/to-node-url.mjs.map +6 -3
  131. package/dist/utils/to-relative-specifier.mjs +2 -16
  132. package/dist/utils/to-relative-specifier.mjs.map +6 -3
  133. package/dist/utils/to-url.mjs +1 -5
  134. package/dist/utils/to-url.mjs.map +6 -3
  135. package/dist/utils/validate-assertions.d.mts +2 -2
  136. package/dist/utils/validate-assertions.mjs +14 -21
  137. package/dist/utils/validate-assertions.mjs.map +9 -4
  138. package/dist/utils/validate-exports.d.mts +3 -2
  139. package/dist/utils/validate-exports.mjs +25 -24
  140. package/dist/utils/validate-exports.mjs.map +6 -3
  141. package/package.json +89 -81
  142. package/src/interfaces/import-dynamic.ts +1 -3
  143. package/src/interfaces/import-static.ts +1 -5
  144. package/src/interfaces/options-find-subpath.ts +4 -3
  145. package/src/interfaces/options-get-format.ts +7 -7
  146. package/src/interfaces/options-get-source.ts +5 -4
  147. package/src/interfaces/options-parse-module-id.ts +4 -3
  148. package/src/interfaces/options-parse-subpath.ts +4 -3
  149. package/src/interfaces/options-resolve-alias.ts +5 -5
  150. package/src/interfaces/options-resolve-module.ts +6 -6
  151. package/src/internal/dequote.ts +18 -0
  152. package/src/internal/format-type-map.ts +2 -0
  153. package/src/internal/get-specifier-kind.ts +7 -4
  154. package/src/internal/get-subpaths.ts +7 -5
  155. package/src/internal/regex-encoded-sep.ts +2 -0
  156. package/src/internal/regex-internal-specifier.ts +2 -0
  157. package/src/internal/regex-invalid-segment.ts +2 -0
  158. package/src/internal/regex-package-name.ts +2 -0
  159. package/src/internal/regex-package-path.ts +2 -0
  160. package/src/internal/resolver.ts +71 -49
  161. package/src/internal/validate-array-set.ts +10 -7
  162. package/src/internal/validate-boolean.ts +6 -3
  163. package/src/internal/validate-map.ts +12 -9
  164. package/src/internal/validate-object.ts +10 -10
  165. package/src/internal/validate-set.ts +9 -9
  166. package/src/internal/validate-string.ts +7 -3
  167. package/src/internal/validate-url-string.ts +6 -3
  168. package/src/types/fn-change-ext.ts +7 -7
  169. package/src/utils/extract-statements.ts +11 -7
  170. package/src/utils/fill-modules.ts +70 -62
  171. package/src/utils/find-dynamic-imports.ts +6 -6
  172. package/src/utils/find-exports.ts +19 -29
  173. package/src/utils/find-requires.ts +6 -6
  174. package/src/utils/find-static-imports.ts +11 -14
  175. package/src/utils/find-subpath.ts +140 -139
  176. package/src/utils/get-format.ts +27 -21
  177. package/src/utils/get-source.ts +5 -5
  178. package/src/utils/index.ts +2 -0
  179. package/src/utils/is-bare-specifier.ts +2 -1
  180. package/src/{internal → utils}/is-directory.ts +1 -1
  181. package/src/utils/is-exports-sugar.ts +16 -9
  182. package/src/{internal → utils}/is-file.ts +1 -1
  183. package/src/utils/is-relative-specifier.ts +5 -6
  184. package/src/utils/lookup-package-scope.ts +2 -2
  185. package/src/utils/parse-data-url.ts +3 -3
  186. package/src/utils/parse-module-id.ts +16 -8
  187. package/src/utils/parse-subpath.ts +32 -19
  188. package/src/utils/read-package-json.ts +13 -6
  189. package/src/utils/resolve-alias.ts +19 -15
  190. package/src/utils/resolve-aliases.ts +25 -25
  191. package/src/utils/resolve-module.ts +4 -5
  192. package/src/utils/resolve-modules.ts +19 -21
  193. package/src/utils/to-bare-specifier.ts +12 -7
  194. package/src/utils/to-relative-specifier.ts +2 -1
  195. package/src/utils/validate-assertions.ts +12 -7
  196. package/src/utils/validate-exports.ts +25 -18
  197. package/dist/enums/assert-type.mjs.map +0 -6
  198. package/dist/enums/format.mjs.map +0 -6
  199. package/dist/enums/index.mjs.map +0 -6
  200. package/dist/enums/kind-specifier-syntax.mjs.map +0 -6
  201. package/dist/enums/kind-specifier.mjs.map +0 -6
  202. package/dist/enums/kind-statement-syntax.mjs.map +0 -6
  203. package/dist/enums/kind-statement.mjs.map +0 -6
  204. package/dist/interfaces/index.mjs.map +0 -6
  205. package/dist/internal/escape-reg-exp.d.mts +0 -16
  206. package/dist/internal/escape-reg-exp.mjs +0 -10
  207. package/dist/internal/escape-reg-exp.mjs.map +0 -6
  208. package/dist/internal/format-type-map.mjs.map +0 -6
  209. package/dist/internal/get-specifier-kind.mjs.map +0 -6
  210. package/dist/internal/get-subpaths.mjs.map +0 -6
  211. package/dist/internal/is-array-index.d.mts +0 -15
  212. package/dist/internal/is-array-index.mjs +0 -9
  213. package/dist/internal/is-array-index.mjs.map +0 -6
  214. package/dist/internal/is-directory.mjs +0 -16
  215. package/dist/internal/is-directory.mjs.map +0 -6
  216. package/dist/internal/is-file.mjs +0 -16
  217. package/dist/internal/is-file.mjs.map +0 -6
  218. package/dist/internal/is-function.d.mts +0 -12
  219. package/dist/internal/is-function.mjs +0 -8
  220. package/dist/internal/is-function.mjs.map +0 -6
  221. package/dist/internal/regex-encoded-sep.mjs.map +0 -6
  222. package/dist/internal/regex-internal-specifier.mjs.map +0 -6
  223. package/dist/internal/regex-invalid-segment.mjs.map +0 -6
  224. package/dist/internal/regex-package-name.mjs.map +0 -6
  225. package/dist/internal/regex-package-path.mjs.map +0 -6
  226. package/dist/internal/resolver.mjs.map +0 -6
  227. package/dist/internal/validate-array-set.mjs.map +0 -6
  228. package/dist/internal/validate-boolean.mjs.map +0 -6
  229. package/dist/internal/validate-map.mjs.map +0 -6
  230. package/dist/internal/validate-object.mjs.map +0 -6
  231. package/dist/internal/validate-set.mjs.map +0 -6
  232. package/dist/internal/validate-string.mjs.map +0 -6
  233. package/dist/internal/validate-url-string.mjs.map +0 -6
  234. package/dist/types/index.mjs.map +0 -6
  235. package/src/internal/escape-reg-exp.ts +0 -24
  236. package/src/internal/is-array-index.ts +0 -28
  237. package/src/internal/is-function.ts +0 -16
  238. /package/dist/{internal → utils}/is-directory.d.mts +0 -0
  239. /package/dist/{internal → utils}/is-file.d.mts +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@flex-development/mlly",
3
3
  "description": "ECMAScript module utilities",
4
- "version": "1.0.0-alpha.15",
4
+ "version": "1.0.0-alpha.16",
5
5
  "keywords": [
6
6
  "ecmascript",
7
7
  "esm",
@@ -10,7 +10,7 @@
10
10
  "typescript"
11
11
  ],
12
12
  "license": "BSD-3-Clause",
13
- "homepage": "https://github.com/flex-development/mlly",
13
+ "homepage": "https://mlly.vercel.app",
14
14
  "repository": "https://github.com/flex-development/mlly.git",
15
15
  "bugs": "https://github.com/flex-development/mlly/issues",
16
16
  "author": {
@@ -23,6 +23,7 @@
23
23
  },
24
24
  "type": "module",
25
25
  "files": [
26
+ "CHANGELOG.md",
26
27
  "dist",
27
28
  "src"
28
29
  ],
@@ -35,11 +36,12 @@
35
36
  "scripts": {
36
37
  "build": "mkbuild",
37
38
  "changelog": "node --loader=./loader.mjs ./config/changelog.config",
38
- "check:ci": "yarn dedupe --check && yarn check:format && yarn check:lint && yarn check:spelling && yarn typecheck && yarn test:cov && NODE_ENV=production yarn pack -o %s-%v.tgz && yarn clean:pack && yarn check:types:build && yarn docs:build",
39
+ "check:ci": "yarn dedupe --check && yarn check:format && yarn check:lint && yarn check:spelling && yarn typecheck && yarn test:cov && yarn pack && yarn check:types:build && attw package.tgz && yarn clean:pack && yarn pkg-size && yarn docs:build",
39
40
  "check:format": "prettier --check .",
40
41
  "check:lint": "eslint --exit-on-fatal-error --max-warnings 0 .",
41
42
  "check:spelling": "cspell lint --color --no-progress --relative $@ \"**\"",
42
43
  "check:types": "vue-tsc -p tsconfig.typecheck.json",
44
+ "check:types:attw": "yarn pack && attw package.tgz && yarn clean:pack",
43
45
  "check:types:build": "bash ./scripts/typecheck-build.sh",
44
46
  "check:upgrades": "yarn upgrade-interactive",
45
47
  "clean:build": "trash ./{dist,*.tgz}",
@@ -60,6 +62,7 @@
60
62
  "fix:dedupe": "yarn dedupe --strategy=highest",
61
63
  "fix:format": "prettier --cache --write .",
62
64
  "fix:lint": "yarn check:lint --cache --fix",
65
+ "pkg-size": "pkg-size --sizes size --sort-by name",
63
66
  "_postinstall": "[ -f ./node_modules/.bin/husky ] && chmod +x .husky/* && husky install || exit 0",
64
67
  "postpack": "toggle-scripts +postinstall",
65
68
  "postpublish": "toggle-scripts +prepack",
@@ -69,127 +72,129 @@
69
72
  "release": "bash ./scripts/release.sh",
70
73
  "test": "vitest run",
71
74
  "test:cov": "yarn clean:coverage; yarn test --coverage",
72
- "test:cov:serve": "serve ./coverage/lcov-report",
75
+ "test:cov:serve": "vite preview --outDir ./coverage",
73
76
  "test:cov:upload": "./codecov -t $CODECOV_TOKEN -f ./coverage/lcov.info",
74
77
  "test:watch": "vitest",
75
78
  "typecheck": "vitest typecheck --run",
76
79
  "typecheck:watch": "vitest typecheck"
77
80
  },
78
81
  "dependencies": {
79
- "@flex-development/errnode": "1.5.0",
80
- "@flex-development/export-regex": "1.0.2",
81
- "@flex-development/import-regex": "2.0.3",
82
- "@flex-development/is-builtin": "2.0.0",
83
- "@flex-development/pathe": "1.0.3",
84
- "@flex-development/pkg-types": "2.0.0",
85
- "@flex-development/tutils": "6.0.0-alpha.10"
82
+ "@flex-development/errnode": "2.0.0",
83
+ "@flex-development/export-regex": "2.0.0",
84
+ "@flex-development/import-regex": "3.0.0",
85
+ "@flex-development/is-builtin": "3.1.0",
86
+ "@flex-development/pathe": "2.0.0",
87
+ "@flex-development/pkg-types": "3.0.0",
88
+ "@flex-development/tutils": "6.0.0-alpha.15"
86
89
  },
87
90
  "devDependencies": {
88
- "@commitlint/cli": "17.4.4",
91
+ "@arethetypeswrong/cli": "0.7.1",
92
+ "@commitlint/cli": "17.6.7",
89
93
  "@commitlint/types": "17.4.4",
90
- "@docsearch/react": "3.3.3",
91
- "@faker-js/faker": "8.0.0-alpha.0",
94
+ "@docsearch/react": "3.5.1",
95
+ "@faker-js/faker": "8.0.2",
92
96
  "@flex-development/commitlint-config": "1.0.1",
93
- "@flex-development/docast": "1.0.0-alpha.9",
94
- "@flex-development/docast-parse": "1.0.0-alpha.4",
95
- "@flex-development/mkbuild": "1.0.0-alpha.15",
96
- "@graphql-eslint/eslint-plugin": "3.16.1",
97
- "@sindresorhus/slugify": "2.2.0",
98
- "@types/chai": "4.3.4",
97
+ "@flex-development/decorator-regex": "2.0.0",
98
+ "@flex-development/docast": "1.0.0-alpha.13",
99
+ "@flex-development/docast-parse": "1.0.0-alpha.5",
100
+ "@flex-development/esm-types": "2.0.0",
101
+ "@flex-development/mkbuild": "1.0.0-alpha.20",
102
+ "@graphql-eslint/eslint-plugin": "3.20.1",
103
+ "@sindresorhus/slugify": "2.2.1",
104
+ "@types/chai": "4.3.5",
99
105
  "@types/chai-string": "1.4.2",
100
106
  "@types/conventional-changelog": "3.1.1",
101
107
  "@types/conventional-changelog-core": "4.2.1",
102
108
  "@types/conventional-changelog-writer": "4.0.2",
103
109
  "@types/conventional-recommended-bump": "6.1.0",
104
110
  "@types/dateformat": "5.0.0",
105
- "@types/eslint": "8.21.1",
111
+ "@types/eslint": "8.44.2",
106
112
  "@types/git-raw-commits": "2.0.1",
107
113
  "@types/is-ci": "3.0.0",
108
114
  "@types/markdown-it": "12.2.3",
109
- "@types/node": "18.14.4",
115
+ "@types/node": "20.4.8",
110
116
  "@types/node-notifier": "8.0.2",
111
- "@types/prettier": "2.7.2",
112
- "@types/semver": "7.3.13",
113
- "@types/unist": "2.0.6",
114
- "@typescript-eslint/eslint-plugin": "5.54.0",
115
- "@typescript-eslint/parser": "5.54.0",
117
+ "@types/prettier": "3.0.0",
118
+ "@types/semver": "7.5.0",
119
+ "@types/unist": "3.0.0",
120
+ "@typescript-eslint/eslint-plugin": "6.2.1",
121
+ "@typescript-eslint/parser": "6.2.1",
116
122
  "@vates/toggle-scripts": "1.0.0",
117
- "@vitest/coverage-c8": "0.29.2",
118
- "@vitest/ui": "0.29.2",
119
- "@vue/runtime-core": "3.2.47",
123
+ "@vitest/coverage-v8": "0.34.1",
124
+ "@vue/runtime-core": "3.3.4",
120
125
  "add-stream": "1.0.0",
121
- "algoliasearch": "4.15.0",
122
- "chai": "4.3.7",
126
+ "algoliasearch": "4.19.1",
127
+ "chai": "5.0.0-alpha.1",
123
128
  "chai-each": "0.0.1",
124
129
  "chai-quantifiers": "1.0.17",
125
130
  "chai-string": "1.5.0",
126
131
  "cheerio": "1.0.0-rc.12",
127
- "conventional-changelog": "3.1.25",
128
- "conventional-changelog-conventionalcommits": "5.0.0",
129
- "conventional-changelog-core": "4.2.4",
130
- "conventional-changelog-writer": "5.0.1",
131
- "conventional-recommended-bump": "6.1.0",
132
+ "conventional-changelog": "4.0.0",
133
+ "conventional-changelog-conventionalcommits": "6.1.0",
134
+ "conventional-changelog-core": "5.0.2",
135
+ "conventional-changelog-writer": "6.0.1",
136
+ "conventional-recommended-bump": "7.0.1",
132
137
  "cross-env": "7.0.3",
133
- "cspell": "6.27.0",
138
+ "cspell": "7.0.1-alpha.8",
134
139
  "dateformat": "5.0.3",
135
- "dotenv": "16.0.3",
136
- "esbuild": "0.17.10",
137
- "escape-string-regexp": "5.0.0",
138
- "eslint": "8.35.0",
139
- "eslint-config-prettier": "8.6.0",
140
+ "dotenv": "16.3.1",
141
+ "esbuild": "0.18.19",
142
+ "eslint": "8.46.0",
143
+ "eslint-config-prettier": "9.0.0",
144
+ "eslint-import-resolver-typescript": "3.5.5",
140
145
  "eslint-plugin-chai-expect": "3.0.0",
146
+ "eslint-plugin-import": "2.27.5",
141
147
  "eslint-plugin-jest-formatting": "3.1.0",
142
- "eslint-plugin-jsdoc": "40.0.1",
143
- "eslint-plugin-jsonc": "2.6.0",
144
- "eslint-plugin-markdown": "3.0.0",
145
- "eslint-plugin-markdownlint": "0.4.0",
148
+ "eslint-plugin-jsdoc": "44.1.0",
149
+ "eslint-plugin-jsonc": "2.9.0",
150
+ "eslint-plugin-markdown": "3.0.1",
151
+ "eslint-plugin-markdownlint": "0.4.1",
146
152
  "eslint-plugin-node": "11.1.0",
147
- "eslint-plugin-prettier": "4.2.1",
153
+ "eslint-plugin-prettier": "5.0.0",
148
154
  "eslint-plugin-promise": "6.1.1",
149
- "eslint-plugin-unicorn": "45.0.2",
150
- "eslint-plugin-vue": "9.9.0",
151
- "eslint-plugin-yml": "1.5.0",
152
- "globby": "13.1.3",
153
- "graphql": "16.6.0",
154
- "graphql-config": "4.4.1",
155
+ "eslint-plugin-unicorn": "48.0.1",
156
+ "eslint-plugin-vue": "9.16.1",
157
+ "eslint-plugin-yml": "1.8.0",
158
+ "globby": "13.2.2",
159
+ "graphql": "16.7.1",
160
+ "graphql-config": "5.0.2",
161
+ "gray-matter": "4.0.3",
155
162
  "growl": "1.10.5",
156
163
  "husky": "8.0.3",
157
164
  "is-ci": "3.0.1",
158
- "jsonc-eslint-parser": "2.1.0",
159
- "lint-staged": "13.1.2",
165
+ "jsonc-eslint-parser": "2.3.0",
166
+ "lint-staged": "13.2.3",
160
167
  "mri": "1.2.0",
161
- "node-fetch": "3.3.0",
168
+ "node-fetch": "3.3.2",
162
169
  "node-notifier": "10.0.1",
163
- "prettier": "2.8.4",
164
- "prettier-plugin-sh": "0.12.8",
165
- "pupa": "3.1.0",
170
+ "pkg-size": "2.4.0",
171
+ "prettier": "3.0.1",
172
+ "prettier-plugin-sh": "0.13.1",
166
173
  "sade": "1.8.1",
167
- "semver": "7.3.8",
168
- "serve": "14.2.0",
169
- "sitemap": "7.1.1",
174
+ "semver": "7.5.4",
170
175
  "tempfile": "5.0.0",
171
176
  "trash-cli": "5.0.0",
172
177
  "ts-dedent": "2.2.0",
173
- "typescript": "5.1.0-dev.20230301",
178
+ "typescript": "5.1.6",
174
179
  "unified": "10.1.2",
175
- "unist-util-remove": "3.1.0",
176
- "unist-util-source": "4.0.2",
177
- "unist-util-visit": "4.1.2",
178
- "vercel": "28.16.12",
180
+ "unist-util-remove": "4.0.0",
181
+ "unist-util-source": "5.0.0",
182
+ "unist-util-visit": "5.0.0",
183
+ "vercel": "31.2.2",
179
184
  "version-bump-prompt": "6.1.0",
180
- "vfile": "5.3.7",
181
- "vite": "4.1.4",
182
- "vite-tsconfig-paths": "4.0.5",
183
- "vitepress": "1.0.0-alpha.34",
184
- "vitest": "0.29.2",
185
+ "vfile": "6.0.1",
186
+ "vite": "4.4.8",
187
+ "vite-tsconfig-paths": "4.2.0",
188
+ "vitepress": "1.0.0-beta.7",
189
+ "vitest": "0.34.1",
185
190
  "vitest-github-actions-reporter": "0.10.0",
186
- "vue": "3.2.47",
187
- "vue-eslint-parser": "9.1.0",
188
- "vue-tsc": "1.2.0",
189
- "yaml-eslint-parser": "1.1.0"
191
+ "vue": "3.3.4",
192
+ "vue-eslint-parser": "9.3.1",
193
+ "vue-tsc": "1.7.8",
194
+ "yaml-eslint-parser": "1.2.2"
190
195
  },
191
196
  "peerDependencies": {
192
- "@types/node": ">=14.17.0",
197
+ "@types/node": ">=16.18.23",
193
198
  "node-fetch": ">=3.3.0"
194
199
  },
195
200
  "peerDependenciesMeta": {
@@ -199,11 +204,14 @@
199
204
  },
200
205
  "resolutions": {
201
206
  "@ardatan/sync-fetch": "larsgw/sync-fetch#head=worker_threads",
202
- "@flex-development/tutils": "6.0.0-alpha.10",
203
- "vitepress@npm:1.0.0-alpha.34": "patch:vitepress@npm%3A1.0.0-alpha.34#patches/vitepress+1.0.0-alpha.34.dev.patch"
207
+ "@types/unist": "3.0.0",
208
+ "chai": "5.0.0-alpha.1",
209
+ "gray-matter": "4.0.3",
210
+ "vfile": "6.0.1",
211
+ "vitepress@npm:1.0.0-beta.7": "patch:vitepress@npm%3A1.0.0-beta.7#patches/vitepress+1.0.0-beta.7.dev.patch"
204
212
  },
205
213
  "engines": {
206
- "node": ">=14.17.0",
214
+ "node": ">=16.20.0",
207
215
  "yarn": "4.0.0-rc.39"
208
216
  },
209
217
  "packageManager": "yarn@4.0.0-rc.39",
@@ -4,7 +4,6 @@
4
4
  */
5
5
 
6
6
  import type { StatementSyntaxKind } from '#src/enums'
7
- import type { SyntaxKindImport } from '#src/types'
8
7
  import type { EmptyString, LiteralUnion } from '@flex-development/tutils'
9
8
  import type ImportStatement from './statement-import'
10
9
 
@@ -13,7 +12,6 @@ import type ImportStatement from './statement-import'
13
12
  *
14
13
  * @see {@linkcode ImportStatement}
15
14
  * @see {@linkcode StatementSyntaxKind}
16
- * @see {@linkcode SyntaxKindImport}
17
15
  * @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/import
18
16
  *
19
17
  * @extends {ImportStatement}
@@ -42,7 +40,7 @@ interface DynamicImport extends ImportStatement {
42
40
  /**
43
41
  * Statement syntax kind.
44
42
  */
45
- syntax: Extract<SyntaxKindImport, StatementSyntaxKind.DYNAMIC>
43
+ syntax: StatementSyntaxKind.DYNAMIC
46
44
  }
47
45
 
48
46
  export type { DynamicImport as default }
@@ -4,7 +4,6 @@
4
4
  */
5
5
 
6
6
  import type { StatementSyntaxKind } from '#src/enums'
7
- import type { SyntaxKindImport } from '#src/types'
8
7
  import type { EmptyString, LiteralUnion } from '@flex-development/tutils'
9
8
  import type ImportStatement from './statement-import'
10
9
 
@@ -13,7 +12,6 @@ import type ImportStatement from './statement-import'
13
12
  *
14
13
  * @see {@linkcode ImportStatement}
15
14
  * @see {@linkcode StatementSyntaxKind}
16
- * @see {@linkcode SyntaxKindImport}
17
15
  *
18
16
  * @extends {ImportStatement}
19
17
  */
@@ -31,15 +29,13 @@ interface StaticImport extends ImportStatement {
31
29
  /**
32
30
  * Statement syntax kind.
33
31
  */
34
- syntax: Extract<
35
- SyntaxKindImport,
32
+ syntax:
36
33
  | StatementSyntaxKind.DEFAULT
37
34
  | StatementSyntaxKind.DEFAULT_WITH_NAMED
38
35
  | StatementSyntaxKind.DEFAULT_WITH_NAMESPACE
39
36
  | StatementSyntaxKind.NAMED
40
37
  | StatementSyntaxKind.NAMESPACE
41
38
  | StatementSyntaxKind.SIDE_EFFECT
42
- >
43
39
 
44
40
  /**
45
41
  * Type-only import statement check.
@@ -4,6 +4,7 @@
4
4
  */
5
5
 
6
6
  import type { ModuleId } from '#src/types'
7
+ import type { Optional } from '@flex-development/tutils'
7
8
 
8
9
  /**
9
10
  * Subpath search options.
@@ -18,7 +19,7 @@ interface FindSubpathOptions {
18
19
  *
19
20
  * @default 'default'
20
21
  */
21
- condition?: string | undefined
22
+ condition?: Optional<string>
22
23
 
23
24
  /**
24
25
  * Export conditions.
@@ -29,7 +30,7 @@ interface FindSubpathOptions {
29
30
  *
30
31
  * @default CONDITIONS
31
32
  */
32
- conditions?: Set<string> | undefined
33
+ conditions?: Optional<Set<string>>
33
34
 
34
35
  /**
35
36
  * URL of directory containing relevant `package.json` file.
@@ -43,7 +44,7 @@ interface FindSubpathOptions {
43
44
  *
44
45
  * @default false
45
46
  */
46
- internal?: boolean | undefined
47
+ internal?: Optional<boolean>
47
48
 
48
49
  /**
49
50
  * URL of module to resolve from.
@@ -5,7 +5,7 @@
5
5
 
6
6
  import type { Format } from '#src/enums'
7
7
  import type { Ext } from '@flex-development/pathe'
8
- import type { EmptyString } from '@flex-development/tutils'
8
+ import type { EmptyString, Optional } from '@flex-development/tutils'
9
9
 
10
10
  /**
11
11
  * Module format retrieval options.
@@ -22,7 +22,7 @@ interface GetFormatOptions {
22
22
  *
23
23
  * @default true
24
24
  */
25
- experimental_json_modules?: boolean | undefined
25
+ experimental_json_modules?: Optional<boolean>
26
26
 
27
27
  /**
28
28
  * Enable support for network based modules.
@@ -35,7 +35,7 @@ interface GetFormatOptions {
35
35
  *
36
36
  * @default false
37
37
  */
38
- experimental_network_imports?: boolean | undefined
38
+ experimental_network_imports?: Optional<boolean>
39
39
 
40
40
  /**
41
41
  * Enable support for WebAssembly modules.
@@ -44,14 +44,14 @@ interface GetFormatOptions {
44
44
  *
45
45
  * @default false
46
46
  */
47
- experimental_wasm_modules?: boolean | undefined
47
+ experimental_wasm_modules?: Optional<boolean>
48
48
 
49
49
  /**
50
50
  * Map file extensions to module formats.
51
51
  *
52
52
  * @default EXTENSION_FORMAT_MAP
53
53
  */
54
- extension_format_map?: Map<EmptyString | Ext, Format> | undefined
54
+ extension_format_map?: Optional<Map<EmptyString | Ext, Format>>
55
55
 
56
56
  /**
57
57
  * Return `undefined` when module format is not found, rather than `null`.
@@ -63,7 +63,7 @@ interface GetFormatOptions {
63
63
  *
64
64
  * @default false
65
65
  */
66
- ignore_errors?: boolean | undefined
66
+ ignore_errors?: Optional<boolean>
67
67
 
68
68
  /**
69
69
  * Request options for network based modules.
@@ -74,7 +74,7 @@ interface GetFormatOptions {
74
74
  *
75
75
  * @default {}
76
76
  */
77
- req?: import('node-fetch').RequestInit | undefined
77
+ req?: Optional<import('node-fetch').RequestInit>
78
78
  }
79
79
 
80
80
  export type { GetFormatOptions as default }
@@ -4,6 +4,7 @@
4
4
  */
5
5
 
6
6
  import type { Format } from '#src/enums'
7
+ import type { Optional, OrLowercase } from '@flex-development/tutils'
7
8
 
8
9
  /**
9
10
  * Source code retrieval options.
@@ -23,7 +24,7 @@ interface GetSourceOptions {
23
24
  *
24
25
  * @default false
25
26
  */
26
- experimental_network_imports?: boolean | undefined
27
+ experimental_network_imports?: Optional<boolean>
27
28
 
28
29
  /**
29
30
  * Module format hint.
@@ -32,7 +33,7 @@ interface GetSourceOptions {
32
33
  *
33
34
  * @default undefined
34
35
  */
35
- format?: Format | Lowercase<keyof typeof Format> | undefined
36
+ format?: Optional<OrLowercase<Format>>
36
37
 
37
38
  /**
38
39
  * Ignore [`ERR_UNSUPPORTED_ESM_URL_SCHEME`][1] if thrown.
@@ -41,7 +42,7 @@ interface GetSourceOptions {
41
42
  *
42
43
  * @default false
43
44
  */
44
- ignore_errors?: boolean | undefined
45
+ ignore_errors?: Optional<boolean>
45
46
 
46
47
  /**
47
48
  * Request options for network based modules.
@@ -52,7 +53,7 @@ interface GetSourceOptions {
52
53
  *
53
54
  * @default {}
54
55
  */
55
- req?: import('node-fetch').RequestInit | undefined
56
+ req?: Optional<import('node-fetch').RequestInit>
56
57
  }
57
58
 
58
59
  export type { GetSourceOptions as default }
@@ -4,6 +4,7 @@
4
4
  */
5
5
 
6
6
  import type { ModuleId } from '#src/types'
7
+ import type { Optional } from '@flex-development/tutils'
7
8
 
8
9
  /**
9
10
  * Module id parsing options.
@@ -18,7 +19,7 @@ interface ParseModuleIdOptions {
18
19
  *
19
20
  * @default id instanceof URL ? false : id.startsWith('#')
20
21
  */
21
- internal?: boolean | undefined
22
+ internal?: Optional<boolean>
22
23
 
23
24
  /**
24
25
  * URL of module to resolve from.
@@ -27,12 +28,12 @@ interface ParseModuleIdOptions {
27
28
  *
28
29
  * @default undefined
29
30
  */
30
- parent?: ModuleId | undefined
31
+ parent?: Optional<ModuleId>
31
32
 
32
33
  /**
33
34
  * Ensure module id begins with a valid package name.
34
35
  */
35
- pkgname?: boolean | undefined
36
+ pkgname?: Optional<boolean>
36
37
  }
37
38
 
38
39
  export type { ParseModuleIdOptions as default }
@@ -4,6 +4,7 @@
4
4
  */
5
5
 
6
6
  import type { ModuleId } from '#src/types'
7
+ import type { Optional } from '@flex-development/tutils'
7
8
 
8
9
  /**
9
10
  * Subpath parsing options.
@@ -18,7 +19,7 @@ interface ParseSubpathOptions {
18
19
  *
19
20
  * @default 'default'
20
21
  */
21
- condition?: string | undefined
22
+ condition?: Optional<string>
22
23
 
23
24
  /**
24
25
  * Export conditions.
@@ -29,7 +30,7 @@ interface ParseSubpathOptions {
29
30
  *
30
31
  * @default CONDITIONS
31
32
  */
32
- conditions?: Set<string> | string[] | undefined
33
+ conditions?: Optional<Set<string> | string[]>
33
34
 
34
35
  /**
35
36
  * URL of directory containing relevant `package.json` file.
@@ -43,7 +44,7 @@ interface ParseSubpathOptions {
43
44
  *
44
45
  * @default specifier.startsWith('#')
45
46
  */
46
- internal?: boolean | undefined
47
+ internal?: Optional<boolean>
47
48
 
48
49
  /**
49
50
  * URL of module to resolve from.
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import type { ModuleId } from '#src/types'
7
- import type { MapLike, OneOrMany } from '@flex-development/tutils'
7
+ import type { MapLike, OneOrMany, Optional } from '@flex-development/tutils'
8
8
  import type ResolveModuleOptions from './options-resolve-module'
9
9
 
10
10
  /**
@@ -26,7 +26,7 @@ interface ResolveAliasOptions extends ResolveModuleOptions {
26
26
  *
27
27
  * @default true
28
28
  */
29
- absolute?: boolean | undefined
29
+ absolute?: Optional<boolean>
30
30
 
31
31
  /**
32
32
  * Path mappings.
@@ -35,14 +35,14 @@ interface ResolveAliasOptions extends ResolveModuleOptions {
35
35
  *
36
36
  * @default {}
37
37
  */
38
- aliases?: MapLike<OneOrMany<string>> | undefined
38
+ aliases?: Optional<MapLike<OneOrMany<string>>>
39
39
 
40
40
  /**
41
41
  * Directory to resolve non-absolute modules from.
42
42
  *
43
43
  * @default pathToFileURL('.')
44
44
  */
45
- cwd?: ModuleId | undefined
45
+ cwd?: Optional<ModuleId>
46
46
 
47
47
  /**
48
48
  * Id of module to resolve from.
@@ -53,7 +53,7 @@ interface ResolveAliasOptions extends ResolveModuleOptions {
53
53
  *
54
54
  * @default import.meta.url
55
55
  */
56
- parent?: ModuleId | undefined
56
+ parent?: Optional<ModuleId>
57
57
  }
58
58
 
59
59
  export type { ResolveAliasOptions as default }
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import type { ChangeExtFn, ModuleId } from '#src/types'
7
- import type { Nilable } from '@flex-development/tutils'
7
+ import type { Nilable, Optional } from '@flex-development/tutils'
8
8
 
9
9
  /**
10
10
  * Module resolution options.
@@ -20,7 +20,7 @@ interface ResolveModuleOptions {
20
20
  *
21
21
  * @default 'default'
22
22
  */
23
- condition?: string | undefined
23
+ condition?: Optional<string>
24
24
 
25
25
  /**
26
26
  * Export conditions.
@@ -31,7 +31,7 @@ interface ResolveModuleOptions {
31
31
  *
32
32
  * @default CONDITIONS
33
33
  */
34
- conditions?: Set<string> | string[] | undefined
34
+ conditions?: Optional<Set<string> | string[]>
35
35
 
36
36
  /**
37
37
  * Replacement file extension or function that returns a file extension.
@@ -50,7 +50,7 @@ interface ResolveModuleOptions {
50
50
  *
51
51
  * @default RESOLVE_EXTENSIONS
52
52
  */
53
- extensions?: Set<string> | string[] | undefined
53
+ extensions?: Optional<Set<string> | string[]>
54
54
 
55
55
  /**
56
56
  * URL of module to resolve from.
@@ -59,14 +59,14 @@ interface ResolveModuleOptions {
59
59
  *
60
60
  * @default import.meta.url
61
61
  */
62
- parent?: ModuleId | undefined
62
+ parent?: Optional<ModuleId>
63
63
 
64
64
  /**
65
65
  * Keep symlinks instead of resolving them.
66
66
  *
67
67
  * @default false
68
68
  */
69
- preserveSymlinks?: boolean | undefined
69
+ preserveSymlinks?: Optional<boolean>
70
70
  }
71
71
 
72
72
  export type { ResolveModuleOptions as default }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @file Internal - dequote
3
+ * @module mlly/internal/dequote
4
+ */
5
+
6
+ import { trim } from '@flex-development/tutils'
7
+
8
+ /**
9
+ * Removes quotes from the beginning and end of a string.
10
+ *
11
+ * @internal
12
+ *
13
+ * @param {string} str - String to dequote
14
+ * @return {string} String with quotes removed
15
+ */
16
+ const dequote = (str: string): string => trim(str).replace(/^["']|["']$/g, '')
17
+
18
+ export default dequote
@@ -13,6 +13,8 @@ import { AssertType, Format } from '#src/enums'
13
13
  *
14
14
  * @see https://github.com/WebAssembly/esm-integration/issues/42
15
15
  *
16
+ * @internal
17
+ *
16
18
  * @const {Map<Format, AssertType>} FORMAT_TYPE_MAP
17
19
  */
18
20
  const FORMAT_TYPE_MAP: Map<Format, AssertType> = new Map<Format, AssertType>([