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

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 (181) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/index.d.mts +2 -2
  3. package/dist/index.mjs +0 -2
  4. package/dist/index.mjs.map +5 -6
  5. package/dist/internal/dequote.mjs +1 -0
  6. package/dist/internal/dequote.mjs.map +8 -0
  7. package/dist/internal/format-type-map.mjs +1 -0
  8. package/dist/internal/format-type-map.mjs.map +8 -0
  9. package/dist/internal/get-specifier-kind.mjs +1 -0
  10. package/dist/internal/get-specifier-kind.mjs.map +8 -0
  11. package/dist/internal/get-subpaths.mjs +1 -0
  12. package/dist/internal/get-subpaths.mjs.map +8 -0
  13. package/dist/internal/regex-encoded-sep.mjs +1 -0
  14. package/dist/internal/regex-encoded-sep.mjs.map +8 -0
  15. package/dist/internal/regex-internal-specifier.mjs +1 -0
  16. package/dist/internal/regex-internal-specifier.mjs.map +8 -0
  17. package/dist/internal/regex-invalid-segment.mjs +1 -0
  18. package/dist/internal/regex-invalid-segment.mjs.map +8 -0
  19. package/dist/internal/regex-package-name.mjs +1 -0
  20. package/dist/internal/regex-package-name.mjs.map +8 -0
  21. package/dist/internal/regex-package-path.mjs +1 -0
  22. package/dist/internal/regex-package-path.mjs.map +8 -0
  23. package/dist/internal/resolver.mjs +1 -0
  24. package/dist/internal/resolver.mjs.map +8 -0
  25. package/dist/internal/validate-array-set.mjs +1 -0
  26. package/dist/internal/validate-array-set.mjs.map +8 -0
  27. package/dist/internal/validate-boolean.mjs +1 -0
  28. package/dist/internal/validate-boolean.mjs.map +8 -0
  29. package/dist/internal/validate-map.mjs +1 -0
  30. package/dist/internal/validate-map.mjs.map +8 -0
  31. package/dist/internal/validate-object.mjs +1 -0
  32. package/dist/internal/validate-object.mjs.map +8 -0
  33. package/dist/internal/validate-set.mjs +1 -0
  34. package/dist/internal/validate-set.mjs.map +8 -0
  35. package/dist/internal/validate-string.mjs +1 -0
  36. package/dist/internal/validate-string.mjs.map +8 -0
  37. package/dist/internal/validate-url-string.mjs +1 -0
  38. package/dist/internal/validate-url-string.mjs.map +8 -0
  39. package/dist/utils/compare-subpaths.mjs.map +4 -5
  40. package/dist/utils/conditions.mjs.map +4 -5
  41. package/dist/utils/detect-syntax.mjs.map +4 -5
  42. package/dist/utils/extension-format-map.mjs.map +4 -5
  43. package/dist/utils/extract-statements.mjs.map +4 -5
  44. package/dist/utils/fill-modules.mjs.map +5 -8
  45. package/dist/utils/find-dynamic-imports.mjs.map +5 -8
  46. package/dist/utils/find-exports.mjs.map +5 -8
  47. package/dist/utils/find-requires.mjs.map +5 -8
  48. package/dist/utils/find-static-imports.mjs.map +5 -8
  49. package/dist/utils/find-subpath.mjs.map +5 -9
  50. package/dist/utils/get-format.mjs.map +5 -8
  51. package/dist/utils/get-source.mjs.map +4 -5
  52. package/dist/utils/has-cjs-syntax.mjs.map +4 -5
  53. package/dist/utils/has-esm-syntax.mjs.map +4 -5
  54. package/dist/utils/index.mjs.map +5 -8
  55. package/dist/utils/is-absolute-specifier.mjs.map +4 -5
  56. package/dist/utils/is-bare-specifier.mjs.map +4 -5
  57. package/dist/utils/is-directory.mjs.map +4 -5
  58. package/dist/utils/is-exports-sugar.mjs.map +4 -5
  59. package/dist/utils/is-file.mjs.map +4 -5
  60. package/dist/utils/is-relative-specifier.mjs.map +4 -5
  61. package/dist/utils/lookup-package-scope.mjs.map +4 -5
  62. package/dist/utils/parse-data-url.mjs.map +4 -5
  63. package/dist/utils/parse-module-id.mjs.map +5 -9
  64. package/dist/utils/parse-subpath.mjs.map +5 -8
  65. package/dist/utils/pattern-character.mjs.map +4 -5
  66. package/dist/utils/read-package-json.mjs.map +4 -5
  67. package/dist/utils/resolve-alias.mjs.map +5 -9
  68. package/dist/utils/resolve-aliases.mjs.map +4 -5
  69. package/dist/utils/resolve-extensions.mjs.map +4 -5
  70. package/dist/utils/resolve-module.d.mts +1 -1
  71. package/dist/utils/resolve-module.mjs.map +4 -5
  72. package/dist/utils/resolve-modules.mjs.map +4 -5
  73. package/dist/utils/to-absolute-specifier.mjs.map +4 -5
  74. package/dist/utils/to-bare-specifier.mjs +8 -1
  75. package/dist/utils/to-bare-specifier.mjs.map +5 -6
  76. package/dist/utils/to-data-url.mjs.map +4 -5
  77. package/dist/utils/to-node-url.mjs.map +4 -5
  78. package/dist/utils/to-relative-specifier.mjs.map +4 -5
  79. package/dist/utils/to-url.mjs.map +4 -5
  80. package/dist/utils/validate-assertions.mjs.map +5 -8
  81. package/dist/utils/validate-exports.mjs.map +4 -5
  82. package/package.json +16 -17
  83. package/dist/interfaces/index.mjs +0 -0
  84. package/dist/types/index.mjs +0 -0
  85. package/src/enums/assert-type.ts +0 -23
  86. package/src/enums/format.ts +0 -19
  87. package/src/enums/index.ts +0 -11
  88. package/src/enums/kind-specifier-syntax.ts +0 -16
  89. package/src/enums/kind-specifier.ts +0 -19
  90. package/src/enums/kind-statement-syntax.ts +0 -24
  91. package/src/enums/kind-statement.ts +0 -17
  92. package/src/index.ts +0 -9
  93. package/src/interfaces/import-assertions.ts +0 -24
  94. package/src/interfaces/import-dynamic.ts +0 -46
  95. package/src/interfaces/import-static.ts +0 -46
  96. package/src/interfaces/index.ts +0 -25
  97. package/src/interfaces/options-fill-module.ts +0 -26
  98. package/src/interfaces/options-find-subpath.ts +0 -57
  99. package/src/interfaces/options-get-format.ts +0 -80
  100. package/src/interfaces/options-get-source.ts +0 -59
  101. package/src/interfaces/options-parse-module-id.ts +0 -39
  102. package/src/interfaces/options-parse-subpath.ts +0 -57
  103. package/src/interfaces/options-resolve-alias.ts +0 -59
  104. package/src/interfaces/options-resolve-module.ts +0 -72
  105. package/src/interfaces/options-resolve.ts +0 -17
  106. package/src/interfaces/package-scope.ts +0 -30
  107. package/src/interfaces/parsed-data-url.ts +0 -63
  108. package/src/interfaces/parsed-module-id.ts +0 -90
  109. package/src/interfaces/parsed-subpath.ts +0 -56
  110. package/src/interfaces/statement-export.ts +0 -52
  111. package/src/interfaces/statement-import.ts +0 -45
  112. package/src/interfaces/statement-require.ts +0 -45
  113. package/src/interfaces/statement.ts +0 -64
  114. package/src/internal/dequote.ts +0 -18
  115. package/src/internal/format-type-map.ts +0 -28
  116. package/src/internal/get-specifier-kind.ts +0 -41
  117. package/src/internal/get-subpaths.ts +0 -43
  118. package/src/internal/regex-encoded-sep.ts +0 -17
  119. package/src/internal/regex-internal-specifier.ts +0 -19
  120. package/src/internal/regex-invalid-segment.ts +0 -25
  121. package/src/internal/regex-package-name.ts +0 -18
  122. package/src/internal/regex-package-path.ts +0 -20
  123. package/src/internal/resolver.ts +0 -790
  124. package/src/internal/validate-array-set.ts +0 -35
  125. package/src/internal/validate-boolean.ts +0 -30
  126. package/src/internal/validate-map.ts +0 -36
  127. package/src/internal/validate-object.ts +0 -30
  128. package/src/internal/validate-set.ts +0 -32
  129. package/src/internal/validate-string.ts +0 -31
  130. package/src/internal/validate-url-string.ts +0 -34
  131. package/src/types/declaration.ts +0 -22
  132. package/src/types/fn-change-ext.ts +0 -33
  133. package/src/types/index.ts +0 -14
  134. package/src/types/mime-type.ts +0 -19
  135. package/src/types/module-id.ts +0 -15
  136. package/src/types/module-specifier-type.ts +0 -13
  137. package/src/types/protocol.ts +0 -40
  138. package/src/types/syntax-kind-export.ts +0 -20
  139. package/src/types/syntax-kind-import.ts +0 -22
  140. package/src/types/syntax-kind-require.ts +0 -15
  141. package/src/utils/compare-subpaths.ts +0 -100
  142. package/src/utils/conditions.ts +0 -15
  143. package/src/utils/detect-syntax.ts +0 -40
  144. package/src/utils/extension-format-map.ts +0 -34
  145. package/src/utils/extract-statements.ts +0 -46
  146. package/src/utils/fill-modules.ts +0 -133
  147. package/src/utils/find-dynamic-imports.ts +0 -75
  148. package/src/utils/find-exports.ts +0 -156
  149. package/src/utils/find-requires.ts +0 -75
  150. package/src/utils/find-static-imports.ts +0 -86
  151. package/src/utils/find-subpath.ts +0 -251
  152. package/src/utils/get-format.ts +0 -249
  153. package/src/utils/get-source.ts +0 -144
  154. package/src/utils/has-cjs-syntax.ts +0 -44
  155. package/src/utils/has-esm-syntax.ts +0 -40
  156. package/src/utils/index.ts +0 -45
  157. package/src/utils/is-absolute-specifier.ts +0 -53
  158. package/src/utils/is-bare-specifier.ts +0 -36
  159. package/src/utils/is-directory.ts +0 -25
  160. package/src/utils/is-exports-sugar.ts +0 -81
  161. package/src/utils/is-file.ts +0 -25
  162. package/src/utils/is-relative-specifier.ts +0 -34
  163. package/src/utils/lookup-package-scope.ts +0 -97
  164. package/src/utils/parse-data-url.ts +0 -71
  165. package/src/utils/parse-module-id.ts +0 -197
  166. package/src/utils/parse-subpath.ts +0 -331
  167. package/src/utils/pattern-character.ts +0 -13
  168. package/src/utils/read-package-json.ts +0 -113
  169. package/src/utils/resolve-alias.ts +0 -224
  170. package/src/utils/resolve-aliases.ts +0 -58
  171. package/src/utils/resolve-extensions.ts +0 -33
  172. package/src/utils/resolve-module.ts +0 -181
  173. package/src/utils/resolve-modules.ts +0 -60
  174. package/src/utils/to-absolute-specifier.ts +0 -30
  175. package/src/utils/to-bare-specifier.ts +0 -211
  176. package/src/utils/to-data-url.ts +0 -42
  177. package/src/utils/to-node-url.ts +0 -27
  178. package/src/utils/to-relative-specifier.ts +0 -55
  179. package/src/utils/to-url.ts +0 -30
  180. package/src/utils/validate-assertions.ts +0 -126
  181. package/src/utils/validate-exports.ts +0 -131
@@ -1,24 +0,0 @@
1
- /**
2
- * @file Interfaces - ImportAssertions
3
- * @module mlly/interfaces/ImportAssertions
4
- */
5
-
6
- import type { AssertType } from '#src/enums'
7
- import type { LiteralUnion } from '@flex-development/tutils'
8
-
9
- /**
10
- * `import` assertions schema.
11
- *
12
- * @see {@linkcode AssertType}
13
- * @see https://github.com/tc39/proposal-import-assertions
14
- */
15
- interface ImportAssertions {
16
- [key: string]: string
17
-
18
- /**
19
- * Assertion type.
20
- */
21
- type?: LiteralUnion<AssertType, string>
22
- }
23
-
24
- export type { ImportAssertions as default }
@@ -1,46 +0,0 @@
1
- /**
2
- * @file Interfaces - DynamicImport
3
- * @module mlly/interfaces/DynamicImport
4
- */
5
-
6
- import type { StatementSyntaxKind } from '#src/enums'
7
- import type { EmptyString, LiteralUnion } from '@flex-development/tutils'
8
- import type ImportStatement from './statement-import'
9
-
10
- /**
11
- * Dynamic import statement object.
12
- *
13
- * @see {@linkcode ImportStatement}
14
- * @see {@linkcode StatementSyntaxKind}
15
- * @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/import
16
- *
17
- * @extends {ImportStatement}
18
- */
19
- interface DynamicImport extends ImportStatement {
20
- /**
21
- * Import expression.
22
- *
23
- * @example
24
- * 'import("foo.json")'
25
- * @example
26
- * 'import(foo)'
27
- */
28
- expression: LiteralUnion<EmptyString, string>
29
-
30
- /**
31
- * Options bag.
32
- *
33
- * @see https://github.com/tc39/proposal-import-assertions#dynamic-import
34
- *
35
- * @example
36
- * '{ assert: { type: "json" } }'
37
- */
38
- options: LiteralUnion<EmptyString, string>
39
-
40
- /**
41
- * Statement syntax kind.
42
- */
43
- syntax: StatementSyntaxKind.DYNAMIC
44
- }
45
-
46
- export type { DynamicImport as default }
@@ -1,46 +0,0 @@
1
- /**
2
- * @file Interfaces - StaticImport
3
- * @module mlly/interfaces/StaticImport
4
- */
5
-
6
- import type { StatementSyntaxKind } from '#src/enums'
7
- import type { EmptyString, LiteralUnion } from '@flex-development/tutils'
8
- import type ImportStatement from './statement-import'
9
-
10
- /**
11
- * Static import statement object.
12
- *
13
- * @see {@linkcode ImportStatement}
14
- * @see {@linkcode StatementSyntaxKind}
15
- *
16
- * @extends {ImportStatement}
17
- */
18
- interface StaticImport extends ImportStatement {
19
- /**
20
- * Assertion options.
21
- *
22
- * @see https://github.com/tc39/proposal-import-assertions#import-statements
23
- *
24
- * @example
25
- * '{ type: "json" }'
26
- */
27
- assertion: LiteralUnion<EmptyString, string>
28
-
29
- /**
30
- * Statement syntax kind.
31
- */
32
- syntax:
33
- | StatementSyntaxKind.DEFAULT
34
- | StatementSyntaxKind.DEFAULT_WITH_NAMED
35
- | StatementSyntaxKind.DEFAULT_WITH_NAMESPACE
36
- | StatementSyntaxKind.NAMED
37
- | StatementSyntaxKind.NAMESPACE
38
- | StatementSyntaxKind.SIDE_EFFECT
39
-
40
- /**
41
- * Type-only import statement check.
42
- */
43
- type: boolean
44
- }
45
-
46
- export type { StaticImport as default }
@@ -1,25 +0,0 @@
1
- /**
2
- * @file Interfaces
3
- * @module mlly/interfaces
4
- */
5
-
6
- export type { default as ImportAssertions } from './import-assertions'
7
- export type { default as DynamicImport } from './import-dynamic'
8
- export type { default as StaticImport } from './import-static'
9
- export type { default as FillModuleOptions } from './options-fill-module'
10
- export type { default as FindSubpathOptions } from './options-find-subpath'
11
- export type { default as GetFormatOptions } from './options-get-format'
12
- export type { default as GetSourceOptions } from './options-get-source'
13
- export type { default as ParseModuleIdOptions } from './options-parse-module-id'
14
- export type { default as ParseSubpathOptions } from './options-parse-subpath'
15
- export type { default as ResolveOptions } from './options-resolve'
16
- export type { default as ResolveAliasOptions } from './options-resolve-alias'
17
- export type { default as ResolveModuleOptions } from './options-resolve-module'
18
- export type { default as PackageScope } from './package-scope'
19
- export type { default as ParsedDataUrl } from './parsed-data-url'
20
- export type { default as ParsedModuleId } from './parsed-module-id'
21
- export type { default as ParsedSubpath } from './parsed-subpath'
22
- export type { default as Statement } from './statement'
23
- export type { default as ExportStatement } from './statement-export'
24
- export type { default as ImportStatement } from './statement-import'
25
- export type { default as RequireStatement } from './statement-require'
@@ -1,26 +0,0 @@
1
- /**
2
- * @file Interfaces - FillModuleOptions
3
- * @module mlly/interfaces/FillModuleOptions
4
- */
5
-
6
- import type { ChangeExtFn } from '#src/types'
7
- import type ResolveModuleOptions from './options-resolve-module'
8
-
9
- /**
10
- * Options for fully specifying modules.
11
- *
12
- * @see {@linkcode ChangeExtFn}
13
- * @see {@linkcode ResolveModuleOptions}
14
- * @see https://nodejs.org/api/esm.html#mandatory-file-extensions
15
- *
16
- * @extends {ResolveModuleOptions}
17
- */
18
- interface FillModuleOptions extends ResolveModuleOptions {
19
- /**
20
- * File extension to add to absolute and relative specifiers or a function
21
- * that returns a file extension.
22
- */
23
- ext: ChangeExtFn<string> | string
24
- }
25
-
26
- export type { FillModuleOptions as default }
@@ -1,57 +0,0 @@
1
- /**
2
- * @file Interfaces - FindSubpathOptions
3
- * @module mlly/interfaces/FindSubpathOptions
4
- */
5
-
6
- import type { ModuleId } from '#src/types'
7
- import type { Optional } from '@flex-development/tutils'
8
-
9
- /**
10
- * Subpath search options.
11
- *
12
- * @see {@linkcode ModuleId}
13
- */
14
- interface FindSubpathOptions {
15
- /**
16
- * Export condition to apply.
17
- *
18
- * @see https://nodejs.org/api/packages.html#conditional-exports
19
- *
20
- * @default 'default'
21
- */
22
- condition?: Optional<string>
23
-
24
- /**
25
- * Export conditions.
26
- *
27
- * **Note**: Should be sorted by priority.
28
- *
29
- * @see https://nodejs.org/api/packages.html#conditional-exports
30
- *
31
- * @default CONDITIONS
32
- */
33
- conditions?: Optional<Set<string>>
34
-
35
- /**
36
- * URL of directory containing relevant `package.json` file.
37
- */
38
- dir: ModuleId
39
-
40
- /**
41
- * Package [`imports`][1] hint.
42
- *
43
- * [1]: https://nodejs.org/api/packages.html#imports
44
- *
45
- * @default false
46
- */
47
- internal?: Optional<boolean>
48
-
49
- /**
50
- * URL of module to resolve from.
51
- *
52
- * **Note**: Used for error reporting only.
53
- */
54
- parent: ModuleId
55
- }
56
-
57
- export type { FindSubpathOptions as default }
@@ -1,80 +0,0 @@
1
- /**
2
- * @file Interfaces - GetFormatOptions
3
- * @module mlly/interfaces/GetFormatOptions
4
- */
5
-
6
- import type { Format } from '#src/enums'
7
- import type { Ext } from '@flex-development/pathe'
8
- import type { EmptyString, Optional } from '@flex-development/tutils'
9
-
10
- /**
11
- * Module format retrieval options.
12
- *
13
- * @see {@linkcode Ext}
14
- * @see {@linkcode Format}
15
- * @see {@linkcode RequestInit}
16
- */
17
- interface GetFormatOptions {
18
- /**
19
- * Enable support for JSON modules.
20
- *
21
- * @see https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_json_modules
22
- *
23
- * @default true
24
- */
25
- experimental_json_modules?: Optional<boolean>
26
-
27
- /**
28
- * Enable support for network based modules.
29
- *
30
- * **Note**: Requires [`node-fetch`][1].
31
- *
32
- * [1]: https://github.com/node-fetch/node-fetch
33
- *
34
- * @see https://nodejs.org/docs/latest-v16.x/api/esm.html#https-and-http-imports
35
- *
36
- * @default false
37
- */
38
- experimental_network_imports?: Optional<boolean>
39
-
40
- /**
41
- * Enable support for WebAssembly modules.
42
- *
43
- * @see https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_wasm_modules
44
- *
45
- * @default false
46
- */
47
- experimental_wasm_modules?: Optional<boolean>
48
-
49
- /**
50
- * Map file extensions to module formats.
51
- *
52
- * @default EXTENSION_FORMAT_MAP
53
- */
54
- extension_format_map?: Optional<Map<EmptyString | Ext, Format>>
55
-
56
- /**
57
- * Return `undefined` when module format is not found, rather than `null`.
58
- *
59
- * An explicit `undefined` return value indicates [`load`][1] hooks should
60
- * re-run module format checks.
61
- *
62
- * [1]: https://nodejs.org/docs/latest-v16.x/api/esm.html#loadurl-context-nextload
63
- *
64
- * @default false
65
- */
66
- ignore_errors?: Optional<boolean>
67
-
68
- /**
69
- * Request options for network based modules.
70
- *
71
- * Only applicable if {@linkcode experimental_network_imports} is enabled.
72
- *
73
- * @see {@linkcode RequestInit}
74
- *
75
- * @default {}
76
- */
77
- req?: Optional<import('node-fetch').RequestInit>
78
- }
79
-
80
- export type { GetFormatOptions as default }
@@ -1,59 +0,0 @@
1
- /**
2
- * @file Interfaces - GetSourceOptions
3
- * @module mlly/interfaces/GetSourceOptions
4
- */
5
-
6
- import type { Format } from '#src/enums'
7
- import type { Optional, OrLowercase } from '@flex-development/tutils'
8
-
9
- /**
10
- * Source code retrieval options.
11
- *
12
- * @see {@linkcode Format}
13
- * @see {@linkcode RequestInit}
14
- */
15
- interface GetSourceOptions {
16
- /**
17
- * Enable support for network based modules.
18
- *
19
- * **Note**: Requires [`node-fetch`][1].
20
- *
21
- * [1]: https://github.com/node-fetch/node-fetch
22
- *
23
- * @see https://nodejs.org/docs/latest-v16.x/api/esm.html#https-and-http-imports
24
- *
25
- * @default false
26
- */
27
- experimental_network_imports?: Optional<boolean>
28
-
29
- /**
30
- * Module format hint.
31
- *
32
- * @see {@linkcode Format}
33
- *
34
- * @default undefined
35
- */
36
- format?: Optional<OrLowercase<Format>>
37
-
38
- /**
39
- * Ignore [`ERR_UNSUPPORTED_ESM_URL_SCHEME`][1] if thrown.
40
- *
41
- * [1]: https://nodejs.org/api/errors.html#err_unsupported_esm_url_scheme
42
- *
43
- * @default false
44
- */
45
- ignore_errors?: Optional<boolean>
46
-
47
- /**
48
- * Request options for network based modules.
49
- *
50
- * Only applicable if {@linkcode experimental_network_imports} is enabled.
51
- *
52
- * @see {@linkcode RequestInit}
53
- *
54
- * @default {}
55
- */
56
- req?: Optional<import('node-fetch').RequestInit>
57
- }
58
-
59
- export type { GetSourceOptions as default }
@@ -1,39 +0,0 @@
1
- /**
2
- * @file Interfaces - ParseModuleIdOptions
3
- * @module mlly/interfaces/ParseModuleIdOptions
4
- */
5
-
6
- import type { ModuleId } from '#src/types'
7
- import type { Optional } from '@flex-development/tutils'
8
-
9
- /**
10
- * Module id parsing options.
11
- *
12
- * @see {@linkcode ModuleId}
13
- */
14
- interface ParseModuleIdOptions {
15
- /**
16
- * Ensure module id is a valid internal specifier, syntactically.
17
- *
18
- * @see https://nodejs.org/api/packages.html#subpath-imports
19
- *
20
- * @default id instanceof URL ? false : id.startsWith('#')
21
- */
22
- internal?: Optional<boolean>
23
-
24
- /**
25
- * URL of module to resolve from.
26
- *
27
- * **Note**: Used for error reporting only.
28
- *
29
- * @default undefined
30
- */
31
- parent?: Optional<ModuleId>
32
-
33
- /**
34
- * Ensure module id begins with a valid package name.
35
- */
36
- pkgname?: Optional<boolean>
37
- }
38
-
39
- export type { ParseModuleIdOptions as default }
@@ -1,57 +0,0 @@
1
- /**
2
- * @file Interfaces - ParseSubpathOptions
3
- * @module mlly/interfaces/ParseSubpathOptions
4
- */
5
-
6
- import type { ModuleId } from '#src/types'
7
- import type { Optional } from '@flex-development/tutils'
8
-
9
- /**
10
- * Subpath parsing options.
11
- *
12
- * @see {@linkcode ModuleId}
13
- */
14
- interface ParseSubpathOptions {
15
- /**
16
- * Export condition to apply.
17
- *
18
- * @see https://nodejs.org/api/packages.html#conditional-exports
19
- *
20
- * @default 'default'
21
- */
22
- condition?: Optional<string>
23
-
24
- /**
25
- * Export conditions.
26
- *
27
- * **Note**: Should be sorted by priority.
28
- *
29
- * @see https://nodejs.org/api/packages.html#conditional-exports
30
- *
31
- * @default CONDITIONS
32
- */
33
- conditions?: Optional<Set<string> | string[]>
34
-
35
- /**
36
- * URL of directory containing relevant `package.json` file.
37
- */
38
- dir: ModuleId
39
-
40
- /**
41
- * Package [`imports`][1] hint.
42
- *
43
- * [1]: https://nodejs.org/api/packages.html#imports
44
- *
45
- * @default specifier.startsWith('#')
46
- */
47
- internal?: Optional<boolean>
48
-
49
- /**
50
- * URL of module to resolve from.
51
- *
52
- * **Note**: Used for error reporting only.
53
- */
54
- parent: ModuleId
55
- }
56
-
57
- export type { ParseSubpathOptions as default }
@@ -1,59 +0,0 @@
1
- /**
2
- * @file Interfaces - ResolveAliasOptions
3
- * @module mlly/interfaces/ResolveAliasOptions
4
- */
5
-
6
- import type { ModuleId } from '#src/types'
7
- import type { MapLike, OneOrMany, Optional } from '@flex-development/tutils'
8
- import type ResolveModuleOptions from './options-resolve-module'
9
-
10
- /**
11
- * Path alias resolution options.
12
- *
13
- * @see {@linkcode ModuleId}
14
- *
15
- * @extends {ResolveModuleOptions}
16
- */
17
- interface ResolveAliasOptions extends ResolveModuleOptions {
18
- /**
19
- * Return resolved module URL as absolute specifier (a [`file:` URL][1]).
20
- *
21
- * If `false`, return resolved module URL as bare or relative specifier.
22
- *
23
- * [1]: https://nodejs.org/api/esm.html#file-urls
24
- *
25
- * @see https://nodejs.org/api/esm.html#terminology
26
- *
27
- * @default true
28
- */
29
- absolute?: Optional<boolean>
30
-
31
- /**
32
- * Path mappings.
33
- *
34
- * **Note**: Paths should be relative to {@linkcode cwd}.
35
- *
36
- * @default {}
37
- */
38
- aliases?: Optional<MapLike<OneOrMany<string>>>
39
-
40
- /**
41
- * Directory to resolve non-absolute modules from.
42
- *
43
- * @default pathToFileURL('.')
44
- */
45
- cwd?: Optional<ModuleId>
46
-
47
- /**
48
- * Id of module to resolve from.
49
- *
50
- * **Note**: Should be an absolute path or [`file:` URL][1].
51
- *
52
- * [1]: https://nodejs.org/api/esm.html#file-urls
53
- *
54
- * @default import.meta.url
55
- */
56
- parent?: Optional<ModuleId>
57
- }
58
-
59
- export type { ResolveAliasOptions as default }
@@ -1,72 +0,0 @@
1
- /**
2
- * @file Interfaces - ResolveModuleOptions
3
- * @module mlly/interfaces/ResolveModuleOptions
4
- */
5
-
6
- import type { ChangeExtFn, ModuleId } from '#src/types'
7
- import type { Nilable, Optional } from '@flex-development/tutils'
8
-
9
- /**
10
- * Module resolution options.
11
- *
12
- * @see {@linkcode ChangeExtFn}
13
- * @see {@linkcode ModuleId}
14
- */
15
- interface ResolveModuleOptions {
16
- /**
17
- * Export condition to apply.
18
- *
19
- * @see https://nodejs.org/api/packages.html#conditional-exports
20
- *
21
- * @default 'default'
22
- */
23
- condition?: Optional<string>
24
-
25
- /**
26
- * Export conditions.
27
- *
28
- * **Note**: Should be sorted by priority.
29
- *
30
- * @see https://nodejs.org/api/packages.html#conditional-exports
31
- *
32
- * @default CONDITIONS
33
- */
34
- conditions?: Optional<Set<string> | string[]>
35
-
36
- /**
37
- * Replacement file extension or function that returns a file extension.
38
- *
39
- * An empty string (`''`) will remove a file extension; `null` or `undefined`
40
- * will skip extension replacement.
41
- *
42
- * @default undefined
43
- */
44
- ext?: ChangeExtFn | Nilable<string>
45
-
46
- /**
47
- * Module extensions to probe for.
48
- *
49
- * **Note**: Should be sorted by priority.
50
- *
51
- * @default RESOLVE_EXTENSIONS
52
- */
53
- extensions?: Optional<Set<string> | string[]>
54
-
55
- /**
56
- * URL of module to resolve from.
57
- *
58
- * @see {@linkcode ModuleId}
59
- *
60
- * @default import.meta.url
61
- */
62
- parent?: Optional<ModuleId>
63
-
64
- /**
65
- * Keep symlinks instead of resolving them.
66
- *
67
- * @default false
68
- */
69
- preserveSymlinks?: Optional<boolean>
70
- }
71
-
72
- export type { ResolveModuleOptions as default }
@@ -1,17 +0,0 @@
1
- /**
2
- * @file Interfaces - ResolveOptions
3
- * @module mlly/interfaces/ResolveOptions
4
- */
5
-
6
- import type ResolveModuleOptions from './options-resolve-module'
7
-
8
- /**
9
- * Resolution options.
10
- *
11
- * @see {@linkcode ResolveModuleOptions}
12
- *
13
- * @extends {ResolveModuleOptions}
14
- */
15
- interface ResolveOptions extends ResolveModuleOptions {}
16
-
17
- export type { ResolveOptions as default }
@@ -1,30 +0,0 @@
1
- /**
2
- * @file Interfaces - PackageScope
3
- * @module mlly/interfaces/PackageScope
4
- */
5
-
6
- import type { PackageJson } from '@flex-development/pkg-types'
7
-
8
- /**
9
- * Object representing a package scope.
10
- *
11
- * @see {@linkcode PackageJson}
12
- */
13
- interface PackageScope {
14
- /**
15
- * URL of directory containing `package.json` file.
16
- */
17
- dir: string
18
-
19
- /**
20
- * URL of `package.json` file.
21
- */
22
- pkg: string
23
-
24
- /**
25
- * `package.json` object.
26
- */
27
- pkgjson: PackageJson
28
- }
29
-
30
- export type { PackageScope as default }