mdat 0.9.0 → 0.10.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.
@@ -1,11 +1,12 @@
1
1
  import { type Root } from 'mdast';
2
2
  import { VFile } from 'vfile';
3
3
  import { type ConfigLoaded, type ConfigToLoad, type loadConfig, type RulesToLoad } from './config';
4
+ import { type AmbientRemarkConfig } from './utilities';
4
5
  type Loader = typeof loadConfig;
5
6
  type ProcessorGetter = typeof getCleanProcessor | typeof getExpandProcessor;
6
7
  export declare function processFiles(files: string | string[], loader: Loader, processorGetter: ProcessorGetter, name?: string, output?: string, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile[]>;
7
8
  export declare function processString(markdown: string, loader: Loader, processorGetter: ProcessorGetter, config?: ConfigToLoad, rules?: RulesToLoad): Promise<VFile>;
8
- export declare function getExpandProcessor(options: ConfigLoaded): import("unified").Processor<Root, undefined, undefined, Root, string>;
9
- export declare function getCleanProcessor(options: ConfigLoaded): import("unified").Processor<Root, undefined, undefined, Root, string>;
10
- export declare function getCheckProcessor(options: ConfigLoaded): import("unified").Processor<Root, undefined, undefined, Root, string>;
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>;
11
12
  export {};
@@ -1,3 +1,5 @@
1
+ import { type ConfigResult as AmbientRemarkConfig } from 'unified-engine';
2
+ export { type ConfigResult as AmbientRemarkConfig } from 'unified-engine';
1
3
  export declare function getInputOutputPaths(inputs: string[], output: string | undefined, name: string | undefined, extension: string | undefined): Array<{
2
4
  input: string;
3
5
  name: string;
@@ -11,3 +13,4 @@ export declare function getInputOutputPath(input: string, output: string | undef
11
13
  export declare function expandPath(file: string): string;
12
14
  export declare function findPackage(): Promise<string | undefined>;
13
15
  export declare function ensureArray<T>(value: T | T[] | undefined): T[];
16
+ export declare function loadAmbientRemarkConfig(): Promise<AmbientRemarkConfig>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mdat",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "description": "CLI tool and library implementing the Markdown Autophagic Template (MDAT) system. MDAT lets you use comments as dynamic content templates in Markdown files, making it easy to generate and update readme boilerplate.",
6
6
  "repository": "github:kitschpatrol/mdat",
@@ -51,17 +51,19 @@
51
51
  "read-pkg": "^9.0.1",
52
52
  "remark-mdat": "^0.7.5",
53
53
  "type-fest": "^4.33.0",
54
+ "unified-engine": "^11.2.2",
54
55
  "vfile": "^6.0.3",
55
56
  "which": "^5.0.0"
56
57
  },
57
58
  "devDependencies": {
58
59
  "@kitschpatrol/shared-config": "^4.7.12",
59
60
  "@types/which": "^3.0.4",
60
- "bumpp": "^9.10.1",
61
+ "bumpp": "^10.0.1",
61
62
  "chalk": "^5.4.1",
62
63
  "chevrotain": "^11.0.3",
63
64
  "find-up": "^7.0.0",
64
65
  "is-executable": "^2.0.1",
66
+ "mdast-util-to-markdown": "^2.1.2",
65
67
  "mdast-util-toc": "^7.1.0",
66
68
  "nanoid": "^5.0.9",
67
69
  "package-up": "^5.0.0",
@@ -73,7 +75,7 @@
73
75
  "remark": "^15.0.1",
74
76
  "remark-gfm": "^4.0.0",
75
77
  "to-vfile": "^8.0.0",
76
- "tsup": "^8.3.5",
78
+ "tsup": "^8.3.6",
77
79
  "typescript": "^5.7.3",
78
80
  "untildify": "^5.0.0",
79
81
  "vitest": "^2.1.8",
package/readme.md CHANGED
@@ -216,7 +216,8 @@ As [noted below](#similar-projects), there are several similar projects out ther
216
216
 
217
217
  ## Usage
218
218
 
219
- > \[!WARNING]\
219
+ > [!WARNING]
220
+ >
220
221
  > **The MDAT CLI tool directly manipulates the contents of readme files, in close (and perhaps dangerous) proximity to your painstakingly crafted words.**
221
222
  >
222
223
  > Please make sure any text you care about is committed before running `mdat`, and never directly modify content inside of the comment expansion blocks.
@@ -647,6 +648,10 @@ A valid configuration file default-exports an object conforming to the above typ
647
648
 
648
649
  The configuration file may be located in any location supported by [cosmicconfig](https://github.com/cosmiconfig/cosmiconfig?tab=readme-ov-file#searchplaces). I use an `mdat.config.ts` file in the root of my projects.
649
650
 
651
+ > [!NOTE]
652
+ >
653
+ > The `mdat` commands _also_ search for and merge any ambient Remark `.remarkrc` configuration files you might have in your project. This is unrelated to the `mdat` rule configuration files, but it _can_ have an affect how Markdown is validated and rendered by `mdat`.
654
+
650
655
  #### Rule file format
651
656
 
652
657
  Rules may also be defined in separate files that default-export a record of rules. The record keys become the keywords used to reference a rule from your comments in Markdown.
@@ -738,10 +743,10 @@ See the [Examples section](https://github.com/kitschpatrol/remark-mdat#examples)
738
743
 
739
744
  <!-- size-table { files: ["package.json", "readme.md"] } -->
740
745
 
741
- | File | Original | Gzip | Brotli |
742
- | ------------ | -------- | ------ | ------ |
743
- | package.json | 2.5 kB | 1.1 kB | 996 B |
744
- | readme.md | 22.8 kB | 8.2 kB | 6.8 kB |
746
+ | File | Original | Gzip | Brotli |
747
+ | ------------ | -------- | ------- | ------ |
748
+ | package.json | 2.6 kB | 1.2 kB | 1 kB |
749
+ | readme.md | 57.4 kB | 11.4 kB | 9.1 kB |
745
750
 
746
751
  <!-- /size-table -->
747
752
 
@@ -856,6 +861,10 @@ Recommended workflow integration approach:
856
861
 
857
862
  - Invoke via hooks / GitHub actions?
858
863
 
864
+ Architectural improvements:
865
+
866
+ - Use [unified-engine](https://github.com/unifiedjs/unified-engine) to handle file loading and transformation.
867
+
859
868
  ## Maintainers
860
869
 
861
870
  [@kitschpatrol](https://github.com/kitschpatrol)