Update npm packages (73 packages including @jqhtml 2.3.36)

Update npm registry domain from privatenpm.hanson.xyz to npm.internal.hanson.xyz

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2026-02-20 11:31:28 +00:00
parent d01a6179aa
commit b5eb27a827
1690 changed files with 47348 additions and 16848 deletions

View File

@@ -36,6 +36,7 @@ __export(base_exports, {
formatRetry: () => formatRetry,
internalScreen: () => internalScreen,
kOutputSymbol: () => kOutputSymbol,
markErrorsAsReported: () => markErrorsAsReported,
nonTerminalScreen: () => nonTerminalScreen,
prepareErrorStack: () => prepareErrorStack,
relativeFilePath: () => relativeFilePath,
@@ -296,19 +297,37 @@ class TerminalReporter {
formatError(error) {
return formatError(this.screen, error);
}
formatResultErrors(test, result) {
return formatResultErrors(this.screen, test, result);
}
writeLine(line) {
this.screen.stdout?.write(line ? line + "\n" : "\n");
}
}
function formatResultErrors(screen, test, result) {
const lines = [];
if (test.outcome() === "unexpected") {
const errorDetails = formatResultFailure(screen, test, result, " ");
if (errorDetails.length > 0)
lines.push("");
for (const error of errorDetails)
lines.push(error.message, "");
}
return lines.join("\n");
}
function formatFailure(screen, config, test, index, options) {
const lines = [];
const header = formatTestHeader(screen, config, test, { indent: " ", index, mode: "error", includeTestId: options?.includeTestId });
lines.push(screen.colors.red(header));
let printedHeader = false;
for (const result of test.results) {
const resultLines = [];
const errors = formatResultFailure(screen, test, result, " ");
if (!errors.length)
continue;
if (!printedHeader) {
const header = formatTestHeader(screen, config, test, { indent: " ", index, mode: "error", includeTestId: options?.includeTestId });
lines.push(screen.colors.red(header));
printedHeader = true;
}
if (result.retry) {
resultLines.push("");
resultLines.push(screen.colors.gray(separator(screen, ` Retry #${result.retry}`)));
@@ -383,6 +402,10 @@ function quotePathIfNeeded(path2) {
return `"${path2}"`;
return path2;
}
const kReportedSymbol = Symbol("reported");
function markErrorsAsReported(result) {
result[kReportedSymbol] = result.errors.length;
}
function formatResultFailure(screen, test, result, initialIndent) {
const errorDetails = [];
if (result.status === "passed" && test.expectedStatus === "failed") {
@@ -395,7 +418,8 @@ function formatResultFailure(screen, test, result, initialIndent) {
message: indent(screen.colors.red(`Test was interrupted.`), initialIndent)
});
}
for (const error of result.errors) {
const reportedIndex = result[kReportedSymbol] || 0;
for (const error of result.errors.slice(reportedIndex)) {
const formattedError = formatError(screen, error);
errorDetails.push({
message: indent(formattedError.message, initialIndent),
@@ -423,7 +447,7 @@ function formatTestTitle(screen, config, test, step, options = {}) {
const projectLabel = options.includeTestId ? `project=` : "";
const projectTitle = projectName ? `[${projectLabel}${projectName}] \u203A ` : "";
const testTitle = `${testId}${projectTitle}${location} \u203A ${titles.join(" \u203A ")}`;
const extraTags = test.tags.filter((t) => !testTitle.includes(t));
const extraTags = test.tags.filter((t) => !testTitle.includes(t) && !config.tags.includes(t));
return `${testTitle}${stepSuffix(step)}${extraTags.length ? " " + extraTags.join(" ") : ""}`;
}
function formatTestHeader(screen, config, test, options = {}) {
@@ -599,6 +623,7 @@ function groupAttachments(attachments) {
formatRetry,
internalScreen,
kOutputSymbol,
markErrorsAsReported,
nonTerminalScreen,
prepareErrorStack,
relativeFilePath,

View File

@@ -56,6 +56,7 @@ class BlobReporter extends import_teleEmitter.TeleReporterEmitter {
const metadata = {
version: currentBlobReportVersion,
userAgent: (0, import_utils2.getUserAgent)(),
// TODO: remove after some time, recommend config.tag instead.
name: process.env.PWTEST_BOT_NAME,
shard: config.shard ?? void 0,
pathSeparator: import_path.default.sep
@@ -67,6 +68,8 @@ class BlobReporter extends import_teleEmitter.TeleReporterEmitter {
this._config = config;
super.onConfigure(config);
}
async onTestPaused(test, result) {
}
async onEnd(result) {
await super.onEnd(result);
const zipFileName = await this._prepareOutputFile();

View File

@@ -73,6 +73,23 @@ class DotReporter extends import_base.TerminalReporter {
this.writeLine("\n" + this.formatError(error).message);
this._counter = 0;
}
async onTestPaused(test, result) {
if (!process.stdin.isTTY && !process.env.PW_TEST_DEBUG_REPORTERS)
return;
this.screen.stdout.write("\n");
if (test.outcome() === "unexpected") {
this.writeLine(this.screen.colors.red(this.formatTestHeader(test, { indent: " " })));
this.writeLine(this.formatResultErrors(test, result));
(0, import_base.markErrorsAsReported)(result);
this.writeLine(this.screen.colors.yellow(" Paused on error. Press Ctrl+C to end.") + "\n");
} else {
this.writeLine(this.screen.colors.yellow(this.formatTestHeader(test, { indent: " " })));
this.writeLine(this.screen.colors.yellow(" Paused at test end. Press Ctrl+C to end.") + "\n");
}
this._counter = 0;
await new Promise(() => {
});
}
async onEnd(result) {
await super.onEnd(result);
this.screen.stdout.write("\n");

View File

@@ -51,6 +51,7 @@ const isHtmlReportOption = (type) => {
class HtmlReporter {
constructor(options) {
this._topLevelErrors = [];
this._machines = [];
this._options = options;
}
version() {
@@ -104,6 +105,9 @@ class HtmlReporter {
onError(error) {
this._topLevelErrors.push(error);
}
onMachineEnd(result) {
this._machines.push(result);
}
async onEnd(result) {
const projectSuites = this.suite.suites;
await (0, import_utils.removeFolders)([this._outputFolder]);
@@ -124,7 +128,7 @@ class HtmlReporter {
noSnippets,
noCopyPrompt
});
this._buildResult = await builder.build(this.config.metadata, projectSuites, result, this._topLevelErrors);
this._buildResult = await builder.build(this.config.metadata, projectSuites, result, this._topLevelErrors, this._machines);
}
async onExit() {
if (process.env.CI || !this._buildResult)
@@ -215,7 +219,7 @@ class HtmlBuilder {
this._dataZipFile = new import_zipBundle.yazl.ZipFile();
this._attachmentsBaseURL = attachmentsBaseURL;
}
async build(metadata, projectSuites, result, topLevelErrors) {
async build(metadata, projectSuites, result, topLevelErrors, machines) {
const data = /* @__PURE__ */ new Map();
for (const projectSuite of projectSuites) {
const projectName = projectSuite.project().name;
@@ -259,7 +263,13 @@ class HtmlBuilder {
projectNames: projectSuites.map((r) => r.project().name),
stats: { ...[...data.values()].reduce((a, e) => addStats(a, e.testFileSummary.stats), emptyStats()) },
errors: topLevelErrors.map((error) => (0, import_base.formatError)(import_base.internalScreen, error).message),
options: this._options
options: this._options,
machines: machines.map((s) => ({
duration: s.duration,
startTime: s.startTime.getTime(),
tag: s.tag,
shardIndex: s.shardIndex
}))
};
htmlReport.files.sort((f1, f2) => {
const w1 = f1.stats.unexpected * 1e3 + f1.stats.flaky;

View File

@@ -66,6 +66,10 @@ class InternalReporter {
onStdErr(chunk, test, result) {
this._reporter.onStdErr?.(chunk, test, result);
}
async onTestPaused(test, result) {
this._addSnippetToTestErrors(test, result);
return await this._reporter.onTestPaused?.(test, result);
}
onTestEnd(test, result) {
this._addSnippetToTestErrors(test, result);
this._reporter.onTestEnd?.(test, result);
@@ -112,6 +116,8 @@ function addLocationAndSnippetToError(config, error, file) {
const location = error.location;
if (!location)
return;
if (!!error.snippet)
return;
try {
const tokens = [];
const source = import_fs.default.readFileSync(location.file, "utf8");

View File

@@ -74,6 +74,24 @@ class LineReporter extends import_base.TerminalReporter {
if (this.screen.isTTY && step.category === "test.step")
this._updateLine(test, result, step.parent);
}
async onTestPaused(test, result) {
if (!process.stdin.isTTY && !process.env.PW_TEST_DEBUG_REPORTERS)
return;
if (!process.env.PW_TEST_DEBUG_REPORTERS)
this.screen.stdout.write(`\x1B[1A\x1B[2K`);
if (test.outcome() === "unexpected") {
this.writeLine(this.screen.colors.red(this.formatTestHeader(test, { indent: " ", index: ++this._failures })));
this.writeLine(this.formatResultErrors(test, result));
(0, import_base.markErrorsAsReported)(result);
this.writeLine(this.screen.colors.yellow(` Paused on error. Press Ctrl+C to end.`) + "\n\n");
} else {
this.writeLine(this.screen.colors.yellow(this.formatTestHeader(test, { indent: " " })));
this.writeLine(this.screen.colors.yellow(` Paused at test end. Press Ctrl+C to end.`) + "\n\n");
}
this._updateLine(test, result, void 0);
await new Promise(() => {
});
}
onTestEnd(test, result) {
super.onTestEnd(test, result);
if (!this.willRetry(test) && (test.outcome() === "flaky" || test.outcome() === "unexpected" || result.status === "interrupted")) {

View File

@@ -38,6 +38,7 @@ class ListReporter extends import_base.TerminalReporter {
this._resultIndex = /* @__PURE__ */ new Map();
this._stepIndex = /* @__PURE__ */ new Map();
this._needNewLine = false;
this._paused = /* @__PURE__ */ new Set();
this._printSteps = (0, import_utils.getAsBooleanFromENV)("PLAYWRIGHT_LIST_PRINT_STEPS", options?.printSteps);
}
onBegin(suite) {
@@ -144,8 +145,29 @@ class ListReporter extends import_base.TerminalReporter {
this._updateLineCountAndNewLineFlagForOutput(text);
stream.write(chunk);
}
async onTestPaused(test, result) {
if (!process.stdin.isTTY && !process.env.PW_TEST_DEBUG_REPORTERS)
return;
this._paused.add(result);
this._updateTestLine(test, result);
this._maybeWriteNewLine();
if (test.outcome() === "unexpected") {
const errors = this.formatResultErrors(test, result);
this.writeLine(errors);
this._updateLineCountAndNewLineFlagForOutput(errors);
(0, import_base.markErrorsAsReported)(result);
}
this._appendLine(this.screen.colors.yellow(`Paused ${test.outcome() === "unexpected" ? "on error" : "at test end"}. Press Ctrl+C to end.`), this._testPrefix("", ""));
await new Promise(() => {
});
}
onTestEnd(test, result) {
super.onTestEnd(test, result);
const wasPaused = this._paused.delete(result);
if (!wasPaused)
this._updateTestLine(test, result);
}
_updateTestLine(test, result) {
const title = this.formatTestTitle(test);
let prefix = "";
let text = "";

View File

@@ -55,10 +55,15 @@ async function createMergedReport(config, dir, reporterDescriptions, rootDirOver
throw new Error(`No report files found in ${dir}`);
const eventData = await mergeEvents(dir, shardFiles, stringPool, printStatus, rootDirOverride);
const pathSeparator = rootDirOverride ? import_path.default.sep : eventData.pathSeparatorFromMetadata ?? import_path.default.sep;
const pathPackage = pathSeparator === "/" ? import_path.default.posix : import_path.default.win32;
const receiver = new import_teleReceiver.TeleReporterReceiver(multiplexer, {
mergeProjects: false,
mergeTestCases: false,
resolvePath: (rootDir, relativePath) => stringPool.internString(rootDir + pathSeparator + relativePath),
// When merging on a different OS, an absolute path like `C:\foo\bar` from win may look like
// a relative path on posix, and vice versa.
// Therefore, we cannot use `path.resolve()` here - it will resolve relative-looking paths
// against `process.cwd()`, while we just want to normalize ".." and "." segments.
resolvePath: (rootDir, relativePath) => stringPool.internString(pathPackage.normalize(pathPackage.join(rootDir, relativePath))),
configOverrides: config.config
});
printStatus(`processing test events`);
@@ -72,7 +77,7 @@ async function createMergedReport(config, dir, reporterDescriptions, rootDirOver
}
};
await dispatchEvents(eventData.prologue);
for (const { reportFile, eventPatchers, metadata, tags } of eventData.reports) {
for (const { reportFile, eventPatchers, metadata, tags, startTime, duration } of eventData.reports) {
const reportJsonl = await import_fs.default.promises.readFile(reportFile);
const events = parseTestEvents(reportJsonl);
new import_stringInternPool.JsonStringInternalizer(stringPool).traverse(events);
@@ -83,6 +88,12 @@ async function createMergedReport(config, dir, reporterDescriptions, rootDirOver
eventPatchers.patchers.push(new GlobalErrorPatcher(tags.join(" ")));
eventPatchers.patchEvents(events);
await dispatchEvents(events);
multiplexer.onMachineEnd({
startTime: new Date(startTime),
duration,
tag: tags,
shardIndex: metadata.shard?.current
});
}
await dispatchEvents(eventData.epilogue);
}
@@ -181,6 +192,8 @@ async function mergeEvents(dir, shardReportFiles, stringPool, printStatus, rootD
eventPatchers.patchers.push(new PathSeparatorPatcher(metadata.pathSeparator));
eventPatchers.patchEvents(parsedEvents);
let tags = [];
let startTime = 0;
let duration = 0;
for (const event of parsedEvents) {
if (event.method === "onConfigure") {
configureEvents.push(event);
@@ -188,14 +201,18 @@ async function mergeEvents(dir, shardReportFiles, stringPool, printStatus, rootD
} else if (event.method === "onProject") {
projectEvents.push(event);
} else if (event.method === "onEnd") {
endEvents.push(event);
endEvents.push({ event, metadata, tags });
startTime = event.params.result.startTime;
duration = event.params.result.duration;
}
}
reports.push({
eventPatchers,
reportFile: localPath,
metadata,
tags
tags,
startTime,
duration
});
}
return {
@@ -270,8 +287,8 @@ function mergeConfigs(to, from) {
function mergeEndEvents(endEvents) {
let startTime = endEvents.length ? 1e13 : Date.now();
let status = "passed";
let duration = 0;
for (const event of endEvents) {
let endTime = 0;
for (const { event } of endEvents) {
const shardResult = event.params.result;
if (shardResult.status === "failed")
status = "failed";
@@ -280,12 +297,12 @@ function mergeEndEvents(endEvents) {
else if (shardResult.status === "interrupted" && status !== "failed" && status !== "timedout")
status = "interrupted";
startTime = Math.min(startTime, shardResult.startTime);
duration = Math.max(duration, shardResult.duration);
endTime = Math.max(endTime, shardResult.startTime + shardResult.duration);
}
const result = {
status,
startTime,
duration
duration: endTime - startTime
};
return {
method: "onEnd",

View File

@@ -48,10 +48,18 @@ class Multiplexer {
for (const reporter of this._reporters)
wrap(() => reporter.onStdErr?.(chunk, test, result));
}
async onTestPaused(test, result) {
for (const reporter of this._reporters)
await wrapAsync(() => reporter.onTestPaused?.(test, result));
}
onTestEnd(test, result) {
for (const reporter of this._reporters)
wrap(() => reporter.onTestEnd?.(test, result));
}
onMachineEnd(result) {
for (const reporter of this._reporters)
wrap(() => reporter.onMachineEnd?.(result));
}
async onEnd(result) {
for (const reporter of this._reporters) {
const outResult = await wrapAsync(() => reporter.onEnd?.(result));

View File

@@ -37,7 +37,8 @@ var import_teleReceiver = require("../isomorphic/teleReceiver");
class TeleReporterEmitter {
constructor(messageSink, options = {}) {
this._resultKnownAttachmentCounts = /* @__PURE__ */ new Map();
// In case there is blob reporter and UI mode, make sure one does override
this._resultKnownErrorCounts = /* @__PURE__ */ new Map();
// In case there is blob reporter and UI mode, make sure one doesn't override
// the id assigned by the other.
this._idSymbol = Symbol("id");
this._messageSink = messageSink;
@@ -66,6 +67,20 @@ class TeleReporterEmitter {
}
});
}
async onTestPaused(test, result) {
const resultId = result[this._idSymbol];
this._resultKnownErrorCounts.set(resultId, result.errors.length);
this._messageSink({
method: "onTestPaused",
params: {
testId: test.id,
resultId,
errors: result.errors
}
});
await new Promise(() => {
});
}
onTestEnd(test, result) {
const testEnd = {
testId: test.id,
@@ -81,7 +96,9 @@ class TeleReporterEmitter {
result: this._serializeResultEnd(result)
}
});
this._resultKnownAttachmentCounts.delete(result[this._idSymbol]);
const resultId = result[this._idSymbol];
this._resultKnownAttachmentCounts.delete(resultId);
this._resultKnownErrorCounts.delete(resultId);
}
onStepBegin(test, result, step) {
step[this._idSymbol] = (0, import_utils.createGuid)();
@@ -221,11 +238,12 @@ class TeleReporterEmitter {
};
}
_serializeResultEnd(result) {
const id = result[this._idSymbol];
return {
id: result[this._idSymbol],
id,
duration: result.duration,
status: result.status,
errors: result.errors,
errors: this._resultKnownErrorCounts.has(id) ? result.errors.slice(this._resultKnownAttachmentCounts.get(id)) : result.errors,
annotations: result.annotations?.length ? this._relativeAnnotationLocations(result.annotations) : void 0
};
}