@hublo/sentinel 1.4.2 → 1.4.3

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.
@@ -15,7 +15,7 @@ import {
15
15
  palette,
16
16
  registerAdapters,
17
17
  resolve
18
- } from "../chunk-BGS5DL44.js";
18
+ } from "../chunk-DYK6UEMO.js";
19
19
  import {
20
20
  resolveContext
21
21
  } from "../chunk-TDNPPNGK.js";
@@ -5691,26 +5691,28 @@ function dependencyNames(cwd) {
5691
5691
  return [];
5692
5692
  }
5693
5693
  }
5694
- function declaresJsx(cwd) {
5694
+ var REACT_TYPESCRIPT_PRESET = "@hublo/sentinel/typescript/react";
5695
+ function reactTsconfigEvidence(cwd) {
5695
5696
  let entries;
5696
5697
  try {
5697
5698
  entries = readdirSync3(cwd).filter(
5698
5699
  (name) => name.startsWith("tsconfig") && name.endsWith(".json")
5699
5700
  );
5700
5701
  } catch {
5701
- return false;
5702
+ return void 0;
5702
5703
  }
5703
5704
  for (const name of entries) {
5704
5705
  try {
5705
- const config = parseJsonc(
5706
- readFileSync17(join19(cwd, name), "utf8"),
5707
- name
5708
- );
5709
- if (config.compilerOptions?.jsx !== void 0) return true;
5706
+ const config = parseJsonc(readFileSync17(join19(cwd, name), "utf8"), name);
5707
+ if (config.compilerOptions?.jsx !== void 0) return 'its tsconfig sets "jsx"';
5708
+ const extended = Array.isArray(config.extends) ? config.extends : config.extends === void 0 ? [] : [config.extends];
5709
+ if (extended.some((entry) => entry === REACT_TYPESCRIPT_PRESET)) {
5710
+ return `its tsconfig extends "${REACT_TYPESCRIPT_PRESET}"`;
5711
+ }
5710
5712
  } catch {
5711
5713
  }
5712
5714
  }
5713
- return false;
5715
+ return void 0;
5714
5716
  }
5715
5717
  function presetSignals(cwd) {
5716
5718
  const signals = [];
@@ -5719,8 +5721,9 @@ function presetSignals(cwd) {
5719
5721
  const hit = dependencies.find((name) => pattern.test(name));
5720
5722
  if (hit) signals.push({ preset, evidence: `it depends on "${hit}"` });
5721
5723
  }
5722
- if (declaresJsx(cwd) && !signals.some((signal) => signal.preset === "react")) {
5723
- signals.push({ preset: "react", evidence: 'its tsconfig sets "jsx"' });
5724
+ const reactTsconfig = reactTsconfigEvidence(cwd);
5725
+ if (reactTsconfig !== void 0 && !signals.some((signal) => signal.preset === "react")) {
5726
+ signals.push({ preset: "react", evidence: reactTsconfig });
5724
5727
  }
5725
5728
  const location = cwd.replaceAll("\\", "/");
5726
5729
  for (const { preset, pattern, evidence } of PATH_SIGNALS) {
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  registerAdapters,
7
7
  resolve,
8
8
  setDefaultRunner
9
- } from "./chunk-BGS5DL44.js";
9
+ } from "./chunk-DYK6UEMO.js";
10
10
  import {
11
11
  BaseAdapter
12
12
  } from "./chunk-TDNPPNGK.js";
@@ -991,7 +991,7 @@ $ sentinel --report --typescript --max-diagnostics 3.9 --module bff-admin
991
991
  ```console
992
992
  $ sentinel --init --dry-run
993
993
  dry run: no files written
994
- wrote .oxlintrc.json extending ./node_modules/@hublo/sentinel/lint/nest.json (@hublo/sentinel@1.4.1)
994
+ wrote .oxlintrc.json extending ./node_modules/@hublo/sentinel/lint/nest.json (@hublo/sentinel@<version>)
995
995
  2 rule(s) not enforced by this preset (1 no-barrel-files, 1 core). Run --inspect --lint for each rule and why.
996
996
  run `pnpm install`, then `pnpm run lint`
997
997
 
@@ -1022,7 +1022,7 @@ $ sentinel --init --dry-run
1022
1022
  + "lint": "sentinel --run --lint"
1023
1023
  + },
1024
1024
  + "devDependencies": {
1025
- + "@hublo/sentinel": "1.4.1"
1025
+ + "@hublo/sentinel": "<version>"
1026
1026
  + },
1027
1027
  + "nx": {
1028
1028
  + "targets": {
@@ -1058,7 +1058,7 @@ $ sentinel --init --dry-run
1058
1058
  + "typecheck": "sentinel --run --typescript"
1059
1059
  + },
1060
1060
  + "devDependencies": {
1061
- + "@hublo/sentinel": "1.4.1"
1061
+ + "@hublo/sentinel": "<version>"
1062
1062
  + },
1063
1063
  + "nx": {
1064
1064
  + "targets": {
@@ -1076,13 +1076,13 @@ $ sentinel --init --dry-run
1076
1076
  build: no Vite config in this module, so there is nothing to point at sentinel. This role moves an existing config's imports; it does not introduce a bundler. If this module builds another way (38 services here build through `@nx/webpack`), the build role does not apply to it.
1077
1077
  test: this module has no test and no jest leftovers, so there is nothing to do here.
1078
1078
  dry run: no files written
1079
- materialized the nest format preset into .oxfmtrc.json (@hublo/sentinel@1.4.1). oxfmt has no `extends`, so the values live here; `sentinel --status --format` reports modules left behind by a preset change
1079
+ materialized the nest format preset into .oxfmtrc.json (@hublo/sentinel@<version>). oxfmt has no `extends`, so the values live here; `sentinel --status --format` reports modules left behind by a preset change
1080
1080
 
1081
1081
  create .oxfmtrc.json
1082
1082
  + {
1083
1083
  + "$sentinel": {
1084
1084
  + "preset": "nest",
1085
- + "version": "1.4.1",
1085
+ + "version": "<version>",
1086
1086
  + "local": []
1087
1087
  + },
1088
1088
  + "printWidth": 80,
@@ -1133,7 +1133,7 @@ $ sentinel --init --dry-run
1133
1133
  + "format:fix": "sentinel --run --format --fix"
1134
1134
  + },
1135
1135
  + "devDependencies": {
1136
- + "@hublo/sentinel": "1.4.1"
1136
+ + "@hublo/sentinel": "<version>"
1137
1137
  + },
1138
1138
  + "nx": {
1139
1139
  + "targets": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hublo/sentinel",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
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",