mdat 1.3.4 → 1.3.5
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/dist/bin/cli.js +278 -0
- package/dist/lib/index.d.ts +156 -0
- package/dist/lib/index.js +7 -0
- package/package.json +46 -34
- package/readme.md +17 -14
- package/bin/cli.js +0 -29419
- package/dist/api.d.ts +0 -31
- package/dist/config.d.ts +0 -74
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -24796
- package/dist/mdat-json-loader.d.ts +0 -7
- package/dist/processors.d.ts +0 -12
- package/dist/readme/api.d.ts +0 -46
- package/dist/readme/config.d.ts +0 -14
- package/dist/readme/init.d.ts +0 -18
- package/dist/readme/rules/badges.d.ts +0 -7
- package/dist/readme/rules/banner.d.ts +0 -7
- package/dist/readme/rules/code.d.ts +0 -6
- package/dist/readme/rules/contributing.d.ts +0 -7
- package/dist/readme/rules/description.d.ts +0 -10
- package/dist/readme/rules/footer.d.ts +0 -10
- package/dist/readme/rules/header.d.ts +0 -11
- package/dist/readme/rules/index.d.ts +0 -66
- package/dist/readme/rules/license.d.ts +0 -7
- package/dist/readme/rules/short-description.d.ts +0 -12
- package/dist/readme/rules/size-table.d.ts +0 -6
- package/dist/readme/rules/size.d.ts +0 -6
- package/dist/readme/rules/table-of-contents.d.ts +0 -9
- package/dist/readme/rules/title.d.ts +0 -8
- package/dist/readme/rules/toc.d.ts +0 -11
- package/dist/readme/rules/utilities/size/size-report.d.ts +0 -19
- package/dist/readme/templates/index.d.ts +0 -27
- package/dist/readme/utilities.d.ts +0 -15
- package/dist/utilities.d.ts +0 -10
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { LoaderResult } from 'cosmiconfig';
|
|
2
|
-
/**
|
|
3
|
-
* Lets arbitrary JSON objects (like from package.json) become reasonably good mdat rule sets
|
|
4
|
-
* HOWEVER cosmiconfig treats package.json as a special case and will always load only specific keys from it
|
|
5
|
-
* So we have to intercept and load them manually in config.ts
|
|
6
|
-
*/
|
|
7
|
-
export declare function mdatJsonLoader(filePath: string, content: string): LoaderResult;
|
package/dist/processors.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Root } from 'mdast';
|
|
2
|
-
import { VFile } from 'vfile';
|
|
3
|
-
import type { ConfigLoaded, ConfigToLoad, loadConfig, RulesToLoad } from './config';
|
|
4
|
-
import type { AmbientRemarkConfig } from './utilities';
|
|
5
|
-
type Loader = typeof loadConfig;
|
|
6
|
-
type ProcessorGetter = typeof getCleanProcessor | typeof getExpandProcessor;
|
|
7
|
-
export declare function processFiles(files: string | string[], loader: Loader, processorGetter: ProcessorGetter, name?: string, output?: string, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile[]>;
|
|
8
|
-
export declare function processString(markdown: string, loader: Loader, processorGetter: ProcessorGetter, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile>;
|
|
9
|
-
export declare function getExpandProcessor(options: ConfigLoaded, ambientRemarkConfig: AmbientRemarkConfig): import("unified").Processor<Root, undefined, undefined, Root, string>;
|
|
10
|
-
export declare function getCleanProcessor(options: ConfigLoaded, ambientRemarkConfig: AmbientRemarkConfig): import("unified").Processor<Root, undefined, undefined, Root, string>;
|
|
11
|
-
export declare function getCheckProcessor(options: ConfigLoaded, ambientRemarkConfig: AmbientRemarkConfig): import("unified").Processor<Root, undefined, undefined, Root, string>;
|
|
12
|
-
export {};
|
package/dist/readme/api.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { VFile } from 'vfile';
|
|
2
|
-
import type { ConfigToLoad, RulesToLoad } from '../config';
|
|
3
|
-
/**
|
|
4
|
-
* Expands MDAT readme comments in the closest readme.md file
|
|
5
|
-
* Basically an alias to `expandReadmeFiles()` with certain arguments elided.
|
|
6
|
-
* @see `findReadme()` for more details on the search process.
|
|
7
|
-
*/
|
|
8
|
-
export declare function expandReadme(config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile[]>;
|
|
9
|
-
/**
|
|
10
|
-
* Expands MDAT readme comments in one or more Markdown files
|
|
11
|
-
* Searches up for a readme.md file if none is provided.
|
|
12
|
-
* @see `findReadme()` for more details on the search process.
|
|
13
|
-
*/
|
|
14
|
-
export declare function expandReadmeFiles(files?: string | string[], name?: string, output?: string, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile[]>;
|
|
15
|
-
/**
|
|
16
|
-
* Expands MDAT readme comments in a Markdown string
|
|
17
|
-
*/
|
|
18
|
-
export declare function expandReadmeString(markdown: string, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile>;
|
|
19
|
-
/**
|
|
20
|
-
* Checks and validates MDAT readme comments in the closest readme.md file
|
|
21
|
-
* Basically an alias to `checkReadmeFiles()` with certain arguments elided.
|
|
22
|
-
* @see `findReadme()` for more details on the search process.
|
|
23
|
-
*/
|
|
24
|
-
export declare function checkReadme(config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile[]>;
|
|
25
|
-
/**
|
|
26
|
-
* Checks and validates MDAT readme comments in one or more Markdown files
|
|
27
|
-
* Searches up for a readme.md file if none is provided.
|
|
28
|
-
* @see `findReadme()` for more details on the search process.
|
|
29
|
-
*/
|
|
30
|
-
export declare function checkReadmeFiles(files?: string | string[], name?: string, output?: string, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile[]>;
|
|
31
|
-
/**
|
|
32
|
-
* Checks and validates MDAT readme comments in a Markdown string
|
|
33
|
-
*/
|
|
34
|
-
export declare function checkReadmeString(markdown: string, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile>;
|
|
35
|
-
/**
|
|
36
|
-
* Collapses MDAT readme comments in the closest readme.md file
|
|
37
|
-
* Basically an alias to `collapseReadmeFiles()` with certain arguments elided.
|
|
38
|
-
* @see `findReadme()` for more details on the search process.
|
|
39
|
-
*/
|
|
40
|
-
export declare function collapseReadme(config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile[]>;
|
|
41
|
-
/**
|
|
42
|
-
* Collapses MDAT readme comments in one or more Markdown files
|
|
43
|
-
* Searches up for a readme.md file if none is provided.
|
|
44
|
-
* @see `findReadme()` for more details on the search process.
|
|
45
|
-
*/
|
|
46
|
-
export declare function collapseReadmeFiles(files?: string | string[], name?: string, output?: string, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile[]>;
|
package/dist/readme/config.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Simplify } from 'type-fest';
|
|
2
|
-
import type { ConfigLoaded } from '../config';
|
|
3
|
-
import { loadConfig } from '../config';
|
|
4
|
-
type ReadmeConfigLoaded = Simplify<ConfigLoaded & {
|
|
5
|
-
packageFile: string;
|
|
6
|
-
}>;
|
|
7
|
-
type LoadConfigOptions = Parameters<typeof loadConfig>[0];
|
|
8
|
-
/**
|
|
9
|
-
* Convenience loader to always include the default readme config.
|
|
10
|
-
* The readme defaults should have lower priority than searched/user config,
|
|
11
|
-
* but higher priority than base mdat defaults.
|
|
12
|
-
*/
|
|
13
|
-
export declare function loadConfigReadme(options?: LoadConfigOptions): Promise<ReadmeConfigLoaded>;
|
|
14
|
-
export {};
|
package/dist/readme/init.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
type MdatReadmeInitOptions = {
|
|
2
|
-
compound: boolean;
|
|
3
|
-
expand: boolean;
|
|
4
|
-
output: string;
|
|
5
|
-
overwrite: boolean;
|
|
6
|
-
template: string;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Initializes a new readme file interactively.
|
|
10
|
-
* @returns Path to the created readme file.
|
|
11
|
-
*/
|
|
12
|
-
export declare function initReadmeInteractive(): Promise<string>;
|
|
13
|
-
/**
|
|
14
|
-
* Creates a new readme file with the given options.
|
|
15
|
-
* @returns Path to the created readme file.
|
|
16
|
-
*/
|
|
17
|
-
export declare function initReadme(options?: Partial<MdatReadmeInitOptions>): Promise<string>;
|
|
18
|
-
export {};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
toc: {
|
|
3
|
-
applicationOrder: number;
|
|
4
|
-
content(options: import("type-fest").JsonValue, tree: import("mdast").Root): Promise<string>;
|
|
5
|
-
order: number;
|
|
6
|
-
};
|
|
7
|
-
title: {
|
|
8
|
-
applicationOrder: number;
|
|
9
|
-
content(options?: import("type-fest").JsonValue | undefined): Promise<string>;
|
|
10
|
-
order: number;
|
|
11
|
-
};
|
|
12
|
-
'table-of-contents': {
|
|
13
|
-
applicationOrder: number;
|
|
14
|
-
content(options: import("type-fest").JsonValue, tree: import("mdast").Root): Promise<string>;
|
|
15
|
-
order: number;
|
|
16
|
-
};
|
|
17
|
-
'size-table': {
|
|
18
|
-
content(options: import("type-fest").JsonValue): Promise<string>;
|
|
19
|
-
};
|
|
20
|
-
size: {
|
|
21
|
-
content(options: import("type-fest").JsonValue): Promise<string>;
|
|
22
|
-
};
|
|
23
|
-
'short-description': {
|
|
24
|
-
content(): Promise<string>;
|
|
25
|
-
order: number;
|
|
26
|
-
};
|
|
27
|
-
license: {
|
|
28
|
-
content(): Promise<string>;
|
|
29
|
-
order: number;
|
|
30
|
-
};
|
|
31
|
-
header: {
|
|
32
|
-
applicationOrder: number;
|
|
33
|
-
content: {
|
|
34
|
-
content(options?: import("type-fest").JsonValue | undefined): Promise<string>;
|
|
35
|
-
order: number;
|
|
36
|
-
}[];
|
|
37
|
-
order: number;
|
|
38
|
-
};
|
|
39
|
-
footer: {
|
|
40
|
-
content: {
|
|
41
|
-
content(): Promise<string>;
|
|
42
|
-
order: number;
|
|
43
|
-
}[];
|
|
44
|
-
order: number;
|
|
45
|
-
};
|
|
46
|
-
description: {
|
|
47
|
-
content(): Promise<string>;
|
|
48
|
-
order: number;
|
|
49
|
-
};
|
|
50
|
-
contributing: {
|
|
51
|
-
content(): Promise<string>;
|
|
52
|
-
order: number;
|
|
53
|
-
};
|
|
54
|
-
code: {
|
|
55
|
-
content(options: import("type-fest").JsonValue): Promise<string>;
|
|
56
|
-
};
|
|
57
|
-
banner: {
|
|
58
|
-
content(options?: import("type-fest").JsonValue | undefined): Promise<string>;
|
|
59
|
-
order: number;
|
|
60
|
-
};
|
|
61
|
-
badges: {
|
|
62
|
-
content(options?: import("type-fest").JsonValue | undefined): Promise<string>;
|
|
63
|
-
order: number;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
export default _default;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple alias for `description` rule, to match nomenclature in
|
|
3
|
-
* [standard-readme](https://github.com/RichardLitt/standard-readme/blob/main/spec.md#short-description)
|
|
4
|
-
* spec.
|
|
5
|
-
*/
|
|
6
|
-
declare const _default: {
|
|
7
|
-
'short-description': {
|
|
8
|
-
content(): Promise<string>;
|
|
9
|
-
order: number;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export default _default;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple alias for table-of-contents
|
|
3
|
-
*/
|
|
4
|
-
declare const _default: {
|
|
5
|
-
toc: {
|
|
6
|
-
applicationOrder: number;
|
|
7
|
-
content(options: import("type-fest").JsonValue, tree: import("mdast").Root): Promise<string>;
|
|
8
|
-
order: number;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export default _default;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
type SizeInfo = {
|
|
2
|
-
bytes: number;
|
|
3
|
-
bytesPretty: string;
|
|
4
|
-
percent: number;
|
|
5
|
-
percentPretty: string;
|
|
6
|
-
};
|
|
7
|
-
export type SizeReport = {
|
|
8
|
-
brotli: SizeInfo;
|
|
9
|
-
gzip: SizeInfo;
|
|
10
|
-
original: SizeInfo;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Analyzes a file's size and its compressed sizes using Brotli and Gzip
|
|
14
|
-
* @param filePath - Path to the file to analyze
|
|
15
|
-
* @returns Promise containing detailed size report
|
|
16
|
-
* @throws {Error} if file cannot be read or compressed
|
|
17
|
-
*/
|
|
18
|
-
export declare function createSizeReport(filePath: string): Promise<SizeReport>;
|
|
19
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'MDAT Readme': {
|
|
3
|
-
content: {
|
|
4
|
-
compound: string;
|
|
5
|
-
explicit: string;
|
|
6
|
-
};
|
|
7
|
-
description: string;
|
|
8
|
-
exampleLink: "https://github.com/kitschpatrol/mdat/blob/main/readme.md";
|
|
9
|
-
};
|
|
10
|
-
'Standard Readme Basic': {
|
|
11
|
-
content: {
|
|
12
|
-
compound: string;
|
|
13
|
-
explicit: string;
|
|
14
|
-
};
|
|
15
|
-
description: string;
|
|
16
|
-
exampleLink: "https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/minimal-readme.md";
|
|
17
|
-
};
|
|
18
|
-
'Standard Readme Full': {
|
|
19
|
-
content: {
|
|
20
|
-
compound: string;
|
|
21
|
-
explicit: string;
|
|
22
|
-
};
|
|
23
|
-
description: string;
|
|
24
|
-
exampleLink: "https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/maximal-readme.md";
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export default _default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Searches for a readme file in the following order:
|
|
3
|
-
* 1. Searches the current working directly for readme.md
|
|
4
|
-
* 2. If there's no readme.md in the current directory, search up to the closest package directory
|
|
5
|
-
* 3. Give up and return undefined if no readme is found
|
|
6
|
-
* @returns The path to the readme file or undefined if not found
|
|
7
|
-
*/
|
|
8
|
-
export declare function findReadme(): Promise<string | undefined>;
|
|
9
|
-
/**
|
|
10
|
-
* Searches up for a readme.md file
|
|
11
|
-
* @see `findReadme()` for more details on the search process.
|
|
12
|
-
* @returns The path to the readme file
|
|
13
|
-
* @throws {Error} if no readme is found
|
|
14
|
-
*/
|
|
15
|
-
export declare function findReadmeThrows(): Promise<string>;
|
package/dist/utilities.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ConfigResult as AmbientRemarkConfig } from 'unified-engine';
|
|
2
|
-
export { type ConfigResult as AmbientRemarkConfig } from 'unified-engine';
|
|
3
|
-
export declare function getInputOutputPaths(inputs: string[], output: string | undefined, name: string | undefined, extension: string | undefined): Array<{
|
|
4
|
-
input: string;
|
|
5
|
-
name: string;
|
|
6
|
-
output: string;
|
|
7
|
-
}>;
|
|
8
|
-
export declare function findPackage(): Promise<string | undefined>;
|
|
9
|
-
export declare function ensureArray<T>(value: T | T[] | undefined): T[];
|
|
10
|
-
export declare function loadAmbientRemarkConfig(): Promise<AmbientRemarkConfig>;
|