mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Webpack Extensions update (#15919)
* test for schemacompare * added schema compare to package.json * added arc for translation * added admin-tool-ext-win * added agent * added cms to list of extensions webpacked * removed dacpac * added import * added machine-learning * removed profiler * added server-report * added sql-assessment * added sql-migration * added sql-database-projects * added query-history * fixed and updated dependencies in extensions for webpacking. * fixed names of entry * fixed webpack for machine-learning * removed dependency external for dacpac * reduced externals for server-report * added back import * removed extension.webpack.config.js * removed useless handlebars function * added todo message
This commit is contained in:
@@ -5,11 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
import * as vscode from 'vscode';
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs-extra';
|
||||
import * as handlebars from 'handlebars';
|
||||
import * as Constants from './constants';
|
||||
import * as LocalizedConstants from './localizedConstants';
|
||||
|
||||
/**
|
||||
* Helper to log messages to the developer console if enabled
|
||||
@@ -24,23 +20,3 @@ export function logDebug(msg: any): void {
|
||||
console.log(outputMsg);
|
||||
}
|
||||
}
|
||||
|
||||
export function renderTemplateHtml(extensionPath: string, templateName: string, templateValues: object): Thenable<string> {
|
||||
let templatePath = path.join(extensionPath, 'resources', templateName);
|
||||
|
||||
// 1) Read the template from the disk
|
||||
// 2) Compile it as a handlebars template and render the HTML
|
||||
// 3) On failure, return a simple string as an error
|
||||
return fs.readFile(templatePath, 'utf-8')
|
||||
.then(templateText => {
|
||||
let template = handlebars.compile(templateText);
|
||||
return template(templateValues);
|
||||
})
|
||||
.then(
|
||||
undefined,
|
||||
error => {
|
||||
logDebug(error);
|
||||
return LocalizedConstants.msgErrorLoadingTab;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user