chore: bump node to v20.13.1 (main) (#42088)

* chore: bump node in DEPS to v20.13.0

* crypto: enable NODE_EXTRA_CA_CERTS with BoringSSL

https://github.com/nodejs/node/pull/52217

* test: skip test for dynamically linked OpenSSL

https://github.com/nodejs/node/pull/52542

* lib, url: add a `windows` option to path parsing

https://github.com/nodejs/node/pull/52509

* src: use dedicated routine to compile function for builtin CJS loader

https://github.com/nodejs/node/pull/52016

* test: mark test as flaky

https://github.com/nodejs/node/pull/52671

* build,tools: add test-ubsan ci

https://github.com/nodejs/node/pull/46297

* src: preload function for Environment

https://github.com/nodejs/node/pull/51539

* chore: fixup patch indices

* deps: update c-ares to 1.28.1

https://github.com/nodejs/node/pull/52285

* chore: handle updated filenames

- https://github.com/nodejs/node/pull/51999
- https://github.com/nodejs/node/pull/51927

* chore: bump node in DEPS to v20.13.1

* events: extract addAbortListener for safe internal use

https://github.com/nodejs/node/pull/52081

* module: print location of unsettled top-level await in entry points

https://github.com/nodejs/node/pull/51999

* fs: add stacktrace to fs/promises

https://github.com/nodejs/node/pull/49849

* chore: update patches

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
This commit is contained in:
electron-roller[bot]
2024-05-13 11:43:14 -04:00
committed by GitHub
parent 10fd0ba655
commit 653d0f009e
36 changed files with 139 additions and 447 deletions

View File

@@ -200,11 +200,11 @@ delete process.appCodeLoaded;
if (packagePath) {
// Finally load app's main.js and transfer control to C++.
if ((packageJson.type === 'module' && !mainStartupScript.endsWith('.cjs')) || mainStartupScript.endsWith('.mjs')) {
const { loadESM } = __non_webpack_require__('internal/process/esm_loader');
const { runEntryPointWithESMLoader } = __non_webpack_require__('internal/modules/run_main');
const main = (require('url') as typeof url).pathToFileURL(path.join(packagePath, mainStartupScript));
loadESM(async (esmLoader: any) => {
runEntryPointWithESMLoader(async (cascadedLoader: any) => {
try {
await esmLoader.import(main.toString(), undefined, Object.create(null));
await cascadedLoader.import(main.toString(), undefined, Object.create(null));
appCodeLoaded!();
} catch (err) {
appCodeLoaded!();

View File

@@ -494,7 +494,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
};
const { access } = fs;
fs.access = function (pathArgument: string, mode: any, callback: any) {
fs.access = function (pathArgument: string, mode: number, callback: any) {
const pathInfo = splitPath(pathArgument);
if (!pathInfo.isAsar) return access.apply(this, arguments);
const { asarPath, filePath } = pathInfo;
@@ -539,7 +539,16 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
nextTick(callback);
};
fs.promises.access = util.promisify(fs.access);
const { access: accessPromise } = fs.promises;
fs.promises.access = function (pathArgument: string, mode: number) {
const pathInfo = splitPath(pathArgument);
if (!pathInfo.isAsar) {
return accessPromise.apply(this, arguments);
}
const p = util.promisify(fs.access);
return p(pathArgument, mode);
};
const { accessSync } = fs;
fs.accessSync = function (pathArgument: string, mode: any) {

View File

@@ -150,12 +150,12 @@ if (cjsPreloads.length) {
}
}
if (esmPreloads.length) {
const { loadESM } = __non_webpack_require__('internal/process/esm_loader');
const { runEntryPointWithESMLoader } = __non_webpack_require__('internal/modules/run_main');
loadESM(async (esmLoader: any) => {
runEntryPointWithESMLoader(async (cascadedLoader: any) => {
// Load the preload scripts.
for (const preloadScript of esmPreloads) {
await esmLoader.import(pathToFileURL(preloadScript).toString(), undefined, Object.create(null)).catch((err: Error) => {
await cascadedLoader.import(pathToFileURL(preloadScript).toString(), undefined, Object.create(null)).catch((err: Error) => {
console.error(`Unable to load preload script: ${preloadScript}`);
console.error(err);

View File

@@ -36,11 +36,12 @@ parentPort.on('removeListener', (name: string) => {
});
// Finally load entry script.
const { loadESM } = __non_webpack_require__('internal/process/esm_loader');
const { runEntryPointWithESMLoader } = __non_webpack_require__('internal/modules/run_main');
const mainEntry = pathToFileURL(entryScript);
loadESM(async (esmLoader: any) => {
runEntryPointWithESMLoader(async (cascadedLoader: any) => {
try {
await esmLoader.import(mainEntry.toString(), undefined, Object.create(null));
await cascadedLoader.import(mainEntry.toString(), undefined, Object.create(null));
} catch (err) {
// @ts-ignore internalBinding is a secret internal global that we shouldn't
// really be using, so we ignore the type error instead of declaring it in types