@mrsf/cli 0.4.2 → 0.5.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.
- package/README.md +29 -0
- package/dist/browser.cjs +887 -0
- package/dist/browser.cjs.map +7 -0
- package/dist/browser.d.ts +11 -1
- package/dist/browser.js +9 -0
- package/dist/index.cjs +2137 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.js +10 -0
- package/dist/lib/comments.js +2 -2
- package/dist/lib/identity.d.ts +12 -0
- package/dist/lib/identity.js +23 -0
- package/dist/lib/reanchor-core.d.ts +4 -1
- package/dist/lib/reanchor-core.js +62 -0
- package/dist/lib/reanchor.d.ts +1 -1
- package/dist/lib/reanchor.js +1 -1
- package/dist/lib/schema.d.ts +106 -0
- package/dist/lib/schema.js +3 -0
- package/dist/lib/types.d.ts +18 -0
- package/dist/lib/validate-core.d.ts +6 -0
- package/dist/lib/validate-core.js +128 -0
- package/dist/lib/validator.js +4 -112
- package/package.json +14 -6
package/dist/lib/reanchor.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Step 4 – orphan
|
|
13
13
|
*/
|
|
14
14
|
import type { MrsfDocument, ReanchorOptions, ReanchorResult } from "./types.js";
|
|
15
|
-
export { applyReanchorResults, DEFAULT_THRESHOLD, HIGH_THRESHOLD, reanchorComment, reanchorDocumentLines, reanchorDocumentText, toReanchorLines, } from "./reanchor-core.js";
|
|
15
|
+
export { applyReanchorResults, DEFAULT_THRESHOLD, HIGH_THRESHOLD, reanchorComment, reanchorDocumentLines, reanchorDocumentText, resolveAnchor, toReanchorLines, } from "./reanchor-core.js";
|
|
16
16
|
/**
|
|
17
17
|
* Re-anchor all comments in an MRSF document.
|
|
18
18
|
*/
|
package/dist/lib/reanchor.js
CHANGED
|
@@ -18,7 +18,7 @@ import { sidecarToDocument } from "./discovery.js";
|
|
|
18
18
|
import { parseSidecar } from "./parser.js";
|
|
19
19
|
import { writeSidecar } from "./writer.js";
|
|
20
20
|
import path from "node:path";
|
|
21
|
-
export { applyReanchorResults, DEFAULT_THRESHOLD, HIGH_THRESHOLD, reanchorComment, reanchorDocumentLines, reanchorDocumentText, toReanchorLines, } from "./reanchor-core.js";
|
|
21
|
+
export { applyReanchorResults, DEFAULT_THRESHOLD, HIGH_THRESHOLD, reanchorComment, reanchorDocumentLines, reanchorDocumentText, resolveAnchor, toReanchorLines, } from "./reanchor-core.js";
|
|
22
22
|
// ---------------------------------------------------------------------------
|
|
23
23
|
// Constants
|
|
24
24
|
// ---------------------------------------------------------------------------
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export declare const mrsfSchema: {
|
|
2
|
+
$schema: string;
|
|
3
|
+
$id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
type: string;
|
|
7
|
+
required: string[];
|
|
8
|
+
additionalProperties: boolean;
|
|
9
|
+
properties: {
|
|
10
|
+
mrsf_version: {
|
|
11
|
+
type: string;
|
|
12
|
+
pattern: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
document: {
|
|
16
|
+
type: string;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
comments: {
|
|
20
|
+
type: string;
|
|
21
|
+
items: {
|
|
22
|
+
type: string;
|
|
23
|
+
required: string[];
|
|
24
|
+
additionalProperties: boolean;
|
|
25
|
+
properties: {
|
|
26
|
+
id: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
author: {
|
|
31
|
+
type: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
timestamp: {
|
|
35
|
+
type: string;
|
|
36
|
+
format: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
text: {
|
|
40
|
+
type: string;
|
|
41
|
+
maxLength: number;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
resolved: {
|
|
45
|
+
type: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
commit: {
|
|
49
|
+
type: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
type: {
|
|
53
|
+
type: string;
|
|
54
|
+
description: string;
|
|
55
|
+
examples: string[];
|
|
56
|
+
};
|
|
57
|
+
severity: {
|
|
58
|
+
type: string;
|
|
59
|
+
description: string;
|
|
60
|
+
enum: string[];
|
|
61
|
+
};
|
|
62
|
+
reply_to: {
|
|
63
|
+
type: string;
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
66
|
+
line: {
|
|
67
|
+
type: string;
|
|
68
|
+
minimum: number;
|
|
69
|
+
description: string;
|
|
70
|
+
};
|
|
71
|
+
end_line: {
|
|
72
|
+
type: string;
|
|
73
|
+
minimum: number;
|
|
74
|
+
description: string;
|
|
75
|
+
};
|
|
76
|
+
start_column: {
|
|
77
|
+
type: string;
|
|
78
|
+
minimum: number;
|
|
79
|
+
description: string;
|
|
80
|
+
};
|
|
81
|
+
end_column: {
|
|
82
|
+
type: string;
|
|
83
|
+
minimum: number;
|
|
84
|
+
description: string;
|
|
85
|
+
};
|
|
86
|
+
selected_text: {
|
|
87
|
+
type: string;
|
|
88
|
+
maxLength: number;
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
anchored_text: {
|
|
92
|
+
type: string;
|
|
93
|
+
maxLength: number;
|
|
94
|
+
description: string;
|
|
95
|
+
};
|
|
96
|
+
selected_text_hash: {
|
|
97
|
+
type: string;
|
|
98
|
+
pattern: string;
|
|
99
|
+
description: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=schema.d.ts.map
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export interface MrsfConfig {
|
|
|
40
40
|
export type DiagnosticSeverity = "error" | "warning";
|
|
41
41
|
export interface ValidationDiagnostic {
|
|
42
42
|
severity: DiagnosticSeverity;
|
|
43
|
+
code: string;
|
|
43
44
|
message: string;
|
|
44
45
|
/** Path within the document, e.g. "/comments/0/end_line". */
|
|
45
46
|
path?: string;
|
|
@@ -69,6 +70,23 @@ export interface ReanchorResult {
|
|
|
69
70
|
/** Human-readable explanation of the resolution. */
|
|
70
71
|
reason: string;
|
|
71
72
|
}
|
|
73
|
+
export interface AnchorPosition {
|
|
74
|
+
status: ReanchorStatus;
|
|
75
|
+
score: number;
|
|
76
|
+
/** Absolute 0-based character offset in normalized document text (start). */
|
|
77
|
+
from?: number;
|
|
78
|
+
/** Absolute 0-based character offset in normalized document text (end, exclusive). */
|
|
79
|
+
to?: number;
|
|
80
|
+
/** 1-based start line. */
|
|
81
|
+
line?: number;
|
|
82
|
+
/** 1-based end line. */
|
|
83
|
+
endLine?: number;
|
|
84
|
+
/** 0-based start column. */
|
|
85
|
+
startColumn?: number;
|
|
86
|
+
/** 0-based end column. */
|
|
87
|
+
endColumn?: number;
|
|
88
|
+
reason: string;
|
|
89
|
+
}
|
|
72
90
|
export interface FuzzyCandidate {
|
|
73
91
|
/** Matched text in the document. */
|
|
74
92
|
text: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { MrsfDocument, ValidationDiagnostic, ValidationResult } from "./types.js";
|
|
2
|
+
export type HashFunction = (text: string) => string;
|
|
3
|
+
export declare function validateDocument(doc: MrsfDocument, schema?: object): ValidationResult;
|
|
4
|
+
export declare function validateSchema(doc: MrsfDocument, rawSchema: object, errors: ValidationDiagnostic[]): void;
|
|
5
|
+
export declare function validateCrossFields(doc: MrsfDocument, errors: ValidationDiagnostic[], warnings: ValidationDiagnostic[], hash?: HashFunction): void;
|
|
6
|
+
//# sourceMappingURL=validate-core.d.ts.map
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import AjvModule from "ajv";
|
|
2
|
+
import addFormatsModule from "ajv-formats";
|
|
3
|
+
import { mrsfSchema } from "./schema.js";
|
|
4
|
+
const Ajv = AjvModule.default ?? AjvModule;
|
|
5
|
+
const addFormats = addFormatsModule.default ?? addFormatsModule;
|
|
6
|
+
export function validateDocument(doc, schema = mrsfSchema) {
|
|
7
|
+
const errors = [];
|
|
8
|
+
const warnings = [];
|
|
9
|
+
validateSchema(doc, schema, errors);
|
|
10
|
+
validateCrossFields(doc, errors, warnings);
|
|
11
|
+
return {
|
|
12
|
+
valid: errors.length === 0,
|
|
13
|
+
errors,
|
|
14
|
+
warnings,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function validateSchema(doc, rawSchema, errors) {
|
|
18
|
+
const { $schema, ...schema } = rawSchema;
|
|
19
|
+
void $schema;
|
|
20
|
+
const ajv = new Ajv({ allErrors: true, strict: false });
|
|
21
|
+
addFormats(ajv);
|
|
22
|
+
const ajvValidate = ajv.compile(schema);
|
|
23
|
+
const schemaValid = ajvValidate(doc);
|
|
24
|
+
if (!schemaValid && ajvValidate.errors) {
|
|
25
|
+
for (const err of ajvValidate.errors) {
|
|
26
|
+
errors.push({
|
|
27
|
+
severity: "error",
|
|
28
|
+
code: "schema-violation",
|
|
29
|
+
message: `${err.instancePath || "/"}: ${err.message ?? "schema error"}`,
|
|
30
|
+
path: err.instancePath || "/",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export function validateCrossFields(doc, errors, warnings, hash) {
|
|
36
|
+
if (!Array.isArray(doc.comments))
|
|
37
|
+
return;
|
|
38
|
+
const ids = new Set();
|
|
39
|
+
const allIds = doc.comments.map((x) => x.id);
|
|
40
|
+
for (let i = 0; i < doc.comments.length; i++) {
|
|
41
|
+
const c = doc.comments[i];
|
|
42
|
+
const prefix = `/comments/${i}`;
|
|
43
|
+
if (c.id) {
|
|
44
|
+
if (ids.has(c.id)) {
|
|
45
|
+
errors.push({
|
|
46
|
+
severity: "error",
|
|
47
|
+
code: "duplicate-id",
|
|
48
|
+
message: `Duplicate comment id "${c.id}"`,
|
|
49
|
+
path: `${prefix}/id`,
|
|
50
|
+
commentId: c.id,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
ids.add(c.id);
|
|
54
|
+
}
|
|
55
|
+
if (c.line != null && c.end_line != null && c.end_line < c.line) {
|
|
56
|
+
errors.push({
|
|
57
|
+
severity: "error",
|
|
58
|
+
code: "end-line-before-line",
|
|
59
|
+
message: `end_line (${c.end_line}) must be ≥ line (${c.line})`,
|
|
60
|
+
path: `${prefix}/end_line`,
|
|
61
|
+
commentId: c.id,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if (c.start_column != null &&
|
|
65
|
+
c.end_column != null &&
|
|
66
|
+
(c.line == null || c.end_line == null || c.line === c.end_line) &&
|
|
67
|
+
c.end_column < c.start_column) {
|
|
68
|
+
errors.push({
|
|
69
|
+
severity: "error",
|
|
70
|
+
code: "end-column-before-start-column",
|
|
71
|
+
message: `end_column (${c.end_column}) must be ≥ start_column (${c.start_column}) on the same line`,
|
|
72
|
+
path: `${prefix}/end_column`,
|
|
73
|
+
commentId: c.id,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (c.selected_text && c.selected_text.length > 4096) {
|
|
77
|
+
errors.push({
|
|
78
|
+
severity: "error",
|
|
79
|
+
code: "selected-text-too-long",
|
|
80
|
+
message: `selected_text exceeds 4096 characters (${c.selected_text.length})`,
|
|
81
|
+
path: `${prefix}/selected_text`,
|
|
82
|
+
commentId: c.id,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (c.text && c.text.length > 16384) {
|
|
86
|
+
warnings.push({
|
|
87
|
+
severity: "warning",
|
|
88
|
+
code: "text-too-long",
|
|
89
|
+
message: `text exceeds recommended 16384 characters (${c.text.length})`,
|
|
90
|
+
path: `${prefix}/text`,
|
|
91
|
+
commentId: c.id,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
// Browser-safe callers do not get the Node SHA-256 implementation.
|
|
95
|
+
// The hash check runs only when a hash function is injected by the Node validator.
|
|
96
|
+
if (hash && c.selected_text && c.selected_text_hash) {
|
|
97
|
+
const expected = hash(c.selected_text);
|
|
98
|
+
if (c.selected_text_hash !== expected) {
|
|
99
|
+
warnings.push({
|
|
100
|
+
severity: "warning",
|
|
101
|
+
code: "hash-mismatch",
|
|
102
|
+
message: `selected_text_hash mismatch (expected ${expected.slice(0, 12)}…, got ${c.selected_text_hash.slice(0, 12)}…)`,
|
|
103
|
+
path: `${prefix}/selected_text_hash`,
|
|
104
|
+
commentId: c.id,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (c.reply_to && !ids.has(c.reply_to) && !allIds.includes(c.reply_to)) {
|
|
109
|
+
warnings.push({
|
|
110
|
+
severity: "warning",
|
|
111
|
+
code: "unresolved-reply-to",
|
|
112
|
+
message: `reply_to "${c.reply_to}" does not resolve to any comment id in this file`,
|
|
113
|
+
path: `${prefix}/reply_to`,
|
|
114
|
+
commentId: c.id,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (c.line != null && !c.selected_text) {
|
|
118
|
+
warnings.push({
|
|
119
|
+
severity: "warning",
|
|
120
|
+
code: "missing-selected-text",
|
|
121
|
+
message: "Comment has line anchors but no selected_text — anchoring will be fragile across edits",
|
|
122
|
+
path: `${prefix}/selected_text`,
|
|
123
|
+
commentId: c.id,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=validate-core.js.map
|
package/dist/lib/validator.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MRSF Validator — JSON Schema + cross-field validation per §10.
|
|
3
3
|
*/
|
|
4
|
-
import AjvModule from "ajv";
|
|
5
|
-
import addFormatsModule from "ajv-formats";
|
|
6
|
-
// ESM interop: handle both default and namespace imports
|
|
7
|
-
const Ajv = AjvModule.default ?? AjvModule;
|
|
8
|
-
const addFormats = addFormatsModule.default ?? addFormatsModule;
|
|
9
4
|
import { readFile } from "node:fs/promises";
|
|
10
5
|
import path from "node:path";
|
|
11
6
|
import { fileURLToPath } from "node:url";
|
|
12
7
|
import { computeHash } from "./writer.js";
|
|
8
|
+
import { validateCrossFields, validateSchema } from "./validate-core.js";
|
|
13
9
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
10
|
let _schemaCache = null;
|
|
15
11
|
async function loadSchema() {
|
|
@@ -44,114 +40,9 @@ export async function validate(doc, options = {}) {
|
|
|
44
40
|
const warnings = [];
|
|
45
41
|
// ── JSON Schema validation ──
|
|
46
42
|
const rawSchema = await loadSchema();
|
|
47
|
-
|
|
48
|
-
const { $schema, ...schema } = rawSchema;
|
|
49
|
-
const ajv = new Ajv({ allErrors: true, strict: false });
|
|
50
|
-
addFormats(ajv);
|
|
51
|
-
const ajvValidate = ajv.compile(schema);
|
|
52
|
-
const schemaValid = ajvValidate(doc);
|
|
53
|
-
if (!schemaValid && ajvValidate.errors) {
|
|
54
|
-
for (const err of ajvValidate.errors) {
|
|
55
|
-
errors.push({
|
|
56
|
-
severity: "error",
|
|
57
|
-
message: `${err.instancePath || "/"}: ${err.message ?? "schema error"}`,
|
|
58
|
-
path: err.instancePath || "/",
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}
|
|
43
|
+
validateSchema(doc, rawSchema, errors);
|
|
62
44
|
// ── Cross-field validation (§10) ──
|
|
63
|
-
|
|
64
|
-
const ids = new Set();
|
|
65
|
-
for (let i = 0; i < doc.comments.length; i++) {
|
|
66
|
-
const c = doc.comments[i];
|
|
67
|
-
const prefix = `/comments/${i}`;
|
|
68
|
-
// Unique id check
|
|
69
|
-
if (c.id) {
|
|
70
|
-
if (ids.has(c.id)) {
|
|
71
|
-
errors.push({
|
|
72
|
-
severity: "error",
|
|
73
|
-
message: `Duplicate comment id "${c.id}"`,
|
|
74
|
-
path: `${prefix}/id`,
|
|
75
|
-
commentId: c.id,
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
ids.add(c.id);
|
|
79
|
-
}
|
|
80
|
-
// end_line ≥ line
|
|
81
|
-
if (c.line != null && c.end_line != null && c.end_line < c.line) {
|
|
82
|
-
errors.push({
|
|
83
|
-
severity: "error",
|
|
84
|
-
message: `end_line (${c.end_line}) must be ≥ line (${c.line})`,
|
|
85
|
-
path: `${prefix}/end_line`,
|
|
86
|
-
commentId: c.id,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
// end_column ≥ start_column when same line
|
|
90
|
-
if (c.start_column != null &&
|
|
91
|
-
c.end_column != null &&
|
|
92
|
-
(c.line == null || c.end_line == null || c.line === c.end_line) &&
|
|
93
|
-
c.end_column < c.start_column) {
|
|
94
|
-
errors.push({
|
|
95
|
-
severity: "error",
|
|
96
|
-
message: `end_column (${c.end_column}) must be ≥ start_column (${c.start_column}) on the same line`,
|
|
97
|
-
path: `${prefix}/end_column`,
|
|
98
|
-
commentId: c.id,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
// selected_text length
|
|
102
|
-
if (c.selected_text && c.selected_text.length > 4096) {
|
|
103
|
-
errors.push({
|
|
104
|
-
severity: "error",
|
|
105
|
-
message: `selected_text exceeds 4096 characters (${c.selected_text.length})`,
|
|
106
|
-
path: `${prefix}/selected_text`,
|
|
107
|
-
commentId: c.id,
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
// text length
|
|
111
|
-
if (c.text && c.text.length > 16384) {
|
|
112
|
-
warnings.push({
|
|
113
|
-
severity: "warning",
|
|
114
|
-
message: `text exceeds recommended 16384 characters (${c.text.length})`,
|
|
115
|
-
path: `${prefix}/text`,
|
|
116
|
-
commentId: c.id,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
// selected_text_hash consistency
|
|
120
|
-
if (c.selected_text && c.selected_text_hash) {
|
|
121
|
-
const expected = computeHash(c.selected_text);
|
|
122
|
-
if (c.selected_text_hash !== expected) {
|
|
123
|
-
warnings.push({
|
|
124
|
-
severity: "warning",
|
|
125
|
-
message: `selected_text_hash mismatch (expected ${expected.slice(0, 12)}…, got ${c.selected_text_hash.slice(0, 12)}…)`,
|
|
126
|
-
path: `${prefix}/selected_text_hash`,
|
|
127
|
-
commentId: c.id,
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
// reply_to resolution
|
|
132
|
-
if (c.reply_to && !ids.has(c.reply_to)) {
|
|
133
|
-
// Check forward references too
|
|
134
|
-
const allIds = doc.comments.map((x) => x.id);
|
|
135
|
-
if (!allIds.includes(c.reply_to)) {
|
|
136
|
-
warnings.push({
|
|
137
|
-
severity: "warning",
|
|
138
|
-
message: `reply_to "${c.reply_to}" does not resolve to any comment id in this file`,
|
|
139
|
-
path: `${prefix}/reply_to`,
|
|
140
|
-
commentId: c.id,
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
// Missing selected_text warning
|
|
145
|
-
if (c.line != null && !c.selected_text) {
|
|
146
|
-
warnings.push({
|
|
147
|
-
severity: "warning",
|
|
148
|
-
message: `Comment has line anchors but no selected_text — anchoring will be fragile across edits`,
|
|
149
|
-
path: `${prefix}/selected_text`,
|
|
150
|
-
commentId: c.id,
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
45
|
+
validateCrossFields(doc, errors, warnings, computeHash);
|
|
155
46
|
const valid = errors.length === 0 && (!options.strict || warnings.length === 0);
|
|
156
47
|
return { valid, errors, warnings };
|
|
157
48
|
}
|
|
@@ -170,6 +61,7 @@ export async function validateFile(filePath, options = {}) {
|
|
|
170
61
|
errors: [
|
|
171
62
|
{
|
|
172
63
|
severity: "error",
|
|
64
|
+
code: "parse-error",
|
|
173
65
|
message: `Failed to parse: ${e.message}`,
|
|
174
66
|
},
|
|
175
67
|
],
|
package/package.json
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrsf/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "CLI and library for the Markdown Review Sidecar Format (MRSF)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
10
11
|
"import": "./dist/index.js",
|
|
11
|
-
"
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
12
13
|
},
|
|
13
14
|
"./browser": {
|
|
15
|
+
"types": "./dist/browser.d.ts",
|
|
16
|
+
"browser": "./dist/browser.js",
|
|
14
17
|
"import": "./dist/browser.js",
|
|
15
|
-
"
|
|
18
|
+
"require": "./dist/browser.cjs"
|
|
16
19
|
}
|
|
17
20
|
},
|
|
18
21
|
"bin": {
|
|
@@ -22,7 +25,7 @@
|
|
|
22
25
|
"node": ">=18"
|
|
23
26
|
},
|
|
24
27
|
"scripts": {
|
|
25
|
-
"build": "tsc",
|
|
28
|
+
"build": "tsc && node esbuild.config.mjs",
|
|
26
29
|
"dev": "tsc --watch",
|
|
27
30
|
"test": "vitest run",
|
|
28
31
|
"test:watch": "vitest",
|
|
@@ -57,6 +60,8 @@
|
|
|
57
60
|
"files": [
|
|
58
61
|
"dist/**/*.js",
|
|
59
62
|
"dist/**/*.d.ts",
|
|
63
|
+
"dist/**/*.cjs",
|
|
64
|
+
"dist/**/*.cjs.map",
|
|
60
65
|
"mrsf.schema.json",
|
|
61
66
|
"README.md",
|
|
62
67
|
"LICENSE"
|
|
@@ -78,6 +83,9 @@
|
|
|
78
83
|
"@types/uuid": "^10.0.0",
|
|
79
84
|
"@vitest/coverage-v8": "^4.0.18",
|
|
80
85
|
"typescript": "^5.8.2",
|
|
81
|
-
"vitest": "^4.0.18"
|
|
82
|
-
|
|
86
|
+
"vitest": "^4.0.18",
|
|
87
|
+
"esbuild": "^0.27.3"
|
|
88
|
+
},
|
|
89
|
+
"module": "./dist/index.js",
|
|
90
|
+
"sideEffects": false
|
|
83
91
|
}
|