Skip to content

Commit

Permalink
Refactor out extensions-modules and rewrite mssql extension (#909)
Browse files Browse the repository at this point in the history
* commting .d.ts changes

* added serverinfo to .d.ts

* maybe its working?

* works

* updated contrib

* remove unnecessary code

* fix compile errors

* init

* conitnue

* on the way to working maybe?

* close

* EVERYTHING WORKS

* moved src out of client folder

* formatting

* reenable logging

* working on build file

* fixed install service gulp command

* fix the command to properly return promises

* clean up code

* add telemetry

* formatting

* added logging/telemetry/statusview

* formatting

* address comments

* resolute vscode-language versions
  • Loading branch information
Anthony Dresser authored Mar 28, 2018
1 parent 22c54a9 commit 2414f43
Show file tree
Hide file tree
Showing 62 changed files with 3,396 additions and 11,239 deletions.
8 changes: 0 additions & 8 deletions build/gulpfile.sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ const filter = require('gulp-filter');

gulp.task('clean-mssql-extension', util.rimraf('extensions/mssql/node_modules'));
gulp.task('clean-credentials-extension', util.rimraf('extensions/credentials/node_modules'));
gulp.task('clean-extensions-modules', util.rimraf('extensions-modules/node_modules'));
gulp.task('clean-protocol', ['clean-extensions-modules', 'clean-mssql-extension', 'clean-credentials-extension', 'clean-client', 'clean-jsonrpc', 'clean-server', 'clean-types']);

// Tasks to clean extensions modules
gulp.task('clean-mssql-ext-mod', util.rimraf('extensions/mssql/node_modules/extensions-modules'));
gulp.task('clean-credentials-ext-mod', util.rimraf('extensions/credentials/node_modules/extensions-modules'));
gulp.task('clean-build-ext-mod', util.rimraf('build/node_modules/extensions-modules'));
gulp.task('clean-ext-mod', ['clean-mssql-ext-mod', 'clean-credentials-ext-mod', 'clean-build-ext-mod', 'clean-extensions-modules']);

gulp.task('fmt', () => formatStagedFiles());
const formatFiles = (some) => {
Expand Down
40 changes: 18 additions & 22 deletions build/gulpfile.vscode.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ const packageJson = require('../package.json');
const product = require('../product.json');
const crypto = require('crypto');
const i18n = require('./lib/i18n');
const serviceInstaller = require('../extensions-modules/lib/languageservice/serviceInstallerUtil');
const serviceDownloader = require('service-downloader').ServiceDownloadProvider;
const platformInfo = require('service-downloader/out/platform').PlatformInformation;
const glob = require('glob');
const deps = require('./dependencies');
const getElectronVersion = require('./lib/electron').getElectronVersion;
Expand Down Expand Up @@ -325,8 +326,6 @@ function packageTask(platform, arch, opts) {
const localExtensionDependencies = gulp.src(extensionDepsSrc, { base: '.', dot: true })
.pipe(filter(['**', '!**/package-lock.json']))
.pipe(util.cleanNodeModule('account-provider-azure', ['node_modules/date-utils/doc/**', 'node_modules/adal_node/node_modules/**'], undefined))
.pipe(util.cleanNodeModule('dataprotocol-client', ['node_modules/**', 'src/*.js'], undefined))
.pipe(util.cleanNodeModule('extensions-modules', ['node_modules/**', 'src/*.js'], undefined))
.pipe(util.cleanNodeModule('typescript', ['**/**'], undefined));

const sources = es.merge(src, localExtensions, localExtensionDependencies)
Expand Down Expand Up @@ -674,27 +673,24 @@ gulp.task('generate-vscode-configuration', () => {
// {{SQL CARBON EDIT}}
// Install service locally before building carbon

function installService(extObj, path) {
var installer = new serviceInstaller.ServiceInstaller(extObj, path);
installer.getServiceInstallDirectoryRoot().then(serviceInstallFolder => {
console.log('Cleaning up the install folder: ' + serviceInstallFolder);
del(serviceInstallFolder + '/*').then(() => {
console.log('Installing the service. Install folder: ' + serviceInstallFolder);
installer.installService();
}, delError => {
console.log('failed to delete the install folder error: ' + delError);
});
}, getFolderPathError => {
console.log('failed to call getServiceInstallDirectoryRoot error: ' + getFolderPathError);
function installService() {
let config = require('../extensions/mssql/src/config.json');
return platformInfo.getCurrent().then(p => {
let runtime = p.runtimeId;
// fix path since it won't be correct
config.installDirectory = path.join(__dirname, '../extensions/mssql/src', config.installDirectory);
var installer = new serviceDownloader(config);
let serviceInstallFolder = installer.getInstallDirectory(runtime);
console.log('Cleaning up the install folder: ' + serviceInstallFolder);
return del(serviceInstallFolder + '/*').then(() => {
console.log('Installing the service. Install folder: ' + serviceInstallFolder);
return installer.installService(runtime);
}, delError => {
console.log('failed to delete the install folder error: ' + delError);
});
});

}

gulp.task('install-sqltoolsservice', () => {
var mssqlExt = require('../extensions/mssql/client/out/models/constants');
var extObj = new mssqlExt.Constants();
var path = '../extensions/mssql/client/out/config.json';
return installService(extObj, path);
return installService();
});


1 change: 0 additions & 1 deletion build/npm/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ function yarnInstall(location, opts) {
}

// {{SQL CARBON EDIT}}
yarnInstall('extensions-modules');
yarnInstall('extensions'); // node modules shared by all extensions

const extensions = [
Expand Down
4 changes: 2 additions & 2 deletions build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"azure-storage": "^2.1.0",
"decompress": "^4.2.0",
"documentdb": "1.13.0",
"extensions-modules": "file:../extensions-modules",
"service-downloader": "github:anthonydresser/service-downloader#0.1.2",
"fs-extra-promise": "^1.0.1",
"mime": "^1.3.4",
"minimist": "^1.2.0",
"typescript": "2.6.1",
"vscode": "^1.0.1",
"vscode": "^1.0.1",
"xml2js": "^0.4.17"
},
"scripts": {
Expand Down
Loading

0 comments on commit 2414f43

Please sign in to comment.