mason-context 0.19.0 → 0.19.1
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/CHANGELOG.md +7 -0
- package/dist/mason-audit.js +432 -253
- package/dist/mason-audit.js.map +1 -1
- package/dist/mason-auto.js +430 -253
- package/dist/mason-auto.js.map +1 -1
- package/dist/mason-drift.js +50 -0
- package/dist/mason-drift.js.map +1 -1
- package/dist/mason-hook.js.map +1 -1
- package/dist/mason-mcp.js +1123 -941
- package/dist/mason-mcp.js.map +1 -1
- package/dist/mason-review.js +50 -0
- package/dist/mason-review.js.map +1 -1
- package/dist/mason-runtime.js.map +1 -1
- package/dist/mason.js +507 -296
- package/dist/mason.js.map +1 -1
- package/package.json +1 -1
package/dist/mason-drift.js
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
if (!import.meta.url.endsWith("/mason-runtime.js")) await import("./mason-runtime.js").then(m => m.registerRuntime());
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __esm = (fn, res) => function __init() {
|
|
6
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
7
|
+
};
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// src/audit/types.ts
|
|
14
|
+
var types_exports = {};
|
|
15
|
+
__export(types_exports, {
|
|
16
|
+
ALL_CHECKS: () => ALL_CHECKS
|
|
17
|
+
});
|
|
18
|
+
var ALL_CHECKS;
|
|
19
|
+
var init_types = __esm({
|
|
20
|
+
"src/audit/types.ts"() {
|
|
21
|
+
"use strict";
|
|
22
|
+
ALL_CHECKS = [
|
|
23
|
+
"deleted-reference",
|
|
24
|
+
"new-module",
|
|
25
|
+
"stale-count",
|
|
26
|
+
"dead-command",
|
|
27
|
+
"deps-changed",
|
|
28
|
+
"decision-anchor-drift"
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
3
32
|
|
|
4
33
|
// src/drift/cli.ts
|
|
5
34
|
import path10 from "path";
|
|
@@ -142,6 +171,27 @@ async function loadProjectConfig(root) {
|
|
|
142
171
|
}
|
|
143
172
|
config[key] = value[key];
|
|
144
173
|
}
|
|
174
|
+
if (value.audit !== void 0) {
|
|
175
|
+
const audit = value.audit;
|
|
176
|
+
if (!audit || typeof audit !== "object" || Array.isArray(audit)) throw new Error("Configuration audit must be an object");
|
|
177
|
+
const patterns = (raw2) => {
|
|
178
|
+
if (!Array.isArray(raw2) || raw2.length > 100 || !raw2.every((s) => typeof s === "string" && normalizeRepoPath(s) === s && !s.startsWith("!") && !/[\x00-\x1f]/.test(s))) {
|
|
179
|
+
throw new Error("Audit patterns must be at most 100 repository-relative globs without traversal or negation");
|
|
180
|
+
}
|
|
181
|
+
return raw2;
|
|
182
|
+
};
|
|
183
|
+
config.audit = {};
|
|
184
|
+
if (audit.include !== void 0) config.audit.include = patterns(audit.include);
|
|
185
|
+
if (audit.exclude !== void 0) {
|
|
186
|
+
if (!audit.exclude || typeof audit.exclude !== "object" || Array.isArray(audit.exclude)) throw new Error("audit.exclude must map check names to patterns");
|
|
187
|
+
const { ALL_CHECKS: ALL_CHECKS2 } = await Promise.resolve().then(() => (init_types(), types_exports));
|
|
188
|
+
config.audit.exclude = {};
|
|
189
|
+
for (const [check, globs] of Object.entries(audit.exclude)) {
|
|
190
|
+
if (!ALL_CHECKS2.includes(check)) throw new Error("Unknown audit check: " + check);
|
|
191
|
+
config.audit.exclude[check] = patterns(globs);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
145
195
|
return config;
|
|
146
196
|
} catch (error) {
|
|
147
197
|
if (error.code === "ENOENT") return {};
|