remark-mdat 3.0.1 → 3.0.3

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
@@ -114,28 +114,28 @@ type Rules = SimplifyDeep<Record<string, Rule>>;
114
114
  /** A record mapping comment keywords to {@link NormalizedRule} objects. */
115
115
  type NormalizedRules = SimplifyDeep<Record<string, NormalizedRule>>;
116
116
  /** Zod schema for validating {@link Rules} records. */
117
- declare const rulesSchema: z.ZodRecord<z.ZodString, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
117
+ export declare const rulesSchema: z.ZodRecord<z.ZodString, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
118
118
  /**
119
119
  * Returns the rule value from a single-rule record. Useful when aliasing rules
120
120
  * or invoking them programmatically.
121
121
  *
122
122
  * Throws if there are no entries or more than one entry.
123
123
  */
124
- declare function getSoleRule<T extends NormalizedRules | Rules>(rules: T): T[keyof T];
124
+ export declare function getSoleRule<T extends NormalizedRules | Rules>(rules: T): T[keyof T];
125
125
  /**
126
126
  * Returns the rule key from a single-rule record. Useful for comment
127
127
  * placeholder validation.
128
128
  *
129
129
  * Throws if there are no entries or more than one entry.
130
130
  */
131
- declare function getSoleRuleKey<T extends NormalizedRules | Rules>(rules: T): keyof T;
131
+ export declare function getSoleRuleKey<T extends NormalizedRules | Rules>(rules: T): keyof T;
132
132
  //#endregion
133
133
  //#region src/lib/mdast-utils/mdast-util-mdat.d.ts
134
134
  /**
135
135
  * Mdast utility that splits, collapses, and then re-expands all mdat comments
136
136
  * in the tree.
137
137
  */
138
- declare function mdat(tree: Root, file: VFile, rules: NormalizedRules | Rules): Promise<void>;
138
+ export declare function mdat(tree: Root, file: VFile, rules: NormalizedRules | Rules): Promise<void>;
139
139
  //#endregion
140
140
  //#region src/lib/mdast-utils/mdast-util-mdat-collapse.d.ts
141
141
  /**
@@ -143,14 +143,14 @@ declare function mdat(tree: Root, file: VFile, rules: NormalizedRules | Rules):
143
143
  * its pre-expansion state, preserving the original comments. No-op if no mdat
144
144
  * comments are found.
145
145
  */
146
- declare function mdatCollapse(tree: Root, file: VFile): void;
146
+ export declare function mdatCollapse(tree: Root, file: VFile): void;
147
147
  //#endregion
148
148
  //#region src/lib/mdast-utils/mdast-util-mdat-clean.d.ts
149
149
  /**
150
150
  * @deprecated Use {@link mdatCollapse} instead. This alias will be removed in a
151
151
  * future major version.
152
152
  */
153
- declare const mdatClean: typeof mdatCollapse;
153
+ export declare const mdatClean: typeof mdatCollapse;
154
154
  //#endregion
155
155
  //#region src/lib/mdast-utils/mdast-util-mdat-diff.d.ts
156
156
  /** Per-tag comparison result from {@link mdatDiff}. */
@@ -173,13 +173,13 @@ type MdatDiffResult = {
173
173
  *
174
174
  * @returns Per-tag comparison results.
175
175
  */
176
- declare function mdatDiff(originalTree: Root, originalFile: VFile, expandedTree: Root, expandedFile: VFile): MdatDiffResult[];
176
+ export declare function mdatDiff(originalTree: Root, originalFile: VFile, expandedTree: Root, expandedFile: VFile): MdatDiffResult[];
177
177
  //#endregion
178
178
  //#region src/lib/mdast-utils/mdast-util-mdat-expand.d.ts
179
179
  /**
180
180
  * Mdast utility to expand mdat comments in the tree.
181
181
  */
182
- declare function mdatExpand(tree: Root, file: VFile, rules: NormalizedRules | Rules): Promise<void>;
182
+ export declare function mdatExpand(tree: Root, file: VFile, rules: NormalizedRules | Rules): Promise<void>;
183
183
  //#endregion
184
184
  //#region src/lib/mdast-utils/mdast-util-mdat-split.d.ts
185
185
  /**
@@ -187,7 +187,7 @@ declare function mdatExpand(tree: Root, file: VFile, rules: NormalizedRules | Ru
187
187
  * individual MDAST HTML nodes. They're wrapped in a paragraph so as not to
188
188
  * introduce new breaks.
189
189
  */
190
- declare function mdatSplit(tree: Root, file: VFile): void;
190
+ export declare function mdatSplit(tree: Root, file: VFile): void;
191
191
  //#endregion
192
192
  //#region src/lib/mdast-utils/mdast-util-mdat-strip.d.ts
193
193
  /**
@@ -195,7 +195,7 @@ declare function mdatSplit(tree: Root, file: VFile): void;
195
195
  * preserving any content between them. Code-style comments (`//`, `#`, `/*`)
196
196
  * are left untouched.
197
197
  */
198
- declare function mdatStrip(tree: Root, _file: VFile): void;
198
+ export declare function mdatStrip(tree: Root, _file: VFile): void;
199
199
  //#endregion
200
200
  //#region src/lib/mdat/log.d.ts
201
201
  /**
@@ -205,7 +205,7 @@ declare function mdatStrip(tree: Root, _file: VFile): void;
205
205
  * @param logger - Accepts either a LogLayer instance or a Console- or
206
206
  * Stream-like log target
207
207
  */
208
- declare function setLogger(logger?: ILogBasic | ILogLayer<unknown>): void;
208
+ export declare function setLogger(logger?: ILogBasic | ILogLayer<unknown>): void;
209
209
  //#endregion
210
210
  //#region src/lib/mdat/mdat-log.d.ts
211
211
  /** A simplified representation of a {@link VFileMessage}. */
@@ -235,9 +235,9 @@ type MdatFileReport = {
235
235
  warnings: MdatMessage[];
236
236
  };
237
237
  /** Converts an array of processed VFiles into {@link MdatFileReport} objects. */
238
- declare function getMdatReports(files: VFile[]): MdatFileReport[];
238
+ export declare function getMdatReports(files: VFile[]): MdatFileReport[];
239
239
  /** Logs a human-readable processing report for each VFile to the library logger. */
240
- declare function reporterMdat(files: VFile[]): void;
240
+ export declare function reporterMdat(files: VFile[]): void;
241
241
  //#endregion
242
242
  //#region src/lib/remark-mdat.d.ts
243
243
  /** Configuration for the remarkMdat plugin. */
@@ -249,7 +249,7 @@ type Options = {
249
249
  rules?: Rules;
250
250
  };
251
251
  /** Zod schema for validating {@link Options}. */
252
- declare const optionsSchema: z.ZodObject<{
252
+ export declare const optionsSchema: z.ZodObject<{
253
253
  rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
254
254
  }, z.core.$strip>;
255
255
  /**
@@ -257,4 +257,4 @@ declare const optionsSchema: z.ZodObject<{
257
257
  */
258
258
  declare const remarkMdat: Plugin<[Options?], Root>;
259
259
  //#endregion
260
- export { type MdatDiffResult, type MdatFileReport, type MdatMessage, type NormalizedRule, type NormalizedRules, type Options, type Rule, type RuleContext, type Rules, type SimplifyDeep, remarkMdat as default, getMdatReports, getSoleRule, getSoleRuleKey, mdat, mdatClean, mdatCollapse, mdatDiff, mdatExpand, mdatSplit, mdatStrip, optionsSchema, reporterMdat, rulesSchema, setLogger };
260
+ export { type MdatDiffResult, type MdatFileReport, type MdatMessage, type NormalizedRule, type NormalizedRules, type Options, type Rule, type RuleContext, type Rules, type SimplifyDeep, remarkMdat as default };
package/dist/index.js CHANGED
@@ -54,7 +54,7 @@ function saveLog(file, level, source, message, lineOrNode, maybeColumn) {
54
54
  source
55
55
  };
56
56
  const vFileMessage = file.message(message, options);
57
- vFileMessage.fatal = level === "error" ? true : level === "warn" ? false : void 0;
57
+ vFileMessage.fatal = level === "info" ? void 0 : level === "error";
58
58
  }
59
59
  function vFileMessageToMdatMessage(vFileMessage) {
60
60
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remark-mdat",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "A remark plugin implementing the Markdown Autophagic Template (MDAT) system.",
5
5
  "keywords": [
6
6
  "mdat",
@@ -46,43 +46,42 @@
46
46
  "gray-matter-es": "^0.2.1",
47
47
  "hast-util-from-html": "^2.0.3",
48
48
  "json5": "^2.2.3",
49
- "lognow": "^0.8.0",
49
+ "lognow": "^0.8.4",
50
50
  "picocolors": "^1.1.1",
51
51
  "remark": "^15.0.1",
52
52
  "remark-gfm": "^4.0.1",
53
- "type-fest": "^5.8.0",
53
+ "type-fest": "^5.10.0",
54
54
  "unified": "^11.0.5",
55
55
  "unist-util-visit": "^5.1.0",
56
56
  "vfile": "^6.0.3",
57
57
  "vfile-message": "^4.0.3",
58
- "zod": "^4.4.3"
58
+ "zod": "^4.6.5"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@arethetypeswrong/core": "^0.18.5",
62
- "@kitschpatrol/shared-config": "^8.6.0",
63
- "@types/node": "~24.13.3",
64
- "@vitest/coverage-v8": "^4.1.10",
65
- "bumpp": "^12.1.1",
66
- "publint": "^0.3.22",
62
+ "@kitschpatrol/shared-config": "^8.10.0",
63
+ "@types/node": "~24.13.4",
64
+ "@vitest/coverage-v8": "^5.0.1",
65
+ "bumpp": "^12.3.0",
66
+ "publint": "^0.3.24",
67
67
  "shx": "^0.4.0",
68
- "tsdown": "^0.22.14",
68
+ "tsdown": "^0.23.0",
69
69
  "typescript": "~6.0.3",
70
- "vitest": "^4.1.10"
70
+ "vitest": "^5.0.1"
71
71
  },
72
72
  "engines": {
73
73
  "node": ">=24.16.0"
74
74
  },
75
75
  "scripts": {
76
- "bench": "vitest bench --run --no-file-parallelism --compare test/benchmarks/baseline.json",
77
- "bench:baseline": "vitest bench --run --no-file-parallelism --outputJson test/benchmarks/baseline.json",
76
+ "bench": "vitest bench --run",
77
+ "bench:baseline": "vitest bench --run --reporter=default --reporter=json --outputFile=test/benchmarks/baseline.json",
78
78
  "build": "tsdown",
79
- "clean": "shx rm -f pnpm-lock.yaml && git clean -fdX -e !.claude/",
79
+ "clean-deep": "shx rm -f pnpm-lock.yaml && git clean -fdX -e !.claude/",
80
80
  "coverage": "vitest --coverage --run",
81
81
  "dev": "pnpm test",
82
82
  "fix": "ksc fix",
83
83
  "lint": "ksc lint",
84
- "release": "bumpp --commit 'Release: %s' && pnpm build && NPM_AUTH_TOKEN=$(op read 'op://Personal/npm/token') pnpm publish",
85
- "release-preview": "bumpp --preid preview --commit 'Release: %s' && pnpm build && NPM_AUTH_TOKEN=$(op read 'op://Personal/npm/token') pnpm publish --tag preview",
84
+ "release": "bumpp --commit 'Release: %s' && pnpm build && pnpm publish --otp $(op item get npm --otp)",
86
85
  "test": "vitest run"
87
86
  }
88
87
  }
package/readme.md CHANGED
@@ -4,11 +4,19 @@
4
4
 
5
5
  <!-- /title -->
6
6
 
7
- <!-- badges -->
7
+ <!-- badges({
8
+ custom: {
9
+ "Bundle Size": {
10
+ image: "https://img.shields.io/bundlephobia/minzip/remark-mdat?label=Size",
11
+ link: "https://bundlephobia.com/package/remark-mdat",
12
+ },
13
+ }
14
+ }) -->
8
15
 
9
16
  [![NPM Package remark-mdat](https://img.shields.io/npm/v/remark-mdat.svg)](https://www.npmjs.com/package/remark-mdat)
10
17
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/license/mit)
11
18
  [![CI](https://github.com/kitschpatrol/remark-mdat/actions/workflows/ci.yml/badge.svg)](https://github.com/kitschpatrol/remark-mdat/actions/workflows/ci.yml)
19
+ [![Bundle Size](https://img.shields.io/bundlephobia/minzip/remark-mdat?label=Size)](https://bundlephobia.com/package/remark-mdat)
12
20
 
13
21
  <!-- /badges -->
14
22