@hublo/sentinel 1.2.0-alpha.37 → 1.2.0-alpha.39
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
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
WORKSPACE_ROOT_MARKER,
|
|
10
10
|
availableTargets,
|
|
11
11
|
buildConfigFile,
|
|
12
|
+
contradictingPreset,
|
|
12
13
|
declaredPresetFor,
|
|
13
14
|
describeFramework,
|
|
14
15
|
dispatch,
|
|
@@ -22,7 +23,7 @@ import {
|
|
|
22
23
|
registerAdapters,
|
|
23
24
|
resolve,
|
|
24
25
|
resolveBin
|
|
25
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-PBCVWRXM.js";
|
|
26
27
|
|
|
27
28
|
// bin/sentinel.ts
|
|
28
29
|
import { program } from "commander";
|
|
@@ -238,7 +239,9 @@ async function analyse(params) {
|
|
|
238
239
|
}
|
|
239
240
|
for (const target of params.targets) {
|
|
240
241
|
let adapter;
|
|
241
|
-
const
|
|
242
|
+
const declared = declaredPresetFor(target, module.root);
|
|
243
|
+
const corrected = params.preset ?? declared ?? contradictingPreset(module.root, preset2)?.preset ?? preset2;
|
|
244
|
+
const resolutionPreset = corrected;
|
|
242
245
|
try {
|
|
243
246
|
adapter = resolve(target, resolutionPreset, params.runner);
|
|
244
247
|
} catch (error) {
|
|
@@ -7806,6 +7806,11 @@ function presetContradiction(declared, cwd) {
|
|
|
7806
7806
|
const evidence = signals.map((signal) => signal.evidence).join(", and ");
|
|
7807
7807
|
return `--preset ${declared} does not match this module: ${evidence}, which makes it "${first.preset}". Nothing was written. Re-run with --preset ${first.preset}, or adopt from the module you actually meant.`;
|
|
7808
7808
|
}
|
|
7809
|
+
function contradictingPreset(cwd, detected) {
|
|
7810
|
+
const [signal] = presetSignals(cwd);
|
|
7811
|
+
if (signal === void 0 || signal.preset === detected) return void 0;
|
|
7812
|
+
return { preset: signal.preset, evidence: signal.evidence };
|
|
7813
|
+
}
|
|
7809
7814
|
|
|
7810
7815
|
// src/core/dispatch.ts
|
|
7811
7816
|
function resolveFlavour(opts) {
|
|
@@ -7883,11 +7888,11 @@ async function dispatch(opts) {
|
|
|
7883
7888
|
}
|
|
7884
7889
|
let effective = preset;
|
|
7885
7890
|
if (opts.preset === void 0 && adapter.declaredPreset?.(opts.cwd) === void 0) {
|
|
7886
|
-
const
|
|
7887
|
-
if (
|
|
7888
|
-
effective =
|
|
7891
|
+
const contradiction = contradictingPreset(opts.cwd, preset);
|
|
7892
|
+
if (contradiction !== void 0) {
|
|
7893
|
+
effective = contradiction.preset;
|
|
7889
7894
|
process.stderr.write(
|
|
7890
|
-
` detected "${preset}" from dependencies, but ${
|
|
7895
|
+
` detected "${preset}" from dependencies, but ${contradiction.evidence}, so adopting as "${contradiction.preset}". Pass --preset to override.
|
|
7891
7896
|
`
|
|
7892
7897
|
);
|
|
7893
7898
|
}
|
|
@@ -7952,8 +7957,9 @@ export {
|
|
|
7952
7957
|
PRESET_NAMES,
|
|
7953
7958
|
palette,
|
|
7954
7959
|
registerAdapters,
|
|
7960
|
+
contradictingPreset,
|
|
7955
7961
|
describeFramework,
|
|
7956
7962
|
detectFramework,
|
|
7957
7963
|
dispatch
|
|
7958
7964
|
};
|
|
7959
|
-
//# sourceMappingURL=chunk-
|
|
7965
|
+
//# sourceMappingURL=chunk-PBCVWRXM.js.map
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,15 @@ import { loadEnv } from "vite";
|
|
|
9
9
|
|
|
10
10
|
// src/roles/test/nest/nest-test-config.ts
|
|
11
11
|
import { existsSync } from "fs";
|
|
12
|
+
import { createRequire } from "module";
|
|
12
13
|
import { dirname, join } from "path";
|
|
14
|
+
function vitestMockExtendedPath() {
|
|
15
|
+
try {
|
|
16
|
+
return createRequire(import.meta.url).resolve("vitest-mock-extended");
|
|
17
|
+
} catch {
|
|
18
|
+
return "vitest-mock-extended";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
13
21
|
function axiosAlias(root) {
|
|
14
22
|
const manifest = join(root, "node_modules", "axios", "package.json");
|
|
15
23
|
return existsSync(manifest) ? [{ find: /^axios$/, replacement: dirname(manifest) }] : [];
|
|
@@ -41,7 +49,7 @@ function baseConfig(options) {
|
|
|
41
49
|
*
|
|
42
50
|
* Measured on `mission`: failing suites went from 159 to 10.
|
|
43
51
|
*/
|
|
44
|
-
{ find: /^jest-mock-extended$/, replacement:
|
|
52
|
+
{ find: /^jest-mock-extended$/, replacement: vitestMockExtendedPath() },
|
|
45
53
|
...tsconfigAliases(workspaceRoot)
|
|
46
54
|
]
|
|
47
55
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hublo/sentinel",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.39",
|
|
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",
|