@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.
- package/CHANGELOG.md +61 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +5 -6
- package/dist/internal/dequote.mjs +1 -0
- package/dist/internal/dequote.mjs.map +8 -0
- package/dist/internal/format-type-map.mjs +1 -0
- package/dist/internal/format-type-map.mjs.map +8 -0
- package/dist/internal/get-specifier-kind.mjs +1 -0
- package/dist/internal/get-specifier-kind.mjs.map +8 -0
- package/dist/internal/get-subpaths.mjs +1 -0
- package/dist/internal/get-subpaths.mjs.map +8 -0
- package/dist/internal/regex-encoded-sep.mjs +1 -0
- package/dist/internal/regex-encoded-sep.mjs.map +8 -0
- package/dist/internal/regex-internal-specifier.mjs +1 -0
- package/dist/internal/regex-internal-specifier.mjs.map +8 -0
- package/dist/internal/regex-invalid-segment.mjs +1 -0
- package/dist/internal/regex-invalid-segment.mjs.map +8 -0
- package/dist/internal/regex-package-name.mjs +1 -0
- package/dist/internal/regex-package-name.mjs.map +8 -0
- package/dist/internal/regex-package-path.mjs +1 -0
- package/dist/internal/regex-package-path.mjs.map +8 -0
- package/dist/internal/resolver.mjs +1 -0
- package/dist/internal/resolver.mjs.map +8 -0
- package/dist/internal/validate-array-set.mjs +1 -0
- package/dist/internal/validate-array-set.mjs.map +8 -0
- package/dist/internal/validate-boolean.mjs +1 -0
- package/dist/internal/validate-boolean.mjs.map +8 -0
- package/dist/internal/validate-map.mjs +1 -0
- package/dist/internal/validate-map.mjs.map +8 -0
- package/dist/internal/validate-object.mjs +1 -0
- package/dist/internal/validate-object.mjs.map +8 -0
- package/dist/internal/validate-set.mjs +1 -0
- package/dist/internal/validate-set.mjs.map +8 -0
- package/dist/internal/validate-string.mjs +1 -0
- package/dist/internal/validate-string.mjs.map +8 -0
- package/dist/internal/validate-url-string.mjs +1 -0
- package/dist/internal/validate-url-string.mjs.map +8 -0
- package/dist/utils/compare-subpaths.mjs.map +4 -5
- package/dist/utils/conditions.mjs.map +4 -5
- package/dist/utils/detect-syntax.mjs.map +4 -5
- package/dist/utils/extension-format-map.mjs.map +4 -5
- package/dist/utils/extract-statements.mjs.map +4 -5
- package/dist/utils/fill-modules.mjs.map +5 -8
- package/dist/utils/find-dynamic-imports.mjs.map +5 -8
- package/dist/utils/find-exports.mjs.map +5 -8
- package/dist/utils/find-requires.mjs.map +5 -8
- package/dist/utils/find-static-imports.mjs.map +5 -8
- package/dist/utils/find-subpath.mjs.map +5 -9
- package/dist/utils/get-format.mjs.map +5 -8
- package/dist/utils/get-source.mjs.map +4 -5
- package/dist/utils/has-cjs-syntax.mjs.map +4 -5
- package/dist/utils/has-esm-syntax.mjs.map +4 -5
- package/dist/utils/index.mjs.map +5 -8
- package/dist/utils/is-absolute-specifier.mjs.map +4 -5
- package/dist/utils/is-bare-specifier.mjs.map +4 -5
- package/dist/utils/is-directory.mjs.map +4 -5
- package/dist/utils/is-exports-sugar.mjs.map +4 -5
- package/dist/utils/is-file.mjs.map +4 -5
- package/dist/utils/is-relative-specifier.mjs.map +4 -5
- package/dist/utils/lookup-package-scope.mjs.map +4 -5
- package/dist/utils/parse-data-url.mjs.map +4 -5
- package/dist/utils/parse-module-id.mjs.map +5 -9
- package/dist/utils/parse-subpath.mjs.map +5 -8
- package/dist/utils/pattern-character.mjs.map +4 -5
- package/dist/utils/read-package-json.mjs.map +4 -5
- package/dist/utils/resolve-alias.mjs.map +5 -9
- package/dist/utils/resolve-aliases.mjs.map +4 -5
- package/dist/utils/resolve-extensions.mjs.map +4 -5
- package/dist/utils/resolve-module.d.mts +1 -1
- package/dist/utils/resolve-module.mjs.map +4 -5
- package/dist/utils/resolve-modules.mjs.map +4 -5
- package/dist/utils/to-absolute-specifier.mjs.map +4 -5
- package/dist/utils/to-bare-specifier.mjs +8 -1
- package/dist/utils/to-bare-specifier.mjs.map +5 -6
- package/dist/utils/to-data-url.mjs.map +4 -5
- package/dist/utils/to-node-url.mjs.map +4 -5
- package/dist/utils/to-relative-specifier.mjs.map +4 -5
- package/dist/utils/to-url.mjs.map +4 -5
- package/dist/utils/validate-assertions.mjs.map +5 -8
- package/dist/utils/validate-exports.mjs.map +4 -5
- package/package.json +16 -17
- package/dist/interfaces/index.mjs +0 -0
- package/dist/types/index.mjs +0 -0
- package/src/enums/assert-type.ts +0 -23
- package/src/enums/format.ts +0 -19
- package/src/enums/index.ts +0 -11
- package/src/enums/kind-specifier-syntax.ts +0 -16
- package/src/enums/kind-specifier.ts +0 -19
- package/src/enums/kind-statement-syntax.ts +0 -24
- package/src/enums/kind-statement.ts +0 -17
- package/src/index.ts +0 -9
- package/src/interfaces/import-assertions.ts +0 -24
- package/src/interfaces/import-dynamic.ts +0 -46
- package/src/interfaces/import-static.ts +0 -46
- package/src/interfaces/index.ts +0 -25
- package/src/interfaces/options-fill-module.ts +0 -26
- package/src/interfaces/options-find-subpath.ts +0 -57
- package/src/interfaces/options-get-format.ts +0 -80
- package/src/interfaces/options-get-source.ts +0 -59
- package/src/interfaces/options-parse-module-id.ts +0 -39
- package/src/interfaces/options-parse-subpath.ts +0 -57
- package/src/interfaces/options-resolve-alias.ts +0 -59
- package/src/interfaces/options-resolve-module.ts +0 -72
- package/src/interfaces/options-resolve.ts +0 -17
- package/src/interfaces/package-scope.ts +0 -30
- package/src/interfaces/parsed-data-url.ts +0 -63
- package/src/interfaces/parsed-module-id.ts +0 -90
- package/src/interfaces/parsed-subpath.ts +0 -56
- package/src/interfaces/statement-export.ts +0 -52
- package/src/interfaces/statement-import.ts +0 -45
- package/src/interfaces/statement-require.ts +0 -45
- package/src/interfaces/statement.ts +0 -64
- package/src/internal/dequote.ts +0 -18
- package/src/internal/format-type-map.ts +0 -28
- package/src/internal/get-specifier-kind.ts +0 -41
- package/src/internal/get-subpaths.ts +0 -43
- package/src/internal/regex-encoded-sep.ts +0 -17
- package/src/internal/regex-internal-specifier.ts +0 -19
- package/src/internal/regex-invalid-segment.ts +0 -25
- package/src/internal/regex-package-name.ts +0 -18
- package/src/internal/regex-package-path.ts +0 -20
- package/src/internal/resolver.ts +0 -790
- package/src/internal/validate-array-set.ts +0 -35
- package/src/internal/validate-boolean.ts +0 -30
- package/src/internal/validate-map.ts +0 -36
- package/src/internal/validate-object.ts +0 -30
- package/src/internal/validate-set.ts +0 -32
- package/src/internal/validate-string.ts +0 -31
- package/src/internal/validate-url-string.ts +0 -34
- package/src/types/declaration.ts +0 -22
- package/src/types/fn-change-ext.ts +0 -33
- package/src/types/index.ts +0 -14
- package/src/types/mime-type.ts +0 -19
- package/src/types/module-id.ts +0 -15
- package/src/types/module-specifier-type.ts +0 -13
- package/src/types/protocol.ts +0 -40
- package/src/types/syntax-kind-export.ts +0 -20
- package/src/types/syntax-kind-import.ts +0 -22
- package/src/types/syntax-kind-require.ts +0 -15
- package/src/utils/compare-subpaths.ts +0 -100
- package/src/utils/conditions.ts +0 -15
- package/src/utils/detect-syntax.ts +0 -40
- package/src/utils/extension-format-map.ts +0 -34
- package/src/utils/extract-statements.ts +0 -46
- package/src/utils/fill-modules.ts +0 -133
- package/src/utils/find-dynamic-imports.ts +0 -75
- package/src/utils/find-exports.ts +0 -156
- package/src/utils/find-requires.ts +0 -75
- package/src/utils/find-static-imports.ts +0 -86
- package/src/utils/find-subpath.ts +0 -251
- package/src/utils/get-format.ts +0 -249
- package/src/utils/get-source.ts +0 -144
- package/src/utils/has-cjs-syntax.ts +0 -44
- package/src/utils/has-esm-syntax.ts +0 -40
- package/src/utils/index.ts +0 -45
- package/src/utils/is-absolute-specifier.ts +0 -53
- package/src/utils/is-bare-specifier.ts +0 -36
- package/src/utils/is-directory.ts +0 -25
- package/src/utils/is-exports-sugar.ts +0 -81
- package/src/utils/is-file.ts +0 -25
- package/src/utils/is-relative-specifier.ts +0 -34
- package/src/utils/lookup-package-scope.ts +0 -97
- package/src/utils/parse-data-url.ts +0 -71
- package/src/utils/parse-module-id.ts +0 -197
- package/src/utils/parse-subpath.ts +0 -331
- package/src/utils/pattern-character.ts +0 -13
- package/src/utils/read-package-json.ts +0 -113
- package/src/utils/resolve-alias.ts +0 -224
- package/src/utils/resolve-aliases.ts +0 -58
- package/src/utils/resolve-extensions.ts +0 -33
- package/src/utils/resolve-module.ts +0 -181
- package/src/utils/resolve-modules.ts +0 -60
- package/src/utils/to-absolute-specifier.ts +0 -30
- package/src/utils/to-bare-specifier.ts +0 -211
- package/src/utils/to-data-url.ts +0 -42
- package/src/utils/to-node-url.ts +0 -27
- package/src/utils/to-relative-specifier.ts +0 -55
- package/src/utils/to-url.ts +0 -30
- package/src/utils/validate-assertions.ts +0 -126
- 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 }
|
package/src/interfaces/index.ts
DELETED
|
@@ -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 }
|