chore(ui): do not add sources into the zip file (#21588)
This commit is contained in:
parent
34efbea4c5
commit
0b9c037f36
|
|
@ -51,7 +51,7 @@ class UIMode {
|
||||||
for (const p of config.projects)
|
for (const p of config.projects)
|
||||||
p.retries = 0;
|
p.retries = 0;
|
||||||
config._internal.configCLIOverrides.use = config._internal.configCLIOverrides.use || {};
|
config._internal.configCLIOverrides.use = config._internal.configCLIOverrides.use || {};
|
||||||
config._internal.configCLIOverrides.use.trace = 'on';
|
config._internal.configCLIOverrides.use.trace = { mode: 'on', sources: false };
|
||||||
|
|
||||||
this._originalStderr = process.stderr.write.bind(process.stderr);
|
this._originalStderr = process.stderr.write.bind(process.stderr);
|
||||||
process.stdout.write = (chunk: string | Buffer) => {
|
process.stdout.write = (chunk: string | Buffer) => {
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,14 @@ export const SourceTab: React.FunctionComponent<{
|
||||||
return '';
|
return '';
|
||||||
if (!stackInfo.fileContent.has(filePath)) {
|
if (!stackInfo.fileContent.has(filePath)) {
|
||||||
const sha1 = await calculateSha1(filePath);
|
const sha1 = await calculateSha1(filePath);
|
||||||
stackInfo.fileContent.set(filePath, await fetch(`sha1/src@${sha1}.txt`).then(response => response.text()).catch(() => `<Unable to read "${filePath}">`));
|
try {
|
||||||
|
let response = await fetch(`sha1/src@${sha1}.txt`);
|
||||||
|
if (response.status === 404)
|
||||||
|
response = await fetch(`file?path=${filePath}`);
|
||||||
|
stackInfo.fileContent.set(filePath, await response.text());
|
||||||
|
} catch {
|
||||||
|
stackInfo.fileContent.set(filePath, `<Unable to read "${filePath}">`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return stackInfo.fileContent.get(filePath)!;
|
return stackInfo.fileContent.get(filePath)!;
|
||||||
}, [stackInfo, selectedFrame], '');
|
}, [stackInfo, selectedFrame], '');
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,23 @@ export const Workbench: React.FunctionComponent<{
|
||||||
output?: React.ReactElement,
|
output?: React.ReactElement,
|
||||||
rightToolbar?: React.ReactElement[],
|
rightToolbar?: React.ReactElement[],
|
||||||
}> = ({ model, output, rightToolbar }) => {
|
}> = ({ model, output, rightToolbar }) => {
|
||||||
const [selectedAction, setSelectedAction] = React.useState<ActionTraceEvent | undefined>();
|
const [selectedAction, setSelectedAction] = React.useState<ActionTraceEvent | undefined>(undefined);
|
||||||
const [highlightedAction, setHighlightedAction] = React.useState<ActionTraceEvent | undefined>();
|
const [highlightedAction, setHighlightedAction] = React.useState<ActionTraceEvent | undefined>();
|
||||||
const [selectedNavigatorTab, setSelectedNavigatorTab] = React.useState<string>('actions');
|
const [selectedNavigatorTab, setSelectedNavigatorTab] = React.useState<string>('actions');
|
||||||
const [selectedPropertiesTab, setSelectedPropertiesTab] = React.useState<string>(output ? 'output' : 'call');
|
const [selectedPropertiesTab, setSelectedPropertiesTab] = React.useState<string>(output ? 'output' : 'call');
|
||||||
const activeAction = model ? highlightedAction || selectedAction : undefined;
|
const activeAction = model ? highlightedAction || selectedAction : undefined;
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (selectedAction)
|
||||||
|
return;
|
||||||
|
const failedAction = model?.actions.find(a => a.error);
|
||||||
|
if (failedAction)
|
||||||
|
setSelectedAction(failedAction);
|
||||||
|
// In the UI mode, selecting the first error should reveal source.
|
||||||
|
if (output)
|
||||||
|
setSelectedPropertiesTab('source');
|
||||||
|
}, [model, output, selectedAction, setSelectedAction, setSelectedPropertiesTab]);
|
||||||
|
|
||||||
const { errors, warnings } = activeAction ? modelUtil.stats(activeAction) : { errors: 0, warnings: 0 };
|
const { errors, warnings } = activeAction ? modelUtil.stats(activeAction) : { errors: 0, warnings: 0 };
|
||||||
const consoleCount = errors + warnings;
|
const consoleCount = errors + warnings;
|
||||||
const networkCount = activeAction ? modelUtil.resourcesForAction(activeAction).length : 0;
|
const networkCount = activeAction ? modelUtil.resourcesForAction(activeAction).length : 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue