@hublo/sentinel 1.2.0-alpha.31 → 1.2.0-alpha.32

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.
@@ -22,7 +22,7 @@ import {
22
22
  registerAdapters,
23
23
  resolve,
24
24
  resolveBin
25
- } from "../chunk-PLZ45MWU.js";
25
+ } from "../chunk-UULHGNMK.js";
26
26
 
27
27
  // bin/sentinel.ts
28
28
  import { program } from "commander";
@@ -5586,8 +5586,6 @@ function registerLint() {
5586
5586
 
5587
5587
  // src/roles/test/adapters/vitest/vitest.adapter.ts
5588
5588
  import { spawnSync as spawnSync5 } from "child_process";
5589
- import { existsSync as existsSync26 } from "fs";
5590
- import { join as join30 } from "path";
5591
5589
 
5592
5590
  // src/roles/test/presets/toolchain.json
5593
5591
  var toolchain_default2 = {
@@ -5848,12 +5846,10 @@ function plan3(context) {
5848
5846
 
5849
5847
  // src/roles/test/adapters/vitest/vitest.adapter.ts
5850
5848
  function resolveVitest(cwd) {
5851
- const fromSentinel = join30(
5852
- new URL("../../../../../node_modules/.bin/vitest", import.meta.url).pathname
5853
- );
5854
- if (existsSync26(fromSentinel)) return { bin: fromSentinel, origin: "sentinel" };
5855
- const fromModule = join30(cwd, "node_modules", ".bin", "vitest");
5856
- return existsSync26(fromModule) ? { bin: fromModule, origin: "module" } : { bin: void 0, origin: "module" };
5849
+ const fromSentinel = binFromOwnInstall("vitest", "vitest");
5850
+ if (fromSentinel !== void 0) return { bin: fromSentinel, origin: "sentinel" };
5851
+ const fromModule = resolveBin(cwd, "vitest");
5852
+ return fromModule !== void 0 ? { bin: fromModule, origin: "module" } : { bin: void 0, origin: "module" };
5857
5853
  }
5858
5854
  var VitestAdapter = class extends BaseAdapter {
5859
5855
  target = "test";
@@ -5930,9 +5926,9 @@ function registerTest() {
5930
5926
 
5931
5927
  // src/roles/typescript/adapters/tsc/tsc.adapter.ts
5932
5928
  import { spawnSync as spawnSync6 } from "child_process";
5933
- import { existsSync as existsSync27, readFileSync as readFileSync25 } from "fs";
5929
+ import { existsSync as existsSync26, readFileSync as readFileSync25 } from "fs";
5934
5930
  import { createRequire as createRequire4 } from "module";
5935
- import { join as join32 } from "path";
5931
+ import { join as join31 } from "path";
5936
5932
 
5937
5933
  // src/roles/typescript/presets/nest.json
5938
5934
  var nest_default2 = {
@@ -6114,7 +6110,7 @@ function readTsconfigAdoption(cwd) {
6114
6110
 
6115
6111
  // src/roles/typescript/adapters/tsc/plan.ts
6116
6112
  import { readFileSync as readFileSync24 } from "fs";
6117
- import { join as join31 } from "path";
6113
+ import { join as join30 } from "path";
6118
6114
 
6119
6115
  // src/roles/typescript/typecheck-script.ts
6120
6116
  var SENTINEL_TYPECHECK_COMMAND = "sentinel --run --typescript";
@@ -6207,7 +6203,7 @@ function planAdoption(context) {
6207
6203
  };
6208
6204
  }
6209
6205
  const existing = parseJsonc(
6210
- readFileSync24(join31(context.cwd, target.path), "utf8"),
6206
+ readFileSync24(join30(context.cwd, target.path), "utf8"),
6211
6207
  target.path
6212
6208
  );
6213
6209
  const extendsChain = composeExtends(existing.extends, preset);
@@ -6345,7 +6341,7 @@ var TscAdapter = class _TscAdapter extends BaseAdapter {
6345
6341
  let chain;
6346
6342
  try {
6347
6343
  const parsed = parseJsonc(
6348
- readFileSync25(join32(cwd, target.path), "utf8"),
6344
+ readFileSync25(join31(cwd, target.path), "utf8"),
6349
6345
  target.path
6350
6346
  );
6351
6347
  chain = parsed.extends;
@@ -6358,7 +6354,7 @@ var TscAdapter = class _TscAdapter extends BaseAdapter {
6358
6354
  );
6359
6355
  if (preset === void 0) return void 0;
6360
6356
  try {
6361
- createRequire4(join32(cwd, "noop.js")).resolve(preset);
6357
+ createRequire4(join31(cwd, "noop.js")).resolve(preset);
6362
6358
  return void 0;
6363
6359
  } catch {
6364
6360
  return preset;
@@ -6454,7 +6450,7 @@ var TscAdapter = class _TscAdapter extends BaseAdapter {
6454
6450
  referencedProjects(cwd, config) {
6455
6451
  try {
6456
6452
  const parsed = parseJsonc(
6457
- readFileSync25(join32(cwd, config), "utf8"),
6453
+ readFileSync25(join31(cwd, config), "utf8"),
6458
6454
  config
6459
6455
  );
6460
6456
  const referenced = (parsed.references ?? []).map((reference) => reference.path).filter((path) => typeof path === "string" && path.length > 0);
@@ -6470,7 +6466,7 @@ var TscAdapter = class _TscAdapter extends BaseAdapter {
6470
6466
  * check.
6471
6467
  */
6472
6468
  typecheckTarget(cwd) {
6473
- if (existsSync27(join32(cwd, "tsconfig.json"))) return "tsconfig.json";
6469
+ if (existsSync26(join31(cwd, "tsconfig.json"))) return "tsconfig.json";
6474
6470
  const target = resolveTsconfigTarget(cwd);
6475
6471
  return target.reason === "none" ? null : target.path;
6476
6472
  }
@@ -6675,7 +6671,7 @@ function replaceLines(current, replacements) {
6675
6671
  }
6676
6672
 
6677
6673
  // src/core/apply-plan.ts
6678
- import { existsSync as existsSync28, readFileSync as readFileSync26, renameSync, rmSync as rmSync3, writeFileSync as writeFileSync4 } from "fs";
6674
+ import { existsSync as existsSync27, readFileSync as readFileSync26, renameSync, rmSync as rmSync3, writeFileSync as writeFileSync4 } from "fs";
6679
6675
  import { resolve as resolve4, sep } from "path";
6680
6676
  import { applyEdits, findNodeAtLocation, modify, parseTree } from "jsonc-parser";
6681
6677
 
@@ -6694,7 +6690,7 @@ function resolveWithinRoot(cwd, relativePath) {
6694
6690
  return absolutePath;
6695
6691
  }
6696
6692
  function readIfExists(absolutePath) {
6697
- return existsSync28(absolutePath) ? readFileSync26(absolutePath, "utf8") : void 0;
6693
+ return existsSync27(absolutePath) ? readFileSync26(absolutePath, "utf8") : void 0;
6698
6694
  }
6699
6695
  function* leaves(value, prefix = []) {
6700
6696
  for (const [key, keyValue] of Object.entries(value)) {
@@ -6812,8 +6808,8 @@ function applyPlan(cwd, plan4) {
6812
6808
  }
6813
6809
 
6814
6810
  // src/core/config/preset-evidence.ts
6815
- import { existsSync as existsSync29, readdirSync as readdirSync4, readFileSync as readFileSync27 } from "fs";
6816
- import { join as join33 } from "path";
6811
+ import { existsSync as existsSync28, readdirSync as readdirSync4, readFileSync as readFileSync27 } from "fs";
6812
+ import { join as join32 } from "path";
6817
6813
  var PATH_SIGNALS = [
6818
6814
  {
6819
6815
  preset: "nest",
@@ -6827,8 +6823,8 @@ var DEPENDENCY_SIGNALS = [
6827
6823
  { preset: "nest", pattern: /^@nestjs\// }
6828
6824
  ];
6829
6825
  function dependencyNames(cwd) {
6830
- const path = join33(cwd, "package.json");
6831
- if (!existsSync29(path)) return [];
6826
+ const path = join32(cwd, "package.json");
6827
+ if (!existsSync28(path)) return [];
6832
6828
  try {
6833
6829
  const manifest = parseJsonc(
6834
6830
  readFileSync27(path, "utf8"),
@@ -6854,7 +6850,7 @@ function declaresJsx(cwd) {
6854
6850
  for (const name of entries) {
6855
6851
  try {
6856
6852
  const config = parseJsonc(
6857
- readFileSync27(join33(cwd, name), "utf8"),
6853
+ readFileSync27(join32(cwd, name), "utf8"),
6858
6854
  name
6859
6855
  );
6860
6856
  if (config.compilerOptions?.jsx !== void 0) return true;
@@ -7034,4 +7030,4 @@ export {
7034
7030
  detectFramework,
7035
7031
  dispatch
7036
7032
  };
7037
- //# sourceMappingURL=chunk-PLZ45MWU.js.map
7033
+ //# sourceMappingURL=chunk-UULHGNMK.js.map
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  registerAdapters,
8
8
  resolve,
9
9
  setDefaultRunner
10
- } from "./chunk-PLZ45MWU.js";
10
+ } from "./chunk-UULHGNMK.js";
11
11
  export {
12
12
  BaseAdapter,
13
13
  all,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hublo/sentinel",
3
- "version": "1.2.0-alpha.31",
3
+ "version": "1.2.0-alpha.32",
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",