remark-mdat 1.2.4 → 1.2.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/index.d.ts CHANGED
@@ -228,15 +228,15 @@ declare const optionsSchema: z.ZodObject<{
228
228
  metaCommentIdentifier: z.ZodOptional<z.ZodString>;
229
229
  rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<any, z.ZodTypeDef, any>>>;
230
230
  }, "strip", z.ZodTypeAny, {
231
- addMetaComment?: string | boolean | undefined;
232
231
  closingPrefix?: string | undefined;
233
232
  keywordPrefix?: string | undefined;
233
+ addMetaComment?: string | boolean | undefined;
234
234
  metaCommentIdentifier?: string | undefined;
235
235
  rules?: Record<string, any> | undefined;
236
236
  }, {
237
- addMetaComment?: string | boolean | undefined;
238
237
  closingPrefix?: string | undefined;
239
238
  keywordPrefix?: string | undefined;
239
+ addMetaComment?: string | boolean | undefined;
240
240
  metaCommentIdentifier?: string | undefined;
241
241
  rules?: Record<string, any> | undefined;
242
242
  }>;
package/dist/index.js CHANGED
@@ -9,7 +9,6 @@ import { remark } from "remark";
9
9
  import remarkGfm from "remark-gfm";
10
10
  import { fromHtml } from "hast-util-from-html";
11
11
  import { deepmerge } from "deepmerge-ts";
12
-
13
12
  //#region src/lib/mdat/log.ts
14
13
  const isNode = process?.versions?.node !== void 0;
15
14
  const log = {
@@ -45,7 +44,6 @@ const log = {
45
44
  this.error(picocolors.blue(`[${prefix}]`), ...data);
46
45
  }
47
46
  };
48
-
49
47
  //#endregion
50
48
  //#region src/lib/mdat/mdat-log.ts
51
49
  function saveLog(file, level, source, message, lineOrNode, maybeColumn) {
@@ -125,7 +123,6 @@ function mdatMessageToLogString(sourcePath, mdatMessage) {
125
123
  function highlightComments(text, level) {
126
124
  return text.replaceAll(/<!--.+-->/g, (match) => level === "info" ? picocolors.green(match) : level === "warn" ? picocolors.yellow(match) : picocolors.red(match));
127
125
  }
128
-
129
126
  //#endregion
130
127
  //#region src/lib/mdat/parse.ts
131
128
  /**
@@ -213,7 +210,6 @@ function trimMetaIdentifiers(text, metaCommentIdentifier) {
213
210
  text = text.endsWith(metaCommentIdentifier) ? text.slice(0, -metaCommentIdentifier.length) : text;
214
211
  return text;
215
212
  }
216
-
217
213
  //#endregion
218
214
  //#region src/lib/mdat/rules.ts
219
215
  function normalizeRules(rules) {
@@ -360,7 +356,6 @@ function getSoleRecord(record) {
360
356
  if (recordValues.length > 1) throw new Error("Found multiple entries in \"sole record\" record. This should never happen");
361
357
  return recordValues[0];
362
358
  }
363
-
364
359
  //#endregion
365
360
  //#region src/lib/mdast-utils/mdast-util-mdat-check.ts
366
361
  /**
@@ -500,7 +495,6 @@ function commentOrderList(comments) {
500
495
  throw new Error("Unexpected comment type");
501
496
  });
502
497
  }
503
-
504
498
  //#endregion
505
499
  //#region src/lib/mdast-utils/mdast-util-mdat-clean.ts
506
500
  /**
@@ -543,7 +537,6 @@ function mdatClean(tree, file, options) {
543
537
  }
544
538
  });
545
539
  }
546
-
547
540
  //#endregion
548
541
  //#region src/lib/mdast-utils/mdast-util-mdat-expand.ts
549
542
  async function mdatExpand(tree, file, options) {
@@ -592,7 +585,6 @@ async function mdatExpand(tree, file, options) {
592
585
  tree.children.unshift(metaComment);
593
586
  }
594
587
  }
595
-
596
588
  //#endregion
597
589
  //#region src/lib/mdast-utils/mdast-util-mdat-split.ts
598
590
  /**
@@ -655,7 +647,6 @@ function getOriginalMarkup(mdastNode, hastNode) {
655
647
  if (hastNode.position === void 0) throw new Error("Hast ElementContent node has no position!");
656
648
  return mdastNode.value.slice(hastNode.position.start.offset, hastNode.position.end.offset);
657
649
  }
658
-
659
650
  //#endregion
660
651
  //#region src/lib/mdast-utils/mdast-util-mdat.ts
661
652
  async function mdat(tree, file, options) {
@@ -682,7 +673,6 @@ async function mdat(tree, file, options) {
682
673
  rules
683
674
  });
684
675
  }
685
-
686
676
  //#endregion
687
677
  //#region src/lib/mdat/deep-merge-defined.ts
688
678
  function stripUndefinedDeep(object) {
@@ -695,7 +685,6 @@ function stripUndefinedDeep(object) {
695
685
  function deepMergeDefined(...objects) {
696
686
  return deepmerge(...objects.map((v, i) => i === 0 ? v : stripUndefinedDeep(v)));
697
687
  }
698
-
699
688
  //#endregion
700
689
  //#region src/lib/remark-mdat.ts
701
690
  const defaultOptions = {
@@ -721,6 +710,5 @@ const remarkMdat = function(options) {
721
710
  await mdat(tree, file, resolvedOptions);
722
711
  };
723
712
  };
724
-
725
713
  //#endregion
726
- export { deepMergeDefined, remarkMdat as default, getMdatReports, getSoleRule, getSoleRuleKey, log, mdat, mdatCheck, mdatClean, mdatExpand, mdatSplit, optionsSchema, reporterMdat, rulesSchema };
714
+ export { deepMergeDefined, remarkMdat as default, getMdatReports, getSoleRule, getSoleRuleKey, log, mdat, mdatCheck, mdatClean, mdatExpand, mdatSplit, optionsSchema, reporterMdat, rulesSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remark-mdat",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "A remark plugin implementing the Markdown Autophagic Template (MDAT) system.",
5
5
  "keywords": [
6
6
  "mdat",
@@ -50,7 +50,7 @@
50
50
  "picocolors": "^1.1.1",
51
51
  "remark": "^15.0.1",
52
52
  "remark-gfm": "^4.0.1",
53
- "type-fest": "^5.4.4",
53
+ "type-fest": "^5.5.0",
54
54
  "unified": "^11.0.5",
55
55
  "unist-util-visit": "^5.1.0",
56
56
  "vfile": "^6.0.3",
@@ -59,13 +59,13 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "@arethetypeswrong/core": "^0.18.2",
62
- "@kitschpatrol/shared-config": "^6.0.2",
63
- "@types/node": "~20.19.35",
64
- "bumpp": "^10.4.1",
62
+ "@kitschpatrol/shared-config": "^6.1.0",
63
+ "@types/node": "~20.19.37",
64
+ "bumpp": "^11.0.1",
65
65
  "publint": "^0.3.18",
66
- "tsdown": "^0.20.3",
66
+ "tsdown": "^0.21.4",
67
67
  "typescript": "~5.9.3",
68
- "vitest": "^4.0.18"
68
+ "vitest": "^4.1.1"
69
69
  },
70
70
  "engines": {
71
71
  "node": ">=20.0.0"
@@ -83,6 +83,6 @@
83
83
  "fix": "ksc fix",
84
84
  "lint": "ksc lint",
85
85
  "release": "bumpp --commit 'Release: %s' && pnpm run build && NPM_AUTH_TOKEN=$(op read 'op://Personal/npm/token') && pnpm publish",
86
- "test": "vitest"
86
+ "test": "vitest run"
87
87
  }
88
88
  }
package/readme.md CHANGED
@@ -6,10 +6,18 @@
6
6
 
7
7
  <!-- /title -->
8
8
 
9
- <!-- badges -->
9
+ <!-- badges { custom: {
10
+ "CI": {
11
+ image: "https://github.com/kitschpatrol/remark-mdat/actions/workflows/ci.yml/badge.svg",
12
+ link: "https://github.com/kitschpatrol/remark-mdat/actions/workflows/ci.yml",
13
+ },
14
+ }
15
+ }
16
+ -->
10
17
 
11
18
  [![NPM Package remark-mdat](https://img.shields.io/npm/v/remark-mdat.svg)](https://npmjs.com/package/remark-mdat)
12
19
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
20
+ [![CI](https://github.com/kitschpatrol/remark-mdat/actions/workflows/ci.yml/badge.svg)](https://github.com/kitschpatrol/remark-mdat/actions/workflows/ci.yml)
13
21
 
14
22
  <!-- /badges -->
15
23