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:
Alex Ma
2021-07-01 09:56:55 -07:00
committed by GitHub
parent ca07671a68
commit 30462dfb25
44 changed files with 329 additions and 192 deletions

View File

@@ -1,6 +1,7 @@
*.vsix
src/**
.gitignore
**/*.ts
**/*.map
.gitignore
out/**
tsconfig.json
extension.webpack.config.js
yarn.lock

View File

@@ -2,6 +2,16 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//@ts-check
'use strict';
export const msgErrorLoadingTab = 'An error occurred while loading the tab.';
const withDefaults = require('../shared.webpack.config');
module.exports = withDefaults({
context: __dirname,
entry: {
extension: './src/extension.ts'
}
});

View File

@@ -26,32 +26,32 @@
"command": "tempdb.startEvent",
"title": "Start",
"icon": {
"light": "./out/media/launch.svg",
"dark": "./out/media/launch_inverse.svg"
"light": "./dist/media/launch.svg",
"dark": "./dist/media/launch_inverse.svg"
}
},
{
"command": "tempdb.stopEvent",
"title": "Stop",
"icon": {
"light": "./out/media/blocker.svg",
"dark": "./out/media/blocker_inverse.svg"
"light": "./dist/media/blocker.svg",
"dark": "./dist/media/blocker_inverse.svg"
}
},
{
"command": "tempdb.contention",
"title": "Contention Help for Tempdb",
"icon": {
"light": "./out/media/documentation.svg",
"dark": "./out/media/documentation_inverse.svg"
"light": "./dist/media/documentation.svg",
"dark": "./dist/media/documentation_inverse.svg"
}
},
{
"command": "tempdb.pauseEvent",
"title": "Toggle Auto Refresh",
"icon": {
"light": "./out/media/insights.svg",
"dark": "./out/media/insights_inverse.svg"
"light": "./dist/media/insights.svg",
"dark": "./dist/media/insights_inverse.svg"
}
}
],
@@ -71,8 +71,8 @@
"id": "server-reports-monitoring",
"title": "Monitor",
"icon": {
"light": "./out/media/monitor.svg",
"dark": "./out/media/monitor_inverse.svg"
"light": "./dist/media/monitor.svg",
"dark": "./dist/media/monitor_inverse.svg"
},
"container": {
"server-reports-monitoring-container": {}
@@ -82,8 +82,8 @@
"id": "server-reports-performance",
"title": "Performance",
"icon": {
"light": "./out/media/performance.svg",
"dark": "./out/media/performance_inverse.svg"
"light": "./dist/media/performance.svg",
"dark": "./dist/media/performance_inverse.svg"
},
"container": {
"server-reports-performance-container": {}
@@ -98,8 +98,8 @@
"group": "monitoring",
"description": "TempDB reports",
"icon": {
"light": "./out/media/tempdb.svg",
"dark": "./out/media/tempdb_inverse.svg"
"light": "./dist/media/tempdb.svg",
"dark": "./dist/media/tempdb_inverse.svg"
},
"container": {
"server-reports-tempdb-container": {}
@@ -119,7 +119,7 @@
"columnsAsLabels": true
}
},
"queryFile": "./out/sql/all_db_space_used.sql"
"queryFile": "./dist/sql/all_db_space_used.sql"
}
},
{
@@ -134,7 +134,7 @@
"columnsAsLabels": false
}
},
"queryFile": "./out/sql/cpumetric.sql"
"queryFile": "./dist/sql/cpumetric.sql"
}
},
{
@@ -150,7 +150,7 @@
"columnsAsLabels": false
}
},
"queryFile": "./out/sql/backup_size_trend.sql"
"queryFile": "./dist/sql/backup_size_trend.sql"
}
},
{
@@ -165,9 +165,9 @@
"columnsAsLabels": true
}
},
"queryFile": "./out/sql/waits_paul_randal.sql",
"queryFile": "./dist/sql/waits_paul_randal.sql",
"details": {
"queryFile": "./out/sql/waits_detail_paul_randal.sql",
"queryFile": "./dist/sql/waits_detail_paul_randal.sql",
"label": {
"column": "WaitType",
"state": []
@@ -188,9 +188,9 @@
"columnsAsLabels": true
}
},
"queryFile": "./out/sql/wait_resources.sql",
"queryFile": "./dist/sql/wait_resources.sql",
"details": {
"queryFile": "./out/sql/wait_resources.sql",
"queryFile": "./dist/sql/wait_resources.sql",
"label": {
"column": "WaitType",
"state": []
@@ -211,7 +211,7 @@
"columnsAsLabels": true
}
},
"queryFile": "./out/sql/memorybydb.sql"
"queryFile": "./dist/sql/memorybydb.sql"
}
},
{
@@ -225,7 +225,7 @@
"legendPosition": "none"
}
},
"queryFile": "./out/sql/typeofContentions.sql",
"queryFile": "./dist/sql/typeofContentions.sql",
"autoRefreshInterval": 0.05
}
},
@@ -241,7 +241,7 @@
"xAxisLabel": "Object Ids for System Tables"
}
},
"queryFile": "./out/sql/metadataContention.sql",
"queryFile": "./dist/sql/metadataContention.sql",
"autoRefreshInterval": 0.05
}
},
@@ -257,7 +257,7 @@
"xAxisLabel": "Page Types"
}
},
"queryFile": "./out/sql/allocationContention.sql",
"queryFile": "./dist/sql/allocationContention.sql",
"autoRefreshInterval": 0.05
}
}
@@ -380,7 +380,6 @@
},
"dependencies": {
"fs-extra": "^8.1.0",
"handlebars": "^4.7.7",
"openurl": "^1.1.1",
"vscode-nls": "^5.0.0"
},

View File

@@ -1,34 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script type="text/javascript">
window.onload = function () {
document.getElementById('frame').src = "{{{url}}}";
};
</script>
<style>
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
#frame {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
</style>
</head>
<body>
<iframe id="frame" width="100%" height="100%" frameborder="0"></iframe>
</body>
</html>

View File

@@ -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;
}
);
}

View File

@@ -14,11 +14,6 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.22.tgz#0d29f382472c4ccf3bd96ff0ce47daf5b7b84b18"
integrity sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==
commander@~2.20.3:
version "2.20.3"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
fs-extra@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
@@ -33,18 +28,6 @@ graceful-fs@^4.1.6, graceful-fs@^4.2.0:
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423"
integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==
handlebars@^4.7.7:
version "4.7.7"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1"
integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==
dependencies:
minimist "^1.2.5"
neo-async "^2.6.0"
source-map "^0.6.1"
wordwrap "^1.0.0"
optionalDependencies:
uglify-js "^3.1.4"
jsonfile@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
@@ -52,33 +35,11 @@ jsonfile@^4.0.0:
optionalDependencies:
graceful-fs "^4.1.6"
minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
neo-async@^2.6.0:
version "2.6.1"
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c"
integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==
openurl@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/openurl/-/openurl-1.1.1.tgz#3875b4b0ef7a52c156f0db41d4609dbb0f94b387"
integrity sha1-OHW0sO96UsFW8NtB1GCduw+Us4c=
source-map@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
uglify-js@^3.1.4:
version "3.9.1"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.9.1.tgz#a56a71c8caa2d36b5556cc1fd57df01ae3491539"
integrity sha512-JUPoL1jHsc9fOjVFHdQIhqEEJsQvfKDjlubcCilu8U26uZ73qOg8VsN8O1jbuei44ZPlwL7kmbAdM4tzaUvqnA==
dependencies:
commander "~2.20.3"
universalify@^0.1.0:
version "0.1.2"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
@@ -88,8 +49,3 @@ vscode-nls@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.0.0.tgz#99f0da0bd9ea7cda44e565a74c54b1f2bc257840"
integrity sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA==
wordwrap@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=