@markuplint/file-resolver 3.3.0 → 3.3.1

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.
@@ -3,6 +3,6 @@ import type { Ruleset, AnyMLRule } from '@markuplint/ml-core';
3
3
  * @deprecated
4
4
  */
5
5
  export declare function autoLoadRules(ruleset: Ruleset): Promise<{
6
- rules: AnyMLRule[];
7
- errors: unknown[];
6
+ rules: AnyMLRule[];
7
+ errors: unknown[];
8
8
  }>;
@@ -2,12 +2,12 @@ import type { MLFile } from './ml-file';
2
2
  import type { ConfigSet, Nullable } from './types';
3
3
  import type { Config } from '@markuplint/ml-config';
4
4
  export declare class ConfigProvider {
5
- #private;
6
- resolve(targetFile: MLFile, names: Nullable<string>[], cache?: boolean): Promise<ConfigSet>;
7
- search(targetFile: MLFile): Promise<string | null>;
8
- set(config: Config, key?: string): string;
9
- private _load;
10
- private _mergeConfigs;
11
- private _pathResolve;
12
- private _recursiveLoad;
5
+ #private;
6
+ resolve(targetFile: MLFile, names: Nullable<string>[], cache?: boolean): Promise<ConfigSet>;
7
+ search(targetFile: MLFile): Promise<string | null>;
8
+ set(config: Config, key?: string): string;
9
+ private _load;
10
+ private _mergeConfigs;
11
+ private _pathResolve;
12
+ private _recursiveLoad;
13
13
  }
@@ -1,11 +1,17 @@
1
1
  import type { LoaderSync } from 'cosmiconfig';
2
2
  type CosmiConfig = ReturnType<LoaderSync>;
3
- export declare function search<T = CosmiConfig>(dir: string, cacheClear: boolean): Promise<{
4
- filePath: string;
5
- config: T;
3
+ export declare function search<T = CosmiConfig>(
4
+ dir: string,
5
+ cacheClear: boolean,
6
+ ): Promise<{
7
+ filePath: string;
8
+ config: T;
6
9
  } | null>;
7
- export declare function load<T = CosmiConfig>(filePath: string, cacheClear: boolean): Promise<{
8
- filePath: string;
9
- config: T;
10
+ export declare function load<T = CosmiConfig>(
11
+ filePath: string,
12
+ cacheClear: boolean,
13
+ ): Promise<{
14
+ filePath: string;
15
+ config: T;
10
16
  } | null>;
11
17
  export {};
@@ -1,23 +1,23 @@
1
1
  import type { Target } from '../types';
2
2
  export declare class MLFile {
3
- #private;
4
- constructor(target: Target);
5
- get dirname(): string;
6
- /**
7
- * Normalized `MLFile.dirname`
8
- */
9
- get nDirname(): string;
10
- /**
11
- * Normalized `MLFile.path`
12
- */
13
- get nPath(): string;
14
- get path(): string;
15
- dirExists(): Promise<boolean>;
16
- getCode(): Promise<string>;
17
- isExist(): Promise<boolean>;
18
- isFile(): Promise<boolean>;
19
- matches(globPath: string): boolean;
20
- setCode(code: string): void;
21
- private _fetch;
22
- private _stat;
3
+ #private;
4
+ constructor(target: Target);
5
+ get dirname(): string;
6
+ /**
7
+ * Normalized `MLFile.dirname`
8
+ */
9
+ get nDirname(): string;
10
+ /**
11
+ * Normalized `MLFile.path`
12
+ */
13
+ get nPath(): string;
14
+ get path(): string;
15
+ dirExists(): Promise<boolean>;
16
+ getCode(): Promise<string>;
17
+ isExist(): Promise<boolean>;
18
+ isFile(): Promise<boolean>;
19
+ matches(globPath: string): boolean;
20
+ setCode(code: string): void;
21
+ private _fetch;
22
+ private _stat;
23
23
  }
@@ -1,9 +1,13 @@
1
1
  import type { MLFile } from './ml-file';
2
2
  import type { MLMarkupLanguageParser, ParserOptions } from '@markuplint/ml-ast';
3
3
  import type { ParserConfig } from '@markuplint/ml-config';
4
- export declare function resolveParser(file: MLFile, parserConfig?: ParserConfig, parserOptions?: ParserOptions): Promise<{
5
- parserModName: string;
6
- parser: MLMarkupLanguageParser;
7
- parserOptions: ParserOptions;
8
- matched: boolean;
4
+ export declare function resolveParser(
5
+ file: MLFile,
6
+ parserConfig?: ParserConfig,
7
+ parserOptions?: ParserOptions,
8
+ ): Promise<{
9
+ parserModName: string;
10
+ parser: MLMarkupLanguageParser;
11
+ parserOptions: ParserOptions;
12
+ matched: boolean;
9
13
  }>;
@@ -1,7 +1,11 @@
1
1
  import type { AnyMLRule, Ruleset, Plugin } from '@markuplint/ml-core';
2
2
  import { MLRule } from '@markuplint/ml-core';
3
- export declare function resolveRules(plugins: Plugin[], ruleset: Ruleset, importPreset: boolean,
4
- /**
5
- * @deprecated
6
- */
7
- autoLoad: boolean): Promise<AnyMLRule[] | MLRule<any, any>[]>;
3
+ export declare function resolveRules(
4
+ plugins: Plugin[],
5
+ ruleset: Ruleset,
6
+ importPreset: boolean,
7
+ /**
8
+ * @deprecated
9
+ */
10
+ autoLoad: boolean,
11
+ ): Promise<AnyMLRule[] | MLRule<any, any>[]>;
@@ -30,6 +30,9 @@ import type { ExtendedSpec, MLMLSpec } from '@markuplint/ml-spec';
30
30
  * @param specConfig The `spec` property part of the config
31
31
  * @returns
32
32
  */
33
- export declare function resolveSpecs(filePath: string, specConfig?: SpecConfig): Promise<{
34
- schemas: readonly [MLMLSpec, ...ExtendedSpec[]];
33
+ export declare function resolveSpecs(
34
+ filePath: string,
35
+ specConfig?: SpecConfig,
36
+ ): Promise<{
37
+ schemas: readonly [MLMLSpec, ...ExtendedSpec[]];
35
38
  }>;
package/lib/types.d.ts CHANGED
@@ -2,22 +2,24 @@ import type { Config } from '@markuplint/ml-config';
2
2
  import type { Plugin } from '@markuplint/ml-core';
3
3
  export type Nullable<T> = T | null | undefined;
4
4
  export interface ConfigSet {
5
- config: Config;
6
- plugins: Plugin[];
7
- files: Set<string>;
8
- errs: Error[];
5
+ config: Config;
6
+ plugins: Plugin[];
7
+ files: Set<string>;
8
+ errs: Error[];
9
9
  }
10
- export type Target = string | {
11
- /**
12
- * Target source code of evaluation
13
- */
14
- sourceCode: string;
15
- /**
16
- * File names when `sourceCodes`
17
- */
18
- name?: string;
19
- /**
20
- * Workspace path when `sourceCodes`
21
- */
22
- workspace?: string;
23
- };
10
+ export type Target =
11
+ | string
12
+ | {
13
+ /**
14
+ * Target source code of evaluation
15
+ */
16
+ sourceCode: string;
17
+ /**
18
+ * File names when `sourceCodes`
19
+ */
20
+ name?: string;
21
+ /**
22
+ * Workspace path when `sourceCodes`
23
+ */
24
+ workspace?: string;
25
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/file-resolver",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
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,10 +24,10 @@
24
24
  "@types/node": "latest"
25
25
  },
26
26
  "dependencies": {
27
- "@markuplint/html-parser": "3.3.0",
27
+ "@markuplint/html-parser": "3.3.1",
28
28
  "@markuplint/ml-ast": "3.0.0",
29
29
  "@markuplint/ml-config": "3.3.0",
30
- "@markuplint/ml-core": "3.3.0",
30
+ "@markuplint/ml-core": "3.3.1",
31
31
  "@markuplint/ml-spec": "3.3.0",
32
32
  "cosmiconfig": "^8.0.0",
33
33
  "glob": "^8.0.3",
@@ -35,5 +35,5 @@
35
35
  "minimatch": "^5.1.1",
36
36
  "tslib": "^2.4.1"
37
37
  },
38
- "gitHead": "791fb22a4df7acb985ced3808923fba0cd95c28a"
38
+ "gitHead": "f19e7de726cf01d53342bc5513c30da75d28da63"
39
39
  }