mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Revert build folder update to fix it properly (#22981)
* Revert "Disable publishing crash reports temporarily (#22950)" This reverts commit13a791d14e. * Revert "Compile build folder (#22811)" This reverts commit2c07c09d0d.
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Transpiler = void 0;
|
||||
const ts = require("typescript");
|
||||
@@ -11,21 +10,20 @@ const threads = require("node:worker_threads");
|
||||
const Vinyl = require("vinyl");
|
||||
const node_os_1 = require("node:os");
|
||||
function transpile(tsSrc, options) {
|
||||
var _a, _b;
|
||||
const isAmd = /\n(import|export)/m.test(tsSrc);
|
||||
if (!isAmd && ((_a = options.compilerOptions) === null || _a === void 0 ? void 0 : _a.module) === ts.ModuleKind.AMD) {
|
||||
if (!isAmd && options.compilerOptions?.module === ts.ModuleKind.AMD) {
|
||||
// enforce NONE module-system for not-amd cases
|
||||
options = Object.assign(Object.assign({}, options), { compilerOptions: Object.assign(Object.assign({}, options.compilerOptions), { module: ts.ModuleKind.None }) });
|
||||
options = { ...options, ...{ compilerOptions: { ...options.compilerOptions, module: ts.ModuleKind.None } } };
|
||||
}
|
||||
const out = ts.transpileModule(tsSrc, options);
|
||||
return {
|
||||
jsSrc: out.outputText,
|
||||
diag: (_b = out.diagnostics) !== null && _b !== void 0 ? _b : []
|
||||
diag: out.diagnostics ?? []
|
||||
};
|
||||
}
|
||||
if (!threads.isMainThread) {
|
||||
// WORKER
|
||||
(_a = threads.parentPort) === null || _a === void 0 ? void 0 : _a.addListener('message', (req) => {
|
||||
threads.parentPort?.addListener('message', (req) => {
|
||||
const res = {
|
||||
jsSrcs: [],
|
||||
diagnostics: []
|
||||
@@ -44,7 +42,6 @@ class TranspileWorker {
|
||||
this._worker = new threads.Worker(__filename);
|
||||
this._durations = [];
|
||||
this._worker.addListener('message', (res) => {
|
||||
var _a, _b;
|
||||
if (!this._pending) {
|
||||
console.error('RECEIVING data WITHOUT request');
|
||||
return;
|
||||
@@ -75,7 +72,7 @@ class TranspileWorker {
|
||||
if (suffixLen === 5 /* SuffixTypes.Dts */ && _isDefaultEmpty(jsSrc)) {
|
||||
continue;
|
||||
}
|
||||
const outBase = (_b = (_a = options.compilerOptions) === null || _a === void 0 ? void 0 : _a.outDir) !== null && _b !== void 0 ? _b : file.base;
|
||||
const outBase = options.compilerOptions?.outDir ?? file.base;
|
||||
const outPath = outFileFn(file.path);
|
||||
outFiles.push(new Vinyl({
|
||||
path: outPath,
|
||||
|
||||
Reference in New Issue
Block a user