@itwin/build-tools 5.1.0-dev.3 → 5.1.0-dev.31

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/CHANGELOG.md CHANGED
@@ -1,6 +1,36 @@
1
1
  # Change Log - @itwin/build-tools
2
2
 
3
- This log was last generated on Thu, 10 Apr 2025 17:50:15 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 03 Jun 2025 16:18:10 GMT and should not be manually modified.
4
+
5
+ ## 4.11.4
6
+ Tue, 03 Jun 2025 16:15:19 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 4.11.3
11
+ Wed, 28 May 2025 13:56:22 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 4.11.2
16
+ Tue, 20 May 2025 20:14:45 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 4.11.1
21
+ Wed, 30 Apr 2025 13:13:21 GMT
22
+
23
+ _Version update only_
24
+
25
+ ## 4.11.0
26
+ Wed, 16 Apr 2025 15:50:28 GMT
27
+
28
+ ### Updates
29
+
30
+ - Bump `typedoc` dependency to a version that supports typescript `5.6`.
31
+ - Deprecate unused --includes flag
32
+ - add temporary fix for typedoc@0.26 issue #2802
33
+ - Bumped `cross-spawn` to `7.0.5`
4
34
 
5
35
  ## 4.10.13
6
36
  Thu, 10 Apr 2025 17:47:21 GMT
@@ -57,9 +57,54 @@ Object.defineProperty(Base, "color", {
57
57
  });
58
58
  class BentleyMochaReporter extends Spec {
59
59
  _junitReporter;
60
+ _chrome = false;
61
+ _electron = true;
60
62
  constructor(_runner, _options) {
61
63
  super(...arguments);
62
64
  this._junitReporter = new MochaJUnitReporter(...arguments);
65
+ // Detect hangs caused by tests that leave timers/other handles open - not possible in electron frontends.
66
+ if (!("electron" in process.versions)) {
67
+ this._electron = false;
68
+ if (process.argv.length > 1 && process.argv[1].endsWith("certa.js")) {
69
+ for (let i = 2; i < process.argv.length; ++i) {
70
+ if (process.argv[i] === "-r") {
71
+ if (i + 1 < process.argv.length && process.argv[i + 1] === "chrome") {
72
+ this._chrome = true;
73
+ process.on("chrome-test-runner-done", () => {
74
+ this.confirmExit();
75
+ });
76
+ }
77
+ break;
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+ confirmExit(seconds = 30) {
84
+ // NB: By calling unref() on this timer, we stop it from keeping the process alive, so it will only fire if _something else_ is still keeping
85
+ // the process alive after n seconds. This also has the benefit of preventing the timer from showing up in wtfnode's dump of open handles.
86
+ setTimeout(() => {
87
+ logBuildError(`Handle leak detected. Node was still running ${seconds} seconds after tests completed.`);
88
+ if (debugLeaks) {
89
+ const wtf = require("wtfnode");
90
+ wtf.setLogger("info", console.error);
91
+ wtf.dump();
92
+ let activeResourcesInfo = process.getActiveResourcesInfo(); // https://nodejs.dev/en/api/v18/process#processgetactiveresourcesinfo (Not added to @types/node yet I suppose)
93
+ console.error(activeResourcesInfo);
94
+ activeResourcesInfo = activeResourcesInfo.map((value) => value.toLowerCase());
95
+ // asyncResourceStats.set(asyncId, {before: 0, after: 0, type, eid, triggerAsyncId, initStack: stack});
96
+ asyncResourceStats.forEach((value, key) => {
97
+ if (activeResourcesInfo.includes(value.type.toLowerCase())) {
98
+ console.error(`asyncId: ${key}: type: ${value.type}, eid: ${value.eid},triggerAsyncId: ${value.triggerAsyncId}, initStack: ${value.initStack}`);
99
+ }
100
+ });
101
+ }
102
+ else {
103
+ console.error("Try running with the DEBUG_LEAKS env var set to see open handles.");
104
+ }
105
+ // Not sure why, but process.exit(1) wasn't working here...
106
+ process.kill(process.pid);
107
+ }, seconds * 1000).unref();
63
108
  }
64
109
  epilogue(...args) {
65
110
  // Force test errors to be printed to stderr instead of stdout.
@@ -77,31 +122,9 @@ class BentleyMochaReporter extends Spec {
77
122
  }
78
123
  }
79
124
  // Detect hangs caused by tests that leave timers/other handles open - not possible in electron frontends.
80
- if (!("electron" in process.versions)) {
81
- // NB: By calling unref() on this timer, we stop it from keeping the process alive, so it will only fire if _something else_ is still keeping
82
- // the process alive after 30 seconds. This also has the benefit of preventing the timer from showing up in wtfnode's dump of open handles.
83
- setTimeout(() => {
84
- logBuildError(`Handle leak detected. Node was still running 30 seconds after tests completed.`);
85
- if (debugLeaks) {
86
- const wtf = require("wtfnode");
87
- wtf.setLogger("info", console.error);
88
- wtf.dump();
89
- let activeResourcesInfo = process.getActiveResourcesInfo(); // https://nodejs.dev/en/api/v18/process#processgetactiveresourcesinfo (Not added to @types/node yet I suppose)
90
- console.error(activeResourcesInfo);
91
- activeResourcesInfo = activeResourcesInfo.map((value) => value.toLowerCase());
92
- // asyncResourceStats.set(asyncId, {before: 0, after: 0, type, eid, triggerAsyncId, initStack: stack});
93
- asyncResourceStats.forEach((value, key) => {
94
- if (activeResourcesInfo.includes(value.type.toLowerCase())) {
95
- console.error(`asyncId: ${key}: type: ${value.type}, eid: ${value.eid},triggerAsyncId: ${value.triggerAsyncId}, initStack: ${value.initStack}`);
96
- }
97
- });
98
- }
99
- else {
100
- console.error("Try running with the DEBUG_LEAKS env var set to see open handles.");
101
- }
102
- // Not sure why, but process.exit(1) wasn't working here...
103
- process.kill(process.pid);
104
- }, 30 * 1000).unref();
125
+ if (!this._electron && !this._chrome) {
126
+ // Not running in Chrome or Electron, so check for open handles.
127
+ this.confirmExit(30);
105
128
  }
106
129
  if (!this.stats.pending)
107
130
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/build-tools",
3
- "version": "5.1.0-dev.3",
3
+ "version": "5.1.0-dev.31",
4
4
  "description": "Bentley build tools",
5
5
  "license": "MIT",
6
6
  "repository": {