build: switch build/tsconfig.json to module: nodenext (#238426)

* build/tsconfig: switch to module: nodenext for bun compat

* build: rewrite imports for nodenext compat

* build: re-generate
This commit is contained in:
Aman Karmani
2025-01-22 11:12:39 -08:00
committed by GitHub
parent 02ea21a23d
commit e76c50f20e
122 changed files with 1907 additions and 1202 deletions

View File

@@ -3,10 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDependencies = getDependencies;
const child_process_1 = require("child_process");
const path = require("path");
const path_1 = __importDefault(require("path"));
const install_sysroot_1 = require("./debian/install-sysroot");
const calculate_deps_1 = require("./debian/calculate-deps");
const calculate_deps_2 = require("./rpm/calculate-deps");
@@ -44,23 +47,23 @@ async function getDependencies(packageType, buildDir, applicationName, arch) {
}
// Get the files for which we want to find dependencies.
const canAsar = false; // TODO@esm ASAR disabled in ESM
const nativeModulesPath = path.join(buildDir, 'resources', 'app', canAsar ? 'node_modules.asar.unpacked' : 'node_modules');
const nativeModulesPath = path_1.default.join(buildDir, 'resources', 'app', canAsar ? 'node_modules.asar.unpacked' : 'node_modules');
const findResult = (0, child_process_1.spawnSync)('find', [nativeModulesPath, '-name', '*.node']);
if (findResult.status) {
console.error('Error finding files:');
console.error(findResult.stderr.toString());
return [];
}
const appPath = path.join(buildDir, applicationName);
const appPath = path_1.default.join(buildDir, applicationName);
// Add the native modules
const files = findResult.stdout.toString().trimEnd().split('\n');
// Add the tunnel binary.
files.push(path.join(buildDir, 'bin', product.tunnelApplicationName));
files.push(path_1.default.join(buildDir, 'bin', product.tunnelApplicationName));
// Add the main executable.
files.push(appPath);
// Add chrome sandbox and crashpad handler.
files.push(path.join(buildDir, 'chrome-sandbox'));
files.push(path.join(buildDir, 'chrome_crashpad_handler'));
files.push(path_1.default.join(buildDir, 'chrome-sandbox'));
files.push(path_1.default.join(buildDir, 'chrome_crashpad_handler'));
// Generate the dependencies.
let dependencies;
if (packageType === 'deb') {