mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
This reverts commit 6bd0a17d3c.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.watchApiProposalNamesTask = exports.compileApiProposalNamesTask = exports.watchTask = exports.compileTask = exports.transpileTask = void 0;
|
||||
exports.watchApiProposalNamesTask = exports.compileApiProposalNamesTask = exports.watchTask = exports.compileTask = void 0;
|
||||
const es = require("event-stream");
|
||||
const fs = require("fs");
|
||||
const gulp = require("gulp");
|
||||
@@ -22,7 +22,7 @@ const watch = require('./watch');
|
||||
const reporter = (0, reporter_1.createReporter)();
|
||||
function getTypeScriptCompilerOptions(src) {
|
||||
const rootDir = path.join(__dirname, `../../${src}`);
|
||||
const options = {};
|
||||
let options = {};
|
||||
options.verbose = false;
|
||||
options.sourceMap = true;
|
||||
if (process.env['VSCODE_NO_SOURCEMAP']) { // To be used by developers in a hurry
|
||||
@@ -34,8 +34,8 @@ function getTypeScriptCompilerOptions(src) {
|
||||
options.newLine = /\r\n/.test(fs.readFileSync(__filename, 'utf8')) ? 0 : 1;
|
||||
return options;
|
||||
}
|
||||
function createCompile(src, build, emitError, transpileOnly) {
|
||||
const tsb = require('./tsb');
|
||||
function createCompile(src, build, emitError) {
|
||||
const tsb = require('gulp-tsb');
|
||||
const sourcemaps = require('gulp-sourcemaps');
|
||||
const projectPath = path.join(__dirname, '../../', src, 'tsconfig.json');
|
||||
const overrideOptions = Object.assign(Object.assign({}, getTypeScriptCompilerOptions(src)), { inlineSources: Boolean(build) });
|
||||
@@ -69,7 +69,7 @@ function createCompile(src, build, emitError, transpileOnly) {
|
||||
.pipe(noDeclarationsFilter)
|
||||
.pipe(build ? nls.nls() : es.through())
|
||||
.pipe(noDeclarationsFilter.restore)
|
||||
.pipe(transpileOnly ? es.through() : sourcemaps.write('.', {
|
||||
.pipe(sourcemaps.write('.', {
|
||||
addComment: false,
|
||||
includeContent: !!build,
|
||||
sourceRoot: overrideOptions.sourceRoot
|
||||
@@ -83,24 +83,14 @@ function createCompile(src, build, emitError, transpileOnly) {
|
||||
};
|
||||
return pipeline;
|
||||
}
|
||||
function transpileTask(src, out) {
|
||||
return function () {
|
||||
const transpile = createCompile(src, false, true, true);
|
||||
const srcPipe = gulp.src(`${src}/**`, { base: `${src}` });
|
||||
return srcPipe
|
||||
.pipe(transpile())
|
||||
.pipe(gulp.dest(out));
|
||||
};
|
||||
}
|
||||
exports.transpileTask = transpileTask;
|
||||
function compileTask(src, out, build) {
|
||||
return function () {
|
||||
if (os.totalmem() < 4000000000) {
|
||||
throw new Error('compilation requires 4GB of RAM');
|
||||
}
|
||||
const compile = createCompile(src, build, true, false);
|
||||
const compile = createCompile(src, build, true);
|
||||
const srcPipe = gulp.src(`${src}/**`, { base: `${src}` });
|
||||
const generator = new MonacoGenerator(false);
|
||||
let generator = new MonacoGenerator(false);
|
||||
if (src === 'src') {
|
||||
generator.execute();
|
||||
}
|
||||
@@ -113,10 +103,10 @@ function compileTask(src, out, build) {
|
||||
exports.compileTask = compileTask;
|
||||
function watchTask(out, build) {
|
||||
return function () {
|
||||
const compile = createCompile('src', build, false, false);
|
||||
const compile = createCompile('src', build);
|
||||
const src = gulp.src('src/**', { base: 'src' });
|
||||
const watchSrc = watch('src/**', { base: 'src', readDelay: 200 });
|
||||
const generator = new MonacoGenerator(true);
|
||||
let generator = new MonacoGenerator(true);
|
||||
generator.execute();
|
||||
return watchSrc
|
||||
.pipe(generator.stream)
|
||||
@@ -132,7 +122,7 @@ class MonacoGenerator {
|
||||
this._isWatch = isWatch;
|
||||
this.stream = es.through();
|
||||
this._watchedFiles = {};
|
||||
const onWillReadFile = (moduleId, filePath) => {
|
||||
let onWillReadFile = (moduleId, filePath) => {
|
||||
if (!this._isWatch) {
|
||||
return;
|
||||
}
|
||||
@@ -169,7 +159,7 @@ class MonacoGenerator {
|
||||
}, 20);
|
||||
}
|
||||
_run() {
|
||||
const r = monacodts.run3(this._declarationResolver);
|
||||
let r = monacodts.run3(this._declarationResolver);
|
||||
if (!r && !this._isWatch) {
|
||||
// The build must always be able to generate the monaco.d.ts
|
||||
throw new Error(`monaco.d.ts generation error - Cannot continue`);
|
||||
@@ -198,15 +188,6 @@ class MonacoGenerator {
|
||||
}
|
||||
}
|
||||
function generateApiProposalNames() {
|
||||
let eol;
|
||||
try {
|
||||
const src = fs.readFileSync('src/vs/workbench/services/extensions/common/extensionsApiProposals.ts', 'utf-8');
|
||||
const match = /\r?\n/m.exec(src);
|
||||
eol = match ? match[0] : os.EOL;
|
||||
}
|
||||
catch {
|
||||
eol = os.EOL;
|
||||
}
|
||||
const pattern = /vscode\.proposed\.([a-zA-Z]+)\.d\.ts$/;
|
||||
const proposalNames = new Set();
|
||||
const input = es.through();
|
||||
@@ -233,7 +214,7 @@ function generateApiProposalNames() {
|
||||
'});',
|
||||
'export type ApiProposalName = keyof typeof allApiProposals;',
|
||||
'',
|
||||
].join(eol);
|
||||
].join(os.EOL);
|
||||
this.emit('data', new File({
|
||||
path: 'vs/workbench/services/extensions/common/extensionsApiProposals.ts',
|
||||
contents: Buffer.from(contents)
|
||||
|
||||
Reference in New Issue
Block a user