@itwin/build-tools 3.7.8 → 3.7.9

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,11 @@
1
1
  # Change Log - @itwin/build-tools
2
2
 
3
- This log was last generated on Thu, 01 Jun 2023 17:00:39 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 20 Jun 2023 12:51:02 GMT and should not be manually modified.
4
+
5
+ ## 3.7.9
6
+ Tue, 20 Jun 2023 12:51:02 GMT
7
+
8
+ _Version update only_
4
9
 
5
10
  ## 3.7.8
6
11
  Thu, 01 Jun 2023 17:00:39 GMT
@@ -1,97 +1,97 @@
1
- "use strict";
2
- var _a, _b;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- /*---------------------------------------------------------------------------------------------
5
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
- * See LICENSE.md in the project root for license terms and full copyright notice.
7
- *--------------------------------------------------------------------------------------------*/
8
- /* eslint-disable @typescript-eslint/naming-convention */
9
- /* eslint-disable @typescript-eslint/no-var-requires */
10
- /* eslint-disable no-console */
11
- const debugLeaks = process.env.DEBUG_LEAKS;
12
- if (debugLeaks)
13
- require("wtfnode");
14
- const path = require("path");
15
- const fs = require("fs-extra");
16
- const { logBuildWarning, logBuildError, failBuild } = require("../scripts/utils/utils");
17
- const Base = require("mocha/lib/reporters/base");
18
- const Spec = require("mocha/lib/reporters/spec");
19
- const MochaJUnitReporter = require("mocha-junit-reporter");
20
- function withStdErr(callback) {
21
- const originalConsoleLog = Base.consoleLog;
22
- Base.consoleLog = console.error;
23
- callback();
24
- Base.consoleLog = originalConsoleLog;
25
- }
26
- const isCI = process.env.CI || process.env.TF_BUILD;
27
- // Force rush test to fail CI builds if describe.only or it.only is used.
28
- // These should only be used for debugging and must not be committed, otherwise we may be accidentally skipping lots of tests.
29
- if (isCI) {
30
- if (typeof (mocha) !== "undefined")
31
- mocha.forbidOnly();
32
- else
33
- require.cache[require.resolve("mocha/lib/mocharc.json", { paths: (_b = (_a = require.main) === null || _a === void 0 ? void 0 : _a.paths) !== null && _b !== void 0 ? _b : module.paths })].exports.forbidOnly = true;
34
- }
35
- // This is necessary to enable colored output when running in rush test:
36
- Object.defineProperty(Base, "color", {
37
- get: () => process.env.FORCE_COLOR !== "false" && process.env.FORCE_COLOR !== "0",
38
- set: () => { },
39
- });
40
- class BentleyMochaReporter extends Spec {
41
- constructor(_runner, _options) {
42
- super(...arguments);
43
- this._junitReporter = new MochaJUnitReporter(...arguments);
44
- }
45
- epilogue(...args) {
46
- // Force test errors to be printed to stderr instead of stdout.
47
- // This will allow rush to correctly summarize test failure when running rush test.
48
- if (this.stats.failures) {
49
- withStdErr(() => super.epilogue(...args));
50
- }
51
- else {
52
- super.epilogue(...args);
53
- if (0 === this.stats.passes) {
54
- logBuildError("There were 0 passing tests. That doesn't seem right."
55
- + "\nIf there are really no passing tests and no failures, then what was even the point?"
56
- + "\nIt seems likely that tests were skipped by it.only, it.skip, or grep filters, so I'm going to fail now.");
57
- failBuild();
58
- }
59
- }
60
- // Detect hangs caused by tests that leave timers/other handles open - not possible in electron frontends.
61
- if (!("electron" in process.versions)) {
62
- // 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
63
- // the process alive after 5 seconds. This also has the benefit of preventing the timer from showing up in wtfnode's dump of open handles.
64
- setTimeout(() => {
65
- logBuildError(`Handle leak detected. Node was still running 5 seconds after tests completed.`);
66
- if (debugLeaks) {
67
- const wtf = require("wtfnode");
68
- wtf.setLogger("info", console.error);
69
- wtf.dump();
70
- }
71
- else {
72
- console.error("Try running with the DEBUG_LEAKS env var set to see open handles.");
73
- }
74
- // Not sure why, but process.exit(1) wasn't working here...
75
- process.kill(process.pid);
76
- }, 5000).unref();
77
- }
78
- if (!this.stats.pending)
79
- return;
80
- // Also log warnings in CI builds when tests have been skipped.
81
- const currentPkgJson = path.join(process.cwd(), "package.json");
82
- if (fs.existsSync(currentPkgJson)) {
83
- const currentPackage = require(currentPkgJson).name;
84
- if (this.stats.pending === 1)
85
- logBuildWarning(`1 test skipped in ${currentPackage}`);
86
- else
87
- logBuildWarning(`${this.stats.pending} tests skipped in ${currentPackage}`);
88
- }
89
- else {
90
- if (this.stats.pending === 1)
91
- logBuildWarning(`1 test skipped`);
92
- else
93
- logBuildWarning(`${this.stats.pending} tests skipped`);
94
- }
95
- }
96
- }
97
- module.exports = BentleyMochaReporter;
1
+ "use strict";
2
+ var _a, _b;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /*---------------------------------------------------------------------------------------------
5
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
+ * See LICENSE.md in the project root for license terms and full copyright notice.
7
+ *--------------------------------------------------------------------------------------------*/
8
+ /* eslint-disable @typescript-eslint/naming-convention */
9
+ /* eslint-disable @typescript-eslint/no-var-requires */
10
+ /* eslint-disable no-console */
11
+ const debugLeaks = process.env.DEBUG_LEAKS;
12
+ if (debugLeaks)
13
+ require("wtfnode");
14
+ const path = require("path");
15
+ const fs = require("fs-extra");
16
+ const { logBuildWarning, logBuildError, failBuild } = require("../scripts/utils/utils");
17
+ const Base = require("mocha/lib/reporters/base");
18
+ const Spec = require("mocha/lib/reporters/spec");
19
+ const MochaJUnitReporter = require("mocha-junit-reporter");
20
+ function withStdErr(callback) {
21
+ const originalConsoleLog = Base.consoleLog;
22
+ Base.consoleLog = console.error;
23
+ callback();
24
+ Base.consoleLog = originalConsoleLog;
25
+ }
26
+ const isCI = process.env.CI || process.env.TF_BUILD;
27
+ // Force rush test to fail CI builds if describe.only or it.only is used.
28
+ // These should only be used for debugging and must not be committed, otherwise we may be accidentally skipping lots of tests.
29
+ if (isCI) {
30
+ if (typeof (mocha) !== "undefined")
31
+ mocha.forbidOnly();
32
+ else
33
+ require.cache[require.resolve("mocha/lib/mocharc.json", { paths: (_b = (_a = require.main) === null || _a === void 0 ? void 0 : _a.paths) !== null && _b !== void 0 ? _b : module.paths })].exports.forbidOnly = true;
34
+ }
35
+ // This is necessary to enable colored output when running in rush test:
36
+ Object.defineProperty(Base, "color", {
37
+ get: () => process.env.FORCE_COLOR !== "false" && process.env.FORCE_COLOR !== "0",
38
+ set: () => { },
39
+ });
40
+ class BentleyMochaReporter extends Spec {
41
+ constructor(_runner, _options) {
42
+ super(...arguments);
43
+ this._junitReporter = new MochaJUnitReporter(...arguments);
44
+ }
45
+ epilogue(...args) {
46
+ // Force test errors to be printed to stderr instead of stdout.
47
+ // This will allow rush to correctly summarize test failure when running rush test.
48
+ if (this.stats.failures) {
49
+ withStdErr(() => super.epilogue(...args));
50
+ }
51
+ else {
52
+ super.epilogue(...args);
53
+ if (0 === this.stats.passes) {
54
+ logBuildError("There were 0 passing tests. That doesn't seem right."
55
+ + "\nIf there are really no passing tests and no failures, then what was even the point?"
56
+ + "\nIt seems likely that tests were skipped by it.only, it.skip, or grep filters, so I'm going to fail now.");
57
+ failBuild();
58
+ }
59
+ }
60
+ // Detect hangs caused by tests that leave timers/other handles open - not possible in electron frontends.
61
+ if (!("electron" in process.versions)) {
62
+ // 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
63
+ // the process alive after 5 seconds. This also has the benefit of preventing the timer from showing up in wtfnode's dump of open handles.
64
+ setTimeout(() => {
65
+ logBuildError(`Handle leak detected. Node was still running 5 seconds after tests completed.`);
66
+ if (debugLeaks) {
67
+ const wtf = require("wtfnode");
68
+ wtf.setLogger("info", console.error);
69
+ wtf.dump();
70
+ }
71
+ else {
72
+ console.error("Try running with the DEBUG_LEAKS env var set to see open handles.");
73
+ }
74
+ // Not sure why, but process.exit(1) wasn't working here...
75
+ process.kill(process.pid);
76
+ }, 5000).unref();
77
+ }
78
+ if (!this.stats.pending)
79
+ return;
80
+ // Also log warnings in CI builds when tests have been skipped.
81
+ const currentPkgJson = path.join(process.cwd(), "package.json");
82
+ if (fs.existsSync(currentPkgJson)) {
83
+ const currentPackage = require(currentPkgJson).name;
84
+ if (this.stats.pending === 1)
85
+ logBuildWarning(`1 test skipped in ${currentPackage}`);
86
+ else
87
+ logBuildWarning(`${this.stats.pending} tests skipped in ${currentPackage}`);
88
+ }
89
+ else {
90
+ if (this.stats.pending === 1)
91
+ logBuildWarning(`1 test skipped`);
92
+ else
93
+ logBuildWarning(`${this.stats.pending} tests skipped`);
94
+ }
95
+ }
96
+ }
97
+ module.exports = BentleyMochaReporter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/build-tools",
3
- "version": "3.7.8",
3
+ "version": "3.7.9",
4
4
  "description": "Bentley build tools",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,7 +37,7 @@
37
37
  "yargs": "^17.4.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@itwin/eslint-plugin": "3.7.8",
40
+ "@itwin/eslint-plugin": "3.7.9",
41
41
  "@types/node": "18.11.5",
42
42
  "eslint": "^7.11.0"
43
43
  },