@forklaunch/hyper-express 0.9.25 → 0.9.27

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 +15 -0
  2. package/lib/index.mjs +15 -0
  3. package/package.json +10 -10
package/lib/index.js CHANGED
@@ -103,6 +103,7 @@ var import_hyper_express_fork = require("@forklaunch/hyper-express-fork");
103
103
  var import_zod = require("@forklaunch/validator/zod");
104
104
  var import_express_api_reference = require("@scalar/express-api-reference");
105
105
  var import_crypto = __toESM(require("crypto"));
106
+ var import_fs = __toESM(require("fs"));
106
107
 
107
108
  // src/cluster/hyperExpress.cluster.ts
108
109
  var import_node_cluster = __toESM(require("cluster"));
@@ -463,6 +464,20 @@ var Application = class extends import_http13.ForklaunchExpressLikeApplication {
463
464
  this.openapiConfiguration = configurationOptions?.openapi;
464
465
  }
465
466
  async listen(arg0, arg1, arg2) {
467
+ if (process.env.FORKLAUNCH_MODE === "openapi") {
468
+ const openApiSpec = (0, import_http13.generateOpenApiSpecs)(
469
+ this.schemaValidator,
470
+ [],
471
+ [],
472
+ this,
473
+ this.openapiConfiguration
474
+ );
475
+ import_fs.default.writeFileSync(
476
+ process.env.FORKLAUNCH_OPENAPI_OUTPUT,
477
+ JSON.stringify(openApiSpec, null, 2)
478
+ );
479
+ process.exit(0);
480
+ }
466
481
  if (typeof arg0 === "number") {
467
482
  const port = arg0 || Number(process.env.PORT);
468
483
  const protocol = process.env.PROTOCOL || "http";
package/lib/index.mjs CHANGED
@@ -95,6 +95,7 @@ import {
95
95
  import { ZodSchemaValidator } from "@forklaunch/validator/zod";
96
96
  import { apiReference } from "@scalar/express-api-reference";
97
97
  import crypto from "crypto";
98
+ import fs from "fs";
98
99
 
99
100
  // src/cluster/hyperExpress.cluster.ts
100
101
  import cluster from "cluster";
@@ -457,6 +458,20 @@ var Application = class extends ForklaunchExpressLikeApplication {
457
458
  this.openapiConfiguration = configurationOptions?.openapi;
458
459
  }
459
460
  async listen(arg0, arg1, arg2) {
461
+ if (process.env.FORKLAUNCH_MODE === "openapi") {
462
+ const openApiSpec = generateOpenApiSpecs(
463
+ this.schemaValidator,
464
+ [],
465
+ [],
466
+ this,
467
+ this.openapiConfiguration
468
+ );
469
+ fs.writeFileSync(
470
+ process.env.FORKLAUNCH_OPENAPI_OUTPUT,
471
+ JSON.stringify(openApiSpec, null, 2)
472
+ );
473
+ process.exit(0);
474
+ }
460
475
  if (typeof arg0 === "number") {
461
476
  const port = arg0 || Number(process.env.PORT);
462
477
  const protocol = process.env.PROTOCOL || "http";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forklaunch/hyper-express",
3
- "version": "0.9.25",
3
+ "version": "0.9.27",
4
4
  "description": "Forklaunch framework for hyper-express.",
5
5
  "homepage": "https://github.com/forklaunch/forklaunch-js#readme",
6
6
  "bugs": {
@@ -26,17 +26,17 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@forklaunch/hyper-express-fork": "^6.17.35",
29
- "@scalar/express-api-reference": "^0.8.21",
29
+ "@scalar/express-api-reference": "^0.8.22",
30
30
  "cors": "^2.8.5",
31
31
  "live-directory": "^3.0.3",
32
32
  "openapi3-ts": "^4.5.0",
33
33
  "qs": "^6.14.0",
34
- "swagger-ui-dist": "^5.29.3",
34
+ "swagger-ui-dist": "^5.29.4",
35
35
  "swagger-ui-express": "^5.0.1",
36
36
  "uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.52.0",
37
- "@forklaunch/core": "0.15.7",
38
- "@forklaunch/validator": "0.10.18",
39
- "@forklaunch/common": "0.6.18"
37
+ "@forklaunch/common": "0.6.19",
38
+ "@forklaunch/validator": "0.10.19",
39
+ "@forklaunch/core": "0.15.8"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@eslint/js": "^9.37.0",
@@ -46,17 +46,17 @@
46
46
  "@types/qs": "^6.14.0",
47
47
  "@types/swagger-ui-dist": "^3.30.6",
48
48
  "@types/swagger-ui-express": "^4.1.8",
49
- "@typescript/native-preview": "7.0.0-dev.20251008.1",
49
+ "@typescript/native-preview": "7.0.0-dev.20251016.1",
50
50
  "jest": "^30.2.0",
51
51
  "kill-port-process": "^3.2.1",
52
52
  "prettier": "^3.6.2",
53
- "ts-jest": "^29.4.4",
53
+ "ts-jest": "^29.4.5",
54
54
  "ts-node": "^10.9.2",
55
55
  "tsup": "^8.5.0",
56
56
  "tsx": "^4.20.6",
57
- "typedoc": "^0.28.13",
57
+ "typedoc": "^0.28.14",
58
58
  "typescript": "^5.9.3",
59
- "typescript-eslint": "^8.46.0"
59
+ "typescript-eslint": "^8.46.1"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "tsgo --noEmit && tsup index.ts --format cjs,esm --no-splitting --dts --tsconfig tsconfig.json --out-dir lib --clean",