@hublo/sentinel 1.4.0-alpha.45 → 1.4.0-alpha.46

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,10 +15,10 @@ import {
15
15
  palette,
16
16
  registerAdapters,
17
17
  resolve
18
- } from "../chunk-HUFF7UQW.js";
18
+ } from "../chunk-QRQTA776.js";
19
19
  import {
20
20
  resolveContext
21
- } from "../chunk-QHH4TCVE.js";
21
+ } from "../chunk-VR67JXVN.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-23IAEIRZ.js");
148
+ const { validateModuleTests } = await import("../validate-4HSEVZUA.js");
149
149
  const outcomes = modules.flatMap(
150
150
  (module) => validateModuleTests(module.name, module.root)
151
151
  );
@@ -53,7 +53,7 @@ import {
53
53
  selfCommand,
54
54
  splitToolArgs,
55
55
  walk
56
- } from "./chunk-QHH4TCVE.js";
56
+ } from "./chunk-VR67JXVN.js";
57
57
  import {
58
58
  parseJsonc
59
59
  } from "./chunk-QXFCZON7.js";
@@ -5771,10 +5771,19 @@ var VitestAdapter = class extends BaseAdapter {
5771
5771
  const { options: typedOptions, paths: typedPaths } = splitToolArgs(ctx.cwd, ctx.toolArgs, {
5772
5772
  valueFlags: ["--config", "-c"]
5773
5773
  });
5774
- const { cwd: runFrom, options, paths } = fromWorkspaceRoot(ctx.cwd, typedOptions, typedPaths);
5774
+ const {
5775
+ cwd: runFrom,
5776
+ options,
5777
+ paths,
5778
+ env: movedEnv
5779
+ } = fromWorkspaceRoot(ctx.cwd, typedOptions, typedPaths);
5775
5780
  const watching = options.includes("--watch") || options.includes("-w");
5776
5781
  const argv = watching ? [...options, ...paths] : ["run", ...options, ...paths];
5777
- const result = spawnSync(bin, argv, { cwd: runFrom, stdio: "inherit" });
5782
+ const result = spawnSync(bin, argv, {
5783
+ cwd: runFrom,
5784
+ env: { ...process.env, ...movedEnv },
5785
+ stdio: "inherit"
5786
+ });
5778
5787
  if (result.error) {
5779
5788
  this.say(`could not run vitest (${result.error.message})`);
5780
5789
  return Promise.resolve({ ok: false, code: 1 });
@@ -5790,7 +5799,7 @@ var VitestAdapter = class extends BaseAdapter {
5790
5799
  function fromWorkspaceRoot(moduleDir, options, paths) {
5791
5800
  const root = findWorkspaceRoot(moduleDir);
5792
5801
  if (root === void 0 || root === moduleDir) {
5793
- return { cwd: moduleDir, options: [...options], paths: [...paths] };
5802
+ return { cwd: moduleDir, options: [...options], paths: [...paths], env: {} };
5794
5803
  }
5795
5804
  const absolute = (value) => isAbsolute2(value) ? value : resolve9(moduleDir, value);
5796
5805
  const moved = [];
@@ -5809,7 +5818,8 @@ function fromWorkspaceRoot(moduleDir, options, paths) {
5809
5818
  cwd: root,
5810
5819
  // `--root` LAST, so a caller cannot be silently overridden by our own flag.
5811
5820
  options: [...moved, "--root", moduleDir],
5812
- paths: paths.map((path) => absolute(path))
5821
+ paths: paths.map((path) => absolute(path)),
5822
+ env: { INIT_CWD: root }
5813
5823
  };
5814
5824
  }
5815
5825
 
package/dist/index.js CHANGED
@@ -6,10 +6,10 @@ import {
6
6
  registerAdapters,
7
7
  resolve,
8
8
  setDefaultRunner
9
- } from "./chunk-HUFF7UQW.js";
9
+ } from "./chunk-QRQTA776.js";
10
10
  import {
11
11
  BaseAdapter
12
- } from "./chunk-QHH4TCVE.js";
12
+ } from "./chunk-VR67JXVN.js";
13
13
  import "./chunk-O7REVMOC.js";
14
14
  import "./chunk-QXFCZON7.js";
15
15
  import "./chunk-NW6UHNYX.js";
@@ -7,7 +7,7 @@ import {
7
7
  readTestAdoption,
8
8
  resolveVitest,
9
9
  suiteOf
10
- } from "./chunk-QHH4TCVE.js";
10
+ } from "./chunk-VR67JXVN.js";
11
11
  import "./chunk-O7REVMOC.js";
12
12
  import "./chunk-QXFCZON7.js";
13
13
  import "./chunk-NW6UHNYX.js";
@@ -29,7 +29,8 @@ function runVitest(cwd, config, extra = []) {
29
29
  {
30
30
  cwd: relocated.cwd,
31
31
  // The SAME environment the reference was taken in, or the two sides are two programs.
32
- env: moduleEnvironment(cwd).env,
32
+ // `relocated.env` last: moving the process is part of the run, not part of the module.
33
+ env: { ...moduleEnvironment(cwd).env, ...relocated.env },
33
34
  stdio: ["ignore", "ignore", "ignore"],
34
35
  maxBuffer: 1 << 28
35
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hublo/sentinel",
3
- "version": "1.4.0-alpha.45",
3
+ "version": "1.4.0-alpha.46",
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",