@markuplint/file-resolver 4.0.0-dev.0 → 4.0.0-dev.12

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2023 Yusuke Hirao
3
+ Copyright (c) 2017-2024 Yusuke Hirao
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -18,6 +18,7 @@ const explorer = cosmiconfig('markuplint', {
18
18
  }
19
19
  }),
20
20
  },
21
+ searchStrategy: 'project',
21
22
  });
22
23
  export async function search(filePath, cacheClear) {
23
24
  if (cacheClear) {
@@ -1,9 +1,9 @@
1
1
  import type { MLFile } from './ml-file/index.js';
2
- import type { MLMarkupLanguageParser, ParserOptions } from '@markuplint/ml-ast';
2
+ import type { MLMarkupLanguageParser, MLParser, ParserOptions } from '@markuplint/ml-ast';
3
3
  import type { ParserConfig } from '@markuplint/ml-config';
4
4
  export declare function resolveParser(file: Readonly<MLFile>, parserConfig?: ParserConfig, parserOptions?: ParserOptions): Promise<{
5
5
  parserModName: string;
6
- parser: MLMarkupLanguageParser;
6
+ parser: MLParser | MLMarkupLanguageParser;
7
7
  parserOptions: ParserOptions;
8
8
  matched: boolean;
9
9
  }>;
@@ -34,6 +34,10 @@ async function importParser(parserModName) {
34
34
  if (entity) {
35
35
  return entity;
36
36
  }
37
- const parser = await import(parserModName);
38
- return parser;
37
+ const parserMod = await import(parserModName);
38
+ // TODO: To be dropped in v5
39
+ if (!('parser' in parserMod)) {
40
+ return parserMod;
41
+ }
42
+ return parserMod.parser;
39
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/file-resolver",
3
- "version": "4.0.0-dev.0+7c596917",
3
+ "version": "4.0.0-dev.12+2275fbeb0",
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>",
@@ -24,23 +24,23 @@
24
24
  "clean": "tsc --build --clean"
25
25
  },
26
26
  "devDependencies": {
27
- "@types/node": "20.10.0"
27
+ "@types/node": "20.11.5"
28
28
  },
29
29
  "dependencies": {
30
- "@markuplint/html-parser": "4.0.0-dev.0+7c596917",
31
- "@markuplint/ml-ast": "4.0.0-dev.0+7c596917",
32
- "@markuplint/ml-config": "4.0.0-dev.0+7c596917",
33
- "@markuplint/ml-core": "4.0.0-dev.0+7c596917",
34
- "@markuplint/ml-spec": "4.0.0-dev.0+7c596917",
35
- "@markuplint/parser-utils": "4.0.0-dev.0+7c596917",
36
- "@markuplint/selector": "4.0.0-dev.0+7c596917",
37
- "@markuplint/shared": "4.0.0-dev.0+7c596917",
38
- "cosmiconfig": "^8.3.6",
30
+ "@markuplint/html-parser": "4.0.0-dev.12+2275fbeb0",
31
+ "@markuplint/ml-ast": "4.0.0-dev.12+2275fbeb0",
32
+ "@markuplint/ml-config": "4.0.0-dev.12+2275fbeb0",
33
+ "@markuplint/ml-core": "4.0.0-dev.12+2275fbeb0",
34
+ "@markuplint/ml-spec": "4.0.0-dev.12+2275fbeb0",
35
+ "@markuplint/parser-utils": "4.0.0-dev.12+2275fbeb0",
36
+ "@markuplint/selector": "4.0.0-dev.12+2275fbeb0",
37
+ "@markuplint/shared": "4.0.0-dev.12+2275fbeb0",
38
+ "cosmiconfig": "^9.0.0",
39
39
  "debug": "^4.3.4",
40
40
  "glob": "^10.3.6",
41
41
  "ignore": "^5.3.0",
42
42
  "jsonc": "^2.0.0",
43
43
  "minimatch": "^9.0.3"
44
44
  },
45
- "gitHead": "7c59691701465a0fb3a4b69187318e8033c463d4"
45
+ "gitHead": "2275fbeb053605b636f080f4fafd7cd4fc57a9a3"
46
46
  }