@markuplint/file-resolver 4.9.14-dev.110 → 4.9.14
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 +4 -0
- package/lib/general-import.js +23 -18
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.9.14](https://github.com/markuplint/markuplint/compare/@markuplint/file-resolver@4.9.13...@markuplint/file-resolver@4.9.14) (2025-04-13)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @markuplint/file-resolver
|
|
9
|
+
|
|
6
10
|
## [4.9.13](https://github.com/markuplint/markuplint/compare/@markuplint/file-resolver@4.9.12...@markuplint/file-resolver@4.9.13) (2025-03-09)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @markuplint/file-resolver
|
package/lib/general-import.js
CHANGED
|
@@ -19,25 +19,30 @@ export async function generalImport(name) {
|
|
|
19
19
|
cache.set(name, mod);
|
|
20
20
|
return mod;
|
|
21
21
|
}
|
|
22
|
-
catch (
|
|
23
|
-
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
'code' in error &&
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
error.code === 'ERR_IMPORT_ASSERTION_TYPE_MISSING') {
|
|
28
|
+
try {
|
|
29
|
+
const mod = require(name) ?? null;
|
|
30
|
+
gLogSuccess('Success by require("%s"): %O', name, mod);
|
|
31
|
+
cache.set(name, mod);
|
|
32
|
+
return mod;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error instanceof Error && /^parse failure/i.test(error.message)) {
|
|
36
|
+
gLogError('Error in `createRequire(import.meta.url)()`: %O', error);
|
|
37
|
+
cache.set(name, null);
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
gLogError('Error in generalImport: %O', error);
|
|
36
41
|
}
|
|
37
|
-
gLogError('Error in generalImport: %O', requireError);
|
|
38
42
|
}
|
|
39
|
-
if (
|
|
40
|
-
const { filePath, packageName } = /Missing\s"(?<filePath>[^"]+)"\sspecifier\sin\s"(?<packageName>[^"]+)"\spackage/.exec(
|
|
43
|
+
if (error instanceof Error) {
|
|
44
|
+
const { filePath, packageName } = /Missing\s"(?<filePath>[^"]+)"\sspecifier\sin\s"(?<packageName>[^"]+)"\spackage/.exec(error.message)
|
|
45
|
+
?.groups ?? {};
|
|
41
46
|
if (filePath && packageName) {
|
|
42
47
|
const modFile = resolve(packageName, import.meta.url);
|
|
43
48
|
const modPath = path.dirname(modFile);
|
|
@@ -55,7 +60,7 @@ export async function generalImport(name) {
|
|
|
55
60
|
cache.set(name, json);
|
|
56
61
|
return json;
|
|
57
62
|
}
|
|
58
|
-
gLogError('Error in `import()`: %O',
|
|
63
|
+
gLogError('Error in `import()`: %O', error);
|
|
59
64
|
cache.set(name, null);
|
|
60
65
|
return null;
|
|
61
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/file-resolver",
|
|
3
|
-
"version": "4.9.14
|
|
3
|
+
"version": "4.9.14",
|
|
4
4
|
"description": "The file resolver of markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"@types/node": "22.14.1"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@markuplint/html-parser": "4.6.19
|
|
32
|
-
"@markuplint/ml-ast": "4.4.
|
|
33
|
-
"@markuplint/ml-config": "4.8.11
|
|
34
|
-
"@markuplint/ml-core": "4.12.4
|
|
35
|
-
"@markuplint/ml-spec": "4.9.6
|
|
36
|
-
"@markuplint/parser-utils": "4.8.7
|
|
37
|
-
"@markuplint/selector": "4.7.4
|
|
38
|
-
"@markuplint/shared": "4.4.11
|
|
31
|
+
"@markuplint/html-parser": "4.6.19",
|
|
32
|
+
"@markuplint/ml-ast": "4.4.9",
|
|
33
|
+
"@markuplint/ml-config": "4.8.11",
|
|
34
|
+
"@markuplint/ml-core": "4.12.4",
|
|
35
|
+
"@markuplint/ml-spec": "4.9.6",
|
|
36
|
+
"@markuplint/parser-utils": "4.8.7",
|
|
37
|
+
"@markuplint/selector": "4.7.4",
|
|
38
|
+
"@markuplint/shared": "4.4.11",
|
|
39
39
|
"cosmiconfig": "9.0.0",
|
|
40
40
|
"debug": "4.4.0",
|
|
41
41
|
"glob": "11.0.1",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"jsonc": "2.0.0",
|
|
45
45
|
"minimatch": "10.0.1"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "eb36d59f7e13d4e59ff3f3c4eabb5ec06c070eb0"
|
|
48
48
|
}
|