@hublo/sentinel 1.7.0-alpha.0 → 1.7.0-alpha.10
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 +2 -0
- package/dist/bin/sentinel.js +20 -16
- package/dist/{chunk-WMBXYYLD.js → chunk-AWDCC5VJ.js} +2972 -1148
- package/dist/{chunk-VVEKPCRY.js → chunk-EESVRILJ.js} +3 -13
- package/dist/chunk-EESVRILJ.js.map +1 -0
- package/dist/{chunk-ZNANJEMK.js → chunk-JT7ZMH44.js} +30 -16
- package/dist/chunk-JT7ZMH44.js.map +1 -0
- package/dist/chunk-LU4E4TVD.js +183 -0
- package/dist/chunk-LU4E4TVD.js.map +1 -0
- package/dist/{chunk-7E6YTTAK.js → chunk-LX7EG6PJ.js} +5 -6
- package/dist/chunk-LX7EG6PJ.js.map +1 -0
- package/dist/{chunk-4YQXLPJ5.js → chunk-PMRL4MH6.js} +2 -2
- package/dist/chunk-PXTU5MPW.js +9 -0
- package/dist/chunk-PXTU5MPW.js.map +1 -0
- package/dist/chunk-QXFCZON7.js +16 -0
- package/dist/chunk-QXFCZON7.js.map +1 -0
- package/dist/{chunk-POZDYETY.js → chunk-SWWQ7X7B.js} +12 -22
- package/dist/{chunk-POZDYETY.js.map → chunk-SWWQ7X7B.js.map} +1 -1
- package/dist/{chunk-EVGG55ZO.js → chunk-ZASD5YPF.js} +93 -88
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -5
- package/dist/roles/build/nest/toolchain.d.ts +1 -1
- package/dist/roles/build/nest/toolchain.js +3 -6
- package/dist/roles/build/nest/toolchain.js.map +1 -1
- package/dist/roles/sql/config.d.ts +68 -0
- package/dist/roles/sql/config.js +8 -0
- package/dist/roles/sql/config.js.map +1 -0
- package/dist/roles/static-analysis/config.js +2 -1
- package/dist/roles/test/nest/toolchain.d.ts +1 -1
- package/dist/roles/test/nest/toolchain.js +3 -3
- package/dist/roles/test/react/toolchain.js +3 -3
- package/dist/roles/test/setup/jest-parity.js +2 -2
- package/dist/roles/test/setup/workspace-entry.js +2 -2
- package/dist/roles/test/shared-test-config.d.ts +1 -1
- package/dist/roles/test/shared-test-config.js +3 -3
- package/dist/{tsconfig-aliases-C_PxuZni.d.ts → tsconfig-aliases-Ce6axdJ4.d.ts} +2 -17
- package/dist/{validate-VWP6YZP5.js → validate-QYP7HFSY.js} +3 -3
- package/docs/build-adoption.md +0 -7
- package/docs/sql-adoption.md +411 -0
- package/docs/test-adoption.md +1 -8
- package/docs/typescript-traces.md +216 -2
- package/docs/using-sentinel.md +2 -1
- package/package.json +6 -1
- package/dist/chunk-7E6YTTAK.js.map +0 -1
- package/dist/chunk-VVEKPCRY.js.map +0 -1
- package/dist/chunk-ZNANJEMK.js.map +0 -1
- package/dist/chunk-ZVHUG6CA.js +0 -88
- package/dist/chunk-ZVHUG6CA.js.map +0 -1
- /package/dist/{chunk-4YQXLPJ5.js.map → chunk-PMRL4MH6.js.map} +0 -0
|
@@ -6,16 +6,13 @@ import {
|
|
|
6
6
|
readNxProjectName,
|
|
7
7
|
readOwnPackage,
|
|
8
8
|
readProjectPackageJson
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JT7ZMH44.js";
|
|
10
10
|
import {
|
|
11
11
|
matchesTsconfigPattern
|
|
12
12
|
} from "./chunk-O7REVMOC.js";
|
|
13
13
|
import {
|
|
14
|
-
WORKSPACE_TSCONFIG,
|
|
15
|
-
chainPaths,
|
|
16
|
-
effectivePaths,
|
|
17
14
|
parseJsonc
|
|
18
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QXFCZON7.js";
|
|
19
16
|
|
|
20
17
|
// src/core/base-adapter.ts
|
|
21
18
|
var BaseAdapter = class {
|
|
@@ -30,12 +27,39 @@ var BaseAdapter = class {
|
|
|
30
27
|
}
|
|
31
28
|
};
|
|
32
29
|
|
|
30
|
+
// src/core/config/tool-args.ts
|
|
31
|
+
import { existsSync } from "node:fs";
|
|
32
|
+
import { isAbsolute, resolve } from "node:path";
|
|
33
|
+
function splitToolArgs(cwd, toolArgs = [], { valueFlags = [] } = {}) {
|
|
34
|
+
const takesValue = new Set(valueFlags);
|
|
35
|
+
const options = [];
|
|
36
|
+
const paths = [];
|
|
37
|
+
let previousTakesValue = false;
|
|
38
|
+
for (const arg of toolArgs) {
|
|
39
|
+
const looksLikeOption = arg.startsWith("-");
|
|
40
|
+
const target = isAbsolute(arg) ? arg : resolve(cwd, arg);
|
|
41
|
+
if (!previousTakesValue && !looksLikeOption && existsSync(target)) paths.push(arg);
|
|
42
|
+
else options.push(arg);
|
|
43
|
+
previousTakesValue = !arg.includes("=") && takesValue.has(arg);
|
|
44
|
+
}
|
|
45
|
+
return { options, paths };
|
|
46
|
+
}
|
|
47
|
+
function separateToolArgs(argv) {
|
|
48
|
+
const separator = argv.indexOf("--");
|
|
49
|
+
if (separator === -1) return { cliArgv: [...argv], toolArgs: [] };
|
|
50
|
+
const rest = argv.slice(separator + 1);
|
|
51
|
+
return {
|
|
52
|
+
cliArgv: argv.slice(0, separator),
|
|
53
|
+
toolArgs: rest[0] === "--" ? rest.slice(1) : rest
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
33
57
|
// src/roles/test/read-adoption.ts
|
|
34
|
-
import { existsSync as
|
|
58
|
+
import { existsSync as existsSync3, readFileSync as readFileSync3, readdirSync } from "node:fs";
|
|
35
59
|
import { join as join3, relative } from "node:path";
|
|
36
60
|
|
|
37
61
|
// src/core/config/manifest.ts
|
|
38
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
62
|
+
import { existsSync as existsSync2, readFileSync } from "node:fs";
|
|
39
63
|
import { basename, join } from "node:path";
|
|
40
64
|
function moduleScripts(cwd) {
|
|
41
65
|
try {
|
|
@@ -78,7 +102,7 @@ function manifestOperation(cwd, scripts) {
|
|
|
78
102
|
scripts,
|
|
79
103
|
devDependencies: { [own.name]: isSelfAdoption(cwd) ? "link:." : own.version }
|
|
80
104
|
};
|
|
81
|
-
if (
|
|
105
|
+
if (existsSync2(join(cwd, "package.json"))) {
|
|
82
106
|
return { kind: "merge-json", path: "package.json", value };
|
|
83
107
|
}
|
|
84
108
|
return {
|
|
@@ -207,15 +231,15 @@ var JEST_CONFIG_FILES = [
|
|
|
207
231
|
"jest.integration-config.ts"
|
|
208
232
|
];
|
|
209
233
|
function testConfigFile(cwd) {
|
|
210
|
-
return TEST_CONFIG_FILES.find((name) =>
|
|
234
|
+
return TEST_CONFIG_FILES.find((name) => existsSync3(join3(cwd, name)));
|
|
211
235
|
}
|
|
212
236
|
function jestConfigFiles(cwd) {
|
|
213
|
-
return JEST_CONFIG_FILES.filter((name) =>
|
|
237
|
+
return JEST_CONFIG_FILES.filter((name) => existsSync3(join3(cwd, name)));
|
|
214
238
|
}
|
|
215
239
|
function rootJestConfigFiles(cwd) {
|
|
216
240
|
const root = findWorkspaceRoot(cwd);
|
|
217
241
|
if (root === void 0 || root === cwd) return [];
|
|
218
|
-
return JEST_CONFIG_FILES.filter((name) =>
|
|
242
|
+
return JEST_CONFIG_FILES.filter((name) => existsSync3(join3(root, name)));
|
|
219
243
|
}
|
|
220
244
|
var TEST_FILE = /[.-](spec|test)\.[cm]?[jt]sx?$/;
|
|
221
245
|
var NOT_WALKED = /* @__PURE__ */ new Set(["node_modules", "dist", "coverage", ".git", ".nx", ".turbo"]);
|
|
@@ -331,7 +355,7 @@ function hasLostItsSuite(cwd, adoption) {
|
|
|
331
355
|
}
|
|
332
356
|
|
|
333
357
|
// src/roles/test/module-env.ts
|
|
334
|
-
import { existsSync as
|
|
358
|
+
import { existsSync as existsSync4, readFileSync as readFileSync4 } from "node:fs";
|
|
335
359
|
import { join as join4 } from "node:path";
|
|
336
360
|
var CASCADE = [".env", ".env.test"];
|
|
337
361
|
var MODULE_CASCADE = [".env", ".env.local", ".env.test"];
|
|
@@ -363,7 +387,7 @@ function moduleEnvironment(cwd) {
|
|
|
363
387
|
...MODULE_CASCADE.map((name) => [join4(cwd, name), `<module>/${name}`])
|
|
364
388
|
];
|
|
365
389
|
for (const [path, label] of files) {
|
|
366
|
-
if (!
|
|
390
|
+
if (!existsSync4(path)) continue;
|
|
367
391
|
loaded.push(label);
|
|
368
392
|
Object.assign(added, parse(path));
|
|
369
393
|
}
|
|
@@ -374,12 +398,12 @@ function moduleEnvironment(cwd) {
|
|
|
374
398
|
// src/roles/test/reference.ts
|
|
375
399
|
import { execFileSync } from "node:child_process";
|
|
376
400
|
import { createHash } from "node:crypto";
|
|
377
|
-
import { existsSync as
|
|
401
|
+
import { existsSync as existsSync6, mkdirSync, mkdtempSync, readFileSync as readFileSync5, rmSync, writeFileSync } from "node:fs";
|
|
378
402
|
import { tmpdir } from "node:os";
|
|
379
|
-
import { join as join6, resolve } from "node:path";
|
|
403
|
+
import { join as join6, resolve as resolve2 } from "node:path";
|
|
380
404
|
|
|
381
405
|
// src/shared/resolve-bin.ts
|
|
382
|
-
import { existsSync as
|
|
406
|
+
import { existsSync as existsSync5 } from "node:fs";
|
|
383
407
|
import { createRequire } from "node:module";
|
|
384
408
|
import { delimiter, dirname, join as join5 } from "node:path";
|
|
385
409
|
var require2 = createRequire(import.meta.url);
|
|
@@ -387,7 +411,7 @@ function resolveBin(fromDir, name) {
|
|
|
387
411
|
let dir = fromDir;
|
|
388
412
|
for (; ; ) {
|
|
389
413
|
const candidate = join5(dir, "node_modules", ".bin", name);
|
|
390
|
-
if (
|
|
414
|
+
if (existsSync5(candidate)) return candidate;
|
|
391
415
|
const parent = dirname(dir);
|
|
392
416
|
if (parent === dir) return void 0;
|
|
393
417
|
dir = parent;
|
|
@@ -400,7 +424,7 @@ function binFromOwnInstall(packageName, binName) {
|
|
|
400
424
|
const relative8 = typeof bin === "string" ? bin : bin?.[binName];
|
|
401
425
|
if (!relative8) return void 0;
|
|
402
426
|
const executable = join5(dirname(manifest), relative8);
|
|
403
|
-
return
|
|
427
|
+
return existsSync5(executable) ? executable : void 0;
|
|
404
428
|
} catch {
|
|
405
429
|
return void 0;
|
|
406
430
|
}
|
|
@@ -687,7 +711,7 @@ function describeComparison(comparison) {
|
|
|
687
711
|
|
|
688
712
|
// src/roles/test/reference.ts
|
|
689
713
|
function referencePath(cwd, suite) {
|
|
690
|
-
const key = createHash("sha256").update(`${
|
|
714
|
+
const key = createHash("sha256").update(`${resolve2(cwd)}\0${suite}`).digest("hex").slice(0, 16);
|
|
691
715
|
return join6(tmpdir(), "sentinel-test-reference", `${key}.json`);
|
|
692
716
|
}
|
|
693
717
|
function suiteOf(config) {
|
|
@@ -716,7 +740,7 @@ function runJest(cwd, config) {
|
|
|
716
740
|
});
|
|
717
741
|
} catch {
|
|
718
742
|
}
|
|
719
|
-
if (!
|
|
743
|
+
if (!existsSync6(out)) return void 0;
|
|
720
744
|
try {
|
|
721
745
|
return JSON.parse(readFileSync5(out, "utf8"));
|
|
722
746
|
} catch {
|
|
@@ -758,7 +782,7 @@ function captureReference(cwd, config) {
|
|
|
758
782
|
};
|
|
759
783
|
}
|
|
760
784
|
function hasReference(cwd, suite) {
|
|
761
|
-
return
|
|
785
|
+
return existsSync6(referencePath(cwd, suite));
|
|
762
786
|
}
|
|
763
787
|
function compareAgainstReference(cwd, suite, report) {
|
|
764
788
|
const path = referencePath(cwd, suite);
|
|
@@ -788,28 +812,10 @@ function resolveVitest(cwd) {
|
|
|
788
812
|
|
|
789
813
|
// src/roles/test/adapters/vitest/vitest.adapter.ts
|
|
790
814
|
import { spawnSync } from "node:child_process";
|
|
791
|
-
import { existsSync as existsSync25, mkdtempSync as mkdtempSync3, readFileSync as
|
|
815
|
+
import { existsSync as existsSync25, mkdtempSync as mkdtempSync3, readFileSync as readFileSync26, writeFileSync as writeFileSync2 } from "node:fs";
|
|
792
816
|
import { tmpdir as tmpdir3 } from "node:os";
|
|
793
817
|
import { isAbsolute as isAbsolute2, join as join32, relative as relative7, resolve as resolve10 } from "node:path";
|
|
794
818
|
|
|
795
|
-
// src/core/config/tool-args.ts
|
|
796
|
-
import { existsSync as existsSync6 } from "node:fs";
|
|
797
|
-
import { isAbsolute, resolve as resolve2 } from "node:path";
|
|
798
|
-
function splitToolArgs(cwd, toolArgs = [], { valueFlags = [] } = {}) {
|
|
799
|
-
const takesValue = new Set(valueFlags);
|
|
800
|
-
const options = [];
|
|
801
|
-
const paths = [];
|
|
802
|
-
let previousTakesValue = false;
|
|
803
|
-
for (const arg of toolArgs) {
|
|
804
|
-
const looksLikeOption = arg.startsWith("-");
|
|
805
|
-
const target = isAbsolute(arg) ? arg : resolve2(cwd, arg);
|
|
806
|
-
if (!previousTakesValue && !looksLikeOption && existsSync6(target)) paths.push(arg);
|
|
807
|
-
else options.push(arg);
|
|
808
|
-
previousTakesValue = !arg.includes("=") && takesValue.has(arg);
|
|
809
|
-
}
|
|
810
|
-
return { options, paths };
|
|
811
|
-
}
|
|
812
|
-
|
|
813
819
|
// src/roles/test/ordering-is-a-permutation.ts
|
|
814
820
|
function isAnImport(line) {
|
|
815
821
|
return /^import\b/.test(line) || /^export\s+(?:\*|\{)[^;]*\bfrom\b/.test(line);
|
|
@@ -998,12 +1004,12 @@ function rewriteToolchainImports(toolchain, source, fileName) {
|
|
|
998
1004
|
}
|
|
999
1005
|
|
|
1000
1006
|
// src/roles/test/jest-migration.ts
|
|
1001
|
-
import { existsSync as existsSync19, readFileSync as
|
|
1007
|
+
import { existsSync as existsSync19, readFileSync as readFileSync21, readdirSync as readdirSync6 } from "node:fs";
|
|
1002
1008
|
import { createRequire as createRequire5 } from "node:module";
|
|
1003
1009
|
import { dirname as dirname12, join as join25, relative as relative6 } from "node:path";
|
|
1004
1010
|
|
|
1005
1011
|
// src/roles/test/codemod/migrate-module.ts
|
|
1006
|
-
import { readdirSync as readdirSync4, readFileSync as
|
|
1012
|
+
import { readdirSync as readdirSync4, readFileSync as readFileSync16, statSync as statSync5 } from "node:fs";
|
|
1007
1013
|
import { join as join18 } from "node:path";
|
|
1008
1014
|
import { parseSync as parseSync9 } from "oxc-parser";
|
|
1009
1015
|
|
|
@@ -3598,40 +3604,37 @@ function resolveContext(cwd, opts) {
|
|
|
3598
3604
|
}
|
|
3599
3605
|
|
|
3600
3606
|
// src/roles/test/codemod/workspace-specifier.ts
|
|
3601
|
-
import { existsSync as existsSync13 } from "node:fs";
|
|
3607
|
+
import { existsSync as existsSync13, readFileSync as readFileSync13 } from "node:fs";
|
|
3602
3608
|
import { join as join15, relative as relative2, resolve as resolve6 } from "node:path";
|
|
3603
3609
|
var EXTENSIONS = ["", ".ts", ".tsx", ".js", ".jsx", ".mts", ".cts", "/index.ts", "/index.js"];
|
|
3604
|
-
|
|
3605
|
-
|
|
3610
|
+
function pathEntries(workspaceRoot) {
|
|
3611
|
+
const file = join15(workspaceRoot, "tsconfig.base.json");
|
|
3612
|
+
if (!existsSync13(file)) return [];
|
|
3613
|
+
let paths;
|
|
3606
3614
|
try {
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
return found && { ...found, fromWorkspaceFallback: false };
|
|
3615
|
+
paths = parseJsonc(
|
|
3616
|
+
readFileSync13(file, "utf8"),
|
|
3617
|
+
"tsconfig.base.json"
|
|
3618
|
+
)?.compilerOptions?.paths;
|
|
3612
3619
|
} catch {
|
|
3613
|
-
return
|
|
3620
|
+
return [];
|
|
3614
3621
|
}
|
|
3615
|
-
}
|
|
3616
|
-
function pathEntries(workspaceRoot, moduleRoot) {
|
|
3617
|
-
const found = pathsFor(workspaceRoot, moduleRoot);
|
|
3618
|
-
if (found === void 0) return [];
|
|
3619
3622
|
const entries = [];
|
|
3620
|
-
for (const [key, targets] of Object.entries(
|
|
3623
|
+
for (const [key, targets] of Object.entries(paths ?? {})) {
|
|
3621
3624
|
const target = targets[0];
|
|
3622
3625
|
if (target === void 0) continue;
|
|
3623
3626
|
const wildcard = key.endsWith("/*") && target.endsWith("/*");
|
|
3624
3627
|
entries.push({
|
|
3625
3628
|
key: wildcard ? key.slice(0, -2) : key,
|
|
3626
|
-
target: resolve6(
|
|
3629
|
+
target: resolve6(workspaceRoot, wildcard ? target.slice(0, -2) : target),
|
|
3627
3630
|
wildcard
|
|
3628
3631
|
});
|
|
3629
3632
|
}
|
|
3630
3633
|
return entries.sort((left, right) => right.target.length - left.target.length);
|
|
3631
3634
|
}
|
|
3632
|
-
function workspaceSpecifier(workspaceRoot, file
|
|
3635
|
+
function workspaceSpecifier(workspaceRoot, file) {
|
|
3633
3636
|
const absolute = resolve6(file);
|
|
3634
|
-
for (const entry of pathEntries(workspaceRoot
|
|
3637
|
+
for (const entry of pathEntries(workspaceRoot)) {
|
|
3635
3638
|
if (!entry.wildcard) {
|
|
3636
3639
|
if (EXTENSIONS.some((extension) => `${entry.target}${extension}` === absolute)) {
|
|
3637
3640
|
return entry.key;
|
|
@@ -3664,7 +3667,7 @@ function importable(written, fileName, workspaceRoot) {
|
|
|
3664
3667
|
const target = resolve7(fileDir, written);
|
|
3665
3668
|
if (target.startsWith(`${moduleRoot}/`)) return written;
|
|
3666
3669
|
if (workspaceRoot === void 0) return void 0;
|
|
3667
|
-
return workspaceSpecifier(workspaceRoot, target
|
|
3670
|
+
return workspaceSpecifier(workspaceRoot, target);
|
|
3668
3671
|
}
|
|
3669
3672
|
function statement(fileName, source, node, specifier, written) {
|
|
3670
3673
|
if (node.type === "ExpressionStatement") return `import '${specifier}'`;
|
|
@@ -3775,7 +3778,7 @@ function rewriteMockFactoryGenerics(source, program) {
|
|
|
3775
3778
|
}
|
|
3776
3779
|
|
|
3777
3780
|
// src/roles/test/codemod/spy-on-internal-call.ts
|
|
3778
|
-
import { readFileSync as
|
|
3781
|
+
import { readFileSync as readFileSync14, statSync as statSync3 } from "node:fs";
|
|
3779
3782
|
import { dirname as dirname7, join as join16, relative as relative3, resolve as resolve8 } from "node:path";
|
|
3780
3783
|
import { parseSync as parseSync7 } from "oxc-parser";
|
|
3781
3784
|
function resolveRelative2(fromFile, specifier) {
|
|
@@ -3796,7 +3799,7 @@ function resolveRelative2(fromFile, specifier) {
|
|
|
3796
3799
|
}
|
|
3797
3800
|
function read(path) {
|
|
3798
3801
|
try {
|
|
3799
|
-
return
|
|
3802
|
+
return readFileSync14(path, "utf8");
|
|
3800
3803
|
} catch {
|
|
3801
3804
|
return void 0;
|
|
3802
3805
|
}
|
|
@@ -4351,7 +4354,7 @@ function migrateTestFile(fileName, source, defaultImported = /* @__PURE__ */ new
|
|
|
4351
4354
|
*/
|
|
4352
4355
|
...statics.refusals.map((specifier) => ({
|
|
4353
4356
|
binding: specifier,
|
|
4354
|
-
reason: `\`require('${specifier}')\` reaches another project, and
|
|
4357
|
+
reason: `\`require('${specifier}')\` reaches another project, and \`tsconfig.base.json\` declares no path for it. A static import of a relative path is refused by nx, and \`await import()\` would make it a dynamic dependency, which forbids every static import of that project across this module. Add a \`paths\` entry for it, or move the file inside this project.`
|
|
4355
4358
|
})),
|
|
4356
4359
|
...fakeTimers.refusals,
|
|
4357
4360
|
...hoist.refusals,
|
|
@@ -4368,7 +4371,7 @@ function migrateTestFile(fileName, source, defaultImported = /* @__PURE__ */ new
|
|
|
4368
4371
|
}
|
|
4369
4372
|
|
|
4370
4373
|
// src/roles/test/codemod/test-support-files.ts
|
|
4371
|
-
import { existsSync as existsSync14, readFileSync as
|
|
4374
|
+
import { existsSync as existsSync14, readFileSync as readFileSync15, readdirSync as readdirSync3, statSync as statSync4 } from "node:fs";
|
|
4372
4375
|
import { dirname as dirname9, join as join17, relative as relative4, resolve as resolve9 } from "node:path";
|
|
4373
4376
|
var THE_SHIM_CANNOT_ANSWER = [/\brequire\s*\(/, /\bjest\.(?:fn|Mock|SpyInstance)\s*</];
|
|
4374
4377
|
var SKIPPED = /* @__PURE__ */ new Set(["node_modules", "dist", "coverage", ".git", ".vite"]);
|
|
@@ -4423,7 +4426,7 @@ function moduleSources(cwd) {
|
|
|
4423
4426
|
}
|
|
4424
4427
|
function read2(path) {
|
|
4425
4428
|
try {
|
|
4426
|
-
return
|
|
4429
|
+
return readFileSync15(path, "utf8");
|
|
4427
4430
|
} catch {
|
|
4428
4431
|
return void 0;
|
|
4429
4432
|
}
|
|
@@ -4481,7 +4484,7 @@ function parse4(fileName, source) {
|
|
|
4481
4484
|
}
|
|
4482
4485
|
function read3(path) {
|
|
4483
4486
|
try {
|
|
4484
|
-
return
|
|
4487
|
+
return readFileSync16(path, "utf8");
|
|
4485
4488
|
} catch {
|
|
4486
4489
|
return void 0;
|
|
4487
4490
|
}
|
|
@@ -4610,7 +4613,7 @@ function migrateModuleTests(cwd, setupFiles = []) {
|
|
|
4610
4613
|
}
|
|
4611
4614
|
|
|
4612
4615
|
// src/roles/test/nest/generate-config.ts
|
|
4613
|
-
import { readdirSync as readdirSync5, readFileSync as
|
|
4616
|
+
import { readdirSync as readdirSync5, readFileSync as readFileSync17, statSync as statSync6 } from "node:fs";
|
|
4614
4617
|
import { join as join19, relative as relative5 } from "node:path";
|
|
4615
4618
|
import { parseSync as parseSync10 } from "oxc-parser";
|
|
4616
4619
|
var NEST_TEST_PRESET_SPECIFIER = "@hublo/sentinel/test/nest";
|
|
@@ -4672,7 +4675,7 @@ function readModuleTraits(cwd) {
|
|
|
4672
4675
|
if (!/\.tsx?$/.test(entry)) continue;
|
|
4673
4676
|
let source;
|
|
4674
4677
|
try {
|
|
4675
|
-
source =
|
|
4678
|
+
source = readFileSync17(path, "utf8");
|
|
4676
4679
|
} catch {
|
|
4677
4680
|
continue;
|
|
4678
4681
|
}
|
|
@@ -4813,7 +4816,7 @@ ${overrides.join("\n")}
|
|
|
4813
4816
|
}
|
|
4814
4817
|
|
|
4815
4818
|
// src/roles/test/nest/read-jest-config.ts
|
|
4816
|
-
import { existsSync as existsSync15, readFileSync as
|
|
4819
|
+
import { existsSync as existsSync15, readFileSync as readFileSync18 } from "node:fs";
|
|
4817
4820
|
import { join as join20 } from "node:path";
|
|
4818
4821
|
var CARRIED = [
|
|
4819
4822
|
"testEnvironment",
|
|
@@ -5035,7 +5038,7 @@ function readJestConfig(cwd, named) {
|
|
|
5035
5038
|
if (file === void 0 || !existsSync15(join20(cwd, file))) return void 0;
|
|
5036
5039
|
let source;
|
|
5037
5040
|
try {
|
|
5038
|
-
source =
|
|
5041
|
+
source = readFileSync18(join20(cwd, file), "utf8");
|
|
5039
5042
|
} catch {
|
|
5040
5043
|
return { file, refusals: [`${file} could not be read`], notes: [] };
|
|
5041
5044
|
}
|
|
@@ -5167,7 +5170,7 @@ import { existsSync as existsSync18 } from "node:fs";
|
|
|
5167
5170
|
import { dirname as dirname11, join as join24 } from "node:path";
|
|
5168
5171
|
|
|
5169
5172
|
// src/roles/format/read-adoption.ts
|
|
5170
|
-
import { existsSync as existsSync17, readFileSync as
|
|
5173
|
+
import { existsSync as existsSync17, readFileSync as readFileSync19 } from "node:fs";
|
|
5171
5174
|
import { join as join22 } from "node:path";
|
|
5172
5175
|
|
|
5173
5176
|
// src/roles/format/config-policy.ts
|
|
@@ -5279,7 +5282,7 @@ function readFormatAdoption(cwd) {
|
|
|
5279
5282
|
if (!existsSync17(path)) return NOT_ADOPTED(null);
|
|
5280
5283
|
let parsed;
|
|
5281
5284
|
try {
|
|
5282
|
-
parsed = parseJsonc(
|
|
5285
|
+
parsed = parseJsonc(readFileSync19(path, "utf8"), FORMAT_CONFIG_FILE);
|
|
5283
5286
|
} catch (error) {
|
|
5284
5287
|
const reason = error instanceof Error ? error.message : String(error);
|
|
5285
5288
|
return NOT_ADOPTED(FORMAT_CONFIG_FILE, `${FORMAT_CONFIG_FILE} could not be parsed (${reason})`);
|
|
@@ -5323,7 +5326,7 @@ function readFormatAdoption(cwd) {
|
|
|
5323
5326
|
}
|
|
5324
5327
|
|
|
5325
5328
|
// src/roles/format/resolve-oxfmt.ts
|
|
5326
|
-
import { readFileSync as
|
|
5329
|
+
import { readFileSync as readFileSync20 } from "node:fs";
|
|
5327
5330
|
import { createRequire as createRequire4 } from "node:module";
|
|
5328
5331
|
import { dirname as dirname10, join as join23 } from "node:path";
|
|
5329
5332
|
function resolveOxfmt(cwd) {
|
|
@@ -5355,7 +5358,7 @@ function readConfigSchema() {
|
|
|
5355
5358
|
try {
|
|
5356
5359
|
const manifest = createRequire4(import.meta.url).resolve("oxfmt/package.json");
|
|
5357
5360
|
const schemaPath = join23(dirname10(manifest), "configuration_schema.json");
|
|
5358
|
-
return JSON.parse(
|
|
5361
|
+
return JSON.parse(readFileSync20(schemaPath, "utf8"));
|
|
5359
5362
|
} catch {
|
|
5360
5363
|
return void 0;
|
|
5361
5364
|
}
|
|
@@ -5415,7 +5418,7 @@ function specTypesOperation(cwd) {
|
|
|
5415
5418
|
let config;
|
|
5416
5419
|
try {
|
|
5417
5420
|
config = parseJsonc(
|
|
5418
|
-
|
|
5421
|
+
readFileSync21(path, "utf8"),
|
|
5419
5422
|
SPEC_TSCONFIG
|
|
5420
5423
|
);
|
|
5421
5424
|
} catch {
|
|
@@ -5439,7 +5442,7 @@ function specTypesCleanupOperation(cwd) {
|
|
|
5439
5442
|
let config;
|
|
5440
5443
|
try {
|
|
5441
5444
|
config = parseJsonc(
|
|
5442
|
-
|
|
5445
|
+
readFileSync21(path, "utf8"),
|
|
5443
5446
|
SPEC_TSCONFIG
|
|
5444
5447
|
);
|
|
5445
5448
|
} catch {
|
|
@@ -5488,7 +5491,7 @@ function helpersStillCallingJest(cwd) {
|
|
|
5488
5491
|
if (/^(jest|vitest)\./.test(entry.name)) continue;
|
|
5489
5492
|
let source;
|
|
5490
5493
|
try {
|
|
5491
|
-
source =
|
|
5494
|
+
source = readFileSync21(path, "utf8");
|
|
5492
5495
|
} catch {
|
|
5493
5496
|
continue;
|
|
5494
5497
|
}
|
|
@@ -5525,7 +5528,7 @@ function tsconfigFileListOperations(cwd) {
|
|
|
5525
5528
|
let config;
|
|
5526
5529
|
try {
|
|
5527
5530
|
config = parseJsonc(
|
|
5528
|
-
|
|
5531
|
+
readFileSync21(join25(cwd, name), "utf8"),
|
|
5529
5532
|
name
|
|
5530
5533
|
);
|
|
5531
5534
|
} catch {
|
|
@@ -5944,7 +5947,7 @@ import { existsSync as existsSync24 } from "node:fs";
|
|
|
5944
5947
|
import { join as join31 } from "node:path";
|
|
5945
5948
|
|
|
5946
5949
|
// src/roles/lint/module-baseline.ts
|
|
5947
|
-
import { existsSync as existsSync20, readFileSync as
|
|
5950
|
+
import { existsSync as existsSync20, readFileSync as readFileSync22 } from "node:fs";
|
|
5948
5951
|
import { join as join26 } from "node:path";
|
|
5949
5952
|
|
|
5950
5953
|
// src/roles/lint/oxlint-rule-owners.json
|
|
@@ -6690,7 +6693,7 @@ function heldRules(cwd) {
|
|
|
6690
6693
|
const path = join26(cwd, LINT_BASELINE_FILE);
|
|
6691
6694
|
if (!existsSync20(path)) return [];
|
|
6692
6695
|
try {
|
|
6693
|
-
const parsed = parseJsonc(
|
|
6696
|
+
const parsed = parseJsonc(readFileSync22(path, "utf8"), LINT_BASELINE_FILE);
|
|
6694
6697
|
const scoped = (parsed.overrides ?? []).flatMap((override) => Object.keys(override.rules ?? {}));
|
|
6695
6698
|
return [.../* @__PURE__ */ new Set([...Object.keys(parsed.rules ?? {}), ...scoped])];
|
|
6696
6699
|
} catch {
|
|
@@ -6738,11 +6741,11 @@ function lintTarget() {
|
|
|
6738
6741
|
}
|
|
6739
6742
|
|
|
6740
6743
|
// src/roles/lint/read-adoption.ts
|
|
6741
|
-
import { readFileSync as
|
|
6744
|
+
import { readFileSync as readFileSync25 } from "node:fs";
|
|
6742
6745
|
import { join as join29 } from "node:path";
|
|
6743
6746
|
|
|
6744
6747
|
// src/core/config/read-adoption.ts
|
|
6745
|
-
import { existsSync as existsSync22, readFileSync as
|
|
6748
|
+
import { existsSync as existsSync22, readFileSync as readFileSync24 } from "node:fs";
|
|
6746
6749
|
import { join as join28 } from "node:path";
|
|
6747
6750
|
|
|
6748
6751
|
// src/core/config/owned-keys.ts
|
|
@@ -6758,12 +6761,12 @@ function localOnlyKeys(config, permitted, presetSets) {
|
|
|
6758
6761
|
}
|
|
6759
6762
|
|
|
6760
6763
|
// src/core/config/resolve-config-target.ts
|
|
6761
|
-
import { existsSync as existsSync21, readFileSync as
|
|
6764
|
+
import { existsSync as existsSync21, readFileSync as readFileSync23 } from "node:fs";
|
|
6762
6765
|
import { join as join27 } from "node:path";
|
|
6763
6766
|
function readExtends(absolutePath) {
|
|
6764
6767
|
let parsed;
|
|
6765
6768
|
try {
|
|
6766
|
-
parsed = parseJsonc(
|
|
6769
|
+
parsed = parseJsonc(readFileSync23(absolutePath, "utf8"), absolutePath);
|
|
6767
6770
|
} catch {
|
|
6768
6771
|
return [];
|
|
6769
6772
|
}
|
|
@@ -6816,7 +6819,7 @@ function readAdoption(cwd, options) {
|
|
|
6816
6819
|
}
|
|
6817
6820
|
let parsed;
|
|
6818
6821
|
try {
|
|
6819
|
-
parsed = parseJsonc(
|
|
6822
|
+
parsed = parseJsonc(readFileSync24(join28(cwd, target.path), "utf8"), target.path);
|
|
6820
6823
|
} catch (error) {
|
|
6821
6824
|
const reason = error instanceof Error ? error.message : String(error);
|
|
6822
6825
|
return NOT_ADOPTED2(target.path, `${target.path} could not be parsed (${reason})`);
|
|
@@ -9500,7 +9503,7 @@ function readModuleAdditions(cwd) {
|
|
|
9500
9503
|
if (preset === void 0 || adoption.configFile === null) return NO_ADDITIONS;
|
|
9501
9504
|
try {
|
|
9502
9505
|
const config = parseJsonc(
|
|
9503
|
-
|
|
9506
|
+
readFileSync25(join29(cwd, adoption.configFile), "utf8"),
|
|
9504
9507
|
adoption.configFile
|
|
9505
9508
|
);
|
|
9506
9509
|
if (typeof config !== "object" || config === null || Array.isArray(config)) {
|
|
@@ -9591,7 +9594,7 @@ var FORMATTABLE = /\.(m|c)?(j|t)sx?$|\.json$/;
|
|
|
9591
9594
|
var FORMAT_BATCH = 25;
|
|
9592
9595
|
function readIfPossible(path) {
|
|
9593
9596
|
try {
|
|
9594
|
-
return
|
|
9597
|
+
return readFileSync26(path, "utf8");
|
|
9595
9598
|
} catch {
|
|
9596
9599
|
return void 0;
|
|
9597
9600
|
}
|
|
@@ -9838,7 +9841,7 @@ var VitestAdapter = class _VitestAdapter extends BaseAdapter {
|
|
|
9838
9841
|
}
|
|
9839
9842
|
let parsed;
|
|
9840
9843
|
try {
|
|
9841
|
-
parsed = JSON.parse(
|
|
9844
|
+
parsed = JSON.parse(readFileSync26(out, "utf8"));
|
|
9842
9845
|
} catch {
|
|
9843
9846
|
return {
|
|
9844
9847
|
ok: false,
|
|
@@ -9960,6 +9963,7 @@ export {
|
|
|
9960
9963
|
projectTargets,
|
|
9961
9964
|
BaseAdapter,
|
|
9962
9965
|
splitToolArgs,
|
|
9966
|
+
separateToolArgs,
|
|
9963
9967
|
resolveBin,
|
|
9964
9968
|
binFromOwnInstall,
|
|
9965
9969
|
binSearchPath,
|
|
@@ -10020,6 +10024,7 @@ export {
|
|
|
10020
10024
|
oxlintPath,
|
|
10021
10025
|
oxlintSearchPath,
|
|
10022
10026
|
walk,
|
|
10027
|
+
MEMBER_TYPES,
|
|
10023
10028
|
writtenFileFormatter,
|
|
10024
10029
|
RESOLVABLE_EXTENSIONS,
|
|
10025
10030
|
readTestAdoption,
|
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare function registerAdapters(): void;
|
|
|
32
32
|
declare const VERBS: readonly ["run", "inspect", "init", "migrate", "validate", "report", "status"];
|
|
33
33
|
type Verb = (typeof VERBS)[number];
|
|
34
34
|
/** Targets: the kind of check. The CLI `--<target>` flags map 1:1 to these. */
|
|
35
|
-
declare const TARGETS: readonly ["lint", "format", "typescript", "build", "dev", "test", "static-analysis", "env", "runtime-analysis", "arch"];
|
|
35
|
+
declare const TARGETS: readonly ["lint", "format", "typescript", "build", "dev", "test", "static-analysis", "sql", "env", "runtime-analysis", "arch"];
|
|
36
36
|
type Target = (typeof TARGETS)[number];
|
|
37
37
|
/** Presets: the stack preset a project resolves to (strict by default). */
|
|
38
38
|
declare const PRESET_NAMES: readonly ["react", "nest", "svelte", "node", "tools"];
|
package/dist/index.js
CHANGED
|
@@ -6,15 +6,17 @@ import {
|
|
|
6
6
|
registerAdapters,
|
|
7
7
|
resolve,
|
|
8
8
|
setDefaultRunner
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AWDCC5VJ.js";
|
|
10
10
|
import {
|
|
11
11
|
BaseAdapter
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-ZASD5YPF.js";
|
|
13
|
+
import "./chunk-JT7ZMH44.js";
|
|
14
|
+
import "./chunk-LX7EG6PJ.js";
|
|
15
|
+
import "./chunk-LU4E4TVD.js";
|
|
16
|
+
import "./chunk-PXTU5MPW.js";
|
|
15
17
|
import "./chunk-4EIY7TTR.js";
|
|
16
18
|
import "./chunk-O7REVMOC.js";
|
|
17
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-QXFCZON7.js";
|
|
18
20
|
export {
|
|
19
21
|
BaseAdapter,
|
|
20
22
|
all,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UserConfig, Plugin } from 'vite';
|
|
2
2
|
export { Plugin, PluginOption, UserConfig, UserConfigExport, defineConfig, loadEnv, mergeConfig } from 'vite';
|
|
3
|
-
export { A as Alias, D as DecoratorMetadataOptions, d as decoratorMetadata, t as tsconfigAliases } from '../../../tsconfig-aliases-
|
|
3
|
+
export { A as Alias, D as DecoratorMetadataOptions, d as decoratorMetadata, t as tsconfigAliases } from '../../../tsconfig-aliases-Ce6axdJ4.js';
|
|
4
4
|
|
|
5
5
|
/** A transformer as the target declares it, passed through to the config unchanged. */
|
|
6
6
|
interface TransformerDeclaration {
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
decoratorMetadata,
|
|
6
6
|
tsconfigAliases
|
|
7
|
-
} from "../../../chunk-
|
|
8
|
-
import "../../../chunk-
|
|
7
|
+
} from "../../../chunk-SWWQ7X7B.js";
|
|
8
|
+
import "../../../chunk-QXFCZON7.js";
|
|
9
9
|
|
|
10
10
|
// src/roles/build/nest/nest-service.ts
|
|
11
11
|
import { join as join4 } from "node:path";
|
|
@@ -180,10 +180,7 @@ var NEST_SERVICE_NO_EXTERNAL = ["tslib"];
|
|
|
180
180
|
var baseConfig = (options) => {
|
|
181
181
|
const outDir = join4(options.workspaceRoot, options.outDir ?? `dist/${options.project}`);
|
|
182
182
|
const entry = join4(options.root, options.entry ?? "src/main.ts");
|
|
183
|
-
const aliases = tsconfigAliases(options.workspaceRoot
|
|
184
|
-
moduleRoot: options.root,
|
|
185
|
-
candidates: [options.tsconfig, "tsconfig.app.json", "tsconfig.json"]
|
|
186
|
-
});
|
|
183
|
+
const aliases = tsconfigAliases(options.workspaceRoot);
|
|
187
184
|
return {
|
|
188
185
|
plugins: [
|
|
189
186
|
importerExternals({ noExternal: NEST_SERVICE_NO_EXTERNAL, aliases }),
|