Skip to content

Commit 692336c

Browse files
authored
fix: restore httpgd plot and local help rendering with EJS 7 (#1911)
* fix: restore viewer rendering with EJS 7 * build: fail non-watch builds on all esbuild warnings
1 parent bca6f7c commit 692336c

3 files changed

Lines changed: 12 additions & 16 deletions

File tree

‎esbuild.js‎

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,19 @@ async function main() {
116116
logLevel: 'info',
117117
});
118118

119+
const contexts = [extensionCtx, agentCtx, interactiveRendererCtx, webviewCtx];
119120
if (watch) {
120-
await Promise.all([
121-
extensionCtx.watch(),
122-
agentCtx.watch(),
123-
interactiveRendererCtx.watch(),
124-
webviewCtx.watch()
125-
]);
121+
await Promise.all(contexts.map(context => context.watch()));
126122
console.log('Watching for changes...');
127123
} else {
128-
await extensionCtx.rebuild();
129-
await agentCtx.rebuild();
130-
await interactiveRendererCtx.rebuild();
131-
await webviewCtx.rebuild();
132-
await extensionCtx.dispose();
133-
await agentCtx.dispose();
134-
await interactiveRendererCtx.dispose();
135-
await webviewCtx.dispose();
124+
try {
125+
const results = await Promise.all(contexts.map(context => context.rebuild()));
126+
if (results.some(result => result.warnings.length > 0)) {
127+
throw new Error('Build failed because esbuild reported warnings.');
128+
}
129+
} finally {
130+
await Promise.all(contexts.map(context => context.dispose()));
131+
}
136132
}
137133
}
138134

‎src/helpViewer/helpPreviewer.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as path from 'path';
22
import * as fs from 'fs';
33
import * as vscode from 'vscode';
44
import * as rHelp from './index';
5-
import * as ejs from 'ejs';
5+
import ejs from 'ejs';
66
import { isDirSafe, isFileSafe, readFileSyncSafe, config, spawnAsync } from '../util';
77
import { Topic, TopicType } from './packages';
88

‎src/plotViewer/httpgdViewer.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { HttpgdClient, HttpgdIdResponse, HttpgdPlotId, HttpgdRendererId } from '
33
import { HttpgdPlot, IHttpgdViewer, HttpgdViewerOptions } from './httpgdTypes';
44
import * as path from 'path';
55
import * as fs from 'fs';
6-
import * as ejs from 'ejs';
6+
import ejs from 'ejs';
77

88
import { asViewColumn, config, setContext, UriIcon, makeWebviewCommandUriString } from '../util';
99
import { extensionContext } from '../extension';

0 commit comments

Comments
 (0)