mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Reduce packaged size of extensions (#4300)
* reduce output of notebooks * reduce size of azurecore * update mssql extensions to be webpacked * formatting * remove commented code * fix packaged config * fix mssql packing
This commit is contained in:
@@ -33,12 +33,10 @@ const i18n = require('./lib/i18n');
|
||||
// {{SQL CARBON EDIT}}
|
||||
const serviceDownloader = require('service-downloader').ServiceDownloadProvider;
|
||||
const platformInfo = require('service-downloader/out/platform').PlatformInformation;
|
||||
const glob = require('glob');
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
const deps = require('./dependencies');
|
||||
const getElectronVersion = require('./lib/electron').getElectronVersion;
|
||||
const createAsar = require('./lib/asar').createAsar;
|
||||
const minimist = require('minimist');
|
||||
const { compileBuildTask } = require('./gulpfile.compile');
|
||||
|
||||
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
||||
@@ -360,7 +358,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
.pipe(util.cleanNodeModule('core-js', ['**/**'], undefined))
|
||||
.pipe(util.cleanNodeModule('slickgrid', ['node_modules/**', 'examples/**'], undefined))
|
||||
.pipe(util.cleanNodeModule('nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
|
||||
.pipe(util.cleanNodeModule('vscode-nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
|
||||
.pipe(util.cleanNodeModule('vscode-nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['build/Release/*.node', '**/*.a']))
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
.pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node']))
|
||||
.pipe(util.cleanNodeModule('vscode-windows-ca-certs', ['**/*'], ['package.json', '**/*.node']))
|
||||
@@ -478,8 +476,6 @@ BUILD_TARGETS.forEach(buildTarget => {
|
||||
minified ? minifyVSCodeTask : optimizeVSCodeTask,
|
||||
util.rimraf(path.join(buildRoot, destinationFolderName))
|
||||
),
|
||||
ext.packageExtensionTask('mssql', platform, arch),
|
||||
ext.packageExtensionTask('azurecore', platform, arch),
|
||||
packageTask(platform, arch, sourceFolderName, destinationFolderName, opts)
|
||||
));
|
||||
gulp.task(vscodeTask);
|
||||
|
||||
@@ -254,7 +254,6 @@ const sqlBuiltInExtensions = [
|
||||
'big-data-cluster',
|
||||
'dacpac'
|
||||
];
|
||||
var azureExtensions = ['azurecore', 'mssql'];
|
||||
const builtInExtensions = require('../builtInExtensions.json');
|
||||
/**
|
||||
* We're doing way too much stuff at once, with webpack et al. So much stuff
|
||||
@@ -290,8 +289,7 @@ function packageExtensionsStream(optsIn) {
|
||||
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
|
||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||
// {{SQL CARBON EDIT}}
|
||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1)
|
||||
.filter(({ name }) => azureExtensions.indexOf(name) === -1);
|
||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1);
|
||||
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
|
||||
return fromLocal(extension.path, opts.sourceMappingURLBase)
|
||||
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
|
||||
|
||||
@@ -301,7 +301,6 @@ const sqlBuiltInExtensions = [
|
||||
'big-data-cluster',
|
||||
'dacpac'
|
||||
];
|
||||
var azureExtensions = ['azurecore', 'mssql'];
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
|
||||
interface IBuiltInExtension {
|
||||
@@ -350,8 +349,7 @@ export function packageExtensionsStream(optsIn?: IPackageExtensionsOptions): Nod
|
||||
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
|
||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||
// {{SQL CARBON EDIT}}
|
||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1)
|
||||
.filter(({ name }) => azureExtensions.indexOf(name) === -1);
|
||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1);
|
||||
|
||||
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
|
||||
return fromLocal(extension.path, opts.sourceMappingURLBase)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
src/**
|
||||
out/**
|
||||
tsconfig.json
|
||||
extension.webpack.config.js
|
||||
yarn.lock
|
||||
|
||||
21
extensions/azurecore/extension.webpack.config.js
Normal file
21
extensions/azurecore/extension.webpack.config.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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';
|
||||
|
||||
const withDefaults = require('../shared.webpack.config');
|
||||
|
||||
module.exports = withDefaults({
|
||||
context: __dirname,
|
||||
entry: {
|
||||
extension: './src/extension.ts'
|
||||
},
|
||||
externals: {
|
||||
'ms-rest': 'commonjs ms-rest',
|
||||
'request': 'commonjs request'
|
||||
}
|
||||
});
|
||||
@@ -156,17 +156,18 @@
|
||||
"hasAzureResourceProviders": true
|
||||
},
|
||||
"dependencies": {
|
||||
"adal-node": "^0.1.28",
|
||||
"azure-arm-resource": "^7.0.0",
|
||||
"azure-arm-sql": "^5.0.1",
|
||||
"ms-rest": "^2.5.0",
|
||||
"request": "2.88.0",
|
||||
"vscode-nls": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^5.2.5",
|
||||
"@types/node": "^8.0.24",
|
||||
"@types/node": "^8.10.25",
|
||||
"mocha": "^5.2.0",
|
||||
"should": "^13.2.1",
|
||||
"typemoq": "^2.1.0",
|
||||
"vscode": "^1.1.26"
|
||||
"typemoq": "^2.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
2
extensions/azurecore/src/typings/ref.d.ts
vendored
2
extensions/azurecore/src/typings/ref.d.ts
vendored
@@ -6,4 +6,4 @@
|
||||
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.d.ts'/>
|
||||
/// <reference path='../../../../src/sql/azdata.proposed.d.ts'/>
|
||||
/// <reference types='@types/node'/>
|
||||
/// <reference types='@types/node'/>
|
||||
|
||||
@@ -1,22 +1,15 @@
|
||||
{
|
||||
"compileOnSave": true,
|
||||
"extends": "../shared.tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"outDir": "./out",
|
||||
"lib": [
|
||||
"es6", "es2015.promise"
|
||||
],
|
||||
"typeRoots": [
|
||||
"./node_modules/@types"
|
||||
],
|
||||
"sourceMap": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"moduleResolution": "node",
|
||||
"declaration": false
|
||||
"strict": false,
|
||||
"alwaysStrict": false,
|
||||
"noImplicitAny": false,
|
||||
"noImplicitReturns": false,
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
"include": [
|
||||
"src/**/*"
|
||||
]
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
||||
client/src/**
|
||||
client/tsconfig.json
|
||||
npm-shrinkwrap.json
|
||||
test/**
|
||||
src/**
|
||||
out/**
|
||||
tsconfig.json
|
||||
extension.webpack.config.js
|
||||
yarn.lock
|
||||
|
||||
24
extensions/mssql/extension.webpack.config.js
Normal file
24
extensions/mssql/extension.webpack.config.js
Normal file
@@ -0,0 +1,24 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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';
|
||||
|
||||
const withDefaults = require('../shared.webpack.config');
|
||||
|
||||
module.exports = withDefaults({
|
||||
context: __dirname,
|
||||
entry: {
|
||||
main: './src/main.ts'
|
||||
},
|
||||
externals: {
|
||||
'clipboardy': 'commonjs clipboardy',
|
||||
'dataprotocol-client': 'commonjs dataprotocol-client',
|
||||
'vscode-languageclient': 'commonjs vscode-languageclient',
|
||||
'vscode-extension-telemetry': 'commonjs vscode-extension-telemetry',
|
||||
'request': 'commonjs request',
|
||||
}
|
||||
});
|
||||
@@ -32,7 +32,8 @@
|
||||
"service-downloader": "github:anthonydresser/service-downloader#0.1.5",
|
||||
"stream-meter": "^1.0.4",
|
||||
"uri-js": "^4.2.2",
|
||||
"vscode-extension-telemetry": "^0.0.15",
|
||||
"vscode-extension-telemetry": "0.1.0",
|
||||
"vscode-languageclient": "^3.5.1",
|
||||
"vscode-nls": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {},
|
||||
|
||||
@@ -19,10 +19,10 @@ ajv@^6.5.5:
|
||||
json-schema-traverse "^0.4.1"
|
||||
uri-js "^4.2.2"
|
||||
|
||||
applicationinsights@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-1.0.1.tgz#53446b830fe8d5d619eee2a278b31d3d25030927"
|
||||
integrity sha1-U0Rrgw/o1dYZ7uKieLMdPSUDCSc=
|
||||
applicationinsights@1.0.6:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-1.0.6.tgz#bc201810de91cea910dab34e8ad35ecde488edeb"
|
||||
integrity sha512-VQT3kBpJVPw5fCO5n+WUeSx0VHjxFtD7znYbILBlVgOS9/cMDuGFmV2Br3ObzFyZUDGNbEfW36fD1y2/vAiCKw==
|
||||
dependencies:
|
||||
diagnostic-channel "0.2.0"
|
||||
diagnostic-channel-publishers "0.2.1"
|
||||
@@ -1043,19 +1043,19 @@ verror@1.10.0:
|
||||
core-util-is "1.0.2"
|
||||
extsprintf "^1.2.0"
|
||||
|
||||
vscode-extension-telemetry@^0.0.15:
|
||||
version "0.0.15"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.15.tgz#685c32f3b67e8fb85ba689c1d7f88ff90ff87856"
|
||||
integrity sha512-Yf6dL9r2x2GISI1xh22XsAaydSTQG/4aBitu8sGBwGr42n2TyOsIXGtXSDgqQBNZgYD6+P1EHqrrzetn9ekWTQ==
|
||||
vscode-extension-telemetry@0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.0.tgz#3cdcb61d03829966bd04b5f11471a1e40d6abaad"
|
||||
integrity sha512-WVCnP+uLxlqB6UD98yQNV47mR5Rf79LFxpuZhSPhEf0Sb4tPZed3a63n003/dchhOwyCTCBuNN4n8XKJkLEI1Q==
|
||||
dependencies:
|
||||
applicationinsights "1.0.1"
|
||||
applicationinsights "1.0.6"
|
||||
|
||||
vscode-jsonrpc@3.5.0:
|
||||
version "3.5.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-3.5.0.tgz#87239d9e166b2d7352245b8a813597804c1d63aa"
|
||||
integrity sha1-hyOdnhZrLXNSJFuKgTWXgEwdY6o=
|
||||
|
||||
vscode-languageclient@3.5.1:
|
||||
vscode-languageclient@3.5.1, vscode-languageclient@^3.5.1:
|
||||
version "3.5.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-3.5.1.tgz#c78e582459c24e58f88020dfa34065e976186a98"
|
||||
integrity sha512-GTQ+hSq/o4c/y6GYmyP9XNrVoIu0NFZ67KltSkqN+tO0eUNDIlrVNX+3DJzzyLhSsrctuGzuYWm3t87mNAcBmQ==
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
jupyter_config/**
|
||||
jupyter_config/**
|
||||
src/**
|
||||
out/**
|
||||
tsconfig.json
|
||||
extension.webpack.config.js
|
||||
yarn.lock
|
||||
|
||||
20
extensions/notebook/extension.webpack.config.js
Normal file
20
extensions/notebook/extension.webpack.config.js
Normal file
@@ -0,0 +1,20 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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';
|
||||
|
||||
const withDefaults = require('../shared.webpack.config');
|
||||
|
||||
module.exports = withDefaults({
|
||||
context: __dirname,
|
||||
entry: {
|
||||
extension: './src/extension.ts'
|
||||
},
|
||||
externals: {
|
||||
'node-fetch': 'commonjs node-fetch'
|
||||
}
|
||||
});
|
||||
@@ -297,7 +297,6 @@
|
||||
"figures": "^2.0.0",
|
||||
"fs-extra": "^5.0.0",
|
||||
"node-fetch": "^2.3.0",
|
||||
"process-nextick-args": "^2.0.0",
|
||||
"request": "^2.88.0",
|
||||
"temp-write": "^3.4.0",
|
||||
"vscode-languageclient": "^5.3.0-next.1",
|
||||
|
||||
@@ -51,6 +51,8 @@ module.exports = function withDefaults(/**@type WebpackConfig*/extConfig) {
|
||||
},
|
||||
externals: {
|
||||
'vscode': 'commonjs vscode', // ignored because it doesn't exist
|
||||
'azdata': 'commonjs azdata',
|
||||
'sqlops': 'commonjs sqlops'
|
||||
},
|
||||
output: {
|
||||
// all output goes into `dist`.
|
||||
|
||||
Reference in New Issue
Block a user