@forklaunch/express 0.10.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/lib/index.js +60 -41
  2. package/lib/index.mjs +61 -42
  3. package/package.json +9 -8
package/lib/index.js CHANGED
@@ -635,47 +635,66 @@ function serveExpress(app, openTelemetryCollector, opts = {}) {
635
635
  [Symbol.asyncDispose]: async () => {
636
636
  cleanup();
637
637
  },
638
- compose: ((stream) => {
639
- if (stream && typeof stream === "object" && "pipe" in stream) {
640
- return stream;
641
- }
642
- if (typeof stream === "function") {
643
- const transform = new import_node_stream.Transform({
644
- objectMode: true,
645
- transform(chunk, encoding, callback) {
646
- try {
647
- stream(chunk);
648
- callback(null, chunk);
649
- } catch (error) {
650
- callback(error);
651
- }
652
- }
653
- });
654
- return transform;
655
- }
656
- if (stream && typeof stream === "object" && Symbol.iterator in stream) {
657
- const iterator = stream[Symbol.iterator]();
658
- const first = iterator.next();
659
- if (!first.done && first.value && typeof first.value === "object" && "pipe" in first.value) {
660
- return first.value;
661
- }
662
- }
663
- if (stream && typeof stream === "object" && Symbol.asyncIterator in stream) {
664
- const readable = new import_node_stream.Readable({
665
- objectMode: true,
666
- read() {
667
- this.push(null);
668
- }
669
- });
670
- return readable;
671
- }
672
- const emptyStream = new import_node_stream.Readable({
673
- read() {
674
- this.push(null);
675
- }
676
- });
677
- return emptyStream;
678
- }),
638
+ // compose: (<T extends NodeJS.ReadableStream>(
639
+ // stream:
640
+ // | T
641
+ // | ((source: unknown) => void)
642
+ // | Iterable<T>
643
+ // | AsyncIterable<T>
644
+ // ): T => {
645
+ // if (stream && typeof stream === 'object' && 'pipe' in stream) {
646
+ // return stream as T;
647
+ // }
648
+ // if (typeof stream === 'function') {
649
+ // const transform = new Transform({
650
+ // objectMode: true,
651
+ // transform(chunk, encoding, callback) {
652
+ // try {
653
+ // (stream as (source: unknown) => void)(chunk);
654
+ // callback(null, chunk);
655
+ // } catch (error) {
656
+ // callback(error as Error);
657
+ // }
658
+ // }
659
+ // });
660
+ // return transform as unknown as T;
661
+ // }
662
+ // if (
663
+ // stream &&
664
+ // typeof stream === 'object' &&
665
+ // Symbol.iterator in stream
666
+ // ) {
667
+ // const iterator = (stream as Iterable<unknown>)[Symbol.iterator]();
668
+ // const first = iterator.next();
669
+ // if (
670
+ // !first.done &&
671
+ // first.value &&
672
+ // typeof first.value === 'object' &&
673
+ // 'pipe' in first.value
674
+ // ) {
675
+ // return first.value as T;
676
+ // }
677
+ // }
678
+ // if (
679
+ // stream &&
680
+ // typeof stream === 'object' &&
681
+ // Symbol.asyncIterator in stream
682
+ // ) {
683
+ // const readable = new Readable({
684
+ // objectMode: true,
685
+ // read() {
686
+ // this.push(null);
687
+ // }
688
+ // });
689
+ // return readable as unknown as T;
690
+ // }
691
+ // const emptyStream = new Readable({
692
+ // read() {
693
+ // this.push(null);
694
+ // }
695
+ // }) as unknown as T;
696
+ // return emptyStream;
697
+ // }) as ExpressResponse['compose'],
679
698
  setTimeout: (msecs, callback) => {
680
699
  setTimeout(callback || (() => {
681
700
  }), msecs);
package/lib/index.mjs CHANGED
@@ -30,7 +30,7 @@ import os from "os";
30
30
  import * as crypto from "crypto";
31
31
  import { EventEmitter } from "events";
32
32
  import * as path from "path";
33
- import { PassThrough, Readable, Transform } from "stream";
33
+ import { PassThrough } from "stream";
34
34
  import RangeParser from "range-parser";
35
35
 
36
36
  // src/cluster/bun.socket.shim.ts
@@ -609,47 +609,66 @@ function serveExpress(app, openTelemetryCollector, opts = {}) {
609
609
  [Symbol.asyncDispose]: async () => {
610
610
  cleanup();
611
611
  },
612
- compose: ((stream) => {
613
- if (stream && typeof stream === "object" && "pipe" in stream) {
614
- return stream;
615
- }
616
- if (typeof stream === "function") {
617
- const transform = new Transform({
618
- objectMode: true,
619
- transform(chunk, encoding, callback) {
620
- try {
621
- stream(chunk);
622
- callback(null, chunk);
623
- } catch (error) {
624
- callback(error);
625
- }
626
- }
627
- });
628
- return transform;
629
- }
630
- if (stream && typeof stream === "object" && Symbol.iterator in stream) {
631
- const iterator = stream[Symbol.iterator]();
632
- const first = iterator.next();
633
- if (!first.done && first.value && typeof first.value === "object" && "pipe" in first.value) {
634
- return first.value;
635
- }
636
- }
637
- if (stream && typeof stream === "object" && Symbol.asyncIterator in stream) {
638
- const readable = new Readable({
639
- objectMode: true,
640
- read() {
641
- this.push(null);
642
- }
643
- });
644
- return readable;
645
- }
646
- const emptyStream = new Readable({
647
- read() {
648
- this.push(null);
649
- }
650
- });
651
- return emptyStream;
652
- }),
612
+ // compose: (<T extends NodeJS.ReadableStream>(
613
+ // stream:
614
+ // | T
615
+ // | ((source: unknown) => void)
616
+ // | Iterable<T>
617
+ // | AsyncIterable<T>
618
+ // ): T => {
619
+ // if (stream && typeof stream === 'object' && 'pipe' in stream) {
620
+ // return stream as T;
621
+ // }
622
+ // if (typeof stream === 'function') {
623
+ // const transform = new Transform({
624
+ // objectMode: true,
625
+ // transform(chunk, encoding, callback) {
626
+ // try {
627
+ // (stream as (source: unknown) => void)(chunk);
628
+ // callback(null, chunk);
629
+ // } catch (error) {
630
+ // callback(error as Error);
631
+ // }
632
+ // }
633
+ // });
634
+ // return transform as unknown as T;
635
+ // }
636
+ // if (
637
+ // stream &&
638
+ // typeof stream === 'object' &&
639
+ // Symbol.iterator in stream
640
+ // ) {
641
+ // const iterator = (stream as Iterable<unknown>)[Symbol.iterator]();
642
+ // const first = iterator.next();
643
+ // if (
644
+ // !first.done &&
645
+ // first.value &&
646
+ // typeof first.value === 'object' &&
647
+ // 'pipe' in first.value
648
+ // ) {
649
+ // return first.value as T;
650
+ // }
651
+ // }
652
+ // if (
653
+ // stream &&
654
+ // typeof stream === 'object' &&
655
+ // Symbol.asyncIterator in stream
656
+ // ) {
657
+ // const readable = new Readable({
658
+ // objectMode: true,
659
+ // read() {
660
+ // this.push(null);
661
+ // }
662
+ // });
663
+ // return readable as unknown as T;
664
+ // }
665
+ // const emptyStream = new Readable({
666
+ // read() {
667
+ // this.push(null);
668
+ // }
669
+ // }) as unknown as T;
670
+ // return emptyStream;
671
+ // }) as ExpressResponse['compose'],
653
672
  setTimeout: (msecs, callback) => {
654
673
  setTimeout(callback || (() => {
655
674
  }), msecs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forklaunch/express",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "Forklaunch framework for express.",
5
5
  "homepage": "https://github.com/forklaunch/forklaunch-js#readme",
6
6
  "bugs": {
@@ -25,21 +25,21 @@
25
25
  "lib/**"
26
26
  ],
27
27
  "dependencies": {
28
- "@forklaunch/fastmcp-fork": "^1.0.5",
29
- "@modelcontextprotocol/sdk": "^1.25.2",
28
+ "@modelcontextprotocol/sdk": "^1.25.3",
30
29
  "@scalar/express-api-reference": "^0.8.34",
31
30
  "@types/multer": "^2.0.0",
32
31
  "body-parser": "^2.2.2",
33
32
  "busboy": "^1.6.0",
34
33
  "cors": "^2.8.5",
35
34
  "express": "^5.2.1",
35
+ "fastmcp": "^3.27.0",
36
36
  "multer": "2.0.2",
37
37
  "qs": "^6.14.1",
38
38
  "range-parser": "^1.2.1",
39
39
  "swagger-ui-express": "^5.0.1",
40
- "@forklaunch/common": "0.6.24",
41
- "@forklaunch/core": "0.17.0",
42
- "@forklaunch/validator": "0.10.24"
40
+ "@forklaunch/core": "0.17.2",
41
+ "@forklaunch/validator": "0.10.26",
42
+ "@forklaunch/common": "0.6.26"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@eslint/js": "^9.39.2",
@@ -50,10 +50,11 @@
50
50
  "@types/express": "^5.0.6",
51
51
  "@types/express-serve-static-core": "^5.1.1",
52
52
  "@types/jest": "^30.0.0",
53
+ "@types/node": "^25.0.9",
53
54
  "@types/qs": "^6.14.0",
54
55
  "@types/range-parser": "^1.2.7",
55
56
  "@types/swagger-ui-express": "^4.1.8",
56
- "@typescript/native-preview": "7.0.0-dev.20260118.1",
57
+ "@typescript/native-preview": "7.0.0-dev.20260120.1",
57
58
  "jest": "^30.2.0",
58
59
  "kill-port-process": "^3.2.1",
59
60
  "prettier": "^3.8.0",
@@ -62,7 +63,7 @@
62
63
  "tsup": "^8.5.1",
63
64
  "typedoc": "^0.28.16",
64
65
  "typescript": "^5.9.3",
65
- "typescript-eslint": "^8.53.0"
66
+ "typescript-eslint": "^8.53.1"
66
67
  },
67
68
  "scripts": {
68
69
  "build": "tsgo --noEmit && tsup index.ts --format cjs,esm --no-splitting --tsconfig tsconfig.json --outDir lib --dts --clean",