@markuplint/file-resolver 4.9.18 → 5.0.0-alpha.0
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 +24 -0
- package/lib/config-load-error.js +3 -1
- package/lib/config-provider.js +24 -36
- package/lib/cosmiconfig.js +30 -11
- package/lib/ml-file/ml-file.js +35 -48
- package/lib/resolve-parser.d.ts +2 -2
- package/lib/resolve-parser.js +0 -4
- package/package.json +15 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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
|
+
# [5.0.0-alpha.0](https://github.com/markuplint/markuplint/compare/v4.14.1...v5.0.0-alpha.0) (2026-02-20)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **file-resolver:** use "options" instead of deprecated "option" in test fixtures ([98a53f2](https://github.com/markuplint/markuplint/commit/98a53f27c4a6e640f20e2c74421c1cdeba3e7db5))
|
|
11
|
+
|
|
12
|
+
- refactor(file-resolver)!: drop MLMarkupLanguageParser support ([3272ee7](https://github.com/markuplint/markuplint/commit/3272ee72a7c4fb3105fbecd41ec4ba5eff030092))
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- **file-resolver:** add .jsonc config file support via cosmiconfig ([755848d](https://github.com/markuplint/markuplint/commit/755848dbec75105e3cdf9de6becb84546b66deec))
|
|
17
|
+
|
|
18
|
+
### BREAKING CHANGES
|
|
19
|
+
|
|
20
|
+
- Remove MLMarkupLanguageParser compatibility from
|
|
21
|
+
resolve-parser. Parser modules must now export MLParserModule
|
|
22
|
+
with a parser property.
|
|
23
|
+
|
|
24
|
+
* Remove MLMarkupLanguageParser import and union types
|
|
25
|
+
* Remove deprecated 'parser' in parserMod check
|
|
26
|
+
* Update test mock to use Parser class instance
|
|
27
|
+
|
|
28
|
+
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
29
|
+
|
|
6
30
|
## [4.9.18](https://github.com/markuplint/markuplint/compare/@markuplint/file-resolver@4.9.17...@markuplint/file-resolver@4.9.18) (2026-02-10)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @markuplint/file-resolver
|
package/lib/config-load-error.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export class ConfigLoadError extends Error {
|
|
2
|
+
filePath;
|
|
3
|
+
name = 'ConfigLoadError';
|
|
4
|
+
referrer;
|
|
2
5
|
constructor(message, filePath, referrer) {
|
|
3
6
|
super(message + ` in ${referrer}`);
|
|
4
|
-
this.name = 'ConfigLoadError';
|
|
5
7
|
this.filePath = filePath;
|
|
6
8
|
this.referrer = referrer;
|
|
7
9
|
}
|
package/lib/config-provider.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _ConfigProvider_cache, _ConfigProvider_held, _ConfigProvider_recursiveLoadKeyAndDepth, _ConfigProvider_store;
|
|
7
1
|
import path from 'node:path';
|
|
8
2
|
import { mergeConfig } from '@markuplint/ml-config';
|
|
9
3
|
import { ConfigParserError } from '@markuplint/parser-utils';
|
|
@@ -29,12 +23,10 @@ const KEY_SEPARATOR = '__ML_CONFIG_MERGE__';
|
|
|
29
23
|
* Configuration files are searched via cosmiconfig and cached by file path.
|
|
30
24
|
*/
|
|
31
25
|
export class ConfigProvider {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
_ConfigProvider_store.set(this, new Map());
|
|
37
|
-
}
|
|
26
|
+
#cache = new Map();
|
|
27
|
+
#held = new Set();
|
|
28
|
+
#recursiveLoadKeyAndDepth = new Map();
|
|
29
|
+
#store = new Map();
|
|
38
30
|
/**
|
|
39
31
|
* Recursively loads a configuration and all its `extends` dependencies.
|
|
40
32
|
*
|
|
@@ -47,15 +39,15 @@ export class ConfigProvider {
|
|
|
47
39
|
async recursiveLoad(key, cache, referrer, depth = 1) {
|
|
48
40
|
const stack = new Set();
|
|
49
41
|
const errs = [];
|
|
50
|
-
const ancestorDepth =
|
|
42
|
+
const ancestorDepth = this.#recursiveLoadKeyAndDepth.get(key);
|
|
51
43
|
if (ancestorDepth != null && ancestorDepth < depth) {
|
|
52
44
|
return {
|
|
53
45
|
stack,
|
|
54
46
|
errs: [new CircularReferenceError(`Circular reference detected: ${key}`)],
|
|
55
47
|
};
|
|
56
48
|
}
|
|
57
|
-
|
|
58
|
-
let config =
|
|
49
|
+
this.#recursiveLoadKeyAndDepth.set(key, depth);
|
|
50
|
+
let config = this.#store.get(key);
|
|
59
51
|
if (!config) {
|
|
60
52
|
config = await this._load(key, cache, referrer);
|
|
61
53
|
}
|
|
@@ -93,18 +85,18 @@ export class ConfigProvider {
|
|
|
93
85
|
*/
|
|
94
86
|
async resolve(targetFile, names, cache = true) {
|
|
95
87
|
if (!cache) {
|
|
96
|
-
|
|
97
|
-
|
|
88
|
+
this.#store.clear();
|
|
89
|
+
this.#cache.clear();
|
|
98
90
|
cacheClear();
|
|
99
91
|
}
|
|
100
92
|
const keys = names.filter(nonNullableFilter);
|
|
101
93
|
const key = keys.join(KEY_SEPARATOR);
|
|
102
|
-
const currentConfig =
|
|
94
|
+
const currentConfig = this.#cache.get(key);
|
|
103
95
|
if (currentConfig) {
|
|
104
96
|
return currentConfig;
|
|
105
97
|
}
|
|
106
98
|
let configSet = await this._mergeConfigs(keys, cache, targetFile.path);
|
|
107
|
-
const filePath = [...configSet.files].
|
|
99
|
+
const filePath = [...configSet.files].toReversed()[0];
|
|
108
100
|
if (!filePath) {
|
|
109
101
|
throw new ConfigParserError('Config file not found', {
|
|
110
102
|
filePath: targetFile.path,
|
|
@@ -114,8 +106,8 @@ export class ConfigProvider {
|
|
|
114
106
|
configSet.errs.push(...errors);
|
|
115
107
|
const { plugins, errors: pluginErrors } = await resolvePlugins(configSet.config.plugins);
|
|
116
108
|
configSet.errs.push(...pluginErrors);
|
|
117
|
-
if (
|
|
118
|
-
const extendHelds = [...
|
|
109
|
+
if (this.#held.size > 0) {
|
|
110
|
+
const extendHelds = [...this.#held.values()];
|
|
119
111
|
for (const held of extendHelds) {
|
|
120
112
|
const [, prefix, namespace, name] = held.match(/^([a-z]+:)([^/]+)(?:\/(.+))?$/) ?? [];
|
|
121
113
|
switch (prefix) {
|
|
@@ -130,7 +122,7 @@ export class ConfigProvider {
|
|
|
130
122
|
}
|
|
131
123
|
}
|
|
132
124
|
configSet = await this._mergeConfigs([...keys, ...extendHelds], cache, targetFile.path);
|
|
133
|
-
|
|
125
|
+
this.#held.clear();
|
|
134
126
|
}
|
|
135
127
|
// Resolves `overrides`
|
|
136
128
|
if (configSet.config.overrides) {
|
|
@@ -157,7 +149,7 @@ export class ConfigProvider {
|
|
|
157
149
|
...configSet,
|
|
158
150
|
plugins,
|
|
159
151
|
};
|
|
160
|
-
|
|
152
|
+
this.#cache.set(key, result);
|
|
161
153
|
return result;
|
|
162
154
|
}
|
|
163
155
|
/**
|
|
@@ -180,7 +172,7 @@ export class ConfigProvider {
|
|
|
180
172
|
}
|
|
181
173
|
const { filePath, config } = res;
|
|
182
174
|
const pathResolvedConfig = await this._pathResolve(config, filePath);
|
|
183
|
-
|
|
175
|
+
this.#store.set(filePath, pathResolvedConfig);
|
|
184
176
|
cpLog('Store key: %s', filePath);
|
|
185
177
|
return filePath;
|
|
186
178
|
}
|
|
@@ -193,11 +185,11 @@ export class ConfigProvider {
|
|
|
193
185
|
*/
|
|
194
186
|
set(config, key) {
|
|
195
187
|
key = key ?? uuid();
|
|
196
|
-
|
|
188
|
+
this.#store.set(key, config);
|
|
197
189
|
return key;
|
|
198
190
|
}
|
|
199
191
|
async _load(filePath, cache, referrer) {
|
|
200
|
-
const entity =
|
|
192
|
+
const entity = this.#store.get(filePath);
|
|
201
193
|
if (entity) {
|
|
202
194
|
return entity;
|
|
203
195
|
}
|
|
@@ -205,11 +197,11 @@ export class ConfigProvider {
|
|
|
205
197
|
const [, name] = filePath.match(/^markuplint:(.+)$/i) ?? [];
|
|
206
198
|
const config = await getPreset(name ?? filePath);
|
|
207
199
|
const pathResolvedConfig = await this._pathResolve(config, filePath);
|
|
208
|
-
|
|
200
|
+
this.#store.set(filePath, pathResolvedConfig);
|
|
209
201
|
return pathResolvedConfig;
|
|
210
202
|
}
|
|
211
203
|
if (isPluginModuleName(filePath)) {
|
|
212
|
-
|
|
204
|
+
this.#held.add(filePath);
|
|
213
205
|
return;
|
|
214
206
|
}
|
|
215
207
|
if (!(await moduleExists(filePath)) && !path.isAbsolute(filePath)) {
|
|
@@ -220,21 +212,21 @@ export class ConfigProvider {
|
|
|
220
212
|
return config;
|
|
221
213
|
}
|
|
222
214
|
const pathResolvedConfig = await this._pathResolve(config, filePath);
|
|
223
|
-
|
|
215
|
+
this.#store.set(filePath, pathResolvedConfig);
|
|
224
216
|
return pathResolvedConfig;
|
|
225
217
|
}
|
|
226
218
|
async _mergeConfigs(keys, cache, referrer) {
|
|
227
219
|
const resolvedKeys = new Set();
|
|
228
220
|
const errs = [];
|
|
229
221
|
for (const key of keys) {
|
|
230
|
-
|
|
222
|
+
this.#recursiveLoadKeyAndDepth.clear();
|
|
231
223
|
const keySet = await this.recursiveLoad(key, cache, referrer);
|
|
232
224
|
for (const k of keySet.stack) {
|
|
233
225
|
resolvedKeys.add(k);
|
|
234
226
|
}
|
|
235
227
|
errs.push(...keySet.errs);
|
|
236
228
|
}
|
|
237
|
-
const configs = [...resolvedKeys].map(name =>
|
|
229
|
+
const configs = [...resolvedKeys].map(name => this.#store.get(name)).filter(nonNullableFilter);
|
|
238
230
|
let resultConfig = {};
|
|
239
231
|
for (const config of configs) {
|
|
240
232
|
if (config instanceof ConfigLoadError) {
|
|
@@ -289,7 +281,6 @@ export class ConfigProvider {
|
|
|
289
281
|
return errors;
|
|
290
282
|
}
|
|
291
283
|
}
|
|
292
|
-
_ConfigProvider_cache = new WeakMap(), _ConfigProvider_held = new WeakMap(), _ConfigProvider_recursiveLoadKeyAndDepth = new WeakMap(), _ConfigProvider_store = new WeakMap();
|
|
293
284
|
async function load(filePath, cache, referrer) {
|
|
294
285
|
if (!fileExists(filePath) && (await moduleExists(filePath))) {
|
|
295
286
|
const config = (await generalImport(filePath)) ?? new ConfigLoadError('Module is not found', filePath, referrer);
|
|
@@ -307,8 +298,5 @@ async function load(filePath, cache, referrer) {
|
|
|
307
298
|
return res.config;
|
|
308
299
|
}
|
|
309
300
|
class CircularReferenceError extends ReferenceError {
|
|
310
|
-
|
|
311
|
-
super(...arguments);
|
|
312
|
-
this.name = 'CircularReferenceError';
|
|
313
|
-
}
|
|
301
|
+
name = 'CircularReferenceError';
|
|
314
302
|
}
|
package/lib/cosmiconfig.js
CHANGED
|
@@ -5,19 +5,38 @@ import { jsonc } from 'jsonc';
|
|
|
5
5
|
import { ConfigLoadError } from './config-load-error.js';
|
|
6
6
|
import { log } from './debug.js';
|
|
7
7
|
const searchLog = log.extend('search');
|
|
8
|
+
const jsoncLoader = (path, content) => {
|
|
9
|
+
try {
|
|
10
|
+
return jsonc.parse(content);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
if (error instanceof Error && error.name === 'JSONError') {
|
|
14
|
+
return defaultLoaders['noExt'](path, content);
|
|
15
|
+
}
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
8
19
|
const explorer = cosmiconfig('markuplint', {
|
|
20
|
+
searchPlaces: [
|
|
21
|
+
'package.json',
|
|
22
|
+
'.markuplintrc',
|
|
23
|
+
'.markuplintrc.json',
|
|
24
|
+
'.markuplintrc.jsonc',
|
|
25
|
+
'.markuplintrc.yaml',
|
|
26
|
+
'.markuplintrc.yml',
|
|
27
|
+
'.markuplintrc.js',
|
|
28
|
+
'.markuplintrc.ts',
|
|
29
|
+
'.markuplintrc.cjs',
|
|
30
|
+
'.markuplintrc.mjs',
|
|
31
|
+
'markuplint.config.js',
|
|
32
|
+
'markuplint.config.ts',
|
|
33
|
+
'markuplint.config.cjs',
|
|
34
|
+
'markuplint.config.mjs',
|
|
35
|
+
'markuplint.config.jsonc',
|
|
36
|
+
],
|
|
9
37
|
loaders: {
|
|
10
|
-
noExt:
|
|
11
|
-
|
|
12
|
-
return jsonc.parse(content);
|
|
13
|
-
}
|
|
14
|
-
catch (error) {
|
|
15
|
-
if (error instanceof Error && error.name === 'JSONError') {
|
|
16
|
-
return defaultLoaders['noExt'](path, content);
|
|
17
|
-
}
|
|
18
|
-
throw error;
|
|
19
|
-
}
|
|
20
|
-
}),
|
|
38
|
+
noExt: jsoncLoader,
|
|
39
|
+
'.jsonc': jsoncLoader,
|
|
21
40
|
},
|
|
22
41
|
searchStrategy: 'project',
|
|
23
42
|
});
|
package/lib/ml-file/ml-file.js
CHANGED
|
@@ -1,51 +1,39 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _MLFile_basename, _MLFile_code, _MLFile_dirname, _MLFile_stat, _MLFile_type;
|
|
13
1
|
import { promises as fs } from 'node:fs';
|
|
14
2
|
import path from 'node:path';
|
|
15
3
|
import ignore from 'ignore';
|
|
16
4
|
import { minimatch } from 'minimatch';
|
|
17
5
|
export class MLFile {
|
|
6
|
+
#basename;
|
|
7
|
+
#code;
|
|
8
|
+
#dirname;
|
|
9
|
+
/**
|
|
10
|
+
* - `Stats`: Exists
|
|
11
|
+
* - `null`: Not exists
|
|
12
|
+
* - `undefined`: Doesn't read yet
|
|
13
|
+
*/
|
|
14
|
+
#stat = undefined;
|
|
15
|
+
#type;
|
|
18
16
|
constructor(target) {
|
|
19
|
-
_MLFile_basename.set(this, void 0);
|
|
20
|
-
_MLFile_code.set(this, void 0);
|
|
21
|
-
_MLFile_dirname.set(this, void 0);
|
|
22
|
-
/**
|
|
23
|
-
* - `Stats`: Exists
|
|
24
|
-
* - `null`: Not exists
|
|
25
|
-
* - `undefined`: Doesn't read yet
|
|
26
|
-
*/
|
|
27
|
-
_MLFile_stat.set(this, undefined);
|
|
28
|
-
_MLFile_type.set(this, void 0);
|
|
29
17
|
if (typeof target === 'string') {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
this.#basename = path.basename(target);
|
|
19
|
+
this.#dirname = path.dirname(target);
|
|
20
|
+
this.#code = null;
|
|
21
|
+
this.#type = 'file-base';
|
|
34
22
|
return;
|
|
35
23
|
}
|
|
36
24
|
if (!target.workspace && target.name && path.isAbsolute(target.name)) {
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
this.#basename = path.basename(target.name);
|
|
26
|
+
this.#dirname = path.dirname(target.name);
|
|
39
27
|
}
|
|
40
28
|
else {
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
this.#basename = target.name ?? '<AnonymousFile>';
|
|
30
|
+
this.#dirname = target.workspace ?? process.cwd();
|
|
43
31
|
}
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
this.#code = target.sourceCode;
|
|
33
|
+
this.#type = 'code-base';
|
|
46
34
|
}
|
|
47
35
|
get dirname() {
|
|
48
|
-
return
|
|
36
|
+
return this.#dirname;
|
|
49
37
|
}
|
|
50
38
|
/**
|
|
51
39
|
* Normalized `MLFile.dirname`
|
|
@@ -60,16 +48,16 @@ export class MLFile {
|
|
|
60
48
|
return pathNormalize(this.path);
|
|
61
49
|
}
|
|
62
50
|
get path() {
|
|
63
|
-
return path.resolve(
|
|
51
|
+
return path.resolve(this.#dirname, this.#basename);
|
|
64
52
|
}
|
|
65
53
|
async dirExists() {
|
|
66
|
-
return !!(await stat(
|
|
54
|
+
return !!(await stat(this.#dirname));
|
|
67
55
|
}
|
|
68
56
|
async getCode() {
|
|
69
|
-
if (
|
|
70
|
-
return
|
|
57
|
+
if (this.#code != null) {
|
|
58
|
+
return this.#code;
|
|
71
59
|
}
|
|
72
|
-
if (
|
|
60
|
+
if (this.#type === 'file-base' && (await this.isExist())) {
|
|
73
61
|
return await this._fetch();
|
|
74
62
|
}
|
|
75
63
|
return '';
|
|
@@ -83,14 +71,14 @@ export class MLFile {
|
|
|
83
71
|
return ignored;
|
|
84
72
|
}
|
|
85
73
|
async isExist() {
|
|
86
|
-
if (
|
|
74
|
+
if (this.#type === 'code-base') {
|
|
87
75
|
return true;
|
|
88
76
|
}
|
|
89
77
|
const stat = await this._stat();
|
|
90
78
|
return !!stat;
|
|
91
79
|
}
|
|
92
80
|
async isFile() {
|
|
93
|
-
if (
|
|
81
|
+
if (this.#type === 'code-base') {
|
|
94
82
|
return true;
|
|
95
83
|
}
|
|
96
84
|
const stat = await this._stat();
|
|
@@ -100,25 +88,24 @@ export class MLFile {
|
|
|
100
88
|
return minimatch(this.nPath, pathNormalize(globPath));
|
|
101
89
|
}
|
|
102
90
|
setCode(code) {
|
|
103
|
-
if (
|
|
91
|
+
if (this.#type === 'file-base') {
|
|
104
92
|
throw new Error(`This file object is readonly (File-base: ${this.path})`);
|
|
105
93
|
}
|
|
106
|
-
|
|
94
|
+
this.#code = code;
|
|
107
95
|
}
|
|
108
96
|
async _fetch() {
|
|
109
97
|
const code = await fs.readFile(this.path, { encoding: 'utf8' });
|
|
110
|
-
|
|
98
|
+
this.#code = code;
|
|
111
99
|
return code;
|
|
112
100
|
}
|
|
113
101
|
async _stat() {
|
|
114
|
-
if (
|
|
115
|
-
return
|
|
102
|
+
if (this.#stat) {
|
|
103
|
+
return this.#stat;
|
|
116
104
|
}
|
|
117
|
-
|
|
118
|
-
return
|
|
105
|
+
this.#stat = await stat(this.path);
|
|
106
|
+
return this.#stat;
|
|
119
107
|
}
|
|
120
108
|
}
|
|
121
|
-
_MLFile_basename = new WeakMap(), _MLFile_code = new WeakMap(), _MLFile_dirname = new WeakMap(), _MLFile_stat = new WeakMap(), _MLFile_type = new WeakMap();
|
|
122
109
|
async function stat(filePath) {
|
|
123
110
|
try {
|
|
124
111
|
return await fs.stat(filePath);
|
package/lib/resolve-parser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MLFile } from './ml-file/index.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MLParser, ParserOptions } from '@markuplint/ml-ast';
|
|
3
3
|
import type { ParserConfig } from '@markuplint/ml-config';
|
|
4
4
|
/**
|
|
5
5
|
* Resolves the appropriate parser for a given file based on the parser configuration.
|
|
@@ -14,7 +14,7 @@ import type { ParserConfig } from '@markuplint/ml-config';
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function resolveParser(file: Readonly<MLFile>, parserConfig?: ParserConfig, parserOptions?: ParserOptions): Promise<{
|
|
16
16
|
parserModName: string;
|
|
17
|
-
parser: MLParser
|
|
17
|
+
parser: MLParser;
|
|
18
18
|
parserOptions: ParserOptions;
|
|
19
19
|
matched: boolean;
|
|
20
20
|
}>;
|
package/lib/resolve-parser.js
CHANGED
|
@@ -50,9 +50,5 @@ async function importParser(parserModName) {
|
|
|
50
50
|
if (!parserMod) {
|
|
51
51
|
throw new Error(`Parser module "${parserModName}" is not found.`);
|
|
52
52
|
}
|
|
53
|
-
// TODO: To be dropped in v5
|
|
54
|
-
if (!('parser' in parserMod)) {
|
|
55
|
-
return parserMod;
|
|
56
|
-
}
|
|
57
53
|
return parserMod.parser;
|
|
58
54
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/file-resolver",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-alpha.0",
|
|
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>",
|
|
7
7
|
"license": "MIT",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=22"
|
|
10
|
+
},
|
|
8
11
|
"type": "module",
|
|
9
12
|
"exports": {
|
|
10
13
|
".": {
|
|
@@ -27,21 +30,21 @@
|
|
|
27
30
|
"@types/node": "24.5.1"
|
|
28
31
|
},
|
|
29
32
|
"dependencies": {
|
|
30
|
-
"@markuplint/html-parser": "
|
|
31
|
-
"@markuplint/ml-ast": "
|
|
32
|
-
"@markuplint/ml-config": "
|
|
33
|
-
"@markuplint/ml-core": "
|
|
34
|
-
"@markuplint/ml-spec": "
|
|
35
|
-
"@markuplint/parser-utils": "
|
|
36
|
-
"@markuplint/selector": "
|
|
37
|
-
"@markuplint/shared": "
|
|
33
|
+
"@markuplint/html-parser": "5.0.0-alpha.0",
|
|
34
|
+
"@markuplint/ml-ast": "5.0.0-alpha.0",
|
|
35
|
+
"@markuplint/ml-config": "5.0.0-alpha.0",
|
|
36
|
+
"@markuplint/ml-core": "5.0.0-alpha.0",
|
|
37
|
+
"@markuplint/ml-spec": "5.0.0-alpha.0",
|
|
38
|
+
"@markuplint/parser-utils": "5.0.0-alpha.0",
|
|
39
|
+
"@markuplint/selector": "5.0.0-alpha.0",
|
|
40
|
+
"@markuplint/shared": "5.0.0-alpha.0",
|
|
38
41
|
"cosmiconfig": "9.0.0",
|
|
39
42
|
"debug": "4.4.3",
|
|
40
|
-
"glob": "13.0.
|
|
43
|
+
"glob": "13.0.6",
|
|
41
44
|
"ignore": "7.0.5",
|
|
42
45
|
"import-meta-resolve": "4.2.0",
|
|
43
46
|
"jsonc": "2.0.0",
|
|
44
|
-
"minimatch": "10.
|
|
47
|
+
"minimatch": "10.2.2"
|
|
45
48
|
},
|
|
46
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "13dcfc84ec83d87360c720e253383b60767e1b56"
|
|
47
50
|
}
|