mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
* Fix initial build breaks from 1.67 merge (#2514) * Update yarn lock files * Update build scripts * Fix tsconfig * Build breaks * WIP * Update yarn lock files * Misc breaks * Updates to package.json * Breaks * Update yarn * Fix breaks * Breaks * Build breaks * Breaks * Breaks * Breaks * Breaks * Breaks * Missing file * Breaks * Breaks * Breaks * Breaks * Breaks * Fix several runtime breaks (#2515) * Missing files * Runtime breaks * Fix proxy ordering issue * Remove commented code * Fix breaks with opening query editor * Fix post merge break * Updates related to setup build and other breaks (#2516) * Fix bundle build issues * Update distro * Fix distro merge and update build JS files * Disable pipeline steps * Remove stats call * Update license name * Make new RPM dependencies a warning * Fix extension manager version checks * Update JS file * Fix a few runtime breaks * Fixes * Fix runtime issues * Fix build breaks * Update notebook tests (part 1) * Fix broken tests * Linting errors * Fix hygiene * Disable lint rules * Bump distro * Turn off smoke tests * Disable integration tests * Remove failing "activate" test * Remove failed test assertion * Disable other broken test * Disable query history tests * Disable extension unit tests * Disable failing tasks
87 lines
4.3 KiB
JavaScript
87 lines
4.3 KiB
JavaScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
'use strict';
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const json = require("gulp-json-editor");
|
|
const buffer = require('gulp-buffer');
|
|
const filter = require("gulp-filter");
|
|
const es = require("event-stream");
|
|
const vfs = require("vinyl-fs");
|
|
const fancyLog = require("fancy-log");
|
|
const ansiColors = require("ansi-colors");
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
async function mixinClient(quality) {
|
|
const productJsonFilter = filter(f => f.relative === 'product.json', { restore: true });
|
|
fancyLog(ansiColors.blue('[mixin]'), `Mixing in client:`);
|
|
return new Promise((c, e) => {
|
|
vfs
|
|
.src(`quality/${quality}/**`, { base: `quality/${quality}` })
|
|
.pipe(filter(f => !f.isDirectory()))
|
|
.pipe(filter(f => f.relative !== 'product.server.json'))
|
|
.pipe(productJsonFilter)
|
|
.pipe(buffer())
|
|
.pipe(json((o) => {
|
|
const originalProduct = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'product.json'), 'utf8'));
|
|
let builtInExtensions = originalProduct.builtInExtensions;
|
|
if (Array.isArray(o.builtInExtensions)) {
|
|
fancyLog(ansiColors.blue('[mixin]'), 'Overwriting built-in extensions:', o.builtInExtensions.map(e => e.name));
|
|
builtInExtensions = o.builtInExtensions;
|
|
}
|
|
else if (o.builtInExtensions) {
|
|
const include = o.builtInExtensions['include'] || [];
|
|
const exclude = o.builtInExtensions['exclude'] || [];
|
|
fancyLog(ansiColors.blue('[mixin]'), 'OSS built-in extensions:', builtInExtensions.map(e => e.name));
|
|
fancyLog(ansiColors.blue('[mixin]'), 'Including built-in extensions:', include.map(e => e.name));
|
|
fancyLog(ansiColors.blue('[mixin]'), 'Excluding built-in extensions:', exclude);
|
|
builtInExtensions = builtInExtensions.filter(ext => !include.find(e => e.name === ext.name) && !exclude.find(name => name === ext.name));
|
|
builtInExtensions = [...builtInExtensions, ...include];
|
|
fancyLog(ansiColors.blue('[mixin]'), 'Final built-in extensions:', builtInExtensions.map(e => e.name));
|
|
}
|
|
else {
|
|
fancyLog(ansiColors.blue('[mixin]'), 'Inheriting OSS built-in extensions', builtInExtensions.map(e => e.name));
|
|
}
|
|
return Object.assign(Object.assign({ webBuiltInExtensions: originalProduct.webBuiltInExtensions }, o), { builtInExtensions });
|
|
}))
|
|
.pipe(productJsonFilter.restore)
|
|
.pipe(es.mapSync((f) => {
|
|
fancyLog(ansiColors.blue('[mixin]'), f.relative, ansiColors.green('✔︎'));
|
|
return f;
|
|
}))
|
|
.pipe(vfs.dest('.'))
|
|
.on('end', () => c())
|
|
.on('error', (err) => e(err));
|
|
});
|
|
}
|
|
function mixinServer(quality) {
|
|
const serverProductJsonPath = `quality/${quality}/product.server.json`;
|
|
if (!fs.existsSync(serverProductJsonPath)) {
|
|
fancyLog(ansiColors.blue('[mixin]'), `Server product not found`, serverProductJsonPath);
|
|
return;
|
|
}
|
|
fancyLog(ansiColors.blue('[mixin]'), `Mixing in server:`);
|
|
const originalProduct = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'product.json'), 'utf8'));
|
|
const serverProductJson = JSON.parse(fs.readFileSync(serverProductJsonPath, 'utf8'));
|
|
fs.writeFileSync('product.json', JSON.stringify(Object.assign(Object.assign({}, originalProduct), serverProductJson), undefined, '\t'));
|
|
fancyLog(ansiColors.blue('[mixin]'), 'product.json', ansiColors.green('✔︎'));
|
|
}
|
|
function main() {
|
|
const quality = process.env['VSCODE_QUALITY'];
|
|
if (!quality) {
|
|
console.log('Missing VSCODE_QUALITY, skipping mixin');
|
|
return;
|
|
}
|
|
if (process.argv[2] === '--server') {
|
|
mixinServer(quality);
|
|
}
|
|
else {
|
|
mixinClient(quality).catch(err => {
|
|
console.error(err);
|
|
process.exit(1);
|
|
});
|
|
}
|
|
}
|
|
main();
|