@systemfsoftware/stryker-js 10.0.1 → 10.1.0

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.
@@ -1,6 +1,6 @@
1
- import { B as ReporterFactory, Ct as RunMutantResult, K as StrykerOptions, P as PartialStrykerOptions, W as ReporterRpcs, X as TestResult, _ as ExitClass, at as WorkerPluginKind, ct as FileDescription, ft as Mutant, j as MutationTestResult, l as CompleteDryRunResult, lt as FileDescriptions, st as CoverageData, yt as MutateDescription } from "./index-D_mcApox.mjs";
1
+ import { B as ReporterFactory, Ct as RunMutantResult, K as StrykerOptions, P as PartialStrykerOptions, W as ReporterRpcs, X as TestResult, _ as ExitClass, at as WorkerPluginKind, ct as FileDescription, ft as Mutant, j as MutationTestResult, l as CompleteDryRunResult, lt as FileDescriptions, st as CoverageData, yt as MutateDescription } from "./index-BopuZXrl.mjs";
2
2
  import { r as ResolvedMode } from "./output-mode-CfGHDpi5.mjs";
3
- import { _ as RunStarted, c as PhaseEntered, i as HelpRendered, l as PlanKnown, m as RunMutantTested, p as RunFailed, r as Heartbeat, x as VerdictReached } from "./Run.schema-t292QQGe.mjs";
3
+ import { _ as RunStarted, c as PhaseEntered, i as HelpRendered, l as PlanKnown, m as RunMutantTested, p as RunFailed, r as Heartbeat, x as VerdictReached } from "./Run.schema-RWUb38ZE.mjs";
4
4
  import * as Effect$1 from "effect/Effect";
5
5
  import * as FileSystem from "effect/FileSystem";
6
6
  import * as Path from "effect/Path";
@@ -1,5 +1,5 @@
1
- import { P as PartialStrykerOptions } from "./index-D_mcApox.mjs";
2
- import { t as MutationTestDone } from "./mutation-test.cell-Dp6QiuRg.mjs";
1
+ import { P as PartialStrykerOptions } from "./index-BopuZXrl.mjs";
2
+ import { t as MutationTestDone } from "./mutation-test.cell-CobzlfL-.mjs";
3
3
  //#region src/promises/index.d.ts
4
4
  export declare const run: (options: PartialStrykerOptions, targetMutatePatterns?: readonly string[]) => Promise<MutationTestDone>;
5
5
  //#endregion
package/dist/promises.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as strykerCell } from "./src-CMHnl87m.mjs";
1
+ import { t as strykerCell } from "./src-Baq6uz-6.mjs";
2
2
  import * as Layer from "effect/Layer";
3
3
  import * as NodeFileSystem from "@effect/platform-node-shared/NodeFileSystem";
4
4
  import * as NodePath from "@effect/platform-node-shared/NodePath";
@@ -1,4 +1,4 @@
1
- import { $ as WorkerPluginKind, F as MutationTestingPlanReady, G as TRACEPARENT_HEADER, I as NonNegativeInt, J as TestRunnerFailed, K as TRACESTATE_HEADER, L as PropagatedTrace, M as MutantTested, N as MutationTestReportReady, O as Metrics, P as MutationTestResultSchema$1, Q as WorkerEntryUrl, S as CheckerMutantWire, T as DryRunCompleted, U as ReporterRpcs, V as ReporterFailed, W as StrykerOptionsSchema, X as TraceContextMiddleware, Y as TestRunnerRpcs, Z as TraceContextReference, _ as RunStarted, c as PhaseEntered, dt as errorToString, et as formatTraceparent, f as RunEvent, ft as instrument, it as INSTRUMENTER_CONSTANTS, k as MetricsResultSchema, l as PlanKnown, m as RunMutantTested, n as StageError, nt as parseTraceparent, ot as Mutant, pt as normalizeFileName$4, r as Heartbeat, rt as toMutantRunResult, t as PrepareError, tt as isCustomTestRunner, ut as disableTypeChecks, v as VerdictReached, w as CheckerRpcs } from "./Run.schema-CgVfoOfk.mjs";
1
+ import { $ as WorkerEntryUrl, F as MutationTestingPlanReady, G as TRACEPARENT_HEADER, I as NonNegativeInt, J as TestRunnerFailed, K as TRACESTATE_HEADER, L as PropagatedTrace, M as MutantTested, N as MutationTestReportReady, O as Metrics, P as MutationTestResultSchema$1, Q as WALL_CLOCK_TIMEOUT_REASON, S as CheckerMutantWire, T as DryRunCompleted, U as ReporterRpcs, V as ReporterFailed, W as StrykerOptionsSchema, X as TraceContextMiddleware, Y as TestRunnerRpcs, Z as TraceContextReference, _ as RunStarted, at as wallClockTimeoutStopsRun, c as PhaseEntered, ct as Mutant, et as WorkerPluginKind, f as RunEvent, ft as disableTypeChecks, ht as normalizeFileName$4, it as toMutantRunResult, k as MetricsResultSchema, l as PlanKnown, m as RunMutantTested, mt as instrument, n as StageError, nt as isCustomTestRunner, ot as INSTRUMENTER_CONSTANTS, pt as errorToString, r as Heartbeat, rt as parseTraceparent, t as PrepareError, tt as formatTraceparent, v as VerdictReached, w as CheckerRpcs } from "./Run.schema-B0ERLxQj.mjs";
2
2
  import { t as mergeConfig } from "./merge-config-BrrNQWje.mjs";
3
3
  import * as Effect$1 from "effect/Effect";
4
4
  import * as FileSystem from "effect/FileSystem";
@@ -345,9 +345,18 @@ const calculateTotalTimeForIds = (testIds, testTimeById) => testIds.reduce((acc,
345
345
  if (t !== void 0) return acc + t;
346
346
  return acc;
347
347
  }, 0);
348
+ const hitLimitForCount = (hitCount) => hitCount * 100;
349
+ const coveredWhenKnown = (covered, coverageKnown) => {
350
+ if (!coverageKnown) return false;
351
+ return covered;
352
+ };
353
+ const isMissingHitCount = (hitCount, covered, coverageKnown) => {
354
+ if (!coveredWhenKnown(covered, coverageKnown)) return false;
355
+ return hitCount === void 0;
356
+ };
348
357
  const getHitLimit = (hitCount) => {
349
358
  if (hitCount === void 0) return;
350
- return hitCount * 100;
359
+ return hitLimitForCount(hitCount);
351
360
  };
352
361
  const getMutantActivation = (testFilter) => {
353
362
  if (testFilter !== void 0) return "runtime";
@@ -407,6 +416,16 @@ const planForStaticallyCovered = (mutant, command, isStatic) => {
407
416
  const useCovered = Match.value(isStatic).pipe(Match.when(false, () => true), Match.orElse(() => ignoreStatic && tests.length > ZERO));
408
417
  return Match.value(useCovered).pipe(Match.when(true, () => toRunPlan(mutant, command, calculateTotalTimeForIds(tests, command.testTimeById), coveredBy, isStatic, coveredBy)), Match.orElse(() => Match.value(ignoreStatic).pipe(Match.when(true, () => toEarlyResultPlan(mutant, isStatic, "Ignored", "Static mutant (and \"ignoreStatic\" was enabled)", coveredBy)), Match.orElse(() => toRunPlan(mutant, command, command.timeSpentAllTests, getTestFilter(command.globalTestFilter), isStatic, coveredBy)))));
409
418
  };
419
+ const hasCoveringTests = (tests) => {
420
+ if (tests === void 0) return false;
421
+ return tests.length > 0;
422
+ };
423
+ const mutantIsCovered = (command, mutantId) => {
424
+ if (hasCoveringTests(command.testsByMutantId[mutantId])) return true;
425
+ return hasStaticCoverageForPlan(command.staticCoverage, mutantId);
426
+ };
427
+ const coverageKnown = (command) => command.staticCoverage !== void 0;
428
+ const boundFor = (command, mutant) => isMissingHitCount(command.hitsByMutantId[mutant.id], mutantIsCovered(command, mutant.id), coverageKnown(command));
410
429
  const decidePlanForMutant = (mutant, command) => {
411
430
  const isStatic = hasStaticCoverageForPlan(command.staticCoverage, mutant.id);
412
431
  return Option.match(Option.fromUndefinedOr(mutant.status), {
@@ -414,6 +433,15 @@ const decidePlanForMutant = (mutant, command) => {
414
433
  onNone: () => Match.value(hasCoverageForPlan(command.staticCoverage)).pipe(Match.when(true, () => planForStaticallyCovered(mutant, command, isStatic)), Match.orElse(() => toRunPlan(mutant, command, command.timeSpentAllTests, getTestFilter(command.globalTestFilter), void 0, void 0)))
415
434
  });
416
435
  };
436
+ const isClosedMutant = (mutant) => mutant.status !== void 0;
437
+ const missingIdOf = (command, mutant) => {
438
+ if (!boundFor(command, mutant)) return [];
439
+ return [mutant.id];
440
+ };
441
+ const missingHitCountIds = (command) => command.mutants.flatMap((mutant) => {
442
+ if (isClosedMutant(mutant)) return [];
443
+ return missingIdOf(command, mutant);
444
+ });
417
445
  const planMutantTests = (command) => {
418
446
  const plans = command.mutants.map((mutant) => decidePlanForMutant(mutant, command));
419
447
  return {
@@ -510,15 +538,28 @@ const materializePlan = (plan, original) => {
510
538
  }
511
539
  };
512
540
  };
541
+ const missingHitFailure = (missing) => {
542
+ if (missing.length === 0) return;
543
+ return Effect$1.fail(StageError.make({
544
+ stage: "mutationTest",
545
+ reason: `covered mutant missing dry-run hit count: ${missing.join(", ")}`
546
+ }));
547
+ };
548
+ const mutantsById = (mutants) => {
549
+ const byId = /* @__PURE__ */ new Map();
550
+ for (const mutant of mutants) byId.set(mutant.id, mutant);
551
+ return byId;
552
+ };
553
+ const materializeKnown = (plan, byId) => {
554
+ const original = byId.get(plan.mutantId);
555
+ if (original === void 0) return Effect$1.die(/* @__PURE__ */ new Error(`planner returned an unknown mutant id: ${plan.mutantId}`));
556
+ return Effect$1.succeed(materializePlan(plan, original));
557
+ };
513
558
  const makeMutantTestPlanner = (command) => {
559
+ const failed = missingHitFailure(missingHitCountIds(command));
560
+ if (failed !== void 0) return failed;
514
561
  const { plans } = planMutantTests(command);
515
- const byId = /* @__PURE__ */ new Map();
516
- for (const mutant of command.mutants) byId.set(mutant.id, mutant);
517
- return Effect$1.forEach(plans, (plan) => {
518
- const original = byId.get(plan.mutantId);
519
- if (original === void 0) return Effect$1.die(/* @__PURE__ */ new Error(`planner returned an unknown mutant id: ${plan.mutantId}`));
520
- return Effect$1.succeed(materializePlan(plan, original));
521
- });
562
+ return Effect$1.forEach(plans, (plan) => materializeKnown(plan, mutantsById(command.mutants)));
522
563
  };
523
564
  const decidePlans = (mutants, testCoverage, options, timeOverheadMS, globalTestFilter, sandboxFileByName) => {
524
565
  const command = coverageToCommand(mutants, testCoverage, options, timeOverheadMS, globalTestFilter, sandboxFileByName);
@@ -1338,18 +1379,25 @@ const withTimeout = (inner) => ({
1338
1379
  dryRun: (options) => {
1339
1380
  const policy = Effect$1.timeoutOrElse({
1340
1381
  duration: Duration.millis(options.timeout),
1341
- orElse: () => Effect$1.succeed({ status: "timeout" })
1382
+ orElse: () => Effect$1.succeed({
1383
+ status: "timeout",
1384
+ reason: WALL_CLOCK_TIMEOUT_REASON
1385
+ })
1342
1386
  });
1343
1387
  return inner.dryRun(options).pipe(policy);
1344
1388
  },
1345
1389
  mutantRun: (options) => {
1346
1390
  const policy = Effect$1.timeoutOrElse({
1347
1391
  duration: Duration.millis(options.timeout),
1348
- orElse: () => Effect$1.succeed({ status: "timeout" })
1392
+ orElse: () => Effect$1.succeed({
1393
+ status: "timeout",
1394
+ reason: WALL_CLOCK_TIMEOUT_REASON
1395
+ })
1349
1396
  });
1350
1397
  return inner.mutantRun(options).pipe(policy);
1351
1398
  }
1352
1399
  });
1400
+ const invalidatesRunnerPool = (status, reason) => status === "timeout" && reason === "wall-clock-timeout";
1353
1401
  /**
1354
1402
  * Retry a run whose runner crashed, and report the crash as a result once the
1355
1403
  * attempts are spent.
@@ -2845,7 +2893,7 @@ const decide = (command) => Option.match(Option.fromUndefinedOr(command.report),
2845
2893
  const admitIncrementalReport = Workflow.total(AdmitIncrementalReportCommand, (command) => Result.succeed(decide(command)));
2846
2894
  //#endregion
2847
2895
  //#region src/stryker-package.ts
2848
- const strykerVersion = "10.0.1";
2896
+ const strykerVersion = "10.1.0";
2849
2897
  //#endregion
2850
2898
  //#region src/incremental-report.cell.ts
2851
2899
  const parseAndDecodeIncrementalReport = S.decodeUnknownResult(S.fromJsonString(IncrementalReportSchema));
@@ -5079,6 +5127,15 @@ const reportDroppedMutants = (dropped) => Match.value(dropped.length).pipe(Match
5079
5127
  yield* Metric.update(checkerMutantsSkipped, dropped.length);
5080
5128
  yield* Effect$1.logWarning(`${dropped.length} mutant(s) cannot be described to a checker and were left out of the run (${droppedIdsOf(dropped)})`);
5081
5129
  })));
5130
+ const hasStringReason = (r) => "reason" in r && typeof r.reason === "string";
5131
+ const reasonOf = (result) => Match.value(result).pipe(Match.when((r) => typeof r === "object" && r !== null, (r) => Match.value(r).pipe(Match.when(hasStringReason, (obj) => obj.reason), Match.orElse(() => void 0))), Match.orElse(() => void 0));
5132
+ const stopWallClock = (result) => {
5133
+ if (!wallClockTimeoutStopsRun(result.status, reasonOf(result))) return Effect$1.void;
5134
+ return Effect$1.fail(StageError.make({
5135
+ stage: "mutationTest",
5136
+ reason: WALL_CLOCK_TIMEOUT_REASON
5137
+ }));
5138
+ };
5082
5139
  const mutationTestCell$1 = Sandwich.read((command) => Effect$1.gen(function* () {
5083
5140
  yield* Scope.Scope;
5084
5141
  return { prev: command };
@@ -5295,6 +5352,15 @@ const mutationTestCell$1 = Sandwich.read((command) => Effect$1.gen(function* ()
5295
5352
  OutOfMemoryError: (error) => invalidateSlot(pool, runner, error),
5296
5353
  ChildProcessCrashedError: (error) => invalidateSlot(pool, runner, error)
5297
5354
  }));
5355
+ if (invalidatesRunnerPool(result.status, reasonOf(result))) return yield* invalidateSlot(pool, runner, ChildProcessCrashedError.make({
5356
+ pid: 0,
5357
+ exit: {
5358
+ _tag: "Signal",
5359
+ signal: "SIGKILL"
5360
+ },
5361
+ cause: "wall-clock timeout"
5362
+ }));
5363
+ yield* stopWallClock(result);
5298
5364
  const reported = yield* reporting.reportMutantRunResult(toReportedMutant(plan.mutant), result);
5299
5365
  const prepared = preparedStreamableOf(reported);
5300
5366
  const finished = yield* offerFinished(reported, prepared);
@@ -1,7 +1,7 @@
1
1
  import { a as __require, n as __esmMin, o as __toCommonJS, r as __exportAll, s as __toESM, t as __commonJSMin } from "./rolldown-runtime-Dr7-SnC6.mjs";
2
2
  import path from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
- //#region ../../node_modules/.pnpm/tsdown@0.23.0_typescript@7.0.2/node_modules/tsdown/esm-shims.js
4
+ //#region ../../node_modules/.pnpm/tsdown@0.23.0_tsx@4.23.15_typescript@7.0.2/node_modules/tsdown/esm-shims.js
5
5
  var getFilename, getDirname, __dirname, __filename;
6
6
  var init_esm_shims = __esmMin((() => {
7
7
  getFilename = () => fileURLToPath(import.meta.url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@systemfsoftware/stryker-js",
3
- "version": "10.0.1",
3
+ "version": "10.1.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/systemfsoftware/stryker-js-effect.git",
@@ -28,11 +28,11 @@
28
28
  "@effect/platform-node-shared": "4.0.0-rc.116",
29
29
  "@noble/hashes": "^2",
30
30
  "@opentelemetry/api": "^1.9.0",
31
- "@opentelemetry/exporter-metrics-otlp-http": "^0.208.0",
32
- "@opentelemetry/exporter-trace-otlp-http": "^0.208.0",
33
- "@opentelemetry/sdk-metrics": "^2.2.0",
31
+ "@opentelemetry/exporter-metrics-otlp-http": "^0.222.0",
32
+ "@opentelemetry/exporter-trace-otlp-http": "^0.222.0",
33
+ "@opentelemetry/sdk-metrics": "^2.11.0",
34
34
  "@opentelemetry/sdk-trace-base": "^2.2.0",
35
- "@systemfsoftware/effect-cell-types": "^8.3.1"
35
+ "@systemfsoftware/effect-cell-types": "^8.3.2"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "effect": "4.0.0-rc.116"
@@ -43,22 +43,22 @@
43
43
  "@microsoft/api-extractor": "^7",
44
44
  "@oxc-parser/binding-wasm32-wasi": "^0.150.0",
45
45
  "@std/jsonc": "npm:@jsr/std__jsonc@^1",
46
- "@systemfsoftware/all": "^2.1.1",
47
46
  "@systemfsoftware/arethetypeswrong-cli": "^4.2.0",
48
- "@systemfsoftware/effect-gherkin-spec": "^4.1.0",
49
- "@systemfsoftware/effect-schema-law": "^2.2.0",
50
- "@systemfsoftware/effect-schema-vite": "^2.2.0",
47
+ "@systemfsoftware/effect-gherkin-spec": "^4.2.1",
48
+ "@systemfsoftware/effect-schema-law": "^2.2.1",
49
+ "@systemfsoftware/effect-schema-vite": "^2.2.1",
50
+ "@systemfsoftware/oxlint-config-recommended": "^1.0.0",
51
51
  "@systemfsoftware/stryker-ignorer-effect-schema-declarations": "latest",
52
52
  "@systemfsoftware/stryker-ignorer-in-source-vitest-block": "latest",
53
53
  "@systemfsoftware/stryker-js": "latest",
54
54
  "@systemfsoftware/stryker-js-typescript-checker": "latest",
55
55
  "@systemfsoftware/stryker-js-vitest-runner": "latest",
56
56
  "@systemfsoftware/stryker-test-contribution": "latest",
57
- "@systemfsoftware/tsconfig": "^1.3.5",
57
+ "@systemfsoftware/tsconfig": "^1.3.6",
58
58
  "@types/node": "^24",
59
59
  "@vitest/coverage-v8": "^5",
60
60
  "concurrently": "^10",
61
- "mutation-testing-elements": "3.7.3",
61
+ "mutation-testing-elements": "3.9.0",
62
62
  "oxc-parser": "^0.150.0",
63
63
  "oxlint": "^1",
64
64
  "oxlint-tsgolint": "^7",
@@ -69,11 +69,11 @@
69
69
  "@systemfsoftware/stryker-config": "^0.1.0",
70
70
  "@systemfsoftware/stryker-ignorer-interface": "^0.1.1",
71
71
  "@systemfsoftware/stryker-js-html-reporter": "^4.0.4",
72
- "@systemfsoftware/stryker-js-instrumenter": "^8.0.0",
72
+ "@systemfsoftware/stryker-js-instrumenter": "^8.0.1",
73
+ "@systemfsoftware/stryker-js-plugin-interface": "^7.2.0",
73
74
  "@systemfsoftware/stryker-js-plugin-runtime": "^5.0.3",
74
- "@systemfsoftware/stryker-js-plugin-interface": "^7.1.1",
75
- "@systemfsoftware/tsdown-config": "^0.1.0",
76
- "@systemfsoftware/vitest-config": "^0.1.0"
75
+ "@systemfsoftware/vitest-config": "^0.1.0",
76
+ "@systemfsoftware/tsdown-config": "^0.1.0"
77
77
  },
78
78
  "publishConfig": {
79
79
  "access": "public",
@@ -108,7 +108,7 @@
108
108
  "@jsr/std__jsonc": "1.0.2",
109
109
  "@sveltejs/acorn-typescript": "1.0.13",
110
110
  "acorn": "8.18.0",
111
- "angular-html-parser": "10.4.0",
111
+ "angular-html-parser": "10.12.0",
112
112
  "aria-query": "5.3.1",
113
113
  "axobject-query": "4.1.0",
114
114
  "esrap": "2.3.7",
@@ -117,7 +117,7 @@
117
117
  "magic-string": "0.30.21",
118
118
  "oxc-parser": "0.150.0",
119
119
  "oxc-walker": "1.1.1",
120
- "svelte": "5.55.1",
120
+ "svelte": "5.57.0",
121
121
  "zimmerframe": "1.1.5"
122
122
  },
123
123
  "scripts": {
@@ -1,10 +0,0 @@
1
- import { a as __require, t as __commonJSMin } from "./rolldown-runtime-Dr7-SnC6.mjs";
2
- //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.2.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js
3
- var require_execAsync = /* @__PURE__ */ __commonJSMin(((exports) => {
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.execAsync = void 0;
6
- const child_process = __require("child_process");
7
- exports.execAsync = __require("util").promisify(child_process.exec);
8
- }));
9
- //#endregion
10
- export { require_execAsync as t };
@@ -1,27 +0,0 @@
1
- import { a as __require, o as __toCommonJS, t as __commonJSMin } from "./rolldown-runtime-Dr7-SnC6.mjs";
2
- import { n as init_esm, t as esm_exports } from "./main.mjs";
3
- import { t as require_execAsync } from "./execAsync-CfPZgJSD.mjs";
4
- //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.2.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js
5
- var require_getMachineId_bsd = /* @__PURE__ */ __commonJSMin(((exports) => {
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getMachineId = void 0;
8
- const fs_1 = __require("fs");
9
- const execAsync_1 = require_execAsync();
10
- const api_1 = (init_esm(), __toCommonJS(esm_exports));
11
- async function getMachineId() {
12
- try {
13
- return (await fs_1.promises.readFile("/etc/hostid", { encoding: "utf8" })).trim();
14
- } catch (e) {
15
- api_1.diag.debug(`error reading machine id: ${e}`);
16
- }
17
- try {
18
- return (await (0, execAsync_1.execAsync)("kenv -q smbios.system.uuid")).stdout.trim();
19
- } catch (e) {
20
- api_1.diag.debug(`error reading machine id: ${e}`);
21
- }
22
- }
23
- exports.getMachineId = getMachineId;
24
- }));
25
- //#endregion
26
- export default require_getMachineId_bsd();
27
- export {};
@@ -1,24 +0,0 @@
1
- import { o as __toCommonJS, t as __commonJSMin } from "./rolldown-runtime-Dr7-SnC6.mjs";
2
- import { n as init_esm, t as esm_exports } from "./main.mjs";
3
- import { t as require_execAsync } from "./execAsync-CfPZgJSD.mjs";
4
- //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.2.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js
5
- var require_getMachineId_darwin = /* @__PURE__ */ __commonJSMin(((exports) => {
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getMachineId = void 0;
8
- const execAsync_1 = require_execAsync();
9
- const api_1 = (init_esm(), __toCommonJS(esm_exports));
10
- async function getMachineId() {
11
- try {
12
- const idLine = (await (0, execAsync_1.execAsync)("ioreg -rd1 -c \"IOPlatformExpertDevice\"")).stdout.split("\n").find((line) => line.includes("IOPlatformUUID"));
13
- if (!idLine) return;
14
- const parts = idLine.split("\" = \"");
15
- if (parts.length === 2) return parts[1].slice(0, -1);
16
- } catch (e) {
17
- api_1.diag.debug(`error reading machine id: ${e}`);
18
- }
19
- }
20
- exports.getMachineId = getMachineId;
21
- }));
22
- //#endregion
23
- export default require_getMachineId_darwin();
24
- export {};
@@ -1,20 +0,0 @@
1
- import { a as __require, o as __toCommonJS, t as __commonJSMin } from "./rolldown-runtime-Dr7-SnC6.mjs";
2
- import { n as init_esm, t as esm_exports } from "./main.mjs";
3
- //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.2.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js
4
- var require_getMachineId_linux = /* @__PURE__ */ __commonJSMin(((exports) => {
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getMachineId = void 0;
7
- const fs_1 = __require("fs");
8
- const api_1 = (init_esm(), __toCommonJS(esm_exports));
9
- async function getMachineId() {
10
- for (const path of ["/etc/machine-id", "/var/lib/dbus/machine-id"]) try {
11
- return (await fs_1.promises.readFile(path, { encoding: "utf8" })).trim();
12
- } catch (e) {
13
- api_1.diag.debug(`error reading machine id: ${e}`);
14
- }
15
- }
16
- exports.getMachineId = getMachineId;
17
- }));
18
- //#endregion
19
- export default require_getMachineId_linux();
20
- export {};
@@ -1,15 +0,0 @@
1
- import { o as __toCommonJS, t as __commonJSMin } from "./rolldown-runtime-Dr7-SnC6.mjs";
2
- import { n as init_esm, t as esm_exports } from "./main.mjs";
3
- //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.2.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js
4
- var require_getMachineId_unsupported = /* @__PURE__ */ __commonJSMin(((exports) => {
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getMachineId = void 0;
7
- const api_1 = (init_esm(), __toCommonJS(esm_exports));
8
- async function getMachineId() {
9
- api_1.diag.debug("could not read machine-id: unsupported platform");
10
- }
11
- exports.getMachineId = getMachineId;
12
- }));
13
- //#endregion
14
- export default require_getMachineId_unsupported();
15
- export {};
@@ -1,26 +0,0 @@
1
- import { a as __require, o as __toCommonJS, t as __commonJSMin } from "./rolldown-runtime-Dr7-SnC6.mjs";
2
- import { n as init_esm, t as esm_exports } from "./main.mjs";
3
- import { t as require_execAsync } from "./execAsync-CfPZgJSD.mjs";
4
- //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.2.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js
5
- var require_getMachineId_win = /* @__PURE__ */ __commonJSMin(((exports) => {
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getMachineId = void 0;
8
- const process = __require("process");
9
- const execAsync_1 = require_execAsync();
10
- const api_1 = (init_esm(), __toCommonJS(esm_exports));
11
- async function getMachineId() {
12
- const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid";
13
- let command = "%windir%\\System32\\REG.exe";
14
- if (process.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process.env) command = "%windir%\\sysnative\\cmd.exe /c " + command;
15
- try {
16
- const parts = (await (0, execAsync_1.execAsync)(`${command} ${args}`)).stdout.split("REG_SZ");
17
- if (parts.length === 2) return parts[1].trim();
18
- } catch (e) {
19
- api_1.diag.debug(`error reading machine id: ${e}`);
20
- }
21
- }
22
- exports.getMachineId = getMachineId;
23
- }));
24
- //#endregion
25
- export default require_getMachineId_win();
26
- export {};