mason-context 0.18.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 +16 -0
- package/README.md +2 -0
- package/dist/mason-audit.js +449 -251
- package/dist/mason-audit.js.map +1 -1
- package/dist/mason-auto.js +522 -270
- package/dist/mason-auto.js.map +1 -1
- package/dist/mason-drift.js +51 -0
- package/dist/mason-drift.js.map +1 -1
- package/dist/mason-hook.js +1 -0
- package/dist/mason-hook.js.map +1 -1
- package/dist/mason-mcp.js +1486 -664
- package/dist/mason-mcp.js.map +1 -1
- package/dist/mason-review.js +51 -0
- package/dist/mason-review.js.map +1 -1
- package/dist/mason-runtime.js +337 -0
- package/dist/mason-runtime.js.map +1 -0
- package/dist/mason.js +1377 -485
- package/dist/mason.js.map +1 -1
- package/package.json +2 -1
package/dist/mason-drift.js
CHANGED
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
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
|
+
});
|
|
2
32
|
|
|
3
33
|
// src/drift/cli.ts
|
|
4
34
|
import path10 from "path";
|
|
@@ -141,6 +171,27 @@ async function loadProjectConfig(root) {
|
|
|
141
171
|
}
|
|
142
172
|
config[key] = value[key];
|
|
143
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
|
+
}
|
|
144
195
|
return config;
|
|
145
196
|
} catch (error) {
|
|
146
197
|
if (error.code === "ENOENT") return {};
|