Skip to content

Commit b070c28

Browse files
renkun-keneitsupi
authored andcommitted
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 58f1d4e commit b070c28

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
@@ -115,23 +115,19 @@ async function main() {
115115
logLevel: 'info',
116116
});
117117

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

‎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)