@gesslar/bedoc 1.4.1 → 1.4.2

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.
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=cli.d.ts.map
2
+ export {}
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -2,26 +2,26 @@ import Logger from './Logger';
2
2
  import HookManager from './HookManager';
3
3
 
4
4
  export interface ActionDefinition {
5
- action: string;
6
- contract: Record<string, unknown>;
7
- meta: Record<string, unknown>;
5
+ action: string;
6
+ contract: Record<string, unknown>;
7
+ meta: Record<string, unknown>;
8
8
  }
9
9
 
10
10
  export default class ActionManager {
11
- constructor(actionDefinition: ActionDefinition, logger: Logger);
12
- get action(): ActionDefinition;
13
- set hookManager(hookManager: HookManager);
14
- get hookManager(): HookManager;
15
- get contract(): Record<string, unknown>;
16
- get meta(): Record<string, unknown>;
17
- get log(): Logger;
18
- setupAction(): Promise<void>;
19
- runAction({ file, content }: {
20
- file: string;
21
- content: string;
22
- }): Promise<string>;
23
- cleanupAction(): Promise<void>;
24
- toString(): string;
25
- #private;
11
+ constructor(actionDefinition: ActionDefinition, logger: Logger);
12
+ get action(): ActionDefinition;
13
+ set hookManager(hookManager: HookManager);
14
+ get hookManager(): HookManager;
15
+ get contract(): Record<string, unknown>;
16
+ get meta(): Record<string, unknown>;
17
+ get log(): Logger;
18
+ setupAction(): Promise<void>;
19
+ runAction({ file, content }: {
20
+ file: string;
21
+ content: string;
22
+ }): Promise<string>;
23
+ cleanupAction(): Promise<void>;
24
+ toString(): string;
25
+ #private;
26
26
  }
27
27
  //# sourceMappingURL=ActionManager.d.ts.map
@@ -1,27 +1,27 @@
1
1
  import { EnvironmentType } from './Core';
2
2
 
3
3
  interface ConfigurationOption {
4
- value: unknown;
5
- source: string;
4
+ value: unknown;
5
+ source: string;
6
6
  }
7
7
 
8
8
  interface ConfigurationOptions {
9
- [key: string]: ConfigurationOption;
9
+ [key: string]: ConfigurationOption;
10
10
  }
11
11
 
12
12
  interface ValidateParams {
13
- options: ConfigurationOptions;
14
- source: EnvironmentType;
13
+ options: ConfigurationOptions;
14
+ source: EnvironmentType;
15
15
  }
16
16
 
17
17
  interface ValidationResult {
18
- status: 'success';
19
- validated: boolean;
20
- [key: string]: unknown;
18
+ status: 'success';
19
+ validated: boolean;
20
+ [key: string]: unknown;
21
21
  }
22
22
 
23
23
  export default class Configuration {
24
- validate({ options, source }: ValidateParams): Promise<ValidationResult>;
25
- #private;
24
+ validate({ options, source }: ValidateParams): Promise<ValidationResult>;
25
+ #private;
26
26
  }
27
27
  //# sourceMappingURL=Configuration.d.ts.map
@@ -1,36 +1,36 @@
1
1
  import TypeSpec from './util/TypeSpec';
2
2
 
3
3
  interface PathConfig {
4
- type: 'file' | 'directory';
5
- mustExist: boolean;
4
+ type: 'file' | 'directory';
5
+ mustExist: boolean;
6
6
  }
7
7
 
8
8
  interface ConfigurationParameter {
9
- short: string;
10
- param?: string;
11
- description: string;
12
- type: TypeSpec;
13
- required: boolean;
14
- default?: boolean | number | string;
15
- path?: PathConfig;
16
- exclusiveOf?: string;
9
+ short: string;
10
+ param?: string;
11
+ description: string;
12
+ type: TypeSpec;
13
+ required: boolean;
14
+ default?: boolean | number | string;
15
+ path?: PathConfig;
16
+ exclusiveOf?: string;
17
17
  }
18
18
 
19
19
  interface ConfigurationParametersType {
20
- input: ConfigurationParameter;
21
- exclude: ConfigurationParameter;
22
- language: ConfigurationParameter;
23
- format: ConfigurationParameter;
24
- maxConcurrent: ConfigurationParameter;
25
- hooks: ConfigurationParameter;
26
- output: ConfigurationParameter;
27
- parser: ConfigurationParameter;
28
- printer: ConfigurationParameter;
29
- hookTimeout: ConfigurationParameter;
30
- mock: ConfigurationParameter;
31
- config: ConfigurationParameter;
32
- debug: ConfigurationParameter;
33
- debugLevel: ConfigurationParameter;
20
+ input: ConfigurationParameter;
21
+ exclude: ConfigurationParameter;
22
+ language: ConfigurationParameter;
23
+ format: ConfigurationParameter;
24
+ maxConcurrent: ConfigurationParameter;
25
+ hooks: ConfigurationParameter;
26
+ output: ConfigurationParameter;
27
+ parser: ConfigurationParameter;
28
+ printer: ConfigurationParameter;
29
+ hookTimeout: ConfigurationParameter;
30
+ mock: ConfigurationParameter;
31
+ config: ConfigurationParameter;
32
+ debug: ConfigurationParameter;
33
+ debugLevel: ConfigurationParameter;
34
34
  }
35
35
 
36
36
  export const ConfigurationParameters: Readonly<ConfigurationParametersType>;
@@ -3,45 +3,47 @@ import Logger from './Logger';
3
3
  import { FileMap } from './util/FDUtil';
4
4
 
5
5
  interface ProcessResult {
6
- status: 'success' | 'error' | 'warning';
7
- file?: FileMap;
8
- error?: Error;
9
- warning?: string;
10
- result?: string;
11
- destFile?: string;
12
- content?: string;
6
+ status: 'success' | 'error' | 'warning';
7
+ file?: FileMap;
8
+ error?: Error;
9
+ warning?: string;
10
+ result?: string;
11
+ destFile?: string;
12
+ content?: string;
13
13
  }
14
14
 
15
- interface ConveyResult {
16
- succeeded: Array<{ input: FileMap; output: FileMap }>;
17
- errored: Array<{ input: FileMap; error: Error }>;
15
+ export interface ConveyResult {
16
+ succeeded: Array<{ input: FileMap; output: FileMap }>;
17
+ errored: Array<{ input: FileMap; error: Error }>;
18
+ warned: Array<{ input: FileMap; warning: string }>;
18
19
  }
19
20
 
20
21
  export default class Conveyor {
21
- constructor(
22
- parse: ActionManager,
23
- print: ActionManager,
24
- logger: Logger,
25
- output: FileMap
26
- );
22
+ constructor(
23
+ parse: ActionManager,
24
+ print: ActionManager,
25
+ logger: Logger,
26
+ output: FileMap
27
+ );
27
28
 
28
- readonly parse: ActionManager;
29
- readonly print: ActionManager;
30
- readonly logger: Logger;
31
- readonly output: FileMap;
29
+ readonly parse: ActionManager;
30
+ readonly print: ActionManager;
31
+ readonly logger: Logger;
32
+ readonly output: FileMap;
32
33
 
33
- /**
34
- * Processes files with a concurrency limit.
35
- *
36
- * @param files - List of files to process.
37
- * @param maxConcurrent - Maximum number of concurrent tasks.
38
- * @returns Resolves when all files are processed.
39
- */
40
- convey(files: FileMap[], maxConcurrent?: number): Promise<ConveyResult>;
34
+ /**
35
+ * Processes files with a concurrency limit.
36
+ *
37
+ * @param files - List of files to process.
38
+ * @param maxConcurrent - Maximum number of concurrent tasks.
39
+ * @returns Resolves when all files are processed.
40
+ */
41
+ convey(files: FileMap[], maxConcurrent?: number): Promise<ConveyResult>;
41
42
 
42
- #succeeded: Array<{ input: FileMap; output: FileMap }>;
43
- #errored: Array<{ input: FileMap; error: Error }>;
44
- #processFile(file: FileMap): Promise<ProcessResult>;
45
- #writeOutput(destFile: string, content: string): Promise<ProcessResult>;
43
+ #succeeded: Array<{ input: FileMap; output: FileMap }>;
44
+ #errored: Array<{ input: FileMap; error: Error }>;
45
+ #warned: Array<{ input: FileMap; warning: string }>;
46
+ #processFile(file: FileMap): Promise<ProcessResult>;
47
+ #writeOutput(destFile: string, content: string): Promise<ProcessResult>;
46
48
  }
47
49
  //# sourceMappingURL=Conveyor.d.ts.map
@@ -1,53 +1,48 @@
1
1
  import Logger from './Logger';
2
2
  import ActionManager from './ActionManager';
3
- import { FileMap } from './util/FDUtil';
3
+ import { ConveyResult} from './Conveyor';
4
4
 
5
5
  export const Environment: Readonly<{
6
- EXTENSION: 'extension';
7
- NPM: 'npm';
8
- ACTION: 'action';
9
- CLI: 'cli';
6
+ EXTENSION: 'extension';
7
+ NPM: 'npm';
8
+ ACTION: 'action';
9
+ CLI: 'cli';
10
10
  }>;
11
11
 
12
12
  export type EnvironmentType = typeof Environment[keyof typeof Environment];
13
13
 
14
14
  interface CoreOptions {
15
- debug?: boolean;
16
- debugLevel?: number;
17
- name?: string;
18
- [key: string]: unknown;
15
+ debug?: boolean;
16
+ debugLevel?: number;
17
+ name?: string;
18
+ [key: string]: unknown;
19
19
  }
20
20
 
21
21
  interface CoreConstructorOptions extends CoreOptions {
22
- hooks?: string;
23
- hooksTimeout?: number;
24
- output?: string;
25
- maxConcurrent?: number;
22
+ hooks?: string;
23
+ hooksTimeout?: number;
24
+ output?: string;
25
+ maxConcurrent?: number;
26
26
  }
27
27
 
28
28
  interface NewParams {
29
- options: CoreOptions;
30
- source: EnvironmentType;
31
- }
32
-
33
- interface ProcessResult {
34
- succeeded: Array<{ input: FileMap; output: FileMap }>;
35
- errored: Array<{ input: FileMap; error: Error }>;
29
+ options: CoreOptions;
30
+ source: EnvironmentType;
36
31
  }
37
32
 
38
33
  export default class Core {
39
- static new({ options, source }: NewParams): Promise<Core>;
34
+ static new({ options, source }: NewParams): Promise<Core>;
40
35
 
41
- constructor(options: CoreConstructorOptions);
36
+ constructor(options: CoreConstructorOptions);
42
37
 
43
- readonly options: CoreConstructorOptions;
44
- readonly logger: Logger;
45
- readonly packageJson: Record<string, unknown>;
46
- readonly debugOptions: {
47
- name: string | null;
48
- debugLevel: number;
49
- };
50
- readonly actions: Record<string, ActionManager>;
38
+ readonly options: CoreConstructorOptions;
39
+ readonly logger: Logger;
40
+ readonly packageJson: Record<string, unknown>;
41
+ readonly debugOptions: {
42
+ name: string | null;
43
+ debugLevel: number;
44
+ };
45
+ readonly actions: Record<string, ActionManager>;
51
46
 
52
- processFiles(glob: string | string[], startTime?: [number, number]): Promise<ProcessResult>;
47
+ processFiles(glob: string | string[], startTime?: [number, number]): Promise<ConveyResult>;
53
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gesslar/bedoc",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "Pluggable documentation engine for any language and format",
5
5
  "publisher": "gesslar",
6
6
  "main": "./src/core/Core.js",
@@ -18,6 +18,13 @@
18
18
  ".": {
19
19
  "import": "./src/core/Core.js",
20
20
  "types": "./dist/types/core/Core.d.ts"
21
+ },
22
+ "./BeDoc": {
23
+ "import": "./src/core/Core.js",
24
+ "types": "./dist/types/core/Core.d.ts"
25
+ },
26
+ "./*": {
27
+ "types": "./dist/types/*"
21
28
  }
22
29
  },
23
30
  "type": "module",
@@ -38,6 +45,8 @@
38
45
  },
39
46
  "devDependencies": {
40
47
  "@stylistic/eslint-plugin-js": "^3.0.0",
48
+ "@typescript-eslint/eslint-plugin": "^8.22.0",
49
+ "@typescript-eslint/parser": "^8.22.0",
41
50
  "axios": "^1.7.9",
42
51
  "chokidar": "^4.0.3",
43
52
  "eslint": "^9.18.0",