feat(core): Add Bun and Deno runtime support, unify core loader, unix-socket support and cross-runtime streaming/tests

This commit is contained in:
2025-11-16 22:50:19 +00:00
parent 32332309dc
commit 6211acd60b
22 changed files with 1447 additions and 92 deletions

View File

@@ -3,8 +3,9 @@ import * as fs from 'fs';
import * as http from 'http';
import * as https from 'https';
import * as path from 'path';
import * as stream from 'stream';
export { http, https, fs, path };
export { http, https, fs, path, stream };
// pushrocks scope
import * as smartpromise from '@push.rocks/smartpromise';

View File

@@ -147,6 +147,12 @@ export class CoreRequest extends AbstractCoreRequest<
this.options.requestBody.pipe(request).on('finish', () => {
request.end();
});
} else if (this.options.requestBody instanceof ReadableStream) {
// Convert web ReadableStream to Node.js Readable stream
const nodeStream = plugins.stream.Readable.fromWeb(this.options.requestBody as any);
nodeStream.pipe(request).on('finish', () => {
request.end();
});
} else {
// Write body as-is - caller is responsible for serialization
const bodyData =