@hublo/sentinel 1.4.0-alpha.52 → 1.4.0-alpha.53
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/bin/sentinel.js
CHANGED
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
palette,
|
|
16
16
|
registerAdapters,
|
|
17
17
|
resolve
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-N5HLS3BX.js";
|
|
19
19
|
import {
|
|
20
20
|
resolveContext
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-GAM4KIPA.js";
|
|
22
22
|
import "../chunk-O7REVMOC.js";
|
|
23
23
|
import "../chunk-QXFCZON7.js";
|
|
24
24
|
import {
|
|
@@ -145,7 +145,7 @@ async function runValidate(ctx) {
|
|
|
145
145
|
);
|
|
146
146
|
}
|
|
147
147
|
if (!ctx.targets.includes("test")) return 1;
|
|
148
|
-
const { validateModuleTests } = await import("../validate-
|
|
148
|
+
const { validateModuleTests } = await import("../validate-KQCFKTXU.js");
|
|
149
149
|
const outcomes = modules.flatMap(
|
|
150
150
|
(module) => validateModuleTests(module.name, module.root)
|
|
151
151
|
);
|
|
@@ -990,7 +990,7 @@ function applyEdits(source, edits) {
|
|
|
990
990
|
}
|
|
991
991
|
|
|
992
992
|
// src/roles/test/codemod/inherited-automocks.ts
|
|
993
|
-
function
|
|
993
|
+
function bareModuleCalls(program, method) {
|
|
994
994
|
const found = [];
|
|
995
995
|
walk(program, (node) => {
|
|
996
996
|
if (node.type !== "CallExpression") return;
|
|
@@ -999,7 +999,7 @@ function bareModuleMocks(program) {
|
|
|
999
999
|
const object = callee.object;
|
|
1000
1000
|
const property = callee.property;
|
|
1001
1001
|
if (object?.type !== "Identifier" || object.name !== "jest" && object.name !== "vi") return;
|
|
1002
|
-
if (property?.type !== "Identifier" || property.name !==
|
|
1002
|
+
if (property?.type !== "Identifier" || property.name !== method) return;
|
|
1003
1003
|
const args = node.arguments ?? [];
|
|
1004
1004
|
if (args.length !== 1) return;
|
|
1005
1005
|
const [specifier] = args;
|
|
@@ -1023,7 +1023,7 @@ function inheritedAutomocks(cwd, setupFiles, parse5) {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
const program = parse5(path, source);
|
|
1025
1025
|
if (program === void 0) continue;
|
|
1026
|
-
for (const specifier of
|
|
1026
|
+
for (const specifier of bareModuleCalls(program, "mock")) found.add(specifier);
|
|
1027
1027
|
}
|
|
1028
1028
|
return [...found].sort();
|
|
1029
1029
|
}
|
|
@@ -1036,9 +1036,10 @@ function importsSpecifier(program, specifier) {
|
|
|
1036
1036
|
return false;
|
|
1037
1037
|
}
|
|
1038
1038
|
function declareInheritedAutomocks(source, program, specifiers) {
|
|
1039
|
-
const alreadyMocked = new Set(
|
|
1039
|
+
const alreadyMocked = new Set(bareModuleCalls(program, "mock"));
|
|
1040
|
+
const refused = new Set(bareModuleCalls(program, "unmock"));
|
|
1040
1041
|
const missing = specifiers.filter(
|
|
1041
|
-
(specifier) => !alreadyMocked.has(specifier) && importsSpecifier(program, specifier)
|
|
1042
|
+
(specifier) => !alreadyMocked.has(specifier) && !refused.has(specifier) && importsSpecifier(program, specifier)
|
|
1042
1043
|
);
|
|
1043
1044
|
if (missing.length === 0) return source;
|
|
1044
1045
|
const imports = (program.body ?? []).filter(
|
package/dist/index.js
CHANGED
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
registerAdapters,
|
|
7
7
|
resolve,
|
|
8
8
|
setDefaultRunner
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-N5HLS3BX.js";
|
|
10
10
|
import {
|
|
11
11
|
BaseAdapter
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GAM4KIPA.js";
|
|
13
13
|
import "./chunk-O7REVMOC.js";
|
|
14
14
|
import "./chunk-QXFCZON7.js";
|
|
15
15
|
import "./chunk-KMKQDGI6.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hublo/sentinel",
|
|
3
|
-
"version": "1.4.0-alpha.
|
|
3
|
+
"version": "1.4.0-alpha.53",
|
|
4
4
|
"description": "One CLI that guards code health across Hublo repos: shared lint/typescript/build/test presets, static & dynamic analysis, and architecture checks.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|